wicked-crew-api-types 0.83.0 → 0.87.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 +249 -3
  2. package/package.json +1 -1
package/index.d.ts CHANGED
@@ -1797,8 +1797,15 @@ export interface GovernanceHookFiredEvent {
1797
1797
  ord: number;
1798
1798
  attempt: number;
1799
1799
  toolName: string;
1800
- decision: 'allow' | 'deny';
1800
+ /** `allow_with_conditions` (typed from api-types 0.87.0): the engine permits with obligations. */
1801
+ decision: 'allow' | 'deny' | 'allow_with_conditions';
1801
1802
  denyingPolicy: string | null;
1803
+ /**
1804
+ * (TR-W2, wicked-core-ts >= 0.7.35; api-types 0.87.0) EVERY steering rule that fired on this
1805
+ * call, whatever the decision — the `warn` class included, which an allow decision used to drop.
1806
+ * The watch registry's `risky-call` entry projects the warn-effect ones. Absent on an older engine.
1807
+ */
1808
+ firedPolicies?: string[];
1802
1809
  }
1803
1810
 
1804
1811
  /** P2 — a pinned deterministic validator was attached; confirms the governance floor is armed. */
@@ -2102,6 +2109,32 @@ export type RepoChecksEvaluatedEvent = {
2102
2109
  * `typecheck`/`lint`/`test` script, …) — the reason an empty `checks` is empty; `null` when
2103
2110
  * detection succeeded. */
2104
2111
  detectError?: string | null;
2112
+ /**
2113
+ * (wicked-core#469; typed here from api-types 0.87.0) How the floor ended: `passed` | `failed` |
2114
+ * `timed_out` | `not_run`. A floor that did not finish, or could not run at all (no write
2115
+ * boundary — see `sandboxError`), is never "its checks failed". Absent on an older engine.
2116
+ */
2117
+ outcome?: string;
2118
+ /**
2119
+ * (wicked-core#467; typed here from api-types 0.87.0) Whose floor this was: `creator` (the seat
2120
+ * handed back output and the engine ran the repo checks on its tree — a failing one is the
2121
+ * structural "handed back as finished, its own checks failed", TR-W6) or `verify` (the
2122
+ * code-verifying unit's, and the deliver re-check). Absent on an older engine.
2123
+ */
2124
+ floor?: string;
2125
+ /**
2126
+ * (wicked-core#467) A creator transcript's "pre-existing failure" claim, judged against the
2127
+ * baseline diff: `verdict` is `claim_rejected` | `claim_confirmed` | `unverified`. `null` when no
2128
+ * claim was made or the floor was green.
2129
+ */
2130
+ claim?: { phrase: string; check: string; verdict: string } | null;
2131
+ /**
2132
+ * (TR-W1b, wicked-core-ts >= 0.7.35) The repo-relative paths the step changed, `git diff-tree
2133
+ * --name-status` baseline → floor tree. Absent when the tree did not change; capped at 200 with
2134
+ * `changedTruncated: true`.
2135
+ */
2136
+ changed?: Array<{ status: string; path: string }>;
2137
+ changedTruncated?: boolean;
2105
2138
  };
2106
2139
 
2107
2140
  // ── wicked-core#431 gate / deliver evidence (F-3R2-013 / -010 / -009; api-types 0.33.0) ──────────
@@ -5233,7 +5266,8 @@ export type ChatSeatRefusedFrame = {
5233
5266
  // verdicts; the seat's TEXT is never edited — a skin MARKS it from these items.
5234
5267
 
5235
5268
  /** What class of thing a citation is. */
5236
- export type ChatCitationKind = 'path' | 'line' | 'symbol' | 'sha';
5269
+ /** `rule` (api-types 0.85.0, DC-S7): a `[rule:<id>]` the reply wrote — "cited by the step — unchecked", never a followed count. */
5270
+ export type ChatCitationKind = 'path' | 'line' | 'symbol' | 'sha' | 'rule';
5237
5271
 
5238
5272
  /**
5239
5273
  * The verdict on one citation.
@@ -5339,7 +5373,21 @@ export type ChatTranscriptRecord =
5339
5373
  corrected: number;
5340
5374
  unchecked: number;
5341
5375
  items: ChatCitationItem[];
5342
- };
5376
+ }
5377
+ /**
5378
+ * The decisions recorded from the operator's message of `turnId` (api-types 0.84.0, DC-S4b) — a
5379
+ * SEPARATE record, like `citations`, because derivation runs after the seats' replies are stored. A
5380
+ * reader folds it onto the turn's `user` record; a skin that does not know this kind ignores it.
5381
+ * The live frame is {@link ChatDecisionsFrame}. The seats' `wicked-decisions` blocks themselves
5382
+ * never reach the transcript (they are cut from the reply before it is persisted or broadcast).
5383
+ */
5384
+ | { at: number; turnId: string; kind: 'decisions'; items: DecisionView[] }
5385
+ /**
5386
+ * A crew-authored preface the seats received with the operator's message of `turnId` (api-types
5387
+ * 0.85.0, DC-S7): the rules remembered since they last heard from crew. Disclosed here so the
5388
+ * operator sees exactly what crew added; the `user` record keeps the operator's own words.
5389
+ */
5390
+ | { at: number; turnId: string; kind: 'system'; text: string };
5343
5391
 
5344
5392
  /** `GET /chats/:id` → 200. */
5345
5393
  export interface ChatDetailResponse {
@@ -5959,6 +6007,8 @@ export interface DiagnosticsResponse {
5959
6007
  * `DiagnosticsStateHome`. `null` on a daemon booted without the watch (some tests); ABSENT on a
5960
6008
  * daemon before this field. */
5961
6009
  stateHome?: DiagnosticsStateHome | null;
6010
+ /** The studio chat recorder's per-CLI format compliance (api-types 0.84.0, DC-S4b); `null` without the chat host. */
6011
+ decisions?: DiagnosticsDecisions | null;
5962
6012
  }
5963
6013
 
5964
6014
  // ── Diagnostics — governance store + dead letters (api-types 0.31.0, crew#495 / F-022) ─────────
@@ -8733,3 +8783,199 @@ export interface DecisionChangedFrame {
8733
8783
  rule_id?: string;
8734
8784
  project_id: string | null;
8735
8785
  }
8786
+
8787
+ /**
8788
+ * `/ws` frame (api-types 0.84.0, DC-S4b): the decisions recorded from ONE chat turn's operator
8789
+ * message, once every seat of the turn has answered (or the turn went stale). Mirrors
8790
+ * {@link ChatCitationsFrame}; the same items land in the transcript as a `decisions` record.
8791
+ */
8792
+ export interface ChatDecisionsFrame {
8793
+ type: 'chatDecisions';
8794
+ chat: string;
8795
+ turn_id: string;
8796
+ items: DecisionView[];
8797
+ project_id?: string;
8798
+ }
8799
+
8800
+ /**
8801
+ * `GET /diagnostics.decisions` (api-types 0.84.0, DC-S4b): the studio chat recorder's format
8802
+ * compliance per seat CLI — how often a seat ended its reply with a well-formed `wicked-decisions`
8803
+ * block (§4.3.3 measures the rate per CLI). `null` on a daemon without the chat host.
8804
+ */
8805
+ export interface DiagnosticsDecisions {
8806
+ /** The `WICKED_DECISIONS` switch this daemon runs under. */
8807
+ mode: 'off' | 'ledger' | 'on';
8808
+ /** Per `cliKey`: replies seen, well-formed blocks, malformed blocks. */
8809
+ recorder: Record<string, { replies: number; blocks: number; malformed: number }>;
8810
+ /** Turns whose recorder seat posted no usable block. The words were still recorded, unlabelled. */
8811
+ unclassified_turns: number;
8812
+ /** Turns that produced at least one decision record. */
8813
+ recorded_turns: number;
8814
+ }
8815
+
8816
+ // ── Considered · set aside · cited (unchecked) (DES-decision-capture §4.7; DC-S7, api-types 0.85.0) ──
8817
+
8818
+ export interface ConsiderationRule {
8819
+ id: string;
8820
+ statement: string;
8821
+ severity: 'info' | 'warn' | 'error' | 'critical';
8822
+ steering_type?: SteeringType;
8823
+ /** Present on a project-scoped rule. */
8824
+ project?: string;
8825
+ }
8826
+
8827
+ export interface ConsiderationSetAside {
8828
+ id: string;
8829
+ statement: string;
8830
+ /** The engine's reasons, plus crew's `not_confirmed`: a decision offered for this project, not yet remembered. */
8831
+ reason: 'out_of_scope' | 'replaced' | 'retired' | 'not_confirmed';
8832
+ }
8833
+
8834
+ /**
8835
+ * A `[rule:<id>]` the reply or step wrote. `unchecked` = the id is in force and the step cited it —
8836
+ * whether it FOLLOWED it is not checked (DES-rule-check will say); `unverified` = not an in-force
8837
+ * rule here (invented, or another project's). Never summed into a "followed" count.
8838
+ */
8839
+ export interface ConsiderationCitation {
8840
+ id: string;
8841
+ /** The seat (`cliKey`) or the unit id that wrote it. */
8842
+ by: string;
8843
+ status: 'unchecked' | 'unverified';
8844
+ label: string;
8845
+ }
8846
+
8847
+ /**
8848
+ * `GET /chats/:id/turns/:turnId/considered` and `GET /runs/:id/units/:unitKey/considered?attempt=`
8849
+ * (operator+): what the seats were given to consider, what was set aside, and what they cited.
8850
+ */
8851
+ export interface Consideration {
8852
+ subject: { kind: 'chat'; chat_id: string; turn_id: string } | { kind: 'unit'; run_id: string; ord: number; attempt: number };
8853
+ /** `considered:<chat>:<turn>` or `considered:<run>:<ord>:<attempt>` — the bus fact's idempotency key. */
8854
+ key: string;
8855
+ project_id: string | null;
8856
+ /** Severity-ordered (critical → info). */
8857
+ considered: ConsiderationRule[];
8858
+ set_aside: ConsiderationSetAside[];
8859
+ cited: ConsiderationCitation[];
8860
+ /** `considerRules` (the engine's project-aware read), `global-only` (an engine without it), or `unavailable`. */
8861
+ source: 'considerRules' | 'global-only' | 'unavailable';
8862
+ }
8863
+
8864
+ // ── Artifact editors (DES-artifact-editor-plugins §5.2, §6, §8.2; EP-C1, api-types 0.86.0) ───────
8865
+
8866
+ /** What a plugin can ask for (§6.1). There is no permission for network calls, agents or gates. */
8867
+ export type EditorPermission =
8868
+ | 'artifact.read'
8869
+ | 'artifact.write'
8870
+ | 'selection.chip'
8871
+ | 'composer.draft'
8872
+ | 'checks.read'
8873
+ | 'checks.contribute'
8874
+ | 'sources.read'
8875
+ | 'media.read'
8876
+ | 'artifact.export'
8877
+ | 'ui.fullscreen'
8878
+ | 'network.media';
8879
+
8880
+ /**
8881
+ * One registered editor, as Settings → Editors renders it. No path is on the wire: the bundle is
8882
+ * fetched at `entry_url` (`GET /editors/:id/:version/entry`, the §8.2 headers, re-hashed per serve).
8883
+ * First-party editors ship inside studio's bundle (`<studio dist>/editors/<id>/editor.json` +
8884
+ * `index.html`, ids `wicked-*`) and are discovered at boot; third-party editors arrive as garden
8885
+ * packs and cannot be installed before the install-time conformance run (EP-C8).
8886
+ */
8887
+ export interface EditorView {
8888
+ id: string;
8889
+ title: string;
8890
+ version: string;
8891
+ /** wicked.editor protocol versions it speaks. */
8892
+ protocol: number[];
8893
+ /** Artifact kinds it can open. */
8894
+ kinds: string[];
8895
+ sizes: Array<'inline' | 'pane' | 'full'>;
8896
+ panels?: Array<'checks'>;
8897
+ /** Each with the reason shown at install. The GRANTED set is `GET /editors/:id/grants`. */
8898
+ permissions: Array<{ id: EditorPermission; why: string }>;
8899
+ /** The full sha256 of the entry file, pinned when the registry read it. */
8900
+ sha256: string;
8901
+ bytes: number;
8902
+ first_party: boolean;
8903
+ enabled: boolean;
8904
+ source: 'studio-bundle';
8905
+ entry_url: string;
8906
+ }
8907
+
8908
+ /** `GET /editors` (operator+). */
8909
+ export interface ListEditorsResponse {
8910
+ editors: EditorView[];
8911
+ /** Why `POST /editors` answers 501 today: third-party installs wait on EP-C8. */
8912
+ installs: 'refused_until_conformance';
8913
+ }
8914
+
8915
+ /** `POST /editors` body (human-only): a pack directory holding `wicked-pack.json`. */
8916
+ export interface InstallEditorBody {
8917
+ packRoot: string;
8918
+ }
8919
+
8920
+ /** One finding of garden's `pack check --json`. */
8921
+ export interface PackCheckFinding {
8922
+ level: 'error' | 'warn';
8923
+ code: string;
8924
+ message: string;
8925
+ path?: string;
8926
+ }
8927
+
8928
+ /** The verdict of garden's `pack check --json` (the fail-closed gate every install runs first). */
8929
+ export interface PackCheckResult {
8930
+ ok: boolean;
8931
+ errors: PackCheckFinding[];
8932
+ warnings: PackCheckFinding[];
8933
+ }
8934
+
8935
+ /**
8936
+ * `POST /editors` → 501: the pack passed garden's gate, and this is what the install WOULD ask the
8937
+ * operator to approve (§3.2 "Add these") once third-party installs open (EP-C8). Nothing was written.
8938
+ */
8939
+ export interface InstallEditorRefusal {
8940
+ code: 'third_party_editors_not_available';
8941
+ error: string;
8942
+ check: PackCheckResult;
8943
+ pack: {
8944
+ name: string;
8945
+ vendor: string;
8946
+ version: string;
8947
+ editors: Array<{ id: string; title: string; version: string; kinds: string[]; permissions: Array<{ id: string; why: string }> }>;
8948
+ blocks: Array<{ id: string; label: string; produces_kind: string; skills: string[] }>;
8949
+ /** The pack's skill directories, approved together with its editors and blocks. */
8950
+ skills: string[];
8951
+ };
8952
+ }
8953
+
8954
+ /** `POST /editors/:id/enabled` body (human-only). */
8955
+ export interface SetEditorEnabledBody {
8956
+ enabled: boolean;
8957
+ }
8958
+
8959
+ /** One decided permission (the engine's `evaluate_editor_grants`, EP-K1). */
8960
+ export interface EditorGrant {
8961
+ permission: EditorPermission | string;
8962
+ decision: 'allow' | 'ask' | 'deny';
8963
+ /** The steering rules that decided it. */
8964
+ ruleIds: string[];
8965
+ /** The ledger entry an operator's "allow" adds to `EDITOR-GRANTS.excludes` (`editor:<id>@<version>#<sha256>/<permission>`). */
8966
+ token: string;
8967
+ }
8968
+
8969
+ /**
8970
+ * `GET /editors/:id/grants?project=` (operator+): the engine's decided set for this editor's version
8971
+ * and hash (a changed hash is a new token and asks again), deny dominating. The host fetches it
8972
+ * before `host.hello` and on every settings/rule change, and enforces it on every request.
8973
+ */
8974
+ export interface EditorGrantsResponse {
8975
+ editorId: string;
8976
+ version: string;
8977
+ sha256: string;
8978
+ project: string | null;
8979
+ firstParty: boolean;
8980
+ grants: EditorGrant[];
8981
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "wicked-crew-api-types",
3
- "version": "0.83.0",
3
+ "version": "0.87.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",