@12ui/design 0.2.56 → 0.2.58

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 (429) 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/branch-client.d.ts +86 -2
  6. package/dist/branch-client.d.ts.map +1 -1
  7. package/dist/branch-client.js +31 -0
  8. package/dist/branch-client.js.map +1 -1
  9. package/dist/cli-arguments.d.ts.map +1 -1
  10. package/dist/cli-arguments.js +3 -1
  11. package/dist/cli-arguments.js.map +1 -1
  12. package/dist/cli-capabilities.d.ts +1 -1
  13. package/dist/cli-conversion-derivation.js +2 -2
  14. package/dist/cli-conversion-derivation.js.map +1 -1
  15. package/dist/cli-convert-command.d.ts +2 -0
  16. package/dist/cli-convert-command.d.ts.map +1 -1
  17. package/dist/cli-convert-command.js +176 -38
  18. package/dist/cli-convert-command.js.map +1 -1
  19. package/dist/cli-corpus-command.js +2 -2
  20. package/dist/cli-corpus-command.js.map +1 -1
  21. package/dist/cli-corpus-evidence.d.ts.map +1 -1
  22. package/dist/cli-corpus-evidence.js +2 -1
  23. package/dist/cli-corpus-evidence.js.map +1 -1
  24. package/dist/cli-corpus-reference-downloads.d.ts +1 -0
  25. package/dist/cli-corpus-reference-downloads.d.ts.map +1 -1
  26. package/dist/cli-corpus-reference-downloads.js +13 -3
  27. package/dist/cli-corpus-reference-downloads.js.map +1 -1
  28. package/dist/cli-corpus-types.d.ts +2 -0
  29. package/dist/cli-corpus-types.d.ts.map +1 -1
  30. package/dist/cli-draft-command.d.ts +9 -0
  31. package/dist/cli-draft-command.d.ts.map +1 -1
  32. package/dist/cli-draft-command.js +26 -1
  33. package/dist/cli-draft-command.js.map +1 -1
  34. package/dist/cli-help/design.d.ts +7 -4
  35. package/dist/cli-help/design.d.ts.map +1 -1
  36. package/dist/cli-help/design.js +23 -6
  37. package/dist/cli-help/design.js.map +1 -1
  38. package/dist/cli-help/index.d.ts +9 -6
  39. package/dist/cli-help/index.d.ts.map +1 -1
  40. package/dist/cli-help/meta.d.ts +2 -2
  41. package/dist/cli-help/meta.d.ts.map +1 -1
  42. package/dist/cli-help/meta.js +4 -1
  43. package/dist/cli-help/meta.js.map +1 -1
  44. package/dist/cli-improve-command.d.ts.map +1 -1
  45. package/dist/cli-improve-command.js +273 -28
  46. package/dist/cli-improve-command.js.map +1 -1
  47. package/dist/cli-redesign-command.d.ts.map +1 -1
  48. package/dist/cli-redesign-command.js +97 -24
  49. package/dist/cli-redesign-command.js.map +1 -1
  50. package/dist/cli-run.d.ts.map +1 -1
  51. package/dist/cli-run.js +13 -3
  52. package/dist/cli-run.js.map +1 -1
  53. package/dist/cli-spend-command.d.ts +12 -1
  54. package/dist/cli-spend-command.d.ts.map +1 -1
  55. package/dist/cli-spend-command.js +94 -2
  56. package/dist/cli-spend-command.js.map +1 -1
  57. package/dist/cli-usage.js +5 -5
  58. package/dist/cli-usage.js.map +1 -1
  59. package/dist/concept-input.d.ts +6 -56
  60. package/dist/concept-input.d.ts.map +1 -1
  61. package/dist/concept-input.js +6 -65
  62. package/dist/concept-input.js.map +1 -1
  63. package/dist/conversion-client.d.ts +92 -3
  64. package/dist/conversion-client.d.ts.map +1 -1
  65. package/dist/conversion-client.js +317 -23
  66. package/dist/conversion-client.js.map +1 -1
  67. package/dist/corpus-client.d.ts +7 -1
  68. package/dist/corpus-client.d.ts.map +1 -1
  69. package/dist/corpus-client.js +3 -2
  70. package/dist/corpus-client.js.map +1 -1
  71. package/dist/corpus-reference-download-retry.d.ts +68 -0
  72. package/dist/corpus-reference-download-retry.d.ts.map +1 -0
  73. package/dist/corpus-reference-download-retry.js +123 -0
  74. package/dist/corpus-reference-download-retry.js.map +1 -0
  75. package/dist/corpus-request-error.d.ts +17 -0
  76. package/dist/corpus-request-error.d.ts.map +1 -0
  77. package/dist/corpus-request-error.js +21 -0
  78. package/dist/corpus-request-error.js.map +1 -0
  79. package/dist/draft-run.d.ts +15 -0
  80. package/dist/draft-run.d.ts.map +1 -1
  81. package/dist/draft-run.js +32 -5
  82. package/dist/draft-run.js.map +1 -1
  83. package/dist/draft-workspace.d.ts +2 -1
  84. package/dist/draft-workspace.d.ts.map +1 -1
  85. package/dist/draft-workspace.js.map +1 -1
  86. package/dist/hosted-draft-identity.d.ts +9 -0
  87. package/dist/hosted-draft-identity.d.ts.map +1 -1
  88. package/dist/hosted-draft-identity.js +2 -0
  89. package/dist/hosted-draft-identity.js.map +1 -1
  90. package/dist/improve-added-specs.d.ts +12 -31
  91. package/dist/improve-added-specs.d.ts.map +1 -1
  92. package/dist/improve-added-specs.js +64 -152
  93. package/dist/improve-added-specs.js.map +1 -1
  94. package/dist/improve-artifact-writer.d.ts +13 -0
  95. package/dist/improve-artifact-writer.d.ts.map +1 -0
  96. package/dist/improve-artifact-writer.js +27 -0
  97. package/dist/improve-artifact-writer.js.map +1 -0
  98. package/dist/improve-bootstrap-history.d.ts +21 -0
  99. package/dist/improve-bootstrap-history.d.ts.map +1 -0
  100. package/dist/improve-bootstrap-history.js +43 -0
  101. package/dist/improve-bootstrap-history.js.map +1 -0
  102. package/dist/improve-bootstrap-secret.d.ts +35 -0
  103. package/dist/improve-bootstrap-secret.d.ts.map +1 -0
  104. package/dist/improve-bootstrap-secret.js +61 -0
  105. package/dist/improve-bootstrap-secret.js.map +1 -0
  106. package/dist/improve-branch-stage.d.ts +10 -0
  107. package/dist/improve-branch-stage.d.ts.map +1 -0
  108. package/dist/improve-branch-stage.js +325 -0
  109. package/dist/improve-branch-stage.js.map +1 -0
  110. package/dist/improve-capture-redirect.d.ts +65 -0
  111. package/dist/improve-capture-redirect.d.ts.map +1 -0
  112. package/dist/improve-capture-redirect.js +85 -0
  113. package/dist/improve-capture-redirect.js.map +1 -0
  114. package/dist/improve-capture-words.d.ts +43 -0
  115. package/dist/improve-capture-words.d.ts.map +1 -0
  116. package/dist/improve-capture-words.js +25 -0
  117. package/dist/improve-capture-words.js.map +1 -0
  118. package/dist/improve-concept.d.ts +6 -7
  119. package/dist/improve-concept.d.ts.map +1 -1
  120. package/dist/improve-concept.js +12 -38
  121. package/dist/improve-concept.js.map +1 -1
  122. package/dist/improve-conversion-attempts.d.ts +21 -9
  123. package/dist/improve-conversion-attempts.d.ts.map +1 -1
  124. package/dist/improve-conversion-attempts.js +6 -1
  125. package/dist/improve-conversion-attempts.js.map +1 -1
  126. package/dist/improve-conversion-stage.d.ts +20 -2
  127. package/dist/improve-conversion-stage.d.ts.map +1 -1
  128. package/dist/improve-conversion-stage.js +386 -178
  129. package/dist/improve-conversion-stage.js.map +1 -1
  130. package/dist/improve-convert-progress.d.ts +44 -0
  131. package/dist/improve-convert-progress.d.ts.map +1 -0
  132. package/dist/improve-convert-progress.js +47 -0
  133. package/dist/improve-convert-progress.js.map +1 -0
  134. package/dist/improve-convert-resilience.d.ts +96 -58
  135. package/dist/improve-convert-resilience.d.ts.map +1 -1
  136. package/dist/improve-convert-resilience.js +128 -72
  137. package/dist/improve-convert-resilience.js.map +1 -1
  138. package/dist/improve-core/concept-input.d.ts +80 -0
  139. package/dist/improve-core/concept-input.d.ts.map +1 -0
  140. package/dist/improve-core/concept-input.js +92 -0
  141. package/dist/improve-core/concept-input.js.map +1 -0
  142. package/dist/improve-core/improve-added-specs.d.ts +62 -0
  143. package/dist/improve-core/improve-added-specs.d.ts.map +1 -0
  144. package/dist/improve-core/improve-added-specs.js +160 -0
  145. package/dist/improve-core/improve-added-specs.js.map +1 -0
  146. package/dist/improve-core/improve-artifacts.d.ts +18 -0
  147. package/dist/improve-core/improve-artifacts.d.ts.map +1 -0
  148. package/dist/improve-core/improve-artifacts.js +4 -0
  149. package/dist/improve-core/improve-artifacts.js.map +1 -0
  150. package/dist/improve-core/improve-concept.d.ts +7 -0
  151. package/dist/improve-core/improve-concept.d.ts.map +1 -0
  152. package/dist/improve-core/improve-concept.js +185 -0
  153. package/dist/improve-core/improve-concept.js.map +1 -0
  154. package/dist/improve-core/improve-discovery.d.ts +84 -0
  155. package/dist/improve-core/improve-discovery.d.ts.map +1 -0
  156. package/dist/improve-core/improve-discovery.js +154 -0
  157. package/dist/improve-core/improve-discovery.js.map +1 -0
  158. package/dist/improve-core/improve-dom-anchor.d.ts.map +1 -0
  159. package/dist/{improve-dom-anchor.js → improve-core/improve-dom-anchor.js} +2 -0
  160. package/dist/improve-core/improve-dom-anchor.js.map +1 -0
  161. package/dist/improve-core/improve-dom-diff.d.ts +59 -0
  162. package/dist/improve-core/improve-dom-diff.d.ts.map +1 -0
  163. package/dist/improve-core/improve-dom-diff.js +151 -0
  164. package/dist/improve-core/improve-dom-diff.js.map +1 -0
  165. package/dist/improve-core/improve-dom-extract.d.ts.map +1 -0
  166. package/dist/{improve-dom-extract.js → improve-core/improve-dom-extract.js} +2 -0
  167. package/dist/improve-core/improve-dom-extract.js.map +1 -0
  168. package/dist/improve-core/improve-dom-gate.d.ts +49 -0
  169. package/dist/improve-core/improve-dom-gate.d.ts.map +1 -0
  170. package/dist/improve-core/improve-dom-gate.js +99 -0
  171. package/dist/improve-core/improve-dom-gate.js.map +1 -0
  172. package/dist/improve-core/improve-dom-neighbour.d.ts.map +1 -0
  173. package/dist/{improve-dom-neighbour.js → improve-core/improve-dom-neighbour.js} +2 -0
  174. package/dist/improve-core/improve-dom-neighbour.js.map +1 -0
  175. package/dist/improve-core/improve-dom-scale.d.ts.map +1 -0
  176. package/dist/{improve-dom-scale.js → improve-core/improve-dom-scale.js} +2 -0
  177. package/dist/improve-core/improve-dom-scale.js.map +1 -0
  178. package/dist/improve-core/improve-icon-svg.d.ts +29 -0
  179. package/dist/improve-core/improve-icon-svg.d.ts.map +1 -0
  180. package/dist/improve-core/improve-icon-svg.js +85 -0
  181. package/dist/improve-core/improve-icon-svg.js.map +1 -0
  182. package/dist/improve-core/improve-kit-asset-model.d.ts +177 -0
  183. package/dist/improve-core/improve-kit-asset-model.d.ts.map +1 -0
  184. package/dist/improve-core/improve-kit-asset-model.js +269 -0
  185. package/dist/improve-core/improve-kit-asset-model.js.map +1 -0
  186. package/dist/improve-core/improve-layerdoc-diff.d.ts.map +1 -0
  187. package/dist/{improve-layerdoc-diff.js → improve-core/improve-layerdoc-diff.js} +2 -0
  188. package/dist/improve-core/improve-layerdoc-diff.js.map +1 -0
  189. package/dist/{improve-layerdoc-types.d.ts → improve-core/improve-layerdoc-types.d.ts} +9 -0
  190. package/dist/improve-core/improve-layerdoc-types.d.ts.map +1 -0
  191. package/dist/improve-core/improve-layerdoc-types.js +4 -0
  192. package/dist/improve-core/improve-layerdoc-types.js.map +1 -0
  193. package/dist/improve-core/improve-page-words.d.ts +180 -0
  194. package/dist/improve-core/improve-page-words.d.ts.map +1 -0
  195. package/dist/improve-core/improve-page-words.js +303 -0
  196. package/dist/improve-core/improve-page-words.js.map +1 -0
  197. package/dist/{improve-plan-annotated-render.d.ts → improve-core/improve-plan-annotated-render.d.ts} +19 -2
  198. package/dist/improve-core/improve-plan-annotated-render.d.ts.map +1 -0
  199. package/dist/{improve-plan-annotated-render.js → improve-core/improve-plan-annotated-render.js} +77 -28
  200. package/dist/improve-core/improve-plan-annotated-render.js.map +1 -0
  201. package/dist/improve-core/improve-plan-annotator.d.ts +34 -0
  202. package/dist/improve-core/improve-plan-annotator.d.ts.map +1 -0
  203. package/dist/improve-core/improve-plan-annotator.js +52 -0
  204. package/dist/improve-core/improve-plan-annotator.js.map +1 -0
  205. package/dist/{improve-plan-render.d.ts → improve-core/improve-plan-render.d.ts} +2 -1
  206. package/dist/improve-core/improve-plan-render.d.ts.map +1 -0
  207. package/dist/{improve-plan-render.js → improve-core/improve-plan-render.js} +7 -1
  208. package/dist/improve-core/improve-plan-render.js.map +1 -0
  209. package/dist/improve-core/improve-plan-vector-keep.d.ts +29 -0
  210. package/dist/improve-core/improve-plan-vector-keep.d.ts.map +1 -0
  211. package/dist/improve-core/improve-plan-vector-keep.js +68 -0
  212. package/dist/improve-core/improve-plan-vector-keep.js.map +1 -0
  213. package/dist/{improve-raster-layers-section.d.ts → improve-core/improve-raster-layers-section.d.ts} +9 -1
  214. package/dist/improve-core/improve-raster-layers-section.d.ts.map +1 -0
  215. package/dist/{improve-raster-layers-section.js → improve-core/improve-raster-layers-section.js} +5 -2
  216. package/dist/improve-core/improve-raster-layers-section.js.map +1 -0
  217. package/dist/improve-core/improve-refusal.d.ts +6 -0
  218. package/dist/improve-core/improve-refusal.d.ts.map +1 -0
  219. package/dist/improve-core/improve-refusal.js +27 -0
  220. package/dist/improve-core/improve-refusal.js.map +1 -0
  221. package/dist/improve-core/improve-retain.d.ts +121 -0
  222. package/dist/improve-core/improve-retain.d.ts.map +1 -0
  223. package/dist/improve-core/improve-retain.js +115 -0
  224. package/dist/improve-core/improve-retain.js.map +1 -0
  225. package/dist/improve-core/improve-site-plan.d.ts +75 -0
  226. package/dist/improve-core/improve-site-plan.d.ts.map +1 -0
  227. package/dist/improve-core/improve-site-plan.js +135 -0
  228. package/dist/improve-core/improve-site-plan.js.map +1 -0
  229. package/dist/improve-core/improve-site-shell.d.ts +56 -0
  230. package/dist/improve-core/improve-site-shell.d.ts.map +1 -0
  231. package/dist/improve-core/improve-site-shell.js +152 -0
  232. package/dist/improve-core/improve-site-shell.js.map +1 -0
  233. package/dist/improve-core/improve-site-tokens.d.ts +44 -0
  234. package/dist/improve-core/improve-site-tokens.d.ts.map +1 -0
  235. package/dist/improve-core/improve-site-tokens.js +87 -0
  236. package/dist/improve-core/improve-site-tokens.js.map +1 -0
  237. package/dist/improve-core/improve-source-hints.d.ts +25 -0
  238. package/dist/improve-core/improve-source-hints.d.ts.map +1 -0
  239. package/dist/improve-core/improve-source-hints.js +17 -0
  240. package/dist/improve-core/improve-source-hints.js.map +1 -0
  241. package/dist/{improve-token-patch.d.ts → improve-core/improve-token-patch.d.ts} +2 -0
  242. package/dist/improve-core/improve-token-patch.d.ts.map +1 -0
  243. package/dist/{improve-token-patch.js → improve-core/improve-token-patch.js} +25 -5
  244. package/dist/improve-core/improve-token-patch.js.map +1 -0
  245. package/dist/improve-core/index.d.ts +47 -0
  246. package/dist/improve-core/index.d.ts.map +1 -0
  247. package/dist/improve-core/index.js +49 -0
  248. package/dist/improve-core/index.js.map +1 -0
  249. package/dist/improve-delivery-stages.d.ts +6 -0
  250. package/dist/improve-delivery-stages.d.ts.map +1 -1
  251. package/dist/improve-delivery-stages.js +91 -6
  252. package/dist/improve-delivery-stages.js.map +1 -1
  253. package/dist/improve-dom-diff.d.ts +8 -24
  254. package/dist/improve-dom-diff.d.ts.map +1 -1
  255. package/dist/improve-dom-diff.js +23 -123
  256. package/dist/improve-dom-diff.js.map +1 -1
  257. package/dist/improve-dom-gate.d.ts +1 -18
  258. package/dist/improve-dom-gate.d.ts.map +1 -1
  259. package/dist/improve-dom-gate.js +1 -46
  260. package/dist/improve-dom-gate.js.map +1 -1
  261. package/dist/improve-generation-stages.d.ts +0 -2
  262. package/dist/improve-generation-stages.d.ts.map +1 -1
  263. package/dist/improve-generation-stages.js +191 -15
  264. package/dist/improve-generation-stages.js.map +1 -1
  265. package/dist/improve-kit-assets.d.ts +8 -116
  266. package/dist/improve-kit-assets.d.ts.map +1 -1
  267. package/dist/improve-kit-assets.js +9 -229
  268. package/dist/improve-kit-assets.js.map +1 -1
  269. package/dist/improve-kit-ignore.d.ts +32 -0
  270. package/dist/improve-kit-ignore.d.ts.map +1 -0
  271. package/dist/improve-kit-ignore.js +111 -0
  272. package/dist/improve-kit-ignore.js.map +1 -0
  273. package/dist/improve-kit-readme.d.ts +4 -0
  274. package/dist/improve-kit-readme.d.ts.map +1 -1
  275. package/dist/improve-kit-readme.js +155 -24
  276. package/dist/improve-kit-readme.js.map +1 -1
  277. package/dist/improve-kit-stall.d.ts +51 -3
  278. package/dist/improve-kit-stall.d.ts.map +1 -1
  279. package/dist/improve-kit-stall.js +205 -21
  280. package/dist/improve-kit-stall.js.map +1 -1
  281. package/dist/improve-kit-status.d.ts +36 -0
  282. package/dist/improve-kit-status.d.ts.map +1 -1
  283. package/dist/improve-kit-status.js +82 -7
  284. package/dist/improve-kit-status.js.map +1 -1
  285. package/dist/improve-options.d.ts +14 -0
  286. package/dist/improve-options.d.ts.map +1 -1
  287. package/dist/improve-options.js +95 -12
  288. package/dist/improve-options.js.map +1 -1
  289. package/dist/improve-passthrough-flags.d.ts +8 -0
  290. package/dist/improve-passthrough-flags.d.ts.map +1 -0
  291. package/dist/improve-passthrough-flags.js +11 -0
  292. package/dist/improve-passthrough-flags.js.map +1 -0
  293. package/dist/improve-plan-annotator.d.ts +13 -2
  294. package/dist/improve-plan-annotator.d.ts.map +1 -1
  295. package/dist/improve-plan-annotator.js +35 -37
  296. package/dist/improve-plan-annotator.js.map +1 -1
  297. package/dist/improve-pricing-plan.d.ts +3 -0
  298. package/dist/improve-pricing-plan.d.ts.map +1 -1
  299. package/dist/improve-pricing-plan.js +33 -5
  300. package/dist/improve-pricing-plan.js.map +1 -1
  301. package/dist/improve-recheck.d.ts +9 -0
  302. package/dist/improve-recheck.d.ts.map +1 -0
  303. package/dist/improve-recheck.js +200 -0
  304. package/dist/improve-recheck.js.map +1 -0
  305. package/dist/improve-reset.d.ts.map +1 -1
  306. package/dist/improve-reset.js +11 -0
  307. package/dist/improve-reset.js.map +1 -1
  308. package/dist/improve-run-summary.d.ts +6 -0
  309. package/dist/improve-run-summary.d.ts.map +1 -1
  310. package/dist/improve-run-summary.js +77 -7
  311. package/dist/improve-run-summary.js.map +1 -1
  312. package/dist/improve-site-plan.d.ts +57 -0
  313. package/dist/improve-site-plan.d.ts.map +1 -0
  314. package/dist/improve-site-plan.js +79 -0
  315. package/dist/improve-site-plan.js.map +1 -0
  316. package/dist/improve-site-shell.d.ts +11 -0
  317. package/dist/improve-site-shell.d.ts.map +1 -0
  318. package/dist/improve-site-shell.js +24 -0
  319. package/dist/improve-site-shell.js.map +1 -0
  320. package/dist/improve-site-stage.d.ts +10 -0
  321. package/dist/improve-site-stage.d.ts.map +1 -0
  322. package/dist/improve-site-stage.js +84 -0
  323. package/dist/improve-site-stage.js.map +1 -0
  324. package/dist/improve-site-tokens.d.ts +9 -0
  325. package/dist/improve-site-tokens.d.ts.map +1 -0
  326. package/dist/improve-site-tokens.js +17 -0
  327. package/dist/improve-site-tokens.js.map +1 -0
  328. package/dist/improve-source-hints.d.ts +3 -12
  329. package/dist/improve-source-hints.d.ts.map +1 -1
  330. package/dist/improve-source-hints.js +4 -5
  331. package/dist/improve-source-hints.js.map +1 -1
  332. package/dist/improve-spend-ledger.d.ts +69 -0
  333. package/dist/improve-spend-ledger.d.ts.map +1 -0
  334. package/dist/improve-spend-ledger.js +118 -0
  335. package/dist/improve-spend-ledger.js.map +1 -0
  336. package/dist/improve-stage-runners.d.ts +5 -2
  337. package/dist/improve-stage-runners.d.ts.map +1 -1
  338. package/dist/improve-stage-runners.js +5 -2
  339. package/dist/improve-stage-runners.js.map +1 -1
  340. package/dist/improve-stage-shared.d.ts +49 -2
  341. package/dist/improve-stage-shared.d.ts.map +1 -1
  342. package/dist/improve-stage-shared.js +80 -3
  343. package/dist/improve-stage-shared.js.map +1 -1
  344. package/dist/improve-stop-handler.d.ts +15 -0
  345. package/dist/improve-stop-handler.d.ts.map +1 -1
  346. package/dist/improve-stop-handler.js +74 -3
  347. package/dist/improve-stop-handler.js.map +1 -1
  348. package/dist/improve-terminal-event.d.ts.map +1 -1
  349. package/dist/improve-terminal-event.js +13 -4
  350. package/dist/improve-terminal-event.js.map +1 -1
  351. package/dist/improve-workspace.d.ts +282 -9
  352. package/dist/improve-workspace.d.ts.map +1 -1
  353. package/dist/improve-workspace.js +250 -78
  354. package/dist/improve-workspace.js.map +1 -1
  355. package/dist/index.d.ts +2 -1
  356. package/dist/index.d.ts.map +1 -1
  357. package/dist/index.js +1 -0
  358. package/dist/index.js.map +1 -1
  359. package/dist/legacy-skill-catalog.d.ts.map +1 -1
  360. package/dist/legacy-skill-catalog.js +202 -0
  361. package/dist/legacy-skill-catalog.js.map +1 -1
  362. package/dist/mcp-convert.js +1 -1
  363. package/dist/mcp-convert.js.map +1 -1
  364. package/dist/redesign-capture.d.ts +146 -15
  365. package/dist/redesign-capture.d.ts.map +1 -1
  366. package/dist/redesign-capture.js +182 -65
  367. package/dist/redesign-capture.js.map +1 -1
  368. package/dist/redesign-workspace.d.ts +13 -0
  369. package/dist/redesign-workspace.d.ts.map +1 -1
  370. package/dist/redesign-workspace.js +14 -0
  371. package/dist/redesign-workspace.js.map +1 -1
  372. package/dist/responsive-alternative-materializer.d.ts +24 -0
  373. package/dist/responsive-alternative-materializer.d.ts.map +1 -0
  374. package/dist/responsive-alternative-materializer.js +93 -0
  375. package/dist/responsive-alternative-materializer.js.map +1 -0
  376. package/dist/result-integrity.d.ts +38 -0
  377. package/dist/result-integrity.d.ts.map +1 -0
  378. package/dist/result-integrity.js +46 -0
  379. package/dist/result-integrity.js.map +1 -0
  380. package/dist/review-edit-source.d.ts.map +1 -1
  381. package/dist/review-edit-source.js +6 -2
  382. package/dist/review-edit-source.js.map +1 -1
  383. package/dist/review-edit.js +2 -2
  384. package/dist/review-edit.js.map +1 -1
  385. package/dist/review-prototype-gap.js +1 -1
  386. package/dist/review-prototype-gap.js.map +1 -1
  387. package/dist/spend-run-filter.d.ts +21 -0
  388. package/dist/spend-run-filter.d.ts.map +1 -0
  389. package/dist/spend-run-filter.js +65 -0
  390. package/dist/spend-run-filter.js.map +1 -0
  391. package/dist/spend-scoped-report-lines.d.ts +4 -0
  392. package/dist/spend-scoped-report-lines.d.ts.map +1 -0
  393. package/dist/spend-scoped-report-lines.js +46 -0
  394. package/dist/spend-scoped-report-lines.js.map +1 -0
  395. package/dist/spend-scoped-report.d.ts +28 -0
  396. package/dist/spend-scoped-report.d.ts.map +1 -0
  397. package/dist/spend-scoped-report.js +45 -0
  398. package/dist/spend-scoped-report.js.map +1 -0
  399. package/open-design.json +2 -2
  400. package/package.json +5 -5
  401. package/skills/12ui-design/SKILL.md +14 -4
  402. package/skills/12ui-design/improve.md +67 -5
  403. package/skills/12ui-design/inspire.md +1 -1
  404. package/dist/improve-dom-anchor.d.ts.map +0 -1
  405. package/dist/improve-dom-anchor.js.map +0 -1
  406. package/dist/improve-dom-extract.d.ts.map +0 -1
  407. package/dist/improve-dom-extract.js.map +0 -1
  408. package/dist/improve-dom-neighbour.d.ts.map +0 -1
  409. package/dist/improve-dom-neighbour.js.map +0 -1
  410. package/dist/improve-dom-scale.d.ts.map +0 -1
  411. package/dist/improve-dom-scale.js.map +0 -1
  412. package/dist/improve-layerdoc-diff.d.ts.map +0 -1
  413. package/dist/improve-layerdoc-diff.js.map +0 -1
  414. package/dist/improve-layerdoc-types.d.ts.map +0 -1
  415. package/dist/improve-layerdoc-types.js +0 -2
  416. package/dist/improve-layerdoc-types.js.map +0 -1
  417. package/dist/improve-plan-annotated-render.d.ts.map +0 -1
  418. package/dist/improve-plan-annotated-render.js.map +0 -1
  419. package/dist/improve-plan-render.d.ts.map +0 -1
  420. package/dist/improve-plan-render.js.map +0 -1
  421. package/dist/improve-raster-layers-section.d.ts.map +0 -1
  422. package/dist/improve-raster-layers-section.js.map +0 -1
  423. package/dist/improve-token-patch.d.ts.map +0 -1
  424. package/dist/improve-token-patch.js.map +0 -1
  425. /package/dist/{improve-dom-anchor.d.ts → improve-core/improve-dom-anchor.d.ts} +0 -0
  426. /package/dist/{improve-dom-extract.d.ts → improve-core/improve-dom-extract.d.ts} +0 -0
  427. /package/dist/{improve-dom-neighbour.d.ts → improve-core/improve-dom-neighbour.d.ts} +0 -0
  428. /package/dist/{improve-dom-scale.d.ts → improve-core/improve-dom-scale.d.ts} +0 -0
  429. /package/dist/{improve-layerdoc-diff.d.ts → improve-core/improve-layerdoc-diff.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,MAA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AAa,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,cAAc,KAAK,CAAC,IAAI,CAAC,WAAW,EAAE,IAAI,CAAC,WAAW,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC,EAAE;YACnK,KAAK,EAAE,IAAI;gBACT,CAAC,CAAC,YAAY,KAAK,CAAC,IAAI,qBAAqB,KAAK,CAAC,IAAI,+BAA+B,KAAK,CAAC,WAAW,qBAAqB;gBAC5H,CAAC,CAAC,KAAK;oBACL,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,7 @@
1
+ import { type ImproveRetainPolicy } from './improve-retain.js';
2
+ /** The real steering limit after reserving room for the mandatory harness. */
3
+ export declare const IMPROVE_DIRECTION_MAX_CHARACTERS: number;
4
+ /** Where cut detail belongs, stated once for the refusal and the skill. */
5
+ export declare const IMPROVE_DIRECTION_TRIM_HINT: string;
6
+ export declare const buildImproveConcept: (direction?: string, retain?: ImproveRetainPolicy) => string;
7
+ //# 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;AA+I7B,8EAA8E;AAC9E,eAAO,MAAM,gCAAgC,QAAuD,CAAC;AAErG,2EAA2E;AAC3E,eAAO,MAAM,2BAA2B,QACG,CAAC;AAS5C,eAAO,MAAM,mBAAmB,GAC9B,YAAY,MAAM,EAClB,SAAQ,mBAA4C,KACnD,MA+CF,CAAC"}
@@ -0,0 +1,185 @@
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 it is "rewrite
28
+ * the words, keep the facts" — the failure pole improve exists to avoid
29
+ * (CLAUDE.md item 8) is never one click away.
30
+ */
31
+ /**
32
+ * ALL FOUR TOGGLES ON IS THE POLISH POSTURE, NOT A FREEZE (owner, 2026-09-02,
33
+ * direct chat with a screenshot): "Selecting all the options results in no
34
+ * changes?" — chargedesk.com, brief "Modern minimal saas with line art", four
35
+ * candidates indistinguishable from the live page.
36
+ *
37
+ * They were indistinguishable because the assembly asked for that. `layout`
38
+ * kept said "the position of everything on it exactly where they are";
39
+ * `style` kept said the palette, typography and texture were fixed while the
40
+ * server's retain clause simultaneously promised back "spacing rhythm …
41
+ * texture and ink … and polish". Between them the two mandates named every
42
+ * axis a design has, and an image edit given a full freeze returns its input.
43
+ *
44
+ * So each mandate now separates what it HOLDS from what it may still IMPROVE,
45
+ * and says so in the same breath — a person who turns everything on is asking
46
+ * for their page polished, not photocopied.
47
+ */
48
+ const LAYOUT_MANDATE = {
49
+ 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.',
50
+ 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.',
51
+ };
52
+ /**
53
+ * A STYLE HAS AN IDENTITY AND IT HAS A FINISH. The identity is what makes the
54
+ * page recognisably this product's — its palette, its typography voice, its
55
+ * image treatment. The finish is spacing rhythm, alignment, surfaces, control
56
+ * affordances, ink and type rendering: what a designer tidies without anyone
57
+ * saying the brand changed. "Keep style" keeps the identity; the finish is
58
+ * exactly what an improvement is for.
59
+ *
60
+ * These are the same words the service's retain clause uses for a retained
61
+ * `style` on a subject run (`workers/api/src/create/retain.ts`), because the
62
+ * harness sentence the toggle picks and the retain clause the toggle produces
63
+ * must not tell the model two different things.
64
+ */
65
+ const STYLE_MANDATE = {
66
+ 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.',
67
+ 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.',
68
+ };
69
+ const BRAND_CLAUSE = "Keep the product's logo, wordmark, and brand imagery as they are.";
70
+ /**
71
+ * THE TOGGLES ARE CONSERVATION DEFAULTS AND THE BRIEF OUTRANKS THEM (owner,
72
+ * 2026-09-02: "Maybe the wording becomes keep xyz PROVIDING it doesn't
73
+ * conflict with the prompt?").
74
+ *
75
+ * Read as absolutes, four "keep" sentences and one brief can only contradict
76
+ * each other, and an image edit resolves a contradiction the safe way: it
77
+ * returns its input. That is the whole of the owner's chargedesk report —
78
+ * "Modern minimal saas with line art" against a gold bokeh photograph, all
79
+ * four toggles on, four candidates indistinguishable from the live page. The
80
+ * brief asked for a different visual world and every other sentence said
81
+ * nothing may change.
82
+ *
83
+ * So there is a precedence order and it is stated ONCE, not bolted onto each
84
+ * facet as a caveat: the brief beats the toggles, and the toggles beat the
85
+ * page as it stands. A brief that asks for nothing in particular — the empty
86
+ * brief's neutral head — outranks nothing, so everything stays kept. This is
87
+ * the same rule the service states in its retain clause
88
+ * (`workers/api/src/create/retain.ts`), so the concept and the retain clause
89
+ * cannot tell the model two different things.
90
+ *
91
+ * IT IS THE SHORT FORM HERE ON PURPOSE. Every character this harness spends is
92
+ * a character taken off the brief a visitor may type
93
+ * (`IMPROVE_DIRECTION_MAX_CHARACTERS` below), and the service states the same
94
+ * rule at full length in the retain clause of the very same prompt. So the
95
+ * concept carries the rule, not the essay.
96
+ */
97
+ const PRECEDENCE_RULE = 'These are conservation defaults, not a freeze:'
98
+ + ' the brief above outranks them, and they outrank the page as it stands.';
99
+ const CONTENT_CLAUSE = {
100
+ 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.',
101
+ free: 'The words may be rewritten and re-sequenced, but every fact the page states — what the product is, its claims, its numbers, its offers, and every control it gives a person — must still be present and still be true; invent no product facts, features, prices, or data.',
102
+ };
103
+ /**
104
+ * THE BRIEF IS THE HEAD, NOT A LABELLED FIELD.
105
+ *
106
+ * Both templates that consume a concept put it in a `for <noun phrase>` slot
107
+ * or after a label of their own: the draft prompt reads "Create one
108
+ * distinctive desktop interface for {concept}." and the improve generation
109
+ * prompt reads "Improvement direction: {concept}". A concept that carried its
110
+ * own `Direction: ` label produced "for Direction: A modern minimal saas …"
111
+ * and "Improvement direction: Direction: …" — one label too many, and a head
112
+ * that is not a noun phrase. So the brief leads bare, and with no brief the
113
+ * head is the run's own subject.
114
+ */
115
+ const NO_BRIEF_HEAD = "a better version of this product's own page";
116
+ /**
117
+ * THE BRIEF NEEDS AN END. Paragraph breaks do not survive the wire: the
118
+ * service normalizes every run of whitespace to a single space before it
119
+ * measures or stores a concept (`cleanText`, workers/api validation), so the
120
+ * blank line this harness used to put around the brief reached the model as
121
+ * one space. With the brief leading and a mandate right behind it, a brief
122
+ * that does not punctuate itself would run straight into that mandate.
123
+ */
124
+ const terminated = (steering) => (/[.!?:;]$/u.test(steering) ? steering : `${steering}.`);
125
+ /**
126
+ * The steering limit must not depend on the toggles, or a brief a visitor
127
+ * typed would be refused by flipping a switch. Reserve the LONGEST assembly —
128
+ * plus the terminator a brief may be given — so every retain set accepts the
129
+ * same brief.
130
+ */
131
+ const longest = (choice) => (Math.max(choice.keep.length, choice.free.length));
132
+ const RESERVED_CONCEPT_CHARACTERS = 1 + BRAND_CLAUSE.length + PRECEDENCE_RULE.length
133
+ + longest(LAYOUT_MANDATE) + longest(STYLE_MANDATE) + longest(CONTENT_CLAUSE) + 8;
134
+ /** The real steering limit after reserving room for the mandatory harness. */
135
+ export const IMPROVE_DIRECTION_MAX_CHARACTERS = MAX_CONCEPT_CHARACTERS - RESERVED_CONCEPT_CHARACTERS;
136
+ /** Where cut detail belongs, stated once for the refusal and the skill. */
137
+ export const IMPROVE_DIRECTION_TRIM_HINT = 'Keep the intended hierarchy, rhythm, typography,'
138
+ + ' surfaces, color, controls, and mood.';
139
+ /**
140
+ * F9 found that detailed, style-anchored direction reliably beats a vague
141
+ * "make it better" instruction. Naming an empty or thin region as the defect
142
+ * did the opposite: the image model filled it with invented product content.
143
+ */
144
+ 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;
145
+ export const buildImproveConcept = (direction, retain = DEFAULT_IMPROVE_RETAIN) => {
146
+ const steering = direction?.replace(/\s+/gu, ' ').trim() ?? '';
147
+ // F7 (wave-2, 2026-09-03): naming only the cap cost two lanes their first
148
+ // command each — the refusal has to name the length of what was written, so
149
+ // the direction can be fixed in one edit rather than counted by hand.
150
+ if (conceptCharacterCount(steering) > IMPROVE_DIRECTION_MAX_CHARACTERS) {
151
+ throw new ImproveRefusal(conceptOverLimitMessage({
152
+ flag: '--direction',
153
+ raw: direction ?? '',
154
+ normalized: steering,
155
+ limit: IMPROVE_DIRECTION_MAX_CHARACTERS,
156
+ because: `improve reserves the other ${RESERVED_CONCEPT_CHARACTERS} of the`
157
+ + ` ${MAX_CONCEPT_CHARACTERS}-character concept for its retain mandates and`
158
+ + ' no-invention guardrails, so --direction is what is left.',
159
+ trimHint: IMPROVE_DIRECTION_TRIM_HINT,
160
+ }), 'improve_direction_too_long');
161
+ }
162
+ if (FABRICATION_TRIGGER.test(steering)) {
163
+ throw new ImproveRefusal('--direction must describe the intended style and hierarchy, not emptiness or thin content;'
164
+ + ' naming a content void invites fabricated UI.', 'improve_direction_emptiness');
165
+ }
166
+ const pick = (facet, choice) => (improveRetainKeeps(retain, facet) ? choice.keep : choice.free);
167
+ // With nothing kept there is no conservation for the brief to outrank, so
168
+ // the rule would be a sentence about nothing.
169
+ const keepsAnything = IMPROVE_RETAIN_FACETS.some((facet) => improveRetainKeeps(retain, facet));
170
+ const concept = [
171
+ terminated(steering || NO_BRIEF_HEAD),
172
+ [pick('layout', LAYOUT_MANDATE), pick('style', STYLE_MANDATE)].join(' '),
173
+ [
174
+ ...(improveRetainKeeps(retain, 'assets') ? [BRAND_CLAUSE] : []),
175
+ pick('content', CONTENT_CLAUSE),
176
+ ].join(' '),
177
+ ...(keepsAnything ? [PRECEDENCE_RULE] : []),
178
+ ].join('\n\n');
179
+ return readConceptValue({
180
+ value: concept,
181
+ flag: '--direction',
182
+ trimHint: IMPROVE_DIRECTION_TRIM_HINT,
183
+ });
184
+ };
185
+ //# 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;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;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,4QAA4Q;CAC1Q,CAAC;AAEX;;;;;;;;;;;GAWG;AACH,MAAM,aAAa,GAAG,6CAA6C,CAAC;AAEpE;;;;;;;GAOG;AACH,MAAM,UAAU,GAAG,CAAC,QAA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E,OAAO;QACd,IAAI,EAAE,aAAa;QACnB,QAAQ,EAAE,2BAA2B;KACtC,CAAC,CAAC;AACL,CAAC,CAAC"}
@@ -0,0 +1,84 @@
1
+ /**
2
+ * 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-discovery.ts"],"names":[],"mappings":"AAGA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,+EAA+E;AAC/E,eAAO,MAAM,mCAAmC,IAAI,CAAC;AAErD;;;;GAIG;AACH,eAAO,MAAM,wBAAwB,0FAC8C,CAAC;AAQpF,gFAAgF;AAChF,MAAM,MAAM,mBAAmB,GAAG;IAChC,IAAI,EAAE,MAAM,CAAC;IACb,8DAA8D;IAC9D,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,sFAAsF;IACtF,CAAC,CAAC,EAAE,MAAM,CAAC;IACX,2EAA2E;IAC3E,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB,CAAC;AAEF,MAAM,MAAM,wBAAwB,GAAG;IACrC,6EAA6E;IAC7E,SAAS,EAAE,MAAM,CAAC;IAClB,KAAK,EAAE,mBAAmB,EAAE,CAAC;CAC9B,CAAC;AAEF;;;;;;GAMG;AACH,eAAO,MAAM,0BAA0B,QAAO,OAY7C,CAAC;AAEF;;;;GAIG;AACH,MAAM,MAAM,mBAAmB,GAAG;IAChC,YAAY,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,MAAM,GAAG,IAAI,GAAG,SAAS,CAAC;IAC1D,OAAO,EAAE,CAAC,SAAS,EAAE,MAAM,KAAK,OAAO,CAAC;CACzC,CAAC;AAEF,MAAM,MAAM,kBAAkB,GAAG;IAC/B,+EAA+E;IAC/E,gBAAgB,EAAE,CAAC,SAAS,EAAE,MAAM,KAAK,SAAS,CAAC,mBAAmB,CAAC,CAAC;CACzE,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,wBAAwB,GAAI,UAAU,kBAAkB,KAAG,wBAQvE,CAAC;AAkBF;;;;;;;;GAQG;AACH,eAAO,MAAM,iBAAiB,GAC5B,OAAO,wBAAwB,GAA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