@creatornader/agent-bridge 0.3.0 → 0.3.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
  # Agent Bridge v2 architecture
2
2
 
3
- Status: living architecture for the 0.3.0 development line. Version 0.2.0 was released on July 14, 2026.
3
+ Status: living architecture. Version 0.3.0 was released on July 15, 2026.
4
4
 
5
5
  ## Product boundary
6
6
 
@@ -13,12 +13,14 @@ These authorization guarantees apply to local v2 and the authenticated gateway.
13
13
  - Local mode runs without an account or network connection.
14
14
  - Shared mode uses a remote service so agents on different machines see the same history and delivery state.
15
15
 
16
- The protocol must support informational context and executable work without treating them as the same thing. A2A and application task semantics sit above Agent Bridge. MCP, CLI, and HTTPS are access surfaces. Optional transports may sit below the core, but they cannot replace authoritative cursor replay or durable delivery state.
16
+ The protocol must support informational context and executable work without treating them as the same thing. A2A and application task semantics sit above Agent Bridge. MCP, CLI, HTTPS, and the Node library are access surfaces. Agent harnesses and host applications use those surfaces through host adapters or direct integration. Optional transports may sit below the core, but they cannot replace authoritative cursor replay or durable delivery state.
17
17
 
18
18
  [ADR-0001](decisions/0001-protocol-layers-and-acknowledgment-semantics.md) defines these layers and the distinct meanings of receipts, claims, leases, delivery settlement, and external task completion.
19
19
 
20
20
  [ADR-0002](decisions/0002-canonical-operation-contract-registry.md) defines the canonical cross-surface operation contract, deterministic artifacts, capability discovery, and protocol negotiation.
21
21
 
22
+ [ADR-0003](decisions/0003-host-adapters-and-consumer-instance-keys.md) separates harnesses, hosts, adapters, and access surfaces and defines the consumer instance-key contract.
23
+
22
24
  ## Decisions
23
25
 
24
26
  ### PostgreSQL is the shared source of truth
@@ -179,7 +181,7 @@ Migration 010 uses `nack_retry` as a conservative compatibility mapping for a le
179
181
 
180
182
  A receipt does not change delivery state. A claim or settlement does not create a receipt. Lease renewal proves only that the current owner retained its claim. External task completion belongs to A2A or the application layer and must be recorded separately when a workflow needs both task state and delivery settlement.
181
183
 
182
- Each delivery transition also appends an audit event. Runtime presence uses a separate leased record keyed by workspace, agent, and instance. Presence can carry a runtime type and declared capabilities without using a PID as ownership proof. Expired rows are pruned during normal presence operations. Each agent is limited to 128 active instances, and each workspace is limited to 4,096.
184
+ Each delivery transition also appends an audit event. Instance presence uses a separate leased record keyed by workspace, principal, and caller-supplied instance key. Presence requires that key and can carry a host or harness type and declared capabilities. Supported installers generate and persist a stable key for each installed client. Direct clients that use presence must provide a stable key for each intended consumer. Processes that share a key also share its presence row. The gateway does not bind the key to an installer registration, and the row does not identify a unique live process or PID. Expired rows are pruned during normal presence operations. Each principal is limited to 128 active instance keys, and each workspace is limited to 4,096.
183
185
 
184
186
  The system promises at-least-once delivery. It does not promise exactly-once execution. Idempotency keys prevent duplicate insertion, and consumers must make side effects idempotent.
185
187
 
@@ -217,14 +219,26 @@ The identity model separates:
217
219
  - Workspace.
218
220
  - Agent principal.
219
221
  - Human-readable name.
220
- - Runtime type.
221
- - Client instance.
222
- - Session or thread.
222
+ - Host adapter and harness type.
223
+ - Consumer instance key.
224
+ - Live process identity, which the released protocol does not represent separately.
225
+ - Session or thread context.
223
226
  - Optional role.
224
227
  - Authentication subject and credential.
225
228
 
226
229
  Remote credentials bind the workspace and principal. Each installed client gets a separate owner-only backend file containing only its bound token and backend settings. The shared config does not hold a gateway token. A client cannot claim another source label. Local mode binds identity through its process configuration. `AGENT_BRIDGE_AGENT` remains the compatibility field for MCP and CLI clients.
227
230
 
231
+ `AGENT_BRIDGE_INSTANCE` is an optional caller-supplied stable consumer key. Unless
232
+ `AGENT_BRIDGE_CURSOR` sets an explicit path, the instance key selects cursor storage.
233
+ The key also selects delivery lease ownership and instance presence. Supported
234
+ installers generate and persist it; direct clients may manage it themselves. When the
235
+ key and explicit cursor path are both omitted, cursor storage uses the `default` path
236
+ component. Delivery lease ownership falls back to the principal, and presence is
237
+ unavailable. The gateway does not treat the key as registered authority. It is not a
238
+ PID, conversation, or session identifier. A future per-process presence feature must
239
+ add a separate identity instead of changing the meaning of `instance` and invalidating
240
+ existing cursor or lease ownership.
241
+
228
242
  ### The core is provider-neutral
229
243
 
230
244
  Protocol logic depends on a `BridgeStore` interface, not a provider SDK. The initial stores are:
@@ -234,7 +248,7 @@ Protocol logic depends on a `BridgeStore` interface, not a provider SDK. The ini
234
248
  - Supabase legacy REST for v1 compatibility during migration.
235
249
  - Agent Bridge HTTP API for normal remote clients.
236
250
 
237
- Runtime and wakeup adapters are independent from storage. A client manifest declares identity injection, supported wake modes, config locations, health checks, and install actions for Codex, Claude Code, Claude Desktop, OpenClaw, or a generic MCP client.
251
+ Host and wakeup adapters are independent from storage. A client manifest declares identity injection, supported wake modes, config locations, health checks, and install actions for Codex, Claude Code, Claude Desktop, OpenClaw, or a generic MCP client. The v1 manifest key named `runtime` identifies an installation target for compatibility. It does not identify a unique running process. The `codex` adapter configures the profile shared by the Codex CLI and the Codex surface in the ChatGPT desktop app. Scripts, CI jobs, daemons, and application services may instead call the CLI or HTTPS API or embed the Node library without pretending to be a harness adapter.
238
252
 
239
253
  ### v1 compatibility is additive
240
254
 
@@ -332,6 +346,11 @@ source, a tag-to-version check, and npm provenance. The npm environment does not
332
346
  currently require a human reviewer, so the release process must not claim a manual
333
347
  approval gate.
334
348
 
349
+ GitHub immutable releases are enabled, and GitHub reports release `v0.3.0` as
350
+ immutable. A tag ruleset also blocks update and deletion of `v*` tags with no bypass
351
+ actor. Future recovery dispatches must run the workflow at the release tag ref so the
352
+ provenance workflow identity and checked-out source commit do not diverge.
353
+
335
354
  ## Acceptance checks
336
355
 
337
356
  The TypeBox 1.x registry validates closed requests before domain semantics. Response schemas require known fields and accept additive properties. MCP and HTTP 2.1 claim and delivery-control results use object envelopes with nullable `delivery` fields. HTTP 2.0 and the unversioned CLI keep their released direct or null shapes.
@@ -30,7 +30,7 @@ Its protocol owns:
30
30
  The surrounding layers have separate responsibilities:
31
31
 
32
32
  - A2A and application protocols sit above Agent Bridge. They own task, conversation, artifact, and domain lifecycle semantics.
33
- - MCP, CLI, and HTTPS are client access surfaces. They expose Agent Bridge operations without defining its stored protocol.
33
+ - MCP, CLI, HTTPS, and the Node library are access surfaces. They expose Agent Bridge operations without defining its stored protocol.
34
34
  - Optional transports such as SLIM or NATS may sit below the core as wakeup or transport adapters. They must not replace authoritative cursor replay or durable delivery state.
35
35
  - agmsg is a reference for adapters, interoperability, and client experience. Its patterns may inform clients, but it does not define Agent Bridge identity, persistence, or delivery semantics.
36
36
 
@@ -60,7 +60,7 @@ Read receipts and delivery settlement remain independent in both directions. Rec
60
60
 
61
61
  Agent Bridge can carry A2A messages without implementing the A2A task state machine. A client that needs both task completion and delivery settlement must record both operations explicitly.
62
62
 
63
- MCP remains replaceable by another access adapter. A transport integration must preserve cursors, idempotency, identity binding, and delivery leases.
63
+ MCP remains replaceable by another access surface. A host or transport integration must preserve cursors, idempotency, identity binding, and delivery leases.
64
64
 
65
65
  Push notifications and future brokers can reduce wakeup latency. Pull and replay remain the recovery path.
66
66
 
@@ -0,0 +1,88 @@
1
+ # ADR-0003: Separate host adapters from consumer instance keys
2
+
3
+ ## Status
4
+
5
+ Accepted
6
+
7
+ ## Date
8
+
9
+ 2026-07-15
10
+
11
+ ## Context
12
+
13
+ Agent products often combine an agent harness with a host application. Codex runs in
14
+ the Codex CLI and in the Codex surface of the ChatGPT desktop app. Claude Code and
15
+ Claude Desktop are separate hosts. OpenClaw, Hermes, Pi, scripts, CI jobs, and services
16
+ have different host and access options.
17
+
18
+ The released protocol also uses `AGENT_BRIDGE_INSTANCE` in several places. Supported
19
+ installers generate one value for each installed client, but the gateway accepts the
20
+ value from the caller. Calling it a registered process identity would promise an
21
+ authority check that the server does not perform.
22
+
23
+ ## Decision
24
+
25
+ The integration model separates these concepts:
26
+
27
+ - A harness runs an agent loop.
28
+ - A host is a CLI, desktop application, daemon, job, or service that contains a
29
+ harness or calls Agent Bridge.
30
+ - A host adapter configures a host to use Agent Bridge.
31
+ - MCP over stdio, the CLI, the HTTPS API, and the Node library are access surfaces.
32
+ - Scripts, CI jobs, and services may use an access surface directly without becoming
33
+ agent harnesses.
34
+
35
+ The `codex` adapter configures the profile shared by the Codex CLI and the Codex
36
+ surface in the ChatGPT desktop app. Claude Code and Claude Desktop have separate
37
+ adapters. Their supported installation flows create separate host registrations and
38
+ instance keys. OpenClaw and generic MCP manifests are operator-managed. Hermes, Pi,
39
+ and other harnesses have no dedicated compatibility or conformance claim until an
40
+ adapter is tested.
41
+
42
+ `AGENT_BRIDGE_INSTANCE` is an optional caller-supplied stable consumer key. Supported
43
+ installers generate and persist one for each installed client. Direct clients should
44
+ generate and persist a value when they need separate consumer state or presence. The
45
+ gateway does not bind the value to an installer registration.
46
+
47
+ Unless `AGENT_BRIDGE_CURSOR` sets an explicit path, a present instance key selects
48
+ cursor storage. The key also selects delivery lease ownership and presence. Processes
49
+ that share one key also share those resources. When the key and explicit cursor path
50
+ are both absent, cursor storage uses the `default` path component. Delivery ownership
51
+ falls back to the principal, and presence is unavailable. The key is not a PID,
52
+ live-process identity, session, or conversation. Per-process presence requires a
53
+ separate additive identity.
54
+
55
+ The v1 client manifest key named `runtime` remains a compatibility field for the host
56
+ installation target. A future manifest version may rename it without changing the
57
+ meaning of `AGENT_BRIDGE_INSTANCE`.
58
+
59
+ ## Consequences
60
+
61
+ The architecture diagram and compatibility matrix can list desktop apps, CLIs,
62
+ daemons, and direct callers without presenting them as one category.
63
+
64
+ Installer-generated keys work without a new protocol field. Direct client authors who
65
+ use a key are responsible for stable storage and uniqueness within a principal. Reusing
66
+ a key intentionally creates one shared delivery consumer and presence identity.
67
+
68
+ The current gateway does not prevent two callers from choosing the same key. Clients
69
+ must not treat an instance value as proof of process identity or server registration.
70
+
71
+ ## Alternatives considered
72
+
73
+ ### Treat the adapter name as the harness identity
74
+
75
+ Rejected because one adapter may configure more than one host surface. The `codex`
76
+ adapter is the current example.
77
+
78
+ ### Treat every live process as an instance
79
+
80
+ Rejected because the released instance key already selects cursor paths, lease
81
+ ownership, and presence. Changing it on every process start would alter consumer
82
+ ownership and strand existing state.
83
+
84
+ ### Bind instance keys to server-side registrations now
85
+
86
+ Deferred. Binding could prevent accidental key collisions, but it needs a migration,
87
+ credential rules, and direct-client enrollment semantics. The current gateway accepts
88
+ the caller-supplied key and must be documented honestly.
package/docs/ecosystem.md CHANGED
@@ -9,16 +9,48 @@ full agent stack.
9
9
 
10
10
  | Layer | Examples | Relationship to Agent Bridge |
11
11
  | --- | --- | --- |
12
- | Tool and context access | MCP | Agent Bridge exposes MCP tools. MCP does not define Agent Bridge's stored message or delivery protocol. |
12
+ | Tool and context access | MCP, CLI, HTTPS, Node library | These surfaces expose Agent Bridge operations. They do not define its stored message or delivery protocol. |
13
13
  | Agent task semantics | A2A and application protocols | These systems own tasks, artifacts, status, and domain completion. Agent Bridge can carry their identifiers and payloads. |
14
14
  | Durable mailbox | Agent Bridge | Agent Bridge owns cursored history, receipts, work claims, leases, retry state, and offline replay. |
15
15
  | Live transport and brokers | SLIM, NATS, RabbitMQ, Kafka | A future adapter may use one of these systems for transport or wakeups. Cursored pull remains the recovery path. |
16
- | Agent execution | LangGraph, AutoGen, agent-loop, hosted agent platforms | These systems decide what runs and how workflows advance. Agent Bridge carries messages between them. |
16
+ | Agent execution | Codex, Claude Code, OpenClaw, Hermes, Pi, LangGraph, AutoGen, agent-loop | These harnesses decide what runs and how workflows advance. Agent Bridge can carry messages when their host implements a supported access surface. |
17
17
  | Local operator experience | agmsg and similar tools | These tools may provide terminal placement, agent spawning, roles, and local coordination. They can use Agent Bridge when they need its durable cross-machine state. |
18
18
 
19
19
  [ADR-0001](decisions/0001-protocol-layers-and-acknowledgment-semantics.md)
20
20
  defines the protocol boundary and the separate meanings of read receipts, delivery
21
21
  settlement, and external task completion.
22
+ [ADR-0003](decisions/0003-host-adapters-and-consumer-instance-keys.md) defines
23
+ the host layers and consumer instance-key contract.
24
+
25
+ ## Harnesses, hosts, adapters, and access
26
+
27
+ Agent Bridge keeps four integration concepts separate:
28
+
29
+ - A harness runs an agent loop, such as Codex, Claude Code, OpenClaw, Hermes, or Pi.
30
+ - A host is the CLI, desktop application, daemon, CI job, or service that contains the
31
+ harness or invokes Agent Bridge.
32
+ - A host adapter configures that host to use Agent Bridge.
33
+ - An access surface is MCP over stdio, the CLI, the HTTPS API, or the Node library.
34
+
35
+ This distinction matters when one profile serves more than one host surface. The
36
+ `codex` adapter configures the profile shared by the Codex CLI and the Codex surface
37
+ in the ChatGPT desktop app. It does not create two independent Agent Bridge
38
+ registrations. Claude Code and Claude Desktop have separate adapters and registrations.
39
+
40
+ | Adapter or integration | Host coverage | Access | Support level |
41
+ | --- | --- | --- | --- |
42
+ | `codex` | Codex CLI and Codex in the ChatGPT desktop app | MCP stdio | Automated install |
43
+ | `claude-code` | Claude Code CLI | MCP stdio | Automated install |
44
+ | `claude-desktop` | Claude Desktop | MCP stdio | Automated install |
45
+ | `openclaw` | OpenClaw daemon or host | MCP stdio | Manifest included; operator-managed |
46
+ | `generic-mcp` | Any compatible MCP host | MCP stdio | Manifest included; operator-managed |
47
+ | Direct integration | Scripts, CI, daemons, and services | CLI, HTTPS, or Node library | No host adapter required |
48
+ | Generic harness integration | Hermes, Pi, and other harnesses | Any access surface their host supports | No dedicated adapter or conformance claim yet |
49
+
50
+ Scripts are orthogonal to harnesses. A script may start a harness, invoke the CLI,
51
+ call the HTTPS API, or embed the Node library. It is not a separate agent category.
52
+ The MCP server currently uses stdio. The gateway exposes the Agent Bridge HTTPS
53
+ protocol, not MCP over HTTP.
22
54
 
23
55
  ## Relationship to agmsg
24
56
 
@@ -49,6 +81,6 @@ vendors without forcing every participant into the same runtime or deployment st
49
81
  ## Interoperability direction
50
82
 
51
83
  The next interoperability work is tracked in [ROADMAP.md](../ROADMAP.md). Planned
52
- surfaces include an agmsg adapter, a thin A2A envelope mapping, runtime conformance
84
+ surfaces include an agmsg adapter, a thin A2A envelope mapping, host-adapter conformance
53
85
  fixtures, and client libraries. Each integration must retain caller-bound identity,
54
86
  idempotent publication, cursored replay, and at-least-once delivery semantics.
package/llms.txt CHANGED
@@ -16,6 +16,11 @@ If an MCP client cannot attach, run `agent-bridge doctor --json` and see
16
16
  `docs/troubleshooting.md`. Normal client installation resolves the MCP launch command;
17
17
  do not copy another runtime's identity or backend file.
18
18
 
19
+ The `codex` host adapter configures the profile shared by the Codex CLI and the Codex
20
+ surface in the ChatGPT desktop app. Claude Code and Claude Desktop use separate
21
+ adapters. OpenClaw and generic MCP manifests are operator-managed. Scripts and
22
+ services can call the CLI or HTTPS API or embed the Node library without a host adapter.
23
+
19
24
  ## Modes
20
25
 
21
26
  - local: SQLite WAL, no account or daemon
@@ -24,6 +29,7 @@ do not copy another runtime's identity or backend file.
24
29
 
25
30
  ## Commands
26
31
 
32
+ - `agent-bridge --version` or `agent-bridge -V`: print the installed package version without loading backend configuration.
27
33
  - `agent-bridge capabilities`: print the canonical v2 operation and protocol capability document.
28
34
 
29
35
  - agent-bridge init --provider local
@@ -84,7 +90,9 @@ Gateway MCP clients sync automatically and expose manual sync for bounded outbox
84
90
  ## Protocol boundary
85
91
 
86
92
  A2A and application task semantics sit above Agent Bridge.
87
- MCP, CLI, and HTTPS are client access surfaces.
93
+ MCP, CLI, HTTPS, and the Node library are access surfaces.
94
+ Harnesses, host applications, host adapters, and access surfaces are separate layers.
95
+ The MCP server uses stdio. The gateway HTTPS API is not MCP over HTTP.
88
96
  Optional transports such as SLIM or NATS may sit below the core.
89
97
  agmsg is a reference for adapters, interoperability, and client experience.
90
98
  HTTP protocol 2.1 is current. Upgraded gateways continue to serve released headerless and explicit 2.0 clients. New 2.1 clients probe before mutation and proceed only after complete, consistent negotiation selects and advertises 2.1. They reject headerless or selected 2.0 gateways instead of downgrading. Upgrade the gateway before 2.1 clients. Capabilities distinguish current, selected, and supported versions.
@@ -100,7 +108,7 @@ Lease extension does not report progress or external task completion.
100
108
 
101
109
  ## Identity rule
102
110
 
103
- The active runtime supplies AGENT_BRIDGE_AGENT and AGENT_BRIDGE_INSTANCE. Do not hardcode another client name and do not store agent identity in the shared backend config. Gateway installations use a separate principal-bound token and owner-only backend file for each client.
111
+ The active client supplies AGENT_BRIDGE_AGENT and may supply a stable AGENT_BRIDGE_INSTANCE consumer key. Do not hardcode another client name and do not store agent identity in the shared backend config. Gateway installations use a separate principal-bound token and owner-only backend file for each client. Supported installers generate and persist the instance key; direct clients may do so when they need separate consumer state or presence. The gateway does not bind it to an installer registration. It is not a PID, unique live process, session, or thread. Unless AGENT_BRIDGE_CURSOR is explicit, processes that share one key also share its cursor path. They also share delivery lease ownership and instance-keyed presence. Without a key or explicit cursor path, cursor storage uses `default`. Leases use the principal, and presence is unavailable.
104
112
 
105
113
  Owner commands are offline and use only AGENT_BRIDGE_OPERATOR_DATABASE_URL. They are
106
114
  not MCP, HTTP, or public gateway operations. Provision and rotation write private
@@ -126,6 +134,7 @@ Local CLI calls may override workspace for one invocation. The legacy Supabase s
126
134
  - docs/troubleshooting.md: MCP startup and client recovery
127
135
  - docs/decisions/0001-protocol-layers-and-acknowledgment-semantics.md: protocol layers and acknowledgment semantics
128
136
  - docs/decisions/0002-canonical-operation-contract-registry.md: generated contracts and version negotiation
137
+ - docs/decisions/0003-host-adapters-and-consumer-instance-keys.md: host layers and instance-key semantics
129
138
  - docs/architecture-v2.md: protocol, storage, identity, delivery, and acceptance decisions
130
- - clients/*.json: runtime adapter manifests
139
+ - clients/*.json: v1 host-adapter manifests; `runtime` is the compatibility key for the installation target
131
140
  - SKILL.md: concise agent operating instructions
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@creatornader/agent-bridge",
3
- "version": "0.3.0",
3
+ "version": "0.3.1",
4
4
  "description": "Durable, pull-first mailbox and work-delivery control plane for AI agents across runtimes, sessions, and machines.",
5
5
  "type": "module",
6
6
  "license": "Apache-2.0",