wicked-core-ts 0.7.18 → 0.7.19
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 +72 -10
- package/package.json +6 -6
package/index.d.ts
CHANGED
|
@@ -103,6 +103,26 @@ export declare class Core {
|
|
|
103
103
|
* as a JSON array of `AgenticCli` — pass straight into `launchRun`'s `clisJson`.
|
|
104
104
|
*/
|
|
105
105
|
static registryRoster(): string
|
|
106
|
+
/**
|
|
107
|
+
* EVENT nodes on the estate store at `dbPath` — the shared store the emit seam writes
|
|
108
|
+
* governance events to (`WICKED_ESTATE_DB`; wicked-crew#495) — as a JSON number string, over
|
|
109
|
+
* a READ-ONLY connection (never the single-writer actor's handle; the store must already
|
|
110
|
+
* exist). crew's `GET /diagnostics` reports it as `governance.records.total` and derives
|
|
111
|
+
* `sinceBoot` from a boot baseline; an addon without this static answers `null` there.
|
|
112
|
+
*/
|
|
113
|
+
static eventStoreCount(dbPath: string): Promise<string>
|
|
114
|
+
/**
|
|
115
|
+
* Replay a dead-letter outbox — the emit seam's NDJSON spool (`WICKED_APPS_EMIT_DEADLETTER`)
|
|
116
|
+
* of governance events it could not store — into the estate store at `dbPath`, writing each
|
|
117
|
+
* record as the EVENT node it should have been with its original `ts` restored
|
|
118
|
+
* (`wicked_apps_core::emit::replay_outbox`). Opens the store read-write (creating it if
|
|
119
|
+
* missing — the caller creates the parent directory). IDEMPOTENT: a replayed node's id is the
|
|
120
|
+
* spool line's content hash plus its original stamp, so the same line replayed twice lands
|
|
121
|
+
* once. Resolves to the JSON report `{ read, replayed, already_present, failed: [{ line,
|
|
122
|
+
* reason }] }`; a failed entry carries its ORIGINAL line so the caller can keep it
|
|
123
|
+
* dead-lettered. Behind `wicked-crew governance replay`.
|
|
124
|
+
*/
|
|
125
|
+
static replayEmitOutbox(outboxPath: string, dbPath: string): Promise<string>
|
|
106
126
|
/**
|
|
107
127
|
* Subscribe to the live [`CoreEvent`] stream. `callback` follows the Node error-first
|
|
108
128
|
* convention — `(err, eventJson)` — and is invoked once per event with the event serialized as
|
|
@@ -119,21 +139,33 @@ export declare class Core {
|
|
|
119
139
|
/** Liveness probe — emits a `Heartbeat` to subscribers and resolves once the actor acks (`"ok"`). */
|
|
120
140
|
ping(): Promise<string>
|
|
121
141
|
/**
|
|
122
|
-
* Open a chat: eagerly warm one ACP session per seat (crew#165 / core#13)
|
|
123
|
-
*
|
|
124
|
-
*
|
|
142
|
+
* Open a chat: eagerly warm one ACP session per seat (crew#165 / core#13) in a SCOPE
|
|
143
|
+
* (wicked-core#410 / wicked-crew#502). `cwd` is the seats' working directory — the chat's
|
|
144
|
+
* scratch root; omitted, a private `<tmp>/wicked-core-chat-<id>` of the chat's own, NEVER this
|
|
145
|
+
* process's cwd. `scopeJson` is `{"codeGraphDb"?: string|null, "readRoots"?: string[]}`: the
|
|
146
|
+
* estate graph the seats' READ-ONLY estate MCP is bound to (omitted/null ⇒ no estate MCP) and
|
|
147
|
+
* the repository roots in scope (advertised to a claude seat as `additionalDirectories`,
|
|
148
|
+
* recorded for every seat). Resolves to a JSON array of per-seat outcomes
|
|
149
|
+
* `[{cliKey, ok, error?}]`; `chatSessionReady`/`chatSessionFailed` also stream to
|
|
150
|
+
* subscribers. Blocking handshakes run on the task pool, not the JS thread.
|
|
125
151
|
*/
|
|
126
|
-
chatOpen(chatId: string, clisJson: string, cwd?: string | undefined | null): Promise<string>
|
|
152
|
+
chatOpen(chatId: string, clisJson: string, cwd?: string | undefined | null, scopeJson?: string | undefined | null): Promise<string>
|
|
127
153
|
/**
|
|
128
154
|
* Fan a message out to the chat's warm seats (all, or `targets_json` subset). Ack-fast:
|
|
129
155
|
* resolves to the JSON array of seats targeted; replies stream as `chatDelta`/`chatReply`.
|
|
156
|
+
* `cwd` is accepted for wire compatibility and IGNORED (wicked-core#410): every turn runs in
|
|
157
|
+
* the scope recorded at `chatOpen` — a per-message working directory was the F-067 leak.
|
|
130
158
|
*/
|
|
131
159
|
chatSend(chatId: string, text: string, targetsJson?: string | undefined | null, cwd?: string | undefined | null): Promise<string>
|
|
132
160
|
/** The seats currently warm for a chat — JSON array of cli keys. */
|
|
133
161
|
chatSeats(chatId: string): Promise<string>
|
|
134
162
|
/**
|
|
135
163
|
* Every chat currently holding pool state — JSON array of
|
|
136
|
-
* `[{chatId, seats, idleSecs}]`, sorted by id.
|
|
164
|
+
* `[{chatId, seats, idleSecs, cwd, codeGraphDb, readRoots}]`, sorted by id. `cwd` /
|
|
165
|
+
* `codeGraphDb` / `readRoots` are the scope recorded at `chatOpen` (wicked-core#410): where the
|
|
166
|
+
* seats run, the estate graph their read-only estate MCP is bound to (`null` ⇒ none), and the
|
|
167
|
+
* repository roots in scope (`[]` when none); `cwd` is `null` only for a pool entry whose scope
|
|
168
|
+
* is gone (a chat mid-close).
|
|
137
169
|
*
|
|
138
170
|
* Each warm seat pins an ACP bridge plus an agent child (~520 MB resident) and clients mint
|
|
139
171
|
* chat ids freely, so without this an accumulation is invisible until the host runs out of
|
|
@@ -240,8 +272,15 @@ export declare class Core {
|
|
|
240
272
|
unitTranscript(unitId: string): Promise<string>
|
|
241
273
|
/**
|
|
242
274
|
* A run's recorded event history, oldest first, as a JSON array. Each entry is the SAME tagged
|
|
243
|
-
* object the `/ws` stream carries ([`CoreEvent::to_json`]) plus
|
|
244
|
-
* and an ordering `seq
|
|
275
|
+
* object the `/ws` stream carries ([`CoreEvent::to_json`]) plus the durable log's envelope — a
|
|
276
|
+
* capture-time `ts` (epoch millis) and an ordering `seq`; `RecordedEventJson` is the shape.
|
|
277
|
+
*
|
|
278
|
+
* Ordering contract (wicked-core#408): `seq` is strictly increasing within a run for the run's
|
|
279
|
+
* whole life, ACROSS daemon restarts — the engine continues a run's `seq` from its persisted
|
|
280
|
+
* log rather than from 0 — so the array is in emission order and its last entry is the run's
|
|
281
|
+
* latest event. The first entry a restarted engine records for a run carries
|
|
282
|
+
* `daemonRestarted: true` (absent everywhere else). `ts` may repeat within a burst; never order
|
|
283
|
+
* by it.
|
|
245
284
|
*
|
|
246
285
|
* The read half of FINDING-014: an evidence bundle assembled after a run must read what actually
|
|
247
286
|
* happened rather than re-derive pseudo-events from unit records, which cannot recover what it
|
|
@@ -526,9 +565,10 @@ export declare class Core {
|
|
|
526
565
|
* `core.db`), which holds run/governance nodes but none of a repo's domain/requirement nodes, so
|
|
527
566
|
* it reports a vacuous `coverage: 1.0` over an empty denominator and cannot name a repo. This
|
|
528
567
|
* resolves the repo from the registry, opens its `code_graph_db` (the engine-resolved path
|
|
529
|
-
* every consumer shares —
|
|
530
|
-
*
|
|
531
|
-
*
|
|
568
|
+
* every consumer shares — `<daemon state home>/repo-graphs/<key>/estate.db`, never inside the
|
|
569
|
+
* checkout; see wicked-core's `code_graph.rs` ADR, core#406), and recomputes over it. The
|
|
570
|
+
* daemon's own store path is handed along so the repo graph resolves under THIS daemon's
|
|
571
|
+
* state home off the actor thread. An unknown `repo_ref` is an
|
|
532
572
|
* ERROR, never a silent vacuous report — the caller must name a real repo.
|
|
533
573
|
* Resolves to the coverage report as a JSON string (`ts_return_type` pins it — the crew adapter
|
|
534
574
|
* used to cast away an `unknown` here; #225 review).
|
|
@@ -655,4 +695,26 @@ export interface UnitDistributedEventJson extends CoreEventJson {
|
|
|
655
695
|
*/
|
|
656
696
|
seatConstraint: string | null
|
|
657
697
|
}
|
|
698
|
+
|
|
699
|
+
/**
|
|
700
|
+
* One entry of the JSON array {@link Core.runEvents} resolves: the `/ws` frame ({@link CoreEventJson})
|
|
701
|
+
* plus the durable log's envelope. Ordering contract (wicked-core#408): `seq` is strictly increasing
|
|
702
|
+
* within a run for the run's WHOLE life — across daemon restarts, not just within one process — so
|
|
703
|
+
* the array is in emission order and its last entry is the run's latest event. `ts` is capture time
|
|
704
|
+
* (epoch millis) and may repeat within a burst; never order by it. The first entry a restarted
|
|
705
|
+
* engine records for a run carries `daemonRestarted: true` (absent everywhere else), marking the
|
|
706
|
+
* boundary for consumers that keep per-run state across the gap. All three are envelope-only: the
|
|
707
|
+
* live `/ws` frame carries none of them.
|
|
708
|
+
*/
|
|
709
|
+
export interface RecordedEventJson extends CoreEventJson {
|
|
710
|
+
/** Capture-time epoch millis. May repeat within a burst — not an order. */
|
|
711
|
+
ts: number
|
|
712
|
+
/**
|
|
713
|
+
* Strictly increasing within the run, across daemon restarts. NOT the per-terminal `seq` of
|
|
714
|
+
* `terminalOutput` frames — those are streaming chunks and are never recorded.
|
|
715
|
+
*/
|
|
716
|
+
seq: number
|
|
717
|
+
/** Present, and `true`, only on the first entry a restarted engine recorded for this run. */
|
|
718
|
+
daemonRestarted?: true
|
|
719
|
+
}
|
|
658
720
|
// ─── end hand-authored ───
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "wicked-core-ts",
|
|
3
|
-
"version": "0.7.
|
|
3
|
+
"version": "0.7.19",
|
|
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.19",
|
|
47
|
+
"wicked-core-ts-darwin-x64": "0.7.19",
|
|
48
|
+
"wicked-core-ts-linux-arm64-gnu": "0.7.19",
|
|
49
|
+
"wicked-core-ts-linux-x64-gnu": "0.7.19",
|
|
50
|
+
"wicked-core-ts-win32-x64-msvc": "0.7.19"
|
|
51
51
|
},
|
|
52
52
|
"devDependencies": {
|
|
53
53
|
"@napi-rs/cli": "^2.18.4",
|