@creatornader/agent-bridge 0.3.0 → 0.4.0

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.
Files changed (75) hide show
  1. package/CHANGELOG.md +174 -5
  2. package/README.md +341 -33
  3. package/ROADMAP.md +78 -16
  4. package/SECURITY.md +68 -1
  5. package/SKILL.md +104 -1
  6. package/dist/archive.d.ts +2 -2
  7. package/dist/archive.js +2 -2
  8. package/dist/{bridge-service-hX1ZQp4W.d.ts → bridge-service-YTjGr91A.d.ts} +1 -1
  9. package/dist/{bridge-store-DPVSCwfs.d.ts → bridge-store-Boaj-ZbO.d.ts} +2 -0
  10. package/dist/bridge.d.ts +17 -7
  11. package/dist/bridge.js +15 -7
  12. package/dist/{chunk-WAI2IYIQ.js → chunk-3YHVUPU2.js} +48 -5
  13. package/dist/chunk-3YHVUPU2.js.map +1 -0
  14. package/dist/{chunk-45BZGB77.js → chunk-6BTJE6D4.js} +168 -7
  15. package/dist/chunk-6BTJE6D4.js.map +1 -0
  16. package/dist/{chunk-5GMB3A77.js → chunk-DQOZJJZ2.js} +22 -10
  17. package/dist/chunk-DQOZJJZ2.js.map +1 -0
  18. package/dist/{chunk-NCO7RLBM.js → chunk-GTK4KOED.js} +108 -8
  19. package/dist/chunk-GTK4KOED.js.map +1 -0
  20. package/dist/{chunk-GADH244D.js → chunk-IHZFI7TH.js} +12 -4
  21. package/dist/chunk-IHZFI7TH.js.map +1 -0
  22. package/dist/{chunk-CEXBMOI5.js → chunk-LAHNQZDN.js} +2 -2
  23. package/dist/{chunk-UAHMP6GC.js → chunk-MCKKVNCE.js} +9 -6
  24. package/dist/chunk-MCKKVNCE.js.map +1 -0
  25. package/dist/{chunk-MBPZXTJA.js → chunk-PDIHDBP3.js} +173 -20
  26. package/dist/chunk-PDIHDBP3.js.map +1 -0
  27. package/dist/{chunk-Q6PPMXJC.js → chunk-SV3SVBYS.js} +377 -21
  28. package/dist/chunk-SV3SVBYS.js.map +1 -0
  29. package/dist/{chunk-SPSMZOCJ.js → chunk-SYGONYMM.js} +4 -4
  30. package/dist/{chunk-A6W4QALF.js → chunk-TC6A7GMF.js} +2 -2
  31. package/dist/cli.js +5856 -413
  32. package/dist/cli.js.map +1 -1
  33. package/dist/client-runtime.d.ts +4 -2
  34. package/dist/client-runtime.js +6 -6
  35. package/dist/contracts/generate.js +1 -1
  36. package/dist/dr.d.ts +9 -2
  37. package/dist/dr.js +6 -4
  38. package/dist/{gateway-CggQ8vTC.d.ts → gateway-BQHpV-MZ.d.ts} +27 -3
  39. package/dist/gateway-main.js +69 -5
  40. package/dist/gateway-main.js.map +1 -1
  41. package/dist/gateway.d.ts +3 -3
  42. package/dist/gateway.js +2 -2
  43. package/dist/index.js +7 -7
  44. package/dist/{postgres-bridge-store-Bfd3hRId.d.ts → postgres-bridge-store-WASumj26.d.ts} +1 -1
  45. package/dist/server.js +7 -7
  46. package/dist/sqlite-edge-store-Bc15DvpX.d.ts +148 -0
  47. package/dist/sqlite.d.ts +19 -80
  48. package/dist/sqlite.js +11 -3
  49. package/docs/architecture-v2.md +278 -13
  50. package/docs/decisions/0001-protocol-layers-and-acknowledgment-semantics.md +2 -2
  51. package/docs/decisions/0003-host-adapters-and-consumer-instance-keys.md +88 -0
  52. package/docs/decisions/0004-client-lifecycle-and-endpoint-migration.md +204 -0
  53. package/docs/deployment.md +205 -0
  54. package/docs/ecosystem.md +35 -3
  55. package/docs/troubleshooting.md +23 -0
  56. package/llms.txt +79 -3
  57. package/openapi/agent-bridge-v2.openapi.json +1023 -0
  58. package/package.json +6 -2
  59. package/schemas/agent-bridge-v2.capabilities.json +24 -0
  60. package/schemas/agent-bridge-v2.mcp.json +6 -0
  61. package/schemas/agent-bridge-v2.schema.json +163 -0
  62. package/sql/migrations/017_gateway_authority_binding.sql +99 -0
  63. package/sql/migrations/018_endpoint_migration_challenges.sql +1028 -0
  64. package/sql/migrations/019_endpoint_migration_same_successor.sql +324 -0
  65. package/dist/chunk-45BZGB77.js.map +0 -1
  66. package/dist/chunk-5GMB3A77.js.map +0 -1
  67. package/dist/chunk-GADH244D.js.map +0 -1
  68. package/dist/chunk-MBPZXTJA.js.map +0 -1
  69. package/dist/chunk-NCO7RLBM.js.map +0 -1
  70. package/dist/chunk-Q6PPMXJC.js.map +0 -1
  71. package/dist/chunk-UAHMP6GC.js.map +0 -1
  72. package/dist/chunk-WAI2IYIQ.js.map +0 -1
  73. /package/dist/{chunk-CEXBMOI5.js.map → chunk-LAHNQZDN.js.map} +0 -0
  74. /package/dist/{chunk-SPSMZOCJ.js.map → chunk-SYGONYMM.js.map} +0 -0
  75. /package/dist/{chunk-A6W4QALF.js.map → chunk-TC6A7GMF.js.map} +0 -0
package/CHANGELOG.md CHANGED
@@ -6,8 +6,173 @@ The format follows [Keep a Changelog](https://keepachangelog.com/en/1.1.0/) and
6
6
 
7
7
  ## [Unreleased]
8
8
 
9
- The changes in this section are implemented on the 0.3.0 development line. They are
10
- not released until the matching tag, GitHub release, and npm package exist.
9
+ ## [0.4.0] - 2026-07-19
10
+
11
+ ### Added
12
+
13
+ - Add v6 managed-client endpoint cutover and finalization commands. A
14
+ committed v5 stage authorizes a credential-free v6 journal only after both live
15
+ gateways negotiate HTTP 2.1, bind the recorded principal and credential IDs, report
16
+ one immutable authority ID, and complete a route challenge. Cutover drains the
17
+ source edge under an exclusive lease before changing a host registration. The initial
18
+ proof uses the predecessor and successor. Once a journal exists, every proof and
19
+ replay uses the successor credential at both URLs, then drains the source edge
20
+ through the target gateway. Finalization retires the source only after the
21
+ predecessor grace cutoff. Dry runs inspect edge state without opening SQLite for
22
+ write access or contacting a gateway. Resume classifies durable before and after
23
+ proofs and cannot take over a live lease.
24
+
25
+ - Add migration 019 for successor-only endpoint-migration challenges. A challenge now
26
+ accepts either a direct predecessor-to-successor pair or the same active successor
27
+ credential on both endpoints. The migration preserves the migration 018 challenge
28
+ records and readiness controls, adds v2 endpoint and v6 owner attestations, and does
29
+ not grant cutover authority. Authenticated HTTP 2.1 capabilities now return the
30
+ credential's `grantedScopes`.
31
+
32
+ - Add migration 017 with an immutable PostgreSQL gateway authority UUID. Production
33
+ request authority now uses a bound opener without changing the released opener's
34
+ return shape. Authenticated gateway status adds optional `gatewayAuthorityId` and
35
+ `credentialId` fields under HTTP 2.1. Native DR preserves the UUID as logical
36
+ authority continuity, not live-clone fencing. Deployments must drain old gateway
37
+ instances before the migration.
38
+
39
+ - Add `clients migrate stage <runtime>` for inert gateway-client migration
40
+ preparation. The command probes the active and successor bearer credentials, records
41
+ enrollment credential IDs and credential-free source and target bindings, and
42
+ prepares a private successor backend without changing the active registration or
43
+ backend. It does not authorize cutover. The source SQLite edge gate prevents new
44
+ outbox inserts once a later drain starts, including from a client that opened the
45
+ database before the gate changed. Staging requires an absolute, normalized source
46
+ edge database path and rejects in-memory edge state.
47
+
48
+ - Add explicit, plan-first `clients rollback <update-operation-id> --identity <name>`
49
+ for committed same-host v4 updates. `--apply` creates a separate reverse journal.
50
+ It verifies the source inverse contract and current forward metadata and
51
+ registration before it removes the forward native entry, restores the prior entry,
52
+ and writes prior metadata last. Claude Desktop replaces only its Agent Bridge entry.
53
+ Generic `clients resume` also resumes a reverse journal. The v4 source completion
54
+ keeps only a bounded credential-free inverse contract. Repair remains monotonic and
55
+ uninstall stays forward-only. Managed operation summaries preserve the durable
56
+ manifest version and include the `rollback` kind.
57
+
58
+ - Add forward-only `clients uninstall` for metadata-owned Codex, Claude Code, and
59
+ Claude Desktop registrations. Uninstall proves and removes the managed
60
+ registration, deletes an already private backend file, then deletes management
61
+ metadata. It never snapshots backend bytes or reverses a completed step. POSIX
62
+ deletion syncs the private parent directory. Windows verifies deletion and records
63
+ unavailable directory durability. Native and Desktop writes retain their documented
64
+ same-user advisory race boundaries.
65
+ Add `clients resume <operation-id> [--recover-lock]`, which derives repair and
66
+ uninstall authority from recorded v3 requests, and update or rollback authority
67
+ from recorded v4 requests. It also accepts pre-v4 update journals. It accepts no
68
+ replacement identity, runtime, instance, launch, or file locator. Version 2
69
+ journals remain inspectable only. Generic resume also completes an uninstall
70
+ interrupted after its final metadata deletion.
71
+
72
+ - Add plan-first `clients repair` and `clients update` for metadata-owned Codex,
73
+ Claude Code, and Claude Desktop registrations. Runtime and stable instance locate
74
+ strict owner-private metadata. Identity binds the record and immutable repair or
75
+ update request. Repair restores the stored launch contract, while update journals a
76
+ normalized credential-free launch request.
77
+ Applied native changes prove remove, absence, add, and exact target before a
78
+ metadata-last launch update. Desktop replaces only the Agent Bridge entry and
79
+ preserves unrelated JSON values. Backend privacy repair records only policy proofs
80
+ and tightens permissions without reading or snapshotting backend content. Full
81
+ metadata and bounded registration proofs prevent drifted state from advancing a
82
+ prior journal. Unknown environment keys and unsafe registration fields stop before
83
+ journal creation. Native update commands reject argument, credential, and URL-like
84
+ surfaces. Desktop publication uses a private operation-scoped temporary file and
85
+ detects the checked races that Node can observe, but it cannot provide an OS
86
+ transaction with Claude Desktop. Same-action same-host resume and stale-lock recovery
87
+ use the existing operation substrate.
88
+ New journals use operation format version 3. Version 2 journals remain inspectable,
89
+ but incomplete records cannot resume without an identity-bound request.
90
+
91
+ - Give local and edge SQLite initialization a 15-second minimum busy-retry window
92
+ for concurrent first-start schema work. Normal database operations retain their
93
+ configured timeout. Concurrency tests also terminate hung child processes before
94
+ temporary-directory cleanup.
95
+
96
+ - Add the crash-safe managed-client operation substrate and read-only `clients
97
+ operations [<operation-id>]` inspection. Owner-private revisioned manifests,
98
+ immutable ordered step plans, snapshot artifacts, pinned directory identities,
99
+ per-client locks, and same-host stale-lock proof keep private contents out of JSON
100
+ and errors. Restart classification distinguishes exact before-state retries,
101
+ verified after-state advancement, and blocked ambiguity. Snapshot publication never
102
+ replaces residue, every step requires a verified before-state snapshot, and bounded
103
+ manifests reject contradictory state. Typed credential-agnostic requests,
104
+ no-replace before/after artifacts, lock-covered begin, and same-host resume now feed
105
+ distinct resumable, classification-required, blocked, and complete inspection.
106
+ Crash-restartable per-artifact cleanup advances `applied` through `cleaning` to a
107
+ `committed` manifest after verified unlink and POSIX directory sync, or an explicit
108
+ Windows unavailable-durability result. Exact after-publication and post-intent unlink
109
+ residue can resume; every other missing or extra artifact blocks. Terminal manifests
110
+ retain a bounded credential-free completion record. Windows mutations reuse native
111
+ ACL results only within one held lock and for the same verified directory path
112
+ identity. File checks, new or resumed locks, and passive inspection recheck the
113
+ policy. POSIX checks remain per-access. Repair, update, and uninstall use this substrate.
114
+
115
+ - Add read-only `clients inspect` and plan-first `clients adopt` for Codex, Claude
116
+ Code, and Claude Desktop. Exact unmanaged registrations can be adopted only with
117
+ `--apply`, which writes owner-only credential-free management metadata. Inspection
118
+ reports absent, unmanaged, managed, or drifted state without reading backend values
119
+ or contacting a gateway. Registration comparison is structural and health-neutral,
120
+ backend paths enforce the owner-only no-link policy, Desktop inspection shares the
121
+ installer launch resolver, and apply re-inspects its postcondition. Enrollment-based
122
+ provision collision behavior is unchanged. Managed metadata also binds Desktop to
123
+ its normalized config path, Codex to its active profile config, and Claude Code
124
+ local or project scope to its invocation directory so later operations cannot guess
125
+ at a registration target.
126
+
127
+ - Add a pinned, non-root gateway image and a loopback-only Compose development stack.
128
+ The stack runs migrations separately, creates a restricted runtime login, reads
129
+ database passwords from private secret files, and retains PostgreSQL data in a named
130
+ volume.
131
+ - Add a Linux Compose acceptance test for credential-bound identity, targeted delivery,
132
+ lease settlement, denied runtime access to credential hashes, and PostgreSQL
133
+ persistence across a full stack restart.
134
+ - Add a deployment guide for production TLS, network isolation, secret handling,
135
+ backup, upgrade order, and rollback.
136
+
137
+ ### Fixed
138
+
139
+ - Defer Windows SQLite sidecar ACL application until the opened connection establishes
140
+ WAL and completes its serialized schema transaction. Concurrent first-open processes
141
+ no longer race a transient sidecar before their own connection holds it. Replacement
142
+ during one ACL validation still fails.
143
+ - Treat a Windows SQLite sidecar that disappears during ACL validation as an expected
144
+ race only when the path remains absent. A replacement or reparse object still fails
145
+ validation.
146
+ - Handle `-h` and `--help` before command parsing and dispatch so help never opens a
147
+ backend or performs a command side effect.
148
+
149
+ ### Changed
150
+
151
+ - Require the exact release commit to pass the full `test.yml` matrix on `main` before
152
+ release packaging begins. Pin GitHub Actions and reusable workflows to verified
153
+ commit SHAs.
154
+ - Keep Dependabot's grouped npm updates to patch and minor versions. Major updates now
155
+ require separate review.
156
+
157
+ ## [0.3.1] - 2026-07-15
158
+
159
+ ### Added
160
+
161
+ - Add `agent-bridge --version` and `agent-bridge -V` commands that print the
162
+ installed package version without loading backend configuration.
163
+
164
+ ### Changed
165
+
166
+ - Clarify the boundary between agent harnesses, host applications, host adapters, and
167
+ MCP, CLI, HTTPS, and Node library access. Define `AGENT_BRIDGE_INSTANCE` as the
168
+ stable consumer key used for cursor paths, leases, and presence. Supported installers
169
+ generate this key, while direct clients may supply it. Document the released
170
+ no-instance fallbacks and the fact that the key is not a unique live process or
171
+ session.
172
+ - Require manual release recovery to run the workflow at the tag it publishes so npm
173
+ provenance identifies the checked-out release source.
174
+
175
+ ## [0.3.0] - 2026-07-15
11
176
 
12
177
  ### Control, portability, and recovery
13
178
 
@@ -77,7 +242,7 @@ not released until the matching tag, GitHub release, and npm package exist.
77
242
  - SQLite gateway outbox, inbox cache, restart-safe synchronization, and explicit stale-cache results.
78
243
  - Cross-platform Node CLI with init, health, delivery, sync, presence, watch, migration, and client installation commands.
79
244
  - Cheap `pending` process gate for unread context or due delivery work.
80
- - Runtime manifests and native installers for Codex, Claude Code, and Claude Desktop.
245
+ - Host-adapter manifests and native installers for Codex, Claude Code, and Claude Desktop.
81
246
  - Runtime-neutral `SKILL.md` guidance and an `llms.txt` package map.
82
247
  - PostgreSQL migrations with checksum validation and runtime schema readiness checks.
83
248
  - Restricted PostgreSQL runtime grants separated from schema migration credentials.
@@ -86,7 +251,8 @@ not released until the matching tag, GitHub release, and npm package exist.
86
251
  ### Changed
87
252
 
88
253
  - Package identity is `@creatornader/agent-bridge` at version `0.2.0`. The first npm publication was performed manually. OIDC trusted publishing was configured afterward for later releases.
89
- - Agent identity is process-scoped. Shared config no longer supplies `AGENT_BRIDGE_AGENT`.
254
+ - Agent principal is injected through the client process. Shared config no longer
255
+ supplies `AGENT_BRIDGE_AGENT`.
90
256
  - Exact idempotent replays deduplicate. Reusing a key for changed content returns a conflict.
91
257
  - Gateway clients authenticate through separate principal-bound credentials stored in owner-only client backend files.
92
258
  - Package-root imports expose the provider-neutral API without starting the MCP server.
@@ -118,5 +284,8 @@ First tagged release. Marks the point where agent-bridge has shipped its initial
118
284
  - Narrative-leak detection in CI + on commit via `creatornader/textleaks@v0.2.0` (renamed from leakguard).
119
285
 
120
286
  [0.1.0]: https://github.com/creatornader/agent-bridge/releases/tag/v0.1.0
121
- [Unreleased]: https://github.com/creatornader/agent-bridge/compare/v0.2.0...HEAD
287
+ [Unreleased]: https://github.com/creatornader/agent-bridge/compare/v0.4.0...HEAD
288
+ [0.4.0]: https://github.com/creatornader/agent-bridge/compare/v0.3.1...v0.4.0
289
+ [0.3.1]: https://github.com/creatornader/agent-bridge/compare/v0.3.0...v0.3.1
290
+ [0.3.0]: https://github.com/creatornader/agent-bridge/compare/v0.2.0...v0.3.0
122
291
  [0.2.0]: https://github.com/creatornader/agent-bridge/compare/v0.1.0...v0.2.0