claudecode-omc 4.4.10 → 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__/pre-tool-agent-prefix.test.d.ts +8 -0
- package/dist/__tests__/pre-tool-agent-prefix.test.d.ts.map +1 -0
- package/dist/__tests__/pre-tool-agent-prefix.test.js +131 -0
- package/dist/__tests__/pre-tool-agent-prefix.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/fixes/agent-prefix-routing-fix.md +105 -0
- 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 +16 -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/quick-init-project/SKILL.md +333 -0
- 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 +79 -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,663 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Team dispatch hook: drain pending dispatch requests via tmux injection.
|
|
3
|
+
*
|
|
4
|
+
* Mirrors OMX scripts/notify-hook/team-dispatch.js behavior exactly.
|
|
5
|
+
*
|
|
6
|
+
* Called on every leader hook tick. Workers skip (OMC_TEAM_WORKER set).
|
|
7
|
+
* Processes pending dispatch requests with:
|
|
8
|
+
* - Hook-preferred transport only (skips transport_direct, prompt_stdin)
|
|
9
|
+
* - Post-injection verification (3 rounds x 250ms)
|
|
10
|
+
* - Issue cooldown (15 min per issue key)
|
|
11
|
+
* - Trigger cooldown (30s per trigger text)
|
|
12
|
+
* - Max unconfirmed attempts (3) before marking failed
|
|
13
|
+
* - Leader pane missing -> deferred
|
|
14
|
+
*/
|
|
15
|
+
import { readFile, writeFile, mkdir, readdir, appendFile, rename, rm, stat } from 'fs/promises';
|
|
16
|
+
import { existsSync } from 'fs';
|
|
17
|
+
import { dirname, join, resolve } from 'path';
|
|
18
|
+
// ── Helpers ────────────────────────────────────────────────────────────────
|
|
19
|
+
function safeString(value, fallback = '') {
|
|
20
|
+
if (typeof value === 'string')
|
|
21
|
+
return value;
|
|
22
|
+
if (value === null || value === undefined)
|
|
23
|
+
return fallback;
|
|
24
|
+
return String(value);
|
|
25
|
+
}
|
|
26
|
+
async function readJson(path, fallback) {
|
|
27
|
+
try {
|
|
28
|
+
const raw = await readFile(path, 'utf8');
|
|
29
|
+
return JSON.parse(raw);
|
|
30
|
+
}
|
|
31
|
+
catch {
|
|
32
|
+
return fallback;
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
async function writeJsonAtomic(path, value) {
|
|
36
|
+
await mkdir(dirname(path), { recursive: true });
|
|
37
|
+
const tmp = `${path}.tmp-${process.pid}-${Date.now()}-${Math.random().toString(16).slice(2)}`;
|
|
38
|
+
await writeFile(tmp, JSON.stringify(value, null, 2));
|
|
39
|
+
await rename(tmp, path);
|
|
40
|
+
}
|
|
41
|
+
// ── Constants ──────────────────────────────────────────────────────────────
|
|
42
|
+
const DISPATCH_LOCK_STALE_MS = 5 * 60 * 1000;
|
|
43
|
+
const DEFAULT_ISSUE_DISPATCH_COOLDOWN_MS = 15 * 60 * 1000;
|
|
44
|
+
const ISSUE_DISPATCH_COOLDOWN_ENV = 'OMC_TEAM_DISPATCH_ISSUE_COOLDOWN_MS';
|
|
45
|
+
const DEFAULT_DISPATCH_TRIGGER_COOLDOWN_MS = 30 * 1000;
|
|
46
|
+
const DISPATCH_TRIGGER_COOLDOWN_ENV = 'OMC_TEAM_DISPATCH_TRIGGER_COOLDOWN_MS';
|
|
47
|
+
const LEADER_PANE_MISSING_DEFERRED_REASON = 'leader_pane_missing_deferred';
|
|
48
|
+
const LEADER_NOTIFICATION_DEFERRED_TYPE = 'leader_notification_deferred';
|
|
49
|
+
const INJECT_VERIFY_DELAY_MS = 250;
|
|
50
|
+
const INJECT_VERIFY_ROUNDS = 3;
|
|
51
|
+
const MAX_UNCONFIRMED_ATTEMPTS = 3;
|
|
52
|
+
// ── Env resolvers ──────────────────────────────────────────────────────────
|
|
53
|
+
function resolveIssueDispatchCooldownMs(env = process.env) {
|
|
54
|
+
const raw = safeString(env[ISSUE_DISPATCH_COOLDOWN_ENV]).trim();
|
|
55
|
+
if (raw === '')
|
|
56
|
+
return DEFAULT_ISSUE_DISPATCH_COOLDOWN_MS;
|
|
57
|
+
const parsed = Number.parseInt(raw, 10);
|
|
58
|
+
if (!Number.isFinite(parsed) || parsed < 0)
|
|
59
|
+
return DEFAULT_ISSUE_DISPATCH_COOLDOWN_MS;
|
|
60
|
+
return parsed;
|
|
61
|
+
}
|
|
62
|
+
function resolveDispatchTriggerCooldownMs(env = process.env) {
|
|
63
|
+
const raw = safeString(env[DISPATCH_TRIGGER_COOLDOWN_ENV]).trim();
|
|
64
|
+
if (raw === '')
|
|
65
|
+
return DEFAULT_DISPATCH_TRIGGER_COOLDOWN_MS;
|
|
66
|
+
const parsed = Number.parseInt(raw, 10);
|
|
67
|
+
if (!Number.isFinite(parsed) || parsed < 0)
|
|
68
|
+
return DEFAULT_DISPATCH_TRIGGER_COOLDOWN_MS;
|
|
69
|
+
return parsed;
|
|
70
|
+
}
|
|
71
|
+
function extractIssueKey(triggerMessage) {
|
|
72
|
+
const match = safeString(triggerMessage).match(/\b([A-Z][A-Z0-9]+-\d+)\b/i);
|
|
73
|
+
return match?.[1]?.toUpperCase() ?? null;
|
|
74
|
+
}
|
|
75
|
+
function normalizeTriggerKey(value) {
|
|
76
|
+
return safeString(value).replace(/\s+/g, ' ').trim();
|
|
77
|
+
}
|
|
78
|
+
// ── Lock ───────────────────────────────────────────────────────────────────
|
|
79
|
+
async function withDispatchLock(teamDirPath, fn) {
|
|
80
|
+
const lockDir = join(teamDirPath, 'dispatch', '.lock');
|
|
81
|
+
const ownerPath = join(lockDir, 'owner');
|
|
82
|
+
const ownerToken = `${process.pid}.${Date.now()}.${Math.random().toString(16).slice(2)}`;
|
|
83
|
+
const deadline = Date.now() + 5_000;
|
|
84
|
+
await mkdir(dirname(lockDir), { recursive: true });
|
|
85
|
+
while (true) {
|
|
86
|
+
try {
|
|
87
|
+
await mkdir(lockDir, { recursive: false });
|
|
88
|
+
try {
|
|
89
|
+
await writeFile(ownerPath, ownerToken, 'utf8');
|
|
90
|
+
}
|
|
91
|
+
catch (error) {
|
|
92
|
+
await rm(lockDir, { recursive: true, force: true });
|
|
93
|
+
throw error;
|
|
94
|
+
}
|
|
95
|
+
break;
|
|
96
|
+
}
|
|
97
|
+
catch (error) {
|
|
98
|
+
const err = error;
|
|
99
|
+
if (err.code !== 'EEXIST')
|
|
100
|
+
throw error;
|
|
101
|
+
try {
|
|
102
|
+
const info = await stat(lockDir);
|
|
103
|
+
if (Date.now() - info.mtimeMs > DISPATCH_LOCK_STALE_MS) {
|
|
104
|
+
await rm(lockDir, { recursive: true, force: true });
|
|
105
|
+
continue;
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
catch { /* best effort */ }
|
|
109
|
+
if (Date.now() > deadline)
|
|
110
|
+
throw new Error(`Timed out acquiring dispatch lock for ${teamDirPath}`);
|
|
111
|
+
await new Promise((r) => setTimeout(r, 25));
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
try {
|
|
115
|
+
return await fn();
|
|
116
|
+
}
|
|
117
|
+
finally {
|
|
118
|
+
try {
|
|
119
|
+
const currentOwner = await readFile(ownerPath, 'utf8');
|
|
120
|
+
if (currentOwner.trim() === ownerToken) {
|
|
121
|
+
await rm(lockDir, { recursive: true, force: true });
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
catch { /* best effort */ }
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
async function withMailboxLock(teamDirPath, workerName, fn) {
|
|
128
|
+
const lockDir = join(teamDirPath, 'mailbox', `.lock-${workerName}`);
|
|
129
|
+
const ownerPath = join(lockDir, 'owner');
|
|
130
|
+
const ownerToken = `${process.pid}.${Date.now()}.${Math.random().toString(16).slice(2)}`;
|
|
131
|
+
const deadline = Date.now() + 5_000;
|
|
132
|
+
await mkdir(dirname(lockDir), { recursive: true });
|
|
133
|
+
while (true) {
|
|
134
|
+
try {
|
|
135
|
+
await mkdir(lockDir, { recursive: false });
|
|
136
|
+
try {
|
|
137
|
+
await writeFile(ownerPath, ownerToken, 'utf8');
|
|
138
|
+
}
|
|
139
|
+
catch (error) {
|
|
140
|
+
await rm(lockDir, { recursive: true, force: true });
|
|
141
|
+
throw error;
|
|
142
|
+
}
|
|
143
|
+
break;
|
|
144
|
+
}
|
|
145
|
+
catch (error) {
|
|
146
|
+
const err = error;
|
|
147
|
+
if (err.code !== 'EEXIST')
|
|
148
|
+
throw error;
|
|
149
|
+
try {
|
|
150
|
+
const info = await stat(lockDir);
|
|
151
|
+
if (Date.now() - info.mtimeMs > DISPATCH_LOCK_STALE_MS) {
|
|
152
|
+
await rm(lockDir, { recursive: true, force: true });
|
|
153
|
+
continue;
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
catch { /* best effort */ }
|
|
157
|
+
if (Date.now() > deadline)
|
|
158
|
+
throw new Error(`Timed out acquiring mailbox lock for ${teamDirPath}/${workerName}`);
|
|
159
|
+
await new Promise((r) => setTimeout(r, 25));
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
try {
|
|
163
|
+
return await fn();
|
|
164
|
+
}
|
|
165
|
+
finally {
|
|
166
|
+
try {
|
|
167
|
+
const currentOwner = await readFile(ownerPath, 'utf8');
|
|
168
|
+
if (currentOwner.trim() === ownerToken) {
|
|
169
|
+
await rm(lockDir, { recursive: true, force: true });
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
catch { /* best effort */ }
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
// ── Cooldown state ─────────────────────────────────────────────────────────
|
|
176
|
+
function issueCooldownStatePath(teamDirPath) {
|
|
177
|
+
return join(teamDirPath, 'dispatch', 'issue-cooldown.json');
|
|
178
|
+
}
|
|
179
|
+
function triggerCooldownStatePath(teamDirPath) {
|
|
180
|
+
return join(teamDirPath, 'dispatch', 'trigger-cooldown.json');
|
|
181
|
+
}
|
|
182
|
+
async function readIssueCooldownState(teamDirPath) {
|
|
183
|
+
const fallback = { by_issue: {} };
|
|
184
|
+
const parsed = await readJson(issueCooldownStatePath(teamDirPath), fallback);
|
|
185
|
+
if (!parsed || typeof parsed !== 'object' || typeof parsed.by_issue !== 'object' || parsed.by_issue === null) {
|
|
186
|
+
return fallback;
|
|
187
|
+
}
|
|
188
|
+
return parsed;
|
|
189
|
+
}
|
|
190
|
+
async function readTriggerCooldownState(teamDirPath) {
|
|
191
|
+
const fallback = { by_trigger: {} };
|
|
192
|
+
const parsed = await readJson(triggerCooldownStatePath(teamDirPath), fallback);
|
|
193
|
+
if (!parsed || typeof parsed !== 'object' || typeof parsed.by_trigger !== 'object' || parsed.by_trigger === null) {
|
|
194
|
+
return fallback;
|
|
195
|
+
}
|
|
196
|
+
return parsed;
|
|
197
|
+
}
|
|
198
|
+
function parseTriggerCooldownEntry(entry) {
|
|
199
|
+
if (typeof entry === 'number') {
|
|
200
|
+
return { at: entry, lastRequestId: '' };
|
|
201
|
+
}
|
|
202
|
+
if (!entry || typeof entry !== 'object') {
|
|
203
|
+
return { at: NaN, lastRequestId: '' };
|
|
204
|
+
}
|
|
205
|
+
return {
|
|
206
|
+
at: Number(entry.at),
|
|
207
|
+
lastRequestId: safeString(entry.last_request_id).trim(),
|
|
208
|
+
};
|
|
209
|
+
}
|
|
210
|
+
function defaultInjectTarget(request, config) {
|
|
211
|
+
if (request.to_worker === 'leader-fixed') {
|
|
212
|
+
if (config.leader_pane_id)
|
|
213
|
+
return { type: 'pane', value: config.leader_pane_id };
|
|
214
|
+
return null;
|
|
215
|
+
}
|
|
216
|
+
if (request.pane_id)
|
|
217
|
+
return { type: 'pane', value: request.pane_id };
|
|
218
|
+
if (typeof request.worker_index === 'number' && Array.isArray(config.workers)) {
|
|
219
|
+
const worker = config.workers.find((c) => Number(c.index) === request.worker_index);
|
|
220
|
+
if (worker?.pane_id)
|
|
221
|
+
return { type: 'pane', value: worker.pane_id };
|
|
222
|
+
}
|
|
223
|
+
if (typeof request.worker_index === 'number' && config.tmux_session) {
|
|
224
|
+
return { type: 'pane', value: `${config.tmux_session}.${request.worker_index}` };
|
|
225
|
+
}
|
|
226
|
+
if (config.tmux_session)
|
|
227
|
+
return { type: 'session', value: config.tmux_session };
|
|
228
|
+
return null;
|
|
229
|
+
}
|
|
230
|
+
function normalizeCaptureText(value) {
|
|
231
|
+
return safeString(value).replace(/\r/g, '').replace(/\s+/g, ' ').trim();
|
|
232
|
+
}
|
|
233
|
+
function capturedPaneContainsTrigger(captured, trigger) {
|
|
234
|
+
if (!captured || !trigger)
|
|
235
|
+
return false;
|
|
236
|
+
return normalizeCaptureText(captured).includes(normalizeCaptureText(trigger));
|
|
237
|
+
}
|
|
238
|
+
function capturedPaneContainsTriggerNearTail(captured, trigger, nonEmptyTailLines = 24) {
|
|
239
|
+
if (!captured || !trigger)
|
|
240
|
+
return false;
|
|
241
|
+
const normalizedTrigger = normalizeCaptureText(trigger);
|
|
242
|
+
if (!normalizedTrigger)
|
|
243
|
+
return false;
|
|
244
|
+
const lines = safeString(captured)
|
|
245
|
+
.split('\n')
|
|
246
|
+
.map((line) => line.replace(/\r/g, '').trim())
|
|
247
|
+
.filter((line) => line.length > 0);
|
|
248
|
+
if (lines.length === 0)
|
|
249
|
+
return false;
|
|
250
|
+
const tail = lines.slice(-Math.max(1, nonEmptyTailLines)).join(' ');
|
|
251
|
+
return normalizeCaptureText(tail).includes(normalizedTrigger);
|
|
252
|
+
}
|
|
253
|
+
function paneHasActiveTask(captured) {
|
|
254
|
+
const lines = safeString(captured)
|
|
255
|
+
.split('\n')
|
|
256
|
+
.map((line) => line.replace(/\r/g, '').trim())
|
|
257
|
+
.filter((line) => line.length > 0);
|
|
258
|
+
const tail = lines.slice(-40);
|
|
259
|
+
if (tail.some((line) => /\b\d+\s+background terminal running\b/i.test(line)))
|
|
260
|
+
return true;
|
|
261
|
+
if (tail.some((line) => /esc to interrupt/i.test(line)))
|
|
262
|
+
return true;
|
|
263
|
+
if (tail.some((line) => /\bbackground terminal running\b/i.test(line)))
|
|
264
|
+
return true;
|
|
265
|
+
if (tail.some((line) => /^[·✻]\s+[A-Za-z][A-Za-z0-9''-]*(?:\s+[A-Za-z][A-Za-z0-9''-]*){0,3}(?:…|\.{3})$/u.test(line)))
|
|
266
|
+
return true;
|
|
267
|
+
return false;
|
|
268
|
+
}
|
|
269
|
+
function paneIsBootstrapping(captured) {
|
|
270
|
+
const lines = safeString(captured)
|
|
271
|
+
.split('\n')
|
|
272
|
+
.map((line) => line.replace(/\r/g, '').trim())
|
|
273
|
+
.filter((line) => line.length > 0);
|
|
274
|
+
return lines.some((line) => /\b(loading|initializing|starting up)\b/i.test(line)
|
|
275
|
+
|| /\bmodel:\s*loading\b/i.test(line)
|
|
276
|
+
|| /\bconnecting\s+to\b/i.test(line));
|
|
277
|
+
}
|
|
278
|
+
function paneLooksReady(captured) {
|
|
279
|
+
const content = safeString(captured).trimEnd();
|
|
280
|
+
if (content === '')
|
|
281
|
+
return false;
|
|
282
|
+
const lines = content
|
|
283
|
+
.split('\n')
|
|
284
|
+
.map((line) => line.replace(/\r/g, '').trimEnd())
|
|
285
|
+
.filter((line) => line.trim() !== '');
|
|
286
|
+
if (paneIsBootstrapping(content))
|
|
287
|
+
return false;
|
|
288
|
+
const lastLine = lines.length > 0 ? lines[lines.length - 1] : '';
|
|
289
|
+
if (/^\s*[›>❯]\s*/u.test(lastLine))
|
|
290
|
+
return true;
|
|
291
|
+
const hasCodexPromptLine = lines.some((line) => /^\s*›\s*/u.test(line));
|
|
292
|
+
const hasClaudePromptLine = lines.some((line) => /^\s*❯\s*/u.test(line));
|
|
293
|
+
if (hasCodexPromptLine || hasClaudePromptLine)
|
|
294
|
+
return true;
|
|
295
|
+
return false;
|
|
296
|
+
}
|
|
297
|
+
function resolveWorkerCliForRequest(request, config) {
|
|
298
|
+
const workers = Array.isArray(config.workers) ? config.workers : [];
|
|
299
|
+
const idx = Number.isFinite(request.worker_index) ? Number(request.worker_index) : null;
|
|
300
|
+
if (idx !== null) {
|
|
301
|
+
const worker = workers.find((c) => Number(c.index) === idx);
|
|
302
|
+
const workerCli = safeString(worker?.worker_cli).trim().toLowerCase();
|
|
303
|
+
if (workerCli === 'claude')
|
|
304
|
+
return 'claude';
|
|
305
|
+
}
|
|
306
|
+
return 'codex';
|
|
307
|
+
}
|
|
308
|
+
async function runProcess(cmd, args, timeoutMs) {
|
|
309
|
+
const { execFile } = await import('child_process');
|
|
310
|
+
const { promisify } = await import('util');
|
|
311
|
+
const execFileAsync = promisify(execFile);
|
|
312
|
+
const result = await execFileAsync(cmd, args, { timeout: timeoutMs });
|
|
313
|
+
return { stdout: result.stdout ?? '', stderr: result.stderr ?? '' };
|
|
314
|
+
}
|
|
315
|
+
async function defaultInjector(request, config, cwd) {
|
|
316
|
+
const target = defaultInjectTarget(request, config);
|
|
317
|
+
if (!target)
|
|
318
|
+
return { ok: false, reason: 'missing_tmux_target' };
|
|
319
|
+
const paneTarget = target.value;
|
|
320
|
+
try {
|
|
321
|
+
const inMode = await runProcess('tmux', ['display-message', '-t', paneTarget, '-p', '#{pane_in_mode}'], 1000);
|
|
322
|
+
if (safeString(inMode.stdout).trim() === '1') {
|
|
323
|
+
return { ok: false, reason: 'scroll_active' };
|
|
324
|
+
}
|
|
325
|
+
}
|
|
326
|
+
catch { /* best effort */ }
|
|
327
|
+
const submitKeyPresses = resolveWorkerCliForRequest(request, config) === 'claude' ? 1 : 2;
|
|
328
|
+
const attemptCountAtStart = Number.isFinite(request.attempt_count) ? Math.max(0, Math.floor(request.attempt_count)) : 0;
|
|
329
|
+
let preCaptureHasTrigger = false;
|
|
330
|
+
if (attemptCountAtStart >= 1) {
|
|
331
|
+
try {
|
|
332
|
+
const preCapture = await runProcess('tmux', ['capture-pane', '-t', paneTarget, '-p', '-S', '-8'], 2000);
|
|
333
|
+
preCaptureHasTrigger = capturedPaneContainsTrigger(preCapture.stdout, request.trigger_message);
|
|
334
|
+
}
|
|
335
|
+
catch {
|
|
336
|
+
preCaptureHasTrigger = false;
|
|
337
|
+
}
|
|
338
|
+
}
|
|
339
|
+
const shouldTypePrompt = attemptCountAtStart === 0 || !preCaptureHasTrigger;
|
|
340
|
+
if (shouldTypePrompt) {
|
|
341
|
+
if (attemptCountAtStart >= 1) {
|
|
342
|
+
await runProcess('tmux', ['send-keys', '-t', paneTarget, 'C-u'], 1000).catch(() => { });
|
|
343
|
+
await new Promise((r) => setTimeout(r, 50));
|
|
344
|
+
}
|
|
345
|
+
await runProcess('tmux', ['send-keys', '-t', paneTarget, '-l', request.trigger_message], 3000);
|
|
346
|
+
}
|
|
347
|
+
for (let i = 0; i < submitKeyPresses; i++) {
|
|
348
|
+
await runProcess('tmux', ['send-keys', '-t', paneTarget, 'C-m'], 3000);
|
|
349
|
+
if (i < submitKeyPresses - 1) {
|
|
350
|
+
await new Promise((r) => setTimeout(r, 100));
|
|
351
|
+
}
|
|
352
|
+
}
|
|
353
|
+
// Post-injection verification
|
|
354
|
+
for (let round = 0; round < INJECT_VERIFY_ROUNDS; round++) {
|
|
355
|
+
await new Promise((r) => setTimeout(r, INJECT_VERIFY_DELAY_MS));
|
|
356
|
+
try {
|
|
357
|
+
const narrowCap = await runProcess('tmux', ['capture-pane', '-t', paneTarget, '-p', '-S', '-8'], 2000);
|
|
358
|
+
const wideCap = await runProcess('tmux', ['capture-pane', '-t', paneTarget, '-p'], 2000);
|
|
359
|
+
if (paneHasActiveTask(wideCap.stdout)) {
|
|
360
|
+
return { ok: true, reason: 'tmux_send_keys_confirmed_active_task', pane: paneTarget };
|
|
361
|
+
}
|
|
362
|
+
if (request.to_worker !== 'leader-fixed' && !paneLooksReady(wideCap.stdout)) {
|
|
363
|
+
continue;
|
|
364
|
+
}
|
|
365
|
+
const triggerInNarrow = capturedPaneContainsTrigger(narrowCap.stdout, request.trigger_message);
|
|
366
|
+
const triggerNearTail = capturedPaneContainsTriggerNearTail(wideCap.stdout, request.trigger_message);
|
|
367
|
+
if (!triggerInNarrow && !triggerNearTail) {
|
|
368
|
+
return { ok: true, reason: 'tmux_send_keys_confirmed', pane: paneTarget };
|
|
369
|
+
}
|
|
370
|
+
}
|
|
371
|
+
catch { /* capture failed; retry */ }
|
|
372
|
+
for (let i = 0; i < submitKeyPresses; i++) {
|
|
373
|
+
await runProcess('tmux', ['send-keys', '-t', paneTarget, 'C-m'], 3000).catch(() => { });
|
|
374
|
+
}
|
|
375
|
+
}
|
|
376
|
+
return { ok: true, reason: 'tmux_send_keys_unconfirmed', pane: paneTarget };
|
|
377
|
+
}
|
|
378
|
+
// ── Mailbox update ─────────────────────────────────────────────────────────
|
|
379
|
+
async function updateMailboxNotified(stateDir, teamName, workerName, messageId) {
|
|
380
|
+
const teamDirPath = join(stateDir, 'team', teamName);
|
|
381
|
+
const mailboxPath = join(teamDirPath, 'mailbox', `${workerName}.json`);
|
|
382
|
+
const legacyMailboxPath = join(teamDirPath, 'mailbox', `${workerName}.jsonl`);
|
|
383
|
+
return await withMailboxLock(teamDirPath, workerName, async () => {
|
|
384
|
+
const canonical = await readJson(mailboxPath, { worker: workerName, messages: [] });
|
|
385
|
+
if (canonical && Array.isArray(canonical.messages)) {
|
|
386
|
+
const msg = canonical.messages.find((c) => c?.message_id === messageId);
|
|
387
|
+
if (msg) {
|
|
388
|
+
if (!msg.notified_at)
|
|
389
|
+
msg.notified_at = new Date().toISOString();
|
|
390
|
+
await writeJsonAtomic(mailboxPath, canonical);
|
|
391
|
+
return true;
|
|
392
|
+
}
|
|
393
|
+
}
|
|
394
|
+
// Legacy fallback: mailbox/*.jsonl
|
|
395
|
+
if (!existsSync(legacyMailboxPath))
|
|
396
|
+
return false;
|
|
397
|
+
try {
|
|
398
|
+
const raw = await readFile(legacyMailboxPath, 'utf8');
|
|
399
|
+
const lines = raw.split('\n').map((line) => line.trim()).filter(Boolean);
|
|
400
|
+
const messagesById = new Map();
|
|
401
|
+
for (const line of lines) {
|
|
402
|
+
let parsed;
|
|
403
|
+
try {
|
|
404
|
+
parsed = JSON.parse(line);
|
|
405
|
+
}
|
|
406
|
+
catch {
|
|
407
|
+
continue;
|
|
408
|
+
}
|
|
409
|
+
if (!parsed || typeof parsed !== 'object')
|
|
410
|
+
continue;
|
|
411
|
+
const candidate = parsed;
|
|
412
|
+
const id = safeString(candidate.message_id || candidate.id).trim();
|
|
413
|
+
if (!id)
|
|
414
|
+
continue;
|
|
415
|
+
messagesById.set(id, candidate);
|
|
416
|
+
}
|
|
417
|
+
const message = messagesById.get(messageId);
|
|
418
|
+
if (!message)
|
|
419
|
+
return false;
|
|
420
|
+
if (!message.notified_at) {
|
|
421
|
+
message.notified_at = new Date().toISOString();
|
|
422
|
+
}
|
|
423
|
+
const normalizedMessages = [...messagesById.values()].map((candidate) => ({
|
|
424
|
+
message_id: safeString(candidate.message_id || candidate.id),
|
|
425
|
+
from_worker: safeString(candidate.from_worker || candidate.from),
|
|
426
|
+
to_worker: safeString(candidate.to_worker || candidate.to),
|
|
427
|
+
body: safeString(candidate.body),
|
|
428
|
+
created_at: safeString(candidate.created_at || candidate.createdAt),
|
|
429
|
+
...(safeString(candidate.notified_at || candidate.notifiedAt) ? { notified_at: safeString(candidate.notified_at || candidate.notifiedAt) } : {}),
|
|
430
|
+
...(safeString(candidate.delivered_at || candidate.deliveredAt) ? { delivered_at: safeString(candidate.delivered_at || candidate.deliveredAt) } : {}),
|
|
431
|
+
}));
|
|
432
|
+
await writeJsonAtomic(mailboxPath, { worker: workerName, messages: normalizedMessages });
|
|
433
|
+
return true;
|
|
434
|
+
}
|
|
435
|
+
catch {
|
|
436
|
+
return false;
|
|
437
|
+
}
|
|
438
|
+
});
|
|
439
|
+
}
|
|
440
|
+
// ── Event logging ──────────────────────────────────────────────────────────
|
|
441
|
+
async function appendDispatchLog(logsDir, event) {
|
|
442
|
+
const path = join(logsDir, `team-dispatch-${new Date().toISOString().slice(0, 10)}.jsonl`);
|
|
443
|
+
await mkdir(logsDir, { recursive: true }).catch(() => { });
|
|
444
|
+
await appendFile(path, `${JSON.stringify({ timestamp: new Date().toISOString(), ...event })}\n`).catch(() => { });
|
|
445
|
+
}
|
|
446
|
+
async function appendLeaderNotificationDeferredEvent(params) {
|
|
447
|
+
const eventsDir = join(params.stateDir, 'team', params.teamName, 'events');
|
|
448
|
+
const eventsPath = join(eventsDir, 'events.ndjson');
|
|
449
|
+
const event = {
|
|
450
|
+
event_id: `leader-deferred-${Date.now()}-${Math.random().toString(16).slice(2, 8)}`,
|
|
451
|
+
team: params.teamName,
|
|
452
|
+
type: LEADER_NOTIFICATION_DEFERRED_TYPE,
|
|
453
|
+
worker: params.request.to_worker,
|
|
454
|
+
to_worker: params.request.to_worker,
|
|
455
|
+
reason: params.reason,
|
|
456
|
+
created_at: params.nowIso,
|
|
457
|
+
request_id: params.request.request_id,
|
|
458
|
+
...(params.request.message_id ? { message_id: params.request.message_id } : {}),
|
|
459
|
+
};
|
|
460
|
+
await mkdir(eventsDir, { recursive: true }).catch(() => { });
|
|
461
|
+
await appendFile(eventsPath, JSON.stringify(event) + '\n').catch(() => { });
|
|
462
|
+
}
|
|
463
|
+
// ── Main export ────────────────────────────────────────────────────────────
|
|
464
|
+
function shouldSkipRequest(request) {
|
|
465
|
+
if (request.status !== 'pending')
|
|
466
|
+
return true;
|
|
467
|
+
return request.transport_preference !== 'hook_preferred_with_fallback';
|
|
468
|
+
}
|
|
469
|
+
export async function drainPendingTeamDispatch(options = { cwd: '' }) {
|
|
470
|
+
const { cwd } = options;
|
|
471
|
+
const stateDir = options.stateDir ?? join(cwd, '.omc', 'state');
|
|
472
|
+
const logsDir = options.logsDir ?? join(cwd, '.omc', 'logs');
|
|
473
|
+
const maxPerTick = options.maxPerTick ?? 5;
|
|
474
|
+
const injector = options.injector ?? defaultInjector;
|
|
475
|
+
if (safeString(process.env.OMC_TEAM_WORKER)) {
|
|
476
|
+
return { processed: 0, skipped: 0, failed: 0, reason: 'worker_context' };
|
|
477
|
+
}
|
|
478
|
+
const teamRoot = join(stateDir, 'team');
|
|
479
|
+
if (!existsSync(teamRoot))
|
|
480
|
+
return { processed: 0, skipped: 0, failed: 0 };
|
|
481
|
+
let teams = [];
|
|
482
|
+
try {
|
|
483
|
+
teams = await readdir(teamRoot);
|
|
484
|
+
}
|
|
485
|
+
catch {
|
|
486
|
+
return { processed: 0, skipped: 0, failed: 0 };
|
|
487
|
+
}
|
|
488
|
+
let processed = 0;
|
|
489
|
+
let skipped = 0;
|
|
490
|
+
let failed = 0;
|
|
491
|
+
const issueCooldownMs = resolveIssueDispatchCooldownMs();
|
|
492
|
+
const triggerCooldownMs = resolveDispatchTriggerCooldownMs();
|
|
493
|
+
for (const teamName of teams) {
|
|
494
|
+
if (processed >= maxPerTick)
|
|
495
|
+
break;
|
|
496
|
+
const teamDirPath = join(teamRoot, teamName);
|
|
497
|
+
const manifestPath = join(teamDirPath, 'manifest.v2.json');
|
|
498
|
+
const configPath = join(teamDirPath, 'config.json');
|
|
499
|
+
const requestsPath = join(teamDirPath, 'dispatch', 'requests.json');
|
|
500
|
+
if (!existsSync(requestsPath))
|
|
501
|
+
continue;
|
|
502
|
+
const config = await readJson(existsSync(manifestPath) ? manifestPath : configPath, {});
|
|
503
|
+
await withDispatchLock(teamDirPath, async () => {
|
|
504
|
+
const requests = await readJson(requestsPath, []);
|
|
505
|
+
if (!Array.isArray(requests))
|
|
506
|
+
return;
|
|
507
|
+
const issueCooldownState = await readIssueCooldownState(teamDirPath);
|
|
508
|
+
const triggerCooldownState = await readTriggerCooldownState(teamDirPath);
|
|
509
|
+
const issueCooldownByIssue = issueCooldownState.by_issue || {};
|
|
510
|
+
const triggerCooldownByKey = triggerCooldownState.by_trigger || {};
|
|
511
|
+
const nowMs = Date.now();
|
|
512
|
+
let mutated = false;
|
|
513
|
+
for (const request of requests) {
|
|
514
|
+
if (processed >= maxPerTick)
|
|
515
|
+
break;
|
|
516
|
+
if (!request || typeof request !== 'object')
|
|
517
|
+
continue;
|
|
518
|
+
if (shouldSkipRequest(request)) {
|
|
519
|
+
skipped += 1;
|
|
520
|
+
continue;
|
|
521
|
+
}
|
|
522
|
+
// Leader pane missing -> defer
|
|
523
|
+
if (request.to_worker === 'leader-fixed' && !safeString(config.leader_pane_id).trim()) {
|
|
524
|
+
const nowIso = new Date().toISOString();
|
|
525
|
+
request.updated_at = nowIso;
|
|
526
|
+
request.last_reason = LEADER_PANE_MISSING_DEFERRED_REASON;
|
|
527
|
+
request.status = 'pending';
|
|
528
|
+
skipped += 1;
|
|
529
|
+
mutated = true;
|
|
530
|
+
await appendDispatchLog(logsDir, {
|
|
531
|
+
type: 'dispatch_deferred',
|
|
532
|
+
team: teamName,
|
|
533
|
+
request_id: request.request_id,
|
|
534
|
+
worker: request.to_worker,
|
|
535
|
+
to_worker: request.to_worker,
|
|
536
|
+
message_id: request.message_id || null,
|
|
537
|
+
reason: LEADER_PANE_MISSING_DEFERRED_REASON,
|
|
538
|
+
status: 'pending',
|
|
539
|
+
tmux_injection_attempted: false,
|
|
540
|
+
});
|
|
541
|
+
await appendLeaderNotificationDeferredEvent({
|
|
542
|
+
stateDir,
|
|
543
|
+
teamName,
|
|
544
|
+
request,
|
|
545
|
+
reason: LEADER_PANE_MISSING_DEFERRED_REASON,
|
|
546
|
+
nowIso,
|
|
547
|
+
});
|
|
548
|
+
continue;
|
|
549
|
+
}
|
|
550
|
+
// Issue cooldown
|
|
551
|
+
const issueKey = extractIssueKey(request.trigger_message);
|
|
552
|
+
if (issueCooldownMs > 0 && issueKey) {
|
|
553
|
+
const lastInjectedMs = Number(issueCooldownByIssue[issueKey]);
|
|
554
|
+
if (Number.isFinite(lastInjectedMs) && lastInjectedMs > 0 && nowMs - lastInjectedMs < issueCooldownMs) {
|
|
555
|
+
skipped += 1;
|
|
556
|
+
continue;
|
|
557
|
+
}
|
|
558
|
+
}
|
|
559
|
+
// Trigger cooldown
|
|
560
|
+
const triggerKey = normalizeTriggerKey(request.trigger_message);
|
|
561
|
+
if (triggerCooldownMs > 0 && triggerKey) {
|
|
562
|
+
const parsed = parseTriggerCooldownEntry(triggerCooldownByKey[triggerKey]);
|
|
563
|
+
const withinCooldown = Number.isFinite(parsed.at) && parsed.at > 0 && nowMs - parsed.at < triggerCooldownMs;
|
|
564
|
+
const sameRequestRetry = parsed.lastRequestId !== '' && parsed.lastRequestId === safeString(request.request_id).trim();
|
|
565
|
+
if (withinCooldown && !sameRequestRetry) {
|
|
566
|
+
skipped += 1;
|
|
567
|
+
continue;
|
|
568
|
+
}
|
|
569
|
+
}
|
|
570
|
+
const result = await injector(request, config, resolve(cwd));
|
|
571
|
+
if (issueKey && issueCooldownMs > 0) {
|
|
572
|
+
issueCooldownByIssue[issueKey] = Date.now();
|
|
573
|
+
mutated = true;
|
|
574
|
+
}
|
|
575
|
+
if (triggerKey && triggerCooldownMs > 0) {
|
|
576
|
+
triggerCooldownByKey[triggerKey] = {
|
|
577
|
+
at: Date.now(),
|
|
578
|
+
last_request_id: safeString(request.request_id).trim(),
|
|
579
|
+
};
|
|
580
|
+
mutated = true;
|
|
581
|
+
}
|
|
582
|
+
const nowIso = new Date().toISOString();
|
|
583
|
+
request.attempt_count = Number.isFinite(request.attempt_count) ? Math.max(0, request.attempt_count + 1) : 1;
|
|
584
|
+
request.updated_at = nowIso;
|
|
585
|
+
if (result.ok) {
|
|
586
|
+
// Unconfirmed: retry up to MAX_UNCONFIRMED_ATTEMPTS
|
|
587
|
+
if (result.reason === 'tmux_send_keys_unconfirmed' && request.attempt_count < MAX_UNCONFIRMED_ATTEMPTS) {
|
|
588
|
+
request.last_reason = result.reason;
|
|
589
|
+
mutated = true;
|
|
590
|
+
skipped += 1;
|
|
591
|
+
await appendDispatchLog(logsDir, {
|
|
592
|
+
type: 'dispatch_unconfirmed_retry',
|
|
593
|
+
team: teamName,
|
|
594
|
+
request_id: request.request_id,
|
|
595
|
+
worker: request.to_worker,
|
|
596
|
+
attempt: request.attempt_count,
|
|
597
|
+
reason: result.reason,
|
|
598
|
+
});
|
|
599
|
+
continue;
|
|
600
|
+
}
|
|
601
|
+
if (result.reason === 'tmux_send_keys_unconfirmed') {
|
|
602
|
+
request.status = 'failed';
|
|
603
|
+
request.failed_at = nowIso;
|
|
604
|
+
request.last_reason = 'unconfirmed_after_max_retries';
|
|
605
|
+
processed += 1;
|
|
606
|
+
failed += 1;
|
|
607
|
+
mutated = true;
|
|
608
|
+
await appendDispatchLog(logsDir, {
|
|
609
|
+
type: 'dispatch_failed',
|
|
610
|
+
team: teamName,
|
|
611
|
+
request_id: request.request_id,
|
|
612
|
+
worker: request.to_worker,
|
|
613
|
+
message_id: request.message_id || null,
|
|
614
|
+
reason: request.last_reason,
|
|
615
|
+
});
|
|
616
|
+
continue;
|
|
617
|
+
}
|
|
618
|
+
request.status = 'notified';
|
|
619
|
+
request.notified_at = nowIso;
|
|
620
|
+
request.last_reason = result.reason;
|
|
621
|
+
if (request.kind === 'mailbox' && request.message_id) {
|
|
622
|
+
await updateMailboxNotified(stateDir, teamName, request.to_worker, request.message_id).catch(() => { });
|
|
623
|
+
}
|
|
624
|
+
processed += 1;
|
|
625
|
+
mutated = true;
|
|
626
|
+
await appendDispatchLog(logsDir, {
|
|
627
|
+
type: 'dispatch_notified',
|
|
628
|
+
team: teamName,
|
|
629
|
+
request_id: request.request_id,
|
|
630
|
+
worker: request.to_worker,
|
|
631
|
+
message_id: request.message_id || null,
|
|
632
|
+
reason: result.reason,
|
|
633
|
+
});
|
|
634
|
+
}
|
|
635
|
+
else {
|
|
636
|
+
request.status = 'failed';
|
|
637
|
+
request.failed_at = nowIso;
|
|
638
|
+
request.last_reason = result.reason;
|
|
639
|
+
processed += 1;
|
|
640
|
+
failed += 1;
|
|
641
|
+
mutated = true;
|
|
642
|
+
await appendDispatchLog(logsDir, {
|
|
643
|
+
type: 'dispatch_failed',
|
|
644
|
+
team: teamName,
|
|
645
|
+
request_id: request.request_id,
|
|
646
|
+
worker: request.to_worker,
|
|
647
|
+
message_id: request.message_id || null,
|
|
648
|
+
reason: result.reason,
|
|
649
|
+
});
|
|
650
|
+
}
|
|
651
|
+
}
|
|
652
|
+
if (mutated) {
|
|
653
|
+
issueCooldownState.by_issue = issueCooldownByIssue;
|
|
654
|
+
await writeJsonAtomic(issueCooldownStatePath(teamDirPath), issueCooldownState);
|
|
655
|
+
triggerCooldownState.by_trigger = triggerCooldownByKey;
|
|
656
|
+
await writeJsonAtomic(triggerCooldownStatePath(teamDirPath), triggerCooldownState);
|
|
657
|
+
await writeJsonAtomic(requestsPath, requests);
|
|
658
|
+
}
|
|
659
|
+
});
|
|
660
|
+
}
|
|
661
|
+
return { processed, skipped, failed };
|
|
662
|
+
}
|
|
663
|
+
//# sourceMappingURL=team-dispatch-hook.js.map
|