@12ui/design 0.2.55 → 0.2.57

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 (222) hide show
  1. package/SKILL.md +1 -1
  2. package/dist/branch-client.d.ts +2 -0
  3. package/dist/branch-client.d.ts.map +1 -1
  4. package/dist/branch-client.js +1 -0
  5. package/dist/branch-client.js.map +1 -1
  6. package/dist/cli-arguments.d.ts.map +1 -1
  7. package/dist/cli-arguments.js +2 -0
  8. package/dist/cli-arguments.js.map +1 -1
  9. package/dist/cli-conversion-derivation.d.ts +2 -1
  10. package/dist/cli-conversion-derivation.d.ts.map +1 -1
  11. package/dist/cli-conversion-derivation.js +9 -1
  12. package/dist/cli-conversion-derivation.js.map +1 -1
  13. package/dist/cli-convert-command.d.ts.map +1 -1
  14. package/dist/cli-convert-command.js +111 -16
  15. package/dist/cli-convert-command.js.map +1 -1
  16. package/dist/cli-corpus-command.d.ts.map +1 -1
  17. package/dist/cli-corpus-command.js +5 -2
  18. package/dist/cli-corpus-command.js.map +1 -1
  19. package/dist/cli-corpus-evidence.d.ts.map +1 -1
  20. package/dist/cli-corpus-evidence.js +2 -1
  21. package/dist/cli-corpus-evidence.js.map +1 -1
  22. package/dist/cli-corpus-reference-downloads.d.ts +1 -0
  23. package/dist/cli-corpus-reference-downloads.d.ts.map +1 -1
  24. package/dist/cli-corpus-reference-downloads.js +13 -3
  25. package/dist/cli-corpus-reference-downloads.js.map +1 -1
  26. package/dist/cli-corpus-types.d.ts +2 -0
  27. package/dist/cli-corpus-types.d.ts.map +1 -1
  28. package/dist/cli-draft-command.d.ts +11 -0
  29. package/dist/cli-draft-command.d.ts.map +1 -1
  30. package/dist/cli-draft-command.js +10 -1
  31. package/dist/cli-draft-command.js.map +1 -1
  32. package/dist/cli-help/design.d.ts +2 -2
  33. package/dist/cli-help/design.d.ts.map +1 -1
  34. package/dist/cli-help/design.js +12 -2
  35. package/dist/cli-help/design.js.map +1 -1
  36. package/dist/cli-help/index.d.ts +2 -2
  37. package/dist/cli-improve-command.d.ts.map +1 -1
  38. package/dist/cli-improve-command.js +317 -70
  39. package/dist/cli-improve-command.js.map +1 -1
  40. package/dist/cli-next-command.d.ts.map +1 -1
  41. package/dist/cli-next-command.js +44 -4
  42. package/dist/cli-next-command.js.map +1 -1
  43. package/dist/cli-usage.js +2 -2
  44. package/dist/concept-input.d.ts +21 -0
  45. package/dist/concept-input.d.ts.map +1 -1
  46. package/dist/concept-input.js +32 -10
  47. package/dist/concept-input.js.map +1 -1
  48. package/dist/conversion-client.d.ts +39 -1
  49. package/dist/conversion-client.d.ts.map +1 -1
  50. package/dist/conversion-client.js +205 -3
  51. package/dist/conversion-client.js.map +1 -1
  52. package/dist/corpus-client.d.ts +7 -1
  53. package/dist/corpus-client.d.ts.map +1 -1
  54. package/dist/corpus-client.js +6 -2
  55. package/dist/corpus-client.js.map +1 -1
  56. package/dist/corpus-reference-download-retry.d.ts +68 -0
  57. package/dist/corpus-reference-download-retry.d.ts.map +1 -0
  58. package/dist/corpus-reference-download-retry.js +123 -0
  59. package/dist/corpus-reference-download-retry.js.map +1 -0
  60. package/dist/corpus-request-error.d.ts +17 -0
  61. package/dist/corpus-request-error.d.ts.map +1 -0
  62. package/dist/corpus-request-error.js +21 -0
  63. package/dist/corpus-request-error.js.map +1 -0
  64. package/dist/draft-run.d.ts +9 -0
  65. package/dist/draft-run.d.ts.map +1 -1
  66. package/dist/draft-run.js +22 -5
  67. package/dist/draft-run.js.map +1 -1
  68. package/dist/draft-workspace.d.ts +2 -1
  69. package/dist/draft-workspace.d.ts.map +1 -1
  70. package/dist/draft-workspace.js.map +1 -1
  71. package/dist/hosted-draft-identity.d.ts +1 -0
  72. package/dist/hosted-draft-identity.d.ts.map +1 -1
  73. package/dist/hosted-draft-identity.js +1 -0
  74. package/dist/hosted-draft-identity.js.map +1 -1
  75. package/dist/improve-added-specs.d.ts +9 -0
  76. package/dist/improve-added-specs.d.ts.map +1 -1
  77. package/dist/improve-added-specs.js +28 -7
  78. package/dist/improve-added-specs.js.map +1 -1
  79. package/dist/improve-bootstrap-secret.d.ts +35 -0
  80. package/dist/improve-bootstrap-secret.d.ts.map +1 -0
  81. package/dist/improve-bootstrap-secret.js +61 -0
  82. package/dist/improve-bootstrap-secret.js.map +1 -0
  83. package/dist/improve-capture-redirect.d.ts +46 -0
  84. package/dist/improve-capture-redirect.d.ts.map +1 -0
  85. package/dist/improve-capture-redirect.js +68 -0
  86. package/dist/improve-capture-redirect.js.map +1 -0
  87. package/dist/improve-concept.d.ts +14 -1
  88. package/dist/improve-concept.d.ts.map +1 -1
  89. package/dist/improve-concept.js +29 -8
  90. package/dist/improve-concept.js.map +1 -1
  91. package/dist/improve-conversion-attempts.d.ts +96 -0
  92. package/dist/improve-conversion-attempts.d.ts.map +1 -0
  93. package/dist/improve-conversion-attempts.js +93 -0
  94. package/dist/improve-conversion-attempts.js.map +1 -0
  95. package/dist/improve-conversion-stage.d.ts +14 -0
  96. package/dist/improve-conversion-stage.d.ts.map +1 -1
  97. package/dist/improve-conversion-stage.js +254 -70
  98. package/dist/improve-conversion-stage.js.map +1 -1
  99. package/dist/improve-convert-progress.d.ts +36 -0
  100. package/dist/improve-convert-progress.d.ts.map +1 -0
  101. package/dist/improve-convert-progress.js +43 -0
  102. package/dist/improve-convert-progress.js.map +1 -0
  103. package/dist/improve-convert-resilience.d.ts +116 -0
  104. package/dist/improve-convert-resilience.d.ts.map +1 -1
  105. package/dist/improve-convert-resilience.js +158 -1
  106. package/dist/improve-convert-resilience.js.map +1 -1
  107. package/dist/improve-delivery-stages.d.ts.map +1 -1
  108. package/dist/improve-delivery-stages.js +5 -0
  109. package/dist/improve-delivery-stages.js.map +1 -1
  110. package/dist/improve-dom-diff.d.ts +2 -0
  111. package/dist/improve-dom-diff.d.ts.map +1 -1
  112. package/dist/improve-dom-diff.js +7 -0
  113. package/dist/improve-dom-diff.js.map +1 -1
  114. package/dist/improve-dom-gate.d.ts +7 -0
  115. package/dist/improve-dom-gate.d.ts.map +1 -1
  116. package/dist/improve-dom-gate.js +13 -0
  117. package/dist/improve-dom-gate.js.map +1 -1
  118. package/dist/improve-generation-stages.d.ts +3 -0
  119. package/dist/improve-generation-stages.d.ts.map +1 -1
  120. package/dist/improve-generation-stages.js +56 -10
  121. package/dist/improve-generation-stages.js.map +1 -1
  122. package/dist/improve-icon-svg.d.ts +47 -0
  123. package/dist/improve-icon-svg.d.ts.map +1 -0
  124. package/dist/improve-icon-svg.js +83 -0
  125. package/dist/improve-icon-svg.js.map +1 -0
  126. package/dist/improve-kit-assets.d.ts +129 -0
  127. package/dist/improve-kit-assets.d.ts.map +1 -0
  128. package/dist/improve-kit-assets.js +333 -0
  129. package/dist/improve-kit-assets.js.map +1 -0
  130. package/dist/improve-kit-ignore.d.ts +32 -0
  131. package/dist/improve-kit-ignore.d.ts.map +1 -0
  132. package/dist/improve-kit-ignore.js +111 -0
  133. package/dist/improve-kit-ignore.js.map +1 -0
  134. package/dist/improve-kit-readme.d.ts +11 -2
  135. package/dist/improve-kit-readme.d.ts.map +1 -1
  136. package/dist/improve-kit-readme.js +282 -26
  137. package/dist/improve-kit-readme.js.map +1 -1
  138. package/dist/improve-kit-stall.d.ts +113 -0
  139. package/dist/improve-kit-stall.d.ts.map +1 -0
  140. package/dist/improve-kit-stall.js +311 -0
  141. package/dist/improve-kit-stall.js.map +1 -0
  142. package/dist/improve-kit-status.d.ts +105 -0
  143. package/dist/improve-kit-status.d.ts.map +1 -0
  144. package/dist/improve-kit-status.js +215 -0
  145. package/dist/improve-kit-status.js.map +1 -0
  146. package/dist/improve-options.d.ts +16 -1
  147. package/dist/improve-options.d.ts.map +1 -1
  148. package/dist/improve-options.js +65 -15
  149. package/dist/improve-options.js.map +1 -1
  150. package/dist/improve-plan-annotated-render.d.ts +45 -0
  151. package/dist/improve-plan-annotated-render.d.ts.map +1 -0
  152. package/dist/improve-plan-annotated-render.js +196 -0
  153. package/dist/improve-plan-annotated-render.js.map +1 -0
  154. package/dist/improve-plan-annotator.d.ts +7 -1
  155. package/dist/improve-plan-annotator.d.ts.map +1 -1
  156. package/dist/improve-plan-annotator.js +22 -45
  157. package/dist/improve-plan-annotator.js.map +1 -1
  158. package/dist/improve-raster-layers-section.d.ts +21 -0
  159. package/dist/improve-raster-layers-section.d.ts.map +1 -0
  160. package/dist/improve-raster-layers-section.js +45 -0
  161. package/dist/improve-raster-layers-section.js.map +1 -0
  162. package/dist/improve-reset.d.ts +122 -0
  163. package/dist/improve-reset.d.ts.map +1 -0
  164. package/dist/improve-reset.js +141 -0
  165. package/dist/improve-reset.js.map +1 -0
  166. package/dist/improve-run-summary.d.ts +35 -0
  167. package/dist/improve-run-summary.d.ts.map +1 -0
  168. package/dist/improve-run-summary.js +180 -0
  169. package/dist/improve-run-summary.js.map +1 -0
  170. package/dist/improve-stage-shared.d.ts +44 -1
  171. package/dist/improve-stage-shared.d.ts.map +1 -1
  172. package/dist/improve-stage-shared.js +80 -3
  173. package/dist/improve-stage-shared.js.map +1 -1
  174. package/dist/improve-stop-handler.d.ts +73 -0
  175. package/dist/improve-stop-handler.d.ts.map +1 -0
  176. package/dist/improve-stop-handler.js +126 -0
  177. package/dist/improve-stop-handler.js.map +1 -0
  178. package/dist/improve-terminal-event.d.ts +118 -0
  179. package/dist/improve-terminal-event.d.ts.map +1 -0
  180. package/dist/improve-terminal-event.js +87 -0
  181. package/dist/improve-terminal-event.js.map +1 -0
  182. package/dist/improve-token-patch.d.ts +2 -0
  183. package/dist/improve-token-patch.d.ts.map +1 -1
  184. package/dist/improve-token-patch.js +23 -5
  185. package/dist/improve-token-patch.js.map +1 -1
  186. package/dist/improve-workspace.d.ts +94 -2
  187. package/dist/improve-workspace.d.ts.map +1 -1
  188. package/dist/improve-workspace.js +19 -1
  189. package/dist/improve-workspace.js.map +1 -1
  190. package/dist/index.d.ts +2 -1
  191. package/dist/index.d.ts.map +1 -1
  192. package/dist/index.js +1 -0
  193. package/dist/index.js.map +1 -1
  194. package/dist/legacy-skill-catalog.d.ts.map +1 -1
  195. package/dist/legacy-skill-catalog.js +143 -0
  196. package/dist/legacy-skill-catalog.js.map +1 -1
  197. package/dist/mcp-tool-definitions.js +1 -1
  198. package/dist/mcp-tool-definitions.js.map +1 -1
  199. package/dist/mcp-tool-handler.d.ts.map +1 -1
  200. package/dist/mcp-tool-handler.js +3 -0
  201. package/dist/mcp-tool-handler.js.map +1 -1
  202. package/dist/redesign-capture.d.ts +17 -0
  203. package/dist/redesign-capture.d.ts.map +1 -1
  204. package/dist/redesign-capture.js +55 -3
  205. package/dist/redesign-capture.js.map +1 -1
  206. package/dist/responsive-alternative-materializer.d.ts +19 -0
  207. package/dist/responsive-alternative-materializer.d.ts.map +1 -0
  208. package/dist/responsive-alternative-materializer.js +76 -0
  209. package/dist/responsive-alternative-materializer.js.map +1 -0
  210. package/dist/run-journal-unfinished.d.ts +56 -0
  211. package/dist/run-journal-unfinished.d.ts.map +1 -0
  212. package/dist/run-journal-unfinished.js +126 -0
  213. package/dist/run-journal-unfinished.js.map +1 -0
  214. package/dist/run-journal.d.ts +25 -1
  215. package/dist/run-journal.d.ts.map +1 -1
  216. package/dist/run-journal.js +15 -1
  217. package/dist/run-journal.js.map +1 -1
  218. package/open-design.json +2 -2
  219. package/package.json +1 -1
  220. package/skills/12ui-design/SKILL.md +9 -1
  221. package/skills/12ui-design/improve.md +83 -6
  222. package/skills/12ui-design/inspire.md +1 -1
@@ -1,42 +1,10 @@
1
1
  import { mkdir, writeFile } from 'node:fs/promises';
2
2
  import path from 'node:path';
3
3
  import { buildImproveAddedElementSpecs } from './improve-added-specs.js';
4
- import { selectorLabel } from './improve-dom-anchor.js';
5
- import { formatImproveSourceHint, indexImproveSourceRepo, resolveImproveSourceHint, } from './improve-source-hints.js';
4
+ import { readImproveKitAssets } from './improve-kit-assets.js';
5
+ import { renderImproveAnnotatedPlan, } from './improve-plan-annotated-render.js';
6
+ import { indexImproveSourceRepo, resolveImproveSourceHint, } from './improve-source-hints.js';
6
7
  import { buildImproveTokenPatch } from './improve-token-patch.js';
7
- const renderAnnotatedPlan = (args) => {
8
- const lines = [
9
- '# Annotated implementation plan', '',
10
- `- Mode: **${args.mode}**`,
11
- `- Coverage: ${(args.computed.domCoverage * 100).toFixed(1)}% before-side; ${(args.computed.designCoverage * 100).toFixed(1)}% target-side`,
12
- `- Source repository: ${args.repo ? `\`${args.repo}\`` : 'not supplied; file hints are unresolved'}`, '',
13
- '## Tokens — apply once', '',
14
- '- Apply `token-patch.css` through the existing global token or theme entry point.',
15
- ];
16
- if (args.tokenPatch.tokens.length === 0) {
17
- lines.push('- No recurring CSS-capable delta reached the two-node threshold.');
18
- }
19
- else {
20
- lines.push(...args.tokenPatch.tokens.map((token) => (`- \`${token.name}: ${token.value}\` — ${token.count} matched changes; selectors: ${token.selectors.join(', ')}.`)));
21
- }
22
- lines.push('', '## Matched changes', '');
23
- const changed = args.entries.filter((entry) => entry.changed || (entry.impliedPadding?.length ?? 0) > 0);
24
- lines.push(...(changed.length > 0 ? changed.map((entry) => {
25
- const leaf = args.computed.beforeLeaves[entry.beforeIndex];
26
- const changes = [
27
- ...entry.deltas.map((delta) => `${delta.field} ${JSON.stringify(delta.before)}→${JSON.stringify(delta.after)}`),
28
- ...(entry.impliedPadding ?? []).map((delta) => `${delta.field} ${delta.before}px→${delta.after}px (${delta.basis})`),
29
- ];
30
- return `- ${selectorLabel(leaf)} — ${formatImproveSourceHint(entry.sourceHint)}: ${changes.join(', ')}`;
31
- }) : ['_No actionable matched changes._']));
32
- lines.push('', '## Added elements — full target specs', '');
33
- if (args.addedSpecs.length === 0)
34
- lines.push('_None._');
35
- else
36
- args.addedSpecs.forEach((spec) => lines.push(spec.markdown, ''));
37
- lines.push('## Implementation guardrails', '', '- Preserve all real content, data, and controls. Do not fabricate product features or copy.', '- In Tailwind v4, verify arbitrary custom-property forms against the installed compiler before using them.', '- Quote CSS `url(...)` values when paths contain punctuation or whitespace.', '- Update the page content-security policy before introducing any data URI.', '- Implement silently. Log only adapted or skipped items and the reason.', '');
38
- return lines.join('\n');
39
- };
40
8
  export const writeImproveAnnotatedPlan = async (args) => {
41
9
  await mkdir(args.outDir, { recursive: true });
42
10
  const sourceIndex = args.repo ? indexImproveSourceRepo(args.repo) : { files: [] };
@@ -45,24 +13,32 @@ export const writeImproveAnnotatedPlan = async (args) => {
45
13
  sourceHint: resolveImproveSourceHint(args.computed.beforeLeaves[entry.beforeIndex], sourceIndex, args.computed.beforeLeaves),
46
14
  }));
47
15
  const tokenPatch = buildImproveTokenPatch(entries, args.computed.beforeLeaves, args.computed.targetLeaves);
48
- const addedSpecs = await buildImproveAddedElementSpecs({
49
- targetDoc: args.targetDoc,
50
- designPath: args.targetPath,
51
- normalizedTarget: args.computed.targetLeaves,
52
- before: args.computed.beforeLeaves,
53
- canvas: args.computed.beforeCanvas,
54
- diff: args.computed.result,
55
- outDir: args.outDir,
56
- });
16
+ const [addedSpecs, index] = await Promise.all([
17
+ buildImproveAddedElementSpecs({
18
+ targetDoc: args.targetDoc,
19
+ designPath: args.targetPath,
20
+ normalizedTarget: args.computed.targetLeaves,
21
+ before: args.computed.beforeLeaves,
22
+ canvas: args.computed.beforeCanvas,
23
+ diff: args.computed.result,
24
+ outDir: args.outDir,
25
+ }),
26
+ readImproveKitAssets({
27
+ runDir: path.dirname(args.outDir),
28
+ layerDocPath: args.targetPath,
29
+ document: args.targetDoc,
30
+ }),
31
+ ]);
57
32
  const planPath = path.join(args.outDir, 'plan-annotated.md');
58
33
  const tokenPath = path.join(args.outDir, 'token-patch.css');
59
34
  await Promise.all([
60
35
  writeFile(tokenPath, tokenPatch.css, 'utf8'),
61
- writeFile(planPath, renderAnnotatedPlan({
36
+ writeFile(planPath, renderImproveAnnotatedPlan({
62
37
  computed: args.computed,
63
38
  entries,
64
39
  tokenPatch,
65
40
  addedSpecs,
41
+ index,
66
42
  ...(args.repo ? { repo: args.repo } : {}),
67
43
  mode: args.mode,
68
44
  }), 'utf8'),
@@ -70,6 +46,7 @@ export const writeImproveAnnotatedPlan = async (args) => {
70
46
  return {
71
47
  planPath,
72
48
  tokenPath,
49
+ fonts: tokenPatch.fontLoads,
73
50
  artifacts: [
74
51
  planPath,
75
52
  tokenPath,
@@ -1 +1 @@
1
- {"version":3,"file":"improve-plan-annotator.js","sourceRoot":"","sources":["../src/improve-plan-annotator.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AACpD,OAAO,IAAI,MAAM,WAAW,CAAC;AAE7B,OAAO,EAAE,6BAA6B,EAAE,MAAM,0BAA0B,CAAC;AACzE,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AACxD,OAAO,EACL,uBAAuB,EACvB,sBAAsB,EACtB,wBAAwB,GAGzB,MAAM,2BAA2B,CAAC;AACnC,OAAO,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAC;AAMlE,MAAM,mBAAmB,GAAG,CAAC,IAO5B,EAAU,EAAE;IACX,MAAM,KAAK,GAAG;QACZ,iCAAiC,EAAE,EAAE;QACrC,aAAa,IAAI,CAAC,IAAI,IAAI;QAC1B,eAAe,CAAC,IAAI,CAAC,QAAQ,CAAC,WAAW,GAAG,GAAG,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,kBAAkB,CAAC,IAAI,CAAC,QAAQ,CAAC,cAAc,GAAG,GAAG,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,eAAe;QAC3I,wBAAwB,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,IAAI,CAAC,IAAI,IAAI,CAAC,CAAC,CAAC,yCAAyC,EAAE,EAAE,EAAE;QACxG,wBAAwB,EAAE,EAAE;QAC5B,mFAAmF;KACpF,CAAC;IACF,IAAI,IAAI,CAAC,UAAU,CAAC,MAAM,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QACxC,KAAK,CAAC,IAAI,CAAC,kEAAkE,CAAC,CAAC;IACjF,CAAC;SAAM,CAAC;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AAE,UAAU,CAAC,GAAG,EAAE,MAAM,CAAC;QAC5C,SAAS,CAAC,QAAQ,EAAE,0BAA0B,CAAC;YAC7C,QAAQ,EAAE,IAAI,CAAC,QAAQ;YACvB,OAAO;YACP,UAAU;YACV,UAAU;YACV,KAAK;YACL,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,IAAI,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;YACzC,IAAI,EAAE,IAAI,CAAC,IAAI;SAChB,CAAC,EAAE,MAAM,CAAC;KACZ,CAAC,CAAC;IACH,OAAO;QACL,QAAQ;QACR,SAAS;QACT,KAAK,EAAE,UAAU,CAAC,SAAS;QAC3B,SAAS,EAAE;YACT,QAAQ;YACR,SAAS;YACT,GAAG,UAAU,CAAC,OAAO,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,KAAK,EAAE,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;SAC3E;KACF,CAAC;AACJ,CAAC,CAAC"}
@@ -0,0 +1,21 @@
1
+ import { type ImproveRasterLayer } from './improve-kit-assets.js';
2
+ /**
3
+ * "Raster layers to carry" — the section that has to come first.
4
+ *
5
+ * A hero can be a single raster plate. When it is, the only correct action is
6
+ * to copy that file into the repository and reference it; a lane that reads
7
+ * thirty token lines before it reaches the hero has already started drawing
8
+ * gradients. So this renders ahead of tokens in the plan, and it is also the
9
+ * one section a stalled run can still emit from a LayerDoc alone.
10
+ *
11
+ * "Never skip one" binds every line it prints, so an alternate backdrop — a
12
+ * plate the README says to use only if its layer is omitted — is filtered out
13
+ * here rather than contradicted two files apart.
14
+ */
15
+ export declare const IMPROVE_RASTER_SECTION_TITLE = "Raster layers to carry";
16
+ export declare const renderImproveRasterLayers: (args: {
17
+ layers: readonly ImproveRasterLayer[];
18
+ /** Where the layer lands in the page, when the diff anchored it to a selector. */
19
+ placement?: (layer: ImproveRasterLayer) => string | undefined;
20
+ }) => string[];
21
+ //# sourceMappingURL=improve-raster-layers-section.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"improve-raster-layers-section.d.ts","sourceRoot":"","sources":["../src/improve-raster-layers-section.ts"],"names":[],"mappings":"AAAA,OAAO,EAIL,KAAK,kBAAkB,EACxB,MAAM,yBAAyB,CAAC;AAEjC;;;;;;;;;;;;GAYG;AAEH,eAAO,MAAM,4BAA4B,2BAA2B,CAAC;AAErE,eAAO,MAAM,yBAAyB,GAAI,MAAM;IAC9C,MAAM,EAAE,SAAS,kBAAkB,EAAE,CAAC;IACtC,kFAAkF;IAClF,SAAS,CAAC,EAAE,CAAC,KAAK,EAAE,kBAAkB,KAAK,MAAM,GAAG,SAAS,CAAC;CAC/D,KAAG,MAAM,EAkCT,CAAC"}
@@ -0,0 +1,45 @@
1
+ import { formatImproveBounds, improveCarriedRasterLayers, isImproveAlternateBackdrop, } from './improve-kit-assets.js';
2
+ /**
3
+ * "Raster layers to carry" — the section that has to come first.
4
+ *
5
+ * A hero can be a single raster plate. When it is, the only correct action is
6
+ * to copy that file into the repository and reference it; a lane that reads
7
+ * thirty token lines before it reaches the hero has already started drawing
8
+ * gradients. So this renders ahead of tokens in the plan, and it is also the
9
+ * one section a stalled run can still emit from a LayerDoc alone.
10
+ *
11
+ * "Never skip one" binds every line it prints, so an alternate backdrop — a
12
+ * plate the README says to use only if its layer is omitted — is filtered out
13
+ * here rather than contradicted two files apart.
14
+ */
15
+ export const IMPROVE_RASTER_SECTION_TITLE = 'Raster layers to carry';
16
+ export const renderImproveRasterLayers = (args) => {
17
+ const lines = [
18
+ `## ${IMPROVE_RASTER_SECTION_TITLE}`,
19
+ '',
20
+ 'Copy each file into the repository and reference it at its bounds.'
21
+ + ' Never redraw one of these in CSS, and never skip one.',
22
+ '',
23
+ ];
24
+ const layers = improveCarriedRasterLayers(args.layers);
25
+ if (layers.length === 0) {
26
+ lines.push('_The target LayerDoc declares no raster layer._', '');
27
+ return lines;
28
+ }
29
+ for (const layer of layers) {
30
+ const placement = args.placement?.(layer);
31
+ lines.push(`- **${layer.kind}** — ${layer.name}${layer.hero ? ' (hero imagery)' : ''}`, layer.asset
32
+ ? ` - Asset: \`${layer.asset.file}\` — ${layer.asset.roleLabel}`
33
+ : ' - Asset: declared by the LayerDoc but not present in this kit; resume the run before coding.', ` - Bounds: ${formatImproveBounds(layer.bounds)}`, ` - Place at: ${placement ?? 'new element — place it at the bounds above'}`, ...(() => {
34
+ const alternates = layer.alternates.filter((asset) => !isImproveAlternateBackdrop(asset));
35
+ return alternates.length > 0
36
+ ? [` - Also available: ${alternates
37
+ .map((asset) => `\`${asset.file}\` (${asset.roleLabel})`)
38
+ .join(', ')} — pick one resolution.`]
39
+ : [];
40
+ })());
41
+ }
42
+ lines.push('');
43
+ return lines;
44
+ };
45
+ //# sourceMappingURL=improve-raster-layers-section.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"improve-raster-layers-section.js","sourceRoot":"","sources":["../src/improve-raster-layers-section.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,mBAAmB,EACnB,0BAA0B,EAC1B,0BAA0B,GAE3B,MAAM,yBAAyB,CAAC;AAEjC;;;;;;;;;;;;GAYG;AAEH,MAAM,CAAC,MAAM,4BAA4B,GAAG,wBAAwB,CAAC;AAErE,MAAM,CAAC,MAAM,yBAAyB,GAAG,CAAC,IAIzC,EAAY,EAAE;IACb,MAAM,KAAK,GAAG;QACZ,MAAM,4BAA4B,EAAE;QACpC,EAAE;QACF,oEAAoE;cAClE,wDAAwD;QAC1D,EAAE;KACH,CAAC;IACF,MAAM,MAAM,GAAG,0BAA0B,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;IACvD,IAAI,MAAM,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QACxB,KAAK,CAAC,IAAI,CAAC,iDAAiD,EAAE,EAAE,CAAC,CAAC;QAClE,OAAO,KAAK,CAAC;IACf,CAAC;IACD,KAAK,MAAM,KAAK,IAAI,MAAM,EAAE,CAAC;QAC3B,MAAM,SAAS,GAAG,IAAI,CAAC,SAAS,EAAE,CAAC,KAAK,CAAC,CAAC;QAC1C,KAAK,CAAC,IAAI,CACR,OAAO,KAAK,CAAC,IAAI,QAAQ,KAAK,CAAC,IAAI,GAAG,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,iBAAiB,CAAC,CAAC,CAAC,EAAE,EAAE,EAC3E,KAAK,CAAC,KAAK;YACT,CAAC,CAAC,gBAAgB,KAAK,CAAC,KAAK,CAAC,IAAI,QAAQ,KAAK,CAAC,KAAK,CAAC,SAAS,EAAE;YACjE,CAAC,CAAC,gGAAgG,EACpG,eAAe,mBAAmB,CAAC,KAAK,CAAC,MAAM,CAAC,EAAE,EAClD,iBAAiB,SAAS,IAAI,4CAA4C,EAAE,EAC5E,GAAG,CAAC,GAAG,EAAE;YACP,MAAM,UAAU,GAAG,KAAK,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC,0BAA0B,CAAC,KAAK,CAAC,CAAC,CAAC;YAC1F,OAAO,UAAU,CAAC,MAAM,GAAG,CAAC;gBAC1B,CAAC,CAAC,CAAC,uBAAuB,UAAU;yBACjC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,KAAK,CAAC,IAAI,OAAO,KAAK,CAAC,SAAS,GAAG,CAAC;yBACxD,IAAI,CAAC,IAAI,CAAC,yBAAyB,CAAC;gBACvC,CAAC,CAAC,EAAE,CAAC;QACT,CAAC,CAAC,EAAE,CACL,CAAC;IACJ,CAAC;IACD,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IACf,OAAO,KAAK,CAAC;AACf,CAAC,CAAC"}
@@ -0,0 +1,122 @@
1
+ import { type ImproveConversionAttempt } from './improve-conversion-attempts.js';
2
+ import { type ImproveRecord, type ImproveStage } from './improve-workspace.js';
3
+ /**
4
+ * What improve throws away, and what it writes down before it does.
5
+ *
6
+ * Three paths discard work that was already dispatched — `--fresh`, the
7
+ * asset-stage stall retry, and a re-pick that changes the winner — and each one
8
+ * used to discard it a slightly different way. They now share this module, so
9
+ * the ownership rule is stated once: a conversion the CLI walks away from is
10
+ * recorded in `improve.json` by id, with the reason, before anything is
11
+ * deleted.
12
+ *
13
+ * THE MONEY TRUTH, stated plainly because the opposite reading is tempting.
14
+ * The hosted conversion API has no cancel or abort verb: `GET
15
+ * /api/v1/convert/{id}` is the whole item surface, and the one DELETE on the
16
+ * family hides a history row for a principal. So the CLI cannot stop an
17
+ * abandoned run, and stopping the poll saves nothing — the polls are free
18
+ * authenticated reads. The abandoned conversion runs to completion server-side
19
+ * and bills either way. What actually saves money is not dispatching a
20
+ * conversion nobody chose, which is why `--pick` is now required before the
21
+ * convert stage. Everything here is bookkeeping so the owner can SEE what was
22
+ * paid for and dropped.
23
+ */
24
+ export type ImproveAbandonedConversion = NonNullable<ImproveRecord['abandonedConversions']>[number];
25
+ /** Append one abandonment, deduped by id — two writers can name the same run. */
26
+ export declare const noteAbandonedConversion: (record: ImproveRecord, entry: ImproveAbandonedConversion) => ImproveRecord;
27
+ /** One wording for "this kit walked away from a conversion that keeps billing". */
28
+ export declare const abandonedConversionLine: (args: {
29
+ id: string;
30
+ reason: string;
31
+ }) => string;
32
+ /**
33
+ * Record the conversion this record is about to stop caring about, if the run
34
+ * ever told us its id. It may not have: a stall before the first status read
35
+ * leaves `improve.json` with no convert block and the journal with no run id,
36
+ * and the kit has to be able to say "a conversion may still be running; its id
37
+ * was not recorded" rather than implying nothing was bought.
38
+ */
39
+ export declare const abandonImproveConversion: (args: {
40
+ record: ImproveRecord;
41
+ reason: string;
42
+ /** The id the caller already holds — an attempt's run id, say. */
43
+ id?: string;
44
+ warn?: (line: string) => void;
45
+ }) => Promise<{
46
+ record: ImproveRecord;
47
+ id?: string;
48
+ }>;
49
+ /**
50
+ * Attempts a caller has already closed in `conversionAttempts` also belong in
51
+ * `abandonedConversions` — the ledger the owner reads for what is still billing
52
+ * — whenever the kit ever learned their id. An attempt that never reported one
53
+ * is recorded by key alone, which is the honest record: there is nothing to name.
54
+ */
55
+ export declare const noteAbandonedAttempts: (args: {
56
+ record: ImproveRecord;
57
+ attempts: readonly ImproveConversionAttempt[];
58
+ reason: string;
59
+ warn?: (line: string) => void;
60
+ }) => ImproveRecord;
61
+ /**
62
+ * The same abandonment, extended to every attempt the kit still had open.
63
+ *
64
+ * A path that discards the WINNER — a redraw, a re-pick, a stall — discards the
65
+ * conversions of it too, and those are recorded by key in `conversionAttempts`
66
+ * (`improve-conversion-attempts.ts`) as well as by id here. Leaving one open
67
+ * would point the next resume at a conversion of a design nobody chose.
68
+ *
69
+ * `--fresh` is deliberately NOT a caller: it closes the attempt it replaces at
70
+ * dispatch, where the key it is about to use is known and can be spared. Doing
71
+ * it here instead would close that same key on the stage replay the
72
+ * temporarily-unavailable retry performs.
73
+ */
74
+ export declare const abandonImproveConversions: (args: {
75
+ record: ImproveRecord;
76
+ reason: string;
77
+ id?: string;
78
+ warn?: (line: string) => void;
79
+ }) => Promise<{
80
+ record: ImproveRecord;
81
+ id?: string;
82
+ }>;
83
+ /**
84
+ * What the owner has to be able to SEE: every conversion this kit paid for and
85
+ * walked away from, by id, with why. There is no cancel, so each of these is
86
+ * still running and still billing somewhere.
87
+ */
88
+ export declare const improveAbandonedLines: (record: ImproveRecord) => string[];
89
+ /** Drop the named stages from the record and from its settlement ledger. */
90
+ export declare const withoutImproveStages: (record: ImproveRecord, stages: readonly ImproveStage[]) => ImproveRecord;
91
+ /**
92
+ * What a redraw is allowed to change about the draw it is replacing. Only the
93
+ * fields the caller passed explicitly appear here: a redraw that quietly reset
94
+ * `--candidates` to the default because the flag was absent would buy a
95
+ * different draw than the one asked for.
96
+ */
97
+ export type ImproveRedraw = Partial<Pick<ImproveRecord, 'direction' | 'concept' | 'candidates' | 'retain' | 'retainFlag'>>;
98
+ export declare const REDRAW_ABANDON_REASON = "redraw discarded the draw this conversion was made from";
99
+ /**
100
+ * `--redraw`: buy a whole new draw of candidates from the same capture.
101
+ *
102
+ * `--fresh` rotates the conversion key and nothing else — it re-buys ONE
103
+ * conversion of the same settled winner. A caller who wanted different
104
+ * candidates had no flag at all, and `--fresh` was the nearest-looking one. The
105
+ * old draw is renamed rather than deleted: a reader may still want the
106
+ * candidate they were about to pick, and a destroyed directory cannot be got
107
+ * back for the price of a rename.
108
+ *
109
+ * This was the fourth path that walked away from paid work and the only one
110
+ * that did not write it down: it removed `target/` while
111
+ * `convert.sourceConversionId` was still in hand, so a settled conversion the
112
+ * kit had bought vanished from the ledger the module header above declares.
113
+ */
114
+ export declare const resetImproveDraw: (args: {
115
+ record: ImproveRecord;
116
+ draw?: ImproveRedraw;
117
+ warn?: (line: string) => void;
118
+ }) => Promise<{
119
+ record: ImproveRecord;
120
+ abandonedId?: string;
121
+ }>;
122
+ //# sourceMappingURL=improve-reset.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"improve-reset.d.ts","sourceRoot":"","sources":["../src/improve-reset.ts"],"names":[],"mappings":"AAEA,OAAO,EAEL,KAAK,wBAAwB,EAC9B,MAAM,kCAAkC,CAAC;AAE1C,OAAO,EAAgB,KAAK,aAAa,EAAE,KAAK,YAAY,EAAE,MAAM,wBAAwB,CAAC;AAE7F;;;;;;;;;;;;;;;;;;;;GAoBG;AAEH,MAAM,MAAM,0BAA0B,GAAG,WAAW,CAAC,aAAa,CAAC,sBAAsB,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC;AAEpG,iFAAiF;AACjF,eAAO,MAAM,uBAAuB,GAClC,QAAQ,aAAa,EACrB,OAAO,0BAA0B,KAChC,aAKF,CAAC;AAEF,mFAAmF;AACnF,eAAO,MAAM,uBAAuB,GAAI,MAAM;IAAE,EAAE,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,KAAG,MAE9E,CAAC;AAEF;;;;;;GAMG;AACH,eAAO,MAA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CAAC,CACtF,CAAC;AAEF,eAAO,MAAM,qBAAqB,4DAA4D,CAAC;AAE/F;;;;;;;;;;;;;;GAcG;AACH,eAAO,MAAM,gBAAgB,GAAU,MAAM;IAC3C,MAAM,EAAE,aAAa,CAAC;IACtB,IAAI,CAAC,EAAE,aAAa,CAAC;IACrB,IAAI,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;CAC/B,KAAG,OAAO,CAAC;IAAE,MAAM,EAAE,aAAa,CAAC;IAAC,WAAW,CAAC,EAAE,MAAM,CAAA;CAAE,CAsB1D,CAAC"}
@@ -0,0 +1,141 @@
1
+ import { rename, rm, stat } from 'node:fs/promises';
2
+ import { abandonImproveConversionAttempts, } from './improve-conversion-attempts.js';
3
+ import { recordedImproveConversionId } from './improve-convert-resilience.js';
4
+ import { improvePaths } from './improve-workspace.js';
5
+ /** Append one abandonment, deduped by id — two writers can name the same run. */
6
+ export const noteAbandonedConversion = (record, entry) => {
7
+ const abandoned = [...(record.abandonedConversions ?? [])];
8
+ if (abandoned.some((existing) => existing.id === entry.id))
9
+ return record;
10
+ abandoned.push(entry);
11
+ return { ...record, abandonedConversions: abandoned };
12
+ };
13
+ /** One wording for "this kit walked away from a conversion that keeps billing". */
14
+ export const abandonedConversionLine = (args) => (`[abandon] convert: ${args.reason}; conversion ${args.id} keeps running and keeps billing`);
15
+ /**
16
+ * Record the conversion this record is about to stop caring about, if the run
17
+ * ever told us its id. It may not have: a stall before the first status read
18
+ * leaves `improve.json` with no convert block and the journal with no run id,
19
+ * and the kit has to be able to say "a conversion may still be running; its id
20
+ * was not recorded" rather than implying nothing was bought.
21
+ */
22
+ export const abandonImproveConversion = async (args) => {
23
+ const id = args.id ?? await recordedImproveConversionId(args.record);
24
+ if (!id)
25
+ return { record: args.record };
26
+ const record = noteAbandonedConversion(args.record, {
27
+ id,
28
+ abandonedAt: new Date().toISOString(),
29
+ reason: args.reason,
30
+ });
31
+ if (record !== args.record)
32
+ args.warn?.(abandonedConversionLine({ id, reason: args.reason }));
33
+ return { record, id };
34
+ };
35
+ /**
36
+ * Attempts a caller has already closed in `conversionAttempts` also belong in
37
+ * `abandonedConversions` — the ledger the owner reads for what is still billing
38
+ * — whenever the kit ever learned their id. An attempt that never reported one
39
+ * is recorded by key alone, which is the honest record: there is nothing to name.
40
+ */
41
+ export const noteAbandonedAttempts = (args) => args.attempts.reduce((carried, attempt) => {
42
+ if (!attempt.conversionId)
43
+ return carried;
44
+ const reason = attempt.abandonedReason ?? args.reason;
45
+ const noted = noteAbandonedConversion(carried, {
46
+ id: attempt.conversionId,
47
+ abandonedAt: attempt.abandonedAt ?? new Date().toISOString(),
48
+ reason,
49
+ });
50
+ if (noted !== carried)
51
+ args.warn?.(abandonedConversionLine({ id: attempt.conversionId, reason }));
52
+ return noted;
53
+ }, args.record);
54
+ /**
55
+ * The same abandonment, extended to every attempt the kit still had open.
56
+ *
57
+ * A path that discards the WINNER — a redraw, a re-pick, a stall — discards the
58
+ * conversions of it too, and those are recorded by key in `conversionAttempts`
59
+ * (`improve-conversion-attempts.ts`) as well as by id here. Leaving one open
60
+ * would point the next resume at a conversion of a design nobody chose.
61
+ *
62
+ * `--fresh` is deliberately NOT a caller: it closes the attempt it replaces at
63
+ * dispatch, where the key it is about to use is known and can be spared. Doing
64
+ * it here instead would close that same key on the stage replay the
65
+ * temporarily-unavailable retry performs.
66
+ */
67
+ export const abandonImproveConversions = async (args) => {
68
+ const abandoned = await abandonImproveConversion(args);
69
+ const closed = abandonImproveConversionAttempts(abandoned.record, { reason: args.reason });
70
+ const record = noteAbandonedAttempts({
71
+ record: closed.record,
72
+ attempts: closed.abandoned,
73
+ reason: args.reason,
74
+ ...(args.warn ? { warn: args.warn } : {}),
75
+ });
76
+ return { record, ...(abandoned.id ? { id: abandoned.id } : {}) };
77
+ };
78
+ /**
79
+ * What the owner has to be able to SEE: every conversion this kit paid for and
80
+ * walked away from, by id, with why. There is no cancel, so each of these is
81
+ * still running and still billing somewhere.
82
+ */
83
+ export const improveAbandonedLines = (record) => {
84
+ const abandoned = record.abandonedConversions ?? [];
85
+ if (abandoned.length === 0)
86
+ return [];
87
+ return [
88
+ `- Abandoned ${abandoned.length} conversion${abandoned.length === 1 ? '' : 's'}`
89
+ + ' (each keeps running and keeps billing; there is no cancel):',
90
+ ...abandoned.map((entry) => ` - \`${entry.id}\` — ${entry.reason}`),
91
+ ];
92
+ };
93
+ /** Drop the named stages from the record and from its settlement ledger. */
94
+ export const withoutImproveStages = (record, stages) => ({
95
+ ...record,
96
+ ...(stages.includes('draft') ? { draft: undefined } : {}),
97
+ ...(stages.includes('pick') ? { pick: undefined } : {}),
98
+ ...(stages.includes('convert') ? { convert: undefined } : {}),
99
+ ...(stages.includes('plan') ? { plan: undefined } : {}),
100
+ stages: Object.fromEntries(Object.entries(record.stages).filter(([stage]) => !stages.includes(stage))),
101
+ });
102
+ export const REDRAW_ABANDON_REASON = 'redraw discarded the draw this conversion was made from';
103
+ /**
104
+ * `--redraw`: buy a whole new draw of candidates from the same capture.
105
+ *
106
+ * `--fresh` rotates the conversion key and nothing else — it re-buys ONE
107
+ * conversion of the same settled winner. A caller who wanted different
108
+ * candidates had no flag at all, and `--fresh` was the nearest-looking one. The
109
+ * old draw is renamed rather than deleted: a reader may still want the
110
+ * candidate they were about to pick, and a destroyed directory cannot be got
111
+ * back for the price of a rename.
112
+ *
113
+ * This was the fourth path that walked away from paid work and the only one
114
+ * that did not write it down: it removed `target/` while
115
+ * `convert.sourceConversionId` was still in hand, so a settled conversion the
116
+ * kit had bought vanished from the ledger the module header above declares.
117
+ */
118
+ export const resetImproveDraw = async (args) => {
119
+ const paths = improvePaths(args.record.runDir);
120
+ const abandoned = await abandonImproveConversions({
121
+ record: args.record,
122
+ reason: REDRAW_ABANDON_REASON,
123
+ ...(args.warn ? { warn: args.warn } : {}),
124
+ });
125
+ const previous = `${paths.candidatesDir}.previous`;
126
+ if (await stat(paths.candidatesDir).catch(() => undefined)) {
127
+ await rm(previous, { recursive: true, force: true });
128
+ await rename(paths.candidatesDir, previous);
129
+ }
130
+ await Promise.all([
131
+ rm(paths.winnerImage, { force: true }),
132
+ rm(paths.targetDir, { recursive: true, force: true }),
133
+ rm(paths.planDir, { recursive: true, force: true }),
134
+ ]);
135
+ const carried = withoutImproveStages(abandoned.record, ['draft', 'pick', 'convert', 'plan']);
136
+ return {
137
+ record: { ...carried, ...args.draw },
138
+ ...(abandoned.id ? { abandonedId: abandoned.id } : {}),
139
+ };
140
+ };
141
+ //# sourceMappingURL=improve-reset.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"improve-reset.js","sourceRoot":"","sources":["../src/improve-reset.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,EAAE,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AAEpD,OAAO,EACL,gCAAgC,GAEjC,MAAM,kCAAkC,CAAC;AAC1C,OAAO,EAAE,2BAA2B,EAAE,MAAM,iCAAiC,CAAC;AAC9E,OAAO,EAAE,YAAY,EAAyC,MAAM,wBAAwB,CAAC;AA0B7F,iFAAiF;AACjF,MAAM,CAAC,MAAM,uBAAuB,GAAG,CACrC,MAAqB,EACrB,KAAiC,EAClB,EAAE;IACjB,MAAM,SAAS,GAAG,CAAC,GAAG,CAAC,MAAM,CAAC,oBAAoB,IAAI,EAAE,CAAC,CAAC,CAAC;IAC3D,IAAI,SAAS,CAAC,IAAI,CAAC,CAAC,QAAQ,EAAE,EAAE,CAAC,QAAQ,CAAC,EAAE,KAAK,KAAK,CAAC,EAAE,CAAC;QAAE,OAAO,MAAM,CAAC;IAC1E,SAAS,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IACtB,OAAO,EAAE,GAAG,MAAM,EAAE,oBAAoB,EAAE,SAAS,EAAE,CAAC;AACxD,CAAC,CAAC;AAEF,mFAAmF;AACnF,MAAM,CAAC,MAAM,uBAAuB,GAAG,CAAC,IAAoC,EAAU,EAAE,CAAC,CACvF,sBAAsB,IAAI,CA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M,EAAE,EAAE,GAAG,OAAO,EAAE,GAAG,IAAI,CAAC,IAAI,EAAE;QACpC,GAAG,CAAC,SAAS,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,WAAW,EAAE,SAAS,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;KACvD,CAAC;AACJ,CAAC,CAAC"}
@@ -0,0 +1,35 @@
1
+ import { type ImproveKitAssetIndex } from './improve-kit-assets.js';
2
+ import { type ImproveKitStatus } from './improve-kit-status.js';
3
+ import type { ImproveOptions } from './improve-options.js';
4
+ import { type ImproveRecord, type ImproveStage } from './improve-workspace.js';
5
+ /**
6
+ * What a run prints when the draw is ready and nobody has chosen.
7
+ *
8
+ * This is the whole point of the dispatch-discipline change, so it has to leave
9
+ * the reader with two things and nothing else: where the candidates are, and
10
+ * the one command that continues from here. It is a finished run, not a
11
+ * failure — the stages that were asked for and could run, ran.
12
+ */
13
+ export declare const awaitingImprovePick: (args: {
14
+ record: ImproveRecord;
15
+ options: Pick<ImproveOptions, "paths" | "input">;
16
+ }) => string;
17
+ export declare const renderImproveRunSummary: (args: {
18
+ record: ImproveRecord;
19
+ status: ImproveKitStatus;
20
+ index: ImproveKitAssetIndex;
21
+ }) => string;
22
+ export declare const buildImproveRunSummary: (args: {
23
+ record: ImproveRecord;
24
+ requestedTo?: ImproveStage;
25
+ }) => Promise<string>;
26
+ /**
27
+ * Put the summary AFTER the failure text.
28
+ *
29
+ * `cli.ts` prints `error.message` last, so a summary written to stdout before
30
+ * the throw leaves the reader's final line as the error rather than
31
+ * "Next: read <kit>/README.md" — which is the line the summary exists to
32
+ * leave there. Carrying it in the message is what keeps the order right.
33
+ */
34
+ export declare const improveStallErrorWithSummary: (error: unknown, summary: string) => unknown;
35
+ //# sourceMappingURL=improve-run-summary.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"improve-run-summary.d.ts","sourceRoot":"","sources":["../src/improve-run-summary.ts"],"names":[],"mappings":"AAIA,OAAO,EAAwB,KAAK,oBAAoB,EAAE,MAAM,yBAAyB,CAAC;AAC1F,OAAO,EAOL,KAAK,gBAAgB,EACtB,MAAM,yBAAyB,CAAC;AAGjC,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAE3D,OAAO,EAAgB,KAAK,aAAa,EAAE,KAAK,YAAY,EAAE,MAAM,wBAAwB,CAAC;AAmE7F;;;;;;;GAOG;AACH,eAAO,MAAM,mBAAmB,GAAI,MAAM;IACxC,MAAM,EAAE,aAAa,CAAC;IACtB,OAAO,EAAE,IAAI,CAAC,cAAc,EAAE,OAAO,GAAG,OAAO,CAAC,CAAC;CAClD,KAAG,MAeH,CAAC;AAmBF,eAAO,MAAM,uBAAuB,GAAI,MAAM;IAC5C,MAAM,EAAE,aAAa,CAAC;IACtB,MAAM,EAAE,gBAAgB,CAAC;IACzB,KAAK,EAAE,oBAAoB,CAAC;CAC7B,KAAG,MAuCH,CAAC;AAEF,eAAO,MAAM,sBAAsB,GAAU,MAAM;IACjD,MAAM,EAAE,aAAa,CAAC;IACtB,WAAW,CAAC,EAAE,YAAY,CAAC;CAC5B,KAAG,OAAO,CAAC,MAAM,CAUjB,CAAC;AAEF;;;;;;;GAOG;AACH,eAAO,MAAM,4BAA4B,GAAI,OAAO,OAAO,EAAE,SAAS,MAAM,KAAG,OAM9E,CAAC"}