wicked-core-ts 0.7.16 → 0.7.17

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.
Files changed (2) hide show
  1. package/index.d.ts +42 -2
  2. package/package.json +10 -8
package/index.d.ts CHANGED
@@ -439,7 +439,12 @@ export declare class Core {
439
439
  * passes it through verbatim as the pinned wire contract):
440
440
  * `{ results: [{ sample: { id, description, kind, steering_type }, expected: "deny"|"allow",
441
441
  * fired: [rule-id…], verdict: "caught"|"gap"|"false_positive", nearest_rules? }],
442
- * summary: { total, caught, gaps, false_positives }, degraded: "facet-only"|null }`.
442
+ * summary: { total, caught, gaps, false_positives }, degraded: "facet-only"|null,
443
+ * rule_coverage: { exercised, unexercised: [{ rule_id, steering_type }], recall_only,
444
+ * per_type: { <steering-type>: { exercised, unexercised } } } }` — `rule_coverage` (core#394)
445
+ * partitions the decide-lane rules eligible for the run (narrowed to `type` when given) by
446
+ * whether any sample fired them; `recall_only` counts the effect-less rules the gate never
447
+ * fires (core#395 — zero decide-lane rules means the verdicts are the corpus split).
443
448
  *
444
449
  * Fail-closed: malformed args, an unknown steering type, a corpus name outside the
445
450
  * `evals:` scope, or a missing store reject the Promise with the engine's reason — crew maps
@@ -600,7 +605,9 @@ export declare class Subscription {
600
605
  * A CoreEvent, delivered as a JSON string to the {@link Core.subscribe} callback. Discriminated on
601
606
  * `type`. Fields vary by variant (see wicked-core `CoreEvent`): e.g.
602
607
  * `sessionStarted` `{session, problem}`, `unitPlanned` `{session, ord, description}`,
603
- * `unitDistributed` `{session, ord, cli}`, `awaitingHuman` `{session, ord, prompt}`,
608
+ * `unitDistributed` `{session, ord, cli, routingMethod, seatConstraint}` (`seatConstraint` is
609
+ * `null` unless the unit's skill narrowed the candidate seats before the council voted),
610
+ * `awaitingHuman` `{session, ord, prompt}`,
604
611
  * `gateDecided` `{session, ord, allow}`, `unitDone`/`unitExecuting`/`resumed` `{session, ord}`,
605
612
  * `sessionCompleted` `{session}`, `sessionFailed` `{session, ord}`, `error` `{session, message}`.
606
613
  * PTY terminal sessions emit `terminalOpened` `{id, cwd}`, `terminalOutput` `{id, seq, bytesB64}`
@@ -612,4 +619,37 @@ export interface CoreEventJson {
612
619
  ord?: number
613
620
  [k: string]: unknown
614
621
  }
622
+
623
+ /**
624
+ * The `unitDistributed` event — a CLI was assigned to a unit — as delivered to the
625
+ * {@link Core.subscribe} callback: the shape to read a parsed {@link CoreEventJson} as once
626
+ * `type === 'unitDistributed'`. Every field is emitted unconditionally; the engine's `Option`
627
+ * fields arrive as `null`, never absent. Pinned against wicked-core's `event_to_json` by the
628
+ * binding's own tests (`cargo test` in this crate) and asserted at compile time by
629
+ * `types-test/` (`npm run typecheck`).
630
+ */
631
+ export interface UnitDistributedEventJson extends CoreEventJson {
632
+ type: 'unitDistributed'
633
+ session: string
634
+ ord: number
635
+ /** The roster key of the assigned seat. */
636
+ cli: string
637
+ /** How the seat was chosen: the council verdict, a degrade to the first candidate, an
638
+ * evaluator ≠ creator reassignment, or a deterministic tool execution. */
639
+ routingMethod: 'council' | 'degraded' | 'evaluator_distinct' | 'tool'
640
+ agreementPct: number | null
641
+ returned: number | null
642
+ /** Seats convened for the council that produced this assignment (`null` = unknown). */
643
+ seated: number | null
644
+ dissent: number | null
645
+ degradedReason: string | null
646
+ /**
647
+ * WHY the candidate seats were narrowed BEFORE the council voted (core#401): the unit's skill
648
+ * (or a transitive mandate) is `portable: false` in the handed skills snapshot — or the root is
649
+ * the Claude-only live-cache fallback — so only a claude seat could be handed it, and the
650
+ * council chose among those. `null` when every roster seat was a candidate. Additive:
651
+ * `routingMethod` and its fields read exactly as before.
652
+ */
653
+ seatConstraint: string | null
654
+ }
615
655
  // ─── end hand-authored ───
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "wicked-core-ts",
3
- "version": "0.7.16",
3
+ "version": "0.7.17",
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": {
@@ -39,16 +39,18 @@
39
39
  "smoke:lifecycle": "node smoke-lifecycle.mjs",
40
40
  "smoke:terminal": "node smoke-terminal.mjs",
41
41
  "smoke:evals": "node smoke-evals.mjs",
42
- "smoke:all": "node smoke.mjs && node smoke-lifecycle.mjs && node smoke-terminal.mjs && node smoke-evals.mjs"
42
+ "smoke:all": "node smoke.mjs && node smoke-lifecycle.mjs && node smoke-terminal.mjs && node smoke-evals.mjs",
43
+ "typecheck": "tsc --noEmit -p types-test/tsconfig.json"
43
44
  },
44
45
  "optionalDependencies": {
45
- "wicked-core-ts-darwin-arm64": "0.7.16",
46
- "wicked-core-ts-darwin-x64": "0.7.16",
47
- "wicked-core-ts-linux-arm64-gnu": "0.7.16",
48
- "wicked-core-ts-linux-x64-gnu": "0.7.16",
49
- "wicked-core-ts-win32-x64-msvc": "0.7.16"
46
+ "wicked-core-ts-darwin-arm64": "0.7.17",
47
+ "wicked-core-ts-darwin-x64": "0.7.17",
48
+ "wicked-core-ts-linux-arm64-gnu": "0.7.17",
49
+ "wicked-core-ts-linux-x64-gnu": "0.7.17",
50
+ "wicked-core-ts-win32-x64-msvc": "0.7.17"
50
51
  },
51
52
  "devDependencies": {
52
- "@napi-rs/cli": "^2.18.4"
53
+ "@napi-rs/cli": "^2.18.4",
54
+ "typescript": "~6.0.2"
53
55
  }
54
56
  }