@cleocode/contracts 2026.5.129 → 2026.5.131
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__/atomic-tools-contract.test.d.ts +14 -0
- package/dist/__tests__/atomic-tools-contract.test.d.ts.map +1 -0
- package/dist/__tests__/atomic-tools-contract.test.js +55 -0
- package/dist/__tests__/atomic-tools-contract.test.js.map +1 -0
- package/dist/__tests__/gateway-contract.test.d.ts +18 -0
- package/dist/__tests__/gateway-contract.test.d.ts.map +1 -0
- package/dist/__tests__/gateway-contract.test.js +187 -0
- package/dist/__tests__/gateway-contract.test.js.map +1 -0
- package/dist/__tests__/mvi.test.d.ts +17 -0
- package/dist/__tests__/mvi.test.d.ts.map +1 -0
- package/dist/__tests__/mvi.test.js +147 -0
- package/dist/__tests__/mvi.test.js.map +1 -0
- package/dist/__tests__/operation-def.test.js +1 -1
- package/dist/__tests__/operation-def.test.js.map +1 -1
- package/dist/boundary.d.ts +26 -0
- package/dist/boundary.d.ts.map +1 -1
- package/dist/boundary.js +42 -4
- package/dist/boundary.js.map +1 -1
- package/dist/branch-lock.d.ts +35 -1
- package/dist/branch-lock.d.ts.map +1 -1
- package/dist/branch-lock.js +23 -2
- package/dist/branch-lock.js.map +1 -1
- package/dist/daemon/__tests__/health-roundtrip.test.d.ts +13 -0
- package/dist/daemon/__tests__/health-roundtrip.test.d.ts.map +1 -0
- package/dist/daemon/__tests__/health-roundtrip.test.js +69 -0
- package/dist/daemon/__tests__/health-roundtrip.test.js.map +1 -0
- package/dist/daemon/health.d.ts +108 -0
- package/dist/daemon/health.d.ts.map +1 -0
- package/dist/daemon/health.js +95 -0
- package/dist/daemon/health.js.map +1 -0
- package/dist/daemon/index.d.ts +24 -0
- package/dist/daemon/index.d.ts.map +1 -0
- package/dist/daemon/index.js +22 -0
- package/dist/daemon/index.js.map +1 -0
- package/dist/daemon/subsystem.d.ts +121 -0
- package/dist/daemon/subsystem.d.ts.map +1 -0
- package/dist/daemon/subsystem.js +28 -0
- package/dist/daemon/subsystem.js.map +1 -0
- package/dist/daemon-ipc/__tests__/daemon-ipc-freeze.test.d.ts +15 -0
- package/dist/daemon-ipc/__tests__/daemon-ipc-freeze.test.d.ts.map +1 -0
- package/dist/daemon-ipc/__tests__/daemon-ipc-freeze.test.js +40 -0
- package/dist/daemon-ipc/__tests__/daemon-ipc-freeze.test.js.map +1 -0
- package/dist/daemon-ipc/index.d.ts +44 -0
- package/dist/daemon-ipc/index.d.ts.map +1 -0
- package/dist/daemon-ipc/index.js +43 -0
- package/dist/daemon-ipc/index.js.map +1 -0
- package/dist/db-inventory.json +8 -8
- package/dist/dispatch/identity.d.ts +1 -1
- package/dist/dispatch/identity.d.ts.map +1 -1
- package/dist/dispatch/identity.js +3 -0
- package/dist/dispatch/identity.js.map +1 -1
- package/dist/dispatch/operation-def.d.ts +16 -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 +133 -0
- package/dist/dispatch/operations-registry.js.map +1 -1
- package/dist/exit-codes.d.ts +1 -1
- package/dist/exit-codes.js +1 -1
- package/dist/gateway/rpc/__tests__/freeze.test.d.ts +20 -0
- package/dist/gateway/rpc/__tests__/freeze.test.d.ts.map +1 -0
- package/dist/gateway/rpc/__tests__/freeze.test.js +122 -0
- package/dist/gateway/rpc/__tests__/freeze.test.js.map +1 -0
- package/dist/gateway/rpc/index.d.ts +23 -0
- package/dist/gateway/rpc/index.d.ts.map +1 -0
- package/dist/gateway/rpc/index.js +22 -0
- package/dist/gateway/rpc/index.js.map +1 -0
- package/dist/gateway/rpc/messages.d.ts +263 -0
- package/dist/gateway/rpc/messages.d.ts.map +1 -0
- package/dist/gateway/rpc/messages.js +152 -0
- package/dist/gateway/rpc/messages.js.map +1 -0
- package/dist/gateway/rpc/version.d.ts +39 -0
- package/dist/gateway/rpc/version.d.ts.map +1 -0
- package/dist/gateway/rpc/version.js +39 -0
- package/dist/gateway/rpc/version.js.map +1 -0
- package/dist/gateway.d.ts +239 -0
- package/dist/gateway.d.ts.map +1 -0
- package/dist/gateway.js +171 -0
- package/dist/gateway.js.map +1 -0
- package/dist/goal.d.ts +314 -0
- package/dist/goal.d.ts.map +1 -0
- package/dist/goal.js +118 -0
- package/dist/goal.js.map +1 -0
- package/dist/index.d.ts +9 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +10 -0
- package/dist/index.js.map +1 -1
- package/dist/mvi.d.ts +209 -0
- package/dist/mvi.d.ts.map +1 -0
- package/dist/mvi.js +99 -0
- package/dist/mvi.js.map +1 -0
- package/dist/operations/attention.d.ts +114 -0
- package/dist/operations/attention.d.ts.map +1 -0
- package/dist/operations/attention.js +22 -0
- package/dist/operations/attention.js.map +1 -0
- package/dist/operations/docs.d.ts +7 -1
- package/dist/operations/docs.d.ts.map +1 -1
- package/dist/operations/docs.js.map +1 -1
- package/dist/operations/focus.d.ts +25 -0
- package/dist/operations/focus.d.ts.map +1 -1
- package/dist/operations/index.d.ts +1 -0
- package/dist/operations/index.d.ts.map +1 -1
- package/dist/operations/index.js +1 -0
- package/dist/operations/index.js.map +1 -1
- package/dist/operations/session.d.ts +11 -0
- package/dist/operations/session.d.ts.map +1 -1
- package/dist/sdk-tool.d.ts +1 -1
- package/dist/sdk-tool.js +1 -1
- package/dist/supervisor-ipc/__tests__/freeze.test.d.ts +15 -0
- package/dist/supervisor-ipc/__tests__/freeze.test.d.ts.map +1 -0
- package/dist/supervisor-ipc/__tests__/freeze.test.js +159 -0
- package/dist/supervisor-ipc/__tests__/freeze.test.js.map +1 -0
- package/dist/supervisor-ipc/index.d.ts +15 -0
- package/dist/supervisor-ipc/index.d.ts.map +1 -0
- package/dist/supervisor-ipc/index.js +14 -0
- package/dist/supervisor-ipc/index.js.map +1 -0
- package/dist/supervisor-ipc/messages.d.ts +457 -0
- package/dist/supervisor-ipc/messages.d.ts.map +1 -0
- package/dist/supervisor-ipc/messages.js +312 -0
- package/dist/supervisor-ipc/messages.js.map +1 -0
- package/dist/supervisor-ipc/version.d.ts +29 -0
- package/dist/supervisor-ipc/version.d.ts.map +1 -0
- package/dist/supervisor-ipc/version.js +29 -0
- package/dist/supervisor-ipc/version.js.map +1 -0
- package/dist/tools/__tests__/composite.test.d.ts +14 -0
- package/dist/tools/__tests__/composite.test.d.ts.map +1 -0
- package/dist/tools/__tests__/composite.test.js +75 -0
- package/dist/tools/__tests__/composite.test.js.map +1 -0
- package/dist/tools/atomic.d.ts +195 -0
- package/dist/tools/atomic.d.ts.map +1 -0
- package/dist/tools/atomic.js +82 -0
- package/dist/tools/atomic.js.map +1 -0
- package/dist/tools/composite.d.ts +128 -0
- package/dist/tools/composite.d.ts.map +1 -0
- package/dist/tools/composite.js +88 -0
- package/dist/tools/composite.js.map +1 -0
- package/package.json +35 -3
- package/src/__tests__/__snapshots__/operations-registry.test.ts.snap +1 -1
- package/src/__tests__/atomic-tools-contract.test.ts +67 -0
- package/src/__tests__/gateway-contract.test.ts +219 -0
- package/src/__tests__/mvi.test.ts +175 -0
- package/src/__tests__/operation-def.test.ts +2 -1
- package/src/boundary.ts +74 -4
- package/src/branch-lock.ts +49 -2
- package/src/daemon/__tests__/health-roundtrip.test.ts +84 -0
- package/src/daemon/health.ts +121 -0
- package/src/daemon/index.ts +35 -0
- package/src/daemon/subsystem.ts +126 -0
- package/src/daemon-ipc/__tests__/daemon-ipc-freeze.test.ts +53 -0
- package/src/daemon-ipc/index.ts +90 -0
- package/src/db-inventory.json +8 -8
- package/src/dispatch/identity.ts +3 -0
- package/src/dispatch/operation-def.ts +16 -0
- package/src/dispatch/operations-registry.ts +140 -0
- package/src/exit-codes.ts +1 -1
- package/src/gateway/rpc/__tests__/freeze.test.ts +139 -0
- package/src/gateway/rpc/index.ts +43 -0
- package/src/gateway/rpc/messages.ts +187 -0
- package/src/gateway/rpc/version.ts +40 -0
- package/src/gateway.ts +252 -0
- package/src/goal.ts +348 -0
- package/src/index.ts +109 -0
- package/src/mvi.ts +236 -0
- package/src/operations/attention.ts +117 -0
- package/src/operations/docs.ts +7 -1
- package/src/operations/focus.ts +26 -0
- package/src/operations/index.ts +1 -0
- package/src/operations/session.ts +11 -0
- package/src/sdk-tool.ts +1 -1
- package/src/supervisor-ipc/__tests__/freeze.test.ts +180 -0
- package/src/supervisor-ipc/index.ts +62 -0
- package/src/supervisor-ipc/messages.ts +396 -0
- package/src/supervisor-ipc/version.ts +30 -0
- package/src/tools/__tests__/composite.test.ts +88 -0
- package/src/tools/atomic.ts +274 -0
- package/src/tools/composite.ts +173 -0
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Daemon subsystem + lifecycle-hook contracts.
|
|
3
|
+
*
|
|
4
|
+
* A **subsystem** is one supervised unit of long-running work inside a CLEO
|
|
5
|
+
* daemon process — Studio supervision, the GC cron, the web server, the
|
|
6
|
+
* docs-viewer, the runtime poller. Each declares a uniform lifecycle
|
|
7
|
+
* (`start → healthProbe → shutdown`) so the `@cleocode/runtime/daemon`
|
|
8
|
+
* registry can drive them identically and the Rust `cleo-supervisor` can
|
|
9
|
+
* aggregate their health over the FROZEN `supervisor-ipc` v1.0 contract.
|
|
10
|
+
*
|
|
11
|
+
* These are **pure type contracts** (no runtime/IO). The implementation —
|
|
12
|
+
* `defineSubsystem()`, the registry, the NDJSON client — lives in
|
|
13
|
+
* `@cleocode/runtime/daemon` (R2 child T11367) and imports these types rather
|
|
14
|
+
* than redeclaring them (Contracts Fan-Out gate, T10074).
|
|
15
|
+
*
|
|
16
|
+
* @packageDocumentation
|
|
17
|
+
* @module @cleocode/contracts/daemon
|
|
18
|
+
*
|
|
19
|
+
* @epic T11253 R2 — `@cleocode/runtime/daemon` submodule
|
|
20
|
+
* @task T11366 — daemon lifecycle + subsystem contracts
|
|
21
|
+
* @saga T11243 SG-RUNTIME-UNIFICATION
|
|
22
|
+
*/
|
|
23
|
+
import type { SubsystemHealth } from './health.js';
|
|
24
|
+
/**
|
|
25
|
+
* Lifecycle hooks fired by the subsystem registry around a subsystem's
|
|
26
|
+
* `start`/`shutdown` transitions.
|
|
27
|
+
*
|
|
28
|
+
* All hooks are optional and may be async. They are observational — a hook
|
|
29
|
+
* MUST NOT mutate registry state. `onError` is the single failure sink: a
|
|
30
|
+
* throwing `start` or `shutdown`, or a rejected `healthProbe`, surfaces here.
|
|
31
|
+
*
|
|
32
|
+
* Hooks fire in a defined order relative to the underlying transition:
|
|
33
|
+
* - `onStart` — after the subsystem's `start()` resolves.
|
|
34
|
+
* - `onShutdown` — after the subsystem's `shutdown()` resolves.
|
|
35
|
+
* - `onError` — when any lifecycle step throws/rejects (start, probe, or
|
|
36
|
+
* shutdown), with the offending `error` and the `phase` it occurred in.
|
|
37
|
+
*/
|
|
38
|
+
export interface DaemonLifecycleHooks {
|
|
39
|
+
/**
|
|
40
|
+
* Fired after the subsystem has successfully started.
|
|
41
|
+
*
|
|
42
|
+
* @param name - The logical subsystem name.
|
|
43
|
+
*/
|
|
44
|
+
onStart?: (name: string) => void | Promise<void>;
|
|
45
|
+
/**
|
|
46
|
+
* Fired after the subsystem has successfully shut down.
|
|
47
|
+
*
|
|
48
|
+
* @param name - The logical subsystem name.
|
|
49
|
+
*/
|
|
50
|
+
onShutdown?: (name: string) => void | Promise<void>;
|
|
51
|
+
/**
|
|
52
|
+
* Fired when a lifecycle step throws or rejects. The single failure sink.
|
|
53
|
+
*
|
|
54
|
+
* @param name - The logical subsystem name.
|
|
55
|
+
* @param error - The thrown value, normalized to an `Error`.
|
|
56
|
+
* @param phase - Which lifecycle step failed.
|
|
57
|
+
*/
|
|
58
|
+
onError?: (name: string, error: Error, phase: SubsystemLifecyclePhase) => void | Promise<void>;
|
|
59
|
+
}
|
|
60
|
+
/**
|
|
61
|
+
* The lifecycle phase a subsystem transition is in, used to tag
|
|
62
|
+
* {@link DaemonLifecycleHooks.onError} and registry diagnostics.
|
|
63
|
+
*/
|
|
64
|
+
export type SubsystemLifecyclePhase = 'start' | 'healthProbe' | 'shutdown';
|
|
65
|
+
/**
|
|
66
|
+
* The frozen, ordered set of lifecycle phases. Pinned by the daemon test suite
|
|
67
|
+
* so a phase cannot be silently added or removed.
|
|
68
|
+
*/
|
|
69
|
+
export declare const SUBSYSTEM_LIFECYCLE_PHASES: readonly ["start", "healthProbe", "shutdown"];
|
|
70
|
+
/**
|
|
71
|
+
* A subsystem descriptor — the declarative unit `defineSubsystem()` produces
|
|
72
|
+
* and the registry drives.
|
|
73
|
+
*
|
|
74
|
+
* The three lifecycle methods are intentionally minimal and uniform so that
|
|
75
|
+
* every long-running concern (supervised child process, cron job, HTTP server)
|
|
76
|
+
* can be expressed identically:
|
|
77
|
+
*
|
|
78
|
+
* - `start` — bring the subsystem up. May be async. Idempotent callers
|
|
79
|
+
* should guard re-entry.
|
|
80
|
+
* - `healthProbe` — report current liveness as a {@link SubsystemHealth} row.
|
|
81
|
+
* Maps onto a supervised `ChildStatus` the Rust supervisor aggregates.
|
|
82
|
+
* - `shutdown` — bring the subsystem down gracefully. May be async.
|
|
83
|
+
*
|
|
84
|
+
* @typeParam TContext - Optional opaque context the registry threads through
|
|
85
|
+
* `start`/`shutdown` (e.g. a resolved config or handle). Defaults to `void`.
|
|
86
|
+
*/
|
|
87
|
+
export interface Subsystem<TContext = void> {
|
|
88
|
+
/** Logical, stable subsystem name (matches the supervised `child_id`). */
|
|
89
|
+
readonly name: string;
|
|
90
|
+
/**
|
|
91
|
+
* Bring the subsystem up. The resolved value is threaded back into
|
|
92
|
+
* `shutdown` as its context argument.
|
|
93
|
+
*
|
|
94
|
+
* @returns The subsystem context (or `void`).
|
|
95
|
+
*/
|
|
96
|
+
start: () => TContext | Promise<TContext>;
|
|
97
|
+
/**
|
|
98
|
+
* Report the subsystem's current health as a single
|
|
99
|
+
* {@link SubsystemHealth} row.
|
|
100
|
+
*
|
|
101
|
+
* @returns The current health row.
|
|
102
|
+
*/
|
|
103
|
+
healthProbe: () => SubsystemHealth | Promise<SubsystemHealth>;
|
|
104
|
+
/**
|
|
105
|
+
* Bring the subsystem down gracefully.
|
|
106
|
+
*
|
|
107
|
+
* @param context - The value returned by `start`.
|
|
108
|
+
*/
|
|
109
|
+
shutdown: (context: TContext) => void | Promise<void>;
|
|
110
|
+
}
|
|
111
|
+
/**
|
|
112
|
+
* The descriptor passed to `defineSubsystem()` — the same surface as
|
|
113
|
+
* {@link Subsystem} (a 1:1 mapping; `defineSubsystem` validates + freezes it).
|
|
114
|
+
*
|
|
115
|
+
* Exposed as a distinct name so call-sites can annotate the literal they pass
|
|
116
|
+
* without importing the post-construction {@link Subsystem} type.
|
|
117
|
+
*
|
|
118
|
+
* @typeParam TContext - See {@link Subsystem}.
|
|
119
|
+
*/
|
|
120
|
+
export type SubsystemDefinition<TContext = void> = Subsystem<TContext>;
|
|
121
|
+
//# sourceMappingURL=subsystem.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"subsystem.d.ts","sourceRoot":"","sources":["../../src/daemon/subsystem.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAEH,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAEnD;;;;;;;;;;;;;GAaG;AACH,MAAM,WAAW,oBAAoB;IACnC;;;;OAIG;IACH,OAAO,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IACjD;;;;OAIG;IACH,UAAU,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IACpD;;;;;;OAMG;IACH,OAAO,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,uBAAuB,KAAK,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CAChG;AAED;;;GAGG;AACH,MAAM,MAAM,uBAAuB,GAAG,OAAO,GAAG,aAAa,GAAG,UAAU,CAAC;AAE3E;;;GAGG;AACH,eAAO,MAAM,0BAA0B,+CAAgD,CAAC;AAExF;;;;;;;;;;;;;;;;GAgBG;AACH,MAAM,WAAW,SAAS,CAAC,QAAQ,GAAG,IAAI;IACxC,0EAA0E;IAC1E,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB;;;;;OAKG;IACH,KAAK,EAAE,MAAM,QAAQ,GAAG,OAAO,CAAC,QAAQ,CAAC,CAAC;IAC1C;;;;;OAKG;IACH,WAAW,EAAE,MAAM,eAAe,GAAG,OAAO,CAAC,eAAe,CAAC,CAAC;IAC9D;;;;OAIG;IACH,QAAQ,EAAE,CAAC,OAAO,EAAE,QAAQ,KAAK,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CACvD;AAED;;;;;;;;GAQG;AACH,MAAM,MAAM,mBAAmB,CAAC,QAAQ,GAAG,IAAI,IAAI,SAAS,CAAC,QAAQ,CAAC,CAAC"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Daemon subsystem + lifecycle-hook contracts.
|
|
3
|
+
*
|
|
4
|
+
* A **subsystem** is one supervised unit of long-running work inside a CLEO
|
|
5
|
+
* daemon process — Studio supervision, the GC cron, the web server, the
|
|
6
|
+
* docs-viewer, the runtime poller. Each declares a uniform lifecycle
|
|
7
|
+
* (`start → healthProbe → shutdown`) so the `@cleocode/runtime/daemon`
|
|
8
|
+
* registry can drive them identically and the Rust `cleo-supervisor` can
|
|
9
|
+
* aggregate their health over the FROZEN `supervisor-ipc` v1.0 contract.
|
|
10
|
+
*
|
|
11
|
+
* These are **pure type contracts** (no runtime/IO). The implementation —
|
|
12
|
+
* `defineSubsystem()`, the registry, the NDJSON client — lives in
|
|
13
|
+
* `@cleocode/runtime/daemon` (R2 child T11367) and imports these types rather
|
|
14
|
+
* than redeclaring them (Contracts Fan-Out gate, T10074).
|
|
15
|
+
*
|
|
16
|
+
* @packageDocumentation
|
|
17
|
+
* @module @cleocode/contracts/daemon
|
|
18
|
+
*
|
|
19
|
+
* @epic T11253 R2 — `@cleocode/runtime/daemon` submodule
|
|
20
|
+
* @task T11366 — daemon lifecycle + subsystem contracts
|
|
21
|
+
* @saga T11243 SG-RUNTIME-UNIFICATION
|
|
22
|
+
*/
|
|
23
|
+
/**
|
|
24
|
+
* The frozen, ordered set of lifecycle phases. Pinned by the daemon test suite
|
|
25
|
+
* so a phase cannot be silently added or removed.
|
|
26
|
+
*/
|
|
27
|
+
export const SUBSYSTEM_LIFECYCLE_PHASES = ['start', 'healthProbe', 'shutdown'];
|
|
28
|
+
//# sourceMappingURL=subsystem.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"subsystem.js","sourceRoot":"","sources":["../../src/daemon/subsystem.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AA+CH;;;GAGG;AACH,MAAM,CAAC,MAAM,0BAA0B,GAAG,CAAC,OAAO,EAAE,aAAa,EAAE,UAAU,CAAU,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Freeze + AC8-alias guard for the `@cleocode/contracts/daemon-ipc` surface
|
|
3
|
+
* (T11369 — R2 gates R4-R7).
|
|
4
|
+
*
|
|
5
|
+
* Proves the AC8-named `daemon-ipc` barrel:
|
|
6
|
+
* 1. resolves and re-exports the FROZEN supervisor-ipc v1.0 schemas + version,
|
|
7
|
+
* 2. is byte-identical to the `supervisor-ipc` surface (one contract, two
|
|
8
|
+
* names — no duplicate drift surface),
|
|
9
|
+
* 3. pins `DAEMON_IPC_PROTOCOL_VERSION === SUPERVISOR_IPC_PROTOCOL_VERSION ===
|
|
10
|
+
* '1.0.0'` and the complete frozen message-kind tuple.
|
|
11
|
+
*
|
|
12
|
+
* @task T11369
|
|
13
|
+
*/
|
|
14
|
+
export {};
|
|
15
|
+
//# sourceMappingURL=daemon-ipc-freeze.test.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"daemon-ipc-freeze.test.d.ts","sourceRoot":"","sources":["../../../src/daemon-ipc/__tests__/daemon-ipc-freeze.test.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Freeze + AC8-alias guard for the `@cleocode/contracts/daemon-ipc` surface
|
|
3
|
+
* (T11369 — R2 gates R4-R7).
|
|
4
|
+
*
|
|
5
|
+
* Proves the AC8-named `daemon-ipc` barrel:
|
|
6
|
+
* 1. resolves and re-exports the FROZEN supervisor-ipc v1.0 schemas + version,
|
|
7
|
+
* 2. is byte-identical to the `supervisor-ipc` surface (one contract, two
|
|
8
|
+
* names — no duplicate drift surface),
|
|
9
|
+
* 3. pins `DAEMON_IPC_PROTOCOL_VERSION === SUPERVISOR_IPC_PROTOCOL_VERSION ===
|
|
10
|
+
* '1.0.0'` and the complete frozen message-kind tuple.
|
|
11
|
+
*
|
|
12
|
+
* @task T11369
|
|
13
|
+
*/
|
|
14
|
+
import { describe, expect, it } from 'vitest';
|
|
15
|
+
import { SUPERVISOR_IPC_MESSAGE_KINDS, SUPERVISOR_IPC_PROTOCOL_VERSION, SupervisorIpcEnvelopeSchema as SupervisorEnvelopeFromRoot, } from '../../supervisor-ipc/index.js';
|
|
16
|
+
import { DAEMON_IPC_PROTOCOL_VERSION, SUPERVISOR_IPC_MESSAGE_KINDS as MESSAGE_KINDS_VIA_DAEMON_IPC, SupervisorIpcEnvelopeSchema as SupervisorEnvelopeFromDaemonIpc, SUPERVISOR_IPC_PROTOCOL_VERSION as VERSION_VIA_DAEMON_IPC, } from '../index.js';
|
|
17
|
+
describe('@cleocode/contracts/daemon-ipc AC8 alias surface (T11369)', () => {
|
|
18
|
+
it('re-exports the SAME frozen schema binding as supervisor-ipc', () => {
|
|
19
|
+
// Referential identity proves it is a re-export, not a duplicate schema.
|
|
20
|
+
expect(SupervisorEnvelopeFromDaemonIpc).toBe(SupervisorEnvelopeFromRoot);
|
|
21
|
+
});
|
|
22
|
+
it('pins the frozen protocol version through both names', () => {
|
|
23
|
+
expect(VERSION_VIA_DAEMON_IPC).toBe('1.0.0');
|
|
24
|
+
expect(DAEMON_IPC_PROTOCOL_VERSION).toBe('1.0.0');
|
|
25
|
+
expect(DAEMON_IPC_PROTOCOL_VERSION).toBe(SUPERVISOR_IPC_PROTOCOL_VERSION);
|
|
26
|
+
});
|
|
27
|
+
it('exposes the identical frozen message-kind set through the daemon-ipc name', () => {
|
|
28
|
+
expect([...MESSAGE_KINDS_VIA_DAEMON_IPC]).toEqual([...SUPERVISOR_IPC_MESSAGE_KINDS]);
|
|
29
|
+
});
|
|
30
|
+
it('validates a real Rust wire envelope through the daemon-ipc schema', () => {
|
|
31
|
+
const wire = {
|
|
32
|
+
protocol_version: '1.0.0',
|
|
33
|
+
id: 'abc',
|
|
34
|
+
direction: 'request',
|
|
35
|
+
request: { kind: 'health' },
|
|
36
|
+
};
|
|
37
|
+
expect(SupervisorEnvelopeFromDaemonIpc.safeParse(wire).success).toBe(true);
|
|
38
|
+
});
|
|
39
|
+
});
|
|
40
|
+
//# sourceMappingURL=daemon-ipc-freeze.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"daemon-ipc-freeze.test.js","sourceRoot":"","sources":["../../../src/daemon-ipc/__tests__/daemon-ipc-freeze.test.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,QAAQ,CAAC;AAC9C,OAAO,EACL,4BAA4B,EAC5B,+BAA+B,EAC/B,2BAA2B,IAAI,0BAA0B,GAC1D,MAAM,+BAA+B,CAAC;AACvC,OAAO,EACL,2BAA2B,EAC3B,4BAA4B,IAAI,4BAA4B,EAC5D,2BAA2B,IAAI,+BAA+B,EAC9D,+BAA+B,IAAI,sBAAsB,GAC1D,MAAM,aAAa,CAAC;AAErB,QAAQ,CAAC,2DAA2D,EAAE,GAAG,EAAE;IACzE,EAAE,CAAC,6DAA6D,EAAE,GAAG,EAAE;QACrE,yEAAyE;QACzE,MAAM,CAAC,+BAA+B,CAAC,CAAC,IAAI,CAAC,0BAA0B,CAAC,CAAC;IAC3E,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,qDAAqD,EAAE,GAAG,EAAE;QAC7D,MAAM,CAAC,sBAAsB,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QAC7C,MAAM,CAAC,2BAA2B,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QAClD,MAAM,CAAC,2BAA2B,CAAC,CAAC,IAAI,CAAC,+BAA+B,CAAC,CAAC;IAC5E,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,2EAA2E,EAAE,GAAG,EAAE;QACnF,MAAM,CAAC,CAAC,GAAG,4BAA4B,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,GAAG,4BAA4B,CAAC,CAAC,CAAC;IACvF,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,mEAAmE,EAAE,GAAG,EAAE;QAC3E,MAAM,IAAI,GAAG;YACX,gBAAgB,EAAE,OAAO;YACzB,EAAE,EAAE,KAAK;YACT,SAAS,EAAE,SAAS;YACpB,OAAO,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;SAC5B,CAAC;QACF,MAAM,CAAC,+BAA+B,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IAC7E,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `@cleocode/contracts/daemon-ipc` — the FROZEN v1.0 daemon-IPC surface
|
|
3
|
+
* R4-R7 adapt against (T11253 AC8).
|
|
4
|
+
*
|
|
5
|
+
* ## AC8 reconciliation (T11369)
|
|
6
|
+
*
|
|
7
|
+
* Epic T11253 AC8 specifies the frozen surface is published under the name
|
|
8
|
+
* `@cleocode/contracts/daemon-ipc/`. R1 (T11339) had already shipped the
|
|
9
|
+
* byte-for-byte Rust mirror under `@cleocode/contracts/supervisor-ipc/`. Rather
|
|
10
|
+
* than DUPLICATE the contract (which would create two drift surfaces), this
|
|
11
|
+
* module is a **thin re-export barrel**: `supervisor-ipc` IS the frozen v1.0
|
|
12
|
+
* contract, and `daemon-ipc` is the AC8-named alias the R2 epic promised.
|
|
13
|
+
*
|
|
14
|
+
* Both import sites resolve to the same FROZEN schemas + version constant:
|
|
15
|
+
*
|
|
16
|
+
* ```ts
|
|
17
|
+
* import { SupervisorIpcEnvelopeSchema } from '@cleocode/contracts/daemon-ipc';
|
|
18
|
+
* import { SupervisorIpcEnvelopeSchema } from '@cleocode/contracts/supervisor-ipc';
|
|
19
|
+
* // identical binding — one frozen contract, two names.
|
|
20
|
+
* ```
|
|
21
|
+
*
|
|
22
|
+
* R4-R7 are **pure adapters** against this frozen surface (see the
|
|
23
|
+
* contract-evolution policy doc, slug `daemon-ipc-contract-evolution-policy`).
|
|
24
|
+
* Breaking changes require a NEW versioned directory + a version-negotiation
|
|
25
|
+
* shim + an R2 amendment task — never an in-place edit to the v1.0 schemas.
|
|
26
|
+
*
|
|
27
|
+
* @packageDocumentation
|
|
28
|
+
* @module @cleocode/contracts/daemon-ipc
|
|
29
|
+
*
|
|
30
|
+
* @epic T11253 R2 — `@cleocode/runtime/daemon` submodule
|
|
31
|
+
* @task T11369 — freeze + publish v1.0 daemon-IPC contract surface (AC8 + AC9)
|
|
32
|
+
* @saga T11243 SG-RUNTIME-UNIFICATION
|
|
33
|
+
*/
|
|
34
|
+
export type { ChildState, ChildStatus, EnvPair, ErrorResponse, HealthRequest, HealthResponse, LifecycleEventKind, LifecycleEventResponse, MonitorRequest, MonitorResponse, RestartedResponse, RestartRequest, SpawnedResponse, SpawnRequest, SupervisorIpcEnvelope, SupervisorIpcRequest, SupervisorIpcRequestEnvelope, SupervisorIpcResponse, SupervisorIpcResponseEnvelope, } from '../supervisor-ipc/index.js';
|
|
35
|
+
export { ChildStateSchema, ChildStatusSchema, EnvPairSchema, ErrorResponseSchema, HealthRequestSchema, HealthResponseSchema, LifecycleEventKindSchema, LifecycleEventResponseSchema, MonitorRequestSchema, MonitorResponseSchema, RestartedResponseSchema, RestartRequestSchema, SpawnedResponseSchema, SpawnRequestSchema, SUPERVISOR_IPC_CHANNEL_BASENAME, SUPERVISOR_IPC_MESSAGE_KINDS, SUPERVISOR_IPC_PROTOCOL_VERSION, SUPERVISOR_IPC_REQUEST_KINDS, SUPERVISOR_IPC_RESPONSE_KINDS, SupervisorIpcEnvelopeSchema, SupervisorIpcRequestEnvelopeSchema, SupervisorIpcRequestSchema, SupervisorIpcResponseEnvelopeSchema, SupervisorIpcResponseSchema, } from '../supervisor-ipc/index.js';
|
|
36
|
+
/**
|
|
37
|
+
* The AC8-canonical name for the frozen daemon-IPC protocol version.
|
|
38
|
+
*
|
|
39
|
+
* Alias of `SUPERVISOR_IPC_PROTOCOL_VERSION` — re-exported so the freeze/drift
|
|
40
|
+
* test (T11369) can pin the value through the `daemon-ipc` surface name AC8
|
|
41
|
+
* specifies. Both constants are the SAME frozen `'1.0.0'`.
|
|
42
|
+
*/
|
|
43
|
+
export { SUPERVISOR_IPC_PROTOCOL_VERSION as DAEMON_IPC_PROTOCOL_VERSION } from '../supervisor-ipc/version.js';
|
|
44
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/daemon-ipc/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AAEH,YAAY,EACV,UAAU,EACV,WAAW,EACX,OAAO,EACP,aAAa,EACb,aAAa,EACb,cAAc,EACd,kBAAkB,EAClB,sBAAsB,EACtB,cAAc,EACd,eAAe,EACf,iBAAiB,EACjB,cAAc,EACd,eAAe,EACf,YAAY,EACZ,qBAAqB,EACrB,oBAAoB,EACpB,4BAA4B,EAC5B,qBAAqB,EACrB,6BAA6B,GAC9B,MAAM,4BAA4B,CAAC;AACpC,OAAO,EACL,gBAAgB,EAChB,iBAAiB,EACjB,aAAa,EACb,mBAAmB,EACnB,mBAAmB,EACnB,oBAAoB,EACpB,wBAAwB,EACxB,4BAA4B,EAC5B,oBAAoB,EACpB,qBAAqB,EACrB,uBAAuB,EACvB,oBAAoB,EACpB,qBAAqB,EACrB,kBAAkB,EAClB,+BAA+B,EAC/B,4BAA4B,EAC5B,+BAA+B,EAC/B,4BAA4B,EAC5B,6BAA6B,EAC7B,2BAA2B,EAC3B,kCAAkC,EAClC,0BAA0B,EAC1B,mCAAmC,EACnC,2BAA2B,GAC5B,MAAM,4BAA4B,CAAC;AAEpC;;;;;;GAMG;AACH,OAAO,EAAE,+BAA+B,IAAI,2BAA2B,EAAE,MAAM,8BAA8B,CAAC"}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `@cleocode/contracts/daemon-ipc` — the FROZEN v1.0 daemon-IPC surface
|
|
3
|
+
* R4-R7 adapt against (T11253 AC8).
|
|
4
|
+
*
|
|
5
|
+
* ## AC8 reconciliation (T11369)
|
|
6
|
+
*
|
|
7
|
+
* Epic T11253 AC8 specifies the frozen surface is published under the name
|
|
8
|
+
* `@cleocode/contracts/daemon-ipc/`. R1 (T11339) had already shipped the
|
|
9
|
+
* byte-for-byte Rust mirror under `@cleocode/contracts/supervisor-ipc/`. Rather
|
|
10
|
+
* than DUPLICATE the contract (which would create two drift surfaces), this
|
|
11
|
+
* module is a **thin re-export barrel**: `supervisor-ipc` IS the frozen v1.0
|
|
12
|
+
* contract, and `daemon-ipc` is the AC8-named alias the R2 epic promised.
|
|
13
|
+
*
|
|
14
|
+
* Both import sites resolve to the same FROZEN schemas + version constant:
|
|
15
|
+
*
|
|
16
|
+
* ```ts
|
|
17
|
+
* import { SupervisorIpcEnvelopeSchema } from '@cleocode/contracts/daemon-ipc';
|
|
18
|
+
* import { SupervisorIpcEnvelopeSchema } from '@cleocode/contracts/supervisor-ipc';
|
|
19
|
+
* // identical binding — one frozen contract, two names.
|
|
20
|
+
* ```
|
|
21
|
+
*
|
|
22
|
+
* R4-R7 are **pure adapters** against this frozen surface (see the
|
|
23
|
+
* contract-evolution policy doc, slug `daemon-ipc-contract-evolution-policy`).
|
|
24
|
+
* Breaking changes require a NEW versioned directory + a version-negotiation
|
|
25
|
+
* shim + an R2 amendment task — never an in-place edit to the v1.0 schemas.
|
|
26
|
+
*
|
|
27
|
+
* @packageDocumentation
|
|
28
|
+
* @module @cleocode/contracts/daemon-ipc
|
|
29
|
+
*
|
|
30
|
+
* @epic T11253 R2 — `@cleocode/runtime/daemon` submodule
|
|
31
|
+
* @task T11369 — freeze + publish v1.0 daemon-IPC contract surface (AC8 + AC9)
|
|
32
|
+
* @saga T11243 SG-RUNTIME-UNIFICATION
|
|
33
|
+
*/
|
|
34
|
+
export { ChildStateSchema, ChildStatusSchema, EnvPairSchema, ErrorResponseSchema, HealthRequestSchema, HealthResponseSchema, LifecycleEventKindSchema, LifecycleEventResponseSchema, MonitorRequestSchema, MonitorResponseSchema, RestartedResponseSchema, RestartRequestSchema, SpawnedResponseSchema, SpawnRequestSchema, SUPERVISOR_IPC_CHANNEL_BASENAME, SUPERVISOR_IPC_MESSAGE_KINDS, SUPERVISOR_IPC_PROTOCOL_VERSION, SUPERVISOR_IPC_REQUEST_KINDS, SUPERVISOR_IPC_RESPONSE_KINDS, SupervisorIpcEnvelopeSchema, SupervisorIpcRequestEnvelopeSchema, SupervisorIpcRequestSchema, SupervisorIpcResponseEnvelopeSchema, SupervisorIpcResponseSchema, } from '../supervisor-ipc/index.js';
|
|
35
|
+
/**
|
|
36
|
+
* The AC8-canonical name for the frozen daemon-IPC protocol version.
|
|
37
|
+
*
|
|
38
|
+
* Alias of `SUPERVISOR_IPC_PROTOCOL_VERSION` — re-exported so the freeze/drift
|
|
39
|
+
* test (T11369) can pin the value through the `daemon-ipc` surface name AC8
|
|
40
|
+
* specifies. Both constants are the SAME frozen `'1.0.0'`.
|
|
41
|
+
*/
|
|
42
|
+
export { SUPERVISOR_IPC_PROTOCOL_VERSION as DAEMON_IPC_PROTOCOL_VERSION } from '../supervisor-ipc/version.js';
|
|
43
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/daemon-ipc/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AAuBH,OAAO,EACL,gBAAgB,EAChB,iBAAiB,EACjB,aAAa,EACb,mBAAmB,EACnB,mBAAmB,EACnB,oBAAoB,EACpB,wBAAwB,EACxB,4BAA4B,EAC5B,oBAAoB,EACpB,qBAAqB,EACrB,uBAAuB,EACvB,oBAAoB,EACpB,qBAAqB,EACrB,kBAAkB,EAClB,+BAA+B,EAC/B,4BAA4B,EAC5B,+BAA+B,EAC/B,4BAA4B,EAC5B,6BAA6B,EAC7B,2BAA2B,EAC3B,kCAAkC,EAClC,0BAA0B,EAC1B,mCAAmC,EACnC,2BAA2B,GAC5B,MAAM,4BAA4B,CAAC;AAEpC;;;;;;GAMG;AACH,OAAO,EAAE,+BAA+B,IAAI,2BAA2B,EAAE,MAAM,8BAA8B,CAAC"}
|
package/dist/db-inventory.json
CHANGED
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
"role": "brain",
|
|
23
23
|
"tier": "project",
|
|
24
24
|
"filePathTemplate": "<projectRoot>/.cleo/brain.db",
|
|
25
|
-
"drizzleSchemaPath": "packages/core/src/store/memory-schema.ts",
|
|
25
|
+
"drizzleSchemaPath": "packages/core/src/store/schema/memory-schema.ts",
|
|
26
26
|
"migrationsDir": "packages/core/migrations/drizzle-brain/",
|
|
27
27
|
"ownerPackage": "@cleocode/brain",
|
|
28
28
|
"openedVia": "openCleoDb('brain', cwd)",
|
|
@@ -35,7 +35,7 @@
|
|
|
35
35
|
"role": "conduit",
|
|
36
36
|
"tier": "project",
|
|
37
37
|
"filePathTemplate": "<projectRoot>/.cleo/conduit.db",
|
|
38
|
-
"drizzleSchemaPath": "packages/core/src/store/conduit-schema.ts",
|
|
38
|
+
"drizzleSchemaPath": "packages/core/src/store/schema/conduit-schema.ts",
|
|
39
39
|
"migrationsDir": "packages/core/migrations/drizzle-conduit/",
|
|
40
40
|
"ownerPackage": "@cleocode/core",
|
|
41
41
|
"openedVia": "openCleoDb('conduit', cwd)",
|
|
@@ -74,7 +74,7 @@
|
|
|
74
74
|
"role": "nexus",
|
|
75
75
|
"tier": "global",
|
|
76
76
|
"filePathTemplate": "$XDG_DATA_HOME/cleo/nexus.db",
|
|
77
|
-
"drizzleSchemaPath": "packages/core/src/store/nexus-schema.ts",
|
|
77
|
+
"drizzleSchemaPath": "packages/core/src/store/schema/nexus-schema.ts",
|
|
78
78
|
"migrationsDir": "packages/core/migrations/drizzle-nexus/",
|
|
79
79
|
"ownerPackage": "@cleocode/core",
|
|
80
80
|
"openedVia": "openCleoDb('nexus')",
|
|
@@ -87,7 +87,7 @@
|
|
|
87
87
|
"role": "signaldock-project",
|
|
88
88
|
"tier": "project",
|
|
89
89
|
"filePathTemplate": "<projectRoot>/.cleo/signaldock.db",
|
|
90
|
-
"drizzleSchemaPath": "packages/core/src/store/signaldock-schema.ts",
|
|
90
|
+
"drizzleSchemaPath": "packages/core/src/store/schema/signaldock-schema.ts",
|
|
91
91
|
"migrationsDir": "packages/core/migrations/drizzle-signaldock/",
|
|
92
92
|
"ownerPackage": "@cleocode/core",
|
|
93
93
|
"openedVia": "HISTORICAL — project-tier signaldock.db was migrated into conduit.db post-T310/ADR-037. No live opener; charter row retained for migration provenance and legacy backup detection.",
|
|
@@ -100,7 +100,7 @@
|
|
|
100
100
|
"role": "signaldock-global",
|
|
101
101
|
"tier": "global",
|
|
102
102
|
"filePathTemplate": "$XDG_DATA_HOME/cleo/signaldock.db",
|
|
103
|
-
"drizzleSchemaPath": "packages/core/src/store/signaldock-schema.ts",
|
|
103
|
+
"drizzleSchemaPath": "packages/core/src/store/schema/signaldock-schema.ts",
|
|
104
104
|
"migrationsDir": "packages/core/migrations/drizzle-signaldock/",
|
|
105
105
|
"ownerPackage": "@cleocode/core",
|
|
106
106
|
"openedVia": "openCleoDb('signaldock')",
|
|
@@ -113,7 +113,7 @@
|
|
|
113
113
|
"role": "telemetry",
|
|
114
114
|
"tier": "global",
|
|
115
115
|
"filePathTemplate": "$XDG_DATA_HOME/cleo/telemetry.db",
|
|
116
|
-
"drizzleSchemaPath": "packages/core/src/
|
|
116
|
+
"drizzleSchemaPath": "packages/core/src/store/schema/telemetry-schema.ts",
|
|
117
117
|
"migrationsDir": "packages/core/migrations/drizzle-telemetry/",
|
|
118
118
|
"ownerPackage": "@cleocode/core",
|
|
119
119
|
"openedVia": "@cleocode/core telemetry/sqlite.ts — lazy open on first event when opted-in; not yet registered as openCleoDb role",
|
|
@@ -126,7 +126,7 @@
|
|
|
126
126
|
"role": "skills",
|
|
127
127
|
"tier": "global",
|
|
128
128
|
"filePathTemplate": "$XDG_DATA_HOME/cleo/skills.db",
|
|
129
|
-
"drizzleSchemaPath": "packages/core/src/store/skills-schema.ts",
|
|
129
|
+
"drizzleSchemaPath": "packages/core/src/store/schema/skills-schema.ts",
|
|
130
130
|
"migrationsDir": "packages/core/migrations/drizzle-skills/",
|
|
131
131
|
"ownerPackage": "@cleocode/core",
|
|
132
132
|
"openedVia": "openCleoDb('skills')",
|
|
@@ -139,7 +139,7 @@
|
|
|
139
139
|
"role": "global-brain",
|
|
140
140
|
"tier": "global",
|
|
141
141
|
"filePathTemplate": "$XDG_DATA_HOME/cleo/brain.db",
|
|
142
|
-
"drizzleSchemaPath": "packages/core/src/store/memory-schema.ts",
|
|
142
|
+
"drizzleSchemaPath": "packages/core/src/store/schema/memory-schema.ts",
|
|
143
143
|
"migrationsDir": "packages/core/migrations/drizzle-brain/",
|
|
144
144
|
"ownerPackage": "@cleocode/brain",
|
|
145
145
|
"openedVia": "UNREGISTERED — file exists on disk (audit §1.2 row 3) but no live opener. Provenance unclear; likely orphan from a getCleoHome()-vs-project-resolution path bug. Tracked for cleanup decision under T10282/T10307.",
|
|
@@ -59,7 +59,7 @@ export type Tier = 0 | 1 | 2;
|
|
|
59
59
|
*
|
|
60
60
|
* @since SG-ARCH-SOLID Saga T9831 · E-CONTRACTS-FOUNDATION T9832 · T9954 (Phase 0b)
|
|
61
61
|
*/
|
|
62
|
-
export declare const CANONICAL_DOMAINS: readonly ["tasks", "session", "memory", "check", "pipeline", "orchestrate", "tools", "admin", "nexus", "sticky", "intelligence", "diagnostics", "docs", "playbook", "conduit", "sentient", "release", "llm", "provenance", "upgrade", "worktree", "focus"];
|
|
62
|
+
export declare const CANONICAL_DOMAINS: readonly ["tasks", "session", "memory", "check", "pipeline", "orchestrate", "tools", "admin", "nexus", "sticky", "intelligence", "diagnostics", "docs", "playbook", "conduit", "sentient", "release", "llm", "provenance", "upgrade", "worktree", "focus", "attention"];
|
|
63
63
|
/**
|
|
64
64
|
* One of the canonical dispatch domain names.
|
|
65
65
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"identity.d.ts","sourceRoot":"","sources":["../../src/dispatch/identity.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAIH;;;;;;GAMG;AACH,MAAM,MAAM,OAAO,GAAG,OAAO,GAAG,QAAQ,CAAC;AAIzC;;;;;;;;;;GAUG;AACH,MAAM,MAAM,IAAI,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;AAI7B;;;;;;;;;;;;;;;;;;GAkBG;AACH,eAAO,MAAM,iBAAiB,
|
|
1
|
+
{"version":3,"file":"identity.d.ts","sourceRoot":"","sources":["../../src/dispatch/identity.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAIH;;;;;;GAMG;AACH,MAAM,MAAM,OAAO,GAAG,OAAO,GAAG,QAAQ,CAAC;AAIzC;;;;;;;;;;GAUG;AACH,MAAM,MAAM,IAAI,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;AAI7B;;;;;;;;;;;;;;;;;;GAkBG;AACH,eAAO,MAAM,iBAAiB,yQA+BpB,CAAC;AAEX;;;;;;;GAOG;AACH,MAAM,MAAM,eAAe,GAAG,CAAC,OAAO,iBAAiB,CAAC,CAAC,MAAM,CAAC,CAAC"}
|
|
@@ -68,5 +68,8 @@ export const CANONICAL_DOMAINS = [
|
|
|
68
68
|
'worktree',
|
|
69
69
|
// T9973: 'cleo focus <id>' — single-envelope task orientation (8 calls → 1).
|
|
70
70
|
'focus',
|
|
71
|
+
// T11373: 'cleo attention add|show|list' (alias 'jot') — Tier-2 scope-keyed
|
|
72
|
+
// working-memory buffer (Epic T11288 · Saga T11283).
|
|
73
|
+
'attention',
|
|
71
74
|
];
|
|
72
75
|
//# sourceMappingURL=identity.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"identity.js","sourceRoot":"","sources":["../../src/dispatch/identity.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AA4BH,wEAAwE;AAExE;;;;;;;;;;;;;;;;;;GAkBG;AACH,MAAM,CAAC,MAAM,iBAAiB,GAAG;IAC/B,OAAO;IACP,SAAS;IACT,QAAQ;IACR,OAAO;IACP,UAAU;IACV,aAAa;IACb,OAAO;IACP,OAAO;IACP,OAAO;IACP,QAAQ;IACR,cAAc;IACd,aAAa;IACb,MAAM;IACN,UAAU;IACV,SAAS;IACT,UAAU;IACV,SAAS;IACT,KAAK;IACL,wEAAwE;IACxE,YAAY;IACZ,wEAAwE;IACxE,0DAA0D;IAC1D,SAAS;IACT,6EAA6E;IAC7E,UAAU;IACV,6EAA6E;IAC7E,OAAO;
|
|
1
|
+
{"version":3,"file":"identity.js","sourceRoot":"","sources":["../../src/dispatch/identity.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AA4BH,wEAAwE;AAExE;;;;;;;;;;;;;;;;;;GAkBG;AACH,MAAM,CAAC,MAAM,iBAAiB,GAAG;IAC/B,OAAO;IACP,SAAS;IACT,QAAQ;IACR,OAAO;IACP,UAAU;IACV,aAAa;IACb,OAAO;IACP,OAAO;IACP,OAAO;IACP,QAAQ;IACR,cAAc;IACd,aAAa;IACb,MAAM;IACN,UAAU;IACV,SAAS;IACT,UAAU;IACV,SAAS;IACT,KAAK;IACL,wEAAwE;IACxE,YAAY;IACZ,wEAAwE;IACxE,0DAA0D;IAC1D,SAAS;IACT,6EAA6E;IAC7E,UAAU;IACV,6EAA6E;IAC7E,OAAO;IACP,4EAA4E;IAC5E,qDAAqD;IACrD,WAAW;CACH,CAAC"}
|
|
@@ -68,6 +68,22 @@ export interface OperationDef {
|
|
|
68
68
|
* @see T4897 for progressive migration
|
|
69
69
|
*/
|
|
70
70
|
params?: ParamDef[];
|
|
71
|
+
/**
|
|
72
|
+
* Whether this operation is surfaced as an MCP tool by the
|
|
73
|
+
* `@cleocode/runtime/gateway/mcp` transport adapter.
|
|
74
|
+
*
|
|
75
|
+
* **Default-deny**: absent / `false` means the operation is NOT exposed over
|
|
76
|
+
* MCP. The MCP adapter generates its `tools/list` from the subset of
|
|
77
|
+
* {@link OperationDef} entries that explicitly set `mcpExposed: true`, so the
|
|
78
|
+
* external tool surface is opt-in rather than the full CQRS registry. This
|
|
79
|
+
* preserves the historically-curated MCP surface (the standalone
|
|
80
|
+
* `@cleocode/mcp-adapter` exposed exactly 3 sentient tools) while letting new
|
|
81
|
+
* tools be promoted one registry edit at a time.
|
|
82
|
+
*
|
|
83
|
+
* @see {@link https://modelcontextprotocol.io | Model Context Protocol}
|
|
84
|
+
* @task T11448
|
|
85
|
+
*/
|
|
86
|
+
mcpExposed?: boolean;
|
|
71
87
|
}
|
|
72
88
|
/**
|
|
73
89
|
* Resolution output for a dispatch request.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"operation-def.d.ts","sourceRoot":"","sources":["../../src/dispatch/operation-def.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AAEH,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,yBAAyB,CAAC;AACxD,OAAO,KAAK,EAAE,eAAe,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,eAAe,CAAC;AAKpE,YAAY,EAAE,eAAe,EAAE,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;AAIzD;;;;;;;;;;;;;GAaG;AACH,MAAM,WAAW,YAAY;IAC3B,8CAA8C;IAC9C,OAAO,EAAE,OAAO,CAAC;IACjB,sDAAsD;IACtD,MAAM,EAAE,eAAe,CAAC;IACxB,+DAA+D;IAC/D,SAAS,EAAE,MAAM,CAAC;IAClB,oDAAoD;IACpD,WAAW,EAAE,MAAM,CAAC;IACpB,2EAA2E;IAC3E,IAAI,EAAE,IAAI,CAAC;IACX,8CAA8C;IAC9C,UAAU,EAAE,OAAO,CAAC;IACpB,yDAAyD;IACzD,eAAe,EAAE,OAAO,CAAC;IACzB,kEAAkE;IAClE,cAAc,EAAE,MAAM,EAAE,CAAC;IACzB;;;;;OAKG;IACH,MAAM,CAAC,EAAE,QAAQ,EAAE,CAAC;
|
|
1
|
+
{"version":3,"file":"operation-def.d.ts","sourceRoot":"","sources":["../../src/dispatch/operation-def.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AAEH,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,yBAAyB,CAAC;AACxD,OAAO,KAAK,EAAE,eAAe,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,eAAe,CAAC;AAKpE,YAAY,EAAE,eAAe,EAAE,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;AAIzD;;;;;;;;;;;;;GAaG;AACH,MAAM,WAAW,YAAY;IAC3B,8CAA8C;IAC9C,OAAO,EAAE,OAAO,CAAC;IACjB,sDAAsD;IACtD,MAAM,EAAE,eAAe,CAAC;IACxB,+DAA+D;IAC/D,SAAS,EAAE,MAAM,CAAC;IAClB,oDAAoD;IACpD,WAAW,EAAE,MAAM,CAAC;IACpB,2EAA2E;IAC3E,IAAI,EAAE,IAAI,CAAC;IACX,8CAA8C;IAC9C,UAAU,EAAE,OAAO,CAAC;IACpB,yDAAyD;IACzD,eAAe,EAAE,OAAO,CAAC;IACzB,kEAAkE;IAClE,cAAc,EAAE,MAAM,EAAE,CAAC;IACzB;;;;;OAKG;IACH,MAAM,CAAC,EAAE,QAAQ,EAAE,CAAC;IACpB;;;;;;;;;;;;;;OAcG;IACH,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB;AAID;;;;;;;;;;;GAWG;AACH,MAAM,WAAW,UAAU;IACzB,4BAA4B;IAC5B,MAAM,EAAE,eAAe,CAAC;IACxB,0BAA0B;IAC1B,SAAS,EAAE,MAAM,CAAC;IAClB,+CAA+C;IAC/C,GAAG,EAAE,YAAY,CAAC;CACnB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"operations-registry.d.ts","sourceRoot":"","sources":["../../src/dispatch/operations-registry.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAGH,OAAO,KAAK,EAAE,eAAe,EAAE,OAAO,EAAE,YAAY,EAAE,QAAQ,EAAE,IAAI,EAAE,MAAM,oBAAoB,CAAC;AAEjG,YAAY,EAAE,eAAe,EAAE,OAAO,EAAE,YAAY,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;AAMvE;;;;;;;GAOG;AACH,wBAAgB,QAAQ,CAAC,GAAG,EAAE,YAAY,GAAG,YAAY,CAExD;AAED;;;;;;;GAOG;AACH,wBAAgB,YAAY,CAAC,OAAO,EAAE,eAAe,EAAE,GAAG,EAAE,YAAY,EAAE,GAAG,YAAY,EAAE,CAE1F;AAMD,6DAA6D;AAC7D,eAAO,MAAM,UAAU,EAAE,YAAY,
|
|
1
|
+
{"version":3,"file":"operations-registry.d.ts","sourceRoot":"","sources":["../../src/dispatch/operations-registry.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAGH,OAAO,KAAK,EAAE,eAAe,EAAE,OAAO,EAAE,YAAY,EAAE,QAAQ,EAAE,IAAI,EAAE,MAAM,oBAAoB,CAAC;AAEjG,YAAY,EAAE,eAAe,EAAE,OAAO,EAAE,YAAY,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;AAMvE;;;;;;;GAOG;AACH,wBAAgB,QAAQ,CAAC,GAAG,EAAE,YAAY,GAAG,YAAY,CAExD;AAED;;;;;;;GAOG;AACH,wBAAgB,YAAY,CAAC,OAAO,EAAE,eAAe,EAAE,GAAG,EAAE,YAAY,EAAE,GAAG,YAAY,EAAE,CAE1F;AAMD,6DAA6D;AAC7D,eAAO,MAAM,UAAU,EAAE,YAAY,EA0pRpC,CAAC"}
|
|
@@ -7429,6 +7429,20 @@ export const OPERATIONS = [
|
|
|
7429
7429
|
// in the DomainHandler map) but absent from OPERATIONS, making them invisible
|
|
7430
7430
|
// to public SDK consumers using @cleocode/core. Adding all 10 ops here.
|
|
7431
7431
|
// ---------------------------------------------------------------------------
|
|
7432
|
+
// sentient query: status (T11448 — exposed over MCP; mirrors the standalone
|
|
7433
|
+
// mcp-adapter `cleo_sentient_status` tool + the `cleo sentient status` CLI op).
|
|
7434
|
+
{
|
|
7435
|
+
gateway: 'query',
|
|
7436
|
+
domain: 'sentient',
|
|
7437
|
+
operation: 'status',
|
|
7438
|
+
description: 'sentient.status (query) — daemon state, kill-switch status, Tier-2 enabled flag, and proposal statistics',
|
|
7439
|
+
tier: 2,
|
|
7440
|
+
idempotent: true,
|
|
7441
|
+
sessionRequired: false,
|
|
7442
|
+
requiredParams: [],
|
|
7443
|
+
params: [],
|
|
7444
|
+
mcpExposed: true,
|
|
7445
|
+
},
|
|
7432
7446
|
// sentient query: propose.list
|
|
7433
7447
|
{
|
|
7434
7448
|
gateway: 'query',
|
|
@@ -7447,6 +7461,7 @@ export const OPERATIONS = [
|
|
|
7447
7461
|
description: 'Maximum number of proposals to return (default: 50)',
|
|
7448
7462
|
},
|
|
7449
7463
|
],
|
|
7464
|
+
mcpExposed: true,
|
|
7450
7465
|
},
|
|
7451
7466
|
// sentient query: propose.diff
|
|
7452
7467
|
{
|
|
@@ -7549,6 +7564,7 @@ export const OPERATIONS = [
|
|
|
7549
7564
|
sessionRequired: false,
|
|
7550
7565
|
requiredParams: [],
|
|
7551
7566
|
params: [],
|
|
7567
|
+
mcpExposed: true,
|
|
7552
7568
|
},
|
|
7553
7569
|
// sentient mutate: propose.disable
|
|
7554
7570
|
{
|
|
@@ -8388,6 +8404,123 @@ export const OPERATIONS = [
|
|
|
8388
8404
|
],
|
|
8389
8405
|
},
|
|
8390
8406
|
// ---------------------------------------------------------------------------
|
|
8407
|
+
// T11373 — attention domain: Tier-2 scope-keyed working-memory jots (E2)
|
|
8408
|
+
// ---------------------------------------------------------------------------
|
|
8409
|
+
{
|
|
8410
|
+
gateway: 'mutate',
|
|
8411
|
+
domain: 'attention',
|
|
8412
|
+
operation: 'add',
|
|
8413
|
+
description: 'attention.add (mutate · alias jot) — record a scope-keyed working-memory ' +
|
|
8414
|
+
'jot. Session/agent identity + current task are auto-resolved from the ' +
|
|
8415
|
+
'environment (E0); the item keys to the narrowest scope (agent>task>epic>' +
|
|
8416
|
+
'saga>session>global). No session/agent/task flags by default.',
|
|
8417
|
+
tier: 1,
|
|
8418
|
+
idempotent: false,
|
|
8419
|
+
sessionRequired: false,
|
|
8420
|
+
requiredParams: ['content'],
|
|
8421
|
+
params: [
|
|
8422
|
+
{
|
|
8423
|
+
name: 'content',
|
|
8424
|
+
type: 'string',
|
|
8425
|
+
required: true,
|
|
8426
|
+
description: 'The jot content',
|
|
8427
|
+
cli: { positional: true },
|
|
8428
|
+
},
|
|
8429
|
+
{
|
|
8430
|
+
name: 'tags',
|
|
8431
|
+
type: 'array',
|
|
8432
|
+
required: false,
|
|
8433
|
+
description: 'Tags to attach (comma-separated on the CLI)',
|
|
8434
|
+
},
|
|
8435
|
+
{
|
|
8436
|
+
name: 'scope',
|
|
8437
|
+
type: 'string',
|
|
8438
|
+
required: false,
|
|
8439
|
+
description: 'Explicit scope escalation: agent|task|epic|saga|session|global (default: narrowest)',
|
|
8440
|
+
},
|
|
8441
|
+
{
|
|
8442
|
+
name: 'ttlSeconds',
|
|
8443
|
+
type: 'number',
|
|
8444
|
+
required: false,
|
|
8445
|
+
description: 'Optional time-to-live in seconds (sets expires_at)',
|
|
8446
|
+
},
|
|
8447
|
+
],
|
|
8448
|
+
},
|
|
8449
|
+
{
|
|
8450
|
+
gateway: 'query',
|
|
8451
|
+
domain: 'attention',
|
|
8452
|
+
operation: 'list',
|
|
8453
|
+
description: 'attention.list (query) — list open working-memory jots visible to the ' +
|
|
8454
|
+
'calling agent across its resolved scope chain. Optional --scope / --tag filters.',
|
|
8455
|
+
tier: 1,
|
|
8456
|
+
idempotent: true,
|
|
8457
|
+
sessionRequired: false,
|
|
8458
|
+
requiredParams: [],
|
|
8459
|
+
params: [
|
|
8460
|
+
{
|
|
8461
|
+
name: 'scope',
|
|
8462
|
+
type: 'string',
|
|
8463
|
+
required: false,
|
|
8464
|
+
description: 'Restrict to one scope kind: agent|task|epic|saga|session|global',
|
|
8465
|
+
},
|
|
8466
|
+
{
|
|
8467
|
+
name: 'tags',
|
|
8468
|
+
type: 'array',
|
|
8469
|
+
required: false,
|
|
8470
|
+
description: 'Filter by tags (contains-ALL; comma-separated on the CLI)',
|
|
8471
|
+
},
|
|
8472
|
+
{
|
|
8473
|
+
name: 'includeAll',
|
|
8474
|
+
type: 'boolean',
|
|
8475
|
+
required: false,
|
|
8476
|
+
description: 'Include non-open (consolidated/discarded) items too. Default: false',
|
|
8477
|
+
},
|
|
8478
|
+
{
|
|
8479
|
+
name: 'limit',
|
|
8480
|
+
type: 'number',
|
|
8481
|
+
required: false,
|
|
8482
|
+
description: 'Maximum rows. Default: 50',
|
|
8483
|
+
},
|
|
8484
|
+
],
|
|
8485
|
+
},
|
|
8486
|
+
{
|
|
8487
|
+
gateway: 'query',
|
|
8488
|
+
domain: 'attention',
|
|
8489
|
+
operation: 'show',
|
|
8490
|
+
description: 'attention.show (query) — synonym for attention.list; emits the open ' +
|
|
8491
|
+
'working-memory jots for the calling agent within token budget.',
|
|
8492
|
+
tier: 1,
|
|
8493
|
+
idempotent: true,
|
|
8494
|
+
sessionRequired: false,
|
|
8495
|
+
requiredParams: [],
|
|
8496
|
+
params: [
|
|
8497
|
+
{
|
|
8498
|
+
name: 'scope',
|
|
8499
|
+
type: 'string',
|
|
8500
|
+
required: false,
|
|
8501
|
+
description: 'Restrict to one scope kind: agent|task|epic|saga|session|global',
|
|
8502
|
+
},
|
|
8503
|
+
{
|
|
8504
|
+
name: 'tags',
|
|
8505
|
+
type: 'array',
|
|
8506
|
+
required: false,
|
|
8507
|
+
description: 'Filter by tags (contains-ALL; comma-separated on the CLI)',
|
|
8508
|
+
},
|
|
8509
|
+
{
|
|
8510
|
+
name: 'includeAll',
|
|
8511
|
+
type: 'boolean',
|
|
8512
|
+
required: false,
|
|
8513
|
+
description: 'Include non-open items too. Default: false',
|
|
8514
|
+
},
|
|
8515
|
+
{
|
|
8516
|
+
name: 'limit',
|
|
8517
|
+
type: 'number',
|
|
8518
|
+
required: false,
|
|
8519
|
+
description: 'Maximum rows. Default: 50',
|
|
8520
|
+
},
|
|
8521
|
+
],
|
|
8522
|
+
},
|
|
8523
|
+
// ---------------------------------------------------------------------------
|
|
8391
8524
|
// T10629 — tasks.context: bounded task-scoped context pack with token budget
|
|
8392
8525
|
// ---------------------------------------------------------------------------
|
|
8393
8526
|
{
|