Repository navigation
Conversation
The port client now answers types() and takes present(key, ...), as the service does in one page. The service pushes each type as data: its identity, title, defaults, which calls it answers (models, usage, provider check and attention action), whether it is hosted, the shape of what it exposes, each exposed store's snapshot, and each keyed read a screen asked for. Its session scope for each shown agent is pushed too. On the screens' side each type is built from that and from what the page presents, through the same merge the service uses. Exposed calls go over the port by path; an AbortSignal argument becomes a stand-in whose abort is sent, so the service's call sees its own signal abort. The service subscribes to the types' own stores, so their changes are pushed, and still pushes before each answer. A type whose handles are not plain is listed but not shown, as in the service's page. Co-authored-by: Larry <627498bd4bd1f281a16431e3c6cce3b5c25b6692798c78672298aefbf2f8f8b5@buzz.block.builderlab.xyz> Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Logan Johnson <loganj@squareup.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.
🤖
Summary
types(). Screens usetypes()for every type-specific part: the create dialog, settings tabs, provider readiness, models in the composer, and usage. A type's screens also reach its runtime through the handles it exposes (refactor(agents): split the Claude harness into runtime and UI #1719 through refactor(agents): give present the exposed handles as another page would #1731).types()and takespresent(key, ...), as the service does when everything runs in one page. Each type is built on the screens' side from data the service pushes and from what the screens' page presents. Exposed stores and keyed reads stay synchronous there, and calls go over the port.Details
features/agents/type-port.ts:serveTypes(agents)describes each type as data: its identity, title and description, itsdefaults(), its migration warning, and whether it is hosted. It also says which calls the type answers (models,usage, providercheckand attention action) and gives the shape of itsexpose. With each push it reads every exposed store's snapshot, the provider snapshot, each keyed read a screen asked for, and each shown agent's session scope.typesClient(...)builds anAgentTypeViewfrom a descriptor. The screens' page's presentation is merged through the service's ownpresented(), and the result is cached, so a type keeps its identity while its stores change. Exposed handles become a proxy:snapshotreads the pushed value;subscribeis the client's change notice;read(key)asks the service for that key once, and answersemptyuntil the key arrives;AbortSignalargument crosses as a stand-in. Its abort is sent over the port, and the service aborts a signal of its own, so a screen that stops a transcript read stops it in the service.exposeis not plain handles is listed but not shown, and the error is logged. This matches refactor(agents): give present the exposed handles as another page would #1731 in the service's page.port.ts:type(a call),watch(a keyed read) andabort.AgentsPortClientnow hastypesandpresent.sessionStateandpreviewRetypestay out of the client; they come next.Testing
port.test.tscases, over a realMessageChannel(structured clone):modelswork, and the type keeps its identity.service.test.ts: over the real service, the client lists the same types with the same defaults.tsc --noEmitpasses. The agents, Agents page and huddle suites pass (986 tests), except the Agents page avatar-picker test, which also fails on the base branch in this worktree (itsnode_modulesis a symlink).🤖 Generated with Claude Code