@12ui/design 0.2.28 → 0.2.30

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 (184) hide show
  1. package/README.md +97 -3
  2. package/SKILL.md +1 -1
  3. package/dist/branch-execution-types.d.ts +2 -0
  4. package/dist/branch-execution-types.d.ts.map +1 -1
  5. package/dist/branch-execution.d.ts.map +1 -1
  6. package/dist/branch-execution.js +3 -0
  7. package/dist/branch-execution.js.map +1 -1
  8. package/dist/branch-run-record.d.ts +1 -0
  9. package/dist/branch-run-record.d.ts.map +1 -1
  10. package/dist/branch-run-record.js.map +1 -1
  11. package/dist/cli-arguments.d.ts.map +1 -1
  12. package/dist/cli-arguments.js +2 -0
  13. package/dist/cli-arguments.js.map +1 -1
  14. package/dist/cli-branch-command.d.ts +4 -0
  15. package/dist/cli-branch-command.d.ts.map +1 -1
  16. package/dist/cli-branch-command.js +30 -3
  17. package/dist/cli-branch-command.js.map +1 -1
  18. package/dist/cli-capabilities.d.ts +15 -0
  19. package/dist/cli-capabilities.d.ts.map +1 -1
  20. package/dist/cli-capabilities.js +19 -0
  21. package/dist/cli-capabilities.js.map +1 -1
  22. package/dist/cli-help/design.d.ts +18 -1
  23. package/dist/cli-help/design.d.ts.map +1 -1
  24. package/dist/cli-help/design.js +33 -0
  25. package/dist/cli-help/design.js.map +1 -1
  26. package/dist/cli-help/index.d.ts +18 -1
  27. package/dist/cli-help/index.d.ts.map +1 -1
  28. package/dist/cli-prototype-command.d.ts +12 -0
  29. package/dist/cli-prototype-command.d.ts.map +1 -0
  30. package/dist/cli-prototype-command.js +29 -0
  31. package/dist/cli-prototype-command.js.map +1 -0
  32. package/dist/cli-review-command.d.ts +8 -0
  33. package/dist/cli-review-command.d.ts.map +1 -0
  34. package/dist/cli-review-command.js +90 -0
  35. package/dist/cli-review-command.js.map +1 -0
  36. package/dist/cli-run.d.ts.map +1 -1
  37. package/dist/cli-run.js +16 -0
  38. package/dist/cli-run.js.map +1 -1
  39. package/dist/cli-usage.d.ts.map +1 -1
  40. package/dist/cli-usage.js +8 -1
  41. package/dist/cli-usage.js.map +1 -1
  42. package/dist/conversion-client.d.ts.map +1 -1
  43. package/dist/conversion-client.js +8 -1
  44. package/dist/conversion-client.js.map +1 -1
  45. package/dist/index.d.ts +4 -0
  46. package/dist/index.d.ts.map +1 -1
  47. package/dist/index.js +4 -0
  48. package/dist/index.js.map +1 -1
  49. package/dist/legacy-skill-catalog.d.ts.map +1 -1
  50. package/dist/legacy-skill-catalog.js +8 -0
  51. package/dist/legacy-skill-catalog.js.map +1 -1
  52. package/dist/next-wait-lease.d.ts +2 -1
  53. package/dist/next-wait-lease.d.ts.map +1 -1
  54. package/dist/next-wait-lease.js +73 -22
  55. package/dist/next-wait-lease.js.map +1 -1
  56. package/dist/next-wait-process.d.ts +17 -0
  57. package/dist/next-wait-process.d.ts.map +1 -0
  58. package/dist/next-wait-process.js +40 -0
  59. package/dist/next-wait-process.js.map +1 -0
  60. package/dist/prototype-gap-html.d.ts +10 -0
  61. package/dist/prototype-gap-html.d.ts.map +1 -0
  62. package/dist/prototype-gap-html.js +55 -0
  63. package/dist/prototype-gap-html.js.map +1 -0
  64. package/dist/prototype-gap-source.d.ts +14 -0
  65. package/dist/prototype-gap-source.d.ts.map +1 -0
  66. package/dist/prototype-gap-source.js +87 -0
  67. package/dist/prototype-gap-source.js.map +1 -0
  68. package/dist/prototype-gates.d.ts +24 -0
  69. package/dist/prototype-gates.d.ts.map +1 -0
  70. package/dist/prototype-gates.js +76 -0
  71. package/dist/prototype-gates.js.map +1 -0
  72. package/dist/prototype-label-client.d.ts +51 -0
  73. package/dist/prototype-label-client.d.ts.map +1 -0
  74. package/dist/prototype-label-client.js +53 -0
  75. package/dist/prototype-label-client.js.map +1 -0
  76. package/dist/prototype-label-score.d.ts +26 -0
  77. package/dist/prototype-label-score.d.ts.map +1 -0
  78. package/dist/prototype-label-score.js +51 -0
  79. package/dist/prototype-label-score.js.map +1 -0
  80. package/dist/prototype-process.d.ts +13 -0
  81. package/dist/prototype-process.d.ts.map +1 -0
  82. package/dist/prototype-process.js +26 -0
  83. package/dist/prototype-process.js.map +1 -0
  84. package/dist/prototype-requests.d.ts +29 -0
  85. package/dist/prototype-requests.d.ts.map +1 -0
  86. package/dist/prototype-requests.js +34 -0
  87. package/dist/prototype-requests.js.map +1 -0
  88. package/dist/prototype-runner.d.ts +22 -0
  89. package/dist/prototype-runner.d.ts.map +1 -0
  90. package/dist/prototype-runner.js +159 -0
  91. package/dist/prototype-runner.js.map +1 -0
  92. package/dist/prototype-source.d.ts +9 -0
  93. package/dist/prototype-source.d.ts.map +1 -0
  94. package/dist/prototype-source.js +48 -0
  95. package/dist/prototype-source.js.map +1 -0
  96. package/dist/review-discovery.d.ts +11 -0
  97. package/dist/review-discovery.d.ts.map +1 -0
  98. package/dist/review-discovery.js +427 -0
  99. package/dist/review-discovery.js.map +1 -0
  100. package/dist/review-edit-html.d.ts +6 -0
  101. package/dist/review-edit-html.d.ts.map +1 -0
  102. package/dist/review-edit-html.js +11 -0
  103. package/dist/review-edit-html.js.map +1 -0
  104. package/dist/review-edit-source.d.ts +22 -0
  105. package/dist/review-edit-source.d.ts.map +1 -0
  106. package/dist/review-edit-source.js +103 -0
  107. package/dist/review-edit-source.js.map +1 -0
  108. package/dist/review-edit.d.ts +15 -0
  109. package/dist/review-edit.d.ts.map +1 -0
  110. package/dist/review-edit.js +192 -0
  111. package/dist/review-edit.js.map +1 -0
  112. package/dist/review-layerdoc-diff.d.ts +7 -0
  113. package/dist/review-layerdoc-diff.d.ts.map +1 -0
  114. package/dist/review-layerdoc-diff.js +92 -0
  115. package/dist/review-layerdoc-diff.js.map +1 -0
  116. package/dist/review-page-assets.d.ts +3 -0
  117. package/dist/review-page-assets.d.ts.map +1 -0
  118. package/dist/review-page-assets.js +62 -0
  119. package/dist/review-page-assets.js.map +1 -0
  120. package/dist/review-page.d.ts +3 -0
  121. package/dist/review-page.d.ts.map +1 -0
  122. package/dist/review-page.js +275 -0
  123. package/dist/review-page.js.map +1 -0
  124. package/dist/review-pricing.d.ts +14 -0
  125. package/dist/review-pricing.d.ts.map +1 -0
  126. package/dist/review-pricing.js +23 -0
  127. package/dist/review-pricing.js.map +1 -0
  128. package/dist/review-prototype-gap.d.ts +48 -0
  129. package/dist/review-prototype-gap.d.ts.map +1 -0
  130. package/dist/review-prototype-gap.js +192 -0
  131. package/dist/review-prototype-gap.js.map +1 -0
  132. package/dist/review-server.d.ts +22 -0
  133. package/dist/review-server.d.ts.map +1 -0
  134. package/dist/review-server.js +268 -0
  135. package/dist/review-server.js.map +1 -0
  136. package/dist/review-store.d.ts +11 -0
  137. package/dist/review-store.d.ts.map +1 -0
  138. package/dist/review-store.js +96 -0
  139. package/dist/review-store.js.map +1 -0
  140. package/dist/review-types.d.ts +140 -0
  141. package/dist/review-types.d.ts.map +1 -0
  142. package/dist/review-types.js +2 -0
  143. package/dist/review-types.js.map +1 -0
  144. package/dist/run-journal-commands.d.ts.map +1 -1
  145. package/dist/run-journal-commands.js +19 -0
  146. package/dist/run-journal-commands.js.map +1 -1
  147. package/open-design.json +2 -2
  148. package/package.json +7 -1
  149. package/prototype-kit/analyze.mjs +275 -0
  150. package/prototype-kit/build.mjs +393 -0
  151. package/prototype-kit/inventory.mjs +104 -0
  152. package/prototype-kit/label-briefs.mjs +47 -0
  153. package/prototype-kit/lib/actions.mjs +15 -0
  154. package/prototype-kit/lib/navigation.mjs +33 -0
  155. package/prototype-kit/lib/runtime-check.mjs +126 -0
  156. package/prototype-kit/lib/shells.mjs +68 -0
  157. package/prototype-kit/lib/static-server.mjs +40 -0
  158. package/prototype-kit/lib/text.mjs +20 -0
  159. package/prototype-kit/runtime/proto.css +46 -0
  160. package/prototype-kit/runtime/proto.js +173 -0
  161. package/prototype-kit/score-labels.mjs +42 -0
  162. package/prototype-kit/tests/README.md +28 -0
  163. package/prototype-kit/tests/adversarial-runtime.mjs +90 -0
  164. package/prototype-kit/tests/discover-runs.mjs +29 -0
  165. package/prototype-kit/tests/fixtures/no-semantic/branch.plan.json +7 -0
  166. package/prototype-kit/tests/fixtures/no-semantic/pages/legacy.html +1 -0
  167. package/prototype-kit/tests/fixtures/partial-plan/branch.plan.json +5 -0
  168. package/prototype-kit/tests/fixtures/partial-plan/pages/orphan.html +4 -0
  169. package/prototype-kit/tests/fixtures/runtime/double.html +5 -0
  170. package/prototype-kit/tests/fixtures/runtime/history-destination.html +1 -0
  171. package/prototype-kit/tests/fixtures/runtime/history.html +6 -0
  172. package/prototype-kit/tests/fixtures/runtime/hover-stack.html +15 -0
  173. package/prototype-kit/tests/fixtures/runtime/invalid-dropdown.html +6 -0
  174. package/prototype-kit/tests/fixtures/runtime/nested.html +7 -0
  175. package/prototype-kit/tests/fixtures/three-shell/branch.plan.json +30 -0
  176. package/prototype-kit/tests/fixtures/three-shell/pages/p0-home.html +11 -0
  177. package/prototype-kit/tests/fixtures/three-shell/pages/p1-reports.html +11 -0
  178. package/prototype-kit/tests/lib/run-discovery.mjs +87 -0
  179. package/prototype-kit/tests/lib/run-process.mjs +49 -0
  180. package/prototype-kit/tests/offline-check.mjs +41 -0
  181. package/prototype-kit/tests/population-sweep.mjs +94 -0
  182. package/prototype-kit/tests/rules-check.mjs +50 -0
  183. package/prototype-kit/verify-runtime.mjs +36 -0
  184. package/skills/12ui-design/SKILL.md +8 -2
@@ -0,0 +1,159 @@
1
+ import { randomUUID } from 'node:crypto';
2
+ import { mkdir, readFile, rename, rm, writeFile } from 'node:fs/promises';
3
+ import path from 'node:path';
4
+ import { fileURLToPath } from 'node:url';
5
+ import { evaluatePrototypeGates } from './prototype-gates.js';
6
+ import { prototypeLabelRequests } from './prototype-requests.js';
7
+ import { runPrototypeStage } from './prototype-process.js';
8
+ import { prototypeSourceDirectory } from './prototype-source.js';
9
+ import { BRANCH_COMPLETION_FILENAME, BRANCH_PLAN_FILENAME } from './branch-run-record.js';
10
+ export const PROTOTYPE_MANIFEST_FILENAME = 'proto-manifest.json';
11
+ export const PROTOTYPE_DIRECTORY = 'prototype';
12
+ export const PROTOTYPE_WORK_DIRECTORY = '.prototype-work';
13
+ export const PROTOTYPE_PIPELINE_REVISION = 'prototype-v2';
14
+ const kitDirectory = () => path.resolve(path.dirname(fileURLToPath(import.meta.url)), '../prototype-kit');
15
+ export const runPrototypePipeline = async (args) => {
16
+ const branchDir = path.resolve(args.branchDir);
17
+ const sourceDir = await prototypeSourceDirectory(branchDir);
18
+ const planPath = path.join(sourceDir, BRANCH_PLAN_FILENAME);
19
+ const completionPath = path.join(branchDir, BRANCH_COMPLETION_FILENAME);
20
+ const completion = JSON.parse(await readFile(completionPath, 'utf8'));
21
+ if (typeof completion.runId !== 'string' || !completion.runId) {
22
+ throw new Error(`Prototype input error: ${completionPath} has no create run id.`);
23
+ }
24
+ const kit = kitDirectory();
25
+ const workDir = path.join(branchDir, PROTOTYPE_WORK_DIRECTORY);
26
+ const labelsDir = path.join(workDir, 'labels');
27
+ const inventoryFile = path.join(workDir, 'inventory.json');
28
+ const modelFile = path.join(workDir, 'model.json');
29
+ const runtimeAuditFile = path.join(workDir, 'runtime-audit.json');
30
+ const gateAuditFile = path.join(workDir, 'gate-audit.json');
31
+ const stagingDir = path.join(branchDir, `.prototype-${randomUUID()}.tmp`);
32
+ const outputDir = path.join(branchDir, PROTOTYPE_DIRECTORY);
33
+ await rm(workDir, { recursive: true, force: true });
34
+ await mkdir(labelsDir, { recursive: true });
35
+ await mkdir(stagingDir, { recursive: true });
36
+ const stages = [];
37
+ try {
38
+ stages.push(await runPrototypeStage({
39
+ stage: 'inventory',
40
+ script: path.join(kit, 'inventory.mjs'),
41
+ argv: [sourceDir, inventoryFile],
42
+ workDir,
43
+ ...(args.signal ? { signal: args.signal } : {}),
44
+ }));
45
+ stages.push(await runPrototypeStage({
46
+ stage: 'analyze',
47
+ script: path.join(kit, 'analyze.mjs'),
48
+ argv: [inventoryFile, modelFile],
49
+ workDir,
50
+ ...(args.signal ? { signal: args.signal } : {}),
51
+ }));
52
+ const model = JSON.parse(await readFile(modelFile, 'utf8'));
53
+ const requests = prototypeLabelRequests(model);
54
+ let labelCostMicros = 0;
55
+ let labeledScreenCount = 0;
56
+ if (args.labelClient) {
57
+ for (const request of requests) {
58
+ const response = await args.labelClient.labelScreen(completion.runId, request, args.signal);
59
+ labelCostMicros += response.costMicros;
60
+ labeledScreenCount += 1;
61
+ await writeFile(path.join(labelsDir, `${request.screen.id}.json`), `${JSON.stringify({ actions: response.actions }, null, 2)}\n`);
62
+ }
63
+ }
64
+ stages.push(await runPrototypeStage({
65
+ stage: 'build',
66
+ script: path.join(kit, 'build.mjs'),
67
+ argv: [sourceDir, inventoryFile, modelFile, labelsDir, stagingDir],
68
+ workDir,
69
+ ...(args.signal ? { signal: args.signal } : {}),
70
+ }));
71
+ stages.push(await runPrototypeStage({
72
+ stage: 'runtime',
73
+ script: path.join(kit, 'verify-runtime.mjs'),
74
+ argv: [stagingDir, runtimeAuditFile],
75
+ workDir,
76
+ ...(args.signal ? { signal: args.signal } : {}),
77
+ }));
78
+ const manifestPath = path.join(stagingDir, PROTOTYPE_MANIFEST_FILENAME);
79
+ const kitManifest = JSON.parse(await readFile(manifestPath, 'utf8'));
80
+ const inventory = JSON.parse(await readFile(inventoryFile, 'utf8'));
81
+ const runtimeAudit = JSON.parse(await readFile(runtimeAuditFile, 'utf8'));
82
+ const evaluation = evaluatePrototypeGates(kitManifest);
83
+ const planStatus = Array.isArray(inventory.plan?.pages) && Array.isArray(inventory.plan?.screens)
84
+ ? 'passed'
85
+ : 'accepted-partial';
86
+ const gates = {
87
+ exportedHtml: 'passed',
88
+ branchPlan: planStatus,
89
+ semanticViewportSections: 'passed',
90
+ runtime: 'passed',
91
+ zeroActionRealPages: evaluation.facts.zeroActionRealPages.length > 0 ? 'failed' : 'passed',
92
+ dropdownValidity: evaluation.facts.invalidDropdowns > 0 ? 'failed' : 'passed',
93
+ holdingRatio: evaluation.facts.holdingRatio > 0.5 ? 'failed' : 'passed',
94
+ };
95
+ await writeFile(gateAuditFile, `${JSON.stringify({
96
+ version: 1,
97
+ revision: PROTOTYPE_PIPELINE_REVISION,
98
+ input: {
99
+ exportedHtmlFiles: Array.isArray(inventory.pages) ? inventory.pages.length : 0,
100
+ semanticViewportSections: model.states.length,
101
+ planStatus,
102
+ },
103
+ gates,
104
+ facts: evaluation.facts,
105
+ warnings: evaluation.warnings,
106
+ blockers: evaluation.blockers,
107
+ }, null, 2)}\n`);
108
+ if (evaluation.blockers.length > 0) {
109
+ throw new Error(`Prototype product gate failed: ${evaluation.blockers.join(' ')}`);
110
+ }
111
+ await writeFile(manifestPath, `${JSON.stringify({
112
+ ...kitManifest,
113
+ version: 1,
114
+ revision: PROTOTYPE_PIPELINE_REVISION,
115
+ source: { branchDir, sourceDir, runId: completion.runId, planPath },
116
+ input: {
117
+ exportedHtmlFiles: Array.isArray(inventory.pages) ? inventory.pages.length : 0,
118
+ semanticViewportSections: model.states.length,
119
+ planStatus,
120
+ },
121
+ labels: {
122
+ requestedScreens: requests.length,
123
+ labeledScreens: labeledScreenCount,
124
+ costMicros: labelCostMicros,
125
+ precedence: 'deterministic navigation and dropdown rules override model labels',
126
+ },
127
+ gates,
128
+ runtime: {
129
+ auditPath: runtimeAuditFile,
130
+ pageCount: runtimeAudit.pages.length,
131
+ pageErrors: runtimeAudit.pageErrors,
132
+ consoleErrors: runtimeAudit.consoleErrors,
133
+ duplicateIds: runtimeAudit.duplicateIds,
134
+ brokenTargets: runtimeAudit.brokenTargets.length,
135
+ interactionFailures: runtimeAudit.interactionFailures,
136
+ deepLinkBack: runtimeAudit.deepLinkBack,
137
+ },
138
+ facts: evaluation.facts,
139
+ warnings: evaluation.warnings,
140
+ }, null, 2)}\n`);
141
+ await rm(outputDir, { recursive: true, force: true });
142
+ await rename(stagingDir, outputDir);
143
+ return {
144
+ branchDir,
145
+ outputDir,
146
+ manifestPath: path.join(outputDir, PROTOTYPE_MANIFEST_FILENAME),
147
+ stages,
148
+ screenCount: model.states.length,
149
+ labeledScreenCount,
150
+ labelCostMicros,
151
+ warnings: evaluation.warnings,
152
+ };
153
+ }
154
+ catch (error) {
155
+ await rm(stagingDir, { recursive: true, force: true });
156
+ throw error;
157
+ }
158
+ };
159
+ //# sourceMappingURL=prototype-runner.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"prototype-runner.js","sourceRoot":"","sources":["../src/prototype-runner.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,MAAM,EAAE,EAAE,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAC1E,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAGzC,OAAO,EAAE,sBAAsB,EAA4B,MAAM,sBAAsB,CAAC;AACxF,OAAO,EAAE,sBAAsB,EAAuB,MAAM,yBAAyB,CAAC;AACtF,OAAO,EAAE,iBAAiB,EAA6B,MAAM,wBAAwB,CAAC;AACtF,OAAO,EAAE,wBAAwB,EAAE,MAAM,uBAAuB,CAAC;AACjE,OAAO,EAAE,0BAA0B,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAE1F,MAAM,CAAC,MAAM,2BAA2B,GAAG,qBAAqB,CAAC;AACjE,MAAM,CAAC,MAAM,mBAAmB,GAAG,WAAW,CAAC;AAC/C,MAAM,CAAC,MAAM,wBAAwB,GAAG,iBAAiB,CAAC;AAC1D,MAAM,CAAC,MAAM,2BAA2B,GAAG,cAAc,CAAC;AAa1D,MAAM,YAAY,GAAG,GAAW,EAAE,CAAC,IAAI,CAAC,OAAO,CAC7C,IAAI,CAAC,OAAO,CAAC,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,EAC5C,kBAAkB,CACnB,CAAC;AAEF,MAAM,CAAC,MAAM,oBAAoB,GAAG,KAAK,EAAE,IAI1C,EAA+B,EAAE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,CAAC"}
@@ -0,0 +1,9 @@
1
+ export declare const PROTOTYPE_SOURCES_DIRECTORY = "prototype-sources";
2
+ export declare const prototypeSourceDirectory: (branchDir: string) => Promise<string>;
3
+ /**
4
+ * A filled holding page extends a private source copy. The shipped branch
5
+ * plan/pages stay immutable evidence; every later fill resumes from this one
6
+ * overlay instead of copying the original again and losing earlier gaps.
7
+ */
8
+ export declare const preparePrototypeSourceOverlay: (branchDir: string) => Promise<string>;
9
+ //# sourceMappingURL=prototype-source.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"prototype-source.d.ts","sourceRoot":"","sources":["../src/prototype-source.ts"],"names":[],"mappings":"AAMA,eAAO,MAAM,2BAA2B,sBAAsB,CAAC;AAU/D,eAAO,MAAM,wBAAwB,GAAU,WAAW,MAAM,KAAG,OAAO,CAAC,MAAM,CAIhF,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,6BAA6B,GAAU,WAAW,MAAM,KAAG,OAAO,CAAC,MAAM,CA4BrF,CAAC"}
@@ -0,0 +1,48 @@
1
+ import { createHash, randomUUID } from 'node:crypto';
2
+ import { cp, mkdir, readFile, rename, rm, stat, writeFile } from 'node:fs/promises';
3
+ import path from 'node:path';
4
+ import { BRANCH_PLAN_FILENAME, BRANCH_PAGES_DIRECTORY } from './branch-run-record.js';
5
+ export const PROTOTYPE_SOURCES_DIRECTORY = 'prototype-sources';
6
+ const exists = async (target) => (stat(target).then(() => true).catch(() => false));
7
+ const sha256 = (bytes) => (createHash('sha256').update(bytes).digest('hex'));
8
+ export const prototypeSourceDirectory = async (branchDir) => {
9
+ const resolved = path.resolve(branchDir);
10
+ const overlay = path.join(resolved, PROTOTYPE_SOURCES_DIRECTORY);
11
+ return await exists(path.join(overlay, BRANCH_PLAN_FILENAME)) ? overlay : resolved;
12
+ };
13
+ /**
14
+ * A filled holding page extends a private source copy. The shipped branch
15
+ * plan/pages stay immutable evidence; every later fill resumes from this one
16
+ * overlay instead of copying the original again and losing earlier gaps.
17
+ */
18
+ export const preparePrototypeSourceOverlay = async (branchDir) => {
19
+ const resolved = path.resolve(branchDir);
20
+ const overlay = path.join(resolved, PROTOTYPE_SOURCES_DIRECTORY);
21
+ if (await exists(path.join(overlay, BRANCH_PLAN_FILENAME)))
22
+ return overlay;
23
+ const plan = await readFile(path.join(resolved, BRANCH_PLAN_FILENAME));
24
+ const pages = path.join(resolved, BRANCH_PAGES_DIRECTORY);
25
+ if (!(await exists(pages)))
26
+ throw new Error(`Prototype source pages do not exist: ${pages}`);
27
+ const staging = path.join(resolved, `.${PROTOTYPE_SOURCES_DIRECTORY}-${randomUUID()}.tmp`);
28
+ try {
29
+ await mkdir(staging, { recursive: true });
30
+ await writeFile(path.join(staging, BRANCH_PLAN_FILENAME), plan, { flag: 'wx', mode: 0o600 });
31
+ await cp(pages, path.join(staging, BRANCH_PAGES_DIRECTORY), {
32
+ recursive: true,
33
+ errorOnExist: true,
34
+ force: false,
35
+ });
36
+ await writeFile(path.join(staging, 'source.json'), `${JSON.stringify({
37
+ version: 1,
38
+ branchDir: resolved,
39
+ basePlanSha256: sha256(plan),
40
+ }, null, 2)}\n`, { flag: 'wx', mode: 0o600 });
41
+ await rename(staging, overlay);
42
+ }
43
+ finally {
44
+ await rm(staging, { recursive: true, force: true });
45
+ }
46
+ return overlay;
47
+ };
48
+ //# sourceMappingURL=prototype-source.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"prototype-source.js","sourceRoot":"","sources":["../src/prototype-source.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACrD,OAAO,EAAE,EAAE,EAAE,KAAK,EAAE,QAAQ,EAAE,MAAM,EAAE,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AACpF,OAAO,IAAI,MAAM,WAAW,CAAC;AAE7B,OAAO,EAAE,oBAAoB,EAAE,sBAAsB,EAAE,MAAM,wBAAwB,CAAC;AAEtF,M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E,IAAI,EAAE,CAAC,CAAC;IACtD,CAAC;IACD,OAAO,OAAO,CAAC;AACjB,CAAC,CAAC"}
@@ -0,0 +1,11 @@
1
+ import type { ReviewModel, ReviewRun } from './review-types.js';
2
+ export declare const discoverReviewModel: (args: {
3
+ target?: string;
4
+ all?: boolean;
5
+ cwd?: string;
6
+ tempRoot?: string;
7
+ editAvailable?: boolean;
8
+ prototypeAvailable?: boolean;
9
+ }) => Promise<ReviewModel>;
10
+ export declare const reviewFileUrl: (run: ReviewRun, file: string) => string;
11
+ //# sourceMappingURL=review-discovery.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"review-discovery.d.ts","sourceRoot":"","sources":["../src/review-discovery.ts"],"names":[],"mappings":"AAmBA,OAAO,KAAK,EAIV,WAAW,EAGX,SAAS,EACV,MAAM,mBAAmB,CAAC;AAma3B,eAAO,MAAM,mBAAmB,GAAU,MAAM;IAC9C,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,GAAG,CAAC,EAAE,OAAO,CAAC;IACd,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,kBAAkB,CAAC,EAAE,OAAO,CAAC;CAC9B,KAAG,OAAO,CAAC,WAAW,CA+BtB,CAAC;AAEF,eAAO,MAAM,aAAa,GAAI,KAAK,SAAS,EAAE,MAAM,MAAM,KAAG,MAM5D,CAAC"}