wicked-crew-api-types 0.83.0 → 0.86.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 +215 -2
  2. package/package.json +1 -1
package/index.d.ts CHANGED
@@ -5233,7 +5233,8 @@ export type ChatSeatRefusedFrame = {
5233
5233
  // verdicts; the seat's TEXT is never edited — a skin MARKS it from these items.
5234
5234
 
5235
5235
  /** What class of thing a citation is. */
5236
- export type ChatCitationKind = 'path' | 'line' | 'symbol' | 'sha';
5236
+ /** `rule` (api-types 0.85.0, DC-S7): a `[rule:<id>]` the reply wrote — "cited by the step — unchecked", never a followed count. */
5237
+ export type ChatCitationKind = 'path' | 'line' | 'symbol' | 'sha' | 'rule';
5237
5238
 
5238
5239
  /**
5239
5240
  * The verdict on one citation.
@@ -5339,7 +5340,21 @@ export type ChatTranscriptRecord =
5339
5340
  corrected: number;
5340
5341
  unchecked: number;
5341
5342
  items: ChatCitationItem[];
5342
- };
5343
+ }
5344
+ /**
5345
+ * The decisions recorded from the operator's message of `turnId` (api-types 0.84.0, DC-S4b) — a
5346
+ * SEPARATE record, like `citations`, because derivation runs after the seats' replies are stored. A
5347
+ * reader folds it onto the turn's `user` record; a skin that does not know this kind ignores it.
5348
+ * The live frame is {@link ChatDecisionsFrame}. The seats' `wicked-decisions` blocks themselves
5349
+ * never reach the transcript (they are cut from the reply before it is persisted or broadcast).
5350
+ */
5351
+ | { at: number; turnId: string; kind: 'decisions'; items: DecisionView[] }
5352
+ /**
5353
+ * A crew-authored preface the seats received with the operator's message of `turnId` (api-types
5354
+ * 0.85.0, DC-S7): the rules remembered since they last heard from crew. Disclosed here so the
5355
+ * operator sees exactly what crew added; the `user` record keeps the operator's own words.
5356
+ */
5357
+ | { at: number; turnId: string; kind: 'system'; text: string };
5343
5358
 
5344
5359
  /** `GET /chats/:id` → 200. */
5345
5360
  export interface ChatDetailResponse {
@@ -5959,6 +5974,8 @@ export interface DiagnosticsResponse {
5959
5974
  * `DiagnosticsStateHome`. `null` on a daemon booted without the watch (some tests); ABSENT on a
5960
5975
  * daemon before this field. */
5961
5976
  stateHome?: DiagnosticsStateHome | null;
5977
+ /** The studio chat recorder's per-CLI format compliance (api-types 0.84.0, DC-S4b); `null` without the chat host. */
5978
+ decisions?: DiagnosticsDecisions | null;
5962
5979
  }
5963
5980
 
5964
5981
  // ── Diagnostics — governance store + dead letters (api-types 0.31.0, crew#495 / F-022) ─────────
@@ -8733,3 +8750,199 @@ export interface DecisionChangedFrame {
8733
8750
  rule_id?: string;
8734
8751
  project_id: string | null;
8735
8752
  }
8753
+
8754
+ /**
8755
+ * `/ws` frame (api-types 0.84.0, DC-S4b): the decisions recorded from ONE chat turn's operator
8756
+ * message, once every seat of the turn has answered (or the turn went stale). Mirrors
8757
+ * {@link ChatCitationsFrame}; the same items land in the transcript as a `decisions` record.
8758
+ */
8759
+ export interface ChatDecisionsFrame {
8760
+ type: 'chatDecisions';
8761
+ chat: string;
8762
+ turn_id: string;
8763
+ items: DecisionView[];
8764
+ project_id?: string;
8765
+ }
8766
+
8767
+ /**
8768
+ * `GET /diagnostics.decisions` (api-types 0.84.0, DC-S4b): the studio chat recorder's format
8769
+ * compliance per seat CLI — how often a seat ended its reply with a well-formed `wicked-decisions`
8770
+ * block (§4.3.3 measures the rate per CLI). `null` on a daemon without the chat host.
8771
+ */
8772
+ export interface DiagnosticsDecisions {
8773
+ /** The `WICKED_DECISIONS` switch this daemon runs under. */
8774
+ mode: 'off' | 'ledger' | 'on';
8775
+ /** Per `cliKey`: replies seen, well-formed blocks, malformed blocks. */
8776
+ recorder: Record<string, { replies: number; blocks: number; malformed: number }>;
8777
+ /** Turns whose recorder seat posted no usable block. The words were still recorded, unlabelled. */
8778
+ unclassified_turns: number;
8779
+ /** Turns that produced at least one decision record. */
8780
+ recorded_turns: number;
8781
+ }
8782
+
8783
+ // ── Considered · set aside · cited (unchecked) (DES-decision-capture §4.7; DC-S7, api-types 0.85.0) ──
8784
+
8785
+ export interface ConsiderationRule {
8786
+ id: string;
8787
+ statement: string;
8788
+ severity: 'info' | 'warn' | 'error' | 'critical';
8789
+ steering_type?: SteeringType;
8790
+ /** Present on a project-scoped rule. */
8791
+ project?: string;
8792
+ }
8793
+
8794
+ export interface ConsiderationSetAside {
8795
+ id: string;
8796
+ statement: string;
8797
+ /** The engine's reasons, plus crew's `not_confirmed`: a decision offered for this project, not yet remembered. */
8798
+ reason: 'out_of_scope' | 'replaced' | 'retired' | 'not_confirmed';
8799
+ }
8800
+
8801
+ /**
8802
+ * A `[rule:<id>]` the reply or step wrote. `unchecked` = the id is in force and the step cited it —
8803
+ * whether it FOLLOWED it is not checked (DES-rule-check will say); `unverified` = not an in-force
8804
+ * rule here (invented, or another project's). Never summed into a "followed" count.
8805
+ */
8806
+ export interface ConsiderationCitation {
8807
+ id: string;
8808
+ /** The seat (`cliKey`) or the unit id that wrote it. */
8809
+ by: string;
8810
+ status: 'unchecked' | 'unverified';
8811
+ label: string;
8812
+ }
8813
+
8814
+ /**
8815
+ * `GET /chats/:id/turns/:turnId/considered` and `GET /runs/:id/units/:unitKey/considered?attempt=`
8816
+ * (operator+): what the seats were given to consider, what was set aside, and what they cited.
8817
+ */
8818
+ export interface Consideration {
8819
+ subject: { kind: 'chat'; chat_id: string; turn_id: string } | { kind: 'unit'; run_id: string; ord: number; attempt: number };
8820
+ /** `considered:<chat>:<turn>` or `considered:<run>:<ord>:<attempt>` — the bus fact's idempotency key. */
8821
+ key: string;
8822
+ project_id: string | null;
8823
+ /** Severity-ordered (critical → info). */
8824
+ considered: ConsiderationRule[];
8825
+ set_aside: ConsiderationSetAside[];
8826
+ cited: ConsiderationCitation[];
8827
+ /** `considerRules` (the engine's project-aware read), `global-only` (an engine without it), or `unavailable`. */
8828
+ source: 'considerRules' | 'global-only' | 'unavailable';
8829
+ }
8830
+
8831
+ // ── Artifact editors (DES-artifact-editor-plugins §5.2, §6, §8.2; EP-C1, api-types 0.86.0) ───────
8832
+
8833
+ /** What a plugin can ask for (§6.1). There is no permission for network calls, agents or gates. */
8834
+ export type EditorPermission =
8835
+ | 'artifact.read'
8836
+ | 'artifact.write'
8837
+ | 'selection.chip'
8838
+ | 'composer.draft'
8839
+ | 'checks.read'
8840
+ | 'checks.contribute'
8841
+ | 'sources.read'
8842
+ | 'media.read'
8843
+ | 'artifact.export'
8844
+ | 'ui.fullscreen'
8845
+ | 'network.media';
8846
+
8847
+ /**
8848
+ * One registered editor, as Settings → Editors renders it. No path is on the wire: the bundle is
8849
+ * fetched at `entry_url` (`GET /editors/:id/:version/entry`, the §8.2 headers, re-hashed per serve).
8850
+ * First-party editors ship inside studio's bundle (`<studio dist>/editors/<id>/editor.json` +
8851
+ * `index.html`, ids `wicked-*`) and are discovered at boot; third-party editors arrive as garden
8852
+ * packs and cannot be installed before the install-time conformance run (EP-C8).
8853
+ */
8854
+ export interface EditorView {
8855
+ id: string;
8856
+ title: string;
8857
+ version: string;
8858
+ /** wicked.editor protocol versions it speaks. */
8859
+ protocol: number[];
8860
+ /** Artifact kinds it can open. */
8861
+ kinds: string[];
8862
+ sizes: Array<'inline' | 'pane' | 'full'>;
8863
+ panels?: Array<'checks'>;
8864
+ /** Each with the reason shown at install. The GRANTED set is `GET /editors/:id/grants`. */
8865
+ permissions: Array<{ id: EditorPermission; why: string }>;
8866
+ /** The full sha256 of the entry file, pinned when the registry read it. */
8867
+ sha256: string;
8868
+ bytes: number;
8869
+ first_party: boolean;
8870
+ enabled: boolean;
8871
+ source: 'studio-bundle';
8872
+ entry_url: string;
8873
+ }
8874
+
8875
+ /** `GET /editors` (operator+). */
8876
+ export interface ListEditorsResponse {
8877
+ editors: EditorView[];
8878
+ /** Why `POST /editors` answers 501 today: third-party installs wait on EP-C8. */
8879
+ installs: 'refused_until_conformance';
8880
+ }
8881
+
8882
+ /** `POST /editors` body (human-only): a pack directory holding `wicked-pack.json`. */
8883
+ export interface InstallEditorBody {
8884
+ packRoot: string;
8885
+ }
8886
+
8887
+ /** One finding of garden's `pack check --json`. */
8888
+ export interface PackCheckFinding {
8889
+ level: 'error' | 'warn';
8890
+ code: string;
8891
+ message: string;
8892
+ path?: string;
8893
+ }
8894
+
8895
+ /** The verdict of garden's `pack check --json` (the fail-closed gate every install runs first). */
8896
+ export interface PackCheckResult {
8897
+ ok: boolean;
8898
+ errors: PackCheckFinding[];
8899
+ warnings: PackCheckFinding[];
8900
+ }
8901
+
8902
+ /**
8903
+ * `POST /editors` → 501: the pack passed garden's gate, and this is what the install WOULD ask the
8904
+ * operator to approve (§3.2 "Add these") once third-party installs open (EP-C8). Nothing was written.
8905
+ */
8906
+ export interface InstallEditorRefusal {
8907
+ code: 'third_party_editors_not_available';
8908
+ error: string;
8909
+ check: PackCheckResult;
8910
+ pack: {
8911
+ name: string;
8912
+ vendor: string;
8913
+ version: string;
8914
+ editors: Array<{ id: string; title: string; version: string; kinds: string[]; permissions: Array<{ id: string; why: string }> }>;
8915
+ blocks: Array<{ id: string; label: string; produces_kind: string; skills: string[] }>;
8916
+ /** The pack's skill directories, approved together with its editors and blocks. */
8917
+ skills: string[];
8918
+ };
8919
+ }
8920
+
8921
+ /** `POST /editors/:id/enabled` body (human-only). */
8922
+ export interface SetEditorEnabledBody {
8923
+ enabled: boolean;
8924
+ }
8925
+
8926
+ /** One decided permission (the engine's `evaluate_editor_grants`, EP-K1). */
8927
+ export interface EditorGrant {
8928
+ permission: EditorPermission | string;
8929
+ decision: 'allow' | 'ask' | 'deny';
8930
+ /** The steering rules that decided it. */
8931
+ ruleIds: string[];
8932
+ /** The ledger entry an operator's "allow" adds to `EDITOR-GRANTS.excludes` (`editor:<id>@<version>#<sha256>/<permission>`). */
8933
+ token: string;
8934
+ }
8935
+
8936
+ /**
8937
+ * `GET /editors/:id/grants?project=` (operator+): the engine's decided set for this editor's version
8938
+ * and hash (a changed hash is a new token and asks again), deny dominating. The host fetches it
8939
+ * before `host.hello` and on every settings/rule change, and enforces it on every request.
8940
+ */
8941
+ export interface EditorGrantsResponse {
8942
+ editorId: string;
8943
+ version: string;
8944
+ sha256: string;
8945
+ project: string | null;
8946
+ firstParty: boolean;
8947
+ grants: EditorGrant[];
8948
+ }
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.86.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",