@creatornader/agent-bridge 0.5.2 → 0.6.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.
- package/CHANGELOG.md +57 -1
- package/README.md +59 -34
- package/ROADMAP.md +74 -17
- package/SECURITY.md +6 -5
- package/SKILL.md +4 -1
- package/dist/archive.d.ts +2 -2
- package/dist/{bridge-service-CNBKdYXh.d.ts → bridge-service-DjSYfjKt.d.ts} +4 -2
- package/dist/{bridge-store-ByJ6CaJk.d.ts → bridge-store-Bi_LCX8e.d.ts} +5 -1
- package/dist/bridge.d.ts +9 -37
- package/dist/bridge.js +6 -10
- package/dist/chunk-23UDQZMT.js +54 -0
- package/dist/chunk-23UDQZMT.js.map +1 -0
- package/dist/{chunk-AWE3DFZV.js → chunk-4V2PFJEF.js} +11 -4
- package/dist/chunk-4V2PFJEF.js.map +1 -0
- package/dist/{chunk-E4OWHGUE.js → chunk-63JKCBC6.js} +10 -8
- package/dist/chunk-63JKCBC6.js.map +1 -0
- package/dist/chunk-6ZOLE3E3.js +242 -0
- package/dist/chunk-6ZOLE3E3.js.map +1 -0
- package/dist/chunk-7B3XRRNI.js +27 -0
- package/dist/chunk-7B3XRRNI.js.map +1 -0
- package/dist/{chunk-7VJI2MXI.js → chunk-IF5OKPBK.js} +32 -14
- package/dist/chunk-IF5OKPBK.js.map +1 -0
- package/dist/{chunk-QPC6JHA3.js → chunk-IXNQG4SB.js} +12 -16
- package/dist/chunk-IXNQG4SB.js.map +1 -0
- package/dist/{chunk-HUHG7XTB.js → chunk-JIRNR75D.js} +30 -193
- package/dist/chunk-JIRNR75D.js.map +1 -0
- package/dist/{chunk-JUTJRAMA.js → chunk-LF37B6KL.js} +6 -4
- package/dist/chunk-LF37B6KL.js.map +1 -0
- package/dist/{chunk-2EVLG3YA.js → chunk-UKFRCP6X.js} +10 -7
- package/dist/chunk-UKFRCP6X.js.map +1 -0
- package/dist/{chunk-SN7PIVDF.js → chunk-ZUZ7TCIH.js} +13 -1
- package/dist/{chunk-SN7PIVDF.js.map → chunk-ZUZ7TCIH.js.map} +1 -1
- package/dist/cli.js +45 -40
- package/dist/cli.js.map +1 -1
- package/dist/client-config.d.ts +1 -1
- package/dist/client-config.js +1 -1
- package/dist/client-runtime.d.ts +3 -3
- package/dist/client-runtime.js +5 -5
- package/dist/contracts/generate.js +3 -3
- package/dist/contracts/generate.js.map +1 -1
- package/dist/dr.d.ts +8 -0
- package/dist/dr.js +1 -1
- package/dist/{gateway-CW-61lvs.d.ts → gateway-DWZ3pX48.d.ts} +7 -2
- package/dist/gateway-main.js +12 -3
- package/dist/gateway-main.js.map +1 -1
- package/dist/gateway.d.ts +3 -3
- package/dist/gateway.js +3 -3
- package/dist/index.js +8 -7
- package/dist/index.js.map +1 -1
- package/dist/{postgres-bridge-store-C9KG9Z69.d.ts → postgres-bridge-store-ChoOuFEY.d.ts} +1 -1
- package/dist/server.d.ts +0 -2
- package/dist/server.js +8 -7
- package/dist/{sqlite-edge-store-CdMIOrho.d.ts → sqlite-edge-store-BAFUeysk.d.ts} +1 -1
- package/dist/sqlite.d.ts +7 -3
- package/dist/sqlite.js +1 -1
- package/docs/architecture-v2.md +26 -14
- package/docs/decisions/0001-protocol-layers-and-acknowledgment-semantics.md +2 -1
- package/docs/decisions/0002-canonical-operation-contract-registry.md +11 -1
- package/docs/decisions/0005-retire-direct-supabase-runtime.md +52 -0
- package/docs/deployment.md +41 -17
- package/docs/ecosystem.md +6 -4
- package/docs/troubleshooting.md +15 -0
- package/llms.txt +4 -4
- package/openapi/agent-bridge-v2.openapi.json +11 -6
- package/package.json +5 -3
- package/schemas/agent-bridge-v2.capabilities.json +11 -5
- package/schemas/agent-bridge-v2.mcp.json +13 -12
- package/schemas/agent-bridge-v2.schema.json +26 -24
- package/scripts/gateway-release-check.mjs +92 -0
- package/dist/chunk-2EVLG3YA.js.map +0 -1
- package/dist/chunk-7VJI2MXI.js.map +0 -1
- package/dist/chunk-AWE3DFZV.js.map +0 -1
- package/dist/chunk-E4OWHGUE.js.map +0 -1
- package/dist/chunk-HUHG7XTB.js.map +0 -1
- package/dist/chunk-JUTJRAMA.js.map +0 -1
- package/dist/chunk-QPC6JHA3.js.map +0 -1
- package/dist/chunk-Z6JP6MYD.js +0 -584
- package/dist/chunk-Z6JP6MYD.js.map +0 -1
package/docs/architecture-v2.md
CHANGED
|
@@ -1,20 +1,26 @@
|
|
|
1
1
|
# Agent Bridge v2 architecture
|
|
2
2
|
|
|
3
|
-
Status: living architecture for the 0.
|
|
3
|
+
Status: living architecture for the 0.6.x package line.
|
|
4
4
|
|
|
5
5
|
## Product boundary
|
|
6
6
|
|
|
7
|
-
Agent Bridge
|
|
7
|
+
Agent Bridge lets AI agents message each other and hand off work across clients,
|
|
8
|
+
processes, sessions, and machines. It supports two operating modes: local SQLite and
|
|
9
|
+
the authenticated PostgreSQL gateway.
|
|
8
10
|
|
|
9
11
|
History visibility is caller-relative. `inbox` is the default and preserves broadcast-plus-targeted visibility; `sent` is source equal to the caller; `all` is their union. Receipt state (`any`, `unread`, `read`) is valid only for inbox and is always evaluated for the authenticated caller. Opaque v2 cursors bind workspace, caller, mailbox, and normalized filters. Readers temporarily accept v1 sequence cursors but emit only v2. After an edge cache contract upgrade, the gateway resets the authoritative pull cursor and replays `all` visibility; the publication outbox is never treated as sent history.
|
|
10
12
|
|
|
11
|
-
These authorization guarantees apply to local v2 and the authenticated gateway.
|
|
13
|
+
These authorization guarantees apply to local v2 and the authenticated gateway.
|
|
12
14
|
|
|
13
15
|
- Local mode runs without an account or network connection.
|
|
14
16
|
- Shared mode uses a remote service so agents on different machines see the same history and delivery state.
|
|
15
17
|
|
|
16
18
|
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
19
|
|
|
20
|
+
Authenticated gateway capabilities identify the running package version. Production
|
|
21
|
+
images also report the Git revision supplied at build time. Deployment checks compare
|
|
22
|
+
both values with the intended release before client rollout or production proof.
|
|
23
|
+
|
|
18
24
|
[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
25
|
|
|
20
26
|
[ADR-0002](decisions/0002-canonical-operation-contract-registry.md) defines the canonical cross-surface operation contract, deterministic artifacts, capability discovery, and protocol negotiation.
|
|
@@ -29,7 +35,10 @@ PostgreSQL stores shared messages, identities, receipts, deliveries, and migrati
|
|
|
29
35
|
|
|
30
36
|
A standalone Agent Bridge API sits between remote clients and PostgreSQL. Clients authenticate to the API with scoped credentials. They do not receive a database password or rely on a shared Supabase publishable key for identity.
|
|
31
37
|
|
|
32
|
-
Supabase can
|
|
38
|
+
Supabase can host the database. Agent Bridge 0.6.0 removed the direct PostgREST runtime
|
|
39
|
+
adapter. Historical deployments migrate through the checked-in schema and ordered
|
|
40
|
+
PostgreSQL migrations described in
|
|
41
|
+
[ADR-0005](decisions/0005-retire-direct-supabase-runtime.md).
|
|
33
42
|
|
|
34
43
|
### Deployment separates schema and request authority
|
|
35
44
|
|
|
@@ -237,7 +246,7 @@ The v2 envelope uses fields that can be mapped to CloudEvents without changing s
|
|
|
237
246
|
|
|
238
247
|
A receipt records that a principal read a message.
|
|
239
248
|
|
|
240
|
-
A publisher stores an immutable `deliveryPolicy` with each message. Untargeted messages default to mailbox mode. Targeted messages default to leased mode with `maxAttempts: 5`, `retryBaseDelayMs: 1000`, `retryMaxDelayMs: 60000`, and `retryJitterRatio: 0.2`. Leased policy may also set `notBefore`. Mailbox messages create no deliveries
|
|
249
|
+
A publisher stores an immutable `deliveryPolicy` with each message. Untargeted messages default to mailbox mode. Targeted messages default to leased mode with `maxAttempts: 5`, `retryBaseDelayMs: 1000`, `retryMaxDelayMs: 60000`, and `retryJitterRatio: 0.2`. Leased policy may also set `notBefore`. Mailbox messages create no deliveries.
|
|
241
250
|
|
|
242
251
|
A leased delivery records executable work for a recipient. Its state is one of `pending`, `claimed`, `acked`, `retrying`, `dead`, or `cancelled`. `attempt` is lifetime-monotonic, while `cycleAttempt` resets on publisher requeue and `requeueCount` increments. Stored policy owns retry and exhaustion. Claims order due work by urgent, high, then info priority, followed by availability, message creation time, and the stable delivery ID tie-break. HTTP 2.1, MCP, and CLI may optionally identify one message. That form atomically selects only the eligible delivery for the authenticated recipient and scopes claim-time expiry and exhaustion maintenance to the same message. Omitting the filter preserves claim-next behavior. The frozen HTTP 2.0 request rejects the additive field.
|
|
243
252
|
|
|
@@ -253,7 +262,9 @@ The system promises at-least-once delivery. It does not promise exactly-once exe
|
|
|
253
262
|
|
|
254
263
|
Project participates in the idempotency fingerprint. Reads without a project filter span labeled and unlabeled messages inside the credential-bound workspace. An exact filter narrows that same cursor authority. Migration 008 adds the PostgreSQL column and index. Existing local and edge SQLite databases add their project columns during initialization. Migration 006 is not rewritten. A schema-owner command dry-runs or reconciles its rows into workspace `agent-bridge` in one transaction. It preserves IDs, timestamps, receipts, and row counts, and it verifies that no delivery exists before or after the change.
|
|
255
264
|
|
|
256
|
-
The
|
|
265
|
+
The historical Supabase schema has no tenant workspace column. Migration 006 maps its
|
|
266
|
+
global rows into canonical workspaces before gateway activation. A caller cannot use
|
|
267
|
+
the retired runtime shape to assign a workspace to those rows.
|
|
257
268
|
|
|
258
269
|
The delivery API supports:
|
|
259
270
|
|
|
@@ -274,9 +285,9 @@ Reads use an opaque cursor backed by the backend sequence number. UUIDv7 improve
|
|
|
274
285
|
|
|
275
286
|
During gateway outages, normal inbox and pending reads return the locally cached candidate set with explicit degraded and stale metadata. Because receipt state is remote authority and is not mirrored, an offline `unacknowledgedBy` result reports acknowledgement state as unknown; it must not be interpreted as proof that every returned message is unread.
|
|
276
287
|
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
288
|
+
Hooks, webhooks, and desktop notifications may wake a client. The client still pulls
|
|
289
|
+
from its last durable cursor. This closes notification gaps and makes reconnect
|
|
290
|
+
behavior testable.
|
|
280
291
|
|
|
281
292
|
### Identity is bound at the client boundary
|
|
282
293
|
|
|
@@ -311,7 +322,6 @@ Protocol logic depends on a `BridgeStore` interface, not a provider SDK. The ini
|
|
|
311
322
|
|
|
312
323
|
- SQLite for local mode and edge state.
|
|
313
324
|
- PostgreSQL for a standalone shared deployment.
|
|
314
|
-
- Supabase legacy REST for v1 compatibility during migration.
|
|
315
325
|
- Agent Bridge HTTP API for normal remote clients.
|
|
316
326
|
|
|
317
327
|
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.
|
|
@@ -503,11 +513,14 @@ because an immutable read could miss uncheckpointed outbox state.
|
|
|
503
513
|
|
|
504
514
|
The MCP tools `post_context`, `get_context`, and `ack_context` remain available. Existing CLI verbs and flags remain accepted. Text responses remain present while v2 adds structured result data.
|
|
505
515
|
|
|
506
|
-
|
|
516
|
+
Migration 006 checks the historical Supabase schema, imports v1 records, and verifies
|
|
517
|
+
counts before activation. The reconciliation command can correct imported project
|
|
518
|
+
labels without reopening the retired runtime adapter. Secure shared mode cannot
|
|
519
|
+
silently inherit the old permissive RLS policies.
|
|
507
520
|
|
|
508
521
|
## Security boundary
|
|
509
522
|
|
|
510
|
-
Shared mode uses a token-authenticated API. The service stores only token hashes. Credentials bind a workspace and principal, carry canonical operation scopes, can expire, and can be revoked. Capabilities requires an active credential but no named scope. Local
|
|
523
|
+
Shared mode uses a token-authenticated API. The service stores only token hashes. Credentials bind a workspace and principal, carry canonical operation scopes, can expire, and can be revoked. Capabilities requires an active credential but no named scope. Local mode does not claim gateway scope enforcement.
|
|
511
524
|
|
|
512
525
|
Migration 011 grants every pre-migration credential the full compatibility scope set, including expired and revoked rows, without rewriting lifecycle metadata. Migration 014 preserves those rows but changes new raw inserts to empty scopes. Owner provisioning selects an immutable named scope set. Database constraints reject unknown, duplicated, or unsorted scopes.
|
|
513
526
|
|
|
@@ -640,7 +653,7 @@ The TypeBox 1.x registry validates closed requests before domain semantics. Resp
|
|
|
640
653
|
|
|
641
654
|
Compatibility is asymmetric. An upgraded gateway serves released headerless and explicit 2.0 clients. A new 2.1 client probes before mutation and accepts the gateway only when complete, consistent response headers select 2.1 and advertise 2.1 support. A headerless response, selected 2.0 response, or partial negotiation means the gateway must be upgraded. The client rejects mutation instead of using the d8184fe 2.0 contract. Deploy the gateway before 2.1 clients.
|
|
642
655
|
|
|
643
|
-
The OpenAPI paths describe protocol 2.1. Embedded 2.0 vendor extensions carry only the frozen compatibility schemas and metadata needed to document released clients; they do not form a second OpenAPI description. `npm run contracts:check` proves that JSON Schema 2020-12, OpenAPI 3.1.2, MCP manifest, and capability artifacts match the registry. All schema references are local. Protocol, npm package, MCP implementation, and migration versions are independent. Gateway scope enforcement comes from the registry. Provider-neutral artifacts report enforcement separately for gateway
|
|
656
|
+
The OpenAPI paths describe protocol 2.1. Embedded 2.0 vendor extensions carry only the frozen compatibility schemas and metadata needed to document released clients; they do not form a second OpenAPI description. `npm run contracts:check` proves that JSON Schema 2020-12, OpenAPI 3.1.2, MCP manifest, and capability artifacts match the registry. All schema references are local. Protocol, npm package, MCP implementation, and migration versions are independent. Gateway scope enforcement comes from the registry. Provider-neutral artifacts report enforcement separately for gateway and local modes.
|
|
644
657
|
|
|
645
658
|
The v2 implementation is not accepted until all of these checks pass:
|
|
646
659
|
|
|
@@ -670,7 +683,6 @@ End-to-end payload encryption needs a separate threat model and key-management d
|
|
|
670
683
|
- SQLite WAL-reset bug: <https://sqlite.org/forum/forumpost/0b7fd7f028>
|
|
671
684
|
- PostgreSQL row locking and `SKIP LOCKED`: <https://www.postgresql.org/docs/current/sql-select.html#SQL-FOR-UPDATE-SHARE>
|
|
672
685
|
- Supabase self-hosting responsibilities: <https://supabase.com/docs/guides/self-hosting>
|
|
673
|
-
- Supabase Realtime delivery limitations: <https://supabase.com/docs/reference/self-hosting-realtime>
|
|
674
686
|
- MCP tools specification: <https://modelcontextprotocol.io/specification/2025-11-25/server/tools>
|
|
675
687
|
- MCP transport specification: <https://modelcontextprotocol.io/specification/2025-11-25/basic/transports>
|
|
676
688
|
- UUIDv7: <https://www.rfc-editor.org/rfc/rfc9562.html#name-uuid-version-7>
|
|
@@ -16,7 +16,8 @@ Agent Bridge needs to serve agents across clients, sessions, processes, and mach
|
|
|
16
16
|
|
|
17
17
|
## Decision
|
|
18
18
|
|
|
19
|
-
Agent Bridge
|
|
19
|
+
Agent Bridge provides messaging and work delivery for intermittently connected agent
|
|
20
|
+
runtimes across tools, sessions, and machines.
|
|
20
21
|
|
|
21
22
|
Its protocol owns:
|
|
22
23
|
|
|
@@ -26,7 +26,16 @@ Compatibility runs in the other direction. An upgraded gateway continues to serv
|
|
|
26
26
|
|
|
27
27
|
The OpenAPI paths require protocol 2.1. The `x-agent-bridge-protocol-2.0` and `x-agent-bridge-schemas-2.0` vendor extensions provide limited metadata and frozen schemas for the released compatibility contract. They do not define a second set of paths or a separate OpenAPI description.
|
|
28
28
|
|
|
29
|
-
Capability documents are filtered by surface and provider. HTTP capability discovery
|
|
29
|
+
Capability documents are filtered by surface and provider. HTTP capability discovery
|
|
30
|
+
requires a valid credential but no named scope. Gateway operations enforce the scopes
|
|
31
|
+
declared by the registry, while local mode uses process identity and reports scope
|
|
32
|
+
enforcement as false. [ADR-0005](0005-retire-direct-supabase-runtime.md) removed the
|
|
33
|
+
legacy runtime provider from this contract.
|
|
34
|
+
|
|
35
|
+
Authenticated gateway capability documents may also identify the running package
|
|
36
|
+
version and image Git revision. These implementation fields are independent of the
|
|
37
|
+
HTTP protocol version. Deployment gates compare them with the intended release so a
|
|
38
|
+
healthy but stale gateway cannot pass release proof.
|
|
30
39
|
|
|
31
40
|
Package version, MCP implementation version, Agent Bridge protocol version, and migration version remain independent. The MCP server reports the explicit `MCP_IMPLEMENTATION_VERSION` constant instead of the npm package version.
|
|
32
41
|
|
|
@@ -42,5 +51,6 @@ Package version, MCP implementation version, Agent Bridge protocol version, and
|
|
|
42
51
|
## Related
|
|
43
52
|
|
|
44
53
|
- [ADR-0001](0001-protocol-layers-and-acknowledgment-semantics.md) defines the protocol layers and acknowledgment meanings.
|
|
54
|
+
- [ADR-0005](0005-retire-direct-supabase-runtime.md) removes the direct Supabase runtime provider.
|
|
45
55
|
- [Architecture v2](../architecture-v2.md) describes the system that follows these decisions.
|
|
46
56
|
- The [README](../../README.md) documents public setup and upgrade behavior.
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
# ADR-0005: Retire the direct Supabase runtime
|
|
2
|
+
|
|
3
|
+
Status: accepted
|
|
4
|
+
|
|
5
|
+
Date: 2026-07-21
|
|
6
|
+
|
|
7
|
+
## Context
|
|
8
|
+
|
|
9
|
+
Early Agent Bridge releases could read and write `public.shared_context` through
|
|
10
|
+
Supabase PostgREST with a publishable key. That adapter kept the first deployment
|
|
11
|
+
working while the canonical protocol and gateway were built.
|
|
12
|
+
|
|
13
|
+
The adapter could not provide the gateway's security or delivery model. Its shared key
|
|
14
|
+
did not bind a principal or workspace. Its schema had no delivery leases, offline
|
|
15
|
+
outbox, presence, scoped credentials, or transaction-bound request authority. Keeping
|
|
16
|
+
it as a runtime provider also made every public contract describe a weaker third mode.
|
|
17
|
+
|
|
18
|
+
Supabase remains a useful managed PostgreSQL host. The problem is the direct client API,
|
|
19
|
+
not the database service.
|
|
20
|
+
|
|
21
|
+
## Decision
|
|
22
|
+
|
|
23
|
+
Agent Bridge 0.6.0 supports two runtime providers:
|
|
24
|
+
|
|
25
|
+
- `local`, backed by SQLite.
|
|
26
|
+
- `gateway`, backed by an authenticated Agent Bridge gateway with PostgreSQL authority
|
|
27
|
+
and a local SQLite edge store.
|
|
28
|
+
|
|
29
|
+
The package no longer exports or constructs the direct Supabase store. It rejects
|
|
30
|
+
`legacy`, `supabase`, `legacy-supabase`, and key-only configurations with an upgrade
|
|
31
|
+
message.
|
|
32
|
+
|
|
33
|
+
Historical migration support remains:
|
|
34
|
+
|
|
35
|
+
- `sql/setup.sql` records the v1 schema shape.
|
|
36
|
+
- Migration 006 imports `public.shared_context` rows and receipts.
|
|
37
|
+
- `reconcile-legacy-projects` repairs the imported workspace and project mapping.
|
|
38
|
+
- Released HTTP 2.0 and MCP compatibility tools remain independent protocol contracts.
|
|
39
|
+
|
|
40
|
+
## Consequences
|
|
41
|
+
|
|
42
|
+
Remote clients now use one authenticated boundary and one capability model. Supabase
|
|
43
|
+
deployments can continue to host the canonical PostgreSQL database without exposing
|
|
44
|
+
PostgREST to Agent Bridge clients.
|
|
45
|
+
|
|
46
|
+
Operators upgrading an old direct deployment must preserve the source, run the
|
|
47
|
+
historical import, provision principal-bound gateway credentials, and change client
|
|
48
|
+
configuration before installing 0.6.0. A running direct client cannot upgrade in place
|
|
49
|
+
without that provider change.
|
|
50
|
+
|
|
51
|
+
The removed adapter is not a promise to delete historical migration code. Migration
|
|
52
|
+
fixtures remain until the project adopts an explicit migration-support window.
|
package/docs/deployment.md
CHANGED
|
@@ -229,11 +229,29 @@ repository does not perform them:
|
|
|
229
229
|
match the recorded runtime contract. It never adopts a restored `NOLOGIN` shell.
|
|
230
230
|
6. Construct the restricted runtime URL. Import it and the base64-encoded PostgreSQL CA
|
|
231
231
|
as the two runtime secrets shown above, then run the app-aware read-only preflight.
|
|
232
|
-
7. Deploy the immutable image with
|
|
232
|
+
7. Deploy the immutable image with its source revision:
|
|
233
|
+
|
|
234
|
+
```bash
|
|
235
|
+
fly deploy --config deploy/fly.toml --app <app> \
|
|
236
|
+
--build-arg AGENT_BRIDGE_BUILD_REVISION="$(git rev-parse HEAD)"
|
|
237
|
+
```
|
|
238
|
+
|
|
233
239
|
Require `/readyz` before routing clients.
|
|
234
|
-
8.
|
|
240
|
+
8. Check the running package and source revision with a principal-bound credential:
|
|
241
|
+
|
|
242
|
+
```bash
|
|
243
|
+
AGENT_BRIDGE_URL="https://<app>.fly.dev" AGENT_BRIDGE_TOKEN="..." \
|
|
244
|
+
npm run verify:gateway:release -- \
|
|
245
|
+
--version "$(node -p "require('./package.json').version")" \
|
|
246
|
+
--revision "$(git rev-parse HEAD)"
|
|
247
|
+
```
|
|
248
|
+
|
|
249
|
+
The check also requires protocol 2.1, request authority, and row isolation. It
|
|
250
|
+
fails if the deployed image omits its revision or differs from the intended
|
|
251
|
+
release.
|
|
252
|
+
9. Run authenticated status, publication, pull, claim, and
|
|
235
253
|
settle a disposable targeted delivery.
|
|
236
|
-
|
|
254
|
+
10. Move clients only after the gateway proof passes. Preserve every source edge store
|
|
237
255
|
until its outbox is empty.
|
|
238
256
|
|
|
239
257
|
App creation, database provisioning, secret writes, migration, bootstrap, deployment,
|
|
@@ -264,25 +282,30 @@ sender credential needs `messages:write` and `messages:read`. The receiver needs
|
|
|
264
282
|
|
|
265
283
|
Run the workflow only when the Fly app has exactly one gateway machine. The cycle job
|
|
266
284
|
restarts that machine and queries the Fly Machines API before and after. It fails
|
|
267
|
-
unless the machine ID stays fixed,
|
|
268
|
-
returns to `started`, and `/readyz` succeeds.
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
285
|
+
unless the machine ID stays fixed, a later successful `start` event appears, the
|
|
286
|
+
machine returns to `started`, and `/readyz` succeeds. Fly documents `instance_id` as a
|
|
287
|
+
version changed by machine updates; a plain restart need not change it. This operation
|
|
288
|
+
changes production compute and requires environment approval. It does not migrate the
|
|
289
|
+
database or change secrets.
|
|
290
|
+
|
|
291
|
+
The sender first writes a leased publication to its private SQLite outbox without a
|
|
292
|
+
network request. It then synchronizes that row to the supplied gateway and repeats the
|
|
293
|
+
publication with the same idempotency key. The gateway origin, workspace, and principal
|
|
294
|
+
scope stay unchanged. A separate host finds the exact message through `proof-receiver`,
|
|
295
|
+
claims its delivery, and acknowledges it.
|
|
275
296
|
After the Fly machine cycle, the verifier uses a fresh instance key, edge database,
|
|
276
297
|
and cursor. It reads the immutable message and confirms that the prior delivery is
|
|
277
|
-
still `acked`.
|
|
298
|
+
still `acked`. The sender and receiver host evidence must differ. GitHub may reuse the
|
|
299
|
+
sender's hosted runner for the verifier, so the verifier proves fresh local state rather
|
|
300
|
+
than requiring a third physical host.
|
|
278
301
|
|
|
279
302
|
Each phase writes an `agent-bridge-production-proof-v1` receipt. The runner rejects
|
|
280
303
|
unknown fields at the phase boundary and checks every receipt before use. Receipts may
|
|
281
304
|
record IDs, timestamps, principal and workspace labels, the gateway origin, boolean
|
|
282
305
|
checks, and salted SHA-256 host evidence. They never record bearer values, database
|
|
283
|
-
URLs, environment values, message content, lease tokens, cursor files,
|
|
284
|
-
databases. Download all four workflow artifacts for the operator record. A
|
|
285
|
-
repository test still does not replace a completed external workflow run.
|
|
306
|
+
URLs, secret-bearing environment values, message content, lease tokens, cursor files,
|
|
307
|
+
or edge databases. Download all four workflow artifacts for the operator record. A
|
|
308
|
+
passing repository test still does not replace a completed external workflow run.
|
|
286
309
|
|
|
287
310
|
### Persistent data and backup
|
|
288
311
|
|
|
@@ -313,8 +336,9 @@ owner-control state, or security events.
|
|
|
313
336
|
5. Stop schema-changing jobs other than the selected migration job.
|
|
314
337
|
6. Run the new image's migration command once with schema-owner authority.
|
|
315
338
|
7. Run the runtime bootstrap with separate runtime-login credentials.
|
|
316
|
-
8. Start the new gateway and require `/readyz
|
|
317
|
-
|
|
339
|
+
8. Start the new gateway and require `/readyz`. Run
|
|
340
|
+
`npm run verify:gateway:release` against the expected package version and Git
|
|
341
|
+
revision, then run an authenticated status probe.
|
|
318
342
|
9. Send, read, claim, and settle a disposable targeted delivery.
|
|
319
343
|
10. Roll clients forward only after the gateway proof passes.
|
|
320
344
|
11. Keep the previous authority available but inactive until the observation window
|
package/docs/ecosystem.md
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
# Agent Bridge in the agent ecosystem
|
|
2
2
|
|
|
3
|
-
Agent Bridge
|
|
4
|
-
|
|
5
|
-
read receipts, delivery claims, leases, retries, and replay state.
|
|
6
|
-
full agent stack.
|
|
3
|
+
Agent Bridge lets AI agents message each other and hand off work across tools,
|
|
4
|
+
sessions, and machines. Messages wait through disconnections and restarts. It stores
|
|
5
|
+
immutable messages, read receipts, delivery claims, leases, retries, and replay state.
|
|
6
|
+
It does not own the full agent stack.
|
|
7
7
|
|
|
8
8
|
## System boundaries
|
|
9
9
|
|
|
@@ -21,6 +21,8 @@ defines the protocol boundary and the separate meanings of read receipts, delive
|
|
|
21
21
|
settlement, and external task completion.
|
|
22
22
|
[ADR-0003](decisions/0003-host-adapters-and-consumer-instance-keys.md) defines
|
|
23
23
|
the host layers and consumer instance-key contract.
|
|
24
|
+
[ADR-0005](decisions/0005-retire-direct-supabase-runtime.md) keeps Supabase as a
|
|
25
|
+
PostgreSQL hosting option while removing its direct runtime adapter.
|
|
24
26
|
|
|
25
27
|
## Harnesses, hosts, adapters, and access
|
|
26
28
|
|
package/docs/troubleshooting.md
CHANGED
|
@@ -81,6 +81,21 @@ Queued sends retain their idempotency keys. Long-lived MCP clients retry them, a
|
|
|
81
81
|
`agent-bridge sync` triggers the same bounded replay manually. Claims, lease changes,
|
|
82
82
|
delivery settlement, presence, and read-receipt writes still require the gateway.
|
|
83
83
|
|
|
84
|
+
## Legacy Supabase provider was removed
|
|
85
|
+
|
|
86
|
+
Agent Bridge 0.6.0 rejects `legacy`, `supabase`, `legacy-supabase`, and key-only
|
|
87
|
+
configurations. These names selected the direct PostgREST adapter in older releases.
|
|
88
|
+
Choose local mode for one machine or create a principal-bound gateway backend:
|
|
89
|
+
|
|
90
|
+
```bash
|
|
91
|
+
agent-bridge init --provider local
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
Do not point new clients at `public.shared_context`. If the old table still contains
|
|
95
|
+
data that has not been migrated, preserve it and follow the historical import and
|
|
96
|
+
reconciliation steps in the
|
|
97
|
+
[README](../README.md#upgrading-historical-supabase-deployments).
|
|
98
|
+
|
|
84
99
|
## Migration gate reported by status or doctor
|
|
85
100
|
|
|
86
101
|
`clients migrate stage` does not begin a drain. `clients migrate cutover
|
package/llms.txt
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Repository: https://github.com/creatornader/agent-bridge
|
|
4
4
|
Package: @creatornader/agent-bridge
|
|
5
5
|
|
|
6
|
-
Agent Bridge
|
|
6
|
+
Agent Bridge lets AI agents message each other and hand off work across tools, sessions, and machines. Messages wait while an agent is offline and are still there after it restarts.
|
|
7
7
|
History uses mailbox `inbox` (default), `sent`, or `all`. Receipt state is `any` (default), `unread`, or `read`; it is caller-relative and inbox-only. CLI: `inbox`, `sent`, and `history --mailbox/--receipt-state`. Deprecated unacked-principal arguments must equal the configured identity.
|
|
8
8
|
|
|
9
9
|
## Install
|
|
@@ -29,7 +29,6 @@ services can call the CLI or HTTPS API or embed the Node library without a host
|
|
|
29
29
|
|
|
30
30
|
- local: SQLite WAL, no account or daemon
|
|
31
31
|
- gateway: authenticated HTTPS, PostgreSQL authority, SQLite edge outbox and cache
|
|
32
|
-
- legacy-supabase: compatibility with the v1 shared_context schema
|
|
33
32
|
|
|
34
33
|
## Commands
|
|
35
34
|
|
|
@@ -123,7 +122,7 @@ one logical authority across restore but does not fence a live clone.
|
|
|
123
122
|
|
|
124
123
|
## MCP tools
|
|
125
124
|
|
|
126
|
-
- `capabilities`: return operations, required scopes, provider-specific enforcement,
|
|
125
|
+
- `capabilities`: return operations, required scopes, provider-specific enforcement, supported protocol versions, and optional implementation version and revision metadata. Gateway access needs an active credential but no named scope for this operation.
|
|
127
126
|
- Production gateway capabilities report `requestAuthority: true` and `rowIsolation: true` only after the migration and live catalog, role, policy, privilege, and function checks pass. PostgreSQL forces RLS on messages, receipts, deliveries, delivery events, and presence. Lease transitions and target-to-delivery membership remain service-enforced.
|
|
128
127
|
- Authenticated gateway `/v2/status` returns optional `gatewayAuthorityId` and
|
|
129
128
|
`credentialId` fields when PostgreSQL request authority is active. They are additive
|
|
@@ -190,7 +189,7 @@ sidecars rather than read uncheckpointed outbox state. Resume uses only the reta
|
|
|
190
189
|
request and waits for an unexpired drain lease instead of taking it over.
|
|
191
190
|
|
|
192
191
|
Project is an optional immutable message label, not a tenant or identity selector. Omitted project reads include labeled and unlabeled messages. Exact project filters are supported by CLI, MCP, HTTP, and stores. Gateway workspace assertions must match the bound credential before network access.
|
|
193
|
-
Local CLI calls may override workspace for one invocation.
|
|
192
|
+
Local CLI calls may override workspace for one invocation. Agent Bridge 0.6.0 removed the direct Supabase runtime adapter; the historical schema and migration import remain for upgrades.
|
|
194
193
|
|
|
195
194
|
## References
|
|
196
195
|
|
|
@@ -203,6 +202,7 @@ Local CLI calls may override workspace for one invocation. The legacy Supabase s
|
|
|
203
202
|
- docs/decisions/0001-protocol-layers-and-acknowledgment-semantics.md: protocol layers and acknowledgment semantics
|
|
204
203
|
- docs/decisions/0002-canonical-operation-contract-registry.md: generated contracts and version negotiation
|
|
205
204
|
- docs/decisions/0003-host-adapters-and-consumer-instance-keys.md: host layers and instance-key semantics
|
|
205
|
+
- docs/decisions/0005-retire-direct-supabase-runtime.md: runtime-provider retirement and migration boundary
|
|
206
206
|
- docs/architecture-v2.md: protocol, storage, identity, delivery, and acceptance decisions
|
|
207
207
|
- clients/*.json: v1 host-adapter manifests; `runtime` is the compatibility key for the installation target
|
|
208
208
|
- SKILL.md: concise agent operating instructions
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
"openapi": "3.1.2",
|
|
3
3
|
"info": {
|
|
4
4
|
"title": "Agent Bridge Gateway",
|
|
5
|
+
"description": "Let AI agents message each other and hand off work across tools, sessions, and machines.",
|
|
5
6
|
"version": "2.1",
|
|
6
7
|
"license": {
|
|
7
8
|
"name": "Apache-2.0",
|
|
@@ -331,8 +332,7 @@
|
|
|
331
332
|
"enum": [
|
|
332
333
|
"scoped-credential",
|
|
333
334
|
"credential-wide",
|
|
334
|
-
"process-identity"
|
|
335
|
-
"legacy-key"
|
|
335
|
+
"process-identity"
|
|
336
336
|
]
|
|
337
337
|
},
|
|
338
338
|
"surface": {
|
|
@@ -345,10 +345,16 @@
|
|
|
345
345
|
"provider": {
|
|
346
346
|
"enum": [
|
|
347
347
|
"local",
|
|
348
|
-
"gateway"
|
|
349
|
-
"legacy-supabase"
|
|
348
|
+
"gateway"
|
|
350
349
|
]
|
|
351
350
|
},
|
|
351
|
+
"implementationVersion": {
|
|
352
|
+
"type": "string"
|
|
353
|
+
},
|
|
354
|
+
"implementationRevision": {
|
|
355
|
+
"type": "string",
|
|
356
|
+
"pattern": "^[0-9a-f]{7,40}$"
|
|
357
|
+
},
|
|
352
358
|
"grantedScopes": {
|
|
353
359
|
"type": "array",
|
|
354
360
|
"items": {
|
|
@@ -849,8 +855,7 @@
|
|
|
849
855
|
"schemaVersion": {
|
|
850
856
|
"enum": [
|
|
851
857
|
"local-v2",
|
|
852
|
-
"postgres-v2"
|
|
853
|
-
"legacy-v1"
|
|
858
|
+
"postgres-v2"
|
|
854
859
|
]
|
|
855
860
|
},
|
|
856
861
|
"deliverySupported": {
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@creatornader/agent-bridge",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"description": "
|
|
3
|
+
"version": "0.6.1",
|
|
4
|
+
"description": "Let AI agents message each other and hand off work across tools, sessions, and machines.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "Apache-2.0",
|
|
7
7
|
"author": "Nader Helmy",
|
|
@@ -29,6 +29,7 @@
|
|
|
29
29
|
"schemas",
|
|
30
30
|
"openapi",
|
|
31
31
|
"docs",
|
|
32
|
+
"scripts/gateway-release-check.mjs",
|
|
32
33
|
"sql/migrations",
|
|
33
34
|
"sql/setup.sql",
|
|
34
35
|
"llms.txt",
|
|
@@ -87,12 +88,13 @@
|
|
|
87
88
|
"pretest": "npm run build",
|
|
88
89
|
"test": "vitest run",
|
|
89
90
|
"test:built": "vitest run",
|
|
90
|
-
"test:postgres:contract": "vitest run test/postgres_integration.test.ts --maxWorkers=1 --hookTimeout=60000",
|
|
91
|
+
"test:postgres:contract": "vitest run test/postgres_integration.test.ts --maxWorkers=1 --testTimeout=30000 --hookTimeout=60000",
|
|
91
92
|
"test:postgres:preflight": "node scripts/postgres-preflight.mjs",
|
|
92
93
|
"test:postgres:preflight:full": "node scripts/postgres-preflight.mjs --full",
|
|
93
94
|
"preflight:postgres:production": "npm run build --silent && node dist/postgres-production-preflight.js",
|
|
94
95
|
"preflight:fly": "node scripts/fly-production-preflight.mjs",
|
|
95
96
|
"proof:gateway:production": "node scripts/gateway-production-proof.mjs",
|
|
97
|
+
"verify:gateway:release": "node scripts/gateway-release-check.mjs",
|
|
96
98
|
"test:gateway:production-proof": "vitest run test/gateway-production-proof.test.ts",
|
|
97
99
|
"test:windows:contract": "vitest run test/private-path.test.ts test/windows-native-smoke.test.ts --maxWorkers=1 --testTimeout=180000 -t \"applies and verifies native Windows file and directory ACLs|recovers an (enrollment|client-operation) subsystem lock\" && vitest run test/client-maintenance.test.ts --maxWorkers=1 --testTimeout=180000",
|
|
98
100
|
"typecheck": "tsc --noEmit",
|
|
@@ -70,8 +70,7 @@
|
|
|
70
70
|
"enum": [
|
|
71
71
|
"scoped-credential",
|
|
72
72
|
"credential-wide",
|
|
73
|
-
"process-identity"
|
|
74
|
-
"legacy-key"
|
|
73
|
+
"process-identity"
|
|
75
74
|
]
|
|
76
75
|
},
|
|
77
76
|
"surface": {
|
|
@@ -84,10 +83,16 @@
|
|
|
84
83
|
"provider": {
|
|
85
84
|
"enum": [
|
|
86
85
|
"local",
|
|
87
|
-
"gateway"
|
|
88
|
-
"legacy-supabase"
|
|
86
|
+
"gateway"
|
|
89
87
|
]
|
|
90
88
|
},
|
|
89
|
+
"implementationVersion": {
|
|
90
|
+
"type": "string"
|
|
91
|
+
},
|
|
92
|
+
"implementationRevision": {
|
|
93
|
+
"type": "string",
|
|
94
|
+
"pattern": "^[0-9a-f]{7,40}$"
|
|
95
|
+
},
|
|
91
96
|
"grantedScopes": {
|
|
92
97
|
"type": "array",
|
|
93
98
|
"items": {
|
|
@@ -219,7 +224,8 @@
|
|
|
219
224
|
"retry-max-ms",
|
|
220
225
|
"retry-jitter",
|
|
221
226
|
"not-before",
|
|
222
|
-
"message-id"
|
|
227
|
+
"message-id",
|
|
228
|
+
"queue-only"
|
|
223
229
|
],
|
|
224
230
|
"outputSchema": {
|
|
225
231
|
"type": "object",
|
|
@@ -3,8 +3,7 @@
|
|
|
3
3
|
"protocolVersion": "2.1",
|
|
4
4
|
"scopeEnforcementByProvider": {
|
|
5
5
|
"local": false,
|
|
6
|
-
"gateway": true
|
|
7
|
-
"legacy-supabase": false
|
|
6
|
+
"gateway": true
|
|
8
7
|
},
|
|
9
8
|
"tools": [
|
|
10
9
|
{
|
|
@@ -59,8 +58,7 @@
|
|
|
59
58
|
"enum": [
|
|
60
59
|
"scoped-credential",
|
|
61
60
|
"credential-wide",
|
|
62
|
-
"process-identity"
|
|
63
|
-
"legacy-key"
|
|
61
|
+
"process-identity"
|
|
64
62
|
]
|
|
65
63
|
},
|
|
66
64
|
"surface": {
|
|
@@ -73,10 +71,16 @@
|
|
|
73
71
|
"provider": {
|
|
74
72
|
"enum": [
|
|
75
73
|
"local",
|
|
76
|
-
"gateway"
|
|
77
|
-
"legacy-supabase"
|
|
74
|
+
"gateway"
|
|
78
75
|
]
|
|
79
76
|
},
|
|
77
|
+
"implementationVersion": {
|
|
78
|
+
"type": "string"
|
|
79
|
+
},
|
|
80
|
+
"implementationRevision": {
|
|
81
|
+
"type": "string",
|
|
82
|
+
"pattern": "^[0-9a-f]{7,40}$"
|
|
83
|
+
},
|
|
80
84
|
"grantedScopes": {
|
|
81
85
|
"type": "array",
|
|
82
86
|
"items": {
|
|
@@ -118,8 +122,7 @@
|
|
|
118
122
|
"requiredScopes": [],
|
|
119
123
|
"providers": [
|
|
120
124
|
"local",
|
|
121
|
-
"gateway"
|
|
122
|
-
"legacy-supabase"
|
|
125
|
+
"gateway"
|
|
123
126
|
]
|
|
124
127
|
},
|
|
125
128
|
{
|
|
@@ -387,8 +390,7 @@
|
|
|
387
390
|
],
|
|
388
391
|
"providers": [
|
|
389
392
|
"local",
|
|
390
|
-
"gateway"
|
|
391
|
-
"legacy-supabase"
|
|
393
|
+
"gateway"
|
|
392
394
|
]
|
|
393
395
|
},
|
|
394
396
|
{
|
|
@@ -627,8 +629,7 @@
|
|
|
627
629
|
],
|
|
628
630
|
"providers": [
|
|
629
631
|
"local",
|
|
630
|
-
"gateway"
|
|
631
|
-
"legacy-supabase"
|
|
632
|
+
"gateway"
|
|
632
633
|
]
|
|
633
634
|
},
|
|
634
635
|
{
|