@12ui/design 0.2.57 → 0.2.59

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 (456) hide show
  1. package/SKILL.md +1 -1
  2. package/dist/artifact-materializer.d.ts.map +1 -1
  3. package/dist/artifact-materializer.js +4 -1
  4. package/dist/artifact-materializer.js.map +1 -1
  5. package/dist/atomic-file-replace.d.ts +21 -0
  6. package/dist/atomic-file-replace.d.ts.map +1 -0
  7. package/dist/atomic-file-replace.js +48 -0
  8. package/dist/atomic-file-replace.js.map +1 -0
  9. package/dist/branch-client.d.ts +84 -2
  10. package/dist/branch-client.d.ts.map +1 -1
  11. package/dist/branch-client.js +30 -0
  12. package/dist/branch-client.js.map +1 -1
  13. package/dist/cli-arguments.d.ts.map +1 -1
  14. package/dist/cli-arguments.js +2 -1
  15. package/dist/cli-arguments.js.map +1 -1
  16. package/dist/cli-capabilities.d.ts +1 -1
  17. package/dist/cli-conversion-derivation.d.ts +14 -1
  18. package/dist/cli-conversion-derivation.d.ts.map +1 -1
  19. package/dist/cli-conversion-derivation.js +14 -7
  20. package/dist/cli-conversion-derivation.js.map +1 -1
  21. package/dist/cli-convert-command.d.ts +2 -0
  22. package/dist/cli-convert-command.d.ts.map +1 -1
  23. package/dist/cli-convert-command.js +86 -34
  24. package/dist/cli-convert-command.js.map +1 -1
  25. package/dist/cli-corpus-command.d.ts.map +1 -1
  26. package/dist/cli-corpus-command.js +0 -3
  27. package/dist/cli-corpus-command.js.map +1 -1
  28. package/dist/cli-draft-command.d.ts +16 -0
  29. package/dist/cli-draft-command.d.ts.map +1 -1
  30. package/dist/cli-draft-command.js +47 -9
  31. package/dist/cli-draft-command.js.map +1 -1
  32. package/dist/cli-help/design.d.ts +7 -4
  33. package/dist/cli-help/design.d.ts.map +1 -1
  34. package/dist/cli-help/design.js +20 -7
  35. package/dist/cli-help/design.js.map +1 -1
  36. package/dist/cli-help/index.d.ts +9 -6
  37. package/dist/cli-help/index.d.ts.map +1 -1
  38. package/dist/cli-help/meta.d.ts +2 -2
  39. package/dist/cli-help/meta.d.ts.map +1 -1
  40. package/dist/cli-help/meta.js +4 -1
  41. package/dist/cli-help/meta.js.map +1 -1
  42. package/dist/cli-improve-command.d.ts.map +1 -1
  43. package/dist/cli-improve-command.js +215 -33
  44. package/dist/cli-improve-command.js.map +1 -1
  45. package/dist/cli-redesign-command.d.ts.map +1 -1
  46. package/dist/cli-redesign-command.js +268 -156
  47. package/dist/cli-redesign-command.js.map +1 -1
  48. package/dist/cli-run.d.ts.map +1 -1
  49. package/dist/cli-run.js +13 -3
  50. package/dist/cli-run.js.map +1 -1
  51. package/dist/cli-spend-command.d.ts +12 -1
  52. package/dist/cli-spend-command.d.ts.map +1 -1
  53. package/dist/cli-spend-command.js +94 -2
  54. package/dist/cli-spend-command.js.map +1 -1
  55. package/dist/cli-usage.js +5 -5
  56. package/dist/cli-usage.js.map +1 -1
  57. package/dist/concept-input.d.ts +6 -77
  58. package/dist/concept-input.d.ts.map +1 -1
  59. package/dist/concept-input.js +6 -87
  60. package/dist/concept-input.js.map +1 -1
  61. package/dist/conversion-client.d.ts +106 -17
  62. package/dist/conversion-client.d.ts.map +1 -1
  63. package/dist/conversion-client.js +244 -80
  64. package/dist/conversion-client.js.map +1 -1
  65. package/dist/corpus-client.d.ts.map +1 -1
  66. package/dist/corpus-client.js +0 -3
  67. package/dist/corpus-client.js.map +1 -1
  68. package/dist/draft-identity.d.ts +7 -0
  69. package/dist/draft-identity.d.ts.map +1 -1
  70. package/dist/draft-identity.js +4 -0
  71. package/dist/draft-identity.js.map +1 -1
  72. package/dist/draft-run.d.ts +13 -0
  73. package/dist/draft-run.d.ts.map +1 -1
  74. package/dist/draft-run.js +20 -2
  75. package/dist/draft-run.js.map +1 -1
  76. package/dist/draft-workspace.d.ts +4 -0
  77. package/dist/draft-workspace.d.ts.map +1 -1
  78. package/dist/draft-workspace.js.map +1 -1
  79. package/dist/hosted-draft-identity.d.ts +18 -0
  80. package/dist/hosted-draft-identity.d.ts.map +1 -1
  81. package/dist/hosted-draft-identity.js +8 -0
  82. package/dist/hosted-draft-identity.js.map +1 -1
  83. package/dist/hosted-draft-run.d.ts +15 -0
  84. package/dist/hosted-draft-run.d.ts.map +1 -1
  85. package/dist/hosted-draft-run.js +27 -0
  86. package/dist/hosted-draft-run.js.map +1 -1
  87. package/dist/improve-added-specs.d.ts +12 -40
  88. package/dist/improve-added-specs.d.ts.map +1 -1
  89. package/dist/improve-added-specs.js +63 -172
  90. package/dist/improve-added-specs.js.map +1 -1
  91. package/dist/improve-artifact-writer.d.ts +13 -0
  92. package/dist/improve-artifact-writer.d.ts.map +1 -0
  93. package/dist/improve-artifact-writer.js +27 -0
  94. package/dist/improve-artifact-writer.js.map +1 -0
  95. package/dist/improve-bootstrap-history.d.ts +21 -0
  96. package/dist/improve-bootstrap-history.d.ts.map +1 -0
  97. package/dist/improve-bootstrap-history.js +43 -0
  98. package/dist/improve-bootstrap-history.js.map +1 -0
  99. package/dist/improve-branch-stage.d.ts +10 -0
  100. package/dist/improve-branch-stage.d.ts.map +1 -0
  101. package/dist/improve-branch-stage.js +325 -0
  102. package/dist/improve-branch-stage.js.map +1 -0
  103. package/dist/improve-capture-redirect.d.ts +19 -0
  104. package/dist/improve-capture-redirect.d.ts.map +1 -1
  105. package/dist/improve-capture-redirect.js +18 -1
  106. package/dist/improve-capture-redirect.js.map +1 -1
  107. package/dist/improve-capture-words.d.ts +43 -0
  108. package/dist/improve-capture-words.d.ts.map +1 -0
  109. package/dist/improve-capture-words.js +25 -0
  110. package/dist/improve-capture-words.js.map +1 -0
  111. package/dist/improve-concept.d.ts +6 -20
  112. package/dist/improve-concept.d.ts.map +1 -1
  113. package/dist/improve-concept.js +12 -59
  114. package/dist/improve-concept.js.map +1 -1
  115. package/dist/improve-conversion-attempts.d.ts +12 -4
  116. package/dist/improve-conversion-attempts.d.ts.map +1 -1
  117. package/dist/improve-conversion-attempts.js.map +1 -1
  118. package/dist/improve-conversion-stage.d.ts +13 -2
  119. package/dist/improve-conversion-stage.d.ts.map +1 -1
  120. package/dist/improve-conversion-stage.js +211 -20
  121. package/dist/improve-conversion-stage.js.map +1 -1
  122. package/dist/improve-convert-progress.d.ts +10 -2
  123. package/dist/improve-convert-progress.d.ts.map +1 -1
  124. package/dist/improve-convert-progress.js +7 -3
  125. package/dist/improve-convert-progress.js.map +1 -1
  126. package/dist/improve-convert-resilience.d.ts +60 -13
  127. package/dist/improve-convert-resilience.d.ts.map +1 -1
  128. package/dist/improve-convert-resilience.js +85 -22
  129. package/dist/improve-convert-resilience.js.map +1 -1
  130. package/dist/improve-core/concept-input.d.ts +80 -0
  131. package/dist/improve-core/concept-input.d.ts.map +1 -0
  132. package/dist/improve-core/concept-input.js +92 -0
  133. package/dist/improve-core/concept-input.js.map +1 -0
  134. package/dist/improve-core/improve-added-specs.d.ts +62 -0
  135. package/dist/improve-core/improve-added-specs.d.ts.map +1 -0
  136. package/dist/improve-core/improve-added-specs.js +160 -0
  137. package/dist/improve-core/improve-added-specs.js.map +1 -0
  138. package/dist/improve-core/improve-artifacts.d.ts +18 -0
  139. package/dist/improve-core/improve-artifacts.d.ts.map +1 -0
  140. package/dist/improve-core/improve-artifacts.js +4 -0
  141. package/dist/improve-core/improve-artifacts.js.map +1 -0
  142. package/dist/improve-core/improve-concept.d.ts +11 -0
  143. package/dist/improve-core/improve-concept.d.ts.map +1 -0
  144. package/dist/improve-core/improve-concept.js +190 -0
  145. package/dist/improve-core/improve-concept.js.map +1 -0
  146. package/dist/improve-core/improve-discovery.d.ts +84 -0
  147. package/dist/improve-core/improve-discovery.d.ts.map +1 -0
  148. package/dist/improve-core/improve-discovery.js +154 -0
  149. package/dist/improve-core/improve-discovery.js.map +1 -0
  150. package/dist/improve-core/improve-dom-anchor.d.ts.map +1 -0
  151. package/dist/{improve-dom-anchor.js → improve-core/improve-dom-anchor.js} +2 -0
  152. package/dist/improve-core/improve-dom-anchor.js.map +1 -0
  153. package/dist/improve-core/improve-dom-diff.d.ts +59 -0
  154. package/dist/improve-core/improve-dom-diff.d.ts.map +1 -0
  155. package/dist/improve-core/improve-dom-diff.js +151 -0
  156. package/dist/improve-core/improve-dom-diff.js.map +1 -0
  157. package/dist/improve-core/improve-dom-extract.d.ts.map +1 -0
  158. package/dist/{improve-dom-extract.js → improve-core/improve-dom-extract.js} +2 -0
  159. package/dist/improve-core/improve-dom-extract.js.map +1 -0
  160. package/dist/improve-core/improve-dom-gate.d.ts +49 -0
  161. package/dist/improve-core/improve-dom-gate.d.ts.map +1 -0
  162. package/dist/improve-core/improve-dom-gate.js +99 -0
  163. package/dist/improve-core/improve-dom-gate.js.map +1 -0
  164. package/dist/improve-core/improve-dom-neighbour.d.ts.map +1 -0
  165. package/dist/{improve-dom-neighbour.js → improve-core/improve-dom-neighbour.js} +2 -0
  166. package/dist/improve-core/improve-dom-neighbour.js.map +1 -0
  167. package/dist/improve-core/improve-dom-scale.d.ts.map +1 -0
  168. package/dist/{improve-dom-scale.js → improve-core/improve-dom-scale.js} +2 -0
  169. package/dist/improve-core/improve-dom-scale.js.map +1 -0
  170. package/dist/improve-core/improve-icon-svg.d.ts +29 -0
  171. package/dist/improve-core/improve-icon-svg.d.ts.map +1 -0
  172. package/dist/{improve-icon-svg.js → improve-core/improve-icon-svg.js} +2 -0
  173. package/dist/improve-core/improve-icon-svg.js.map +1 -0
  174. package/dist/improve-core/improve-kit-asset-model.d.ts +177 -0
  175. package/dist/improve-core/improve-kit-asset-model.d.ts.map +1 -0
  176. package/dist/improve-core/improve-kit-asset-model.js +269 -0
  177. package/dist/improve-core/improve-kit-asset-model.js.map +1 -0
  178. package/dist/improve-core/improve-layerdoc-diff.d.ts.map +1 -0
  179. package/dist/{improve-layerdoc-diff.js → improve-core/improve-layerdoc-diff.js} +2 -0
  180. package/dist/improve-core/improve-layerdoc-diff.js.map +1 -0
  181. package/dist/{improve-layerdoc-types.d.ts → improve-core/improve-layerdoc-types.d.ts} +9 -0
  182. package/dist/improve-core/improve-layerdoc-types.d.ts.map +1 -0
  183. package/dist/improve-core/improve-layerdoc-types.js +4 -0
  184. package/dist/improve-core/improve-layerdoc-types.js.map +1 -0
  185. package/dist/improve-core/improve-page-words.d.ts +180 -0
  186. package/dist/improve-core/improve-page-words.d.ts.map +1 -0
  187. package/dist/improve-core/improve-page-words.js +303 -0
  188. package/dist/improve-core/improve-page-words.js.map +1 -0
  189. package/dist/{improve-plan-annotated-render.d.ts → improve-core/improve-plan-annotated-render.d.ts} +6 -1
  190. package/dist/improve-core/improve-plan-annotated-render.d.ts.map +1 -0
  191. package/dist/{improve-plan-annotated-render.js → improve-core/improve-plan-annotated-render.js} +56 -28
  192. package/dist/{improve-plan-annotated-render.js.map → improve-core/improve-plan-annotated-render.js.map} +1 -1
  193. package/dist/improve-core/improve-plan-annotator.d.ts +34 -0
  194. package/dist/improve-core/improve-plan-annotator.d.ts.map +1 -0
  195. package/dist/improve-core/improve-plan-annotator.js +52 -0
  196. package/dist/improve-core/improve-plan-annotator.js.map +1 -0
  197. package/dist/{improve-plan-render.d.ts → improve-core/improve-plan-render.d.ts} +2 -1
  198. package/dist/improve-core/improve-plan-render.d.ts.map +1 -0
  199. package/dist/{improve-plan-render.js → improve-core/improve-plan-render.js} +7 -1
  200. package/dist/improve-core/improve-plan-render.js.map +1 -0
  201. package/dist/improve-core/improve-plan-vector-keep.d.ts +29 -0
  202. package/dist/improve-core/improve-plan-vector-keep.d.ts.map +1 -0
  203. package/dist/improve-core/improve-plan-vector-keep.js +68 -0
  204. package/dist/improve-core/improve-plan-vector-keep.js.map +1 -0
  205. package/dist/{improve-raster-layers-section.d.ts → improve-core/improve-raster-layers-section.d.ts} +9 -1
  206. package/dist/improve-core/improve-raster-layers-section.d.ts.map +1 -0
  207. package/dist/{improve-raster-layers-section.js → improve-core/improve-raster-layers-section.js} +5 -2
  208. package/dist/improve-core/improve-raster-layers-section.js.map +1 -0
  209. package/dist/improve-core/improve-refusal.d.ts +6 -0
  210. package/dist/improve-core/improve-refusal.d.ts.map +1 -0
  211. package/dist/improve-core/improve-refusal.js +27 -0
  212. package/dist/improve-core/improve-refusal.js.map +1 -0
  213. package/dist/improve-core/improve-retain.d.ts +121 -0
  214. package/dist/improve-core/improve-retain.d.ts.map +1 -0
  215. package/dist/improve-core/improve-retain.js +115 -0
  216. package/dist/improve-core/improve-retain.js.map +1 -0
  217. package/dist/improve-core/improve-site-plan.d.ts +75 -0
  218. package/dist/improve-core/improve-site-plan.d.ts.map +1 -0
  219. package/dist/improve-core/improve-site-plan.js +135 -0
  220. package/dist/improve-core/improve-site-plan.js.map +1 -0
  221. package/dist/improve-core/improve-site-shell.d.ts +56 -0
  222. package/dist/improve-core/improve-site-shell.d.ts.map +1 -0
  223. package/dist/improve-core/improve-site-shell.js +152 -0
  224. package/dist/improve-core/improve-site-shell.js.map +1 -0
  225. package/dist/improve-core/improve-site-tokens.d.ts +44 -0
  226. package/dist/improve-core/improve-site-tokens.d.ts.map +1 -0
  227. package/dist/improve-core/improve-site-tokens.js +87 -0
  228. package/dist/improve-core/improve-site-tokens.js.map +1 -0
  229. package/dist/improve-core/improve-source-hints.d.ts +25 -0
  230. package/dist/improve-core/improve-source-hints.d.ts.map +1 -0
  231. package/dist/improve-core/improve-source-hints.js +17 -0
  232. package/dist/improve-core/improve-source-hints.js.map +1 -0
  233. package/dist/improve-core/improve-token-patch.d.ts.map +1 -0
  234. package/dist/{improve-token-patch.js → improve-core/improve-token-patch.js} +2 -0
  235. package/dist/improve-core/improve-token-patch.js.map +1 -0
  236. package/dist/improve-core/index.d.ts +47 -0
  237. package/dist/improve-core/index.d.ts.map +1 -0
  238. package/dist/improve-core/index.js +49 -0
  239. package/dist/improve-core/index.js.map +1 -0
  240. package/dist/improve-delivery-stages.d.ts +6 -0
  241. package/dist/improve-delivery-stages.d.ts.map +1 -1
  242. package/dist/improve-delivery-stages.js +87 -6
  243. package/dist/improve-delivery-stages.js.map +1 -1
  244. package/dist/improve-dom-diff.d.ts +8 -24
  245. package/dist/improve-dom-diff.d.ts.map +1 -1
  246. package/dist/improve-dom-diff.js +23 -123
  247. package/dist/improve-dom-diff.js.map +1 -1
  248. package/dist/improve-dom-gate.d.ts +1 -18
  249. package/dist/improve-dom-gate.d.ts.map +1 -1
  250. package/dist/improve-dom-gate.js +1 -46
  251. package/dist/improve-dom-gate.js.map +1 -1
  252. package/dist/improve-generation-stages.d.ts +0 -2
  253. package/dist/improve-generation-stages.d.ts.map +1 -1
  254. package/dist/improve-generation-stages.js +162 -15
  255. package/dist/improve-generation-stages.js.map +1 -1
  256. package/dist/improve-kit-assets.d.ts +8 -116
  257. package/dist/improve-kit-assets.d.ts.map +1 -1
  258. package/dist/improve-kit-assets.js +9 -229
  259. package/dist/improve-kit-assets.js.map +1 -1
  260. package/dist/improve-kit-readme.d.ts +4 -0
  261. package/dist/improve-kit-readme.d.ts.map +1 -1
  262. package/dist/improve-kit-readme.js +57 -16
  263. package/dist/improve-kit-readme.js.map +1 -1
  264. package/dist/improve-kit-stall.d.ts +3 -1
  265. package/dist/improve-kit-stall.d.ts.map +1 -1
  266. package/dist/improve-kit-stall.js +46 -14
  267. package/dist/improve-kit-stall.js.map +1 -1
  268. package/dist/improve-kit-status.d.ts.map +1 -1
  269. package/dist/improve-kit-status.js +8 -3
  270. package/dist/improve-kit-status.js.map +1 -1
  271. package/dist/improve-options.d.ts +8 -0
  272. package/dist/improve-options.d.ts.map +1 -1
  273. package/dist/improve-options.js +92 -12
  274. package/dist/improve-options.js.map +1 -1
  275. package/dist/improve-passthrough-flags.d.ts +8 -0
  276. package/dist/improve-passthrough-flags.d.ts.map +1 -0
  277. package/dist/improve-passthrough-flags.js +11 -0
  278. package/dist/improve-passthrough-flags.js.map +1 -0
  279. package/dist/improve-plan-annotator.d.ts +8 -2
  280. package/dist/improve-plan-annotator.d.ts.map +1 -1
  281. package/dist/improve-plan-annotator.js +35 -38
  282. package/dist/improve-plan-annotator.js.map +1 -1
  283. package/dist/improve-pricing-plan.d.ts +3 -0
  284. package/dist/improve-pricing-plan.d.ts.map +1 -1
  285. package/dist/improve-pricing-plan.js +33 -5
  286. package/dist/improve-pricing-plan.js.map +1 -1
  287. package/dist/improve-recheck.d.ts +9 -0
  288. package/dist/improve-recheck.d.ts.map +1 -0
  289. package/dist/improve-recheck.js +200 -0
  290. package/dist/improve-recheck.js.map +1 -0
  291. package/dist/improve-reset.d.ts.map +1 -1
  292. package/dist/improve-reset.js +11 -0
  293. package/dist/improve-reset.js.map +1 -1
  294. package/dist/improve-run-summary.d.ts +6 -0
  295. package/dist/improve-run-summary.d.ts.map +1 -1
  296. package/dist/improve-run-summary.js +29 -5
  297. package/dist/improve-run-summary.js.map +1 -1
  298. package/dist/improve-site-plan.d.ts +57 -0
  299. package/dist/improve-site-plan.d.ts.map +1 -0
  300. package/dist/improve-site-plan.js +79 -0
  301. package/dist/improve-site-plan.js.map +1 -0
  302. package/dist/improve-site-shell.d.ts +11 -0
  303. package/dist/improve-site-shell.d.ts.map +1 -0
  304. package/dist/improve-site-shell.js +24 -0
  305. package/dist/improve-site-shell.js.map +1 -0
  306. package/dist/improve-site-stage.d.ts +10 -0
  307. package/dist/improve-site-stage.d.ts.map +1 -0
  308. package/dist/improve-site-stage.js +84 -0
  309. package/dist/improve-site-stage.js.map +1 -0
  310. package/dist/improve-site-tokens.d.ts +9 -0
  311. package/dist/improve-site-tokens.d.ts.map +1 -0
  312. package/dist/improve-site-tokens.js +17 -0
  313. package/dist/improve-site-tokens.js.map +1 -0
  314. package/dist/improve-source-hints.d.ts +3 -12
  315. package/dist/improve-source-hints.d.ts.map +1 -1
  316. package/dist/improve-source-hints.js +4 -5
  317. package/dist/improve-source-hints.js.map +1 -1
  318. package/dist/improve-spend-ledger.d.ts +69 -0
  319. package/dist/improve-spend-ledger.d.ts.map +1 -0
  320. package/dist/improve-spend-ledger.js +118 -0
  321. package/dist/improve-spend-ledger.js.map +1 -0
  322. package/dist/improve-stage-runners.d.ts +5 -2
  323. package/dist/improve-stage-runners.d.ts.map +1 -1
  324. package/dist/improve-stage-runners.js +5 -2
  325. package/dist/improve-stage-runners.js.map +1 -1
  326. package/dist/improve-stage-shared.d.ts +10 -1
  327. package/dist/improve-stage-shared.d.ts.map +1 -1
  328. package/dist/improve-stage-shared.js.map +1 -1
  329. package/dist/improve-stop-handler.d.ts +15 -0
  330. package/dist/improve-stop-handler.d.ts.map +1 -1
  331. package/dist/improve-stop-handler.js +74 -3
  332. package/dist/improve-stop-handler.js.map +1 -1
  333. package/dist/improve-terminal-event.d.ts.map +1 -1
  334. package/dist/improve-terminal-event.js +7 -4
  335. package/dist/improve-terminal-event.js.map +1 -1
  336. package/dist/improve-workspace.d.ts +198 -2
  337. package/dist/improve-workspace.d.ts.map +1 -1
  338. package/dist/improve-workspace.js +249 -92
  339. package/dist/improve-workspace.js.map +1 -1
  340. package/dist/legacy-skill-catalog.d.ts.map +1 -1
  341. package/dist/legacy-skill-catalog.js +79 -0
  342. package/dist/legacy-skill-catalog.js.map +1 -1
  343. package/dist/mcp-convert.js +1 -1
  344. package/dist/mcp-convert.js.map +1 -1
  345. package/dist/mcp-tool-definitions.js +1 -1
  346. package/dist/mcp-tool-definitions.js.map +1 -1
  347. package/dist/mcp-tool-handler.d.ts.map +1 -1
  348. package/dist/mcp-tool-handler.js +0 -3
  349. package/dist/mcp-tool-handler.js.map +1 -1
  350. package/dist/redesign-branch-adoption.d.ts +29 -0
  351. package/dist/redesign-branch-adoption.d.ts.map +1 -0
  352. package/dist/redesign-branch-adoption.js +183 -0
  353. package/dist/redesign-branch-adoption.js.map +1 -0
  354. package/dist/redesign-branch-identity.d.ts +23 -0
  355. package/dist/redesign-branch-identity.d.ts.map +1 -0
  356. package/dist/redesign-branch-identity.js +27 -0
  357. package/dist/redesign-branch-identity.js.map +1 -0
  358. package/dist/redesign-branch-record-verification.d.ts +51 -0
  359. package/dist/redesign-branch-record-verification.d.ts.map +1 -0
  360. package/dist/redesign-branch-record-verification.js +127 -0
  361. package/dist/redesign-branch-record-verification.js.map +1 -0
  362. package/dist/redesign-branch-stage.d.ts +17 -0
  363. package/dist/redesign-branch-stage.d.ts.map +1 -0
  364. package/dist/redesign-branch-stage.js +218 -0
  365. package/dist/redesign-branch-stage.js.map +1 -0
  366. package/dist/redesign-capture.d.ts +145 -15
  367. package/dist/redesign-capture.d.ts.map +1 -1
  368. package/dist/redesign-capture.js +182 -71
  369. package/dist/redesign-capture.js.map +1 -1
  370. package/dist/redesign-page-candidates.d.ts +40 -0
  371. package/dist/redesign-page-candidates.d.ts.map +1 -0
  372. package/dist/redesign-page-candidates.js +131 -0
  373. package/dist/redesign-page-candidates.js.map +1 -0
  374. package/dist/redesign-page-ownership.d.ts +36 -0
  375. package/dist/redesign-page-ownership.d.ts.map +1 -0
  376. package/dist/redesign-page-ownership.js +174 -0
  377. package/dist/redesign-page-ownership.js.map +1 -0
  378. package/dist/redesign-plan-identity.d.ts +3 -1
  379. package/dist/redesign-plan-identity.d.ts.map +1 -1
  380. package/dist/redesign-plan-identity.js +4 -1
  381. package/dist/redesign-plan-identity.js.map +1 -1
  382. package/dist/redesign-plan.d.ts.map +1 -1
  383. package/dist/redesign-plan.js +12 -6
  384. package/dist/redesign-plan.js.map +1 -1
  385. package/dist/redesign-record-validation.d.ts +4 -0
  386. package/dist/redesign-record-validation.d.ts.map +1 -0
  387. package/dist/redesign-record-validation.js +210 -0
  388. package/dist/redesign-record-validation.js.map +1 -0
  389. package/dist/redesign-workspace.d.ts +43 -5
  390. package/dist/redesign-workspace.d.ts.map +1 -1
  391. package/dist/redesign-workspace.js +66 -7
  392. package/dist/redesign-workspace.js.map +1 -1
  393. package/dist/responsive-alternative-materializer.d.ts +8 -3
  394. package/dist/responsive-alternative-materializer.d.ts.map +1 -1
  395. package/dist/responsive-alternative-materializer.js +68 -51
  396. package/dist/responsive-alternative-materializer.js.map +1 -1
  397. package/dist/result-integrity.d.ts +38 -0
  398. package/dist/result-integrity.d.ts.map +1 -0
  399. package/dist/result-integrity.js +46 -0
  400. package/dist/result-integrity.js.map +1 -0
  401. package/dist/review-edit-source.d.ts.map +1 -1
  402. package/dist/review-edit-source.js +6 -2
  403. package/dist/review-edit-source.js.map +1 -1
  404. package/dist/review-edit.js +2 -2
  405. package/dist/review-edit.js.map +1 -1
  406. package/dist/review-prototype-gap.js +1 -1
  407. package/dist/review-prototype-gap.js.map +1 -1
  408. package/dist/run-journal.d.ts +3 -1
  409. package/dist/run-journal.d.ts.map +1 -1
  410. package/dist/run-journal.js +7 -1
  411. package/dist/run-journal.js.map +1 -1
  412. package/dist/spend-run-filter.d.ts +21 -0
  413. package/dist/spend-run-filter.d.ts.map +1 -0
  414. package/dist/spend-run-filter.js +67 -0
  415. package/dist/spend-run-filter.js.map +1 -0
  416. package/dist/spend-scoped-report-lines.d.ts +4 -0
  417. package/dist/spend-scoped-report-lines.d.ts.map +1 -0
  418. package/dist/spend-scoped-report-lines.js +46 -0
  419. package/dist/spend-scoped-report-lines.js.map +1 -0
  420. package/dist/spend-scoped-report.d.ts +28 -0
  421. package/dist/spend-scoped-report.d.ts.map +1 -0
  422. package/dist/spend-scoped-report.js +45 -0
  423. package/dist/spend-scoped-report.js.map +1 -0
  424. package/open-design.json +2 -2
  425. package/package.json +5 -5
  426. package/skills/12ui-design/SKILL.md +8 -4
  427. package/skills/12ui-design/improve.md +50 -3
  428. package/dist/improve-dom-anchor.d.ts.map +0 -1
  429. package/dist/improve-dom-anchor.js.map +0 -1
  430. package/dist/improve-dom-extract.d.ts.map +0 -1
  431. package/dist/improve-dom-extract.js.map +0 -1
  432. package/dist/improve-dom-neighbour.d.ts.map +0 -1
  433. package/dist/improve-dom-neighbour.js.map +0 -1
  434. package/dist/improve-dom-scale.d.ts.map +0 -1
  435. package/dist/improve-dom-scale.js.map +0 -1
  436. package/dist/improve-icon-svg.d.ts +0 -47
  437. package/dist/improve-icon-svg.d.ts.map +0 -1
  438. package/dist/improve-icon-svg.js.map +0 -1
  439. package/dist/improve-layerdoc-diff.d.ts.map +0 -1
  440. package/dist/improve-layerdoc-diff.js.map +0 -1
  441. package/dist/improve-layerdoc-types.d.ts.map +0 -1
  442. package/dist/improve-layerdoc-types.js +0 -2
  443. package/dist/improve-layerdoc-types.js.map +0 -1
  444. package/dist/improve-plan-annotated-render.d.ts.map +0 -1
  445. package/dist/improve-plan-render.d.ts.map +0 -1
  446. package/dist/improve-plan-render.js.map +0 -1
  447. package/dist/improve-raster-layers-section.d.ts.map +0 -1
  448. package/dist/improve-raster-layers-section.js.map +0 -1
  449. package/dist/improve-token-patch.d.ts.map +0 -1
  450. package/dist/improve-token-patch.js.map +0 -1
  451. /package/dist/{improve-dom-anchor.d.ts → improve-core/improve-dom-anchor.d.ts} +0 -0
  452. /package/dist/{improve-dom-extract.d.ts → improve-core/improve-dom-extract.d.ts} +0 -0
  453. /package/dist/{improve-dom-neighbour.d.ts → improve-core/improve-dom-neighbour.d.ts} +0 -0
  454. /package/dist/{improve-dom-scale.d.ts → improve-core/improve-dom-scale.d.ts} +0 -0
  455. /package/dist/{improve-layerdoc-diff.d.ts → improve-core/improve-layerdoc-diff.d.ts} +0 -0
  456. /package/dist/{improve-token-patch.d.ts → improve-core/improve-token-patch.d.ts} +0 -0
@@ -0,0 +1,160 @@
1
+ // GENERATED — do not edit. Copied verbatim from
2
+ // packages/layerdoc/src/improve-core by scripts/sync-improve-core.mjs.
3
+ import { insertionAnchor, selectorLabel, domPx } from './improve-dom-anchor.js';
4
+ import { improveIconSvgVariants } from './improve-icon-svg.js';
5
+ /** Flatten target leaves while retaining group ancestry for sibling placement. */
6
+ export const flattenImproveHierarchy = (document) => {
7
+ const layers = document && typeof document === 'object' && 'layers' in document
8
+ && Array.isArray(document.layers) ? document.layers : [];
9
+ const output = [];
10
+ const visit = (nodes, parents) => {
11
+ nodes.forEach((node, index) => {
12
+ if (!node || typeof node !== 'object')
13
+ return;
14
+ const leaf = node;
15
+ if (leaf.kind === 'group' && Array.isArray(leaf.children)) {
16
+ visit(leaf.children, [...parents, `${leaf.name ?? 'group'}[${index}]`]);
17
+ }
18
+ else
19
+ output.push({ leaf, parentPath: parents });
20
+ });
21
+ };
22
+ visit(layers, []);
23
+ return output;
24
+ };
25
+ const commonDepth = (left, right) => {
26
+ let index = 0;
27
+ while (index < left.length && left[index] === right[index])
28
+ index += 1;
29
+ return index;
30
+ };
31
+ const insertionFor = (args) => {
32
+ const target = args.normalizedTarget[args.designIndex];
33
+ const siblings = args.diff.matched.filter((entry) => args.before[entry.beforeIndex]?.dom)
34
+ .map((entry) => ({
35
+ entry,
36
+ depth: commonDepth(args.hierarchy[args.designIndex]?.parentPath ?? [], args.hierarchy[entry.afterIndex]?.parentPath ?? []),
37
+ distance: target?.box && args.normalizedTarget[entry.afterIndex]?.box
38
+ ? Math.hypot(target.box[0] - args.normalizedTarget[entry.afterIndex].box[0], target.box[1] - args.normalizedTarget[entry.afterIndex].box[1])
39
+ : Number.POSITIVE_INFINITY,
40
+ }))
41
+ .sort((left, right) => right.depth - left.depth || left.distance - right.distance);
42
+ const sibling = siblings[0];
43
+ if (sibling) {
44
+ const siblingBox = args.normalizedTarget[sibling.entry.afterIndex]?.box;
45
+ const relation = target?.box && siblingBox
46
+ && (target.box[1] < siblingBox[1] || (target.box[1] === siblingBox[1] && target.box[0] < siblingBox[0]))
47
+ ? 'before'
48
+ : 'after';
49
+ return `${relation} ${selectorLabel(args.before[sibling.entry.beforeIndex])}`;
50
+ }
51
+ if (target?.box) {
52
+ const fallback = insertionAnchor(target.box, args.before);
53
+ if (fallback.container >= 0)
54
+ return `inside ${selectorLabel(args.before[fallback.container])}`;
55
+ }
56
+ return 'unresolved — no matched parent or sibling selector';
57
+ };
58
+ const shown = (value, suffix = '') => value === undefined || value === null || value === ''
59
+ ? 'not specified'
60
+ : `${typeof value === 'object' ? JSON.stringify(value) : String(value)}${suffix}`;
61
+ /** Preference order for the extracted artifact a plan should hand a coder. */
62
+ export const improveArtifactIds = (leaf) => {
63
+ const artifacts = leaf.artifacts;
64
+ if (!artifacts || typeof artifacts !== 'object' || Array.isArray(artifacts))
65
+ return [];
66
+ const preference = ['cutout', 'region2x', 'crop'];
67
+ return Object.entries(artifacts).flatMap(([name, value]) => (value && typeof value === 'object' && !Array.isArray(value)
68
+ && typeof value.artifactId === 'string'
69
+ ? [{ name, id: value.artifactId }]
70
+ : [])).sort((left, right) => {
71
+ const leftIndex = preference.indexOf(left.name);
72
+ const rightIndex = preference.indexOf(right.name);
73
+ return (leftIndex < 0 ? preference.length : leftIndex)
74
+ - (rightIndex < 0 ? preference.length : rightIndex);
75
+ }).map((entry) => entry.id);
76
+ };
77
+ const svgAssetStem = (designIndex, leaf) => (`added-${String(designIndex).padStart(3, '0')}-${(leaf.content ?? 'icon')
78
+ .toLowerCase().replace(/[^a-z0-9]+/gu, '-').replace(/^-+|-+$/gu, '') || 'icon'}`);
79
+ /**
80
+ * Every target leaf the diff never matched, with the full specification a coder
81
+ * needs to build it: where it goes relative to a real selector, its complete
82
+ * typography and style map, and the asset it references. Inline `iconSvg` is
83
+ * materialized into the returned `files` map rather than written here, so the
84
+ * CLI and the browser produce the same bytes at the same relative path.
85
+ */
86
+ export const buildImproveAddedElementSpecs = (args) => {
87
+ const hierarchy = flattenImproveHierarchy(args.targetDoc);
88
+ const matched = new Set(args.diff.matched.map((entry) => entry.afterIndex));
89
+ const specs = [];
90
+ const files = {};
91
+ for (const [designIndex, entry] of hierarchy.entries()) {
92
+ if (matched.has(designIndex))
93
+ continue;
94
+ const leaf = entry.leaf;
95
+ const ids = improveArtifactIds(leaf);
96
+ let asset = ids.length === 0
97
+ ? undefined
98
+ : args.resolveAsset?.(ids)
99
+ ?? { kind: `unresolved extracted artifact (${ids.join(', ')})`, resolvable: false };
100
+ if (typeof leaf.iconSvg === 'string' && leaf.iconSvg.trim()) {
101
+ // A single `currentColor` file rendered black wherever the kit told a
102
+ // lane to put it (F30). The layer declares its colour, so both forms are
103
+ // written and the spec says which is which.
104
+ const variants = improveIconSvgVariants({
105
+ svg: leaf.iconSvg,
106
+ color: leaf.color,
107
+ stem: svgAssetStem(designIndex, leaf),
108
+ });
109
+ for (const file of variants.files)
110
+ files[`assets/${file.name}`] = `${file.svg}\n`;
111
+ const inline = variants.inline && variants.inline.name !== variants.primary.name
112
+ ? {
113
+ path: args.describePath(`assets/${variants.inline.name}`),
114
+ destination: `src/assets/design/${variants.inline.name}`,
115
+ }
116
+ : undefined;
117
+ asset = {
118
+ kind: variants.color
119
+ ? `inline iconSvg materialized as SVG, painted ${variants.color}`
120
+ : 'inline iconSvg materialized as SVG',
121
+ path: args.describePath(`assets/${variants.primary.name}`),
122
+ destination: `src/assets/design/${variants.primary.name}`,
123
+ resolvable: true,
124
+ usage: variants.primary.usage,
125
+ ...(inline ? { inline } : {}),
126
+ colorNote: variants.note,
127
+ };
128
+ }
129
+ const insertion = insertionFor({
130
+ designIndex,
131
+ hierarchy,
132
+ normalizedTarget: args.normalizedTarget,
133
+ before: args.before,
134
+ diff: args.diff,
135
+ });
136
+ const markdown = [
137
+ `### Added ${designIndex}: ${leaf.kind ?? 'layer'} — ${shown(leaf.content)}`,
138
+ '',
139
+ `- Kind: \`${leaf.kind ?? 'layer'}\``,
140
+ `- Content: ${shown(leaf.content)}`,
141
+ `- Box: target-design px ${shown(leaf.box)}; DOM-frame px ${shown(domPx(args.normalizedTarget[designIndex]?.box, args.canvas))}`,
142
+ `- Insert: ${insertion}`,
143
+ `- Typography: font-family ${shown(leaf.googleFontFamily)}; font-size ${shown(leaf.fontSizePx, leaf.fontSizePx === undefined ? '' : 'px')}; fitted-font-size ${shown(leaf.fittedFontSizePx, leaf.fittedFontSizePx === undefined ? '' : 'px')}; font-weight ${shown(leaf.fontWeight)}; color ${shown(leaf.color)}; align ${shown(leaf.align)}`,
144
+ `- Style map: \`${JSON.stringify(leaf.style ?? {})}\``,
145
+ `- Visual fields: surface ${shown(leaf.surface)}; opacity ${shown(leaf.opacity)}; rotation ${shown(leaf.rotationDeg, leaf.rotationDeg === undefined ? '' : 'deg')}`,
146
+ asset?.path
147
+ ? `- Asset: ${asset.kind}; absolute path \`${asset.path}\`; suggested destination \`${asset.destination}\`; resolvable: yes`
148
+ : asset
149
+ ? `- Asset: ${asset.kind}; absolute path unresolved; suggested destination unresolved; resolvable: no`
150
+ : '- Asset: none referenced by the target node',
151
+ ...(asset?.inline
152
+ ? [`- Inline variant: absolute path \`${asset.inline.path}\`; suggested destination \`${asset.inline.destination}\``]
153
+ : []),
154
+ ...(asset?.colorNote ? [`- Colour: ${asset.colorNote}`] : []),
155
+ ].join('\n');
156
+ specs.push({ designIndex, insertion, markdown, ...(asset ? { asset } : {}) });
157
+ }
158
+ return { specs, files };
159
+ };
160
+ //# sourceMappingURL=improve-added-specs.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"improve-added-specs.js","sourceRoot":"","sources":["../../src/improve-core/improve-added-specs.ts"],"names":[],"mappings":"AAAA,gDAAgD;AAChD,uEAAuE;AAEvE,OAAO,EAAE,eAAe,EAAE,aAAa,EAAE,KAAK,EAAE,MAAM,yBAAyB,CAAC;AAChF,OAAO,EAAE,sBAAsB,EAAE,MAAM,uBAAuB,CAAC;AAmC/D,kFAAkF;AAClF,MAAM,CAAC,MAAM,uBAAuB,GAAG,CAAC,QAAiB,EAAmB,EAAE;IAC5E,MAAM,MAAM,GAAG,QAAQ,IAAI,OAAO,QAAQ,KAAK,QAAQ,IAAI,QAAQ,IAAI,QAAQ;WAC1E,KAAK,CAAC,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC;IAC3D,MAAM,MAAM,GAAoB,EAAE,CAAC;IACnC,MAAM,KAAK,GAAG,CAAC,KAAgB,EAAE,OAAiB,EAAQ,EAAE;QAC1D,KAAK,CAAC,OAAO,CAAC,CAAC,IAAI,EAAE,KAAK,EAAE,EAAE;YAC5B,IAAI,CAAC,IAAI,IAAI,OAAO,IAAI,KAAK,QAAQ;gBAAE,OAAO;YAC9C,MAAM,IA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L,CAAC,CAAC,YAAY,KAAK,CAAC,IAAI,8EAA8E;oBACxG,CAAC,CAAC,6CAA6C;YACjD,GAAG,CAAC,KAAK,EAAE,MAAM;gBACf,CAAC,CAAC,CAAC,qCAAqC,KAAK,CAAC,MAAM,CAAC,IAAI,+BAA+B,KAAK,CAAC,MAAM,CAAC,WAAW,IAAI,CAAC;gBACrH,CAAC,CAAC,EAAE,CAAC;YACP,GAAG,CAAC,KAAK,EAAE,SAAS,CAAC,CAAC,CAAC,CAAC,aAAa,KAAK,CAAC,SAAS,EAAE,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;SAC9D,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QACb,KAAK,CAAC,IAAI,CAAC,EAAE,WAAW,EAAE,SAAS,EAAE,QAAQ,EAAE,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC;IAChF,CAAC;IACD,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,CAAC;AAC1B,CAAC,CAAC"}
@@ -0,0 +1,18 @@
1
+ /**
2
+ * The plan core never touches a filesystem: it returns the kit it wants to
3
+ * exist and lets the caller realize it. The CLI writes the map under a run
4
+ * directory; the web page zips the same map. One policy module, two hosts,
5
+ * byte-identical artifacts for the same inputs.
6
+ *
7
+ * Keys are relative POSIX paths inside the directory the caller names — never
8
+ * absolute, never `..`. `remove` lists the relative paths a previous run may
9
+ * have left behind that this run's state invalidates (a passing gate deletes
10
+ * `GATE.md`; a blocked gate deletes the plan it must not imply).
11
+ */
12
+ export type ImproveArtifactMap = {
13
+ files: Record<string, string | Uint8Array>;
14
+ remove: string[];
15
+ };
16
+ /** A caller-supplied way to name a relative artifact in rendered prose. */
17
+ export type ImproveDescribePath = (relativePath: string) => string;
18
+ //# sourceMappingURL=improve-artifacts.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"improve-artifacts.d.ts","sourceRoot":"","sources":["../../src/improve-core/improve-artifacts.ts"],"names":[],"mappings":"AAGA;;;;;;;;;;GAUG;AACH,MAAM,MAAM,kBAAkB,GAAG;IAC/B,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,UAAU,CAAC,CAAC;IAC3C,MAAM,EAAE,MAAM,EAAE,CAAC;CAClB,CAAC;AAEF,2EAA2E;AAC3E,MAAM,MAAM,mBAAmB,GAAG,CAAC,YAAY,EAAE,MAAM,KAAK,MAAM,CAAC"}
@@ -0,0 +1,4 @@
1
+ // GENERATED — do not edit. Copied verbatim from
2
+ // packages/layerdoc/src/improve-core by scripts/sync-improve-core.mjs.
3
+ export {};
4
+ //# sourceMappingURL=improve-artifacts.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"improve-artifacts.js","sourceRoot":"","sources":["../../src/improve-core/improve-artifacts.ts"],"names":[],"mappings":"AAAA,gDAAgD;AAChD,uEAAuE"}
@@ -0,0 +1,11 @@
1
+ import { type ImproveRetainPolicy } from './improve-retain.js';
2
+ /**
3
+ * The promised 600-character steering limit, bounded by the room left after
4
+ * the longest mandatory harness. Shortening a harness must not silently make
5
+ * the CLI and web limits disagree with this shared owner.
6
+ */
7
+ export declare const IMPROVE_DIRECTION_MAX_CHARACTERS: number;
8
+ /** Where cut detail belongs, stated once for the refusal and the skill. */
9
+ export declare const IMPROVE_DIRECTION_TRIM_HINT: string;
10
+ export declare const buildImproveConcept: (direction?: string, retain?: ImproveRetainPolicy) => string;
11
+ //# sourceMappingURL=improve-concept.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"improve-concept.d.ts","sourceRoot":"","sources":["../../src/improve-core/improve-concept.ts"],"names":[],"mappings":"AASA,OAAO,EAIL,KAAK,mBAAmB,EACzB,MAAM,qBAAqB,CAAC;AAgJ7B;;;;GAIG;AACH,eAAO,MAAM,gCAAgC,QAG5C,CAAC;AAEF,2EAA2E;AAC3E,eAAO,MAAM,2BAA2B,QACG,CAAC;AAS5C,eAAO,MAAM,mBAAmB,GAC9B,YAAY,MAAM,EAClB,SAAQ,mBAA4C,KACnD,MA+CF,CAAC"}
@@ -0,0 +1,190 @@
1
+ // GENERATED — do not edit. Copied verbatim from
2
+ // packages/layerdoc/src/improve-core by scripts/sync-improve-core.mjs.
3
+ import { conceptCharacterCount, conceptOverLimitMessage, MAX_CONCEPT_CHARACTERS, readConceptValue, } from './concept-input.js';
4
+ import { DEFAULT_IMPROVE_RETAIN, IMPROVE_RETAIN_FACETS, improveRetainKeeps, } from './improve-retain.js';
5
+ import { ImproveRefusal } from './improve-refusal.js';
6
+ /**
7
+ * THE BRIEF LEADS, AND THE CLAUSES AROUND IT SCALE WITH THE TOGGLES (owner,
8
+ * 2026-09-02).
9
+ *
10
+ * The harness used to SANDWICH the brief: a fixed three-sentence "preserve its
11
+ * product identity and working structure" paragraph first, the user's brief as
12
+ * one `Direction:` line in the middle, and one no-invention clause last — the
13
+ * same three sentences no matter what the run was retaining. The owner asked
14
+ * for "a modern minimal saas with line art imagery" and got his own page with
15
+ * a slightly different background, which is what that sandwich asks for.
16
+ *
17
+ * So the brief goes first, and every sentence after it is chosen by a retain
18
+ * facet the service already understands:
19
+ * layout — is the page redrawn, or lifted where it stands?
20
+ * style — is there a new visual system, or is the existing one sharpened?
21
+ * assets — is the brand held?
22
+ * content — are the words held, or may they be rewritten?
23
+ * Nothing here invents a policy: turn a toggle and exactly one sentence
24
+ * changes, so what the visitor set is what the model is told.
25
+ *
26
+ * ONE THING IS NOT A TOGGLE. No combination licenses inventing a product fact.
27
+ * With copy held that is "say the same things"; with copy free, only the
28
+ * product's identity remains a conservation floor and the brief decides how
29
+ * much other text survives. That lets "limited text" mean limited text without
30
+ * turning the screen into a different product (CLAUDE.md item 8).
31
+ */
32
+ /**
33
+ * ALL FOUR TOGGLES ON IS THE POLISH POSTURE, NOT A FREEZE (owner, 2026-09-02,
34
+ * direct chat with a screenshot): "Selecting all the options results in no
35
+ * changes?" — chargedesk.com, brief "Modern minimal saas with line art", four
36
+ * candidates indistinguishable from the live page.
37
+ *
38
+ * They were indistinguishable because the assembly asked for that. `layout`
39
+ * kept said "the position of everything on it exactly where they are";
40
+ * `style` kept said the palette, typography and texture were fixed while the
41
+ * server's retain clause simultaneously promised back "spacing rhythm …
42
+ * texture and ink … and polish". Between them the two mandates named every
43
+ * axis a design has, and an image edit given a full freeze returns its input.
44
+ *
45
+ * So each mandate now separates what it HOLDS from what it may still IMPROVE,
46
+ * and says so in the same breath — a person who turns everything on is asking
47
+ * for their page polished, not photocopied.
48
+ */
49
+ const LAYOUT_MANDATE = {
50
+ keep: 'Improve this existing product interface into a production-ready version of itself, keeping its layout and section order: nothing moves to a new place, though spacing and alignment may be tightened.',
51
+ free: 'Redesign this existing product interface. Its layout, composition, section order, and proportions are yours to rework: this should read as a new design of the same product, not a retouch of the one it has.',
52
+ };
53
+ /**
54
+ * A STYLE HAS AN IDENTITY AND IT HAS A FINISH. The identity is what makes the
55
+ * page recognisably this product's — its palette, its typography voice, its
56
+ * image treatment. The finish is spacing rhythm, alignment, surfaces, control
57
+ * affordances, ink and type rendering: what a designer tidies without anyone
58
+ * saying the brand changed. "Keep style" keeps the identity; the finish is
59
+ * exactly what an improvement is for.
60
+ *
61
+ * These are the same words the service's retain clause uses for a retained
62
+ * `style` on a subject run (`workers/api/src/create/retain.ts`), because the
63
+ * harness sentence the toggle picks and the retain clause the toggle produces
64
+ * must not tell the model two different things.
65
+ */
66
+ const STYLE_MANDATE = {
67
+ keep: 'Work inside its existing visual language: its palette, typography voice, and image treatment stay, and everything around them is sharpened - spacing rhythm, alignment, surfaces, control affordances, ink, and type rendering.',
68
+ free: 'Give it a deliberate hierarchy, a real spacing rhythm, typography with range, restrained color, purposeful states, and surfaces and controls that belong to one system.',
69
+ };
70
+ const BRAND_CLAUSE = "Keep the product's logo, wordmark, and brand imagery as they are.";
71
+ /**
72
+ * THE TOGGLES ARE CONSERVATION DEFAULTS AND THE BRIEF OUTRANKS THEM (owner,
73
+ * 2026-09-02: "Maybe the wording becomes keep xyz PROVIDING it doesn't
74
+ * conflict with the prompt?").
75
+ *
76
+ * Read as absolutes, four "keep" sentences and one brief can only contradict
77
+ * each other, and an image edit resolves a contradiction the safe way: it
78
+ * returns its input. That is the whole of the owner's chargedesk report —
79
+ * "Modern minimal saas with line art" against a gold bokeh photograph, all
80
+ * four toggles on, four candidates indistinguishable from the live page. The
81
+ * brief asked for a different visual world and every other sentence said
82
+ * nothing may change.
83
+ *
84
+ * So there is a precedence order and it is stated ONCE, not bolted onto each
85
+ * facet as a caveat: the brief beats the toggles, and the toggles beat the
86
+ * page as it stands. A brief that asks for nothing in particular — the empty
87
+ * brief's neutral head — outranks nothing, so everything stays kept. This is
88
+ * the same rule the service states in its retain clause
89
+ * (`workers/api/src/create/retain.ts`), so the concept and the retain clause
90
+ * cannot tell the model two different things.
91
+ *
92
+ * IT IS THE SHORT FORM HERE ON PURPOSE. Every character this harness spends is
93
+ * a character taken off the brief a visitor may type
94
+ * (`IMPROVE_DIRECTION_MAX_CHARACTERS` below), and the service states the same
95
+ * rule at full length in the retain clause of the very same prompt. So the
96
+ * concept carries the rule, not the essay.
97
+ */
98
+ const PRECEDENCE_RULE = 'These are conservation defaults, not a freeze:'
99
+ + ' the brief above outranks them, and they outrank the page as it stands.';
100
+ const CONTENT_CLAUSE = {
101
+ keep: 'Keep every real piece of content, data, and control the page carries: say the same things, in whatever arrangement serves them best, and invent nothing.',
102
+ free: 'Keep only the same product: its name and wordmark, and what it is. The brief decides how much of the page\'s other text and control copy survives; invent no product facts, features, prices, or data.',
103
+ };
104
+ /**
105
+ * THE BRIEF IS THE HEAD, NOT A LABELLED FIELD.
106
+ *
107
+ * Both templates that consume a concept put it in a `for <noun phrase>` slot
108
+ * or after a label of their own: the draft prompt reads "Create one
109
+ * distinctive desktop interface for {concept}." and the improve generation
110
+ * prompt reads "Improvement direction: {concept}". A concept that carried its
111
+ * own `Direction: ` label produced "for Direction: A modern minimal saas …"
112
+ * and "Improvement direction: Direction: …" — one label too many, and a head
113
+ * that is not a noun phrase. So the brief leads bare, and with no brief the
114
+ * head is the run's own subject.
115
+ */
116
+ const NO_BRIEF_HEAD = "a better version of this product's own page";
117
+ /**
118
+ * THE BRIEF NEEDS AN END. Paragraph breaks do not survive the wire: the
119
+ * service normalizes every run of whitespace to a single space before it
120
+ * measures or stores a concept (`cleanText`, workers/api validation), so the
121
+ * blank line this harness used to put around the brief reached the model as
122
+ * one space. With the brief leading and a mandate right behind it, a brief
123
+ * that does not punctuate itself would run straight into that mandate.
124
+ */
125
+ const terminated = (steering) => (/[.!?:;]$/u.test(steering) ? steering : `${steering}.`);
126
+ /**
127
+ * The steering limit must not depend on the toggles, or a brief a visitor
128
+ * typed would be refused by flipping a switch. Reserve the LONGEST assembly —
129
+ * plus the terminator a brief may be given — so every retain set accepts the
130
+ * same brief.
131
+ */
132
+ const longest = (choice) => (Math.max(choice.keep.length, choice.free.length));
133
+ const RESERVED_CONCEPT_CHARACTERS = 1 + BRAND_CLAUSE.length + PRECEDENCE_RULE.length
134
+ + longest(LAYOUT_MANDATE) + longest(STYLE_MANDATE) + longest(CONTENT_CLAUSE) + 8;
135
+ /**
136
+ * The promised 600-character steering limit, bounded by the room left after
137
+ * the longest mandatory harness. Shortening a harness must not silently make
138
+ * the CLI and web limits disagree with this shared owner.
139
+ */
140
+ export const IMPROVE_DIRECTION_MAX_CHARACTERS = Math.min(600, MAX_CONCEPT_CHARACTERS - RESERVED_CONCEPT_CHARACTERS);
141
+ /** Where cut detail belongs, stated once for the refusal and the skill. */
142
+ export const IMPROVE_DIRECTION_TRIM_HINT = 'Keep the intended hierarchy, rhythm, typography,'
143
+ + ' surfaces, color, controls, and mood.';
144
+ /**
145
+ * F9 found that detailed, style-anchored direction reliably beats a vague
146
+ * "make it better" instruction. Naming an empty or thin region as the defect
147
+ * did the opposite: the image model filled it with invented product content.
148
+ */
149
+ const FABRICATION_TRIGGER = /\b(?:empty|emptiness|underfilled|under-filled|thin[ -]content|lack of content|missing content|dead space|blank (?:area|region|half|section))\b/iu;
150
+ export const buildImproveConcept = (direction, retain = DEFAULT_IMPROVE_RETAIN) => {
151
+ const steering = direction?.replace(/\s+/gu, ' ').trim() ?? '';
152
+ // F7 (wave-2, 2026-09-03): naming only the cap cost two lanes their first
153
+ // command each — the refusal has to name the length of what was written, so
154
+ // the direction can be fixed in one edit rather than counted by hand.
155
+ if (conceptCharacterCount(steering) > IMPROVE_DIRECTION_MAX_CHARACTERS) {
156
+ throw new ImproveRefusal(conceptOverLimitMessage({
157
+ flag: '--direction',
158
+ raw: direction ?? '',
159
+ normalized: steering,
160
+ limit: IMPROVE_DIRECTION_MAX_CHARACTERS,
161
+ because: `improve reserves the other ${RESERVED_CONCEPT_CHARACTERS} of the`
162
+ + ` ${MAX_CONCEPT_CHARACTERS}-character concept for its retain mandates and`
163
+ + ' no-invention guardrails, so --direction is what is left.',
164
+ trimHint: IMPROVE_DIRECTION_TRIM_HINT,
165
+ }), 'improve_direction_too_long');
166
+ }
167
+ if (FABRICATION_TRIGGER.test(steering)) {
168
+ throw new ImproveRefusal('--direction must describe the intended style and hierarchy, not emptiness or thin content;'
169
+ + ' naming a content void invites fabricated UI.', 'improve_direction_emptiness');
170
+ }
171
+ const pick = (facet, choice) => (improveRetainKeeps(retain, facet) ? choice.keep : choice.free);
172
+ // With nothing kept there is no conservation for the brief to outrank, so
173
+ // the rule would be a sentence about nothing.
174
+ const keepsAnything = IMPROVE_RETAIN_FACETS.some((facet) => improveRetainKeeps(retain, facet));
175
+ const concept = [
176
+ terminated(steering || NO_BRIEF_HEAD),
177
+ [pick('layout', LAYOUT_MANDATE), pick('style', STYLE_MANDATE)].join(' '),
178
+ [
179
+ ...(improveRetainKeeps(retain, 'assets') ? [BRAND_CLAUSE] : []),
180
+ pick('content', CONTENT_CLAUSE),
181
+ ].join(' '),
182
+ ...(keepsAnything ? [PRECEDENCE_RULE] : []),
183
+ ].join('\n\n');
184
+ return readConceptValue({
185
+ value: concept,
186
+ flag: '--direction',
187
+ trimHint: IMPROVE_DIRECTION_TRIM_HINT,
188
+ });
189
+ };
190
+ //# sourceMappingURL=improve-concept.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"improve-concept.js","sourceRoot":"","sources":["../../src/improve-core/improve-concept.ts"],"names":[],"mappings":"AAAA,gDAAgD;AAChD,uEAAuE;AAEvE,OAAO,EACL,qBAAqB,EACrB,uBAAuB,EACvB,sBAAsB,EACtB,gBAAgB,GACjB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EACL,sBAAsB,EACtB,qBAAqB,EACrB,kBAAkB,GAEnB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAEtD;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH;;;;;;;;;;;;;;;;GAgBG;AACH,MAAM,cAAc,GAAG;IACrB,IAAI,EAAE,uMAAuM;IAC7M,IAAI,EAAE,+MAA+M;CAC7M,CAAC;AAEX;;;;;;;;;;;;GAYG;AACH,MAAM,aAAa,GAAG;IACpB,IAAI,EAAE,iOAAiO;IACvO,IAAI,EAAE,yKAAyK;CACvK,CAAC;AAEX,MAAM,YAAY,GAAG,mEAAmE,CAAC;AAEzF;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,MAAM,eAAe,GAAG,gDAAgD;MACpE,yEAAyE,CAAC;AAE9E,MAAM,cAAc,GAAG;IACrB,IAAI,EAAE,0JAA0J;IAChK,IAAI,EAAE,wMAAwM;CACtM,CAAC;AAEX;;;;;;;;;;;GAWG;AACH,MAAM,aAAa,GAAG,6CAA6C,CAAC;AAEpE;;;;;;;GAOG;AACH,MAAM,UAAU,GAAG,CAAC,QAAgB,EAAU,EAAE,CAAC,CAC/C,WAAW,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,GAAG,QAAQ,GAAG,CACvD,CAAC;AAEF;;;;;GAKG;AACH,MAAM,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* Page discovery policy for improve: which same-origin pages a site's root
3
+ * claims are its key screens, and in what order.
4
+ *
5
+ * ONE RANKER, TWO HOSTS. The hosted capture service renders the root in
6
+ * Playwright and collects layout facts (`collectRenderedLinksInPage`); the CLI
7
+ * reads the root's HTML and collects the structural facts a parsed document
8
+ * can state (`collectLinksFromDocument`). Both hand the same fact shape to
9
+ * `rankRenderedLinks`, so the two products cannot disagree about ordering
10
+ * policy — only about how much the page told them.
11
+ *
12
+ * WHY RANK AT ALL. Scoping discovery to `nav`/`header`/`footer` loses whole
13
+ * sites: chargedesk.com states 112 same-origin links, every one of them in
14
+ * div chrome, and landmark-scoped discovery captured the root alone (owner
15
+ * report 2026-09-02). Nothing is dropped here; links are ordered and the
16
+ * caller's `maxPages` cap decides how deep it goes.
17
+ *
18
+ * Every fact is one the page declared or the browser measured — no guessing
19
+ * at a link's importance from its text (CLAUDE.md item 8).
20
+ */
21
+ /** Pages captured for a site when the caller states no cap (root included). */
22
+ export declare const IMPROVE_DISCOVERY_DEFAULT_MAX_PAGES = 5;
23
+ /**
24
+ * Landmark chrome: where a site states its own key screens. Mirrored as a
25
+ * literal inside `collectRenderedLinksInPage` because Playwright serializes
26
+ * that function into the page — see the note there.
27
+ */
28
+ export declare const CHROME_LANDMARK_SELECTOR = "nav, header, footer, [role=\"navigation\"], [role=\"banner\"], [role=\"contentinfo\"]";
29
+ /** What one anchor told us. Absent facts mean "not measured", never "false". */
30
+ export type DiscoveredLinkFacts = {
31
+ href: string;
32
+ /** Inside a landmark element (`CHROME_LANDMARK_SELECTOR`). */
33
+ chrome?: boolean;
34
+ /** Document-space top of the anchor's rect; absent when nothing laid the page out. */
35
+ y?: number;
36
+ /** Rendered with a non-zero box; absent when nothing laid the page out. */
37
+ visible?: boolean;
38
+ };
39
+ export type DiscoveredLinkCollection = {
40
+ /** Full document height, so the bottom band can be measured from the end. */
41
+ docHeight: number;
42
+ links: DiscoveredLinkFacts[];
43
+ };
44
+ /**
45
+ * Runs inside the rendered page: every anchor with its landmark and layout
46
+ * facts. Playwright serializes this function, so it must be self-contained —
47
+ * no module-scope references survive `page.evaluate`. The landmark selector is
48
+ * therefore repeated here as a literal; `improve-discovery.test.ts` asserts it
49
+ * still matches `CHROME_LANDMARK_SELECTOR`.
50
+ */
51
+ export declare const collectRenderedLinksInPage: () => unknown;
52
+ /**
53
+ * The minimum a parsed (unrendered) document has to offer. Typed structurally
54
+ * so a `linkedom` document satisfies it without this pure module importing a
55
+ * DOM implementation.
56
+ */
57
+ export type StaticAnchorElement = {
58
+ getAttribute: (name: string) => string | null | undefined;
59
+ closest: (selectors: string) => unknown;
60
+ };
61
+ export type StaticLinkDocument = {
62
+ /** `ArrayLike`, not `Iterable`: a `linkedom` NodeList satisfies the former. */
63
+ querySelectorAll: (selectors: string) => ArrayLike<StaticAnchorElement>;
64
+ };
65
+ /**
66
+ * The same facts from a parsed document: landmark membership is declared in
67
+ * the markup, position and visibility are not, so they are left absent rather
68
+ * than invented. Absent position ranks a link in the body tier, where document
69
+ * order decides — the only positional fact static HTML actually states.
70
+ */
71
+ export declare const collectLinksFromDocument: (document: StaticLinkDocument) => DiscoveredLinkCollection;
72
+ /**
73
+ * Orders links by how likely they are to be a key screen: landmark chrome
74
+ * first, then the top band (div headers), then the bottom band (div footers),
75
+ * then body links — visible before hidden within a tier, account plumbing
76
+ * last. Document order breaks every remaining tie.
77
+ *
78
+ * Accepts a collection, a bare fact list, or plain href strings (no facts →
79
+ * body tier, document order), so a caller that measured nothing still works.
80
+ */
81
+ export declare const rankRenderedLinks: (input: DiscoveredLinkCollection | readonly DiscoveredLinkFacts[] | readonly string[] | null | undefined) => string[];
82
+ /** Homepage first, then ranked same-origin links, one per pathname, capped. */
83
+ export declare const discoverSameOriginPages: (rootUrl: string, hrefs: readonly string[], maxPages?: number) => string[];
84
+ //# sourceMappingURL=improve-discovery.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"improve-discovery.d.ts","sourceRoot":"","sources":["../../src/improve-core/improve-discov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