| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Name | Name | Last commit date | ||
|---|---|---|---|---|
The host-agnostic bridge client for the Plannotator agent dispatch protocol. It is the shared core under every adapter that connects a coding agent to an Artifact Server (or any server implementing the protocol): review comments dispatched from the web UI arrive in the agent's session as follow-up work, and the agent's replies close the loop.
The protocol itself is documented in PROTOCOL.md.
An adapter supplies a HostPort — three functions — and gets everything above:
import {startBridge, resolveBridgeCredentials} from "@plannotator/agent-bridge";
const credentials = await resolveBridgeCredentials(environment, homedir());
const bridge = startBridge({
agentSessionId: null,
credentials,
displayName: "my-project",
fetchImplementation: fetch,
host: {
isCompacting: () => false,
notify: (message, kind) => { /* surface a notice in your host */ },
sendUserMessage: async (text) => { /* await host admission */ },
},
hostname: hostname(),
kind: "my-harness",
workingDirectory: process.cwd(),
});Reference adapters live in the Artifact Server repository under integrations/: the Pi extension, the OpenCode plugin, and the Claude Code channel — each ~250 lines over this core.
sendUserMessage may return void for a synchronous host or a promise for an asynchronous host. Resolve that promise only after the host admits the message. Rejecting it fails that dispatch and leaves the bridge available for later work. Reserve a synchronous throw for an invalid host handle that requires the claim loop to stop.
renderBundleMessage(bundle) defaults to the native/channel instruction that names artifact_comments. Pass "mailbox" as its second argument when the receiving agent instead has the MCP comment_reply and comment_resolve tools. Both profiles use the same sanitization and message structure.
The package exports index.ts directly. Every current host loads TypeScript natively (Pi via jiti, OpenCode via Bun, channel processes via tsx); a compiled distribution can be added when a consumer needs one.
The protocol's conformance suite (BRP/PRS requirement IDs) runs in the Artifact Server repository against a real server, with this package as the client under test.
MIT
| Back | FazBrowse Home | New Git URL |