borgmcp-shared 0.10.1 → 0.11.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.
- package/CONTRIBUTING.md +2 -2
- package/README.md +16 -15
- package/dist/protocol/contract.d.ts +1 -1
- package/dist/protocol/contract.js +1 -1
- package/dist/templates.d.ts +1 -1
- package/dist/templates.d.ts.map +1 -1
- package/dist/templates.js +178 -53
- package/dist/templates.js.map +1 -1
- package/docs/release-records.json +14 -0
- package/docs/releasing.md +2 -3
- package/docs/template-lifecycle.md +66 -0
- package/package.json +2 -2
- package/src/protocol/contract.ts +1 -1
- package/src/templates.ts +185 -53
package/CONTRIBUTING.md
CHANGED
package/README.md
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
# borgmcp-shared
|
|
2
2
|
|
|
3
3
|
`borgmcp-shared` is the implementation-neutral contract package for Borg MCP.
|
|
4
|
-
It contains protocol types, domain helpers, built-in cube templates, and
|
|
5
|
-
|
|
4
|
+
It contains protocol types, domain helpers, built-in cube templates, and portable
|
|
5
|
+
conformance vectors that Borg MCP client and server implementations can run.
|
|
6
6
|
Its pure ESM helpers and generated TypeScript declarations run consistently
|
|
7
7
|
across host environments with zero runtime dependencies.
|
|
8
8
|
|
|
@@ -12,7 +12,7 @@ across host environments with zero runtime dependencies.
|
|
|
12
12
|
npm install borgmcp-shared
|
|
13
13
|
```
|
|
14
14
|
|
|
15
|
-
The package is ESM-only and supports Node.js
|
|
15
|
+
The package is ESM-only and supports Node.js 22.12.0 or newer.
|
|
16
16
|
|
|
17
17
|
## Public API
|
|
18
18
|
|
|
@@ -53,9 +53,9 @@ The supported subpaths are:
|
|
|
53
53
|
- `borgmcp-shared/drone-address`: stable short drone-address rendering.
|
|
54
54
|
- `borgmcp-shared/runtime-metadata`: pure validation and canonical repository
|
|
55
55
|
identity helpers for advisory local seat metadata.
|
|
56
|
+
- `borgmcp-shared/package.json`: package metadata.
|
|
56
57
|
|
|
57
|
-
Generated declaration files are included in
|
|
58
|
-
functions and contracts include API documentation in their TypeScript sources.
|
|
58
|
+
Generated declaration files are included in the published package.
|
|
59
59
|
|
|
60
60
|
## Handshake
|
|
61
61
|
|
|
@@ -99,11 +99,12 @@ authority: there is no capability negotiation, and client and server ship and
|
|
|
99
99
|
update together as one clean-slate product. The attach request envelope still
|
|
100
100
|
decodes its version before any payload as defense in depth.
|
|
101
101
|
|
|
102
|
-
|
|
103
|
-
`ProtocolEnvelope<T>`. Failures use `ProtocolErrorEnvelope`. The
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
validate the
|
|
102
|
+
Versioned JSON coordination requests and successful responses are carried inside
|
|
103
|
+
`ProtocolEnvelope<T>`. Failures use `ProtocolErrorEnvelope`. The credential-free
|
|
104
|
+
protocol preflight uses its exact tag-only shape; `204` liveness and
|
|
105
|
+
acknowledgement responses are bodyless. Payload codecs are exported separately
|
|
106
|
+
so adapters can validate the envelope first and then validate the
|
|
107
|
+
operation-specific payload without accepting ambiguous fields.
|
|
107
108
|
Cube managers reassign a seat with `PATCH /api/cubes/:cubeId/drones/:droneId`
|
|
108
109
|
and evict one with `DELETE` on the same path. Both operations use strict
|
|
109
110
|
versioned request and success envelopes. An evicted seat's former bearer receives
|
|
@@ -121,8 +122,8 @@ ordinary ungranted enrollment, cube creation, pending enrollment, and retry cont
|
|
|
121
122
|
## Conformance
|
|
122
123
|
|
|
123
124
|
Server and client implementations should run the vectors exported from
|
|
124
|
-
`borgmcp-shared/conformance` against their adapters. The vectors
|
|
125
|
-
|
|
125
|
+
`borgmcp-shared/conformance` against their adapters. The vectors are readonly
|
|
126
|
+
data, and the runner is test-runner-independent code, so they work with any test
|
|
126
127
|
runner supported by the implementation. Cases cover HTTP and canonical errors,
|
|
127
128
|
credential misuse, isolation and revocation, SSE framing/replay/cursor ordering,
|
|
128
129
|
executable enrollment authority/retry/mismatch/redaction and cube-create
|
|
@@ -144,9 +145,9 @@ historical values so existing registry entries remain compatible.
|
|
|
144
145
|
Implement `ConformanceEnvironment` with raw responses from the target adapter,
|
|
145
146
|
then call `runAdapterConformance`. The runner creates and decodes envelopes,
|
|
146
147
|
drives state transitions, and decides pass/fail; adapters do not submit expected
|
|
147
|
-
results.
|
|
148
|
-
|
|
149
|
-
|
|
148
|
+
results. A server or client adapter can run the portable suite against its
|
|
149
|
+
local/self-hosted implementation. The package does not define a second authority,
|
|
150
|
+
migration target, or fallback implementation.
|
|
150
151
|
|
|
151
152
|
The package's own suite covers built-in templates, role-section patching,
|
|
152
153
|
broadcast high-water-mark ordering, drone-address formatting, runtime metadata
|
|
@@ -2,7 +2,7 @@ import { ErrorCode } from './errors.js';
|
|
|
2
2
|
import { type ProtocolVersion } from './version.js';
|
|
3
3
|
import type { DroneRuntimeMetadata, DroneRuntimeMetadataPatch } from './types.js';
|
|
4
4
|
export declare const SHARED_PACKAGE_NAME: "borgmcp-shared";
|
|
5
|
-
export declare const SHARED_PACKAGE_VERSION: "0.
|
|
5
|
+
export declare const SHARED_PACKAGE_VERSION: "0.11.0";
|
|
6
6
|
export declare const DECISION_TEXT_MAX_BYTES: 512;
|
|
7
7
|
export declare const ROLE_TEXT_MAX_BYTES: 51200;
|
|
8
8
|
export declare const HEALTH_PATH: "/healthz";
|
|
@@ -2,7 +2,7 @@ import { ErrorCode } from './errors.js';
|
|
|
2
2
|
import { PROTOCOL_VERSION } from './version.js';
|
|
3
3
|
import { canonicalizeRepositoryIdentity, RuntimeMetadataValidationError, validateRuntimeMetadata, validateRuntimeMetadataPatch, validateRuntimeMetadataReportState, } from '../runtime-metadata.js';
|
|
4
4
|
export const SHARED_PACKAGE_NAME = 'borgmcp-shared';
|
|
5
|
-
export const SHARED_PACKAGE_VERSION = '0.
|
|
5
|
+
export const SHARED_PACKAGE_VERSION = '0.11.0';
|
|
6
6
|
export const DECISION_TEXT_MAX_BYTES = 512;
|
|
7
7
|
export const ROLE_TEXT_MAX_BYTES = 51_200;
|
|
8
8
|
export const HEALTH_PATH = '/healthz';
|
package/dist/templates.d.ts
CHANGED
|
@@ -51,7 +51,7 @@ export declare const WAKE_PATH_MONITOR_DISCIPLINE = "\n\nWake discipline:\n- Use
|
|
|
51
51
|
export declare const WORKER_BUNDLE_DRY_RUN_DISCIPLINE = "\n\nEnvironment-owned verification:\n- When a required check needs permissions or an environment this seat lacks, report the exact check and revision.\n- The coordinating seat routes that one check to an authorized operator; it does not broaden the implementation slice.\n- A result from another revision does not satisfy the gate.";
|
|
52
52
|
export declare const PUSH_DISCIPLINE_COORDINATOR = "\n\nPush discipline:\n- Before pushing an integration result, fetch, verify the target and exact revision, and confirm the worktree is clean.\n- Do not force-push or move an existing tag without explicit recovery authority.";
|
|
53
53
|
export declare const PUSH_DISCIPLINE_BUILDER = "\n\nPush discipline:\n- Push only the assigned branch after verifying the staged paths and final diff.\n- Do not force-push, rebase a shared branch, or publish from a local substitute artifact.";
|
|
54
|
-
export declare const SAME_REPOSITORY_WORKFLOW_DISCIPLINE = "\n\nSame-repository
|
|
54
|
+
export declare const SAME_REPOSITORY_WORKFLOW_DISCIPLINE = "\n\nSame-repository workflow policy:\n- Start a routed work item on its own branch with `git checkout -b <branch>`. Announce its name in STARTING. One branch equals one work item and one owning seat.\n- Use merge-only history: no rebases and no force-pushes.\n- Hand over the exact commit SHA. Each review round binds to one exact SHA, and a new SHA restarts the gate sequence.\n- Run `git remote get-url origin` to determine whether a hosted origin exists.\n- When that command succeeds, publish the branch with `git push -u origin <branch>`; the branch is REVIEW-READY only after that push and exact remote-head verification.\n- When that command fails because no origin exists, omit the push; the work is REVIEW-READY when its exact commit SHA is available through the project review mechanism.\n- After every merge to the protected or main branch, broadcast the merge SHA.";
|
|
55
55
|
export declare const UNIVERSAL_SAFETY_DISCIPLINES: string[];
|
|
56
56
|
export declare const ROLE_SCOPED_SAFETY_DISCIPLINES: string[];
|
|
57
57
|
export declare const DRONE_ADDRESSING_CONVENTION = "\n\nDrone addressing:\n- Route directed work with the stable short UUID shown by Borg, not a mutable display label.\n- Keep each dispatch self-contained: recipient, exact item, first action, and completion evidence.";
|
package/dist/templates.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"templates.d.ts","sourceRoot":"","sources":["../src/templates.ts"],"names":[],"mappings":"AASA,MAAM,WAAW,YAAY;IAC3B,IAAI,EAAE,MAAM,CAAC;IACb,iBAAiB,EAAE,MAAM,CAAC;IAC1B,oBAAoB,EAAE,MAAM,CAAC;IAC7B,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,mBAAmB,CAAC,EAAE,OAAO,CAAC;CAC/B;AAED,MAAM,WAAW,oBAAoB;IACnC,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAC;IACpB,OAAO,EAAE,WAAW,GAAG,UAAU,CAAC;IAClC,UAAU,CAAC,EAAE,MAAM,EAAE,CAAC;IACtB,SAAS,CAAC,EAAE,UAAU,GAAG,YAAY,CAAC;CACvC;AAED,MAAM,MAAM,eAAe,GAAG,oBAAoB,EAAE,CAAC;AAErD,MAAM,WAAW,QAAQ;IACvB,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,iBAAiB,EAAE,MAAM,CAAC;IAC1B,WAAW,EAAE,MAAM,CAAC;IACpB,KAAK,EAAE,YAAY,EAAE,CAAC;IACtB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,gBAAgB,CAAC,EAAE,eAAe,CAAC;CACpC;AAED,eAAO,MAAM,6BAA6B,qBAAqB,CAAC;AAEhE,eAAO,MAAM,+BAA+B;;;;;;;;;;;;EAgBlC,CAAC;AAEX,eAAO,MAAM,qBAAqB,gdAOuD,CAAC;AAI1F,eAAO,MAAM,gCAAgC,+YAMoC,CAAC;AAElF,eAAO,MAAM,mCAAmC,qgBAQ8D,CAAC;A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