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.
- package/.claude-plugin/marketplace.json +2 -2
- package/.claude-plugin/plugin.json +1 -1
- package/README.md +2 -2
- package/agents/analyst.agent.md +2 -1
- package/agents/architect.agent.md +2 -1
- package/agents/code-reviewer.agent.md +2 -1
- package/agents/critic.agent.md +2 -1
- package/agents/debugger.agent.md +2 -1
- package/agents/designer.agent.md +2 -1
- package/agents/devils-advocate.agent.md +2 -1
- package/agents/document-specialist.agent.md +2 -1
- package/agents/executor.agent.md +2 -1
- package/agents/explore.agent.md +2 -1
- package/agents/git-master.agent.md +2 -1
- package/agents/planner.agent.md +2 -1
- package/agents/qa-tester.agent.md +2 -1
- package/agents/scientist.agent.md +2 -1
- package/agents/security-reviewer.agent.md +2 -1
- package/agents/test-engineer.agent.md +2 -1
- package/agents/verifier.agent.md +2 -1
- package/agents/writer.agent.md +2 -1
- package/bridge/cli.cjs +2823 -1491
- package/bridge/mcp-server.cjs +15 -2
- package/bridge/run-mcp-server.sh +1 -1
- package/bridge/runtime-cli.cjs +3589 -2448
- package/bridge/team-bridge.cjs +6 -4
- package/bridge/team-mcp.cjs +19607 -0
- package/bridge/team.js +3576 -2080
- package/dist/__tests__/auto-slash-aliases.test.js +5 -5
- package/dist/__tests__/auto-slash-aliases.test.js.map +1 -1
- package/dist/__tests__/bedrock-lm-suffix-hook.test.js +2 -2
- package/dist/__tests__/bedrock-lm-suffix-hook.test.js.map +1 -1
- package/dist/__tests__/cleanup-orphans-unref.test.d.ts +2 -0
- package/dist/__tests__/cleanup-orphans-unref.test.d.ts.map +1 -0
- package/dist/__tests__/cleanup-orphans-unref.test.js +44 -0
- package/dist/__tests__/cleanup-orphans-unref.test.js.map +1 -0
- package/dist/__tests__/context-safety.test.js +3 -3
- package/dist/__tests__/context-safety.test.js.map +1 -1
- package/dist/__tests__/hooks/learner/bridge.test.js +106 -0
- package/dist/__tests__/hooks/learner/bridge.test.js.map +1 -1
- package/dist/__tests__/hooks/learner/parser.test.js +30 -0
- package/dist/__tests__/hooks/learner/parser.test.js.map +1 -1
- package/dist/__tests__/hooks.test.js +47 -0
- package/dist/__tests__/hooks.test.js.map +1 -1
- package/dist/__tests__/hud/extra-usage.test.js +42 -0
- package/dist/__tests__/hud/extra-usage.test.js.map +1 -1
- package/dist/__tests__/hud/render-enterprise.test.d.ts +5 -0
- package/dist/__tests__/hud/render-enterprise.test.d.ts.map +1 -0
- package/dist/__tests__/hud/render-enterprise.test.js +232 -0
- package/dist/__tests__/hud/render-enterprise.test.js.map +1 -0
- package/dist/__tests__/hud/render-rate-limits-priority.test.js +159 -0
- package/dist/__tests__/hud/render-rate-limits-priority.test.js.map +1 -1
- package/dist/__tests__/hud/stdin-session-scope.test.d.ts +2 -0
- package/dist/__tests__/hud/stdin-session-scope.test.d.ts.map +1 -0
- package/dist/__tests__/hud/stdin-session-scope.test.js +169 -0
- package/dist/__tests__/hud/stdin-session-scope.test.js.map +1 -0
- package/dist/__tests__/hud/usage-api.test.js +111 -1
- package/dist/__tests__/hud/usage-api.test.js.map +1 -1
- package/dist/__tests__/issue-2652-runtime-wiring-and-output-contract.test.js +2 -0
- package/dist/__tests__/issue-2652-runtime-wiring-and-output-contract.test.js.map +1 -1
- package/dist/__tests__/keyword-detector-echo-guard.test.d.ts +2 -0
- package/dist/__tests__/keyword-detector-echo-guard.test.d.ts.map +1 -0
- package/dist/__tests__/keyword-detector-echo-guard.test.js +218 -0
- package/dist/__tests__/keyword-detector-echo-guard.test.js.map +1 -0
- package/dist/__tests__/keyword-detector-script.test.js +2 -1
- package/dist/__tests__/keyword-detector-script.test.js.map +1 -1
- package/dist/__tests__/omc-cli-rendering.test.js +13 -10
- package/dist/__tests__/omc-cli-rendering.test.js.map +1 -1
- package/dist/__tests__/pre-tool-enforcer.test.js +22 -38
- package/dist/__tests__/pre-tool-enforcer.test.js.map +1 -1
- package/dist/__tests__/preemptive-compaction-hook.test.js +63 -0
- package/dist/__tests__/preemptive-compaction-hook.test.js.map +1 -1
- package/dist/__tests__/safe-command-approver.test.d.ts +2 -0
- package/dist/__tests__/safe-command-approver.test.d.ts.map +1 -0
- package/dist/__tests__/safe-command-approver.test.js +103 -0
- package/dist/__tests__/safe-command-approver.test.js.map +1 -0
- package/dist/__tests__/skills.test.js +18 -0
- package/dist/__tests__/skills.test.js.map +1 -1
- package/dist/__tests__/state-root-resolution.test.js +64 -0
- package/dist/__tests__/state-root-resolution.test.js.map +1 -1
- package/dist/cli/__tests__/launch.test.js +24 -0
- package/dist/cli/__tests__/launch.test.js.map +1 -1
- package/dist/cli/__tests__/team-status-worktree.test.d.ts +2 -0
- package/dist/cli/__tests__/team-status-worktree.test.d.ts.map +1 -0
- package/dist/cli/__tests__/team-status-worktree.test.js +96 -0
- package/dist/cli/__tests__/team-status-worktree.test.js.map +1 -0
- package/dist/cli/__tests__/team.test.js +164 -0
- package/dist/cli/__tests__/team.test.js.map +1 -1
- package/dist/cli/__tests__/tmux-utils.test.js +18 -3
- package/dist/cli/__tests__/tmux-utils.test.js.map +1 -1
- package/dist/cli/autoresearch-setup-session.d.ts.map +1 -1
- package/dist/cli/autoresearch-setup-session.js +1 -0
- package/dist/cli/autoresearch-setup-session.js.map +1 -1
- package/dist/cli/commands/team.js +1 -1
- package/dist/cli/launch.d.ts.map +1 -1
- package/dist/cli/launch.js +10 -2
- package/dist/cli/launch.js.map +1 -1
- package/dist/cli/team.d.ts.map +1 -1
- package/dist/cli/team.js +103 -4
- package/dist/cli/team.js.map +1 -1
- package/dist/cli/tmux-utils.d.ts.map +1 -1
- package/dist/cli/tmux-utils.js +5 -2
- package/dist/cli/tmux-utils.js.map +1 -1
- package/dist/cli/utils/formatting.d.ts +0 -10
- package/dist/cli/utils/formatting.d.ts.map +1 -1
- package/dist/cli/utils/formatting.js +0 -52
- package/dist/cli/utils/formatting.js.map +1 -1
- package/dist/config/loader.d.ts.map +1 -1
- package/dist/config/loader.js +34 -8
- package/dist/config/loader.js.map +1 -1
- package/dist/features/__tests__/magic-keywords.test.d.ts +2 -0
- package/dist/features/__tests__/magic-keywords.test.d.ts.map +1 -0
- package/dist/features/__tests__/magic-keywords.test.js +19 -0
- package/dist/features/__tests__/magic-keywords.test.js.map +1 -0
- package/dist/features/delegation-enforcer.d.ts +2 -0
- package/dist/features/delegation-enforcer.d.ts.map +1 -1
- package/dist/features/delegation-enforcer.js +10 -0
- package/dist/features/delegation-enforcer.js.map +1 -1
- package/dist/features/magic-keywords.d.ts +1 -1
- package/dist/features/magic-keywords.d.ts.map +1 -1
- package/dist/features/magic-keywords.js +5 -192
- package/dist/features/magic-keywords.js.map +1 -1
- package/dist/hooks/__tests__/bridge-routing.test.js +23 -0
- package/dist/hooks/__tests__/bridge-routing.test.js.map +1 -1
- package/dist/hooks/bridge-normalize.d.ts +5 -0
- package/dist/hooks/bridge-normalize.d.ts.map +1 -1
- package/dist/hooks/bridge-normalize.js +6 -0
- package/dist/hooks/bridge-normalize.js.map +1 -1
- package/dist/hooks/bridge.d.ts +4 -0
- package/dist/hooks/bridge.d.ts.map +1 -1
- package/dist/hooks/bridge.js +60 -3
- package/dist/hooks/bridge.js.map +1 -1
- package/dist/hooks/keyword-detector/index.js +1 -1
- package/dist/hooks/keyword-detector/index.js.map +1 -1
- package/dist/hooks/keyword-detector/ultrawork/__tests__/index.test.d.ts +2 -0
- package/dist/hooks/keyword-detector/ultrawork/__tests__/index.test.d.ts.map +1 -0
- package/dist/hooks/keyword-detector/ultrawork/__tests__/index.test.js +37 -0
- package/dist/hooks/keyword-detector/ultrawork/__tests__/index.test.js.map +1 -0
- package/dist/hooks/keyword-detector/ultrawork/default.d.ts +3 -0
- package/dist/hooks/keyword-detector/ultrawork/default.d.ts.map +1 -0
- package/dist/hooks/keyword-detector/ultrawork/default.js +67 -0
- package/dist/hooks/keyword-detector/ultrawork/default.js.map +1 -0
- package/dist/hooks/keyword-detector/ultrawork/gemini.d.ts +3 -0
- package/dist/hooks/keyword-detector/ultrawork/gemini.d.ts.map +1 -0
- package/dist/hooks/keyword-detector/ultrawork/gemini.js +47 -0
- package/dist/hooks/keyword-detector/ultrawork/gemini.js.map +1 -0
- package/dist/hooks/keyword-detector/ultrawork/gpt.d.ts +3 -0
- package/dist/hooks/keyword-detector/ultrawork/gpt.d.ts.map +1 -0
- package/dist/hooks/keyword-detector/ultrawork/gpt.js +52 -0
- package/dist/hooks/keyword-detector/ultrawork/gpt.js.map +1 -0
- package/dist/hooks/keyword-detector/ultrawork/index.d.ts +8 -0
- package/dist/hooks/keyword-detector/ultrawork/index.d.ts.map +1 -0
- package/dist/hooks/keyword-detector/ultrawork/index.js +24 -0
- package/dist/hooks/keyword-detector/ultrawork/index.js.map +1 -0
- package/dist/hooks/keyword-detector/ultrawork/planner.d.ts +3 -0
- package/dist/hooks/keyword-detector/ultrawork/planner.d.ts.map +1 -0
- package/dist/hooks/keyword-detector/ultrawork/planner.js +57 -0
- package/dist/hooks/keyword-detector/ultrawork/planner.js.map +1 -0
- package/dist/hooks/keyword-detector/ultrawork/source-detector.d.ts +6 -0
- package/dist/hooks/keyword-detector/ultrawork/source-detector.d.ts.map +1 -0
- package/dist/hooks/keyword-detector/ultrawork/source-detector.js +37 -0
- package/dist/hooks/keyword-detector/ultrawork/source-detector.js.map +1 -0
- package/dist/hooks/learner/bridge.d.ts +2 -0
- package/dist/hooks/learner/bridge.d.ts.map +1 -1
- package/dist/hooks/learner/bridge.js +15 -109
- package/dist/hooks/learner/bridge.js.map +1 -1
- package/dist/hooks/learner/index.d.ts.map +1 -1
- package/dist/hooks/learner/index.js +51 -14
- package/dist/hooks/learner/index.js.map +1 -1
- package/dist/hooks/learner/parser.d.ts +9 -0
- package/dist/hooks/learner/parser.d.ts.map +1 -1
- package/dist/hooks/learner/parser.js +18 -5
- package/dist/hooks/learner/parser.js.map +1 -1
- package/dist/hooks/learner/types.d.ts +6 -0
- package/dist/hooks/learner/types.d.ts.map +1 -1
- package/dist/hooks/persistent-mode/index.d.ts.map +1 -1
- package/dist/hooks/persistent-mode/index.js +7 -4
- package/dist/hooks/persistent-mode/index.js.map +1 -1
- package/dist/hooks/persistent-mode/session-isolation.test.js +8 -3
- package/dist/hooks/persistent-mode/session-isolation.test.js.map +1 -1
- package/dist/hooks/persistent-mode/stop-hook-blocking.test.js +142 -7
- package/dist/hooks/persistent-mode/stop-hook-blocking.test.js.map +1 -1
- package/dist/hooks/project-memory/__tests__/learner.test.js +7 -0
- package/dist/hooks/project-memory/__tests__/learner.test.js.map +1 -1
- package/dist/hooks/project-memory/learner.d.ts +1 -1
- package/dist/hooks/project-memory/learner.d.ts.map +1 -1
- package/dist/hooks/project-memory/learner.js +3 -0
- package/dist/hooks/project-memory/learner.js.map +1 -1
- package/dist/hooks/session-end/index.d.ts.map +1 -1
- package/dist/hooks/session-end/index.js +43 -0
- package/dist/hooks/session-end/index.js.map +1 -1
- package/dist/hooks/skill-bridge.cjs +116 -87
- package/dist/hud/__tests__/enterprise-cost.test.d.ts +5 -0
- package/dist/hud/__tests__/enterprise-cost.test.d.ts.map +1 -0
- package/dist/hud/__tests__/enterprise-cost.test.js +151 -0
- package/dist/hud/__tests__/enterprise-cost.test.js.map +1 -0
- package/dist/hud/__tests__/usage-api-enterprise.test.d.ts +5 -0
- package/dist/hud/__tests__/usage-api-enterprise.test.d.ts.map +1 -0
- package/dist/hud/__tests__/usage-api-enterprise.test.js +249 -0
- package/dist/hud/__tests__/usage-api-enterprise.test.js.map +1 -0
- package/dist/hud/elements/enterprise-cost.d.ts +16 -0
- package/dist/hud/elements/enterprise-cost.d.ts.map +1 -0
- package/dist/hud/elements/enterprise-cost.js +63 -0
- package/dist/hud/elements/enterprise-cost.js.map +1 -0
- package/dist/hud/elements/permission.d.ts.map +1 -1
- package/dist/hud/elements/permission.js +2 -5
- package/dist/hud/elements/permission.js.map +1 -1
- package/dist/hud/elements/session.d.ts.map +1 -1
- package/dist/hud/elements/session.js +5 -9
- package/dist/hud/elements/session.js.map +1 -1
- package/dist/hud/index.d.ts.map +1 -1
- package/dist/hud/index.js +22 -5
- package/dist/hud/index.js.map +1 -1
- package/dist/hud/render.d.ts.map +1 -1
- package/dist/hud/render.js +34 -2
- package/dist/hud/render.js.map +1 -1
- package/dist/hud/stdin.d.ts.map +1 -1
- package/dist/hud/stdin.js +49 -5
- package/dist/hud/stdin.js.map +1 -1
- package/dist/hud/types.d.ts +16 -0
- package/dist/hud/types.d.ts.map +1 -1
- package/dist/hud/types.js +1 -1
- package/dist/hud/types.js.map +1 -1
- package/dist/hud/usage-api.d.ts +19 -1
- package/dist/hud/usage-api.d.ts.map +1 -1
- package/dist/hud/usage-api.js +101 -18
- package/dist/hud/usage-api.js.map +1 -1
- package/dist/installer/__tests__/hook-templates.test.js +23 -0
- package/dist/installer/__tests__/hook-templates.test.js.map +1 -1
- package/dist/installer/hooks.d.ts +4 -2
- package/dist/installer/hooks.d.ts.map +1 -1
- package/dist/installer/hooks.js +5 -94
- package/dist/installer/hooks.js.map +1 -1
- package/dist/installer/index.d.ts +1 -0
- package/dist/installer/index.d.ts.map +1 -1
- package/dist/installer/index.js +64 -24
- package/dist/installer/index.js.map +1 -1
- package/dist/installer/mcp-registry.d.ts.map +1 -1
- package/dist/installer/mcp-registry.js +3 -2
- package/dist/installer/mcp-registry.js.map +1 -1
- package/dist/mcp/__tests__/team-server-artifact-convergence.test.js +156 -4
- package/dist/mcp/__tests__/team-server-artifact-convergence.test.js.map +1 -1
- package/dist/mcp/omc-tools-server.d.ts +11 -17
- package/dist/mcp/omc-tools-server.d.ts.map +1 -1
- package/dist/mcp/omc-tools-server.js +22 -32
- package/dist/mcp/omc-tools-server.js.map +1 -1
- package/dist/mcp/team-job-convergence.d.ts +9 -2
- package/dist/mcp/team-job-convergence.d.ts.map +1 -1
- package/dist/mcp/team-job-convergence.js +35 -14
- package/dist/mcp/team-job-convergence.js.map +1 -1
- package/dist/mcp/team-server.d.ts.map +1 -1
- package/dist/mcp/team-server.js +93 -13
- package/dist/mcp/team-server.js.map +1 -1
- package/dist/ralphthon/prd.d.ts.map +1 -1
- package/dist/ralphthon/prd.js +13 -17
- package/dist/ralphthon/prd.js.map +1 -1
- package/dist/shared/types.d.ts +3 -1
- package/dist/shared/types.d.ts.map +1 -1
- package/dist/team/__tests__/api-interop.cleanup.test.d.ts +2 -0
- package/dist/team/__tests__/api-interop.cleanup.test.d.ts.map +1 -0
- package/dist/team/__tests__/api-interop.cleanup.test.js +234 -0
- package/dist/team/__tests__/api-interop.cleanup.test.js.map +1 -0
- package/dist/team/__tests__/api-interop.dispatch.test.js +2 -1
- package/dist/team/__tests__/api-interop.dispatch.test.js.map +1 -1
- package/dist/team/__tests__/git-worktree.test.js +164 -3
- package/dist/team/__tests__/git-worktree.test.js.map +1 -1
- package/dist/team/__tests__/model-contract.test.js +38 -22
- package/dist/team/__tests__/model-contract.test.js.map +1 -1
- package/dist/team/__tests__/resolved-routing-snapshot.test.js +29 -1
- package/dist/team/__tests__/resolved-routing-snapshot.test.js.map +1 -1
- package/dist/team/__tests__/runtime-cli.test.js +2 -2
- package/dist/team/__tests__/runtime-cli.test.js.map +1 -1
- package/dist/team/__tests__/runtime-prompt-mode.test.js +17 -17
- package/dist/team/__tests__/runtime-prompt-mode.test.js.map +1 -1
- package/dist/team/__tests__/runtime-v2-role-routing.test.js +7 -1
- package/dist/team/__tests__/runtime-v2-role-routing.test.js.map +1 -1
- package/dist/team/__tests__/runtime-v2.dispatch.test.js +145 -16
- package/dist/team/__tests__/runtime-v2.dispatch.test.js.map +1 -1
- package/dist/team/__tests__/runtime-v2.monitor.test.d.ts +2 -0
- package/dist/team/__tests__/runtime-v2.monitor.test.d.ts.map +1 -0
- package/dist/team/__tests__/runtime-v2.monitor.test.js +219 -0
- package/dist/team/__tests__/runtime-v2.monitor.test.js.map +1 -0
- package/dist/team/__tests__/runtime-v2.shutdown.test.d.ts +2 -0
- package/dist/team/__tests__/runtime-v2.shutdown.test.d.ts.map +1 -0
- package/dist/team/__tests__/runtime-v2.shutdown.test.js +292 -0
- package/dist/team/__tests__/runtime-v2.shutdown.test.js.map +1 -0
- package/dist/team/__tests__/scaling-launch-config.test.js +204 -4
- package/dist/team/__tests__/scaling-launch-config.test.js.map +1 -1
- package/dist/team/__tests__/stage-router.test.js +29 -1
- package/dist/team/__tests__/stage-router.test.js.map +1 -1
- package/dist/team/__tests__/team-summary-worktree.test.d.ts +2 -0
- package/dist/team/__tests__/team-summary-worktree.test.d.ts.map +1 -0
- package/dist/team/__tests__/team-summary-worktree.test.js +85 -0
- package/dist/team/__tests__/team-summary-worktree.test.js.map +1 -0
- package/dist/team/__tests__/tmux-session-liveness.test.d.ts +2 -0
- package/dist/team/__tests__/tmux-session-liveness.test.d.ts.map +1 -0
- package/dist/team/__tests__/tmux-session-liveness.test.js +37 -0
- package/dist/team/__tests__/tmux-session-liveness.test.js.map +1 -0
- package/dist/team/__tests__/worker-bootstrap.test.js +47 -1
- package/dist/team/__tests__/worker-bootstrap.test.js.map +1 -1
- package/dist/team/__tests__/worktree-contract-fields.test.d.ts +2 -0
- package/dist/team/__tests__/worktree-contract-fields.test.d.ts.map +1 -0
- package/dist/team/__tests__/worktree-contract-fields.test.js +157 -0
- package/dist/team/__tests__/worktree-contract-fields.test.js.map +1 -0
- package/dist/team/api-interop.d.ts +2 -1
- package/dist/team/api-interop.d.ts.map +1 -1
- package/dist/team/api-interop.js +121 -14
- package/dist/team/api-interop.js.map +1 -1
- package/dist/team/capabilities.d.ts.map +1 -1
- package/dist/team/capabilities.js +2 -0
- package/dist/team/capabilities.js.map +1 -1
- package/dist/team/cli-worker-contract.d.ts +7 -6
- package/dist/team/cli-worker-contract.d.ts.map +1 -1
- package/dist/team/cli-worker-contract.js +7 -6
- package/dist/team/cli-worker-contract.js.map +1 -1
- package/dist/team/events.d.ts +3 -0
- package/dist/team/events.d.ts.map +1 -1
- package/dist/team/events.js +2 -1
- package/dist/team/events.js.map +1 -1
- package/dist/team/git-worktree.d.ts +78 -10
- package/dist/team/git-worktree.d.ts.map +1 -1
- package/dist/team/git-worktree.js +453 -97
- package/dist/team/git-worktree.js.map +1 -1
- package/dist/team/governance.d.ts +3 -2
- package/dist/team/governance.d.ts.map +1 -1
- package/dist/team/governance.js.map +1 -1
- package/dist/team/model-contract.d.ts +18 -2
- package/dist/team/model-contract.d.ts.map +1 -1
- package/dist/team/model-contract.js +55 -27
- package/dist/team/model-contract.js.map +1 -1
- package/dist/team/monitor.d.ts.map +1 -1
- package/dist/team/monitor.js +47 -3
- package/dist/team/monitor.js.map +1 -1
- package/dist/team/runtime-v2.d.ts +9 -0
- package/dist/team/runtime-v2.d.ts.map +1 -1
- package/dist/team/runtime-v2.js +347 -120
- package/dist/team/runtime-v2.js.map +1 -1
- package/dist/team/runtime.d.ts.map +1 -1
- package/dist/team/runtime.js +4 -1
- package/dist/team/runtime.js.map +1 -1
- package/dist/team/scaling.d.ts.map +1 -1
- package/dist/team/scaling.js +110 -13
- package/dist/team/scaling.js.map +1 -1
- package/dist/team/state/tasks.d.ts.map +1 -1
- package/dist/team/state/tasks.js +1 -0
- package/dist/team/state/tasks.js.map +1 -1
- package/dist/team/team-ops.d.ts.map +1 -1
- package/dist/team/team-ops.js +112 -16
- package/dist/team/team-ops.js.map +1 -1
- package/dist/team/tmux-session.d.ts +17 -29
- package/dist/team/tmux-session.d.ts.map +1 -1
- package/dist/team/tmux-session.js +116 -107
- package/dist/team/tmux-session.js.map +1 -1
- package/dist/team/types.d.ts +31 -17
- package/dist/team/types.d.ts.map +1 -1
- package/dist/team/types.js.map +1 -1
- package/dist/team/worker-bootstrap.d.ts +7 -0
- package/dist/team/worker-bootstrap.d.ts.map +1 -1
- package/dist/team/worker-bootstrap.js +27 -13
- package/dist/team/worker-bootstrap.js.map +1 -1
- package/dist/team/worker-canonicalization.d.ts.map +1 -1
- package/dist/team/worker-canonicalization.js +2 -0
- package/dist/team/worker-canonicalization.js.map +1 -1
- package/dist/utils/frontmatter.d.ts.map +1 -1
- package/dist/utils/frontmatter.js +1 -16
- package/dist/utils/frontmatter.js.map +1 -1
- package/dist/utils/omc-cli-rendering.d.ts.map +1 -1
- package/dist/utils/omc-cli-rendering.js +1 -12
- package/dist/utils/omc-cli-rendering.js.map +1 -1
- package/dist/utils/resolve-node.d.ts.map +1 -1
- package/dist/utils/resolve-node.js +22 -28
- package/dist/utils/resolve-node.js.map +1 -1
- package/docs/MIGRATION.md +1003 -0
- package/docs/REFERENCE.md +4 -0
- package/docs/TEAM-WORKTREE-MODE.md +86 -0
- package/docs/copilot-instructions.md +1 -1
- package/docs/reference/compatibility.md +1 -1
- package/hooks/hooks.json +34 -13
- package/package.json +1 -1
- package/scripts/cleanup-orphans.mjs +24 -3
- package/scripts/context-safety.mjs +10 -11
- package/scripts/keyword-detector.debug.mjs +2 -2
- package/scripts/keyword-detector.mjs +219 -57
- package/scripts/lib/state-root.cjs +1 -1
- package/scripts/lib/state-root.mjs +3 -3
- package/scripts/persistent-mode.cjs +30 -4
- package/scripts/persistent-mode.mjs +28 -2
- package/scripts/plugin-setup.mjs +8 -7
- package/scripts/post-tool-rules-injector.mjs +1 -1
- package/scripts/post-tool-verifier.mjs +55 -3
- package/scripts/pre-tool-enforcer.mjs +9 -21
- package/scripts/project-memory-session.mjs +1 -1
- package/scripts/run.cjs +9 -9
- package/scripts/safe-command-approver.mjs +156 -0
- package/scripts/session-start.mjs +91 -11
- package/scripts/setup-copilot-instructions.sh +5 -4
- package/scripts/skill-injector.mjs +60 -23
- package/scripts/test-pr25.sh +1 -1
- package/scripts/uninstall.sh +1 -1
- package/scripts/verify-deliverables.mjs +1 -1
- package/skills/deep-interview/SKILL.md +23 -10
- package/skills/learner/SKILL.md +1 -1
- package/skills/project-session-manager/lib/config.sh +1 -1
- package/skills/project-session-manager/lib/parse.sh +1 -1
- package/skills/project-session-manager/lib/providers/azure-devops.sh +1 -1
- package/skills/project-session-manager/lib/providers/bitbucket.sh +1 -1
- package/skills/project-session-manager/lib/providers/gitea.sh +1 -1
- package/skills/project-session-manager/lib/providers/github.sh +1 -1
- package/skills/project-session-manager/lib/providers/gitlab.sh +1 -1
- package/skills/project-session-manager/lib/providers/interface.sh +1 -1
- package/skills/project-session-manager/lib/providers/jira.sh +1 -1
- package/skills/project-session-manager/lib/session.sh +1 -1
- package/skills/project-session-manager/lib/tmux.sh +1 -1
- package/skills/project-session-manager/lib/worktree.sh +1 -1
- package/skills/project-session-manager/psm.sh +1 -1
- package/skills/project-session-manager/tests/test-psm-prompt-injection.sh +1 -1
- package/skills/skill/SKILL.md +1 -1
- package/templates/hooks/keyword-detector.mjs +183 -26
- package/templates/hooks/persistent-mode.mjs +28 -2
- 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.
|
|
@@ -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
|
-
"
|
|
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
|
-
"
|
|
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
|
-
"
|
|
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
|
-
"
|
|
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
|
-
"
|
|
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
|
@@ -127,7 +127,21 @@ function teamConfigExists(name) {
|
|
|
127
127
|
}
|
|
128
128
|
|
|
129
129
|
/**
|
|
130
|
-
* Kill a process
|
|
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
|
-
//
|
|
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
|
-
* -
|
|
15
|
-
* - Allow ({
|
|
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({
|
|
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
|
-
|
|
152
|
-
`
|
|
153
|
-
|
|
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({
|
|
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({
|
|
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:
|
|
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
|
/**
|