Skip to content

feat(electron): the desktop app gets the Assistant — Claude Code with a face (0406) - #648

Merged
crs48 merged 4 commits into
mainfrom
claude/0406-desktop-ai-panel
Jul 28, 2026
Merged

feat(electron): the desktop app gets the Assistant — Claude Code with a face (0406)#648
crs48 merged 4 commits into
mainfrom
claude/0406-desktop-ai-panel

Conversation

@crs48

@crs48 crs48 commented Jul 28, 2026

Copy link
Copy Markdown
Owner

Continues exploration 0406 (13/33 after this) — and closes the loop this whole arc opened: #638 gave desktop Claude Code the workspace tools; this PR finally gives it a UI.

What this does

Moves the AI chat cluster (AiChatPanel + nine ai-* modules) into @xnetjs/workbench under a new subpath export — @xnetjs/workbench/ai, kept off the core barrel so hosts opt into the brain/WebLLM weight — and mounts it in the desktop shell: an assistant ShellState kind, a system-menu entry, and an Open Assistant palette command, following the settings/stories pattern exactly.

The move was cheap because the cluster was already app-clean (every dependency an @xnetjs package) and the panel was written host-aware from the start: it probes window.xnetAgentBridge and auto-pairs over IPC. It had simply never been mounted on the one surface that has the bridge.

Verified in the running desktop app

  • Zero-setup pairing: bridge tier auto-selected, "Running claude · v3.0.0", pairing code auto-filled over IPC.
  • The tools arrive: asked to create a page, the agent declined, naming xnet_create_page as callable but honoring the read-only tier — 0391's consent posture holding exactly as designed.
  • Real reads: "how many pages titled 'Untitled Page'" → a count plus a genuine node id, verified against the store (exampleIdReal: true; the count was one off exact-title equality, consistent with fuzzy search semantics).

Approval-gated writes from the panel remain the explicit next step (0394 phase 2) — the panel's own header comment says so.

Checks

992 web + 89 workbench + 149 electron tests green; repo-wide typecheck clean; changelog fragment included (user-visible feature).

🤖 Generated with Claude Code

… a face

Moves the AI chat cluster (AiChatPanel + the nine ai-* modules, 0174/0192/
0391) into @xnetjs/workbench under a new subpath export, @xnetjs/workbench/ai
— kept off the core barrel so hosts opt into the brain/WebLLM weight. The
cluster was already app-clean: every dependency is an @xnetjs package, and
the panel was written host-aware from the start — it probes
window.xnetAgentBridge and auto-pairs over IPC. It was simply never mounted
on the surface that has the bridge.

Desktop mounts it as a shell overlay: an 'assistant' ShellState kind, a
system-menu entry, and an "Open Assistant" palette command, following the
settings/stories pattern exactly. Old web paths keep export-* shims.

Verified in the running desktop app, end to end:
- the bridge tier is auto-selected, "Running claude · v3.0.0", pairing code
  auto-filled over IPC — zero setup;
- a real chat turn round-tripped through the claude CLI with the workspace
  tools attached: asked to create a page, the agent correctly declined,
  citing the read-only tier — 0391's consent posture holding, and proof the
  tools arrived;
- the read path answers from real data: "how many pages titled 'Untitled
  Page'" returned a count and a genuine node id (verified against the store;
  the count was one off exact-title equality, consistent with fuzzy search
  semantics, and the id is real).

Approval-gated writes from the panel remain the next step (0394 phase 2) —
the panel says so in its own header comment.

992 web + 89 workbench + 149 electron tests green; typecheck clean.

Signed-off-by: xNet Test <test@xnet.dev>
@crs48
crs48 temporarily deployed to pr-648 July 28, 2026 19:49 — with GitHub Actions Inactive
@crs48
crs48 temporarily deployed to pr-648 July 28, 2026 19:57 — with GitHub Actions Inactive
The AI cluster reaches @xnetjs/vectors, whose native HNSW addon (usearch,
node-gyp-build) cannot be bundled for the renderer — Rollup died on its
node:fs imports. Dev mode never hit it because modules transform lazily.
Same exclusion apps/web already ships: vectors dynamically imports usearch
and falls back to the pure-JS LinearVectorIndex when it is absent.

Signed-off-by: xNet Test <test@xnet.dev>
@crs48
crs48 temporarily deployed to pr-648 July 28, 2026 20:00 — with GitHub Actions Inactive
@github-actions

github-actions Bot commented Jul 28, 2026

Copy link
Copy Markdown
Contributor

🖼️ UI changes in this PR

Components

✏️ Electron/SystemMenu — Docs _(SSIM 0.942)_
before after diff
before after diff

Auto-captured by CI · run. Informational — not a blocking check.

github-actions Bot added a commit that referenced this pull request Jul 28, 2026
github-actions Bot added a commit that referenced this pull request Jul 28, 2026
@github-actions

github-actions Bot commented Jul 28, 2026

Copy link
Copy Markdown
Contributor

Preview removed for PR #648.

github-actions Bot added a commit that referenced this pull request Jul 28, 2026
@crs48
crs48 temporarily deployed to pr-648 July 28, 2026 20:20 — with GitHub Actions Inactive
github-actions Bot added a commit that referenced this pull request Jul 28, 2026
@crs48
crs48 merged commit b68098f into main Jul 28, 2026
22 checks passed
@crs48
crs48 deleted the claude/0406-desktop-ai-panel branch July 28, 2026 20:33
github-actions Bot added a commit that referenced this pull request Jul 28, 2026
crs48 added a commit that referenced this pull request Jul 29, 2026
Every box in exploration 0406 is checked — 23/23 implementation, 10/10
validation — so the filename flips to `[x]`.

The arc, for the record: #641/#642/#644 (port + core extraction), #648
(AI panel on desktop), #650/#651 (chrome behind injection points, first
Electron mount), #652 (desktop surfaces in the shell), #653 (flag
removed, bespoke shell deleted), #655 (cold-open back under the 0.52s
baseline), #656 (approval-gated writes — the last blocked item). The
desktop and web apps now render one shell from one module, verified live
at every step.

🤖 Generated with [Claude Code](https://claude.com/claude-code)
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