Skip to content

feat: add jackin daemon and Desktop Agent Hub#317

Open
donbeave wants to merge 23 commits into
mainfrom
jackin/desktop-attention-routing
Open

feat: add jackin daemon and Desktop Agent Hub#317
donbeave wants to merge 23 commits into
mainfrom
jackin/desktop-attention-routing

Conversation

@donbeave

@donbeave donbeave commented May 11, 2026

Copy link
Copy Markdown
Member

Summary

This consolidates the jackin' daemon and Desktop Agent Hub work into one reviewable PR. It introduces the per-user host daemon with a private Unix socket, versioned daemon/hello handshake, lifecycle/status/log/warm commands, keep-awake/cache/notification foundations, daemon-backed workspace and running-session discovery, per-session repository/branch/linked-PR correlation, GitHub PR lookup endpoints with DiffsHub URLs, Ghostty/browser action endpoints, account credential-source reporting for Claude/Codex/Amp/Kimi/OpenCode, the first event-route contract, and a native macOS SwiftUI/AppKit Desktop shell that consumes those daemon APIs for menu bar health, active project grouping, workspace counts, PR inboxes, account cards, filtered Desktop views, workspace launch/reconnect actions, and branch/PR visibility in Workspaces and Running Agents.

Hard rule / impact callout

The daemon preserves the host-mutation rule: it reads host-side state where needed, but daemon-managed smoothing and command execution stay explicit, scoped, and surfaced through daemon/Desktop contracts. This PR adds host-side daemon lifecycle commands and macOS Desktop code, so reviewers should pay particular attention to socket permissions, launch/control surfaces, and any code path that could mutate host state without an operator-visible action.

What's deferred

  • Real streaming event delivery, jackin-attention MCP enrichment, waiting/blocked attention state, and native Notification Center click activation remain open; event/subscribe currently returns a documented poll/click-route contract.
  • macOS app packaging, signing, notarization, and daemon/app version negotiation beyond daemon/hello remain follow-up work.
  • Account status reports credential-source presence, not provider quota/live usage, reset windows, confidence labels, provider refresh backoff, or repair/login actions; those remain with live auth sync and token/cost telemetry.
  • Capsule-backed live session state remains open; session/list is still label-backed, now enriched with daemon-owned GitHub PR correlation when repository and branch labels are available.
  • Host bridge approval UI and audit timeline remain open with the host bridge roadmap item.

Consolidated PR trail

This PR replaces the narrower stacked PRs so the whole feature can be reviewed and validated together: #283, #306, #307, #308, #310, #311, #312, #313, #314, #315, and #316. Those PRs should stay closed as superseded by this consolidated PR.

Verify locally

Checkout

Paste this first to bypass the tirith paste scanner for the rest of the session:

export TIRITH=0

Then paste the checkout block:

mkdir -p "$HOME/Projects/jackin-project/test/pr-317"
cd "$HOME/Projects/jackin-project/test/pr-317"

if [ ! -d jackin/.git ]; then
  git clone https://github.com/jackin-project/jackin.git
fi

cd jackin
mise trust
git fetch -f origin jackin/desktop-attention-routing:refs/remotes/origin/jackin/desktop-attention-routing
git checkout -B jackin/desktop-attention-routing refs/remotes/origin/jackin/desktop-attention-routing
mise install
cargo build --bin jackin
export PATH="$PWD/target/debug:$PATH"
which jackin

Isolation

export JACKIN_CONFIG_DIR="$HOME/.config/jackin-pr-317"
export JACKIN_HOME_DIR="$HOME/.jackin-pr-317"
rm -rf "$JACKIN_CONFIG_DIR" "$JACKIN_HOME_DIR"
mkdir -p "$JACKIN_CONFIG_DIR" "$JACKIN_HOME_DIR"

Static checks

cargo fmt --check
cargo clippy --lib -- -D warnings

Rust tests

cargo test --lib daemon::tests
cargo test --lib workspace_repo_labels_reads_mounted_workdir_git_state
cargo test --lib load_agent_sets_display_name_label

These tests cover daemon protocol negotiation, Desktop capability exposure, workspace/session discovery, repository branch label derivation from the mounted workspace repo, GitHub PR parsing/filtering, DiffsHub URL derivation, per-session branch-to-PR correlation, Ghostty/browser action contracts, account status caching, event route contracts, macOS notification/script validation, and Docker label stamping.

Docs checks

(
  cd docs
  bun install --frozen-lockfile
  bun run build
  bun run check:repo-links
  bunx tsc --noEmit
  bun test
)

User smoke

jackin daemon restart
jackin daemon status
jackin daemon warm
jackin daemon logs -n 100
jackin console --debug

Expected behavior: daemon status reports version, pid, socket path, capabilities, keep-awake/cache/notification adapter state, and the existing console flow still launches workspaces while new launches stamp workspace repository and branch labels for daemon discovery.

macOS Desktop smoke

cd desktop/macos
swift run JackinDesktop

Expected behavior on macOS with Swift installed: the menu bar item appears, Refresh calls daemon/hello, Desktop shows daemon-backed health/workspace/session/PR/account data, PR rows expose separate GitHub and DiffsHub actions, Projects includes PR-backed and running-session-backed repositories, Workspaces and Running Agents show repository/branch/linked-PR state when detected, Accounts shows daemon-provided credential-source presence and cache freshness for Claude/Codex/Amp/Kimi/OpenCode, and browser/Ghostty actions route through daemon endpoints. Swift validation is host-dependent and may need to run outside Linux CI/agent environments.

Documentation

cd docs
bun install --frozen-lockfile
bun run dev

Astro serves at http://localhost:4321/. Pages to walk:

http://localhost:4321/reference/roadmap/jackin-daemon/
UPDATED roadmap page. Check daemon lifecycle, protocol capabilities, security/host-side effects, session/PR contract, event contract, and phase status against the implemented feature.

http://localhost:4321/reference/roadmap/jackin-desktop-agent-hub/
UPDATED roadmap page. Check the Desktop Agent Hub daemon dependency, menu bar/window slices, filters, workspace/session/account actions, branch/PR visibility, and attention routing notes.

http://localhost:4321/reference/goals/jackin-desktop-agent-hub/
UPDATED goal page. Check that the consolidated implementation path matches the current goal framing.

http://localhost:4321/reference/roadmap/
UPDATED roadmap overview. Check that daemon/Desktop items appear in the correct status sections.

Verification performed on this head

  • PASS: cargo fmt --check
  • PASS: cargo clippy --lib -- -D warnings
  • PASS: cargo test --lib daemon::tests — 26 daemon tests passed.
  • PASS: cargo test --lib workspace_repo_labels_reads_mounted_workdir_git_state — 1 runtime launch-label test passed.
  • PASS: cargo test --lib load_agent_sets_display_name_label — 1 runtime launch-label test passed.
  • PASS: cd docs && bun install --frozen-lockfile
  • PASS: cd docs && bun run build
  • PASS: cd docs && bun run check:repo-links
  • PASS: cd docs && bunx tsc --noEmit
  • PASS: cd docs && bun test — 5 tests passed.
  • BLOCKED: cd desktop/macos && swift --version failed with zsh:1: command not found: swift, so swift run JackinDesktop could not be executed in this environment.

Migration notes

None. The new daemon/Desktop surfaces are additive for pre-release jackin'. New Docker labels are additive on future launches, and existing running containers without those labels still appear through fallback fields.

donbeave and others added 13 commits May 25, 2026 00:45
Signed-off-by: Alexey Zhokhov <alexey@zhokhov.com>
Co-authored-by: Codex <codex@openai.com>
Signed-off-by: Alexey Zhokhov <alexey@zhokhov.com>
Co-authored-by: Codex <codex@openai.com>
Signed-off-by: Alexey Zhokhov <alexey@zhokhov.com>
Co-authored-by: Codex <codex@openai.com>
Signed-off-by: Alexey Zhokhov <alexey@zhokhov.com>
Co-authored-by: Codex <codex@openai.com>
Signed-off-by: Alexey Zhokhov <alexey@zhokhov.com>
Co-authored-by: Codex <codex@openai.com>
Signed-off-by: Alexey Zhokhov <alexey@zhokhov.com>
Co-authored-by: Codex <codex@openai.com>
Signed-off-by: Alexey Zhokhov <alexey@zhokhov.com>
Co-authored-by: Codex <codex@openai.com>
Signed-off-by: Alexey Zhokhov <alexey@zhokhov.com>
Co-authored-by: Codex <codex@openai.com>
Signed-off-by: Alexey Zhokhov <alexey@zhokhov.com>
Co-authored-by: Codex <codex@openai.com>
Signed-off-by: Alexey Zhokhov <alexey@zhokhov.com>
Co-authored-by: Codex <codex@openai.com>
Signed-off-by: Alexey Zhokhov <alexey@zhokhov.com>
Co-authored-by: Codex <codex@openai.com>
Signed-off-by: Alexey Zhokhov <alexey@zhokhov.com>
Co-authored-by: Codex <codex@openai.com>
Signed-off-by: Alexey Zhokhov <alexey@zhokhov.com>
Co-authored-by: Codex <codex@openai.com>
@donbeave donbeave force-pushed the jackin/desktop-attention-routing branch from 320adbe to c70e85a Compare May 25, 2026 01:00
Signed-off-by: Alexey Zhokhov <alexey@zhokhov.com>
Co-authored-by: Codex <codex@openai.com>
@donbeave donbeave force-pushed the jackin/desktop-attention-routing branch from c70e85a to f03a9ba Compare May 25, 2026 01:03
Signed-off-by: Alexey Zhokhov <alexey@zhokhov.com>
Co-authored-by: Codex <codex@openai.com>
donbeave and others added 8 commits May 25, 2026 02:07
Signed-off-by: Alexey Zhokhov <alexey@zhokhov.com>
Co-authored-by: Codex <codex@openai.com>
Signed-off-by: Alexey Zhokhov <alexey@zhokhov.com>
Co-authored-by: Codex <codex@openai.com>
…ion-routing

Signed-off-by: Alexey Zhokhov <alexey@zhokhov.com>
Co-authored-by: Codex <codex@openai.com>

# Conflicts:
#	docs/src/content/docs/reference/goals/jackin-desktop-agent-hub.mdx
#	src/runtime/launch.rs
Refresh the consolidated daemon/Desktop branch against main (63 commits).
Resolve the sole conflict in src/runtime/launch.rs: restore git_repo_name
and is_git_dir helpers in repo_cache.rs (main GC'd them as dead; the
workspace repo/branch label-stamping path is their live consumer) and drop
the unused confirm_repo_removal_interactive import.

Signed-off-by: Alexey Zhokhov <alexey@zhokhov.com>
Co-authored-by: Claude <noreply@anthropic.com>
Strip the host daemon (src/daemon.rs, src/cli/daemon.rs) and the
daemon-coupled macOS menu-bar app (desktop/macos) from the consolidated
Desktop branch. The daemon was built ahead of the product: the actual
target is a CMUX-style native window that embeds libghostty and launches
`jackin load` directly, which needs no daemon for v1. Revert the daemon
wiring (cli/app/lib/paths) and the launch.rs daemon-socket mount plus the
speculative workspace repo/branch label-stamping that only the daemon
consumed. The enrichment plane (PR inbox, account status, session
discovery, notifications) returns in a later PR when the app needs it;
git history preserves the removed implementation.

Signed-off-by: Alexey Zhokhov <alexey@zhokhov.com>
Co-authored-by: Claude <noreply@anthropic.com>
Rewrite the Desktop Agent Hub roadmap item around the actual product: a
native macOS window modeled on CMUX that embeds libghostty terminal
surfaces and a WKWebView browser, with a left sidebar grouping isolated
sessions by workspace and per-space top tabs. Each terminal surface runs
`jackin load` directly, so v1 depends only on the `jackin` CLI; the host
daemon returns later as a pure enrichment plane (PR inbox, account state,
attention routing).

Remove the daemon-era container-to-host notification bridge (jackin-notify
plus its socat dependency in the construct image), and revert the
jackin-daemon and agent-attention-prompts roadmap items to their pristine
"open — design proposal" state now that the consolidated daemon
implementation has been removed. Update the roadmap overview entry to match
the reset.

Signed-off-by: Alexey Zhokhov <alexey@zhokhov.com>
Co-authored-by: Claude <noreply@anthropic.com>
Start the fresh, window-first macOS app called for by the Desktop Agent
Hub design reset. SwiftPM executable (Swift 6, macOS 14+) so it builds and
runs from the terminal during early iteration; .app bundling and signing
come later. Milestone 1 is intentionally minimal: a SwiftUI WindowGroup
with an activation delegate that foregrounds the window under `swift run`.
No sidebar, terminal, or CLI wiring yet — those land as separate
previewable steps.

Signed-off-by: Alexey Zhokhov <alexey@zhokhov.com>
Co-authored-by: Claude <noreply@anthropic.com>
…chor

Tie the design reset back to the original Desktop Agent Hub idea: the goal
(a native operator control surface for what's running, what needs review,
and which accounts are near exhaustion) is unchanged; only the foundation
changed. Frame the original menu-bar + daemon prototype as all chrome with
no terminal, and the CMUX-style embedded-terminal window as the foundation
the original idea was missing. Recast the deferred daemon work as exactly
the original control-surface features, layered on the terminal foundation.

Replace the v1 implementation list with a previewable milestone checklist
that doubles as the in-PR resume anchor (milestone 1 done, awaiting
operator preview), and record the concrete libghostty embedding symbols and
their experimental status in the open questions.

Signed-off-by: Alexey Zhokhov <alexey@zhokhov.com>
Co-authored-by: Claude <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