wicked-core-ts 0.2.1 → 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/index.d.ts +68 -0
- package/package.json +6 -6
package/index.d.ts
CHANGED
|
@@ -62,6 +62,39 @@ export declare class Core {
|
|
|
62
62
|
subscribe(callback: (err: Error | null, eventJson: string) => void): Subscription
|
|
63
63
|
/** Liveness probe — emits a `Heartbeat` to subscribers and resolves once the actor acks (`"ok"`). */
|
|
64
64
|
ping(): Promise<string>
|
|
65
|
+
/**
|
|
66
|
+
* Open a chat: eagerly warm one ACP session per seat (crew#165 / core#13). Resolves to a
|
|
67
|
+
* JSON array of per-seat outcomes `[{cliKey, ok, error?}]`; `chatSessionReady`/`chatSessionFailed`
|
|
68
|
+
* also stream to subscribers. Blocking handshakes run on the task pool, not the JS thread.
|
|
69
|
+
*/
|
|
70
|
+
chatOpen(chatId: string, clisJson: string, cwd?: string | undefined | null): Promise<string>
|
|
71
|
+
/**
|
|
72
|
+
* Fan a message out to the chat's warm seats (all, or `targets_json` subset). Ack-fast:
|
|
73
|
+
* resolves to the JSON array of seats targeted; replies stream as `chatDelta`/`chatReply`.
|
|
74
|
+
*/
|
|
75
|
+
chatSend(chatId: string, text: string, targetsJson?: string | undefined | null, cwd?: string | undefined | null): Promise<string>
|
|
76
|
+
/** The seats currently warm for a chat — JSON array of cli keys. */
|
|
77
|
+
chatSeats(chatId: string): Promise<string>
|
|
78
|
+
/**
|
|
79
|
+
* Every chat currently holding pool state — JSON array of
|
|
80
|
+
* `[{chatId, seats, idleSecs}]`, sorted by id.
|
|
81
|
+
*
|
|
82
|
+
* Each warm seat pins an ACP bridge plus an agent child (~520 MB resident) and clients mint
|
|
83
|
+
* chat ids freely, so without this an accumulation is invisible until the host runs out of
|
|
84
|
+
* memory (FINDING-027). `idleSecs` is seconds since the chat's last open/ensure/turn, or
|
|
85
|
+
* `null` when no activity was ever recorded — which the reaper treats as idle-since-forever.
|
|
86
|
+
*
|
|
87
|
+
* `null` rather than the `u64::MAX` the Rust side uses for that case: a JS `number` is an
|
|
88
|
+
* f64, so `u64::MAX` arrives as `18446744073709552000` and no consumer can test for the
|
|
89
|
+
* sentinel by equality. `null` is checkable, and it stops a caller from doing arithmetic on a
|
|
90
|
+
* value that never meant a duration.
|
|
91
|
+
*/
|
|
92
|
+
chatList(): Promise<string>
|
|
93
|
+
/**
|
|
94
|
+
* Close a chat's warm sessions (idempotent); emits
|
|
95
|
+
* `chatClosed` with `reason: "requested"`.
|
|
96
|
+
*/
|
|
97
|
+
chatClose(chatId: string): Promise<string>
|
|
65
98
|
/**
|
|
66
99
|
* Launch an interactive, resumable run: plans + distributes, then executes each unit off-thread
|
|
67
100
|
* (or pauses at a human-confirm gate). Resolves to the run id. Progress arrives as `CoreEvent`s
|
|
@@ -93,6 +126,21 @@ export declare class Core {
|
|
|
93
126
|
sessionsDetail(): Promise<string>
|
|
94
127
|
/** A unit's captured work output (transcript), as a JSON value — a string, or `null` if none. */
|
|
95
128
|
workOutput(unitId: string): Promise<string>
|
|
129
|
+
/**
|
|
130
|
+
* A run's recorded event history, oldest first, as a JSON array. Each entry is the SAME tagged
|
|
131
|
+
* object the `/ws` stream carries ([`CoreEvent::to_json`]) plus a capture-time `ts` (epoch millis)
|
|
132
|
+
* and an ordering `seq`.
|
|
133
|
+
*
|
|
134
|
+
* The read half of FINDING-014: an evidence bundle assembled after a run must read what actually
|
|
135
|
+
* happened rather than re-derive pseudo-events from unit records, which cannot recover what it
|
|
136
|
+
* never saw and invents its own type names doing it. Because the log and the socket serialize
|
|
137
|
+
* through one mapping, an event named here is the event named live.
|
|
138
|
+
*
|
|
139
|
+
* Empty array for an unknown run, one that emitted nothing, or one predating the log — an absent
|
|
140
|
+
* history is not an error. Streaming chunk events (`cliOutputDelta`, `chatDelta`,
|
|
141
|
+
* `terminalOutput`, `heartbeat`) are excluded by design.
|
|
142
|
+
*/
|
|
143
|
+
runEvents(runId: string): Promise<string>
|
|
96
144
|
/**
|
|
97
145
|
* Register a git repository the orchestrator can run within. Validates it is a git repo with
|
|
98
146
|
* ≥1 commit; resolves to the persisted `RepoEntry` as a JSON object.
|
|
@@ -119,6 +167,26 @@ export declare class Core {
|
|
|
119
167
|
* Validates server-side (INV-C1/C2/C4). Idempotent on stable id.
|
|
120
168
|
*/
|
|
121
169
|
upsertConformanceRule(ruleJson: string): Promise<string>
|
|
170
|
+
/**
|
|
171
|
+
* Withdraw a governance policy from enforcement (FINDING-038 — governance state was otherwise
|
|
172
|
+
* append-only, so a mis-authored policy denied forever).
|
|
173
|
+
*
|
|
174
|
+
* Retire, not delete: the node stays readable so a past decision citing this id can still be
|
|
175
|
+
* explained, but SELECT stops returning it, so it can never decide another gate.
|
|
176
|
+
*
|
|
177
|
+
* Resolves to a JSON-encoded boolean: the four characters `true` if a policy with that id
|
|
178
|
+
* existed, the five characters `false` if none did. Like every method here it hands JS a
|
|
179
|
+
* `Promise<string>` carrying JSON, so it must be `JSON.parse`d — a bare truthiness test
|
|
180
|
+
* passes on BOTH values and would read a miss as a hit, losing exactly the 200-vs-404
|
|
181
|
+
* distinction this return value exists to carry.
|
|
182
|
+
*/
|
|
183
|
+
retirePolicy(id: string): Promise<string>
|
|
184
|
+
/**
|
|
185
|
+
* Withdraw a conformance rule from recall. Same retire-not-delete contract as
|
|
186
|
+
* [`Core::retire_policy`], and the same JSON-encoded `true`/`false` reply that must be
|
|
187
|
+
* parsed rather than tested for truthiness.
|
|
188
|
+
*/
|
|
189
|
+
retireConformanceRule(id: string): Promise<string>
|
|
122
190
|
/**
|
|
123
191
|
* Register (or replace) a workflow definition in the actor's runtime registry. `json` is a
|
|
124
192
|
* JSON-serialised `WorkflowDef` object (fields: id, description, phases — see the wicked-core
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "wicked-core-ts",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.4.0",
|
|
4
4
|
"description": "Node/TypeScript bindings (napi-rs) for wicked-core: drive the in-process orchestration engine from JS/TS.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -41,11 +41,11 @@
|
|
|
41
41
|
"smoke:all": "node smoke.mjs && node smoke-lifecycle.mjs && node smoke-terminal.mjs"
|
|
42
42
|
},
|
|
43
43
|
"optionalDependencies": {
|
|
44
|
-
"wicked-core-ts-darwin-arm64": "0.
|
|
45
|
-
"wicked-core-ts-darwin-x64": "0.
|
|
46
|
-
"wicked-core-ts-linux-arm64-gnu": "0.
|
|
47
|
-
"wicked-core-ts-linux-x64-gnu": "0.
|
|
48
|
-
"wicked-core-ts-win32-x64-msvc": "0.
|
|
44
|
+
"wicked-core-ts-darwin-arm64": "0.4.0",
|
|
45
|
+
"wicked-core-ts-darwin-x64": "0.4.0",
|
|
46
|
+
"wicked-core-ts-linux-arm64-gnu": "0.4.0",
|
|
47
|
+
"wicked-core-ts-linux-x64-gnu": "0.4.0",
|
|
48
|
+
"wicked-core-ts-win32-x64-msvc": "0.4.0"
|
|
49
49
|
},
|
|
50
50
|
"devDependencies": {
|
|
51
51
|
"@napi-rs/cli": "^2.18.4"
|