Skip to content

Local-server mode + macOS support (auto-detected) — builds on #28#31

Open
kylecarbonneau wants to merge 1 commit into
taskyou:feat/channels-integrationfrom
kylecarbonneau:pr/local-mode-macos
Open

Local-server mode + macOS support (auto-detected) — builds on #28#31
kylecarbonneau wants to merge 1 commit into
taskyou:feat/channels-integrationfrom
kylecarbonneau:pr/local-mode-macos

Conversation

@kylecarbonneau
Copy link
Copy Markdown

Builds on #28 (feat/channels-integration) — this PR is stacked on that branch, so the diff here is just these additions (3 files, +148/−13). Happy to fold them in as commits on #28 directly instead if you'd prefer; once #28 lands on main I'll retarget this to main.

Summary

#28 adds the push-based task-event channel, built for a remote Linux server reached over SSH. This makes the same channel also work when the GM runs on the same machine as the daemon — including macOS — auto-detected, with the remote-Linux/SSH flow left fully intact. Everything is additive; nothing existing is removed.

What changed

1. Channel local mode

templates/channel/taskyou-channel.ts.tmplrunRemote() gains a LOCAL branch: when SERVER_HOST is local / localhost / empty (IS_LOCAL), commands run via bash -lc directly on this machine (no SSH). Otherwise the original SSH path runs unchanged. ~/.local/bin is prepended to PATH and we cd into SERVER_HOME, mirroring the remote path.

2. Cross-platform hooks directory

setup.sh — the hooks dir was hardcoded to ~/.config/task/hooks, but ty's hooks.DefaultHooksDir() follows Go's os.UserConfigDir():

OS hooks dir
Linux ~/.config/task/hooks
macOS ~/Library/Application Support/task/hooks

A resolve_hooks_dir helper detects the OS via uname -s and picks the right path. Linux installs are byte-identical; macOS installs now land where the daemon actually looks (previously, hooks placed in ~/.config on a Mac silently never fired).

3. Local-server setup mode

setup.shsetup_server() detects a local server (SERVER_HOST local/localhost/empty) and delegates to a new setup_server_local() that configures git identity, registers project repos with ty locally, installs hooks to the OS-correct dir, creates notifications.jsonl, and skips SSH provisioning + the systemd service (GM and daemon share the box). The remote-Linux (setup_server) and exe.dev (setup_exe_dev) paths are untouched aside from adopting the OS-aware hooks dir.

Plus config.example.env documents SERVER_HOST=local.

Testing (macOS)

  • Rendered channel template compiles — bun build bundles cleanly and tsc --noEmit --strict is clean; the repo's own smoke-test.ts passes against the local render.
  • The local bash -lc runner drives ty commands without SSH.
  • Hooks install to ~/Library/Application Support/task/hooks and fire on task events.
  • Events surface in the GM session via the channel.
  • Remote-Linux/SSH path unchanged (additive else branches only — near-zero deletions).

Compatibility

Fully backward-compatible. Existing remote-Linux deployments behave exactly as before; the new behavior only engages when SERVER_HOST is local/localhost/empty or the target OS is macOS.

PR taskyou#28 assumes a remote Linux server reached over SSH. These additive
changes let the GM run on the same machine as the TaskYou daemon
(including macOS) with zero change to the existing remote-Linux flow:

- channel: runRemote() gains a LOCAL branch (bash -lc, no SSH) when
  SERVER_HOST is local/localhost/empty; the SSH path is unchanged.
- setup.sh: OS-detect the hooks dir to match ty's os.UserConfigDir()
  (Linux ~/.config/task/hooks vs macOS ~/Library/Application Support/
  task/hooks). The hardcoded ~/.config path silently misfired on macOS.
- setup.sh: a local-server provisioning path that skips SSH/systemd
  when the daemon runs on this same box; remote-Linux/systemd intact.
- config.example.env: document SERVER_HOST=local.

Both paths are auto-detected; no existing behavior is removed.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant