feat(electron): the desktop app gets the Assistant — Claude Code with a face (0406) - #648
Merged
Conversation
… 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>
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>
Contributor
🖼️ UI changes in this PRComponentsAuto-captured by CI · run. Informational — not a blocking check. |
Contributor
|
Preview removed for PR #648. |
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)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



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+ nineai-*modules) into@xnetjs/workbenchunder 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: anassistantShellStatekind, 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
@xnetjspackage) and the panel was written host-aware from the start: it probeswindow.xnetAgentBridgeand auto-pairs over IPC. It had simply never been mounted on the one surface that has the bridge.Verified in the running desktop app
xnet_create_pageas callable but honoring the read-only tier — 0391's consent posture holding exactly as designed.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