openplanr 3.3.0 → 3.5.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 (493) hide show
  1. package/CHANGELOG.md +80 -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/design.d.ts +3 -0
  10. package/dist/cli/commands/design.d.ts.map +1 -0
  11. package/dist/cli/commands/design.js +137 -0
  12. package/dist/cli/commands/design.js.map +1 -0
  13. package/dist/cli/commands/groups/operations.d.ts.map +1 -1
  14. package/dist/cli/commands/groups/operations.js +2 -0
  15. package/dist/cli/commands/groups/operations.js.map +1 -1
  16. package/dist/cli/commands/ship.d.ts.map +1 -1
  17. package/dist/cli/commands/ship.js +2 -0
  18. package/dist/cli/commands/ship.js.map +1 -1
  19. package/dist/dashboard/.vite/manifest.json +2 -2
  20. package/dist/dashboard/assets/index-B-l_941W.js +75 -0
  21. package/dist/dashboard/assets/index-B-l_941W.js.map +1 -0
  22. package/dist/dashboard/assets/index-Cv4Vwhuw.css +2 -0
  23. package/dist/dashboard/dashboard-manifest.json +14 -14
  24. package/dist/dashboard/index.html +2 -2
  25. package/dist/services/design-artifact-service.d.ts +42 -1
  26. package/dist/services/design-artifact-service.d.ts.map +1 -1
  27. package/dist/services/design-artifact-service.js +198 -19
  28. package/dist/services/design-artifact-service.js.map +1 -1
  29. package/dist/services/runtime-manager/runtime-package.js +1 -1
  30. package/dist/services/runtime-manager/runtime-package.js.map +1 -1
  31. package/dist/services/ship-checks/contract.d.ts +3 -1
  32. package/dist/services/ship-checks/contract.d.ts.map +1 -1
  33. package/dist/services/ship-checks/contract.js +1 -1
  34. package/dist/services/ship-checks/contract.js.map +1 -1
  35. package/dist/services/ship-checks/discover.d.ts.map +1 -1
  36. package/dist/services/ship-checks/discover.js +2 -1
  37. package/dist/services/ship-checks/discover.js.map +1 -1
  38. package/dist/services/ship-checks/package-contents.d.ts +4 -0
  39. package/dist/services/ship-checks/package-contents.d.ts.map +1 -0
  40. package/dist/services/ship-checks/package-contents.js +91 -0
  41. package/dist/services/ship-checks/package-contents.js.map +1 -0
  42. package/dist/services/ship-checks/packages.d.ts +2 -0
  43. package/dist/services/ship-checks/packages.d.ts.map +1 -1
  44. package/dist/services/ship-checks/packages.js +4 -0
  45. package/dist/services/ship-checks/packages.js.map +1 -1
  46. package/dist/services/ship-checks/scope.js +2 -1
  47. package/dist/services/ship-checks/scope.js.map +1 -1
  48. package/dist/utils/splice-managed-block.js +1 -1
  49. package/dist/utils/splice-managed-block.js.map +1 -1
  50. package/docs/CLI.md +67 -1
  51. package/lib/host-packages/adapter-registry.json +5 -5
  52. package/lib/host-packages/capability-map.json +1 -1
  53. package/lib/host-packages/claude/.claude-plugin/marketplace.json +3 -3
  54. package/lib/host-packages/claude/openplanr/.claude-plugin/plugin.json +6 -6
  55. package/lib/host-packages/claude/openplanr/.openplanr-content.json +57 -429
  56. package/lib/host-packages/claude/openplanr/README.md +16 -16
  57. package/lib/host-packages/claude/openplanr/references/agents/shared/modes/shared/task-context-resolution.md +4 -4
  58. package/lib/host-packages/claude/openplanr/skills/artifact/references/design-sharing.md +2 -2
  59. package/lib/host-packages/claude/openplanr/skills/delegate/SKILL.md +2 -1
  60. package/lib/host-packages/claude/openplanr/skills/delegate/references/integration-review.md +26 -20
  61. package/lib/host-packages/claude/openplanr/skills/delegate/references/operator-guide.md +25 -1
  62. package/lib/host-packages/claude/openplanr/skills/delegate/references/run-handoff.md +2 -2
  63. package/lib/host-packages/claude/openplanr/skills/delegate/references/worktree-custody.md +17 -9
  64. package/lib/host-packages/claude/openplanr/skills/delegate/scripts/adapters/claude.mjs +15 -3
  65. package/lib/host-packages/claude/openplanr/skills/delegate/scripts/adapters/codex.mjs +38 -2
  66. package/lib/host-packages/claude/openplanr/skills/delegate/scripts/adapters/native.mjs +5 -0
  67. package/lib/host-packages/claude/openplanr/skills/delegate/scripts/custody.mjs +217 -10
  68. package/lib/host-packages/claude/openplanr/skills/delegate/scripts/handoff.mjs +1080 -0
  69. package/lib/host-packages/claude/openplanr/skills/delegate/scripts/integrate.mjs +96 -201
  70. package/lib/host-packages/claude/openplanr/skills/delegate/scripts/integration-files.mjs +3 -382
  71. package/lib/host-packages/claude/openplanr/skills/delegate/scripts/presentation.mjs +29 -12
  72. package/lib/host-packages/claude/openplanr/skills/delegate/scripts/run-contract.mjs +11 -0
  73. package/lib/host-packages/claude/openplanr/skills/delegate/scripts/run-execution.mjs +1 -1
  74. package/lib/host-packages/claude/openplanr/skills/delegate/scripts/run-lifecycle.mjs +14 -10
  75. package/lib/host-packages/claude/openplanr/skills/delegate/scripts/run-preparation.mjs +4 -0
  76. package/lib/host-packages/claude/openplanr/skills/delegate/scripts/run-record.mjs +2 -2
  77. package/lib/host-packages/claude/openplanr/skills/design/SKILL.md +23 -12
  78. package/lib/host-packages/claude/openplanr/skills/design/references/design-system.md +2 -2
  79. package/lib/host-packages/claude/openplanr/skills/design/references/generation.md +3 -3
  80. package/lib/host-packages/claude/openplanr/skills/design/references/hosted-canvas.md +6 -3
  81. package/lib/host-packages/claude/openplanr/skills/design/references/review.md +6 -6
  82. package/lib/host-packages/claude/openplanr/skills/design/references/team-review.md +3 -4
  83. package/lib/host-packages/claude/openplanr/skills/design/references/utilities.md +78 -32
  84. package/lib/host-packages/claude/openplanr/skills/design-loop/SKILL.md +15 -7
  85. package/lib/host-packages/claude/openplanr/skills/design-loop/references/design-system.md +2 -2
  86. package/lib/host-packages/claude/openplanr/skills/design-loop/references/generation.md +3 -3
  87. package/lib/host-packages/claude/openplanr/skills/design-loop/references/review.md +6 -6
  88. package/lib/host-packages/claude/openplanr/skills/design-loop/references/team-review.md +3 -4
  89. package/lib/host-packages/claude/openplanr/skills/design-loop/references/utilities.md +78 -32
  90. package/lib/host-packages/claude/openplanr/skills/design-review/SKILL.md +25 -5
  91. package/lib/host-packages/claude/openplanr/skills/design-review/references/design-system.md +2 -2
  92. package/lib/host-packages/claude/openplanr/skills/design-review/references/generation.md +3 -3
  93. package/lib/host-packages/claude/openplanr/skills/design-review/references/review.md +6 -6
  94. package/lib/host-packages/claude/openplanr/skills/design-review/references/team-review.md +3 -4
  95. package/lib/host-packages/claude/openplanr/skills/design-review/references/utilities.md +78 -32
  96. package/lib/host-packages/claude/openplanr/skills/investigate/SKILL.md +1 -0
  97. package/lib/host-packages/claude/openplanr/skills/investigate/references/fail-first.md +40 -0
  98. package/lib/host-packages/claude/openplanr/skills/plan/SKILL.md +7 -3
  99. package/lib/host-packages/claude/openplanr/skills/ship/SKILL.md +22 -10
  100. package/lib/host-packages/claude/openplanr/skills/ship/references/fail-first.md +40 -0
  101. package/lib/host-packages/claude/openplanr/skills/ship/references/result-contract.md +7 -3
  102. package/lib/host-packages/cursor/openplanr/.openplanr-content.json +55 -427
  103. package/lib/host-packages/cursor/openplanr/manifest.json +1 -1
  104. package/lib/host-packages/cursor/openplanr/rules/planr-artifact/references/design-sharing.md +2 -2
  105. package/lib/host-packages/cursor/openplanr/rules/planr-delegate/references/integration-review.md +26 -20
  106. package/lib/host-packages/cursor/openplanr/rules/planr-delegate/references/operator-guide.md +25 -1
  107. package/lib/host-packages/cursor/openplanr/rules/planr-delegate/references/run-handoff.md +2 -2
  108. package/lib/host-packages/cursor/openplanr/rules/planr-delegate/references/worktree-custody.md +17 -9
  109. package/lib/host-packages/cursor/openplanr/rules/planr-delegate/scripts/adapters/claude.mjs +15 -3
  110. package/lib/host-packages/cursor/openplanr/rules/planr-delegate/scripts/adapters/codex.mjs +38 -2
  111. package/lib/host-packages/cursor/openplanr/rules/planr-delegate/scripts/adapters/native.mjs +5 -0
  112. package/lib/host-packages/cursor/openplanr/rules/planr-delegate/scripts/custody.mjs +217 -10
  113. package/lib/host-packages/cursor/openplanr/rules/planr-delegate/scripts/handoff.mjs +1080 -0
  114. package/lib/host-packages/cursor/openplanr/rules/planr-delegate/scripts/integrate.mjs +96 -201
  115. package/lib/host-packages/cursor/openplanr/rules/planr-delegate/scripts/integration-files.mjs +3 -382
  116. package/lib/host-packages/cursor/openplanr/rules/planr-delegate/scripts/presentation.mjs +29 -12
  117. package/lib/host-packages/cursor/openplanr/rules/planr-delegate/scripts/run-contract.mjs +11 -0
  118. package/lib/host-packages/cursor/openplanr/rules/planr-delegate/scripts/run-execution.mjs +1 -1
  119. package/lib/host-packages/cursor/openplanr/rules/planr-delegate/scripts/run-lifecycle.mjs +14 -10
  120. package/lib/host-packages/cursor/openplanr/rules/planr-delegate/scripts/run-preparation.mjs +4 -0
  121. package/lib/host-packages/cursor/openplanr/rules/planr-delegate/scripts/run-record.mjs +2 -2
  122. package/lib/host-packages/cursor/openplanr/rules/planr-delegate.mdc +2 -1
  123. package/lib/host-packages/cursor/openplanr/rules/planr-design/references/design-system.md +2 -2
  124. package/lib/host-packages/cursor/openplanr/rules/planr-design/references/generation.md +3 -3
  125. package/lib/host-packages/cursor/openplanr/rules/planr-design/references/hosted-canvas.md +6 -3
  126. package/lib/host-packages/cursor/openplanr/rules/planr-design/references/review.md +6 -6
  127. package/lib/host-packages/cursor/openplanr/rules/planr-design/references/team-review.md +3 -4
  128. package/lib/host-packages/cursor/openplanr/rules/planr-design/references/utilities.md +78 -32
  129. package/lib/host-packages/cursor/openplanr/rules/planr-design-loop/references/design-system.md +2 -2
  130. package/lib/host-packages/cursor/openplanr/rules/planr-design-loop/references/generation.md +3 -3
  131. package/lib/host-packages/cursor/openplanr/rules/planr-design-loop/references/review.md +6 -6
  132. package/lib/host-packages/cursor/openplanr/rules/planr-design-loop/references/team-review.md +3 -4
  133. package/lib/host-packages/cursor/openplanr/rules/planr-design-loop/references/utilities.md +78 -32
  134. package/lib/host-packages/cursor/openplanr/rules/planr-design-loop.mdc +15 -7
  135. package/lib/host-packages/cursor/openplanr/rules/planr-design-review/references/design-system.md +2 -2
  136. package/lib/host-packages/cursor/openplanr/rules/planr-design-review/references/generation.md +3 -3
  137. package/lib/host-packages/cursor/openplanr/rules/planr-design-review/references/review.md +6 -6
  138. package/lib/host-packages/cursor/openplanr/rules/planr-design-review/references/team-review.md +3 -4
  139. package/lib/host-packages/cursor/openplanr/rules/planr-design-review/references/utilities.md +78 -32
  140. package/lib/host-packages/cursor/openplanr/rules/planr-design-review.mdc +25 -5
  141. package/lib/host-packages/cursor/openplanr/rules/planr-design.mdc +23 -12
  142. package/lib/host-packages/cursor/openplanr/rules/planr-investigate/references/fail-first.md +40 -0
  143. package/lib/host-packages/cursor/openplanr/rules/planr-investigate.mdc +1 -0
  144. package/lib/host-packages/cursor/openplanr/rules/planr-plan.mdc +7 -3
  145. package/lib/host-packages/cursor/openplanr/rules/planr-ship/references/fail-first.md +40 -0
  146. package/lib/host-packages/cursor/openplanr/rules/planr-ship/references/result-contract.md +7 -3
  147. package/lib/host-packages/cursor/openplanr/rules/planr-ship.mdc +22 -10
  148. package/lib/host-packages/openai/.claude-plugin/marketplace.json +3 -3
  149. package/lib/host-packages/openai/openplanr/.codex-plugin/plugin.json +2 -2
  150. package/lib/host-packages/openai/openplanr/.openplanr-content.json +62 -434
  151. package/lib/host-packages/openai/openplanr/skills/artifact/references/design-sharing.md +2 -2
  152. package/lib/host-packages/openai/openplanr/skills/delegate/SKILL.md +2 -1
  153. package/lib/host-packages/openai/openplanr/skills/delegate/openplanr.skill.json +1 -1
  154. package/lib/host-packages/openai/openplanr/skills/delegate/references/integration-review.md +26 -20
  155. package/lib/host-packages/openai/openplanr/skills/delegate/references/operator-guide.md +25 -1
  156. package/lib/host-packages/openai/openplanr/skills/delegate/references/run-handoff.md +2 -2
  157. package/lib/host-packages/openai/openplanr/skills/delegate/references/worktree-custody.md +17 -9
  158. package/lib/host-packages/openai/openplanr/skills/delegate/scripts/adapters/claude.mjs +15 -3
  159. package/lib/host-packages/openai/openplanr/skills/delegate/scripts/adapters/codex.mjs +38 -2
  160. package/lib/host-packages/openai/openplanr/skills/delegate/scripts/adapters/native.mjs +5 -0
  161. package/lib/host-packages/openai/openplanr/skills/delegate/scripts/custody.mjs +217 -10
  162. package/lib/host-packages/openai/openplanr/skills/delegate/scripts/handoff.mjs +1080 -0
  163. package/lib/host-packages/openai/openplanr/skills/delegate/scripts/integrate.mjs +96 -201
  164. package/lib/host-packages/openai/openplanr/skills/delegate/scripts/integration-files.mjs +3 -382
  165. package/lib/host-packages/openai/openplanr/skills/delegate/scripts/presentation.mjs +29 -12
  166. package/lib/host-packages/openai/openplanr/skills/delegate/scripts/run-contract.mjs +11 -0
  167. package/lib/host-packages/openai/openplanr/skills/delegate/scripts/run-execution.mjs +1 -1
  168. package/lib/host-packages/openai/openplanr/skills/delegate/scripts/run-lifecycle.mjs +14 -10
  169. package/lib/host-packages/openai/openplanr/skills/delegate/scripts/run-preparation.mjs +4 -0
  170. package/lib/host-packages/openai/openplanr/skills/delegate/scripts/run-record.mjs +2 -2
  171. package/lib/host-packages/openai/openplanr/skills/design/SKILL.md +23 -12
  172. package/lib/host-packages/openai/openplanr/skills/design/openplanr.skill.json +0 -11
  173. package/lib/host-packages/openai/openplanr/skills/design/references/design-system.md +2 -2
  174. package/lib/host-packages/openai/openplanr/skills/design/references/generation.md +3 -3
  175. package/lib/host-packages/openai/openplanr/skills/design/references/hosted-canvas.md +6 -3
  176. package/lib/host-packages/openai/openplanr/skills/design/references/review.md +6 -6
  177. package/lib/host-packages/openai/openplanr/skills/design/references/team-review.md +3 -4
  178. package/lib/host-packages/openai/openplanr/skills/design/references/utilities.md +78 -32
  179. package/lib/host-packages/openai/openplanr/skills/design-loop/SKILL.md +15 -7
  180. package/lib/host-packages/openai/openplanr/skills/design-loop/openplanr.skill.json +0 -11
  181. package/lib/host-packages/openai/openplanr/skills/design-loop/references/design-system.md +2 -2
  182. package/lib/host-packages/openai/openplanr/skills/design-loop/references/generation.md +3 -3
  183. package/lib/host-packages/openai/openplanr/skills/design-loop/references/review.md +6 -6
  184. package/lib/host-packages/openai/openplanr/skills/design-loop/references/team-review.md +3 -4
  185. package/lib/host-packages/openai/openplanr/skills/design-loop/references/utilities.md +78 -32
  186. package/lib/host-packages/openai/openplanr/skills/design-review/SKILL.md +25 -5
  187. package/lib/host-packages/openai/openplanr/skills/design-review/openplanr.skill.json +0 -11
  188. package/lib/host-packages/openai/openplanr/skills/design-review/references/design-system.md +2 -2
  189. package/lib/host-packages/openai/openplanr/skills/design-review/references/generation.md +3 -3
  190. package/lib/host-packages/openai/openplanr/skills/design-review/references/review.md +6 -6
  191. package/lib/host-packages/openai/openplanr/skills/design-review/references/team-review.md +3 -4
  192. package/lib/host-packages/openai/openplanr/skills/design-review/references/utilities.md +78 -32
  193. package/lib/host-packages/openai/openplanr/skills/investigate/SKILL.md +1 -0
  194. package/lib/host-packages/openai/openplanr/skills/investigate/openplanr.skill.json +12 -1
  195. package/lib/host-packages/openai/openplanr/skills/investigate/references/fail-first.md +40 -0
  196. package/lib/host-packages/openai/openplanr/skills/plan/SKILL.md +7 -3
  197. package/lib/host-packages/openai/openplanr/skills/plan/openplanr.skill.json +0 -11
  198. package/lib/host-packages/openai/openplanr/skills/ship/SKILL.md +22 -10
  199. package/lib/host-packages/openai/openplanr/skills/ship/openplanr.skill.json +12 -1
  200. package/lib/host-packages/openai/openplanr/skills/ship/references/fail-first.md +40 -0
  201. package/lib/host-packages/openai/openplanr/skills/ship/references/result-contract.md +7 -3
  202. package/package.json +8 -8
  203. package/dist/dashboard/assets/index-BU5fzjyz.css +0 -1
  204. package/dist/dashboard/assets/index-B_96uzCl.js +0 -572
  205. package/dist/dashboard/assets/index-B_96uzCl.js.map +0 -1
  206. package/lib/host-packages/claude/openplanr/runtime/design/scripts/design-artifact-shell.mjs +0 -1774
  207. package/lib/host-packages/claude/openplanr/runtime/design/scripts/design-chunked-workspace-client.mjs +0 -555
  208. package/lib/host-packages/claude/openplanr/runtime/design/scripts/design-compression.mjs +0 -4180
  209. package/lib/host-packages/claude/openplanr/runtime/design/scripts/design-document.mjs +0 -2937
  210. package/lib/host-packages/claude/openplanr/runtime/design/scripts/design-encrypted-workspace-client.mjs +0 -647
  211. package/lib/host-packages/claude/openplanr/runtime/design/scripts/design-entities.mjs +0 -439
  212. package/lib/host-packages/claude/openplanr/runtime/design/scripts/design-handoff.mjs +0 -1576
  213. package/lib/host-packages/claude/openplanr/runtime/design/scripts/design-loopback-server.mjs +0 -359
  214. package/lib/host-packages/claude/openplanr/runtime/design/scripts/design-owner-custody.mjs +0 -129
  215. package/lib/host-packages/claude/openplanr/runtime/design/scripts/design-parse5-parser.mjs +0 -3970
  216. package/lib/host-packages/claude/openplanr/runtime/design/scripts/design-parse5-tokenizer.mjs +0 -3501
  217. package/lib/host-packages/claude/openplanr/runtime/design/scripts/design-resource-pack.mjs +0 -698
  218. package/lib/host-packages/claude/openplanr/runtime/design/scripts/design-review.mjs +0 -3385
  219. package/lib/host-packages/claude/openplanr/runtime/design/scripts/design-runtime-home.mjs +0 -39
  220. package/lib/host-packages/claude/openplanr/runtime/design/scripts/design-runtime-support-25485dbf1cb2.mjs +0 -24
  221. package/lib/host-packages/claude/openplanr/runtime/design/scripts/design-sandbox-guards.mjs +0 -1102
  222. package/lib/host-packages/claude/openplanr/runtime/design/scripts/design-share.mjs +0 -1993
  223. package/lib/host-packages/claude/openplanr/runtime/design/scripts/design-shared-artifact-support-dependencies-design-support-protocol-contracts-3d9b1a86.mjs +0 -1113
  224. package/lib/host-packages/claude/openplanr/runtime/design/scripts/design-shared-artifact-support-protocol-contracts-ea2cd15e.mjs +0 -505
  225. package/lib/host-packages/claude/openplanr/runtime/design/scripts/design-shared-protocol-contracts-75a938cc.mjs +0 -222
  226. package/lib/host-packages/claude/openplanr/runtime/design/scripts/design-shared-protocol-contracts-b5f28f94.mjs +0 -5907
  227. package/lib/host-packages/claude/openplanr/runtime/design/scripts/design-upload-spool.mjs +0 -198
  228. package/lib/host-packages/claude/openplanr/runtime/design/scripts/design.mjs +0 -1430
  229. package/lib/host-packages/claude/openplanr/runtime/design/scripts/runtime/notices/THIRD_PARTY_NOTICES.txt +0 -2050
  230. package/lib/host-packages/claude/openplanr/runtime/design/scripts/runtime/packages/artifact/lib/artifact/ui/studio-shell.css +0 -2
  231. package/lib/host-packages/claude/openplanr/runtime/design/scripts/runtime/packages/artifact/templates/artifact-review-stage.js.sources/01-module-runtime.js +0 -18
  232. package/lib/host-packages/claude/openplanr/runtime/design/scripts/runtime/packages/artifact/templates/artifact-review-stage.js.sources/02-artifact-review-ui.js +0 -809
  233. package/lib/host-packages/claude/openplanr/runtime/design/scripts/runtime/packages/artifact/templates/artifact-review-stage.js.sources/03-protocol-contracts.js +0 -5693
  234. package/lib/host-packages/claude/openplanr/runtime/design/scripts/runtime/packages/artifact/templates/artifact-review-stage.js.sources/04-compression.js +0 -4175
  235. package/lib/host-packages/claude/openplanr/runtime/design/scripts/runtime/packages/artifact/templates/artifact-review-stage.js.sources/05-artifact-sharing.js +0 -65
  236. 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
  237. package/lib/host-packages/claude/openplanr/runtime/design/scripts/runtime/packages/artifact/templates/artifact-review-stage.js.sources/07-artifact-sharing.js +0 -62
  238. 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
  239. package/lib/host-packages/claude/openplanr/runtime/design/scripts/runtime/packages/artifact/templates/artifact-review-stage.js.sources.json +0 -124
  240. package/lib/host-packages/claude/openplanr/runtime/design/scripts/runtime/packages/design/package.json +0 -65
  241. package/lib/host-packages/claude/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/enhancements.css +0 -388
  242. package/lib/host-packages/claude/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/handoff-center.css +0 -81
  243. package/lib/host-packages/claude/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/share.css +0 -1
  244. package/lib/host-packages/claude/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/share.js +0 -133
  245. package/lib/host-packages/claude/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/studio.css +0 -1159
  246. package/lib/host-packages/claude/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/studio.js.sources/01-module-runtime.js +0 -30
  247. package/lib/host-packages/claude/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/studio.js.sources/02-react.js +0 -900
  248. package/lib/host-packages/claude/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/studio.js.sources/03-react-dom-client-fiber-foundations.js +0 -2261
  249. package/lib/host-packages/claude/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/studio.js.sources/04-react-dom-client-reconciliation-hooks.js +0 -1595
  250. package/lib/host-packages/claude/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/studio.js.sources/05-react-dom-client-render-phases.js +0 -1467
  251. package/lib/host-packages/claude/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/studio.js.sources/06-react-dom-client-commit-effects.js +0 -1860
  252. package/lib/host-packages/claude/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/studio.js.sources/07-react-dom-client-work-loop-scheduling.js +0 -914
  253. package/lib/host-packages/claude/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/studio.js.sources/08-react-dom-client-dom-events-properties-hydration.js +0 -2578
  254. package/lib/host-packages/claude/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/studio.js.sources/09-react-dom-client-public-roots.js +0 -582
  255. package/lib/host-packages/claude/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/studio.js.sources/10-react.js +0 -17
  256. package/lib/host-packages/claude/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/studio.js.sources/11-artifact-review-ui.js +0 -12
  257. package/lib/host-packages/claude/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/studio.js.sources/12-protocol-contracts.js +0 -285
  258. package/lib/host-packages/claude/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/studio.js.sources/13-design-review-experience.js +0 -2773
  259. package/lib/host-packages/claude/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/studio.js.sources/14-studio-shell.js +0 -134
  260. package/lib/host-packages/claude/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/studio.js.sources/15-canvas-engine.js +0 -2207
  261. package/lib/host-packages/claude/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/studio.js.sources/16-design-review-experience.js +0 -16
  262. package/lib/host-packages/claude/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/studio.js.sources/17-studio-shell.js +0 -8
  263. package/lib/host-packages/claude/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/studio.js.sources/18-interface-primitives.js +0 -3883
  264. package/lib/host-packages/claude/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/studio.js.sources/19-interface-primitives.js +0 -966
  265. package/lib/host-packages/claude/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/studio.js.sources/20-studio-shell.js +0 -520
  266. package/lib/host-packages/claude/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/studio.js.sources/21-design-studio.js +0 -1597
  267. package/lib/host-packages/claude/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/studio.js.sources.json +0 -311
  268. package/lib/host-packages/claude/openplanr/runtime/design/scripts/runtime/packages/protocol/package.json +0 -159
  269. package/lib/host-packages/claude/openplanr/runtime/design/scripts/runtime/packages/protocol/registries/artifact-theme.json +0 -64
  270. package/lib/host-packages/claude/openplanr/runtime/design/scripts/runtime/packages/protocol/schemas/v1.0.0/design-manifest.schema.json +0 -90
  271. package/lib/host-packages/claude/openplanr/runtime/design/scripts/runtime/packages/protocol/schemas/v1.1.0/artifact-envelope.schema.json +0 -142
  272. package/lib/host-packages/claude/openplanr/runtime/design/scripts/runtime/packages/protocol/schemas/v1.1.0/artifact-paste.schema.json +0 -49
  273. package/lib/host-packages/claude/openplanr/runtime/design/scripts/runtime/packages/protocol/schemas/v1.1.0/artifact-review.schema.json +0 -97
  274. package/lib/host-packages/claude/openplanr/runtime/design/scripts/runtime/packages/protocol/schemas/v1.10.0/design-review-bundle.schema.json +0 -584
  275. package/lib/host-packages/claude/openplanr/runtime/design/scripts/runtime/packages/protocol/schemas/v1.10.0/design-review-context.schema.json +0 -191
  276. package/lib/host-packages/claude/openplanr/runtime/design/scripts/runtime/packages/protocol/schemas/v1.10.0/design-review-handoff.schema.json +0 -407
  277. package/lib/host-packages/claude/openplanr/runtime/design/scripts/runtime/packages/protocol/schemas/v1.10.0/design-review-metadata-payload.schema.json +0 -106
  278. package/lib/host-packages/claude/openplanr/runtime/design/scripts/runtime/packages/protocol/schemas/v1.11.0/design-handoff-readiness.schema.json +0 -398
  279. package/lib/host-packages/claude/openplanr/runtime/design/scripts/runtime/packages/protocol/schemas/v1.11.0/design-implementation-handoff.schema.json +0 -518
  280. package/lib/host-packages/claude/openplanr/runtime/design/scripts/runtime/packages/protocol/schemas/v1.11.0/design-planning-lineage.schema.json +0 -106
  281. package/lib/host-packages/claude/openplanr/runtime/design/scripts/runtime/packages/protocol/schemas/v1.11.0/design-review-metadata-payload.schema.json +0 -107
  282. package/lib/host-packages/claude/openplanr/runtime/design/scripts/runtime/packages/protocol/schemas/v1.14.0/artifact-theme.schema.json +0 -316
  283. package/lib/host-packages/claude/openplanr/runtime/design/scripts/runtime/packages/protocol/schemas/v1.16.0/artifact-envelope.schema.json +0 -408
  284. package/lib/host-packages/claude/openplanr/runtime/design/scripts/runtime/packages/protocol/schemas/v1.16.0/design-review-bundle.schema.json +0 -590
  285. package/lib/host-packages/claude/openplanr/runtime/design/scripts/runtime/packages/protocol/schemas/v1.22.0/design-document.schema.json +0 -506
  286. package/lib/host-packages/claude/openplanr/runtime/design/scripts/runtime/packages/protocol/schemas/v1.22.0/design-review-bundle.schema.json +0 -822
  287. package/lib/host-packages/claude/openplanr/runtime/design/scripts/runtime/packages/protocol/schemas/v1.9.0/design-review-bundle.schema.json +0 -346
  288. package/lib/host-packages/claude/openplanr/runtime/design/scripts/runtime/packages/protocol/schemas/v1.9.0/design-review-workspace.schema.json +0 -108
  289. package/lib/host-packages/claude/openplanr/runtime/design/scripts/runtime/packages/protocol/schemas/v1.9.0/design-workspace-create.schema.json +0 -170
  290. package/lib/host-packages/claude/openplanr/runtime/design/scripts/runtime/packages/protocol/schemas/v1.9.0/design-workspace-event.schema.json +0 -97
  291. package/lib/host-packages/claude/openplanr/runtime/design/scripts/runtime/packages/protocol/schemas/v1.9.0/design-workspace-revision.schema.json +0 -56
  292. package/lib/host-packages/claude/openplanr/runtime/plan/scripts/design-protocol-contracts.mjs +0 -5468
  293. package/lib/host-packages/claude/openplanr/runtime/plan/scripts/design.mjs +0 -2844
  294. package/lib/host-packages/claude/openplanr/runtime/plan/scripts/runtime/notices/THIRD_PARTY_NOTICES.txt +0 -21
  295. package/lib/host-packages/claude/openplanr/runtime/plan/scripts/runtime/packages/protocol/package.json +0 -159
  296. package/lib/host-packages/claude/openplanr/runtime/plan/scripts/runtime/packages/protocol/schemas/v1.1.0/artifact-review.schema.json +0 -97
  297. package/lib/host-packages/claude/openplanr/skills/delegate/scripts/integration-transaction.mjs +0 -958
  298. package/lib/host-packages/claude/openplanr/skills/design/scripts/design.mjs +0 -12
  299. package/lib/host-packages/claude/openplanr/skills/design-loop/scripts/design.mjs +0 -12
  300. package/lib/host-packages/claude/openplanr/skills/design-review/scripts/design.mjs +0 -12
  301. package/lib/host-packages/claude/openplanr/skills/plan/scripts/design.mjs +0 -12
  302. package/lib/host-packages/cursor/openplanr/rules/planr-delegate/scripts/integration-transaction.mjs +0 -958
  303. package/lib/host-packages/cursor/openplanr/rules/planr-design/scripts/design.mjs +0 -12
  304. package/lib/host-packages/cursor/openplanr/rules/planr-design-loop/scripts/design.mjs +0 -12
  305. package/lib/host-packages/cursor/openplanr/rules/planr-design-review/scripts/design.mjs +0 -12
  306. package/lib/host-packages/cursor/openplanr/rules/planr-plan/scripts/design.mjs +0 -12
  307. package/lib/host-packages/cursor/openplanr/runtime/design/scripts/design-artifact-shell.mjs +0 -1774
  308. package/lib/host-packages/cursor/openplanr/runtime/design/scripts/design-chunked-workspace-client.mjs +0 -555
  309. package/lib/host-packages/cursor/openplanr/runtime/design/scripts/design-compression.mjs +0 -4180
  310. package/lib/host-packages/cursor/openplanr/runtime/design/scripts/design-document.mjs +0 -2937
  311. package/lib/host-packages/cursor/openplanr/runtime/design/scripts/design-encrypted-workspace-client.mjs +0 -647
  312. package/lib/host-packages/cursor/openplanr/runtime/design/scripts/design-entities.mjs +0 -439
  313. package/lib/host-packages/cursor/openplanr/runtime/design/scripts/design-handoff.mjs +0 -1576
  314. package/lib/host-packages/cursor/openplanr/runtime/design/scripts/design-loopback-server.mjs +0 -359
  315. package/lib/host-packages/cursor/openplanr/runtime/design/scripts/design-owner-custody.mjs +0 -129
  316. package/lib/host-packages/cursor/openplanr/runtime/design/scripts/design-parse5-parser.mjs +0 -3970
  317. package/lib/host-packages/cursor/openplanr/runtime/design/scripts/design-parse5-tokenizer.mjs +0 -3501
  318. package/lib/host-packages/cursor/openplanr/runtime/design/scripts/design-resource-pack.mjs +0 -698
  319. package/lib/host-packages/cursor/openplanr/runtime/design/scripts/design-review.mjs +0 -3385
  320. package/lib/host-packages/cursor/openplanr/runtime/design/scripts/design-runtime-home.mjs +0 -39
  321. package/lib/host-packages/cursor/openplanr/runtime/design/scripts/design-runtime-support-25485dbf1cb2.mjs +0 -24
  322. package/lib/host-packages/cursor/openplanr/runtime/design/scripts/design-sandbox-guards.mjs +0 -1102
  323. package/lib/host-packages/cursor/openplanr/runtime/design/scripts/design-share.mjs +0 -1993
  324. package/lib/host-packages/cursor/openplanr/runtime/design/scripts/design-shared-artifact-support-dependencies-design-support-protocol-contracts-3d9b1a86.mjs +0 -1113
  325. package/lib/host-packages/cursor/openplanr/runtime/design/scripts/design-shared-artifact-support-protocol-contracts-ea2cd15e.mjs +0 -505
  326. package/lib/host-packages/cursor/openplanr/runtime/design/scripts/design-shared-protocol-contracts-75a938cc.mjs +0 -222
  327. package/lib/host-packages/cursor/openplanr/runtime/design/scripts/design-shared-protocol-contracts-b5f28f94.mjs +0 -5907
  328. package/lib/host-packages/cursor/openplanr/runtime/design/scripts/design-upload-spool.mjs +0 -198
  329. package/lib/host-packages/cursor/openplanr/runtime/design/scripts/design.mjs +0 -1430
  330. package/lib/host-packages/cursor/openplanr/runtime/design/scripts/runtime/notices/THIRD_PARTY_NOTICES.txt +0 -2050
  331. package/lib/host-packages/cursor/openplanr/runtime/design/scripts/runtime/packages/artifact/lib/artifact/ui/studio-shell.css +0 -2
  332. package/lib/host-packages/cursor/openplanr/runtime/design/scripts/runtime/packages/artifact/templates/artifact-review-stage.js.sources/01-module-runtime.js +0 -18
  333. package/lib/host-packages/cursor/openplanr/runtime/design/scripts/runtime/packages/artifact/templates/artifact-review-stage.js.sources/02-artifact-review-ui.js +0 -809
  334. package/lib/host-packages/cursor/openplanr/runtime/design/scripts/runtime/packages/artifact/templates/artifact-review-stage.js.sources/03-protocol-contracts.js +0 -5693
  335. package/lib/host-packages/cursor/openplanr/runtime/design/scripts/runtime/packages/artifact/templates/artifact-review-stage.js.sources/04-compression.js +0 -4175
  336. package/lib/host-packages/cursor/openplanr/runtime/design/scripts/runtime/packages/artifact/templates/artifact-review-stage.js.sources/05-artifact-sharing.js +0 -65
  337. 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
  338. package/lib/host-packages/cursor/openplanr/runtime/design/scripts/runtime/packages/artifact/templates/artifact-review-stage.js.sources/07-artifact-sharing.js +0 -62
  339. 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
  340. package/lib/host-packages/cursor/openplanr/runtime/design/scripts/runtime/packages/artifact/templates/artifact-review-stage.js.sources.json +0 -124
  341. package/lib/host-packages/cursor/openplanr/runtime/design/scripts/runtime/packages/design/package.json +0 -65
  342. package/lib/host-packages/cursor/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/enhancements.css +0 -388
  343. package/lib/host-packages/cursor/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/handoff-center.css +0 -81
  344. package/lib/host-packages/cursor/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/share.css +0 -1
  345. package/lib/host-packages/cursor/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/share.js +0 -133
  346. package/lib/host-packages/cursor/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/studio.css +0 -1159
  347. package/lib/host-packages/cursor/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/studio.js.sources/01-module-runtime.js +0 -30
  348. package/lib/host-packages/cursor/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/studio.js.sources/02-react.js +0 -900
  349. package/lib/host-packages/cursor/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/studio.js.sources/03-react-dom-client-fiber-foundations.js +0 -2261
  350. package/lib/host-packages/cursor/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/studio.js.sources/04-react-dom-client-reconciliation-hooks.js +0 -1595
  351. package/lib/host-packages/cursor/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/studio.js.sources/05-react-dom-client-render-phases.js +0 -1467
  352. package/lib/host-packages/cursor/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/studio.js.sources/06-react-dom-client-commit-effects.js +0 -1860
  353. package/lib/host-packages/cursor/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/studio.js.sources/07-react-dom-client-work-loop-scheduling.js +0 -914
  354. package/lib/host-packages/cursor/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/studio.js.sources/08-react-dom-client-dom-events-properties-hydration.js +0 -2578
  355. package/lib/host-packages/cursor/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/studio.js.sources/09-react-dom-client-public-roots.js +0 -582
  356. package/lib/host-packages/cursor/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/studio.js.sources/10-react.js +0 -17
  357. package/lib/host-packages/cursor/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/studio.js.sources/11-artifact-review-ui.js +0 -12
  358. package/lib/host-packages/cursor/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/studio.js.sources/12-protocol-contracts.js +0 -285
  359. package/lib/host-packages/cursor/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/studio.js.sources/13-design-review-experience.js +0 -2773
  360. package/lib/host-packages/cursor/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/studio.js.sources/14-studio-shell.js +0 -134
  361. package/lib/host-packages/cursor/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/studio.js.sources/15-canvas-engine.js +0 -2207
  362. package/lib/host-packages/cursor/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/studio.js.sources/16-design-review-experience.js +0 -16
  363. package/lib/host-packages/cursor/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/studio.js.sources/17-studio-shell.js +0 -8
  364. package/lib/host-packages/cursor/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/studio.js.sources/18-interface-primitives.js +0 -3883
  365. package/lib/host-packages/cursor/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/studio.js.sources/19-interface-primitives.js +0 -966
  366. package/lib/host-packages/cursor/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/studio.js.sources/20-studio-shell.js +0 -520
  367. package/lib/host-packages/cursor/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/studio.js.sources/21-design-studio.js +0 -1597
  368. package/lib/host-packages/cursor/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/studio.js.sources.json +0 -311
  369. package/lib/host-packages/cursor/openplanr/runtime/design/scripts/runtime/packages/protocol/package.json +0 -159
  370. package/lib/host-packages/cursor/openplanr/runtime/design/scripts/runtime/packages/protocol/registries/artifact-theme.json +0 -64
  371. package/lib/host-packages/cursor/openplanr/runtime/design/scripts/runtime/packages/protocol/schemas/v1.0.0/design-manifest.schema.json +0 -90
  372. package/lib/host-packages/cursor/openplanr/runtime/design/scripts/runtime/packages/protocol/schemas/v1.1.0/artifact-envelope.schema.json +0 -142
  373. package/lib/host-packages/cursor/openplanr/runtime/design/scripts/runtime/packages/protocol/schemas/v1.1.0/artifact-paste.schema.json +0 -49
  374. package/lib/host-packages/cursor/openplanr/runtime/design/scripts/runtime/packages/protocol/schemas/v1.1.0/artifact-review.schema.json +0 -97
  375. package/lib/host-packages/cursor/openplanr/runtime/design/scripts/runtime/packages/protocol/schemas/v1.10.0/design-review-bundle.schema.json +0 -584
  376. package/lib/host-packages/cursor/openplanr/runtime/design/scripts/runtime/packages/protocol/schemas/v1.10.0/design-review-context.schema.json +0 -191
  377. package/lib/host-packages/cursor/openplanr/runtime/design/scripts/runtime/packages/protocol/schemas/v1.10.0/design-review-handoff.schema.json +0 -407
  378. package/lib/host-packages/cursor/openplanr/runtime/design/scripts/runtime/packages/protocol/schemas/v1.10.0/design-review-metadata-payload.schema.json +0 -106
  379. package/lib/host-packages/cursor/openplanr/runtime/design/scripts/runtime/packages/protocol/schemas/v1.11.0/design-handoff-readiness.schema.json +0 -398
  380. package/lib/host-packages/cursor/openplanr/runtime/design/scripts/runtime/packages/protocol/schemas/v1.11.0/design-implementation-handoff.schema.json +0 -518
  381. package/lib/host-packages/cursor/openplanr/runtime/design/scripts/runtime/packages/protocol/schemas/v1.11.0/design-planning-lineage.schema.json +0 -106
  382. package/lib/host-packages/cursor/openplanr/runtime/design/scripts/runtime/packages/protocol/schemas/v1.11.0/design-review-metadata-payload.schema.json +0 -107
  383. package/lib/host-packages/cursor/openplanr/runtime/design/scripts/runtime/packages/protocol/schemas/v1.14.0/artifact-theme.schema.json +0 -316
  384. package/lib/host-packages/cursor/openplanr/runtime/design/scripts/runtime/packages/protocol/schemas/v1.16.0/artifact-envelope.schema.json +0 -408
  385. package/lib/host-packages/cursor/openplanr/runtime/design/scripts/runtime/packages/protocol/schemas/v1.16.0/design-review-bundle.schema.json +0 -590
  386. package/lib/host-packages/cursor/openplanr/runtime/design/scripts/runtime/packages/protocol/schemas/v1.22.0/design-document.schema.json +0 -506
  387. package/lib/host-packages/cursor/openplanr/runtime/design/scripts/runtime/packages/protocol/schemas/v1.22.0/design-review-bundle.schema.json +0 -822
  388. package/lib/host-packages/cursor/openplanr/runtime/design/scripts/runtime/packages/protocol/schemas/v1.9.0/design-review-bundle.schema.json +0 -346
  389. package/lib/host-packages/cursor/openplanr/runtime/design/scripts/runtime/packages/protocol/schemas/v1.9.0/design-review-workspace.schema.json +0 -108
  390. package/lib/host-packages/cursor/openplanr/runtime/design/scripts/runtime/packages/protocol/schemas/v1.9.0/design-workspace-create.schema.json +0 -170
  391. package/lib/host-packages/cursor/openplanr/runtime/design/scripts/runtime/packages/protocol/schemas/v1.9.0/design-workspace-event.schema.json +0 -97
  392. package/lib/host-packages/cursor/openplanr/runtime/design/scripts/runtime/packages/protocol/schemas/v1.9.0/design-workspace-revision.schema.json +0 -56
  393. package/lib/host-packages/cursor/openplanr/runtime/plan/scripts/design-protocol-contracts.mjs +0 -5468
  394. package/lib/host-packages/cursor/openplanr/runtime/plan/scripts/design.mjs +0 -2844
  395. package/lib/host-packages/cursor/openplanr/runtime/plan/scripts/runtime/notices/THIRD_PARTY_NOTICES.txt +0 -21
  396. package/lib/host-packages/cursor/openplanr/runtime/plan/scripts/runtime/packages/protocol/package.json +0 -159
  397. package/lib/host-packages/cursor/openplanr/runtime/plan/scripts/runtime/packages/protocol/schemas/v1.1.0/artifact-review.schema.json +0 -97
  398. package/lib/host-packages/openai/openplanr/runtime/design/scripts/design-artifact-shell.mjs +0 -1774
  399. package/lib/host-packages/openai/openplanr/runtime/design/scripts/design-chunked-workspace-client.mjs +0 -555
  400. package/lib/host-packages/openai/openplanr/runtime/design/scripts/design-compression.mjs +0 -4180
  401. package/lib/host-packages/openai/openplanr/runtime/design/scripts/design-document.mjs +0 -2937
  402. package/lib/host-packages/openai/openplanr/runtime/design/scripts/design-encrypted-workspace-client.mjs +0 -647
  403. package/lib/host-packages/openai/openplanr/runtime/design/scripts/design-entities.mjs +0 -439
  404. package/lib/host-packages/openai/openplanr/runtime/design/scripts/design-handoff.mjs +0 -1576
  405. package/lib/host-packages/openai/openplanr/runtime/design/scripts/design-loopback-server.mjs +0 -359
  406. package/lib/host-packages/openai/openplanr/runtime/design/scripts/design-owner-custody.mjs +0 -129
  407. package/lib/host-packages/openai/openplanr/runtime/design/scripts/design-parse5-parser.mjs +0 -3970
  408. package/lib/host-packages/openai/openplanr/runtime/design/scripts/design-parse5-tokenizer.mjs +0 -3501
  409. package/lib/host-packages/openai/openplanr/runtime/design/scripts/design-resource-pack.mjs +0 -698
  410. package/lib/host-packages/openai/openplanr/runtime/design/scripts/design-review.mjs +0 -3385
  411. package/lib/host-packages/openai/openplanr/runtime/design/scripts/design-runtime-home.mjs +0 -39
  412. package/lib/host-packages/openai/openplanr/runtime/design/scripts/design-runtime-support-25485dbf1cb2.mjs +0 -24
  413. package/lib/host-packages/openai/openplanr/runtime/design/scripts/design-sandbox-guards.mjs +0 -1102
  414. package/lib/host-packages/openai/openplanr/runtime/design/scripts/design-share.mjs +0 -1993
  415. package/lib/host-packages/openai/openplanr/runtime/design/scripts/design-shared-artifact-support-dependencies-design-support-protocol-contracts-3d9b1a86.mjs +0 -1113
  416. package/lib/host-packages/openai/openplanr/runtime/design/scripts/design-shared-artifact-support-protocol-contracts-ea2cd15e.mjs +0 -505
  417. package/lib/host-packages/openai/openplanr/runtime/design/scripts/design-shared-protocol-contracts-75a938cc.mjs +0 -222
  418. package/lib/host-packages/openai/openplanr/runtime/design/scripts/design-shared-protocol-contracts-b5f28f94.mjs +0 -5907
  419. package/lib/host-packages/openai/openplanr/runtime/design/scripts/design-upload-spool.mjs +0 -198
  420. package/lib/host-packages/openai/openplanr/runtime/design/scripts/design.mjs +0 -1430
  421. package/lib/host-packages/openai/openplanr/runtime/design/scripts/runtime/notices/THIRD_PARTY_NOTICES.txt +0 -2050
  422. package/lib/host-packages/openai/openplanr/runtime/design/scripts/runtime/packages/artifact/lib/artifact/ui/studio-shell.css +0 -2
  423. package/lib/host-packages/openai/openplanr/runtime/design/scripts/runtime/packages/artifact/templates/artifact-review-stage.js.sources/01-module-runtime.js +0 -18
  424. package/lib/host-packages/openai/openplanr/runtime/design/scripts/runtime/packages/artifact/templates/artifact-review-stage.js.sources/02-artifact-review-ui.js +0 -809
  425. package/lib/host-packages/openai/openplanr/runtime/design/scripts/runtime/packages/artifact/templates/artifact-review-stage.js.sources/03-protocol-contracts.js +0 -5693
  426. package/lib/host-packages/openai/openplanr/runtime/design/scripts/runtime/packages/artifact/templates/artifact-review-stage.js.sources/04-compression.js +0 -4175
  427. package/lib/host-packages/openai/openplanr/runtime/design/scripts/runtime/packages/artifact/templates/artifact-review-stage.js.sources/05-artifact-sharing.js +0 -65
  428. 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
  429. package/lib/host-packages/openai/openplanr/runtime/design/scripts/runtime/packages/artifact/templates/artifact-review-stage.js.sources/07-artifact-sharing.js +0 -62
  430. 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
  431. package/lib/host-packages/openai/openplanr/runtime/design/scripts/runtime/packages/artifact/templates/artifact-review-stage.js.sources.json +0 -124
  432. package/lib/host-packages/openai/openplanr/runtime/design/scripts/runtime/packages/design/package.json +0 -65
  433. package/lib/host-packages/openai/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/enhancements.css +0 -388
  434. package/lib/host-packages/openai/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/handoff-center.css +0 -81
  435. package/lib/host-packages/openai/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/share.css +0 -1
  436. package/lib/host-packages/openai/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/share.js +0 -133
  437. package/lib/host-packages/openai/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/studio.css +0 -1159
  438. package/lib/host-packages/openai/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/studio.js.sources/01-module-runtime.js +0 -30
  439. package/lib/host-packages/openai/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/studio.js.sources/02-react.js +0 -900
  440. package/lib/host-packages/openai/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/studio.js.sources/03-react-dom-client-fiber-foundations.js +0 -2261
  441. package/lib/host-packages/openai/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/studio.js.sources/04-react-dom-client-reconciliation-hooks.js +0 -1595
  442. package/lib/host-packages/openai/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/studio.js.sources/05-react-dom-client-render-phases.js +0 -1467
  443. package/lib/host-packages/openai/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/studio.js.sources/06-react-dom-client-commit-effects.js +0 -1860
  444. package/lib/host-packages/openai/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/studio.js.sources/07-react-dom-client-work-loop-scheduling.js +0 -914
  445. package/lib/host-packages/openai/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/studio.js.sources/08-react-dom-client-dom-events-properties-hydration.js +0 -2578
  446. package/lib/host-packages/openai/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/studio.js.sources/09-react-dom-client-public-roots.js +0 -582
  447. package/lib/host-packages/openai/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/studio.js.sources/10-react.js +0 -17
  448. package/lib/host-packages/openai/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/studio.js.sources/11-artifact-review-ui.js +0 -12
  449. package/lib/host-packages/openai/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/studio.js.sources/12-protocol-contracts.js +0 -285
  450. package/lib/host-packages/openai/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/studio.js.sources/13-design-review-experience.js +0 -2773
  451. package/lib/host-packages/openai/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/studio.js.sources/14-studio-shell.js +0 -134
  452. package/lib/host-packages/openai/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/studio.js.sources/15-canvas-engine.js +0 -2207
  453. package/lib/host-packages/openai/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/studio.js.sources/16-design-review-experience.js +0 -16
  454. package/lib/host-packages/openai/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/studio.js.sources/17-studio-shell.js +0 -8
  455. package/lib/host-packages/openai/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/studio.js.sources/18-interface-primitives.js +0 -3883
  456. package/lib/host-packages/openai/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/studio.js.sources/19-interface-primitives.js +0 -966
  457. package/lib/host-packages/openai/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/studio.js.sources/20-studio-shell.js +0 -520
  458. package/lib/host-packages/openai/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/studio.js.sources/21-design-studio.js +0 -1597
  459. package/lib/host-packages/openai/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/studio.js.sources.json +0 -311
  460. package/lib/host-packages/openai/openplanr/runtime/design/scripts/runtime/packages/protocol/package.json +0 -159
  461. package/lib/host-packages/openai/openplanr/runtime/design/scripts/runtime/packages/protocol/registries/artifact-theme.json +0 -64
  462. package/lib/host-packages/openai/openplanr/runtime/design/scripts/runtime/packages/protocol/schemas/v1.0.0/design-manifest.schema.json +0 -90
  463. package/lib/host-packages/openai/openplanr/runtime/design/scripts/runtime/packages/protocol/schemas/v1.1.0/artifact-envelope.schema.json +0 -142
  464. package/lib/host-packages/openai/openplanr/runtime/design/scripts/runtime/packages/protocol/schemas/v1.1.0/artifact-paste.schema.json +0 -49
  465. package/lib/host-packages/openai/openplanr/runtime/design/scripts/runtime/packages/protocol/schemas/v1.1.0/artifact-review.schema.json +0 -97
  466. package/lib/host-packages/openai/openplanr/runtime/design/scripts/runtime/packages/protocol/schemas/v1.10.0/design-review-bundle.schema.json +0 -584
  467. package/lib/host-packages/openai/openplanr/runtime/design/scripts/runtime/packages/protocol/schemas/v1.10.0/design-review-context.schema.json +0 -191
  468. package/lib/host-packages/openai/openplanr/runtime/design/scripts/runtime/packages/protocol/schemas/v1.10.0/design-review-handoff.schema.json +0 -407
  469. package/lib/host-packages/openai/openplanr/runtime/design/scripts/runtime/packages/protocol/schemas/v1.10.0/design-review-metadata-payload.schema.json +0 -106
  470. package/lib/host-packages/openai/openplanr/runtime/design/scripts/runtime/packages/protocol/schemas/v1.11.0/design-handoff-readiness.schema.json +0 -398
  471. package/lib/host-packages/openai/openplanr/runtime/design/scripts/runtime/packages/protocol/schemas/v1.11.0/design-implementation-handoff.schema.json +0 -518
  472. package/lib/host-packages/openai/openplanr/runtime/design/scripts/runtime/packages/protocol/schemas/v1.11.0/design-planning-lineage.schema.json +0 -106
  473. package/lib/host-packages/openai/openplanr/runtime/design/scripts/runtime/packages/protocol/schemas/v1.11.0/design-review-metadata-payload.schema.json +0 -107
  474. package/lib/host-packages/openai/openplanr/runtime/design/scripts/runtime/packages/protocol/schemas/v1.14.0/artifact-theme.schema.json +0 -316
  475. package/lib/host-packages/openai/openplanr/runtime/design/scripts/runtime/packages/protocol/schemas/v1.16.0/artifact-envelope.schema.json +0 -408
  476. package/lib/host-packages/openai/openplanr/runtime/design/scripts/runtime/packages/protocol/schemas/v1.16.0/design-review-bundle.schema.json +0 -590
  477. package/lib/host-packages/openai/openplanr/runtime/design/scripts/runtime/packages/protocol/schemas/v1.22.0/design-document.schema.json +0 -506
  478. package/lib/host-packages/openai/openplanr/runtime/design/scripts/runtime/packages/protocol/schemas/v1.22.0/design-review-bundle.schema.json +0 -822
  479. package/lib/host-packages/openai/openplanr/runtime/design/scripts/runtime/packages/protocol/schemas/v1.9.0/design-review-bundle.schema.json +0 -346
  480. package/lib/host-packages/openai/openplanr/runtime/design/scripts/runtime/packages/protocol/schemas/v1.9.0/design-review-workspace.schema.json +0 -108
  481. package/lib/host-packages/openai/openplanr/runtime/design/scripts/runtime/packages/protocol/schemas/v1.9.0/design-workspace-create.schema.json +0 -170
  482. package/lib/host-packages/openai/openplanr/runtime/design/scripts/runtime/packages/protocol/schemas/v1.9.0/design-workspace-event.schema.json +0 -97
  483. package/lib/host-packages/openai/openplanr/runtime/design/scripts/runtime/packages/protocol/schemas/v1.9.0/design-workspace-revision.schema.json +0 -56
  484. package/lib/host-packages/openai/openplanr/runtime/plan/scripts/design-protocol-contracts.mjs +0 -5468
  485. package/lib/host-packages/openai/openplanr/runtime/plan/scripts/design.mjs +0 -2844
  486. package/lib/host-packages/openai/openplanr/runtime/plan/scripts/runtime/notices/THIRD_PARTY_NOTICES.txt +0 -21
  487. package/lib/host-packages/openai/openplanr/runtime/plan/scripts/runtime/packages/protocol/package.json +0 -159
  488. package/lib/host-packages/openai/openplanr/runtime/plan/scripts/runtime/packages/protocol/schemas/v1.1.0/artifact-review.schema.json +0 -97
  489. package/lib/host-packages/openai/openplanr/skills/delegate/scripts/integration-transaction.mjs +0 -958
  490. package/lib/host-packages/openai/openplanr/skills/design/scripts/design.mjs +0 -12
  491. package/lib/host-packages/openai/openplanr/skills/design-loop/scripts/design.mjs +0 -12
  492. package/lib/host-packages/openai/openplanr/skills/design-review/scripts/design.mjs +0 -12
  493. package/lib/host-packages/openai/openplanr/skills/plan/scripts/design.mjs +0 -12
@@ -1,1113 +0,0 @@
1
- import {
2
- isProcessAlive
3
- } from "./design-loopback-server.mjs";
4
- import {
5
- Parser,
6
- defaultTreeAdapter
7
- } from "./design-parse5-parser.mjs";
8
- import {
9
- NS,
10
- TAG_NAMES,
11
- hasUnescapedText
12
- } from "./design-parse5-tokenizer.mjs";
13
- import {
14
- MAX_ARTIFACT_HTML_BYTES
15
- } from "./design-shared-artifact-support-protocol-contracts-ea2cd15e.mjs";
16
- import {
17
- DESIGN_DOCUMENT_SCHEMA,
18
- DESIGN_DOCUMENT_V120_SCHEMA,
19
- DESIGN_REVIEW_BUNDLE_SCHEMA,
20
- validateDesignProps,
21
- validateJson
22
- } from "./design-shared-protocol-contracts-b5f28f94.mjs";
23
- import {
24
- canonicalizeJson,
25
- sha256Hex
26
- } from "./design-shared-protocol-contracts-75a938cc.mjs";
27
-
28
- // packages/design/lib/design/document-state.mjs
29
- import { createHash, randomUUID } from "node:crypto";
30
- import {
31
- chmodSync,
32
- closeSync,
33
- lstatSync,
34
- mkdirSync,
35
- openSync,
36
- readFileSync,
37
- realpathSync,
38
- renameSync,
39
- rmSync,
40
- writeFileSync
41
- } from "node:fs";
42
- import { dirname, join, resolve } from "node:path";
43
- var hash = (value) => createHash("sha256").update(value).digest("hex");
44
- var json = (value) => `${JSON.stringify(value, null, 2)}
45
- `;
46
- function readJson(path, fallback = void 0) {
47
- try {
48
- return JSON.parse(readFileSync(path, "utf8"));
49
- } catch (error) {
50
- if (error.code === "ENOENT" && fallback !== void 0) return fallback;
51
- throw error;
52
- }
53
- }
54
- function atomicJson(path, value, { mode } = {}) {
55
- atomicBytes(path, json(value), mode);
56
- }
57
- function atomicBytes(path, bytes, mode) {
58
- mkdirSync(dirname(path), { recursive: true });
59
- const temporary = `${path}.${randomUUID()}.tmp`;
60
- try {
61
- writeFileSync(temporary, bytes, { mode: 384, flag: "wx" });
62
- if (mode !== void 0) chmodSync(temporary, mode);
63
- renameSync(temporary, path);
64
- } finally {
65
- rmSync(temporary, { force: true });
66
- }
67
- }
68
- function recoverDesignPublication(root, { ownsRenderLock = false } = {}) {
69
- const journalPath = join(root, ".design/publication.json");
70
- let journal = readJson(journalPath, null);
71
- if (!journal) return;
72
- const lockPath = join(root, ".design/render.lock");
73
- let recoveryOwner;
74
- if (!ownsRenderLock) {
75
- const lock = readJson(lockPath, null);
76
- if (lock && isProcessAlive(lock.pid)) return;
77
- if (lock) rmSync(lockPath, { force: true });
78
- recoveryOwner = randomUUID();
79
- let descriptor;
80
- try {
81
- descriptor = openSync(lockPath, "wx", 384);
82
- writeFileSync(
83
- descriptor,
84
- json({ pid: process.pid, owner: recoveryOwner, createdAt: Date.now() })
85
- );
86
- } catch (error) {
87
- if (error.code === "EEXIST") return;
88
- throw error;
89
- } finally {
90
- if (descriptor !== void 0) closeSync(descriptor);
91
- }
92
- }
93
- try {
94
- journal = readJson(journalPath, null);
95
- if (!journal) return;
96
- const pointer = readJson(join(root, ".design/current.json"), null);
97
- const manifestPath = join(root, "finalized.json");
98
- if (pointer?.revision === journal.revision) atomicJson(manifestPath, journal.manifest);
99
- else if ((pointer?.revision ?? null) === journal.previousRevision) {
100
- if (journal.previousManifest === null) rmSync(manifestPath, { force: true });
101
- else atomicBytes(manifestPath, Buffer.from(journal.previousManifest, "base64"));
102
- } else if (pointer?.revision && /^[a-f0-9]{64}$/u.test(pointer.revision)) {
103
- atomicJson(
104
- manifestPath,
105
- readJson(join(root, ".design/revisions", pointer.revision, "render.json")).manifest
106
- );
107
- } else
108
- throw new Error("Design publication recovery could not identify the committed revision.");
109
- rmSync(journalPath, { force: true });
110
- } finally {
111
- if (recoveryOwner && readJson(lockPath, null)?.owner === recoveryOwner)
112
- rmSync(lockPath, { force: true });
113
- }
114
- }
115
- function designSpecPath(root) {
116
- return /(?:^|\/)output\/feats\/feat-[^/]+\/design$/u.test(root.replaceAll("\\", "/")) ? join(dirname(root), "design-spec.md") : join(root, "design-spec.md");
117
- }
118
- function currentDesign(file, { recoverPublication = true } = {}) {
119
- const root = realpathSync(dirname(resolve(file)));
120
- if (recoverPublication) recoverDesignPublication(root);
121
- else {
122
- try {
123
- lstatSync(join(root, ".design/publication.json"));
124
- throw Object.assign(
125
- new Error(
126
- "Design publication state is pending or needs recovery. Finish or recover it with the Design utility; repair or restore an invalid .design/publication.json before retrying Plan handoff inspection."
127
- ),
128
- { code: "E_DESIGN_PUBLICATION_PENDING", statusCode: 409 }
129
- );
130
- } catch (error) {
131
- if (error.code !== "ENOENT") throw error;
132
- }
133
- }
134
- const pointer = readJson(join(root, ".design/current.json"), null);
135
- if (!pointer || !/^[a-f0-9]{64}$/u.test(pointer.revision))
136
- throw new Error("Design has no completed render. Run the render utility first.");
137
- const directory = join(root, ".design/revisions", pointer.revision);
138
- const prepared = readJson(join(directory, "render.json"));
139
- return {
140
- ...prepared,
141
- root,
142
- directory,
143
- file: resolve(file),
144
- verification: readJson(join(root, ".design/verification", `${pointer.revision}.json`), {
145
- status: "unverified",
146
- revision: pointer.revision
147
- })
148
- };
149
- }
150
-
151
- // packages/artifact/lib/artifact/local-document.mjs
152
- import { createHash as createHash2 } from "node:crypto";
153
- import { readFileSync as readFileSync2, realpathSync as realpathSync2, statSync } from "node:fs";
154
- import { dirname as dirname2, extname, isAbsolute, relative, resolve as resolve2 } from "node:path";
155
- import { Script } from "node:vm";
156
-
157
- // node_modules/entities/dist/escape.js
158
- var getCodePoint = typeof String.prototype.codePointAt === "function" ? (input, index) => input.codePointAt(index) : (
159
- // http://mathiasbynens.be/notes/javascript-encoding#surrogate-formulae
160
- (c, index) => (c.charCodeAt(index) & 64512) === 55296 ? (c.charCodeAt(index) - 55296) * 1024 + c.charCodeAt(index + 1) - 56320 + 65536 : c.charCodeAt(index)
161
- );
162
- function getEscaper(regex, map) {
163
- return function escape(data) {
164
- let match;
165
- let lastIndex = 0;
166
- let result = "";
167
- while (match = regex.exec(data)) {
168
- if (lastIndex !== match.index) {
169
- result += data.substring(lastIndex, match.index);
170
- }
171
- result += map.get(match[0].charCodeAt(0));
172
- lastIndex = match.index + 1;
173
- }
174
- return result + data.substring(lastIndex);
175
- };
176
- }
177
- var escapeAttribute = /* @__PURE__ */ getEscaper(/["&\u00A0]/g, /* @__PURE__ */ new Map([
178
- [34, """],
179
- [38, "&"],
180
- [160, " "]
181
- ]));
182
- var escapeText = /* @__PURE__ */ getEscaper(/[&<>\u00A0]/g, /* @__PURE__ */ new Map([
183
- [38, "&amp;"],
184
- [60, "&lt;"],
185
- [62, "&gt;"],
186
- [160, "&nbsp;"]
187
- ]));
188
-
189
- // node_modules/parse5/dist/serializer/index.js
190
- var VOID_ELEMENTS = /* @__PURE__ */ new Set([
191
- TAG_NAMES.AREA,
192
- TAG_NAMES.BASE,
193
- TAG_NAMES.BASEFONT,
194
- TAG_NAMES.BGSOUND,
195
- TAG_NAMES.BR,
196
- TAG_NAMES.COL,
197
- TAG_NAMES.EMBED,
198
- TAG_NAMES.FRAME,
199
- TAG_NAMES.HR,
200
- TAG_NAMES.IMG,
201
- TAG_NAMES.INPUT,
202
- TAG_NAMES.KEYGEN,
203
- TAG_NAMES.LINK,
204
- TAG_NAMES.META,
205
- TAG_NAMES.PARAM,
206
- TAG_NAMES.SOURCE,
207
- TAG_NAMES.TRACK,
208
- TAG_NAMES.WBR
209
- ]);
210
- function isVoidElement(node, options) {
211
- return options.treeAdapter.isElementNode(node) && options.treeAdapter.getNamespaceURI(node) === NS.HTML && VOID_ELEMENTS.has(options.treeAdapter.getTagName(node));
212
- }
213
- var defaultOpts = { treeAdapter: defaultTreeAdapter, scriptingEnabled: true };
214
- function serialize(node, options) {
215
- const opts = { ...defaultOpts, ...options };
216
- if (isVoidElement(node, opts)) {
217
- return "";
218
- }
219
- return serializeChildNodes(node, opts);
220
- }
221
- function serializeChildNodes(parentNode, options) {
222
- let html = "";
223
- const container = options.treeAdapter.isElementNode(parentNode) && options.treeAdapter.getTagName(parentNode) === TAG_NAMES.TEMPLATE && options.treeAdapter.getNamespaceURI(parentNode) === NS.HTML ? options.treeAdapter.getTemplateContent(parentNode) : parentNode;
224
- const childNodes = options.treeAdapter.getChildNodes(container);
225
- if (childNodes) {
226
- for (const currentNode of childNodes) {
227
- html += serializeNode(currentNode, options);
228
- }
229
- }
230
- return html;
231
- }
232
- function serializeNode(node, options) {
233
- if (options.treeAdapter.isElementNode(node)) {
234
- return serializeElement(node, options);
235
- }
236
- if (options.treeAdapter.isTextNode(node)) {
237
- return serializeTextNode(node, options);
238
- }
239
- if (options.treeAdapter.isCommentNode(node)) {
240
- return serializeCommentNode(node, options);
241
- }
242
- if (options.treeAdapter.isDocumentTypeNode(node)) {
243
- return serializeDocumentTypeNode(node, options);
244
- }
245
- return "";
246
- }
247
- function serializeElement(node, options) {
248
- const tn = options.treeAdapter.getTagName(node);
249
- return `<${tn}${serializeAttributes(node, options)}>${isVoidElement(node, options) ? "" : `${serializeChildNodes(node, options)}</${tn}>`}`;
250
- }
251
- function serializeAttributes(node, { treeAdapter }) {
252
- let html = "";
253
- for (const attr2 of treeAdapter.getAttrList(node)) {
254
- html += " ";
255
- if (attr2.namespace) {
256
- switch (attr2.namespace) {
257
- case NS.XML: {
258
- html += `xml:${attr2.name}`;
259
- break;
260
- }
261
- case NS.XMLNS: {
262
- if (attr2.name !== "xmlns") {
263
- html += "xmlns:";
264
- }
265
- html += attr2.name;
266
- break;
267
- }
268
- case NS.XLINK: {
269
- html += `xlink:${attr2.name}`;
270
- break;
271
- }
272
- default: {
273
- html += `${attr2.prefix}:${attr2.name}`;
274
- }
275
- }
276
- } else {
277
- html += attr2.name;
278
- }
279
- html += `="${escapeAttribute(attr2.value)}"`;
280
- }
281
- return html;
282
- }
283
- function serializeTextNode(node, options) {
284
- const { treeAdapter } = options;
285
- const content = treeAdapter.getTextNodeContent(node);
286
- const parent = treeAdapter.getParentNode(node);
287
- const parentTn = parent && treeAdapter.isElementNode(parent) && treeAdapter.getTagName(parent);
288
- return parentTn && treeAdapter.getNamespaceURI(parent) === NS.HTML && hasUnescapedText(parentTn, options.scriptingEnabled) ? content : escapeText(content);
289
- }
290
- function serializeCommentNode(node, { treeAdapter }) {
291
- return `<!--${treeAdapter.getCommentNodeContent(node)}-->`;
292
- }
293
- function serializeDocumentTypeNode(node, { treeAdapter }) {
294
- return `<!DOCTYPE ${treeAdapter.getDocumentTypeNodeName(node)}>`;
295
- }
296
-
297
- // node_modules/parse5/dist/index.js
298
- function parse(html, options) {
299
- return Parser.parse(html, options);
300
- }
301
- function parseFragment(fragmentContext, html, options) {
302
- if (typeof fragmentContext === "string") {
303
- options = html;
304
- html = fragmentContext;
305
- fragmentContext = null;
306
- }
307
- const parser = Parser.getFragmentParser(fragmentContext, options);
308
- parser.tokenizer.write(html, true);
309
- return parser.getFragment();
310
- }
311
-
312
- // packages/artifact/lib/artifact/local-document.mjs
313
- var MIME = {
314
- ".png": "image/png",
315
- ".jpg": "image/jpeg",
316
- ".jpeg": "image/jpeg",
317
- ".svg": "image/svg+xml",
318
- ".webp": "image/webp",
319
- ".avif": "image/avif",
320
- ".gif": "image/gif",
321
- ".woff": "font/woff",
322
- ".woff2": "font/woff2",
323
- ".ttf": "font/ttf",
324
- ".ico": "image/x-icon"
325
- };
326
- var children = (node) => [...node.childNodes ?? [], ...node.content?.childNodes ?? []];
327
- var attr = (node, name) => node.attrs?.find((item2) => item2.name === name);
328
- var isPropToken = (value) => typeof value === "string" && value.length <= 128 && /^[a-z][a-z0-9-]*(?![\s\S])/u.test(value);
329
- var text = (node) => children(node).map((item2) => item2.value ?? "").join("");
330
- function setText(node, value) {
331
- node.childNodes = [{ nodeName: "#text", value, parentNode: node }];
332
- }
333
- function element(name, value) {
334
- const node = parseFragment(`<${name}></${name}>`).childNodes[0];
335
- setText(node, value);
336
- return node;
337
- }
338
- function parseBodySource(html) {
339
- const roots = [];
340
- const parser = new Parser({ sourceCodeLocationInfo: true });
341
- const onStartTag = parser.onStartTag.bind(parser);
342
- parser.onStartTag = (token) => {
343
- if (token.tagName === "body") roots.push(token);
344
- onStartTag(token);
345
- };
346
- parser.tokenizer.write(html, true);
347
- const body = parser.document.childNodes.find((node) => node.tagName === "html")?.childNodes.find((node) => node.tagName === "body");
348
- const root = roots.length === 1 && body?.sourceCodeLocation?.startTag?.startOffset === roots[0].location?.startOffset ? roots[0] : null;
349
- return { document: parser.document, roots, root };
350
- }
351
- function inspectLocalDocumentBody(html) {
352
- const { root } = parseBodySource(html);
353
- return root ? { attrs: root.attrs, location: root.location } : null;
354
- }
355
- function resolveLocalDocumentFile(root, path, from = root) {
356
- if (typeof path !== "string" || !path || /^(?:[a-z][a-z\d+.-]*:|\/|\\)/iu.test(path))
357
- throw new Error(`Expected a local relative asset: ${path}`);
358
- const candidate = resolve2(from, path);
359
- const inside = (file) => {
360
- const r = relative(root, file);
361
- return r !== ".." && !r.startsWith(`..${process.platform === "win32" ? "\\" : "/"}`) && !isAbsolute(r);
362
- };
363
- if (!inside(candidate)) throw new Error(`Asset escapes design root: ${path}`);
364
- const actual = realpathSync2(candidate);
365
- if (!inside(actual) || !statSync(actual).isFile())
366
- throw new Error(`Asset is not a contained regular file: ${path}`);
367
- return actual;
368
- }
369
- function bundleLocalDocument({
370
- root: inputRoot,
371
- source,
372
- sharedStyles = [],
373
- screenId,
374
- maxBytes = MAX_ARTIFACT_HTML_BYTES,
375
- readSource,
376
- passive = false,
377
- screenProps
378
- }) {
379
- const root = realpathSync2(inputRoot);
380
- const files = /* @__PURE__ */ new Map();
381
- const mediaStack = /* @__PURE__ */ new Set();
382
- let svgDepth = 0;
383
- let cssExpansionBytes = 0;
384
- let cssExpansions = 0;
385
- let bytes = 0;
386
- function read(path, from = root) {
387
- const checked = readSource?.(path, from);
388
- const file = checked?.file ?? resolveLocalDocumentFile(root, path, from);
389
- if (!files.has(file)) {
390
- const value = checked?.value ?? readFileSync2(file);
391
- bytes += value.length;
392
- if (bytes > maxBytes || files.size >= 1e3)
393
- throw new Error("Design source exceeds the local asset budget.");
394
- files.set(file, value);
395
- }
396
- return { file, value: files.get(file) };
397
- }
398
- function asset(ref, from) {
399
- if (/^#/iu.test(ref)) return ref;
400
- if (/^data:/iu.test(ref)) {
401
- if (!passive) return ref;
402
- const match = /^data:([^;,]+)(;base64)?,([\s\S]*)$/iu.exec(ref);
403
- if (!match || !Object.values(MIME).includes(match[1].toLowerCase()))
404
- throw new Error("Passive design media must be a supported image or font.");
405
- if (match[1].toLowerCase() !== "image/svg+xml") return ref;
406
- const svg = match[2] ? Buffer.from(match[3], "base64").toString("utf8") : decodeURIComponent(match[3]);
407
- return `data:image/svg+xml;base64,${Buffer.from(passiveSvg(svg, from)).toString("base64")}`;
408
- }
409
- const fragmentIndex = ref.indexOf("#");
410
- const fragment = fragmentIndex < 0 ? "" : ref.slice(fragmentIndex);
411
- const { file, value } = read(fragmentIndex < 0 ? ref : ref.slice(0, fragmentIndex), from);
412
- if (!MIME[extname(file).toLowerCase()]) throw new Error(`Unsupported local media: ${ref}`);
413
- let payload = value;
414
- if (passive && extname(file).toLowerCase() === ".svg") {
415
- if (mediaStack.has(file) || mediaStack.size >= 16)
416
- throw new Error("Circular or excessively nested SVG media cannot be published.");
417
- mediaStack.add(file);
418
- try {
419
- payload = Buffer.from(passiveSvg(value.toString("utf8"), dirname2(file)));
420
- } finally {
421
- mediaStack.delete(file);
422
- }
423
- }
424
- return `data:${MIME[extname(file).toLowerCase()]};base64,${payload.toString("base64")}${fragment}`;
425
- }
426
- function passiveSvg(value, from) {
427
- if (++svgDepth > 16) throw new Error("Excessively nested SVG media cannot be published.");
428
- try {
429
- const fragment = parseFragment(value);
430
- if (!fragment.childNodes.some((node) => node.tagName === "svg"))
431
- throw new Error("SVG media must contain an SVG drawing.");
432
- const queue2 = [...children(fragment)];
433
- while (queue2.length) {
434
- const node = queue2.shift();
435
- if (["script", "foreignObject", "iframe", "object", "embed"].includes(node.tagName)) {
436
- node.parentNode.childNodes = node.parentNode.childNodes.filter((child) => child !== node);
437
- continue;
438
- }
439
- node.attrs = (node.attrs ?? []).filter((item2) => !/^on/iu.test(item2.name));
440
- if (node.tagName === "style") setText(node, css(text(node), from));
441
- for (const item2 of node.attrs) {
442
- if (item2.name === "style") item2.value = css(item2.value, from);
443
- if (["href", "src"].includes(item2.name)) item2.value = asset(item2.value, from);
444
- }
445
- queue2.unshift(...children(node));
446
- }
447
- return serialize(fragment);
448
- } finally {
449
- svgDepth--;
450
- }
451
- }
452
- function replaceCss(value, pattern, replacement) {
453
- const parts = [];
454
- let offset = 0, outputBytes = 0;
455
- function append(part) {
456
- const size = Buffer.byteLength(part);
457
- outputBytes += size;
458
- cssExpansionBytes += size;
459
- if (outputBytes > maxBytes || cssExpansionBytes > maxBytes * 8)
460
- throw new Error("Stylesheet expansion exceeds the local asset budget.");
461
- parts.push(part);
462
- }
463
- for (const match of value.matchAll(pattern)) {
464
- append(value.slice(offset, match.index));
465
- append(replacement(...match));
466
- offset = match.index + match[0].length;
467
- }
468
- append(value.slice(offset));
469
- return parts.join("");
470
- }
471
- function css(value, from, stack = /* @__PURE__ */ new Set()) {
472
- if (++cssExpansions > 4096)
473
- throw new Error("Stylesheet expansion complexity exceeds the local asset budget.");
474
- let result = replaceCss(
475
- value,
476
- /@import\s+(?:url\(\s*)?["']([^"']+)["']\s*\)?\s*([^;]*);/giu,
477
- (_all, ref, media) => {
478
- const next = read(ref, from);
479
- if (stack.has(next.file)) throw new Error(`Circular stylesheet import: ${ref}`);
480
- const expanded = css(
481
- next.value.toString("utf8"),
482
- dirname2(next.file),
483
- /* @__PURE__ */ new Set([...stack, next.file])
484
- );
485
- return media.trim() ? `@media ${media.trim()}{${expanded}}` : expanded;
486
- }
487
- );
488
- if (/@import\b/iu.test(result)) throw new Error("Use quoted local stylesheet imports.");
489
- result = replaceCss(
490
- result,
491
- /url\(\s*(["']?)(.*?)\1\s*\)/giu,
492
- (_all, _quote, ref) => `url("${asset(ref, from)}")`
493
- );
494
- return replaceCss(result, /<\/style/giu, () => "<\\/style");
495
- }
496
- function js(value, label) {
497
- try {
498
- new Script(value, { filename: label });
499
- } catch (error) {
500
- throw new Error(
501
- `Use compiled, self-contained browser JavaScript in ${label}: ${error.message}`
502
- );
503
- }
504
- return value.replace(/<\/script/giu, "<\\/script");
505
- }
506
- const input = read(source.html);
507
- const propEntries = Object.entries(screenProps ?? {});
508
- let document;
509
- if (propEntries.length) {
510
- const parsed = parseBodySource(input.value.toString("utf8"));
511
- if (!parsed.root)
512
- throw new Error(
513
- `Screen ${screenId} source ${source.html} requires a single authored <body> root for props; found ${parsed.roots.length}.`
514
- );
515
- document = parsed.document;
516
- } else document = parse(input.value.toString("utf8"));
517
- let head, body;
518
- const deferredScripts = [];
519
- const queue = [...children(document)];
520
- while (queue.length) {
521
- const node = queue.shift();
522
- if (node.tagName === "head") head = node;
523
- if (node.tagName === "body") body = node;
524
- if (["base", "iframe", "frame", "frameset", "object", "embed"].includes(node.tagName))
525
- throw new Error(
526
- `Unsupported <${node.tagName}> in a local design. Use local controls and button handlers.`
527
- );
528
- if (node.tagName === "meta" && attr(node, "http-equiv")?.value.toLowerCase() === "refresh")
529
- throw new Error("Design screens cannot redirect.");
530
- if (node.tagName === "style") setText(node, css(text(node), dirname2(input.file)));
531
- if (node.tagName === "link" && attr(node, "rel")?.value.toLowerCase().split(/\s+/u).includes("stylesheet")) {
532
- const linked = read(attr(node, "href")?.value, dirname2(input.file));
533
- node.tagName = "style";
534
- node.nodeName = "style";
535
- node.attrs = [];
536
- setText(
537
- node,
538
- css(linked.value.toString("utf8"), dirname2(linked.file), /* @__PURE__ */ new Set([linked.file]))
539
- );
540
- }
541
- if (node.tagName === "script") {
542
- const src = attr(node, "src");
543
- if (passive) {
544
- if (src) read(src.value, dirname2(input.file));
545
- node.parentNode.childNodes = node.parentNode.childNodes.filter((child) => child !== node);
546
- continue;
547
- }
548
- const type = attr(node, "type")?.value.trim().toLowerCase();
549
- if (type === "module")
550
- throw new Error("Compile module scripts before using them in a portable design.");
551
- if (!type || /(?:javascript|ecmascript)/u.test(type)) {
552
- const linked = src ? read(src.value, dirname2(input.file)) : null;
553
- setText(
554
- node,
555
- js(linked ? linked.value.toString("utf8") : text(node), linked?.file ?? input.file)
556
- );
557
- if (src && attr(node, "defer")) {
558
- deferredScripts.push(node);
559
- node.parentNode.childNodes = node.parentNode.childNodes.filter((child) => child !== node);
560
- }
561
- node.attrs = (node.attrs ?? []).filter(
562
- (item2) => !["src", "async", "defer"].includes(item2.name)
563
- );
564
- }
565
- }
566
- if (passive) node.attrs = (node.attrs ?? []).filter((item2) => !/^on/iu.test(item2.name));
567
- for (const item2 of node.attrs ?? []) {
568
- if (item2.name === "style") item2.value = css(item2.value, dirname2(input.file));
569
- if (["src", "poster"].includes(item2.name))
570
- item2.value = asset(item2.value, dirname2(input.file));
571
- if (item2.name === "srcset")
572
- throw new Error("Use a local src and responsive CSS for portable design images.");
573
- if (["action", "formaction", "target", "formtarget"].includes(item2.name) && item2.value.trim())
574
- throw new Error("Design forms must use local submit handlers without navigation targets.");
575
- if (item2.name === "href" && !item2.value.startsWith("#")) {
576
- if (node.tagName === "link" || node.namespaceURI === "http://www.w3.org/2000/svg")
577
- item2.value = asset(item2.value, dirname2(input.file));
578
- else if (node.tagName === "a")
579
- throw new Error('Use data-design-navigate="screen-id" for prototype navigation.');
580
- }
581
- }
582
- queue.unshift(...children(node));
583
- }
584
- const prepend = [];
585
- for (const path of [...sharedStyles, ...source.styles ?? []]) {
586
- const linked = read(path);
587
- prepend.push(
588
- element(
589
- "style",
590
- css(linked.value.toString("utf8"), dirname2(linked.file), /* @__PURE__ */ new Set([linked.file]))
591
- )
592
- );
593
- }
594
- head.childNodes = [...prepend, ...head.childNodes];
595
- for (const node of prepend) node.parentNode = head;
596
- for (const path of source.scripts ?? []) {
597
- const linked = read(path);
598
- if (passive) continue;
599
- const node = element("script", js(linked.value.toString("utf8"), path));
600
- node.parentNode = body;
601
- body.childNodes.push(node);
602
- }
603
- for (const node of deferredScripts) {
604
- node.parentNode = body;
605
- body.childNodes.push(node);
606
- }
607
- body.attrs.push({ name: "data-planr-screen", value: screenId });
608
- if (propEntries.length) {
609
- const classes = (attr(body, "class")?.value ?? "").split(/\s+/u).filter(Boolean).filter((item2) => !propEntries.some(([name]) => item2.startsWith(`prop-${name}-`)));
610
- for (const [name, value] of propEntries) {
611
- if (!isPropToken(name) || !(typeof value === "boolean" || isPropToken(value)))
612
- throw new TypeError(
613
- `Screen ${screenId} source ${source.html} has invalid prop ${name}: ${JSON.stringify(value)}.`
614
- );
615
- const attribute = `data-prop-${name}`;
616
- body.attrs = body.attrs.filter((item2) => item2.name !== attribute);
617
- body.attrs.push({ name: attribute, value: String(value) });
618
- const prefix = `prop-${name}-`;
619
- classes.push(`${prefix}${value}`);
620
- }
621
- body.attrs = body.attrs.filter((item2) => item2.name !== "class");
622
- body.attrs.push({ name: "class", value: classes.join(" ") });
623
- }
624
- const html = serialize(document);
625
- if (Buffer.byteLength(html) > maxBytes)
626
- throw new Error("Bundled design exceeds the output budget.");
627
- return {
628
- html,
629
- files: [...files.keys()].map((path) => relative(root, path)),
630
- sourceDigests: Object.fromEntries(
631
- [...files].map(([path, value]) => [
632
- relative(root, path),
633
- createHash2("sha256").update(value).digest("hex")
634
- ])
635
- ),
636
- inputBytes: bytes,
637
- bytes: Buffer.byteLength(html)
638
- };
639
- }
640
-
641
- // packages/protocol/src/review-experience-contracts.mjs
642
- var text2 = { type: "string", maxLength: 16384 };
643
- var id = { type: "string", minLength: 1, maxLength: 128 };
644
- var digest = { type: "string", pattern: "^[a-f0-9]{64}$" };
645
- var texts = { type: "array", maxItems: 256, items: text2 };
646
- var closed = (properties, required = Object.keys(properties)) => ({
647
- type: "object",
648
- additionalProperties: false,
649
- properties,
650
- required
651
- });
652
- var list = (items, maxItems = 256) => ({ type: "array", maxItems, items });
653
- var schema = (name, properties, required) => ({
654
- $schema: "https://json-schema.org/draft/2020-12/schema",
655
- $id: `https://openplanr.dev/schemas/v1.10.0/${name}.schema.json`,
656
- "x-openplanr-contract": { id: name, version: "1.10.0" },
657
- ...closed(properties, required)
658
- });
659
- var DESIGN_REVIEW_CONTEXT_SCHEMA = schema(
660
- "design-review-context",
661
- {
662
- kind: { const: "openplanr-design-review-context" },
663
- schemaVersion: { const: "1.0.0" },
664
- designId: id,
665
- brief: closed({ purpose: text2, requests: { ...texts, maxItems: 3 }, audience: text2 }, [
666
- "purpose",
667
- "requests"
668
- ]),
669
- revisionSummary: text2,
670
- implementation: closed({
671
- tokens: list(closed({ name: id, value: text2, description: text2 }, ["name", "value"]), 512),
672
- components: list(
673
- closed(
674
- {
675
- id,
676
- name: text2,
677
- screenIds: list(id),
678
- anchorIds: list(id),
679
- states: list(closed({ name: id, description: text2 })),
680
- notes: text2,
681
- responsive: text2,
682
- accessibility: text2
683
- },
684
- ["id", "name"]
685
- )
686
- ),
687
- responsive: texts,
688
- accessibility: texts
689
- })
690
- },
691
- ["kind", "schemaVersion", "designId", "brief", "implementation"]
692
- );
693
- var DESIGN_FINGERPRINT_SCHEMA = closed({
694
- screenId: id,
695
- variantId: id,
696
- frameId: id,
697
- contentDigest: digest,
698
- guidanceDigest: digest
699
- });
700
- var bundleV11 = {
701
- .../** @type {MutableSchema} */
702
- structuredClone(DESIGN_REVIEW_BUNDLE_SCHEMA),
703
- $id: "https://openplanr.dev/schemas/v1.10.0/design-review-bundle.schema.json",
704
- "x-openplanr-contract": { id: "design-review-bundle", version: "1.10.0" }
705
- };
706
- Object.assign(bundleV11.properties, {
707
- schemaVersion: { const: "1.1.0" },
708
- reviewContext: DESIGN_REVIEW_CONTEXT_SCHEMA,
709
- contextDigest: digest,
710
- fingerprints: list(DESIGN_FINGERPRINT_SCHEMA)
711
- });
712
- bundleV11.required.push("reviewContext", "contextDigest", "fingerprints");
713
- var DESIGN_REVIEW_BUNDLE_V11_SCHEMA = bundleV11;
714
- var bundleV12 = (
715
- /** @type {MutableSchema} */
716
- structuredClone(DESIGN_REVIEW_BUNDLE_V11_SCHEMA)
717
- );
718
- bundleV12.$id = "https://openplanr.dev/schemas/v1.16.0/design-review-bundle.schema.json";
719
- bundleV12["x-openplanr-contract"] = { id: "design-review-bundle", version: "1.16.0" };
720
- Object.assign(bundleV12.properties, {
721
- schemaVersion: { const: "1.2.0" },
722
- envelope: {
723
- type: "object",
724
- required: ["schemaVersion", "sources", "artifacts", "viewer"],
725
- properties: { schemaVersion: { const: "1.1.0" } }
726
- },
727
- entries: {
728
- .../** @type {Record<string, unknown>} */
729
- bundleV12.properties.entries,
730
- maxItems: 4096
731
- },
732
- fingerprints: list(DESIGN_FINGERPRINT_SCHEMA, 4096)
733
- });
734
- var DESIGN_REVIEW_BUNDLE_V12_SCHEMA = bundleV12;
735
- var bundleCurrent = (
736
- /** @type {MutableSchema} */
737
- structuredClone(bundleV12)
738
- );
739
- bundleCurrent.$id = "https://openplanr.dev/schemas/v1.20.0/design-review-bundle.schema.json";
740
- bundleCurrent["x-openplanr-contract"] = { id: "design-review-bundle", version: "1.20.0" };
741
- bundleCurrent.properties.schemaVersion = { enum: ["1.1.0", "1.2.0"] };
742
- bundleCurrent.properties.envelope = bundleV11.properties.envelope;
743
- bundleCurrent.allOf = [
744
- {
745
- if: { properties: { schemaVersion: { const: "1.2.0" } } },
746
- then: { properties: { envelope: bundleV12.properties.envelope } }
747
- }
748
- ];
749
- var currentDesign2 = (
750
- /** @type {MutableSchema} */
751
- bundleCurrent.properties.design
752
- );
753
- for (const key of ["frames", "layout"])
754
- currentDesign2.properties[key] = /** @type {Record<string, unknown>} */
755
- DESIGN_DOCUMENT_V120_SCHEMA.properties[key];
756
- bundleCurrent.$defs = structuredClone(DESIGN_DOCUMENT_V120_SCHEMA.$defs);
757
- var currentEntries = (
758
- /** @type {{ items: { properties: Record<string, unknown> } }} */
759
- bundleCurrent.properties.entries
760
- );
761
- currentEntries.items.properties.height = { const: "auto" };
762
- var bundleProps = (
763
- /** @type {MutableSchema} */
764
- structuredClone(bundleCurrent)
765
- );
766
- bundleProps.$id = "https://openplanr.dev/schemas/v1.22.0/design-review-bundle.schema.json";
767
- bundleProps["x-openplanr-contract"] = { id: "design-review-bundle", version: "1.22.0" };
768
- var propsDesign = (
769
- /** @type {MutableSchema} */
770
- bundleProps.properties.design
771
- );
772
- var authoredProperties = (
773
- /** @type {Record<string, unknown>} */
774
- DESIGN_DOCUMENT_SCHEMA.properties
775
- );
776
- propsDesign.properties.schemaVersion = authoredProperties.schemaVersion;
777
- for (const key of ["screens", "variants"]) {
778
- const projected = (
779
- /** @type {{ items: { properties: Record<string, unknown> } }} */
780
- propsDesign.properties[key]
781
- );
782
- const authored = (
783
- /** @type {{ items: { properties: Record<string, unknown> } }} */
784
- authoredProperties[key]
785
- );
786
- projected.items.properties.props = authored.items.properties.props;
787
- }
788
- propsDesign.allOf = structuredClone(DESIGN_DOCUMENT_SCHEMA.allOf);
789
- var DESIGN_REVIEW_BUNDLE_CURRENT_SCHEMA = bundleProps;
790
- var item = closed(
791
- {
792
- pinId: id,
793
- reviewId: id,
794
- screenId: id,
795
- revisionId: id,
796
- text: text2,
797
- refinement: text2,
798
- stale: { type: "boolean" },
799
- author: text2,
800
- reviewOf: digest,
801
- source: text2
802
- },
803
- ["pinId", "text"]
804
- );
805
- var DESIGN_HANDOFF_CONTENT_SCHEMA = closed({
806
- summary: text2,
807
- agreedChanges: list(item, 1e4),
808
- openQuestions: list(item, 1e4),
809
- deferred: list(item, 1e4),
810
- rejected: list(item, 1e4)
811
- });
812
- var DESIGN_HANDOFF_SCHEMA = schema(
813
- "design-review-handoff",
814
- {
815
- kind: { const: "openplanr-design-review-handoff" },
816
- schemaVersion: { const: "1.0.0" },
817
- title: text2,
818
- version: { type: "integer", minimum: 1 },
819
- status: { enum: ["draft", "approved"] },
820
- basis: closed({
821
- designId: id,
822
- sourceRevision: digest,
823
- contextDigest: digest,
824
- reviewOf: digest,
825
- selectedVariant: id,
826
- feedbackDigest: digest,
827
- verificationDigest: digest,
828
- feedbackWatermark: { type: "integer", minimum: 0 }
829
- }),
830
- content: DESIGN_HANDOFF_CONTENT_SCHEMA,
831
- contentHash: digest,
832
- markdown: { type: "string", maxLength: 2097152 },
833
- affectedScreens: list(id),
834
- verificationGaps: texts,
835
- reviewNotes: list(closed({ reviewId: id, text: text2 }), 1e4),
836
- approval: closed({ contentHash: digest, at: { type: "string", format: "date-time" } })
837
- },
838
- [
839
- "kind",
840
- "schemaVersion",
841
- "title",
842
- "version",
843
- "status",
844
- "basis",
845
- "content",
846
- "contentHash",
847
- "markdown",
848
- "affectedScreens",
849
- "verificationGaps",
850
- "reviewNotes"
851
- ]
852
- );
853
- var DESIGN_REVIEW_METADATA_PAYLOAD_SCHEMA = {
854
- ...schema(
855
- "design-review-metadata-payload",
856
- {
857
- schemaVersion: { const: "1.0.0" },
858
- kind: { enum: ["category", "disposition"] },
859
- author: { ...text2, minLength: 1, maxLength: 160 },
860
- reviewOf: digest,
861
- pinId: id,
862
- category: { enum: ["question", "suggestion", "blocker"] },
863
- disposition: { enum: ["accepted", "deferred", "rejected"] },
864
- reason: text2,
865
- updatedAt: { type: "string", format: "date-time" }
866
- },
867
- ["schemaVersion", "kind", "author", "reviewOf", "pinId", "updatedAt"]
868
- ),
869
- allOf: [
870
- {
871
- if: { properties: { kind: { const: "category" } } },
872
- then: { required: ["category"], not: { required: ["disposition"] } }
873
- },
874
- {
875
- if: { properties: { kind: { const: "disposition" } } },
876
- then: { required: ["disposition", "reason"], not: { required: ["category"] } }
877
- }
878
- ]
879
- };
880
- var payloadV11 = {
881
- .../** @type {MutableSchema} */
882
- structuredClone(DESIGN_REVIEW_METADATA_PAYLOAD_SCHEMA),
883
- $id: "https://openplanr.dev/schemas/v1.11.0/design-review-metadata-payload.schema.json",
884
- "x-openplanr-contract": { id: "design-review-metadata-payload", version: "1.11.0" }
885
- };
886
- Object.assign(payloadV11.properties, {
887
- schemaVersion: { const: "1.1.0" },
888
- category: { enum: ["question", "suggestion", "change-request", "blocker"] }
889
- });
890
- var DESIGN_REVIEW_METADATA_PAYLOAD_V11_SCHEMA = payloadV11;
891
- function assertReviewExperience(value, contract) {
892
- const errors = validateJson(value, contract);
893
- if (errors.length)
894
- throw new TypeError(
895
- `Invalid ${contract["x-openplanr-contract"]?.id ?? "review data"}: ${errors.slice(0, 4).map((item2) => `${item2.path} ${item2.detail}`).join("; ")}`
896
- );
897
- return value;
898
- }
899
- function assertDesignReviewMetadata(value) {
900
- return assertReviewExperience(
901
- value,
902
- value?.schemaVersion === "1.1.0" ? DESIGN_REVIEW_METADATA_PAYLOAD_V11_SCHEMA : DESIGN_REVIEW_METADATA_PAYLOAD_SCHEMA
903
- );
904
- }
905
- function assertDesignReviewBundle(value) {
906
- if (value?.design?.schemaVersion !== "1.1.0" && ["screens", "variants"].some(
907
- (field) => Array.isArray(value?.design?.[field]) && value.design[field].some((item2) => item2 && Object.hasOwn(item2, "props"))
908
- ))
909
- throw new TypeError('Invalid design props: props require design.schemaVersion "1.1.0"');
910
- assertReviewExperience(
911
- value,
912
- value?.design?.schemaVersion !== void 0 || ["screens", "variants"].some(
913
- (field) => Array.isArray(value?.design?.[field]) && value.design[field].some((item2) => item2 && Object.hasOwn(item2, "props"))
914
- ) || value?.design?.layout !== void 0 || Array.isArray(value?.design?.frames) && value.design.frames.some(({ height }) => height === "auto") ? DESIGN_REVIEW_BUNDLE_CURRENT_SCHEMA : value?.schemaVersion === "1.2.0" ? DESIGN_REVIEW_BUNDLE_V12_SCHEMA : value?.schemaVersion === "1.1.0" ? DESIGN_REVIEW_BUNDLE_V11_SCHEMA : DESIGN_REVIEW_BUNDLE_SCHEMA
915
- );
916
- const propErrors = validateDesignProps(value.design);
917
- if (propErrors.length) throw new TypeError(`Invalid design props:
918
- ${propErrors.join("\n")}`);
919
- if (["1.1.0", "1.2.0"].includes(value.schemaVersion)) {
920
- if (value.reviewContext.designId !== value.design.id || value.contextDigest !== sha256Hex(canonicalizeJson(value.reviewContext)))
921
- throw new TypeError("Review context identity or digest does not match its published design.");
922
- const entries = new Set(
923
- value.entries.map((entry) => `${entry.screenId}:${entry.variantId}:${entry.frameId}`)
924
- );
925
- const seen = /* @__PURE__ */ new Set();
926
- for (const item2 of value.fingerprints) {
927
- const key = `${item2.screenId}:${item2.variantId}:${item2.frameId}`;
928
- if (!entries.has(key) || seen.has(key))
929
- throw new TypeError("Review fingerprints must identify distinct published artboards.");
930
- seen.add(key);
931
- }
932
- if (seen.size && seen.size !== entries.size)
933
- throw new TypeError("Review fingerprints must cover every published artboard.");
934
- }
935
- return value;
936
- }
937
- var REVIEW_EXPERIENCE_SCHEMAS = Object.freeze({
938
- "design-review-context": DESIGN_REVIEW_CONTEXT_SCHEMA,
939
- "design-review-bundle": DESIGN_REVIEW_BUNDLE_V11_SCHEMA,
940
- "design-review-handoff": DESIGN_HANDOFF_SCHEMA,
941
- "design-review-metadata-payload": DESIGN_REVIEW_METADATA_PAYLOAD_SCHEMA
942
- });
943
-
944
- // packages/design/lib/design/context.mjs
945
- import { createHash as createHash3 } from "node:crypto";
946
- import { existsSync, readdirSync, readFileSync as readFileSync3, realpathSync as realpathSync3 } from "node:fs";
947
- import { dirname as dirname3, join as join2, resolve as resolve3 } from "node:path";
948
- var reviewDigest = (value) => createHash3("sha256").update(canonicalizeJson(value)).digest("hex");
949
- function emptyReviewContext(document) {
950
- return {
951
- kind: "openplanr-design-review-context",
952
- schemaVersion: "1.0.0",
953
- designId: document.id,
954
- brief: { purpose: "", requests: [] },
955
- implementation: { tokens: [], components: [], responsive: [], accessibility: [] }
956
- };
957
- }
958
- function loadReviewContext(root, document, { readSource } = {}) {
959
- const file = join2(root, "review-context.json");
960
- if (!existsSync(file)) return emptyReviewContext(document);
961
- const context = JSON.parse(
962
- readSource ? readSource("review-context.json", root).value.toString("utf8") : readFileSync3(resolveLocalDocumentFile(root, "review-context.json"), "utf8")
963
- );
964
- assertReviewExperience(context, DESIGN_REVIEW_CONTEXT_SCHEMA);
965
- if (context.designId !== document.id)
966
- throw new Error("Review context belongs to a different design.");
967
- const screens = new Set(document.screenOrder);
968
- const ids = /* @__PURE__ */ new Set();
969
- for (const component of context.implementation.components) {
970
- if (ids.has(component.id)) throw new Error("Review component identities must be unique.");
971
- ids.add(component.id);
972
- if (component.screenIds?.some((id2) => !screens.has(id2)))
973
- throw new Error(`Component ${component.id} references an unknown screen.`);
974
- }
975
- if (/(?:file:\/\/|\/(?:Users|home|private|tmp|var|etc|opt|Volumes)\/|[A-Za-z]:\\\\|\\\\\\\\)/u.test(
976
- JSON.stringify(context)
977
- ))
978
- throw new Error(
979
- "Review context contains a local filesystem path. Use share-safe implementation guidance."
980
- );
981
- return context;
982
- }
983
- function reviewFingerprints({ document, context, screen, variant, frame, sourceDigests }) {
984
- const components = context.implementation.components.filter(
985
- (component) => !component.screenIds?.length || component.screenIds.includes(screen.id)
986
- );
987
- const values = Object.hasOwn(variant.props ?? {}, screen.id) ? variant.props[screen.id] : {};
988
- return {
989
- screenId: screen.id,
990
- variantId: variant.id,
991
- frameId: frame.id,
992
- contentDigest: reviewDigest({
993
- files: Object.entries(sourceDigests).sort(([a], [b]) => a < b ? -1 : a > b ? 1 : 0),
994
- width: frame.width,
995
- height: frame.height,
996
- ...screen.props === void 0 ? {} : {
997
- props: Object.fromEntries(
998
- Object.entries(screen.props).map(([name, declaration]) => [
999
- name,
1000
- Object.hasOwn(values, name) ? values[name] : declaration.default
1001
- ])
1002
- )
1003
- }
1004
- }),
1005
- guidanceDigest: reviewDigest({
1006
- title: screen.title,
1007
- description: screen.description ?? "",
1008
- anchors: screen.anchors ?? [],
1009
- variant: { label: variant.label, description: variant.description ?? "" },
1010
- frameLabel: frame.label,
1011
- components,
1012
- tokens: context.implementation.tokens,
1013
- responsive: context.implementation.responsive,
1014
- accessibility: context.implementation.accessibility
1015
- })
1016
- };
1017
- }
1018
- function bundleDesignRevision(current, state = {}) {
1019
- const { document } = current;
1020
- const pick = (value, keys) => Object.fromEntries(
1021
- keys.filter((key) => value?.[key] !== void 0).map((key) => [key, structuredClone(value[key])])
1022
- );
1023
- const context = current.reviewContext ?? emptyReviewContext(document);
1024
- return {
1025
- kind: "openplanr-design-review-bundle",
1026
- schemaVersion: current.envelope.schemaVersion === "1.1.0" ? "1.2.0" : "1.1.0",
1027
- design: {
1028
- ...document.screens.some((screen) => screen.props !== void 0) || document.variants.some((variant) => variant.props !== void 0) ? { schemaVersion: document.schemaVersion } : {},
1029
- ...pick(document, [
1030
- "id",
1031
- "title",
1032
- "defaultView",
1033
- "selectedVariant",
1034
- "screenOrder",
1035
- "frames",
1036
- "flows",
1037
- "layout"
1038
- ]),
1039
- screens: document.screens.map(
1040
- (screen) => pick(screen, ["id", "title", "description", "anchors", "props"])
1041
- ),
1042
- selectedVariant: document.variants.some(
1043
- (variant) => variant.id === state.selectedVariant && variant.status === "ready"
1044
- ) ? state.selectedVariant : document.selectedVariant,
1045
- variants: document.variants.filter((variant) => variant.status === "ready").map((variant) => pick(variant, ["id", "label", "status", "props"]))
1046
- },
1047
- envelope: structuredClone(current.envelope),
1048
- entries: structuredClone(current.entries),
1049
- state: {},
1050
- revision: current.revision,
1051
- verification: pick(current.verification ?? {}, ["status"]),
1052
- reviewContext: context,
1053
- contextDigest: current.contextDigest ?? reviewDigest(context),
1054
- fingerprints: current.fingerprints ?? []
1055
- };
1056
- }
1057
- var localRoot = (file) => realpathSync3(dirname3(resolve3(file)));
1058
- function listDesignRevisions(file) {
1059
- const root = localRoot(file);
1060
- const pointer = JSON.parse(readFileSync3(join2(root, ".design/current.json"), "utf8"));
1061
- const revisions = readdirSync(join2(root, ".design/revisions")).filter((name) => /^[a-f0-9]{64}$/u.test(name)).map((revision) => {
1062
- const value = JSON.parse(
1063
- readFileSync3(join2(root, ".design/revisions", revision, "render.json"), "utf8")
1064
- );
1065
- return {
1066
- revision,
1067
- createdAt: value.manifest.generated_at,
1068
- summary: value.reviewContext?.revisionSummary ?? "",
1069
- fingerprints: value.fingerprints ?? []
1070
- };
1071
- }).sort((a, b) => b.createdAt.localeCompare(a.createdAt));
1072
- return { revisions, currentRevision: pointer.revision };
1073
- }
1074
- function readDesignRevision(file, revision) {
1075
- if (!/^[a-f0-9]{64}$/u.test(revision)) throw new Error("Invalid design revision identity.");
1076
- const root = localRoot(file);
1077
- const value = JSON.parse(
1078
- readFileSync3(
1079
- resolveLocalDocumentFile(root, `.design/revisions/${revision}/render.json`),
1080
- "utf8"
1081
- )
1082
- );
1083
- return bundleDesignRevision(value);
1084
- }
1085
-
1086
- export {
1087
- serialize,
1088
- parse,
1089
- parseFragment,
1090
- inspectLocalDocumentBody,
1091
- resolveLocalDocumentFile,
1092
- bundleLocalDocument,
1093
- DESIGN_HANDOFF_CONTENT_SCHEMA,
1094
- DESIGN_HANDOFF_SCHEMA,
1095
- assertReviewExperience,
1096
- assertDesignReviewMetadata,
1097
- assertDesignReviewBundle,
1098
- reviewDigest,
1099
- emptyReviewContext,
1100
- loadReviewContext,
1101
- reviewFingerprints,
1102
- bundleDesignRevision,
1103
- listDesignRevisions,
1104
- readDesignRevision,
1105
- hash,
1106
- json,
1107
- readJson,
1108
- atomicJson,
1109
- atomicBytes,
1110
- recoverDesignPublication,
1111
- designSpecPath,
1112
- currentDesign
1113
- };