wicked-crew 0.9.4 → 0.9.6

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 (121) hide show
  1. package/dist/api/delivery-assurance.d.ts.map +1 -1
  2. package/dist/api/delivery-assurance.js +14 -3
  3. package/dist/api/delivery-assurance.js.map +1 -1
  4. package/dist/api/discovery-source.d.ts +4 -4
  5. package/dist/api/discovery-source.d.ts.map +1 -1
  6. package/dist/api/discovery-source.js +14 -8
  7. package/dist/api/discovery-source.js.map +1 -1
  8. package/dist/api/eval-sample.d.ts +12 -12
  9. package/dist/api/governance-steering.d.ts +2 -2
  10. package/dist/api/governance-steering.js +2 -2
  11. package/dist/api/governance-steering.js.map +1 -1
  12. package/dist/api/mcp.d.ts +4 -4
  13. package/dist/api/onboarding-capture.d.ts +1 -1
  14. package/dist/api/onboarding-capture.d.ts.map +1 -1
  15. package/dist/api/onboarding-capture.js +1 -1
  16. package/dist/api/onboarding-capture.js.map +1 -1
  17. package/dist/api/routes.d.ts +133 -131
  18. package/dist/api/routes.d.ts.map +1 -1
  19. package/dist/api/routes.js +37 -34
  20. package/dist/api/routes.js.map +1 -1
  21. package/dist/api/server.d.ts +6 -0
  22. package/dist/api/server.d.ts.map +1 -1
  23. package/dist/api/server.js +36 -1
  24. package/dist/api/server.js.map +1 -1
  25. package/dist/api/testing.js +1 -1
  26. package/dist/api/testing.js.map +1 -1
  27. package/dist/campaigns/plan.d.ts +8 -1
  28. package/dist/campaigns/plan.d.ts.map +1 -1
  29. package/dist/campaigns/plan.js +15 -3
  30. package/dist/campaigns/plan.js.map +1 -1
  31. package/dist/campaigns/routes.d.ts +8 -8
  32. package/dist/core/adapter.d.ts +29 -89
  33. package/dist/core/adapter.d.ts.map +1 -1
  34. package/dist/core/adapter.js +86 -609
  35. package/dist/core/adapter.js.map +1 -1
  36. package/dist/core/builtin-catalog.d.ts +24 -0
  37. package/dist/core/builtin-catalog.d.ts.map +1 -0
  38. package/dist/core/builtin-catalog.js +54 -0
  39. package/dist/core/builtin-catalog.js.map +1 -0
  40. package/dist/core/council-settings.d.ts +18 -0
  41. package/dist/core/council-settings.d.ts.map +1 -0
  42. package/dist/core/council-settings.js +37 -0
  43. package/dist/core/council-settings.js.map +1 -0
  44. package/dist/core/deliver-text.d.ts +1 -1
  45. package/dist/core/deliver-text.d.ts.map +1 -1
  46. package/dist/core/deliver-text.js +3 -2
  47. package/dist/core/deliver-text.js.map +1 -1
  48. package/dist/core/deliver.d.ts +0 -6
  49. package/dist/core/deliver.d.ts.map +1 -1
  50. package/dist/core/deliver.js +0 -6
  51. package/dist/core/deliver.js.map +1 -1
  52. package/dist/core/run-identity.d.ts +1 -1
  53. package/dist/core/run-identity.d.ts.map +1 -1
  54. package/dist/core/run-identity.js +7 -3
  55. package/dist/core/run-identity.js.map +1 -1
  56. package/dist/editors/csp.js +2 -2
  57. package/dist/editors/csp.js.map +1 -1
  58. package/dist/editors/pack-install.d.ts +35 -14
  59. package/dist/editors/pack-install.d.ts.map +1 -1
  60. package/dist/editors/pack-install.js +171 -24
  61. package/dist/editors/pack-install.js.map +1 -1
  62. package/dist/editors/registry.d.ts +151 -13
  63. package/dist/editors/registry.d.ts.map +1 -1
  64. package/dist/editors/registry.js +257 -20
  65. package/dist/editors/registry.js.map +1 -1
  66. package/dist/editors/routes.d.ts +10 -5
  67. package/dist/editors/routes.d.ts.map +1 -1
  68. package/dist/editors/routes.js +30 -20
  69. package/dist/editors/routes.js.map +1 -1
  70. package/dist/learn/routes.d.ts +42 -0
  71. package/dist/learn/routes.d.ts.map +1 -0
  72. package/dist/learn/routes.js +87 -0
  73. package/dist/learn/routes.js.map +1 -0
  74. package/dist/learn/schedule-store.d.ts +41 -0
  75. package/dist/learn/schedule-store.d.ts.map +1 -0
  76. package/dist/learn/schedule-store.js +137 -0
  77. package/dist/learn/schedule-store.js.map +1 -0
  78. package/dist/learn/scheduler.d.ts +71 -0
  79. package/dist/learn/scheduler.d.ts.map +1 -0
  80. package/dist/learn/scheduler.js +222 -0
  81. package/dist/learn/scheduler.js.map +1 -0
  82. package/dist/learn/topics.d.ts +14 -0
  83. package/dist/learn/topics.d.ts.map +1 -0
  84. package/dist/learn/topics.js +95 -0
  85. package/dist/learn/topics.js.map +1 -0
  86. package/dist/projects/graph.d.ts +14 -0
  87. package/dist/projects/graph.d.ts.map +1 -1
  88. package/dist/projects/graph.js +41 -2
  89. package/dist/projects/graph.js.map +1 -1
  90. package/dist/projects/routes.d.ts +2 -2
  91. package/dist/projects/state-home-registry.d.ts.map +1 -1
  92. package/dist/projects/state-home-registry.js +2 -0
  93. package/dist/projects/state-home-registry.js.map +1 -1
  94. package/dist/qe/acceptance.d.ts +5 -0
  95. package/dist/qe/acceptance.d.ts.map +1 -1
  96. package/dist/qe/acceptance.js +4 -2
  97. package/dist/qe/acceptance.js.map +1 -1
  98. package/dist/qe/author-workflow.d.ts +6 -83
  99. package/dist/qe/author-workflow.d.ts.map +1 -1
  100. package/dist/qe/author-workflow.js +6 -300
  101. package/dist/qe/author-workflow.js.map +1 -1
  102. package/dist/qe/ledger.d.ts +20 -0
  103. package/dist/qe/ledger.d.ts.map +1 -1
  104. package/dist/qe/ledger.js +28 -2
  105. package/dist/qe/ledger.js.map +1 -1
  106. package/dist/skills/core-closure.d.ts +3 -5
  107. package/dist/skills/core-closure.d.ts.map +1 -1
  108. package/dist/skills/core-closure.js +3 -5
  109. package/dist/skills/core-closure.js.map +1 -1
  110. package/dist/standing-orders/routes.d.ts +4 -4
  111. package/dist/standing-orders/store.d.ts +2 -2
  112. package/dist/studio/assets/index-C0ZMi_8d.js +583 -0
  113. package/dist/studio/assets/index-DYLo25MW.css +32 -0
  114. package/dist/studio/editors/wicked-page/editor.json +1 -1
  115. package/dist/studio/editors/wicked-page/index.html +1 -1
  116. package/dist/studio/index.html +2 -2
  117. package/dist/studio/testid-inventory.json +566 -36
  118. package/endpoint-manifest.json +59 -2
  119. package/package.json +4 -4
  120. package/dist/studio/assets/index-BGfFmWw4.css +0 -32
  121. package/dist/studio/assets/index-BMRUMU4X.js +0 -567
@@ -1,16 +1,22 @@
1
1
  /**
2
- * A pack install, as far as it goes before EP-C8 (DES-artifact-editor-plugins §5.2, §9.2; EP-C1).
2
+ * A pack install (DES-artifact-editor-plugins §3.2, §5.2, §9.2, §12.1; EP-C1 + the install-time
3
+ * conformance run of EP-C8, operator ruling X3).
3
4
  *
4
- * Install is human-only (§6.4) and runs garden's fail-closed gate FIRST: `pack check --json` on the
5
- * pack root (schema, every editor's entry inside the pack, its hash, its size, nothing loaded from
6
- * outside). Then crew reads the spec-2 manifest and lists what the operator would be asked to
7
- * approve — the editors, the blocks and the pack's skills (§3.2 "Add these") — and REFUSES with 501
8
- * `third_party_editors_not_available`: an unverified editor must pass the install-time conformance
9
- * run (cases 1-12 against the bundle, headless Chrome) before it may be installed, and that run is
10
- * EP-C8. Nothing is written. The refusal carries the check verdict and the approval list, so the
11
- * operator sees exactly what will be asked once installs open.
5
+ * Install is human-only (§6.4) and fail closed at every step, in this order:
6
+ * 1. garden's `pack check --json` on the pack root (schema, every editor's entry inside the pack, its
7
+ * hash, its size, nothing loaded from outside);
8
+ * 2. the pack ships editors only: one that also ships skills or blocks is refused with the approval
9
+ * list (501 `pack_ships_skills_or_blocks`), since their own "Add these" step (§3.2) is not built;
10
+ * 3. the **conformance run**, done by crew itself: garden's `scripts/editor/conformance.py --pack
11
+ * <root> --host-url <this daemon>` drives studio's conformance host page (served by this daemon)
12
+ * in headless Chromium against each editor. A failed case, no browser or no runner is a 422 with
13
+ * the report — an unverified editor is never installed. Only crew's run counts (§12.1, review S13);
14
+ * an author's own run is not consulted;
15
+ * 4. the registry reads every editor back from disk at its pinned hash and records it.
16
+ * Nothing is written into the pack. The registry file is `daemon-editors.json`.
12
17
  */
13
- import type { InstallEditorRefusal, PackCheckResult } from '../core/types.js';
18
+ import type { EditorConformanceSummary, InstallEditorResponse, PackCheckResult } from '../core/types.js';
19
+ import { EditorRegistry } from './registry.js';
14
20
  export type PackCheckRunner = (packRoot: string) => Promise<PackCheckResult>;
15
21
  /**
16
22
  * Garden's gate, run as a child: `python3 <garden>/scripts/pack/check.py <pack> --json --garden-root <garden>`
@@ -19,10 +25,25 @@ export type PackCheckRunner = (packRoot: string) => Promise<PackCheckResult>;
19
25
  */
20
26
  export declare function gardenPackCheck(gardenRoot: string | null): PackCheckRunner;
21
27
  export declare class PackInstallError extends Error {
22
- readonly status: 400 | 404 | 422;
28
+ readonly status: 400 | 404 | 409 | 422 | 501;
23
29
  readonly check?: PackCheckResult | undefined;
24
- constructor(status: 400 | 404 | 422, message: string, check?: PackCheckResult | undefined);
30
+ readonly body?: Record<string, unknown> | undefined;
31
+ constructor(status: 400 | 404 | 409 | 422 | 501, message: string, check?: PackCheckResult | undefined, body?: Record<string, unknown> | undefined);
25
32
  }
26
- /** What `POST /editors` reads of a pack before refusing: the approval list (§3.2). */
27
- export declare function previewPackInstall(packRootRaw: string, check: PackCheckRunner): Promise<InstallEditorRefusal>;
33
+ /** The install-time conformance run: the pack root in, garden's report out. */
34
+ export type ConformanceRunner = (packRoot: string) => Promise<EditorConformanceSummary>;
35
+ /** The cases a conformance run must report passing for every editor (garden's runner: 0-6 and 8-12). */
36
+ export declare const CONFORMANCE_CASES: readonly ["0-manifest", "1-handshake", "2-sizes", "3-no-network", "4-permissions", "5-typing", "6-forwarding", "8-strict-input", "9-liveness", "10-keyboard", "11-theme", "12-hash-pinned"];
37
+ /**
38
+ * Garden's conformance runner as a child: `python3 <garden>/scripts/editor/conformance.py --pack <root>
39
+ * --host-url <this daemon> --json`. A missing garden or runner, no daemon URL, no browser, or an
40
+ * unreadable report is a FAILED run with the reason — never a pass.
41
+ */
42
+ export declare function gardenConformance(gardenRoot: string | null, hostUrl: () => string | null): ConformanceRunner;
43
+ /** `POST /editors {packRoot, enabled?}`: the gate, the conformance run, then the registry. */
44
+ export declare function installPack(packRootRaw: string, enabled: boolean | undefined, deps: {
45
+ check: PackCheckRunner;
46
+ conformance: ConformanceRunner;
47
+ registry: EditorRegistry;
48
+ }): Promise<InstallEditorResponse>;
28
49
  //# sourceMappingURL=pack-install.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"pack-install.d.ts","sourceRoot":"","sources":["../../src/editors/pack-install.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAKH,OAAO,KAAK,EAAE,oBAAoB,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AAG9E,MAAM,MAAM,eAAe,GAAG,CAAC,QAAQ,EAAE,MAAM,KAAK,OAAO,CAAC,eAAe,CAAC,CAAC;AAiB7E;;;;GAIG;AACH,wBAAgB,eAAe,CAAC,UAAU,EAAE,MAAM,GAAG,IAAI,GAAG,eAAe,CAiC1E;AAED,qBAAa,gBAAiB,SAAQ,KAAK;IAEvC,QAAQ,CAAC,MAAM,EAAE,GAAG,GAAG,GAAG,GAAG,GAAG;IAEhC,QAAQ,CAAC,KAAK,CAAC,EAAE,eAAe;gBAFvB,MAAM,EAAE,GAAG,GAAG,GAAG,GAAG,GAAG,EAChC,OAAO,EAAE,MAAM,EACN,KAAK,CAAC,EAAE,eAAe,YAAA;CAKnC;AAED,sFAAsF;AACtF,wBAAsB,kBAAkB,CAAC,WAAW,EAAE,MAAM,EAAE,KAAK,EAAE,eAAe,GAAG,OAAO,CAAC,oBAAoB,CAAC,CAgEnH"}
1
+ {"version":3,"file":"pack-install.d.ts","sourceRoot":"","sources":["../../src/editors/pack-install.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAKH,OAAO,KAAK,EAAE,wBAAwB,EAAwB,qBAAqB,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AAE/H,OAAO,EAAyB,cAAc,EAA2D,MAAM,eAAe,CAAC;AAE/H,MAAM,MAAM,eAAe,GAAG,CAAC,QAAQ,EAAE,MAAM,KAAK,OAAO,CAAC,eAAe,CAAC,CAAC;AAiB7E;;;;GAIG;AACH,wBAAgB,eAAe,CAAC,UAAU,EAAE,MAAM,GAAG,IAAI,GAAG,eAAe,CAiC1E;AAED,qBAAa,gBAAiB,SAAQ,KAAK;IAEvC,QAAQ,CAAC,MAAM,EAAE,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG;IAE5C,QAAQ,CAAC,KAAK,CAAC,EAAE,eAAe;IAChC,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;gBAH9B,MAAM,EAAE,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,EAC5C,OAAO,EAAE,MAAM,EACN,KAAK,CAAC,EAAE,eAAe,YAAA,EACvB,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,YAAA;CAK1C;AAED,+EAA+E;AAC/E,MAAM,MAAM,iBAAiB,GAAG,CAAC,QAAQ,EAAE,MAAM,KAAK,OAAO,CAAC,wBAAwB,CAAC,CAAC;AAExF,wGAAwG;AACxG,eAAO,MAAM,iBAAiB,6LAA8L,CAAC;AAE7N;;;;GAIG;AACH,wBAAgB,iBAAiB,CAAC,UAAU,EAAE,MAAM,GAAG,IAAI,EAAE,OAAO,EAAE,MAAM,MAAM,GAAG,IAAI,GAAG,iBAAiB,CAkD5G;AA0FD,8FAA8F;AAC9F,wBAAsB,WAAW,CAC/B,WAAW,EAAE,MAAM,EACnB,OAAO,EAAE,OAAO,GAAG,SAAS,EAC5B,IAAI,EAAE;IAAE,KAAK,EAAE,eAAe,CAAC;IAAC,WAAW,EAAE,iBAAiB,CAAC;IAAC,QAAQ,EAAE,cAAc,CAAA;CAAE,GACzF,OAAO,CAAC,qBAAqB,CAAC,CA2DhC"}
@@ -1,18 +1,24 @@
1
1
  /**
2
- * A pack install, as far as it goes before EP-C8 (DES-artifact-editor-plugins §5.2, §9.2; EP-C1).
2
+ * A pack install (DES-artifact-editor-plugins §3.2, §5.2, §9.2, §12.1; EP-C1 + the install-time
3
+ * conformance run of EP-C8, operator ruling X3).
3
4
  *
4
- * Install is human-only (§6.4) and runs garden's fail-closed gate FIRST: `pack check --json` on the
5
- * pack root (schema, every editor's entry inside the pack, its hash, its size, nothing loaded from
6
- * outside). Then crew reads the spec-2 manifest and lists what the operator would be asked to
7
- * approve — the editors, the blocks and the pack's skills (§3.2 "Add these") — and REFUSES with 501
8
- * `third_party_editors_not_available`: an unverified editor must pass the install-time conformance
9
- * run (cases 1-12 against the bundle, headless Chrome) before it may be installed, and that run is
10
- * EP-C8. Nothing is written. The refusal carries the check verdict and the approval list, so the
11
- * operator sees exactly what will be asked once installs open.
5
+ * Install is human-only (§6.4) and fail closed at every step, in this order:
6
+ * 1. garden's `pack check --json` on the pack root (schema, every editor's entry inside the pack, its
7
+ * hash, its size, nothing loaded from outside);
8
+ * 2. the pack ships editors only: one that also ships skills or blocks is refused with the approval
9
+ * list (501 `pack_ships_skills_or_blocks`), since their own "Add these" step (§3.2) is not built;
10
+ * 3. the **conformance run**, done by crew itself: garden's `scripts/editor/conformance.py --pack
11
+ * <root> --host-url <this daemon>` drives studio's conformance host page (served by this daemon)
12
+ * in headless Chromium against each editor. A failed case, no browser or no runner is a 422 with
13
+ * the report — an unverified editor is never installed. Only crew's run counts (§12.1, review S13);
14
+ * an author's own run is not consulted;
15
+ * 4. the registry reads every editor back from disk at its pinned hash and records it.
16
+ * Nothing is written into the pack. The registry file is `daemon-editors.json`.
12
17
  */
13
18
  import { existsSync, readdirSync, readFileSync, statSync } from 'node:fs';
14
19
  import { isAbsolute, join, resolve } from 'node:path';
15
20
  import { execCapped } from '../core/exec.js';
21
+ import { EditorInstallConflict, EditorRegistry, PackEditorSchema, editorEntryDigest } from './registry.js';
16
22
  /** The verdict shape garden's `scripts/pack/check.py --json` prints. */
17
23
  function parseCheckOutput(stdout) {
18
24
  try {
@@ -72,15 +78,83 @@ export function gardenPackCheck(gardenRoot) {
72
78
  export class PackInstallError extends Error {
73
79
  status;
74
80
  check;
75
- constructor(status, message, check) {
81
+ body;
82
+ constructor(status, message, check, body) {
76
83
  super(message);
77
84
  this.status = status;
78
85
  this.check = check;
86
+ this.body = body;
79
87
  this.name = 'PackInstallError';
80
88
  }
81
89
  }
82
- /** What `POST /editors` reads of a pack before refusing: the approval list (§3.2). */
83
- export async function previewPackInstall(packRootRaw, check) {
90
+ /** The cases a conformance run must report passing for every editor (garden's runner: 0-6 and 8-12). */
91
+ export const CONFORMANCE_CASES = ['0-manifest', '1-handshake', '2-sizes', '3-no-network', '4-permissions', '5-typing', '6-forwarding', '8-strict-input', '9-liveness', '10-keyboard', '11-theme', '12-hash-pinned'];
92
+ /**
93
+ * Garden's conformance runner as a child: `python3 <garden>/scripts/editor/conformance.py --pack <root>
94
+ * --host-url <this daemon> --json`. A missing garden or runner, no daemon URL, no browser, or an
95
+ * unreadable report is a FAILED run with the reason — never a pass.
96
+ */
97
+ export function gardenConformance(gardenRoot, hostUrl) {
98
+ const failed = (error) => ({ ok: false, at: new Date().toISOString(), editors: [], error });
99
+ return async (packRoot) => {
100
+ if (gardenRoot === null)
101
+ return failed('no wicked-garden plugin found to run the editor conformance cases');
102
+ const script = join(gardenRoot, 'scripts', 'editor', 'conformance.py');
103
+ if (!existsSync(script))
104
+ return failed('this wicked-garden has no scripts/editor/conformance.py (needs the release with the editor-scaffold skill)');
105
+ const host = hostUrl();
106
+ if (host === null)
107
+ return failed('this daemon does not know its own URL to serve the conformance host page');
108
+ const args = [script, '--pack', packRoot, '--host-url', host, '--json'];
109
+ let stdout = '';
110
+ for (const bin of ['python3', 'python']) {
111
+ try {
112
+ stdout = (await execCapped(bin, args, { timeout: 240_000, windowsHide: true })).stdout;
113
+ break;
114
+ }
115
+ catch (err) {
116
+ const e = err;
117
+ if (e.code === 'ENOENT')
118
+ continue;
119
+ // A failing run exits 1 (a case failed) or 3 (no browser) with the JSON report on stdout.
120
+ if (typeof e.stdout === 'string' && e.stdout.trim() !== '') {
121
+ stdout = e.stdout;
122
+ break;
123
+ }
124
+ return failed(`the conformance run did not finish: ${e.message}`);
125
+ }
126
+ }
127
+ if (stdout === '')
128
+ return failed('no python interpreter found (python3 / python)');
129
+ try {
130
+ const raw = JSON.parse(stdout);
131
+ const editors = Array.isArray(raw.editors)
132
+ ? raw.editors.flatMap((e) => {
133
+ if (typeof e !== 'object' || e === null)
134
+ return [];
135
+ const r = e;
136
+ const cases = {};
137
+ if (typeof r.cases === 'object' && r.cases !== null) {
138
+ for (const [k, v] of Object.entries(r.cases))
139
+ cases[k] = { ok: typeof v === 'object' && v !== null && v.ok === true };
140
+ }
141
+ const gaps = Array.isArray(r.gaps) ? r.gaps.filter((g) => typeof g === 'string') : [];
142
+ return [{ id: String(r.id), version: typeof r.version === 'string' ? r.version : '', sha256: typeof r.sha256 === 'string' ? r.sha256 : '', ok: r.ok === true, cases, gaps }];
143
+ })
144
+ : [];
145
+ return {
146
+ ok: raw.ok === true,
147
+ at: new Date().toISOString(),
148
+ editors,
149
+ ...(typeof raw.error === 'string' ? { error: raw.error } : {}),
150
+ };
151
+ }
152
+ catch {
153
+ return failed('the conformance run printed no readable report');
154
+ }
155
+ };
156
+ }
157
+ async function readCheckedPack(packRootRaw, check) {
84
158
  if (typeof packRootRaw !== 'string' || packRootRaw.trim() === '' || !isAbsolute(packRootRaw)) {
85
159
  throw new PackInstallError(400, '`packRoot` must be an absolute path to a directory holding wicked-pack.json');
86
160
  }
@@ -124,19 +198,24 @@ export async function previewPackInstall(packRootRaw, check) {
124
198
  catch {
125
199
  skills = [];
126
200
  }
127
- const str = (v) => (typeof v === 'string' ? v : '');
128
- const strs = (v) => (Array.isArray(v) ? v.filter((x) => typeof x === 'string') : []);
201
+ return { pack: { root: packRoot, manifest, editors, blocks, skills }, verdict };
202
+ }
203
+ const str = (v) => (typeof v === 'string' ? v : '');
204
+ const strs = (v) => (Array.isArray(v) ? v.filter((x) => typeof x === 'string') : []);
205
+ /** The approval list a pack with skills or blocks would need (§3.2): the 501 body. */
206
+ function approvalList(pack, verdict) {
207
+ const m = pack.manifest;
129
208
  return {
130
- code: 'third_party_editors_not_available',
131
- error: 'third-party editors cannot be installed yet: the install-time conformance run (DES-artifact-editor-plugins EP-C8) ' +
132
- 'has not shipped, and an unverified editor is never installed. The pack passed wicked-garden `pack check`; ' +
133
- 'this is what the install would ask you to approve.',
209
+ code: 'pack_ships_skills_or_blocks',
210
+ error: 'this pack also ships skills or blocks, and their own approval step (DES-artifact-editor-plugins §3.2 ' +
211
+ '"Add these") is not built yet, so it cannot be installed. An editor-only pack can be. ' +
212
+ 'This is what the install would ask you to approve.',
134
213
  check: verdict,
135
214
  pack: {
136
- name: str(manifest['name']),
137
- vendor: str(manifest['vendor']),
138
- version: str(manifest['version']),
139
- editors: editors.map((e) => ({
215
+ name: str(m['name']),
216
+ vendor: str(m['vendor']),
217
+ version: str(m['version']),
218
+ editors: pack.editors.map((e) => ({
140
219
  id: str(e['id']),
141
220
  title: str(e['title']),
142
221
  version: str(e['version']),
@@ -145,9 +224,77 @@ export async function previewPackInstall(packRootRaw, check) {
145
224
  ? e['permissions'].map((p) => ({ id: str(p['id']), why: str(p['why']) }))
146
225
  : [],
147
226
  })),
148
- blocks: blocks.map((b) => ({ id: str(b['id']), label: str(b['label']), produces_kind: str(b['produces_kind']), skills: strs(b['skills']) })),
149
- skills,
227
+ blocks: pack.blocks.map((b) => ({ id: str(b['id']), label: str(b['label']), produces_kind: str(b['produces_kind']), skills: strs(b['skills']) })),
228
+ skills: pack.skills,
150
229
  },
151
230
  };
152
231
  }
232
+ /** The admitted manifest entry's digest, over the same parse the registry reads it back with. */
233
+ function digestOf(entry) {
234
+ const parsed = PackEditorSchema.safeParse(entry);
235
+ if (!parsed.success)
236
+ throw new PackInstallError(400, `editor ${str(entry['id'])}: manifest entry refused (${parsed.error.issues.map((i) => `${i.path.join('.')}: ${i.message}`).join('; ')})`);
237
+ return editorEntryDigest(parsed.data);
238
+ }
239
+ /** `POST /editors {packRoot, enabled?}`: the gate, the conformance run, then the registry. */
240
+ export async function installPack(packRootRaw, enabled, deps) {
241
+ const { pack, verdict } = await readCheckedPack(packRootRaw, deps.check);
242
+ if (pack.blocks.length > 0 || pack.skills.length > 0) {
243
+ throw new PackInstallError(501, 'the pack ships skills or blocks', verdict, approvalList(pack, verdict));
244
+ }
245
+ const name = str(pack.manifest['name']);
246
+ const ids = pack.editors.map((e) => str(e['id']));
247
+ for (const id of ids) {
248
+ if (deps.registry.get(id)?.firstParty === true)
249
+ throw new PackInstallError(409, `${id} is a first-party editor's id`, verdict);
250
+ }
251
+ const conformance = await deps.conformance(pack.root);
252
+ // The report counts only for the bytes being installed (codex r1): the run's own version and entry
253
+ // hash must be the manifest's, which the registry then re-reads at that same hash.
254
+ const missing = (e) => {
255
+ const r = conformance.editors.find((x) => x.id === str(e['id']));
256
+ if (r === undefined)
257
+ return ['not in the report'];
258
+ if (r.sha256 !== str(e['sha256']) || r.version !== str(e['version']))
259
+ return [`ran against ${r.version || '?'}#${(r.sha256 || '?').slice(0, 12)}, not this entry`];
260
+ return CONFORMANCE_CASES.filter((c) => r.cases[c]?.ok !== true);
261
+ };
262
+ const failures = pack.editors.map((e) => ({ id: str(e['id']), missing: missing(e) })).filter((f) => f.missing.length > 0);
263
+ if (!conformance.ok || failures.length > 0) {
264
+ const unavailable = conformance.editors.length === 0;
265
+ throw new PackInstallError(422, unavailable
266
+ ? `the conformance run could not run, so nothing was installed: ${conformance.error ?? 'no report'}`
267
+ : `the editor failed its conformance run (${failures.map((f) => `${f.id}: ${f.missing.join(', ')}`).join('; ')}); nothing was installed`, verdict, { code: unavailable ? 'conformance_unavailable' : 'editor_not_conformant', conformance });
268
+ }
269
+ const now = new Date().toISOString();
270
+ const packs = pack.editors.map((e) => {
271
+ const entry = str(e['entry']);
272
+ const record = {
273
+ root: pack.root,
274
+ name,
275
+ entry,
276
+ sha256: str(e['sha256']),
277
+ manifestSha256: digestOf(e),
278
+ installedAt: now,
279
+ conformance: { ok: true, at: conformance.at, cases: [...CONFORMANCE_CASES] },
280
+ };
281
+ return { id: str(e['id']), pack: record };
282
+ });
283
+ let installed;
284
+ try {
285
+ installed = deps.registry.installPack(packs, enabled);
286
+ }
287
+ catch (err) {
288
+ if (err instanceof EditorInstallConflict)
289
+ throw new PackInstallError(409, err.message, verdict);
290
+ throw err;
291
+ }
292
+ return {
293
+ installed: true,
294
+ updated: installed.updated,
295
+ editors: installed.records.map((r) => EditorRegistry.view(r)),
296
+ check: verdict,
297
+ conformance,
298
+ };
299
+ }
153
300
  //# sourceMappingURL=pack-install.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"pack-install.js","sourceRoot":"","sources":["../../src/editors/pack-install.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,YAAY,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAC1E,OAAO,EAAE,UAAU,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAGtD,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAI7C,wEAAwE;AACxE,SAAS,gBAAgB,CAAC,MAAc;IACtC,IAAI,CAAC;QACH,MAAM,GAAG,GAAG,IAAI,CAAC,KAAK,CAAC,MAAM,CAA6B,CAAC;QAC3D,IAAI,OAAO,GAAG,KAAK,QAAQ,IAAI,GAAG,KAAK,IAAI,IAAI,OAAO,GAAG,CAAC,EAAE,KAAK,SAAS;YAAE,OAAO,IAAI,CAAC;QACxF,MAAM,QAAQ,GAAG,CAAC,IAAa,EAA6B,EAAE,CAC5D,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC;YACjB,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,OAAO,CAAC,KAAK,QAAQ,IAAI,CAAC,KAAK,IAAI,CAAC,CAAC,CAAC,CAAC,CAAsC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC;YAC5G,CAAC,CAAC,EAAE,CAAC;QACT,O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§8.6, §9.1; EP-C1).
3
3
  *
4
- * Two kinds of editor exist in the design; one exists today:
4
+ * Two kinds of editor exist:
5
5
  *
6
6
  * - **First-party** editors ship INSIDE studio's bundle (§8.6): `<studio dist>/editors/<id>/editor.json`
7
7
  * beside the ONE self-contained `index.html` entry. Crew discovers them at boot, pins each entry's
8
8
  * sha256 and byte size, and serves the entry through the hashed bundle route (`routes.ts`) with
9
9
  * the §8.2 headers. Their ids are `wicked-*` — the reserved first-party namespace every pack is
10
10
  * refused (garden `wicked-pack.schema.json`).
11
- * - **Third-party** editors arrive as garden packs (spec 2 `editors[]`). Their install is REFUSED
12
- * until the install-time conformance run ships (EP-C8, LATER): `pack-install.ts` still runs
13
- * garden's fail-closed `pack check` and lists what the operator would be asked to approve, then
14
- * answers 501. Nothing of a pack is ever written by this registry.
11
+ * - **Third-party** editors arrive as garden packs (spec 2 `editors[]`), installed by the operator
12
+ * (`POST /editors {packRoot}`, human-only) once garden's fail-closed `pack check` AND the
13
+ * install-time conformance run (garden `scripts/editor/conformance.py`, run by crew against its
14
+ * own conformance host page, §12.1 / EP-C8) both pass (`pack-install.ts`). The registry records
15
+ * the pack directory and each editor's pinned entry hash; it never writes into the pack. A pack
16
+ * that also ships skills or blocks is refused: their own "Add these" approval (§3.2) is not built.
15
17
  *
16
- * Persisted state is ONE file, `<state home>/daemon-editors.json` — the enable/disable flags the
17
- * operator sets in Settings → Editors (§6.4, human-only). It sits under the `daemon-` prefix both
18
- * crew's state-home registry and the engine's worker fence already classify (crew#756), so no new
19
- * top-level entry is introduced; a pack install (EP-C8) will need a registered `editors/` subtree in
20
- * both repos first.
18
+ * Persisted state is ONE file, `<state home>/daemon-editors.json`: the enable/disable flags the
19
+ * operator sets in Settings (§6.4, human-only) and the installed packs. It sits under the `daemon-`
20
+ * prefix both crew's state-home registry and the engine's worker fence already classify (crew#756),
21
+ * so no new top-level entry is introduced. The packs themselves live where the installer staged
22
+ * them (garden's default `~/.wicked/editors/<name>/current`, program-owned, outside the state home);
23
+ * a bundle is re-hashed against the recorded pin on every serve, so a copy changed after install is
24
+ * refused, never served.
21
25
  */
22
26
  import { z } from 'zod';
23
27
  import type { EditorView } from '../core/types.js';
@@ -25,6 +29,8 @@ import type { EditorView } from '../core/types.js';
25
29
  export declare const EDITORS_STATE_FILENAME = "daemon-editors.json";
26
30
  /** Where first-party manifests live inside the studio bundle. */
27
31
  export declare const STUDIO_EDITORS_DIRNAME = "editors";
32
+ /** The most of an installed pack's `wicked-pack.json` the registry reads (a manifest is a few KB). */
33
+ export declare const PACK_MANIFEST_CAP_BYTES: number;
28
34
  /** The host's bundle cap (§8.5); a pack's `limits.bundleBytes` may only be lower. */
29
35
  export declare const HOST_BUNDLE_CAP_BYTES: number;
30
36
  export declare const EDITOR_PERMISSIONS: readonly ["artifact.read", "artifact.write", "selection.chip", "composer.draft", "checks.read", "checks.contribute", "sources.read", "media.read", "artifact.export", "ui.fullscreen", "network.media"];
@@ -61,10 +67,10 @@ export declare const EditorManifestSchema: z.ZodObject<{
61
67
  }>>;
62
68
  }, "strip", z.ZodTypeAny, {
63
69
  id: string;
64
- title: string;
65
70
  version: string;
66
71
  entry: string;
67
72
  protocol: number[];
73
+ title: string;
68
74
  kinds: string[];
69
75
  sizes: ("full" | "inline" | "pane")[];
70
76
  permissions: {
@@ -77,9 +83,9 @@ export declare const EditorManifestSchema: z.ZodObject<{
77
83
  } | undefined;
78
84
  }, {
79
85
  id: string;
80
- title: string;
81
86
  version: string;
82
87
  protocol: number[];
88
+ title: string;
83
89
  kinds: string[];
84
90
  sizes: ("full" | "inline" | "pane")[];
85
91
  permissions: {
@@ -101,10 +107,44 @@ export interface EditorRecord {
101
107
  /** Absolute path of the entry file. Never on the wire. */
102
108
  entryPath: string;
103
109
  firstParty: boolean;
104
- source: 'studio-bundle';
110
+ /** `studio-bundle`: first-party, shipped in studio's dist. `pack`: a third-party pack the operator installed. */
111
+ source: 'studio-bundle' | 'pack';
105
112
  enabled: boolean;
113
+ /** For a pack editor: the pack it came from. Never on the wire. */
114
+ pack?: InstalledPack;
115
+ }
116
+ /** One installed pack editor, as `daemon-editors.json` records it. */
117
+ export interface InstalledPack {
118
+ /** Absolute path of the pack directory (holding `wicked-pack.json`). */
119
+ root: string;
120
+ /** The pack's `name` (the installer's key). */
121
+ name: string;
122
+ /** The editor's entry path, relative to the pack root. */
123
+ entry: string;
124
+ /** The entry's sha256 when it was installed (and passed the conformance run). */
125
+ sha256: string;
126
+ /** {@link editorEntryDigest} of its manifest entry as admitted: permissions, kinds, version, … */
127
+ manifestSha256: string;
128
+ installedAt: string;
129
+ /** The conformance run that admitted it: when, and which cases ran. */
130
+ conformance: {
131
+ ok: true;
132
+ at: string;
133
+ cases: string[];
134
+ };
135
+ }
136
+ /** An install the registry refuses: the id is taken, or the pack did not read back. */
137
+ export declare class EditorInstallConflict extends Error {
138
+ constructor(message: string);
106
139
  }
107
140
  export declare function sha256Of(buf: Buffer): string;
141
+ /**
142
+ * Read a file holding at most `cap` bytes, never allocating more than `cap + 1` (codex r1 on X3: a
143
+ * file swapped for a huge one is refused before it is read whole). `null` = over the cap.
144
+ */
145
+ export declare function readCapped(path: string, cap: number): Buffer | null;
146
+ /** The digest of a pack editor's admitted manifest entry: a manifest edited after install is a new install. */
147
+ export declare function editorEntryDigest(entry: unknown): string;
108
148
  /**
109
149
  * A path is served from the bundle only if it IS what it looks like: a real directory or a real
110
150
  * file, never a link (codex r1 — a link under `editors/` could point outside the bundle and be
@@ -119,6 +159,77 @@ export declare function externalReferences(html: string): string[];
119
159
  * served half-right.
120
160
  */
121
161
  export declare function discoverStudioEditors(studioRoot: string, log?: (msg: string) => void): Array<Omit<EditorRecord, 'enabled'>>;
162
+ /** A pack editor's manifest entry: the shared shape plus its pinned hash and a pack-relative entry. */
163
+ export declare const PackEditorSchema: z.ZodObject<{
164
+ id: z.ZodString;
165
+ title: z.ZodString;
166
+ version: z.ZodString;
167
+ protocol: z.ZodArray<z.ZodNumber, "many">;
168
+ kinds: z.ZodArray<z.ZodString, "many">;
169
+ sizes: z.ZodEffects<z.ZodArray<z.ZodEnum<["inline", "pane", "full"]>, "many">, ("full" | "inline" | "pane")[], ("full" | "inline" | "pane")[]>;
170
+ panels: z.ZodOptional<z.ZodArray<z.ZodEnum<["checks"]>, "many">>;
171
+ permissions: z.ZodArray<z.ZodObject<{
172
+ id: z.ZodEnum<["artifact.read", "artifact.write", "selection.chip", "composer.draft", "checks.read", "checks.contribute", "sources.read", "media.read", "artifact.export", "ui.fullscreen", "network.media"]>;
173
+ why: z.ZodString;
174
+ }, "strip", z.ZodTypeAny, {
175
+ id: "artifact.read" | "artifact.write" | "selection.chip" | "composer.draft" | "checks.read" | "checks.contribute" | "sources.read" | "media.read" | "artifact.export" | "ui.fullscreen" | "network.media";
176
+ why: string;
177
+ }, {
178
+ id: "artifact.read" | "artifact.write" | "selection.chip" | "composer.draft" | "checks.read" | "checks.contribute" | "sources.read" | "media.read" | "artifact.export" | "ui.fullscreen" | "network.media";
179
+ why: string;
180
+ }>, "many">;
181
+ limits: z.ZodOptional<z.ZodObject<{
182
+ bundleBytes: z.ZodNumber;
183
+ }, "strip", z.ZodTypeAny, {
184
+ bundleBytes: number;
185
+ }, {
186
+ bundleBytes: number;
187
+ }>>;
188
+ } & {
189
+ entry: z.ZodString;
190
+ sha256: z.ZodString;
191
+ }, "strip", z.ZodTypeAny, {
192
+ id: string;
193
+ sha256: string;
194
+ version: string;
195
+ entry: string;
196
+ protocol: number[];
197
+ title: string;
198
+ kinds: string[];
199
+ sizes: ("full" | "inline" | "pane")[];
200
+ permissions: {
201
+ id: "artifact.read" | "artifact.write" | "selection.chip" | "composer.draft" | "checks.read" | "checks.contribute" | "sources.read" | "media.read" | "artifact.export" | "ui.fullscreen" | "network.media";
202
+ why: string;
203
+ }[];
204
+ panels?: "checks"[] | undefined;
205
+ limits?: {
206
+ bundleBytes: number;
207
+ } | undefined;
208
+ }, {
209
+ id: string;
210
+ sha256: string;
211
+ version: string;
212
+ entry: string;
213
+ protocol: number[];
214
+ title: string;
215
+ kinds: string[];
216
+ sizes: ("full" | "inline" | "pane")[];
217
+ permissions: {
218
+ id: "artifact.read" | "artifact.write" | "selection.chip" | "composer.draft" | "checks.read" | "checks.contribute" | "sources.read" | "media.read" | "artifact.export" | "ui.fullscreen" | "network.media";
219
+ why: string;
220
+ }[];
221
+ panels?: "checks"[] | undefined;
222
+ limits?: {
223
+ bundleBytes: number;
224
+ } | undefined;
225
+ }>;
226
+ /**
227
+ * Read one pack editor at serve-time quality: the manifest entry for `id` in `<root>/wicked-pack.json`,
228
+ * its entry a real file inside the pack, within its caps, loading nothing from outside, and hashing to
229
+ * `pin`. `null` + a logged reason when any of it fails — an installed editor whose pack changed is
230
+ * skipped until it is installed again, never served half-right.
231
+ */
232
+ export declare function readPackEditor(pack: InstalledPack, id: string, log?: (msg: string) => void): Omit<EditorRecord, 'enabled'> | null;
122
233
  export declare class EditorRegistry {
123
234
  private readonly records;
124
235
  private readonly stateFile;
@@ -128,6 +239,10 @@ export declare class EditorRegistry {
128
239
  studioRoot?: string;
129
240
  log?: (msg: string) => void;
130
241
  });
242
+ /** Every installed pack editor as recorded, including one skipped at boot (so an install can replace it). */
243
+ private readonly installed;
244
+ /** The flags as read at boot: kept for an installed editor skipped at boot, so a write never drops its "off". */
245
+ private persistedFlags;
131
246
  private readState;
132
247
  private writeState;
133
248
  /** Where the flags live (diagnostics / tests). */
@@ -136,6 +251,29 @@ export declare class EditorRegistry {
136
251
  get(id: string): EditorRecord | null;
137
252
  /** Enable or disable (§6.4: the operator's click). Returns the record, or `null` for an unknown id. */
138
253
  setEnabled(id: string, enabled: boolean): EditorRecord | null;
254
+ /**
255
+ * Apply `change` to the in-memory maps and persist; a failed write restores the maps as they were
256
+ * and rethrows, so memory never holds what the file does not (codex r1 on X3).
257
+ */
258
+ private commit;
259
+ /**
260
+ * Record a pack's editors, already checked and conformance-run by the caller (`pack-install.ts`):
261
+ * each is read back from disk exactly as boot reads it, and only then recorded. All or nothing — a
262
+ * pack editor that does not read back leaves the registry as it was. An editor id another pack
263
+ * holds is refused; the same pack re-installed (an update) replaces its own editors, keeping the
264
+ * operator's on/off choice unless `enabled` says otherwise.
265
+ */
266
+ installPack(packs: Array<{
267
+ id: string;
268
+ pack: InstalledPack;
269
+ }>, enabled: boolean | undefined): {
270
+ records: EditorRecord[];
271
+ updated: boolean;
272
+ };
273
+ /** Remove an installed pack editor (the pack's files are the installer's to delete). `false` when it is not one. */
274
+ removeInstalled(id: string): boolean;
275
+ /** Whether `id` is an installed pack editor (served or skipped at boot). */
276
+ isInstalled(id: string): boolean;
139
277
  /** The wire view: no paths, the hashed entry URL instead. */
140
278
  static view(r: EditorRecord): EditorView;
141
279
  }
@@ -1 +1 @@
1
- {"version":3,"file":"registry.d.ts","sourceRoot":"","sources":["../../src/editors/registry.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAKH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,KAAK,EAAoB,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAGrE,uEAAuE;AACvE,eAAO,MAAM,sBAAsB,wBAAwB,CAAC;AAC5D,iEAAiE;AACjE,eAAO,MAAM,sBAAsB,YAAY,CAAC;AAChD,qFAAqF;AACrF,eAAO,MAAM,qBAAqB,QAAkB,CAAC;AAErD,eAAO,MAAM,kBAAkB,yMAYqB,CAAC;AAErD,sGAAsG;AACtG,eAAO,MAAM,SAAS,QAAgC,CAAC;AACvD,eAAO,MAAM,cAAc,QAAuC,CAAC;AACnE,wCAAwC;AACxC,eAAO,MAAM,cAAc,QAA8D,CAAC;AAG1F,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAW/B,CAAC;AACH,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAC;AAElE,MAAM,WAAW,YAAY;IAC3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