wicked-crew-api-types 0.29.0 → 0.30.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 +122 -0
  2. package/package.json +1 -1
package/index.d.ts CHANGED
@@ -2710,6 +2710,128 @@ export interface InteractiveDocDeleteResponse {
2710
2710
  ledger: InteractiveDocDeleteLedgerReport;
2711
2711
  }
2712
2712
 
2713
+ /** One hand-pinned demo step on a `kind: "demo"` create (api-types 0.30.0): the wizard's ordered
2714
+ * steps the governed run authors the spec from (ADR-0018: the agent authors, the service records). */
2715
+ export interface InteractiveDemoStepDraft {
2716
+ index: number;
2717
+ subject: string;
2718
+ action: string;
2719
+ }
2720
+
2721
+ /**
2722
+ * The body of `POST /projects/:projectId/interactive/api/docs` as crew's proxy understands it
2723
+ * (acceptance finding F-046; api-types 0.30.0 — the studio types its create from THIS declaration,
2724
+ * no local mirror). The bridge's own fields (`name`, `kind`, `html`, `brief`, `source_paths`,
2725
+ * `url`, `demo_steps`, `style`, `project`, `source_message_id`) are relayed as-is — this type
2726
+ * documents the two things CREW adds at the proxy before forwarding:
2727
+ *
2728
+ * - `repo_ref` / `repo_refs` — the repository (or repositories) this document is ABOUT, each a
2729
+ * registered repo id, its registry name, or its root directory's basename. Crew validates them
2730
+ * against the project's `crew.repo` members BEFORE the bridge sees the request (a miss is the
2731
+ * 400 {@link InteractiveDocCreateRefusal}, nothing created), strips them from the forwarded
2732
+ * body, and remembers the binding so the governed draft/demo run is grounded on THOSE repos
2733
+ * (offline snapshot + the project graph) — never on the project's first member. Unfiled
2734
+ * (`default` mount) documents cannot name a repository.
2735
+ * - `style` — passed through when given; when ABSENT crew infers it from the brief's format
2736
+ * words (print-ready / A4 / brochure → `brochure`; slides / deck → `ppt`; memo / whitepaper →
2737
+ * `doc`) so the bridge's own print instructions apply to a print brief. No format words → the
2738
+ * bridge's `web` default.
2739
+ */
2740
+ export interface InteractiveDocCreateRequest {
2741
+ /** The doc name; the bridge slugifies it (409 when taken or retired). */
2742
+ name?: string;
2743
+ /** Omitted = a plain html doc (`html` required); `source` = generated from brief/sources; `demo` = a recording. */
2744
+ kind?: 'source' | 'demo';
2745
+ /** A plain html doc's content (or a `source` doc's seed). */
2746
+ html?: string;
2747
+ brief?: string;
2748
+ source_paths?: string[];
2749
+ /** `kind: "demo"` — the live app URL to record against. */
2750
+ url?: string;
2751
+ /** `kind: "demo"` — hand-pinned steps; omitted = the run authors them from the brief. */
2752
+ demo_steps?: InteractiveDemoStepDraft[];
2753
+ style?: 'web' | 'ppt' | 'brochure' | 'doc';
2754
+ /** Crew project binding (DES-PROJECT-001 §2.3): registration is the authority. */
2755
+ project?: string;
2756
+ /** The thread message this generation came from (§7.6). */
2757
+ source_message_id?: string;
2758
+ /** ONE subject repository: a repo id, its name, or its root basename. */
2759
+ repo_ref?: string;
2760
+ /** SEVERAL subject repositories (at most 8); the union with `repo_ref`, de-duplicated. */
2761
+ repo_refs?: string[];
2762
+ }
2763
+
2764
+ /**
2765
+ * The bridge's answer to a successful `POST /projects/:projectId/interactive/api/docs`, relayed
2766
+ * verbatim by crew's proxy (api-types 0.30.0): interactive's `{ name, head, … }` — `generating`
2767
+ * for a `kind: "source"` doc whose first draft a governed run now produces, `learning` for a demo,
2768
+ * `project_id` echoed for a project-bound doc.
2769
+ */
2770
+ export interface InteractiveDocCreateResult {
2771
+ name: string;
2772
+ head: number;
2773
+ kind?: 'doc' | 'demo';
2774
+ generating?: boolean;
2775
+ learning?: boolean;
2776
+ project_id?: string;
2777
+ }
2778
+
2779
+ /**
2780
+ * Crew's 400 on `POST /projects/:projectId/interactive/api/docs` when the request names a
2781
+ * repository the document cannot be grounded on (F-046; api-types 0.30.0). Nothing was created
2782
+ * on the bridge.
2783
+ */
2784
+ export interface InteractiveDocCreateRefusal {
2785
+ /** Human-readable, names the fix (attach the repo, pick one of `available`, name it by id, …). */
2786
+ error: string;
2787
+ /**
2788
+ * `repo_not_in_project` — a ref matched no member repo; `unfiled_doc_repo` — a repo named on the
2789
+ * Unfiled mount; `invalid_repo_ref` — junk spelling / shape / over the cap; `ambiguous_repo_ref`
2790
+ * — a name or basename shared by several member repos (name it by id); `project_mismatch` — the
2791
+ * body's `project` is not the route's project (or is present on the Unfiled mount). The proxy
2792
+ * canonicalizes an OMITTED `project` from the route.
2793
+ */
2794
+ code: 'repo_not_in_project' | 'unfiled_doc_repo' | 'invalid_repo_ref' | 'ambiguous_repo_ref' | 'project_mismatch';
2795
+ /** The refs the request named, as spelled (best-effort stringified when malformed). */
2796
+ requested: string[];
2797
+ /** The subset of `requested` that matched no member repo (`repo_not_in_project` only). */
2798
+ missing?: string[];
2799
+ /** `ambiguous_repo_ref`: each ambiguous ref with the member repos it names. */
2800
+ ambiguous?: Array<{ ref: string; candidates: Array<{ id: string; name: string }> }>;
2801
+ /** The project's `crew.repo` members the request could have named. */
2802
+ available?: Array<{ id: string; name: string }>;
2803
+ }
2804
+
2805
+ /**
2806
+ * The 502 the create earns when the bridge dropped the connection AFTER the request had reached it
2807
+ * (api-types 0.30.0): the document may already exist, so the proxy never replays the POST — list the
2808
+ * project's documents before creating again.
2809
+ */
2810
+ export interface InteractiveDocCreateUndetermined {
2811
+ code: 'create_undetermined';
2812
+ error: string;
2813
+ }
2814
+
2815
+ /**
2816
+ * The payload of `wicked.interactive.status.posted` as crew's own seams emit it (`producer_id:
2817
+ * "wi-crew"`, relayed on `/ws` inside an `interactiveEvent` frame; api-types 0.30.0). Acceptance finding F-045: every
2818
+ * seam emit — status narration, the terminal error/complete lines, and the closing
2819
+ * `draft.completed` / `edit.completed` / `demo.requested` — now carries `project_id` for a
2820
+ * project-bound document (omitted for an Unfiled one), exactly like the bridge's own emits, so a
2821
+ * skin can file the frame under the right thread. A skin should ALSO match frames by
2822
+ * `document_id` alone when the doc is open under exactly one mount (belt and braces).
2823
+ */
2824
+ export interface InteractiveStatusPosted {
2825
+ ts: string;
2826
+ document_id: string;
2827
+ /** Present for a project-bound document. */
2828
+ project_id?: string;
2829
+ state: 'processing' | 'working' | 'asking' | 'complete' | 'error';
2830
+ message?: string;
2831
+ /** The edit seam stamps the handoff version it is answering. */
2832
+ version?: number;
2833
+ }
2834
+
2713
2835
  /**
2714
2836
  * One row of `GET /projects/:projectId/interactive/api/docs` (crew#472) — the bridge's own
2715
2837
  * `GET /api/docs` row (interactive's `listDocs` shape, relayed field-for-field) stamped with the
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "wicked-crew-api-types",
3
- "version": "0.29.0",
3
+ "version": "0.30.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",