wicked-crew-api-types 0.77.0 → 0.83.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.
Files changed (2) hide show
  1. package/index.d.ts +224 -2
  2. package/package.json +1 -1
package/index.d.ts CHANGED
@@ -364,6 +364,17 @@ export interface AgentSession {
364
364
  * work. ABSENT on every other run (and on a daemon before the field).
365
365
  */
366
366
  outcome?: 'text_only';
367
+ /**
368
+ * (crew#762; api-types 0.79.0) Was delivery ASKED FOR on this run? A durable fact, so a skin can
369
+ * tell a run kept locally as asked from one whose delivery was attempted and did not land, also
370
+ * after a reload or a daemon restart. `stranded` with no deliver unit covers both.
371
+ * - `true`: the launch resolved `deliver: 'pr'`, OR a post-hoc `POST /runs/:id/deliver` was
372
+ * attempted (recorded before the script runs, whatever came of it), OR a delivery is on record.
373
+ * - `false`: the launch resolved `deliver: 'none'` and nothing was attempted since.
374
+ * - ABSENT: this daemon holds no launch record for the run and no attempt (a pre-field run, or a
375
+ * daemon before the field). Never fabricated.
376
+ */
377
+ deliver_requested?: boolean;
367
378
  /**
368
379
  * The delivered PR's URL (crew#393; api-types 0.18.0) — present exactly when
369
380
  * `delivery === 'delivered'`; absent otherwise (absence is the one spelling, never `null`).
@@ -1164,6 +1175,12 @@ export interface CoreEvent {
1164
1175
  elicitationId?: string;
1165
1176
  /** `elicitationCreated`: an ordered set of valid responses; `null` / absent = free-text. */
1166
1177
  options?: string[] | null;
1178
+ /**
1179
+ * `elicitationCreated` (C3; wicked-core-ts >= 0.7.35, api-types 0.83.0): the index into `options`
1180
+ * of the option the PRODUCER of the options recommends (the field's JSON Schema `default`).
1181
+ * ABSENT ⇒ nothing is preselected.
1182
+ */
1183
+ recommended?: number;
1167
1184
  /** PTY terminal frames (`terminalOpened`/`terminalOutput`/`terminalExited`): the terminal id. */
1168
1185
  id?: string;
1169
1186
  /**
@@ -4501,6 +4518,13 @@ export interface ElicitationInfo {
4501
4518
  message: string;
4502
4519
  /** Ordered set of valid responses; `null` means free-text. */
4503
4520
  options: string[] | null;
4521
+ /**
4522
+ * (C3, api-types 0.83.0) The index into `options` the producer of the options recommends —
4523
+ * relayed from the engine's `elicitationCreated.recommended`, kept only when it names one of
4524
+ * `options`. ABSENT ⇒ nothing is preselected (and a skin's Enter stays inert until a choice has
4525
+ * focus, DESIGN-interaction rule 6).
4526
+ */
4527
+ recommended?: number;
4504
4528
  receivedAt: string;
4505
4529
  }
4506
4530
 
@@ -6079,7 +6103,12 @@ export interface DiagnosticsSkillsFinding {
6079
6103
  * an `error` under `'require'` (the engine refuses every launch at intake); cleared by a publish
6080
6104
  * that hands it. Also carried as `DiagnosticsSkills.baseSkill.finding`; `skills.phase-skill`
6081
6105
  * (`warning`, crew#661) = a subsystem's phases declare a skill the published snapshot did not hold
6082
- * when it armed, so they run without it — one per `DiagnosticsSkills.phaseSkillGaps` entry. */
6106
+ * when it armed, so they run without it — one per `DiagnosticsSkills.phaseSkillGaps` entry;
6107
+ * `skills.garden` (`error`, api-types 0.78.0, crew#753) = the installed wicked-garden is older
6108
+ * than the daemon requires (`GardenRequiredBody.required`), so it is not used: found at seed,
6109
+ * the runtime is `config-error` and the engine is handed a refusal path. Rides
6110
+ * `/health.warnings` too; launches and onboarding answer 422
6111
+ * `garden_required` until a newer garden is installed and published. */
6083
6112
  kind:
6084
6113
  | 'skills.fallback'
6085
6114
  | 'skills.blocked'
@@ -6088,11 +6117,25 @@ export interface DiagnosticsSkillsFinding {
6088
6117
  | 'skills.manifest'
6089
6118
  | 'skills.stale-rules'
6090
6119
  | 'skills.base-skill'
6091
- | 'skills.phase-skill';
6120
+ | 'skills.phase-skill'
6121
+ | 'skills.garden';
6092
6122
  severity: 'warning' | 'error';
6093
6123
  message: string;
6094
6124
  }
6095
6125
 
6126
+ /**
6127
+ * The 422 `POST /runs`, `POST /repos` and `POST /repos/:id/onboard` answer while the installed
6128
+ * wicked-garden is older than the daemon requires (api-types 0.78.0, crew#753). `error` names the
6129
+ * version found, where, the version required and the install command. Nothing was launched or
6130
+ * registered. A daemon with NO garden answers the base skill's 422 `base_skill_refused` instead.
6131
+ */
6132
+ export interface GardenRequiredBody {
6133
+ code: 'garden_required';
6134
+ error: string;
6135
+ /** The minimum wicked-garden version, e.g. `"12.40.0"`. */
6136
+ required: string;
6137
+ }
6138
+
6096
6139
  /**
6097
6140
  * `GET /diagnostics` → `skills`: whether the engine is being handed a verified snapshot, and if not,
6098
6141
  * why — the one read-only answer to "why do launches refuse the skills snapshot". `disabled` is a
@@ -6710,6 +6753,50 @@ export interface RunAcceptanceWalkthrough {
6710
6753
  steps: WalkthroughStepState[];
6711
6754
  }
6712
6755
 
6756
+ /**
6757
+ * `GET /runs/:id/acceptance` → `summary` (WT-W3, DES-walkthrough-proof §4.8/§7; api-types 0.82.0): the
6758
+ * deliver card's ONE acceptance line, computed at the same read as the gate. `line` is plain words
6759
+ * ("Checked by a walkthrough: 3 of 3 steps at a1b2c3d."); it cites counts and the tree, never a path.
6760
+ */
6761
+ export interface RunAcceptanceSummary {
6762
+ /** The run had something to prove (`gate.required`). */
6763
+ required: boolean;
6764
+ /** Deny-dominates across the repo ledger and every walkthrough (`gate.satisfied`). */
6765
+ satisfied: boolean;
6766
+ line: string;
6767
+ /** From the newest walkthrough; `null` when the requirement names none. */
6768
+ walkthrough: {
6769
+ checked: number;
6770
+ failed: number;
6771
+ ownedByYou: number;
6772
+ /** Creator steps with a check state. */
6773
+ steps: number;
6774
+ /** Every walkthrough seal held. */
6775
+ sealed: boolean;
6776
+ /** The tree the newest seal binds; `null` with no seal. */
6777
+ tree: string | null;
6778
+ } | null;
6779
+ }
6780
+
6781
+ /**
6782
+ * `PUT /runs/:id/walkthrough/storyline?step=` body (WT-W3, §4.8 "Edit the check"): the whole storyline
6783
+ * module text. Accepted only while that walkthrough's escalation gate is open (409
6784
+ * `no_open_escalation` otherwise), only from a human actor (403), at most 256 KB (413).
6785
+ */
6786
+ export interface PutStorylineBody {
6787
+ storyline: string;
6788
+ }
6789
+
6790
+ /** `PUT /runs/:id/walkthrough/storyline` → 200: crew wrote `author/<planStepId>/storyline.mjs`, marked `edited_by: human`. */
6791
+ export interface PutStorylineResponse {
6792
+ runId: string;
6793
+ planStepId: string;
6794
+ sha256: string;
6795
+ edited_by: 'human';
6796
+ /** ISO-8601. */
6797
+ at: string;
6798
+ }
6799
+
6713
6800
  /** `POST /proposals/:id/reject` → 200. */
6714
6801
  export interface RejectProposalResponse {
6715
6802
  ok: true;
@@ -7487,6 +7574,12 @@ export interface WatchEntry {
7487
7574
  version: number;
7488
7575
  /** See {@link WatchEntrySource}. A `bus` type is a 4-segment `wicked.<domain>.<noun>.<verb>` type. */
7489
7576
  on: { source: WatchEntrySource; type: string };
7577
+ /**
7578
+ * (api-types 0.81.0, TR-W5b) The key points the check JOINS to its trigger — "the same unit's
7579
+ * `repoChecksEvaluated`", "the cursor unit's latest `unitOutputCaptured`". They reach the check
7580
+ * unfiltered so it can fold them; only `on` (with `filter`) triggers a row. Absent = none.
7581
+ */
7582
+ join?: Array<{ source: Exclude<WatchEntrySource, 'internal'>; type: string }>;
7490
7583
  /** JSON-path equality, AND of keys; an array means "any of". */
7491
7584
  filter: Record<string, unknown>;
7492
7585
  check: string;
@@ -8511,3 +8604,132 @@ export interface McpUsageResponse {
8511
8604
  /** Lines of `calls.ndjson` that did not parse as a call record. */
8512
8605
  skipped: number;
8513
8606
  }
8607
+
8608
+ // ── Decision capture (DES-decision-capture §4.2.1 / §4.6; DC-S4a, api-types 0.80.0) ──────────────
8609
+
8610
+ /** The laya codebook's decision types. `none` is crew's label for "no decision". */
8611
+ export type DecisionType = 'rule' | 'correction' | 'scope' | 'exception' | 'choice' | 'confirmation' | 'none';
8612
+
8613
+ /** Where the operator's words entered crew. S4a records the three structured hosts. */
8614
+ export type DecisionHost = 'studio-chat' | 'gate' | 'elicitation' | 'inject' | 'capture' | 'claude-code';
8615
+
8616
+ /** The deterministic templates (`derive.ts`). Only `T1-always` and `T2-never` can auto-remember. */
8617
+ export type DecisionTemplateId =
8618
+ | 'T1-always'
8619
+ | 'T2-never'
8620
+ | 'T3-before'
8621
+ | 'T4-prefer'
8622
+ | 'T5-must'
8623
+ | 'T6-only'
8624
+ | 'in-your-words';
8625
+
8626
+ /** How the derivation routed a decision (§4.4): the first that applies wins. */
8627
+ export type DecisionRoute = 'ledger' | 'offer' | 'auto' | 'restated' | 'maybe-restated' | 'conflict';
8628
+
8629
+ /** The latest outcome of a decision. `recorded` = no outcome yet (ledger-only, or still landing). */
8630
+ export type DecisionState =
8631
+ | 'recorded'
8632
+ | 'offered'
8633
+ | 'remembered'
8634
+ | 'undone'
8635
+ | 'dismissed'
8636
+ | 'restated'
8637
+ | 'widened'
8638
+ | 'landing_failed';
8639
+
8640
+ /** Why an offered decision was dismissed (a label for the laya v3 flywheel). */
8641
+ export type DecisionDismissReason = 'not-a-rule' | 'one-off' | 'wrong-type' | 'wrong-scope' | 'not-the-same' | 'undone';
8642
+
8643
+ /**
8644
+ * One decision as studio renders it (`GET /decisions`, operator+). ORIGIN (`origin.words`) comes
8645
+ * ONLY from crew's ledger: a proposal payload carries just the decision id, so a forged payload
8646
+ * has no ORIGIN. Words are never on the bus.
8647
+ */
8648
+ export interface DecisionView {
8649
+ id: string;
8650
+ /** Epoch ms the words were recorded. */
8651
+ at: number;
8652
+ project_id: string | null;
8653
+ host: DecisionHost;
8654
+ origin: {
8655
+ actor: { id: string; kind: 'human'; trust: TrustLevel };
8656
+ auth_mode: 'off' | 'required';
8657
+ run_id?: string;
8658
+ ord?: number;
8659
+ gate_id?: string;
8660
+ elicitation_id?: string;
8661
+ chat_id?: string;
8662
+ turn_id?: string;
8663
+ /** The verbatim words (masked where a secret was found; then `redacted: true`). */
8664
+ words: string;
8665
+ /** A bare gate approve/reject or a picked elicitation option, when there were no words. */
8666
+ choice?: string;
8667
+ words_source: 'typed' | 'operator-files' | 'cli-transcript';
8668
+ redacted: boolean;
8669
+ };
8670
+ /** The derived rule: the statement crew would remember, never the model's paraphrase. */
8671
+ derived: {
8672
+ statement: string | null;
8673
+ polarity: 'do' | 'dont' | null;
8674
+ key: string | null;
8675
+ scope: 'project' | 'everywhere';
8676
+ steering_type: SteeringType;
8677
+ template: DecisionTemplateId | null;
8678
+ exclusions: string[];
8679
+ };
8680
+ route: DecisionRoute;
8681
+ state: DecisionState;
8682
+ /** How it was remembered (present once `remembered`). */
8683
+ how?: 'auto' | 'chip' | 'needs-you';
8684
+ proposal_id?: string;
8685
+ rule_id?: string;
8686
+ /** The in-force rule this restates (`restated`) or contradicts (`conflict`). */
8687
+ restates_rule_id?: string;
8688
+ conflicts_rule_id?: string;
8689
+ /** Edits the operator made at Remember; ORIGIN keeps the original words. */
8690
+ edits?: { statement?: string; scope?: 'project' | 'everywhere'; steering_type?: SteeringType };
8691
+ /** The loud reason a landing failed (`landing_failed`). */
8692
+ error?: string;
8693
+ /** B8: the same rule decided in ≥ 2 projects — "Make it apply everywhere". */
8694
+ widen?: { projects: string[] };
8695
+ }
8696
+
8697
+ /** `GET /decisions?project=&chat=&run=&state=&since=` (operator+). Newest first. */
8698
+ export interface ListDecisionsResponse {
8699
+ decisions: DecisionView[];
8700
+ /** `off` | `ledger` | `on` — the `WICKED_DECISIONS` switch this daemon runs under. */
8701
+ mode: 'off' | 'ledger' | 'on';
8702
+ }
8703
+
8704
+ /** `POST /decisions/:id/remember` body. An edited `statement` is recorded in `edits`. */
8705
+ export interface RememberDecisionBody {
8706
+ scope?: 'project' | 'everywhere';
8707
+ steering_type?: SteeringType;
8708
+ statement?: string;
8709
+ }
8710
+
8711
+ /** `POST /decisions/:id/remember` → the landed rule. */
8712
+ export interface RememberDecisionResponse {
8713
+ rule_id: string;
8714
+ proposal_id: string;
8715
+ project?: string;
8716
+ }
8717
+
8718
+ /** `POST /decisions/:id/dismiss` body. */
8719
+ export interface DismissDecisionBody {
8720
+ reason: DecisionDismissReason;
8721
+ }
8722
+
8723
+ /** `POST /decisions/:id/same` body — resolves a `maybe-restated` decision. */
8724
+ export interface SameDecisionBody {
8725
+ same: boolean;
8726
+ }
8727
+
8728
+ /** `/ws` frame: a decision's state changed (no words). */
8729
+ export interface DecisionChangedFrame {
8730
+ type: 'decisionChanged';
8731
+ id: string;
8732
+ state: DecisionState;
8733
+ rule_id?: string;
8734
+ project_id: string | null;
8735
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "wicked-crew-api-types",
3
- "version": "0.77.0",
3
+ "version": "0.83.0",
4
4
  "description": "The wire contract of the wicked-crew daemon's /api/v1 REST surface and /ws CoreEvent frames \u2014 types only, zero runtime",
5
5
  "type": "module",
6
6
  "types": "./index.d.ts",