openplanr 3.3.0 → 3.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (267) hide show
  1. package/CHANGELOG.md +52 -0
  2. package/dist/cli/commands/artifact-design-share.d.ts +9 -0
  3. package/dist/cli/commands/artifact-design-share.d.ts.map +1 -0
  4. package/dist/cli/commands/artifact-design-share.js +200 -0
  5. package/dist/cli/commands/artifact-design-share.js.map +1 -0
  6. package/dist/cli/commands/artifact.d.ts.map +1 -1
  7. package/dist/cli/commands/artifact.js +5 -18
  8. package/dist/cli/commands/artifact.js.map +1 -1
  9. package/dist/cli/commands/ship.d.ts.map +1 -1
  10. package/dist/cli/commands/ship.js +2 -0
  11. package/dist/cli/commands/ship.js.map +1 -1
  12. package/dist/dashboard/.vite/manifest.json +2 -2
  13. package/dist/dashboard/assets/index-Cv4Vwhuw.css +2 -0
  14. package/dist/dashboard/assets/index-CvQAlBy3.js +75 -0
  15. package/dist/dashboard/assets/index-CvQAlBy3.js.map +1 -0
  16. package/dist/dashboard/dashboard-manifest.json +14 -14
  17. package/dist/dashboard/index.html +2 -2
  18. package/dist/services/design-artifact-service.d.ts +20 -1
  19. package/dist/services/design-artifact-service.d.ts.map +1 -1
  20. package/dist/services/design-artifact-service.js +137 -18
  21. package/dist/services/design-artifact-service.js.map +1 -1
  22. package/dist/services/ship-checks/contract.d.ts +3 -1
  23. package/dist/services/ship-checks/contract.d.ts.map +1 -1
  24. package/dist/services/ship-checks/contract.js +1 -1
  25. package/dist/services/ship-checks/contract.js.map +1 -1
  26. package/dist/services/ship-checks/discover.d.ts.map +1 -1
  27. package/dist/services/ship-checks/discover.js +2 -1
  28. package/dist/services/ship-checks/discover.js.map +1 -1
  29. package/dist/services/ship-checks/package-contents.d.ts +4 -0
  30. package/dist/services/ship-checks/package-contents.d.ts.map +1 -0
  31. package/dist/services/ship-checks/package-contents.js +91 -0
  32. package/dist/services/ship-checks/package-contents.js.map +1 -0
  33. package/dist/services/ship-checks/packages.d.ts +2 -0
  34. package/dist/services/ship-checks/packages.d.ts.map +1 -1
  35. package/dist/services/ship-checks/packages.js +4 -0
  36. package/dist/services/ship-checks/packages.js.map +1 -1
  37. package/dist/services/ship-checks/scope.js +2 -1
  38. package/dist/services/ship-checks/scope.js.map +1 -1
  39. package/dist/utils/splice-managed-block.js +1 -1
  40. package/dist/utils/splice-managed-block.js.map +1 -1
  41. package/docs/CLI.md +38 -1
  42. package/lib/host-packages/adapter-registry.json +5 -5
  43. package/lib/host-packages/capability-map.json +1 -1
  44. package/lib/host-packages/claude/.claude-plugin/marketplace.json +3 -3
  45. package/lib/host-packages/claude/openplanr/.claude-plugin/plugin.json +6 -6
  46. package/lib/host-packages/claude/openplanr/.openplanr-content.json +67 -123
  47. package/lib/host-packages/claude/openplanr/README.md +12 -12
  48. package/lib/host-packages/claude/openplanr/references/agents/shared/modes/shared/task-context-resolution.md +4 -4
  49. package/lib/host-packages/claude/openplanr/runtime/design/scripts/design-artifact-shell.mjs +2 -4
  50. package/lib/host-packages/claude/openplanr/runtime/design/scripts/design-document.mjs +26 -26
  51. package/lib/host-packages/claude/openplanr/runtime/design/scripts/design-handoff.mjs +850 -56
  52. package/lib/host-packages/claude/openplanr/runtime/design/scripts/design-review-state-store.mjs +45 -0
  53. package/lib/host-packages/claude/openplanr/runtime/design/scripts/design-review.mjs +65 -74
  54. package/lib/host-packages/claude/openplanr/runtime/design/scripts/design-runtime-home.mjs +0 -1
  55. package/lib/host-packages/claude/openplanr/runtime/design/scripts/design-share-cli-bridge.mjs +321 -0
  56. package/lib/host-packages/{openai/openplanr/runtime/design/scripts/design-shared-artifact-support-dependencies-design-support-protocol-contracts-3d9b1a86.mjs → claude/openplanr/runtime/design/scripts/design-shared-artifact-support-dependencies-design-support-protocol-contracts-d707e49b.mjs} +762 -223
  57. package/lib/host-packages/{openai/openplanr/runtime/design/scripts/design-shared-artifact-support-protocol-contracts-ea2cd15e.mjs → claude/openplanr/runtime/design/scripts/design-shared-artifact-support-protocol-contracts-9f6918b0.mjs} +537 -5
  58. package/lib/host-packages/claude/openplanr/runtime/design/scripts/design-shared-design-support-0bac378d.mjs +137 -0
  59. package/lib/host-packages/claude/openplanr/runtime/design/scripts/design.mjs +107 -37
  60. package/lib/host-packages/claude/openplanr/runtime/design/scripts/runtime/notices/THIRD_PARTY_NOTICES.txt +0 -27
  61. package/lib/host-packages/claude/openplanr/runtime/design/scripts/runtime/packages/artifact/templates/artifact-review-stage.js.sources/02-artifact-review-ui.js +138 -133
  62. package/lib/host-packages/claude/openplanr/runtime/design/scripts/runtime/packages/artifact/templates/artifact-review-stage.js.sources/03-protocol-contracts.js +1 -5684
  63. package/lib/host-packages/claude/openplanr/runtime/design/scripts/runtime/packages/artifact/templates/artifact-review-stage.js.sources/04-artifact-review-ui.js +2568 -0
  64. package/lib/host-packages/claude/openplanr/runtime/design/scripts/runtime/packages/artifact/templates/artifact-review-stage.js.sources.json +10 -74
  65. package/lib/host-packages/claude/openplanr/runtime/design/scripts/runtime/packages/design/package.json +3 -3
  66. package/lib/host-packages/claude/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/share.js +8 -2
  67. package/lib/host-packages/claude/openplanr/runtime/design/scripts/runtime/packages/protocol/package.json +5 -1
  68. package/lib/host-packages/claude/openplanr/runtime/plan/scripts/design-protocol-contracts.mjs +545 -4781
  69. package/lib/host-packages/claude/openplanr/runtime/plan/scripts/design.mjs +219 -452
  70. package/lib/host-packages/claude/openplanr/runtime/plan/scripts/runtime/packages/protocol/package.json +5 -1
  71. package/lib/host-packages/claude/openplanr/skills/delegate/SKILL.md +2 -1
  72. package/lib/host-packages/claude/openplanr/skills/delegate/references/integration-review.md +26 -20
  73. package/lib/host-packages/claude/openplanr/skills/delegate/references/operator-guide.md +25 -1
  74. package/lib/host-packages/claude/openplanr/skills/delegate/references/run-handoff.md +2 -2
  75. package/lib/host-packages/claude/openplanr/skills/delegate/references/worktree-custody.md +17 -9
  76. package/lib/host-packages/claude/openplanr/skills/delegate/scripts/adapters/claude.mjs +15 -3
  77. package/lib/host-packages/claude/openplanr/skills/delegate/scripts/adapters/codex.mjs +38 -2
  78. package/lib/host-packages/claude/openplanr/skills/delegate/scripts/adapters/native.mjs +5 -0
  79. package/lib/host-packages/claude/openplanr/skills/delegate/scripts/custody.mjs +217 -10
  80. package/lib/host-packages/claude/openplanr/skills/delegate/scripts/handoff.mjs +1080 -0
  81. package/lib/host-packages/claude/openplanr/skills/delegate/scripts/integrate.mjs +96 -201
  82. package/lib/host-packages/claude/openplanr/skills/delegate/scripts/integration-files.mjs +3 -382
  83. package/lib/host-packages/claude/openplanr/skills/delegate/scripts/presentation.mjs +29 -12
  84. package/lib/host-packages/claude/openplanr/skills/delegate/scripts/run-contract.mjs +11 -0
  85. package/lib/host-packages/claude/openplanr/skills/delegate/scripts/run-execution.mjs +1 -1
  86. package/lib/host-packages/claude/openplanr/skills/delegate/scripts/run-lifecycle.mjs +14 -10
  87. package/lib/host-packages/claude/openplanr/skills/delegate/scripts/run-preparation.mjs +4 -0
  88. package/lib/host-packages/claude/openplanr/skills/delegate/scripts/run-record.mjs +2 -2
  89. package/lib/host-packages/claude/openplanr/skills/design/references/utilities.md +14 -8
  90. package/lib/host-packages/claude/openplanr/skills/design-loop/references/utilities.md +14 -8
  91. package/lib/host-packages/claude/openplanr/skills/design-review/references/utilities.md +14 -8
  92. package/lib/host-packages/claude/openplanr/skills/investigate/SKILL.md +1 -0
  93. package/lib/host-packages/claude/openplanr/skills/investigate/references/fail-first.md +40 -0
  94. package/lib/host-packages/claude/openplanr/skills/ship/SKILL.md +22 -10
  95. package/lib/host-packages/claude/openplanr/skills/ship/references/fail-first.md +40 -0
  96. package/lib/host-packages/claude/openplanr/skills/ship/references/result-contract.md +7 -3
  97. package/lib/host-packages/cursor/openplanr/.openplanr-content.json +65 -121
  98. package/lib/host-packages/cursor/openplanr/manifest.json +1 -1
  99. package/lib/host-packages/cursor/openplanr/rules/planr-delegate/references/integration-review.md +26 -20
  100. package/lib/host-packages/cursor/openplanr/rules/planr-delegate/references/operator-guide.md +25 -1
  101. package/lib/host-packages/cursor/openplanr/rules/planr-delegate/references/run-handoff.md +2 -2
  102. package/lib/host-packages/cursor/openplanr/rules/planr-delegate/references/worktree-custody.md +17 -9
  103. package/lib/host-packages/cursor/openplanr/rules/planr-delegate/scripts/adapters/claude.mjs +15 -3
  104. package/lib/host-packages/cursor/openplanr/rules/planr-delegate/scripts/adapters/codex.mjs +38 -2
  105. package/lib/host-packages/cursor/openplanr/rules/planr-delegate/scripts/adapters/native.mjs +5 -0
  106. package/lib/host-packages/cursor/openplanr/rules/planr-delegate/scripts/custody.mjs +217 -10
  107. package/lib/host-packages/cursor/openplanr/rules/planr-delegate/scripts/handoff.mjs +1080 -0
  108. package/lib/host-packages/cursor/openplanr/rules/planr-delegate/scripts/integrate.mjs +96 -201
  109. package/lib/host-packages/cursor/openplanr/rules/planr-delegate/scripts/integration-files.mjs +3 -382
  110. package/lib/host-packages/cursor/openplanr/rules/planr-delegate/scripts/presentation.mjs +29 -12
  111. package/lib/host-packages/cursor/openplanr/rules/planr-delegate/scripts/run-contract.mjs +11 -0
  112. package/lib/host-packages/cursor/openplanr/rules/planr-delegate/scripts/run-execution.mjs +1 -1
  113. package/lib/host-packages/cursor/openplanr/rules/planr-delegate/scripts/run-lifecycle.mjs +14 -10
  114. package/lib/host-packages/cursor/openplanr/rules/planr-delegate/scripts/run-preparation.mjs +4 -0
  115. package/lib/host-packages/cursor/openplanr/rules/planr-delegate/scripts/run-record.mjs +2 -2
  116. package/lib/host-packages/cursor/openplanr/rules/planr-delegate.mdc +2 -1
  117. package/lib/host-packages/cursor/openplanr/rules/planr-design/references/utilities.md +14 -8
  118. package/lib/host-packages/cursor/openplanr/rules/planr-design-loop/references/utilities.md +14 -8
  119. package/lib/host-packages/cursor/openplanr/rules/planr-design-review/references/utilities.md +14 -8
  120. package/lib/host-packages/cursor/openplanr/rules/planr-investigate/references/fail-first.md +40 -0
  121. package/lib/host-packages/cursor/openplanr/rules/planr-investigate.mdc +1 -0
  122. package/lib/host-packages/cursor/openplanr/rules/planr-ship/references/fail-first.md +40 -0
  123. package/lib/host-packages/cursor/openplanr/rules/planr-ship/references/result-contract.md +7 -3
  124. package/lib/host-packages/cursor/openplanr/rules/planr-ship.mdc +22 -10
  125. package/lib/host-packages/cursor/openplanr/runtime/design/scripts/design-artifact-shell.mjs +2 -4
  126. package/lib/host-packages/cursor/openplanr/runtime/design/scripts/design-document.mjs +26 -26
  127. package/lib/host-packages/cursor/openplanr/runtime/design/scripts/design-handoff.mjs +850 -56
  128. package/lib/host-packages/cursor/openplanr/runtime/design/scripts/design-review-state-store.mjs +45 -0
  129. package/lib/host-packages/cursor/openplanr/runtime/design/scripts/design-review.mjs +65 -74
  130. package/lib/host-packages/cursor/openplanr/runtime/design/scripts/design-runtime-home.mjs +0 -1
  131. package/lib/host-packages/cursor/openplanr/runtime/design/scripts/design-share-cli-bridge.mjs +321 -0
  132. package/lib/host-packages/cursor/openplanr/runtime/design/scripts/{design-shared-artifact-support-dependencies-design-support-protocol-contracts-3d9b1a86.mjs → design-shared-artifact-support-dependencies-design-support-protocol-contracts-d707e49b.mjs} +762 -223
  133. package/lib/host-packages/cursor/openplanr/runtime/design/scripts/{design-shared-artifact-support-protocol-contracts-ea2cd15e.mjs → design-shared-artifact-support-protocol-contracts-9f6918b0.mjs} +537 -5
  134. package/lib/host-packages/cursor/openplanr/runtime/design/scripts/design-shared-design-support-0bac378d.mjs +137 -0
  135. package/lib/host-packages/cursor/openplanr/runtime/design/scripts/design.mjs +107 -37
  136. package/lib/host-packages/cursor/openplanr/runtime/design/scripts/runtime/notices/THIRD_PARTY_NOTICES.txt +0 -27
  137. package/lib/host-packages/cursor/openplanr/runtime/design/scripts/runtime/packages/artifact/templates/artifact-review-stage.js.sources/02-artifact-review-ui.js +138 -133
  138. package/lib/host-packages/cursor/openplanr/runtime/design/scripts/runtime/packages/artifact/templates/artifact-review-stage.js.sources/03-protocol-contracts.js +1 -5684
  139. package/lib/host-packages/cursor/openplanr/runtime/design/scripts/runtime/packages/artifact/templates/artifact-review-stage.js.sources/04-artifact-review-ui.js +2568 -0
  140. package/lib/host-packages/cursor/openplanr/runtime/design/scripts/runtime/packages/artifact/templates/artifact-review-stage.js.sources.json +10 -74
  141. package/lib/host-packages/cursor/openplanr/runtime/design/scripts/runtime/packages/design/package.json +3 -3
  142. package/lib/host-packages/cursor/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/share.js +8 -2
  143. package/lib/host-packages/cursor/openplanr/runtime/design/scripts/runtime/packages/protocol/package.json +5 -1
  144. package/lib/host-packages/cursor/openplanr/runtime/plan/scripts/design-protocol-contracts.mjs +545 -4781
  145. package/lib/host-packages/cursor/openplanr/runtime/plan/scripts/design.mjs +219 -452
  146. package/lib/host-packages/cursor/openplanr/runtime/plan/scripts/runtime/packages/protocol/package.json +5 -1
  147. package/lib/host-packages/openai/.claude-plugin/marketplace.json +3 -3
  148. package/lib/host-packages/openai/openplanr/.codex-plugin/plugin.json +2 -2
  149. package/lib/host-packages/openai/openplanr/.openplanr-content.json +68 -124
  150. package/lib/host-packages/openai/openplanr/runtime/design/scripts/design-artifact-shell.mjs +2 -4
  151. package/lib/host-packages/openai/openplanr/runtime/design/scripts/design-document.mjs +26 -26
  152. package/lib/host-packages/openai/openplanr/runtime/design/scripts/design-handoff.mjs +850 -56
  153. package/lib/host-packages/openai/openplanr/runtime/design/scripts/design-review-state-store.mjs +45 -0
  154. package/lib/host-packages/openai/openplanr/runtime/design/scripts/design-review.mjs +65 -74
  155. package/lib/host-packages/openai/openplanr/runtime/design/scripts/design-runtime-home.mjs +0 -1
  156. package/lib/host-packages/openai/openplanr/runtime/design/scripts/design-share-cli-bridge.mjs +321 -0
  157. package/lib/host-packages/{claude/openplanr/runtime/design/scripts/design-shared-artifact-support-dependencies-design-support-protocol-contracts-3d9b1a86.mjs → openai/openplanr/runtime/design/scripts/design-shared-artifact-support-dependencies-design-support-protocol-contracts-d707e49b.mjs} +762 -223
  158. package/lib/host-packages/{claude/openplanr/runtime/design/scripts/design-shared-artifact-support-protocol-contracts-ea2cd15e.mjs → openai/openplanr/runtime/design/scripts/design-shared-artifact-support-protocol-contracts-9f6918b0.mjs} +537 -5
  159. package/lib/host-packages/openai/openplanr/runtime/design/scripts/design-shared-design-support-0bac378d.mjs +137 -0
  160. package/lib/host-packages/openai/openplanr/runtime/design/scripts/design.mjs +107 -37
  161. package/lib/host-packages/openai/openplanr/runtime/design/scripts/runtime/notices/THIRD_PARTY_NOTICES.txt +0 -27
  162. package/lib/host-packages/openai/openplanr/runtime/design/scripts/runtime/packages/artifact/templates/artifact-review-stage.js.sources/02-artifact-review-ui.js +138 -133
  163. package/lib/host-packages/openai/openplanr/runtime/design/scripts/runtime/packages/artifact/templates/artifact-review-stage.js.sources/03-protocol-contracts.js +1 -5684
  164. package/lib/host-packages/openai/openplanr/runtime/design/scripts/runtime/packages/artifact/templates/artifact-review-stage.js.sources/04-artifact-review-ui.js +2568 -0
  165. package/lib/host-packages/openai/openplanr/runtime/design/scripts/runtime/packages/artifact/templates/artifact-review-stage.js.sources.json +10 -74
  166. package/lib/host-packages/openai/openplanr/runtime/design/scripts/runtime/packages/design/package.json +3 -3
  167. package/lib/host-packages/openai/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/share.js +8 -2
  168. package/lib/host-packages/openai/openplanr/runtime/design/scripts/runtime/packages/protocol/package.json +5 -1
  169. package/lib/host-packages/openai/openplanr/runtime/plan/scripts/design-protocol-contracts.mjs +545 -4781
  170. package/lib/host-packages/openai/openplanr/runtime/plan/scripts/design.mjs +219 -452
  171. package/lib/host-packages/openai/openplanr/runtime/plan/scripts/runtime/packages/protocol/package.json +5 -1
  172. package/lib/host-packages/openai/openplanr/skills/delegate/SKILL.md +2 -1
  173. package/lib/host-packages/openai/openplanr/skills/delegate/openplanr.skill.json +1 -1
  174. package/lib/host-packages/openai/openplanr/skills/delegate/references/integration-review.md +26 -20
  175. package/lib/host-packages/openai/openplanr/skills/delegate/references/operator-guide.md +25 -1
  176. package/lib/host-packages/openai/openplanr/skills/delegate/references/run-handoff.md +2 -2
  177. package/lib/host-packages/openai/openplanr/skills/delegate/references/worktree-custody.md +17 -9
  178. package/lib/host-packages/openai/openplanr/skills/delegate/scripts/adapters/claude.mjs +15 -3
  179. package/lib/host-packages/openai/openplanr/skills/delegate/scripts/adapters/codex.mjs +38 -2
  180. package/lib/host-packages/openai/openplanr/skills/delegate/scripts/adapters/native.mjs +5 -0
  181. package/lib/host-packages/openai/openplanr/skills/delegate/scripts/custody.mjs +217 -10
  182. package/lib/host-packages/openai/openplanr/skills/delegate/scripts/handoff.mjs +1080 -0
  183. package/lib/host-packages/openai/openplanr/skills/delegate/scripts/integrate.mjs +96 -201
  184. package/lib/host-packages/openai/openplanr/skills/delegate/scripts/integration-files.mjs +3 -382
  185. package/lib/host-packages/openai/openplanr/skills/delegate/scripts/presentation.mjs +29 -12
  186. package/lib/host-packages/openai/openplanr/skills/delegate/scripts/run-contract.mjs +11 -0
  187. package/lib/host-packages/openai/openplanr/skills/delegate/scripts/run-execution.mjs +1 -1
  188. package/lib/host-packages/openai/openplanr/skills/delegate/scripts/run-lifecycle.mjs +14 -10
  189. package/lib/host-packages/openai/openplanr/skills/delegate/scripts/run-preparation.mjs +4 -0
  190. package/lib/host-packages/openai/openplanr/skills/delegate/scripts/run-record.mjs +2 -2
  191. package/lib/host-packages/openai/openplanr/skills/design/references/utilities.md +14 -8
  192. package/lib/host-packages/openai/openplanr/skills/design-loop/references/utilities.md +14 -8
  193. package/lib/host-packages/openai/openplanr/skills/design-review/references/utilities.md +14 -8
  194. package/lib/host-packages/openai/openplanr/skills/investigate/SKILL.md +1 -0
  195. package/lib/host-packages/openai/openplanr/skills/investigate/openplanr.skill.json +12 -1
  196. package/lib/host-packages/openai/openplanr/skills/investigate/references/fail-first.md +40 -0
  197. package/lib/host-packages/openai/openplanr/skills/ship/SKILL.md +22 -10
  198. package/lib/host-packages/openai/openplanr/skills/ship/openplanr.skill.json +12 -1
  199. package/lib/host-packages/openai/openplanr/skills/ship/references/fail-first.md +40 -0
  200. package/lib/host-packages/openai/openplanr/skills/ship/references/result-contract.md +7 -3
  201. package/package.json +8 -8
  202. package/dist/dashboard/assets/index-BU5fzjyz.css +0 -1
  203. package/dist/dashboard/assets/index-B_96uzCl.js +0 -572
  204. package/dist/dashboard/assets/index-B_96uzCl.js.map +0 -1
  205. package/lib/host-packages/claude/openplanr/runtime/design/scripts/design-chunked-workspace-client.mjs +0 -555
  206. package/lib/host-packages/claude/openplanr/runtime/design/scripts/design-compression.mjs +0 -4180
  207. package/lib/host-packages/claude/openplanr/runtime/design/scripts/design-encrypted-workspace-client.mjs +0 -647
  208. package/lib/host-packages/claude/openplanr/runtime/design/scripts/design-owner-custody.mjs +0 -129
  209. package/lib/host-packages/claude/openplanr/runtime/design/scripts/design-resource-pack.mjs +0 -698
  210. package/lib/host-packages/claude/openplanr/runtime/design/scripts/design-runtime-support-25485dbf1cb2.mjs +0 -24
  211. package/lib/host-packages/claude/openplanr/runtime/design/scripts/design-share.mjs +0 -1993
  212. package/lib/host-packages/claude/openplanr/runtime/design/scripts/design-shared-protocol-contracts-75a938cc.mjs +0 -222
  213. package/lib/host-packages/claude/openplanr/runtime/design/scripts/design-shared-protocol-contracts-b5f28f94.mjs +0 -5907
  214. package/lib/host-packages/claude/openplanr/runtime/design/scripts/design-upload-spool.mjs +0 -198
  215. package/lib/host-packages/claude/openplanr/runtime/design/scripts/runtime/packages/artifact/templates/artifact-review-stage.js.sources/04-compression.js +0 -4175
  216. package/lib/host-packages/claude/openplanr/runtime/design/scripts/runtime/packages/artifact/templates/artifact-review-stage.js.sources/05-artifact-sharing.js +0 -65
  217. package/lib/host-packages/claude/openplanr/runtime/design/scripts/runtime/packages/artifact/templates/artifact-review-stage.js.sources/06-artifact-review-ui.js +0 -1755
  218. package/lib/host-packages/claude/openplanr/runtime/design/scripts/runtime/packages/artifact/templates/artifact-review-stage.js.sources/07-artifact-sharing.js +0 -62
  219. package/lib/host-packages/claude/openplanr/runtime/design/scripts/runtime/packages/artifact/templates/artifact-review-stage.js.sources/08-artifact-review-ui.js +0 -2633
  220. package/lib/host-packages/claude/openplanr/runtime/design/scripts/runtime/packages/protocol/schemas/v1.1.0/artifact-paste.schema.json +0 -49
  221. package/lib/host-packages/claude/openplanr/runtime/design/scripts/runtime/packages/protocol/schemas/v1.9.0/design-review-workspace.schema.json +0 -108
  222. package/lib/host-packages/claude/openplanr/runtime/design/scripts/runtime/packages/protocol/schemas/v1.9.0/design-workspace-create.schema.json +0 -170
  223. package/lib/host-packages/claude/openplanr/runtime/design/scripts/runtime/packages/protocol/schemas/v1.9.0/design-workspace-event.schema.json +0 -97
  224. package/lib/host-packages/claude/openplanr/runtime/design/scripts/runtime/packages/protocol/schemas/v1.9.0/design-workspace-revision.schema.json +0 -56
  225. package/lib/host-packages/claude/openplanr/skills/delegate/scripts/integration-transaction.mjs +0 -958
  226. package/lib/host-packages/cursor/openplanr/rules/planr-delegate/scripts/integration-transaction.mjs +0 -958
  227. package/lib/host-packages/cursor/openplanr/runtime/design/scripts/design-chunked-workspace-client.mjs +0 -555
  228. package/lib/host-packages/cursor/openplanr/runtime/design/scripts/design-compression.mjs +0 -4180
  229. package/lib/host-packages/cursor/openplanr/runtime/design/scripts/design-encrypted-workspace-client.mjs +0 -647
  230. package/lib/host-packages/cursor/openplanr/runtime/design/scripts/design-owner-custody.mjs +0 -129
  231. package/lib/host-packages/cursor/openplanr/runtime/design/scripts/design-resource-pack.mjs +0 -698
  232. package/lib/host-packages/cursor/openplanr/runtime/design/scripts/design-runtime-support-25485dbf1cb2.mjs +0 -24
  233. package/lib/host-packages/cursor/openplanr/runtime/design/scripts/design-share.mjs +0 -1993
  234. package/lib/host-packages/cursor/openplanr/runtime/design/scripts/design-shared-protocol-contracts-75a938cc.mjs +0 -222
  235. package/lib/host-packages/cursor/openplanr/runtime/design/scripts/design-shared-protocol-contracts-b5f28f94.mjs +0 -5907
  236. package/lib/host-packages/cursor/openplanr/runtime/design/scripts/design-upload-spool.mjs +0 -198
  237. package/lib/host-packages/cursor/openplanr/runtime/design/scripts/runtime/packages/artifact/templates/artifact-review-stage.js.sources/04-compression.js +0 -4175
  238. package/lib/host-packages/cursor/openplanr/runtime/design/scripts/runtime/packages/artifact/templates/artifact-review-stage.js.sources/05-artifact-sharing.js +0 -65
  239. package/lib/host-packages/cursor/openplanr/runtime/design/scripts/runtime/packages/artifact/templates/artifact-review-stage.js.sources/06-artifact-review-ui.js +0 -1755
  240. package/lib/host-packages/cursor/openplanr/runtime/design/scripts/runtime/packages/artifact/templates/artifact-review-stage.js.sources/07-artifact-sharing.js +0 -62
  241. package/lib/host-packages/cursor/openplanr/runtime/design/scripts/runtime/packages/artifact/templates/artifact-review-stage.js.sources/08-artifact-review-ui.js +0 -2633
  242. package/lib/host-packages/cursor/openplanr/runtime/design/scripts/runtime/packages/protocol/schemas/v1.1.0/artifact-paste.schema.json +0 -49
  243. package/lib/host-packages/cursor/openplanr/runtime/design/scripts/runtime/packages/protocol/schemas/v1.9.0/design-review-workspace.schema.json +0 -108
  244. package/lib/host-packages/cursor/openplanr/runtime/design/scripts/runtime/packages/protocol/schemas/v1.9.0/design-workspace-create.schema.json +0 -170
  245. package/lib/host-packages/cursor/openplanr/runtime/design/scripts/runtime/packages/protocol/schemas/v1.9.0/design-workspace-event.schema.json +0 -97
  246. package/lib/host-packages/cursor/openplanr/runtime/design/scripts/runtime/packages/protocol/schemas/v1.9.0/design-workspace-revision.schema.json +0 -56
  247. package/lib/host-packages/openai/openplanr/runtime/design/scripts/design-chunked-workspace-client.mjs +0 -555
  248. package/lib/host-packages/openai/openplanr/runtime/design/scripts/design-compression.mjs +0 -4180
  249. package/lib/host-packages/openai/openplanr/runtime/design/scripts/design-encrypted-workspace-client.mjs +0 -647
  250. package/lib/host-packages/openai/openplanr/runtime/design/scripts/design-owner-custody.mjs +0 -129
  251. package/lib/host-packages/openai/openplanr/runtime/design/scripts/design-resource-pack.mjs +0 -698
  252. package/lib/host-packages/openai/openplanr/runtime/design/scripts/design-runtime-support-25485dbf1cb2.mjs +0 -24
  253. package/lib/host-packages/openai/openplanr/runtime/design/scripts/design-share.mjs +0 -1993
  254. package/lib/host-packages/openai/openplanr/runtime/design/scripts/design-shared-protocol-contracts-75a938cc.mjs +0 -222
  255. package/lib/host-packages/openai/openplanr/runtime/design/scripts/design-shared-protocol-contracts-b5f28f94.mjs +0 -5907
  256. package/lib/host-packages/openai/openplanr/runtime/design/scripts/design-upload-spool.mjs +0 -198
  257. package/lib/host-packages/openai/openplanr/runtime/design/scripts/runtime/packages/artifact/templates/artifact-review-stage.js.sources/04-compression.js +0 -4175
  258. package/lib/host-packages/openai/openplanr/runtime/design/scripts/runtime/packages/artifact/templates/artifact-review-stage.js.sources/05-artifact-sharing.js +0 -65
  259. package/lib/host-packages/openai/openplanr/runtime/design/scripts/runtime/packages/artifact/templates/artifact-review-stage.js.sources/06-artifact-review-ui.js +0 -1755
  260. package/lib/host-packages/openai/openplanr/runtime/design/scripts/runtime/packages/artifact/templates/artifact-review-stage.js.sources/07-artifact-sharing.js +0 -62
  261. package/lib/host-packages/openai/openplanr/runtime/design/scripts/runtime/packages/artifact/templates/artifact-review-stage.js.sources/08-artifact-review-ui.js +0 -2633
  262. package/lib/host-packages/openai/openplanr/runtime/design/scripts/runtime/packages/protocol/schemas/v1.1.0/artifact-paste.schema.json +0 -49
  263. package/lib/host-packages/openai/openplanr/runtime/design/scripts/runtime/packages/protocol/schemas/v1.9.0/design-review-workspace.schema.json +0 -108
  264. package/lib/host-packages/openai/openplanr/runtime/design/scripts/runtime/packages/protocol/schemas/v1.9.0/design-workspace-create.schema.json +0 -170
  265. package/lib/host-packages/openai/openplanr/runtime/design/scripts/runtime/packages/protocol/schemas/v1.9.0/design-workspace-event.schema.json +0 -97
  266. package/lib/host-packages/openai/openplanr/runtime/design/scripts/runtime/packages/protocol/schemas/v1.9.0/design-workspace-revision.schema.json +0 -56
  267. package/lib/host-packages/openai/openplanr/skills/delegate/scripts/integration-transaction.mjs +0 -958
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@openplanr/protocol",
3
- "version": "0.15.0",
3
+ "version": "0.16.0",
4
4
  "type": "module",
5
5
  "description": "Canonical OpenPlanr schemas, registries, typed errors, and portable contract validation",
6
6
  "license": "MIT",
@@ -108,6 +108,10 @@
108
108
  "types": "./src/large-object-contracts.d.mts",
109
109
  "import": "./src/large-object-contracts.mjs"
110
110
  },
111
+ "./large-object-limits": {
112
+ "types": "./src/large-object-limits.d.mts",
113
+ "import": "./src/large-object-limits.mjs"
114
+ },
111
115
  "./studio-presentation-contracts": {
112
116
  "types": "./src/studio-presentation-contracts.d.mts",
113
117
  "import": "./src/studio-presentation-contracts.mjs"
@@ -68,7 +68,8 @@ digest-acceptance step or permanently frozen setup baseline. See
68
68
 
69
69
  Use the returned pinned helper for subsequent actions. `dispatch`, bounded `wait`
70
70
  and `status` expose the exact session, native progress, inactivity and phase timings.
71
- Native tools, permissions, configuration and implementation loops remain native.
71
+ Native tools, permissions, configuration and implementation loops remain native, except
72
+ that Claude Code or Codex with no configured permission mode starts in its edit mode.
72
73
  Do not add bypass/force/yolo flags, blanket tool exclusions or silent model fallbacks.
73
74
  Local backend probes are compatibility diagnostics, not a separate execution policy.
74
75
  They read model metadata without submitting inference, loading models or sending
@@ -298,7 +298,7 @@
298
298
  "executable": false
299
299
  },
300
300
  {
301
- "path": "scripts/integration-transaction.mjs",
301
+ "path": "scripts/handoff.mjs",
302
302
  "kind": "script",
303
303
  "hosts": [
304
304
  "claude-code",
@@ -26,32 +26,38 @@ parent host's normal execution controls and configuration. They are not an OpenP
26
26
  OS sandbox. Arguments, exits, timings and bounded private failure diagnostics are
27
27
  saved separately from native-agent check claims.
28
28
 
29
- Verification normally runs in the prepared owned worktree. Ordinary ignored
30
- build/cache outputs are allowed. If preparation, a check or generation changes
31
- reviewable source/tests/configuration/generated files, the old review is invalid:
32
- inspect the updated candidate and review again before acceptance. If the source
33
- checkout makes the prepared tree stale, verification uses a fresh candidate only
34
- when needed, retaining the original native session/worktree.
29
+ `review` commits the worktree's non-ignored state as the run branch tip and reviews
30
+ `git diff base tip`. Verification runs in the owned worktree at that tip: checks see
31
+ HEAD plus the selected files plus the delegate's changes, not the parent checkout's
32
+ other uncommitted files, which the report lists. Ordinary ignored build/cache outputs
33
+ are allowed. If preparation, a check or generation changes reviewable
34
+ source/tests/configuration/generated files, the old review is invalid: inspect the
35
+ updated candidate and review again before acceptance.
35
36
 
36
37
  Failed checks keep the candidate blocked. `baselineComparison: true` explicitly
37
- requests a relevant failed-check comparison; it is diagnostic and cannot turn a
38
- failure into acceptance. Earlier attempt evidence remains private. Narrowing a
38
+ requests a relevant failed-check comparison in a temporary worktree at the base
39
+ commit; it is diagnostic and cannot turn a failure into acceptance. Dependencies are
40
+ not copied there, so include their setup in `preparation`. Earlier attempt evidence remains private. Narrowing a
39
41
  previously failed check set requires `checkSelectionReason`. With no applicable
40
42
  automated check, `reviewOnlyReason` allows explicitly unverified review-only
41
43
  integration; zero checks never produces a verified outcome.
42
44
 
43
45
  ## Checkout protection and recovery
44
46
 
45
- The integration lock, scope/Preserve checks, reviewed patch identity, destination
46
- compare-and-swap and recovery journal protect checkout writes. Concurrent user
47
- edits are never overwritten or rolled back. A source change during checks requires
48
- reviewing the actual candidate again. The journal records intended states before
49
- the first source write and recovery touches only helper-written paths that still
50
- match those states.
47
+ The per-repository lock, scope/Preserve checks and the reviewed tip protect checkout
48
+ writes. `apply` saves a restore point (`git stash create`) under the private ref
49
+ `refs/planr-delegate/<runId>/restore`, then runs `git apply --check` and `git apply`
50
+ with the saved `patch.diff`. A parent edit elsewhere in a changed file merges; an
51
+ overlapping parent edit blocks with its path and leaves the checkout untouched.
52
+ Concurrent user edits are never overwritten or rolled back.
51
53
 
52
- An interrupted source write must use `recover` with rollback (default) or accept
53
- after inspecting every journaled path. Keep conflicting user edits. Do not bypass
54
- a rejected helper by manually applying its patch.
54
+ If `git apply` fails without writing, for example after a parent save between its check
55
+ and the write, the run returns to review with the conflicting paths. An apply
56
+ interrupted between its check and completion must use `recover`, which compares each
57
+ patch path with its pre- and post-apply content. A fully applied patch can be accepted;
58
+ rollback (default) restores only paths that match their post-apply content and keeps
59
+ file permissions. Keep conflicting user edits. Do not bypass a rejected helper by manually applying
60
+ its patch.
55
61
 
56
62
  Successful native integration closes the exact run, saves evidence/report and
57
63
  removes only its owned worktree unless retained. `status` recovers the five-field
@@ -61,8 +67,8 @@ deployment are outside this helper.
61
67
  Experimental generic protocol-v1 adapters and older pinned helpers retain their
62
68
  original check interface and lifecycle; native v2 does not expand their permissions.
63
69
 
64
- Destination publication claims the existing directory entry and compares its bytes before exclusive creation of the replacement. Concurrent replacements block integration. Claimed originals remain in private write custody (Git metadata, or destination-local custody when volumes differ) for crash recovery and writers holding an old inode; conflicts report their retained paths. Rollback uses the same guard and cannot discard a changed claimed original.
70
+ ## Process custody and runs pinned to older helpers
65
71
 
66
- Candidate identity is checked across verification and acceptance; a changed owned worktree is retained instead of automatically removed. Guarded writes validate parent-directory identities as well as final entries. The parent host provides filesystem containment: these checks are conflict detection, not an OS sandbox against processes that deliberately rename ancestors between syscalls. Process custody stops the owned process group; intentionally detached services and processes outside that group remain the native harness/operator responsibility. Independent commands must finish their work before returning success.
72
+ Process custody stops the owned process group; intentionally detached services and processes outside that group remain the native harness/operator responsibility. Independent commands must finish their work before returning success. Cleanup checks that the owned worktree is still at the accepted tip after ownership reads, just before removal; a changed worktree is retained for inspection.
67
73
 
68
- Native interruption recovery validates the complete checkout against the journaled candidate identity before accepting saved verification. Cleanup validates accepted worktree contents after ownership reads, just before removal; an already absent owned worktree can still be unregistered. Concurrent editor saves detected at either boundary retain their files and require review or recovery.
74
+ A run prepared by an older helper, without a run branch, finishes review, apply and recovery through that pinned helper. The current helper refuses its custody instead of integrating it.
@@ -114,7 +114,31 @@ a GGUF filename or display label is not automatically its request ID. Apply an
114
114
  explicit model override only to this run through the existing native options;
115
115
  rewrite or enroll a saved profile only when the user requests it.
116
116
 
117
- If a native CLI uses read-only permissions for non-interactive runs, delegation reports attention rather than enabling writes. Resolve access in that CLI’s own configuration or explicitly authorized exact-session invocation, then continue the recorded session. Model summaries are never sufficient evidence of implementation.
117
+ When the CLI's own settings choose no permission mode, dispatch and resume start
118
+ Claude Code with `--permission-mode acceptEdits` and Codex with `--sandbox
119
+ workspace-write`, so a stock install can edit files in its worktree. In
120
+ `acceptEdits`, Claude also runs `mkdir`, `touch`, `rm`, `rmdir`, `mv`, `cp` and `sed`
121
+ without asking, for paths in the worktree and the added context directory. A
122
+ configured mode always wins: Claude `permissions.defaultMode` in user, project, local
123
+ or managed settings files, or Codex `sandbox_mode` in `config.toml` or the project's
124
+ `.codex/config.toml`, outside an inactive profile. Unreadable or oversized settings
125
+ count as configured. Cursor runs with `--trust`. Other shell commands still follow
126
+ the CLI's allowlist and approval settings, and no bypass flag is passed.
127
+
128
+ Limits of this check: it reads settings files only, so system or MDM-delivered
129
+ policies and Codex managed configuration are not seen. A Codex profile selected in
130
+ one file but defined in the other is not matched. A project-level Claude
131
+ `defaultMode`, including `"auto"`, counts as configured. The check runs again on each
132
+ `resume`, so a settings change between turns can change the flag.
133
+
134
+ If the CLI still denies an action, delegation
135
+ reports attention rather than widening access. Resolve access in that CLI’s own configuration or explicitly authorized exact-session invocation, then continue the recorded session. Model summaries are never sufficient evidence of implementation.
136
+
137
+ Cursor's CLI writes its own state back to `~/.cursor/cli-config.json` when a run
138
+ ends, so `permissions.allow` entries added while a run is active can be lost. Add
139
+ the commands the task needs (for example `Shell(pnpm)`) before `dispatch`. After an
140
+ `E_ADAPTER_PERMISSION` attention state, wait until the run has stopped, edit the
141
+ allowlist, then `resume` the same run.
118
142
 
119
143
  ## Diagnostics and unused runs
120
144
 
@@ -1,7 +1,7 @@
1
1
  # Run/session lifecycle
2
2
 
3
- Each new run has private v2 records, a complete readable capsule, one owned detached
4
- worktree and a pinned helper snapshot. Records contain configuration references,
3
+ Each new run has private v3 records, a complete readable capsule, one owned worktree
4
+ on its run branch and a pinned helper snapshot. Records contain configuration references,
5
5
  not credential values. Old runs route operations through their unchanged pinned
6
6
  helpers; there is no automatic migration or permission expansion.
7
7
 
@@ -1,13 +1,21 @@
1
1
  # Worktree and context custody
2
2
 
3
- One run owns one detached worktree outside the user's checkout. Copy only selected
4
- dirty state, preserving starting bytes, deletion and the Git executable bit. Full
5
- required ignored planning and repository instructions live in the readable capsule.
6
- The source checkout and unrelated worktrees remain independent.
3
+ One run owns one locked worktree on its own branch, `planr-delegate/<runId>`, outside
4
+ the user's checkout. Only selected dirty state is copied, preserving starting bytes,
5
+ deletion and the Git executable bit, then committed as the run's base commit without
6
+ repository hooks. Full required ignored planning and repository instructions live in
7
+ the readable capsule. The source checkout and unrelated worktrees remain independent.
7
8
 
8
- Custody records bind the run, worktree ownership, starting HEAD/index, selected
9
- source state and Preserve paths. Commits, staging, Preserve changes, scope violations
10
- and destination conflicts block acceptance. Integration scope constrains accepted
9
+ Custody records bind the run, worktree ownership, base commit, selected source state,
10
+ Preserve paths and the repository's refs. The delegate may commit; the run branch must
11
+ stay checked out and descend from its base. The branch checked out in the parent at
12
+ prepare may not be deleted or moved to a commit that contains the run's base, and a
13
+ restore ref may not be deleted while its run is still applying or interrupted. Any
14
+ other ref change, such as a branch switch, amend, reset, stash, fetch or tag, is a
15
+ report warning.
16
+ Preserve changes, scope violations, submodule (gitlink) changes, including ones that
17
+ `ignore` settings hide, and patches the parent
18
+ checkout no longer accepts block acceptance. Integration scope constrains accepted
11
19
  changes; it does not sandbox every native tool operation. Native tools, hooks,
12
20
  plugins and MCP run under the native harness's permissions and trusted configuration.
13
21
 
@@ -16,10 +24,10 @@ and join the candidate; no manual digest acceptance or immutable setup-path list
16
24
  needed. Ignored dependencies/build/cache outputs are ordinary worktree outputs.
17
25
 
18
26
  Successful native integration removes only the owned worktree by checking its
19
- ownership token and Git registration. Retention can be requested before dispatch.
27
+ ownership token and Git registration, then deletes its run branch. Retention can be requested before dispatch.
20
28
  Failures/interruption retain custody. The private run keeps context, accepted patch,
21
29
  verification evidence, report and exact native session reference after cleanup.
22
30
  Old runs continue through their pinned helper; never broaden their policy or migrate
23
31
  their records automatically.
24
32
 
25
- Guarded integration keeps original directory entries for recovery and for writers holding the old inode. If Git metadata is on a different filesystem, private ignored write custody stays beside the destination and its location is recorded in the Git metadata before the first source write. Recovery validates that location inside the checkout. Existing metadata-based custody and pinned legacy helpers remain readable.
33
+ Runs prepared by older helpers use detached worktrees and their own integration; they finish through that pinned helper.
@@ -5,9 +5,9 @@ import { capsuleDirectory } from './capsule.mjs';
5
5
  import { AdapterError, destinationFromEndpoint, invokeProcess } from './generic.mjs';
6
6
  import {
7
7
  createNativeProgress,
8
+ EDIT_DEFAULT_EXECUTION_POLICY,
8
9
  knownDestination,
9
10
  NATIVE_CAPABILITIES,
10
- NATIVE_EXECUTION_POLICY,
11
11
  nativeFailure,
12
12
  nativeObserver,
13
13
  nativeTurn,
@@ -26,7 +26,7 @@ function routingVariables(env) {
26
26
  );
27
27
  }
28
28
 
29
- // Keeps only routing variables from settings files; callers expose source labels and origins.
29
+ // Keeps routing variables and whether a default permission mode is set; callers expose source labels.
30
30
  async function readClaudeRoutingSettings(profile, env, cwd, options = {}) {
31
31
  const managedRoot =
32
32
  options.managedRoot ??
@@ -108,6 +108,7 @@ async function readClaudeRoutingSettings(profile, env, cwd, options = {}) {
108
108
  inspected.push({
109
109
  source,
110
110
  env: routingVariables(settings.env ?? {}),
111
+ ...(settings.permissions?.defaultMode !== undefined ? { defaultMode: true } : {}),
111
112
  ...(settings.policyHelper ? { opaqueRouting: true } : {}),
112
113
  });
113
114
  } catch (error) {
@@ -202,6 +203,16 @@ export async function resolveClaudeRouting(profile, env, cwd, options) {
202
203
  };
203
204
  }
204
205
 
206
+ // Edit access only when no settings file chooses a mode; unreadable settings count as chosen.
207
+ export async function claudeWriteFlags(profile, env, cwd, options) {
208
+ try {
209
+ const settings = await readClaudeRoutingSettings(profile, env, cwd, options);
210
+ return settings.some((entry) => entry.defaultMode) ? [] : ['--permission-mode', 'acceptEdits'];
211
+ } catch {
212
+ return [];
213
+ }
214
+ }
215
+
205
216
  export async function resolveClaudeDestination(profile, env, cwd) {
206
217
  return (await resolveClaudeRouting(profile, env, cwd)).destination;
207
218
  }
@@ -263,6 +274,7 @@ async function execute({
263
274
  profile.executable,
264
275
  [
265
276
  ...profile.argv,
277
+ ...(await claudeWriteFlags(profile, env, cwd)),
266
278
  '--print',
267
279
  '--output-format',
268
280
  'stream-json',
@@ -317,7 +329,7 @@ export const claudeAdapter = Object.freeze({
317
329
  return {
318
330
  capabilities: NATIVE_CAPABILITIES,
319
331
  ...routing,
320
- executionPolicy: NATIVE_EXECUTION_POLICY,
332
+ executionPolicy: EDIT_DEFAULT_EXECUTION_POLICY,
321
333
  };
322
334
  },
323
335
  run: execute,
@@ -1,11 +1,12 @@
1
+ import { readFile, stat } from 'node:fs/promises';
1
2
  import { join } from 'node:path';
2
3
  import { capsuleDirectory } from './capsule.mjs';
3
4
  import { AdapterError, invokeProcess } from './generic.mjs';
4
5
  import {
5
6
  createNativeProgress,
7
+ EDIT_DEFAULT_EXECUTION_POLICY,
6
8
  knownDestination,
7
9
  NATIVE_CAPABILITIES,
8
- NATIVE_EXECUTION_POLICY,
9
10
  nativeFailure,
10
11
  nativeObserver,
11
12
  nativeTurn,
@@ -31,6 +32,39 @@ export async function resolveCodexDestination(profile, env) {
31
32
  return knownDestination(endpoint);
32
33
  }
33
34
 
35
+ // Any uncommented sandbox_mode key outside an inactive [profiles.<name>] table counts as set.
36
+ function sandboxModeSet(config) {
37
+ const active = /^\s*profile\s*=\s*["']([^"']+)["']/mu.exec(config.split(/^\s*\[/mu)[0])?.[1];
38
+ let skipped = false;
39
+ for (const line of config.split('\n')) {
40
+ const header = /^\s*\[\s*profiles\.(?:"([^"]+)"|'([^']+)'|([A-Za-z0-9_-]+))\s*\]/u.exec(line);
41
+ if (header) skipped = (header[1] ?? header[2] ?? header[3]) !== active;
42
+ else if (/^\s*\[/u.test(line)) skipped = false;
43
+ if (!skipped && /^[^#]*\bsandbox_mode["']?\s*=/u.test(line)) return true;
44
+ }
45
+ return false;
46
+ }
47
+
48
+ // Missing config means no sandbox choice; unreadable or oversized config counts as a choice.
49
+ async function codexConfigChoosesSandbox(path) {
50
+ let config;
51
+ try {
52
+ if ((await stat(path)).size > 64 * 1024) return true;
53
+ config = await readFile(path, 'utf8');
54
+ } catch (error) {
55
+ return error.code !== 'ENOENT';
56
+ }
57
+ return sandboxModeSet(config);
58
+ }
59
+
60
+ // Workspace writes only when neither the user nor the project config chooses a sandbox.
61
+ export async function codexWriteFlags(profile, env, cwd) {
62
+ const home = profile.configDir || env.CODEX_HOME || join(env.HOME ?? '', '.codex');
63
+ for (const path of [join(home, 'config.toml'), join(cwd, '.codex', 'config.toml')])
64
+ if (await codexConfigChoosesSandbox(path)) return [];
65
+ return ['--sandbox', 'workspace-write'];
66
+ }
67
+
34
68
  async function execute({
35
69
  profile,
36
70
  cwd,
@@ -84,6 +118,8 @@ async function execute({
84
118
  const args = [
85
119
  ...profile.argv,
86
120
  'exec',
121
+ // `exec resume` takes no sandbox flag of its own; the parent `exec` flag applies.
122
+ ...(await codexWriteFlags(profile, env, cwd)),
87
123
  ...(sessionId ? ['resume'] : []),
88
124
  '--json',
89
125
  ...(!sessionId ? ['--add-dir', directory] : []),
@@ -141,7 +177,7 @@ export const codexAdapter = Object.freeze({
141
177
  return {
142
178
  capabilities: NATIVE_CAPABILITIES,
143
179
  destination: await resolveCodexDestination(profile, env),
144
- executionPolicy: NATIVE_EXECUTION_POLICY,
180
+ executionPolicy: EDIT_DEFAULT_EXECUTION_POLICY,
145
181
  };
146
182
  },
147
183
  run: execute,
@@ -20,6 +20,11 @@ export const NATIVE_EXECUTION_POLICY = Object.freeze({
20
20
  extensions:
21
21
  'Trusted native hooks, plugins and MCP may execute code or contact additional services. OpenPlanr does not sandbox these extensions.',
22
22
  });
23
+ // Claude Code and Codex start in their edit mode when native settings choose none.
24
+ export const EDIT_DEFAULT_EXECUTION_POLICY = Object.freeze({
25
+ ...NATIVE_EXECUTION_POLICY,
26
+ permissions: 'native-managed; edit mode when none is configured',
27
+ });
23
28
  export const NATIVE_MANAGED_DESTINATION = Object.freeze({
24
29
  class: 'native-managed',
25
30
  origin: 'native-managed',