openplanr 3.4.0 → 3.6.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 (530) hide show
  1. package/CHANGELOG.md +59 -0
  2. package/dist/cli/commands/backlog-commands.d.ts +3 -0
  3. package/dist/cli/commands/backlog-commands.d.ts.map +1 -0
  4. package/dist/cli/commands/backlog-commands.js +60 -0
  5. package/dist/cli/commands/backlog-commands.js.map +1 -0
  6. package/dist/cli/commands/company.d.ts.map +1 -1
  7. package/dist/cli/commands/company.js +17 -0
  8. package/dist/cli/commands/company.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/planning-artifacts.d.ts.map +1 -1
  17. package/dist/cli/commands/planning-artifacts.js +13 -5
  18. package/dist/cli/commands/planning-artifacts.js.map +1 -1
  19. package/dist/dashboard/.vite/manifest.json +1 -1
  20. package/dist/dashboard/assets/{index-CvQAlBy3.js → index-C_OquZVk.js} +2 -2
  21. package/dist/dashboard/assets/{index-CvQAlBy3.js.map → index-C_OquZVk.js.map} +1 -1
  22. package/dist/dashboard/dashboard-manifest.json +13 -13
  23. package/dist/dashboard/index.html +1 -1
  24. package/dist/services/artifact-service.d.ts.map +1 -1
  25. package/dist/services/artifact-service.js +13 -6
  26. package/dist/services/artifact-service.js.map +1 -1
  27. package/dist/services/company-export-service.d.ts +41 -0
  28. package/dist/services/company-export-service.d.ts.map +1 -0
  29. package/dist/services/company-export-service.js +429 -0
  30. package/dist/services/company-export-service.js.map +1 -0
  31. package/dist/services/company-sync-service.d.ts +24 -1
  32. package/dist/services/company-sync-service.d.ts.map +1 -1
  33. package/dist/services/company-sync-service.js +36 -19
  34. package/dist/services/company-sync-service.js.map +1 -1
  35. package/dist/services/design-artifact-service.d.ts +22 -0
  36. package/dist/services/design-artifact-service.d.ts.map +1 -1
  37. package/dist/services/design-artifact-service.js +76 -16
  38. package/dist/services/design-artifact-service.js.map +1 -1
  39. package/dist/services/runtime-manager/runtime-package.js +1 -1
  40. package/dist/services/runtime-manager/runtime-package.js.map +1 -1
  41. package/docs/CLI.md +126 -1
  42. package/lib/backlog-item.d.mts +45 -1
  43. package/lib/backlog-item.mjs +302 -34
  44. package/lib/host-packages/adapter-registry.json +5 -5
  45. package/lib/host-packages/capability-map.json +1 -1
  46. package/lib/host-packages/claude/.claude-plugin/marketplace.json +2 -2
  47. package/lib/host-packages/claude/openplanr/.claude-plugin/icon.png +0 -0
  48. package/lib/host-packages/claude/openplanr/.claude-plugin/plugin.json +1 -1
  49. package/lib/host-packages/claude/openplanr/.openplanr-content.json +97 -413
  50. package/lib/host-packages/claude/openplanr/README.md +8 -8
  51. package/lib/host-packages/claude/openplanr/skills/artifact/references/design-sharing.md +2 -2
  52. package/lib/host-packages/claude/openplanr/skills/ceo-review/references/note-checklist.md +131 -0
  53. package/lib/host-packages/claude/openplanr/skills/ceo-review/references/operate-advisor-contract.md +2 -7
  54. package/lib/host-packages/claude/openplanr/skills/chair-review/SKILL.md +2 -7
  55. package/lib/host-packages/claude/openplanr/skills/chair-review/references/note-checklist.md +131 -0
  56. package/lib/host-packages/claude/openplanr/skills/challenger-review/SKILL.md +3 -7
  57. package/lib/host-packages/claude/openplanr/skills/challenger-review/references/note-checklist.md +131 -0
  58. package/lib/host-packages/claude/openplanr/skills/cmo-review/references/note-checklist.md +131 -0
  59. package/lib/host-packages/claude/openplanr/skills/cmo-review/references/operate-advisor-contract.md +2 -7
  60. package/lib/host-packages/claude/openplanr/skills/coo-review/references/note-checklist.md +131 -0
  61. package/lib/host-packages/claude/openplanr/skills/coo-review/references/operate-advisor-contract.md +2 -7
  62. package/lib/host-packages/claude/openplanr/skills/cpo-review/references/note-checklist.md +131 -0
  63. package/lib/host-packages/claude/openplanr/skills/cpo-review/references/operate-advisor-contract.md +2 -7
  64. package/lib/host-packages/claude/openplanr/skills/cto-review/references/note-checklist.md +131 -0
  65. package/lib/host-packages/claude/openplanr/skills/cto-review/references/operate-advisor-contract.md +2 -7
  66. package/lib/host-packages/claude/openplanr/skills/design/SKILL.md +23 -12
  67. package/lib/host-packages/claude/openplanr/skills/design/references/design-system.md +2 -2
  68. package/lib/host-packages/claude/openplanr/skills/design/references/generation.md +3 -3
  69. package/lib/host-packages/claude/openplanr/skills/design/references/hosted-canvas.md +6 -3
  70. package/lib/host-packages/claude/openplanr/skills/design/references/review.md +6 -6
  71. package/lib/host-packages/claude/openplanr/skills/design/references/team-review.md +3 -4
  72. package/lib/host-packages/claude/openplanr/skills/design/references/utilities.md +78 -38
  73. package/lib/host-packages/claude/openplanr/skills/design-loop/SKILL.md +15 -7
  74. package/lib/host-packages/claude/openplanr/skills/design-loop/references/design-system.md +2 -2
  75. package/lib/host-packages/claude/openplanr/skills/design-loop/references/generation.md +3 -3
  76. package/lib/host-packages/claude/openplanr/skills/design-loop/references/review.md +6 -6
  77. package/lib/host-packages/claude/openplanr/skills/design-loop/references/team-review.md +3 -4
  78. package/lib/host-packages/claude/openplanr/skills/design-loop/references/utilities.md +78 -38
  79. package/lib/host-packages/claude/openplanr/skills/design-review/SKILL.md +25 -5
  80. package/lib/host-packages/claude/openplanr/skills/design-review/references/design-system.md +2 -2
  81. package/lib/host-packages/claude/openplanr/skills/design-review/references/generation.md +3 -3
  82. package/lib/host-packages/claude/openplanr/skills/design-review/references/review.md +6 -6
  83. package/lib/host-packages/claude/openplanr/skills/design-review/references/team-review.md +3 -4
  84. package/lib/host-packages/claude/openplanr/skills/design-review/references/utilities.md +78 -38
  85. package/lib/host-packages/claude/openplanr/skills/investigate/SKILL.md +2 -3
  86. package/lib/host-packages/claude/openplanr/skills/investigate/references/backlog-filing.md +102 -0
  87. package/lib/host-packages/claude/openplanr/skills/investigate/references/findings.md +8 -16
  88. package/lib/host-packages/claude/openplanr/skills/operate/SKILL.md +73 -84
  89. package/lib/host-packages/claude/openplanr/skills/operate/references/note-checklist.md +131 -0
  90. package/lib/host-packages/claude/openplanr/skills/operate/references/return-contract.md +10 -0
  91. package/lib/host-packages/claude/openplanr/skills/plan/SKILL.md +23 -20
  92. package/lib/host-packages/claude/openplanr/skills/plan/references/planning-ids.md +53 -0
  93. package/lib/host-packages/claude/openplanr/skills/plan/references/return-contract.md +10 -0
  94. package/lib/host-packages/claude/openplanr/skills/plan-review/SKILL.md +6 -6
  95. package/lib/host-packages/claude/openplanr/skills/plan-review/references/return-contract.md +10 -0
  96. package/lib/host-packages/claude/openplanr/skills/release/SKILL.md +40 -139
  97. package/lib/host-packages/claude/openplanr/skills/release/references/cadence.md +10 -0
  98. package/lib/host-packages/claude/openplanr/skills/release/references/release-notes.md +1 -1
  99. package/lib/host-packages/claude/openplanr/skills/release/references/return-contract.md +10 -0
  100. package/lib/host-packages/claude/openplanr/skills/release/references/schemes.md +4 -2
  101. package/lib/host-packages/claude/openplanr/skills/ship/SKILL.md +37 -24
  102. package/lib/host-packages/claude/openplanr/skills/ship/references/backlog-filing.md +102 -0
  103. package/lib/host-packages/claude/openplanr/skills/ship/references/findings.md +8 -16
  104. package/lib/host-packages/claude/openplanr/skills/ship/references/return-contract.md +10 -0
  105. package/lib/host-packages/claude/openplanr/skills/spec/SKILL.md +9 -9
  106. package/lib/host-packages/claude/openplanr/skills/spec/references/return-contract.md +10 -0
  107. package/lib/host-packages/cursor/openplanr/.openplanr-content.json +94 -410
  108. package/lib/host-packages/cursor/openplanr/manifest.json +1 -1
  109. package/lib/host-packages/cursor/openplanr/rules/planr-artifact/references/design-sharing.md +2 -2
  110. package/lib/host-packages/cursor/openplanr/rules/planr-ceo-review/references/note-checklist.md +131 -0
  111. package/lib/host-packages/cursor/openplanr/rules/planr-ceo-review/references/operate-advisor-contract.md +2 -7
  112. package/lib/host-packages/cursor/openplanr/rules/planr-chair-review/references/note-checklist.md +131 -0
  113. package/lib/host-packages/cursor/openplanr/rules/planr-chair-review.mdc +2 -7
  114. package/lib/host-packages/cursor/openplanr/rules/planr-challenger-review/references/note-checklist.md +131 -0
  115. package/lib/host-packages/cursor/openplanr/rules/planr-challenger-review.mdc +3 -7
  116. package/lib/host-packages/cursor/openplanr/rules/planr-cmo-review/references/note-checklist.md +131 -0
  117. package/lib/host-packages/cursor/openplanr/rules/planr-cmo-review/references/operate-advisor-contract.md +2 -7
  118. package/lib/host-packages/cursor/openplanr/rules/planr-coo-review/references/note-checklist.md +131 -0
  119. package/lib/host-packages/cursor/openplanr/rules/planr-coo-review/references/operate-advisor-contract.md +2 -7
  120. package/lib/host-packages/cursor/openplanr/rules/planr-cpo-review/references/note-checklist.md +131 -0
  121. package/lib/host-packages/cursor/openplanr/rules/planr-cpo-review/references/operate-advisor-contract.md +2 -7
  122. package/lib/host-packages/cursor/openplanr/rules/planr-cto-review/references/note-checklist.md +131 -0
  123. package/lib/host-packages/cursor/openplanr/rules/planr-cto-review/references/operate-advisor-contract.md +2 -7
  124. package/lib/host-packages/cursor/openplanr/rules/planr-design/references/design-system.md +2 -2
  125. package/lib/host-packages/cursor/openplanr/rules/planr-design/references/generation.md +3 -3
  126. package/lib/host-packages/cursor/openplanr/rules/planr-design/references/hosted-canvas.md +6 -3
  127. package/lib/host-packages/cursor/openplanr/rules/planr-design/references/review.md +6 -6
  128. package/lib/host-packages/cursor/openplanr/rules/planr-design/references/team-review.md +3 -4
  129. package/lib/host-packages/cursor/openplanr/rules/planr-design/references/utilities.md +78 -38
  130. package/lib/host-packages/cursor/openplanr/rules/planr-design-loop/references/design-system.md +2 -2
  131. package/lib/host-packages/cursor/openplanr/rules/planr-design-loop/references/generation.md +3 -3
  132. package/lib/host-packages/cursor/openplanr/rules/planr-design-loop/references/review.md +6 -6
  133. package/lib/host-packages/cursor/openplanr/rules/planr-design-loop/references/team-review.md +3 -4
  134. package/lib/host-packages/cursor/openplanr/rules/planr-design-loop/references/utilities.md +78 -38
  135. package/lib/host-packages/cursor/openplanr/rules/planr-design-loop.mdc +15 -7
  136. package/lib/host-packages/cursor/openplanr/rules/planr-design-review/references/design-system.md +2 -2
  137. package/lib/host-packages/cursor/openplanr/rules/planr-design-review/references/generation.md +3 -3
  138. package/lib/host-packages/cursor/openplanr/rules/planr-design-review/references/review.md +6 -6
  139. package/lib/host-packages/cursor/openplanr/rules/planr-design-review/references/team-review.md +3 -4
  140. package/lib/host-packages/cursor/openplanr/rules/planr-design-review/references/utilities.md +78 -38
  141. package/lib/host-packages/cursor/openplanr/rules/planr-design-review.mdc +25 -5
  142. package/lib/host-packages/cursor/openplanr/rules/planr-design.mdc +23 -12
  143. package/lib/host-packages/cursor/openplanr/rules/planr-investigate/references/backlog-filing.md +102 -0
  144. package/lib/host-packages/cursor/openplanr/rules/planr-investigate/references/findings.md +8 -16
  145. package/lib/host-packages/cursor/openplanr/rules/planr-investigate.mdc +2 -3
  146. package/lib/host-packages/cursor/openplanr/rules/planr-operate/references/note-checklist.md +131 -0
  147. package/lib/host-packages/cursor/openplanr/rules/planr-operate/references/return-contract.md +10 -0
  148. package/lib/host-packages/cursor/openplanr/rules/planr-operate.mdc +73 -84
  149. package/lib/host-packages/cursor/openplanr/rules/planr-plan/references/planning-ids.md +53 -0
  150. package/lib/host-packages/cursor/openplanr/rules/planr-plan/references/return-contract.md +10 -0
  151. package/lib/host-packages/cursor/openplanr/rules/planr-plan-review/references/return-contract.md +10 -0
  152. package/lib/host-packages/cursor/openplanr/rules/planr-plan-review.mdc +6 -6
  153. package/lib/host-packages/cursor/openplanr/rules/planr-plan.mdc +23 -20
  154. package/lib/host-packages/cursor/openplanr/rules/planr-release/references/cadence.md +10 -0
  155. package/lib/host-packages/cursor/openplanr/rules/planr-release/references/release-notes.md +1 -1
  156. package/lib/host-packages/cursor/openplanr/rules/planr-release/references/return-contract.md +10 -0
  157. package/lib/host-packages/cursor/openplanr/rules/planr-release/references/schemes.md +4 -2
  158. package/lib/host-packages/cursor/openplanr/rules/planr-release.mdc +40 -139
  159. package/lib/host-packages/cursor/openplanr/rules/planr-ship/references/backlog-filing.md +102 -0
  160. package/lib/host-packages/cursor/openplanr/rules/planr-ship/references/findings.md +8 -16
  161. package/lib/host-packages/cursor/openplanr/rules/planr-ship/references/return-contract.md +10 -0
  162. package/lib/host-packages/cursor/openplanr/rules/planr-ship.mdc +37 -24
  163. package/lib/host-packages/cursor/openplanr/rules/planr-spec/references/return-contract.md +10 -0
  164. package/lib/host-packages/cursor/openplanr/rules/planr-spec.mdc +9 -9
  165. package/lib/host-packages/openai/.claude-plugin/marketplace.json +2 -2
  166. package/lib/host-packages/openai/openplanr/.codex-plugin/plugin.json +1 -1
  167. package/lib/host-packages/openai/openplanr/.openplanr-content.json +112 -428
  168. package/lib/host-packages/openai/openplanr/skills/artifact/references/design-sharing.md +2 -2
  169. package/lib/host-packages/openai/openplanr/skills/ceo-review/openplanr.skill.json +4 -4
  170. package/lib/host-packages/openai/openplanr/skills/ceo-review/references/note-checklist.md +131 -0
  171. package/lib/host-packages/openai/openplanr/skills/ceo-review/references/operate-advisor-contract.md +2 -7
  172. package/lib/host-packages/openai/openplanr/skills/chair-review/SKILL.md +2 -7
  173. package/lib/host-packages/openai/openplanr/skills/chair-review/openplanr.skill.json +4 -4
  174. package/lib/host-packages/openai/openplanr/skills/chair-review/references/note-checklist.md +131 -0
  175. package/lib/host-packages/openai/openplanr/skills/challenger-review/SKILL.md +3 -7
  176. package/lib/host-packages/openai/openplanr/skills/challenger-review/openplanr.skill.json +4 -4
  177. package/lib/host-packages/openai/openplanr/skills/challenger-review/references/note-checklist.md +131 -0
  178. package/lib/host-packages/openai/openplanr/skills/cmo-review/openplanr.skill.json +4 -4
  179. package/lib/host-packages/openai/openplanr/skills/cmo-review/references/note-checklist.md +131 -0
  180. package/lib/host-packages/openai/openplanr/skills/cmo-review/references/operate-advisor-contract.md +2 -7
  181. package/lib/host-packages/openai/openplanr/skills/coo-review/openplanr.skill.json +4 -4
  182. package/lib/host-packages/openai/openplanr/skills/coo-review/references/note-checklist.md +131 -0
  183. package/lib/host-packages/openai/openplanr/skills/coo-review/references/operate-advisor-contract.md +2 -7
  184. package/lib/host-packages/openai/openplanr/skills/cpo-review/openplanr.skill.json +4 -4
  185. package/lib/host-packages/openai/openplanr/skills/cpo-review/references/note-checklist.md +131 -0
  186. package/lib/host-packages/openai/openplanr/skills/cpo-review/references/operate-advisor-contract.md +2 -7
  187. package/lib/host-packages/openai/openplanr/skills/cto-review/openplanr.skill.json +4 -4
  188. package/lib/host-packages/openai/openplanr/skills/cto-review/references/note-checklist.md +131 -0
  189. package/lib/host-packages/openai/openplanr/skills/cto-review/references/operate-advisor-contract.md +2 -7
  190. package/lib/host-packages/openai/openplanr/skills/design/SKILL.md +23 -12
  191. package/lib/host-packages/openai/openplanr/skills/design/openplanr.skill.json +0 -11
  192. package/lib/host-packages/openai/openplanr/skills/design/references/design-system.md +2 -2
  193. package/lib/host-packages/openai/openplanr/skills/design/references/generation.md +3 -3
  194. package/lib/host-packages/openai/openplanr/skills/design/references/hosted-canvas.md +6 -3
  195. package/lib/host-packages/openai/openplanr/skills/design/references/review.md +6 -6
  196. package/lib/host-packages/openai/openplanr/skills/design/references/team-review.md +3 -4
  197. package/lib/host-packages/openai/openplanr/skills/design/references/utilities.md +78 -38
  198. package/lib/host-packages/openai/openplanr/skills/design-loop/SKILL.md +15 -7
  199. package/lib/host-packages/openai/openplanr/skills/design-loop/openplanr.skill.json +0 -11
  200. package/lib/host-packages/openai/openplanr/skills/design-loop/references/design-system.md +2 -2
  201. package/lib/host-packages/openai/openplanr/skills/design-loop/references/generation.md +3 -3
  202. package/lib/host-packages/openai/openplanr/skills/design-loop/references/review.md +6 -6
  203. package/lib/host-packages/openai/openplanr/skills/design-loop/references/team-review.md +3 -4
  204. package/lib/host-packages/openai/openplanr/skills/design-loop/references/utilities.md +78 -38
  205. package/lib/host-packages/openai/openplanr/skills/design-review/SKILL.md +25 -5
  206. package/lib/host-packages/openai/openplanr/skills/design-review/openplanr.skill.json +0 -11
  207. package/lib/host-packages/openai/openplanr/skills/design-review/references/design-system.md +2 -2
  208. package/lib/host-packages/openai/openplanr/skills/design-review/references/generation.md +3 -3
  209. package/lib/host-packages/openai/openplanr/skills/design-review/references/review.md +6 -6
  210. package/lib/host-packages/openai/openplanr/skills/design-review/references/team-review.md +3 -4
  211. package/lib/host-packages/openai/openplanr/skills/design-review/references/utilities.md +78 -38
  212. package/lib/host-packages/openai/openplanr/skills/investigate/SKILL.md +2 -3
  213. package/lib/host-packages/openai/openplanr/skills/investigate/openplanr.skill.json +4 -4
  214. package/lib/host-packages/openai/openplanr/skills/investigate/references/backlog-filing.md +102 -0
  215. package/lib/host-packages/openai/openplanr/skills/investigate/references/findings.md +8 -16
  216. package/lib/host-packages/openai/openplanr/skills/operate/SKILL.md +73 -84
  217. package/lib/host-packages/openai/openplanr/skills/operate/openplanr.skill.json +15 -4
  218. package/lib/host-packages/openai/openplanr/skills/operate/references/note-checklist.md +131 -0
  219. package/lib/host-packages/openai/openplanr/skills/operate/references/return-contract.md +10 -0
  220. package/lib/host-packages/openai/openplanr/skills/plan/SKILL.md +23 -20
  221. package/lib/host-packages/openai/openplanr/skills/plan/openplanr.skill.json +8 -8
  222. package/lib/host-packages/openai/openplanr/skills/plan/references/planning-ids.md +53 -0
  223. package/lib/host-packages/openai/openplanr/skills/plan/references/return-contract.md +10 -0
  224. package/lib/host-packages/openai/openplanr/skills/plan-review/SKILL.md +6 -6
  225. package/lib/host-packages/openai/openplanr/skills/plan-review/openplanr.skill.json +12 -1
  226. package/lib/host-packages/openai/openplanr/skills/plan-review/references/return-contract.md +10 -0
  227. package/lib/host-packages/openai/openplanr/skills/release/SKILL.md +40 -139
  228. package/lib/host-packages/openai/openplanr/skills/release/openplanr.skill.json +4 -4
  229. package/lib/host-packages/openai/openplanr/skills/release/references/cadence.md +10 -0
  230. package/lib/host-packages/openai/openplanr/skills/release/references/release-notes.md +1 -1
  231. package/lib/host-packages/openai/openplanr/skills/release/references/return-contract.md +10 -0
  232. package/lib/host-packages/openai/openplanr/skills/release/references/schemes.md +4 -2
  233. package/lib/host-packages/openai/openplanr/skills/ship/SKILL.md +37 -24
  234. package/lib/host-packages/openai/openplanr/skills/ship/openplanr.skill.json +9 -9
  235. package/lib/host-packages/openai/openplanr/skills/ship/references/backlog-filing.md +102 -0
  236. package/lib/host-packages/openai/openplanr/skills/ship/references/findings.md +8 -16
  237. package/lib/host-packages/openai/openplanr/skills/ship/references/return-contract.md +10 -0
  238. package/lib/host-packages/openai/openplanr/skills/spec/SKILL.md +9 -9
  239. package/lib/host-packages/openai/openplanr/skills/spec/openplanr.skill.json +12 -1
  240. package/lib/host-packages/openai/openplanr/skills/spec/references/return-contract.md +10 -0
  241. package/package.json +2 -2
  242. package/lib/host-packages/claude/openplanr/.claude-plugin/icon.svg +0 -11
  243. package/lib/host-packages/claude/openplanr/runtime/design/scripts/design-artifact-shell.mjs +0 -1772
  244. package/lib/host-packages/claude/openplanr/runtime/design/scripts/design-document.mjs +0 -2937
  245. package/lib/host-packages/claude/openplanr/runtime/design/scripts/design-entities.mjs +0 -439
  246. package/lib/host-packages/claude/openplanr/runtime/design/scripts/design-handoff.mjs +0 -2370
  247. package/lib/host-packages/claude/openplanr/runtime/design/scripts/design-loopback-server.mjs +0 -359
  248. package/lib/host-packages/claude/openplanr/runtime/design/scripts/design-parse5-parser.mjs +0 -3970
  249. package/lib/host-packages/claude/openplanr/runtime/design/scripts/design-parse5-tokenizer.mjs +0 -3501
  250. package/lib/host-packages/claude/openplanr/runtime/design/scripts/design-review-state-store.mjs +0 -45
  251. package/lib/host-packages/claude/openplanr/runtime/design/scripts/design-review.mjs +0 -3376
  252. package/lib/host-packages/claude/openplanr/runtime/design/scripts/design-runtime-home.mjs +0 -38
  253. package/lib/host-packages/claude/openplanr/runtime/design/scripts/design-sandbox-guards.mjs +0 -1102
  254. package/lib/host-packages/claude/openplanr/runtime/design/scripts/design-share-cli-bridge.mjs +0 -321
  255. package/lib/host-packages/claude/openplanr/runtime/design/scripts/design-shared-artifact-support-dependencies-design-support-protocol-contracts-d707e49b.mjs +0 -1652
  256. package/lib/host-packages/claude/openplanr/runtime/design/scripts/design-shared-artifact-support-protocol-contracts-9f6918b0.mjs +0 -1037
  257. package/lib/host-packages/claude/openplanr/runtime/design/scripts/design-shared-design-support-0bac378d.mjs +0 -137
  258. package/lib/host-packages/claude/openplanr/runtime/design/scripts/design.mjs +0 -1500
  259. package/lib/host-packages/claude/openplanr/runtime/design/scripts/runtime/notices/THIRD_PARTY_NOTICES.txt +0 -2023
  260. package/lib/host-packages/claude/openplanr/runtime/design/scripts/runtime/packages/artifact/lib/artifact/ui/studio-shell.css +0 -2
  261. package/lib/host-packages/claude/openplanr/runtime/design/scripts/runtime/packages/artifact/templates/artifact-review-stage.js.sources/01-module-runtime.js +0 -18
  262. package/lib/host-packages/claude/openplanr/runtime/design/scripts/runtime/packages/artifact/templates/artifact-review-stage.js.sources/02-artifact-review-ui.js +0 -814
  263. package/lib/host-packages/claude/openplanr/runtime/design/scripts/runtime/packages/artifact/templates/artifact-review-stage.js.sources/03-protocol-contracts.js +0 -10
  264. package/lib/host-packages/claude/openplanr/runtime/design/scripts/runtime/packages/artifact/templates/artifact-review-stage.js.sources/04-artifact-review-ui.js +0 -2568
  265. package/lib/host-packages/claude/openplanr/runtime/design/scripts/runtime/packages/artifact/templates/artifact-review-stage.js.sources.json +0 -60
  266. package/lib/host-packages/claude/openplanr/runtime/design/scripts/runtime/packages/design/package.json +0 -65
  267. package/lib/host-packages/claude/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/enhancements.css +0 -388
  268. package/lib/host-packages/claude/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/handoff-center.css +0 -81
  269. package/lib/host-packages/claude/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/share.css +0 -1
  270. package/lib/host-packages/claude/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/share.js +0 -139
  271. package/lib/host-packages/claude/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/studio.css +0 -1159
  272. package/lib/host-packages/claude/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/studio.js.sources/01-module-runtime.js +0 -30
  273. package/lib/host-packages/claude/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/studio.js.sources/02-react.js +0 -900
  274. 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
  275. 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
  276. 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
  277. 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
  278. 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
  279. 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
  280. 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
  281. package/lib/host-packages/claude/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/studio.js.sources/10-react.js +0 -17
  282. package/lib/host-packages/claude/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/studio.js.sources/11-artifact-review-ui.js +0 -12
  283. package/lib/host-packages/claude/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/studio.js.sources/12-protocol-contracts.js +0 -285
  284. package/lib/host-packages/claude/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/studio.js.sources/13-design-review-experience.js +0 -2773
  285. package/lib/host-packages/claude/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/studio.js.sources/14-studio-shell.js +0 -134
  286. package/lib/host-packages/claude/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/studio.js.sources/15-canvas-engine.js +0 -2207
  287. package/lib/host-packages/claude/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/studio.js.sources/16-design-review-experience.js +0 -16
  288. package/lib/host-packages/claude/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/studio.js.sources/17-studio-shell.js +0 -8
  289. package/lib/host-packages/claude/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/studio.js.sources/18-interface-primitives.js +0 -3883
  290. package/lib/host-packages/claude/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/studio.js.sources/19-interface-primitives.js +0 -966
  291. package/lib/host-packages/claude/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/studio.js.sources/20-studio-shell.js +0 -520
  292. package/lib/host-packages/claude/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/studio.js.sources/21-design-studio.js +0 -1597
  293. package/lib/host-packages/claude/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/studio.js.sources.json +0 -311
  294. package/lib/host-packages/claude/openplanr/runtime/design/scripts/runtime/packages/protocol/package.json +0 -163
  295. package/lib/host-packages/claude/openplanr/runtime/design/scripts/runtime/packages/protocol/registries/artifact-theme.json +0 -64
  296. package/lib/host-packages/claude/openplanr/runtime/design/scripts/runtime/packages/protocol/schemas/v1.0.0/design-manifest.schema.json +0 -90
  297. package/lib/host-packages/claude/openplanr/runtime/design/scripts/runtime/packages/protocol/schemas/v1.1.0/artifact-envelope.schema.json +0 -142
  298. package/lib/host-packages/claude/openplanr/runtime/design/scripts/runtime/packages/protocol/schemas/v1.1.0/artifact-review.schema.json +0 -97
  299. package/lib/host-packages/claude/openplanr/runtime/design/scripts/runtime/packages/protocol/schemas/v1.10.0/design-review-bundle.schema.json +0 -584
  300. package/lib/host-packages/claude/openplanr/runtime/design/scripts/runtime/packages/protocol/schemas/v1.10.0/design-review-context.schema.json +0 -191
  301. package/lib/host-packages/claude/openplanr/runtime/design/scripts/runtime/packages/protocol/schemas/v1.10.0/design-review-handoff.schema.json +0 -407
  302. package/lib/host-packages/claude/openplanr/runtime/design/scripts/runtime/packages/protocol/schemas/v1.10.0/design-review-metadata-payload.schema.json +0 -106
  303. package/lib/host-packages/claude/openplanr/runtime/design/scripts/runtime/packages/protocol/schemas/v1.11.0/design-handoff-readiness.schema.json +0 -398
  304. package/lib/host-packages/claude/openplanr/runtime/design/scripts/runtime/packages/protocol/schemas/v1.11.0/design-implementation-handoff.schema.json +0 -518
  305. package/lib/host-packages/claude/openplanr/runtime/design/scripts/runtime/packages/protocol/schemas/v1.11.0/design-planning-lineage.schema.json +0 -106
  306. package/lib/host-packages/claude/openplanr/runtime/design/scripts/runtime/packages/protocol/schemas/v1.11.0/design-review-metadata-payload.schema.json +0 -107
  307. package/lib/host-packages/claude/openplanr/runtime/design/scripts/runtime/packages/protocol/schemas/v1.14.0/artifact-theme.schema.json +0 -316
  308. package/lib/host-packages/claude/openplanr/runtime/design/scripts/runtime/packages/protocol/schemas/v1.16.0/artifact-envelope.schema.json +0 -408
  309. package/lib/host-packages/claude/openplanr/runtime/design/scripts/runtime/packages/protocol/schemas/v1.16.0/design-review-bundle.schema.json +0 -590
  310. package/lib/host-packages/claude/openplanr/runtime/design/scripts/runtime/packages/protocol/schemas/v1.22.0/design-document.schema.json +0 -506
  311. package/lib/host-packages/claude/openplanr/runtime/design/scripts/runtime/packages/protocol/schemas/v1.22.0/design-review-bundle.schema.json +0 -822
  312. package/lib/host-packages/claude/openplanr/runtime/design/scripts/runtime/packages/protocol/schemas/v1.9.0/design-review-bundle.schema.json +0 -346
  313. package/lib/host-packages/claude/openplanr/runtime/operate/scripts/errors.mjs +0 -8
  314. package/lib/host-packages/claude/openplanr/runtime/operate/scripts/operate-review-contract.mjs +0 -428
  315. package/lib/host-packages/claude/openplanr/runtime/operate/scripts/operate-review-note.mjs +0 -686
  316. package/lib/host-packages/claude/openplanr/runtime/operate/scripts/validate-note.mjs +0 -39
  317. package/lib/host-packages/claude/openplanr/runtime/plan/scripts/design-protocol-contracts.mjs +0 -1232
  318. package/lib/host-packages/claude/openplanr/runtime/plan/scripts/design.mjs +0 -2611
  319. package/lib/host-packages/claude/openplanr/runtime/plan/scripts/runtime/notices/THIRD_PARTY_NOTICES.txt +0 -21
  320. package/lib/host-packages/claude/openplanr/runtime/plan/scripts/runtime/packages/protocol/package.json +0 -163
  321. package/lib/host-packages/claude/openplanr/runtime/plan/scripts/runtime/packages/protocol/schemas/v1.1.0/artifact-review.schema.json +0 -97
  322. package/lib/host-packages/claude/openplanr/skills/ceo-review/scripts/validate-note.mjs +0 -12
  323. package/lib/host-packages/claude/openplanr/skills/chair-review/scripts/validate-note.mjs +0 -12
  324. package/lib/host-packages/claude/openplanr/skills/challenger-review/scripts/validate-note.mjs +0 -12
  325. package/lib/host-packages/claude/openplanr/skills/cmo-review/scripts/validate-note.mjs +0 -12
  326. package/lib/host-packages/claude/openplanr/skills/coo-review/scripts/validate-note.mjs +0 -12
  327. package/lib/host-packages/claude/openplanr/skills/cpo-review/scripts/validate-note.mjs +0 -12
  328. package/lib/host-packages/claude/openplanr/skills/cto-review/scripts/validate-note.mjs +0 -12
  329. package/lib/host-packages/claude/openplanr/skills/design/scripts/design.mjs +0 -12
  330. package/lib/host-packages/claude/openplanr/skills/design-loop/scripts/design.mjs +0 -12
  331. package/lib/host-packages/claude/openplanr/skills/design-review/scripts/design.mjs +0 -12
  332. package/lib/host-packages/claude/openplanr/skills/investigate/scripts/backlog-item.mjs +0 -339
  333. package/lib/host-packages/claude/openplanr/skills/operate/scripts/validate-note.mjs +0 -12
  334. package/lib/host-packages/claude/openplanr/skills/plan/scripts/design.mjs +0 -12
  335. package/lib/host-packages/claude/openplanr/skills/plan/scripts/planning-ids.mjs +0 -166
  336. package/lib/host-packages/claude/openplanr/skills/release/scripts/collect_changes.sh +0 -85
  337. package/lib/host-packages/claude/openplanr/skills/ship/scripts/backlog-item.mjs +0 -339
  338. package/lib/host-packages/claude/openplanr/skills/ship/scripts/discover-verification.mjs +0 -108
  339. package/lib/host-packages/cursor/openplanr/rules/planr-ceo-review/scripts/validate-note.mjs +0 -12
  340. package/lib/host-packages/cursor/openplanr/rules/planr-chair-review/scripts/validate-note.mjs +0 -12
  341. package/lib/host-packages/cursor/openplanr/rules/planr-challenger-review/scripts/validate-note.mjs +0 -12
  342. package/lib/host-packages/cursor/openplanr/rules/planr-cmo-review/scripts/validate-note.mjs +0 -12
  343. package/lib/host-packages/cursor/openplanr/rules/planr-coo-review/scripts/validate-note.mjs +0 -12
  344. package/lib/host-packages/cursor/openplanr/rules/planr-cpo-review/scripts/validate-note.mjs +0 -12
  345. package/lib/host-packages/cursor/openplanr/rules/planr-cto-review/scripts/validate-note.mjs +0 -12
  346. package/lib/host-packages/cursor/openplanr/rules/planr-design/scripts/design.mjs +0 -12
  347. package/lib/host-packages/cursor/openplanr/rules/planr-design-loop/scripts/design.mjs +0 -12
  348. package/lib/host-packages/cursor/openplanr/rules/planr-design-review/scripts/design.mjs +0 -12
  349. package/lib/host-packages/cursor/openplanr/rules/planr-investigate/scripts/backlog-item.mjs +0 -339
  350. package/lib/host-packages/cursor/openplanr/rules/planr-operate/scripts/validate-note.mjs +0 -12
  351. package/lib/host-packages/cursor/openplanr/rules/planr-plan/scripts/design.mjs +0 -12
  352. package/lib/host-packages/cursor/openplanr/rules/planr-plan/scripts/planning-ids.mjs +0 -166
  353. package/lib/host-packages/cursor/openplanr/rules/planr-release/scripts/collect_changes.sh +0 -85
  354. package/lib/host-packages/cursor/openplanr/rules/planr-ship/scripts/backlog-item.mjs +0 -339
  355. package/lib/host-packages/cursor/openplanr/rules/planr-ship/scripts/discover-verification.mjs +0 -108
  356. package/lib/host-packages/cursor/openplanr/runtime/design/scripts/design-artifact-shell.mjs +0 -1772
  357. package/lib/host-packages/cursor/openplanr/runtime/design/scripts/design-document.mjs +0 -2937
  358. package/lib/host-packages/cursor/openplanr/runtime/design/scripts/design-entities.mjs +0 -439
  359. package/lib/host-packages/cursor/openplanr/runtime/design/scripts/design-handoff.mjs +0 -2370
  360. package/lib/host-packages/cursor/openplanr/runtime/design/scripts/design-loopback-server.mjs +0 -359
  361. package/lib/host-packages/cursor/openplanr/runtime/design/scripts/design-parse5-parser.mjs +0 -3970
  362. package/lib/host-packages/cursor/openplanr/runtime/design/scripts/design-parse5-tokenizer.mjs +0 -3501
  363. package/lib/host-packages/cursor/openplanr/runtime/design/scripts/design-review-state-store.mjs +0 -45
  364. package/lib/host-packages/cursor/openplanr/runtime/design/scripts/design-review.mjs +0 -3376
  365. package/lib/host-packages/cursor/openplanr/runtime/design/scripts/design-runtime-home.mjs +0 -38
  366. package/lib/host-packages/cursor/openplanr/runtime/design/scripts/design-sandbox-guards.mjs +0 -1102
  367. package/lib/host-packages/cursor/openplanr/runtime/design/scripts/design-share-cli-bridge.mjs +0 -321
  368. package/lib/host-packages/cursor/openplanr/runtime/design/scripts/design-shared-artifact-support-dependencies-design-support-protocol-contracts-d707e49b.mjs +0 -1652
  369. package/lib/host-packages/cursor/openplanr/runtime/design/scripts/design-shared-artifact-support-protocol-contracts-9f6918b0.mjs +0 -1037
  370. package/lib/host-packages/cursor/openplanr/runtime/design/scripts/design-shared-design-support-0bac378d.mjs +0 -137
  371. package/lib/host-packages/cursor/openplanr/runtime/design/scripts/design.mjs +0 -1500
  372. package/lib/host-packages/cursor/openplanr/runtime/design/scripts/runtime/notices/THIRD_PARTY_NOTICES.txt +0 -2023
  373. package/lib/host-packages/cursor/openplanr/runtime/design/scripts/runtime/packages/artifact/lib/artifact/ui/studio-shell.css +0 -2
  374. package/lib/host-packages/cursor/openplanr/runtime/design/scripts/runtime/packages/artifact/templates/artifact-review-stage.js.sources/01-module-runtime.js +0 -18
  375. package/lib/host-packages/cursor/openplanr/runtime/design/scripts/runtime/packages/artifact/templates/artifact-review-stage.js.sources/02-artifact-review-ui.js +0 -814
  376. package/lib/host-packages/cursor/openplanr/runtime/design/scripts/runtime/packages/artifact/templates/artifact-review-stage.js.sources/03-protocol-contracts.js +0 -10
  377. package/lib/host-packages/cursor/openplanr/runtime/design/scripts/runtime/packages/artifact/templates/artifact-review-stage.js.sources/04-artifact-review-ui.js +0 -2568
  378. package/lib/host-packages/cursor/openplanr/runtime/design/scripts/runtime/packages/artifact/templates/artifact-review-stage.js.sources.json +0 -60
  379. package/lib/host-packages/cursor/openplanr/runtime/design/scripts/runtime/packages/design/package.json +0 -65
  380. package/lib/host-packages/cursor/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/enhancements.css +0 -388
  381. package/lib/host-packages/cursor/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/handoff-center.css +0 -81
  382. package/lib/host-packages/cursor/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/share.css +0 -1
  383. package/lib/host-packages/cursor/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/share.js +0 -139
  384. package/lib/host-packages/cursor/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/studio.css +0 -1159
  385. package/lib/host-packages/cursor/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/studio.js.sources/01-module-runtime.js +0 -30
  386. package/lib/host-packages/cursor/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/studio.js.sources/02-react.js +0 -900
  387. 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
  388. 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
  389. 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
  390. 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
  391. 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
  392. 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
  393. 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
  394. package/lib/host-packages/cursor/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/studio.js.sources/10-react.js +0 -17
  395. package/lib/host-packages/cursor/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/studio.js.sources/11-artifact-review-ui.js +0 -12
  396. package/lib/host-packages/cursor/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/studio.js.sources/12-protocol-contracts.js +0 -285
  397. package/lib/host-packages/cursor/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/studio.js.sources/13-design-review-experience.js +0 -2773
  398. package/lib/host-packages/cursor/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/studio.js.sources/14-studio-shell.js +0 -134
  399. package/lib/host-packages/cursor/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/studio.js.sources/15-canvas-engine.js +0 -2207
  400. package/lib/host-packages/cursor/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/studio.js.sources/16-design-review-experience.js +0 -16
  401. package/lib/host-packages/cursor/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/studio.js.sources/17-studio-shell.js +0 -8
  402. package/lib/host-packages/cursor/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/studio.js.sources/18-interface-primitives.js +0 -3883
  403. package/lib/host-packages/cursor/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/studio.js.sources/19-interface-primitives.js +0 -966
  404. package/lib/host-packages/cursor/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/studio.js.sources/20-studio-shell.js +0 -520
  405. package/lib/host-packages/cursor/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/studio.js.sources/21-design-studio.js +0 -1597
  406. package/lib/host-packages/cursor/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/studio.js.sources.json +0 -311
  407. package/lib/host-packages/cursor/openplanr/runtime/design/scripts/runtime/packages/protocol/package.json +0 -163
  408. package/lib/host-packages/cursor/openplanr/runtime/design/scripts/runtime/packages/protocol/registries/artifact-theme.json +0 -64
  409. package/lib/host-packages/cursor/openplanr/runtime/design/scripts/runtime/packages/protocol/schemas/v1.0.0/design-manifest.schema.json +0 -90
  410. package/lib/host-packages/cursor/openplanr/runtime/design/scripts/runtime/packages/protocol/schemas/v1.1.0/artifact-envelope.schema.json +0 -142
  411. package/lib/host-packages/cursor/openplanr/runtime/design/scripts/runtime/packages/protocol/schemas/v1.1.0/artifact-review.schema.json +0 -97
  412. package/lib/host-packages/cursor/openplanr/runtime/design/scripts/runtime/packages/protocol/schemas/v1.10.0/design-review-bundle.schema.json +0 -584
  413. package/lib/host-packages/cursor/openplanr/runtime/design/scripts/runtime/packages/protocol/schemas/v1.10.0/design-review-context.schema.json +0 -191
  414. package/lib/host-packages/cursor/openplanr/runtime/design/scripts/runtime/packages/protocol/schemas/v1.10.0/design-review-handoff.schema.json +0 -407
  415. package/lib/host-packages/cursor/openplanr/runtime/design/scripts/runtime/packages/protocol/schemas/v1.10.0/design-review-metadata-payload.schema.json +0 -106
  416. package/lib/host-packages/cursor/openplanr/runtime/design/scripts/runtime/packages/protocol/schemas/v1.11.0/design-handoff-readiness.schema.json +0 -398
  417. package/lib/host-packages/cursor/openplanr/runtime/design/scripts/runtime/packages/protocol/schemas/v1.11.0/design-implementation-handoff.schema.json +0 -518
  418. package/lib/host-packages/cursor/openplanr/runtime/design/scripts/runtime/packages/protocol/schemas/v1.11.0/design-planning-lineage.schema.json +0 -106
  419. package/lib/host-packages/cursor/openplanr/runtime/design/scripts/runtime/packages/protocol/schemas/v1.11.0/design-review-metadata-payload.schema.json +0 -107
  420. package/lib/host-packages/cursor/openplanr/runtime/design/scripts/runtime/packages/protocol/schemas/v1.14.0/artifact-theme.schema.json +0 -316
  421. package/lib/host-packages/cursor/openplanr/runtime/design/scripts/runtime/packages/protocol/schemas/v1.16.0/artifact-envelope.schema.json +0 -408
  422. package/lib/host-packages/cursor/openplanr/runtime/design/scripts/runtime/packages/protocol/schemas/v1.16.0/design-review-bundle.schema.json +0 -590
  423. package/lib/host-packages/cursor/openplanr/runtime/design/scripts/runtime/packages/protocol/schemas/v1.22.0/design-document.schema.json +0 -506
  424. package/lib/host-packages/cursor/openplanr/runtime/design/scripts/runtime/packages/protocol/schemas/v1.22.0/design-review-bundle.schema.json +0 -822
  425. package/lib/host-packages/cursor/openplanr/runtime/design/scripts/runtime/packages/protocol/schemas/v1.9.0/design-review-bundle.schema.json +0 -346
  426. package/lib/host-packages/cursor/openplanr/runtime/operate/scripts/errors.mjs +0 -8
  427. package/lib/host-packages/cursor/openplanr/runtime/operate/scripts/operate-review-contract.mjs +0 -428
  428. package/lib/host-packages/cursor/openplanr/runtime/operate/scripts/operate-review-note.mjs +0 -686
  429. package/lib/host-packages/cursor/openplanr/runtime/operate/scripts/validate-note.mjs +0 -39
  430. package/lib/host-packages/cursor/openplanr/runtime/plan/scripts/design-protocol-contracts.mjs +0 -1232
  431. package/lib/host-packages/cursor/openplanr/runtime/plan/scripts/design.mjs +0 -2611
  432. package/lib/host-packages/cursor/openplanr/runtime/plan/scripts/runtime/notices/THIRD_PARTY_NOTICES.txt +0 -21
  433. package/lib/host-packages/cursor/openplanr/runtime/plan/scripts/runtime/packages/protocol/package.json +0 -163
  434. package/lib/host-packages/cursor/openplanr/runtime/plan/scripts/runtime/packages/protocol/schemas/v1.1.0/artifact-review.schema.json +0 -97
  435. package/lib/host-packages/openai/openplanr/runtime/design/scripts/design-artifact-shell.mjs +0 -1772
  436. package/lib/host-packages/openai/openplanr/runtime/design/scripts/design-document.mjs +0 -2937
  437. package/lib/host-packages/openai/openplanr/runtime/design/scripts/design-entities.mjs +0 -439
  438. package/lib/host-packages/openai/openplanr/runtime/design/scripts/design-handoff.mjs +0 -2370
  439. package/lib/host-packages/openai/openplanr/runtime/design/scripts/design-loopback-server.mjs +0 -359
  440. package/lib/host-packages/openai/openplanr/runtime/design/scripts/design-parse5-parser.mjs +0 -3970
  441. package/lib/host-packages/openai/openplanr/runtime/design/scripts/design-parse5-tokenizer.mjs +0 -3501
  442. package/lib/host-packages/openai/openplanr/runtime/design/scripts/design-review-state-store.mjs +0 -45
  443. package/lib/host-packages/openai/openplanr/runtime/design/scripts/design-review.mjs +0 -3376
  444. package/lib/host-packages/openai/openplanr/runtime/design/scripts/design-runtime-home.mjs +0 -38
  445. package/lib/host-packages/openai/openplanr/runtime/design/scripts/design-sandbox-guards.mjs +0 -1102
  446. package/lib/host-packages/openai/openplanr/runtime/design/scripts/design-share-cli-bridge.mjs +0 -321
  447. package/lib/host-packages/openai/openplanr/runtime/design/scripts/design-shared-artifact-support-dependencies-design-support-protocol-contracts-d707e49b.mjs +0 -1652
  448. package/lib/host-packages/openai/openplanr/runtime/design/scripts/design-shared-artifact-support-protocol-contracts-9f6918b0.mjs +0 -1037
  449. package/lib/host-packages/openai/openplanr/runtime/design/scripts/design-shared-design-support-0bac378d.mjs +0 -137
  450. package/lib/host-packages/openai/openplanr/runtime/design/scripts/design.mjs +0 -1500
  451. package/lib/host-packages/openai/openplanr/runtime/design/scripts/runtime/notices/THIRD_PARTY_NOTICES.txt +0 -2023
  452. package/lib/host-packages/openai/openplanr/runtime/design/scripts/runtime/packages/artifact/lib/artifact/ui/studio-shell.css +0 -2
  453. package/lib/host-packages/openai/openplanr/runtime/design/scripts/runtime/packages/artifact/templates/artifact-review-stage.js.sources/01-module-runtime.js +0 -18
  454. package/lib/host-packages/openai/openplanr/runtime/design/scripts/runtime/packages/artifact/templates/artifact-review-stage.js.sources/02-artifact-review-ui.js +0 -814
  455. package/lib/host-packages/openai/openplanr/runtime/design/scripts/runtime/packages/artifact/templates/artifact-review-stage.js.sources/03-protocol-contracts.js +0 -10
  456. package/lib/host-packages/openai/openplanr/runtime/design/scripts/runtime/packages/artifact/templates/artifact-review-stage.js.sources/04-artifact-review-ui.js +0 -2568
  457. package/lib/host-packages/openai/openplanr/runtime/design/scripts/runtime/packages/artifact/templates/artifact-review-stage.js.sources.json +0 -60
  458. package/lib/host-packages/openai/openplanr/runtime/design/scripts/runtime/packages/design/package.json +0 -65
  459. package/lib/host-packages/openai/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/enhancements.css +0 -388
  460. package/lib/host-packages/openai/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/handoff-center.css +0 -81
  461. package/lib/host-packages/openai/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/share.css +0 -1
  462. package/lib/host-packages/openai/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/share.js +0 -139
  463. package/lib/host-packages/openai/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/studio.css +0 -1159
  464. package/lib/host-packages/openai/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/studio.js.sources/01-module-runtime.js +0 -30
  465. package/lib/host-packages/openai/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/studio.js.sources/02-react.js +0 -900
  466. 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
  467. 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
  468. 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
  469. 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
  470. 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
  471. 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
  472. 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
  473. package/lib/host-packages/openai/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/studio.js.sources/10-react.js +0 -17
  474. package/lib/host-packages/openai/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/studio.js.sources/11-artifact-review-ui.js +0 -12
  475. package/lib/host-packages/openai/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/studio.js.sources/12-protocol-contracts.js +0 -285
  476. package/lib/host-packages/openai/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/studio.js.sources/13-design-review-experience.js +0 -2773
  477. package/lib/host-packages/openai/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/studio.js.sources/14-studio-shell.js +0 -134
  478. package/lib/host-packages/openai/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/studio.js.sources/15-canvas-engine.js +0 -2207
  479. package/lib/host-packages/openai/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/studio.js.sources/16-design-review-experience.js +0 -16
  480. package/lib/host-packages/openai/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/studio.js.sources/17-studio-shell.js +0 -8
  481. package/lib/host-packages/openai/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/studio.js.sources/18-interface-primitives.js +0 -3883
  482. package/lib/host-packages/openai/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/studio.js.sources/19-interface-primitives.js +0 -966
  483. package/lib/host-packages/openai/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/studio.js.sources/20-studio-shell.js +0 -520
  484. package/lib/host-packages/openai/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/studio.js.sources/21-design-studio.js +0 -1597
  485. package/lib/host-packages/openai/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/studio.js.sources.json +0 -311
  486. package/lib/host-packages/openai/openplanr/runtime/design/scripts/runtime/packages/protocol/package.json +0 -163
  487. package/lib/host-packages/openai/openplanr/runtime/design/scripts/runtime/packages/protocol/registries/artifact-theme.json +0 -64
  488. package/lib/host-packages/openai/openplanr/runtime/design/scripts/runtime/packages/protocol/schemas/v1.0.0/design-manifest.schema.json +0 -90
  489. package/lib/host-packages/openai/openplanr/runtime/design/scripts/runtime/packages/protocol/schemas/v1.1.0/artifact-envelope.schema.json +0 -142
  490. package/lib/host-packages/openai/openplanr/runtime/design/scripts/runtime/packages/protocol/schemas/v1.1.0/artifact-review.schema.json +0 -97
  491. package/lib/host-packages/openai/openplanr/runtime/design/scripts/runtime/packages/protocol/schemas/v1.10.0/design-review-bundle.schema.json +0 -584
  492. package/lib/host-packages/openai/openplanr/runtime/design/scripts/runtime/packages/protocol/schemas/v1.10.0/design-review-context.schema.json +0 -191
  493. package/lib/host-packages/openai/openplanr/runtime/design/scripts/runtime/packages/protocol/schemas/v1.10.0/design-review-handoff.schema.json +0 -407
  494. package/lib/host-packages/openai/openplanr/runtime/design/scripts/runtime/packages/protocol/schemas/v1.10.0/design-review-metadata-payload.schema.json +0 -106
  495. package/lib/host-packages/openai/openplanr/runtime/design/scripts/runtime/packages/protocol/schemas/v1.11.0/design-handoff-readiness.schema.json +0 -398
  496. package/lib/host-packages/openai/openplanr/runtime/design/scripts/runtime/packages/protocol/schemas/v1.11.0/design-implementation-handoff.schema.json +0 -518
  497. package/lib/host-packages/openai/openplanr/runtime/design/scripts/runtime/packages/protocol/schemas/v1.11.0/design-planning-lineage.schema.json +0 -106
  498. package/lib/host-packages/openai/openplanr/runtime/design/scripts/runtime/packages/protocol/schemas/v1.11.0/design-review-metadata-payload.schema.json +0 -107
  499. package/lib/host-packages/openai/openplanr/runtime/design/scripts/runtime/packages/protocol/schemas/v1.14.0/artifact-theme.schema.json +0 -316
  500. package/lib/host-packages/openai/openplanr/runtime/design/scripts/runtime/packages/protocol/schemas/v1.16.0/artifact-envelope.schema.json +0 -408
  501. package/lib/host-packages/openai/openplanr/runtime/design/scripts/runtime/packages/protocol/schemas/v1.16.0/design-review-bundle.schema.json +0 -590
  502. package/lib/host-packages/openai/openplanr/runtime/design/scripts/runtime/packages/protocol/schemas/v1.22.0/design-document.schema.json +0 -506
  503. package/lib/host-packages/openai/openplanr/runtime/design/scripts/runtime/packages/protocol/schemas/v1.22.0/design-review-bundle.schema.json +0 -822
  504. package/lib/host-packages/openai/openplanr/runtime/design/scripts/runtime/packages/protocol/schemas/v1.9.0/design-review-bundle.schema.json +0 -346
  505. package/lib/host-packages/openai/openplanr/runtime/operate/scripts/errors.mjs +0 -8
  506. package/lib/host-packages/openai/openplanr/runtime/operate/scripts/operate-review-contract.mjs +0 -428
  507. package/lib/host-packages/openai/openplanr/runtime/operate/scripts/operate-review-note.mjs +0 -686
  508. package/lib/host-packages/openai/openplanr/runtime/operate/scripts/validate-note.mjs +0 -39
  509. package/lib/host-packages/openai/openplanr/runtime/plan/scripts/design-protocol-contracts.mjs +0 -1232
  510. package/lib/host-packages/openai/openplanr/runtime/plan/scripts/design.mjs +0 -2611
  511. package/lib/host-packages/openai/openplanr/runtime/plan/scripts/runtime/notices/THIRD_PARTY_NOTICES.txt +0 -21
  512. package/lib/host-packages/openai/openplanr/runtime/plan/scripts/runtime/packages/protocol/package.json +0 -163
  513. package/lib/host-packages/openai/openplanr/runtime/plan/scripts/runtime/packages/protocol/schemas/v1.1.0/artifact-review.schema.json +0 -97
  514. package/lib/host-packages/openai/openplanr/skills/ceo-review/scripts/validate-note.mjs +0 -12
  515. package/lib/host-packages/openai/openplanr/skills/chair-review/scripts/validate-note.mjs +0 -12
  516. package/lib/host-packages/openai/openplanr/skills/challenger-review/scripts/validate-note.mjs +0 -12
  517. package/lib/host-packages/openai/openplanr/skills/cmo-review/scripts/validate-note.mjs +0 -12
  518. package/lib/host-packages/openai/openplanr/skills/coo-review/scripts/validate-note.mjs +0 -12
  519. package/lib/host-packages/openai/openplanr/skills/cpo-review/scripts/validate-note.mjs +0 -12
  520. package/lib/host-packages/openai/openplanr/skills/cto-review/scripts/validate-note.mjs +0 -12
  521. package/lib/host-packages/openai/openplanr/skills/design/scripts/design.mjs +0 -12
  522. package/lib/host-packages/openai/openplanr/skills/design-loop/scripts/design.mjs +0 -12
  523. package/lib/host-packages/openai/openplanr/skills/design-review/scripts/design.mjs +0 -12
  524. package/lib/host-packages/openai/openplanr/skills/investigate/scripts/backlog-item.mjs +0 -339
  525. package/lib/host-packages/openai/openplanr/skills/operate/scripts/validate-note.mjs +0 -12
  526. package/lib/host-packages/openai/openplanr/skills/plan/scripts/design.mjs +0 -12
  527. package/lib/host-packages/openai/openplanr/skills/plan/scripts/planning-ids.mjs +0 -166
  528. package/lib/host-packages/openai/openplanr/skills/release/scripts/collect_changes.sh +0 -85
  529. package/lib/host-packages/openai/openplanr/skills/ship/scripts/backlog-item.mjs +0 -339
  530. package/lib/host-packages/openai/openplanr/skills/ship/scripts/discover-verification.mjs +0 -108
@@ -1,814 +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(rect) {
50
- if (!rect || !Number.isFinite(rect.left) || !Number.isFinite(rect.top) || !Number.isFinite(rect.width) || !Number.isFinite(rect.height) || rect.width <= 0 || rect.height <= 0) {
51
- throw new RangeError("Artifact bounds must have positive finite dimensions.");
52
- }
53
- }
54
- function clientSelectionToNormalized(rect, start, end = start, { dragThreshold = ARTIFACT_ANNOTATION_LIMITS.dragThreshold } = {}) {
55
- assertRect(rect);
56
- const startX = clamp(
57
- finite(start?.x ?? start?.clientX, rect.left),
58
- rect.left,
59
- rect.left + rect.width
60
- );
61
- const startY = clamp(
62
- finite(start?.y ?? start?.clientY, rect.top),
63
- rect.top,
64
- rect.top + rect.height
65
- );
66
- const endX = clamp(finite(end?.x ?? end?.clientX, startX), rect.left, rect.left + rect.width);
67
- const endY = clamp(finite(end?.y ?? end?.clientY, startY), rect.top, rect.top + rect.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 - rect.left) / rect.width),
75
- y: normalized((top - rect.top) / rect.height),
76
- w: normalized((right - left) / rect.width),
77
- h: normalized((bottom - top) / rect.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 token = "";
130
- for (let index = 0; index < source.length; index += 1) {
131
- token += source.charCodeAt(index).toString(16).padStart(4, "0");
132
- }
133
- return token;
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 node = document2.createElement(tag);
147
- if (className) node.className = className;
148
- if (textContent !== void 0) node.textContent = textContent;
149
- for (const [name, value] of Object.entries(attributes)) {
150
- if (value !== void 0 && value !== null) node.setAttribute(name, String(value));
151
- }
152
- return node;
153
- }
154
- function setRegionStyle(node, region) {
155
- const style = annotationStyle(region);
156
- if (node.style.left !== style.left) node.style.left = style.left;
157
- if (node.style.top !== style.top) node.style.top = style.top;
158
- if (region.w > 0 || region.h > 0) {
159
- if (node.style.width !== style.width) node.style.width = style.width;
160
- if (node.style.height !== style.height) node.style.height = style.height;
161
- }
162
- }
163
- function announce(document2, value) {
164
- const node = document2.querySelector('[data-planr-slot="review-announcer"]');
165
- if (node) node.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 [index, 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(index === 0),
185
- tabindex: index === 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
- (node) => node.dataset.planrAnnotationLayer === artifactId
222
- ) ?? null;
223
- }
224
- function frameFor(artifactId) {
225
- return [...document2.querySelectorAll("[data-planr-artifact-frame]")].find(
226
- (node) => node.dataset.planrArtifactFrame === artifactId
227
- ) ?? null;
228
- }
229
- function focusThread(pinId) {
230
- const pin = review()?.pins?.find((item) => item.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((item) => item.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(record, region) {
274
- const point = { x: region.x + region.w / 2, y: region.y + region.h / 2, w: 0, h: 0 };
275
- setRegionStyle(record.button, point);
276
- if (record.region) setRegionStyle(record.region, region);
277
- if (record.button.hidden) record.button.hidden = false;
278
- if (record.region?.hidden) record.region.hidden = false;
279
- }
280
- function hidePin(record) {
281
- if (!record.button.hidden) record.button.hidden = true;
282
- if (record.region && !record.region.hidden) record.region.hidden = true;
283
- }
284
- function removePin(record) {
285
- record.pending = null;
286
- record.button.remove();
287
- record.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((record) => record.pin.anchor?.planrId).sort((a, b) => a.requestedAt - b.requestedAt);
299
- for (const record of records) {
300
- if (record.pending || now - record.requestedAt < 200 || !record.button.isConnected) continue;
301
- const frame = frames.get(record.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 = record.geometryKey, pin = record.pin;
306
- record.pending = request;
307
- record.requestedAt = now;
308
- anchorRequests.set(frame, (anchorRequests.get(frame) ?? 0) + 1);
309
- Promise.resolve().then(() => bridge.resolve(pin.anchor.planrId, pin.anchor.screen)).then((anchor) => {
310
- if (destroyed || record.pending !== request || record.geometryKey !== key || !record.button.isConnected || frame.__openPlanrBridge !== bridge)
311
- return;
312
- if (!anchor || anchor.rect.width <= 0 || anchor.rect.height <= 0) {
313
- hidePin(record);
314
- if (record.button.dataset.planrAnchorStatus !== "unavailable")
315
- record.button.dataset.planrAnchorStatus = "unavailable";
316
- return;
317
- }
318
- const projected = anchorRegionToViewportRegion(
319
- pin.region,
320
- anchor.viewport ?? pin.viewport,
321
- anchor.rect
322
- );
323
- setPinPosition(record, projected);
324
- if (record.button.dataset.planrAnchorStatus !== "resolved")
325
- record.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 (record.pending === request) record.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 record of records.values()) removePin(record);
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 [index, pin] of pins.entries()) {
352
- if (pin.artifactId !== layer.dataset.planrAnnotationLayer) continue;
353
- current.add(pin.id);
354
- const ids = annotationDomIds(pin.id), ordinal = index + 1;
355
- const hasRegion = pin.region.w > 0 || pin.region.h > 0;
356
- let record = records.get(pin.id);
357
- if (!record) {
358
- const button = make(document2, "button", {
359
- attributes: {
360
- type: "button",
361
- id: ids.pin,
362
- "data-planr-pin-id": pin.id,
363
- "aria-controls": ids.thread
364
- }
365
- });
366
- button.addEventListener("click", () => focusThread(pin.id));
367
- layer.append(button);
368
- record = {
369
- button,
370
- region: null,
371
- pin,
372
- geometryKey: null,
373
- pending: null,
374
- requestedAt: -Infinity
375
- };
376
- records.set(pin.id, record);
377
- }
378
- record.pin = pin;
379
- if (hasRegion && !record.region) {
380
- record.region = make(document2, "span", {
381
- attributes: { "data-planr-pin-region-id": pin.id, "aria-hidden": "true" }
382
- });
383
- layer.insertBefore(record.region, record.button);
384
- } else if (!hasRegion && record.region) {
385
- record.region.remove();
386
- record.region = null;
387
- }
388
- const buttonClass = `planr-pin planr-pin-${pin.intent} planr-pin-${pin.status}${hasRegion ? " planr-pin-region-handle" : ""}${record.button.classList.contains("planr-pin-highlight") ? " planr-pin-highlight" : ""}`;
389
- if (record.button.className !== buttonClass) record.button.className = buttonClass;
390
- if (record.button.textContent !== String(ordinal))
391
- record.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 (record.button.getAttribute(name) !== value) record.button.setAttribute(name, value);
398
- }
399
- if (record.region) {
400
- const regionClass = `planr-pin-region planr-pin-region-${pin.intent} planr-pin-region-${pin.status}`;
401
- if (record.region.className !== regionClass) record.region.className = regionClass;
402
- }
403
- const key = pinGeometryKey(pin);
404
- if (record.geometryKey !== key) {
405
- record.geometryKey = key;
406
- record.pending = null;
407
- record.requestedAt = -Infinity;
408
- if (pin.anchor?.planrId) hidePin(record);
409
- else {
410
- delete record.button.dataset.planrAnchorStatus;
411
- setPinPosition(record, pin.region);
412
- }
413
- }
414
- }
415
- for (const [id, record] of records) {
416
- if (!current.has(id)) {
417
- removePin(record);
418
- records.delete(id);
419
- }
420
- }
421
- }
422
- refreshAnchors();
423
- }
424
- function closeComposer({ restoreFocus = false, preserveDraft = false } = {}) {
425
- const snapshot = 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 = snapshot;
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(token, candidate) {
450
- const frame = frameFor(candidate.artifactId);
451
- const point = artifactAnchorPoint(candidate.region, candidate.viewport);
452
- let result = null;
453
- try {
454
- const anchor = frame?.__openPlanrBridge?.hitTest?.(point.x, point.y);
455
- if (anchor) {
456
- result = await Promise.race([
457
- anchor,
458
- new Promise((resolve) => window.setTimeout(() => resolve(null), 800))
459
- ]);
460
- }
461
- } catch {
462
- result = null;
463
- }
464
- if (token !== 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 bounds = layer.getBoundingClientRect();
489
- const point = {
490
- x: bounds.left + clamp(draft.displayRegion.x + draft.displayRegion.w / 2) * bounds.width,
491
- y: bounds.top + clamp(draft.displayRegion.y + draft.displayRegion.h / 2) * bounds.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 = point.x + 16 + width <= viewport.x + viewport.width - margin ? point.x + 16 : point.x - width - 16;
496
- composer.style.left = `${clamp(left, viewport.x + margin, viewport.x + viewport.width - width - margin)}px`;
497
- composer.style.top = `${clamp(point.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 token = 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 }) => id) ?? []);
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 }) => !existingIds.has(id));
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 (token !== 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(token, 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(snapshot) {
740
- if (!snapshot || snapshot.reviewOf !== (reviewController.getReviewOf?.() ?? review()?.reviewOf ?? null))
741
- return false;
742
- const artifact = stageController.getState().artifacts.find((entry) => entry.id === snapshot.artifactId);
743
- if (!artifact || artifact.viewport.width !== snapshot.viewport?.width || artifact.viewport.height !== snapshot.viewport?.height || !["x", "y", "w", "h"].every(
744
- (key) => Number.isFinite(snapshot.region?.[key]) && snapshot.region[key] >= 0 && snapshot.region[key] <= 1
745
- ) || !["x", "y", "w", "h"].every(
746
- (key) => Number.isFinite(snapshot.displayRegion?.[key]) && snapshot.displayRegion[key] >= 0 && snapshot.displayRegion[key] <= 1
747
- ) || typeof snapshot.comment !== "string" || snapshot.comment.length > ARTIFACT_ANNOTATION_LIMITS.maxCommentLength || typeof snapshot.identity !== "string" || snapshot.identity.length > ARTIFACT_ANNOTATION_LIMITS.maxIdentityLength || !INTENTS.includes(snapshot.intent) || snapshot.anchor && (typeof snapshot.anchor.planrId !== "string" || snapshot.anchor.planrId.length > 512))
748
- return false;
749
- openComposer(snapshot, { restoredDraft: snapshot });
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 record of records.values()) removePin(record);
803
- pinRecords.clear();
804
- anchorRequests.clear();
805
- }
806
- });
807
- window.__openPlanrArtifactAnnotations = controller;
808
- return controller;
809
- }
810
-
811
- // local-stage-stub:./durable-paste-share.mjs
812
- function createDurablePasteShare() {
813
- return null;
814
- }