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,809 +0,0 @@
1
-
2
-
3
- // lib/artifact/ui/stage.mjs
4
- var stage_exports = {};
5
- __export(stage_exports, {
6
- ARTIFACT_STAGE_EVENTS: () => ARTIFACT_STAGE_EVENTS,
7
- ARTIFACT_STAGE_LIMITS: () => ARTIFACT_STAGE_LIMITS,
8
- bootstrapArtifactStage: () => bootstrapArtifactStage,
9
- clientPointToNormalized: () => clientPointToNormalized,
10
- createArtifactStagePayload: () => createArtifactStagePayload,
11
- createArtifactStageState: () => createArtifactStageState,
12
- mountArtifactStage: () => mountArtifactStage,
13
- normalizedPointToClient: () => normalizedPointToClient,
14
- reduceArtifactStageState: () => reduceArtifactStageState,
15
- resolveArtifactPresentation: () => resolveArtifactPresentation,
16
- visibleArtifactIds: () => visibleArtifactIds
17
- });
18
-
19
- // lib/artifact/ui/presentation.mjs
20
- function resolveArtifactPresentation(value, {
21
- mode,
22
- viewMode = mode ?? "single",
23
- artifactCount = 1
24
- } = {}) {
25
- if (value === "document" || value === "canvas") return value;
26
- return artifactCount > 1 || viewMode === "variants" || viewMode === "split" ? "canvas" : "document";
27
- }
28
-
29
- // lib/artifact/ui/annotations.mjs
30
- var ARTIFACT_ANNOTATION_EVENTS = Object.freeze({
31
- draft: "planr:artifact-annotation-draft",
32
- focus: "planr:artifact-annotation-focus"
33
- });
34
- var ARTIFACT_ANNOTATION_LIMITS = Object.freeze({
35
- dragThreshold: 4,
36
- maxCommentLength: 65536,
37
- maxIdentityLength: 256
38
- });
39
- var INTENTS = Object.freeze(["fix", "improve", "question"]);
40
- function finite(value, fallback = 0) {
41
- return typeof value === "number" && Number.isFinite(value) ? value : fallback;
42
- }
43
- function clamp(value, min = 0, max = 1) {
44
- return Math.min(max, Math.max(min, finite(value)));
45
- }
46
- function normalized(value) {
47
- return Math.round(clamp(value) * 1e6) / 1e6;
48
- }
49
- function assertRect(rect2) {
50
- if (!rect2 || !Number.isFinite(rect2.left) || !Number.isFinite(rect2.top) || !Number.isFinite(rect2.width) || !Number.isFinite(rect2.height) || rect2.width <= 0 || rect2.height <= 0) {
51
- throw new RangeError("Artifact bounds must have positive finite dimensions.");
52
- }
53
- }
54
- function clientSelectionToNormalized(rect2, start, end = start, { dragThreshold = ARTIFACT_ANNOTATION_LIMITS.dragThreshold } = {}) {
55
- assertRect(rect2);
56
- const startX = clamp(
57
- finite(start?.x ?? start?.clientX, rect2.left),
58
- rect2.left,
59
- rect2.left + rect2.width
60
- );
61
- const startY = clamp(
62
- finite(start?.y ?? start?.clientY, rect2.top),
63
- rect2.top,
64
- rect2.top + rect2.height
65
- );
66
- const endX = clamp(finite(end?.x ?? end?.clientX, startX), rect2.left, rect2.left + rect2.width);
67
- const endY = clamp(finite(end?.y ?? end?.clientY, startY), rect2.top, rect2.top + rect2.height);
68
- const dragged = Math.hypot(endX - startX, endY - startY) >= Math.max(0, finite(dragThreshold, 4));
69
- const left = dragged ? Math.min(startX, endX) : startX;
70
- const top = dragged ? Math.min(startY, endY) : startY;
71
- const right = dragged ? Math.max(startX, endX) : startX;
72
- const bottom = dragged ? Math.max(startY, endY) : startY;
73
- return Object.freeze({
74
- x: normalized((left - rect2.left) / rect2.width),
75
- y: normalized((top - rect2.top) / rect2.height),
76
- w: normalized((right - left) / rect2.width),
77
- h: normalized((bottom - top) / rect2.height)
78
- });
79
- }
80
- function artifactAnchorPoint(region, viewport) {
81
- const width = Number.isInteger(viewport?.width) && viewport.width > 0 ? viewport.width : 1;
82
- const height = Number.isInteger(viewport?.height) && viewport.height > 0 ? viewport.height : 1;
83
- return Object.freeze({
84
- x: Math.round(clamp(region?.x + finite(region?.w) / 2) * width),
85
- y: Math.round(clamp(region?.y + finite(region?.h) / 2) * height)
86
- });
87
- }
88
- function annotationStyle(region) {
89
- const percent = (value) => `${Math.round(clamp(value) * 1e6) / 1e4}%`;
90
- return Object.freeze({
91
- left: percent(region?.x),
92
- top: percent(region?.y),
93
- width: percent(region?.w),
94
- height: percent(region?.h)
95
- });
96
- }
97
- function viewportRegionToAnchorRegion(region, viewport, anchorRect) {
98
- const width = Number.isInteger(viewport?.width) && viewport.width > 0 ? viewport.width : 1;
99
- const height = Number.isInteger(viewport?.height) && viewport.height > 0 ? viewport.height : 1;
100
- const anchorWidth = Math.max(1, finite(anchorRect?.width, 1));
101
- const anchorHeight = Math.max(1, finite(anchorRect?.height, 1));
102
- const left = clamp(region?.x) * width;
103
- const top = clamp(region?.y) * height;
104
- const right = left + clamp(region?.w) * width;
105
- const bottom = top + clamp(region?.h) * height;
106
- const x = clamp((left - finite(anchorRect?.x)) / anchorWidth);
107
- const y = clamp((top - finite(anchorRect?.y)) / anchorHeight);
108
- return Object.freeze({
109
- x: normalized(x),
110
- y: normalized(y),
111
- w: normalized(Math.max(0, Math.min(1 - x, (right - left) / anchorWidth))),
112
- h: normalized(Math.max(0, Math.min(1 - y, (bottom - top) / anchorHeight)))
113
- });
114
- }
115
- function anchorRegionToViewportRegion(region, viewport, anchorRect) {
116
- const width = Number.isInteger(viewport?.width) && viewport.width > 0 ? viewport.width : 1;
117
- const height = Number.isInteger(viewport?.height) && viewport.height > 0 ? viewport.height : 1;
118
- const anchorWidth = Math.max(0, finite(anchorRect?.width));
119
- const anchorHeight = Math.max(0, finite(anchorRect?.height));
120
- return Object.freeze({
121
- x: normalized((finite(anchorRect?.x) + clamp(region?.x) * anchorWidth) / width),
122
- y: normalized((finite(anchorRect?.y) + clamp(region?.y) * anchorHeight) / height),
123
- w: normalized(clamp(region?.w) * anchorWidth / width),
124
- h: normalized(clamp(region?.h) * anchorHeight / height)
125
- });
126
- }
127
- function domToken(value) {
128
- const source = String(value);
129
- let token3 = "";
130
- for (let index2 = 0; index2 < source.length; index2 += 1) {
131
- token3 += source.charCodeAt(index2).toString(16).padStart(4, "0");
132
- }
133
- return token3;
134
- }
135
- function annotationDomIds(pinId) {
136
- const suffix = domToken(pinId);
137
- return Object.freeze({
138
- pin: `planr-pin-${suffix}`,
139
- thread: `planr-thread-${suffix}`
140
- });
141
- }
142
- function text(value, max = ARTIFACT_ANNOTATION_LIMITS.maxCommentLength) {
143
- return typeof value === "string" ? value.trim().slice(0, max) : "";
144
- }
145
- function make(document2, tag, { className, textContent, attributes = {} } = {}) {
146
- const node2 = document2.createElement(tag);
147
- if (className) node2.className = className;
148
- if (textContent !== void 0) node2.textContent = textContent;
149
- for (const [name, value] of Object.entries(attributes)) {
150
- if (value !== void 0 && value !== null) node2.setAttribute(name, String(value));
151
- }
152
- return node2;
153
- }
154
- function setRegionStyle(node2, region) {
155
- const style = annotationStyle(region);
156
- if (node2.style.left !== style.left) node2.style.left = style.left;
157
- if (node2.style.top !== style.top) node2.style.top = style.top;
158
- if (region.w > 0 || region.h > 0) {
159
- if (node2.style.width !== style.width) node2.style.width = style.width;
160
- if (node2.style.height !== style.height) node2.style.height = style.height;
161
- }
162
- }
163
- function announce(document2, value) {
164
- const node2 = document2.querySelector('[data-planr-slot="review-announcer"]');
165
- if (node2) node2.textContent = value;
166
- }
167
- function identityName(reviewController) {
168
- return text(
169
- reviewController?.getIdentity?.()?.name,
170
- ARTIFACT_ANNOTATION_LIMITS.maxIdentityLength
171
- );
172
- }
173
- function createIntentPicker(document2) {
174
- const group = make(document2, "div", {
175
- className: "planr-intent-picker",
176
- attributes: { role: "radiogroup", "aria-label": "Feedback intent" }
177
- });
178
- for (const [index2, intent] of INTENTS.entries()) {
179
- const button = make(document2, "button", {
180
- textContent: intent[0].toUpperCase() + intent.slice(1),
181
- attributes: {
182
- type: "button",
183
- role: "radio",
184
- "aria-checked": String(index2 === 0),
185
- tabindex: index2 === 0 ? 0 : -1,
186
- "data-planr-intent": intent
187
- }
188
- });
189
- group.append(button);
190
- }
191
- return group;
192
- }
193
- function mountArtifactAnnotations({
194
- document: document2 = globalThis.document,
195
- window = document2?.defaultView,
196
- root = document2?.querySelector?.(".planr-shell"),
197
- stageController,
198
- reviewController,
199
- onFocusPin
200
- } = {}) {
201
- if (!document2 || !window || !root || !stageController || !reviewController) return null;
202
- const cleanup = [];
203
- let draft = null;
204
- let suspendedDraft = null;
205
- let draftToken = 0;
206
- let draftFieldCleanup = null;
207
- let composerLayoutCleanup = null;
208
- let composerReturnFocus = null;
209
- const pinRecords = /* @__PURE__ */ new Map();
210
- const anchorRequests = /* @__PURE__ */ new Map();
211
- let destroyed = false;
212
- function listen(target, type, handler, options) {
213
- target.addEventListener(type, handler, options);
214
- cleanup.push(() => target.removeEventListener(type, handler, options));
215
- }
216
- function review() {
217
- return reviewController.getReview?.() ?? reviewController.getState?.()?.review ?? reviewController.getState?.();
218
- }
219
- function layerFor(artifactId) {
220
- return [...document2.querySelectorAll("[data-planr-annotation-layer]")].find(
221
- (node2) => node2.dataset.planrAnnotationLayer === artifactId
222
- ) ?? null;
223
- }
224
- function frameFor(artifactId) {
225
- return [...document2.querySelectorAll("[data-planr-artifact-frame]")].find(
226
- (node2) => node2.dataset.planrArtifactFrame === artifactId
227
- ) ?? null;
228
- }
229
- function focusThread(pinId) {
230
- const pin = review()?.pins?.find((item2) => item2.id === pinId);
231
- if (!pin) return;
232
- reviewController.selectPin?.(pinId);
233
- const state = stageController.getState();
234
- if (state.activeArtifactId !== pin.artifactId) {
235
- stageController.dispatch({ type: "set-active", artifactId: pin.artifactId });
236
- }
237
- stageController.dispatch({ type: "set-rail-open", railOpen: true });
238
- queueMicrotask(() => document2.getElementById(annotationDomIds(pinId).thread)?.focus());
239
- }
240
- function focusPin(pinId) {
241
- const pin = review()?.pins?.find((item2) => item2.id === pinId);
242
- if (!pin) return;
243
- reviewController.selectPin?.(pinId);
244
- const state = stageController.getState();
245
- if (state.activeArtifactId !== pin.artifactId) {
246
- stageController.dispatch({ type: "set-active", artifactId: pin.artifactId });
247
- }
248
- queueMicrotask(() => {
249
- const marker = document2.getElementById(annotationDomIds(pinId).pin);
250
- if (marker?.hidden) {
251
- announce(
252
- document2,
253
- "This pin’s element is not currently visible. The original comment remains in Review."
254
- );
255
- return;
256
- }
257
- if (onFocusPin) onFocusPin(pin);
258
- else marker?.scrollIntoView?.({ block: "center", inline: "center", behavior: "smooth" });
259
- marker?.focus?.({ preventScroll: true });
260
- marker?.classList.add("planr-pin-highlight");
261
- window.setTimeout(() => marker?.classList.remove("planr-pin-highlight"), 1200);
262
- });
263
- }
264
- function pinGeometryKey(pin) {
265
- return JSON.stringify([
266
- reviewController.getReviewOf?.() ?? review()?.reviewOf,
267
- pin.artifactId,
268
- pin.anchor,
269
- pin.region,
270
- pin.viewport
271
- ]);
272
- }
273
- function setPinPosition(record2, region) {
274
- const point3 = { x: region.x + region.w / 2, y: region.y + region.h / 2, w: 0, h: 0 };
275
- setRegionStyle(record2.button, point3);
276
- if (record2.region) setRegionStyle(record2.region, region);
277
- if (record2.button.hidden) record2.button.hidden = false;
278
- if (record2.region?.hidden) record2.region.hidden = false;
279
- }
280
- function hidePin(record2) {
281
- if (!record2.button.hidden) record2.button.hidden = true;
282
- if (record2.region && !record2.region.hidden) record2.region.hidden = true;
283
- }
284
- function removePin(record2) {
285
- record2.pending = null;
286
- record2.button.remove();
287
- record2.region?.remove();
288
- }
289
- function refreshAnchors() {
290
- if (destroyed) return;
291
- const now = window.performance.now();
292
- const frames = new Map(
293
- [...document2.querySelectorAll("[data-planr-artifact-frame]")].map((frame) => [
294
- frame.dataset.planrArtifactFrame,
295
- frame
296
- ])
297
- );
298
- const records = [...pinRecords.values()].flatMap((records2) => [...records2.values()]).filter((record2) => record2.pin.anchor?.planrId).sort((a, b) => a.requestedAt - b.requestedAt);
299
- for (const record2 of records) {
300
- if (record2.pending || now - record2.requestedAt < 200 || !record2.button.isConnected) continue;
301
- const frame = frames.get(record2.pin.artifactId);
302
- const bridge = frame?.__openPlanrBridge;
303
- if (!bridge?.resolve || frame.closest("[hidden]") || frame.dataset.planrBridgeTrusted === "false" || (anchorRequests.get(frame) ?? 0) >= 8)
304
- continue;
305
- const request = {}, key = record2.geometryKey, pin = record2.pin;
306
- record2.pending = request;
307
- record2.requestedAt = now;
308
- anchorRequests.set(frame, (anchorRequests.get(frame) ?? 0) + 1);
309
- Promise.resolve().then(() => bridge.resolve(pin.anchor.planrId, pin.anchor.screen)).then((anchor2) => {
310
- if (destroyed || record2.pending !== request || record2.geometryKey !== key || !record2.button.isConnected || frame.__openPlanrBridge !== bridge)
311
- return;
312
- if (!anchor2 || anchor2.rect.width <= 0 || anchor2.rect.height <= 0) {
313
- hidePin(record2);
314
- if (record2.button.dataset.planrAnchorStatus !== "unavailable")
315
- record2.button.dataset.planrAnchorStatus = "unavailable";
316
- return;
317
- }
318
- const projected = anchorRegionToViewportRegion(
319
- pin.region,
320
- anchor2.viewport ?? pin.viewport,
321
- anchor2.rect
322
- );
323
- setPinPosition(record2, projected);
324
- if (record2.button.dataset.planrAnchorStatus !== "resolved")
325
- record2.button.dataset.planrAnchorStatus = "resolved";
326
- }).catch(() => {
327
- }).finally(() => {
328
- const remaining = (anchorRequests.get(frame) ?? 1) - 1;
329
- if (remaining > 0) anchorRequests.set(frame, remaining);
330
- else anchorRequests.delete(frame);
331
- if (record2.pending === request) record2.pending = null;
332
- });
333
- }
334
- }
335
- function renderPins() {
336
- if (destroyed) return;
337
- const pins = Array.isArray(review()?.pins) ? review().pins : [];
338
- const layers = new Set(document2.querySelectorAll("[data-planr-annotation-layer]"));
339
- for (const [layer, records] of pinRecords) {
340
- if (layers.has(layer)) continue;
341
- for (const record2 of records.values()) removePin(record2);
342
- pinRecords.delete(layer);
343
- }
344
- for (const layer of layers) {
345
- let records = pinRecords.get(layer);
346
- if (!records) {
347
- records = /* @__PURE__ */ new Map();
348
- pinRecords.set(layer, records);
349
- }
350
- const current = /* @__PURE__ */ new Set();
351
- for (const [index2, pin] of pins.entries()) {
352
- if (pin.artifactId !== layer.dataset.planrAnnotationLayer) continue;
353
- current.add(pin.id);
354
- const ids2 = annotationDomIds(pin.id), ordinal = index2 + 1;
355
- const hasRegion = pin.region.w > 0 || pin.region.h > 0;
356
- let record2 = records.get(pin.id);
357
- if (!record2) {
358
- const button = make(document2, "button", {
359
- attributes: {
360
- type: "button",
361
- id: ids2.pin,
362
- "data-planr-pin-id": pin.id,
363
- "aria-controls": ids2.thread
364
- }
365
- });
366
- button.addEventListener("click", () => focusThread(pin.id));
367
- layer.append(button);
368
- record2 = {
369
- button,
370
- region: null,
371
- pin,
372
- geometryKey: null,
373
- pending: null,
374
- requestedAt: -Infinity
375
- };
376
- records.set(pin.id, record2);
377
- }
378
- record2.pin = pin;
379
- if (hasRegion && !record2.region) {
380
- record2.region = make(document2, "span", {
381
- attributes: { "data-planr-pin-region-id": pin.id, "aria-hidden": "true" }
382
- });
383
- layer.insertBefore(record2.region, record2.button);
384
- } else if (!hasRegion && record2.region) {
385
- record2.region.remove();
386
- record2.region = null;
387
- }
388
- const buttonClass = `planr-pin planr-pin-${pin.intent} planr-pin-${pin.status}${hasRegion ? " planr-pin-region-handle" : ""}${record2.button.classList.contains("planr-pin-highlight") ? " planr-pin-highlight" : ""}`;
389
- if (record2.button.className !== buttonClass) record2.button.className = buttonClass;
390
- if (record2.button.textContent !== String(ordinal))
391
- record2.button.textContent = String(ordinal);
392
- for (const [name, value] of Object.entries({
393
- "data-planr-intent": pin.intent,
394
- "data-planr-status": pin.status,
395
- "aria-label": `${pin.intent} comment ${ordinal}: ${pin.comment}`
396
- })) {
397
- if (record2.button.getAttribute(name) !== value) record2.button.setAttribute(name, value);
398
- }
399
- if (record2.region) {
400
- const regionClass = `planr-pin-region planr-pin-region-${pin.intent} planr-pin-region-${pin.status}`;
401
- if (record2.region.className !== regionClass) record2.region.className = regionClass;
402
- }
403
- const key = pinGeometryKey(pin);
404
- if (record2.geometryKey !== key) {
405
- record2.geometryKey = key;
406
- record2.pending = null;
407
- record2.requestedAt = -Infinity;
408
- if (pin.anchor?.planrId) hidePin(record2);
409
- else {
410
- delete record2.button.dataset.planrAnchorStatus;
411
- setPinPosition(record2, pin.region);
412
- }
413
- }
414
- }
415
- for (const [id7, record2] of records) {
416
- if (!current.has(id7)) {
417
- removePin(record2);
418
- records.delete(id7);
419
- }
420
- }
421
- }
422
- refreshAnchors();
423
- }
424
- function closeComposer({ restoreFocus = false, preserveDraft = false } = {}) {
425
- const snapshot2 = preserveDraft ? snapshotDraft() : null;
426
- draftFieldCleanup?.();
427
- draftFieldCleanup = null;
428
- composerLayoutCleanup?.();
429
- composerLayoutCleanup = null;
430
- const activeLayer = draft ? layerFor(draft.artifactId) : null;
431
- const composer = root.querySelector("[data-planr-annotation-composer]");
432
- try {
433
- if (composer?.matches(":popover-open")) composer.hidePopover();
434
- } catch {
435
- }
436
- composer?.remove();
437
- draft = null;
438
- suspendedDraft = snapshot2;
439
- draftToken += 1;
440
- if (activeLayer && stageController.getState().reviewMode !== "comment") {
441
- activeLayer.setAttribute("aria-disabled", "true");
442
- }
443
- if (restoreFocus) {
444
- const target = composerReturnFocus?.isConnected && composerReturnFocus !== document2.body ? composerReturnFocus : activeLayer;
445
- target?.focus?.({ preventScroll: true });
446
- }
447
- composerReturnFocus = null;
448
- }
449
- async function resolveAnchor(token3, candidate) {
450
- const frame = frameFor(candidate.artifactId);
451
- const point3 = artifactAnchorPoint(candidate.region, candidate.viewport);
452
- let result = null;
453
- try {
454
- const anchor2 = frame?.__openPlanrBridge?.hitTest?.(point3.x, point3.y);
455
- if (anchor2) {
456
- result = await Promise.race([
457
- anchor2,
458
- new Promise((resolve) => window.setTimeout(() => resolve(null), 800))
459
- ]);
460
- }
461
- } catch {
462
- result = null;
463
- }
464
- if (token3 !== draftToken || !draft || draft.artifactId !== candidate.artifactId) return;
465
- if (result?.planrId) {
466
- draft.anchor = Object.freeze({
467
- planrId: String(result.planrId).slice(0, 512),
468
- ...result.screen ? { screen: String(result.screen).slice(0, 128) } : {}
469
- });
470
- draft.region = viewportRegionToAnchorRegion(draft.region, draft.viewport, result.rect);
471
- }
472
- }
473
- function positionComposer() {
474
- const composer = root.querySelector("[data-planr-annotation-composer]");
475
- const layer = draft && layerFor(draft.artifactId);
476
- if (!composer || !layer) return;
477
- const visual = window.visualViewport;
478
- const viewport = {
479
- x: finite(visual?.offsetLeft),
480
- y: finite(visual?.offsetTop),
481
- width: finite(visual?.width, window.innerWidth),
482
- height: finite(visual?.height, window.innerHeight)
483
- };
484
- const margin = Math.min(12, viewport.width / 8, viewport.height / 8);
485
- const availableWidth = Math.max(1, viewport.width - margin * 2), availableHeight = Math.max(1, viewport.height - margin * 2);
486
- composer.style.width = `${Math.min(360, availableWidth)}px`;
487
- composer.style.maxHeight = `${Math.min(620, availableHeight)}px`;
488
- const bounds2 = layer.getBoundingClientRect();
489
- const point3 = {
490
- x: bounds2.left + clamp(draft.displayRegion.x + draft.displayRegion.w / 2) * bounds2.width,
491
- y: bounds2.top + clamp(draft.displayRegion.y + draft.displayRegion.h / 2) * bounds2.height
492
- };
493
- const size = composer.getBoundingClientRect();
494
- const width = Math.min(size.width || 360, availableWidth), height = Math.min(size.height || 360, availableHeight);
495
- const left = point3.x + 16 + width <= viewport.x + viewport.width - margin ? point3.x + 16 : point3.x - width - 16;
496
- composer.style.left = `${clamp(left, viewport.x + margin, viewport.x + viewport.width - width - margin)}px`;
497
- composer.style.top = `${clamp(point3.y + 16, viewport.y + margin, viewport.y + viewport.height - height - margin)}px`;
498
- }
499
- function openComposer(detail, { restoredDraft = null } = {}) {
500
- const opener = document2.activeElement;
501
- closeComposer();
502
- composerReturnFocus = opener;
503
- const layer = layerFor(detail.artifactId);
504
- if (!layer) return;
505
- draftToken += 1;
506
- const token3 = draftToken;
507
- draft = {
508
- artifactId: detail.artifactId,
509
- region: Object.freeze({ ...detail.region }),
510
- viewport: Object.freeze({ ...detail.viewport }),
511
- variant: typeof detail.variant === "string" && detail.variant.length > 0 ? detail.variant : detail.artifactId,
512
- anchor: restoredDraft?.anchor ?? null,
513
- displayRegion: Object.freeze({ ...restoredDraft?.displayRegion ?? detail.region })
514
- };
515
- const composer = make(document2, "form", {
516
- className: "planr-annotation-composer",
517
- attributes: {
518
- "data-planr-annotation-composer": "",
519
- role: "dialog",
520
- popover: "manual",
521
- "aria-label": "Add artifact comment"
522
- }
523
- });
524
- const header = make(document2, "header", { className: "planr-composer-header" });
525
- const heading = make(document2, "strong", { textContent: "New comment" });
526
- const close = make(document2, "button", {
527
- textContent: "×",
528
- attributes: {
529
- type: "button",
530
- "data-planr-composer-close": "",
531
- "aria-label": "Close new comment",
532
- title: "Close new comment (Escape)"
533
- }
534
- });
535
- header.append(heading, close);
536
- const identityLabel = make(document2, "label", { textContent: "Your name" });
537
- const identity = make(document2, "input", {
538
- attributes: {
539
- type: "text",
540
- maxlength: ARTIFACT_ANNOTATION_LIMITS.maxIdentityLength,
541
- autocomplete: "name",
542
- value: identityName(reviewController),
543
- "data-planr-composer-identity": "",
544
- "aria-describedby": "planr-composer-error"
545
- }
546
- });
547
- identityLabel.append(identity);
548
- const intentPicker = createIntentPicker(document2);
549
- const commentLabel = make(document2, "label", { textContent: "Comment" });
550
- const comment = make(document2, "textarea", {
551
- attributes: {
552
- maxlength: ARTIFACT_ANNOTATION_LIMITS.maxCommentLength,
553
- required: "",
554
- placeholder: "Describe what the coding agent should change or consider…",
555
- "data-planr-composer-comment": "",
556
- "aria-describedby": "planr-composer-error"
557
- }
558
- });
559
- commentLabel.append(comment);
560
- const error = make(document2, "p", {
561
- className: "planr-field-error",
562
- attributes: { id: "planr-composer-error", role: "alert", "data-planr-composer-error": "" }
563
- });
564
- const actions = make(document2, "div", { className: "planr-composer-actions" });
565
- actions.append(
566
- make(document2, "button", {
567
- textContent: "Cancel",
568
- attributes: { type: "button", "data-planr-composer-cancel": "" }
569
- }),
570
- make(document2, "button", {
571
- textContent: "Add comment",
572
- attributes: { type: "submit", "data-planr-composer-submit": "" }
573
- })
574
- );
575
- composer.append(header, identityLabel, intentPicker, commentLabel, error, actions);
576
- root.append(composer);
577
- try {
578
- if (typeof composer.showPopover === "function") composer.showPopover();
579
- else composer.removeAttribute("popover");
580
- } catch {
581
- composer.removeAttribute("popover");
582
- }
583
- positionComposer();
584
- const observer = typeof window.ResizeObserver === "function" ? new window.ResizeObserver(positionComposer) : null;
585
- observer?.observe(composer);
586
- composerLayoutCleanup = () => observer?.disconnect();
587
- let selectedIntent = "fix";
588
- listen(intentPicker, "click", (event) => {
589
- const button = event.target.closest?.("[data-planr-intent]");
590
- if (!button || !INTENTS.includes(button.dataset.planrIntent)) return;
591
- selectedIntent = button.dataset.planrIntent;
592
- for (const option of intentPicker.querySelectorAll("[data-planr-intent]")) {
593
- option.setAttribute("aria-checked", String(option === button));
594
- option.tabIndex = option === button ? 0 : -1;
595
- }
596
- });
597
- listen(intentPicker, "keydown", (event) => {
598
- if (!["ArrowLeft", "ArrowRight", "ArrowUp", "ArrowDown", "Home", "End"].includes(event.key))
599
- return;
600
- const options = [...intentPicker.querySelectorAll("[data-planr-intent]")];
601
- const current = options.findIndex((option) => option.getAttribute("aria-checked") === "true");
602
- const delta = ["ArrowRight", "ArrowDown"].includes(event.key) ? 1 : -1;
603
- const nextIndex = event.key === "Home" ? 0 : event.key === "End" ? options.length - 1 : (Math.max(0, current) + delta + options.length) % options.length;
604
- event.preventDefault();
605
- options[nextIndex].click();
606
- options[nextIndex].focus();
607
- });
608
- listen(close, "click", () => closeComposer({ restoreFocus: true }));
609
- listen(
610
- composer.querySelector("[data-planr-composer-cancel]"),
611
- "click",
612
- () => {
613
- closeComposer({ restoreFocus: true });
614
- },
615
- { once: true }
616
- );
617
- listen(composer, "keydown", (event) => {
618
- if (event.key === "Escape") {
619
- event.preventDefault();
620
- event.stopPropagation();
621
- closeComposer({ restoreFocus: true });
622
- } else if (event.key === "Enter" && !event.isComposing && (event.metaKey || event.ctrlKey)) {
623
- event.preventDefault();
624
- composer.requestSubmit();
625
- }
626
- });
627
- listen(composer, "submit", (event) => {
628
- event.preventDefault();
629
- if (!draft) return;
630
- const author = text(identity.value, ARTIFACT_ANNOTATION_LIMITS.maxIdentityLength);
631
- const body = text(comment.value);
632
- identity.setAttribute("aria-invalid", String(!author));
633
- comment.setAttribute("aria-invalid", String(!body));
634
- if (!author || !body) {
635
- error.textContent = !author ? "Enter your name before adding a comment." : "Enter a comment before submitting.";
636
- (!author ? identity : comment).focus();
637
- return;
638
- }
639
- reviewController.setIdentity?.({ name: author });
640
- const existingIds = new Set(review()?.pins?.map(({ id: id7 }) => id7) ?? []);
641
- const action = {
642
- type: "add-pin",
643
- pin: {
644
- artifactId: draft.artifactId,
645
- region: draft.region,
646
- viewport: draft.viewport,
647
- variant: draft.variant,
648
- ...draft.anchor ? { anchor: draft.anchor } : {},
649
- intent: selectedIntent,
650
- comment: body
651
- }
652
- };
653
- const next = reviewController.dispatch(action);
654
- const nextReview = next?.review ?? next;
655
- const created = nextReview?.pins?.find?.(({ id: id7 }) => !existingIds.has(id7));
656
- closeComposer();
657
- renderPins();
658
- announce(document2, `${selectedIntent} comment added.`);
659
- if (created?.id) queueMicrotask(() => focusThread(created.id));
660
- });
661
- comment.focus();
662
- root.dispatchEvent(
663
- new window.CustomEvent(ARTIFACT_ANNOTATION_EVENTS.draft, {
664
- bubbles: true,
665
- detail: Object.freeze({ ...draft })
666
- })
667
- );
668
- if (restoredDraft) {
669
- identity.value = restoredDraft.identity;
670
- comment.value = restoredDraft.comment;
671
- selectedIntent = restoredDraft.intent;
672
- for (const option of intentPicker.querySelectorAll("[data-planr-intent]")) {
673
- const selected = option.dataset.planrIntent === selectedIntent;
674
- option.setAttribute("aria-checked", String(selected));
675
- option.tabIndex = selected ? 0 : -1;
676
- }
677
- if (Number.isInteger(restoredDraft.selectionStart))
678
- comment.setSelectionRange(
679
- restoredDraft.selectionStart,
680
- restoredDraft.selectionEnd,
681
- restoredDraft.selectionDirection
682
- );
683
- const fields = new Map(
684
- Object.entries(restoredDraft.fields ?? {}).slice(0, 32).filter(
685
- ([key, value]) => key.length <= 128 && typeof value === "string" && value.length <= ARTIFACT_ANNOTATION_LIMITS.maxCommentLength
686
- )
687
- );
688
- if (fields.size) {
689
- let restoreFields = function() {
690
- if (token3 !== draftToken || !composer.isConnected) {
691
- finish();
692
- return;
693
- }
694
- for (const field of composer.querySelectorAll("[data-planr-draft-key]")) {
695
- const key = field.dataset.planrDraftKey;
696
- if (!fields.has(key) || typeof field.value !== "string") continue;
697
- field.value = fields.get(key);
698
- fields.delete(key);
699
- field.dispatchEvent(new window.Event("change", { bubbles: true }));
700
- }
701
- if (!fields.size) finish();
702
- };
703
- let timer;
704
- const observer2 = new window.MutationObserver(restoreFields);
705
- const finish = () => {
706
- observer2.disconnect();
707
- window.clearTimeout(timer);
708
- };
709
- observer2.observe(composer, { childList: true, subtree: true });
710
- timer = window.setTimeout(finish, 1500);
711
- draftFieldCleanup = finish;
712
- restoreFields();
713
- }
714
- } else void resolveAnchor(token3, draft);
715
- }
716
- function snapshotDraft() {
717
- const composer = document2.querySelector("[data-planr-annotation-composer]");
718
- if (!draft || !composer) return suspendedDraft;
719
- const comment = composer.querySelector("[data-planr-composer-comment]");
720
- return Object.freeze({
721
- ...draft,
722
- reviewOf: reviewController.getReviewOf?.() ?? review()?.reviewOf ?? null,
723
- identity: composer.querySelector("[data-planr-composer-identity]").value,
724
- fields: Object.fromEntries(
725
- [...composer.querySelectorAll("[data-planr-draft-key]")].slice(0, 32).filter(
726
- (field) => field.dataset.planrDraftKey.length <= 128 && typeof field.value === "string"
727
- ).map((field) => [
728
- field.dataset.planrDraftKey,
729
- field.value.slice(0, ARTIFACT_ANNOTATION_LIMITS.maxCommentLength)
730
- ])
731
- ),
732
- comment: comment.value,
733
- intent: composer.querySelector('[data-planr-intent][aria-checked="true"]')?.dataset.planrIntent ?? "fix",
734
- selectionStart: comment.selectionStart,
735
- selectionEnd: comment.selectionEnd,
736
- selectionDirection: comment.selectionDirection
737
- });
738
- }
739
- function restoreDraft(snapshot2) {
740
- if (!snapshot2 || snapshot2.reviewOf !== (reviewController.getReviewOf?.() ?? review()?.reviewOf ?? null))
741
- return false;
742
- const artifact = stageController.getState().artifacts.find((entry) => entry.id === snapshot2.artifactId);
743
- if (!artifact || artifact.viewport.width !== snapshot2.viewport?.width || artifact.viewport.height !== snapshot2.viewport?.height || !["x", "y", "w", "h"].every(
744
- (key) => Number.isFinite(snapshot2.region?.[key]) && snapshot2.region[key] >= 0 && snapshot2.region[key] <= 1
745
- ) || !["x", "y", "w", "h"].every(
746
- (key) => Number.isFinite(snapshot2.displayRegion?.[key]) && snapshot2.displayRegion[key] >= 0 && snapshot2.displayRegion[key] <= 1
747
- ) || typeof snapshot2.comment !== "string" || snapshot2.comment.length > ARTIFACT_ANNOTATION_LIMITS.maxCommentLength || typeof snapshot2.identity !== "string" || snapshot2.identity.length > ARTIFACT_ANNOTATION_LIMITS.maxIdentityLength || !INTENTS.includes(snapshot2.intent) || snapshot2.anchor && (typeof snapshot2.anchor.planrId !== "string" || snapshot2.anchor.planrId.length > 512))
748
- return false;
749
- openComposer(snapshot2, { restoredDraft: snapshot2 });
750
- return Boolean(draft);
751
- }
752
- listen(window, "resize", positionComposer);
753
- if (window.visualViewport) {
754
- listen(window.visualViewport, "resize", positionComposer);
755
- listen(window.visualViewport, "scroll", positionComposer);
756
- }
757
- listen(root, "planr:artifact-region", (event) => openComposer(event.detail));
758
- listen(root, "planr:stage-change", () => {
759
- const state = stageController.getState();
760
- const visible = state.viewMode === "split" ? [state.activeArtifactId, state.comparisonArtifactId] : [state.activeArtifactId];
761
- if (!draft) {
762
- if (suspendedDraft && state.status === "ready" && state.reviewMode === "comment" && visible.includes(suspendedDraft.artifactId))
763
- restoreDraft(suspendedDraft);
764
- return;
765
- }
766
- if (state.status !== "ready" || state.presentation !== "document" && state.reviewMode !== "comment") {
767
- closeComposer({ preserveDraft: true });
768
- return;
769
- }
770
- if (!visible.includes(draft.artifactId)) closeComposer({ preserveDraft: true });
771
- else {
772
- draftToken += 1;
773
- positionComposer();
774
- }
775
- });
776
- listen(root, "planr:artifact-review-change", renderPins);
777
- const anchorRefresh = window.setInterval(refreshAnchors, 250);
778
- cleanup.push(() => window.clearInterval(anchorRefresh));
779
- listen(root, ARTIFACT_ANNOTATION_EVENTS.focus, (event) => {
780
- if (event.detail?.target === "pin") focusPin(event.detail.pinId);
781
- if (event.detail?.target === "thread") focusThread(event.detail.pinId);
782
- });
783
- listen(root, "planr:artifact-review-select", (event) => {
784
- if (event.detail?.source === "thread" && typeof event.detail?.pinId === "string") {
785
- focusPin(event.detail.pinId);
786
- }
787
- });
788
- renderPins();
789
- const controller = Object.freeze({
790
- render: renderPins,
791
- openComposer,
792
- closeComposer,
793
- snapshotDraft,
794
- restoreDraft,
795
- focusPin,
796
- focusThread,
797
- destroy() {
798
- destroyed = true;
799
- closeComposer();
800
- for (const remove of cleanup.splice(0)) remove();
801
- for (const records of pinRecords.values())
802
- for (const record2 of records.values()) removePin(record2);
803
- pinRecords.clear();
804
- anchorRequests.clear();
805
- }
806
- });
807
- window.__openPlanrArtifactAnnotations = controller;
808
- return controller;
809
- }