@cleocode/contracts 2026.6.12 → 2026.6.14
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/dist/__tests__/operation-def.test.js +5 -1
- package/dist/__tests__/operation-def.test.js.map +1 -1
- package/dist/__tests__/provider-def.test.d.ts +12 -0
- package/dist/__tests__/provider-def.test.d.ts.map +1 -0
- package/dist/__tests__/provider-def.test.js +84 -0
- package/dist/__tests__/provider-def.test.js.map +1 -0
- package/dist/__tests__/sealed-credential.test.d.ts +19 -0
- package/dist/__tests__/sealed-credential.test.d.ts.map +1 -0
- package/dist/__tests__/sealed-credential.test.js +74 -0
- package/dist/__tests__/sealed-credential.test.js.map +1 -0
- package/dist/__tests__/service-provider.test.d.ts +17 -0
- package/dist/__tests__/service-provider.test.d.ts.map +1 -0
- package/dist/__tests__/service-provider.test.js +108 -0
- package/dist/__tests__/service-provider.test.js.map +1 -0
- package/dist/__tests__/skill-executor-contract.test.js +3 -0
- package/dist/__tests__/skill-executor-contract.test.js.map +1 -1
- package/dist/acceptance-gate.d.ts +2 -3
- package/dist/acceptance-gate.d.ts.map +1 -1
- package/dist/boundary.d.ts +52 -0
- package/dist/boundary.d.ts.map +1 -1
- package/dist/boundary.js +24 -19
- package/dist/boundary.js.map +1 -1
- package/dist/conduit.d.ts +171 -0
- package/dist/conduit.d.ts.map +1 -1
- package/dist/config/index.d.ts +23 -0
- package/dist/config/index.d.ts.map +1 -0
- package/dist/config/index.js +22 -0
- package/dist/config/index.js.map +1 -0
- package/dist/config.d.ts +104 -1
- package/dist/config.d.ts.map +1 -1
- package/dist/data-accessor.d.ts +21 -1
- package/dist/data-accessor.d.ts.map +1 -1
- package/dist/data-accessor.js.map +1 -1
- package/dist/dispatch/__tests__/tasks-gateway-crud-ops.test.d.ts +21 -0
- package/dist/dispatch/__tests__/tasks-gateway-crud-ops.test.d.ts.map +1 -0
- package/dist/dispatch/__tests__/tasks-gateway-crud-ops.test.js +84 -0
- package/dist/dispatch/__tests__/tasks-gateway-crud-ops.test.js.map +1 -0
- package/dist/dispatch/identity.d.ts +1 -1
- package/dist/dispatch/identity.d.ts.map +1 -1
- package/dist/dispatch/identity.js +25 -0
- package/dist/dispatch/identity.js.map +1 -1
- package/dist/dispatch/operation-def.d.ts +20 -0
- package/dist/dispatch/operation-def.d.ts.map +1 -1
- package/dist/dispatch/operations-registry.d.ts.map +1 -1
- package/dist/dispatch/operations-registry.js +1044 -182
- package/dist/dispatch/operations-registry.js.map +1 -1
- package/dist/docs/read.d.ts +2 -2
- package/dist/index.d.ts +25 -11
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +17 -1
- package/dist/index.js.map +1 -1
- package/dist/lease-ipc/__tests__/freeze.test.d.ts +15 -0
- package/dist/lease-ipc/__tests__/freeze.test.d.ts.map +1 -0
- package/dist/lease-ipc/__tests__/freeze.test.js +313 -0
- package/dist/lease-ipc/__tests__/freeze.test.js.map +1 -0
- package/dist/lease-ipc/index.d.ts +17 -0
- package/dist/lease-ipc/index.d.ts.map +1 -0
- package/dist/lease-ipc/index.js +16 -0
- package/dist/lease-ipc/index.js.map +1 -0
- package/dist/lease-ipc/messages.d.ts +918 -0
- package/dist/lease-ipc/messages.d.ts.map +1 -0
- package/dist/lease-ipc/messages.js +476 -0
- package/dist/lease-ipc/messages.js.map +1 -0
- package/dist/lease-ipc/version.d.ts +41 -0
- package/dist/lease-ipc/version.d.ts.map +1 -0
- package/dist/lease-ipc/version.js +43 -0
- package/dist/lease-ipc/version.js.map +1 -0
- package/dist/llm/catalog-schema.d.ts +242 -0
- package/dist/llm/catalog-schema.d.ts.map +1 -0
- package/dist/llm/catalog-schema.js +153 -0
- package/dist/llm/catalog-schema.js.map +1 -0
- package/dist/llm/catalog-schema.json +139 -0
- package/dist/llm/index.d.ts +15 -0
- package/dist/llm/index.d.ts.map +1 -0
- package/dist/llm/index.js +14 -0
- package/dist/llm/index.js.map +1 -0
- package/dist/llm/interfaces.d.ts +23 -0
- package/dist/llm/interfaces.d.ts.map +1 -1
- package/dist/llm/oauth.d.ts +16 -2
- package/dist/llm/oauth.d.ts.map +1 -1
- package/dist/llm/onboarding.d.ts +126 -0
- package/dist/llm/onboarding.d.ts.map +1 -0
- package/dist/llm/onboarding.js +34 -0
- package/dist/llm/onboarding.js.map +1 -0
- package/dist/llm/provider-def.d.ts +254 -0
- package/dist/llm/provider-def.d.ts.map +1 -0
- package/dist/llm/provider-def.js +93 -0
- package/dist/llm/provider-def.js.map +1 -0
- package/dist/llm/sealed-credential.d.ts +164 -0
- package/dist/llm/sealed-credential.d.ts.map +1 -0
- package/dist/llm/sealed-credential.js +43 -0
- package/dist/llm/sealed-credential.js.map +1 -0
- package/dist/llm/system-of-use.d.ts +383 -0
- package/dist/llm/system-of-use.d.ts.map +1 -0
- package/dist/llm/system-of-use.js +238 -0
- package/dist/llm/system-of-use.js.map +1 -0
- package/dist/llm/system-resolver.d.ts +87 -11
- package/dist/llm/system-resolver.d.ts.map +1 -1
- package/dist/llm/system-resolver.js +14 -7
- package/dist/llm/system-resolver.js.map +1 -1
- package/dist/operations/__tests__/ensures-schema-registry.test.d.ts +17 -0
- package/dist/operations/__tests__/ensures-schema-registry.test.d.ts.map +1 -0
- package/dist/operations/__tests__/ensures-schema-registry.test.js +113 -0
- package/dist/operations/__tests__/ensures-schema-registry.test.js.map +1 -0
- package/dist/operations/admin.d.ts +124 -1
- package/dist/operations/admin.d.ts.map +1 -1
- package/dist/operations/ensures-schema-registry.d.ts +172 -0
- package/dist/operations/ensures-schema-registry.d.ts.map +1 -0
- package/dist/operations/ensures-schema-registry.js +226 -0
- package/dist/operations/ensures-schema-registry.js.map +1 -0
- package/dist/operations/entities.d.ts +110 -0
- package/dist/operations/entities.d.ts.map +1 -0
- package/dist/operations/entities.js +695 -0
- package/dist/operations/entities.js.map +1 -0
- package/dist/operations/llm.d.ts +116 -9
- package/dist/operations/llm.d.ts.map +1 -1
- package/dist/operations/output-contracts-data.d.ts.map +1 -1
- package/dist/operations/output-contracts-data.js +230 -0
- package/dist/operations/output-contracts-data.js.map +1 -1
- package/dist/operations/service.d.ts +68 -0
- package/dist/operations/service.d.ts.map +1 -0
- package/dist/operations/service.js +336 -0
- package/dist/operations/service.js.map +1 -0
- package/dist/operations/tasks.d.ts +109 -0
- package/dist/operations/tasks.d.ts.map +1 -1
- package/dist/operations/tasks.js.map +1 -1
- package/dist/operations/validate.d.ts +1 -12
- package/dist/operations/validate.d.ts.map +1 -1
- package/dist/operations/validate.js +1 -1
- package/dist/playbook.d.ts +116 -0
- package/dist/playbook.d.ts.map +1 -1
- package/dist/release/plan.d.ts +5 -5
- package/dist/session.d.ts +11 -0
- package/dist/session.d.ts.map +1 -1
- package/dist/session.js.map +1 -1
- package/dist/templates/manifest.d.ts +1 -1
- package/dist/tools/agent-tools.d.ts +231 -0
- package/dist/tools/agent-tools.d.ts.map +1 -0
- package/dist/tools/agent-tools.js +25 -0
- package/dist/tools/agent-tools.js.map +1 -0
- package/dist/tools/atomic.d.ts +19 -0
- package/dist/tools/atomic.d.ts.map +1 -1
- package/dist/tools/atomic.js +17 -0
- package/dist/tools/atomic.js.map +1 -1
- package/dist/tools/index.d.ts +2 -0
- package/dist/tools/index.d.ts.map +1 -1
- package/dist/tools/skill-executor.d.ts +7 -0
- package/dist/tools/skill-executor.d.ts.map +1 -1
- package/dist/tools/web-tools.d.ts +217 -0
- package/dist/tools/web-tools.d.ts.map +1 -0
- package/dist/tools/web-tools.js +31 -0
- package/dist/tools/web-tools.js.map +1 -0
- package/dist/vault/service-provider.d.ts +343 -0
- package/dist/vault/service-provider.d.ts.map +1 -0
- package/dist/vault/service-provider.js +857 -0
- package/dist/vault/service-provider.js.map +1 -0
- package/dist/workgraph.d.ts +12 -12
- package/package.json +14 -2
- package/src/__tests__/__snapshots__/operations-registry.test.ts.snap +1 -1
- package/src/__tests__/operation-def.test.ts +7 -1
- package/src/__tests__/provider-def.test.ts +93 -0
- package/src/__tests__/sealed-credential.test.ts +100 -0
- package/src/__tests__/service-provider.test.ts +129 -0
- package/src/__tests__/skill-executor-contract.test.ts +3 -0
- package/src/acceptance-gate.ts +2 -3
- package/src/boundary.ts +70 -20
- package/src/conduit.ts +200 -0
- package/src/config/index.ts +35 -0
- package/src/config.ts +106 -1
- package/src/data-accessor.ts +22 -1
- package/src/dispatch/__tests__/tasks-gateway-crud-ops.test.ts +99 -0
- package/src/dispatch/identity.ts +25 -0
- package/src/dispatch/operation-def.ts +21 -0
- package/src/dispatch/operations-registry.ts +1083 -176
- package/src/index.ts +240 -25
- package/src/lease-ipc/__tests__/freeze.test.ts +342 -0
- package/src/lease-ipc/index.ts +75 -0
- package/src/lease-ipc/messages.ts +588 -0
- package/src/lease-ipc/version.ts +46 -0
- package/src/llm/catalog-schema.json +139 -0
- package/src/llm/catalog-schema.ts +184 -0
- package/src/llm/index.ts +29 -0
- package/src/llm/interfaces.ts +23 -0
- package/src/llm/oauth.ts +16 -2
- package/src/llm/onboarding.ts +131 -0
- package/src/llm/provider-def.ts +291 -0
- package/src/llm/sealed-credential.ts +166 -0
- package/src/llm/system-of-use.ts +503 -0
- package/src/llm/system-resolver.ts +91 -11
- package/src/operations/__tests__/ensures-schema-registry.test.ts +169 -0
- package/src/operations/admin.ts +144 -0
- package/src/operations/ensures-schema-registry.ts +260 -0
- package/src/operations/entities.ts +758 -0
- package/src/operations/llm.ts +120 -8
- package/src/operations/output-contracts-data.ts +264 -0
- package/src/operations/service.ts +360 -0
- package/src/operations/tasks.ts +119 -0
- package/src/operations/validate.ts +1 -14
- package/src/playbook.ts +117 -0
- package/src/session.ts +11 -0
- package/src/tools/agent-tools.ts +270 -0
- package/src/tools/atomic.ts +21 -0
- package/src/tools/index.ts +46 -0
- package/src/tools/skill-executor.ts +7 -0
- package/src/tools/web-tools.ts +247 -0
- package/src/vault/service-provider.ts +1137 -0
- package/dist/tessera.d.ts +0 -32
- package/dist/tessera.d.ts.map +0 -1
- package/dist/tessera.js +0 -11
- package/dist/tessera.js.map +0 -1
- package/dist/warp-chain.d.ts +0 -129
- package/dist/warp-chain.d.ts.map +0 -1
- package/dist/warp-chain.js +0 -13
- package/dist/warp-chain.js.map +0 -1
- package/src/tessera.ts +0 -35
- package/src/warp-chain.ts +0 -185
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"messages.d.ts","sourceRoot":"","sources":["../../src/lease-ipc/messages.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAIxB;;;;;;GAMG;AACH,eAAO,MAAM,gBAAgB;;;EAAgC,CAAC;AAE9D,iEAAiE;AACjE,MAAM,MAAM,UAAU,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,gBAAgB,CAAC,CAAC;AAE1D;;;;;;;GAOG;AACH,eAAO,MAAM,eAAe;;;;EAAqC,CAAC;AAElE,mEAAmE;AACnE,MAAM,MAAM,SAAS,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,eAAe,CAAC,CAAC;AAIxD;;;GAGG;AACH,eAAO,MAAM,yBAAyB;;;;;;;;;;;;;;;kBAiB3B,CAAC;AAEZ,iFAAiF;AACjF,MAAM,MAAM,mBAAmB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,yBAAyB,CAAC,CAAC;AAE5E;;GAEG;AACH,eAAO,MAAM,yBAAyB;;;;;;;;;;;;;kBAa3B,CAAC;AAEZ,iFAAiF;AACjF,MAAM,MAAM,mBAAmB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,yBAAyB,CAAC,CAAC;AAE5E;;GAEG;AACH,eAAO,MAAM,uBAAuB;;;;;;;;;;;;;kBAazB,CAAC;AAEZ,6EAA6E;AAC7E,MAAM,MAAM,iBAAiB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,uBAAuB,CAAC,CAAC;AAExE;;;GAGG;AACH,eAAO,MAAM,sBAAsB;;;;;;;;;;;;kBAWxB,CA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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iCAGjC,CAAC;AAEH,6EAA6E;AAC7E,MAAM,MAAM,gBAAgB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,sBAAsB,CAAC,CAAC;AAItE;;;;GAIG;AACH,eAAO,MAAM,uBAAuB,2HAQ1B,CAAC;AAEX;;;GAGG;AACH,eAAO,MAAM,wBAAwB,yLAW3B,CAAC;AAEX;;;GAGG;AACH,eAAO,MAAM,uBAAuB,ySAG1B,CAAC"}
|
|
@@ -0,0 +1,476 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `lease-ipc` v1.1 — PARALLEL message contract (Zod schemas) for the
|
|
3
|
+
* DbWriterLease IPC surface (T11627 ST-1).
|
|
4
|
+
*
|
|
5
|
+
* This is the byte-for-byte TypeScript mirror of the Rust serde types in
|
|
6
|
+
* `crates/cleo-supervisor/src/lease_ipc.rs`. The wire format is newline-delimited
|
|
7
|
+
* JSON (NDJSON): one {@link LeaseIpcEnvelope} per line — identical framing to the
|
|
8
|
+
* frozen `supervisor-ipc` v1.0 envelope, only the version string
|
|
9
|
+
* ({@link LEASE_IPC_PROTOCOL_VERSION}) and the inner union differ.
|
|
10
|
+
*
|
|
11
|
+
* Wire-shape contract (snake_case keys — matches serde defaults):
|
|
12
|
+
*
|
|
13
|
+
* ```jsonc
|
|
14
|
+
* // request
|
|
15
|
+
* { "protocol_version": "1.1.0", "id": "abc", "direction": "request",
|
|
16
|
+
* "request": { "kind": "lease_acquire", "scope": "project", "lane": "tasks",
|
|
17
|
+
* "holder_id": "pid-42:tasks", "priority": 0, "ttl_ms": 30000,
|
|
18
|
+
* "reentrant": true } }
|
|
19
|
+
* // response
|
|
20
|
+
* { "protocol_version": "1.1.0", "id": "abc", "direction": "response",
|
|
21
|
+
* "response": { "kind": "lease_granted", "scope": "project", "lane": "tasks",
|
|
22
|
+
* "holder_id": "pid-42:tasks", "epoch": 7, "ttl_ms": 30000,
|
|
23
|
+
* "expires_at_ms": 1000030000 } }
|
|
24
|
+
* ```
|
|
25
|
+
*
|
|
26
|
+
* Staged delivery: every kind is *declared* so the protocol freeze is stable,
|
|
27
|
+
* but `rate_check` / `tool_grant` handlers are deferred (return
|
|
28
|
+
* `E_LEASE_UNIMPLEMENTED`) until a follow-up task. This module (ST-1) ships the
|
|
29
|
+
* protocol surface with **no consumer** — zero behavior change.
|
|
30
|
+
*
|
|
31
|
+
* @task T11627
|
|
32
|
+
* @packageDocumentation
|
|
33
|
+
*/
|
|
34
|
+
import { z } from 'zod';
|
|
35
|
+
// ─── Shared value types ───────────────────────────────────────────────────────
|
|
36
|
+
/**
|
|
37
|
+
* The cleo.db scope a lease is arbitrated within. Mirrors `DbScope` in Rust.
|
|
38
|
+
*
|
|
39
|
+
* Under the dual-cleo.db split, a `project` lease lives inside the project's
|
|
40
|
+
* `cleo.db` and a `global` lease inside the global `cleo.db` — different files,
|
|
41
|
+
* so they never serialize against each other (AC2).
|
|
42
|
+
*/
|
|
43
|
+
export const LeaseScopeSchema = z.enum(['project', 'global']);
|
|
44
|
+
/**
|
|
45
|
+
* The write lane a lease arbitrates within a single scope file. Mirrors
|
|
46
|
+
* `LeaseLane` in Rust.
|
|
47
|
+
*
|
|
48
|
+
* - `tasks` — the primary task-chokepoint write lane.
|
|
49
|
+
* - `brain` — the BRAIN memory write lane (gated separately — AC4).
|
|
50
|
+
* - `bulk` — the bulk / bypass-writer lane (conduit, telemetry, nexus graph).
|
|
51
|
+
*/
|
|
52
|
+
export const LeaseLaneSchema = z.enum(['tasks', 'brain', 'bulk']);
|
|
53
|
+
// ─── Requests (client → arbiter) ──────────────────────────────────────────────
|
|
54
|
+
/**
|
|
55
|
+
* Acquire (or re-enter) the writer lease for a (scope, lane). Mirrors
|
|
56
|
+
* `LeaseAcquireReq`. `[v1 core]`
|
|
57
|
+
*/
|
|
58
|
+
export const LeaseAcquireRequestSchema = z
|
|
59
|
+
.object({
|
|
60
|
+
/** Tag discriminating this request variant. */
|
|
61
|
+
kind: z.literal('lease_acquire'),
|
|
62
|
+
/** The cleo.db scope being arbitrated. */
|
|
63
|
+
scope: LeaseScopeSchema,
|
|
64
|
+
/** The write lane within the scope. */
|
|
65
|
+
lane: LeaseLaneSchema,
|
|
66
|
+
/** Process+lane holder identity. */
|
|
67
|
+
holder_id: z.string().min(1),
|
|
68
|
+
/** Advisory priority — lower acquires sooner. `0` = highest. */
|
|
69
|
+
priority: z.number().int().min(0).max(255),
|
|
70
|
+
/** Lease time-to-live in milliseconds. */
|
|
71
|
+
ttl_ms: z.number().int().nonnegative(),
|
|
72
|
+
/** When true, a same-holder acquire re-enters (refcount++) rather than queuing. */
|
|
73
|
+
reentrant: z.boolean(),
|
|
74
|
+
})
|
|
75
|
+
.strict();
|
|
76
|
+
/**
|
|
77
|
+
* Release the held writer lease. Mirrors `LeaseReleaseReq`. `[v1 core]`
|
|
78
|
+
*/
|
|
79
|
+
export const LeaseReleaseRequestSchema = z
|
|
80
|
+
.object({
|
|
81
|
+
/** Tag discriminating this request variant. */
|
|
82
|
+
kind: z.literal('lease_release'),
|
|
83
|
+
/** The cleo.db scope being arbitrated. */
|
|
84
|
+
scope: LeaseScopeSchema,
|
|
85
|
+
/** The write lane within the scope. */
|
|
86
|
+
lane: LeaseLaneSchema,
|
|
87
|
+
/** Process+lane holder identity. */
|
|
88
|
+
holder_id: z.string().min(1),
|
|
89
|
+
/** The epoch fence the holder acquired — a stale epoch no-ops. */
|
|
90
|
+
epoch: z.number().int().nonnegative(),
|
|
91
|
+
})
|
|
92
|
+
.strict();
|
|
93
|
+
/**
|
|
94
|
+
* Heartbeat / renew the held lease's TTL. Mirrors `LeaseRenewReq`. `[v1 core]`
|
|
95
|
+
*/
|
|
96
|
+
export const LeaseRenewRequestSchema = z
|
|
97
|
+
.object({
|
|
98
|
+
/** Tag discriminating this request variant. */
|
|
99
|
+
kind: z.literal('lease_renew'),
|
|
100
|
+
/** The cleo.db scope being arbitrated. */
|
|
101
|
+
scope: LeaseScopeSchema,
|
|
102
|
+
/** The write lane within the scope. */
|
|
103
|
+
lane: LeaseLaneSchema,
|
|
104
|
+
/** Process+lane holder identity. */
|
|
105
|
+
holder_id: z.string().min(1),
|
|
106
|
+
/** The epoch fence the holder acquired (epoch-guarded renew). */
|
|
107
|
+
epoch: z.number().int().nonnegative(),
|
|
108
|
+
})
|
|
109
|
+
.strict();
|
|
110
|
+
/**
|
|
111
|
+
* Check the per-scope write rate budget. Mirrors `RateCheckReq`.
|
|
112
|
+
* `[declared; handler deferred — returns E_LEASE_UNIMPLEMENTED]`
|
|
113
|
+
*/
|
|
114
|
+
export const RateCheckRequestSchema = z
|
|
115
|
+
.object({
|
|
116
|
+
/** Tag discriminating this request variant. */
|
|
117
|
+
kind: z.literal('rate_check'),
|
|
118
|
+
/** The cleo.db scope being checked. */
|
|
119
|
+
scope: LeaseScopeSchema,
|
|
120
|
+
/** The write lane within the scope. */
|
|
121
|
+
lane: LeaseLaneSchema,
|
|
122
|
+
/** Estimated bytes the caller intends to write. */
|
|
123
|
+
est_bytes: z.number().int().nonnegative(),
|
|
124
|
+
})
|
|
125
|
+
.strict();
|
|
126
|
+
/**
|
|
127
|
+
* Request a tool-use grant. Mirrors `ToolGrantReq`.
|
|
128
|
+
* `[declared; handler deferred — returns E_LEASE_UNIMPLEMENTED]`
|
|
129
|
+
*/
|
|
130
|
+
export const ToolGrantRequestSchema = z
|
|
131
|
+
.object({
|
|
132
|
+
/** Tag discriminating this request variant. */
|
|
133
|
+
kind: z.literal('tool_grant'),
|
|
134
|
+
/** The tool name being requested. */
|
|
135
|
+
tool: z.string().min(1),
|
|
136
|
+
/** The requesting holder identity. */
|
|
137
|
+
holder_id: z.string().min(1),
|
|
138
|
+
})
|
|
139
|
+
.strict();
|
|
140
|
+
/**
|
|
141
|
+
* The priority class of a `queue_admit` request (T11630). Mirrors the Rust
|
|
142
|
+
* `QueuePriorityClass` enum and `cleo_supervisor::llm_queue::PriorityClass`.
|
|
143
|
+
*
|
|
144
|
+
* `lead > worker > background` — a lead/orchestrator agent is never starved by a
|
|
145
|
+
* background consolidation (AC1).
|
|
146
|
+
*/
|
|
147
|
+
export const QueuePriorityClassSchema = z.enum(['lead', 'worker', 'background']);
|
|
148
|
+
/**
|
|
149
|
+
* Admit (or defer) an outbound LLM call through the supervisor's priority
|
|
150
|
+
* scheduler + per-provider rate governor (T11630 · AC1-AC4). Mirrors
|
|
151
|
+
* `QueueAdmitReq`. `[wired]`
|
|
152
|
+
*/
|
|
153
|
+
export const QueueAdmitRequestSchema = z
|
|
154
|
+
.object({
|
|
155
|
+
/** Tag discriminating this request variant. */
|
|
156
|
+
kind: z.literal('queue_admit'),
|
|
157
|
+
/** The LLM provider id the call targets (rate budget is per-provider). */
|
|
158
|
+
provider: z.string().min(1),
|
|
159
|
+
/** The caller's priority class (lead > worker > background). */
|
|
160
|
+
priority_class: QueuePriorityClassSchema,
|
|
161
|
+
/** The caller's estimate of the request's token cost (debited on admit). */
|
|
162
|
+
est_tokens: z.number().int().nonnegative(),
|
|
163
|
+
/** The child the call belongs to (in-flight tracking — the watchdog seam). */
|
|
164
|
+
child_id: z.string().min(1),
|
|
165
|
+
})
|
|
166
|
+
.strict();
|
|
167
|
+
/**
|
|
168
|
+
* A liveness heartbeat from a managed worker (T11628). Mirrors
|
|
169
|
+
* `WorkerHeartbeatReq`. `[wired]`
|
|
170
|
+
*
|
|
171
|
+
* The worker sends this periodically (well inside the watchdog's NORMAL
|
|
172
|
+
* deadline) so the supervisor knows it is alive. `in_flight_llm` is the worker's
|
|
173
|
+
* OWN view of whether it is currently waiting on an LLM call: when true the
|
|
174
|
+
* watchdog grants the EXTENDED deadline even if the call never went through the
|
|
175
|
+
* `queue_admit` seam, so a slow-but-healthy long call is never false-killed
|
|
176
|
+
* (AC2 · RISK-7).
|
|
177
|
+
*/
|
|
178
|
+
export const WorkerHeartbeatRequestSchema = z
|
|
179
|
+
.object({
|
|
180
|
+
/** Tag discriminating this request variant. */
|
|
181
|
+
kind: z.literal('worker_heartbeat'),
|
|
182
|
+
/** The logical id of the heartbeating child (matches the registry key). */
|
|
183
|
+
child_id: z.string().min(1),
|
|
184
|
+
/** The worker's own view of whether it is currently inside an LLM call. */
|
|
185
|
+
in_flight_llm: z.boolean(),
|
|
186
|
+
})
|
|
187
|
+
.strict();
|
|
188
|
+
/**
|
|
189
|
+
* The discriminated union of all client → arbiter lease requests. The `kind`
|
|
190
|
+
* field selects the variant, matching the serde `#[serde(tag = "kind")]`
|
|
191
|
+
* tagging on the Rust `LeaseRequest` enum.
|
|
192
|
+
*/
|
|
193
|
+
export const LeaseIpcRequestSchema = z.discriminatedUnion('kind', [
|
|
194
|
+
LeaseAcquireRequestSchema,
|
|
195
|
+
LeaseReleaseRequestSchema,
|
|
196
|
+
LeaseRenewRequestSchema,
|
|
197
|
+
RateCheckRequestSchema,
|
|
198
|
+
ToolGrantRequestSchema,
|
|
199
|
+
QueueAdmitRequestSchema,
|
|
200
|
+
WorkerHeartbeatRequestSchema,
|
|
201
|
+
]);
|
|
202
|
+
// ─── Responses (arbiter → client) ─────────────────────────────────────────────
|
|
203
|
+
/**
|
|
204
|
+
* The lease was granted to the caller. Mirrors `LeaseGranted`.
|
|
205
|
+
*/
|
|
206
|
+
export const LeaseGrantedResponseSchema = z
|
|
207
|
+
.object({
|
|
208
|
+
/** Tag discriminating this response variant. */
|
|
209
|
+
kind: z.literal('lease_granted'),
|
|
210
|
+
/** The granted cleo.db scope. */
|
|
211
|
+
scope: LeaseScopeSchema,
|
|
212
|
+
/** The granted write lane. */
|
|
213
|
+
lane: LeaseLaneSchema,
|
|
214
|
+
/** The holder the lease was granted to. */
|
|
215
|
+
holder_id: z.string().min(1),
|
|
216
|
+
/** The monotonic epoch fence assigned to this grant. */
|
|
217
|
+
epoch: z.number().int().nonnegative(),
|
|
218
|
+
/** The lease TTL in milliseconds. */
|
|
219
|
+
ttl_ms: z.number().int().nonnegative(),
|
|
220
|
+
/** Absolute expiry timestamp (epoch ms) for this grant. */
|
|
221
|
+
expires_at_ms: z.number().int().nonnegative(),
|
|
222
|
+
})
|
|
223
|
+
.strict();
|
|
224
|
+
/**
|
|
225
|
+
* The caller was placed in the per-scope FIFO+priority queue. Mirrors
|
|
226
|
+
* `LeaseQueued`.
|
|
227
|
+
*/
|
|
228
|
+
export const LeaseQueuedResponseSchema = z
|
|
229
|
+
.object({
|
|
230
|
+
/** Tag discriminating this response variant. */
|
|
231
|
+
kind: z.literal('lease_queued'),
|
|
232
|
+
/** The queued cleo.db scope. */
|
|
233
|
+
scope: LeaseScopeSchema,
|
|
234
|
+
/** The queued write lane. */
|
|
235
|
+
lane: LeaseLaneSchema,
|
|
236
|
+
/** The monotonic ticket assigned for FIFO tiebreak. */
|
|
237
|
+
ticket: z.number().int().nonnegative(),
|
|
238
|
+
/** Number of waiters ahead of this one. */
|
|
239
|
+
ahead: z.number().int().nonnegative(),
|
|
240
|
+
})
|
|
241
|
+
.strict();
|
|
242
|
+
/**
|
|
243
|
+
* The acquire was denied. Mirrors `LeaseDenied`.
|
|
244
|
+
*/
|
|
245
|
+
export const LeaseDeniedResponseSchema = z
|
|
246
|
+
.object({
|
|
247
|
+
/** Tag discriminating this response variant. */
|
|
248
|
+
kind: z.literal('lease_denied'),
|
|
249
|
+
/** The denied cleo.db scope. */
|
|
250
|
+
scope: LeaseScopeSchema,
|
|
251
|
+
/** Machine-readable denial code (e.g. `E_LEASE_UNAVAILABLE`). */
|
|
252
|
+
code: z.string().min(1),
|
|
253
|
+
/** Human-readable denial message. */
|
|
254
|
+
message: z.string(),
|
|
255
|
+
})
|
|
256
|
+
.strict();
|
|
257
|
+
/**
|
|
258
|
+
* Reply to a deferred `rate_check`. Mirrors `RateResult`.
|
|
259
|
+
*/
|
|
260
|
+
export const RateResultResponseSchema = z
|
|
261
|
+
.object({
|
|
262
|
+
/** Tag discriminating this response variant. */
|
|
263
|
+
kind: z.literal('rate_result'),
|
|
264
|
+
/** The checked cleo.db scope. */
|
|
265
|
+
scope: LeaseScopeSchema,
|
|
266
|
+
/** Whether the write is within budget. */
|
|
267
|
+
ok: z.boolean(),
|
|
268
|
+
/** Suggested back-off in milliseconds when `ok` is false. */
|
|
269
|
+
retry_after_ms: z.number().int().nonnegative(),
|
|
270
|
+
/** Remaining token budget for the scope. */
|
|
271
|
+
tokens_remaining: z.number().int().nonnegative(),
|
|
272
|
+
})
|
|
273
|
+
.strict();
|
|
274
|
+
/**
|
|
275
|
+
* Reply to a deferred `tool_grant`. Mirrors `ToolGranted`.
|
|
276
|
+
*/
|
|
277
|
+
export const ToolGrantedResponseSchema = z
|
|
278
|
+
.object({
|
|
279
|
+
/** Tag discriminating this response variant. */
|
|
280
|
+
kind: z.literal('tool_granted'),
|
|
281
|
+
/** The granted tool name. */
|
|
282
|
+
tool: z.string().min(1),
|
|
283
|
+
/** The holder the tool grant was issued to. */
|
|
284
|
+
holder_id: z.string().min(1),
|
|
285
|
+
})
|
|
286
|
+
.strict();
|
|
287
|
+
/**
|
|
288
|
+
* Unsolicited event: a held lease was revoked. Mirrors `LeaseRevoked`.
|
|
289
|
+
*/
|
|
290
|
+
export const LeaseRevokedResponseSchema = z
|
|
291
|
+
.object({
|
|
292
|
+
/** Tag discriminating this response variant. */
|
|
293
|
+
kind: z.literal('lease_revoked'),
|
|
294
|
+
/** The revoked cleo.db scope. */
|
|
295
|
+
scope: LeaseScopeSchema,
|
|
296
|
+
/** The revoked write lane. */
|
|
297
|
+
lane: LeaseLaneSchema,
|
|
298
|
+
/** The holder whose lease was revoked. */
|
|
299
|
+
holder_id: z.string().min(1),
|
|
300
|
+
/** Human-readable reason for the revocation. */
|
|
301
|
+
reason: z.string(),
|
|
302
|
+
})
|
|
303
|
+
.strict();
|
|
304
|
+
/**
|
|
305
|
+
* Unsolicited event: a lease holder was killed for being unresponsive. Mirrors
|
|
306
|
+
* `ChildKilled` carried by the `child_killed_unresponsive` response variant.
|
|
307
|
+
*/
|
|
308
|
+
export const ChildKilledUnresponsiveResponseSchema = z
|
|
309
|
+
.object({
|
|
310
|
+
/** Tag discriminating this response variant. */
|
|
311
|
+
kind: z.literal('child_killed_unresponsive'),
|
|
312
|
+
/** Logical id of the killed child. */
|
|
313
|
+
child_id: z.string().min(1),
|
|
314
|
+
/** The holder identity the killed child held the lease as. */
|
|
315
|
+
holder_id: z.string().min(1),
|
|
316
|
+
/** The cleo.db scope the killed child held the lease in. */
|
|
317
|
+
scope: LeaseScopeSchema,
|
|
318
|
+
/** Human-readable reason for the kill. */
|
|
319
|
+
reason: z.string(),
|
|
320
|
+
})
|
|
321
|
+
.strict();
|
|
322
|
+
/**
|
|
323
|
+
* The disposition of a `queue_admit` request (T11630). Mirrors
|
|
324
|
+
* `QueueAdmitDisposition` in Rust — `admitted` (execute now) or `deferred`
|
|
325
|
+
* (back off `retry_after_ms` and re-request; AC4 — never a silent drop).
|
|
326
|
+
*/
|
|
327
|
+
export const QueueAdmitDispositionSchema = z.enum(['admitted', 'deferred']);
|
|
328
|
+
/**
|
|
329
|
+
* Reply to a `queue_admit`: the LLM call was admitted or deferred (T11630).
|
|
330
|
+
* Mirrors `QueueAdmitResult`.
|
|
331
|
+
*/
|
|
332
|
+
export const QueueAdmitResultResponseSchema = z
|
|
333
|
+
.object({
|
|
334
|
+
/** Tag discriminating this response variant. */
|
|
335
|
+
kind: z.literal('queue_admit_result'),
|
|
336
|
+
/** Whether the LLM call was admitted or deferred. */
|
|
337
|
+
disposition: QueueAdmitDispositionSchema,
|
|
338
|
+
/** Back-off in ms before re-requesting (0 when admitted). */
|
|
339
|
+
retry_after_ms: z.number().int().nonnegative(),
|
|
340
|
+
/** Remaining provider token budget after this decision. */
|
|
341
|
+
tokens_remaining: z.number().int().nonnegative(),
|
|
342
|
+
/** Number of higher/equal-priority waiters ahead (0 when admitted). */
|
|
343
|
+
queue_position: z.number().int().nonnegative(),
|
|
344
|
+
})
|
|
345
|
+
.strict();
|
|
346
|
+
/**
|
|
347
|
+
* Acknowledge a `worker_heartbeat` (T11628). Mirrors `HeartbeatAck`.
|
|
348
|
+
*
|
|
349
|
+
* Deliberately carries only its `kind` — the ack's presence (correlated by id)
|
|
350
|
+
* is the signal that the watchdog recorded the beat and reset the child's
|
|
351
|
+
* deadline. Matches the Rust unit-struct wire shape `{ "kind": "heartbeat_ack" }`.
|
|
352
|
+
*/
|
|
353
|
+
export const HeartbeatAckResponseSchema = z
|
|
354
|
+
.object({
|
|
355
|
+
/** Tag discriminating this response variant. */
|
|
356
|
+
kind: z.literal('heartbeat_ack'),
|
|
357
|
+
})
|
|
358
|
+
.strict();
|
|
359
|
+
/**
|
|
360
|
+
* An error response correlated to a request. Mirrors the v1.0
|
|
361
|
+
* `crate::ipc::ErrorResult` shape reused by the Rust `LeaseResponse::Error`
|
|
362
|
+
* variant — error framing is shared across protocol versions.
|
|
363
|
+
*/
|
|
364
|
+
export const LeaseErrorResponseSchema = z
|
|
365
|
+
.object({
|
|
366
|
+
/** Tag discriminating this response variant. */
|
|
367
|
+
kind: z.literal('error'),
|
|
368
|
+
/** Machine-readable error code (e.g. `E_LEASE_BAD_VERSION`, `E_LEASE_UNIMPLEMENTED`). */
|
|
369
|
+
code: z.string().min(1),
|
|
370
|
+
/** Human-readable error message. */
|
|
371
|
+
message: z.string(),
|
|
372
|
+
})
|
|
373
|
+
.strict();
|
|
374
|
+
/**
|
|
375
|
+
* The discriminated union of all arbiter → client lease responses and events.
|
|
376
|
+
* The `kind` field selects the variant, matching the serde
|
|
377
|
+
* `#[serde(tag = "kind")]` tagging on the Rust `LeaseResponse` enum.
|
|
378
|
+
*/
|
|
379
|
+
export const LeaseIpcResponseSchema = z.discriminatedUnion('kind', [
|
|
380
|
+
LeaseGrantedResponseSchema,
|
|
381
|
+
LeaseQueuedResponseSchema,
|
|
382
|
+
LeaseDeniedResponseSchema,
|
|
383
|
+
RateResultResponseSchema,
|
|
384
|
+
ToolGrantedResponseSchema,
|
|
385
|
+
LeaseRevokedResponseSchema,
|
|
386
|
+
ChildKilledUnresponsiveResponseSchema,
|
|
387
|
+
QueueAdmitResultResponseSchema,
|
|
388
|
+
HeartbeatAckResponseSchema,
|
|
389
|
+
LeaseErrorResponseSchema,
|
|
390
|
+
]);
|
|
391
|
+
// ─── Envelope ──────────────────────────────────────────────────────────────────
|
|
392
|
+
/**
|
|
393
|
+
* A client → arbiter lease request envelope.
|
|
394
|
+
*
|
|
395
|
+
* The `direction` discriminator + flattened `request` payload mirror the serde
|
|
396
|
+
* `#[serde(tag = "direction")]` `LeasePayload::Request { request }` variant.
|
|
397
|
+
*/
|
|
398
|
+
export const LeaseIpcRequestEnvelopeSchema = z
|
|
399
|
+
.object({
|
|
400
|
+
/** Parallel protocol version. */
|
|
401
|
+
protocol_version: z.string(),
|
|
402
|
+
/** Correlation id echoed back on the matching response. */
|
|
403
|
+
id: z.string().min(1),
|
|
404
|
+
/** Direction discriminator. */
|
|
405
|
+
direction: z.literal('request'),
|
|
406
|
+
/** The request body. */
|
|
407
|
+
request: LeaseIpcRequestSchema,
|
|
408
|
+
})
|
|
409
|
+
.strict();
|
|
410
|
+
/**
|
|
411
|
+
* An arbiter → client lease response/event envelope.
|
|
412
|
+
*
|
|
413
|
+
* The `direction` discriminator + flattened `response` payload mirror the serde
|
|
414
|
+
* `LeasePayload::Response { response }` variant.
|
|
415
|
+
*/
|
|
416
|
+
export const LeaseIpcResponseEnvelopeSchema = z
|
|
417
|
+
.object({
|
|
418
|
+
/** Parallel protocol version. */
|
|
419
|
+
protocol_version: z.string(),
|
|
420
|
+
/** Correlation id echoed from the originating request (or a fresh id for events). */
|
|
421
|
+
id: z.string().min(1),
|
|
422
|
+
/** Direction discriminator. */
|
|
423
|
+
direction: z.literal('response'),
|
|
424
|
+
/** The response body. */
|
|
425
|
+
response: LeaseIpcResponseSchema,
|
|
426
|
+
})
|
|
427
|
+
.strict();
|
|
428
|
+
/**
|
|
429
|
+
* The top-level lease IPC envelope: a versioned, correlated wrapper that is
|
|
430
|
+
* either a request or a response, discriminated by `direction`. One envelope per
|
|
431
|
+
* NDJSON line. Mirrors the Rust `LeaseEnvelope`.
|
|
432
|
+
*/
|
|
433
|
+
export const LeaseIpcEnvelopeSchema = z.discriminatedUnion('direction', [
|
|
434
|
+
LeaseIpcRequestEnvelopeSchema,
|
|
435
|
+
LeaseIpcResponseEnvelopeSchema,
|
|
436
|
+
]);
|
|
437
|
+
// ─── Frozen message-set guard ──────────────────────────────────────────────────
|
|
438
|
+
/**
|
|
439
|
+
* The v1.1 request `kind` values, in declaration order. The schema-drift guard
|
|
440
|
+
* test pins this tuple; any addition/removal is a contract-breaking change
|
|
441
|
+
* requiring a coordinated dual (Rust + TS) edit.
|
|
442
|
+
*/
|
|
443
|
+
export const LEASE_IPC_REQUEST_KINDS = [
|
|
444
|
+
'lease_acquire',
|
|
445
|
+
'lease_release',
|
|
446
|
+
'lease_renew',
|
|
447
|
+
'rate_check',
|
|
448
|
+
'tool_grant',
|
|
449
|
+
'queue_admit',
|
|
450
|
+
'worker_heartbeat',
|
|
451
|
+
];
|
|
452
|
+
/**
|
|
453
|
+
* The v1.1 response `kind` values, in declaration order. The schema-drift guard
|
|
454
|
+
* test pins this tuple.
|
|
455
|
+
*/
|
|
456
|
+
export const LEASE_IPC_RESPONSE_KINDS = [
|
|
457
|
+
'lease_granted',
|
|
458
|
+
'lease_queued',
|
|
459
|
+
'lease_denied',
|
|
460
|
+
'rate_result',
|
|
461
|
+
'tool_granted',
|
|
462
|
+
'lease_revoked',
|
|
463
|
+
'child_killed_unresponsive',
|
|
464
|
+
'queue_admit_result',
|
|
465
|
+
'heartbeat_ack',
|
|
466
|
+
'error',
|
|
467
|
+
];
|
|
468
|
+
/**
|
|
469
|
+
* The complete v1.1 message kind set (requests + responses), used by the drift
|
|
470
|
+
* guard on both the TS and Rust sides.
|
|
471
|
+
*/
|
|
472
|
+
export const LEASE_IPC_MESSAGE_KINDS = [
|
|
473
|
+
...LEASE_IPC_REQUEST_KINDS,
|
|
474
|
+
...LEASE_IPC_RESPONSE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
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* PARALLEL protocol version for the `lease-ipc` v1.1 contract (T11627 ST-1).
|
|
3
|
+
*
|
|
4
|
+
* The Rust arbiter (`crates/cleo-supervisor/src/lease_ipc.rs`) and this
|
|
5
|
+
* TypeScript contract MUST agree on this value. It runs **in parallel** to the
|
|
6
|
+
* byte-frozen `supervisor-ipc` v1.0 contract: the two are distinguished on the
|
|
7
|
+
* wire purely by this version string, so a single accept loop can route
|
|
8
|
+
* `'1.0.0'` → the v1.0 union and `'1.1.0'` → the lease union. Bump only via a
|
|
9
|
+
* coordinated dual (Rust + TS) edit, never edit this value in place.
|
|
10
|
+
*
|
|
11
|
+
* @see {@link LEASE_IPC_MESSAGE_KINDS} for the v1.1 message set.
|
|
12
|
+
* @task T11627
|
|
13
|
+
* @packageDocumentation
|
|
14
|
+
*/
|
|
15
|
+
/**
|
|
16
|
+
* The `lease-ipc` v1.1 protocol version string.
|
|
17
|
+
*
|
|
18
|
+
* Mirrors `cleo_supervisor::lease_ipc::LEASE_IPC_PROTOCOL_VERSION` on the Rust
|
|
19
|
+
* side. Both the Rust schema-drift guard (`lease_ipc::tests`) and the TS drift
|
|
20
|
+
* test (`__tests__/freeze.test.ts`) pin this exact value.
|
|
21
|
+
*/
|
|
22
|
+
export declare const LEASE_IPC_PROTOCOL_VERSION: "1.1.0";
|
|
23
|
+
/**
|
|
24
|
+
* Whether the given version string is the frozen `lease-ipc` v1.1 wire version.
|
|
25
|
+
*
|
|
26
|
+
* Used by an accept-loop version router to confirm a frame is a lease-protocol
|
|
27
|
+
* frame before dispatching it through the {@link LEASE_IPC_PROTOCOL_VERSION}
|
|
28
|
+
* union (rather than the v1.0 supervisor-ipc union).
|
|
29
|
+
*
|
|
30
|
+
* @param version - The `protocol_version` field read off an inbound envelope.
|
|
31
|
+
* @returns `true` iff `version` equals {@link LEASE_IPC_PROTOCOL_VERSION}.
|
|
32
|
+
*
|
|
33
|
+
* @example
|
|
34
|
+
* ```ts
|
|
35
|
+
* if (isFrozenLeaseIpcVersion(env.protocol_version)) {
|
|
36
|
+
* // dispatch through LeaseIpcEnvelopeSchema
|
|
37
|
+
* }
|
|
38
|
+
* ```
|
|
39
|
+
*/
|
|
40
|
+
export declare function isFrozenLeaseIpcVersion(version: string): version is typeof LEASE_IPC_PROTOCOL_VERSION;
|
|
41
|
+
//# sourceMappingURL=version.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"version.d.ts","sourceRoot":"","sources":["../../src/lease-ipc/version.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH;;;;;;GAMG;AACH,eAAO,MAAM,0BAA0B,EAAG,OAAgB,CAAC;AAE3D;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,uBAAuB,CACrC,OAAO,EAAE,MAAM,GACd,OAAO,IAAI,OAAO,0BAA0B,CAE9C"}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* PARALLEL protocol version for the `lease-ipc` v1.1 contract (T11627 ST-1).
|
|
3
|
+
*
|
|
4
|
+
* The Rust arbiter (`crates/cleo-supervisor/src/lease_ipc.rs`) and this
|
|
5
|
+
* TypeScript contract MUST agree on this value. It runs **in parallel** to the
|
|
6
|
+
* byte-frozen `supervisor-ipc` v1.0 contract: the two are distinguished on the
|
|
7
|
+
* wire purely by this version string, so a single accept loop can route
|
|
8
|
+
* `'1.0.0'` → the v1.0 union and `'1.1.0'` → the lease union. Bump only via a
|
|
9
|
+
* coordinated dual (Rust + TS) edit, never edit this value in place.
|
|
10
|
+
*
|
|
11
|
+
* @see {@link LEASE_IPC_MESSAGE_KINDS} for the v1.1 message set.
|
|
12
|
+
* @task T11627
|
|
13
|
+
* @packageDocumentation
|
|
14
|
+
*/
|
|
15
|
+
/**
|
|
16
|
+
* The `lease-ipc` v1.1 protocol version string.
|
|
17
|
+
*
|
|
18
|
+
* Mirrors `cleo_supervisor::lease_ipc::LEASE_IPC_PROTOCOL_VERSION` on the Rust
|
|
19
|
+
* side. Both the Rust schema-drift guard (`lease_ipc::tests`) and the TS drift
|
|
20
|
+
* test (`__tests__/freeze.test.ts`) pin this exact value.
|
|
21
|
+
*/
|
|
22
|
+
export const LEASE_IPC_PROTOCOL_VERSION = '1.1.0';
|
|
23
|
+
/**
|
|
24
|
+
* Whether the given version string is the frozen `lease-ipc` v1.1 wire version.
|
|
25
|
+
*
|
|
26
|
+
* Used by an accept-loop version router to confirm a frame is a lease-protocol
|
|
27
|
+
* frame before dispatching it through the {@link LEASE_IPC_PROTOCOL_VERSION}
|
|
28
|
+
* union (rather than the v1.0 supervisor-ipc union).
|
|
29
|
+
*
|
|
30
|
+
* @param version - The `protocol_version` field read off an inbound envelope.
|
|
31
|
+
* @returns `true` iff `version` equals {@link LEASE_IPC_PROTOCOL_VERSION}.
|
|
32
|
+
*
|
|
33
|
+
* @example
|
|
34
|
+
* ```ts
|
|
35
|
+
* if (isFrozenLeaseIpcVersion(env.protocol_version)) {
|
|
36
|
+
* // dispatch through LeaseIpcEnvelopeSchema
|
|
37
|
+
* }
|
|
38
|
+
* ```
|
|
39
|
+
*/
|
|
40
|
+
export function isFrozenLeaseIpcVersion(version) {
|
|
41
|
+
return version === LEASE_IPC_PROTOCOL_VERSION;
|
|
42
|
+
}
|
|
43
|
+
//# sourceMappingURL=version.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"version.js","sourceRoot":"","sources":["../../src/lease-ipc/version.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,0BAA0B,GAAG,OAAgB,CAAC;AAE3D;;;;;;;;;;;;;;;;GAgBG;AACH,MAAM,UAAU,uBAAuB,CACrC,OAAe;IAEf,OAAO,OAAO,KAAK,0BAA0B,CAAC;AAChD,CAAC"}
|