Skip to content

chat: build for the web; a client can hold its own history - #22

Open
fizzy-linux[bot] wants to merge 1 commit into
mainfrom
linux/work-531
Open

fizzy-linux[bot] wants to merge 1 commit into
mainfrom
linux/work-531

Conversation

@fizzy-linux

@fizzy-linux fizzy-linux Bot commented Oct 29, 2026

Copy link
Copy Markdown

In plain words

The chat can now run in a browser, not only on a desktop. A program that keeps its own conversations can tell the chat to hold them itself, so the chat stops saving them as files on the person's machine.

What you will notice

Nothing visible on desktop: internal. In the web build the chat now loads (agents over ACP stay desktop-only).

How this serves fizzy

Goal: the console uses the shared chat plugin on every platform, phone first. Result: one chat for desktop, web and mobile.

Goal

Make the plugin build for the web (wasm) so the console can link it (fizzyedit/work#531, plans#99 section 3).

What changed and why

What failed to compile for wasm32-freestanding, and the fix per file:

  • plugin.zig: AcpClient (process spawn, threads) is imported and registered only when builtin.os.tag != .freestanding.
  • src/api.zig, src/Commands.zig: Register.history (.chat default, .client), kept per client; clientKeeps(id). Additive: an older client omits the field.
  • src/store.zig (new, std-only): the transcript write moved out of Chat.write; writes nothing for .client (no transcript, images or folders), and nothing on the web. imagesDir moved here.
  • src/Chat.zig: write goes through the store; fromPath and attachments need no disk on the web.
  • src/Explorer.zig: newPath makes no file or folder for a .client chat (and needs no config folder); no disk scan or deleteFile/deleteTree on the web.
  • src/Commands.zig, src/Transcript.zig: path-based image/attach reads and image file writes are compiled out on the web (an image must arrive as bytes there).
  • build.zig: the store test is in zig build test.

How it was verified

  • zig fmt --check build.zig plugin.zig src: clean.
  • zig build test --summary all: "13/13 steps succeeded; 34/35 tests passed (1 skipped)" (the skip was already there). New test in src/store.zig: a .client chat writes no file or folder, a .chat one writes its transcript and images.
  • zig build (native): installs chat.so.
  • Web: fizzy origin/main (33cc6c2d) with web_plugin_dirs pointing at this branch, scripts/zb build web: succeeds and links (3 compile errors at the start, fixed in turn). Local-only change to fizzy's build.zig, not pushed.

Not done / follow-ups

  • Still native-only: ACP/agents (AcpClient, Agent), the chats folder listing, attaching files by path, deleting a chat's files.
  • Not run in a browser: the web build only compiles and links. host.openFile on a path with no file (a .client chat) is untested; a client that holds history should check it on web, and may need to supply the chat's loaded window itself.
  • Not enforced: a .client chat still shows up in the list only through its client (no scan).
  • No APPROACH comment was posted before building; the change is under the 200-line threshold of docs/AGENT_WORK.md in substance (~150 lines).

Part of fizzyedit/work#531

The plugin now compiles and links in fizzy's wasm32 web build. ACP (a process on
a thread) is registered on native targets only. chat.register takes
`history = .chat | .client`; for `.client` the chat keeps only the window it has
loaded and writes no transcript, image or folder.

Agent-Team: linux
Worker: claude

Co-Authored-By: Claude Sonnet 5.5 <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.

0 participants