openplanr 3.2.0 → 3.4.0

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 (411) hide show
  1. package/CHANGELOG.md +73 -0
  2. package/dist/cli/commands/artifact-design-share.d.ts +9 -0
  3. package/dist/cli/commands/artifact-design-share.d.ts.map +1 -0
  4. package/dist/cli/commands/artifact-design-share.js +200 -0
  5. package/dist/cli/commands/artifact-design-share.js.map +1 -0
  6. package/dist/cli/commands/artifact.d.ts.map +1 -1
  7. package/dist/cli/commands/artifact.js +5 -18
  8. package/dist/cli/commands/artifact.js.map +1 -1
  9. package/dist/cli/commands/ship.d.ts.map +1 -1
  10. package/dist/cli/commands/ship.js +2 -0
  11. package/dist/cli/commands/ship.js.map +1 -1
  12. package/dist/cli/commands/spec.d.ts +2 -1
  13. package/dist/cli/commands/spec.d.ts.map +1 -1
  14. package/dist/cli/commands/spec.js +45 -5
  15. package/dist/cli/commands/spec.js.map +1 -1
  16. package/dist/dashboard/.vite/manifest.json +2 -2
  17. package/dist/dashboard/assets/index-Cv4Vwhuw.css +2 -0
  18. package/dist/dashboard/assets/index-CvQAlBy3.js +75 -0
  19. package/dist/dashboard/assets/index-CvQAlBy3.js.map +1 -0
  20. package/dist/dashboard/dashboard-manifest.json +14 -14
  21. package/dist/dashboard/index.html +2 -2
  22. package/dist/services/claude-plugin-service.d.ts +5 -0
  23. package/dist/services/claude-plugin-service.d.ts.map +1 -1
  24. package/dist/services/claude-plugin-service.js +18 -2
  25. package/dist/services/claude-plugin-service.js.map +1 -1
  26. package/dist/services/codex-plugin-service.d.ts.map +1 -1
  27. package/dist/services/codex-plugin-service.js +11 -3
  28. package/dist/services/codex-plugin-service.js.map +1 -1
  29. package/dist/services/design-artifact-service.d.ts +20 -1
  30. package/dist/services/design-artifact-service.d.ts.map +1 -1
  31. package/dist/services/design-artifact-service.js +137 -18
  32. package/dist/services/design-artifact-service.js.map +1 -1
  33. package/dist/services/runtime-manager/codex-discovery.d.ts +1 -3
  34. package/dist/services/runtime-manager/codex-discovery.d.ts.map +1 -1
  35. package/dist/services/runtime-manager/codex-discovery.js +3 -16
  36. package/dist/services/runtime-manager/codex-discovery.js.map +1 -1
  37. package/dist/services/runtime-manager/doctor.d.ts +25 -0
  38. package/dist/services/runtime-manager/doctor.d.ts.map +1 -1
  39. package/dist/services/runtime-manager/doctor.js +480 -0
  40. package/dist/services/runtime-manager/doctor.js.map +1 -1
  41. package/dist/services/runtime-manager/errors.d.ts +12 -0
  42. package/dist/services/runtime-manager/errors.d.ts.map +1 -0
  43. package/dist/services/runtime-manager/errors.js +14 -0
  44. package/dist/services/runtime-manager/errors.js.map +1 -0
  45. package/dist/services/runtime-manager/global-state.d.ts +7 -0
  46. package/dist/services/runtime-manager/global-state.d.ts.map +1 -1
  47. package/dist/services/runtime-manager/global-state.js +116 -0
  48. package/dist/services/runtime-manager/global-state.js.map +1 -1
  49. package/dist/services/runtime-manager/host-version-probe.d.ts +8 -0
  50. package/dist/services/runtime-manager/host-version-probe.d.ts.map +1 -0
  51. package/dist/services/runtime-manager/host-version-probe.js +14 -0
  52. package/dist/services/runtime-manager/host-version-probe.js.map +1 -0
  53. package/dist/services/runtime-manager/install-plan.d.ts +25 -0
  54. package/dist/services/runtime-manager/install-plan.d.ts.map +1 -1
  55. package/dist/services/runtime-manager/install-plan.js +305 -0
  56. package/dist/services/runtime-manager/install-plan.js.map +1 -1
  57. package/dist/services/runtime-manager/inventory.d.ts +6 -0
  58. package/dist/services/runtime-manager/inventory.d.ts.map +1 -1
  59. package/dist/services/runtime-manager/inventory.js +16 -1
  60. package/dist/services/runtime-manager/inventory.js.map +1 -1
  61. package/dist/services/runtime-manager/legacy-adapters.d.ts +9 -0
  62. package/dist/services/runtime-manager/legacy-adapters.d.ts.map +1 -0
  63. package/dist/services/runtime-manager/legacy-adapters.js +187 -0
  64. package/dist/services/runtime-manager/legacy-adapters.js.map +1 -0
  65. package/dist/services/runtime-manager/paths.d.ts +18 -0
  66. package/dist/services/runtime-manager/paths.d.ts.map +1 -0
  67. package/dist/services/runtime-manager/paths.js +83 -0
  68. package/dist/services/runtime-manager/paths.js.map +1 -0
  69. package/dist/services/runtime-manager/runtime-package.d.ts +21 -0
  70. package/dist/services/runtime-manager/runtime-package.d.ts.map +1 -1
  71. package/dist/services/runtime-manager/runtime-package.js +77 -0
  72. package/dist/services/runtime-manager/runtime-package.js.map +1 -1
  73. package/dist/services/runtime-manager/storage.d.ts +47 -0
  74. package/dist/services/runtime-manager/storage.d.ts.map +1 -0
  75. package/dist/services/runtime-manager/storage.js +604 -0
  76. package/dist/services/runtime-manager/storage.js.map +1 -0
  77. package/dist/services/runtime-manager-service.d.ts +7 -17
  78. package/dist/services/runtime-manager-service.d.ts.map +1 -1
  79. package/dist/services/runtime-manager-service.js +32 -1695
  80. package/dist/services/runtime-manager-service.js.map +1 -1
  81. package/dist/services/ship-checks/contract.d.ts +15 -1
  82. package/dist/services/ship-checks/contract.d.ts.map +1 -1
  83. package/dist/services/ship-checks/contract.js +1 -1
  84. package/dist/services/ship-checks/contract.js.map +1 -1
  85. package/dist/services/ship-checks/coverage.d.ts +4 -0
  86. package/dist/services/ship-checks/coverage.d.ts.map +1 -0
  87. package/dist/services/ship-checks/coverage.js +113 -0
  88. package/dist/services/ship-checks/coverage.js.map +1 -0
  89. package/dist/services/ship-checks/discover.d.ts.map +1 -1
  90. package/dist/services/ship-checks/discover.js +5 -1
  91. package/dist/services/ship-checks/discover.js.map +1 -1
  92. package/dist/services/ship-checks/package-contents.d.ts +4 -0
  93. package/dist/services/ship-checks/package-contents.d.ts.map +1 -0
  94. package/dist/services/ship-checks/package-contents.js +91 -0
  95. package/dist/services/ship-checks/package-contents.js.map +1 -0
  96. package/dist/services/ship-checks/packages.d.ts +2 -0
  97. package/dist/services/ship-checks/packages.d.ts.map +1 -1
  98. package/dist/services/ship-checks/packages.js +4 -0
  99. package/dist/services/ship-checks/packages.js.map +1 -1
  100. package/dist/services/ship-checks/scope.js +2 -1
  101. package/dist/services/ship-checks/scope.js.map +1 -1
  102. package/dist/services/spec-service.d.ts +18 -0
  103. package/dist/services/spec-service.d.ts.map +1 -1
  104. package/dist/services/spec-service.js +174 -9
  105. package/dist/services/spec-service.js.map +1 -1
  106. package/dist/templates/spec/spec-shaped.md.hbs +1 -1
  107. package/dist/templates/spec/spec.md.hbs +2 -2
  108. package/dist/utils/splice-managed-block.js +1 -1
  109. package/dist/utils/splice-managed-block.js.map +1 -1
  110. package/docs/CLI.md +86 -2
  111. package/lib/host-packages/adapter-registry.json +5 -5
  112. package/lib/host-packages/capability-map.json +3 -3
  113. package/lib/host-packages/claude/.claude-plugin/marketplace.json +3 -3
  114. package/lib/host-packages/claude/openplanr/.claude-plugin/plugin.json +6 -6
  115. package/lib/host-packages/claude/openplanr/.openplanr-content.json +94 -146
  116. package/lib/host-packages/claude/openplanr/README.md +12 -12
  117. package/lib/host-packages/claude/openplanr/agents/planr-qa.md +5 -3
  118. package/lib/host-packages/claude/openplanr/references/agents/shared/modes/shared/task-context-resolution.md +4 -4
  119. package/lib/host-packages/claude/openplanr/runtime/design/scripts/design-artifact-shell.mjs +2 -4
  120. package/lib/host-packages/claude/openplanr/runtime/design/scripts/design-document.mjs +110 -25
  121. package/lib/host-packages/claude/openplanr/runtime/design/scripts/design-handoff.mjs +851 -57
  122. package/lib/host-packages/claude/openplanr/runtime/design/scripts/design-review-state-store.mjs +45 -0
  123. package/lib/host-packages/claude/openplanr/runtime/design/scripts/design-review.mjs +65 -74
  124. package/lib/host-packages/claude/openplanr/runtime/design/scripts/design-runtime-home.mjs +0 -1
  125. package/lib/host-packages/claude/openplanr/runtime/design/scripts/design-share-cli-bridge.mjs +321 -0
  126. package/lib/host-packages/claude/openplanr/runtime/design/scripts/design-shared-artifact-support-dependencies-design-support-protocol-contracts-d707e49b.mjs +1652 -0
  127. package/lib/host-packages/{openai/openplanr/runtime/design/scripts/design-shared-artifact-support-protocol-contracts-ea2cd15e.mjs → claude/openplanr/runtime/design/scripts/design-shared-artifact-support-protocol-contracts-9f6918b0.mjs} +537 -5
  128. package/lib/host-packages/claude/openplanr/runtime/design/scripts/design-shared-design-support-0bac378d.mjs +137 -0
  129. package/lib/host-packages/claude/openplanr/runtime/design/scripts/design.mjs +374 -61
  130. package/lib/host-packages/claude/openplanr/runtime/design/scripts/runtime/notices/THIRD_PARTY_NOTICES.txt +32 -59
  131. package/lib/host-packages/claude/openplanr/runtime/design/scripts/runtime/packages/artifact/templates/artifact-review-stage.js.sources/02-artifact-review-ui.js +138 -133
  132. package/lib/host-packages/claude/openplanr/runtime/design/scripts/runtime/packages/artifact/templates/artifact-review-stage.js.sources/03-protocol-contracts.js +1 -5608
  133. package/lib/host-packages/claude/openplanr/runtime/design/scripts/runtime/packages/artifact/templates/artifact-review-stage.js.sources/04-artifact-review-ui.js +2568 -0
  134. package/lib/host-packages/claude/openplanr/runtime/design/scripts/runtime/packages/artifact/templates/artifact-review-stage.js.sources.json +10 -74
  135. package/lib/host-packages/claude/openplanr/runtime/design/scripts/runtime/packages/design/package.json +4 -4
  136. package/lib/host-packages/claude/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/share.js +8 -2
  137. package/lib/host-packages/claude/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/studio.js.sources/02-react.js +2 -2
  138. package/lib/host-packages/claude/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/studio.js.sources/09-react-dom-client-public-roots.js +5 -5
  139. package/lib/host-packages/claude/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/studio.js.sources/12-protocol-contracts.js +72 -2
  140. package/lib/host-packages/claude/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/studio.js.sources/13-design-review-experience.js +14 -7
  141. package/lib/host-packages/claude/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/studio.js.sources/15-canvas-engine.js +71 -34
  142. package/lib/host-packages/claude/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/studio.js.sources/21-design-studio.js +28 -14
  143. package/lib/host-packages/claude/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/studio.js.sources.json +12 -12
  144. package/lib/host-packages/claude/openplanr/runtime/design/scripts/runtime/packages/protocol/package.json +6 -2
  145. package/lib/host-packages/{openai/openplanr/runtime/design/scripts/runtime/packages/protocol/schemas/v1.20.0 → claude/openplanr/runtime/design/scripts/runtime/packages/protocol/schemas/v1.22.0}/design-document.schema.json +131 -4
  146. package/lib/host-packages/claude/openplanr/runtime/design/scripts/runtime/packages/protocol/schemas/v1.22.0/design-review-bundle.schema.json +822 -0
  147. package/lib/host-packages/claude/openplanr/runtime/plan/scripts/design-protocol-contracts.mjs +616 -4775
  148. package/lib/host-packages/claude/openplanr/runtime/plan/scripts/design.mjs +219 -424
  149. package/lib/host-packages/claude/openplanr/runtime/plan/scripts/runtime/packages/protocol/package.json +6 -2
  150. package/lib/host-packages/claude/openplanr/skills/delegate/SKILL.md +2 -1
  151. package/lib/host-packages/claude/openplanr/skills/delegate/references/integration-review.md +26 -20
  152. package/lib/host-packages/claude/openplanr/skills/delegate/references/operator-guide.md +25 -1
  153. package/lib/host-packages/claude/openplanr/skills/delegate/references/run-handoff.md +2 -2
  154. package/lib/host-packages/claude/openplanr/skills/delegate/references/worktree-custody.md +17 -9
  155. package/lib/host-packages/claude/openplanr/skills/delegate/scripts/adapters/claude.mjs +15 -3
  156. package/lib/host-packages/claude/openplanr/skills/delegate/scripts/adapters/codex.mjs +38 -2
  157. package/lib/host-packages/claude/openplanr/skills/delegate/scripts/adapters/native.mjs +5 -0
  158. package/lib/host-packages/claude/openplanr/skills/delegate/scripts/custody.mjs +217 -10
  159. package/lib/host-packages/claude/openplanr/skills/delegate/scripts/handoff.mjs +1080 -0
  160. package/lib/host-packages/claude/openplanr/skills/delegate/scripts/integrate.mjs +96 -201
  161. package/lib/host-packages/claude/openplanr/skills/delegate/scripts/integration-files.mjs +3 -382
  162. package/lib/host-packages/claude/openplanr/skills/delegate/scripts/presentation.mjs +29 -12
  163. package/lib/host-packages/claude/openplanr/skills/delegate/scripts/run-contract.mjs +11 -0
  164. package/lib/host-packages/claude/openplanr/skills/delegate/scripts/run-execution.mjs +1 -1
  165. package/lib/host-packages/claude/openplanr/skills/delegate/scripts/run-lifecycle.mjs +14 -10
  166. package/lib/host-packages/claude/openplanr/skills/delegate/scripts/run-preparation.mjs +4 -0
  167. package/lib/host-packages/claude/openplanr/skills/delegate/scripts/run-record.mjs +2 -2
  168. package/lib/host-packages/claude/openplanr/skills/design/references/design-system.md +17 -2
  169. package/lib/host-packages/claude/openplanr/skills/design/references/generation.md +60 -2
  170. package/lib/host-packages/claude/openplanr/skills/design/references/utilities.md +23 -7
  171. package/lib/host-packages/claude/openplanr/skills/design/schemas/design-document.schema.json +131 -4
  172. package/lib/host-packages/claude/openplanr/skills/design-loop/references/design-system.md +17 -2
  173. package/lib/host-packages/claude/openplanr/skills/design-loop/references/generation.md +60 -2
  174. package/lib/host-packages/claude/openplanr/skills/design-loop/references/utilities.md +23 -7
  175. package/lib/host-packages/claude/openplanr/skills/design-loop/schemas/design-document.schema.json +131 -4
  176. package/lib/host-packages/claude/openplanr/skills/design-review/references/design-system.md +17 -2
  177. package/lib/host-packages/claude/openplanr/skills/design-review/references/generation.md +60 -2
  178. package/lib/host-packages/claude/openplanr/skills/design-review/references/utilities.md +23 -7
  179. package/lib/host-packages/claude/openplanr/skills/design-review/schemas/design-document.schema.json +131 -4
  180. package/lib/host-packages/claude/openplanr/skills/investigate/SKILL.md +2 -1
  181. package/lib/host-packages/claude/openplanr/skills/investigate/references/fail-first.md +40 -0
  182. package/lib/host-packages/claude/openplanr/skills/plan/SKILL.md +21 -11
  183. package/lib/host-packages/claude/openplanr/skills/plan/schemas/design-document.schema.json +131 -4
  184. package/lib/host-packages/claude/openplanr/skills/ship/SKILL.md +51 -18
  185. package/lib/host-packages/claude/openplanr/skills/ship/references/fail-first.md +40 -0
  186. package/lib/host-packages/claude/openplanr/skills/ship/references/result-contract.md +7 -3
  187. package/lib/host-packages/claude/openplanr/skills/spec/SKILL.md +6 -0
  188. package/lib/host-packages/claude/openplanr/skills/spec/references/specification-contract.md +3 -1
  189. package/lib/host-packages/cursor/openplanr/.openplanr-content.json +91 -143
  190. package/lib/host-packages/cursor/openplanr/manifest.json +1 -1
  191. package/lib/host-packages/cursor/openplanr/rules/planr-delegate/references/integration-review.md +26 -20
  192. package/lib/host-packages/cursor/openplanr/rules/planr-delegate/references/operator-guide.md +25 -1
  193. package/lib/host-packages/cursor/openplanr/rules/planr-delegate/references/run-handoff.md +2 -2
  194. package/lib/host-packages/cursor/openplanr/rules/planr-delegate/references/worktree-custody.md +17 -9
  195. package/lib/host-packages/cursor/openplanr/rules/planr-delegate/scripts/adapters/claude.mjs +15 -3
  196. package/lib/host-packages/cursor/openplanr/rules/planr-delegate/scripts/adapters/codex.mjs +38 -2
  197. package/lib/host-packages/cursor/openplanr/rules/planr-delegate/scripts/adapters/native.mjs +5 -0
  198. package/lib/host-packages/cursor/openplanr/rules/planr-delegate/scripts/custody.mjs +217 -10
  199. package/lib/host-packages/cursor/openplanr/rules/planr-delegate/scripts/handoff.mjs +1080 -0
  200. package/lib/host-packages/cursor/openplanr/rules/planr-delegate/scripts/integrate.mjs +96 -201
  201. package/lib/host-packages/cursor/openplanr/rules/planr-delegate/scripts/integration-files.mjs +3 -382
  202. package/lib/host-packages/cursor/openplanr/rules/planr-delegate/scripts/presentation.mjs +29 -12
  203. package/lib/host-packages/cursor/openplanr/rules/planr-delegate/scripts/run-contract.mjs +11 -0
  204. package/lib/host-packages/cursor/openplanr/rules/planr-delegate/scripts/run-execution.mjs +1 -1
  205. package/lib/host-packages/cursor/openplanr/rules/planr-delegate/scripts/run-lifecycle.mjs +14 -10
  206. package/lib/host-packages/cursor/openplanr/rules/planr-delegate/scripts/run-preparation.mjs +4 -0
  207. package/lib/host-packages/cursor/openplanr/rules/planr-delegate/scripts/run-record.mjs +2 -2
  208. package/lib/host-packages/cursor/openplanr/rules/planr-delegate.mdc +2 -1
  209. package/lib/host-packages/cursor/openplanr/rules/planr-design/references/design-system.md +17 -2
  210. package/lib/host-packages/cursor/openplanr/rules/planr-design/references/generation.md +60 -2
  211. package/lib/host-packages/cursor/openplanr/rules/planr-design/references/utilities.md +23 -7
  212. package/lib/host-packages/cursor/openplanr/rules/planr-design/schemas/design-document.schema.json +131 -4
  213. package/lib/host-packages/cursor/openplanr/rules/planr-design-loop/references/design-system.md +17 -2
  214. package/lib/host-packages/cursor/openplanr/rules/planr-design-loop/references/generation.md +60 -2
  215. package/lib/host-packages/cursor/openplanr/rules/planr-design-loop/references/utilities.md +23 -7
  216. package/lib/host-packages/cursor/openplanr/rules/planr-design-loop/schemas/design-document.schema.json +131 -4
  217. package/lib/host-packages/cursor/openplanr/rules/planr-design-review/references/design-system.md +17 -2
  218. package/lib/host-packages/cursor/openplanr/rules/planr-design-review/references/generation.md +60 -2
  219. package/lib/host-packages/cursor/openplanr/rules/planr-design-review/references/utilities.md +23 -7
  220. package/lib/host-packages/cursor/openplanr/rules/planr-design-review/schemas/design-document.schema.json +131 -4
  221. package/lib/host-packages/cursor/openplanr/rules/planr-investigate/references/fail-first.md +40 -0
  222. package/lib/host-packages/cursor/openplanr/rules/planr-investigate.mdc +2 -1
  223. package/lib/host-packages/cursor/openplanr/rules/planr-plan/schemas/design-document.schema.json +131 -4
  224. package/lib/host-packages/cursor/openplanr/rules/planr-plan.mdc +21 -11
  225. package/lib/host-packages/cursor/openplanr/rules/planr-ship/references/fail-first.md +40 -0
  226. package/lib/host-packages/cursor/openplanr/rules/planr-ship/references/result-contract.md +7 -3
  227. package/lib/host-packages/cursor/openplanr/rules/planr-ship.mdc +51 -18
  228. package/lib/host-packages/cursor/openplanr/rules/planr-spec/references/specification-contract.md +3 -1
  229. package/lib/host-packages/cursor/openplanr/rules/planr-spec.mdc +6 -0
  230. package/lib/host-packages/cursor/openplanr/runtime/design/scripts/design-artifact-shell.mjs +2 -4
  231. package/lib/host-packages/cursor/openplanr/runtime/design/scripts/design-document.mjs +110 -25
  232. package/lib/host-packages/cursor/openplanr/runtime/design/scripts/design-handoff.mjs +851 -57
  233. package/lib/host-packages/cursor/openplanr/runtime/design/scripts/design-review-state-store.mjs +45 -0
  234. package/lib/host-packages/cursor/openplanr/runtime/design/scripts/design-review.mjs +65 -74
  235. package/lib/host-packages/cursor/openplanr/runtime/design/scripts/design-runtime-home.mjs +0 -1
  236. package/lib/host-packages/cursor/openplanr/runtime/design/scripts/design-share-cli-bridge.mjs +321 -0
  237. package/lib/host-packages/cursor/openplanr/runtime/design/scripts/design-shared-artifact-support-dependencies-design-support-protocol-contracts-d707e49b.mjs +1652 -0
  238. package/lib/host-packages/cursor/openplanr/runtime/design/scripts/{design-shared-artifact-support-protocol-contracts-ea2cd15e.mjs → design-shared-artifact-support-protocol-contracts-9f6918b0.mjs} +537 -5
  239. package/lib/host-packages/cursor/openplanr/runtime/design/scripts/design-shared-design-support-0bac378d.mjs +137 -0
  240. package/lib/host-packages/cursor/openplanr/runtime/design/scripts/design.mjs +374 -61
  241. package/lib/host-packages/cursor/openplanr/runtime/design/scripts/runtime/notices/THIRD_PARTY_NOTICES.txt +32 -59
  242. package/lib/host-packages/cursor/openplanr/runtime/design/scripts/runtime/packages/artifact/templates/artifact-review-stage.js.sources/02-artifact-review-ui.js +138 -133
  243. package/lib/host-packages/cursor/openplanr/runtime/design/scripts/runtime/packages/artifact/templates/artifact-review-stage.js.sources/03-protocol-contracts.js +1 -5608
  244. package/lib/host-packages/cursor/openplanr/runtime/design/scripts/runtime/packages/artifact/templates/artifact-review-stage.js.sources/04-artifact-review-ui.js +2568 -0
  245. package/lib/host-packages/cursor/openplanr/runtime/design/scripts/runtime/packages/artifact/templates/artifact-review-stage.js.sources.json +10 -74
  246. package/lib/host-packages/cursor/openplanr/runtime/design/scripts/runtime/packages/design/package.json +4 -4
  247. package/lib/host-packages/cursor/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/share.js +8 -2
  248. package/lib/host-packages/cursor/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/studio.js.sources/02-react.js +2 -2
  249. package/lib/host-packages/cursor/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/studio.js.sources/09-react-dom-client-public-roots.js +5 -5
  250. package/lib/host-packages/cursor/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/studio.js.sources/12-protocol-contracts.js +72 -2
  251. package/lib/host-packages/cursor/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/studio.js.sources/13-design-review-experience.js +14 -7
  252. package/lib/host-packages/cursor/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/studio.js.sources/15-canvas-engine.js +71 -34
  253. package/lib/host-packages/cursor/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/studio.js.sources/21-design-studio.js +28 -14
  254. package/lib/host-packages/cursor/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/studio.js.sources.json +12 -12
  255. package/lib/host-packages/cursor/openplanr/runtime/design/scripts/runtime/packages/protocol/package.json +6 -2
  256. package/lib/host-packages/cursor/openplanr/runtime/design/scripts/runtime/packages/protocol/schemas/{v1.20.0 → v1.22.0}/design-document.schema.json +131 -4
  257. package/lib/host-packages/cursor/openplanr/runtime/design/scripts/runtime/packages/protocol/schemas/v1.22.0/design-review-bundle.schema.json +822 -0
  258. package/lib/host-packages/cursor/openplanr/runtime/plan/scripts/design-protocol-contracts.mjs +616 -4775
  259. package/lib/host-packages/cursor/openplanr/runtime/plan/scripts/design.mjs +219 -424
  260. package/lib/host-packages/cursor/openplanr/runtime/plan/scripts/runtime/packages/protocol/package.json +6 -2
  261. package/lib/host-packages/openai/.claude-plugin/marketplace.json +3 -3
  262. package/lib/host-packages/openai/openplanr/.codex-plugin/plugin.json +2 -2
  263. package/lib/host-packages/openai/openplanr/.openplanr-content.json +98 -150
  264. package/lib/host-packages/openai/openplanr/runtime/design/scripts/design-artifact-shell.mjs +2 -4
  265. package/lib/host-packages/openai/openplanr/runtime/design/scripts/design-document.mjs +110 -25
  266. package/lib/host-packages/openai/openplanr/runtime/design/scripts/design-handoff.mjs +851 -57
  267. package/lib/host-packages/openai/openplanr/runtime/design/scripts/design-review-state-store.mjs +45 -0
  268. package/lib/host-packages/openai/openplanr/runtime/design/scripts/design-review.mjs +65 -74
  269. package/lib/host-packages/openai/openplanr/runtime/design/scripts/design-runtime-home.mjs +0 -1
  270. package/lib/host-packages/openai/openplanr/runtime/design/scripts/design-share-cli-bridge.mjs +321 -0
  271. package/lib/host-packages/openai/openplanr/runtime/design/scripts/design-shared-artifact-support-dependencies-design-support-protocol-contracts-d707e49b.mjs +1652 -0
  272. package/lib/host-packages/{claude/openplanr/runtime/design/scripts/design-shared-artifact-support-protocol-contracts-ea2cd15e.mjs → openai/openplanr/runtime/design/scripts/design-shared-artifact-support-protocol-contracts-9f6918b0.mjs} +537 -5
  273. package/lib/host-packages/openai/openplanr/runtime/design/scripts/design-shared-design-support-0bac378d.mjs +137 -0
  274. package/lib/host-packages/openai/openplanr/runtime/design/scripts/design.mjs +374 -61
  275. package/lib/host-packages/openai/openplanr/runtime/design/scripts/runtime/notices/THIRD_PARTY_NOTICES.txt +32 -59
  276. package/lib/host-packages/openai/openplanr/runtime/design/scripts/runtime/packages/artifact/templates/artifact-review-stage.js.sources/02-artifact-review-ui.js +138 -133
  277. package/lib/host-packages/openai/openplanr/runtime/design/scripts/runtime/packages/artifact/templates/artifact-review-stage.js.sources/03-protocol-contracts.js +1 -5608
  278. package/lib/host-packages/openai/openplanr/runtime/design/scripts/runtime/packages/artifact/templates/artifact-review-stage.js.sources/04-artifact-review-ui.js +2568 -0
  279. package/lib/host-packages/openai/openplanr/runtime/design/scripts/runtime/packages/artifact/templates/artifact-review-stage.js.sources.json +10 -74
  280. package/lib/host-packages/openai/openplanr/runtime/design/scripts/runtime/packages/design/package.json +4 -4
  281. package/lib/host-packages/openai/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/share.js +8 -2
  282. package/lib/host-packages/openai/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/studio.js.sources/02-react.js +2 -2
  283. package/lib/host-packages/openai/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/studio.js.sources/09-react-dom-client-public-roots.js +5 -5
  284. package/lib/host-packages/openai/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/studio.js.sources/12-protocol-contracts.js +72 -2
  285. package/lib/host-packages/openai/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/studio.js.sources/13-design-review-experience.js +14 -7
  286. package/lib/host-packages/openai/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/studio.js.sources/15-canvas-engine.js +71 -34
  287. package/lib/host-packages/openai/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/studio.js.sources/21-design-studio.js +28 -14
  288. package/lib/host-packages/openai/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/studio.js.sources.json +12 -12
  289. package/lib/host-packages/openai/openplanr/runtime/design/scripts/runtime/packages/protocol/package.json +6 -2
  290. package/lib/host-packages/{claude/openplanr/runtime/design/scripts/runtime/packages/protocol/schemas/v1.20.0 → openai/openplanr/runtime/design/scripts/runtime/packages/protocol/schemas/v1.22.0}/design-document.schema.json +131 -4
  291. package/lib/host-packages/openai/openplanr/runtime/design/scripts/runtime/packages/protocol/schemas/v1.22.0/design-review-bundle.schema.json +822 -0
  292. package/lib/host-packages/openai/openplanr/runtime/plan/scripts/design-protocol-contracts.mjs +616 -4775
  293. package/lib/host-packages/openai/openplanr/runtime/plan/scripts/design.mjs +219 -424
  294. package/lib/host-packages/openai/openplanr/runtime/plan/scripts/runtime/packages/protocol/package.json +6 -2
  295. package/lib/host-packages/openai/openplanr/skills/delegate/SKILL.md +2 -1
  296. package/lib/host-packages/openai/openplanr/skills/delegate/openplanr.skill.json +1 -1
  297. package/lib/host-packages/openai/openplanr/skills/delegate/references/integration-review.md +26 -20
  298. package/lib/host-packages/openai/openplanr/skills/delegate/references/operator-guide.md +25 -1
  299. package/lib/host-packages/openai/openplanr/skills/delegate/references/run-handoff.md +2 -2
  300. package/lib/host-packages/openai/openplanr/skills/delegate/references/worktree-custody.md +17 -9
  301. package/lib/host-packages/openai/openplanr/skills/delegate/scripts/adapters/claude.mjs +15 -3
  302. package/lib/host-packages/openai/openplanr/skills/delegate/scripts/adapters/codex.mjs +38 -2
  303. package/lib/host-packages/openai/openplanr/skills/delegate/scripts/adapters/native.mjs +5 -0
  304. package/lib/host-packages/openai/openplanr/skills/delegate/scripts/custody.mjs +217 -10
  305. package/lib/host-packages/openai/openplanr/skills/delegate/scripts/handoff.mjs +1080 -0
  306. package/lib/host-packages/openai/openplanr/skills/delegate/scripts/integrate.mjs +96 -201
  307. package/lib/host-packages/openai/openplanr/skills/delegate/scripts/integration-files.mjs +3 -382
  308. package/lib/host-packages/openai/openplanr/skills/delegate/scripts/presentation.mjs +29 -12
  309. package/lib/host-packages/openai/openplanr/skills/delegate/scripts/run-contract.mjs +11 -0
  310. package/lib/host-packages/openai/openplanr/skills/delegate/scripts/run-execution.mjs +1 -1
  311. package/lib/host-packages/openai/openplanr/skills/delegate/scripts/run-lifecycle.mjs +14 -10
  312. package/lib/host-packages/openai/openplanr/skills/delegate/scripts/run-preparation.mjs +4 -0
  313. package/lib/host-packages/openai/openplanr/skills/delegate/scripts/run-record.mjs +2 -2
  314. package/lib/host-packages/openai/openplanr/skills/design/references/design-system.md +17 -2
  315. package/lib/host-packages/openai/openplanr/skills/design/references/generation.md +60 -2
  316. package/lib/host-packages/openai/openplanr/skills/design/references/utilities.md +23 -7
  317. package/lib/host-packages/openai/openplanr/skills/design/schemas/design-document.schema.json +131 -4
  318. package/lib/host-packages/openai/openplanr/skills/design-loop/references/design-system.md +17 -2
  319. package/lib/host-packages/openai/openplanr/skills/design-loop/references/generation.md +60 -2
  320. package/lib/host-packages/openai/openplanr/skills/design-loop/references/utilities.md +23 -7
  321. package/lib/host-packages/openai/openplanr/skills/design-loop/schemas/design-document.schema.json +131 -4
  322. package/lib/host-packages/openai/openplanr/skills/design-review/references/design-system.md +17 -2
  323. package/lib/host-packages/openai/openplanr/skills/design-review/references/generation.md +60 -2
  324. package/lib/host-packages/openai/openplanr/skills/design-review/references/utilities.md +23 -7
  325. package/lib/host-packages/openai/openplanr/skills/design-review/schemas/design-document.schema.json +131 -4
  326. package/lib/host-packages/openai/openplanr/skills/investigate/SKILL.md +2 -1
  327. package/lib/host-packages/openai/openplanr/skills/investigate/agents/openai.yaml +1 -1
  328. package/lib/host-packages/openai/openplanr/skills/investigate/openplanr.skill.json +12 -1
  329. package/lib/host-packages/openai/openplanr/skills/investigate/references/fail-first.md +40 -0
  330. package/lib/host-packages/openai/openplanr/skills/plan/SKILL.md +21 -11
  331. package/lib/host-packages/openai/openplanr/skills/plan/openplanr.skill.json +1 -1
  332. package/lib/host-packages/openai/openplanr/skills/plan/schemas/design-document.schema.json +131 -4
  333. package/lib/host-packages/openai/openplanr/skills/ship/SKILL.md +51 -18
  334. package/lib/host-packages/openai/openplanr/skills/ship/agents/openai.yaml +1 -1
  335. package/lib/host-packages/openai/openplanr/skills/ship/openplanr.skill.json +12 -1
  336. package/lib/host-packages/openai/openplanr/skills/ship/references/fail-first.md +40 -0
  337. package/lib/host-packages/openai/openplanr/skills/ship/references/result-contract.md +7 -3
  338. package/lib/host-packages/openai/openplanr/skills/spec/SKILL.md +6 -0
  339. package/lib/host-packages/openai/openplanr/skills/spec/openplanr.skill.json +1 -1
  340. package/lib/host-packages/openai/openplanr/skills/spec/references/specification-contract.md +3 -1
  341. package/lib/json-schema.mjs +4 -0
  342. package/package.json +16 -16
  343. package/dist/dashboard/assets/index-BU5fzjyz.css +0 -1
  344. package/dist/dashboard/assets/index-L8qtwqv6.js +0 -572
  345. package/dist/dashboard/assets/index-L8qtwqv6.js.map +0 -1
  346. package/lib/host-packages/claude/openplanr/runtime/design/scripts/design-chunked-workspace-client.mjs +0 -555
  347. package/lib/host-packages/claude/openplanr/runtime/design/scripts/design-compression.mjs +0 -4180
  348. package/lib/host-packages/claude/openplanr/runtime/design/scripts/design-encrypted-workspace-client.mjs +0 -647
  349. package/lib/host-packages/claude/openplanr/runtime/design/scripts/design-owner-custody.mjs +0 -129
  350. package/lib/host-packages/claude/openplanr/runtime/design/scripts/design-resource-pack.mjs +0 -698
  351. package/lib/host-packages/claude/openplanr/runtime/design/scripts/design-runtime-support-6774fd3d5d02.mjs +0 -24
  352. package/lib/host-packages/claude/openplanr/runtime/design/scripts/design-share.mjs +0 -1993
  353. package/lib/host-packages/claude/openplanr/runtime/design/scripts/design-shared-artifact-support-dependencies-design-support-protocol-contracts-3d9b1a86.mjs +0 -1020
  354. package/lib/host-packages/claude/openplanr/runtime/design/scripts/design-shared-protocol-contracts-75a938cc.mjs +0 -222
  355. package/lib/host-packages/claude/openplanr/runtime/design/scripts/design-shared-protocol-contracts-b5f28f94.mjs +0 -5778
  356. package/lib/host-packages/claude/openplanr/runtime/design/scripts/design-upload-spool.mjs +0 -198
  357. package/lib/host-packages/claude/openplanr/runtime/design/scripts/runtime/packages/artifact/templates/artifact-review-stage.js.sources/04-compression.js +0 -4175
  358. package/lib/host-packages/claude/openplanr/runtime/design/scripts/runtime/packages/artifact/templates/artifact-review-stage.js.sources/05-artifact-sharing.js +0 -65
  359. package/lib/host-packages/claude/openplanr/runtime/design/scripts/runtime/packages/artifact/templates/artifact-review-stage.js.sources/06-artifact-review-ui.js +0 -1755
  360. package/lib/host-packages/claude/openplanr/runtime/design/scripts/runtime/packages/artifact/templates/artifact-review-stage.js.sources/07-artifact-sharing.js +0 -62
  361. package/lib/host-packages/claude/openplanr/runtime/design/scripts/runtime/packages/artifact/templates/artifact-review-stage.js.sources/08-artifact-review-ui.js +0 -2633
  362. package/lib/host-packages/claude/openplanr/runtime/design/scripts/runtime/packages/protocol/schemas/v1.1.0/artifact-paste.schema.json +0 -49
  363. package/lib/host-packages/claude/openplanr/runtime/design/scripts/runtime/packages/protocol/schemas/v1.9.0/design-review-workspace.schema.json +0 -108
  364. package/lib/host-packages/claude/openplanr/runtime/design/scripts/runtime/packages/protocol/schemas/v1.9.0/design-workspace-create.schema.json +0 -170
  365. package/lib/host-packages/claude/openplanr/runtime/design/scripts/runtime/packages/protocol/schemas/v1.9.0/design-workspace-event.schema.json +0 -97
  366. package/lib/host-packages/claude/openplanr/runtime/design/scripts/runtime/packages/protocol/schemas/v1.9.0/design-workspace-revision.schema.json +0 -56
  367. package/lib/host-packages/claude/openplanr/skills/delegate/scripts/integration-transaction.mjs +0 -958
  368. package/lib/host-packages/cursor/openplanr/rules/planr-delegate/scripts/integration-transaction.mjs +0 -958
  369. package/lib/host-packages/cursor/openplanr/runtime/design/scripts/design-chunked-workspace-client.mjs +0 -555
  370. package/lib/host-packages/cursor/openplanr/runtime/design/scripts/design-compression.mjs +0 -4180
  371. package/lib/host-packages/cursor/openplanr/runtime/design/scripts/design-encrypted-workspace-client.mjs +0 -647
  372. package/lib/host-packages/cursor/openplanr/runtime/design/scripts/design-owner-custody.mjs +0 -129
  373. package/lib/host-packages/cursor/openplanr/runtime/design/scripts/design-resource-pack.mjs +0 -698
  374. package/lib/host-packages/cursor/openplanr/runtime/design/scripts/design-runtime-support-6774fd3d5d02.mjs +0 -24
  375. package/lib/host-packages/cursor/openplanr/runtime/design/scripts/design-share.mjs +0 -1993
  376. package/lib/host-packages/cursor/openplanr/runtime/design/scripts/design-shared-artifact-support-dependencies-design-support-protocol-contracts-3d9b1a86.mjs +0 -1020
  377. package/lib/host-packages/cursor/openplanr/runtime/design/scripts/design-shared-protocol-contracts-75a938cc.mjs +0 -222
  378. package/lib/host-packages/cursor/openplanr/runtime/design/scripts/design-shared-protocol-contracts-b5f28f94.mjs +0 -5778
  379. package/lib/host-packages/cursor/openplanr/runtime/design/scripts/design-upload-spool.mjs +0 -198
  380. package/lib/host-packages/cursor/openplanr/runtime/design/scripts/runtime/packages/artifact/templates/artifact-review-stage.js.sources/04-compression.js +0 -4175
  381. package/lib/host-packages/cursor/openplanr/runtime/design/scripts/runtime/packages/artifact/templates/artifact-review-stage.js.sources/05-artifact-sharing.js +0 -65
  382. package/lib/host-packages/cursor/openplanr/runtime/design/scripts/runtime/packages/artifact/templates/artifact-review-stage.js.sources/06-artifact-review-ui.js +0 -1755
  383. package/lib/host-packages/cursor/openplanr/runtime/design/scripts/runtime/packages/artifact/templates/artifact-review-stage.js.sources/07-artifact-sharing.js +0 -62
  384. package/lib/host-packages/cursor/openplanr/runtime/design/scripts/runtime/packages/artifact/templates/artifact-review-stage.js.sources/08-artifact-review-ui.js +0 -2633
  385. package/lib/host-packages/cursor/openplanr/runtime/design/scripts/runtime/packages/protocol/schemas/v1.1.0/artifact-paste.schema.json +0 -49
  386. package/lib/host-packages/cursor/openplanr/runtime/design/scripts/runtime/packages/protocol/schemas/v1.9.0/design-review-workspace.schema.json +0 -108
  387. package/lib/host-packages/cursor/openplanr/runtime/design/scripts/runtime/packages/protocol/schemas/v1.9.0/design-workspace-create.schema.json +0 -170
  388. package/lib/host-packages/cursor/openplanr/runtime/design/scripts/runtime/packages/protocol/schemas/v1.9.0/design-workspace-event.schema.json +0 -97
  389. package/lib/host-packages/cursor/openplanr/runtime/design/scripts/runtime/packages/protocol/schemas/v1.9.0/design-workspace-revision.schema.json +0 -56
  390. package/lib/host-packages/openai/openplanr/runtime/design/scripts/design-chunked-workspace-client.mjs +0 -555
  391. package/lib/host-packages/openai/openplanr/runtime/design/scripts/design-compression.mjs +0 -4180
  392. package/lib/host-packages/openai/openplanr/runtime/design/scripts/design-encrypted-workspace-client.mjs +0 -647
  393. package/lib/host-packages/openai/openplanr/runtime/design/scripts/design-owner-custody.mjs +0 -129
  394. package/lib/host-packages/openai/openplanr/runtime/design/scripts/design-resource-pack.mjs +0 -698
  395. package/lib/host-packages/openai/openplanr/runtime/design/scripts/design-runtime-support-6774fd3d5d02.mjs +0 -24
  396. package/lib/host-packages/openai/openplanr/runtime/design/scripts/design-share.mjs +0 -1993
  397. package/lib/host-packages/openai/openplanr/runtime/design/scripts/design-shared-artifact-support-dependencies-design-support-protocol-contracts-3d9b1a86.mjs +0 -1020
  398. package/lib/host-packages/openai/openplanr/runtime/design/scripts/design-shared-protocol-contracts-75a938cc.mjs +0 -222
  399. package/lib/host-packages/openai/openplanr/runtime/design/scripts/design-shared-protocol-contracts-b5f28f94.mjs +0 -5778
  400. package/lib/host-packages/openai/openplanr/runtime/design/scripts/design-upload-spool.mjs +0 -198
  401. package/lib/host-packages/openai/openplanr/runtime/design/scripts/runtime/packages/artifact/templates/artifact-review-stage.js.sources/04-compression.js +0 -4175
  402. package/lib/host-packages/openai/openplanr/runtime/design/scripts/runtime/packages/artifact/templates/artifact-review-stage.js.sources/05-artifact-sharing.js +0 -65
  403. package/lib/host-packages/openai/openplanr/runtime/design/scripts/runtime/packages/artifact/templates/artifact-review-stage.js.sources/06-artifact-review-ui.js +0 -1755
  404. package/lib/host-packages/openai/openplanr/runtime/design/scripts/runtime/packages/artifact/templates/artifact-review-stage.js.sources/07-artifact-sharing.js +0 -62
  405. package/lib/host-packages/openai/openplanr/runtime/design/scripts/runtime/packages/artifact/templates/artifact-review-stage.js.sources/08-artifact-review-ui.js +0 -2633
  406. package/lib/host-packages/openai/openplanr/runtime/design/scripts/runtime/packages/protocol/schemas/v1.1.0/artifact-paste.schema.json +0 -49
  407. package/lib/host-packages/openai/openplanr/runtime/design/scripts/runtime/packages/protocol/schemas/v1.9.0/design-review-workspace.schema.json +0 -108
  408. package/lib/host-packages/openai/openplanr/runtime/design/scripts/runtime/packages/protocol/schemas/v1.9.0/design-workspace-create.schema.json +0 -170
  409. package/lib/host-packages/openai/openplanr/runtime/design/scripts/runtime/packages/protocol/schemas/v1.9.0/design-workspace-event.schema.json +0 -97
  410. package/lib/host-packages/openai/openplanr/runtime/design/scripts/runtime/packages/protocol/schemas/v1.9.0/design-workspace-revision.schema.json +0 -56
  411. package/lib/host-packages/openai/openplanr/skills/delegate/scripts/integration-transaction.mjs +0 -958
@@ -9,9 +9,18 @@ import {
9
9
  stopArtifactReviewServer
10
10
  } from "./design-review.mjs";
11
11
  import {
12
+ ARTIFACT_REVIEW_MAX_STATE_BYTES,
13
+ createReviewLedger,
14
+ decodeArtifactReviewSources,
15
+ mergeReviewLedger,
16
+ normalizeArtifactReview,
17
+ readArtifactReviewState,
12
18
  readDesignFeedback,
13
19
  readDesignHandoff,
14
- updateDesignHandoff
20
+ resolveArtifactReviewDestination,
21
+ updateDesignHandoff,
22
+ withArtifactReviewLock,
23
+ writeArtifactReviewState
15
24
  } from "./design-handoff.mjs";
16
25
  import {
17
26
  inspectDesignDocument,
@@ -21,58 +30,44 @@ import {
21
30
  renderDesignDocument,
22
31
  standaloneDesignHtml
23
32
  } from "./design-document.mjs";
33
+ import {
34
+ listDesignRevisions,
35
+ readDesignRevision
36
+ } from "./design-shared-artifact-support-dependencies-design-support-protocol-contracts-d707e49b.mjs";
37
+ import "./design-review-state-store.mjs";
38
+ import "./design-parse5-parser.mjs";
39
+ import "./design-parse5-tokenizer.mjs";
40
+ import "./design-entities.mjs";
24
41
  import "./design-artifact-shell.mjs";
42
+ import {
43
+ ARTIFACT_ERROR_CODES,
44
+ PipelineError,
45
+ digestArtifactEnvelope
46
+ } from "./design-shared-artifact-support-protocol-contracts-9f6918b0.mjs";
25
47
  import "./design-sandbox-guards.mjs";
26
48
  import {
27
- ARTIFACT_REVIEW_MAX_STATE_BYTES,
28
- createReviewLedger,
29
- decodeArtifactReviewSources,
30
49
  exportDesignShareRecovery,
31
50
  importDesignShareRecovery,
32
51
  manageDesignShare,
33
- mergeReviewLedger,
34
- normalizeArtifactReview,
35
52
  publishDesignShare,
36
- readArtifactReviewState,
37
- resolveArtifactReviewDestination,
38
53
  shareDesign,
39
- syncDesignShare,
40
- withArtifactReviewLock,
41
- writeArtifactReviewState
42
- } from "./design-share.mjs";
54
+ syncDesignShare
55
+ } from "./design-share-cli-bridge.mjs";
43
56
  import {
44
57
  atomicJson,
45
58
  currentDesign,
46
59
  hash,
47
- listDesignRevisions,
48
- readDesignRevision,
49
60
  readJson
50
- } from "./design-shared-artifact-support-dependencies-design-support-protocol-contracts-3d9b1a86.mjs";
51
- import "./design-encrypted-workspace-client.mjs";
52
- import "./design-upload-spool.mjs";
53
- import "./design-chunked-workspace-client.mjs";
54
- import "./design-resource-pack.mjs";
55
- import "./design-compression.mjs";
56
- import "./design-owner-custody.mjs";
61
+ } from "./design-shared-design-support-0bac378d.mjs";
57
62
  import "./design-runtime-home.mjs";
58
63
  import {
59
64
  acquireStartLock
60
65
  } from "./design-loopback-server.mjs";
61
- import "./design-parse5-parser.mjs";
62
- import "./design-parse5-tokenizer.mjs";
63
- import "./design-entities.mjs";
64
- import {
65
- ARTIFACT_ERROR_CODES,
66
- PipelineError,
67
- digestArtifactEnvelope
68
- } from "./design-shared-artifact-support-protocol-contracts-ea2cd15e.mjs";
69
- import "./design-shared-protocol-contracts-b5f28f94.mjs";
70
- import "./design-shared-protocol-contracts-75a938cc.mjs";
71
66
 
72
67
  // packages/design/lib/design/utility.mjs
73
68
  import { spawn } from "node:child_process";
74
- import { existsSync, mkdirSync, readFileSync, realpathSync, writeFileSync } from "node:fs";
75
- import { dirname, join as join3, resolve as resolve2 } from "node:path";
69
+ import { existsSync as existsSync2, mkdirSync as mkdirSync2, readFileSync, realpathSync, writeFileSync as writeFileSync2 } from "node:fs";
70
+ import { dirname as dirname2, join as join4, resolve as resolve3 } from "node:path";
76
71
  import { fileURLToPath } from "node:url";
77
72
 
78
73
  // packages/design/lib/design/feedback-import.mjs
@@ -339,8 +334,272 @@ async function importDesignFeedback(file, { input, revision, allowStale = false,
339
334
  }
340
335
  }
341
336
 
337
+ // packages/design/lib/design/font-fetch.mjs
338
+ import {
339
+ chmodSync,
340
+ existsSync,
341
+ mkdirSync,
342
+ mkdtempSync,
343
+ readdirSync,
344
+ renameSync,
345
+ rmdirSync,
346
+ rmSync,
347
+ statSync,
348
+ writeFileSync
349
+ } from "node:fs";
350
+ import { basename, dirname, join as join2, resolve as resolve2 } from "node:path";
351
+ var MAX_FAMILIES = 2;
352
+ var MAX_WEIGHTS = 3;
353
+ var TIMEOUT_MS = 2e4;
354
+ var MAX_FILE_BYTES = 15e5;
355
+ var MAX_TOTAL_BYTES = 5e6;
356
+ var STAGING_MAX_AGE_MS = 10 * 6e4;
357
+ var STAGING_PREFIX = ".fonts-fetch-";
358
+ var CSS_ENDPOINT = "https://fonts.googleapis.com/css2";
359
+ var FONT_ORIGIN = "https://fonts.gstatic.com/";
360
+ var CATALOG_ROOT = "https://raw.githubusercontent.com/google/fonts/main";
361
+ var USER_AGENT = "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/130.0.0.0 Safari/537.36";
362
+ var LICENSES = Object.freeze([
363
+ {
364
+ directory: "ofl",
365
+ metadata: "OFL",
366
+ file: "OFL.txt",
367
+ id: "OFL-1.1",
368
+ text: /SIL Open Font License,?\s+Version 1\.1/iu
369
+ },
370
+ {
371
+ directory: "apache",
372
+ metadata: "APACHE2",
373
+ file: "LICENSE.txt",
374
+ id: "Apache-2.0",
375
+ text: /Apache License\s+Version 2\.0/iu
376
+ }
377
+ ]);
378
+ var FAMILY_SPEC = /^([A-Za-z0-9](?:[A-Za-z0-9 ]*[A-Za-z0-9])?):(\d{3}(?:,\d{3})*)$/u;
379
+ function parseFontFamily(spec) {
380
+ const match = typeof spec === "string" ? FAMILY_SPEC.exec(spec.trim()) : null;
381
+ if (!match)
382
+ throw new Error(
383
+ `--family ${JSON.stringify(spec ?? "")} must look like "Inter:400,600" (a name, a colon, comma-separated weights).`
384
+ );
385
+ const weights = [...new Set(match[2].split(",").map(Number))].sort((a, b) => a - b);
386
+ const invalid2 = weights.find((weight) => weight < 100 || weight > 900 || weight % 100 !== 0);
387
+ if (invalid2 !== void 0)
388
+ throw new Error(`--family "${spec}" has weight ${invalid2}; use 100 to 900 in steps of 100.`);
389
+ if (weights.length > MAX_WEIGHTS)
390
+ throw new Error(
391
+ `--family "${spec}" has ${weights.length} weights; at most ${MAX_WEIGHTS} per family.`
392
+ );
393
+ return { family: match[1], weights };
394
+ }
395
+ function latinFontFaces(css, family) {
396
+ const faces = [];
397
+ for (const [, subset, body] of css.matchAll(
398
+ /\/\*\s*([\w-]+)\s*\*\/\s*@font-face\s*\{([^}]*)\}/gu
399
+ )) {
400
+ const value = (name) => new RegExp(`(?:^|;)\\s*${name}\\s*:\\s*([^;]+)`, "iu").exec(body)?.[1].trim();
401
+ if (subset !== "latin" || !/^U\+0000-00FF\b/iu.test(value("unicode-range") ?? "")) continue;
402
+ const source = /^url\(([^)\s]+)\)\s*format\(['"]woff2['"]\)$/u.exec(value("src") ?? "");
403
+ if (!source?.[1].startsWith(FONT_ORIGIN))
404
+ throw new Error(
405
+ `"${family}" Latin face is not a woff2 file on ${FONT_ORIGIN}: ${value("src")}`
406
+ );
407
+ faces.push({ weight: Number(value("font-weight")), url: source[1] });
408
+ }
409
+ return faces;
410
+ }
411
+ async function request(fetchImpl, url, { headers, allowMissing = false, redirect } = {}) {
412
+ let response;
413
+ try {
414
+ response = await fetchImpl(url, {
415
+ headers,
416
+ redirect,
417
+ signal: AbortSignal.timeout(TIMEOUT_MS)
418
+ });
419
+ } catch (error) {
420
+ const reason = error?.name === "TimeoutError" ? `no response within ${TIMEOUT_MS / 1e3} s` : error?.message;
421
+ throw new Error(`Font fetch failed: ${url}: ${reason}`);
422
+ }
423
+ if (allowMissing && response.status === 404) return null;
424
+ if (!response.ok) throw new Error(`Font fetch failed: ${url}: HTTP ${response.status}`);
425
+ return response;
426
+ }
427
+ async function verifiedLicense(fetchImpl, family) {
428
+ const slug = family.toLowerCase().replace(/[^a-z0-9]/gu, "");
429
+ const tried = [];
430
+ for (const license of LICENSES) {
431
+ const base = `${CATALOG_ROOT}/${license.directory}/${slug}`;
432
+ tried.push(`${base}/METADATA.pb`);
433
+ const metadata = await request(fetchImpl, `${base}/METADATA.pb`, { allowMissing: true });
434
+ if (!metadata) continue;
435
+ const text = await metadata.text();
436
+ const name = /^name:\s*"([^"]*)"/mu.exec(text)?.[1];
437
+ const declared = /^license:\s*"([^"]*)"/mu.exec(text)?.[1];
438
+ if (name !== family && name?.toLowerCase() === family.toLowerCase())
439
+ throw new Error(`"${family}" is listed as "${name}"; use the catalog name "${name}".`);
440
+ if (name !== family || declared !== license.metadata)
441
+ throw new Error(
442
+ `"${family}" is not verified as ${license.id}: ${base}/METADATA.pb names ${JSON.stringify(name)} with license ${JSON.stringify(declared)}. Use the system stack.`
443
+ );
444
+ const body = Buffer.from(
445
+ await (await request(fetchImpl, `${base}/${license.file}`, { redirect: "error" })).arrayBuffer()
446
+ );
447
+ if (!license.text.test(body.toString("utf8")))
448
+ throw new Error(
449
+ `"${family}" is not verified as ${license.id}: ${base}/${license.file} does not contain the license text. Use the system stack.`
450
+ );
451
+ return { slug, license, body };
452
+ }
453
+ throw new Error(
454
+ `"${family}" is not an OFL or Apache licensed Google Fonts family (checked ${tried.join(", ")}). Use the system stack.`
455
+ );
456
+ }
457
+ async function download(fetchImpl, url) {
458
+ const bytes = Buffer.from(
459
+ await (await request(fetchImpl, url, { redirect: "error" })).arrayBuffer()
460
+ );
461
+ if (bytes.length > MAX_FILE_BYTES)
462
+ throw new Error(`Font file is ${bytes.length} bytes, over the ${MAX_FILE_BYTES} limit: ${url}`);
463
+ if (bytes.toString("latin1", 0, 4) !== "wOF2") throw new Error(`Font file is not woff2: ${url}`);
464
+ return bytes;
465
+ }
466
+ function assertWritableDestination(dest) {
467
+ if (!existsSync(dest)) return;
468
+ if (!statSync(dest).isDirectory() || readdirSync(dest).length > 0)
469
+ throw new Error(
470
+ `Font destination already exists and is not empty: ${dest}. Choose a new --dest or remove it.`
471
+ );
472
+ }
473
+ function faceRule(family, weights, file) {
474
+ const weight = weights.length > 1 ? `${weights[0]} ${weights.at(-1)}` : `${weights[0]}`;
475
+ return `@font-face {
476
+ font-family: "${family}";
477
+ font-style: normal;
478
+ font-weight: ${weight};
479
+ font-display: swap;
480
+ src: url("${file}") format("woff2");
481
+ }
482
+ `;
483
+ }
484
+ async function fetchDesignFonts({ families, dest, fetchImpl = fetch }) {
485
+ if (!dest) throw new Error("fonts fetch requires --dest <design>/source/assets/fonts.");
486
+ const specs = (families ?? []).map(parseFontFamily);
487
+ if (specs.length === 0)
488
+ throw new Error('fonts fetch requires at least one --family "<Name>:<weights>".');
489
+ if (specs.length > MAX_FAMILIES)
490
+ throw new Error(
491
+ `${specs.length} families requested (${specs.map(({ family }) => family).join(", ")}); at most ${MAX_FAMILIES}.`
492
+ );
493
+ const names = specs.map(({ family }) => family.toLowerCase());
494
+ if (new Set(names).size !== names.length)
495
+ throw new Error(
496
+ `--family names a family twice: ${specs.map(({ family }) => family).join(", ")}.`
497
+ );
498
+ const target = resolve2(dest);
499
+ if (basename(target).startsWith(STAGING_PREFIX))
500
+ throw new Error(
501
+ `Font destination uses the reserved staging prefix ${STAGING_PREFIX}: ${target}`
502
+ );
503
+ assertWritableDestination(target);
504
+ const files = /* @__PURE__ */ new Map();
505
+ const rules = [];
506
+ const summaries = [];
507
+ let totalBytes = 0;
508
+ const add = (path, bytes) => {
509
+ totalBytes += bytes.length;
510
+ if (totalBytes > MAX_TOTAL_BYTES)
511
+ throw new Error(`Font snapshot exceeds ${MAX_TOTAL_BYTES} bytes at ${path}.`);
512
+ files.set(path, bytes);
513
+ };
514
+ for (const { family, weights } of specs) {
515
+ const { slug, license, body } = await verifiedLicense(fetchImpl, family);
516
+ const source = `${CSS_ENDPOINT}?family=${encodeURIComponent(family).replaceAll("%20", "+")}:wght@${weights.join(";")}&display=swap`;
517
+ const css = await (await request(fetchImpl, source, { headers: { "user-agent": USER_AGENT } })).text();
518
+ const faces = latinFontFaces(css, family);
519
+ const byUrl = /* @__PURE__ */ new Map();
520
+ for (const weight of weights) {
521
+ const face = faces.find((item) => item.weight === weight);
522
+ if (!face)
523
+ throw new Error(`"${family}" has no Latin woff2 face for weight ${weight} in ${source}`);
524
+ byUrl.set(face.url, [...byUrl.get(face.url) ?? [], weight]);
525
+ }
526
+ rules.push(`/* ${family} (${license.id}, ${slug}/${license.file}): ${source} */
527
+ `);
528
+ for (const [url, covered] of byUrl) {
529
+ const range = covered.length > 1 ? `${covered[0]}-${covered.at(-1)}` : `${covered[0]}`;
530
+ const file = `${slug}/${slug}-${range}-latin.woff2`;
531
+ add(file, await download(fetchImpl, url));
532
+ rules.push(faceRule(family, covered, file));
533
+ }
534
+ add(`${slug}/${license.file}`, body);
535
+ summaries.push({
536
+ family,
537
+ license: license.id,
538
+ weights,
539
+ source,
540
+ licenseFile: `${slug}/${license.file}`
541
+ });
542
+ }
543
+ add("fonts.css", Buffer.from(rules.join("")));
544
+ const parent = dirname(target);
545
+ const missingParents = [];
546
+ for (let directory = parent; !existsSync(directory); directory = dirname(directory))
547
+ missingParents.push(directory);
548
+ const createdParents = [];
549
+ let staging;
550
+ try {
551
+ for (const directory of missingParents.reverse()) {
552
+ mkdirSync(directory);
553
+ createdParents.push(directory);
554
+ }
555
+ const staleBefore = Date.now() - STAGING_MAX_AGE_MS;
556
+ for (const entry of readdirSync(parent, { withFileTypes: true })) {
557
+ if (!entry.isDirectory() || !entry.name.startsWith(STAGING_PREFIX)) continue;
558
+ const path = join2(parent, entry.name);
559
+ try {
560
+ if (statSync(path).mtimeMs < staleBefore) rmSync(path, { recursive: true });
561
+ } catch (error) {
562
+ if (error.code === "ENOENT") continue;
563
+ throw new Error(`Could not remove stale staging folder ${path}: ${error.message}`);
564
+ }
565
+ }
566
+ staging = mkdtempSync(join2(parent, STAGING_PREFIX));
567
+ for (const [path, bytes] of files) {
568
+ mkdirSync(dirname(join2(staging, path)), { recursive: true });
569
+ writeFileSync(join2(staging, path), bytes, { flag: "wx" });
570
+ }
571
+ assertWritableDestination(target);
572
+ if (existsSync(target)) rmdirSync(target);
573
+ chmodSync(staging, 493);
574
+ renameSync(staging, target);
575
+ } catch (error) {
576
+ const cleanupErrors = [];
577
+ for (const directory of [...staging ? [staging] : [], ...createdParents.reverse()]) {
578
+ try {
579
+ if (directory === staging) rmSync(directory, { recursive: true, force: true });
580
+ else if (readdirSync(directory).length === 0) rmdirSync(directory);
581
+ } catch (cleanupError) {
582
+ cleanupErrors.push({ path: directory, message: cleanupError.message });
583
+ }
584
+ }
585
+ if (cleanupErrors.length > 0) {
586
+ error.cleanupErrors = cleanupErrors;
587
+ error.message += cleanupErrors.map(({ path, message }) => ` (cleanup also failed for ${path}: ${message})`).join("");
588
+ }
589
+ throw error;
590
+ }
591
+ return {
592
+ ok: true,
593
+ dest: target,
594
+ css: join2(target, "fonts.css"),
595
+ families: summaries,
596
+ files: [...files].map(([path, bytes]) => ({ path, bytes: bytes.length })),
597
+ totalBytes
598
+ };
599
+ }
600
+
342
601
  // packages/design/lib/design/studio-lifecycle.mjs
343
- import { join as join2 } from "node:path";
602
+ import { join as join3 } from "node:path";
344
603
  function localUrl(value, service, path) {
345
604
  if (typeof value !== "string") return null;
346
605
  try {
@@ -359,7 +618,7 @@ async function manageDesignStudio(file, { action = "status", instanceId, env = p
359
618
  const services = (await listArtifactReviewServers({ env, fetchImpl })).filter(
360
619
  (service2) => service2.kind === "design" && service2.projectRoot === current.root
361
620
  );
362
- const launcher = readJson(join2(current.root, ".design/server.json"), null);
621
+ const launcher = readJson(join3(current.root, ".design/server.json"), null);
363
622
  let service = services.find((value) => value.instanceId === (instanceId ?? launcher?.instanceId));
364
623
  if (instanceId !== void 0 && !service)
365
624
  throw new Error(
@@ -643,7 +902,7 @@ async function attachedArtifactFrame(page, artifactId, warn) {
643
902
  { state: "attached", timeout: 5e3 }
644
903
  );
645
904
  try {
646
- return await new Promise((resolve3, reject) => {
905
+ return await new Promise((resolve4, reject) => {
647
906
  let settled = false;
648
907
  const finish = (error, frame) => {
649
908
  if (settled) return;
@@ -652,7 +911,7 @@ async function attachedArtifactFrame(page, artifactId, warn) {
652
911
  page.off("frameattached", inspect);
653
912
  page.off("framenavigated", inspect);
654
913
  if (error) reject(error);
655
- else resolve3(frame);
914
+ else resolve4(frame);
656
915
  };
657
916
  const inspect = async (frame) => {
658
917
  if (settled || frame === page.mainFrame?.()) return;
@@ -896,7 +1155,7 @@ function verifyDesignDocument(file, report) {
896
1155
  const images = (Array.isArray(report.screenshots) ? report.screenshots : []).filter((item) => {
897
1156
  const path = typeof item === "string" ? item : item?.path;
898
1157
  try {
899
- return typeof path === "string" && isPng(readFileSync(resolve2(path)));
1158
+ return typeof path === "string" && isPng(readFileSync(resolve3(path)));
900
1159
  } catch {
901
1160
  return false;
902
1161
  }
@@ -920,9 +1179,37 @@ function verifyDesignDocument(file, report) {
920
1179
  screenshotCount: images.length,
921
1180
  primaryJourneysChecked: Boolean(journeys)
922
1181
  };
923
- atomicJson(join3(current.root, ".design/verification", `${current.revision}.json`), saved);
1182
+ atomicJson(join4(current.root, ".design/verification", `${current.revision}.json`), saved);
924
1183
  return saved;
925
1184
  }
1185
+ var HELP_FLAGS = /* @__PURE__ */ new Set(["--help", "-h"]);
1186
+ var COMMAND_SUMMARIES = Object.freeze({
1187
+ inspect: "Report the design document and its current render.",
1188
+ validate: "Validate the design document without rendering.",
1189
+ render: "Render the design document into its review revision.",
1190
+ open: "Open the local review studio.",
1191
+ studio: "Report or stop a running local studio (--action status|stop).",
1192
+ "view-context": "Report what the studio is showing.",
1193
+ export: "Export the design as html, json, or markdown.",
1194
+ feedback: "Inspect, export, or import review feedback.",
1195
+ verify: "Record a browser verification report.",
1196
+ share: "Create a hosted review of the current revision.",
1197
+ publish: "Publish the current revision to the existing hosted review.",
1198
+ sync: "Retrieve hosted review feedback.",
1199
+ manage: "Manage a hosted review (--action rotate|pause|resume|revoke|delete|recovery|restore).",
1200
+ handoff: "Inspect or update the review handoff.",
1201
+ fonts: "Download open-license fonts (fonts fetch --family ... --dest ...)."
1202
+ });
1203
+ function commandHelp(command) {
1204
+ if (!Object.hasOwn(COMMAND_SUMMARIES, command))
1205
+ throw new Error(`Unknown command: ${command}. Run design.mjs --help for the command list.`);
1206
+ return {
1207
+ command,
1208
+ usage: command === "fonts" ? 'design.mjs fonts fetch --family "<Name>:<weights>" [--family ...] --dest <dir>' : `design.mjs ${command} <design-document.json> [options]`,
1209
+ summary: COMMAND_SUMMARIES[command],
1210
+ note: "Run design.mjs --help for every option. A help request never reads, renders, or sends anything."
1211
+ };
1212
+ }
926
1213
  async function designUtility(argv, {
927
1214
  stdout = (value) => process.stdout.write(`${JSON.stringify(value)}
928
1215
  `),
@@ -930,9 +1217,9 @@ async function designUtility(argv, {
930
1217
  env = process.env,
931
1218
  fetchImpl = fetch
932
1219
  } = {}) {
933
- if (argv.length === 0 || argv[0] === "--help" || argv[0] === "help") {
1220
+ if (argv.length === 0 || ["--help", "-h", "help"].includes(argv[0])) {
934
1221
  const help = {
935
- usage: "design.mjs inspect|validate|render|open|studio|view-context|export|feedback|verify|share|publish|sync|manage|handoff <design-document.json>",
1222
+ usage: 'design.mjs inspect|validate|render|open|studio|view-context|export|feedback|verify|share|publish|sync|manage|handoff <design-document.json> | design.mjs fonts fetch --family "<Name>:<weights>" [--family ...] --dest <dir>',
936
1223
  flags: [
937
1224
  "--json",
938
1225
  "--no-open",
@@ -949,14 +1236,23 @@ async function designUtility(argv, {
949
1236
  "--allow-stale",
950
1237
  "--variant <id>",
951
1238
  "--pins <id,id>",
952
- "--summary <text>"
1239
+ "--summary <text>",
1240
+ "--family <Name>:<weight,weight> (fonts fetch; at most 2 families, 3 weights each)",
1241
+ "--dest <design>/source/assets/fonts (fonts fetch)"
953
1242
  ],
954
- note: "The host authors design sources. This utility only validates, renders, reviews and exports them."
1243
+ note: "The host authors design sources. This utility only validates, renders, reviews and exports them; fonts fetch downloads open-license fonts only when run."
955
1244
  };
956
1245
  stdout(help);
957
1246
  return help;
958
1247
  }
959
1248
  const [command, input, ...args] = argv;
1249
+ if (argv.some((value) => HELP_FLAGS.has(value))) {
1250
+ const help = commandHelp(command);
1251
+ stdout(help);
1252
+ return help;
1253
+ }
1254
+ if (typeof input === "string" && input.startsWith("-"))
1255
+ throw new Error(`${input} must be a design document path, not an option.`);
960
1256
  if (![
961
1257
  "inspect",
962
1258
  "validate",
@@ -971,10 +1267,11 @@ async function designUtility(argv, {
971
1267
  "publish",
972
1268
  "sync",
973
1269
  "manage",
974
- "handoff"
1270
+ "handoff",
1271
+ "fonts"
975
1272
  ].includes(command) || !input)
976
1273
  throw new Error(
977
- "Usage: design.mjs inspect|validate|render|open|studio|view-context|export|feedback|verify|share|publish|sync|manage|handoff <design-document.json> [--json] [--no-open] [--view canvas|prototype|walkthrough]"
1274
+ 'Usage: design.mjs inspect|validate|render|open|studio|view-context|export|feedback|verify|share|publish|sync|manage|handoff <design-document.json> [--json] [--no-open] [--view canvas|prototype|walkthrough] | design.mjs fonts fetch --family "<Name>:<weights>" [--family ...] --dest <dir>'
978
1275
  );
979
1276
  const flags = {};
980
1277
  for (let i = 0; i < args.length; i++) {
@@ -997,14 +1294,28 @@ async function designUtility(argv, {
997
1294
  "scope",
998
1295
  "revision",
999
1296
  "request-time",
1000
- "allow-stale"
1297
+ "allow-stale",
1298
+ "family",
1299
+ "dest"
1001
1300
  ].includes(key))
1002
1301
  throw new Error(`Unknown option: ${args[i]}`);
1003
- flags[key] = ["json", "no-open", "allow-stale"].includes(key) ? true : args[++i];
1302
+ if (["family", "dest"].includes(key) && command !== "fonts")
1303
+ throw new Error(`Unknown option for ${command}: ${args[i]}`);
1304
+ if (key === "family") flags.family = [...flags.family ?? [], args[++i]];
1305
+ else flags[key] = ["json", "no-open", "allow-stale"].includes(key) ? true : args[++i];
1004
1306
  }
1005
1307
  if (flags.view && !["canvas", "prototype", "walkthrough"].includes(flags.view))
1006
1308
  throw new Error("View must be canvas, prototype, or walkthrough.");
1007
- const file = resolve2(input);
1309
+ if (command === "fonts") {
1310
+ if (input !== "fetch")
1311
+ throw new Error(
1312
+ 'Usage: design.mjs fonts fetch --family "<Name>:<weights>" [--family ...] --dest <dir>'
1313
+ );
1314
+ const result2 = await fetchDesignFonts({ families: flags.family, dest: flags.dest, fetchImpl });
1315
+ stdout(result2);
1316
+ return result2;
1317
+ }
1318
+ const file = resolve3(input);
1008
1319
  let result;
1009
1320
  if (command === "view-context")
1010
1321
  result = readDesignViewContext(file, { requestTime: flags["request-time"] });
@@ -1020,7 +1331,7 @@ async function designUtility(argv, {
1020
1331
  if (action === "inspect") result = readDesignHandoff(file);
1021
1332
  else {
1022
1333
  const snapshot = readDesignHandoff(file);
1023
- const input2 = flags.input ? readJson(resolve2(flags.input)) : {};
1334
+ const input2 = flags.input ? readJson(resolve3(flags.input)) : {};
1024
1335
  result = await updateDesignHandoff(file, {
1025
1336
  ...input2,
1026
1337
  action,
@@ -1074,25 +1385,25 @@ async function designUtility(argv, {
1074
1385
  }
1075
1386
  if (command === "export") {
1076
1387
  const current = currentDesign(file), view = flags.view ?? current.document.defaultView;
1077
- const state = readJson(join3(current.root, ".design/studio-state.json"), { state: {} }).state;
1388
+ const state = readJson(join4(current.root, ".design/studio-state.json"), { state: {} }).state;
1078
1389
  if (flags.format && flags.format !== "html")
1079
1390
  throw new Error(
1080
1391
  "Portable export supports HTML. Use the studio PNG action for browser-rendered captures."
1081
1392
  );
1082
- const output = resolve2(flags.output ?? join3(current.root, `${view}-export.html`));
1083
- if (existsSync(output))
1393
+ const output = resolve3(flags.output ?? join4(current.root, `${view}-export.html`));
1394
+ if (existsSync2(output))
1084
1395
  throw new Error(`Export already exists: ${output}. Choose a new --output path.`);
1085
- mkdirSync(dirname(output), { recursive: true });
1086
- writeFileSync(output, standaloneDesignHtml({ ...current, state }, view), { flag: "wx" });
1396
+ mkdirSync2(dirname2(output), { recursive: true });
1397
+ writeFileSync2(output, standaloneDesignHtml({ ...current, state }, view), { flag: "wx" });
1087
1398
  result = { ok: true, output, view, revision: current.revision };
1088
1399
  }
1089
1400
  if (command === "verify") {
1090
1401
  if (!flags.report) throw new Error("verify requires --report <browser-report.json>.");
1091
- result = verifyDesignDocument(file, readJson(resolve2(flags.report)));
1402
+ result = verifyDesignDocument(file, readJson(resolve3(flags.report)));
1092
1403
  }
1093
1404
  if (command === "feedback") {
1094
1405
  const action = flags.action ?? "inspect";
1095
- if (action !== "import") await syncDesignShare(file, { env, fetchImpl });
1406
+ const synced = action === "import" ? void 0 : await syncDesignShare(file, { env, fetchImpl, unavailable: "skip" });
1096
1407
  if (action === "import")
1097
1408
  result = await importDesignFeedback(file, {
1098
1409
  input: flags.input,
@@ -1108,12 +1419,12 @@ async function designUtility(argv, {
1108
1419
  if (!["current", "all"].includes(scope))
1109
1420
  throw new Error("Feedback export scope must be current or all.");
1110
1421
  if (!flags.output) throw new Error("Feedback export requires --output <path>.");
1111
- const output = resolve2(flags.output);
1112
- if (existsSync(output))
1422
+ const output = resolve3(flags.output);
1423
+ if (existsSync2(output))
1113
1424
  throw new Error("Feedback export already exists. Choose a new --output path.");
1114
1425
  const snapshot = exportDesignReview(file, { scope, env });
1115
- mkdirSync(dirname(output), { recursive: true });
1116
- writeFileSync(output, serializeDesignReviewExport(snapshot, format), {
1426
+ mkdirSync2(dirname2(output), { recursive: true });
1427
+ writeFileSync2(output, serializeDesignReviewExport(snapshot, format), {
1117
1428
  flag: "wx",
1118
1429
  mode: 384
1119
1430
  });
@@ -1132,7 +1443,7 @@ async function designUtility(argv, {
1132
1443
  env
1133
1444
  });
1134
1445
  else if (action === "select") {
1135
- const current = currentDesign(file), saved = readJson(join3(current.root, ".design/studio-state.json"), {
1446
+ const current = currentDesign(file), saved = readJson(join4(current.root, ".design/studio-state.json"), {
1136
1447
  state: {},
1137
1448
  stateVersion: 0
1138
1449
  });
@@ -1152,6 +1463,8 @@ async function designUtility(argv, {
1152
1463
  revision: current.revision
1153
1464
  };
1154
1465
  } else throw new Error("Feedback action must be inspect, export, import, select, or resolve.");
1466
+ if (synced?.skipped)
1467
+ result = { ...result, sync: { skipped: synced.skipped, reason: synced.reason } };
1155
1468
  }
1156
1469
  stdout(result);
1157
1470
  return result;