claudecode-omc 4.5.7 → 4.7.4
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 +18 -4
- package/.claude-plugin/plugin.json +14 -1
- package/.mcp.json +0 -4
- package/README.de.md +260 -0
- package/README.es.md +27 -41
- package/README.fr.md +260 -0
- package/README.it.md +260 -0
- package/README.ja.md +27 -41
- package/README.ko.md +45 -54
- package/README.md +247 -14
- package/README.pt.md +23 -6
- package/README.ru.md +260 -0
- package/README.tr.md +260 -0
- package/README.vi.md +23 -6
- package/README.zh.md +27 -41
- package/agents/harsh-critic.md +254 -0
- package/bridge/cli.cjs +67181 -0
- package/bridge/gyoshu_bridge.py +69 -19
- package/bridge/mcp-server.cjs +846 -526
- package/bridge/runtime-cli.cjs +2861 -367
- package/bridge/team-bridge.cjs +216 -60
- package/bridge/team-mcp.cjs +493 -255
- package/bridge/team.js +1460 -0
- package/dist/__tests__/agent-registry.test.js +13 -3
- package/dist/__tests__/agent-registry.test.js.map +1 -1
- package/dist/__tests__/auto-slash-aliases.test.js +12 -20
- package/dist/__tests__/auto-slash-aliases.test.js.map +1 -1
- package/dist/__tests__/auto-update.test.js +1 -1
- package/dist/__tests__/auto-update.test.js.map +1 -1
- package/dist/__tests__/bash-history.test.js.map +1 -1
- package/dist/__tests__/cleanup-validation.test.d.ts +2 -0
- package/dist/__tests__/cleanup-validation.test.d.ts.map +1 -0
- package/dist/__tests__/cleanup-validation.test.js +44 -0
- package/dist/__tests__/cleanup-validation.test.js.map +1 -0
- package/dist/__tests__/config-force-inherit-env.test.d.ts +5 -0
- package/dist/__tests__/config-force-inherit-env.test.d.ts.map +1 -0
- package/dist/__tests__/config-force-inherit-env.test.js +35 -0
- package/dist/__tests__/config-force-inherit-env.test.js.map +1 -0
- package/dist/__tests__/consolidation-contracts.test.js +4 -7
- package/dist/__tests__/consolidation-contracts.test.js.map +1 -1
- package/dist/__tests__/daemon-module-path.test.d.ts +2 -0
- package/dist/__tests__/daemon-module-path.test.d.ts.map +1 -0
- package/dist/__tests__/daemon-module-path.test.js +29 -0
- package/dist/__tests__/daemon-module-path.test.js.map +1 -0
- package/dist/__tests__/delegation-enforcement-levels.test.js.map +1 -1
- package/dist/__tests__/delegation-enforcer.test.js +172 -0
- package/dist/__tests__/delegation-enforcer.test.js.map +1 -1
- package/dist/__tests__/doctor-conflicts.test.js +144 -1
- package/dist/__tests__/doctor-conflicts.test.js.map +1 -1
- package/dist/__tests__/file-lock.test.d.ts +2 -0
- package/dist/__tests__/file-lock.test.d.ts.map +1 -0
- package/dist/__tests__/file-lock.test.js +209 -0
- package/dist/__tests__/file-lock.test.js.map +1 -0
- package/dist/__tests__/hooks.test.js +27 -56
- package/dist/__tests__/hooks.test.js.map +1 -1
- package/dist/__tests__/hud/defaults.test.js +3 -0
- package/dist/__tests__/hud/defaults.test.js.map +1 -1
- package/dist/__tests__/hud/limits-error.test.d.ts +5 -0
- package/dist/__tests__/hud/limits-error.test.d.ts.map +1 -0
- package/dist/__tests__/hud/limits-error.test.js +43 -0
- package/dist/__tests__/hud/limits-error.test.js.map +1 -0
- package/dist/__tests__/hud/max-width.test.d.ts +2 -0
- package/dist/__tests__/hud/max-width.test.d.ts.map +1 -0
- package/dist/__tests__/hud/max-width.test.js +149 -0
- package/dist/__tests__/hud/max-width.test.js.map +1 -0
- package/dist/__tests__/hud/rate-limits-error.test.d.ts +5 -0
- package/dist/__tests__/hud/rate-limits-error.test.d.ts.map +1 -0
- package/dist/__tests__/hud/rate-limits-error.test.js +76 -0
- package/dist/__tests__/hud/rate-limits-error.test.js.map +1 -0
- package/dist/__tests__/hud/render.test.js +245 -1
- package/dist/__tests__/hud/render.test.js.map +1 -1
- package/dist/__tests__/hud/state.test.js +15 -0
- package/dist/__tests__/hud/state.test.js.map +1 -1
- package/dist/__tests__/hud/usage-api.test.js +19 -5
- package/dist/__tests__/hud/usage-api.test.js.map +1 -1
- package/dist/__tests__/hud/version-display.test.js +3 -1
- package/dist/__tests__/hud/version-display.test.js.map +1 -1
- package/dist/__tests__/hud-agents.test.js.map +1 -1
- package/dist/__tests__/hud-api-key-source.test.d.ts +7 -0
- package/dist/__tests__/hud-api-key-source.test.d.ts.map +1 -0
- package/dist/__tests__/hud-api-key-source.test.js +112 -0
- package/dist/__tests__/hud-api-key-source.test.js.map +1 -0
- package/dist/__tests__/hud-build-guidance.test.d.ts +2 -0
- package/dist/__tests__/hud-build-guidance.test.d.ts.map +1 -0
- package/dist/__tests__/hud-build-guidance.test.js +26 -0
- package/dist/__tests__/hud-build-guidance.test.js.map +1 -0
- package/dist/__tests__/installer-hooks-merge.test.js +1 -1
- package/dist/__tests__/installer-hooks-merge.test.js.map +1 -1
- package/dist/__tests__/installer.test.js +4 -0
- package/dist/__tests__/installer.test.js.map +1 -1
- package/dist/__tests__/job-management.test.js +1 -1
- package/dist/__tests__/job-management.test.js.map +1 -1
- package/dist/__tests__/live-data.test.js +11 -5
- package/dist/__tests__/live-data.test.js.map +1 -1
- package/dist/__tests__/mcp-default-config.test.d.ts +2 -0
- package/dist/__tests__/mcp-default-config.test.d.ts.map +1 -0
- package/dist/__tests__/mcp-default-config.test.js +13 -0
- package/dist/__tests__/mcp-default-config.test.js.map +1 -0
- package/dist/__tests__/model-routing.test.js.map +1 -1
- package/dist/__tests__/non-claude-provider-detection.test.d.ts +11 -0
- package/dist/__tests__/non-claude-provider-detection.test.d.ts.map +1 -0
- package/dist/__tests__/non-claude-provider-detection.test.js +303 -0
- package/dist/__tests__/non-claude-provider-detection.test.js.map +1 -0
- package/dist/__tests__/omc-tools-server.test.js +5 -5
- package/dist/__tests__/package-dir-resolution-regression.test.d.ts +2 -0
- package/dist/__tests__/package-dir-resolution-regression.test.d.ts.map +1 -0
- package/dist/__tests__/package-dir-resolution-regression.test.js +63 -0
- package/dist/__tests__/package-dir-resolution-regression.test.js.map +1 -0
- package/dist/__tests__/pipeline-orchestrator.test.d.ts +5 -0
- package/dist/__tests__/pipeline-orchestrator.test.d.ts.map +1 -0
- package/dist/__tests__/pipeline-orchestrator.test.js +244 -0
- package/dist/__tests__/pipeline-orchestrator.test.js.map +1 -0
- package/dist/__tests__/plugin-setup-deps.test.d.ts +2 -0
- package/dist/__tests__/plugin-setup-deps.test.d.ts.map +1 -0
- package/dist/__tests__/plugin-setup-deps.test.js +64 -0
- package/dist/__tests__/plugin-setup-deps.test.js.map +1 -0
- package/dist/__tests__/project-memory-merge.test.d.ts +2 -0
- package/dist/__tests__/project-memory-merge.test.d.ts.map +1 -0
- package/dist/__tests__/project-memory-merge.test.js +342 -0
- package/dist/__tests__/project-memory-merge.test.js.map +1 -0
- package/dist/__tests__/ralph-prd-mandatory.test.d.ts +2 -0
- package/dist/__tests__/ralph-prd-mandatory.test.d.ts.map +1 -0
- package/dist/__tests__/ralph-prd-mandatory.test.js +316 -0
- package/dist/__tests__/ralph-prd-mandatory.test.js.map +1 -0
- package/dist/__tests__/rate-limit-wait/daemon-bootstrap.test.d.ts +2 -0
- package/dist/__tests__/rate-limit-wait/daemon-bootstrap.test.d.ts.map +1 -0
- package/dist/__tests__/rate-limit-wait/daemon-bootstrap.test.js +94 -0
- package/dist/__tests__/rate-limit-wait/daemon-bootstrap.test.js.map +1 -0
- package/dist/__tests__/rate-limit-wait/daemon.test.js.map +1 -1
- package/dist/__tests__/rate-limit-wait/integration.test.js +33 -25
- package/dist/__tests__/rate-limit-wait/integration.test.js.map +1 -1
- package/dist/__tests__/rate-limit-wait/rate-limit-monitor.test.js +34 -26
- package/dist/__tests__/rate-limit-wait/rate-limit-monitor.test.js.map +1 -1
- package/dist/__tests__/rate-limit-wait/tmux-detector.test.js.map +1 -1
- package/dist/__tests__/resolve-node.test.js.map +1 -1
- package/dist/__tests__/resolve-transcript-path.test.d.ts +12 -0
- package/dist/__tests__/resolve-transcript-path.test.d.ts.map +1 -0
- package/dist/__tests__/resolve-transcript-path.test.js +167 -0
- package/dist/__tests__/resolve-transcript-path.test.js.map +1 -0
- package/dist/__tests__/routing-force-inherit.test.d.ts +8 -0
- package/dist/__tests__/routing-force-inherit.test.d.ts.map +1 -0
- package/dist/__tests__/routing-force-inherit.test.js +180 -0
- package/dist/__tests__/routing-force-inherit.test.js.map +1 -0
- package/dist/__tests__/run-cjs-graceful-fallback.test.js +2 -2
- package/dist/__tests__/run-cjs-graceful-fallback.test.js.map +1 -1
- package/dist/__tests__/shared-memory-concurrency.test.d.ts +8 -0
- package/dist/__tests__/shared-memory-concurrency.test.d.ts.map +1 -0
- package/dist/__tests__/shared-memory-concurrency.test.js +132 -0
- package/dist/__tests__/shared-memory-concurrency.test.js.map +1 -0
- package/dist/__tests__/shared-memory.test.d.ts +2 -0
- package/dist/__tests__/shared-memory.test.d.ts.map +1 -0
- package/dist/__tests__/shared-memory.test.js +345 -0
- package/dist/__tests__/shared-memory.test.js.map +1 -0
- package/dist/__tests__/shell-path.test.d.ts +5 -0
- package/dist/__tests__/shell-path.test.d.ts.map +1 -0
- package/dist/__tests__/shell-path.test.js +70 -0
- package/dist/__tests__/shell-path.test.js.map +1 -0
- package/dist/__tests__/skills.test.js +13 -10
- package/dist/__tests__/skills.test.js.map +1 -1
- package/dist/__tests__/slack-socket.test.d.ts +5 -0
- package/dist/__tests__/slack-socket.test.d.ts.map +1 -0
- package/dist/__tests__/slack-socket.test.js +252 -0
- package/dist/__tests__/slack-socket.test.js.map +1 -0
- package/dist/__tests__/smoke-functional.test.d.ts +8 -0
- package/dist/__tests__/smoke-functional.test.d.ts.map +1 -0
- package/dist/__tests__/smoke-functional.test.js +450 -0
- package/dist/__tests__/smoke-functional.test.js.map +1 -0
- package/dist/__tests__/smoke-pipeline-edge.test.d.ts +8 -0
- package/dist/__tests__/smoke-pipeline-edge.test.d.ts.map +1 -0
- package/dist/__tests__/smoke-pipeline-edge.test.js +435 -0
- package/dist/__tests__/smoke-pipeline-edge.test.js.map +1 -0
- package/dist/__tests__/smoke-slack-and-state.test.d.ts +13 -0
- package/dist/__tests__/smoke-slack-and-state.test.d.ts.map +1 -0
- package/dist/__tests__/smoke-slack-and-state.test.js +632 -0
- package/dist/__tests__/smoke-slack-and-state.test.js.map +1 -0
- package/dist/__tests__/smoke-team-worker.test.d.ts +15 -0
- package/dist/__tests__/smoke-team-worker.test.d.ts.map +1 -0
- package/dist/__tests__/smoke-team-worker.test.js +483 -0
- package/dist/__tests__/smoke-team-worker.test.js.map +1 -0
- package/dist/__tests__/ssrf-guard.test.d.ts +2 -0
- package/dist/__tests__/ssrf-guard.test.d.ts.map +1 -0
- package/dist/__tests__/ssrf-guard.test.js +96 -0
- package/dist/__tests__/ssrf-guard.test.js.map +1 -0
- package/dist/__tests__/task-continuation.test.js +1 -1
- package/dist/__tests__/task-continuation.test.js.map +1 -1
- package/dist/__tests__/tier0-contracts.test.js +5 -1
- package/dist/__tests__/tier0-contracts.test.js.map +1 -1
- package/dist/__tests__/tier0-docs-consistency.test.js +3 -4
- package/dist/__tests__/tier0-docs-consistency.test.js.map +1 -1
- package/dist/__tests__/tools/trace-tools.test.js +7 -3
- package/dist/__tests__/tools/trace-tools.test.js.map +1 -1
- package/dist/__tests__/types.test.js +4 -4
- package/dist/__tests__/types.test.js.map +1 -1
- package/dist/__tests__/worker-adapter.test.d.ts +5 -0
- package/dist/__tests__/worker-adapter.test.d.ts.map +1 -0
- package/dist/__tests__/worker-adapter.test.js +211 -0
- package/dist/__tests__/worker-adapter.test.js.map +1 -0
- package/dist/agents/definitions.d.ts +6 -5
- package/dist/agents/definitions.d.ts.map +1 -1
- package/dist/agents/definitions.js +11 -6
- package/dist/agents/definitions.js.map +1 -1
- package/dist/agents/harsh-critic.d.ts +14 -0
- package/dist/agents/harsh-critic.d.ts.map +1 -0
- package/dist/agents/harsh-critic.js +42 -0
- package/dist/agents/harsh-critic.js.map +1 -0
- package/dist/agents/index.d.ts +1 -3
- package/dist/agents/index.d.ts.map +1 -1
- package/dist/agents/index.js +1 -4
- package/dist/agents/index.js.map +1 -1
- package/dist/agents/prompt-helpers.d.ts.map +1 -1
- package/dist/agents/prompt-helpers.js +21 -16
- package/dist/agents/prompt-helpers.js.map +1 -1
- package/dist/agents/prompt-sections/index.d.ts.map +1 -1
- package/dist/agents/prompt-sections/index.js +7 -3
- package/dist/agents/prompt-sections/index.js.map +1 -1
- package/dist/agents/utils.d.ts.map +1 -1
- package/dist/agents/utils.js +22 -13
- package/dist/agents/utils.js.map +1 -1
- package/dist/cli/__tests__/ask.test.d.ts +2 -0
- package/dist/cli/__tests__/ask.test.d.ts.map +1 -0
- package/dist/cli/__tests__/ask.test.js +282 -0
- package/dist/cli/__tests__/ask.test.js.map +1 -0
- package/dist/cli/__tests__/cli-boot.test.d.ts +8 -0
- package/dist/cli/__tests__/cli-boot.test.d.ts.map +1 -0
- package/dist/cli/__tests__/cli-boot.test.js +82 -0
- package/dist/cli/__tests__/cli-boot.test.js.map +1 -0
- package/dist/cli/__tests__/launch.test.js +11 -2
- package/dist/cli/__tests__/launch.test.js.map +1 -1
- package/dist/cli/__tests__/team-command-branding.test.d.ts +2 -0
- package/dist/cli/__tests__/team-command-branding.test.d.ts.map +1 -0
- package/dist/cli/__tests__/team-command-branding.test.js +14 -0
- package/dist/cli/__tests__/team-command-branding.test.js.map +1 -0
- package/dist/cli/__tests__/team-help.test.d.ts +2 -0
- package/dist/cli/__tests__/team-help.test.d.ts.map +1 -0
- package/dist/cli/__tests__/team-help.test.js +19 -0
- package/dist/cli/__tests__/team-help.test.js.map +1 -0
- package/dist/cli/__tests__/team-runtime-boundary.test.d.ts +2 -0
- package/dist/cli/__tests__/team-runtime-boundary.test.d.ts.map +1 -0
- package/dist/cli/__tests__/team-runtime-boundary.test.js +11 -0
- package/dist/cli/__tests__/team-runtime-boundary.test.js.map +1 -0
- package/dist/cli/__tests__/team.test.d.ts +2 -0
- package/dist/cli/__tests__/team.test.d.ts.map +1 -0
- package/dist/cli/__tests__/team.test.js +335 -0
- package/dist/cli/__tests__/team.test.js.map +1 -0
- package/dist/cli/__tests__/tmux-utils.test.d.ts +11 -0
- package/dist/cli/__tests__/tmux-utils.test.d.ts.map +1 -0
- package/dist/cli/__tests__/tmux-utils.test.js +145 -0
- package/dist/cli/__tests__/tmux-utils.test.js.map +1 -0
- package/dist/cli/ask.d.ts +13 -0
- package/dist/cli/ask.d.ts.map +1 -0
- package/dist/cli/ask.js +202 -0
- package/dist/cli/ask.js.map +1 -0
- package/dist/cli/commands/__tests__/team.test.d.ts +2 -0
- package/dist/cli/commands/__tests__/team.test.d.ts.map +1 -0
- package/dist/cli/commands/__tests__/team.test.js +177 -0
- package/dist/cli/commands/__tests__/team.test.js.map +1 -0
- package/dist/cli/commands/__tests__/teleport.test.js.map +1 -1
- package/dist/cli/commands/doctor-conflicts.d.ts +14 -1
- package/dist/cli/commands/doctor-conflicts.d.ts.map +1 -1
- package/dist/cli/commands/doctor-conflicts.js +126 -12
- package/dist/cli/commands/doctor-conflicts.js.map +1 -1
- package/dist/cli/commands/team.d.ts +19 -0
- package/dist/cli/commands/team.d.ts.map +1 -0
- package/dist/cli/commands/team.js +510 -0
- package/dist/cli/commands/team.js.map +1 -0
- package/dist/cli/commands/teleport.d.ts.map +1 -1
- package/dist/cli/commands/teleport.js +6 -4
- package/dist/cli/commands/teleport.js.map +1 -1
- package/dist/cli/index.js +58 -17
- package/dist/cli/index.js.map +1 -1
- package/dist/cli/launch.d.ts.map +1 -1
- package/dist/cli/launch.js +12 -6
- package/dist/cli/launch.js.map +1 -1
- package/dist/cli/team.d.ts +76 -0
- package/dist/cli/team.d.ts.map +1 -0
- package/dist/cli/team.js +1117 -0
- package/dist/cli/team.js.map +1 -0
- package/dist/cli/tmux-utils.d.ts +10 -0
- package/dist/cli/tmux-utils.d.ts.map +1 -1
- package/dist/cli/tmux-utils.js +20 -1
- package/dist/cli/tmux-utils.js.map +1 -1
- package/dist/config/loader.d.ts.map +1 -1
- package/dist/config/loader.js +134 -48
- package/dist/config/loader.js.map +1 -1
- package/dist/config/models.d.ts +36 -14
- package/dist/config/models.d.ts.map +1 -1
- package/dist/config/models.js +94 -0
- package/dist/config/models.js.map +1 -1
- package/dist/constants/names.d.ts +6 -3
- package/dist/constants/names.d.ts.map +1 -1
- package/dist/constants/names.js +7 -3
- package/dist/constants/names.js.map +1 -1
- package/dist/features/auto-update.js +5 -5
- package/dist/features/auto-update.js.map +1 -1
- package/dist/features/boulder-state/storage.d.ts +1 -1
- package/dist/features/boulder-state/storage.d.ts.map +1 -1
- package/dist/features/boulder-state/storage.js +20 -22
- package/dist/features/boulder-state/storage.js.map +1 -1
- package/dist/features/delegation-enforcer.d.ts +5 -0
- package/dist/features/delegation-enforcer.d.ts.map +1 -1
- package/dist/features/delegation-enforcer.js +58 -5
- package/dist/features/delegation-enforcer.js.map +1 -1
- package/dist/features/model-routing/router.d.ts.map +1 -1
- package/dist/features/model-routing/router.js +11 -0
- package/dist/features/model-routing/router.js.map +1 -1
- package/dist/features/model-routing/types.d.ts +6 -0
- package/dist/features/model-routing/types.d.ts.map +1 -1
- package/dist/features/model-routing/types.js.map +1 -1
- package/dist/features/rate-limit-wait/daemon.d.ts +5 -0
- package/dist/features/rate-limit-wait/daemon.d.ts.map +1 -1
- package/dist/features/rate-limit-wait/daemon.js +38 -9
- package/dist/features/rate-limit-wait/daemon.js.map +1 -1
- package/dist/features/rate-limit-wait/rate-limit-monitor.d.ts.map +1 -1
- package/dist/features/rate-limit-wait/rate-limit-monitor.js +3 -2
- package/dist/features/rate-limit-wait/rate-limit-monitor.js.map +1 -1
- package/dist/features/rate-limit-wait/tmux-detector.d.ts.map +1 -1
- package/dist/features/rate-limit-wait/tmux-detector.js +8 -2
- package/dist/features/rate-limit-wait/tmux-detector.js.map +1 -1
- package/dist/features/state-manager/__tests__/cache.test.js +161 -1
- package/dist/features/state-manager/__tests__/cache.test.js.map +1 -1
- package/dist/features/state-manager/index.d.ts +2 -0
- package/dist/features/state-manager/index.d.ts.map +1 -1
- package/dist/features/state-manager/index.js +167 -51
- package/dist/features/state-manager/index.js.map +1 -1
- package/dist/hooks/__tests__/bridge-routing.test.js +124 -1
- package/dist/hooks/__tests__/bridge-routing.test.js.map +1 -1
- package/dist/hooks/__tests__/bridge-security.test.js +1 -1
- package/dist/hooks/__tests__/bridge-security.test.js.map +1 -1
- package/dist/hooks/__tests__/bridge-team-worker-guard.test.d.ts +2 -0
- package/dist/hooks/__tests__/bridge-team-worker-guard.test.d.ts.map +1 -0
- package/dist/hooks/__tests__/bridge-team-worker-guard.test.js +52 -0
- package/dist/hooks/__tests__/bridge-team-worker-guard.test.js.map +1 -0
- package/dist/hooks/__tests__/bridge.test.js.map +1 -1
- package/dist/hooks/__tests__/codebase-map.test.js.map +1 -1
- package/dist/hooks/__tests__/compaction-concurrency.test.js.map +1 -1
- package/dist/hooks/__tests__/stop-hook-openclaw-cooldown.test.d.ts +2 -0
- package/dist/hooks/__tests__/stop-hook-openclaw-cooldown.test.d.ts.map +1 -0
- package/dist/hooks/__tests__/stop-hook-openclaw-cooldown.test.js +65 -0
- package/dist/hooks/__tests__/stop-hook-openclaw-cooldown.test.js.map +1 -0
- package/dist/hooks/auto-slash-command/live-data.d.ts.map +1 -1
- package/dist/hooks/auto-slash-command/live-data.js +54 -25
- package/dist/hooks/auto-slash-command/live-data.js.map +1 -1
- package/dist/hooks/autopilot/__tests__/cancel.test.js +1 -1
- package/dist/hooks/autopilot/__tests__/cancel.test.js.map +1 -1
- package/dist/hooks/autopilot/__tests__/pipeline.test.d.ts +2 -0
- package/dist/hooks/autopilot/__tests__/pipeline.test.d.ts.map +1 -0
- package/dist/hooks/autopilot/__tests__/pipeline.test.js +375 -0
- package/dist/hooks/autopilot/__tests__/pipeline.test.js.map +1 -0
- package/dist/hooks/autopilot/__tests__/state.test.js +2 -2
- package/dist/hooks/autopilot/__tests__/state.test.js.map +1 -1
- package/dist/hooks/autopilot/__tests__/summary.test.js.map +1 -1
- package/dist/hooks/autopilot/__tests__/transition.test.js.map +1 -1
- package/dist/hooks/autopilot/__tests__/validation.test.js +3 -3
- package/dist/hooks/autopilot/__tests__/validation.test.js.map +1 -1
- package/dist/hooks/autopilot/adapters/execution-adapter.d.ts +12 -0
- package/dist/hooks/autopilot/adapters/execution-adapter.d.ts.map +1 -0
- package/dist/hooks/autopilot/adapters/execution-adapter.js +110 -0
- package/dist/hooks/autopilot/adapters/execution-adapter.js.map +1 -0
- package/dist/hooks/autopilot/adapters/index.d.ts +22 -0
- package/dist/hooks/autopilot/adapters/index.d.ts.map +1 -0
- package/dist/hooks/autopilot/adapters/index.js +32 -0
- package/dist/hooks/autopilot/adapters/index.js.map +1 -0
- package/dist/hooks/autopilot/adapters/qa-adapter.d.ts +12 -0
- package/dist/hooks/autopilot/adapters/qa-adapter.d.ts.map +1 -0
- package/dist/hooks/autopilot/adapters/qa-adapter.js +33 -0
- package/dist/hooks/autopilot/adapters/qa-adapter.js.map +1 -0
- package/dist/hooks/autopilot/adapters/ralph-adapter.d.ts +15 -0
- package/dist/hooks/autopilot/adapters/ralph-adapter.d.ts.map +1 -0
- package/dist/hooks/autopilot/adapters/ralph-adapter.js +102 -0
- package/dist/hooks/autopilot/adapters/ralph-adapter.js.map +1 -0
- package/dist/hooks/autopilot/adapters/ralplan-adapter.d.ts +14 -0
- package/dist/hooks/autopilot/adapters/ralplan-adapter.d.ts.map +1 -0
- package/dist/hooks/autopilot/adapters/ralplan-adapter.js +81 -0
- package/dist/hooks/autopilot/adapters/ralplan-adapter.js.map +1 -0
- package/dist/hooks/autopilot/enforcement.d.ts.map +1 -1
- package/dist/hooks/autopilot/enforcement.js +162 -0
- package/dist/hooks/autopilot/enforcement.js.map +1 -1
- package/dist/hooks/autopilot/index.d.ts +4 -0
- package/dist/hooks/autopilot/index.d.ts.map +1 -1
- package/dist/hooks/autopilot/index.js +5 -0
- package/dist/hooks/autopilot/index.js.map +1 -1
- package/dist/hooks/autopilot/pipeline-types.d.ts +133 -0
- package/dist/hooks/autopilot/pipeline-types.d.ts.map +1 -0
- package/dist/hooks/autopilot/pipeline-types.js +44 -0
- package/dist/hooks/autopilot/pipeline-types.js.map +1 -0
- package/dist/hooks/autopilot/pipeline.d.ts +124 -0
- package/dist/hooks/autopilot/pipeline.d.ts.map +1 -0
- package/dist/hooks/autopilot/pipeline.js +407 -0
- package/dist/hooks/autopilot/pipeline.js.map +1 -0
- package/dist/hooks/autopilot/state.d.ts +6 -6
- package/dist/hooks/autopilot/state.d.ts.map +1 -1
- package/dist/hooks/autopilot/state.js +71 -129
- package/dist/hooks/autopilot/state.js.map +1 -1
- package/dist/hooks/autopilot/types.d.ts +21 -0
- package/dist/hooks/autopilot/types.d.ts.map +1 -1
- package/dist/hooks/autopilot/types.js.map +1 -1
- package/dist/hooks/bridge-normalize.d.ts.map +1 -1
- package/dist/hooks/bridge-normalize.js +13 -2
- package/dist/hooks/bridge-normalize.js.map +1 -1
- package/dist/hooks/bridge.d.ts.map +1 -1
- package/dist/hooks/bridge.js +151 -27
- package/dist/hooks/bridge.js.map +1 -1
- package/dist/hooks/comment-checker/index.js +1 -1
- package/dist/hooks/comment-checker/index.js.map +1 -1
- package/dist/hooks/empty-message-sanitizer/__tests__/index.test.js +2 -2
- package/dist/hooks/empty-message-sanitizer/__tests__/index.test.js.map +1 -1
- package/dist/hooks/factcheck/__tests__/factcheck.test.d.ts +7 -0
- package/dist/hooks/factcheck/__tests__/factcheck.test.d.ts.map +1 -0
- package/dist/hooks/factcheck/__tests__/factcheck.test.js +153 -0
- package/dist/hooks/factcheck/__tests__/factcheck.test.js.map +1 -0
- package/dist/hooks/factcheck/__tests__/sentinel-gate.test.d.ts +5 -0
- package/dist/hooks/factcheck/__tests__/sentinel-gate.test.d.ts.map +1 -0
- package/dist/hooks/factcheck/__tests__/sentinel-gate.test.js +159 -0
- package/dist/hooks/factcheck/__tests__/sentinel-gate.test.js.map +1 -0
- package/dist/hooks/factcheck/__tests__/sentinel.test.d.ts +7 -0
- package/dist/hooks/factcheck/__tests__/sentinel.test.d.ts.map +1 -0
- package/dist/hooks/factcheck/__tests__/sentinel.test.js +117 -0
- package/dist/hooks/factcheck/__tests__/sentinel.test.js.map +1 -0
- package/dist/hooks/factcheck/checks.d.ts +36 -0
- package/dist/hooks/factcheck/checks.d.ts.map +1 -0
- package/dist/hooks/factcheck/checks.js +144 -0
- package/dist/hooks/factcheck/checks.js.map +1 -0
- package/dist/hooks/factcheck/config.d.ts +25 -0
- package/dist/hooks/factcheck/config.d.ts.map +1 -0
- package/dist/hooks/factcheck/config.js +125 -0
- package/dist/hooks/factcheck/config.js.map +1 -0
- package/dist/hooks/factcheck/index.d.ts +34 -0
- package/dist/hooks/factcheck/index.d.ts.map +1 -0
- package/dist/hooks/factcheck/index.js +120 -0
- package/dist/hooks/factcheck/index.js.map +1 -0
- package/dist/hooks/factcheck/sentinel.d.ts +32 -0
- package/dist/hooks/factcheck/sentinel.d.ts.map +1 -0
- package/dist/hooks/factcheck/sentinel.js +153 -0
- package/dist/hooks/factcheck/sentinel.js.map +1 -0
- package/dist/hooks/factcheck/types.d.ts +99 -0
- package/dist/hooks/factcheck/types.d.ts.map +1 -0
- package/dist/hooks/factcheck/types.js +27 -0
- package/dist/hooks/factcheck/types.js.map +1 -0
- package/dist/hooks/keyword-detector/__tests__/index.test.js +29 -80
- package/dist/hooks/keyword-detector/__tests__/index.test.js.map +1 -1
- package/dist/hooks/keyword-detector/index.d.ts +1 -1
- package/dist/hooks/keyword-detector/index.d.ts.map +1 -1
- package/dist/hooks/keyword-detector/index.js +11 -21
- package/dist/hooks/keyword-detector/index.js.map +1 -1
- package/dist/hooks/learner/bridge.d.ts.map +1 -1
- package/dist/hooks/learner/bridge.js +8 -0
- package/dist/hooks/learner/bridge.js.map +1 -1
- package/dist/hooks/learner/index.d.ts +15 -15
- package/dist/hooks/learner/index.d.ts.map +1 -1
- package/dist/hooks/learner/index.js +44 -38
- package/dist/hooks/learner/index.js.map +1 -1
- package/dist/hooks/mode-registry/__tests__/session-isolation.test.js +4 -2
- package/dist/hooks/mode-registry/__tests__/session-isolation.test.js.map +1 -1
- package/dist/hooks/mode-registry/index.d.ts +2 -13
- package/dist/hooks/mode-registry/index.d.ts.map +1 -1
- package/dist/hooks/mode-registry/index.js +77 -174
- package/dist/hooks/mode-registry/index.js.map +1 -1
- package/dist/hooks/mode-registry/types.d.ts +1 -1
- package/dist/hooks/mode-registry/types.d.ts.map +1 -1
- package/dist/hooks/notepad/index.d.ts.map +1 -1
- package/dist/hooks/notepad/index.js +83 -73
- package/dist/hooks/notepad/index.js.map +1 -1
- package/dist/hooks/omc-orchestrator/index.d.ts.map +1 -1
- package/dist/hooks/omc-orchestrator/index.js +2 -1
- package/dist/hooks/omc-orchestrator/index.js.map +1 -1
- package/dist/hooks/permission-handler/__tests__/index.test.js +2 -2
- package/dist/hooks/permission-handler/__tests__/index.test.js.map +1 -1
- package/dist/hooks/permission-handler/index.d.ts +1 -1
- package/dist/hooks/permission-handler/index.d.ts.map +1 -1
- package/dist/hooks/permission-handler/index.js +4 -8
- package/dist/hooks/permission-handler/index.js.map +1 -1
- package/dist/hooks/persistent-mode/__tests__/rate-limit-stop.test.js +23 -0
- package/dist/hooks/persistent-mode/__tests__/rate-limit-stop.test.js.map +1 -1
- package/dist/hooks/persistent-mode/__tests__/skill-state-stop.test.js.map +1 -1
- package/dist/hooks/persistent-mode/__tests__/tool-error.test.js +1 -1
- package/dist/hooks/persistent-mode/__tests__/tool-error.test.js.map +1 -1
- package/dist/hooks/persistent-mode/index.d.ts +3 -3
- package/dist/hooks/persistent-mode/index.d.ts.map +1 -1
- package/dist/hooks/persistent-mode/index.js +25 -12
- package/dist/hooks/persistent-mode/index.js.map +1 -1
- package/dist/hooks/persistent-mode/session-isolation.test.js +20 -4
- package/dist/hooks/persistent-mode/session-isolation.test.js.map +1 -1
- package/dist/hooks/persistent-mode/stop-hook-blocking.test.d.ts +2 -0
- package/dist/hooks/persistent-mode/stop-hook-blocking.test.d.ts.map +1 -0
- package/dist/hooks/persistent-mode/stop-hook-blocking.test.js +367 -0
- package/dist/hooks/persistent-mode/stop-hook-blocking.test.js.map +1 -0
- package/dist/hooks/pre-compact/index.d.ts +2 -14
- package/dist/hooks/pre-compact/index.d.ts.map +1 -1
- package/dist/hooks/pre-compact/index.js +8 -49
- package/dist/hooks/pre-compact/index.js.map +1 -1
- package/dist/hooks/preemptive-compaction/index.js +1 -1
- package/dist/hooks/preemptive-compaction/index.js.map +1 -1
- package/dist/hooks/project-memory/__tests__/integration.test.js +4 -2
- package/dist/hooks/project-memory/__tests__/integration.test.js.map +1 -1
- package/dist/hooks/project-memory/index.d.ts +9 -9
- package/dist/hooks/project-memory/index.d.ts.map +1 -1
- package/dist/hooks/project-memory/index.js +25 -25
- 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 +92 -86
- package/dist/hooks/project-memory/learner.js.map +1 -1
- package/dist/hooks/project-memory/storage.d.ts +9 -0
- package/dist/hooks/project-memory/storage.d.ts.map +1 -1
- package/dist/hooks/project-memory/storage.js +15 -0
- package/dist/hooks/project-memory/storage.js.map +1 -1
- package/dist/hooks/ralph/index.d.ts +1 -1
- package/dist/hooks/ralph/index.d.ts.map +1 -1
- package/dist/hooks/ralph/index.js +2 -0
- package/dist/hooks/ralph/index.js.map +1 -1
- package/dist/hooks/ralph/loop.d.ts +10 -2
- package/dist/hooks/ralph/loop.d.ts.map +1 -1
- package/dist/hooks/ralph/loop.js +64 -113
- package/dist/hooks/ralph/loop.js.map +1 -1
- package/dist/hooks/ralph/prd.d.ts.map +1 -1
- package/dist/hooks/ralph/prd.js +3 -2
- package/dist/hooks/ralph/prd.js.map +1 -1
- package/dist/hooks/ralph/progress.d.ts.map +1 -1
- package/dist/hooks/ralph/progress.js +6 -5
- package/dist/hooks/ralph/progress.js.map +1 -1
- package/dist/hooks/ralph/verifier.d.ts +3 -1
- package/dist/hooks/ralph/verifier.d.ts.map +1 -1
- package/dist/hooks/ralph/verifier.js +19 -7
- package/dist/hooks/ralph/verifier.js.map +1 -1
- package/dist/hooks/session-end/__tests__/openclaw-session-end.test.d.ts +2 -0
- package/dist/hooks/session-end/__tests__/openclaw-session-end.test.d.ts.map +1 -0
- package/dist/hooks/session-end/__tests__/openclaw-session-end.test.js +86 -0
- package/dist/hooks/session-end/__tests__/openclaw-session-end.test.js.map +1 -0
- package/dist/hooks/session-end/index.d.ts.map +1 -1
- package/dist/hooks/session-end/index.js +17 -17
- package/dist/hooks/session-end/index.js.map +1 -1
- package/dist/hooks/setup/index.d.ts.map +1 -1
- package/dist/hooks/setup/index.js +0 -2
- package/dist/hooks/setup/index.js.map +1 -1
- package/dist/hooks/skill-bridge.cjs +13 -4
- package/dist/hooks/skill-state/__tests__/skill-state.test.js.map +1 -1
- package/dist/hooks/skill-state/index.d.ts +0 -5
- package/dist/hooks/skill-state/index.d.ts.map +1 -1
- package/dist/hooks/skill-state/index.js +9 -55
- package/dist/hooks/skill-state/index.js.map +1 -1
- package/dist/hooks/subagent-tracker/__tests__/flush-race.test.js.map +1 -1
- package/dist/hooks/subagent-tracker/__tests__/index.test.js.map +1 -1
- package/dist/hooks/subagent-tracker/__tests__/session-replay.test.js +1 -1
- package/dist/hooks/subagent-tracker/__tests__/session-replay.test.js.map +1 -1
- package/dist/hooks/subagent-tracker/index.d.ts.map +1 -1
- package/dist/hooks/subagent-tracker/index.js +10 -22
- package/dist/hooks/subagent-tracker/index.js.map +1 -1
- package/dist/hooks/subagent-tracker/session-replay.d.ts.map +1 -1
- package/dist/hooks/subagent-tracker/session-replay.js +3 -2
- package/dist/hooks/subagent-tracker/session-replay.js.map +1 -1
- package/dist/hooks/task-size-detector/__tests__/index.test.js +7 -7
- package/dist/hooks/task-size-detector/__tests__/index.test.js.map +1 -1
- package/dist/hooks/task-size-detector/index.d.ts.map +1 -1
- package/dist/hooks/task-size-detector/index.js +0 -3
- package/dist/hooks/task-size-detector/index.js.map +1 -1
- package/dist/hooks/team-dispatch-hook.d.ts +65 -0
- package/dist/hooks/team-dispatch-hook.d.ts.map +1 -0
- package/dist/hooks/team-dispatch-hook.js +663 -0
- package/dist/hooks/team-dispatch-hook.js.map +1 -0
- package/dist/hooks/team-leader-nudge-hook.d.ts +36 -0
- package/dist/hooks/team-leader-nudge-hook.d.ts.map +1 -0
- package/dist/hooks/team-leader-nudge-hook.js +218 -0
- package/dist/hooks/team-leader-nudge-hook.js.map +1 -0
- package/dist/hooks/team-worker-hook.d.ts +45 -0
- package/dist/hooks/team-worker-hook.d.ts.map +1 -0
- package/dist/hooks/team-worker-hook.js +415 -0
- package/dist/hooks/team-worker-hook.js.map +1 -0
- package/dist/hooks/think-mode/__tests__/index.test.js.map +1 -1
- package/dist/hooks/todo-continuation/__tests__/isAuthenticationError.test.d.ts +2 -0
- package/dist/hooks/todo-continuation/__tests__/isAuthenticationError.test.d.ts.map +1 -0
- package/dist/hooks/todo-continuation/__tests__/isAuthenticationError.test.js +33 -0
- package/dist/hooks/todo-continuation/__tests__/isAuthenticationError.test.js.map +1 -0
- package/dist/hooks/todo-continuation/index.d.ts +12 -0
- package/dist/hooks/todo-continuation/index.d.ts.map +1 -1
- package/dist/hooks/todo-continuation/index.js +37 -1
- package/dist/hooks/todo-continuation/index.js.map +1 -1
- package/dist/hooks/ultrapilot/decomposer.d.ts.map +1 -1
- package/dist/hooks/ultrapilot/decomposer.js +3 -1
- package/dist/hooks/ultrapilot/decomposer.js.map +1 -1
- package/dist/hooks/ultrapilot/index.d.ts.map +1 -1
- package/dist/hooks/ultrapilot/index.js +3 -1
- package/dist/hooks/ultrapilot/index.js.map +1 -1
- package/dist/hooks/ultrapilot/state.d.ts +1 -1
- package/dist/hooks/ultrapilot/state.d.ts.map +1 -1
- package/dist/hooks/ultrapilot/state.js +45 -77
- package/dist/hooks/ultrapilot/state.js.map +1 -1
- package/dist/hooks/ultraqa/index.d.ts.map +1 -1
- package/dist/hooks/ultraqa/index.js +4 -77
- package/dist/hooks/ultraqa/index.js.map +1 -1
- package/dist/hooks/ultrawork/index.d.ts.map +1 -1
- package/dist/hooks/ultrawork/index.js +40 -82
- package/dist/hooks/ultrawork/index.js.map +1 -1
- package/dist/hooks/ultrawork/session-isolation.test.js +1 -1
- package/dist/hooks/ultrawork/session-isolation.test.js.map +1 -1
- package/dist/hud/elements/api-key-source.d.ts +30 -0
- package/dist/hud/elements/api-key-source.d.ts.map +1 -0
- package/dist/hud/elements/api-key-source.js +70 -0
- package/dist/hud/elements/api-key-source.js.map +1 -0
- 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/limits.d.ts +9 -1
- package/dist/hud/elements/limits.d.ts.map +1 -1
- package/dist/hud/elements/limits.js +18 -0
- package/dist/hud/elements/limits.js.map +1 -1
- package/dist/hud/index.d.ts.map +1 -1
- package/dist/hud/index.js +40 -25
- package/dist/hud/index.js.map +1 -1
- package/dist/hud/omc-state.d.ts.map +1 -1
- package/dist/hud/omc-state.js +6 -4
- package/dist/hud/omc-state.js.map +1 -1
- package/dist/hud/render.d.ts +9 -0
- package/dist/hud/render.d.ts.map +1 -1
- package/dist/hud/render.js +166 -15
- package/dist/hud/render.js.map +1 -1
- package/dist/hud/state.d.ts.map +1 -1
- package/dist/hud/state.js +23 -14
- package/dist/hud/state.js.map +1 -1
- package/dist/hud/stdin.d.ts.map +1 -1
- package/dist/hud/stdin.js +5 -2
- package/dist/hud/stdin.js.map +1 -1
- package/dist/hud/types.d.ts +34 -3
- package/dist/hud/types.d.ts.map +1 -1
- package/dist/hud/types.js +19 -0
- package/dist/hud/types.js.map +1 -1
- package/dist/hud/usage-api.d.ts +9 -6
- package/dist/hud/usage-api.d.ts.map +1 -1
- package/dist/hud/usage-api.js +115 -46
- package/dist/hud/usage-api.js.map +1 -1
- package/dist/index.d.ts +3 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +6 -2
- package/dist/index.js.map +1 -1
- package/dist/installer/__tests__/claude-md-merge.test.js +29 -0
- package/dist/installer/__tests__/claude-md-merge.test.js.map +1 -1
- package/dist/installer/__tests__/safe-installer.test.js +1 -1
- package/dist/installer/__tests__/safe-installer.test.js.map +1 -1
- package/dist/installer/hooks.d.ts.map +1 -1
- package/dist/installer/hooks.js +11 -12
- package/dist/installer/hooks.js.map +1 -1
- package/dist/installer/index.d.ts.map +1 -1
- package/dist/installer/index.js +20 -16
- package/dist/installer/index.js.map +1 -1
- package/dist/interop/__tests__/worker-adapter-integration.test.d.ts +2 -0
- package/dist/interop/__tests__/worker-adapter-integration.test.d.ts.map +1 -0
- package/dist/interop/__tests__/worker-adapter-integration.test.js +219 -0
- package/dist/interop/__tests__/worker-adapter-integration.test.js.map +1 -0
- package/dist/interop/__tests__/worker-adapter.test.d.ts +2 -0
- package/dist/interop/__tests__/worker-adapter.test.d.ts.map +1 -0
- package/dist/interop/__tests__/worker-adapter.test.js +408 -0
- package/dist/interop/__tests__/worker-adapter.test.js.map +1 -0
- package/dist/interop/adapter-types.d.ts +39 -0
- package/dist/interop/adapter-types.d.ts.map +1 -0
- package/dist/interop/adapter-types.js +9 -0
- package/dist/interop/adapter-types.js.map +1 -0
- package/dist/interop/worker-adapter.d.ts +116 -0
- package/dist/interop/worker-adapter.d.ts.map +1 -0
- package/dist/interop/worker-adapter.js +324 -0
- package/dist/interop/worker-adapter.js.map +1 -0
- package/dist/lib/__tests__/mode-state-io.test.d.ts +2 -0
- package/dist/lib/__tests__/mode-state-io.test.d.ts.map +1 -0
- package/dist/lib/__tests__/mode-state-io.test.js +194 -0
- package/dist/lib/__tests__/mode-state-io.test.js.map +1 -0
- package/dist/lib/__tests__/payload-limits.test.d.ts +2 -0
- package/dist/lib/__tests__/payload-limits.test.d.ts.map +1 -0
- package/dist/lib/__tests__/payload-limits.test.js +124 -0
- package/dist/lib/__tests__/payload-limits.test.js.map +1 -0
- package/dist/lib/__tests__/worktree-paths.test.js +5 -4
- package/dist/lib/__tests__/worktree-paths.test.js.map +1 -1
- package/dist/lib/file-lock.d.ts +75 -0
- package/dist/lib/file-lock.d.ts.map +1 -0
- package/dist/lib/file-lock.js +246 -0
- package/dist/lib/file-lock.js.map +1 -0
- package/dist/lib/mode-names.d.ts +10 -3
- package/dist/lib/mode-names.d.ts.map +1 -1
- package/dist/lib/mode-names.js +12 -17
- package/dist/lib/mode-names.js.map +1 -1
- package/dist/lib/mode-state-io.d.ts +41 -0
- package/dist/lib/mode-state-io.d.ts.map +1 -0
- package/dist/lib/mode-state-io.js +127 -0
- package/dist/lib/mode-state-io.js.map +1 -0
- package/dist/lib/payload-limits.d.ts +31 -0
- package/dist/lib/payload-limits.d.ts.map +1 -0
- package/dist/lib/payload-limits.js +82 -0
- package/dist/lib/payload-limits.js.map +1 -0
- package/dist/lib/project-memory-merge.d.ts +36 -0
- package/dist/lib/project-memory-merge.d.ts.map +1 -0
- package/dist/lib/project-memory-merge.js +154 -0
- package/dist/lib/project-memory-merge.js.map +1 -0
- package/dist/lib/shared-memory.d.ts +82 -0
- package/dist/lib/shared-memory.d.ts.map +1 -0
- package/dist/lib/shared-memory.js +305 -0
- package/dist/lib/shared-memory.js.map +1 -0
- package/dist/lib/worktree-paths.d.ts +31 -3
- package/dist/lib/worktree-paths.d.ts.map +1 -1
- package/dist/lib/worktree-paths.js +147 -12
- package/dist/lib/worktree-paths.js.map +1 -1
- package/dist/mcp/__tests__/team-server-artifact-convergence.test.d.ts +2 -0
- package/dist/mcp/__tests__/team-server-artifact-convergence.test.d.ts.map +1 -0
- package/dist/mcp/__tests__/team-server-artifact-convergence.test.js +84 -0
- package/dist/mcp/__tests__/team-server-artifact-convergence.test.js.map +1 -0
- package/dist/mcp/__tests__/team-server-deprecation.test.d.ts +2 -0
- package/dist/mcp/__tests__/team-server-deprecation.test.d.ts.map +1 -0
- package/dist/mcp/__tests__/team-server-deprecation.test.js +54 -0
- package/dist/mcp/__tests__/team-server-deprecation.test.js.map +1 -0
- package/dist/mcp/omc-tools-server.d.ts +2 -0
- package/dist/mcp/omc-tools-server.d.ts.map +1 -1
- package/dist/mcp/omc-tools-server.js +9 -2
- package/dist/mcp/omc-tools-server.js.map +1 -1
- package/dist/mcp/team-job-convergence.d.ts +20 -0
- package/dist/mcp/team-job-convergence.d.ts.map +1 -0
- package/dist/mcp/team-job-convergence.js +101 -0
- package/dist/mcp/team-job-convergence.js.map +1 -0
- package/dist/mcp/team-server.d.ts +33 -10
- package/dist/mcp/team-server.d.ts.map +1 -1
- package/dist/mcp/team-server.js +219 -109
- package/dist/mcp/team-server.js.map +1 -1
- package/dist/notifications/__tests__/config.test.js +100 -6
- package/dist/notifications/__tests__/config.test.js.map +1 -1
- package/dist/notifications/__tests__/custom-integration.test.d.ts +8 -0
- package/dist/notifications/__tests__/custom-integration.test.d.ts.map +1 -0
- package/dist/notifications/__tests__/custom-integration.test.js +297 -0
- package/dist/notifications/__tests__/custom-integration.test.js.map +1 -0
- package/dist/notifications/__tests__/dispatcher.test.js +195 -0
- package/dist/notifications/__tests__/dispatcher.test.js.map +1 -1
- package/dist/notifications/__tests__/redact.test.d.ts +2 -0
- package/dist/notifications/__tests__/redact.test.d.ts.map +1 -0
- package/dist/notifications/__tests__/redact.test.js +111 -0
- package/dist/notifications/__tests__/redact.test.js.map +1 -0
- package/dist/notifications/__tests__/reply-listener.test.js +8 -1
- package/dist/notifications/__tests__/reply-listener.test.js.map +1 -1
- package/dist/notifications/__tests__/slack-socket.test.d.ts +2 -0
- package/dist/notifications/__tests__/slack-socket.test.d.ts.map +1 -0
- package/dist/notifications/__tests__/slack-socket.test.js +293 -0
- package/dist/notifications/__tests__/slack-socket.test.js.map +1 -0
- package/dist/notifications/__tests__/template-engine.test.js +32 -0
- package/dist/notifications/__tests__/template-engine.test.js.map +1 -1
- package/dist/notifications/config.d.ts +40 -0
- package/dist/notifications/config.d.ts.map +1 -1
- package/dist/notifications/config.js +201 -4
- package/dist/notifications/config.js.map +1 -1
- package/dist/notifications/dispatcher.d.ts +20 -1
- package/dist/notifications/dispatcher.d.ts.map +1 -1
- package/dist/notifications/dispatcher.js +183 -7
- package/dist/notifications/dispatcher.js.map +1 -1
- package/dist/notifications/hook-config-types.d.ts +1 -1
- package/dist/notifications/hook-config-types.d.ts.map +1 -1
- package/dist/notifications/index.d.ts +11 -2
- package/dist/notifications/index.d.ts.map +1 -1
- package/dist/notifications/index.js +13 -3
- package/dist/notifications/index.js.map +1 -1
- package/dist/notifications/presets.d.ts +43 -0
- package/dist/notifications/presets.d.ts.map +1 -0
- package/dist/notifications/presets.js +122 -0
- package/dist/notifications/presets.js.map +1 -0
- package/dist/notifications/redact.d.ts +21 -0
- package/dist/notifications/redact.d.ts.map +1 -0
- package/dist/notifications/redact.js +33 -0
- package/dist/notifications/redact.js.map +1 -0
- package/dist/notifications/reply-listener.d.ts +54 -2
- package/dist/notifications/reply-listener.d.ts.map +1 -1
- package/dist/notifications/reply-listener.js +178 -15
- package/dist/notifications/reply-listener.js.map +1 -1
- package/dist/notifications/session-registry.d.ts +1 -1
- package/dist/notifications/session-registry.d.ts.map +1 -1
- package/dist/notifications/slack-socket.d.ts +242 -0
- package/dist/notifications/slack-socket.d.ts.map +1 -0
- package/dist/notifications/slack-socket.js +603 -0
- package/dist/notifications/slack-socket.js.map +1 -0
- package/dist/notifications/template-engine.d.ts.map +1 -1
- package/dist/notifications/template-engine.js +4 -0
- package/dist/notifications/template-engine.js.map +1 -1
- package/dist/notifications/template-variables.d.ts +26 -0
- package/dist/notifications/template-variables.d.ts.map +1 -0
- package/dist/notifications/template-variables.js +139 -0
- package/dist/notifications/template-variables.js.map +1 -0
- package/dist/notifications/types.d.ts +75 -2
- package/dist/notifications/types.d.ts.map +1 -1
- package/dist/notifications/validation.d.ts +24 -0
- package/dist/notifications/validation.d.ts.map +1 -0
- package/dist/notifications/validation.js +167 -0
- package/dist/notifications/validation.js.map +1 -0
- package/dist/openclaw/__tests__/dispatcher.test.js +0 -1
- package/dist/openclaw/__tests__/dispatcher.test.js.map +1 -1
- package/dist/openclaw/__tests__/index.test.js +82 -0
- package/dist/openclaw/__tests__/index.test.js.map +1 -1
- package/dist/openclaw/index.d.ts.map +1 -1
- package/dist/openclaw/index.js +24 -1
- package/dist/openclaw/index.js.map +1 -1
- package/dist/openclaw/types.d.ts +12 -0
- package/dist/openclaw/types.d.ts.map +1 -1
- package/dist/shared/types.d.ts +84 -20
- package/dist/shared/types.d.ts.map +1 -1
- package/dist/team/__tests__/api-interop.command-dialect.test.d.ts +2 -0
- package/dist/team/__tests__/api-interop.command-dialect.test.d.ts.map +1 -0
- package/dist/team/__tests__/api-interop.command-dialect.test.js +26 -0
- package/dist/team/__tests__/api-interop.command-dialect.test.js.map +1 -0
- package/dist/team/__tests__/api-interop.compatibility.test.d.ts +2 -0
- package/dist/team/__tests__/api-interop.compatibility.test.d.ts.map +1 -0
- package/dist/team/__tests__/api-interop.compatibility.test.js +93 -0
- package/dist/team/__tests__/api-interop.compatibility.test.js.map +1 -0
- package/dist/team/__tests__/cli-path-resolution.test.d.ts +2 -0
- package/dist/team/__tests__/cli-path-resolution.test.d.ts.map +1 -0
- package/dist/team/__tests__/cli-path-resolution.test.js +281 -0
- package/dist/team/__tests__/cli-path-resolution.test.js.map +1 -0
- package/dist/team/__tests__/index.compat-exports.test.d.ts +2 -0
- package/dist/team/__tests__/index.compat-exports.test.d.ts.map +1 -0
- package/dist/team/__tests__/index.compat-exports.test.js +20 -0
- package/dist/team/__tests__/index.compat-exports.test.js.map +1 -0
- package/dist/team/__tests__/layout-stabilizer.test.d.ts +2 -0
- package/dist/team/__tests__/layout-stabilizer.test.d.ts.map +1 -0
- package/dist/team/__tests__/layout-stabilizer.test.js +217 -0
- package/dist/team/__tests__/layout-stabilizer.test.js.map +1 -0
- package/dist/team/__tests__/mcp-team-bridge.spawn-args.test.js +8 -4
- package/dist/team/__tests__/mcp-team-bridge.spawn-args.test.js.map +1 -1
- package/dist/team/__tests__/mcp-team-bridge.usage.test.js +4 -2
- package/dist/team/__tests__/mcp-team-bridge.usage.test.js.map +1 -1
- package/dist/team/__tests__/model-contract.test.js +84 -8
- package/dist/team/__tests__/model-contract.test.js.map +1 -1
- package/dist/team/__tests__/pane-readiness.test.d.ts +2 -0
- package/dist/team/__tests__/pane-readiness.test.d.ts.map +1 -0
- package/dist/team/__tests__/pane-readiness.test.js +185 -0
- package/dist/team/__tests__/pane-readiness.test.js.map +1 -0
- package/dist/team/__tests__/prompt-sanitization.test.js +1 -1
- package/dist/team/__tests__/prompt-sanitization.test.js.map +1 -1
- package/dist/team/__tests__/runtime-cli.test.d.ts +2 -0
- package/dist/team/__tests__/runtime-cli.test.d.ts.map +1 -0
- package/dist/team/__tests__/runtime-cli.test.js +159 -0
- package/dist/team/__tests__/runtime-cli.test.js.map +1 -0
- package/dist/team/__tests__/runtime-done-recovery.test.d.ts +2 -0
- package/dist/team/__tests__/runtime-done-recovery.test.d.ts.map +1 -0
- package/dist/team/__tests__/runtime-done-recovery.test.js +77 -0
- package/dist/team/__tests__/runtime-done-recovery.test.js.map +1 -0
- package/dist/team/__tests__/runtime-interop-spawn-regression.test.d.ts +2 -0
- package/dist/team/__tests__/runtime-interop-spawn-regression.test.d.ts.map +1 -0
- package/dist/team/__tests__/runtime-interop-spawn-regression.test.js +139 -0
- package/dist/team/__tests__/runtime-interop-spawn-regression.test.js.map +1 -0
- package/dist/team/__tests__/runtime-prompt-mode.test.js +167 -14
- package/dist/team/__tests__/runtime-prompt-mode.test.js.map +1 -1
- package/dist/team/__tests__/runtime-v2.feature-flag.test.d.ts +2 -0
- package/dist/team/__tests__/runtime-v2.feature-flag.test.d.ts.map +1 -0
- package/dist/team/__tests__/runtime-v2.feature-flag.test.js +20 -0
- package/dist/team/__tests__/runtime-v2.feature-flag.test.js.map +1 -0
- package/dist/team/__tests__/runtime-watchdog-retry.test.d.ts +2 -0
- package/dist/team/__tests__/runtime-watchdog-retry.test.d.ts.map +1 -0
- package/dist/team/__tests__/runtime-watchdog-retry.test.js +408 -0
- package/dist/team/__tests__/runtime-watchdog-retry.test.js.map +1 -0
- package/dist/team/__tests__/shell-path.test.d.ts +2 -0
- package/dist/team/__tests__/shell-path.test.d.ts.map +1 -0
- package/dist/team/__tests__/shell-path.test.js +193 -0
- package/dist/team/__tests__/shell-path.test.js.map +1 -0
- package/dist/team/__tests__/state-paths.test.d.ts +2 -0
- package/dist/team/__tests__/state-paths.test.d.ts.map +1 -0
- package/dist/team/__tests__/state-paths.test.js +16 -0
- package/dist/team/__tests__/state-paths.test.js.map +1 -0
- package/dist/team/__tests__/task-file-ops.test.js +8 -2
- package/dist/team/__tests__/task-file-ops.test.js.map +1 -1
- package/dist/team/__tests__/tmux-session.create-team.test.js +15 -17
- package/dist/team/__tests__/tmux-session.create-team.test.js.map +1 -1
- package/dist/team/__tests__/tmux-session.kill-team-session.test.d.ts +2 -0
- package/dist/team/__tests__/tmux-session.kill-team-session.test.d.ts.map +1 -0
- package/dist/team/__tests__/tmux-session.kill-team-session.test.js +56 -0
- package/dist/team/__tests__/tmux-session.kill-team-session.test.js.map +1 -0
- package/dist/team/__tests__/tmux-session.spawn.test.js +9 -0
- package/dist/team/__tests__/tmux-session.spawn.test.js.map +1 -1
- package/dist/team/__tests__/tmux-session.test.js +83 -5
- package/dist/team/__tests__/tmux-session.test.js.map +1 -1
- package/dist/team/__tests__/wait-for-shell-ready.test.d.ts +2 -0
- package/dist/team/__tests__/wait-for-shell-ready.test.d.ts.map +1 -0
- package/dist/team/__tests__/wait-for-shell-ready.test.js +242 -0
- package/dist/team/__tests__/wait-for-shell-ready.test.js.map +1 -0
- package/dist/team/__tests__/worker-bootstrap.test.js +11 -0
- package/dist/team/__tests__/worker-bootstrap.test.js.map +1 -1
- package/dist/team/api-interop.d.ts +20 -0
- package/dist/team/api-interop.d.ts.map +1 -0
- package/dist/team/api-interop.js +601 -0
- package/dist/team/api-interop.js.map +1 -0
- package/dist/team/contracts.d.ts +14 -0
- package/dist/team/contracts.d.ts.map +1 -0
- package/dist/team/contracts.js +32 -0
- package/dist/team/contracts.js.map +1 -0
- package/dist/team/dispatch-queue.d.ts +64 -0
- package/dist/team/dispatch-queue.d.ts.map +1 -0
- package/dist/team/dispatch-queue.js +288 -0
- package/dist/team/dispatch-queue.js.map +1 -0
- package/dist/team/events.d.ts +49 -0
- package/dist/team/events.d.ts.map +1 -0
- package/dist/team/events.js +113 -0
- package/dist/team/events.js.map +1 -0
- package/dist/team/index.d.ts +15 -2
- package/dist/team/index.d.ts.map +1 -1
- package/dist/team/index.js +14 -1
- package/dist/team/index.js.map +1 -1
- package/dist/team/layout-stabilizer.d.ts +23 -0
- package/dist/team/layout-stabilizer.d.ts.map +1 -0
- package/dist/team/layout-stabilizer.js +117 -0
- package/dist/team/layout-stabilizer.js.map +1 -0
- package/dist/team/mcp-comm.d.ts +99 -0
- package/dist/team/mcp-comm.d.ts.map +1 -0
- package/dist/team/mcp-comm.js +235 -0
- package/dist/team/mcp-comm.js.map +1 -0
- package/dist/team/mcp-team-bridge.d.ts +2 -2
- package/dist/team/mcp-team-bridge.d.ts.map +1 -1
- package/dist/team/mcp-team-bridge.js +263 -144
- package/dist/team/mcp-team-bridge.js.map +1 -1
- package/dist/team/model-contract.d.ts +28 -1
- package/dist/team/model-contract.d.ts.map +1 -1
- package/dist/team/model-contract.js +143 -5
- package/dist/team/model-contract.js.map +1 -1
- package/dist/team/monitor.d.ts +45 -0
- package/dist/team/monitor.d.ts.map +1 -0
- package/dist/team/monitor.js +339 -0
- package/dist/team/monitor.js.map +1 -0
- package/dist/team/runtime-cli.d.ts +24 -0
- package/dist/team/runtime-cli.d.ts.map +1 -1
- package/dist/team/runtime-cli.js +230 -12
- package/dist/team/runtime-cli.js.map +1 -1
- package/dist/team/runtime-v2.d.ts +122 -0
- package/dist/team/runtime-v2.d.ts.map +1 -0
- package/dist/team/runtime-v2.js +766 -0
- package/dist/team/runtime-v2.js.map +1 -0
- package/dist/team/runtime.d.ts +2 -0
- package/dist/team/runtime.d.ts.map +1 -1
- package/dist/team/runtime.js +145 -52
- package/dist/team/runtime.js.map +1 -1
- package/dist/team/scaling.d.ts +59 -0
- package/dist/team/scaling.d.ts.map +1 -0
- package/dist/team/scaling.js +311 -0
- package/dist/team/scaling.js.map +1 -0
- package/dist/team/sentinel-gate.d.ts +23 -0
- package/dist/team/sentinel-gate.d.ts.map +1 -0
- package/dist/team/sentinel-gate.js +127 -0
- package/dist/team/sentinel-gate.js.map +1 -0
- package/dist/team/shell-path.d.ts +21 -0
- package/dist/team/shell-path.d.ts.map +1 -0
- package/dist/team/shell-path.js +73 -0
- package/dist/team/shell-path.js.map +1 -0
- package/dist/team/state/tasks.d.ts +48 -0
- package/dist/team/state/tasks.d.ts.map +1 -0
- package/dist/team/state/tasks.js +184 -0
- package/dist/team/state/tasks.js.map +1 -0
- package/dist/team/state-paths.d.ts +20 -4
- package/dist/team/state-paths.d.ts.map +1 -1
- package/dist/team/state-paths.js +29 -6
- package/dist/team/state-paths.js.map +1 -1
- package/dist/team/task-file-ops.d.ts +2 -1
- package/dist/team/task-file-ops.d.ts.map +1 -1
- package/dist/team/task-file-ops.js +19 -0
- package/dist/team/task-file-ops.js.map +1 -1
- package/dist/team/team-ops.d.ts +44 -0
- package/dist/team/team-ops.d.ts.map +1 -0
- package/dist/team/team-ops.js +547 -0
- package/dist/team/team-ops.js.map +1 -0
- package/dist/team/tmux-comm.d.ts.map +1 -1
- package/dist/team/tmux-comm.js +107 -44
- package/dist/team/tmux-comm.js.map +1 -1
- package/dist/team/tmux-session.d.ts +5 -0
- package/dist/team/tmux-session.d.ts.map +1 -1
- package/dist/team/tmux-session.js +81 -10
- package/dist/team/tmux-session.js.map +1 -1
- package/dist/team/types.d.ts +303 -8
- package/dist/team/types.d.ts.map +1 -1
- package/dist/team/types.js +2 -1
- package/dist/team/types.js.map +1 -1
- package/dist/team/worker-bootstrap.d.ts.map +1 -1
- package/dist/team/worker-bootstrap.js +73 -21
- package/dist/team/worker-bootstrap.js.map +1 -1
- package/dist/tools/__tests__/cancel-integration.test.d.ts +2 -0
- package/dist/tools/__tests__/cancel-integration.test.d.ts.map +1 -0
- package/dist/tools/__tests__/cancel-integration.test.js +248 -0
- package/dist/tools/__tests__/cancel-integration.test.js.map +1 -0
- package/dist/tools/__tests__/memory-tools.test.d.ts +2 -0
- package/dist/tools/__tests__/memory-tools.test.d.ts.map +1 -0
- package/dist/tools/__tests__/memory-tools.test.js +66 -0
- package/dist/tools/__tests__/memory-tools.test.js.map +1 -0
- package/dist/tools/__tests__/state-tools.test.js +73 -5
- package/dist/tools/__tests__/state-tools.test.js.map +1 -1
- package/dist/tools/lsp/__tests__/client-eviction.test.js +6 -6
- package/dist/tools/lsp/__tests__/client-eviction.test.js.map +1 -1
- package/dist/tools/lsp/__tests__/client-timeout-env.test.d.ts +2 -0
- package/dist/tools/lsp/__tests__/client-timeout-env.test.d.ts.map +1 -0
- package/dist/tools/lsp/__tests__/client-timeout-env.test.js +39 -0
- package/dist/tools/lsp/__tests__/client-timeout-env.test.js.map +1 -0
- package/dist/tools/lsp/client.d.ts +2 -0
- package/dist/tools/lsp/client.d.ts.map +1 -1
- package/dist/tools/lsp/client.js +11 -1
- package/dist/tools/lsp/client.js.map +1 -1
- package/dist/tools/lsp/index.d.ts +1 -1
- package/dist/tools/lsp/index.d.ts.map +1 -1
- package/dist/tools/lsp/index.js +1 -1
- package/dist/tools/lsp/index.js.map +1 -1
- package/dist/tools/memory-tools.d.ts.map +1 -1
- package/dist/tools/memory-tools.js +2 -1
- package/dist/tools/memory-tools.js.map +1 -1
- package/dist/tools/python-repl/__tests__/tcp-fallback.test.d.ts +2 -0
- package/dist/tools/python-repl/__tests__/tcp-fallback.test.d.ts.map +1 -0
- package/dist/tools/python-repl/__tests__/tcp-fallback.test.js +138 -0
- package/dist/tools/python-repl/__tests__/tcp-fallback.test.js.map +1 -0
- package/dist/tools/python-repl/bridge-manager.d.ts.map +1 -1
- package/dist/tools/python-repl/bridge-manager.js +104 -24
- package/dist/tools/python-repl/bridge-manager.js.map +1 -1
- package/dist/tools/python-repl/paths.d.ts +8 -0
- package/dist/tools/python-repl/paths.d.ts.map +1 -1
- package/dist/tools/python-repl/paths.js +10 -0
- package/dist/tools/python-repl/paths.js.map +1 -1
- package/dist/tools/python-repl/socket-client.d.ts.map +1 -1
- package/dist/tools/python-repl/socket-client.js +9 -2
- package/dist/tools/python-repl/socket-client.js.map +1 -1
- package/dist/tools/shared-memory-tools.d.ts +55 -0
- package/dist/tools/shared-memory-tools.d.ts.map +1 -0
- package/dist/tools/shared-memory-tools.js +250 -0
- package/dist/tools/shared-memory-tools.js.map +1 -0
- package/dist/tools/state-tools.d.ts.map +1 -1
- package/dist/tools/state-tools.js +126 -101
- package/dist/tools/state-tools.js.map +1 -1
- package/dist/utils/daemon-module-path.d.ts +9 -0
- package/dist/utils/daemon-module-path.d.ts.map +1 -0
- package/dist/utils/daemon-module-path.js +23 -0
- package/dist/utils/daemon-module-path.js.map +1 -0
- package/dist/utils/jsonc.d.ts +16 -0
- package/dist/utils/jsonc.d.ts.map +1 -0
- package/dist/utils/jsonc.js +64 -0
- package/dist/utils/jsonc.js.map +1 -0
- package/dist/utils/paths.js +1 -1
- package/dist/utils/paths.js.map +1 -1
- package/dist/utils/ssrf-guard.d.ts +26 -0
- package/dist/utils/ssrf-guard.d.ts.map +1 -0
- package/dist/utils/ssrf-guard.js +103 -0
- package/dist/utils/ssrf-guard.js.map +1 -0
- package/dist/verification/tier-selector.d.ts +1 -1
- package/dist/verification/tier-selector.js +1 -1
- package/docs/ANALYTICS-SYSTEM.md +2 -5
- package/docs/CLAUDE.md +88 -212
- package/docs/MIGRATION.md +138 -161
- package/docs/PERFORMANCE-MONITORING.md +5 -5
- package/docs/REFERENCE.md +351 -286
- package/docs/ko/ARCHITECTURE.md +152 -0
- package/docs/ko/FEATURES.md +582 -0
- package/docs/ko/MIGRATION.md +1027 -0
- package/docs/ko/REFERENCE.md +745 -0
- package/docs/partials/mode-selection-guide.md +22 -12
- package/docs/shared/mode-selection-guide.md +22 -12
- package/package.json +11 -6
- package/scripts/ask-codex.sh +24 -0
- package/scripts/ask-gemini.sh +24 -0
- package/scripts/build-cli.mjs +47 -0
- package/scripts/build-runtime-cli.mjs +2 -0
- package/scripts/context-guard-stop.mjs +66 -3
- package/scripts/context-safety.mjs +67 -2
- package/scripts/keyword-detector.mjs +14 -36
- package/scripts/persistent-mode.cjs +106 -1
- package/scripts/persistent-mode.mjs +88 -2
- package/scripts/plugin-setup.mjs +46 -4
- package/scripts/pre-tool-enforcer.mjs +1 -0
- package/scripts/qa-tests/test-custom-integration.mjs +144 -0
- package/scripts/run-provider-advisor.js +220 -0
- package/scripts/session-start.mjs +42 -2
- package/skills/AGENTS.md +15 -20
- package/skills/ask-codex/SKILL.md +47 -0
- package/skills/ask-gemini/SKILL.md +47 -0
- package/skills/autopilot/SKILL.md +39 -5
- package/skills/cancel/SKILL.md +23 -105
- package/skills/ccg/SKILL.md +58 -75
- package/skills/configure-notifications/SKILL.md +276 -0
- package/skills/configure-openclaw/SKILL.md +63 -0
- package/skills/deep-interview/SKILL.md +551 -0
- package/skills/deepinit/SKILL.md +1 -1
- package/skills/hud/SKILL.md +35 -3
- package/skills/omc-doctor/SKILL.md +30 -13
- package/skills/omc-help/SKILL.md +1 -1
- package/skills/omc-setup/SKILL.md +20 -20
- package/skills/omc-teams/SKILL.md +60 -112
- package/skills/plan/SKILL.md +5 -5
- package/skills/ralph/SKILL.md +96 -70
- package/skills/ralplan/SKILL.md +7 -7
- package/skills/security-review/SKILL.md +2 -2
- package/skills/team/SKILL.md +36 -2
- package/skills/ultrawork/SKILL.md +7 -7
- package/templates/hooks/keyword-detector.mjs +20 -28
- package/templates/hooks/persistent-mode.mjs +89 -2
- package/templates/hooks/pre-tool-use.mjs +53 -0
- package/templates/hooks/session-start.mjs +3 -3
- package/skills/pipeline/SKILL.md +0 -434
- package/skills/review/SKILL.md +0 -30
- package/skills/ultrapilot/SKILL.md +0 -632
|
@@ -0,0 +1,766 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Event-driven team runtime v2 — replaces the polling watchdog from runtime.ts.
|
|
3
|
+
*
|
|
4
|
+
* Runtime selection:
|
|
5
|
+
* - Default: v2 enabled
|
|
6
|
+
* - Opt-out: set OMC_RUNTIME_V2=0|false|no|off to force legacy v1
|
|
7
|
+
* NO done.json polling. Completion is detected via:
|
|
8
|
+
* - CLI API lifecycle transitions (claim-task, transition-task-status)
|
|
9
|
+
* - Event-driven monitor snapshots
|
|
10
|
+
* - Worker heartbeat/status files
|
|
11
|
+
*
|
|
12
|
+
* Preserves: sentinel gate, circuit breaker, failure sidecars.
|
|
13
|
+
* Removes: done.json watchdog loop, sleep-based polling.
|
|
14
|
+
*
|
|
15
|
+
* Architecture mirrors runtime.ts: startTeam, monitorTeam, shutdownTeam,
|
|
16
|
+
* assignTask, resumeTeam as discrete operations driven by the caller.
|
|
17
|
+
*/
|
|
18
|
+
import { join, resolve } from 'path';
|
|
19
|
+
import { existsSync } from 'fs';
|
|
20
|
+
import { mkdir, readdir, writeFile } from 'fs/promises';
|
|
21
|
+
import { performance } from 'perf_hooks';
|
|
22
|
+
import { TeamPaths, absPath, teamStateRoot } from './state-paths.js';
|
|
23
|
+
import { readTeamConfig, readWorkerStatus, readWorkerHeartbeat, readMonitorSnapshot, writeMonitorSnapshot, writeShutdownRequest, readShutdownAck, writeWorkerInbox, listTasksFromFiles, saveTeamConfig, cleanupTeamState, } from './monitor.js';
|
|
24
|
+
import { appendTeamEvent, emitMonitorDerivedEvents } from './events.js';
|
|
25
|
+
import { inferPhase } from './phase-controller.js';
|
|
26
|
+
import { validateTeamName } from './team-name.js';
|
|
27
|
+
import { buildWorkerArgv, resolveValidatedBinaryPath, getWorkerEnv as getModelWorkerEnv, isPromptModeAgent, getPromptModeArgs, } from './model-contract.js';
|
|
28
|
+
import { createTeamSession, spawnWorkerInPane, sendToWorker, waitForPaneReady, } from './tmux-session.js';
|
|
29
|
+
import { composeInitialInbox, ensureWorkerStateDir, writeWorkerOverlay, } from './worker-bootstrap.js';
|
|
30
|
+
// ---------------------------------------------------------------------------
|
|
31
|
+
// Feature flag
|
|
32
|
+
// ---------------------------------------------------------------------------
|
|
33
|
+
export function isRuntimeV2Enabled(env = process.env) {
|
|
34
|
+
const raw = env.OMC_RUNTIME_V2;
|
|
35
|
+
if (!raw)
|
|
36
|
+
return true;
|
|
37
|
+
const normalized = raw.trim().toLowerCase();
|
|
38
|
+
return !['0', 'false', 'no', 'off'].includes(normalized);
|
|
39
|
+
}
|
|
40
|
+
// ---------------------------------------------------------------------------
|
|
41
|
+
// Helper: sanitize team name
|
|
42
|
+
// ---------------------------------------------------------------------------
|
|
43
|
+
function sanitizeTeamName(name) {
|
|
44
|
+
return name.replace(/[^a-z0-9-]/g, '').slice(0, 30);
|
|
45
|
+
}
|
|
46
|
+
// ---------------------------------------------------------------------------
|
|
47
|
+
// Helper: check worker liveness via tmux pane
|
|
48
|
+
// ---------------------------------------------------------------------------
|
|
49
|
+
async function isWorkerPaneAlive(paneId) {
|
|
50
|
+
if (!paneId)
|
|
51
|
+
return false;
|
|
52
|
+
try {
|
|
53
|
+
const { isWorkerAlive } = await import('./tmux-session.js');
|
|
54
|
+
return await isWorkerAlive(paneId);
|
|
55
|
+
}
|
|
56
|
+
catch {
|
|
57
|
+
return false;
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
// ---------------------------------------------------------------------------
|
|
61
|
+
// V2 task instruction builder — CLI API lifecycle, NO done.json
|
|
62
|
+
// ---------------------------------------------------------------------------
|
|
63
|
+
/**
|
|
64
|
+
* Build the initial task instruction for v2 workers.
|
|
65
|
+
* Workers use `omc team api` CLI commands for all lifecycle transitions.
|
|
66
|
+
*/
|
|
67
|
+
function buildV2TaskInstruction(teamName, workerName, task, taskId) {
|
|
68
|
+
return [
|
|
69
|
+
`## Initial Task Assignment`,
|
|
70
|
+
`Task ID: ${taskId}`,
|
|
71
|
+
`Worker: ${workerName}`,
|
|
72
|
+
`Subject: ${task.subject}`,
|
|
73
|
+
``,
|
|
74
|
+
task.description,
|
|
75
|
+
``,
|
|
76
|
+
`## Task Lifecycle (CLI API)`,
|
|
77
|
+
`1. Claim your task:`,
|
|
78
|
+
` omc team api claim-task --input '{"team_name":"${teamName}","task_id":"${taskId}","worker":"${workerName}"}' --json`,
|
|
79
|
+
`2. Do the work described above`,
|
|
80
|
+
`3. On completion (use the claim_token from step 1):`,
|
|
81
|
+
` omc team api transition-task-status --input '{"team_name":"${teamName}","task_id":"${taskId}","from":"in_progress","to":"completed","claim_token":"<claim_token>"}' --json`,
|
|
82
|
+
`4. On failure (use the claim_token from step 1):`,
|
|
83
|
+
` omc team api transition-task-status --input '{"team_name":"${teamName}","task_id":"${taskId}","from":"in_progress","to":"failed","claim_token":"<claim_token>"}' --json`,
|
|
84
|
+
``,
|
|
85
|
+
`IMPORTANT: Use the CLI API commands above for all task state transitions.`,
|
|
86
|
+
`Do NOT write done.json or edit task files directly.`,
|
|
87
|
+
`After completing or failing the task, exit immediately.`,
|
|
88
|
+
].join('\n');
|
|
89
|
+
}
|
|
90
|
+
// ---------------------------------------------------------------------------
|
|
91
|
+
// V2 worker spawning — direct tmux pane creation, no v1 delegation
|
|
92
|
+
// ---------------------------------------------------------------------------
|
|
93
|
+
async function notifyPaneWithRetry(sessionName, paneId, message, maxAttempts = 6, retryDelayMs = 350) {
|
|
94
|
+
for (let attempt = 1; attempt <= maxAttempts; attempt++) {
|
|
95
|
+
if (await sendToWorker(sessionName, paneId, message)) {
|
|
96
|
+
return true;
|
|
97
|
+
}
|
|
98
|
+
if (attempt < maxAttempts) {
|
|
99
|
+
await new Promise(r => setTimeout(r, retryDelayMs));
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
return false;
|
|
103
|
+
}
|
|
104
|
+
/**
|
|
105
|
+
* Spawn a single v2 worker in a tmux pane.
|
|
106
|
+
* Writes CLI API inbox (no done.json), waits for ready, sends inbox path.
|
|
107
|
+
*/
|
|
108
|
+
async function spawnV2Worker(opts) {
|
|
109
|
+
const { execFile } = await import('child_process');
|
|
110
|
+
const { promisify } = await import('util');
|
|
111
|
+
const execFileAsync = promisify(execFile);
|
|
112
|
+
// Split new pane off the last existing pane (or leader if first worker)
|
|
113
|
+
const splitTarget = opts.existingWorkerPaneIds.length === 0
|
|
114
|
+
? opts.leaderPaneId
|
|
115
|
+
: opts.existingWorkerPaneIds[opts.existingWorkerPaneIds.length - 1];
|
|
116
|
+
const splitType = opts.existingWorkerPaneIds.length === 0 ? '-h' : '-v';
|
|
117
|
+
const splitResult = await execFileAsync('tmux', [
|
|
118
|
+
'split-window', splitType, '-t', splitTarget,
|
|
119
|
+
'-d', '-P', '-F', '#{pane_id}',
|
|
120
|
+
'-c', opts.cwd,
|
|
121
|
+
]);
|
|
122
|
+
const paneId = splitResult.stdout.split('\n')[0]?.trim();
|
|
123
|
+
if (!paneId)
|
|
124
|
+
return null;
|
|
125
|
+
const usePromptMode = isPromptModeAgent(opts.agentType);
|
|
126
|
+
// Build v2 task instruction (CLI API, NO done.json)
|
|
127
|
+
const instruction = buildV2TaskInstruction(opts.teamName, opts.workerName, opts.task, opts.taskId);
|
|
128
|
+
await composeInitialInbox(opts.teamName, opts.workerName, instruction, opts.cwd);
|
|
129
|
+
const relInboxPath = `.omc/state/team/${opts.teamName}/workers/${opts.workerName}/inbox.md`;
|
|
130
|
+
// Build env and launch command
|
|
131
|
+
const envVars = getModelWorkerEnv(opts.teamName, opts.workerName, opts.agentType);
|
|
132
|
+
const resolvedBinaryPath = opts.resolvedBinaryPaths[opts.agentType]
|
|
133
|
+
?? resolveValidatedBinaryPath(opts.agentType);
|
|
134
|
+
// Resolve model from environment variables
|
|
135
|
+
const modelForAgent = (() => {
|
|
136
|
+
if (opts.agentType === 'codex') {
|
|
137
|
+
return process.env.OMC_EXTERNAL_MODELS_DEFAULT_CODEX_MODEL
|
|
138
|
+
|| process.env.OMC_CODEX_DEFAULT_MODEL
|
|
139
|
+
|| undefined;
|
|
140
|
+
}
|
|
141
|
+
if (opts.agentType === 'gemini') {
|
|
142
|
+
return process.env.OMC_EXTERNAL_MODELS_DEFAULT_GEMINI_MODEL
|
|
143
|
+
|| process.env.OMC_GEMINI_DEFAULT_MODEL
|
|
144
|
+
|| undefined;
|
|
145
|
+
}
|
|
146
|
+
return undefined;
|
|
147
|
+
})();
|
|
148
|
+
const [launchBinary, ...launchArgs] = buildWorkerArgv(opts.agentType, {
|
|
149
|
+
teamName: opts.teamName,
|
|
150
|
+
workerName: opts.workerName,
|
|
151
|
+
cwd: opts.cwd,
|
|
152
|
+
resolvedBinaryPath,
|
|
153
|
+
model: modelForAgent,
|
|
154
|
+
});
|
|
155
|
+
// For prompt-mode agents (codex, gemini), pass instruction via CLI flag
|
|
156
|
+
if (usePromptMode) {
|
|
157
|
+
const promptArgs = getPromptModeArgs(opts.agentType, `Read and execute your task from: ${relInboxPath}`);
|
|
158
|
+
launchArgs.push(...promptArgs);
|
|
159
|
+
}
|
|
160
|
+
const paneConfig = {
|
|
161
|
+
teamName: opts.teamName,
|
|
162
|
+
workerName: opts.workerName,
|
|
163
|
+
envVars,
|
|
164
|
+
launchBinary,
|
|
165
|
+
launchArgs,
|
|
166
|
+
cwd: opts.cwd,
|
|
167
|
+
};
|
|
168
|
+
await spawnWorkerInPane(opts.sessionName, paneId, paneConfig);
|
|
169
|
+
// Apply layout
|
|
170
|
+
try {
|
|
171
|
+
await execFileAsync('tmux', [
|
|
172
|
+
'select-layout', '-t', opts.sessionName, 'main-vertical',
|
|
173
|
+
]);
|
|
174
|
+
}
|
|
175
|
+
catch { /* layout is best-effort */ }
|
|
176
|
+
// For interactive agents, wait for pane readiness then send inbox path
|
|
177
|
+
if (!usePromptMode) {
|
|
178
|
+
const paneReady = await waitForPaneReady(paneId);
|
|
179
|
+
if (!paneReady) {
|
|
180
|
+
try {
|
|
181
|
+
await execFileAsync('tmux', ['kill-pane', '-t', paneId]);
|
|
182
|
+
}
|
|
183
|
+
catch { /* best-effort cleanup */ }
|
|
184
|
+
return null;
|
|
185
|
+
}
|
|
186
|
+
// Handle gemini trust-confirm
|
|
187
|
+
if (opts.agentType === 'gemini') {
|
|
188
|
+
const confirmed = await notifyPaneWithRetry(opts.sessionName, paneId, '1');
|
|
189
|
+
if (!confirmed) {
|
|
190
|
+
try {
|
|
191
|
+
await execFileAsync('tmux', ['kill-pane', '-t', paneId]);
|
|
192
|
+
}
|
|
193
|
+
catch { /* best-effort cleanup */ }
|
|
194
|
+
return null;
|
|
195
|
+
}
|
|
196
|
+
await new Promise(r => setTimeout(r, 800));
|
|
197
|
+
}
|
|
198
|
+
// Send inbox path to worker
|
|
199
|
+
const notified = await notifyPaneWithRetry(opts.sessionName, paneId, `Read and execute your task from: ${relInboxPath}`);
|
|
200
|
+
if (!notified) {
|
|
201
|
+
try {
|
|
202
|
+
await execFileAsync('tmux', ['kill-pane', '-t', paneId]);
|
|
203
|
+
}
|
|
204
|
+
catch { /* best-effort cleanup */ }
|
|
205
|
+
return null;
|
|
206
|
+
}
|
|
207
|
+
}
|
|
208
|
+
return paneId;
|
|
209
|
+
}
|
|
210
|
+
// ---------------------------------------------------------------------------
|
|
211
|
+
// startTeamV2 — direct tmux creation, CLI API inbox, NO watchdog
|
|
212
|
+
// ---------------------------------------------------------------------------
|
|
213
|
+
/**
|
|
214
|
+
* Start a team with the v2 event-driven runtime.
|
|
215
|
+
* Creates state directories, writes config + task files, spawns workers via
|
|
216
|
+
* tmux split-panes, and writes CLI API inbox instructions. NO done.json.
|
|
217
|
+
* NO watchdog polling — the leader drives monitoring via monitorTeamV2().
|
|
218
|
+
*/
|
|
219
|
+
export async function startTeamV2(config) {
|
|
220
|
+
const sanitized = sanitizeTeamName(config.teamName);
|
|
221
|
+
const leaderCwd = resolve(config.cwd);
|
|
222
|
+
validateTeamName(sanitized);
|
|
223
|
+
// Validate CLIs and pin absolute binary paths
|
|
224
|
+
const agentTypes = config.agentTypes;
|
|
225
|
+
const resolvedBinaryPaths = {};
|
|
226
|
+
for (const agentType of [...new Set(agentTypes)]) {
|
|
227
|
+
resolvedBinaryPaths[agentType] = resolveValidatedBinaryPath(agentType);
|
|
228
|
+
}
|
|
229
|
+
// Create state directories
|
|
230
|
+
await mkdir(absPath(leaderCwd, TeamPaths.tasks(sanitized)), { recursive: true });
|
|
231
|
+
await mkdir(absPath(leaderCwd, TeamPaths.workers(sanitized)), { recursive: true });
|
|
232
|
+
await mkdir(join(leaderCwd, '.omc', 'state', 'team', sanitized, 'mailbox'), { recursive: true });
|
|
233
|
+
// Write task files
|
|
234
|
+
for (let i = 0; i < config.tasks.length; i++) {
|
|
235
|
+
const taskId = String(i + 1);
|
|
236
|
+
const taskFilePath = absPath(leaderCwd, TeamPaths.taskFile(sanitized, taskId));
|
|
237
|
+
await mkdir(join(taskFilePath, '..'), { recursive: true });
|
|
238
|
+
await writeFile(taskFilePath, JSON.stringify({
|
|
239
|
+
id: taskId,
|
|
240
|
+
subject: config.tasks[i].subject,
|
|
241
|
+
description: config.tasks[i].description,
|
|
242
|
+
status: 'pending',
|
|
243
|
+
owner: null,
|
|
244
|
+
result: null,
|
|
245
|
+
created_at: new Date().toISOString(),
|
|
246
|
+
}, null, 2), 'utf-8');
|
|
247
|
+
}
|
|
248
|
+
// Set up worker state dirs and overlays (with v2 CLI API instructions)
|
|
249
|
+
const workerNames = [];
|
|
250
|
+
for (let i = 0; i < config.tasks.length; i++) {
|
|
251
|
+
const wName = `worker-${i + 1}`;
|
|
252
|
+
workerNames.push(wName);
|
|
253
|
+
const agentType = (agentTypes[i % agentTypes.length] ?? agentTypes[0] ?? 'claude');
|
|
254
|
+
await ensureWorkerStateDir(sanitized, wName, leaderCwd);
|
|
255
|
+
await writeWorkerOverlay({
|
|
256
|
+
teamName: sanitized, workerName: wName, agentType,
|
|
257
|
+
tasks: config.tasks.map((t, idx) => ({
|
|
258
|
+
id: String(idx + 1), subject: t.subject, description: t.description,
|
|
259
|
+
})),
|
|
260
|
+
cwd: leaderCwd,
|
|
261
|
+
});
|
|
262
|
+
}
|
|
263
|
+
// Create tmux session (leader only — workers spawned below)
|
|
264
|
+
const session = await createTeamSession(sanitized, 0, leaderCwd);
|
|
265
|
+
const sessionName = session.sessionName;
|
|
266
|
+
const leaderPaneId = session.leaderPaneId;
|
|
267
|
+
const workerPaneIds = [];
|
|
268
|
+
// Build workers info for config
|
|
269
|
+
const workersInfo = workerNames.map((wName, i) => ({
|
|
270
|
+
name: wName,
|
|
271
|
+
index: i + 1,
|
|
272
|
+
role: (agentTypes[i % agentTypes.length] ?? agentTypes[0] ?? 'claude'),
|
|
273
|
+
assigned_tasks: [],
|
|
274
|
+
working_dir: leaderCwd,
|
|
275
|
+
}));
|
|
276
|
+
// Write initial v2 config
|
|
277
|
+
const teamConfig = {
|
|
278
|
+
name: sanitized,
|
|
279
|
+
task: config.tasks.map(t => t.subject).join('; '),
|
|
280
|
+
agent_type: agentTypes[0] || 'claude',
|
|
281
|
+
worker_launch_mode: 'interactive',
|
|
282
|
+
worker_count: config.workerCount,
|
|
283
|
+
max_workers: 20,
|
|
284
|
+
workers: workersInfo,
|
|
285
|
+
created_at: new Date().toISOString(),
|
|
286
|
+
tmux_session: sessionName,
|
|
287
|
+
next_task_id: config.tasks.length + 1,
|
|
288
|
+
leader_cwd: leaderCwd,
|
|
289
|
+
team_state_root: teamStateRoot(leaderCwd, sanitized),
|
|
290
|
+
leader_pane_id: leaderPaneId,
|
|
291
|
+
hud_pane_id: null,
|
|
292
|
+
resize_hook_name: null,
|
|
293
|
+
resize_hook_target: null,
|
|
294
|
+
};
|
|
295
|
+
await saveTeamConfig(teamConfig, leaderCwd);
|
|
296
|
+
// Spawn workers for initial tasks (up to workerCount concurrent)
|
|
297
|
+
const maxConcurrent = Math.min(agentTypes.length, config.tasks.length);
|
|
298
|
+
for (let i = 0; i < maxConcurrent; i++) {
|
|
299
|
+
const wName = workerNames[i];
|
|
300
|
+
const taskId = String(i + 1);
|
|
301
|
+
const task = config.tasks[i];
|
|
302
|
+
if (!task)
|
|
303
|
+
break;
|
|
304
|
+
const paneId = await spawnV2Worker({
|
|
305
|
+
sessionName,
|
|
306
|
+
leaderPaneId,
|
|
307
|
+
existingWorkerPaneIds: workerPaneIds,
|
|
308
|
+
teamName: sanitized,
|
|
309
|
+
workerName: wName,
|
|
310
|
+
workerIndex: i,
|
|
311
|
+
agentType: (agentTypes[i % agentTypes.length] ?? agentTypes[0] ?? 'claude'),
|
|
312
|
+
task,
|
|
313
|
+
taskId,
|
|
314
|
+
cwd: leaderCwd,
|
|
315
|
+
resolvedBinaryPaths,
|
|
316
|
+
});
|
|
317
|
+
if (paneId) {
|
|
318
|
+
workerPaneIds.push(paneId);
|
|
319
|
+
const workerInfo = workersInfo[i];
|
|
320
|
+
if (workerInfo) {
|
|
321
|
+
workerInfo.pane_id = paneId;
|
|
322
|
+
workerInfo.assigned_tasks = [taskId];
|
|
323
|
+
}
|
|
324
|
+
}
|
|
325
|
+
}
|
|
326
|
+
// Persist config with pane IDs
|
|
327
|
+
teamConfig.workers = workersInfo;
|
|
328
|
+
await saveTeamConfig(teamConfig, leaderCwd);
|
|
329
|
+
// Emit start event — NO watchdog, leader drives via monitorTeamV2()
|
|
330
|
+
await appendTeamEvent(sanitized, {
|
|
331
|
+
type: 'team_leader_nudge',
|
|
332
|
+
worker: 'leader-fixed',
|
|
333
|
+
reason: `start_team_v2: workers=${config.workerCount} tasks=${config.tasks.length} panes=${workerPaneIds.length}`,
|
|
334
|
+
}, leaderCwd);
|
|
335
|
+
return {
|
|
336
|
+
teamName: sanitized,
|
|
337
|
+
sanitizedName: sanitized,
|
|
338
|
+
sessionName,
|
|
339
|
+
config: teamConfig,
|
|
340
|
+
cwd: leaderCwd,
|
|
341
|
+
};
|
|
342
|
+
}
|
|
343
|
+
// ---------------------------------------------------------------------------
|
|
344
|
+
// Circuit breaker — 3 consecutive failures -> write watchdog-failed.json
|
|
345
|
+
// ---------------------------------------------------------------------------
|
|
346
|
+
const CIRCUIT_BREAKER_THRESHOLD = 3;
|
|
347
|
+
export async function writeWatchdogFailedMarker(teamName, cwd, reason) {
|
|
348
|
+
const { writeFile } = await import('fs/promises');
|
|
349
|
+
const marker = {
|
|
350
|
+
failedAt: Date.now(),
|
|
351
|
+
reason,
|
|
352
|
+
writtenBy: 'runtime-v2',
|
|
353
|
+
};
|
|
354
|
+
const root = absPath(cwd, TeamPaths.root(sanitizeTeamName(teamName)));
|
|
355
|
+
const markerPath = join(root, 'watchdog-failed.json');
|
|
356
|
+
await mkdir(root, { recursive: true });
|
|
357
|
+
await writeFile(markerPath, JSON.stringify(marker, null, 2), 'utf-8');
|
|
358
|
+
}
|
|
359
|
+
/**
|
|
360
|
+
* Circuit breaker context for tracking consecutive monitor failures.
|
|
361
|
+
* The caller (runtime-cli v2 loop) should call recordSuccess on each
|
|
362
|
+
* successful monitor cycle and recordFailure on each error. When the
|
|
363
|
+
* threshold is reached, the breaker trips and writes watchdog-failed.json.
|
|
364
|
+
*/
|
|
365
|
+
export class CircuitBreakerV2 {
|
|
366
|
+
teamName;
|
|
367
|
+
cwd;
|
|
368
|
+
threshold;
|
|
369
|
+
consecutiveFailures = 0;
|
|
370
|
+
tripped = false;
|
|
371
|
+
constructor(teamName, cwd, threshold = CIRCUIT_BREAKER_THRESHOLD) {
|
|
372
|
+
this.teamName = teamName;
|
|
373
|
+
this.cwd = cwd;
|
|
374
|
+
this.threshold = threshold;
|
|
375
|
+
}
|
|
376
|
+
recordSuccess() {
|
|
377
|
+
this.consecutiveFailures = 0;
|
|
378
|
+
}
|
|
379
|
+
async recordFailure(reason) {
|
|
380
|
+
this.consecutiveFailures++;
|
|
381
|
+
if (this.consecutiveFailures >= this.threshold && !this.tripped) {
|
|
382
|
+
this.tripped = true;
|
|
383
|
+
await writeWatchdogFailedMarker(this.teamName, this.cwd, reason);
|
|
384
|
+
return true; // breaker tripped
|
|
385
|
+
}
|
|
386
|
+
return false;
|
|
387
|
+
}
|
|
388
|
+
isTripped() {
|
|
389
|
+
return this.tripped;
|
|
390
|
+
}
|
|
391
|
+
}
|
|
392
|
+
// ---------------------------------------------------------------------------
|
|
393
|
+
// Failure sidecars — requeue tasks from dead workers
|
|
394
|
+
// ---------------------------------------------------------------------------
|
|
395
|
+
/**
|
|
396
|
+
* Requeue tasks from dead workers by writing failure sidecars and resetting
|
|
397
|
+
* task status back to pending so they can be claimed by other workers.
|
|
398
|
+
*/
|
|
399
|
+
export async function requeueDeadWorkerTasks(teamName, deadWorkerNames, cwd) {
|
|
400
|
+
const sanitized = sanitizeTeamName(teamName);
|
|
401
|
+
const tasks = await listTasksFromFiles(sanitized, cwd);
|
|
402
|
+
const requeued = [];
|
|
403
|
+
const deadSet = new Set(deadWorkerNames);
|
|
404
|
+
for (const task of tasks) {
|
|
405
|
+
if (task.status !== 'in_progress')
|
|
406
|
+
continue;
|
|
407
|
+
if (!task.owner || !deadSet.has(task.owner))
|
|
408
|
+
continue;
|
|
409
|
+
// Write failure sidecar
|
|
410
|
+
const sidecarPath = absPath(cwd, `${TeamPaths.tasks(sanitized)}/${task.id}.failure.json`);
|
|
411
|
+
const sidecar = {
|
|
412
|
+
taskId: task.id,
|
|
413
|
+
lastError: `worker_dead:${task.owner}`,
|
|
414
|
+
retryCount: 0,
|
|
415
|
+
lastFailedAt: new Date().toISOString(),
|
|
416
|
+
};
|
|
417
|
+
const { writeFile } = await import('fs/promises');
|
|
418
|
+
await mkdir(absPath(cwd, TeamPaths.tasks(sanitized)), { recursive: true });
|
|
419
|
+
await writeFile(sidecarPath, JSON.stringify(sidecar, null, 2), 'utf-8');
|
|
420
|
+
// Reset task to pending (clear owner and claim)
|
|
421
|
+
const taskPath = absPath(cwd, TeamPaths.taskFile(sanitized, task.id));
|
|
422
|
+
try {
|
|
423
|
+
const raw = await import('fs/promises').then(fs => fs.readFile(taskPath, 'utf-8'));
|
|
424
|
+
const taskData = JSON.parse(raw);
|
|
425
|
+
taskData.status = 'pending';
|
|
426
|
+
taskData.owner = undefined;
|
|
427
|
+
taskData.claim = undefined;
|
|
428
|
+
await writeFile(taskPath, JSON.stringify(taskData, null, 2), 'utf-8');
|
|
429
|
+
requeued.push(task.id);
|
|
430
|
+
}
|
|
431
|
+
catch {
|
|
432
|
+
// Task file may have been removed; skip
|
|
433
|
+
}
|
|
434
|
+
await appendTeamEvent(sanitized, {
|
|
435
|
+
type: 'team_leader_nudge',
|
|
436
|
+
worker: 'leader-fixed',
|
|
437
|
+
task_id: task.id,
|
|
438
|
+
reason: `requeue_dead_worker:${task.owner}`,
|
|
439
|
+
}, cwd).catch(() => { });
|
|
440
|
+
}
|
|
441
|
+
return requeued;
|
|
442
|
+
}
|
|
443
|
+
// ---------------------------------------------------------------------------
|
|
444
|
+
// monitorTeam — snapshot-based, event-driven (no watchdog)
|
|
445
|
+
// ---------------------------------------------------------------------------
|
|
446
|
+
/**
|
|
447
|
+
* Take a single monitor snapshot of team state.
|
|
448
|
+
* Caller drives the loop (e.g., runtime-cli poll interval or event trigger).
|
|
449
|
+
*/
|
|
450
|
+
export async function monitorTeamV2(teamName, cwd) {
|
|
451
|
+
const monitorStartMs = performance.now();
|
|
452
|
+
const sanitized = sanitizeTeamName(teamName);
|
|
453
|
+
const config = await readTeamConfig(sanitized, cwd);
|
|
454
|
+
if (!config)
|
|
455
|
+
return null;
|
|
456
|
+
const previousSnapshot = await readMonitorSnapshot(sanitized, cwd);
|
|
457
|
+
// Load all tasks
|
|
458
|
+
const listTasksStartMs = performance.now();
|
|
459
|
+
const allTasks = await listTasksFromFiles(sanitized, cwd);
|
|
460
|
+
const listTasksMs = performance.now() - listTasksStartMs;
|
|
461
|
+
const taskById = new Map(allTasks.map((task) => [task.id, task]));
|
|
462
|
+
const inProgressByOwner = new Map();
|
|
463
|
+
for (const task of allTasks) {
|
|
464
|
+
if (task.status !== 'in_progress' || !task.owner)
|
|
465
|
+
continue;
|
|
466
|
+
const existing = inProgressByOwner.get(task.owner) || [];
|
|
467
|
+
existing.push(task);
|
|
468
|
+
inProgressByOwner.set(task.owner, existing);
|
|
469
|
+
}
|
|
470
|
+
// Scan workers
|
|
471
|
+
const workers = [];
|
|
472
|
+
const deadWorkers = [];
|
|
473
|
+
const nonReportingWorkers = [];
|
|
474
|
+
const recommendations = [];
|
|
475
|
+
const workerScanStartMs = performance.now();
|
|
476
|
+
const workerSignals = await Promise.all(config.workers.map(async (worker) => {
|
|
477
|
+
const alive = await isWorkerPaneAlive(worker.pane_id);
|
|
478
|
+
const [status, heartbeat] = await Promise.all([
|
|
479
|
+
readWorkerStatus(sanitized, worker.name, cwd),
|
|
480
|
+
readWorkerHeartbeat(sanitized, worker.name, cwd),
|
|
481
|
+
]);
|
|
482
|
+
return { worker, alive, status, heartbeat };
|
|
483
|
+
}));
|
|
484
|
+
const workerScanMs = performance.now() - workerScanStartMs;
|
|
485
|
+
for (const { worker: w, alive, status, heartbeat } of workerSignals) {
|
|
486
|
+
const currentTask = status.current_task_id ? taskById.get(status.current_task_id) ?? null : null;
|
|
487
|
+
const previousTurns = previousSnapshot ? (previousSnapshot.workerTurnCountByName[w.name] ?? 0) : null;
|
|
488
|
+
const previousTaskId = previousSnapshot?.workerTaskIdByName[w.name] ?? '';
|
|
489
|
+
const currentTaskId = status.current_task_id ?? '';
|
|
490
|
+
const turnsWithoutProgress = heartbeat &&
|
|
491
|
+
previousTurns !== null &&
|
|
492
|
+
status.state === 'working' &&
|
|
493
|
+
currentTask &&
|
|
494
|
+
(currentTask.status === 'pending' || currentTask.status === 'in_progress') &&
|
|
495
|
+
currentTaskId !== '' &&
|
|
496
|
+
previousTaskId === currentTaskId
|
|
497
|
+
? Math.max(0, heartbeat.turn_count - previousTurns)
|
|
498
|
+
: 0;
|
|
499
|
+
workers.push({
|
|
500
|
+
name: w.name,
|
|
501
|
+
alive,
|
|
502
|
+
status,
|
|
503
|
+
heartbeat,
|
|
504
|
+
assignedTasks: w.assigned_tasks,
|
|
505
|
+
turnsWithoutProgress,
|
|
506
|
+
});
|
|
507
|
+
if (!alive) {
|
|
508
|
+
deadWorkers.push(w.name);
|
|
509
|
+
const deadWorkerTasks = inProgressByOwner.get(w.name) || [];
|
|
510
|
+
for (const t of deadWorkerTasks) {
|
|
511
|
+
recommendations.push(`Reassign task-${t.id} from dead ${w.name}`);
|
|
512
|
+
}
|
|
513
|
+
}
|
|
514
|
+
if (alive && turnsWithoutProgress > 5) {
|
|
515
|
+
nonReportingWorkers.push(w.name);
|
|
516
|
+
recommendations.push(`Send reminder to non-reporting ${w.name}`);
|
|
517
|
+
}
|
|
518
|
+
}
|
|
519
|
+
// Count tasks
|
|
520
|
+
const taskCounts = {
|
|
521
|
+
total: allTasks.length,
|
|
522
|
+
pending: allTasks.filter((t) => t.status === 'pending').length,
|
|
523
|
+
blocked: allTasks.filter((t) => t.status === 'blocked').length,
|
|
524
|
+
in_progress: allTasks.filter((t) => t.status === 'in_progress').length,
|
|
525
|
+
completed: allTasks.filter((t) => t.status === 'completed').length,
|
|
526
|
+
failed: allTasks.filter((t) => t.status === 'failed').length,
|
|
527
|
+
};
|
|
528
|
+
const allTasksTerminal = taskCounts.pending === 0 && taskCounts.blocked === 0 && taskCounts.in_progress === 0;
|
|
529
|
+
// Infer phase from task distribution
|
|
530
|
+
const phase = inferPhase(allTasks.map((t) => ({
|
|
531
|
+
status: t.status,
|
|
532
|
+
metadata: undefined,
|
|
533
|
+
})));
|
|
534
|
+
// Emit monitor-derived events (task completions, worker state changes)
|
|
535
|
+
await emitMonitorDerivedEvents(sanitized, allTasks, workers.map((w) => ({ name: w.name, alive: w.alive, status: w.status })), previousSnapshot, cwd);
|
|
536
|
+
// Persist snapshot for next cycle
|
|
537
|
+
const updatedAt = new Date().toISOString();
|
|
538
|
+
const totalMs = performance.now() - monitorStartMs;
|
|
539
|
+
await writeMonitorSnapshot(sanitized, {
|
|
540
|
+
taskStatusById: Object.fromEntries(allTasks.map((t) => [t.id, t.status])),
|
|
541
|
+
workerAliveByName: Object.fromEntries(workers.map((w) => [w.name, w.alive])),
|
|
542
|
+
workerStateByName: Object.fromEntries(workers.map((w) => [w.name, w.status.state])),
|
|
543
|
+
workerTurnCountByName: Object.fromEntries(workers.map((w) => [w.name, w.heartbeat?.turn_count ?? 0])),
|
|
544
|
+
workerTaskIdByName: Object.fromEntries(workers.map((w) => [w.name, w.status.current_task_id ?? ''])),
|
|
545
|
+
mailboxNotifiedByMessageId: previousSnapshot?.mailboxNotifiedByMessageId ?? {},
|
|
546
|
+
completedEventTaskIds: previousSnapshot?.completedEventTaskIds ?? {},
|
|
547
|
+
monitorTimings: {
|
|
548
|
+
list_tasks_ms: Number(listTasksMs.toFixed(2)),
|
|
549
|
+
worker_scan_ms: Number(workerScanMs.toFixed(2)),
|
|
550
|
+
mailbox_delivery_ms: 0,
|
|
551
|
+
total_ms: Number(totalMs.toFixed(2)),
|
|
552
|
+
updated_at: updatedAt,
|
|
553
|
+
},
|
|
554
|
+
}, cwd);
|
|
555
|
+
return {
|
|
556
|
+
teamName: sanitized,
|
|
557
|
+
phase,
|
|
558
|
+
workers,
|
|
559
|
+
tasks: {
|
|
560
|
+
...taskCounts,
|
|
561
|
+
items: allTasks,
|
|
562
|
+
},
|
|
563
|
+
allTasksTerminal,
|
|
564
|
+
deadWorkers,
|
|
565
|
+
nonReportingWorkers,
|
|
566
|
+
recommendations,
|
|
567
|
+
performance: {
|
|
568
|
+
list_tasks_ms: Number(listTasksMs.toFixed(2)),
|
|
569
|
+
worker_scan_ms: Number(workerScanMs.toFixed(2)),
|
|
570
|
+
total_ms: Number(totalMs.toFixed(2)),
|
|
571
|
+
updated_at: updatedAt,
|
|
572
|
+
},
|
|
573
|
+
};
|
|
574
|
+
}
|
|
575
|
+
// ---------------------------------------------------------------------------
|
|
576
|
+
// shutdownTeam — graceful shutdown with gate, ack, force kill
|
|
577
|
+
// ---------------------------------------------------------------------------
|
|
578
|
+
/**
|
|
579
|
+
* Graceful team shutdown:
|
|
580
|
+
* 1. Shutdown gate check (unless force)
|
|
581
|
+
* 2. Send shutdown request to all workers via inbox
|
|
582
|
+
* 3. Wait for ack or timeout
|
|
583
|
+
* 4. Force kill remaining tmux panes
|
|
584
|
+
* 5. Clean up state
|
|
585
|
+
*/
|
|
586
|
+
export async function shutdownTeamV2(teamName, cwd, options = {}) {
|
|
587
|
+
const force = options.force === true;
|
|
588
|
+
const ralph = options.ralph === true;
|
|
589
|
+
const timeoutMs = options.timeoutMs ?? 15_000;
|
|
590
|
+
const sanitized = sanitizeTeamName(teamName);
|
|
591
|
+
const config = await readTeamConfig(sanitized, cwd);
|
|
592
|
+
if (!config) {
|
|
593
|
+
// No config available; only clean state. We intentionally avoid guessing
|
|
594
|
+
// a tmux session name here to prevent accidental self-session termination.
|
|
595
|
+
await cleanupTeamState(sanitized, cwd);
|
|
596
|
+
return;
|
|
597
|
+
}
|
|
598
|
+
// 1. Shutdown gate check
|
|
599
|
+
if (!force) {
|
|
600
|
+
const allTasks = await listTasksFromFiles(sanitized, cwd);
|
|
601
|
+
const gate = {
|
|
602
|
+
total: allTasks.length,
|
|
603
|
+
pending: allTasks.filter((t) => t.status === 'pending').length,
|
|
604
|
+
blocked: allTasks.filter((t) => t.status === 'blocked').length,
|
|
605
|
+
in_progress: allTasks.filter((t) => t.status === 'in_progress').length,
|
|
606
|
+
completed: allTasks.filter((t) => t.status === 'completed').length,
|
|
607
|
+
failed: allTasks.filter((t) => t.status === 'failed').length,
|
|
608
|
+
allowed: false,
|
|
609
|
+
};
|
|
610
|
+
gate.allowed = gate.pending === 0 && gate.blocked === 0 && gate.in_progress === 0 && gate.failed === 0;
|
|
611
|
+
await appendTeamEvent(sanitized, {
|
|
612
|
+
type: 'shutdown_gate',
|
|
613
|
+
worker: 'leader-fixed',
|
|
614
|
+
reason: `allowed=${gate.allowed} total=${gate.total} pending=${gate.pending} blocked=${gate.blocked} in_progress=${gate.in_progress} completed=${gate.completed} failed=${gate.failed}${ralph ? ' policy=ralph' : ''}`,
|
|
615
|
+
}, cwd).catch(() => { });
|
|
616
|
+
if (!gate.allowed) {
|
|
617
|
+
const hasActiveWork = gate.pending > 0 || gate.blocked > 0 || gate.in_progress > 0;
|
|
618
|
+
if (ralph && !hasActiveWork) {
|
|
619
|
+
// Ralph policy: bypass on failure-only scenarios
|
|
620
|
+
await appendTeamEvent(sanitized, {
|
|
621
|
+
type: 'team_leader_nudge',
|
|
622
|
+
worker: 'leader-fixed',
|
|
623
|
+
reason: `gate_bypassed:pending=${gate.pending},blocked=${gate.blocked},in_progress=${gate.in_progress},failed=${gate.failed}`,
|
|
624
|
+
}, cwd).catch(() => { });
|
|
625
|
+
}
|
|
626
|
+
else {
|
|
627
|
+
throw new Error(`shutdown_gate_blocked:pending=${gate.pending},blocked=${gate.blocked},in_progress=${gate.in_progress},failed=${gate.failed}`);
|
|
628
|
+
}
|
|
629
|
+
}
|
|
630
|
+
}
|
|
631
|
+
if (force) {
|
|
632
|
+
await appendTeamEvent(sanitized, {
|
|
633
|
+
type: 'shutdown_gate_forced',
|
|
634
|
+
worker: 'leader-fixed',
|
|
635
|
+
reason: 'force_bypass',
|
|
636
|
+
}, cwd).catch(() => { });
|
|
637
|
+
}
|
|
638
|
+
// 2. Send shutdown request to each worker
|
|
639
|
+
const shutdownRequestTimes = new Map();
|
|
640
|
+
for (const w of config.workers) {
|
|
641
|
+
try {
|
|
642
|
+
const requestedAt = new Date().toISOString();
|
|
643
|
+
await writeShutdownRequest(sanitized, w.name, 'leader-fixed', cwd);
|
|
644
|
+
shutdownRequestTimes.set(w.name, requestedAt);
|
|
645
|
+
// Write shutdown inbox
|
|
646
|
+
const shutdownInbox = `# Shutdown Request\n\nAll tasks are complete. Please wrap up and respond with a shutdown acknowledgement.\n\nWrite your ack to: ${TeamPaths.shutdownAck(sanitized, w.name)}\nFormat: {"status":"accept","reason":"ok","updated_at":"<iso>"}\n\nThen exit your session.\n`;
|
|
647
|
+
await writeWorkerInbox(sanitized, w.name, shutdownInbox, cwd);
|
|
648
|
+
}
|
|
649
|
+
catch (err) {
|
|
650
|
+
process.stderr.write(`[team/runtime-v2] shutdown request failed for ${w.name}: ${err}\n`);
|
|
651
|
+
}
|
|
652
|
+
}
|
|
653
|
+
// 3. Wait for ack or timeout
|
|
654
|
+
const deadline = Date.now() + timeoutMs;
|
|
655
|
+
const rejected = [];
|
|
656
|
+
const ackedWorkers = new Set();
|
|
657
|
+
while (Date.now() < deadline) {
|
|
658
|
+
for (const w of config.workers) {
|
|
659
|
+
if (ackedWorkers.has(w.name))
|
|
660
|
+
continue;
|
|
661
|
+
const ack = await readShutdownAck(sanitized, w.name, cwd, shutdownRequestTimes.get(w.name));
|
|
662
|
+
if (ack) {
|
|
663
|
+
ackedWorkers.add(w.name);
|
|
664
|
+
await appendTeamEvent(sanitized, {
|
|
665
|
+
type: 'shutdown_ack',
|
|
666
|
+
worker: w.name,
|
|
667
|
+
reason: ack.status === 'reject' ? `reject:${ack.reason || 'no_reason'}` : 'accept',
|
|
668
|
+
}, cwd).catch(() => { });
|
|
669
|
+
if (ack.status === 'reject') {
|
|
670
|
+
rejected.push({ worker: w.name, reason: ack.reason || 'no_reason' });
|
|
671
|
+
}
|
|
672
|
+
}
|
|
673
|
+
}
|
|
674
|
+
if (rejected.length > 0 && !force) {
|
|
675
|
+
const detail = rejected.map((r) => `${r.worker}:${r.reason}`).join(',');
|
|
676
|
+
throw new Error(`shutdown_rejected:${detail}`);
|
|
677
|
+
}
|
|
678
|
+
// Check if all workers have acked or exited
|
|
679
|
+
const allDone = config.workers.every((w) => ackedWorkers.has(w.name));
|
|
680
|
+
if (allDone)
|
|
681
|
+
break;
|
|
682
|
+
await new Promise((r) => setTimeout(r, 2_000));
|
|
683
|
+
}
|
|
684
|
+
// 4. Force kill remaining tmux panes
|
|
685
|
+
try {
|
|
686
|
+
const { killWorkerPanes, killTeamSession } = await import('./tmux-session.js');
|
|
687
|
+
const workerPaneIds = config.workers
|
|
688
|
+
.map((w) => w.pane_id)
|
|
689
|
+
.filter((p) => typeof p === 'string' && p.trim().length > 0);
|
|
690
|
+
await killWorkerPanes({
|
|
691
|
+
paneIds: workerPaneIds,
|
|
692
|
+
leaderPaneId: config.leader_pane_id ?? undefined,
|
|
693
|
+
teamName: sanitized,
|
|
694
|
+
cwd,
|
|
695
|
+
});
|
|
696
|
+
// Destroy tmux session if it's a standalone session
|
|
697
|
+
if (config.tmux_session && !config.tmux_session.includes(':')) {
|
|
698
|
+
await killTeamSession(config.tmux_session, [], undefined);
|
|
699
|
+
}
|
|
700
|
+
}
|
|
701
|
+
catch (err) {
|
|
702
|
+
process.stderr.write(`[team/runtime-v2] tmux cleanup: ${err}\n`);
|
|
703
|
+
}
|
|
704
|
+
// 5. Ralph completion logging
|
|
705
|
+
if (ralph) {
|
|
706
|
+
const finalTasks = await listTasksFromFiles(sanitized, cwd).catch(() => []);
|
|
707
|
+
const completed = finalTasks.filter((t) => t.status === 'completed').length;
|
|
708
|
+
const failed = finalTasks.filter((t) => t.status === 'failed').length;
|
|
709
|
+
const pending = finalTasks.filter((t) => t.status === 'pending').length;
|
|
710
|
+
await appendTeamEvent(sanitized, {
|
|
711
|
+
type: 'team_leader_nudge',
|
|
712
|
+
worker: 'leader-fixed',
|
|
713
|
+
reason: `ralph_cleanup_summary: total=${finalTasks.length} completed=${completed} failed=${failed} pending=${pending} force=${force}`,
|
|
714
|
+
}, cwd).catch(() => { });
|
|
715
|
+
}
|
|
716
|
+
// 6. Clean up state
|
|
717
|
+
await cleanupTeamState(sanitized, cwd);
|
|
718
|
+
}
|
|
719
|
+
// ---------------------------------------------------------------------------
|
|
720
|
+
// resumeTeam — reconstruct runtime from persisted state
|
|
721
|
+
// ---------------------------------------------------------------------------
|
|
722
|
+
export async function resumeTeamV2(teamName, cwd) {
|
|
723
|
+
const sanitized = sanitizeTeamName(teamName);
|
|
724
|
+
const config = await readTeamConfig(sanitized, cwd);
|
|
725
|
+
if (!config)
|
|
726
|
+
return null;
|
|
727
|
+
// Verify tmux session is alive
|
|
728
|
+
try {
|
|
729
|
+
const { execFile } = await import('child_process');
|
|
730
|
+
const { promisify } = await import('util');
|
|
731
|
+
const execFileAsync = promisify(execFile);
|
|
732
|
+
const sessionName = config.tmux_session || `omc-team-${sanitized}`;
|
|
733
|
+
await execFileAsync('tmux', ['has-session', '-t', sessionName.split(':')[0]]);
|
|
734
|
+
return {
|
|
735
|
+
teamName: sanitized,
|
|
736
|
+
sanitizedName: sanitized,
|
|
737
|
+
sessionName,
|
|
738
|
+
config,
|
|
739
|
+
cwd,
|
|
740
|
+
};
|
|
741
|
+
}
|
|
742
|
+
catch {
|
|
743
|
+
return null; // Session not alive
|
|
744
|
+
}
|
|
745
|
+
}
|
|
746
|
+
// ---------------------------------------------------------------------------
|
|
747
|
+
// findActiveTeams — discover running teams
|
|
748
|
+
// ---------------------------------------------------------------------------
|
|
749
|
+
export async function findActiveTeamsV2(cwd) {
|
|
750
|
+
const root = join(cwd, '.omc', 'state', 'team');
|
|
751
|
+
if (!existsSync(root))
|
|
752
|
+
return [];
|
|
753
|
+
const entries = await readdir(root, { withFileTypes: true });
|
|
754
|
+
const active = [];
|
|
755
|
+
for (const e of entries) {
|
|
756
|
+
if (!e.isDirectory())
|
|
757
|
+
continue;
|
|
758
|
+
const teamName = e.name;
|
|
759
|
+
const config = await readTeamConfig(teamName, cwd);
|
|
760
|
+
if (config) {
|
|
761
|
+
active.push(teamName);
|
|
762
|
+
}
|
|
763
|
+
}
|
|
764
|
+
return active;
|
|
765
|
+
}
|
|
766
|
+
//# sourceMappingURL=runtime-v2.js.map
|