wicked-core-ts 0.7.40 → 0.7.42
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 +48 -59
- package/package.json +6 -6
package/index.d.ts
CHANGED
|
@@ -255,59 +255,6 @@ export declare class Core {
|
|
|
255
255
|
subscribe(callback: (err: Error | null, eventJson: string) => void): Subscription
|
|
256
256
|
/** Liveness probe — emits a `Heartbeat` to subscribers and resolves once the actor acks (`"ok"`). */
|
|
257
257
|
ping(): Promise<string>
|
|
258
|
-
/**
|
|
259
|
-
* Open a chat: eagerly warm one ACP session per seat (crew#165 / core#13) in a SCOPE
|
|
260
|
-
* (wicked-core#410 / wicked-crew#502). `cwd` is the seats' working directory — the chat's
|
|
261
|
-
* scratch root; omitted, a private `<tmp>/wicked-core-chat-<id>` of the chat's own, NEVER this
|
|
262
|
-
* process's cwd. `scopeJson` is `{"codeGraphDb"?: string|null, "readRoots"?: string[]}`: the
|
|
263
|
-
* estate graph the seats' READ-ONLY estate MCP is bound to (omitted/null ⇒ no estate MCP) and
|
|
264
|
-
* the repository roots in scope (advertised to a claude seat as `additionalDirectories`,
|
|
265
|
-
* recorded for every seat). Resolves to a JSON array of per-seat outcomes
|
|
266
|
-
* `[{cliKey, ok, error?}]`; `chatSessionReady`/`chatSessionFailed` also stream to
|
|
267
|
-
* subscribers. Blocking handshakes run on the task pool, not the JS thread.
|
|
268
|
-
*/
|
|
269
|
-
chatOpen(chatId: string, clisJson: string, cwd?: string | undefined | null, scopeJson?: string | undefined | null): Promise<string>
|
|
270
|
-
/**
|
|
271
|
-
* Fan a message out to the chat's warm seats (all, or `targets_json` subset). Ack-fast:
|
|
272
|
-
* resolves to the JSON array of seats targeted; replies stream as `chatDelta`/`chatReply`.
|
|
273
|
-
* `cwd` is accepted for wire compatibility and IGNORED (wicked-core#410): every turn runs in
|
|
274
|
-
* the scope recorded at `chatOpen` — a per-message working directory was the F-067 leak.
|
|
275
|
-
*/
|
|
276
|
-
chatSend(chatId: string, text: string, targetsJson?: string | undefined | null, cwd?: string | undefined | null): Promise<string>
|
|
277
|
-
/** The seats currently warm for a chat — JSON array of cli keys. */
|
|
278
|
-
chatSeats(chatId: string): Promise<string>
|
|
279
|
-
/**
|
|
280
|
-
* Every chat currently holding pool state — JSON array of
|
|
281
|
-
* `[{chatId, seats, idleSecs, cwd, codeGraphDb, readRoots, heldBy}]`, sorted by id. `cwd` /
|
|
282
|
-
* `codeGraphDb` / `readRoots` are the scope recorded at `chatOpen` (wicked-core#410): where the
|
|
283
|
-
* seats run, the estate graph their read-only estate MCP is bound to (`null` ⇒ none), and the
|
|
284
|
-
* repository roots in scope (`[]` when none); `cwd` is `null` only for a pool entry whose scope
|
|
285
|
-
* is gone (a chat mid-close). `heldBy` lists the runs launched from the chat that keep it
|
|
286
|
-
* warm (`chatHold`, crew#619).
|
|
287
|
-
*
|
|
288
|
-
* Each warm seat pins an ACP bridge plus an agent child (~520 MB resident) and clients mint
|
|
289
|
-
* chat ids freely, so without this an accumulation is invisible until the host runs out of
|
|
290
|
-
* memory (FINDING-027). `idleSecs` is seconds since the chat's last open/ensure/turn, or
|
|
291
|
-
* `null` when no activity was ever recorded — which the reaper treats as idle-since-forever.
|
|
292
|
-
*
|
|
293
|
-
* `null` rather than the `u64::MAX` the Rust side uses for that case: a JS `number` is an
|
|
294
|
-
* f64, so `u64::MAX` arrives as `18446744073709552000` and no consumer can test for the
|
|
295
|
-
* sentinel by equality. `null` is checkable, and it stops a caller from doing arithmetic on a
|
|
296
|
-
* value that never meant a duration.
|
|
297
|
-
*/
|
|
298
|
-
chatList(): Promise<string>
|
|
299
|
-
/**
|
|
300
|
-
* Hold a chat warm for a run launched from it (crew#619): the engine's idle reaper passes the
|
|
301
|
-
* chat over until that run is terminal, and its idle clock restarts then. Resolves `"true"`,
|
|
302
|
-
* or `"false"` when the chat is not open on this engine (nothing held). Call it right after
|
|
303
|
-
* `launchRun` resolves the run id.
|
|
304
|
-
*/
|
|
305
|
-
chatHold(chatId: string, runId: string): Promise<string>
|
|
306
|
-
/**
|
|
307
|
-
* Close a chat's warm sessions (idempotent); emits
|
|
308
|
-
* `chatClosed` with `reason: "requested"`.
|
|
309
|
-
*/
|
|
310
|
-
chatClose(chatId: string): Promise<string>
|
|
311
258
|
/**
|
|
312
259
|
* Launch an interactive, resumable run: plans + distributes, then executes each unit off-thread
|
|
313
260
|
* (or pauses at a human-confirm gate). Resolves to the run id. Progress arrives as `CoreEvent`s
|
|
@@ -340,10 +287,10 @@ export declare class Core {
|
|
|
340
287
|
* amendment. The engine refuses each at any other gate.
|
|
341
288
|
*
|
|
342
289
|
* (core#555, additive.) `amend_intent` (`approve=true`, the text in `amend`, no `amendScope`)
|
|
343
|
-
* approves the gate AND AMENDS THE RUN'S INTENT: the text is appended to every unit at or
|
|
344
|
-
* the cursor, so the acceptance list each LATER EVALUATOR is handed changes with the
|
|
345
|
-
* and it is recorded on the run
|
|
346
|
-
*
|
|
290
|
+
* approves the gate AND AMENDS THE RUN'S INTENT: the text is appended to every unit at or
|
|
291
|
+
* after the cursor, so the acceptance list each LATER EVALUATOR is handed changes with the
|
|
292
|
+
* decision, and it is recorded on the run plus an `intentAmended` event. It is the only arm
|
|
293
|
+
* that can descope a run mid-flight; refused at a plan or team gate, and with empty text.
|
|
347
294
|
*
|
|
348
295
|
* (DES-TEAMING-002 T3, additive.) `planJson` answers a `plan_approval` gate WITH AN EDIT: the
|
|
349
296
|
* edited plan as JSON (`approve=true`, `action` omitted or `edit_plan`). The engine accepts it
|
|
@@ -796,6 +743,19 @@ export declare class Core {
|
|
|
796
743
|
* call; no process restart required.
|
|
797
744
|
*/
|
|
798
745
|
registerWorkflow(json: string): Promise<string>
|
|
746
|
+
/**
|
|
747
|
+
* (core#677) Vault a deterministic validator the host authored — `criterion` and a POSIX
|
|
748
|
+
* shell `script` that exits 0 iff it holds — UNAPPROVED, resolving to its content-addressed
|
|
749
|
+
* pin. Rejects `bad_request: …` on an empty criterion/script or a script the run-time
|
|
750
|
+
* backstop refuses. Approve it with `approveValidator`; a def pins the APPROVED pin.
|
|
751
|
+
*/
|
|
752
|
+
vaultValidator(criterion: string, script: string): Promise<string>
|
|
753
|
+
/**
|
|
754
|
+
* (core#677) Approve a vaulted validator (the audited step) and resolve to the APPROVED pin
|
|
755
|
+
* a workflow def's `validator_pin` names. Rejects `not_found: …` on an unknown pin. A def
|
|
756
|
+
* pinning an unapproved or unvaulted pin still fails its launch at plan time.
|
|
757
|
+
*/
|
|
758
|
+
approveValidator(pin: string): Promise<string>
|
|
799
759
|
/**
|
|
800
760
|
* Recall which conformance rules apply to the given `query_json` (a JSON-serialized
|
|
801
761
|
* `RuleQuery` — fields: language, layer, framework, severity, rule_type, steering_type;
|
|
@@ -829,6 +789,15 @@ export declare class Core {
|
|
|
829
789
|
* needs no `Core` handle.
|
|
830
790
|
*/
|
|
831
791
|
static evaluateMcpCall(requestJson: string): Promise<string>
|
|
792
|
+
/**
|
|
793
|
+
* (core#669, DES-MCP-TOOLS-001 decision 2) Record that a brokered REST call left its pinned
|
|
794
|
+
* host (crew's broker calls this on `RestBoundaryError`, after `evaluateMcpCall` allowed it).
|
|
795
|
+
* `request_json` is `{ token, subject, reason }`; appends a unit-FATAL deny claim under rule
|
|
796
|
+
* `engine:mcp-rest-boundary` (not the advisory `mcp-deny:` class) and resolves to
|
|
797
|
+
* `{ claimId }`. Rejects with `invalid_token: …`, `bad_request: …` or `guard_error: …` — the
|
|
798
|
+
* broker then refuses the call with `guard_error` (D-3). Static, like `evaluateMcpCall`.
|
|
799
|
+
*/
|
|
800
|
+
static recordMcpBoundaryEscape(requestJson: string): Promise<string>
|
|
832
801
|
/**
|
|
833
802
|
* The unit's visible MCP tool list (DES-MCP-TOOLS-001 §8 `GET /mcp/tools?token=`; slice S4,
|
|
834
803
|
* the garden shim's `list`). `request_json` is `{ token, calls: [{ server, tool, annotations?,
|
|
@@ -946,6 +915,9 @@ export declare class Core {
|
|
|
946
915
|
* `newCli` is either a CLI key string (re-dispatch immediately to that CLI) or `null` (re-run
|
|
947
916
|
* the council and let it pick). Returns `"ok"` when the command has been queued; the
|
|
948
917
|
* [`CoreEvent::UnitReassigned`] event confirms the reassignment.
|
|
918
|
+
*
|
|
919
|
+
* (core#773) On a run parked at a gate, a named `newCli` re-seats the cursor unit without
|
|
920
|
+
* dispatching it (the attempt does not move); approving the gate then runs it once, there.
|
|
949
921
|
*/
|
|
950
922
|
reassignUnit(runId: string, ord: number, newCli?: string | undefined | null): Promise<unknown>
|
|
951
923
|
}
|
|
@@ -1013,8 +985,9 @@ export declare class Subscription {
|
|
|
1013
985
|
* may start with 'install fence:' (a package-manager install outside the unit's worktree, judged
|
|
1014
986
|
* from the seat's shell cwd tracked across its tool calls — best-effort, never hermetic);
|
|
1015
987
|
* sandboxPosture {session, ord, cli, posture: 'os' | 'advisory', reason} (the write containment
|
|
1016
|
-
* the assigned seat runs under — '
|
|
1017
|
-
*
|
|
988
|
+
* the assigned seat runs under — 'os' = the seat is on the OS-sandbox floor, the run is bound to a
|
|
989
|
+
* worktree and the host launcher arms; 'advisory' = one of the three failed, reason names which —
|
|
990
|
+
* command-text fences + worktree guard only); worktreeRetained {session, path, reason} (a terminal run's worktree
|
|
1018
991
|
* kept because it holds uncommitted work — cancel included).
|
|
1019
992
|
* core#468 (additive): unitDispatched carries `baseSkill: {name, role, handed} | null` — the run's
|
|
1020
993
|
* role-keyed BASE skill directive (`role` is 'creator' | 'evaluator' | 'neutral'), null when the
|
|
@@ -1082,6 +1055,22 @@ export declare class Subscription {
|
|
|
1082
1055
|
* the option the producer of the options recommends (the field's own JSON Schema `default`, when
|
|
1083
1056
|
* it names a delivered option). ABSENT ⇒ nothing is preselected; `options`/`propType` stay
|
|
1084
1057
|
* explicit nulls.
|
|
1058
|
+
* core#412 (additive — a new `type` value): cliUsageUnreported {session, ord, attempt, cli} — an
|
|
1059
|
+
* agent unit whose seat reported NO usage for that attempt; emitted where cliUsage would be, so a
|
|
1060
|
+
* burn view shows the unit as UNREPORTED, never as $0.
|
|
1061
|
+
* core#554 (additive): every unitContextInjected.priorUnits[] item carries `deliveredBytes`
|
|
1062
|
+
* (the size the worker received, after the carriers' shared prior-context clip) and `clipped`
|
|
1063
|
+
* (boolean). `outputBytes` stays the pre-clip size; a clipped operator note now says so.
|
|
1064
|
+
* core#651 (a new VALUE): unitReworkAmended.scope can read `'floor_auto_retry'` — the one automatic
|
|
1065
|
+
* round a creator gets when its own repo-checks floor ran and failed (the failing tails are the
|
|
1066
|
+
* amendment); WorkUnit gains `floor_auto_retries` (number, absent while 0).
|
|
1067
|
+
* core#686 (additive): WorkUnit gains `instructions` (the phase's authored card, absent when
|
|
1068
|
+
* none), `amendments` (approved intent-amendment texts, absent when empty) and
|
|
1069
|
+
* `structured_description` (true on units planned with those fields; absent on older records,
|
|
1070
|
+
* which a reader re-parses from `description` as legacy).
|
|
1071
|
+
* core#591 (additive): unitReassigned carries `distinctnessFallback` ('creator_seat' |
|
|
1072
|
+
* 'same_cli_instance' | null), as unitDistributed does — the new seat is another INSTANCE of (or
|
|
1073
|
+
* the very seat of) the CLI that created the work the unit depends on.
|
|
1085
1074
|
*/
|
|
1086
1075
|
export interface CoreEventJson {
|
|
1087
1076
|
type: string
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "wicked-core-ts",
|
|
3
|
-
"version": "0.7.
|
|
3
|
+
"version": "0.7.42",
|
|
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": {
|
|
@@ -43,11 +43,11 @@
|
|
|
43
43
|
"typecheck": "tsc --noEmit -p types-test/tsconfig.json"
|
|
44
44
|
},
|
|
45
45
|
"optionalDependencies": {
|
|
46
|
-
"wicked-core-ts-darwin-arm64": "0.7.
|
|
47
|
-
"wicked-core-ts-darwin-x64": "0.7.
|
|
48
|
-
"wicked-core-ts-linux-arm64-gnu": "0.7.
|
|
49
|
-
"wicked-core-ts-linux-x64-gnu": "0.7.
|
|
50
|
-
"wicked-core-ts-win32-x64-msvc": "0.7.
|
|
46
|
+
"wicked-core-ts-darwin-arm64": "0.7.42",
|
|
47
|
+
"wicked-core-ts-darwin-x64": "0.7.42",
|
|
48
|
+
"wicked-core-ts-linux-arm64-gnu": "0.7.42",
|
|
49
|
+
"wicked-core-ts-linux-x64-gnu": "0.7.42",
|
|
50
|
+
"wicked-core-ts-win32-x64-msvc": "0.7.42"
|
|
51
51
|
},
|
|
52
52
|
"devDependencies": {
|
|
53
53
|
"@napi-rs/cli": "^2.18.4",
|