wicked-core-ts 0.7.16 → 0.7.18

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 +45 -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,11 +605,16 @@ 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}`
607
614
  * (raw output base64-encoded in `bytesB64`), and `terminalExited` `{id, status}`.
615
+ * Gate evidence (wicked-core F-036/F-039): evaluatorMutatedWorktree {session, ord, attempt, cli,
616
+ * phase, beforeTree, afterTree, headMoved, changed} and repoChecksEvaluated {session,
617
+ * ord, attempt, passed, criterion, checks, skipped}.
608
618
  */
609
619
  export interface CoreEventJson {
610
620
  type: string
@@ -612,4 +622,37 @@ export interface CoreEventJson {
612
622
  ord?: number
613
623
  [k: string]: unknown
614
624
  }
625
+
626
+ /**
627
+ * The `unitDistributed` event — a CLI was assigned to a unit — as delivered to the
628
+ * {@link Core.subscribe} callback: the shape to read a parsed {@link CoreEventJson} as once
629
+ * `type === 'unitDistributed'`. Every field is emitted unconditionally; the engine's `Option`
630
+ * fields arrive as `null`, never absent. Pinned against wicked-core's `event_to_json` by the
631
+ * binding's own tests (`cargo test` in this crate) and asserted at compile time by
632
+ * `types-test/` (`npm run typecheck`).
633
+ */
634
+ export interface UnitDistributedEventJson extends CoreEventJson {
635
+ type: 'unitDistributed'
636
+ session: string
637
+ ord: number
638
+ /** The roster key of the assigned seat. */
639
+ cli: string
640
+ /** How the seat was chosen: the council verdict, a degrade to the first candidate, an
641
+ * evaluator ≠ creator reassignment, or a deterministic tool execution. */
642
+ routingMethod: 'council' | 'degraded' | 'evaluator_distinct' | 'tool'
643
+ agreementPct: number | null
644
+ returned: number | null
645
+ /** Seats convened for the council that produced this assignment (`null` = unknown). */
646
+ seated: number | null
647
+ dissent: number | null
648
+ degradedReason: string | null
649
+ /**
650
+ * WHY the candidate seats were narrowed BEFORE the council voted (core#401): the unit's skill
651
+ * (or a transitive mandate) is `portable: false` in the handed skills snapshot — or the root is
652
+ * the Claude-only live-cache fallback — so only a claude seat could be handed it, and the
653
+ * council chose among those. `null` when every roster seat was a candidate. Additive:
654
+ * `routingMethod` and its fields read exactly as before.
655
+ */
656
+ seatConstraint: string | null
657
+ }
615
658
  // ─── 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.18",
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.18",
47
+ "wicked-core-ts-darwin-x64": "0.7.18",
48
+ "wicked-core-ts-linux-arm64-gnu": "0.7.18",
49
+ "wicked-core-ts-linux-x64-gnu": "0.7.18",
50
+ "wicked-core-ts-win32-x64-msvc": "0.7.18"
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
  }