borgmcp-shared 0.2.2 → 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.
- package/README.md +52 -35
- package/dist/conformance/adapter.d.ts +34 -6
- package/dist/conformance/adapter.d.ts.map +1 -1
- package/dist/conformance/adapter.js +215 -54
- package/dist/conformance/adapter.js.map +1 -1
- package/dist/conformance/index.d.ts +49 -0
- package/dist/conformance/index.d.ts.map +1 -1
- package/dist/conformance/index.js +111 -0
- package/dist/conformance/index.js.map +1 -1
- package/dist/protocol/contract.d.ts +81 -28
- package/dist/protocol/contract.d.ts.map +1 -1
- package/dist/protocol/contract.js +213 -128
- package/dist/protocol/contract.js.map +1 -1
- package/dist/protocol/errors.d.ts +2 -4
- package/dist/protocol/errors.d.ts.map +1 -1
- package/dist/protocol/errors.js +1 -1
- package/dist/protocol/errors.js.map +1 -1
- package/dist/protocol/version.d.ts +2 -10
- package/dist/protocol/version.d.ts.map +1 -1
- package/dist/protocol/version.js +1 -13
- package/dist/protocol/version.js.map +1 -1
- package/docs/compatibility.md +44 -25
- package/docs/enrollment.md +167 -0
- package/docs/releasing.md +77 -6
- package/package.json +2 -1
- package/src/conformance/adapter.ts +386 -63
- package/src/conformance/index.ts +139 -0
- package/src/protocol/contract.ts +373 -180
- package/src/protocol/errors.ts +7 -3
- package/src/protocol/version.ts +3 -30
package/src/protocol/errors.ts
CHANGED
|
@@ -18,10 +18,16 @@ export enum ErrorCode {
|
|
|
18
18
|
DRONE_EVICTED = 'DRONE_EVICTED',
|
|
19
19
|
DRONE_FROZEN = 'DRONE_FROZEN',
|
|
20
20
|
UNSUPPORTED_PROTOCOL_VERSION = 'UNSUPPORTED_PROTOCOL_VERSION',
|
|
21
|
-
UNSUPPORTED_CAPABILITY = 'UNSUPPORTED_CAPABILITY',
|
|
22
21
|
CURSOR_INVALID = 'CURSOR_INVALID',
|
|
23
22
|
CURSOR_EXPIRED = 'CURSOR_EXPIRED',
|
|
24
23
|
SESSION_REVOKED = 'SESSION_REVOKED',
|
|
24
|
+
/**
|
|
25
|
+
* The presented session bearer does not match the seat it targets: a fresh or
|
|
26
|
+
* non-matching bearer against an already-bound active seat. Distinct from
|
|
27
|
+
* SESSION_REVOKED (a formerly valid credential that was explicitly revoked or
|
|
28
|
+
* expired). Carried by the server's typed 401 takeover rejection.
|
|
29
|
+
*/
|
|
30
|
+
SESSION_REJECTED = 'SESSION_REJECTED',
|
|
25
31
|
}
|
|
26
32
|
|
|
27
33
|
/** @deprecated Wire failures use the versioned ProtocolErrorEnvelope. */
|
|
@@ -31,6 +37,4 @@ export interface ErrorResponse {
|
|
|
31
37
|
details?: string;
|
|
32
38
|
/** Number of seconds a rate-limited caller should wait. */
|
|
33
39
|
retryAfter?: number;
|
|
34
|
-
requiredCapability?: string;
|
|
35
|
-
supportedVersions?: readonly string[];
|
|
36
40
|
}
|
package/src/protocol/version.ts
CHANGED
|
@@ -1,31 +1,4 @@
|
|
|
1
|
-
/** Current Borg coordination protocol generation. */
|
|
2
|
-
export const PROTOCOL_VERSION = '
|
|
1
|
+
/** Current Borg coordination protocol generation. Clean-slate v2. */
|
|
2
|
+
export const PROTOCOL_VERSION = '2' as const;
|
|
3
3
|
|
|
4
|
-
|
|
5
|
-
export const SUPPORTED_PROTOCOL_VERSIONS = [PROTOCOL_VERSION] as const;
|
|
6
|
-
|
|
7
|
-
export type ProtocolVersion = (typeof SUPPORTED_PROTOCOL_VERSIONS)[number];
|
|
8
|
-
|
|
9
|
-
export interface CompatibilityEntry {
|
|
10
|
-
packageRange: string;
|
|
11
|
-
protocolVersions: readonly ProtocolVersion[];
|
|
12
|
-
notes: string;
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
/**
|
|
16
|
-
* Compatibility table for published package releases. Pre-1.0 package
|
|
17
|
-
* releases may add contracts, but do not change an existing wire shape without
|
|
18
|
-
* a documented migration path.
|
|
19
|
-
*/
|
|
20
|
-
export const COMPATIBILITY_MATRIX: readonly CompatibilityEntry[] = [
|
|
21
|
-
{
|
|
22
|
-
packageRange: '>=0.2.0 <0.3.0',
|
|
23
|
-
protocolVersions: SUPPORTED_PROTOCOL_VERSIONS,
|
|
24
|
-
notes: 'Versioned envelope, codecs, and adapter conformance for Borg MCP servers.',
|
|
25
|
-
},
|
|
26
|
-
];
|
|
27
|
-
|
|
28
|
-
export function isProtocolVersionSupported(value: unknown): value is ProtocolVersion {
|
|
29
|
-
return typeof value === 'string' &&
|
|
30
|
-
(SUPPORTED_PROTOCOL_VERSIONS as readonly string[]).includes(value);
|
|
31
|
-
}
|
|
4
|
+
export type ProtocolVersion = typeof PROTOCOL_VERSION;
|