Repository navigation
chat: build for the web; a client can hold its own history - #22
Open
fizzy-linux[bot] wants to merge 1 commit into
Open
fizzy-linux[bot] wants to merge 1 commit into
fizzy-linux[bot] wants to merge 1 commit into
Conversation
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>
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.
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 whenbuiltin.os.tag != .freestanding.src/api.zig,src/Commands.zig:Register.history(.chatdefault,.client), kept per client;clientKeeps(id). Additive: an older client omits the field.src/store.zig(new, std-only): the transcript write moved out ofChat.write; writes nothing for.client(no transcript, images or folders), and nothing on the web.imagesDirmoved here.src/Chat.zig:writegoes through the store;fromPathand attachments need no disk on the web.src/Explorer.zig:newPathmakes no file or folder for a.clientchat (and needs no config folder); no disk scan ordeleteFile/deleteTreeon 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 inzig 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 insrc/store.zig: a.clientchat writes no file or folder, a.chatone writes its transcript and images.zig build(native): installs chat.so.web_plugin_dirspointing 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
host.openFileon a path with no file (a.clientchat) is untested; a client that holds history should check it on web, and may need to supply the chat's loaded window itself..clientchat still shows up in the list only through its client (no scan).APPROACHcomment 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