claudecode-omc 4.4.5 → 4.4.6
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/.mcp.json +2 -6
- package/README.es.md +64 -8
- package/README.ja.md +64 -8
- package/README.ko.md +64 -8
- package/README.pt.md +29 -0
- package/README.vi.md +29 -0
- package/README.zh.md +64 -8
- package/agents/architect.md +17 -7
- package/agents/code-reviewer.md +6 -7
- package/agents/critic.md +14 -1
- package/agents/deep-executor.md +6 -7
- package/agents/designer.md +6 -8
- package/agents/executor.md +6 -7
- package/agents/planner.md +21 -0
- package/agents/quality-reviewer.md +6 -7
- package/agents/security-reviewer.md +6 -7
- package/agents/test-engineer.md +6 -7
- package/bridge/mcp-server.cjs +517 -202
- package/bridge/runtime-cli.cjs +1547 -0
- package/bridge/team-bridge.cjs +348 -92
- package/bridge/{gemini-server.cjs → team-mcp.cjs} +10914 -10240
- package/dist/__tests__/auto-update.test.js +1 -1
- package/dist/__tests__/auto-update.test.js.map +1 -1
- package/dist/__tests__/cli-win32-warning.test.d.ts +2 -0
- package/dist/__tests__/cli-win32-warning.test.d.ts.map +1 -0
- package/dist/__tests__/cli-win32-warning.test.js +46 -0
- package/dist/__tests__/cli-win32-warning.test.js.map +1 -0
- package/dist/__tests__/codex-callsite-normalization.test.js +112 -0
- package/dist/__tests__/consensus-execution-handoff.test.d.ts +2 -0
- package/dist/__tests__/consensus-execution-handoff.test.d.ts.map +1 -1
- package/dist/__tests__/consensus-execution-handoff.test.js +48 -0
- package/dist/__tests__/consensus-execution-handoff.test.js.map +1 -1
- package/dist/__tests__/context-safety.test.d.ts +2 -0
- package/dist/__tests__/context-safety.test.d.ts.map +1 -0
- package/dist/__tests__/context-safety.test.js +59 -0
- package/dist/__tests__/context-safety.test.js.map +1 -0
- package/dist/__tests__/hooks.test.js +15 -0
- package/dist/__tests__/hooks.test.js.map +1 -1
- package/dist/__tests__/hud/call-counts.test.js +0 -3
- package/dist/__tests__/hud/call-counts.test.js.map +1 -1
- package/dist/__tests__/hud/defaults.test.js +3 -5
- package/dist/__tests__/hud/defaults.test.js.map +1 -1
- package/dist/__tests__/hud/prompt-time.test.d.ts +2 -0
- package/dist/__tests__/hud/prompt-time.test.d.ts.map +1 -0
- package/dist/__tests__/hud/prompt-time.test.js +24 -0
- package/dist/__tests__/hud/prompt-time.test.js.map +1 -0
- package/dist/__tests__/hud/render.test.js +0 -1
- package/dist/__tests__/hud/render.test.js.map +1 -1
- package/dist/__tests__/hud/version-display.test.js +1 -0
- package/dist/__tests__/hud/version-display.test.js.map +1 -1
- package/dist/__tests__/hud/windows-platform.test.js +0 -4
- package/dist/__tests__/hud/windows-platform.test.js.map +1 -1
- package/dist/__tests__/hud-windows.test.js +5 -3
- package/dist/__tests__/hud-windows.test.js.map +1 -1
- package/dist/__tests__/installer-hud-skip.test.js +12 -2
- package/dist/__tests__/installer-hud-skip.test.js.map +1 -1
- package/dist/__tests__/job-management-sqlite.test.js +0 -15
- package/dist/__tests__/job-management-sqlite.test.js.map +1 -1
- package/dist/__tests__/job-management.test.js +0 -16
- package/dist/__tests__/job-management.test.js.map +1 -1
- package/dist/__tests__/load-agent-prompt.test.js +0 -23
- package/dist/__tests__/load-agent-prompt.test.js.map +1 -1
- package/dist/__tests__/model-routing.test.js +3 -2
- package/dist/__tests__/model-routing.test.js.map +1 -1
- package/dist/__tests__/omc-tools-server-interop.test.js +1 -1
- package/dist/__tests__/omc-tools-server-interop.test.js.map +1 -1
- package/dist/__tests__/pre-tool-enforcer.test.d.ts +2 -0
- package/dist/__tests__/pre-tool-enforcer.test.d.ts.map +1 -0
- package/dist/__tests__/pre-tool-enforcer.test.js +194 -0
- package/dist/__tests__/pre-tool-enforcer.test.js.map +1 -0
- package/dist/__tests__/prompt-injection.test.js +0 -26
- package/dist/__tests__/prompt-injection.test.js.map +1 -1
- package/dist/__tests__/purge-stale-cache.test.js +3 -2
- package/dist/__tests__/purge-stale-cache.test.js.map +1 -1
- package/dist/__tests__/run-cjs-graceful-fallback.test.d.ts +2 -0
- package/dist/__tests__/run-cjs-graceful-fallback.test.d.ts.map +1 -0
- package/dist/__tests__/run-cjs-graceful-fallback.test.js +167 -0
- package/dist/__tests__/run-cjs-graceful-fallback.test.js.map +1 -0
- package/dist/__tests__/session-start-cache-cleanup.test.d.ts +2 -0
- package/dist/__tests__/session-start-cache-cleanup.test.d.ts.map +1 -0
- package/dist/__tests__/session-start-cache-cleanup.test.js +150 -0
- package/dist/__tests__/session-start-cache-cleanup.test.js.map +1 -0
- package/dist/__tests__/skills.test.js +10 -8
- package/dist/__tests__/skills.test.js.map +1 -1
- package/dist/__tests__/team-server-validation.test.d.ts +2 -0
- package/dist/__tests__/team-server-validation.test.d.ts.map +1 -0
- package/dist/__tests__/team-server-validation.test.js +122 -0
- package/dist/__tests__/team-server-validation.test.js.map +1 -0
- package/dist/agents/index.d.ts +0 -1
- package/dist/agents/index.d.ts.map +1 -1
- package/dist/agents/index.js +0 -2
- package/dist/agents/index.js.map +1 -1
- package/dist/agents/prompt-helpers.d.ts +74 -0
- package/dist/agents/prompt-helpers.d.ts.map +1 -0
- package/dist/agents/prompt-helpers.js +187 -0
- package/dist/agents/prompt-helpers.js.map +1 -0
- package/dist/agents/utils.d.ts +1 -5
- package/dist/agents/utils.d.ts.map +1 -1
- package/dist/agents/utils.js +1 -34
- package/dist/agents/utils.js.map +1 -1
- package/dist/cli/__tests__/launch.test.d.ts +1 -2
- package/dist/cli/__tests__/launch.test.d.ts.map +1 -1
- package/dist/cli/__tests__/launch.test.js +442 -48
- package/dist/cli/__tests__/launch.test.js.map +1 -1
- package/dist/cli/__tests__/teleport-help.test.d.ts +2 -0
- package/dist/cli/__tests__/teleport-help.test.d.ts.map +1 -0
- package/dist/cli/__tests__/teleport-help.test.js +17 -0
- package/dist/cli/__tests__/teleport-help.test.js.map +1 -0
- package/dist/cli/commands/teleport.d.ts +2 -1
- package/dist/cli/commands/teleport.d.ts.map +1 -1
- package/dist/cli/commands/teleport.js +6 -3
- package/dist/cli/commands/teleport.js.map +1 -1
- package/dist/cli/index.js +40 -290
- package/dist/cli/index.js.map +1 -1
- package/dist/cli/launch.d.ts +83 -3
- package/dist/cli/launch.d.ts.map +1 -1
- package/dist/cli/launch.js +213 -48
- package/dist/cli/launch.js.map +1 -1
- package/dist/cli/win32-warning.d.ts +6 -0
- package/dist/cli/win32-warning.d.ts.map +1 -0
- package/dist/cli/win32-warning.js +15 -0
- package/dist/cli/win32-warning.js.map +1 -0
- package/dist/config/loader.d.ts +9 -1
- package/dist/config/loader.d.ts.map +1 -1
- package/dist/config/loader.js +29 -19
- package/dist/config/loader.js.map +1 -1
- package/dist/config/models.d.ts +33 -0
- package/dist/config/models.d.ts.map +1 -0
- package/dist/config/models.js +49 -0
- package/dist/config/models.js.map +1 -0
- package/dist/constants/names.d.ts +2 -0
- package/dist/constants/names.d.ts.map +1 -1
- package/dist/constants/names.js +2 -0
- package/dist/constants/names.js.map +1 -1
- package/dist/features/auto-update.d.ts.map +1 -1
- package/dist/features/auto-update.js +21 -11
- package/dist/features/auto-update.js.map +1 -1
- package/dist/features/background-agent/manager.d.ts.map +1 -1
- package/dist/features/background-agent/manager.js +1 -2
- package/dist/features/background-agent/manager.js.map +1 -1
- package/dist/features/boulder-state/storage.d.ts.map +1 -1
- package/dist/features/boulder-state/storage.js +9 -5
- package/dist/features/boulder-state/storage.js.map +1 -1
- package/dist/features/boulder-state/types.d.ts +4 -0
- package/dist/features/boulder-state/types.d.ts.map +1 -1
- package/dist/features/builtin-skills/skills.d.ts.map +1 -1
- package/dist/features/builtin-skills/skills.js +25 -78
- package/dist/features/builtin-skills/skills.js.map +1 -1
- package/dist/features/delegation-enforcer.d.ts.map +1 -1
- package/dist/features/delegation-enforcer.js +4 -1
- package/dist/features/delegation-enforcer.js.map +1 -1
- package/dist/features/delegation-routing/__tests__/resolver.test.js +47 -122
- package/dist/features/delegation-routing/__tests__/resolver.test.js.map +1 -1
- package/dist/features/delegation-routing/resolver.d.ts.map +1 -1
- package/dist/features/delegation-routing/resolver.js +24 -47
- package/dist/features/delegation-routing/resolver.js.map +1 -1
- package/dist/features/delegation-routing/types.d.ts.map +1 -1
- package/dist/features/delegation-routing/types.js +2 -0
- package/dist/features/delegation-routing/types.js.map +1 -1
- package/dist/features/model-routing/external-model-policy.d.ts.map +1 -1
- package/dist/features/model-routing/external-model-policy.js.map +1 -1
- package/dist/features/model-routing/router.d.ts.map +1 -1
- package/dist/features/model-routing/router.js +12 -2
- package/dist/features/model-routing/router.js.map +1 -1
- package/dist/features/model-routing/types.d.ts +5 -1
- package/dist/features/model-routing/types.d.ts.map +1 -1
- package/dist/features/model-routing/types.js +7 -6
- package/dist/features/model-routing/types.js.map +1 -1
- package/dist/features/rate-limit-wait/daemon.d.ts.map +1 -1
- package/dist/features/rate-limit-wait/daemon.js +40 -4
- package/dist/features/rate-limit-wait/daemon.js.map +1 -1
- package/dist/features/task-decomposer/index.js +14 -4
- package/dist/features/task-decomposer/index.js.map +1 -1
- package/dist/hooks/__tests__/bridge-openclaw.test.d.ts +2 -0
- package/dist/hooks/__tests__/bridge-openclaw.test.d.ts.map +1 -0
- package/dist/hooks/__tests__/bridge-openclaw.test.js +124 -0
- package/dist/hooks/__tests__/bridge-openclaw.test.js.map +1 -0
- package/dist/hooks/__tests__/bridge-security.test.js +1 -1
- package/dist/hooks/__tests__/bridge-security.test.js.map +1 -1
- package/dist/hooks/auto-slash-command/executor.d.ts.map +1 -1
- package/dist/hooks/auto-slash-command/executor.js +38 -61
- package/dist/hooks/auto-slash-command/executor.js.map +1 -1
- package/dist/hooks/bridge.d.ts +11 -0
- package/dist/hooks/bridge.d.ts.map +1 -1
- package/dist/hooks/bridge.js +154 -82
- package/dist/hooks/bridge.js.map +1 -1
- package/dist/hooks/comment-checker/index.d.ts.map +1 -1
- package/dist/hooks/comment-checker/index.js +3 -1
- package/dist/hooks/comment-checker/index.js.map +1 -1
- package/dist/hooks/keyword-detector/__tests__/index.test.js +348 -1
- package/dist/hooks/keyword-detector/__tests__/index.test.js.map +1 -1
- package/dist/hooks/keyword-detector/index.d.ts +29 -0
- package/dist/hooks/keyword-detector/index.d.ts.map +1 -1
- package/dist/hooks/keyword-detector/index.js +123 -1
- package/dist/hooks/keyword-detector/index.js.map +1 -1
- package/dist/hooks/mode-registry/__tests__/session-isolation.test.js +40 -0
- package/dist/hooks/mode-registry/__tests__/session-isolation.test.js.map +1 -1
- package/dist/hooks/mode-registry/index.d.ts.map +1 -1
- package/dist/hooks/mode-registry/index.js +135 -52
- package/dist/hooks/mode-registry/index.js.map +1 -1
- package/dist/hooks/notepad/index.d.ts.map +1 -1
- package/dist/hooks/notepad/index.js +5 -3
- package/dist/hooks/notepad/index.js.map +1 -1
- package/dist/hooks/persistent-mode/__tests__/cancel-race.test.d.ts +2 -0
- package/dist/hooks/persistent-mode/__tests__/cancel-race.test.d.ts.map +1 -0
- package/dist/hooks/persistent-mode/__tests__/cancel-race.test.js +73 -0
- package/dist/hooks/persistent-mode/__tests__/cancel-race.test.js.map +1 -0
- package/dist/hooks/persistent-mode/__tests__/idle-cooldown.test.js +89 -13
- package/dist/hooks/persistent-mode/__tests__/idle-cooldown.test.js.map +1 -1
- package/dist/hooks/persistent-mode/__tests__/skill-state-stop.test.d.ts +2 -0
- package/dist/hooks/persistent-mode/__tests__/skill-state-stop.test.d.ts.map +1 -0
- package/dist/hooks/persistent-mode/__tests__/skill-state-stop.test.js +156 -0
- package/dist/hooks/persistent-mode/__tests__/skill-state-stop.test.js.map +1 -0
- package/dist/hooks/persistent-mode/idle-cooldown.test.d.ts +2 -3
- package/dist/hooks/persistent-mode/idle-cooldown.test.d.ts.map +1 -1
- package/dist/hooks/persistent-mode/idle-cooldown.test.js +19 -4
- package/dist/hooks/persistent-mode/idle-cooldown.test.js.map +1 -1
- package/dist/hooks/persistent-mode/index.d.ts +2 -2
- package/dist/hooks/persistent-mode/index.d.ts.map +1 -1
- package/dist/hooks/persistent-mode/index.js +144 -26
- package/dist/hooks/persistent-mode/index.js.map +1 -1
- package/dist/hooks/plugin-patterns/index.d.ts.map +1 -1
- package/dist/hooks/plugin-patterns/index.js +22 -31
- package/dist/hooks/plugin-patterns/index.js.map +1 -1
- package/dist/hooks/pre-compact/index.js +1 -1
- package/dist/hooks/preemptive-compaction/index.d.ts.map +1 -1
- package/dist/hooks/preemptive-compaction/index.js +3 -1
- package/dist/hooks/preemptive-compaction/index.js.map +1 -1
- package/dist/hooks/project-memory/index.d.ts.map +1 -1
- package/dist/hooks/project-memory/index.js +9 -0
- package/dist/hooks/project-memory/index.js.map +1 -1
- package/dist/hooks/project-memory/learner.d.ts.map +1 -1
- package/dist/hooks/project-memory/learner.js +107 -85
- package/dist/hooks/project-memory/learner.js.map +1 -1
- package/dist/hooks/project-memory/storage.d.ts.map +1 -1
- package/dist/hooks/project-memory/storage.js +3 -2
- package/dist/hooks/project-memory/storage.js.map +1 -1
- package/dist/hooks/recovery/context-window.d.ts +4 -0
- package/dist/hooks/recovery/context-window.d.ts.map +1 -1
- package/dist/hooks/recovery/context-window.js +22 -1
- package/dist/hooks/recovery/context-window.js.map +1 -1
- package/dist/hooks/recovery/session-recovery.js +1 -1
- package/dist/hooks/recovery/session-recovery.js.map +1 -1
- package/dist/hooks/session-end/index.d.ts.map +1 -1
- package/dist/hooks/session-end/index.js +13 -22
- package/dist/hooks/session-end/index.js.map +1 -1
- package/dist/hooks/setup/__tests__/windows-patch.test.d.ts +2 -0
- package/dist/hooks/setup/__tests__/windows-patch.test.d.ts.map +1 -0
- package/dist/hooks/setup/__tests__/windows-patch.test.js +110 -0
- package/dist/hooks/setup/__tests__/windows-patch.test.js.map +1 -0
- package/dist/hooks/setup/index.d.ts +18 -0
- package/dist/hooks/setup/index.d.ts.map +1 -1
- package/dist/hooks/setup/index.js +59 -1
- package/dist/hooks/setup/index.js.map +1 -1
- package/dist/hooks/skill-bridge.cjs +1 -0
- package/dist/hooks/skill-state/__tests__/skill-state.test.d.ts +2 -0
- package/dist/hooks/skill-state/__tests__/skill-state.test.d.ts.map +1 -0
- package/dist/hooks/skill-state/__tests__/skill-state.test.js +301 -0
- package/dist/hooks/skill-state/__tests__/skill-state.test.js.map +1 -0
- package/dist/hooks/skill-state/index.d.ts +79 -0
- package/dist/hooks/skill-state/index.d.ts.map +1 -0
- package/dist/hooks/skill-state/index.js +245 -0
- package/dist/hooks/skill-state/index.js.map +1 -0
- package/dist/hooks/team-pipeline/state.d.ts.map +1 -1
- package/dist/hooks/team-pipeline/state.js +5 -0
- package/dist/hooks/team-pipeline/state.js.map +1 -1
- package/dist/hooks/todo-continuation/index.d.ts +17 -0
- package/dist/hooks/todo-continuation/index.d.ts.map +1 -1
- package/dist/hooks/todo-continuation/index.js +44 -2
- package/dist/hooks/todo-continuation/index.js.map +1 -1
- package/dist/hud/elements/call-counts.d.ts.map +1 -1
- package/dist/hud/elements/call-counts.js +6 -4
- package/dist/hud/elements/call-counts.js.map +1 -1
- package/dist/hud/elements/index.d.ts +1 -0
- package/dist/hud/elements/index.d.ts.map +1 -1
- package/dist/hud/elements/index.js +1 -0
- package/dist/hud/elements/index.js.map +1 -1
- package/dist/hud/elements/prompt-time.d.ts +13 -0
- package/dist/hud/elements/prompt-time.d.ts.map +1 -0
- package/dist/hud/elements/prompt-time.js +21 -0
- package/dist/hud/elements/prompt-time.js.map +1 -0
- package/dist/hud/index.d.ts +2 -1
- package/dist/hud/index.d.ts.map +1 -1
- package/dist/hud/index.js +40 -215
- package/dist/hud/index.js.map +1 -1
- package/dist/hud/render.d.ts.map +1 -1
- package/dist/hud/render.js +7 -108
- package/dist/hud/render.js.map +1 -1
- package/dist/hud/state.d.ts.map +1 -1
- package/dist/hud/state.js +4 -3
- package/dist/hud/state.js.map +1 -1
- package/dist/hud/stdin.d.ts +10 -0
- package/dist/hud/stdin.d.ts.map +1 -1
- package/dist/hud/stdin.js +43 -0
- package/dist/hud/stdin.js.map +1 -1
- package/dist/hud/types.d.ts +6 -18
- package/dist/hud/types.d.ts.map +1 -1
- package/dist/hud/types.js +6 -46
- package/dist/hud/types.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -11
- package/dist/index.js.map +1 -1
- package/dist/installer/hooks.d.ts +5 -0
- package/dist/installer/hooks.d.ts.map +1 -1
- package/dist/installer/hooks.js +8 -0
- package/dist/installer/hooks.js.map +1 -1
- package/dist/installer/index.d.ts.map +1 -1
- package/dist/installer/index.js +26 -11
- package/dist/installer/index.js.map +1 -1
- package/dist/interop/omx-team-state.d.ts.map +1 -1
- package/dist/interop/omx-team-state.js +38 -6
- package/dist/interop/omx-team-state.js.map +1 -1
- package/dist/interop/shared-state.d.ts.map +1 -1
- package/dist/interop/shared-state.js +58 -7
- package/dist/interop/shared-state.js.map +1 -1
- package/dist/lib/__tests__/worktree-paths.test.js +250 -1
- package/dist/lib/__tests__/worktree-paths.test.js.map +1 -1
- package/dist/lib/job-state-db.d.ts +150 -0
- package/dist/lib/job-state-db.d.ts.map +1 -0
- package/dist/lib/job-state-db.js +650 -0
- package/dist/lib/job-state-db.js.map +1 -0
- package/dist/lib/mode-names.d.ts +46 -0
- package/dist/lib/mode-names.d.ts.map +1 -0
- package/dist/lib/mode-names.js +73 -0
- package/dist/lib/mode-names.js.map +1 -0
- package/dist/lib/session-isolation.d.ts +32 -0
- package/dist/lib/session-isolation.d.ts.map +1 -0
- package/dist/lib/session-isolation.js +39 -0
- package/dist/lib/session-isolation.js.map +1 -0
- package/dist/lib/worktree-paths.d.ts +38 -8
- package/dist/lib/worktree-paths.d.ts.map +1 -1
- package/dist/lib/worktree-paths.js +124 -56
- package/dist/lib/worktree-paths.js.map +1 -1
- package/dist/mcp/__tests__/team-cleanup.test.d.ts +11 -0
- package/dist/mcp/__tests__/team-cleanup.test.d.ts.map +1 -0
- package/dist/mcp/__tests__/team-cleanup.test.js +228 -0
- package/dist/mcp/__tests__/team-cleanup.test.js.map +1 -0
- package/dist/mcp/cli-detection.d.ts +4 -8
- package/dist/mcp/cli-detection.d.ts.map +1 -1
- package/dist/mcp/cli-detection.js +5 -8
- package/dist/mcp/cli-detection.js.map +1 -1
- package/dist/mcp/codex-request-normalizer.js +59 -0
- package/dist/mcp/codex-server.js +16 -4
- package/dist/mcp/codex-standalone-server.js +13 -4
- package/dist/mcp/index.d.ts +2 -4
- package/dist/mcp/index.d.ts.map +1 -1
- package/dist/mcp/index.js +1 -5
- package/dist/mcp/index.js.map +1 -1
- package/dist/mcp/job-management.d.ts.map +1 -1
- package/dist/mcp/job-management.js +11 -9
- package/dist/mcp/job-management.js.map +1 -1
- package/dist/mcp/job-state-db.d.ts +1 -149
- package/dist/mcp/job-state-db.d.ts.map +1 -1
- package/dist/mcp/job-state-db.js +2 -649
- package/dist/mcp/job-state-db.js.map +1 -1
- package/dist/mcp/mcp-config.d.ts +1 -1
- package/dist/mcp/mcp-config.js +1 -1
- package/dist/mcp/prompt-injection.d.ts +14 -76
- package/dist/mcp/prompt-injection.d.ts.map +1 -1
- package/dist/mcp/prompt-injection.js +34 -175
- package/dist/mcp/prompt-injection.js.map +1 -1
- package/dist/mcp/standalone-server.js +2 -0
- package/dist/mcp/standalone-server.js.map +1 -1
- package/dist/mcp/team-server.d.ts +16 -0
- package/dist/mcp/team-server.d.ts.map +1 -0
- package/dist/mcp/team-server.js +356 -0
- package/dist/mcp/team-server.js.map +1 -0
- package/dist/notifications/__tests__/formatter.test.js +62 -0
- package/dist/notifications/__tests__/formatter.test.js.map +1 -1
- package/dist/notifications/__tests__/hook-config.test.d.ts +14 -0
- package/dist/notifications/__tests__/hook-config.test.d.ts.map +1 -0
- package/dist/notifications/__tests__/hook-config.test.js +210 -0
- package/dist/notifications/__tests__/hook-config.test.js.map +1 -0
- package/dist/notifications/__tests__/platform-gating.test.d.ts +12 -0
- package/dist/notifications/__tests__/platform-gating.test.d.ts.map +1 -0
- package/dist/notifications/__tests__/platform-gating.test.js +140 -0
- package/dist/notifications/__tests__/platform-gating.test.js.map +1 -0
- package/dist/notifications/__tests__/template-engine.test.d.ts +13 -0
- package/dist/notifications/__tests__/template-engine.test.d.ts.map +1 -0
- package/dist/notifications/__tests__/template-engine.test.js +378 -0
- package/dist/notifications/__tests__/template-engine.test.js.map +1 -0
- package/dist/notifications/config.d.ts.map +1 -1
- package/dist/notifications/config.js +54 -18
- package/dist/notifications/config.js.map +1 -1
- package/dist/notifications/dispatcher.d.ts +2 -2
- package/dist/notifications/dispatcher.d.ts.map +1 -1
- package/dist/notifications/dispatcher.js +10 -6
- package/dist/notifications/dispatcher.js.map +1 -1
- package/dist/notifications/formatter.d.ts.map +1 -1
- package/dist/notifications/formatter.js +22 -0
- package/dist/notifications/formatter.js.map +1 -1
- package/dist/notifications/hook-config-types.d.ts +44 -0
- package/dist/notifications/hook-config-types.d.ts.map +1 -0
- package/dist/notifications/hook-config-types.js +8 -0
- package/dist/notifications/hook-config-types.js.map +1 -0
- package/dist/notifications/hook-config.d.ts +36 -0
- package/dist/notifications/hook-config.d.ts.map +1 -0
- package/dist/notifications/hook-config.js +95 -0
- package/dist/notifications/hook-config.js.map +1 -0
- package/dist/notifications/index.d.ts +3 -0
- package/dist/notifications/index.d.ts.map +1 -1
- package/dist/notifications/index.js +31 -3
- package/dist/notifications/index.js.map +1 -1
- package/dist/notifications/reply-listener.d.ts.map +1 -1
- package/dist/notifications/reply-listener.js +1 -0
- package/dist/notifications/reply-listener.js.map +1 -1
- package/dist/notifications/session-registry.d.ts.map +1 -1
- package/dist/notifications/session-registry.js +13 -5
- package/dist/notifications/session-registry.js.map +1 -1
- package/dist/notifications/template-engine.d.ts +34 -0
- package/dist/notifications/template-engine.d.ts.map +1 -0
- package/dist/notifications/template-engine.js +248 -0
- package/dist/notifications/template-engine.js.map +1 -0
- package/dist/notifications/types.d.ts +0 -2
- package/dist/notifications/types.d.ts.map +1 -1
- package/dist/openclaw/__tests__/config.test.d.ts +2 -0
- package/dist/openclaw/__tests__/config.test.d.ts.map +1 -0
- package/dist/openclaw/__tests__/config.test.js +200 -0
- package/dist/openclaw/__tests__/config.test.js.map +1 -0
- package/dist/openclaw/__tests__/dispatcher.test.d.ts +2 -0
- package/dist/openclaw/__tests__/dispatcher.test.d.ts.map +1 -0
- package/dist/openclaw/__tests__/dispatcher.test.js +348 -0
- package/dist/openclaw/__tests__/dispatcher.test.js.map +1 -0
- package/dist/openclaw/__tests__/index.test.d.ts +2 -0
- package/dist/openclaw/__tests__/index.test.d.ts.map +1 -0
- package/dist/openclaw/__tests__/index.test.js +235 -0
- package/dist/openclaw/__tests__/index.test.js.map +1 -0
- package/dist/openclaw/config.d.ts +33 -0
- package/dist/openclaw/config.d.ts.map +1 -0
- package/dist/openclaw/config.js +83 -0
- package/dist/openclaw/config.js.map +1 -0
- package/dist/openclaw/dispatcher.d.ts +47 -0
- package/dist/openclaw/dispatcher.d.ts.map +1 -0
- package/dist/openclaw/dispatcher.js +138 -0
- package/dist/openclaw/dispatcher.js.map +1 -0
- package/dist/openclaw/index.d.ts +25 -0
- package/dist/openclaw/index.d.ts.map +1 -0
- package/dist/openclaw/index.js +132 -0
- package/dist/openclaw/index.js.map +1 -0
- package/dist/openclaw/types.d.ts +102 -0
- package/dist/openclaw/types.d.ts.map +1 -0
- package/dist/openclaw/types.js +8 -0
- package/dist/openclaw/types.js.map +1 -0
- package/dist/platform/index.d.ts +5 -0
- package/dist/platform/index.d.ts.map +1 -1
- package/dist/platform/index.js +17 -0
- package/dist/platform/index.js.map +1 -1
- package/dist/platform/process-utils.d.ts.map +1 -1
- package/dist/platform/process-utils.js +55 -9
- package/dist/platform/process-utils.js.map +1 -1
- package/dist/shared/types.d.ts +7 -5
- package/dist/shared/types.d.ts.map +1 -1
- package/dist/team/__tests__/bridge-integration.test.js +10 -8
- package/dist/team/__tests__/bridge-integration.test.js.map +1 -1
- package/dist/team/__tests__/edge-cases.test.js +40 -29
- package/dist/team/__tests__/edge-cases.test.js.map +1 -1
- package/dist/team/__tests__/idle-nudge.test.d.ts +11 -0
- package/dist/team/__tests__/idle-nudge.test.d.ts.map +1 -0
- package/dist/team/__tests__/idle-nudge.test.js +282 -0
- package/dist/team/__tests__/idle-nudge.test.js.map +1 -0
- package/dist/team/__tests__/mcp-team-bridge.spawn-args.test.js +2 -2
- package/dist/team/__tests__/mcp-team-bridge.spawn-args.test.js.map +1 -1
- package/dist/team/__tests__/mcp-team-bridge.usage.test.d.ts +2 -0
- package/dist/team/__tests__/mcp-team-bridge.usage.test.d.ts.map +1 -0
- package/dist/team/__tests__/mcp-team-bridge.usage.test.js +49 -0
- package/dist/team/__tests__/mcp-team-bridge.usage.test.js.map +1 -0
- package/dist/team/__tests__/model-contract.test.d.ts +2 -0
- package/dist/team/__tests__/model-contract.test.d.ts.map +1 -0
- package/dist/team/__tests__/model-contract.test.js +121 -0
- package/dist/team/__tests__/model-contract.test.js.map +1 -0
- package/dist/team/__tests__/phase-controller.test.d.ts +2 -0
- package/dist/team/__tests__/phase-controller.test.d.ts.map +1 -0
- package/dist/team/__tests__/phase-controller.test.js +45 -0
- package/dist/team/__tests__/phase-controller.test.js.map +1 -0
- package/dist/team/__tests__/runtime-assign.test.d.ts +2 -0
- package/dist/team/__tests__/runtime-assign.test.d.ts.map +1 -0
- package/dist/team/__tests__/runtime-assign.test.js +43 -0
- package/dist/team/__tests__/runtime-assign.test.js.map +1 -0
- package/dist/team/__tests__/runtime-gemini-prompt.test.d.ts +2 -0
- package/dist/team/__tests__/runtime-gemini-prompt.test.d.ts.map +1 -0
- package/dist/team/__tests__/runtime-gemini-prompt.test.js +153 -0
- package/dist/team/__tests__/runtime-gemini-prompt.test.js.map +1 -0
- package/dist/team/__tests__/runtime-prompt-mode.test.d.ts +2 -0
- package/dist/team/__tests__/runtime-prompt-mode.test.d.ts.map +1 -0
- package/dist/team/__tests__/runtime-prompt-mode.test.js +162 -0
- package/dist/team/__tests__/runtime-prompt-mode.test.js.map +1 -0
- package/dist/team/__tests__/runtime.test.d.ts +2 -0
- package/dist/team/__tests__/runtime.test.d.ts.map +1 -0
- package/dist/team/__tests__/runtime.test.js +37 -0
- package/dist/team/__tests__/runtime.test.js.map +1 -0
- package/dist/team/__tests__/task-file-ops.test.js +63 -59
- package/dist/team/__tests__/task-file-ops.test.js.map +1 -1
- package/dist/team/__tests__/team-name.test.d.ts +2 -0
- package/dist/team/__tests__/team-name.test.d.ts.map +1 -0
- package/dist/team/__tests__/team-name.test.js +18 -0
- package/dist/team/__tests__/team-name.test.js.map +1 -0
- package/dist/team/__tests__/team-status.test.js +52 -6
- package/dist/team/__tests__/team-status.test.js.map +1 -1
- package/dist/team/__tests__/tmux-comm.test.d.ts +2 -0
- package/dist/team/__tests__/tmux-comm.test.d.ts.map +1 -0
- package/dist/team/__tests__/tmux-comm.test.js +26 -0
- package/dist/team/__tests__/tmux-comm.test.js.map +1 -0
- package/dist/team/__tests__/tmux-session.create-team.test.d.ts +2 -0
- package/dist/team/__tests__/tmux-session.create-team.test.d.ts.map +1 -0
- package/dist/team/__tests__/tmux-session.create-team.test.js +104 -0
- package/dist/team/__tests__/tmux-session.create-team.test.js.map +1 -0
- package/dist/team/__tests__/tmux-session.spawn.test.d.ts +2 -0
- package/dist/team/__tests__/tmux-session.spawn.test.d.ts.map +1 -0
- package/dist/team/__tests__/tmux-session.spawn.test.js +61 -0
- package/dist/team/__tests__/tmux-session.spawn.test.js.map +1 -0
- package/dist/team/__tests__/tmux-session.test.js +161 -2
- package/dist/team/__tests__/tmux-session.test.js.map +1 -1
- package/dist/team/__tests__/worker-bootstrap.test.d.ts +2 -0
- package/dist/team/__tests__/worker-bootstrap.test.d.ts.map +1 -0
- package/dist/team/__tests__/worker-bootstrap.test.js +58 -0
- package/dist/team/__tests__/worker-bootstrap.test.js.map +1 -0
- package/dist/team/bridge-entry.d.ts.map +1 -1
- package/dist/team/bridge-entry.js +4 -0
- package/dist/team/bridge-entry.js.map +1 -1
- package/dist/team/capabilities.d.ts.map +1 -1
- package/dist/team/capabilities.js +3 -0
- package/dist/team/capabilities.js.map +1 -1
- package/dist/team/cli-detection.d.ts +9 -0
- package/dist/team/cli-detection.d.ts.map +1 -0
- package/dist/team/cli-detection.js +29 -0
- package/dist/team/cli-detection.js.map +1 -0
- package/dist/team/idle-nudge.d.ts +53 -0
- package/dist/team/idle-nudge.d.ts.map +1 -0
- package/dist/team/idle-nudge.js +124 -0
- package/dist/team/idle-nudge.js.map +1 -0
- package/dist/team/inbox-outbox.d.ts.map +1 -1
- package/dist/team/inbox-outbox.js +7 -3
- package/dist/team/inbox-outbox.js.map +1 -1
- package/dist/team/index.d.ts +14 -1
- package/dist/team/index.d.ts.map +1 -1
- package/dist/team/index.js +12 -1
- package/dist/team/index.js.map +1 -1
- package/dist/team/mcp-team-bridge.d.ts +9 -0
- package/dist/team/mcp-team-bridge.d.ts.map +1 -1
- package/dist/team/mcp-team-bridge.js +82 -3
- package/dist/team/mcp-team-bridge.js.map +1 -1
- package/dist/team/model-contract.d.ts +37 -0
- package/dist/team/model-contract.d.ts.map +1 -0
- package/dist/team/model-contract.js +139 -0
- package/dist/team/model-contract.js.map +1 -0
- package/dist/team/phase-controller.d.ts +33 -0
- package/dist/team/phase-controller.d.ts.map +1 -0
- package/dist/team/phase-controller.js +79 -0
- package/dist/team/phase-controller.js.map +1 -0
- package/dist/team/runtime-cli.d.ts +9 -0
- package/dist/team/runtime-cli.d.ts.map +1 -0
- package/dist/team/runtime-cli.js +188 -0
- package/dist/team/runtime-cli.js.map +1 -0
- package/dist/team/runtime.d.ts +95 -0
- package/dist/team/runtime.d.ts.map +1 -0
- package/dist/team/runtime.js +692 -0
- package/dist/team/runtime.js.map +1 -0
- package/dist/team/state-paths.d.ts +72 -0
- package/dist/team/state-paths.d.ts.map +1 -0
- package/dist/team/state-paths.js +87 -0
- package/dist/team/state-paths.js.map +1 -0
- package/dist/team/task-file-ops.d.ts +27 -7
- package/dist/team/task-file-ops.d.ts.map +1 -1
- package/dist/team/task-file-ops.js +116 -55
- package/dist/team/task-file-ops.js.map +1 -1
- package/dist/team/team-name.d.ts +2 -0
- package/dist/team/team-name.d.ts.map +1 -0
- package/dist/team/team-name.js +8 -0
- package/dist/team/team-name.js.map +1 -0
- package/dist/team/team-registration.d.ts +1 -1
- package/dist/team/team-registration.d.ts.map +1 -1
- package/dist/team/team-registration.js.map +1 -1
- package/dist/team/team-status.d.ts +11 -1
- package/dist/team/team-status.d.ts.map +1 -1
- package/dist/team/team-status.js +32 -3
- package/dist/team/team-status.js.map +1 -1
- package/dist/team/tmux-comm.d.ts +36 -0
- package/dist/team/tmux-comm.d.ts.map +1 -0
- package/dist/team/tmux-comm.js +115 -0
- package/dist/team/tmux-comm.js.map +1 -0
- package/dist/team/tmux-session.d.ts +92 -0
- package/dist/team/tmux-session.d.ts.map +1 -1
- package/dist/team/tmux-session.js +533 -2
- package/dist/team/tmux-session.js.map +1 -1
- package/dist/team/types.d.ts +10 -3
- package/dist/team/types.d.ts.map +1 -1
- package/dist/team/unified-team.d.ts.map +1 -1
- package/dist/team/unified-team.js +13 -3
- package/dist/team/unified-team.js.map +1 -1
- package/dist/team/worker-bootstrap.d.ts +39 -0
- package/dist/team/worker-bootstrap.d.ts.map +1 -0
- package/dist/team/worker-bootstrap.js +117 -0
- package/dist/team/worker-bootstrap.js.map +1 -0
- package/dist/team/worker-health.d.ts.map +1 -1
- package/dist/team/worker-health.js +15 -3
- package/dist/team/worker-health.js.map +1 -1
- package/dist/tools/ast-tools.js +1 -1
- package/dist/tools/ast-tools.js.map +1 -1
- package/dist/tools/diagnostics/lsp-aggregator.d.ts.map +1 -1
- package/dist/tools/diagnostics/lsp-aggregator.js +4 -2
- package/dist/tools/diagnostics/lsp-aggregator.js.map +1 -1
- package/dist/tools/lsp/__tests__/client-handle-data.test.d.ts +2 -0
- package/dist/tools/lsp/__tests__/client-handle-data.test.d.ts.map +1 -0
- package/dist/tools/lsp/__tests__/client-handle-data.test.js +138 -0
- package/dist/tools/lsp/__tests__/client-handle-data.test.js.map +1 -0
- package/dist/tools/lsp/client.d.ts +13 -0
- package/dist/tools/lsp/client.d.ts.map +1 -1
- package/dist/tools/lsp/client.js +64 -8
- package/dist/tools/lsp/client.js.map +1 -1
- package/dist/tools/lsp/servers.d.ts.map +1 -1
- package/dist/tools/lsp/servers.js +4 -9
- package/dist/tools/lsp/servers.js.map +1 -1
- package/dist/tools/lsp-tools.d.ts.map +1 -1
- package/dist/tools/lsp-tools.js +4 -0
- package/dist/tools/lsp-tools.js.map +1 -1
- package/dist/tools/python-repl/bridge-manager.d.ts.map +1 -1
- package/dist/tools/python-repl/bridge-manager.js +15 -1
- package/dist/tools/python-repl/bridge-manager.js.map +1 -1
- package/dist/tools/python-repl/session-lock.d.ts.map +1 -1
- package/dist/tools/python-repl/session-lock.js +35 -15
- package/dist/tools/python-repl/session-lock.js.map +1 -1
- package/dist/tools/state-tools.d.ts.map +1 -1
- package/dist/tools/state-tools.js +10 -0
- package/dist/tools/state-tools.js.map +1 -1
- package/dist/utils/__tests__/frontmatter.test.d.ts +2 -0
- package/dist/utils/__tests__/frontmatter.test.d.ts.map +1 -0
- package/dist/utils/__tests__/frontmatter.test.js +147 -0
- package/dist/utils/__tests__/frontmatter.test.js.map +1 -0
- package/dist/utils/frontmatter.d.ts +24 -0
- package/dist/utils/frontmatter.d.ts.map +1 -0
- package/dist/utils/frontmatter.js +62 -0
- package/dist/utils/frontmatter.js.map +1 -0
- package/dist/utils/paths.d.ts.map +1 -1
- package/dist/utils/paths.js +4 -2
- package/dist/utils/paths.js.map +1 -1
- package/dist/utils/string-width.d.ts.map +1 -1
- package/dist/utils/string-width.js +15 -4
- package/dist/utils/string-width.js.map +1 -1
- package/dist/verification/tier-selector.js +1 -1
- package/dist/verification/tier-selector.js.map +1 -1
- package/docs/AGENTS.md +4 -2
- package/docs/CLAUDE.md +8 -48
- package/docs/MIGRATION.md +114 -0
- package/docs/REFERENCE.md +35 -102
- package/hooks/hooks.json +23 -23
- package/package.json +8 -8
- package/scripts/build-runtime-cli.mjs +24 -0
- package/scripts/build-team-server.mjs +28 -0
- package/scripts/cleanup-orphans.mjs +22 -5
- package/scripts/context-safety.mjs +5 -1
- package/scripts/demo-team.mjs +26 -0
- package/scripts/keyword-detector.mjs +6 -76
- package/scripts/openclaw-gateway-demo.mjs +168 -0
- package/scripts/persistent-mode.cjs +30 -4
- package/scripts/persistent-mode.mjs +48 -3
- package/scripts/plugin-setup.mjs +66 -3
- package/scripts/post-tool-use-failure.mjs +20 -2
- package/scripts/post-tool-verifier.mjs +57 -6
- package/scripts/pre-tool-enforcer.mjs +125 -5
- package/scripts/run.cjs +114 -0
- package/scripts/session-start.mjs +56 -7
- package/scripts/status.mjs +144 -0
- package/scripts/test-codex-gemini-team.mjs +78 -0
- package/skills/AGENTS.md +5 -2
- package/skills/analyze/SKILL.md +5 -11
- package/skills/autopilot/SKILL.md +5 -6
- package/skills/ccg/SKILL.md +88 -99
- package/skills/configure-notifications/SKILL.md +177 -0
- package/skills/configure-openclaw/SKILL.md +320 -0
- package/skills/external-context/SKILL.md +7 -83
- package/skills/hud/SKILL.md +68 -46
- package/skills/omc-setup/SKILL.md +58 -19
- package/skills/omc-teams/SKILL.md +178 -0
- package/skills/pipeline/SKILL.md +4 -4
- package/skills/plan/SKILL.md +28 -16
- package/skills/ralph/SKILL.md +3 -4
- package/skills/ralph-init/SKILL.md +3 -1
- package/skills/ralplan/SKILL.md +93 -8
- package/skills/security-review/SKILL.md +5 -6
- package/skills/tdd/SKILL.md +5 -6
- package/skills/team/SKILL.md +35 -34
- package/templates/hooks/keyword-detector.mjs +11 -82
- package/templates/hooks/persistent-mode.mjs +120 -3
- package/templates/hooks/post-tool-use-failure.mjs +20 -2
- package/templates/hooks/session-start.mjs +2 -16
- package/dist/__tests__/analytics/backfill-dedup.test.d.ts +0 -2
- package/dist/__tests__/analytics/backfill-dedup.test.d.ts.map +0 -1
- package/dist/__tests__/analytics/backfill-dedup.test.js +0 -179
- package/dist/__tests__/analytics/backfill-dedup.test.js.map +0 -1
- package/dist/__tests__/analytics/backfill-engine.test.d.ts +0 -2
- package/dist/__tests__/analytics/backfill-engine.test.d.ts.map +0 -1
- package/dist/__tests__/analytics/backfill-engine.test.js +0 -362
- package/dist/__tests__/analytics/backfill-engine.test.js.map +0 -1
- package/dist/__tests__/analytics/output-estimator.test.d.ts +0 -2
- package/dist/__tests__/analytics/output-estimator.test.d.ts.map +0 -1
- package/dist/__tests__/analytics/output-estimator.test.js +0 -124
- package/dist/__tests__/analytics/output-estimator.test.js.map +0 -1
- package/dist/__tests__/analytics/token-extractor.test.d.ts +0 -2
- package/dist/__tests__/analytics/token-extractor.test.d.ts.map +0 -1
- package/dist/__tests__/analytics/token-extractor.test.js +0 -165
- package/dist/__tests__/analytics/token-extractor.test.js.map +0 -1
- package/dist/__tests__/analytics/token-tracker.test.d.ts +0 -2
- package/dist/__tests__/analytics/token-tracker.test.d.ts.map +0 -1
- package/dist/__tests__/analytics/token-tracker.test.js +0 -189
- package/dist/__tests__/analytics/token-tracker.test.js.map +0 -1
- package/dist/__tests__/analytics/tokscale-adapter.test.d.ts +0 -2
- package/dist/__tests__/analytics/tokscale-adapter.test.d.ts.map +0 -1
- package/dist/__tests__/analytics/tokscale-adapter.test.js +0 -79
- package/dist/__tests__/analytics/tokscale-adapter.test.js.map +0 -1
- package/dist/__tests__/analytics/transcript-parser.test.d.ts +0 -2
- package/dist/__tests__/analytics/transcript-parser.test.d.ts.map +0 -1
- package/dist/__tests__/analytics/transcript-parser.test.js +0 -285
- package/dist/__tests__/analytics/transcript-parser.test.js.map +0 -1
- package/dist/__tests__/analytics/transcript-scanner.test.d.ts +0 -2
- package/dist/__tests__/analytics/transcript-scanner.test.d.ts.map +0 -1
- package/dist/__tests__/analytics/transcript-scanner.test.js +0 -443
- package/dist/__tests__/analytics/transcript-scanner.test.js.map +0 -1
- package/dist/__tests__/analytics/transcript-token-extractor.test.d.ts +0 -2
- package/dist/__tests__/analytics/transcript-token-extractor.test.d.ts.map +0 -1
- package/dist/__tests__/analytics/transcript-token-extractor.test.js +0 -177
- package/dist/__tests__/analytics/transcript-token-extractor.test.js.map +0 -1
- package/dist/analytics/analytics-summary.d.ts +0 -47
- package/dist/analytics/analytics-summary.d.ts.map +0 -1
- package/dist/analytics/analytics-summary.js +0 -171
- package/dist/analytics/analytics-summary.js.map +0 -1
- package/dist/analytics/backfill-dedup.d.ts +0 -49
- package/dist/analytics/backfill-dedup.d.ts.map +0 -1
- package/dist/analytics/backfill-dedup.js +0 -115
- package/dist/analytics/backfill-dedup.js.map +0 -1
- package/dist/analytics/backfill-engine.d.ts +0 -59
- package/dist/analytics/backfill-engine.d.ts.map +0 -1
- package/dist/analytics/backfill-engine.js +0 -172
- package/dist/analytics/backfill-engine.js.map +0 -1
- package/dist/analytics/cost-estimator.d.ts +0 -29
- package/dist/analytics/cost-estimator.d.ts.map +0 -1
- package/dist/analytics/cost-estimator.js +0 -135
- package/dist/analytics/cost-estimator.js.map +0 -1
- package/dist/analytics/export.d.ts +0 -7
- package/dist/analytics/export.d.ts.map +0 -1
- package/dist/analytics/export.js +0 -93
- package/dist/analytics/export.js.map +0 -1
- package/dist/analytics/index.d.ts +0 -24
- package/dist/analytics/index.d.ts.map +0 -1
- package/dist/analytics/index.js +0 -30
- package/dist/analytics/index.js.map +0 -1
- package/dist/analytics/metrics-collector.d.ts +0 -30
- package/dist/analytics/metrics-collector.d.ts.map +0 -1
- package/dist/analytics/metrics-collector.js +0 -96
- package/dist/analytics/metrics-collector.js.map +0 -1
- package/dist/analytics/output-estimator.d.ts +0 -26
- package/dist/analytics/output-estimator.d.ts.map +0 -1
- package/dist/analytics/output-estimator.js +0 -65
- package/dist/analytics/output-estimator.js.map +0 -1
- package/dist/analytics/query-engine.d.ts +0 -35
- package/dist/analytics/query-engine.d.ts.map +0 -1
- package/dist/analytics/query-engine.js +0 -239
- package/dist/analytics/query-engine.js.map +0 -1
- package/dist/analytics/session-catalog.d.ts +0 -45
- package/dist/analytics/session-catalog.d.ts.map +0 -1
- package/dist/analytics/session-catalog.js +0 -153
- package/dist/analytics/session-catalog.js.map +0 -1
- package/dist/analytics/session-manager.d.ts +0 -58
- package/dist/analytics/session-manager.d.ts.map +0 -1
- package/dist/analytics/session-manager.js +0 -396
- package/dist/analytics/session-manager.js.map +0 -1
- package/dist/analytics/session-types.d.ts +0 -37
- package/dist/analytics/session-types.d.ts.map +0 -1
- package/dist/analytics/session-types.js +0 -2
- package/dist/analytics/session-types.js.map +0 -1
- package/dist/analytics/token-extractor.d.ts +0 -31
- package/dist/analytics/token-extractor.d.ts.map +0 -1
- package/dist/analytics/token-extractor.js +0 -57
- package/dist/analytics/token-extractor.js.map +0 -1
- package/dist/analytics/token-tracker.d.ts +0 -33
- package/dist/analytics/token-tracker.d.ts.map +0 -1
- package/dist/analytics/token-tracker.js +0 -443
- package/dist/analytics/token-tracker.js.map +0 -1
- package/dist/analytics/tokscale-adapter.d.ts +0 -71
- package/dist/analytics/tokscale-adapter.d.ts.map +0 -1
- package/dist/analytics/tokscale-adapter.js +0 -223
- package/dist/analytics/tokscale-adapter.js.map +0 -1
- package/dist/analytics/transcript-parser.d.ts +0 -42
- package/dist/analytics/transcript-parser.d.ts.map +0 -1
- package/dist/analytics/transcript-parser.js +0 -90
- package/dist/analytics/transcript-parser.js.map +0 -1
- package/dist/analytics/transcript-scanner.d.ts +0 -51
- package/dist/analytics/transcript-scanner.d.ts.map +0 -1
- package/dist/analytics/transcript-scanner.js +0 -279
- package/dist/analytics/transcript-scanner.js.map +0 -1
- package/dist/analytics/transcript-token-extractor.d.ts +0 -35
- package/dist/analytics/transcript-token-extractor.d.ts.map +0 -1
- package/dist/analytics/transcript-token-extractor.js +0 -136
- package/dist/analytics/transcript-token-extractor.js.map +0 -1
- package/dist/analytics/types.d.ts +0 -119
- package/dist/analytics/types.d.ts.map +0 -1
- package/dist/analytics/types.js +0 -32
- package/dist/analytics/types.js.map +0 -1
- package/dist/cli/analytics.d.ts +0 -3
- package/dist/cli/analytics.d.ts.map +0 -1
- package/dist/cli/analytics.js +0 -105
- package/dist/cli/analytics.js.map +0 -1
- package/dist/cli/commands/agents.d.ts +0 -5
- package/dist/cli/commands/agents.d.ts.map +0 -1
- package/dist/cli/commands/agents.js +0 -31
- package/dist/cli/commands/agents.js.map +0 -1
- package/dist/cli/commands/backfill.d.ts +0 -15
- package/dist/cli/commands/backfill.d.ts.map +0 -1
- package/dist/cli/commands/backfill.js +0 -146
- package/dist/cli/commands/backfill.js.map +0 -1
- package/dist/cli/commands/cleanup.d.ts +0 -4
- package/dist/cli/commands/cleanup.d.ts.map +0 -1
- package/dist/cli/commands/cleanup.js +0 -31
- package/dist/cli/commands/cleanup.js.map +0 -1
- package/dist/cli/commands/cost.d.ts +0 -4
- package/dist/cli/commands/cost.d.ts.map +0 -1
- package/dist/cli/commands/cost.js +0 -53
- package/dist/cli/commands/cost.js.map +0 -1
- package/dist/cli/commands/export.d.ts +0 -5
- package/dist/cli/commands/export.d.ts.map +0 -1
- package/dist/cli/commands/export.js +0 -30
- package/dist/cli/commands/export.js.map +0 -1
- package/dist/cli/commands/sessions.d.ts +0 -5
- package/dist/cli/commands/sessions.d.ts.map +0 -1
- package/dist/cli/commands/sessions.js +0 -89
- package/dist/cli/commands/sessions.js.map +0 -1
- package/dist/cli/commands/stats.d.ts +0 -5
- package/dist/cli/commands/stats.d.ts.map +0 -1
- package/dist/cli/commands/stats.js +0 -84
- package/dist/cli/commands/stats.js.map +0 -1
- package/dist/cli/utils/tokscale-launcher.d.ts +0 -25
- package/dist/cli/utils/tokscale-launcher.d.ts.map +0 -1
- package/dist/cli/utils/tokscale-launcher.js +0 -70
- package/dist/cli/utils/tokscale-launcher.js.map +0 -1
- package/dist/hud/analytics-display.d.ts +0 -63
- package/dist/hud/analytics-display.d.ts.map +0 -1
- package/dist/hud/analytics-display.js +0 -190
- package/dist/hud/analytics-display.js.map +0 -1
- package/scripts/build-codex-server.mjs +0 -95
|
@@ -149,10 +149,28 @@ async function main() {
|
|
|
149
149
|
// Write error state
|
|
150
150
|
writeErrorState(stateDir, toolName, inputPreview, error, retryCount);
|
|
151
151
|
|
|
152
|
-
|
|
152
|
+
// Inject continuation guidance so the model analyzes the error instead of stopping.
|
|
153
|
+
// Without this, PostToolUseFailure returns silently and the model may end its turn.
|
|
154
|
+
// The PostToolUse hook (post-tool-verifier.mjs) provides similar guidance for
|
|
155
|
+
// successful Bash calls with error patterns, but PostToolUseFailure is a separate
|
|
156
|
+
// event that needs its own guidance injection.
|
|
157
|
+
let guidance;
|
|
158
|
+
if (retryCount >= 5) {
|
|
159
|
+
guidance = `Tool "${toolName}" has failed ${retryCount} times. Stop retrying the same approach — try a different command, check dependencies, or ask the user for guidance.`;
|
|
160
|
+
} else {
|
|
161
|
+
guidance = `Tool "${toolName}" failed. Analyze the error, fix the issue, and continue working.`;
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
console.log(JSON.stringify({
|
|
165
|
+
continue: true,
|
|
166
|
+
hookSpecificOutput: {
|
|
167
|
+
hookEventName: 'PostToolUseFailure',
|
|
168
|
+
additionalContext: guidance,
|
|
169
|
+
},
|
|
170
|
+
}));
|
|
153
171
|
} catch (error) {
|
|
154
172
|
// Never block on hook errors
|
|
155
|
-
console.log(JSON.stringify({ continue: true
|
|
173
|
+
console.log(JSON.stringify({ continue: true }));
|
|
156
174
|
}
|
|
157
175
|
}
|
|
158
176
|
|
|
@@ -134,6 +134,47 @@ function stripClaudeTempCwdErrors(output) {
|
|
|
134
134
|
return output.replace(CLAUDE_TEMP_CWD_PATTERN, '');
|
|
135
135
|
}
|
|
136
136
|
|
|
137
|
+
// Pattern matching Claude Code's "Error: Exit code N" prefix line
|
|
138
|
+
const CLAUDE_EXIT_CODE_PREFIX = /^Error: Exit code \d+\s*$/gm;
|
|
139
|
+
|
|
140
|
+
/**
|
|
141
|
+
* Detect non-zero exit code with valid stdout (issue #960).
|
|
142
|
+
* Returns true when output has Claude Code's "Error: Exit code N" prefix
|
|
143
|
+
* AND substantial content that doesn't itself indicate real errors.
|
|
144
|
+
* Example: `gh pr checks` exits 8 (pending) but outputs valid CI status.
|
|
145
|
+
*/
|
|
146
|
+
export function isNonZeroExitWithOutput(output) {
|
|
147
|
+
if (!output) return false;
|
|
148
|
+
const cleaned = stripClaudeTempCwdErrors(output);
|
|
149
|
+
|
|
150
|
+
// Must contain Claude Code's exit code prefix
|
|
151
|
+
if (!CLAUDE_EXIT_CODE_PREFIX.test(cleaned)) return false;
|
|
152
|
+
// Reset regex state (global flag)
|
|
153
|
+
CLAUDE_EXIT_CODE_PREFIX.lastIndex = 0;
|
|
154
|
+
|
|
155
|
+
// Strip exit code prefix line(s) and check remaining content
|
|
156
|
+
const remaining = cleaned.replace(CLAUDE_EXIT_CODE_PREFIX, '').trim();
|
|
157
|
+
CLAUDE_EXIT_CODE_PREFIX.lastIndex = 0;
|
|
158
|
+
|
|
159
|
+
// Must have at least one non-empty line of real output
|
|
160
|
+
const contentLines = remaining.split('\n').filter(l => l.trim().length > 0);
|
|
161
|
+
if (contentLines.length === 0) return false;
|
|
162
|
+
|
|
163
|
+
// If remaining content has its own error indicators, it's a real failure
|
|
164
|
+
const contentErrorPatterns = [
|
|
165
|
+
/error:/i,
|
|
166
|
+
/failed/i,
|
|
167
|
+
/cannot/i,
|
|
168
|
+
/permission denied/i,
|
|
169
|
+
/command not found/i,
|
|
170
|
+
/no such file/i,
|
|
171
|
+
/fatal:/i,
|
|
172
|
+
/abort/i,
|
|
173
|
+
];
|
|
174
|
+
|
|
175
|
+
return !contentErrorPatterns.some(p => p.test(remaining));
|
|
176
|
+
}
|
|
177
|
+
|
|
137
178
|
// Detect failures in Bash output
|
|
138
179
|
export function detectBashFailure(output) {
|
|
139
180
|
const cleaned = stripClaudeTempCwdErrors(output);
|
|
@@ -206,14 +247,19 @@ function processRememberTags(output, directory) {
|
|
|
206
247
|
}
|
|
207
248
|
|
|
208
249
|
// Detect write failure
|
|
250
|
+
// Patterns are tightened to tool-level failure phrases to avoid false positives
|
|
251
|
+
// when edited file content contains error-handling code (issue #1005)
|
|
209
252
|
export function detectWriteFailure(output) {
|
|
210
253
|
const cleaned = stripClaudeTempCwdErrors(output);
|
|
211
254
|
const errorPatterns = [
|
|
212
|
-
|
|
213
|
-
/
|
|
214
|
-
|
|
215
|
-
/
|
|
216
|
-
/
|
|
255
|
+
/\berror:/i, // "error:" with word boundary — avoids "setError", "console.error"
|
|
256
|
+
/\bfailed to\b/i, // "failed to write" — avoids "failedOidc", UI strings
|
|
257
|
+
/\bwrite failed\b/i, // explicit write failure
|
|
258
|
+
/\boperation failed\b/i, // explicit operation failure
|
|
259
|
+
/permission denied/i, // keep as-is (specific enough)
|
|
260
|
+
/read-only/i, // keep as-is
|
|
261
|
+
/\bno such file\b/i, // more specific than "not found"
|
|
262
|
+
/\bdirectory not found\b/i,
|
|
217
263
|
];
|
|
218
264
|
|
|
219
265
|
return errorPatterns.some(pattern => pattern.test(cleaned));
|
|
@@ -251,7 +297,12 @@ function generateMessage(toolName, toolOutput, sessionId, toolCount, directory)
|
|
|
251
297
|
|
|
252
298
|
switch (toolName) {
|
|
253
299
|
case 'Bash':
|
|
254
|
-
if (
|
|
300
|
+
if (isNonZeroExitWithOutput(toolOutput)) {
|
|
301
|
+
// Non-zero exit with valid output — warning, not error (issue #960)
|
|
302
|
+
const exitMatch = toolOutput.match(/Exit code (\d+)/);
|
|
303
|
+
const code = exitMatch ? exitMatch[1] : 'non-zero';
|
|
304
|
+
message = `Command exited with code ${code} but produced valid output. This may be expected behavior.`;
|
|
305
|
+
} else if (detectBashFailure(toolOutput)) {
|
|
255
306
|
message = 'Command failed. Please investigate the error and fix before continuing.';
|
|
256
307
|
} else if (detectBackgroundOperation(toolOutput)) {
|
|
257
308
|
message = 'Background operation detected. Remember to verify results before proceeding.';
|
|
@@ -11,6 +11,17 @@ import { join } from 'path';
|
|
|
11
11
|
import { pathToFileURL } from 'url';
|
|
12
12
|
import { readStdin } from './lib/stdin.mjs';
|
|
13
13
|
|
|
14
|
+
const SESSION_ID_PATTERN = /^[a-zA-Z0-9][a-zA-Z0-9_-]{0,255}$/;
|
|
15
|
+
const MODE_STATE_FILES = [
|
|
16
|
+
'autopilot-state.json',
|
|
17
|
+
'ultrapilot-state.json',
|
|
18
|
+
'ralph-state.json',
|
|
19
|
+
'ultrawork-state.json',
|
|
20
|
+
'ultraqa-state.json',
|
|
21
|
+
'pipeline-state.json',
|
|
22
|
+
'team-state.json',
|
|
23
|
+
];
|
|
24
|
+
|
|
14
25
|
// Simple JSON field extraction
|
|
15
26
|
function extractJsonField(input, field, defaultValue = '') {
|
|
16
27
|
try {
|
|
@@ -74,8 +85,88 @@ function getTodoStatus(directory) {
|
|
|
74
85
|
return '';
|
|
75
86
|
}
|
|
76
87
|
|
|
88
|
+
function isValidSessionId(sessionId) {
|
|
89
|
+
return typeof sessionId === 'string' && SESSION_ID_PATTERN.test(sessionId);
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
function readJsonFile(filePath) {
|
|
93
|
+
try {
|
|
94
|
+
if (!existsSync(filePath)) return null;
|
|
95
|
+
return JSON.parse(readFileSync(filePath, 'utf-8'));
|
|
96
|
+
} catch {
|
|
97
|
+
return null;
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
function hasActiveJsonMode(stateDir, { allowSessionTagged = false } = {}) {
|
|
102
|
+
for (const file of MODE_STATE_FILES) {
|
|
103
|
+
const state = readJsonFile(join(stateDir, file));
|
|
104
|
+
if (!state || state.active !== true) continue;
|
|
105
|
+
if (!allowSessionTagged && state.session_id) continue;
|
|
106
|
+
return true;
|
|
107
|
+
}
|
|
108
|
+
return false;
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
function hasActiveSwarmMode(stateDir, { allowSessionTagged = false } = {}) {
|
|
112
|
+
const markerFile = join(stateDir, 'swarm-active.marker');
|
|
113
|
+
if (!existsSync(markerFile)) return false;
|
|
114
|
+
|
|
115
|
+
const summary = readJsonFile(join(stateDir, 'swarm-summary.json'));
|
|
116
|
+
if (!summary || summary.active !== true) return false;
|
|
117
|
+
if (!allowSessionTagged && summary.session_id) return false;
|
|
118
|
+
|
|
119
|
+
return true;
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
function hasActiveMode(directory, sessionId) {
|
|
123
|
+
const stateDir = join(directory, '.omc', 'state');
|
|
124
|
+
|
|
125
|
+
if (isValidSessionId(sessionId)) {
|
|
126
|
+
const sessionStateDir = join(stateDir, 'sessions', sessionId);
|
|
127
|
+
return (
|
|
128
|
+
hasActiveJsonMode(sessionStateDir, { allowSessionTagged: true }) ||
|
|
129
|
+
hasActiveSwarmMode(sessionStateDir, { allowSessionTagged: true })
|
|
130
|
+
);
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
return (
|
|
134
|
+
hasActiveJsonMode(stateDir, { allowSessionTagged: false }) ||
|
|
135
|
+
hasActiveSwarmMode(stateDir, { allowSessionTagged: false })
|
|
136
|
+
);
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
/**
|
|
140
|
+
* Check if team mode is active for the given directory/session.
|
|
141
|
+
* Reads team-state.json from session-scoped or legacy paths.
|
|
142
|
+
* Returns the team state object if active, null otherwise.
|
|
143
|
+
*/
|
|
144
|
+
function getActiveTeamState(directory, sessionId) {
|
|
145
|
+
const paths = [];
|
|
146
|
+
|
|
147
|
+
// Session-scoped path (preferred)
|
|
148
|
+
if (sessionId && SESSION_ID_PATTERN.test(sessionId)) {
|
|
149
|
+
paths.push(join(directory, '.omc', 'state', 'sessions', sessionId, 'team-state.json'));
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
// Legacy path
|
|
153
|
+
paths.push(join(directory, '.omc', 'state', 'team-state.json'));
|
|
154
|
+
|
|
155
|
+
for (const statePath of paths) {
|
|
156
|
+
const state = readJsonFile(statePath);
|
|
157
|
+
if (state && state.active === true) {
|
|
158
|
+
// Respect session isolation: skip state tagged to a different session
|
|
159
|
+
if (sessionId && state.session_id && state.session_id !== sessionId) {
|
|
160
|
+
continue;
|
|
161
|
+
}
|
|
162
|
+
return state;
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
return null;
|
|
166
|
+
}
|
|
167
|
+
|
|
77
168
|
// Generate agent spawn message with metadata
|
|
78
|
-
function generateAgentSpawnMessage(toolInput, directory, todoStatus) {
|
|
169
|
+
function generateAgentSpawnMessage(toolInput, directory, todoStatus, sessionId) {
|
|
79
170
|
if (!toolInput || typeof toolInput !== 'object') {
|
|
80
171
|
return `${todoStatus}Launch multiple agents in parallel when tasks are independent. Use run_in_background for long operations.`;
|
|
81
172
|
}
|
|
@@ -86,6 +177,20 @@ function generateAgentSpawnMessage(toolInput, directory, todoStatus) {
|
|
|
86
177
|
const bg = toolInput.run_in_background ? ' [BACKGROUND]' : '';
|
|
87
178
|
const tracking = getAgentTrackingInfo(directory);
|
|
88
179
|
|
|
180
|
+
// Team-routing enforcement (issue #1006):
|
|
181
|
+
// When team state is active and Task is called WITHOUT team_name,
|
|
182
|
+
// inject a redirect message to use team agents instead of subagents.
|
|
183
|
+
const teamState = getActiveTeamState(directory, sessionId);
|
|
184
|
+
if (teamState && !toolInput.team_name) {
|
|
185
|
+
const teamName = teamState.team_name || teamState.teamName || 'team';
|
|
186
|
+
return `[TEAM ROUTING REQUIRED] Team "${teamName}" is active but you are spawning a regular subagent ` +
|
|
187
|
+
`without team_name. You MUST use TeamCreate first (if not already created), then spawn teammates with ` +
|
|
188
|
+
`Task(team_name="${teamName}", name="worker-N", subagent_type="${agentType}"). ` +
|
|
189
|
+
`Do NOT use Task without team_name during an active team session. ` +
|
|
190
|
+
`If TeamCreate is not available in your tools, tell the user to verify ` +
|
|
191
|
+
`CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS=1 is set in ~/.claude/settings.json and restart Claude Code.`;
|
|
192
|
+
}
|
|
193
|
+
|
|
89
194
|
const parts = [`${todoStatus}Spawning agent: ${agentType} (${model})${bg}`];
|
|
90
195
|
if (desc) parts.push(`Task: ${desc}`);
|
|
91
196
|
if (tracking.running > 0) parts.push(`Active agents: ${tracking.running}`);
|
|
@@ -94,7 +199,7 @@ function generateAgentSpawnMessage(toolInput, directory, todoStatus) {
|
|
|
94
199
|
}
|
|
95
200
|
|
|
96
201
|
// Generate contextual message based on tool type
|
|
97
|
-
function generateMessage(toolName, todoStatus) {
|
|
202
|
+
function generateMessage(toolName, todoStatus, modeActive = false) {
|
|
98
203
|
const messages = {
|
|
99
204
|
TodoWrite: `${todoStatus}Mark todos in_progress BEFORE starting, completed IMMEDIATELY after finishing.`,
|
|
100
205
|
Bash: `${todoStatus}Use parallel execution for independent tasks. Use run_in_background for long operations (npm install, builds, tests).`,
|
|
@@ -105,7 +210,9 @@ function generateMessage(toolName, todoStatus) {
|
|
|
105
210
|
Glob: `${todoStatus}Combine searches in parallel when investigating multiple patterns.`,
|
|
106
211
|
};
|
|
107
212
|
|
|
108
|
-
|
|
213
|
+
if (messages[toolName]) return messages[toolName];
|
|
214
|
+
if (modeActive) return `${todoStatus}The boulder never stops. Continue until all tasks complete.`;
|
|
215
|
+
return '';
|
|
109
216
|
}
|
|
110
217
|
|
|
111
218
|
// Record Skill/Task invocations to flow trace (best-effort)
|
|
@@ -144,6 +251,14 @@ async function main() {
|
|
|
144
251
|
try { data = JSON.parse(input); } catch {}
|
|
145
252
|
recordToolInvocation(data, directory);
|
|
146
253
|
|
|
254
|
+
const sessionId =
|
|
255
|
+
typeof data.session_id === 'string'
|
|
256
|
+
? data.session_id
|
|
257
|
+
: typeof data.sessionId === 'string'
|
|
258
|
+
? data.sessionId
|
|
259
|
+
: '';
|
|
260
|
+
const modeActive = hasActiveMode(directory, sessionId);
|
|
261
|
+
|
|
147
262
|
// Send notification when AskUserQuestion is about to execute (user input needed)
|
|
148
263
|
// Fires in PreToolUse so users get notified BEFORE the tool blocks for input (#597)
|
|
149
264
|
if (toolName === 'AskUserQuestion') {
|
|
@@ -174,9 +289,14 @@ async function main() {
|
|
|
174
289
|
let message;
|
|
175
290
|
if (toolName === 'Task' || toolName === 'TaskCreate' || toolName === 'TaskUpdate') {
|
|
176
291
|
const toolInput = data.toolInput || data.tool_input || null;
|
|
177
|
-
message = generateAgentSpawnMessage(toolInput, directory, todoStatus);
|
|
292
|
+
message = generateAgentSpawnMessage(toolInput, directory, todoStatus, sessionId);
|
|
178
293
|
} else {
|
|
179
|
-
message = generateMessage(toolName, todoStatus);
|
|
294
|
+
message = generateMessage(toolName, todoStatus, modeActive);
|
|
295
|
+
}
|
|
296
|
+
|
|
297
|
+
if (!message) {
|
|
298
|
+
console.log(JSON.stringify({ continue: true, suppressOutput: true }));
|
|
299
|
+
return;
|
|
180
300
|
}
|
|
181
301
|
|
|
182
302
|
console.log(JSON.stringify({
|
package/scripts/run.cjs
ADDED
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
'use strict';
|
|
3
|
+
/**
|
|
4
|
+
* OMC Cross-platform hook runner (run.cjs)
|
|
5
|
+
*
|
|
6
|
+
* Uses process.execPath (the Node binary already running this script) to spawn
|
|
7
|
+
* the target .mjs hook, bypassing PATH / shell discovery issues.
|
|
8
|
+
*
|
|
9
|
+
* Replaces the `sh + find-node.sh` chain that fails on Windows because
|
|
10
|
+
* /usr/bin/sh is a PE32+ binary the OS refuses to execute natively.
|
|
11
|
+
* Fixes issues #909, #899, #892, #869.
|
|
12
|
+
*
|
|
13
|
+
* Usage (from hooks.json, after setup patches the absolute node path in):
|
|
14
|
+
* /abs/path/to/node "${CLAUDE_PLUGIN_ROOT}/scripts/run.cjs" \
|
|
15
|
+
* "${CLAUDE_PLUGIN_ROOT}/scripts/<hook>.mjs" [args...]
|
|
16
|
+
*
|
|
17
|
+
* During post-install setup, the leading `node` token is replaced with
|
|
18
|
+
* process.execPath so nvm/fnm users and Windows users all get the right binary.
|
|
19
|
+
*/
|
|
20
|
+
|
|
21
|
+
const { spawnSync } = require('child_process');
|
|
22
|
+
const { existsSync, realpathSync } = require('fs');
|
|
23
|
+
const { join, basename, dirname } = require('path');
|
|
24
|
+
|
|
25
|
+
const target = process.argv[2];
|
|
26
|
+
if (!target) {
|
|
27
|
+
// Nothing to run — exit cleanly so Claude Code hooks are never blocked.
|
|
28
|
+
process.exit(0);
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* Resolve the hook script target path, handling stale CLAUDE_PLUGIN_ROOT.
|
|
33
|
+
*
|
|
34
|
+
* When a plugin update replaces an old version directory with a symlink (or
|
|
35
|
+
* deletes it entirely), sessions that still reference the old version via
|
|
36
|
+
* CLAUDE_PLUGIN_ROOT will fail with MODULE_NOT_FOUND.
|
|
37
|
+
*
|
|
38
|
+
* Resolution strategy:
|
|
39
|
+
* 1. Use the target as-is if it exists.
|
|
40
|
+
* 2. Try resolving through realpathSync (follows symlinks).
|
|
41
|
+
* 3. Scan the plugin cache for the latest available version that has the
|
|
42
|
+
* same script name and use that instead.
|
|
43
|
+
* 4. If all else fails, return null (caller exits cleanly).
|
|
44
|
+
*
|
|
45
|
+
* See: https://github.com/Yeachan-Heo/oh-my-claudecode/issues/1007
|
|
46
|
+
*/
|
|
47
|
+
function resolveTarget(targetPath) {
|
|
48
|
+
// Fast path: target exists (common case)
|
|
49
|
+
if (existsSync(targetPath)) return targetPath;
|
|
50
|
+
|
|
51
|
+
// Try realpath resolution (handles broken symlinks that resolve elsewhere)
|
|
52
|
+
try {
|
|
53
|
+
const resolved = realpathSync(targetPath);
|
|
54
|
+
if (existsSync(resolved)) return resolved;
|
|
55
|
+
} catch {
|
|
56
|
+
// realpathSync throws if the path doesn't exist at all — expected
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
// Fallback: scan plugin cache for the same script in the latest version.
|
|
60
|
+
// CLAUDE_PLUGIN_ROOT is e.g. ~/.claude/plugins/cache/omc/oh-my-claudecode/4.2.14
|
|
61
|
+
// We look one level up for sibling version directories.
|
|
62
|
+
try {
|
|
63
|
+
const pluginRoot = process.env.CLAUDE_PLUGIN_ROOT;
|
|
64
|
+
if (!pluginRoot) return null;
|
|
65
|
+
|
|
66
|
+
const cacheBase = dirname(pluginRoot); // .../oh-my-claudecode/
|
|
67
|
+
const scriptRelative = targetPath.slice(pluginRoot.length); // /scripts/persistent-mode.cjs
|
|
68
|
+
|
|
69
|
+
if (!scriptRelative || !existsSync(cacheBase)) return null;
|
|
70
|
+
|
|
71
|
+
// Find version directories (real dirs or valid symlinks), pick latest
|
|
72
|
+
const { readdirSync, lstatSync, readlinkSync } = require('fs');
|
|
73
|
+
const entries = readdirSync(cacheBase).filter(v => /^\d+\.\d+\.\d+/.test(v));
|
|
74
|
+
|
|
75
|
+
// Sort descending by semver
|
|
76
|
+
entries.sort((a, b) => {
|
|
77
|
+
const pa = a.split('.').map(Number);
|
|
78
|
+
const pb = b.split('.').map(Number);
|
|
79
|
+
for (let i = 0; i < 3; i++) {
|
|
80
|
+
if ((pa[i] || 0) !== (pb[i] || 0)) return (pb[i] || 0) - (pa[i] || 0);
|
|
81
|
+
}
|
|
82
|
+
return 0;
|
|
83
|
+
});
|
|
84
|
+
|
|
85
|
+
for (const version of entries) {
|
|
86
|
+
const candidate = join(cacheBase, version) + scriptRelative;
|
|
87
|
+
if (existsSync(candidate)) return candidate;
|
|
88
|
+
}
|
|
89
|
+
} catch {
|
|
90
|
+
// Any error in fallback scan — give up gracefully
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
return null;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
const resolved = resolveTarget(target);
|
|
97
|
+
if (!resolved) {
|
|
98
|
+
// Target not found anywhere — exit cleanly so hooks are never blocked.
|
|
99
|
+
// This is the graceful fallback for stale CLAUDE_PLUGIN_ROOT paths.
|
|
100
|
+
process.exit(0);
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
const result = spawnSync(
|
|
104
|
+
process.execPath,
|
|
105
|
+
[resolved, ...process.argv.slice(3)],
|
|
106
|
+
{
|
|
107
|
+
stdio: 'inherit',
|
|
108
|
+
env: process.env,
|
|
109
|
+
windowsHide: true,
|
|
110
|
+
}
|
|
111
|
+
);
|
|
112
|
+
|
|
113
|
+
// Propagate the child exit code (null → 0 to avoid blocking hooks).
|
|
114
|
+
process.exit(result.status ?? 0);
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
* Cross-platform: Windows, macOS, Linux
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
|
-
import { existsSync, readFileSync, readdirSync, rmSync, mkdirSync, writeFileSync } from 'fs';
|
|
9
|
+
import { existsSync, readFileSync, readdirSync, rmSync, mkdirSync, writeFileSync, symlinkSync, lstatSync, readlinkSync, unlinkSync, renameSync } from 'fs';
|
|
10
10
|
import { join, dirname } from 'path';
|
|
11
11
|
import { homedir } from 'os';
|
|
12
12
|
import { fileURLToPath, pathToFileURL } from 'url';
|
|
@@ -414,7 +414,10 @@ ${cleanContent}
|
|
|
414
414
|
}
|
|
415
415
|
}
|
|
416
416
|
|
|
417
|
-
// Cleanup old plugin cache versions (keep latest 2)
|
|
417
|
+
// Cleanup old plugin cache versions (keep latest 2, symlink the rest)
|
|
418
|
+
// Instead of deleting old versions, replace them with symlinks to the latest.
|
|
419
|
+
// This prevents "Cannot find module" errors for sessions started before a
|
|
420
|
+
// plugin update whose CLAUDE_PLUGIN_ROOT still points to the old version.
|
|
418
421
|
try {
|
|
419
422
|
const cacheBase = join(configDir, 'plugins', 'cache', 'omc', 'oh-my-claudecode');
|
|
420
423
|
if (existsSync(cacheBase)) {
|
|
@@ -422,11 +425,57 @@ ${cleanContent}
|
|
|
422
425
|
.filter(v => /^\d+\.\d+\.\d+/.test(v))
|
|
423
426
|
.sort(semverCompare)
|
|
424
427
|
.reverse();
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
428
|
+
|
|
429
|
+
if (versions.length > 2) {
|
|
430
|
+
const latest = versions[0];
|
|
431
|
+
const toSymlink = versions.slice(2);
|
|
432
|
+
for (const version of toSymlink) {
|
|
433
|
+
try {
|
|
434
|
+
const versionPath = join(cacheBase, version);
|
|
435
|
+
const stat = lstatSync(versionPath);
|
|
436
|
+
|
|
437
|
+
const isWin = process.platform === 'win32';
|
|
438
|
+
const symlinkTarget = isWin ? join(cacheBase, latest) : latest;
|
|
439
|
+
|
|
440
|
+
if (stat.isSymbolicLink()) {
|
|
441
|
+
// Already a symlink — update only if pointing to wrong target.
|
|
442
|
+
// Use atomic temp-symlink + rename to avoid a window where
|
|
443
|
+
// the path doesn't exist (fixes race in issue #1007).
|
|
444
|
+
const target = readlinkSync(versionPath);
|
|
445
|
+
if (target === latest || target === join(cacheBase, latest)) continue;
|
|
446
|
+
try {
|
|
447
|
+
const tmpLink = versionPath + '.tmp.' + process.pid;
|
|
448
|
+
symlinkSync(symlinkTarget, tmpLink, isWin ? 'junction' : undefined);
|
|
449
|
+
try {
|
|
450
|
+
renameSync(tmpLink, versionPath);
|
|
451
|
+
} catch {
|
|
452
|
+
// rename failed (e.g. cross-device) — fall back to unlink+symlink
|
|
453
|
+
try { unlinkSync(tmpLink); } catch {}
|
|
454
|
+
unlinkSync(versionPath);
|
|
455
|
+
symlinkSync(symlinkTarget, versionPath, isWin ? 'junction' : undefined);
|
|
456
|
+
}
|
|
457
|
+
} catch (swapErr) {
|
|
458
|
+
if (swapErr?.code !== 'EEXIST') {
|
|
459
|
+
// Leave as-is rather than losing it
|
|
460
|
+
}
|
|
461
|
+
}
|
|
462
|
+
} else if (stat.isDirectory()) {
|
|
463
|
+
// Directory → symlink: cannot be atomic, but run.cjs now
|
|
464
|
+
// handles missing targets gracefully (issue #1007).
|
|
465
|
+
rmSync(versionPath, { recursive: true, force: true });
|
|
466
|
+
try {
|
|
467
|
+
symlinkSync(symlinkTarget, versionPath, isWin ? 'junction' : undefined);
|
|
468
|
+
} catch (symlinkErr) {
|
|
469
|
+
// EEXIST: another session raced us — safe to ignore.
|
|
470
|
+
if (symlinkErr?.code !== 'EEXIST') {
|
|
471
|
+
// Symlink genuinely failed. Leave the path as-is.
|
|
472
|
+
}
|
|
473
|
+
}
|
|
474
|
+
}
|
|
475
|
+
} catch {
|
|
476
|
+
// lstatSync / rmSync / unlinkSync failure — leave old directory as-is.
|
|
477
|
+
}
|
|
478
|
+
}
|
|
430
479
|
}
|
|
431
480
|
}
|
|
432
481
|
} catch {}
|
|
@@ -0,0 +1,144 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
import { spawnSync } from 'node:child_process';
|
|
4
|
+
|
|
5
|
+
const SESSION_PREFIX = 'omc-team-';
|
|
6
|
+
|
|
7
|
+
function runTmux(args) {
|
|
8
|
+
const result = spawnSync('tmux', args, {
|
|
9
|
+
encoding: 'utf8',
|
|
10
|
+
stdio: ['ignore', 'pipe', 'pipe'],
|
|
11
|
+
});
|
|
12
|
+
|
|
13
|
+
if (result.error) {
|
|
14
|
+
return {
|
|
15
|
+
ok: false,
|
|
16
|
+
code: 1,
|
|
17
|
+
stderr: result.error.message,
|
|
18
|
+
stdout: '',
|
|
19
|
+
};
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
return {
|
|
23
|
+
ok: result.status === 0,
|
|
24
|
+
code: result.status ?? 1,
|
|
25
|
+
stderr: (result.stderr || '').trim(),
|
|
26
|
+
stdout: (result.stdout || '').trimEnd(),
|
|
27
|
+
};
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
function printTable(rows) {
|
|
31
|
+
const headers = ['session', 'pane ID', 'command', 'status'];
|
|
32
|
+
const widths = [
|
|
33
|
+
headers[0].length,
|
|
34
|
+
headers[1].length,
|
|
35
|
+
headers[2].length,
|
|
36
|
+
headers[3].length,
|
|
37
|
+
];
|
|
38
|
+
|
|
39
|
+
for (const row of rows) {
|
|
40
|
+
widths[0] = Math.max(widths[0], row.session.length);
|
|
41
|
+
widths[1] = Math.max(widths[1], row.paneId.length);
|
|
42
|
+
widths[2] = Math.max(widths[2], row.command.length);
|
|
43
|
+
widths[3] = Math.max(widths[3], row.status.length);
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
const format = (cols) =>
|
|
47
|
+
cols
|
|
48
|
+
.map((col, idx) => col.padEnd(widths[idx]))
|
|
49
|
+
.join(' ')
|
|
50
|
+
.trimEnd();
|
|
51
|
+
|
|
52
|
+
const separator = widths
|
|
53
|
+
.map((w) => '-'.repeat(w))
|
|
54
|
+
.join(' ')
|
|
55
|
+
.trimEnd();
|
|
56
|
+
|
|
57
|
+
console.log(format(headers));
|
|
58
|
+
console.log(separator);
|
|
59
|
+
|
|
60
|
+
for (const row of rows) {
|
|
61
|
+
console.log(format([row.session, row.paneId, row.command, row.status]));
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
function parsePaneLine(line, session) {
|
|
66
|
+
const trimmed = line.trim();
|
|
67
|
+
if (!trimmed) return null;
|
|
68
|
+
|
|
69
|
+
const parts = trimmed.split(/\s+/);
|
|
70
|
+
if (parts.length < 3) return null;
|
|
71
|
+
|
|
72
|
+
const paneId = parts[0];
|
|
73
|
+
const paneDead = parts[parts.length - 1];
|
|
74
|
+
const command = parts.slice(1, -1).join(' ');
|
|
75
|
+
|
|
76
|
+
return {
|
|
77
|
+
session,
|
|
78
|
+
paneId,
|
|
79
|
+
command,
|
|
80
|
+
status: paneDead === '1' ? 'dead' : 'alive',
|
|
81
|
+
};
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
function main() {
|
|
85
|
+
const sessionsResult = runTmux(['list-sessions', '-F', '#{session_name}']);
|
|
86
|
+
|
|
87
|
+
if (!sessionsResult.ok) {
|
|
88
|
+
const err = sessionsResult.stderr || 'tmux is unavailable or no server is running.';
|
|
89
|
+
console.error(`Failed to list tmux sessions: ${err}`);
|
|
90
|
+
process.exit(1);
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
const sessions = sessionsResult.stdout
|
|
94
|
+
.split('\n')
|
|
95
|
+
.map((s) => s.trim())
|
|
96
|
+
.filter((s) => s.startsWith(SESSION_PREFIX));
|
|
97
|
+
|
|
98
|
+
if (sessions.length === 0) {
|
|
99
|
+
console.error(`No tmux sessions found with prefix '${SESSION_PREFIX}'.`);
|
|
100
|
+
process.exit(0);
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
const rows = [];
|
|
104
|
+
let sawDeadPane = false;
|
|
105
|
+
|
|
106
|
+
for (const session of sessions) {
|
|
107
|
+
const panesResult = runTmux([
|
|
108
|
+
'list-panes',
|
|
109
|
+
'-t',
|
|
110
|
+
session,
|
|
111
|
+
'-F',
|
|
112
|
+
'#{pane_id} #{pane_current_command} #{pane_dead}',
|
|
113
|
+
]);
|
|
114
|
+
|
|
115
|
+
if (!panesResult.ok) {
|
|
116
|
+
const err = panesResult.stderr || `failed to list panes for session ${session}`;
|
|
117
|
+
console.error(`Failed to inspect panes for '${session}': ${err}`);
|
|
118
|
+
sawDeadPane = true;
|
|
119
|
+
continue;
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
const paneLines = panesResult.stdout
|
|
123
|
+
.split('\n')
|
|
124
|
+
.map((line) => parsePaneLine(line, session))
|
|
125
|
+
.filter(Boolean);
|
|
126
|
+
|
|
127
|
+
for (const pane of paneLines) {
|
|
128
|
+
if (pane.status === 'dead') {
|
|
129
|
+
sawDeadPane = true;
|
|
130
|
+
}
|
|
131
|
+
rows.push(pane);
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
if (rows.length === 0) {
|
|
136
|
+
console.error('No panes found for matching sessions.');
|
|
137
|
+
process.exit(sawDeadPane ? 1 : 0);
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
printTable(rows);
|
|
141
|
+
process.exit(sawDeadPane ? 1 : 0);
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
main();
|