oh-my-copilot 4.13.0 → 4.13.2

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 (420) hide show
  1. package/.claude-plugin/marketplace.json +2 -2
  2. package/.claude-plugin/plugin.json +1 -1
  3. package/README.md +2 -2
  4. package/agents/analyst.agent.md +2 -1
  5. package/agents/architect.agent.md +2 -1
  6. package/agents/code-reviewer.agent.md +2 -1
  7. package/agents/critic.agent.md +2 -1
  8. package/agents/debugger.agent.md +2 -1
  9. package/agents/designer.agent.md +2 -1
  10. package/agents/devils-advocate.agent.md +2 -1
  11. package/agents/document-specialist.agent.md +2 -1
  12. package/agents/executor.agent.md +2 -1
  13. package/agents/explore.agent.md +2 -1
  14. package/agents/git-master.agent.md +2 -1
  15. package/agents/planner.agent.md +2 -1
  16. package/agents/qa-tester.agent.md +2 -1
  17. package/agents/scientist.agent.md +2 -1
  18. package/agents/security-reviewer.agent.md +2 -1
  19. package/agents/test-engineer.agent.md +2 -1
  20. package/agents/verifier.agent.md +2 -1
  21. package/agents/writer.agent.md +2 -1
  22. package/bridge/cli.cjs +2823 -1491
  23. package/bridge/mcp-server.cjs +15 -2
  24. package/bridge/run-mcp-server.sh +1 -1
  25. package/bridge/runtime-cli.cjs +3589 -2448
  26. package/bridge/team-bridge.cjs +6 -4
  27. package/bridge/team-mcp.cjs +19607 -0
  28. package/bridge/team.js +3576 -2080
  29. package/dist/__tests__/auto-slash-aliases.test.js +5 -5
  30. package/dist/__tests__/auto-slash-aliases.test.js.map +1 -1
  31. package/dist/__tests__/bedrock-lm-suffix-hook.test.js +2 -2
  32. package/dist/__tests__/bedrock-lm-suffix-hook.test.js.map +1 -1
  33. package/dist/__tests__/cleanup-orphans-unref.test.d.ts +2 -0
  34. package/dist/__tests__/cleanup-orphans-unref.test.d.ts.map +1 -0
  35. package/dist/__tests__/cleanup-orphans-unref.test.js +44 -0
  36. package/dist/__tests__/cleanup-orphans-unref.test.js.map +1 -0
  37. package/dist/__tests__/context-safety.test.js +3 -3
  38. package/dist/__tests__/context-safety.test.js.map +1 -1
  39. package/dist/__tests__/hooks/learner/bridge.test.js +106 -0
  40. package/dist/__tests__/hooks/learner/bridge.test.js.map +1 -1
  41. package/dist/__tests__/hooks/learner/parser.test.js +30 -0
  42. package/dist/__tests__/hooks/learner/parser.test.js.map +1 -1
  43. package/dist/__tests__/hooks.test.js +47 -0
  44. package/dist/__tests__/hooks.test.js.map +1 -1
  45. package/dist/__tests__/hud/extra-usage.test.js +42 -0
  46. package/dist/__tests__/hud/extra-usage.test.js.map +1 -1
  47. package/dist/__tests__/hud/render-enterprise.test.d.ts +5 -0
  48. package/dist/__tests__/hud/render-enterprise.test.d.ts.map +1 -0
  49. package/dist/__tests__/hud/render-enterprise.test.js +232 -0
  50. package/dist/__tests__/hud/render-enterprise.test.js.map +1 -0
  51. package/dist/__tests__/hud/render-rate-limits-priority.test.js +159 -0
  52. package/dist/__tests__/hud/render-rate-limits-priority.test.js.map +1 -1
  53. package/dist/__tests__/hud/stdin-session-scope.test.d.ts +2 -0
  54. package/dist/__tests__/hud/stdin-session-scope.test.d.ts.map +1 -0
  55. package/dist/__tests__/hud/stdin-session-scope.test.js +169 -0
  56. package/dist/__tests__/hud/stdin-session-scope.test.js.map +1 -0
  57. package/dist/__tests__/hud/usage-api.test.js +111 -1
  58. package/dist/__tests__/hud/usage-api.test.js.map +1 -1
  59. package/dist/__tests__/issue-2652-runtime-wiring-and-output-contract.test.js +2 -0
  60. package/dist/__tests__/issue-2652-runtime-wiring-and-output-contract.test.js.map +1 -1
  61. package/dist/__tests__/keyword-detector-echo-guard.test.d.ts +2 -0
  62. package/dist/__tests__/keyword-detector-echo-guard.test.d.ts.map +1 -0
  63. package/dist/__tests__/keyword-detector-echo-guard.test.js +218 -0
  64. package/dist/__tests__/keyword-detector-echo-guard.test.js.map +1 -0
  65. package/dist/__tests__/keyword-detector-script.test.js +2 -1
  66. package/dist/__tests__/keyword-detector-script.test.js.map +1 -1
  67. package/dist/__tests__/omc-cli-rendering.test.js +13 -10
  68. package/dist/__tests__/omc-cli-rendering.test.js.map +1 -1
  69. package/dist/__tests__/pre-tool-enforcer.test.js +22 -38
  70. package/dist/__tests__/pre-tool-enforcer.test.js.map +1 -1
  71. package/dist/__tests__/preemptive-compaction-hook.test.js +63 -0
  72. package/dist/__tests__/preemptive-compaction-hook.test.js.map +1 -1
  73. package/dist/__tests__/safe-command-approver.test.d.ts +2 -0
  74. package/dist/__tests__/safe-command-approver.test.d.ts.map +1 -0
  75. package/dist/__tests__/safe-command-approver.test.js +103 -0
  76. package/dist/__tests__/safe-command-approver.test.js.map +1 -0
  77. package/dist/__tests__/skills.test.js +18 -0
  78. package/dist/__tests__/skills.test.js.map +1 -1
  79. package/dist/__tests__/state-root-resolution.test.js +64 -0
  80. package/dist/__tests__/state-root-resolution.test.js.map +1 -1
  81. package/dist/cli/__tests__/launch.test.js +24 -0
  82. package/dist/cli/__tests__/launch.test.js.map +1 -1
  83. package/dist/cli/__tests__/team-status-worktree.test.d.ts +2 -0
  84. package/dist/cli/__tests__/team-status-worktree.test.d.ts.map +1 -0
  85. package/dist/cli/__tests__/team-status-worktree.test.js +96 -0
  86. package/dist/cli/__tests__/team-status-worktree.test.js.map +1 -0
  87. package/dist/cli/__tests__/team.test.js +164 -0
  88. package/dist/cli/__tests__/team.test.js.map +1 -1
  89. package/dist/cli/__tests__/tmux-utils.test.js +18 -3
  90. package/dist/cli/__tests__/tmux-utils.test.js.map +1 -1
  91. package/dist/cli/autoresearch-setup-session.d.ts.map +1 -1
  92. package/dist/cli/autoresearch-setup-session.js +1 -0
  93. package/dist/cli/autoresearch-setup-session.js.map +1 -1
  94. package/dist/cli/commands/team.js +1 -1
  95. package/dist/cli/launch.d.ts.map +1 -1
  96. package/dist/cli/launch.js +10 -2
  97. package/dist/cli/launch.js.map +1 -1
  98. package/dist/cli/team.d.ts.map +1 -1
  99. package/dist/cli/team.js +103 -4
  100. package/dist/cli/team.js.map +1 -1
  101. package/dist/cli/tmux-utils.d.ts.map +1 -1
  102. package/dist/cli/tmux-utils.js +5 -2
  103. package/dist/cli/tmux-utils.js.map +1 -1
  104. package/dist/cli/utils/formatting.d.ts +0 -10
  105. package/dist/cli/utils/formatting.d.ts.map +1 -1
  106. package/dist/cli/utils/formatting.js +0 -52
  107. package/dist/cli/utils/formatting.js.map +1 -1
  108. package/dist/config/loader.d.ts.map +1 -1
  109. package/dist/config/loader.js +34 -8
  110. package/dist/config/loader.js.map +1 -1
  111. package/dist/features/__tests__/magic-keywords.test.d.ts +2 -0
  112. package/dist/features/__tests__/magic-keywords.test.d.ts.map +1 -0
  113. package/dist/features/__tests__/magic-keywords.test.js +19 -0
  114. package/dist/features/__tests__/magic-keywords.test.js.map +1 -0
  115. package/dist/features/delegation-enforcer.d.ts +2 -0
  116. package/dist/features/delegation-enforcer.d.ts.map +1 -1
  117. package/dist/features/delegation-enforcer.js +10 -0
  118. package/dist/features/delegation-enforcer.js.map +1 -1
  119. package/dist/features/magic-keywords.d.ts +1 -1
  120. package/dist/features/magic-keywords.d.ts.map +1 -1
  121. package/dist/features/magic-keywords.js +5 -192
  122. package/dist/features/magic-keywords.js.map +1 -1
  123. package/dist/hooks/__tests__/bridge-routing.test.js +23 -0
  124. package/dist/hooks/__tests__/bridge-routing.test.js.map +1 -1
  125. package/dist/hooks/bridge-normalize.d.ts +5 -0
  126. package/dist/hooks/bridge-normalize.d.ts.map +1 -1
  127. package/dist/hooks/bridge-normalize.js +6 -0
  128. package/dist/hooks/bridge-normalize.js.map +1 -1
  129. package/dist/hooks/bridge.d.ts +4 -0
  130. package/dist/hooks/bridge.d.ts.map +1 -1
  131. package/dist/hooks/bridge.js +60 -3
  132. package/dist/hooks/bridge.js.map +1 -1
  133. package/dist/hooks/keyword-detector/index.js +1 -1
  134. package/dist/hooks/keyword-detector/index.js.map +1 -1
  135. package/dist/hooks/keyword-detector/ultrawork/__tests__/index.test.d.ts +2 -0
  136. package/dist/hooks/keyword-detector/ultrawork/__tests__/index.test.d.ts.map +1 -0
  137. package/dist/hooks/keyword-detector/ultrawork/__tests__/index.test.js +37 -0
  138. package/dist/hooks/keyword-detector/ultrawork/__tests__/index.test.js.map +1 -0
  139. package/dist/hooks/keyword-detector/ultrawork/default.d.ts +3 -0
  140. package/dist/hooks/keyword-detector/ultrawork/default.d.ts.map +1 -0
  141. package/dist/hooks/keyword-detector/ultrawork/default.js +67 -0
  142. package/dist/hooks/keyword-detector/ultrawork/default.js.map +1 -0
  143. package/dist/hooks/keyword-detector/ultrawork/gemini.d.ts +3 -0
  144. package/dist/hooks/keyword-detector/ultrawork/gemini.d.ts.map +1 -0
  145. package/dist/hooks/keyword-detector/ultrawork/gemini.js +47 -0
  146. package/dist/hooks/keyword-detector/ultrawork/gemini.js.map +1 -0
  147. package/dist/hooks/keyword-detector/ultrawork/gpt.d.ts +3 -0
  148. package/dist/hooks/keyword-detector/ultrawork/gpt.d.ts.map +1 -0
  149. package/dist/hooks/keyword-detector/ultrawork/gpt.js +52 -0
  150. package/dist/hooks/keyword-detector/ultrawork/gpt.js.map +1 -0
  151. package/dist/hooks/keyword-detector/ultrawork/index.d.ts +8 -0
  152. package/dist/hooks/keyword-detector/ultrawork/index.d.ts.map +1 -0
  153. package/dist/hooks/keyword-detector/ultrawork/index.js +24 -0
  154. package/dist/hooks/keyword-detector/ultrawork/index.js.map +1 -0
  155. package/dist/hooks/keyword-detector/ultrawork/planner.d.ts +3 -0
  156. package/dist/hooks/keyword-detector/ultrawork/planner.d.ts.map +1 -0
  157. package/dist/hooks/keyword-detector/ultrawork/planner.js +57 -0
  158. package/dist/hooks/keyword-detector/ultrawork/planner.js.map +1 -0
  159. package/dist/hooks/keyword-detector/ultrawork/source-detector.d.ts +6 -0
  160. package/dist/hooks/keyword-detector/ultrawork/source-detector.d.ts.map +1 -0
  161. package/dist/hooks/keyword-detector/ultrawork/source-detector.js +37 -0
  162. package/dist/hooks/keyword-detector/ultrawork/source-detector.js.map +1 -0
  163. package/dist/hooks/learner/bridge.d.ts +2 -0
  164. package/dist/hooks/learner/bridge.d.ts.map +1 -1
  165. package/dist/hooks/learner/bridge.js +15 -109
  166. package/dist/hooks/learner/bridge.js.map +1 -1
  167. package/dist/hooks/learner/index.d.ts.map +1 -1
  168. package/dist/hooks/learner/index.js +51 -14
  169. package/dist/hooks/learner/index.js.map +1 -1
  170. package/dist/hooks/learner/parser.d.ts +9 -0
  171. package/dist/hooks/learner/parser.d.ts.map +1 -1
  172. package/dist/hooks/learner/parser.js +18 -5
  173. package/dist/hooks/learner/parser.js.map +1 -1
  174. package/dist/hooks/learner/types.d.ts +6 -0
  175. package/dist/hooks/learner/types.d.ts.map +1 -1
  176. package/dist/hooks/persistent-mode/index.d.ts.map +1 -1
  177. package/dist/hooks/persistent-mode/index.js +7 -4
  178. package/dist/hooks/persistent-mode/index.js.map +1 -1
  179. package/dist/hooks/persistent-mode/session-isolation.test.js +8 -3
  180. package/dist/hooks/persistent-mode/session-isolation.test.js.map +1 -1
  181. package/dist/hooks/persistent-mode/stop-hook-blocking.test.js +142 -7
  182. package/dist/hooks/persistent-mode/stop-hook-blocking.test.js.map +1 -1
  183. package/dist/hooks/project-memory/__tests__/learner.test.js +7 -0
  184. package/dist/hooks/project-memory/__tests__/learner.test.js.map +1 -1
  185. package/dist/hooks/project-memory/learner.d.ts +1 -1
  186. package/dist/hooks/project-memory/learner.d.ts.map +1 -1
  187. package/dist/hooks/project-memory/learner.js +3 -0
  188. package/dist/hooks/project-memory/learner.js.map +1 -1
  189. package/dist/hooks/session-end/index.d.ts.map +1 -1
  190. package/dist/hooks/session-end/index.js +43 -0
  191. package/dist/hooks/session-end/index.js.map +1 -1
  192. package/dist/hooks/skill-bridge.cjs +116 -87
  193. package/dist/hud/__tests__/enterprise-cost.test.d.ts +5 -0
  194. package/dist/hud/__tests__/enterprise-cost.test.d.ts.map +1 -0
  195. package/dist/hud/__tests__/enterprise-cost.test.js +151 -0
  196. package/dist/hud/__tests__/enterprise-cost.test.js.map +1 -0
  197. package/dist/hud/__tests__/usage-api-enterprise.test.d.ts +5 -0
  198. package/dist/hud/__tests__/usage-api-enterprise.test.d.ts.map +1 -0
  199. package/dist/hud/__tests__/usage-api-enterprise.test.js +249 -0
  200. package/dist/hud/__tests__/usage-api-enterprise.test.js.map +1 -0
  201. package/dist/hud/elements/enterprise-cost.d.ts +16 -0
  202. package/dist/hud/elements/enterprise-cost.d.ts.map +1 -0
  203. package/dist/hud/elements/enterprise-cost.js +63 -0
  204. package/dist/hud/elements/enterprise-cost.js.map +1 -0
  205. package/dist/hud/elements/permission.d.ts.map +1 -1
  206. package/dist/hud/elements/permission.js +2 -5
  207. package/dist/hud/elements/permission.js.map +1 -1
  208. package/dist/hud/elements/session.d.ts.map +1 -1
  209. package/dist/hud/elements/session.js +5 -9
  210. package/dist/hud/elements/session.js.map +1 -1
  211. package/dist/hud/index.d.ts.map +1 -1
  212. package/dist/hud/index.js +22 -5
  213. package/dist/hud/index.js.map +1 -1
  214. package/dist/hud/render.d.ts.map +1 -1
  215. package/dist/hud/render.js +34 -2
  216. package/dist/hud/render.js.map +1 -1
  217. package/dist/hud/stdin.d.ts.map +1 -1
  218. package/dist/hud/stdin.js +49 -5
  219. package/dist/hud/stdin.js.map +1 -1
  220. package/dist/hud/types.d.ts +16 -0
  221. package/dist/hud/types.d.ts.map +1 -1
  222. package/dist/hud/types.js +1 -1
  223. package/dist/hud/types.js.map +1 -1
  224. package/dist/hud/usage-api.d.ts +19 -1
  225. package/dist/hud/usage-api.d.ts.map +1 -1
  226. package/dist/hud/usage-api.js +101 -18
  227. package/dist/hud/usage-api.js.map +1 -1
  228. package/dist/installer/__tests__/hook-templates.test.js +23 -0
  229. package/dist/installer/__tests__/hook-templates.test.js.map +1 -1
  230. package/dist/installer/hooks.d.ts +4 -2
  231. package/dist/installer/hooks.d.ts.map +1 -1
  232. package/dist/installer/hooks.js +5 -94
  233. package/dist/installer/hooks.js.map +1 -1
  234. package/dist/installer/index.d.ts +1 -0
  235. package/dist/installer/index.d.ts.map +1 -1
  236. package/dist/installer/index.js +64 -24
  237. package/dist/installer/index.js.map +1 -1
  238. package/dist/installer/mcp-registry.d.ts.map +1 -1
  239. package/dist/installer/mcp-registry.js +3 -2
  240. package/dist/installer/mcp-registry.js.map +1 -1
  241. package/dist/mcp/__tests__/team-server-artifact-convergence.test.js +156 -4
  242. package/dist/mcp/__tests__/team-server-artifact-convergence.test.js.map +1 -1
  243. package/dist/mcp/omc-tools-server.d.ts +11 -17
  244. package/dist/mcp/omc-tools-server.d.ts.map +1 -1
  245. package/dist/mcp/omc-tools-server.js +22 -32
  246. package/dist/mcp/omc-tools-server.js.map +1 -1
  247. package/dist/mcp/team-job-convergence.d.ts +9 -2
  248. package/dist/mcp/team-job-convergence.d.ts.map +1 -1
  249. package/dist/mcp/team-job-convergence.js +35 -14
  250. package/dist/mcp/team-job-convergence.js.map +1 -1
  251. package/dist/mcp/team-server.d.ts.map +1 -1
  252. package/dist/mcp/team-server.js +93 -13
  253. package/dist/mcp/team-server.js.map +1 -1
  254. package/dist/ralphthon/prd.d.ts.map +1 -1
  255. package/dist/ralphthon/prd.js +13 -17
  256. package/dist/ralphthon/prd.js.map +1 -1
  257. package/dist/shared/types.d.ts +3 -1
  258. package/dist/shared/types.d.ts.map +1 -1
  259. package/dist/team/__tests__/api-interop.cleanup.test.d.ts +2 -0
  260. package/dist/team/__tests__/api-interop.cleanup.test.d.ts.map +1 -0
  261. package/dist/team/__tests__/api-interop.cleanup.test.js +234 -0
  262. package/dist/team/__tests__/api-interop.cleanup.test.js.map +1 -0
  263. package/dist/team/__tests__/api-interop.dispatch.test.js +2 -1
  264. package/dist/team/__tests__/api-interop.dispatch.test.js.map +1 -1
  265. package/dist/team/__tests__/git-worktree.test.js +164 -3
  266. package/dist/team/__tests__/git-worktree.test.js.map +1 -1
  267. package/dist/team/__tests__/model-contract.test.js +38 -22
  268. package/dist/team/__tests__/model-contract.test.js.map +1 -1
  269. package/dist/team/__tests__/resolved-routing-snapshot.test.js +29 -1
  270. package/dist/team/__tests__/resolved-routing-snapshot.test.js.map +1 -1
  271. package/dist/team/__tests__/runtime-cli.test.js +2 -2
  272. package/dist/team/__tests__/runtime-cli.test.js.map +1 -1
  273. package/dist/team/__tests__/runtime-prompt-mode.test.js +17 -17
  274. package/dist/team/__tests__/runtime-prompt-mode.test.js.map +1 -1
  275. package/dist/team/__tests__/runtime-v2-role-routing.test.js +7 -1
  276. package/dist/team/__tests__/runtime-v2-role-routing.test.js.map +1 -1
  277. package/dist/team/__tests__/runtime-v2.dispatch.test.js +145 -16
  278. package/dist/team/__tests__/runtime-v2.dispatch.test.js.map +1 -1
  279. package/dist/team/__tests__/runtime-v2.monitor.test.d.ts +2 -0
  280. package/dist/team/__tests__/runtime-v2.monitor.test.d.ts.map +1 -0
  281. package/dist/team/__tests__/runtime-v2.monitor.test.js +219 -0
  282. package/dist/team/__tests__/runtime-v2.monitor.test.js.map +1 -0
  283. package/dist/team/__tests__/runtime-v2.shutdown.test.d.ts +2 -0
  284. package/dist/team/__tests__/runtime-v2.shutdown.test.d.ts.map +1 -0
  285. package/dist/team/__tests__/runtime-v2.shutdown.test.js +292 -0
  286. package/dist/team/__tests__/runtime-v2.shutdown.test.js.map +1 -0
  287. package/dist/team/__tests__/scaling-launch-config.test.js +204 -4
  288. package/dist/team/__tests__/scaling-launch-config.test.js.map +1 -1
  289. package/dist/team/__tests__/stage-router.test.js +29 -1
  290. package/dist/team/__tests__/stage-router.test.js.map +1 -1
  291. package/dist/team/__tests__/team-summary-worktree.test.d.ts +2 -0
  292. package/dist/team/__tests__/team-summary-worktree.test.d.ts.map +1 -0
  293. package/dist/team/__tests__/team-summary-worktree.test.js +85 -0
  294. package/dist/team/__tests__/team-summary-worktree.test.js.map +1 -0
  295. package/dist/team/__tests__/tmux-session-liveness.test.d.ts +2 -0
  296. package/dist/team/__tests__/tmux-session-liveness.test.d.ts.map +1 -0
  297. package/dist/team/__tests__/tmux-session-liveness.test.js +37 -0
  298. package/dist/team/__tests__/tmux-session-liveness.test.js.map +1 -0
  299. package/dist/team/__tests__/worker-bootstrap.test.js +47 -1
  300. package/dist/team/__tests__/worker-bootstrap.test.js.map +1 -1
  301. package/dist/team/__tests__/worktree-contract-fields.test.d.ts +2 -0
  302. package/dist/team/__tests__/worktree-contract-fields.test.d.ts.map +1 -0
  303. package/dist/team/__tests__/worktree-contract-fields.test.js +157 -0
  304. package/dist/team/__tests__/worktree-contract-fields.test.js.map +1 -0
  305. package/dist/team/api-interop.d.ts +2 -1
  306. package/dist/team/api-interop.d.ts.map +1 -1
  307. package/dist/team/api-interop.js +121 -14
  308. package/dist/team/api-interop.js.map +1 -1
  309. package/dist/team/capabilities.d.ts.map +1 -1
  310. package/dist/team/capabilities.js +2 -0
  311. package/dist/team/capabilities.js.map +1 -1
  312. package/dist/team/cli-worker-contract.d.ts +7 -6
  313. package/dist/team/cli-worker-contract.d.ts.map +1 -1
  314. package/dist/team/cli-worker-contract.js +7 -6
  315. package/dist/team/cli-worker-contract.js.map +1 -1
  316. package/dist/team/events.d.ts +3 -0
  317. package/dist/team/events.d.ts.map +1 -1
  318. package/dist/team/events.js +2 -1
  319. package/dist/team/events.js.map +1 -1
  320. package/dist/team/git-worktree.d.ts +78 -10
  321. package/dist/team/git-worktree.d.ts.map +1 -1
  322. package/dist/team/git-worktree.js +453 -97
  323. package/dist/team/git-worktree.js.map +1 -1
  324. package/dist/team/governance.d.ts +3 -2
  325. package/dist/team/governance.d.ts.map +1 -1
  326. package/dist/team/governance.js.map +1 -1
  327. package/dist/team/model-contract.d.ts +18 -2
  328. package/dist/team/model-contract.d.ts.map +1 -1
  329. package/dist/team/model-contract.js +55 -27
  330. package/dist/team/model-contract.js.map +1 -1
  331. package/dist/team/monitor.d.ts.map +1 -1
  332. package/dist/team/monitor.js +47 -3
  333. package/dist/team/monitor.js.map +1 -1
  334. package/dist/team/runtime-v2.d.ts +9 -0
  335. package/dist/team/runtime-v2.d.ts.map +1 -1
  336. package/dist/team/runtime-v2.js +347 -120
  337. package/dist/team/runtime-v2.js.map +1 -1
  338. package/dist/team/runtime.d.ts.map +1 -1
  339. package/dist/team/runtime.js +4 -1
  340. package/dist/team/runtime.js.map +1 -1
  341. package/dist/team/scaling.d.ts.map +1 -1
  342. package/dist/team/scaling.js +110 -13
  343. package/dist/team/scaling.js.map +1 -1
  344. package/dist/team/state/tasks.d.ts.map +1 -1
  345. package/dist/team/state/tasks.js +1 -0
  346. package/dist/team/state/tasks.js.map +1 -1
  347. package/dist/team/team-ops.d.ts.map +1 -1
  348. package/dist/team/team-ops.js +112 -16
  349. package/dist/team/team-ops.js.map +1 -1
  350. package/dist/team/tmux-session.d.ts +17 -29
  351. package/dist/team/tmux-session.d.ts.map +1 -1
  352. package/dist/team/tmux-session.js +116 -107
  353. package/dist/team/tmux-session.js.map +1 -1
  354. package/dist/team/types.d.ts +31 -17
  355. package/dist/team/types.d.ts.map +1 -1
  356. package/dist/team/types.js.map +1 -1
  357. package/dist/team/worker-bootstrap.d.ts +7 -0
  358. package/dist/team/worker-bootstrap.d.ts.map +1 -1
  359. package/dist/team/worker-bootstrap.js +27 -13
  360. package/dist/team/worker-bootstrap.js.map +1 -1
  361. package/dist/team/worker-canonicalization.d.ts.map +1 -1
  362. package/dist/team/worker-canonicalization.js +2 -0
  363. package/dist/team/worker-canonicalization.js.map +1 -1
  364. package/dist/utils/frontmatter.d.ts.map +1 -1
  365. package/dist/utils/frontmatter.js +1 -16
  366. package/dist/utils/frontmatter.js.map +1 -1
  367. package/dist/utils/omc-cli-rendering.d.ts.map +1 -1
  368. package/dist/utils/omc-cli-rendering.js +1 -12
  369. package/dist/utils/omc-cli-rendering.js.map +1 -1
  370. package/dist/utils/resolve-node.d.ts.map +1 -1
  371. package/dist/utils/resolve-node.js +22 -28
  372. package/dist/utils/resolve-node.js.map +1 -1
  373. package/docs/MIGRATION.md +1003 -0
  374. package/docs/REFERENCE.md +4 -0
  375. package/docs/TEAM-WORKTREE-MODE.md +86 -0
  376. package/docs/copilot-instructions.md +1 -1
  377. package/docs/reference/compatibility.md +1 -1
  378. package/hooks/hooks.json +34 -13
  379. package/package.json +1 -1
  380. package/scripts/cleanup-orphans.mjs +24 -3
  381. package/scripts/context-safety.mjs +10 -11
  382. package/scripts/keyword-detector.debug.mjs +2 -2
  383. package/scripts/keyword-detector.mjs +219 -57
  384. package/scripts/lib/state-root.cjs +1 -1
  385. package/scripts/lib/state-root.mjs +3 -3
  386. package/scripts/persistent-mode.cjs +30 -4
  387. package/scripts/persistent-mode.mjs +28 -2
  388. package/scripts/plugin-setup.mjs +8 -7
  389. package/scripts/post-tool-rules-injector.mjs +1 -1
  390. package/scripts/post-tool-verifier.mjs +55 -3
  391. package/scripts/pre-tool-enforcer.mjs +9 -21
  392. package/scripts/project-memory-session.mjs +1 -1
  393. package/scripts/run.cjs +9 -9
  394. package/scripts/safe-command-approver.mjs +156 -0
  395. package/scripts/session-start.mjs +91 -11
  396. package/scripts/setup-copilot-instructions.sh +5 -4
  397. package/scripts/skill-injector.mjs +60 -23
  398. package/scripts/test-pr25.sh +1 -1
  399. package/scripts/uninstall.sh +1 -1
  400. package/scripts/verify-deliverables.mjs +1 -1
  401. package/skills/deep-interview/SKILL.md +23 -10
  402. package/skills/learner/SKILL.md +1 -1
  403. package/skills/project-session-manager/lib/config.sh +1 -1
  404. package/skills/project-session-manager/lib/parse.sh +1 -1
  405. package/skills/project-session-manager/lib/providers/azure-devops.sh +1 -1
  406. package/skills/project-session-manager/lib/providers/bitbucket.sh +1 -1
  407. package/skills/project-session-manager/lib/providers/gitea.sh +1 -1
  408. package/skills/project-session-manager/lib/providers/github.sh +1 -1
  409. package/skills/project-session-manager/lib/providers/gitlab.sh +1 -1
  410. package/skills/project-session-manager/lib/providers/interface.sh +1 -1
  411. package/skills/project-session-manager/lib/providers/jira.sh +1 -1
  412. package/skills/project-session-manager/lib/session.sh +1 -1
  413. package/skills/project-session-manager/lib/tmux.sh +1 -1
  414. package/skills/project-session-manager/lib/worktree.sh +1 -1
  415. package/skills/project-session-manager/psm.sh +1 -1
  416. package/skills/project-session-manager/tests/test-psm-prompt-injection.sh +1 -1
  417. package/skills/skill/SKILL.md +1 -1
  418. package/templates/hooks/keyword-detector.mjs +183 -26
  419. package/templates/hooks/persistent-mode.mjs +28 -2
  420. package/templates/hooks/session-start.mjs +126 -11
package/docs/REFERENCE.md CHANGED
@@ -192,10 +192,14 @@ name: architect
192
192
  description: Your custom description
193
193
  tools: Read, Grep, Glob, Bash, Edit
194
194
  model: opus # or sonnet, haiku
195
+ # Optional: effort inherits from the parent Copilot CLI session unless you add an explicit override.
196
+ # effort: high
195
197
  ---
196
198
  Your custom system prompt here...
197
199
  ```
198
200
 
201
+ Bundled OMC agent prompts currently do **not** ship an `effort:` frontmatter field. Any effort language inside `agents/*.md` is behavioral guidance for the prompt body, while runtime effort inherits from the parent Copilot CLI session unless the agent markdown explicitly declares an override.
202
+
199
203
  ### Project-Level Config
200
204
 
201
205
  Create `.claude/CLAUDE.md` in your project for project-specific instructions:
@@ -0,0 +1,86 @@
1
+ # Native Team Worktree Mode
2
+
3
+ Native team worktree mode is the opt-in rollout path for running `omc team` workers in dedicated git worktrees while keeping one leader-owned team-specific coordination root. It is intended for runtime-v2 team sessions and is designed to make worker edits isolated without fragmenting task, mailbox, status, or manifest state.
4
+
5
+ ## Availability
6
+
7
+ - The rollout is **opt-in / config-gated** for the first slice. Do not assume worktree mode is the default behavior.
8
+ - The target runtime is `runtime-v2`. Legacy `runtime.ts` remains limited to read/status and cleanup compatibility unless a later plan explicitly expands it.
9
+ - No new dependency is required; lifecycle operations use git worktrees plus the existing team CLI/API surfaces.
10
+
11
+ ## Workspace contract
12
+
13
+ When worktree mode is active, OMC uses this stable layout:
14
+
15
+ | Field | Contract |
16
+ | --- | --- |
17
+ | Worktree root | `<repo>/.omc/team/<team-name>/worktrees/<worker-name>` |
18
+ | Team-specific coordination root | `<repo>/.omc/state/team/<team-name>` in the leader workspace |
19
+ | Worker cwd | The worker's `worktree_path` |
20
+ | Worker coordination | `OMC_TEAM_STATE_ROOT` points back to the team-specific leader-owned coordination root |
21
+ | Worker instructions | Worktree-root `AGENTS.md` is installed with backup/restore safeguards |
22
+
23
+ Workers must keep using `omc team api ...` lifecycle and mailbox operations against the team-specific coordination root. They must not create or mutate a separate local `.omc/state` inside their worker worktree when `OMC_TEAM_STATE_ROOT` is available; for worktree-backed workers it should point at `<repo>/.omc/state/team/<team-name>`.
24
+
25
+ ## Persisted fields
26
+
27
+ Config, manifest, worker identity, and status surfaces should expose the same locked field set so resume/status/bootstrap paths can reason about worker location without inference:
28
+
29
+ - `workspace_mode`
30
+ - `worktree_mode`
31
+ - `team_state_root`
32
+ - `working_dir`
33
+ - `worktree_repo_root`
34
+ - `worktree_path`
35
+ - `worktree_branch`
36
+ - `worktree_detached`
37
+ - `worktree_created`
38
+
39
+ `workspace_mode` should be `worktree` for worktree-backed sessions and `single` for the existing shared-workspace behavior. `team_state_root` means the team-specific coordination root (`<repo>/.omc/state/team/<team-name>`); if a future feature needs the broader `.omc/state` base, use a separately named field such as `state_base_root`.
40
+
41
+ ## Safety rules
42
+
43
+ - OMC must check the leader workspace before provisioning worktrees. If the leader repo is dirty, startup should refuse worktree provisioning rather than copying an unsafe base state.
44
+ - Existing compatible clean worker worktrees may be reused.
45
+ - Dirty worker worktrees must be preserved and surfaced as warnings/events. Cleanup must not force-remove dirty worker edits.
46
+ - Branch/path mismatches should fail instead of reusing the wrong workspace.
47
+ - Rollback may remove newly created clean worktrees and runtime-created branches when safe; reused worktrees are preserved.
48
+ - `orphan-cleanup` is a destructive escape hatch that may delete worktree recovery metadata and root `AGENTS.md` backups. When that evidence exists, callers must pass `acknowledge_lost_worktree_recovery: true` only after manually preserving or intentionally discarding the affected worker worktrees/backups.
49
+
50
+ ## CLI and status expectations
51
+
52
+ `omc team status <team-name> --json` should make the workspace contract observable. JSON consumers should be able to find `workspace_mode`, `worktree_mode`, `team_state_root`, and each worker's worktree metadata without reading private files directly.
53
+
54
+ Human status output should also surface the mode and worktree path/branch details enough for users to understand where worker changes live and whether cleanup preserved a dirty worktree.
55
+
56
+ ## Verification checklist for changes
57
+
58
+ Use the source PRD/test-spec checklist when modifying this area. At minimum, changes should cover:
59
+
60
+ 1. Worktree planning disabled/no-op and active path modes.
61
+ 2. Fresh, reused, dirty, and mismatched worktree lifecycle cases.
62
+ 3. Runtime-v2 startup/spawn state: worker cwd, env, config, manifest, and identity all agree.
63
+ 4. Bootstrap prompts and trigger paths use `$OMC_TEAM_STATE_ROOT` for worktree-backed workers.
64
+ 5. Scale-up workers inherit the same team-specific coordination root and worktree instruction strategy.
65
+ 6. Shutdown/cleanup removes safe clean worktrees, preserves dirty ones, and reports warnings.
66
+ 7. CLI help/status tests cover the opt-in rollout and locked status field set.
67
+
68
+ Recommended focused commands:
69
+
70
+ ```bash
71
+ npm test -- --run src/team/__tests__/git-worktree.test.ts
72
+ npm test -- --run src/team/__tests__/worker-bootstrap.test.ts
73
+ npm test -- --run src/team/__tests__/runtime-v2.dispatch.test.ts
74
+ npm test -- --run src/team/__tests__/runtime-v2.shutdown.test.ts
75
+ npm test -- --run src/team/__tests__/api-interop.dispatch.test.ts
76
+ npm test -- --run src/team/__tests__/api-interop.cwd-resolution.test.ts
77
+ npm test -- --run src/team/__tests__/scaling-launch-config.test.ts
78
+ npm test -- --run src/cli/__tests__/team-runtime-boundary.test.ts
79
+ npm run build
80
+ ```
81
+
82
+ ## Review notes
83
+
84
+ - Keep the first slice narrow: runtime-v2 startup/spawn/dispatch/scale-up/resume/status/shutdown/cleanup plus legacy read/cleanup compatibility.
85
+ - Do not reduce scope by omitting status visibility, dirty-worktree preservation, or team-specific coordination-root behavior; those are part of the locked contract.
86
+ - Prefer explicit persisted fields over reconstructing worktree state from paths or branch names.
@@ -1,5 +1,5 @@
1
1
  <!-- OMC:START -->
2
- <!-- OMC:VERSION:4.13.0 -->
2
+ <!-- OMC:VERSION:4.13.2 -->
3
3
 
4
4
  # oh-my-copilot - Intelligent Multi-Agent Orchestration
5
5
 
@@ -180,7 +180,7 @@ tags: tag1, tag2
180
180
  Skill documentation here...
181
181
  ```
182
182
 
183
- **Agents** are discovered from `.md` files in the agents directory with similar frontmatter structure.
183
+ **Agents** are discovered from `.md` files in the agents directory with similar frontmatter structure. Supported runtime fields depend on Copilot CLI; OMC's bundled agent files currently rely on `name`, `description`, `model`, optional tool restrictions, and prompt body guidance. They do not currently ship an `effort:` frontmatter override, so effort inherits from the parent Copilot CLI session unless a custom agent explicitly adds one.
184
184
 
185
185
  ## MCP Server Discovery
186
186
 
package/hooks/hooks.json CHANGED
@@ -1,16 +1,17 @@
1
1
  {
2
2
  "version": 1,
3
- "description": "OMC orchestration hooks with async capabilities",
4
3
  "hooks": {
5
4
  "userPromptSubmitted": [
6
5
  {
7
6
  "type": "command",
8
7
  "bash": "node \"${PLUGIN_ROOT}/scripts/run.cjs\" \"${PLUGIN_ROOT}/scripts/keyword-detector.mjs\"",
8
+ "powershell": "node \"${PLUGIN_ROOT}/scripts/run.cjs\" \"${PLUGIN_ROOT}/scripts/keyword-detector.mjs\"",
9
9
  "timeoutSec": 5
10
10
  },
11
11
  {
12
12
  "type": "command",
13
13
  "bash": "node \"${PLUGIN_ROOT}/scripts/run.cjs\" \"${PLUGIN_ROOT}/scripts/skill-injector.mjs\"",
14
+ "powershell": "node \"${PLUGIN_ROOT}/scripts/run.cjs\" \"${PLUGIN_ROOT}/scripts/skill-injector.mjs\"",
14
15
  "timeoutSec": 3
15
16
  }
16
17
  ],
@@ -18,26 +19,31 @@
18
19
  {
19
20
  "type": "command",
20
21
  "bash": "node \"${PLUGIN_ROOT}/scripts/run.cjs\" \"${PLUGIN_ROOT}/scripts/session-start.mjs\"",
22
+ "powershell": "node \"${PLUGIN_ROOT}/scripts/run.cjs\" \"${PLUGIN_ROOT}/scripts/session-start.mjs\"",
21
23
  "timeoutSec": 5
22
24
  },
23
25
  {
24
26
  "type": "command",
25
27
  "bash": "node \"${PLUGIN_ROOT}/scripts/run.cjs\" \"${PLUGIN_ROOT}/scripts/project-memory-session.mjs\"",
28
+ "powershell": "node \"${PLUGIN_ROOT}/scripts/run.cjs\" \"${PLUGIN_ROOT}/scripts/project-memory-session.mjs\"",
26
29
  "timeoutSec": 5
27
30
  },
28
31
  {
29
32
  "type": "command",
30
33
  "bash": "node \"${PLUGIN_ROOT}/scripts/run.cjs\" \"${PLUGIN_ROOT}/scripts/wiki-session-start.mjs\"",
34
+ "powershell": "node \"${PLUGIN_ROOT}/scripts/run.cjs\" \"${PLUGIN_ROOT}/scripts/wiki-session-start.mjs\"",
31
35
  "timeoutSec": 5
32
36
  },
33
37
  {
34
38
  "type": "command",
35
39
  "bash": "node \"${PLUGIN_ROOT}/scripts/run.cjs\" \"${PLUGIN_ROOT}/scripts/setup-init.mjs\"",
40
+ "powershell": "node \"${PLUGIN_ROOT}/scripts/run.cjs\" \"${PLUGIN_ROOT}/scripts/setup-init.mjs\"",
36
41
  "timeoutSec": 30
37
42
  },
38
43
  {
39
44
  "type": "command",
40
45
  "bash": "node \"${PLUGIN_ROOT}/scripts/run.cjs\" \"${PLUGIN_ROOT}/scripts/setup-maintenance.mjs\"",
46
+ "powershell": "node \"${PLUGIN_ROOT}/scripts/run.cjs\" \"${PLUGIN_ROOT}/scripts/setup-maintenance.mjs\"",
41
47
  "timeoutSec": 60
42
48
  }
43
49
  ],
@@ -45,16 +51,25 @@
45
51
  {
46
52
  "type": "command",
47
53
  "bash": "node \"${PLUGIN_ROOT}/scripts/run.cjs\" \"${PLUGIN_ROOT}/scripts/subagent-tracker.mjs\" start",
54
+ "powershell": "node \"${PLUGIN_ROOT}/scripts/run.cjs\" \"${PLUGIN_ROOT}/scripts/subagent-tracker.mjs\" start",
55
+ "timeoutSec": 3
56
+ },
57
+ {
58
+ "type": "command",
59
+ "bash": "node \"${PLUGIN_ROOT}/scripts/run.cjs\" \"${PLUGIN_ROOT}/scripts/safe-command-approver.mjs\"",
60
+ "powershell": "node \"${PLUGIN_ROOT}/scripts/run.cjs\" \"${PLUGIN_ROOT}/scripts/safe-command-approver.mjs\"",
48
61
  "timeoutSec": 3
49
62
  },
50
63
  {
51
64
  "type": "command",
52
65
  "bash": "node \"${PLUGIN_ROOT}/scripts/run.cjs\" \"${PLUGIN_ROOT}/scripts/pre-tool-enforcer.mjs\"",
66
+ "powershell": "node \"${PLUGIN_ROOT}/scripts/run.cjs\" \"${PLUGIN_ROOT}/scripts/pre-tool-enforcer.mjs\"",
53
67
  "timeoutSec": 3
54
68
  },
55
69
  {
56
70
  "type": "command",
57
71
  "bash": "node \"${PLUGIN_ROOT}/scripts/run.cjs\" \"${PLUGIN_ROOT}/scripts/context-safety.mjs\"",
72
+ "powershell": "node \"${PLUGIN_ROOT}/scripts/run.cjs\" \"${PLUGIN_ROOT}/scripts/context-safety.mjs\"",
58
73
  "timeoutSec": 3
59
74
  }
60
75
  ],
@@ -62,11 +77,13 @@
62
77
  {
63
78
  "type": "command",
64
79
  "bash": "node \"${PLUGIN_ROOT}/scripts/run.cjs\" \"${PLUGIN_ROOT}/scripts/post-tool-verifier.mjs\"",
80
+ "powershell": "node \"${PLUGIN_ROOT}/scripts/run.cjs\" \"${PLUGIN_ROOT}/scripts/post-tool-verifier.mjs\"",
65
81
  "timeoutSec": 3
66
82
  },
67
83
  {
68
84
  "type": "command",
69
85
  "bash": "node \"${PLUGIN_ROOT}/scripts/run.cjs\" \"${PLUGIN_ROOT}/scripts/project-memory-posttool.mjs\"",
86
+ "powershell": "node \"${PLUGIN_ROOT}/scripts/run.cjs\" \"${PLUGIN_ROOT}/scripts/project-memory-posttool.mjs\"",
70
87
  "timeoutSec": 3
71
88
  }
72
89
  ],
@@ -74,6 +91,7 @@
74
91
  {
75
92
  "type": "command",
76
93
  "bash": "node \"${PLUGIN_ROOT}/scripts/run.cjs\" \"${PLUGIN_ROOT}/scripts/post-tool-use-failure.mjs\"",
94
+ "powershell": "node \"${PLUGIN_ROOT}/scripts/run.cjs\" \"${PLUGIN_ROOT}/scripts/post-tool-use-failure.mjs\"",
77
95
  "timeoutSec": 3
78
96
  }
79
97
  ],
@@ -81,11 +99,13 @@
81
99
  {
82
100
  "type": "command",
83
101
  "bash": "node \"${PLUGIN_ROOT}/scripts/run.cjs\" \"${PLUGIN_ROOT}/scripts/subagent-tracker.mjs\" stop",
102
+ "powershell": "node \"${PLUGIN_ROOT}/scripts/run.cjs\" \"${PLUGIN_ROOT}/scripts/subagent-tracker.mjs\" stop",
84
103
  "timeoutSec": 5
85
104
  },
86
105
  {
87
106
  "type": "command",
88
107
  "bash": "node \"${PLUGIN_ROOT}/scripts/run.cjs\" \"${PLUGIN_ROOT}/scripts/verify-deliverables.mjs\"",
108
+ "powershell": "node \"${PLUGIN_ROOT}/scripts/run.cjs\" \"${PLUGIN_ROOT}/scripts/verify-deliverables.mjs\"",
89
109
  "timeoutSec": 5
90
110
  }
91
111
  ],
@@ -93,52 +113,53 @@
93
113
  {
94
114
  "type": "command",
95
115
  "bash": "node \"${PLUGIN_ROOT}/scripts/run.cjs\" \"${PLUGIN_ROOT}/scripts/pre-compact.mjs\"",
96
- "timeoutSec": 10
116
+ "powershell": "node \"${PLUGIN_ROOT}/scripts/run.cjs\" \"${PLUGIN_ROOT}/scripts/pre-compact.mjs\"",
117
+ "timeoutSec": 5
97
118
  },
98
119
  {
99
120
  "type": "command",
100
121
  "bash": "node \"${PLUGIN_ROOT}/scripts/run.cjs\" \"${PLUGIN_ROOT}/scripts/project-memory-precompact.mjs\"",
101
- "timeoutSec": 5
122
+ "powershell": "node \"${PLUGIN_ROOT}/scripts/run.cjs\" \"${PLUGIN_ROOT}/scripts/project-memory-precompact.mjs\"",
123
+ "timeoutSec": 3
102
124
  },
103
125
  {
104
126
  "type": "command",
105
127
  "bash": "node \"${PLUGIN_ROOT}/scripts/run.cjs\" \"${PLUGIN_ROOT}/scripts/wiki-pre-compact.mjs\"",
128
+ "powershell": "node \"${PLUGIN_ROOT}/scripts/run.cjs\" \"${PLUGIN_ROOT}/scripts/wiki-pre-compact.mjs\"",
106
129
  "timeoutSec": 3
107
130
  },
108
131
  {
109
132
  "type": "command",
110
133
  "bash": "node \"${PLUGIN_ROOT}/scripts/run.cjs\" \"${PLUGIN_ROOT}/scripts/context-guard-stop.mjs\"",
111
- "timeoutSec": 5
134
+ "powershell": "node \"${PLUGIN_ROOT}/scripts/run.cjs\" \"${PLUGIN_ROOT}/scripts/context-guard-stop.mjs\"",
135
+ "timeoutSec": 3
112
136
  },
113
137
  {
114
138
  "type": "command",
115
139
  "bash": "node \"${PLUGIN_ROOT}/scripts/run.cjs\" \"${PLUGIN_ROOT}/scripts/persistent-mode.cjs\"",
116
- "timeoutSec": 10
140
+ "powershell": "node \"${PLUGIN_ROOT}/scripts/run.cjs\" \"${PLUGIN_ROOT}/scripts/persistent-mode.cjs\"",
141
+ "timeoutSec": 5
117
142
  },
118
143
  {
119
144
  "type": "command",
120
145
  "bash": "node \"${PLUGIN_ROOT}/scripts/run.cjs\" \"${PLUGIN_ROOT}/scripts/code-simplifier.mjs\"",
121
- "timeoutSec": 5
146
+ "powershell": "node \"${PLUGIN_ROOT}/scripts/run.cjs\" \"${PLUGIN_ROOT}/scripts/code-simplifier.mjs\"",
147
+ "timeoutSec": 3
122
148
  }
123
149
  ],
124
150
  "sessionEnd": [
125
151
  {
126
152
  "type": "command",
127
153
  "bash": "node \"${PLUGIN_ROOT}/scripts/run.cjs\" \"${PLUGIN_ROOT}/scripts/session-end.mjs\"",
154
+ "powershell": "node \"${PLUGIN_ROOT}/scripts/run.cjs\" \"${PLUGIN_ROOT}/scripts/session-end.mjs\"",
128
155
  "timeoutSec": 10
129
156
  },
130
157
  {
131
158
  "type": "command",
132
159
  "bash": "node \"${PLUGIN_ROOT}/scripts/run.cjs\" \"${PLUGIN_ROOT}/scripts/wiki-session-end.mjs\"",
160
+ "powershell": "node \"${PLUGIN_ROOT}/scripts/run.cjs\" \"${PLUGIN_ROOT}/scripts/wiki-session-end.mjs\"",
133
161
  "timeoutSec": 30
134
162
  }
135
- ],
136
- "permissionRequest": [
137
- {
138
- "type": "command",
139
- "bash": "node \"${PLUGIN_ROOT}/scripts/run.cjs\" \"${PLUGIN_ROOT}/scripts/permission-handler.mjs\"",
140
- "timeoutSec": 3
141
- }
142
163
  ]
143
164
  }
144
165
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "oh-my-copilot",
3
- "version": "4.13.0",
3
+ "version": "4.13.2",
4
4
  "description": "Multi-agent orchestration system for Copilot CLI - Inspired by oh-my-opencode",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -127,7 +127,21 @@ function teamConfigExists(name) {
127
127
  }
128
128
 
129
129
  /**
130
- * Kill a process: SIGTERM first, SIGKILL after 5s if still alive.
130
+ * Kill a process.
131
+ *
132
+ * On Windows: `taskkill /F` terminates synchronously.
133
+ *
134
+ * On Unix: issue SIGTERM for graceful exit. A best-effort SIGKILL escalation
135
+ * is scheduled 5s later, but the timer is `.unref()`ed so it does not block
136
+ * the Node event loop — main() exits promptly after SIGTERM and does not
137
+ * hang waiting for the escalation window to elapse. In practice, OMC agent
138
+ * processes (claude/codex/gemini/omc) respect SIGTERM and exit within
139
+ * milliseconds; the SIGKILL path is a safety net that only fires if the
140
+ * caller's event loop stays alive long enough (e.g., another timer or I/O
141
+ * keeps the process running past 5s). Callers that need guaranteed
142
+ * escalation should poll `process.kill(pid, 0)` themselves or re-run this
143
+ * script. See commit message for the rationale behind removing the implicit
144
+ * 5s hang this function previously caused.
131
145
  */
132
146
  function killProcess(pid) {
133
147
  // Validate PID is a positive integer (prevent command injection)
@@ -140,7 +154,10 @@ function killProcess(pid) {
140
154
  // Send SIGTERM
141
155
  process.kill(pid, 'SIGTERM');
142
156
 
143
- // Wait 5s, then SIGKILL if still alive
157
+ // Schedule a best-effort SIGKILL escalation after 5s.
158
+ // .unref() ensures this pending timer does not keep the Node event
159
+ // loop alive — without it, main() would appear to "hang" for 5s per
160
+ // orphan after printing the JSON result.
144
161
  setTimeout(() => {
145
162
  try {
146
163
  process.kill(pid, 0); // Check if still running
@@ -148,7 +165,7 @@ function killProcess(pid) {
148
165
  } catch {
149
166
  // Process already exited
150
167
  }
151
- }, 5000);
168
+ }, 5000).unref();
152
169
  }
153
170
  return true;
154
171
  } catch {
@@ -201,6 +218,10 @@ function main() {
201
218
  ? `Found ${orphans.length} orphan(s). Re-run without --dry-run to clean up.`
202
219
  : `Cleaned up ${results.filter(r => r.action === 'killed').length}/${orphans.length} orphan(s).`,
203
220
  }));
221
+
222
+ // Explicit exit: any pending .unref()ed SIGKILL timers should not pin the
223
+ // event loop, but exit(0) here makes the completion intent unambiguous.
224
+ process.exit(0);
204
225
  }
205
226
 
206
227
  main();
@@ -10,9 +10,9 @@
10
10
  *
11
11
  * Configurable via OMC_CONTEXT_SAFETY_THRESHOLD env var (default: 55%).
12
12
  *
13
- * Hook output:
14
- * - Block (exit 2 + stderr message) when context too high for the tool
15
- * - Allow ({ continue: true, suppressOutput: true }) otherwise
13
+ * Hook output (preToolUse — Copilot CLI compliant):
14
+ * - Deny ({ permissionDecision: "deny", permissionDecisionReason: "..." }) when context too high
15
+ * - Allow ({ permissionDecision: "allow" }) otherwise
16
16
  */
17
17
 
18
18
  import { existsSync, statSync, openSync, readSync, closeSync } from 'node:fs';
@@ -139,7 +139,7 @@ async function main() {
139
139
  const toolName = data.tool_name || data.toolName || '';
140
140
 
141
141
  if (!BLOCKED_TOOLS.has(toolName)) {
142
- console.log(JSON.stringify({ continue: true, suppressOutput: true }));
142
+ console.log(JSON.stringify({ permissionDecision: 'allow' }));
143
143
  return;
144
144
  }
145
145
 
@@ -148,17 +148,16 @@ async function main() {
148
148
  const pct = estimateContextPercent(transcriptPath);
149
149
 
150
150
  if (pct >= THRESHOLD) {
151
- process.stderr.write(
152
- `[OMC] Context at ${pct}% (threshold: ${THRESHOLD}%). ` +
153
- `Too high for ${toolName}. Run /compact or start a fresh session to free context.\n`
154
- );
155
- process.exit(2);
151
+ const reason = `[OMC] Context at ${pct}% (threshold: ${THRESHOLD}%). ` +
152
+ `Too high for ${toolName}. Run /compact or start a fresh session to free context.`;
153
+ console.log(JSON.stringify({ permissionDecision: 'deny', permissionDecisionReason: reason }));
154
+ return;
156
155
  }
157
156
 
158
- console.log(JSON.stringify({ continue: true, suppressOutput: true }));
157
+ console.log(JSON.stringify({ permissionDecision: 'allow' }));
159
158
  } catch {
160
159
  // On any error, allow the tool to proceed (never block on hook failure)
161
- console.log(JSON.stringify({ continue: true, suppressOutput: true }));
160
+ console.log(JSON.stringify({ permissionDecision: 'allow' }));
162
161
  }
163
162
  }
164
163
 
@@ -31,8 +31,8 @@ import { fileURLToPath } from 'url';
31
31
  import { getCopilotConfigDir } from './lib/config-dir.mjs';
32
32
  import { readStdin } from './lib/stdin.mjs';
33
33
 
34
- // Resolve OMC package root: CLAUDE_PLUGIN_ROOT (plugin system) or derive from this script's location
35
- const _omcRoot = process.env.CLAUDE_PLUGIN_ROOT ||
34
+ // Resolve OMC package root: PLUGIN_ROOT (plugin system) or derive from this script's location
35
+ const _omcRoot = process.env.PLUGIN_ROOT || process.env.CLAUDE_PLUGIN_ROOT ||
36
36
  join(dirname(fileURLToPath(import.meta.url)), '..');
37
37
 
38
38
  /**