wicked-crew-api-types 0.28.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 +146 -6
  2. package/package.json +1 -1
package/index.d.ts CHANGED
@@ -1328,6 +1328,11 @@ export interface SteeringLandingResult {
1328
1328
 
1329
1329
  // ── Skills — the daemon-owned garden plugin root, published as immutable snapshots (api-types 0.28.0) ──
1330
1330
  //
1331
+ // api-types 0.29.0 (design amendment v3.6, crew #490): the installer-managed copy
1332
+ // `<config dir>/plugins/wicked-garden` is a LAST-resort seed source — `SkillSourceKind` gains
1333
+ // `installer-copy`, and `DiagnosticsSkillsFinding.kind` gains the persistent `skills.source` warning
1334
+ // and the fail-closed `skills.manifest` error.
1335
+ //
1331
1336
  // Skills are files (skills keystone, design v3 + amendments v3.1/v3.2). The daemon owns ONE
1332
1337
  // effective `wicked-garden`-shaped plugin root — `<state home>/skills/effective/`, the dependency
1333
1338
  // closure of the installed plugin: `.claude-plugin/{plugin.json,archetypes.json,components.json}`,
@@ -1361,10 +1366,14 @@ export type SkillKind = 'router' | 'fork-worker' | 'module';
1361
1366
  * it while the operator's edits were kept). */
1362
1367
  export type SkillProvenance = 'shipped' | 'override' | 'user-added';
1363
1368
 
1364
- /** Where a baseline was captured from. `claude-plugin-cache` covers the marketplace cache AND the
1365
- * hand-installed `plugins/wicked-garden` copy (both are "the installed plugin"); `checkout` is a
1366
- * git working tree; `directory` any other explicit plugin-shaped directory. */
1367
- export type SkillSourceKind = 'claude-plugin-cache' | 'checkout' | 'directory';
1369
+ /** Where a baseline was captured from. `claude-plugin-cache` is the marketplace cache
1370
+ * (`<config dir>/plugins/cache/wicked-garden/wicked-garden/<version>` — the plugin Claude Code
1371
+ * runs); `installer-copy` is the installer-managed `<config dir>/plugins/wicked-garden` copy
1372
+ * (`npx wicked-installer install wicked-garden`), accepted only as the LAST resort when no cache
1373
+ * exists (design v3.6, api-types 0.29.0) and flagged by the `skills.source` diagnostics finding
1374
+ * while it is the current baseline; `checkout` is a git working tree; `directory` any other
1375
+ * explicit plugin-shaped directory. */
1376
+ export type SkillSourceKind = 'claude-plugin-cache' | 'installer-copy' | 'checkout' | 'directory';
1368
1377
 
1369
1378
  /** The per-baseline `uv sync` state (`<baseline>/.venv`, provisioned once per content hash — the
1370
1379
  * publish that needs it AWAITS it — and shared read-only by every snapshot that links it):
@@ -2701,6 +2710,128 @@ export interface InteractiveDocDeleteResponse {
2701
2710
  ledger: InteractiveDocDeleteLedgerReport;
2702
2711
  }
2703
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
+
2704
2835
  /**
2705
2836
  * One row of `GET /projects/:projectId/interactive/api/docs` (crew#472) — the bridge's own
2706
2837
  * `GET /api/docs` row (interactive's `listDocs` shape, relayed field-for-field) stamped with the
@@ -3376,8 +3507,17 @@ export interface DiagnosticsSkillsFinding {
3376
3507
  * blocked (engine input points at a non-existent refusal path — launches fail loudly until the
3377
3508
  * catalog is fixed); `skills.config` = the configured root is corrupt/unusable (same refusal;
3378
3509
  * `error`), or — as a `warning` on the `published` state — the root lies OUTSIDE the daemon
3379
- * state home, so core's fence cross-check (`WICKED_CREW_STATE_HOME`) refuses every launch. */
3380
- kind: 'skills.fallback' | 'skills.blocked' | 'skills.config';
3510
+ * state home, so core's fence cross-check (`WICKED_CREW_STATE_HOME`) refuses every launch;
3511
+ * `skills.source` (`warning`, api-types 0.29.0, design v3.6) = the CURRENT baseline was seeded
3512
+ * from the installer-managed copy (`SkillSourceKind` `installer-copy`) — the daemon works, but
3513
+ * that copy receives no marketplace updates until the plugin is registered with Claude Code; it
3514
+ * persists (alongside the ladder's own finding, if any) until a refresh from the marketplace
3515
+ * cache re-records the baseline's provenance (byte-identical or not); `skills.manifest`
3516
+ * (`error`, api-types 0.29.0) = `manifest.json` could not be read when diagnostics were taken
3517
+ * (corrupt, unreadable, or the root no longer the one the store bound) — reported as
3518
+ * `config-error` with the cause instead of the stale boot outcome; the exported engine input is
3519
+ * unchanged until the daemon restarts. */
3520
+ kind: 'skills.fallback' | 'skills.blocked' | 'skills.config' | 'skills.source' | 'skills.manifest';
3381
3521
  severity: 'warning' | 'error';
3382
3522
  message: string;
3383
3523
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "wicked-crew-api-types",
3
- "version": "0.28.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",