@12ui/design 0.2.27 → 0.2.28

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 (349) hide show
  1. package/README.md +72 -87
  2. package/SKILL.md +5 -5
  3. package/dist/branch-completion.d.ts.map +1 -1
  4. package/dist/branch-completion.js +37 -14
  5. package/dist/branch-completion.js.map +1 -1
  6. package/dist/branch-execution.d.ts.map +1 -1
  7. package/dist/branch-execution.js +28 -8
  8. package/dist/branch-execution.js.map +1 -1
  9. package/dist/branch-identity.d.ts +10 -4
  10. package/dist/branch-identity.d.ts.map +1 -1
  11. package/dist/branch-identity.js +9 -6
  12. package/dist/branch-identity.js.map +1 -1
  13. package/dist/branch-page-conversion.d.ts +9 -8
  14. package/dist/branch-page-conversion.d.ts.map +1 -1
  15. package/dist/branch-page-conversion.js +8 -2
  16. package/dist/branch-page-conversion.js.map +1 -1
  17. package/dist/branch-page-packaging.d.ts +31 -0
  18. package/dist/branch-page-packaging.d.ts.map +1 -0
  19. package/dist/branch-page-packaging.js +86 -0
  20. package/dist/branch-page-packaging.js.map +1 -0
  21. package/dist/branch-plan.d.ts +6 -0
  22. package/dist/branch-plan.d.ts.map +1 -1
  23. package/dist/branch-plan.js +6 -1
  24. package/dist/branch-plan.js.map +1 -1
  25. package/dist/branch-progress.d.ts +22 -0
  26. package/dist/branch-progress.d.ts.map +1 -1
  27. package/dist/branch-progress.js +33 -8
  28. package/dist/branch-progress.js.map +1 -1
  29. package/dist/branch-run-record.d.ts +9 -0
  30. package/dist/branch-run-record.d.ts.map +1 -1
  31. package/dist/branch-run-record.js.map +1 -1
  32. package/dist/branch-status.d.ts +2 -0
  33. package/dist/branch-status.d.ts.map +1 -1
  34. package/dist/branch-status.js +60 -15
  35. package/dist/branch-status.js.map +1 -1
  36. package/dist/branch-winner.d.ts +13 -15
  37. package/dist/branch-winner.d.ts.map +1 -1
  38. package/dist/branch-winner.js +25 -77
  39. package/dist/branch-winner.js.map +1 -1
  40. package/dist/cli-auth-command.d.ts.map +1 -1
  41. package/dist/cli-auth-command.js +5 -0
  42. package/dist/cli-auth-command.js.map +1 -1
  43. package/dist/cli-auth-onboarding.d.ts +12 -0
  44. package/dist/cli-auth-onboarding.d.ts.map +1 -0
  45. package/dist/cli-auth-onboarding.js +21 -0
  46. package/dist/cli-auth-onboarding.js.map +1 -0
  47. package/dist/cli-branch-command.d.ts +14 -19
  48. package/dist/cli-branch-command.d.ts.map +1 -1
  49. package/dist/cli-branch-command.js +207 -137
  50. package/dist/cli-branch-command.js.map +1 -1
  51. package/dist/cli-capabilities.d.ts +10 -51
  52. package/dist/cli-capabilities.d.ts.map +1 -1
  53. package/dist/cli-capabilities.js +13 -26
  54. package/dist/cli-capabilities.js.map +1 -1
  55. package/dist/cli-cli-command.d.ts +3 -0
  56. package/dist/cli-cli-command.d.ts.map +1 -1
  57. package/dist/cli-cli-command.js +15 -3
  58. package/dist/cli-cli-command.js.map +1 -1
  59. package/dist/cli-conversion-derivation.d.ts +30 -0
  60. package/dist/cli-conversion-derivation.d.ts.map +1 -0
  61. package/dist/{cli-export-command.js → cli-conversion-derivation.js} +178 -110
  62. package/dist/cli-conversion-derivation.js.map +1 -0
  63. package/dist/cli-conversion-output-directory.d.ts +5 -0
  64. package/dist/cli-conversion-output-directory.d.ts.map +1 -0
  65. package/dist/{cli-export-output-directory.js → cli-conversion-output-directory.js} +10 -10
  66. package/dist/cli-conversion-output-directory.js.map +1 -0
  67. package/dist/cli-convert-command.d.ts +9 -0
  68. package/dist/cli-convert-command.d.ts.map +1 -1
  69. package/dist/cli-convert-command.js +528 -158
  70. package/dist/cli-convert-command.js.map +1 -1
  71. package/dist/cli-corpus-command.d.ts.map +1 -1
  72. package/dist/cli-corpus-command.js +77 -10
  73. package/dist/cli-corpus-command.js.map +1 -1
  74. package/dist/cli-corpus-reference-downloads.d.ts +5 -0
  75. package/dist/cli-corpus-reference-downloads.d.ts.map +1 -1
  76. package/dist/cli-corpus-reference-downloads.js +18 -7
  77. package/dist/cli-corpus-reference-downloads.js.map +1 -1
  78. package/dist/cli-corpus-run.d.ts +9 -0
  79. package/dist/cli-corpus-run.d.ts.map +1 -1
  80. package/dist/cli-corpus-run.js +18 -0
  81. package/dist/cli-corpus-run.js.map +1 -1
  82. package/dist/cli-detach.d.ts +12 -4
  83. package/dist/cli-detach.d.ts.map +1 -1
  84. package/dist/cli-detach.js +49 -17
  85. package/dist/cli-detach.js.map +1 -1
  86. package/dist/cli-draft-command.d.ts +44 -61
  87. package/dist/cli-draft-command.d.ts.map +1 -1
  88. package/dist/cli-draft-command.js +307 -180
  89. package/dist/cli-draft-command.js.map +1 -1
  90. package/dist/cli-help/conversion.d.ts +30 -0
  91. package/dist/cli-help/conversion.d.ts.map +1 -0
  92. package/dist/cli-help/conversion.js +55 -0
  93. package/dist/cli-help/conversion.js.map +1 -0
  94. package/dist/cli-help/design.d.ts +74 -0
  95. package/dist/cli-help/design.d.ts.map +1 -0
  96. package/dist/cli-help/design.js +131 -0
  97. package/dist/cli-help/design.js.map +1 -0
  98. package/dist/cli-help/index.d.ts +224 -0
  99. package/dist/cli-help/index.d.ts.map +1 -0
  100. package/dist/cli-help/index.js +32 -0
  101. package/dist/cli-help/index.js.map +1 -0
  102. package/dist/cli-help/meta.d.ts +24 -0
  103. package/dist/cli-help/meta.d.ts.map +1 -0
  104. package/dist/cli-help/meta.js +30 -0
  105. package/dist/cli-help/meta.js.map +1 -0
  106. package/dist/cli-help/render.d.ts +4 -0
  107. package/dist/cli-help/render.d.ts.map +1 -0
  108. package/dist/cli-help/render.js +28 -0
  109. package/dist/cli-help/render.js.map +1 -0
  110. package/dist/cli-help/setup.d.ts +93 -0
  111. package/dist/cli-help/setup.d.ts.map +1 -0
  112. package/dist/cli-help/setup.js +142 -0
  113. package/dist/cli-help/setup.js.map +1 -0
  114. package/dist/cli-help/types.d.ts +10 -0
  115. package/dist/cli-help/types.d.ts.map +1 -0
  116. package/dist/cli-help/types.js +2 -0
  117. package/dist/cli-help/types.js.map +1 -0
  118. package/dist/cli-next-command.d.ts +11 -8
  119. package/dist/cli-next-command.d.ts.map +1 -1
  120. package/dist/cli-next-command.js +288 -88
  121. package/dist/cli-next-command.js.map +1 -1
  122. package/dist/cli-output-paths.d.ts +2 -23
  123. package/dist/cli-output-paths.d.ts.map +1 -1
  124. package/dist/cli-output-paths.js +2 -36
  125. package/dist/cli-output-paths.js.map +1 -1
  126. package/dist/cli-package-command.d.ts +1 -0
  127. package/dist/cli-package-command.d.ts.map +1 -1
  128. package/dist/cli-package-command.js +107 -34
  129. package/dist/cli-package-command.js.map +1 -1
  130. package/dist/cli-pending-auth.d.ts +20 -0
  131. package/dist/cli-pending-auth.d.ts.map +1 -0
  132. package/dist/cli-pending-auth.js +160 -0
  133. package/dist/cli-pending-auth.js.map +1 -0
  134. package/dist/cli-progress.d.ts +256 -75
  135. package/dist/cli-progress.d.ts.map +1 -1
  136. package/dist/cli-progress.js +425 -98
  137. package/dist/cli-progress.js.map +1 -1
  138. package/dist/cli-run.d.ts +2 -0
  139. package/dist/cli-run.d.ts.map +1 -1
  140. package/dist/cli-run.js +56 -75
  141. package/dist/cli-run.js.map +1 -1
  142. package/dist/cli-skill-command.d.ts +3 -0
  143. package/dist/cli-skill-command.d.ts.map +1 -1
  144. package/dist/cli-skill-command.js +26 -3
  145. package/dist/cli-skill-command.js.map +1 -1
  146. package/dist/cli-usage.d.ts +17 -8
  147. package/dist/cli-usage.d.ts.map +1 -1
  148. package/dist/cli-usage.js +55 -40
  149. package/dist/cli-usage.js.map +1 -1
  150. package/dist/config.d.ts +1 -0
  151. package/dist/config.d.ts.map +1 -1
  152. package/dist/config.js +8 -2
  153. package/dist/config.js.map +1 -1
  154. package/dist/conversion-client.d.ts +4 -0
  155. package/dist/conversion-client.d.ts.map +1 -1
  156. package/dist/conversion-client.js.map +1 -1
  157. package/dist/conversion-outputs.d.ts +11 -0
  158. package/dist/conversion-outputs.d.ts.map +1 -1
  159. package/dist/conversion-outputs.js +13 -1
  160. package/dist/conversion-outputs.js.map +1 -1
  161. package/dist/conversion-receipt.d.ts +1 -1
  162. package/dist/conversion-receipt.js +1 -1
  163. package/dist/conversion-recovery.d.ts +20 -0
  164. package/dist/conversion-recovery.d.ts.map +1 -0
  165. package/dist/conversion-recovery.js +61 -0
  166. package/dist/conversion-recovery.js.map +1 -0
  167. package/dist/conversion-status-contract.js +1 -1
  168. package/dist/conversion-status-contract.js.map +1 -1
  169. package/dist/credential-setup.d.ts +9 -1
  170. package/dist/credential-setup.d.ts.map +1 -1
  171. package/dist/credential-setup.js +13 -1
  172. package/dist/credential-setup.js.map +1 -1
  173. package/dist/draft-adoption.d.ts +9 -3
  174. package/dist/draft-adoption.d.ts.map +1 -1
  175. package/dist/draft-adoption.js +26 -41
  176. package/dist/draft-adoption.js.map +1 -1
  177. package/dist/draft-identity.d.ts +9 -12
  178. package/dist/draft-identity.d.ts.map +1 -1
  179. package/dist/draft-identity.js +0 -0
  180. package/dist/draft-identity.js.map +1 -1
  181. package/dist/draft-run.d.ts +9 -19
  182. package/dist/draft-run.d.ts.map +1 -1
  183. package/dist/draft-run.js +67 -95
  184. package/dist/draft-run.js.map +1 -1
  185. package/dist/draft-workspace.d.ts +26 -18
  186. package/dist/draft-workspace.d.ts.map +1 -1
  187. package/dist/draft-workspace.js +16 -5
  188. package/dist/draft-workspace.js.map +1 -1
  189. package/dist/hosted-draft-identity.d.ts +20 -0
  190. package/dist/hosted-draft-identity.d.ts.map +1 -0
  191. package/dist/hosted-draft-identity.js +30 -0
  192. package/dist/hosted-draft-identity.js.map +1 -0
  193. package/dist/hosted-draft-run.d.ts +60 -0
  194. package/dist/hosted-draft-run.d.ts.map +1 -0
  195. package/dist/hosted-draft-run.js +97 -0
  196. package/dist/hosted-draft-run.js.map +1 -0
  197. package/dist/legacy-codex-cleanup.d.ts +13 -0
  198. package/dist/legacy-codex-cleanup.d.ts.map +1 -1
  199. package/dist/legacy-codex-cleanup.js +83 -0
  200. package/dist/legacy-codex-cleanup.js.map +1 -1
  201. package/dist/legacy-skill-catalog.d.ts +2 -2
  202. package/dist/legacy-skill-catalog.d.ts.map +1 -1
  203. package/dist/legacy-skill-catalog.js +76 -5
  204. package/dist/legacy-skill-catalog.js.map +1 -1
  205. package/dist/login-auth.d.ts +38 -0
  206. package/dist/login-auth.d.ts.map +1 -1
  207. package/dist/login-auth.js +67 -16
  208. package/dist/login-auth.js.map +1 -1
  209. package/dist/mcp-tool-definitions.js +1 -1
  210. package/dist/mcp-tool-definitions.js.map +1 -1
  211. package/dist/next-target.d.ts +1 -4
  212. package/dist/next-target.d.ts.map +1 -1
  213. package/dist/next-target.js +5 -9
  214. package/dist/next-target.js.map +1 -1
  215. package/dist/next-wait-lease.d.ts +17 -0
  216. package/dist/next-wait-lease.d.ts.map +1 -0
  217. package/dist/next-wait-lease.js +92 -0
  218. package/dist/next-wait-lease.js.map +1 -0
  219. package/dist/package-client.d.ts +30 -0
  220. package/dist/package-client.d.ts.map +1 -1
  221. package/dist/package-client.js.map +1 -1
  222. package/dist/package-submission.d.ts +17 -0
  223. package/dist/package-submission.d.ts.map +1 -1
  224. package/dist/package-submission.js +13 -0
  225. package/dist/package-submission.js.map +1 -1
  226. package/dist/pending-auth-store.d.ts +15 -0
  227. package/dist/pending-auth-store.d.ts.map +1 -0
  228. package/dist/pending-auth-store.js +90 -0
  229. package/dist/pending-auth-store.js.map +1 -0
  230. package/dist/responsive-quality.d.ts +2 -2
  231. package/dist/responsive-quality.js +2 -2
  232. package/dist/run-journal-commands.d.ts.map +1 -1
  233. package/dist/run-journal-commands.js +30 -78
  234. package/dist/run-journal-commands.js.map +1 -1
  235. package/dist/run-journal-in-flight.d.ts +2 -2
  236. package/dist/run-journal-in-flight.d.ts.map +1 -1
  237. package/dist/run-journal-in-flight.js +0 -0
  238. package/dist/run-journal-in-flight.js.map +1 -1
  239. package/dist/skill-installer.d.ts +2 -2
  240. package/dist/skill-installer.d.ts.map +1 -1
  241. package/dist/skill-installer.js +2 -2
  242. package/dist/skill-installer.js.map +1 -1
  243. package/open-design.json +3 -3
  244. package/package.json +1 -1
  245. package/skills/12ui-design/SKILL.md +62 -0
  246. package/skills/12ui-design/agents/openai.yaml +6 -0
  247. package/skills/12ui-design/inspire.md +11 -0
  248. package/dist/cli-create-command.d.ts +0 -59
  249. package/dist/cli-create-command.d.ts.map +0 -1
  250. package/dist/cli-create-command.js +0 -354
  251. package/dist/cli-create-command.js.map +0 -1
  252. package/dist/cli-export-command.d.ts +0 -26
  253. package/dist/cli-export-command.d.ts.map +0 -1
  254. package/dist/cli-export-command.js.map +0 -1
  255. package/dist/cli-export-output-directory.d.ts +0 -5
  256. package/dist/cli-export-output-directory.d.ts.map +0 -1
  257. package/dist/cli-export-output-directory.js.map +0 -1
  258. package/dist/cli-image-batch-command.d.ts +0 -29
  259. package/dist/cli-image-batch-command.d.ts.map +0 -1
  260. package/dist/cli-image-batch-command.js +0 -236
  261. package/dist/cli-image-batch-command.js.map +0 -1
  262. package/dist/cli-image-batch-materialize.d.ts +0 -27
  263. package/dist/cli-image-batch-materialize.d.ts.map +0 -1
  264. package/dist/cli-image-batch-materialize.js +0 -41
  265. package/dist/cli-image-batch-materialize.js.map +0 -1
  266. package/dist/cli-image-batch-resume.d.ts +0 -36
  267. package/dist/cli-image-batch-resume.d.ts.map +0 -1
  268. package/dist/cli-image-batch-resume.js +0 -176
  269. package/dist/cli-image-batch-resume.js.map +0 -1
  270. package/dist/cli-image-command.d.ts +0 -10
  271. package/dist/cli-image-command.d.ts.map +0 -1
  272. package/dist/cli-image-command.js +0 -106
  273. package/dist/cli-image-command.js.map +0 -1
  274. package/dist/cli-select-command.d.ts +0 -16
  275. package/dist/cli-select-command.d.ts.map +0 -1
  276. package/dist/cli-select-command.js +0 -60
  277. package/dist/cli-select-command.js.map +0 -1
  278. package/dist/create-identity.d.ts +0 -25
  279. package/dist/create-identity.d.ts.map +0 -1
  280. package/dist/create-identity.js +0 -0
  281. package/dist/create-identity.js.map +0 -1
  282. package/dist/draft-prompts.d.ts +0 -35
  283. package/dist/draft-prompts.d.ts.map +0 -1
  284. package/dist/draft-prompts.js +0 -51
  285. package/dist/draft-prompts.js.map +0 -1
  286. package/dist/image-batch-status.d.ts +0 -42
  287. package/dist/image-batch-status.d.ts.map +0 -1
  288. package/dist/image-batch-status.js +0 -143
  289. package/dist/image-batch-status.js.map +0 -1
  290. package/dist/image-generation-batch-attempt.d.ts +0 -28
  291. package/dist/image-generation-batch-attempt.d.ts.map +0 -1
  292. package/dist/image-generation-batch-attempt.js +0 -48
  293. package/dist/image-generation-batch-attempt.js.map +0 -1
  294. package/dist/image-generation-batch-manifest.d.ts +0 -25
  295. package/dist/image-generation-batch-manifest.d.ts.map +0 -1
  296. package/dist/image-generation-batch-manifest.js +0 -97
  297. package/dist/image-generation-batch-manifest.js.map +0 -1
  298. package/dist/image-generation-completion.d.ts +0 -43
  299. package/dist/image-generation-completion.d.ts.map +0 -1
  300. package/dist/image-generation-completion.js +0 -54
  301. package/dist/image-generation-completion.js.map +0 -1
  302. package/dist/image-generation-error.d.ts +0 -3
  303. package/dist/image-generation-error.d.ts.map +0 -1
  304. package/dist/image-generation-error.js +0 -30
  305. package/dist/image-generation-error.js.map +0 -1
  306. package/dist/image-generation-evidence.d.ts +0 -43
  307. package/dist/image-generation-evidence.d.ts.map +0 -1
  308. package/dist/image-generation-evidence.js +0 -28
  309. package/dist/image-generation-evidence.js.map +0 -1
  310. package/dist/image-generation-fs.d.ts +0 -3
  311. package/dist/image-generation-fs.d.ts.map +0 -1
  312. package/dist/image-generation-fs.js +0 -23
  313. package/dist/image-generation-fs.js.map +0 -1
  314. package/dist/image-generation-output.d.ts +0 -3
  315. package/dist/image-generation-output.d.ts.map +0 -1
  316. package/dist/image-generation-output.js +0 -51
  317. package/dist/image-generation-output.js.map +0 -1
  318. package/dist/image-generation-request.d.ts +0 -43
  319. package/dist/image-generation-request.d.ts.map +0 -1
  320. package/dist/image-generation-request.js +0 -52
  321. package/dist/image-generation-request.js.map +0 -1
  322. package/dist/image-generation-resume.d.ts +0 -49
  323. package/dist/image-generation-resume.d.ts.map +0 -1
  324. package/dist/image-generation-resume.js +0 -96
  325. package/dist/image-generation-resume.js.map +0 -1
  326. package/dist/image-generation-run.d.ts +0 -46
  327. package/dist/image-generation-run.d.ts.map +0 -1
  328. package/dist/image-generation-run.js +0 -158
  329. package/dist/image-generation-run.js.map +0 -1
  330. package/dist/image-generation-staging.d.ts +0 -25
  331. package/dist/image-generation-staging.d.ts.map +0 -1
  332. package/dist/image-generation-staging.js +0 -80
  333. package/dist/image-generation-staging.js.map +0 -1
  334. package/dist/image-generation-usage.d.ts +0 -75
  335. package/dist/image-generation-usage.d.ts.map +0 -1
  336. package/dist/image-generation-usage.js +0 -219
  337. package/dist/image-generation-usage.js.map +0 -1
  338. package/dist/image-provider-preflight.d.ts +0 -21
  339. package/dist/image-provider-preflight.d.ts.map +0 -1
  340. package/dist/image-provider-preflight.js +0 -184
  341. package/dist/image-provider-preflight.js.map +0 -1
  342. package/dist/selection-record.d.ts +0 -97
  343. package/dist/selection-record.d.ts.map +0 -1
  344. package/dist/selection-record.js +0 -138
  345. package/dist/selection-record.js.map +0 -1
  346. package/skills/design/SKILL.md +0 -116
  347. package/skills/design/agents/openai.yaml +0 -8
  348. package/skills/design/assets/large-logo.svg +0 -3
  349. package/skills/design/assets/small-400px.png +0 -0
@@ -1,18 +1,18 @@
1
1
  import { createHash } from 'node:crypto';
2
- import { readFile, writeFile } from 'node:fs/promises';
2
+ import { writeFile } from 'node:fs/promises';
3
3
  import path from 'node:path';
4
4
  import { materializeConversionArtifacts, } from './artifact-materializer.js';
5
- import { conversionExportKey } from './branch-identity.js';
6
- import { stringFlag } from './cli-arguments.js';
5
+ import { conversionDerivationKey } from './branch-identity.js';
6
+ import { booleanFlag, stringFlag } from './cli-arguments.js';
7
7
  import { CliRefusal } from './cli-refusal.js';
8
- import { exportManifestPath, exportOutputFilePath, prepareExportOutputDirectory, } from './cli-export-output-directory.js';
8
+ import { derivationManifestPath, derivedOutputFilePath, prepareDerivationOutputDirectory, } from './cli-conversion-output-directory.js';
9
9
  import { TwelveUiConversionClient, } from './conversion-client.js';
10
- import { isConversionOutput, } from './conversion-outputs.js';
10
+ import { isCliConversionOutput, } from './conversion-outputs.js';
11
11
  import { conversionIdYielding, isPendingConversionStatus, readConversionStatus, } from './conversion-status-contract.js';
12
12
  import { readConversionConfig } from './config.js';
13
13
  import { usageRefusal } from './cli-usage.js';
14
14
  import { normalizeOptionalIdempotencyKey } from './idempotency-key.js';
15
- import { parseConversionOutputProfile, } from './project-profiles.js';
15
+ import { OPERATION_DURATION_HINTS, createLongRunningProgress, formatDuration, } from './cli-progress.js';
16
16
  import { isResponsiveConversionQuality, } from './responsive-quality.js';
17
17
  const sha256 = (bytes) => (createHash('sha256').update(bytes).digest('hex'));
18
18
  const parseOutputs = (value) => {
@@ -21,47 +21,22 @@ const parseOutputs = (value) => {
21
21
  const outputs = value.split(',').map((entry) => entry.trim()).filter(Boolean);
22
22
  if (outputs.length === 0)
23
23
  throw new Error('--output is required');
24
- const invalid = outputs.filter((output) => !isConversionOutput(output));
24
+ const invalid = outputs.filter((output) => !isCliConversionOutput(output));
25
25
  if (invalid.length > 0)
26
- throw new Error(`Unsupported export output: ${invalid.join(', ')}`);
26
+ throw new Error(`Unsupported conversion output: ${invalid.join(', ')}`);
27
27
  return [...new Set(outputs)];
28
28
  };
29
- const readProfile = async (output, value) => {
30
- if (!value?.trim()) {
31
- throw new Error(`${output === 'web_project' ? '--web-profile' : '--app-profile'} is required`
32
- + ` when exporting ${output}`);
33
- }
34
- const trimmed = value.trim();
35
- const source = trimmed.startsWith('{')
36
- ? trimmed
37
- : await readFile(path.resolve(trimmed.startsWith('@') ? trimmed.slice(1) : trimmed), 'utf8');
38
- let parsed;
39
- try {
40
- parsed = JSON.parse(source);
41
- }
42
- catch (error) {
43
- throw new Error(`Invalid ${output} profile JSON: ${error instanceof Error ? error.message : String(error)}`);
44
- }
45
- return parseConversionOutputProfile(output, parsed);
46
- };
47
29
  const outputIdempotencyKey = (base, output, requestShapeSha256) => {
48
30
  const suffix = `${output}:${requestShapeSha256.slice(0, 32)}`;
49
31
  return `${base.slice(0, 128 - suffix.length - 1)}:${suffix}`;
50
32
  };
51
- const prepareExportPlan = (args) => {
33
+ const prepareDerivationPlan = (args) => {
52
34
  const requestShape = args.output === 'html'
53
35
  ? {
54
36
  output: args.output,
55
37
  responsiveQuality: args.responsiveQuality,
56
38
  }
57
- : args.output === 'web_project' || args.output === 'app_project'
58
- ? {
59
- output: args.output,
60
- profile: args.profile,
61
- }
62
- : {
63
- output: args.output,
64
- };
39
+ : { output: args.output };
65
40
  const requestShapeSha256 = sha256(Buffer.from(JSON.stringify(requestShape)));
66
41
  return {
67
42
  output: args.output,
@@ -73,31 +48,30 @@ const prepareExportPlan = (args) => {
73
48
  ...(args.output === 'html'
74
49
  ? { responsiveQuality: args.responsiveQuality }
75
50
  : {}),
76
- ...(args.output === 'web_project' || args.output === 'app_project'
77
- ? { profile: args.profile }
78
- : {}),
79
51
  },
80
52
  };
81
53
  };
82
54
  /** A rejection that knows which conversion it was waiting on. */
83
- class ExportAttemptError extends Error {
55
+ class DerivationAttemptError extends Error {
84
56
  conversionId;
85
57
  constructor(message, conversionId, options) {
86
58
  super(message, options);
87
- this.name = 'ExportAttemptError';
59
+ this.name = 'DerivationAttemptError';
88
60
  this.conversionId = conversionId;
89
61
  }
90
62
  }
91
- const waitForSuccess = async (client, operation, timeoutMs) => {
63
+ const waitForSuccess = async (client, operation, timeoutMs, onProgress) => {
64
+ onProgress?.(operation);
92
65
  if (operation.status === 'succeeded')
93
66
  return operation;
94
67
  return client.waitForConversion(operation.id, {
95
68
  expiresAt: operation.expires_at,
96
69
  timeoutMs,
70
+ ...(onProgress ? { onProgress } : {}),
97
71
  });
98
72
  };
99
- const exportOne = async (args) => {
100
- const outFile = exportOutputFilePath(args.outDir, args.plan.output);
73
+ const deriveOne = async (args) => {
74
+ const outFile = derivedOutputFilePath(args.outDir, args.plan.output);
101
75
  if (args.plan.output === 'layerdoc') {
102
76
  await writeFile(outFile, args.baseLayerDoc, { flag: 'wx' });
103
77
  return {
@@ -123,106 +97,138 @@ const exportOne = async (args) => {
123
97
  idempotencyKey: shared.idempotencyKey,
124
98
  waitSeconds: shared.waitSeconds,
125
99
  }
126
- : args.plan.output === 'web_project'
127
- ? {
128
- layerdoc: args.baseLayerDoc,
129
- filename: `${args.source.id}.layerdoc.json`,
130
- sourceConversionId: args.source.id,
131
- output: 'web_project',
132
- profile: args.plan.request.profile,
133
- idempotencyKey: shared.idempotencyKey,
134
- waitSeconds: shared.waitSeconds,
135
- }
136
- : args.plan.output === 'app_project'
137
- ? {
138
- layerdoc: args.baseLayerDoc,
139
- filename: `${args.source.id}.layerdoc.json`,
140
- sourceConversionId: args.source.id,
141
- output: 'app_project',
142
- profile: args.plan.request.profile,
143
- idempotencyKey: shared.idempotencyKey,
144
- waitSeconds: shared.waitSeconds,
145
- }
146
- : {
147
- layerdoc: args.baseLayerDoc,
148
- filename: `${args.source.id}.layerdoc.json`,
149
- sourceConversionId: args.source.id,
150
- output: args.plan.output,
151
- idempotencyKey: shared.idempotencyKey,
152
- waitSeconds: shared.waitSeconds,
153
- };
100
+ : {
101
+ layerdoc: args.baseLayerDoc,
102
+ filename: `${args.source.id}.layerdoc.json`,
103
+ sourceConversionId: args.source.id,
104
+ output: args.plan.output,
105
+ idempotencyKey: shared.idempotencyKey,
106
+ waitSeconds: shared.waitSeconds,
107
+ };
154
108
  const dispatched = await args.client.createConversion(input);
109
+ // Identity said once per format, when it exists — never on every tick.
110
+ args.progress.note(`${args.plan.output}: conversion ${dispatched.id}`);
111
+ const publish = (operation) => {
112
+ args.progress.update({
113
+ stage: operation.status === 'succeeded'
114
+ ? 'collecting'
115
+ : operation.progress?.stage ?? operation.status,
116
+ completed: args.completed(),
117
+ total: args.total,
118
+ unit: 'formats settled',
119
+ running: args.running(),
120
+ detail: args.plan.output,
121
+ });
122
+ };
155
123
  let completed;
156
124
  try {
157
- completed = await waitForSuccess(args.client, dispatched, args.timeoutMs);
125
+ completed = await waitForSuccess(args.client, dispatched, args.timeoutMs, publish);
158
126
  }
159
127
  catch (error) {
160
128
  // The id travels with the failure. Without it the manifest names a format
161
129
  // and a message, and a caller holding a merely-slow export has nothing to
162
130
  // collect it with except another conversion.
163
- throw new ExportAttemptError(error instanceof Error ? error.message : String(error), dispatched.id, { cause: error });
131
+ throw new DerivationAttemptError(error instanceof Error ? error.message : String(error), dispatched.id, { cause: error });
164
132
  }
165
133
  const downloaded = await args.client.downloadResult(completed.id, args.plan.output);
166
134
  await writeFile(outFile, downloaded.bytes, { flag: 'wx' });
135
+ const manifest = await materializeConversionArtifacts(args.client, completed, outFile);
167
136
  return {
168
137
  output: args.plan.output,
169
138
  conversionId: completed.id,
170
139
  outFile,
171
- artifactManifest: await materializeConversionArtifacts(args.client, completed, outFile),
140
+ artifactManifest: {
141
+ conversionId: manifest.conversionId,
142
+ operationExpiresAt: manifest.operationExpiresAt,
143
+ manifestFile: manifest.manifestFile,
144
+ artifactCount: manifest.artifacts.length,
145
+ },
172
146
  request: args.plan.request,
173
147
  };
174
148
  };
175
- export const runExportCommand = async (sourceConversionId, flags) => {
149
+ export const runConversionDerivation = async (sourceConversionId, flags) => {
176
150
  const sourceId = sourceConversionId?.trim();
177
151
  if (!sourceId) {
178
152
  throw usageRefusal({
179
- reason: 'An export derives new formats from one finished layerdoc conversion, and no source'
153
+ reason: 'A conversion-id input derives new formats from one finished LayerDoc conversion,'
154
+ + ' and no source'
180
155
  + ' conversion id was given.',
181
- code: 'export_usage',
182
- verb: ['export'],
156
+ code: 'convert_usage',
157
+ verb: ['convert'],
183
158
  });
184
159
  }
185
160
  const outputs = parseOutputs(stringFlag(flags, 'output'));
186
161
  const outDirValue = stringFlag(flags, 'out-dir');
187
162
  if (!outDirValue)
188
- throw new CliRefusal('--out-dir is required', 'export_out_dir_missing');
163
+ throw new CliRefusal('--out-dir is required', 'convert_out_dir_missing');
189
164
  const outDir = path.resolve(outDirValue);
190
- const idempotencyKey = normalizeOptionalIdempotencyKey(stringFlag(flags, 'idempotency-key'), '--idempotency-key') ?? conversionExportKey({ sourceConversionId: sourceId });
165
+ const idempotencyKey = normalizeOptionalIdempotencyKey(stringFlag(flags, 'idempotency-key'), '--idempotency-key') ?? conversionDerivationKey({ sourceConversionId: sourceId });
191
166
  const responsiveValue = stringFlag(flags, 'responsive-quality') ?? 'standard';
192
167
  if (!isResponsiveConversionQuality(responsiveValue)) {
193
168
  throw new Error('--responsive-quality must be standard or pro');
194
169
  }
195
- const [webProfile, appProfile] = await Promise.all([
196
- outputs.includes('web_project')
197
- ? readProfile('web_project', stringFlag(flags, 'web-profile'))
198
- : undefined,
199
- outputs.includes('app_project')
200
- ? readProfile('app_project', stringFlag(flags, 'app-profile'))
201
- : undefined,
202
- ]);
203
- await prepareExportOutputDirectory(outDir, outputs);
170
+ await prepareDerivationOutputDirectory(outDir, outputs);
204
171
  const client = new TwelveUiConversionClient(readConversionConfig({
205
172
  origin: stringFlag(flags, 'origin'),
206
173
  apiKey: stringFlag(flags, 'api-key'),
207
174
  }));
208
- const source = await client.getConversion(sourceId);
175
+ const progress = createLongRunningProgress({
176
+ label: `derive ${sourceId}`,
177
+ typicalSeconds: OPERATION_DURATION_HINTS.derivation,
178
+ quiet: booleanFlag(flags, 'quiet'),
179
+ });
180
+ // No single number is honest here: a format the server has already
181
+ // rendered replays in seconds, a fresh export dispatch takes minutes, and
182
+ // which of the two this run is only becomes known per format after
183
+ // submission. The board measured the numeric quote as a +3m44 worst
184
+ // overstatement on a 16s replay; the conditional sentence IS the good
185
+ // estimate for a bimodal wait, and each dispatch announces itself below.
186
+ progress.brief({
187
+ request: `derive ${outputs.join(', ')} from conversion ${sourceId}`,
188
+ ...(outputs.includes('html')
189
+ ? { paid: '1 responsive export (html); the other formats are free derivations' }
190
+ : { free: 'every requested format derives from the finished document without a new purchase' }),
191
+ done: `one file per requested format in ${outDir}, plus a derivation manifest`,
192
+ blocking: true,
193
+ });
194
+ progress.note('replayed formats land in seconds; a freshly dispatched export runs'
195
+ + ` ~${formatDuration(OPERATION_DURATION_HINTS.derivation)} and is announced when it starts`);
196
+ progress.update({
197
+ stage: 'prepare',
198
+ completed: 0,
199
+ total: outputs.length,
200
+ unit: 'formats settled',
201
+ detail: 'reading the source conversion',
202
+ });
203
+ const source = await client.getConversion(sourceId).catch((error) => {
204
+ progress.finish('stopped', {
205
+ detail: error instanceof Error ? error.message : String(error),
206
+ });
207
+ throw error;
208
+ });
209
209
  // Not finished and wrong kind are different facts, and answering both with
210
210
  // one sentence is what sent a measured run off to buy a second conversion of
211
211
  // the same image. Each gets its own answer, and each names the id that works.
212
212
  if (source.output !== 'layerdoc') {
213
+ progress.finish('stopped', { detail: `source produces ${source.output}, not layerdoc` });
213
214
  const document = conversionIdYielding(source, 'layerdoc');
214
215
  throw new Error(`Source conversion ${sourceId} produces ${source.output}; only a layerdoc conversion can be`
215
- + ` exported.${document
216
- ? ` Its document is ${document}: export that one.`
216
+ + ` used as a derivation source.${document
217
+ ? ` Its document is ${document}: convert from that one.`
217
218
  : ' Name the layerdoc conversion this one derives from.'}`);
218
219
  }
219
220
  if (isPendingConversionStatus(source.status)) {
221
+ progress.finish('stopped', {
222
+ detail: `source conversion is ${source.status}, not finished; nothing was bought`,
223
+ next: `12ui resume ${sourceId} --output layerdoc --out <file> blocks until it settles`,
224
+ });
220
225
  throw new Error(`Source conversion ${sourceId} is ${source.status}, not finished. Nothing failed and nothing`
221
226
  + ` was bought here. Leave \`12ui resume ${sourceId} --output layerdoc --out <file>\` running,`
222
- + ' which blocks until it settles, then export it.');
227
+ + ' which blocks until it settles, then derive from it.');
223
228
  }
224
229
  if (source.status !== 'succeeded') {
225
- throw new Error(`Source conversion ${sourceId} ${source.status}; there is nothing to export.`);
230
+ progress.finish('failed', { detail: `source conversion ${source.status}; there is nothing to derive` });
231
+ throw new Error(`Source conversion ${sourceId} ${source.status}; there is nothing to derive.`);
226
232
  }
227
233
  // Read through `conversionIdYielding` rather than off the field: the link
228
234
  // from a conversion to the id that yields a given format lives in one module,
@@ -237,7 +243,7 @@ export const runExportCommand = async (sourceConversionId, flags) => {
237
243
  // the one that exists, at the last moment it is still free.
238
244
  process.stderr.write(`Conversion ${sourceId} already carries a responsive HTML export: ${existingHtmlExport}.`
239
245
  + ` Collect it with \`12ui resume ${existingHtmlExport} --output html --out <file>\` rather`
240
- + ' than paying for a second one. Continuing with the export you asked for.\n');
246
+ + ' than paying for a second one. Continuing with the derivation you asked for.\n');
241
247
  }
242
248
  const baseLayerDoc = (await client.downloadResult(source.id, 'layerdoc')).bytes;
243
249
  const timeoutValue = stringFlag(flags, 'timeout-ms');
@@ -245,21 +251,50 @@ export const runExportCommand = async (sourceConversionId, flags) => {
245
251
  if (timeoutMs !== undefined && (!Number.isFinite(timeoutMs) || timeoutMs < 1_000)) {
246
252
  throw new Error('--timeout-ms must be a number of at least 1000');
247
253
  }
248
- const plans = outputs.map((output) => prepareExportPlan({
254
+ const plans = outputs.map((output) => prepareDerivationPlan({
249
255
  idempotencyKey,
250
256
  output,
251
- profile: output === 'web_project' ? webProfile : output === 'app_project' ? appProfile : undefined,
252
257
  responsiveQuality: responsiveValue,
253
258
  }));
254
259
  const preparedAt = new Date().toISOString();
255
- const settled = await Promise.allSettled(plans.map((plan) => exportOne({
256
- baseLayerDoc,
257
- client,
258
- outDir,
259
- plan,
260
- source,
261
- timeoutMs,
262
- })));
260
+ let completedCount = 0;
261
+ const active = new Set(plans.map((plan) => plan.output));
262
+ progress.update({
263
+ stage: 'queued',
264
+ completed: 0,
265
+ total: plans.length,
266
+ unit: 'formats settled',
267
+ running: active.size,
268
+ detail: `active: ${[...active].join(', ')}`,
269
+ });
270
+ const settled = await Promise.allSettled(plans.map(async (plan) => {
271
+ try {
272
+ return await deriveOne({
273
+ baseLayerDoc,
274
+ client,
275
+ outDir,
276
+ plan,
277
+ source,
278
+ timeoutMs,
279
+ progress,
280
+ completed: () => completedCount,
281
+ running: () => active.size,
282
+ total: plans.length,
283
+ });
284
+ }
285
+ finally {
286
+ active.delete(plan.output);
287
+ completedCount += 1;
288
+ progress.update({
289
+ stage: 'collecting',
290
+ completed: completedCount,
291
+ total: plans.length,
292
+ unit: 'formats settled',
293
+ running: active.size,
294
+ detail: `settled ${plan.output}${active.size > 0 ? `; active: ${[...active].join(', ')}` : ''}`,
295
+ });
296
+ }
297
+ }));
263
298
  const results = settled.flatMap((result) => result.status === 'fulfilled' ? [result.value] : []);
264
299
  // A wait that ended without the bytes is not the same fact as a conversion
265
300
  // that failed. One free read per rejection settles which it was, and a
@@ -267,7 +302,7 @@ export const runExportCommand = async (sourceConversionId, flags) => {
267
302
  // the id that collects it.
268
303
  const failures = await Promise.all(settled.flatMap((result, index) => result.status === 'rejected'
269
304
  ? [(async () => {
270
- const conversionId = result.reason instanceof ExportAttemptError
305
+ const conversionId = result.reason instanceof DerivationAttemptError
271
306
  ? result.reason.conversionId
272
307
  : null;
273
308
  const status = conversionId ? await readConversionStatus(client, conversionId) : 'unknown';
@@ -281,7 +316,7 @@ export const runExportCommand = async (sourceConversionId, flags) => {
281
316
  };
282
317
  })()]
283
318
  : []));
284
- const manifestPath = exportManifestPath(outDir);
319
+ const manifestPath = derivationManifestPath(outDir);
285
320
  await writeFile(manifestPath, `${JSON.stringify({
286
321
  schemaVersion: 2,
287
322
  sourceConversionId: source.id,
@@ -297,11 +332,44 @@ export const runExportCommand = async (sourceConversionId, flags) => {
297
332
  ? `${failure.output}: ${failure.conversionId} is ${failure.status}, not failed; collect it`
298
333
  + ` with \`12ui resume ${failure.conversionId} --output ${failure.output} --out <file>\``
299
334
  : `${failure.output}: ${failure.error}`);
335
+ progress.finish(failures.every((failure) => failure.pending) ? 'deadline' : 'partial', {
336
+ detail: failures.every((failure) => failure.pending)
337
+ ? 'client wait ended; paid work continues server-side'
338
+ : `${failures.length} requested format(s) did not settle`,
339
+ artifacts: [
340
+ ...results.map((result) => ({
341
+ name: result.output,
342
+ state: 'succeeded',
343
+ path: result.outFile,
344
+ })),
345
+ ...failures.map((failure) => (failure.pending
346
+ ? {
347
+ name: failure.output,
348
+ state: `still running server-side (${failure.status})`,
349
+ ...(failure.conversionId
350
+ ? { note: `collect free with: 12ui resume ${failure.conversionId} --output ${failure.output} --out <file>` }
351
+ : {}),
352
+ }
353
+ : { name: failure.output, state: 'failed', note: failure.error })),
354
+ ],
355
+ next: `evidence and every id: ${manifestPath}`,
356
+ });
300
357
  throw new Error(`${failures.every((failure) => failure.pending)
301
- ? 'One or more exports have not settled yet'
302
- : 'One or more exports failed without redispatch'}:`
358
+ ? 'One or more derivations have not settled yet'
359
+ : 'One or more derivations failed without redispatch'}:`
303
360
  + ` ${failures.map(describe).join('; ')}. Evidence: ${manifestPath}`);
304
361
  }
362
+ progress.finish('succeeded', {
363
+ artifacts: results.map((result) => ({
364
+ name: result.output,
365
+ state: 'succeeded',
366
+ path: result.outFile,
367
+ })),
368
+ spend: outputs.includes('html')
369
+ ? '1 responsive export purchased; the other formats derived free'
370
+ : 'nothing — every format derived free from the finished document',
371
+ next: `derivation manifest: ${manifestPath}`,
372
+ });
305
373
  console.log(JSON.stringify({
306
374
  sourceConversionId: source.id,
307
375
  sourceLayerDocSha256: sha256(baseLayerDoc),
@@ -310,4 +378,4 @@ export const runExportCommand = async (sourceConversionId, flags) => {
310
378
  }, null, 2));
311
379
  return { sourceConversionId: source.id, manifestPath, results };
312
380
  };
313
- //# sourceMappingURL=cli-export-command.js.map
381
+ //# sourceMappingURL=cli-conversion-derivation.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cli-conversion-derivation.js","sourceRoot":"","sources":["../src/cli-conversion-derivation.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAC7C,OAAO,IAAI,MAAM,WAAW,CAAC;AAE7B,OAAO,EACL,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 import { type ConversionOutput } from './conversion-outputs.js';
2
+ export declare const derivedOutputFilePath: (outDir: string, output: ConversionOutput) => string;
3
+ export declare const derivationManifestPath: (outDir: string) => string;
4
+ export declare const prepareDerivationOutputDirectory: (outDir: string, outputs: readonly ConversionOutput[]) => Promise<void>;
5
+ //# sourceMappingURL=cli-conversion-output-directory.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cli-conversion-output-directory.d.ts","sourceRoot":"","sources":["../src/cli-conversion-output-directory.ts"],"names":[],"mappings":"AAIA,OAAO,EAEL,KAAK,gBAAgB,EACtB,MAAM,yBAAyB,CAAC;AAEjC,eAAO,MAAM,qBAAqB,GAChC,QAAQ,MAAM,EACd,QAAQ,gBAAgB,KACvB,MAOF,CAAC;AAEF,eAAO,MAAM,sBAAsB,GAAI,QAAQ,MAAM,KAAG,MAEvD,CAAC;AAYF,eAAO,MAAM,gCAAgC,GAC3C,QAAQ,MAAM,EACd,SAAS,SAAS,gBAAgB,EAAE,KACnC,OAAO,CAAC,IAAI,CAkBd,CAAC"}
@@ -2,12 +2,12 @@ import { lstat } from 'node:fs/promises';
2
2
  import path from 'node:path';
3
3
  import { prepareOutputDirectory } from './cli-output-paths.js';
4
4
  import { CONVERSION_OUTPUT_FILENAME_SUFFIXES, } from './conversion-outputs.js';
5
- export const exportOutputFilePath = (outDir, output) => path.join(outDir, output === 'html'
6
- ? 'export.responsive.html'
5
+ export const derivedOutputFilePath = (outDir, output) => path.join(outDir, output === 'html'
6
+ ? 'derived.responsive.html'
7
7
  : output === 'html_fixed'
8
- ? 'export.fixed.html'
9
- : `export.${CONVERSION_OUTPUT_FILENAME_SUFFIXES[output]}`);
10
- export const exportManifestPath = (outDir) => (path.join(outDir, 'export-manifest.json'));
8
+ ? 'derived.fixed.html'
9
+ : `derived.${CONVERSION_OUTPUT_FILENAME_SUFFIXES[output]}`);
10
+ export const derivationManifestPath = (outDir) => (path.join(outDir, 'derivation-manifest.json'));
11
11
  const pathExists = async (target) => {
12
12
  try {
13
13
  await lstat(target);
@@ -19,17 +19,17 @@ const pathExists = async (target) => {
19
19
  throw error;
20
20
  }
21
21
  };
22
- export const prepareExportOutputDirectory = async (outDir, outputs) => {
22
+ export const prepareDerivationOutputDirectory = async (outDir, outputs) => {
23
23
  await prepareOutputDirectory(outDir);
24
- const outputFiles = outputs.map((output) => exportOutputFilePath(outDir, output));
24
+ const outputFiles = outputs.map((output) => derivedOutputFilePath(outDir, output));
25
25
  const reservedPaths = [
26
- exportManifestPath(outDir),
26
+ derivationManifestPath(outDir),
27
27
  ...outputFiles,
28
28
  ...outputFiles.flatMap((outputFile, index) => (outputs[index] === 'layerdoc' ? [] : [`${outputFile}.assets`])),
29
29
  ];
30
30
  const conflicts = (await Promise.all(reservedPaths.map(async (target) => (await pathExists(target) ? target : null)))).filter((target) => target !== null);
31
31
  if (conflicts.length > 0) {
32
- throw new Error(`Refusing export because destination path already exists: ${conflicts.join(', ')}`);
32
+ throw new Error(`Refusing derivation because destination path already exists: ${conflicts.join(', ')}`);
33
33
  }
34
34
  };
35
- //# sourceMappingURL=cli-export-output-directory.js.map
35
+ //# sourceMappingURL=cli-conversion-output-directory.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cli-conversion-output-directory.js","sourceRoot":"","sources":["../src/cli-conversion-output-directory.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAC;AACzC,OAAO,IAAI,MAAM,WAAW,CAAC;AAE7B,OAAO,EAAE,sBAAsB,EAAE,MAAM,uBAAuB,CAAC;AAC/D,OAAO,EACL,mCAAmC,GAEpC,MAAM,yBAAyB,CAAC;AAEjC,MAAM,CAAC,MAAM,qBAAqB,GAAG,CACnC,MAAc,EACd,MAAwB,EAChB,EAAE,CAAC,IAAI,CAAC,IAAI,CACpB,MAAM,EACN,MAAM,KAAK,MAAM;IACf,CAAC,CAAC,yBAAyB;IAC3B,CAAC,CAAC,MAAM,KAAK,YAAY;QACvB,CAAC,C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C,CAAC,MAAM,CAAC,CAAC,CAAC,IAAI,CACzC,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,MAAM,EAAoB,EAAE,CAAC,MAAM,KAAK,IAAI,CAAC,CAAC;IAC3D,IAAI,SAAS,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QACzB,MAAM,IAAI,KAAK,CACb,gEAAgE,SAAS,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CACvF,CAAC;IACJ,CAAC;AACH,CAAC,CAAC"}
@@ -1,4 +1,5 @@
1
1
  import { type CliFlags } from './cli-arguments.js';
2
+ import { type ObservedConversionStatus } from './conversion-status-contract.js';
2
3
  import { type InFlightRunJournalRecord } from './run-journal-in-flight.js';
3
4
  import type { RunJournalNotes } from './run-journal.js';
4
5
  /**
@@ -19,6 +20,14 @@ export declare const parseTimeoutMs: (value?: string) => number | undefined;
19
20
  * the command that wrote the file is the one that knows there is no page.
20
21
  */
21
22
  export declare const layerDocPageAction: (outFile: string) => string;
23
+ export declare const layerDocStateAction: (args: {
24
+ outFile: string;
25
+ linkedExport?: {
26
+ id: string;
27
+ status: ObservedConversionStatus;
28
+ outFile?: string;
29
+ };
30
+ }) => string;
22
31
  /**
23
32
  * A conversion of these exact bytes is already running in this workspace.
24
33
  *
@@ -1 +1 @@
1
- {"version":3,"file":"cli-convert-command.d.ts","sourceRoot":"","sources":["../src/cli-convert-command.ts"],"names":[],"mappings":"AAKA,OAAO,EAA2B,KAAK,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AA0C5E,OAAO,EAGL,KAAK,wBAAwB,EAC9B,MAAM,4BAA4B,CAAC;AACpC,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AAExD;;;;GAIG;AAEH,eAAO,MAAM,cAAc,GAAI,QAAQ,MAAM,KAAG,MAAM,GAAG,SAOxD,CAAC;AAyCF;;;;;;;;;;GAUG;AACH,eAAO,MAAM,kBAAkB,GAAI,SAAS,MAAM,KAAG,MAI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