claudecode-omc 4.8.2 → 4.8.3
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 +3 -3
- package/.claude-plugin/plugin.json +3 -3
- package/README.de.md +60 -0
- package/README.es.md +60 -0
- package/README.fr.md +60 -0
- package/README.it.md +60 -0
- package/README.ja.md +60 -0
- package/README.ko.md +60 -0
- package/README.md +101 -16
- package/README.pt.md +60 -0
- package/README.ru.md +60 -0
- package/README.tr.md +60 -0
- package/README.vi.md +60 -0
- package/README.zh.md +60 -0
- package/agents/code-reviewer.md +107 -6
- package/agents/critic.md +212 -42
- package/agents/debugger.md +52 -4
- package/agents/document-specialist.md +39 -60
- package/agents/executor.md +29 -9
- package/agents/explore.md +3 -1
- package/agents/security-reviewer.md +57 -0
- package/agents/test-engineer.md +21 -0
- package/agents/verifier.md +2 -0
- package/agents/writer.md +2 -0
- package/bridge/cli.cjs +7402 -3580
- package/bridge/mcp-server.cjs +558 -43
- package/bridge/runtime-cli.cjs +3034 -1801
- package/bridge/team-bridge.cjs +25 -1
- package/bridge/team-mcp.cjs +257 -88
- package/bridge/team.js +5226 -413
- package/dist/__tests__/agent-boundary-guidance.test.d.ts +2 -0
- package/dist/__tests__/agent-boundary-guidance.test.d.ts.map +1 -0
- package/dist/__tests__/agent-boundary-guidance.test.js +48 -0
- package/dist/__tests__/agent-boundary-guidance.test.js.map +1 -0
- package/dist/__tests__/agent-registry.test.js +48 -11
- package/dist/__tests__/agent-registry.test.js.map +1 -1
- package/dist/__tests__/auto-slash-aliases.test.js +25 -0
- package/dist/__tests__/auto-slash-aliases.test.js.map +1 -1
- package/dist/__tests__/bedrock-model-routing.test.d.ts +21 -0
- package/dist/__tests__/bedrock-model-routing.test.d.ts.map +1 -0
- package/dist/__tests__/bedrock-model-routing.test.js +397 -0
- package/dist/__tests__/bedrock-model-routing.test.js.map +1 -0
- package/dist/__tests__/cleanup-validation.test.js +7 -3
- package/dist/__tests__/cleanup-validation.test.js.map +1 -1
- package/dist/__tests__/cli-win32-warning.test.js +15 -2
- package/dist/__tests__/cli-win32-warning.test.js.map +1 -1
- package/dist/__tests__/consolidation-contracts.test.js +28 -3
- package/dist/__tests__/consolidation-contracts.test.js.map +1 -1
- package/dist/__tests__/context-guard-stop.test.d.ts +2 -0
- package/dist/__tests__/context-guard-stop.test.d.ts.map +1 -0
- package/dist/__tests__/context-guard-stop.test.js +58 -0
- package/dist/__tests__/context-guard-stop.test.js.map +1 -0
- package/dist/__tests__/delegation-enforcer.test.js +76 -11
- package/dist/__tests__/delegation-enforcer.test.js.map +1 -1
- package/dist/__tests__/doctor-conflicts.test.js +62 -1
- package/dist/__tests__/doctor-conflicts.test.js.map +1 -1
- package/dist/__tests__/hooks.test.js +165 -4
- package/dist/__tests__/hooks.test.js.map +1 -1
- package/dist/__tests__/hud/defaults.test.js +4 -0
- package/dist/__tests__/hud/defaults.test.js.map +1 -1
- package/dist/__tests__/hud/limits-error.test.js +2 -4
- package/dist/__tests__/hud/limits-error.test.js.map +1 -1
- package/dist/__tests__/hud/mission-board-state.test.d.ts +2 -0
- package/dist/__tests__/hud/mission-board-state.test.d.ts.map +1 -0
- package/dist/__tests__/hud/mission-board-state.test.js +170 -0
- package/dist/__tests__/hud/mission-board-state.test.js.map +1 -0
- package/dist/__tests__/hud/mission-board.test.d.ts +2 -0
- package/dist/__tests__/hud/mission-board.test.d.ts.map +1 -0
- package/dist/__tests__/hud/mission-board.test.js +143 -0
- package/dist/__tests__/hud/mission-board.test.js.map +1 -0
- package/dist/__tests__/hud/rate-limits-error.test.js +13 -0
- package/dist/__tests__/hud/rate-limits-error.test.js.map +1 -1
- package/dist/__tests__/hud/render-rate-limits-priority.test.d.ts +8 -0
- package/dist/__tests__/hud/render-rate-limits-priority.test.d.ts.map +1 -0
- package/dist/__tests__/hud/render-rate-limits-priority.test.js +145 -0
- package/dist/__tests__/hud/render-rate-limits-priority.test.js.map +1 -0
- package/dist/__tests__/hud/render.test.js +22 -0
- package/dist/__tests__/hud/render.test.js.map +1 -1
- package/dist/__tests__/hud/stale-indicator.test.d.ts +9 -0
- package/dist/__tests__/hud/stale-indicator.test.d.ts.map +1 -0
- package/dist/__tests__/hud/stale-indicator.test.js +81 -0
- package/dist/__tests__/hud/stale-indicator.test.js.map +1 -0
- package/dist/__tests__/hud/state.test.js +30 -0
- package/dist/__tests__/hud/state.test.js.map +1 -1
- package/dist/__tests__/hud/usage-api-lock.test.d.ts +2 -0
- package/dist/__tests__/hud/usage-api-lock.test.d.ts.map +1 -0
- package/dist/__tests__/hud/usage-api-lock.test.js +245 -0
- package/dist/__tests__/hud/usage-api-lock.test.js.map +1 -0
- package/dist/__tests__/hud/usage-api-stale.test.d.ts +9 -0
- package/dist/__tests__/hud/usage-api-stale.test.d.ts.map +1 -0
- package/dist/__tests__/hud/usage-api-stale.test.js +297 -0
- package/dist/__tests__/hud/usage-api-stale.test.js.map +1 -0
- package/dist/__tests__/hud/usage-api.test.js +223 -0
- package/dist/__tests__/hud/usage-api.test.js.map +1 -1
- package/dist/__tests__/hud/watch-mode-init.test.d.ts +2 -0
- package/dist/__tests__/hud/watch-mode-init.test.d.ts.map +1 -0
- package/dist/__tests__/hud/watch-mode-init.test.js +133 -0
- package/dist/__tests__/hud/watch-mode-init.test.js.map +1 -0
- package/dist/__tests__/hud-agents.test.js +12 -10
- package/dist/__tests__/hud-agents.test.js.map +1 -1
- package/dist/__tests__/hud-build-guidance.test.js +6 -2
- package/dist/__tests__/hud-build-guidance.test.js.map +1 -1
- package/dist/__tests__/hud-marketplace-resolution.test.d.ts +2 -0
- package/dist/__tests__/hud-marketplace-resolution.test.d.ts.map +1 -0
- package/dist/__tests__/hud-marketplace-resolution.test.js +53 -0
- package/dist/__tests__/hud-marketplace-resolution.test.js.map +1 -0
- package/dist/__tests__/installer-hud-skip.test.js +12 -0
- package/dist/__tests__/installer-hud-skip.test.js.map +1 -1
- package/dist/__tests__/installer-plugin-agents.test.d.ts +2 -0
- package/dist/__tests__/installer-plugin-agents.test.d.ts.map +1 -0
- package/dist/__tests__/installer-plugin-agents.test.js +111 -0
- package/dist/__tests__/installer-plugin-agents.test.js.map +1 -0
- package/dist/__tests__/installer-version-guard.test.d.ts +2 -0
- package/dist/__tests__/installer-version-guard.test.d.ts.map +1 -0
- package/dist/__tests__/installer-version-guard.test.js +75 -0
- package/dist/__tests__/installer-version-guard.test.js.map +1 -0
- package/dist/__tests__/installer.test.js +58 -4
- package/dist/__tests__/installer.test.js.map +1 -1
- package/dist/__tests__/omc-tools-server.test.js +8 -5
- package/dist/__tests__/omc-tools-server.test.js.map +1 -1
- package/dist/__tests__/pre-tool-enforcer.test.js +38 -0
- package/dist/__tests__/pre-tool-enforcer.test.js.map +1 -1
- package/dist/__tests__/prompt-injection.test.js +3 -3
- package/dist/__tests__/prompt-injection.test.js.map +1 -1
- package/dist/__tests__/ralph-prd-mandatory.test.js +53 -2
- package/dist/__tests__/ralph-prd-mandatory.test.js.map +1 -1
- package/dist/__tests__/rate-limit-wait/rate-limit-monitor.test.js +42 -0
- package/dist/__tests__/rate-limit-wait/rate-limit-monitor.test.js.map +1 -1
- package/dist/__tests__/rate-limit-wait/tmux-detector.test.js +1 -1
- package/dist/__tests__/session-history-search.test.d.ts +2 -0
- package/dist/__tests__/session-history-search.test.d.ts.map +1 -0
- package/dist/__tests__/session-history-search.test.js +115 -0
- package/dist/__tests__/session-history-search.test.js.map +1 -0
- package/dist/__tests__/session-start-script-context.test.d.ts +2 -0
- package/dist/__tests__/session-start-script-context.test.d.ts.map +1 -0
- package/dist/__tests__/session-start-script-context.test.js +49 -0
- package/dist/__tests__/session-start-script-context.test.js.map +1 -0
- package/dist/__tests__/skills.test.js +71 -24
- package/dist/__tests__/skills.test.js.map +1 -1
- package/dist/__tests__/standalone-server.test.js +8 -4
- package/dist/__tests__/standalone-server.test.js.map +1 -1
- package/dist/__tests__/tier0-docs-consistency.test.js +10 -2
- package/dist/__tests__/tier0-docs-consistency.test.js.map +1 -1
- package/dist/agents/definitions.d.ts +5 -15
- package/dist/agents/definitions.d.ts.map +1 -1
- package/dist/agents/definitions.js +48 -49
- package/dist/agents/definitions.js.map +1 -1
- package/dist/agents/document-specialist.d.ts +1 -1
- package/dist/agents/document-specialist.d.ts.map +1 -1
- package/dist/agents/document-specialist.js +46 -21
- package/dist/agents/document-specialist.js.map +1 -1
- package/dist/agents/explore.d.ts.map +1 -1
- package/dist/agents/explore.js +3 -2
- package/dist/agents/explore.js.map +1 -1
- package/dist/agents/index.d.ts +2 -4
- package/dist/agents/index.d.ts.map +1 -1
- package/dist/agents/index.js +3 -6
- package/dist/agents/index.js.map +1 -1
- package/dist/agents/types.d.ts +2 -2
- package/dist/agents/types.d.ts.map +1 -1
- package/dist/cli/__tests__/ask.test.js +255 -8
- package/dist/cli/__tests__/ask.test.js.map +1 -1
- package/dist/cli/__tests__/session-search-help.test.d.ts +2 -0
- package/dist/cli/__tests__/session-search-help.test.d.ts.map +1 -0
- package/dist/cli/__tests__/session-search-help.test.js +13 -0
- package/dist/cli/__tests__/session-search-help.test.js.map +1 -0
- package/dist/cli/__tests__/session-search.test.d.ts +2 -0
- package/dist/cli/__tests__/session-search.test.d.ts.map +1 -0
- package/dist/cli/__tests__/session-search.test.js +72 -0
- package/dist/cli/__tests__/session-search.test.js.map +1 -0
- package/dist/cli/__tests__/team-help.test.js +1 -1
- package/dist/cli/__tests__/team-help.test.js.map +1 -1
- package/dist/cli/__tests__/team.test.js +256 -4
- package/dist/cli/__tests__/team.test.js.map +1 -1
- package/dist/cli/commands/__tests__/team.test.js +52 -2
- package/dist/cli/commands/__tests__/team.test.js.map +1 -1
- package/dist/cli/commands/doctor-conflicts.d.ts.map +1 -1
- package/dist/cli/commands/doctor-conflicts.js +15 -1
- package/dist/cli/commands/doctor-conflicts.js.map +1 -1
- package/dist/cli/commands/session-search.d.ts +18 -0
- package/dist/cli/commands/session-search.d.ts.map +1 -0
- package/dist/cli/commands/session-search.js +47 -0
- package/dist/cli/commands/session-search.js.map +1 -0
- package/dist/cli/commands/team.d.ts +11 -0
- package/dist/cli/commands/team.d.ts.map +1 -1
- package/dist/cli/commands/team.js +94 -24
- package/dist/cli/commands/team.js.map +1 -1
- package/dist/cli/commands/wait.d.ts.map +1 -1
- package/dist/cli/commands/wait.js +12 -1
- package/dist/cli/commands/wait.js.map +1 -1
- package/dist/cli/index.js +70 -2
- package/dist/cli/index.js.map +1 -1
- package/dist/cli/team.d.ts +1 -0
- package/dist/cli/team.d.ts.map +1 -1
- package/dist/cli/team.js +100 -214
- package/dist/cli/team.js.map +1 -1
- package/dist/cli/win32-warning.d.ts +2 -1
- package/dist/cli/win32-warning.d.ts.map +1 -1
- package/dist/cli/win32-warning.js +20 -6
- package/dist/cli/win32-warning.js.map +1 -1
- package/dist/config/__tests__/loader.test.d.ts +2 -0
- package/dist/config/__tests__/loader.test.d.ts.map +1 -0
- package/dist/config/__tests__/loader.test.js +145 -0
- package/dist/config/__tests__/loader.test.js.map +1 -0
- package/dist/config/__tests__/models.test.d.ts +2 -0
- package/dist/config/__tests__/models.test.d.ts.map +1 -0
- package/dist/config/__tests__/models.test.js +147 -0
- package/dist/config/__tests__/models.test.js.map +1 -0
- package/dist/config/__tests__/test-helpers.d.ts +3 -0
- package/dist/config/__tests__/test-helpers.d.ts.map +1 -0
- package/dist/config/__tests__/test-helpers.js +19 -0
- package/dist/config/__tests__/test-helpers.js.map +1 -0
- package/dist/config/loader.d.ts +3 -1
- package/dist/config/loader.d.ts.map +1 -1
- package/dist/config/loader.js +140 -126
- package/dist/config/loader.js.map +1 -1
- package/dist/config/models.d.ts +29 -10
- package/dist/config/models.d.ts.map +1 -1
- package/dist/config/models.js +96 -10
- package/dist/config/models.js.map +1 -1
- package/dist/features/builtin-skills/skills.d.ts.map +1 -1
- package/dist/features/builtin-skills/skills.js +8 -1
- package/dist/features/builtin-skills/skills.js.map +1 -1
- package/dist/features/builtin-skills/types.d.ts +3 -0
- package/dist/features/builtin-skills/types.d.ts.map +1 -1
- package/dist/features/delegation-enforcer.d.ts +5 -12
- package/dist/features/delegation-enforcer.d.ts.map +1 -1
- package/dist/features/delegation-enforcer.js +48 -54
- package/dist/features/delegation-enforcer.js.map +1 -1
- package/dist/features/delegation-routing/__tests__/resolver.test.js +4 -3
- package/dist/features/delegation-routing/__tests__/resolver.test.js.map +1 -1
- package/dist/features/delegation-routing/types.d.ts.map +1 -1
- package/dist/features/delegation-routing/types.js +7 -4
- package/dist/features/delegation-routing/types.js.map +1 -1
- package/dist/features/index.d.ts +1 -0
- package/dist/features/index.d.ts.map +1 -1
- package/dist/features/index.js +2 -0
- package/dist/features/index.js.map +1 -1
- package/dist/features/rate-limit-wait/daemon.d.ts.map +1 -1
- package/dist/features/rate-limit-wait/daemon.js +8 -5
- package/dist/features/rate-limit-wait/daemon.js.map +1 -1
- package/dist/features/rate-limit-wait/index.d.ts +1 -1
- package/dist/features/rate-limit-wait/index.d.ts.map +1 -1
- package/dist/features/rate-limit-wait/index.js +1 -1
- package/dist/features/rate-limit-wait/index.js.map +1 -1
- package/dist/features/rate-limit-wait/rate-limit-monitor.d.ts +9 -0
- package/dist/features/rate-limit-wait/rate-limit-monitor.d.ts.map +1 -1
- package/dist/features/rate-limit-wait/rate-limit-monitor.js +38 -0
- package/dist/features/rate-limit-wait/rate-limit-monitor.js.map +1 -1
- package/dist/features/rate-limit-wait/tmux-detector.d.ts +2 -1
- package/dist/features/rate-limit-wait/tmux-detector.d.ts.map +1 -1
- package/dist/features/rate-limit-wait/tmux-detector.js +8 -9
- package/dist/features/rate-limit-wait/tmux-detector.js.map +1 -1
- package/dist/features/rate-limit-wait/types.d.ts +11 -0
- package/dist/features/rate-limit-wait/types.d.ts.map +1 -1
- package/dist/features/session-history-search/index.d.ts +6 -0
- package/dist/features/session-history-search/index.d.ts.map +1 -0
- package/dist/features/session-history-search/index.js +480 -0
- package/dist/features/session-history-search/index.js.map +1 -0
- package/dist/features/session-history-search/types.d.ts +36 -0
- package/dist/features/session-history-search/types.d.ts.map +1 -0
- package/dist/features/session-history-search/types.js +2 -0
- package/dist/features/session-history-search/types.js.map +1 -0
- package/dist/hooks/__tests__/background-process-guard.test.js +101 -5
- package/dist/hooks/__tests__/background-process-guard.test.js.map +1 -1
- package/dist/hooks/__tests__/bridge-openclaw.test.js +16 -5
- package/dist/hooks/__tests__/bridge-openclaw.test.js.map +1 -1
- package/dist/hooks/__tests__/bridge-routing.test.js +48 -1
- package/dist/hooks/__tests__/bridge-routing.test.js.map +1 -1
- package/dist/hooks/auto-slash-command/executor.d.ts.map +1 -1
- package/dist/hooks/auto-slash-command/executor.js +9 -1
- package/dist/hooks/auto-slash-command/executor.js.map +1 -1
- package/dist/hooks/auto-slash-command/types.d.ts +2 -0
- package/dist/hooks/auto-slash-command/types.d.ts.map +1 -1
- package/dist/hooks/auto-slash-command/types.js +0 -7
- package/dist/hooks/auto-slash-command/types.js.map +1 -1
- package/dist/hooks/autopilot/adapters/execution-adapter.js +3 -3
- package/dist/hooks/autopilot/prompts.js +1 -1
- package/dist/hooks/bridge-normalize.d.ts.map +1 -1
- package/dist/hooks/bridge-normalize.js +2 -0
- package/dist/hooks/bridge-normalize.js.map +1 -1
- package/dist/hooks/bridge.d.ts.map +1 -1
- package/dist/hooks/bridge.js +248 -39
- package/dist/hooks/bridge.js.map +1 -1
- package/dist/hooks/keyword-detector/__tests__/index.test.js +41 -0
- 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 +3 -1
- package/dist/hooks/keyword-detector/index.js.map +1 -1
- package/dist/hooks/permission-handler/index.d.ts +8 -0
- package/dist/hooks/permission-handler/index.d.ts.map +1 -1
- package/dist/hooks/permission-handler/index.js +76 -0
- package/dist/hooks/permission-handler/index.js.map +1 -1
- package/dist/hooks/persistent-mode/__tests__/ralph-verification-flow.test.d.ts +2 -0
- package/dist/hooks/persistent-mode/__tests__/ralph-verification-flow.test.d.ts.map +1 -0
- package/dist/hooks/persistent-mode/__tests__/ralph-verification-flow.test.js +90 -0
- package/dist/hooks/persistent-mode/__tests__/ralph-verification-flow.test.js.map +1 -0
- package/dist/hooks/persistent-mode/__tests__/team-ralplan-stop.test.d.ts +2 -0
- package/dist/hooks/persistent-mode/__tests__/team-ralplan-stop.test.d.ts.map +1 -0
- package/dist/hooks/persistent-mode/__tests__/team-ralplan-stop.test.js +535 -0
- package/dist/hooks/persistent-mode/__tests__/team-ralplan-stop.test.js.map +1 -0
- package/dist/hooks/persistent-mode/index.d.ts +1 -1
- package/dist/hooks/persistent-mode/index.d.ts.map +1 -1
- package/dist/hooks/persistent-mode/index.js +296 -21
- package/dist/hooks/persistent-mode/index.js.map +1 -1
- package/dist/hooks/persistent-mode/stop-hook-blocking.test.js +156 -0
- package/dist/hooks/persistent-mode/stop-hook-blocking.test.js.map +1 -1
- package/dist/hooks/project-memory/__tests__/integration.test.js +27 -2
- package/dist/hooks/project-memory/__tests__/integration.test.js.map +1 -1
- package/dist/hooks/project-memory/__tests__/storage.test.js +37 -0
- package/dist/hooks/project-memory/__tests__/storage.test.js.map +1 -1
- package/dist/hooks/project-memory/storage.d.ts +1 -1
- package/dist/hooks/project-memory/storage.d.ts.map +1 -1
- package/dist/hooks/project-memory/storage.js +5 -4
- 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 +1 -1
- package/dist/hooks/ralph/index.js.map +1 -1
- package/dist/hooks/ralph/loop.d.ts +18 -0
- package/dist/hooks/ralph/loop.d.ts.map +1 -1
- package/dist/hooks/ralph/loop.js +31 -0
- package/dist/hooks/ralph/loop.js.map +1 -1
- package/dist/hooks/ralph/verifier.d.ts +4 -1
- package/dist/hooks/ralph/verifier.d.ts.map +1 -1
- package/dist/hooks/ralph/verifier.js +56 -21
- package/dist/hooks/ralph/verifier.js.map +1 -1
- package/dist/hooks/recovery/__tests__/storage.test.d.ts +2 -0
- package/dist/hooks/recovery/__tests__/storage.test.d.ts.map +1 -0
- package/dist/hooks/recovery/__tests__/storage.test.js +65 -0
- package/dist/hooks/recovery/__tests__/storage.test.js.map +1 -0
- package/dist/hooks/recovery/storage.d.ts +5 -1
- package/dist/hooks/recovery/storage.d.ts.map +1 -1
- package/dist/hooks/recovery/storage.js +7 -29
- package/dist/hooks/recovery/storage.js.map +1 -1
- package/dist/hooks/recovery/types.d.ts +1 -1
- package/dist/hooks/recovery/types.d.ts.map +1 -1
- package/dist/hooks/session-end/__tests__/duplicate-notifications.test.d.ts +2 -0
- package/dist/hooks/session-end/__tests__/duplicate-notifications.test.d.ts.map +1 -0
- package/dist/hooks/session-end/__tests__/duplicate-notifications.test.js +140 -0
- package/dist/hooks/session-end/__tests__/duplicate-notifications.test.js.map +1 -0
- package/dist/hooks/session-end/__tests__/mode-state-cleanup.test.d.ts +2 -0
- package/dist/hooks/session-end/__tests__/mode-state-cleanup.test.d.ts.map +1 -0
- package/dist/hooks/session-end/__tests__/mode-state-cleanup.test.js +122 -0
- package/dist/hooks/session-end/__tests__/mode-state-cleanup.test.js.map +1 -0
- package/dist/hooks/session-end/__tests__/openclaw-session-end.test.js +38 -12
- package/dist/hooks/session-end/__tests__/openclaw-session-end.test.js.map +1 -1
- package/dist/hooks/session-end/callbacks.d.ts +4 -1
- package/dist/hooks/session-end/callbacks.d.ts.map +1 -1
- package/dist/hooks/session-end/callbacks.js +5 -4
- package/dist/hooks/session-end/callbacks.js.map +1 -1
- package/dist/hooks/session-end/index.d.ts.map +1 -1
- package/dist/hooks/session-end/index.js +162 -36
- package/dist/hooks/session-end/index.js.map +1 -1
- package/dist/hooks/skill-state/__tests__/skill-state.test.js +35 -33
- package/dist/hooks/skill-state/__tests__/skill-state.test.js.map +1 -1
- package/dist/hooks/skill-state/index.d.ts +3 -3
- package/dist/hooks/skill-state/index.d.ts.map +1 -1
- package/dist/hooks/skill-state/index.js +7 -11
- package/dist/hooks/skill-state/index.js.map +1 -1
- package/dist/hooks/subagent-tracker/index.d.ts.map +1 -1
- package/dist/hooks/subagent-tracker/index.js +22 -0
- package/dist/hooks/subagent-tracker/index.js.map +1 -1
- package/dist/hooks/think-mode/__tests__/index.test.js +20 -20
- package/dist/hooks/think-mode/__tests__/index.test.js.map +1 -1
- package/dist/hooks/think-mode/switcher.d.ts.map +1 -1
- package/dist/hooks/think-mode/switcher.js +13 -10
- package/dist/hooks/think-mode/switcher.js.map +1 -1
- package/dist/hooks/thinking-block-validator/__tests__/index.test.d.ts +2 -0
- package/dist/hooks/thinking-block-validator/__tests__/index.test.d.ts.map +1 -0
- package/dist/hooks/thinking-block-validator/__tests__/index.test.js +56 -0
- package/dist/hooks/thinking-block-validator/__tests__/index.test.js.map +1 -0
- package/dist/hooks/thinking-block-validator/index.d.ts.map +1 -1
- package/dist/hooks/thinking-block-validator/index.js +7 -6
- package/dist/hooks/thinking-block-validator/index.js.map +1 -1
- package/dist/hooks/todo-continuation/index.d.ts +6 -0
- package/dist/hooks/todo-continuation/index.d.ts.map +1 -1
- package/dist/hooks/todo-continuation/index.js +14 -5
- package/dist/hooks/todo-continuation/index.js.map +1 -1
- package/dist/hud/elements/agents.d.ts.map +1 -1
- package/dist/hud/elements/agents.js +8 -14
- package/dist/hud/elements/agents.js.map +1 -1
- package/dist/hud/elements/index.d.ts +1 -0
- package/dist/hud/elements/index.d.ts.map +1 -1
- package/dist/hud/elements/index.js +1 -0
- package/dist/hud/elements/index.js.map +1 -1
- package/dist/hud/elements/limits.d.ts +3 -3
- package/dist/hud/elements/limits.d.ts.map +1 -1
- package/dist/hud/elements/limits.js +26 -18
- package/dist/hud/elements/limits.js.map +1 -1
- package/dist/hud/elements/mission-board.d.ts +2 -0
- package/dist/hud/elements/mission-board.d.ts.map +1 -0
- package/dist/hud/elements/mission-board.js +2 -0
- package/dist/hud/elements/mission-board.js.map +1 -0
- package/dist/hud/index.d.ts +1 -1
- package/dist/hud/index.d.ts.map +1 -1
- package/dist/hud/index.js +10 -2
- package/dist/hud/index.js.map +1 -1
- package/dist/hud/mission-board.d.ts +75 -0
- package/dist/hud/mission-board.d.ts.map +1 -0
- package/dist/hud/mission-board.js +420 -0
- package/dist/hud/mission-board.js.map +1 -0
- package/dist/hud/render.d.ts.map +1 -1
- package/dist/hud/render.js +16 -8
- package/dist/hud/render.js.map +1 -1
- package/dist/hud/state.d.ts.map +1 -1
- package/dist/hud/state.js +13 -0
- package/dist/hud/state.js.map +1 -1
- package/dist/hud/types.d.ts +11 -0
- package/dist/hud/types.d.ts.map +1 -1
- package/dist/hud/types.js +10 -0
- package/dist/hud/types.js.map +1 -1
- package/dist/hud/usage-api.d.ts +1 -1
- package/dist/hud/usage-api.d.ts.map +1 -1
- package/dist/hud/usage-api.js +207 -106
- package/dist/hud/usage-api.js.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -3
- package/dist/index.js.map +1 -1
- package/dist/installer/__tests__/claude-md-merge.test.js +53 -9
- package/dist/installer/__tests__/claude-md-merge.test.js.map +1 -1
- package/dist/installer/__tests__/hook-templates.test.d.ts +2 -0
- package/dist/installer/__tests__/hook-templates.test.d.ts.map +1 -0
- package/dist/installer/__tests__/hook-templates.test.js +76 -0
- package/dist/installer/__tests__/hook-templates.test.js.map +1 -0
- package/dist/installer/hooks.d.ts +15 -0
- package/dist/installer/hooks.d.ts.map +1 -1
- package/dist/installer/hooks.js +51 -0
- package/dist/installer/hooks.js.map +1 -1
- package/dist/installer/index.d.ts +25 -0
- package/dist/installer/index.d.ts.map +1 -1
- package/dist/installer/index.js +273 -64
- package/dist/installer/index.js.map +1 -1
- package/dist/lib/mode-names.d.ts.map +1 -1
- package/dist/lib/mode-names.js +2 -0
- package/dist/lib/mode-names.js.map +1 -1
- package/dist/mcp/__tests__/team-server-artifact-convergence.test.js +30 -3
- package/dist/mcp/__tests__/team-server-artifact-convergence.test.js.map +1 -1
- package/dist/mcp/__tests__/team-server-deprecation.test.js +2 -0
- package/dist/mcp/__tests__/team-server-deprecation.test.js.map +1 -1
- package/dist/mcp/team-job-convergence.d.ts.map +1 -1
- package/dist/mcp/team-job-convergence.js +12 -3
- package/dist/mcp/team-job-convergence.js.map +1 -1
- package/dist/mcp/team-server.d.ts.map +1 -1
- package/dist/mcp/team-server.js +18 -4
- package/dist/mcp/team-server.js.map +1 -1
- package/dist/notifications/__tests__/config-merge.test.js +36 -1
- package/dist/notifications/__tests__/config-merge.test.js.map +1 -1
- package/dist/notifications/__tests__/formatter.test.js +13 -5
- package/dist/notifications/__tests__/formatter.test.js.map +1 -1
- package/dist/notifications/__tests__/notify-registry-integration.test.js +27 -1
- package/dist/notifications/__tests__/notify-registry-integration.test.js.map +1 -1
- package/dist/notifications/__tests__/verbosity.test.js +33 -1
- package/dist/notifications/__tests__/verbosity.test.js.map +1 -1
- package/dist/notifications/config.d.ts +7 -0
- package/dist/notifications/config.d.ts.map +1 -1
- package/dist/notifications/config.js +18 -0
- package/dist/notifications/config.js.map +1 -1
- package/dist/notifications/formatter.d.ts +2 -2
- package/dist/notifications/formatter.d.ts.map +1 -1
- package/dist/notifications/formatter.js +7 -6
- package/dist/notifications/formatter.js.map +1 -1
- package/dist/notifications/index.d.ts +1 -1
- package/dist/notifications/index.d.ts.map +1 -1
- package/dist/notifications/index.js +5 -3
- package/dist/notifications/index.js.map +1 -1
- package/dist/notifications/template-engine.js +1 -1
- package/dist/notifications/template-engine.js.map +1 -1
- package/dist/notifications/types.d.ts +4 -0
- package/dist/notifications/types.d.ts.map +1 -1
- package/dist/openclaw/__tests__/dispatcher.test.js +26 -0
- package/dist/openclaw/__tests__/dispatcher.test.js.map +1 -1
- package/dist/openclaw/__tests__/index.test.js +42 -0
- package/dist/openclaw/__tests__/index.test.js.map +1 -1
- package/dist/openclaw/__tests__/signal.test.d.ts +2 -0
- package/dist/openclaw/__tests__/signal.test.d.ts.map +1 -0
- package/dist/openclaw/__tests__/signal.test.js +69 -0
- package/dist/openclaw/__tests__/signal.test.js.map +1 -0
- package/dist/openclaw/dispatcher.d.ts +5 -1
- package/dist/openclaw/dispatcher.d.ts.map +1 -1
- package/dist/openclaw/dispatcher.js +13 -2
- package/dist/openclaw/dispatcher.js.map +1 -1
- package/dist/openclaw/index.d.ts +2 -1
- package/dist/openclaw/index.d.ts.map +1 -1
- package/dist/openclaw/index.js +29 -15
- package/dist/openclaw/index.js.map +1 -1
- package/dist/openclaw/signal.d.ts +3 -0
- package/dist/openclaw/signal.d.ts.map +1 -0
- package/dist/openclaw/signal.js +215 -0
- package/dist/openclaw/signal.js.map +1 -0
- package/dist/openclaw/types.d.ts +35 -0
- package/dist/openclaw/types.d.ts.map +1 -1
- package/dist/shared/types.d.ts +2 -12
- package/dist/shared/types.d.ts.map +1 -1
- package/dist/skills/__tests__/mingw-escape.test.js +41 -11
- package/dist/skills/__tests__/mingw-escape.test.js.map +1 -1
- package/dist/team/__tests__/api-interop.cwd-resolution.test.d.ts +2 -0
- package/dist/team/__tests__/api-interop.cwd-resolution.test.d.ts.map +1 -0
- package/dist/team/__tests__/api-interop.cwd-resolution.test.js +78 -0
- package/dist/team/__tests__/api-interop.cwd-resolution.test.js.map +1 -0
- package/dist/team/__tests__/api-interop.dispatch.test.d.ts +2 -0
- package/dist/team/__tests__/api-interop.dispatch.test.d.ts.map +1 -0
- package/dist/team/__tests__/api-interop.dispatch.test.js +125 -0
- package/dist/team/__tests__/api-interop.dispatch.test.js.map +1 -0
- package/dist/team/__tests__/cli-detection.test.d.ts +2 -0
- package/dist/team/__tests__/cli-detection.test.d.ts.map +1 -0
- package/dist/team/__tests__/cli-detection.test.js +36 -0
- package/dist/team/__tests__/cli-detection.test.js.map +1 -0
- package/dist/team/__tests__/model-contract.test.js +79 -2
- package/dist/team/__tests__/model-contract.test.js.map +1 -1
- package/dist/team/__tests__/runtime-done-recovery.test.js +1 -0
- package/dist/team/__tests__/runtime-done-recovery.test.js.map +1 -1
- package/dist/team/__tests__/runtime-prompt-mode.test.js +84 -8
- package/dist/team/__tests__/runtime-prompt-mode.test.js.map +1 -1
- package/dist/team/__tests__/runtime-v2.dispatch.test.d.ts +2 -0
- package/dist/team/__tests__/runtime-v2.dispatch.test.d.ts.map +1 -0
- package/dist/team/__tests__/runtime-v2.dispatch.test.js +237 -0
- package/dist/team/__tests__/runtime-v2.dispatch.test.js.map +1 -0
- package/dist/team/__tests__/runtime-v2.monitor.test.d.ts +2 -0
- package/dist/team/__tests__/runtime-v2.monitor.test.d.ts.map +1 -0
- package/dist/team/__tests__/runtime-v2.monitor.test.js +103 -0
- package/dist/team/__tests__/runtime-v2.monitor.test.js.map +1 -0
- package/dist/team/__tests__/runtime-v2.shutdown.test.d.ts +2 -0
- package/dist/team/__tests__/runtime-v2.shutdown.test.d.ts.map +1 -0
- package/dist/team/__tests__/runtime-v2.shutdown.test.js +49 -0
- package/dist/team/__tests__/runtime-v2.shutdown.test.js.map +1 -0
- package/dist/team/__tests__/runtime-watchdog-retry.test.js +3 -0
- package/dist/team/__tests__/runtime-watchdog-retry.test.js.map +1 -1
- package/dist/team/__tests__/tmux-session.create-team.test.js +29 -12
- package/dist/team/__tests__/tmux-session.create-team.test.js.map +1 -1
- package/dist/team/__tests__/tmux-session.kill-team-session.test.js +6 -0
- package/dist/team/__tests__/tmux-session.kill-team-session.test.js.map +1 -1
- package/dist/team/__tests__/tmux-session.test.js +9 -0
- package/dist/team/__tests__/tmux-session.test.js.map +1 -1
- package/dist/team/__tests__/worker-bootstrap.test.js +32 -3
- package/dist/team/__tests__/worker-bootstrap.test.js.map +1 -1
- package/dist/team/api-interop.d.ts.map +1 -1
- package/dist/team/api-interop.js +153 -2
- package/dist/team/api-interop.js.map +1 -1
- package/dist/team/cli-detection.d.ts.map +1 -1
- package/dist/team/cli-detection.js +6 -2
- package/dist/team/cli-detection.js.map +1 -1
- package/dist/team/idle-nudge.js +1 -1
- package/dist/team/idle-nudge.js.map +1 -1
- package/dist/team/mcp-team-bridge.d.ts.map +1 -1
- package/dist/team/mcp-team-bridge.js +2 -1
- package/dist/team/mcp-team-bridge.js.map +1 -1
- package/dist/team/model-contract.d.ts +1 -1
- package/dist/team/model-contract.d.ts.map +1 -1
- package/dist/team/model-contract.js +35 -4
- package/dist/team/model-contract.js.map +1 -1
- package/dist/team/runtime-cli.d.ts.map +1 -1
- package/dist/team/runtime-cli.js +10 -7
- package/dist/team/runtime-cli.js.map +1 -1
- package/dist/team/runtime-v2.d.ts +4 -0
- package/dist/team/runtime-v2.d.ts.map +1 -1
- package/dist/team/runtime-v2.js +231 -59
- package/dist/team/runtime-v2.js.map +1 -1
- package/dist/team/runtime.d.ts +6 -1
- package/dist/team/runtime.d.ts.map +1 -1
- package/dist/team/runtime.js +39 -14
- package/dist/team/runtime.js.map +1 -1
- package/dist/team/tmux-session.d.ts +20 -11
- package/dist/team/tmux-session.d.ts.map +1 -1
- package/dist/team/tmux-session.js +108 -51
- package/dist/team/tmux-session.js.map +1 -1
- package/dist/team/types.d.ts +1 -0
- package/dist/team/types.d.ts.map +1 -1
- package/dist/team/types.js.map +1 -1
- package/dist/team/worker-bootstrap.d.ts +2 -0
- package/dist/team/worker-bootstrap.d.ts.map +1 -1
- package/dist/team/worker-bootstrap.js +46 -12
- package/dist/team/worker-bootstrap.js.map +1 -1
- package/dist/tools/__tests__/memory-tools.test.js +29 -1
- package/dist/tools/__tests__/memory-tools.test.js.map +1 -1
- package/dist/tools/lsp/client.d.ts +11 -0
- package/dist/tools/lsp/client.d.ts.map +1 -1
- package/dist/tools/lsp/client.js +46 -0
- package/dist/tools/lsp/client.js.map +1 -1
- package/dist/tools/session-history-tools.d.ts +23 -0
- package/dist/tools/session-history-tools.d.ts.map +1 -0
- package/dist/tools/session-history-tools.js +41 -0
- package/dist/tools/session-history-tools.js.map +1 -0
- package/dist/tools/trace-tools.d.ts +9 -0
- package/dist/tools/trace-tools.d.ts.map +1 -1
- package/dist/tools/trace-tools.js +2 -1
- package/dist/tools/trace-tools.js.map +1 -1
- package/dist/utils/frontmatter.d.ts +5 -0
- package/dist/utils/frontmatter.d.ts.map +1 -1
- package/dist/utils/frontmatter.js +22 -0
- package/dist/utils/frontmatter.js.map +1 -1
- package/dist/utils/skill-pipeline.d.ts +9 -0
- package/dist/utils/skill-pipeline.d.ts.map +1 -0
- package/dist/utils/skill-pipeline.js +97 -0
- package/dist/utils/skill-pipeline.js.map +1 -0
- package/docs/AGENTS.md +1 -1
- package/docs/ANALYTICS-SYSTEM.md +23 -132
- package/docs/CLAUDE.md +40 -139
- package/docs/MIGRATION.md +4 -4
- package/docs/OPENCLAW-ROUTING.md +102 -0
- package/docs/PERFORMANCE-MONITORING.md +30 -55
- package/docs/REFERENCE.md +62 -35
- package/docs/TIERED_AGENTS_V2.md +3 -2
- package/docs/design/SKILL_AUDIT_1445.md +75 -0
- package/docs/ko/MIGRATION.md +2 -2
- package/docs/ko/REFERENCE.md +14 -22
- package/docs/partials/agent-tiers.md +11 -15
- package/docs/partials/features.md +2 -2
- package/docs/partials/mode-selection-guide.md +2 -2
- package/docs/shared/agent-tiers.md +11 -15
- package/docs/shared/features.md +2 -2
- package/docs/shared/mode-selection-guide.md +2 -2
- package/package.json +4 -1
- package/scripts/code-simplifier.mjs +1 -1
- package/scripts/context-guard-stop.mjs +26 -10
- package/scripts/keyword-detector.mjs +99 -39
- package/scripts/persistent-mode.cjs +295 -34
- package/scripts/persistent-mode.mjs +79 -21
- package/scripts/plugin-setup.mjs +10 -1
- package/scripts/post-tool-verifier.mjs +57 -3
- package/scripts/pre-tool-enforcer.mjs +207 -2
- package/scripts/run-provider-advisor.js +30 -3
- package/scripts/session-start.mjs +3 -3
- package/scripts/setup-claude-md.sh +159 -0
- package/scripts/setup-progress.sh +123 -0
- package/scripts/sync-metadata.ts +11 -1
- package/skills/AGENTS.md +13 -17
- package/skills/ai-slop-cleaner/SKILL.md +130 -0
- package/skills/ask/SKILL.md +51 -0
- package/skills/ccg/SKILL.md +6 -6
- package/skills/deep-interview/SKILL.md +4 -0
- package/skills/omc-doctor/SKILL.md +2 -2
- package/skills/omc-setup/SKILL.md +75 -1206
- package/skills/omc-setup/phases/01-install-claude-md.md +76 -0
- package/skills/omc-setup/phases/02-configure.md +211 -0
- package/skills/omc-setup/phases/03-integrations.md +192 -0
- package/skills/omc-setup/phases/04-welcome.md +192 -0
- package/skills/omc-teams/SKILL.md +35 -2
- package/skills/plan/SKILL.md +3 -0
- package/skills/ralph/SKILL.md +16 -10
- package/skills/release/SKILL.md +4 -0
- package/skills/setup/SKILL.md +40 -0
- package/skills/team/SKILL.md +6 -6
- package/templates/hooks/code-simplifier.mjs +1 -1
- package/templates/hooks/keyword-detector.mjs +100 -32
- package/templates/hooks/persistent-mode.mjs +43 -4
- package/templates/hooks/pre-tool-use.mjs +115 -1
- package/templates/hooks/session-start.mjs +1 -1
- package/agents/build-fixer.md +0 -90
- package/agents/deep-executor.md +0 -112
- package/agents/harsh-critic.md +0 -254
- package/agents/quality-reviewer.md +0 -151
- package/skills/analyze/SKILL.md +0 -87
- package/skills/ask-codex/SKILL.md +0 -47
- package/skills/ask-gemini/SKILL.md +0 -47
- package/skills/build-fix/SKILL.md +0 -123
- package/skills/code-review/SKILL.md +0 -573
- package/skills/configure-openclaw/SKILL.md +0 -383
- package/skills/learn-about-omc/SKILL.md +0 -37
- package/skills/note/SKILL.md +0 -62
- package/skills/omc-help/SKILL.md +0 -192
- package/skills/ralph-init/SKILL.md +0 -40
- package/skills/security-review/SKILL.md +0 -282
- package/skills/tdd/SKILL.md +0 -104
- package/skills/trace/SKILL.md +0 -33
package/bridge/mcp-server.cjs
CHANGED
|
@@ -2245,8 +2245,8 @@ var require_resolve = __commonJS({
|
|
|
2245
2245
|
}
|
|
2246
2246
|
return count;
|
|
2247
2247
|
}
|
|
2248
|
-
function getFullPath(resolver, id = "",
|
|
2249
|
-
if (
|
|
2248
|
+
function getFullPath(resolver, id = "", normalize3) {
|
|
2249
|
+
if (normalize3 !== false)
|
|
2250
2250
|
id = normalizeId(id);
|
|
2251
2251
|
const p = resolver.parse(id);
|
|
2252
2252
|
return _getFullPath(resolver, p);
|
|
@@ -2994,7 +2994,7 @@ var require_compile = __commonJS({
|
|
|
2994
2994
|
const schOrFunc = root.refs[ref];
|
|
2995
2995
|
if (schOrFunc)
|
|
2996
2996
|
return schOrFunc;
|
|
2997
|
-
let _sch =
|
|
2997
|
+
let _sch = resolve6.call(this, root, ref);
|
|
2998
2998
|
if (_sch === void 0) {
|
|
2999
2999
|
const schema = (_a = root.localRefs) === null || _a === void 0 ? void 0 : _a[ref];
|
|
3000
3000
|
const { schemaId } = this.opts;
|
|
@@ -3021,7 +3021,7 @@ var require_compile = __commonJS({
|
|
|
3021
3021
|
function sameSchemaEnv(s1, s2) {
|
|
3022
3022
|
return s1.schema === s2.schema && s1.root === s2.root && s1.baseId === s2.baseId;
|
|
3023
3023
|
}
|
|
3024
|
-
function
|
|
3024
|
+
function resolve6(root, ref) {
|
|
3025
3025
|
let sch;
|
|
3026
3026
|
while (typeof (sch = this.refs[ref]) == "string")
|
|
3027
3027
|
ref = sch;
|
|
@@ -3586,7 +3586,7 @@ var require_fast_uri = __commonJS({
|
|
|
3586
3586
|
"use strict";
|
|
3587
3587
|
var { normalizeIPv6, removeDotSegments, recomposeAuthority, normalizeComponentEncoding, isIPv4, nonSimpleDomain } = require_utils();
|
|
3588
3588
|
var { SCHEMES, getSchemeHandler } = require_schemes();
|
|
3589
|
-
function
|
|
3589
|
+
function normalize3(uri, options) {
|
|
3590
3590
|
if (typeof uri === "string") {
|
|
3591
3591
|
uri = /** @type {T} */
|
|
3592
3592
|
serialize(parse5(uri, options), options);
|
|
@@ -3596,7 +3596,7 @@ var require_fast_uri = __commonJS({
|
|
|
3596
3596
|
}
|
|
3597
3597
|
return uri;
|
|
3598
3598
|
}
|
|
3599
|
-
function
|
|
3599
|
+
function resolve6(baseURI, relativeURI, options) {
|
|
3600
3600
|
const schemelessOptions = options ? Object.assign({ scheme: "null" }, options) : { scheme: "null" };
|
|
3601
3601
|
const resolved = resolveComponent(parse5(baseURI, schemelessOptions), parse5(relativeURI, schemelessOptions), schemelessOptions, true);
|
|
3602
3602
|
schemelessOptions.skipEscape = true;
|
|
@@ -3822,8 +3822,8 @@ var require_fast_uri = __commonJS({
|
|
|
3822
3822
|
}
|
|
3823
3823
|
var fastUri = {
|
|
3824
3824
|
SCHEMES,
|
|
3825
|
-
normalize:
|
|
3826
|
-
resolve:
|
|
3825
|
+
normalize: normalize3,
|
|
3826
|
+
resolve: resolve6,
|
|
3827
3827
|
resolveComponent,
|
|
3828
3828
|
equal,
|
|
3829
3829
|
serialize,
|
|
@@ -16665,7 +16665,7 @@ var Protocol = class {
|
|
|
16665
16665
|
return;
|
|
16666
16666
|
}
|
|
16667
16667
|
const pollInterval = task2.pollInterval ?? this._options?.defaultTaskPollInterval ?? 1e3;
|
|
16668
|
-
await new Promise((
|
|
16668
|
+
await new Promise((resolve6) => setTimeout(resolve6, pollInterval));
|
|
16669
16669
|
options?.signal?.throwIfAborted();
|
|
16670
16670
|
}
|
|
16671
16671
|
} catch (error2) {
|
|
@@ -16682,7 +16682,7 @@ var Protocol = class {
|
|
|
16682
16682
|
*/
|
|
16683
16683
|
request(request, resultSchema, options) {
|
|
16684
16684
|
const { relatedRequestId, resumptionToken, onresumptiontoken, task, relatedTask } = options ?? {};
|
|
16685
|
-
return new Promise((
|
|
16685
|
+
return new Promise((resolve6, reject) => {
|
|
16686
16686
|
const earlyReject = (error2) => {
|
|
16687
16687
|
reject(error2);
|
|
16688
16688
|
};
|
|
@@ -16760,7 +16760,7 @@ var Protocol = class {
|
|
|
16760
16760
|
if (!parseResult.success) {
|
|
16761
16761
|
reject(parseResult.error);
|
|
16762
16762
|
} else {
|
|
16763
|
-
|
|
16763
|
+
resolve6(parseResult.data);
|
|
16764
16764
|
}
|
|
16765
16765
|
} catch (error2) {
|
|
16766
16766
|
reject(error2);
|
|
@@ -17021,12 +17021,12 @@ var Protocol = class {
|
|
|
17021
17021
|
}
|
|
17022
17022
|
} catch {
|
|
17023
17023
|
}
|
|
17024
|
-
return new Promise((
|
|
17024
|
+
return new Promise((resolve6, reject) => {
|
|
17025
17025
|
if (signal.aborted) {
|
|
17026
17026
|
reject(new McpError(ErrorCode.InvalidRequest, "Request cancelled"));
|
|
17027
17027
|
return;
|
|
17028
17028
|
}
|
|
17029
|
-
const timeoutId = setTimeout(
|
|
17029
|
+
const timeoutId = setTimeout(resolve6, interval);
|
|
17030
17030
|
signal.addEventListener("abort", () => {
|
|
17031
17031
|
clearTimeout(timeoutId);
|
|
17032
17032
|
reject(new McpError(ErrorCode.InvalidRequest, "Request cancelled"));
|
|
@@ -17755,12 +17755,12 @@ var StdioServerTransport = class {
|
|
|
17755
17755
|
this.onclose?.();
|
|
17756
17756
|
}
|
|
17757
17757
|
send(message) {
|
|
17758
|
-
return new Promise((
|
|
17758
|
+
return new Promise((resolve6) => {
|
|
17759
17759
|
const json = serializeMessage(message);
|
|
17760
17760
|
if (this._stdout.write(json)) {
|
|
17761
|
-
|
|
17761
|
+
resolve6();
|
|
17762
17762
|
} else {
|
|
17763
|
-
this._stdout.once("drain",
|
|
17763
|
+
this._stdout.once("drain", resolve6);
|
|
17764
17764
|
}
|
|
17765
17765
|
});
|
|
17766
17766
|
}
|
|
@@ -17964,7 +17964,7 @@ var LspClient = class {
|
|
|
17964
17964
|
Install with: ${this.serverConfig.installHint}`
|
|
17965
17965
|
);
|
|
17966
17966
|
}
|
|
17967
|
-
return new Promise((
|
|
17967
|
+
return new Promise((resolve6, reject) => {
|
|
17968
17968
|
this.process = (0, import_child_process2.spawn)(this.serverConfig.command, this.serverConfig.args, {
|
|
17969
17969
|
cwd: this.workspaceRoot,
|
|
17970
17970
|
stdio: ["pipe", "pipe", "pipe"],
|
|
@@ -17991,10 +17991,24 @@ Install with: ${this.serverConfig.installHint}`
|
|
|
17991
17991
|
});
|
|
17992
17992
|
this.initialize().then(() => {
|
|
17993
17993
|
this.initialized = true;
|
|
17994
|
-
|
|
17994
|
+
resolve6();
|
|
17995
17995
|
}).catch(reject);
|
|
17996
17996
|
});
|
|
17997
17997
|
}
|
|
17998
|
+
/**
|
|
17999
|
+
* Synchronously kill the LSP server process.
|
|
18000
|
+
* Used in process exit handlers where async operations are not possible.
|
|
18001
|
+
*/
|
|
18002
|
+
forceKill() {
|
|
18003
|
+
if (this.process) {
|
|
18004
|
+
try {
|
|
18005
|
+
this.process.kill("SIGKILL");
|
|
18006
|
+
} catch {
|
|
18007
|
+
}
|
|
18008
|
+
this.process = null;
|
|
18009
|
+
this.initialized = false;
|
|
18010
|
+
}
|
|
18011
|
+
}
|
|
17998
18012
|
/**
|
|
17999
18013
|
* Disconnect from the LSP server
|
|
18000
18014
|
*/
|
|
@@ -18103,13 +18117,13 @@ Install with: ${this.serverConfig.installHint}`
|
|
|
18103
18117
|
const message = `Content-Length: ${Buffer.byteLength(content)}\r
|
|
18104
18118
|
\r
|
|
18105
18119
|
${content}`;
|
|
18106
|
-
return new Promise((
|
|
18120
|
+
return new Promise((resolve6, reject) => {
|
|
18107
18121
|
const timeoutHandle = setTimeout(() => {
|
|
18108
18122
|
this.pendingRequests.delete(id);
|
|
18109
18123
|
reject(new Error(`LSP request '${method}' timed out after ${timeout}ms`));
|
|
18110
18124
|
}, timeout);
|
|
18111
18125
|
this.pendingRequests.set(id, {
|
|
18112
|
-
resolve:
|
|
18126
|
+
resolve: resolve6,
|
|
18113
18127
|
reject,
|
|
18114
18128
|
timeout: timeoutHandle
|
|
18115
18129
|
});
|
|
@@ -18178,7 +18192,7 @@ ${content}`;
|
|
|
18178
18192
|
}
|
|
18179
18193
|
});
|
|
18180
18194
|
this.openDocuments.add(uri);
|
|
18181
|
-
await new Promise((
|
|
18195
|
+
await new Promise((resolve6) => setTimeout(resolve6, 100));
|
|
18182
18196
|
}
|
|
18183
18197
|
/**
|
|
18184
18198
|
* Close a document
|
|
@@ -18309,13 +18323,13 @@ ${content}`;
|
|
|
18309
18323
|
if (this.diagnostics.has(uri)) {
|
|
18310
18324
|
return Promise.resolve();
|
|
18311
18325
|
}
|
|
18312
|
-
return new Promise((
|
|
18326
|
+
return new Promise((resolve6) => {
|
|
18313
18327
|
let resolved = false;
|
|
18314
18328
|
const timer = setTimeout(() => {
|
|
18315
18329
|
if (!resolved) {
|
|
18316
18330
|
resolved = true;
|
|
18317
18331
|
this.diagnosticWaiters.delete(uri);
|
|
18318
|
-
|
|
18332
|
+
resolve6();
|
|
18319
18333
|
}
|
|
18320
18334
|
}, timeoutMs);
|
|
18321
18335
|
const existing = this.diagnosticWaiters.get(uri) || [];
|
|
@@ -18323,7 +18337,7 @@ ${content}`;
|
|
|
18323
18337
|
if (!resolved) {
|
|
18324
18338
|
resolved = true;
|
|
18325
18339
|
clearTimeout(timer);
|
|
18326
|
-
|
|
18340
|
+
resolve6();
|
|
18327
18341
|
}
|
|
18328
18342
|
});
|
|
18329
18343
|
this.diagnosticWaiters.set(uri, existing);
|
|
@@ -18377,6 +18391,32 @@ var LspClientManager = class {
|
|
|
18377
18391
|
idleTimer = null;
|
|
18378
18392
|
constructor() {
|
|
18379
18393
|
this.startIdleCheck();
|
|
18394
|
+
this.registerCleanupHandlers();
|
|
18395
|
+
}
|
|
18396
|
+
/**
|
|
18397
|
+
* Register process exit/signal handlers to kill all spawned LSP server processes.
|
|
18398
|
+
* Prevents orphaned language server processes (e.g. kotlin-language-server)
|
|
18399
|
+
* when the MCP bridge process exits or a claude session ends.
|
|
18400
|
+
*/
|
|
18401
|
+
registerCleanupHandlers() {
|
|
18402
|
+
const forceKillAll = () => {
|
|
18403
|
+
for (const client of this.clients.values()) {
|
|
18404
|
+
try {
|
|
18405
|
+
client.forceKill();
|
|
18406
|
+
} catch {
|
|
18407
|
+
}
|
|
18408
|
+
}
|
|
18409
|
+
this.clients.clear();
|
|
18410
|
+
this.lastUsed.clear();
|
|
18411
|
+
this.inFlightCount.clear();
|
|
18412
|
+
};
|
|
18413
|
+
process.on("exit", forceKillAll);
|
|
18414
|
+
for (const sig of ["SIGTERM", "SIGINT", "SIGHUP"]) {
|
|
18415
|
+
process.on(sig, () => {
|
|
18416
|
+
forceKillAll();
|
|
18417
|
+
process.exit(0);
|
|
18418
|
+
});
|
|
18419
|
+
}
|
|
18380
18420
|
}
|
|
18381
18421
|
/**
|
|
18382
18422
|
* Get or create a client for a file
|
|
@@ -19069,7 +19109,7 @@ var lspDiagnosticsTool = {
|
|
|
19069
19109
|
const { file, severity } = args;
|
|
19070
19110
|
return withLspClient(file, "diagnostics", async (client) => {
|
|
19071
19111
|
await client.openDocument(file);
|
|
19072
|
-
await new Promise((
|
|
19112
|
+
await new Promise((resolve6) => setTimeout(resolve6, LSP_DIAGNOSTICS_WAIT_MS));
|
|
19073
19113
|
let diagnostics = client.getDiagnostics(file);
|
|
19074
19114
|
if (severity) {
|
|
19075
19115
|
const severityMap = {
|
|
@@ -20396,7 +20436,7 @@ var SessionLock = class {
|
|
|
20396
20436
|
}
|
|
20397
20437
|
};
|
|
20398
20438
|
function sleep(ms) {
|
|
20399
|
-
return new Promise((
|
|
20439
|
+
return new Promise((resolve6) => setTimeout(resolve6, ms));
|
|
20400
20440
|
}
|
|
20401
20441
|
|
|
20402
20442
|
// src/tools/python-repl/socket-client.ts
|
|
@@ -20426,7 +20466,7 @@ var JsonRpcError = class extends Error {
|
|
|
20426
20466
|
}
|
|
20427
20467
|
};
|
|
20428
20468
|
async function sendSocketRequest(socketPath, method, params, timeout = 6e4) {
|
|
20429
|
-
return new Promise((
|
|
20469
|
+
return new Promise((resolve6, reject) => {
|
|
20430
20470
|
const id = (0, import_crypto.randomUUID)();
|
|
20431
20471
|
const request = {
|
|
20432
20472
|
jsonrpc: "2.0",
|
|
@@ -20496,7 +20536,7 @@ async function sendSocketRequest(socketPath, method, params, timeout = 6e4) {
|
|
|
20496
20536
|
));
|
|
20497
20537
|
return;
|
|
20498
20538
|
}
|
|
20499
|
-
|
|
20539
|
+
resolve6(response.result);
|
|
20500
20540
|
} catch (e) {
|
|
20501
20541
|
reject(new Error(
|
|
20502
20542
|
`Failed to parse JSON-RPC response: ${e.message}`
|
|
@@ -20877,7 +20917,7 @@ async function deleteBridgeMeta(sessionId) {
|
|
|
20877
20917
|
}
|
|
20878
20918
|
}
|
|
20879
20919
|
function sleep2(ms) {
|
|
20880
|
-
return new Promise((
|
|
20920
|
+
return new Promise((resolve6) => setTimeout(resolve6, ms));
|
|
20881
20921
|
}
|
|
20882
20922
|
|
|
20883
20923
|
// src/tools/python-repl/tool.ts
|
|
@@ -21478,6 +21518,17 @@ function ensureSessionStateDir(sessionId, worktreeRoot) {
|
|
|
21478
21518
|
}
|
|
21479
21519
|
return sessionDir;
|
|
21480
21520
|
}
|
|
21521
|
+
function resolveToWorktreeRoot(directory) {
|
|
21522
|
+
if (directory) {
|
|
21523
|
+
const resolved = (0, import_path7.resolve)(directory);
|
|
21524
|
+
const root = getWorktreeRoot(resolved);
|
|
21525
|
+
if (root) return root;
|
|
21526
|
+
console.error("[worktree] non-git directory provided, falling back to process root", {
|
|
21527
|
+
directory: resolved
|
|
21528
|
+
});
|
|
21529
|
+
}
|
|
21530
|
+
return getWorktreeRoot(process.cwd()) || process.cwd();
|
|
21531
|
+
}
|
|
21481
21532
|
function validateWorkingDirectory(workingDirectory) {
|
|
21482
21533
|
const trustedRoot = getWorktreeRoot(process.cwd()) || process.cwd();
|
|
21483
21534
|
if (!workingDirectory) {
|
|
@@ -21609,9 +21660,11 @@ var MODE_STATE_FILE_MAP = {
|
|
|
21609
21660
|
};
|
|
21610
21661
|
var SESSION_END_MODE_STATE_FILES = [
|
|
21611
21662
|
{ file: MODE_STATE_FILE_MAP[MODE_NAMES.AUTOPILOT], mode: MODE_NAMES.AUTOPILOT },
|
|
21663
|
+
{ file: MODE_STATE_FILE_MAP[MODE_NAMES.TEAM], mode: MODE_NAMES.TEAM },
|
|
21612
21664
|
{ file: MODE_STATE_FILE_MAP[MODE_NAMES.RALPH], mode: MODE_NAMES.RALPH },
|
|
21613
21665
|
{ file: MODE_STATE_FILE_MAP[MODE_NAMES.ULTRAWORK], mode: MODE_NAMES.ULTRAWORK },
|
|
21614
|
-
{ file: MODE_STATE_FILE_MAP[MODE_NAMES.ULTRAQA], mode: MODE_NAMES.ULTRAQA }
|
|
21666
|
+
{ file: MODE_STATE_FILE_MAP[MODE_NAMES.ULTRAQA], mode: MODE_NAMES.ULTRAQA },
|
|
21667
|
+
{ file: "skill-active-state.json", mode: "skill-active" }
|
|
21615
21668
|
];
|
|
21616
21669
|
var SESSION_METRICS_MODE_FILES = [
|
|
21617
21670
|
{ file: MODE_STATE_FILE_MAP[MODE_NAMES.AUTOPILOT], mode: MODE_NAMES.AUTOPILOT },
|
|
@@ -22633,7 +22686,7 @@ function withFileLockSync(lockPath, fn, opts) {
|
|
|
22633
22686
|
}
|
|
22634
22687
|
}
|
|
22635
22688
|
function sleep3(ms) {
|
|
22636
|
-
return new Promise((
|
|
22689
|
+
return new Promise((resolve6) => setTimeout(resolve6, ms));
|
|
22637
22690
|
}
|
|
22638
22691
|
async function acquireFileLock(lockPath, opts) {
|
|
22639
22692
|
const staleLockMs = opts?.staleLockMs ?? DEFAULT_STALE_LOCK_MS;
|
|
@@ -23324,13 +23377,11 @@ var import_promises = __toESM(require("fs/promises"), 1);
|
|
|
23324
23377
|
var import_path12 = __toESM(require("path"), 1);
|
|
23325
23378
|
|
|
23326
23379
|
// src/hooks/project-memory/constants.ts
|
|
23327
|
-
var MEMORY_FILE = "project-memory.json";
|
|
23328
|
-
var MEMORY_DIR = ".omc";
|
|
23329
23380
|
var CACHE_EXPIRY_MS = 24 * 60 * 60 * 1e3;
|
|
23330
23381
|
|
|
23331
23382
|
// src/hooks/project-memory/storage.ts
|
|
23332
23383
|
function getMemoryPath(projectRoot) {
|
|
23333
|
-
return
|
|
23384
|
+
return getWorktreeProjectMemoryPath(projectRoot);
|
|
23334
23385
|
}
|
|
23335
23386
|
async function loadProjectMemory(projectRoot) {
|
|
23336
23387
|
const memoryPath = getMemoryPath(projectRoot);
|
|
@@ -23346,8 +23397,8 @@ async function loadProjectMemory(projectRoot) {
|
|
|
23346
23397
|
}
|
|
23347
23398
|
}
|
|
23348
23399
|
async function saveProjectMemory(projectRoot, memory) {
|
|
23349
|
-
const omcDir = import_path12.default.join(projectRoot, MEMORY_DIR);
|
|
23350
23400
|
const memoryPath = getMemoryPath(projectRoot);
|
|
23401
|
+
const omcDir = import_path12.default.dirname(memoryPath);
|
|
23351
23402
|
try {
|
|
23352
23403
|
await import_promises.default.mkdir(omcDir, { recursive: true });
|
|
23353
23404
|
await atomicWriteJson(memoryPath, memory);
|
|
@@ -23500,7 +23551,7 @@ function mergeArrays(fieldName, base, incoming) {
|
|
|
23500
23551
|
return mergeScalarArray(base, incoming);
|
|
23501
23552
|
}
|
|
23502
23553
|
}
|
|
23503
|
-
function mergeByKey(base, incoming, keyFn,
|
|
23554
|
+
function mergeByKey(base, incoming, keyFn, resolve6) {
|
|
23504
23555
|
const seen = /* @__PURE__ */ new Map();
|
|
23505
23556
|
for (const item of base) {
|
|
23506
23557
|
seen.set(keyFn(item), item);
|
|
@@ -23509,7 +23560,7 @@ function mergeByKey(base, incoming, keyFn, resolve5) {
|
|
|
23509
23560
|
const key = keyFn(item);
|
|
23510
23561
|
const existing = seen.get(key);
|
|
23511
23562
|
if (existing) {
|
|
23512
|
-
seen.set(key,
|
|
23563
|
+
seen.set(key, resolve6(existing, item));
|
|
23513
23564
|
} else {
|
|
23514
23565
|
seen.set(key, item);
|
|
23515
23566
|
}
|
|
@@ -23750,8 +23801,8 @@ var memoryTools = [
|
|
|
23750
23801
|
];
|
|
23751
23802
|
|
|
23752
23803
|
// src/tools/trace-tools.ts
|
|
23753
|
-
var
|
|
23754
|
-
var
|
|
23804
|
+
var import_fs15 = require("fs");
|
|
23805
|
+
var import_path18 = require("path");
|
|
23755
23806
|
|
|
23756
23807
|
// src/hooks/subagent-tracker/session-replay.ts
|
|
23757
23808
|
var import_fs13 = require("fs");
|
|
@@ -23940,15 +23991,479 @@ function getReplaySummary(directory, sessionId) {
|
|
|
23940
23991
|
return summary;
|
|
23941
23992
|
}
|
|
23942
23993
|
|
|
23994
|
+
// src/features/session-history-search/index.ts
|
|
23995
|
+
var import_child_process9 = require("child_process");
|
|
23996
|
+
var import_fs14 = require("fs");
|
|
23997
|
+
var import_os3 = require("os");
|
|
23998
|
+
var import_path17 = require("path");
|
|
23999
|
+
var import_readline = require("readline");
|
|
24000
|
+
var DEFAULT_LIMIT = 10;
|
|
24001
|
+
var DEFAULT_CONTEXT_CHARS = 120;
|
|
24002
|
+
function getClaudeConfigDir() {
|
|
24003
|
+
return process.env.CLAUDE_CONFIG_DIR || (0, import_path17.join)((0, import_os3.homedir)(), ".claude");
|
|
24004
|
+
}
|
|
24005
|
+
function compactWhitespace(text) {
|
|
24006
|
+
return text.replace(/\s+/g, " ").trim();
|
|
24007
|
+
}
|
|
24008
|
+
function normalizeForSearch(value, caseSensitive) {
|
|
24009
|
+
const compacted = compactWhitespace(value);
|
|
24010
|
+
return caseSensitive ? compacted : compacted.toLowerCase();
|
|
24011
|
+
}
|
|
24012
|
+
function parseSinceSpec(since) {
|
|
24013
|
+
if (!since) return void 0;
|
|
24014
|
+
const trimmed = since.trim();
|
|
24015
|
+
if (!trimmed) return void 0;
|
|
24016
|
+
const durationMatch = trimmed.match(/^(\d+)\s*([mhdw])$/i);
|
|
24017
|
+
if (durationMatch) {
|
|
24018
|
+
const amount = Number.parseInt(durationMatch[1], 10);
|
|
24019
|
+
const unit = durationMatch[2].toLowerCase();
|
|
24020
|
+
const multiplierMap = {
|
|
24021
|
+
m: 6e4,
|
|
24022
|
+
h: 36e5,
|
|
24023
|
+
d: 864e5,
|
|
24024
|
+
w: 6048e5
|
|
24025
|
+
};
|
|
24026
|
+
const multiplier = multiplierMap[unit];
|
|
24027
|
+
return multiplier ? Date.now() - amount * multiplier : void 0;
|
|
24028
|
+
}
|
|
24029
|
+
const parsed = Date.parse(trimmed);
|
|
24030
|
+
return Number.isNaN(parsed) ? void 0 : parsed;
|
|
24031
|
+
}
|
|
24032
|
+
function encodeProjectPath(projectPath) {
|
|
24033
|
+
return projectPath.replace(/[\\/]/g, "-");
|
|
24034
|
+
}
|
|
24035
|
+
function getMainRepoRoot(projectRoot) {
|
|
24036
|
+
try {
|
|
24037
|
+
const gitCommonDir = (0, import_child_process9.execSync)("git rev-parse --git-common-dir", {
|
|
24038
|
+
cwd: projectRoot,
|
|
24039
|
+
encoding: "utf-8",
|
|
24040
|
+
stdio: ["pipe", "pipe", "pipe"]
|
|
24041
|
+
}).trim();
|
|
24042
|
+
const absoluteCommonDir = (0, import_path17.resolve)(projectRoot, gitCommonDir);
|
|
24043
|
+
const mainRepoRoot = (0, import_path17.dirname)(absoluteCommonDir);
|
|
24044
|
+
return mainRepoRoot === projectRoot ? null : mainRepoRoot;
|
|
24045
|
+
} catch {
|
|
24046
|
+
return null;
|
|
24047
|
+
}
|
|
24048
|
+
}
|
|
24049
|
+
function getClaudeWorktreeParent(projectRoot) {
|
|
24050
|
+
const marker = `${(0, import_path17.normalize)("/.claude/worktrees/")}`;
|
|
24051
|
+
const normalizedRoot = (0, import_path17.normalize)(projectRoot);
|
|
24052
|
+
const idx = normalizedRoot.indexOf(marker);
|
|
24053
|
+
if (idx === -1) return null;
|
|
24054
|
+
return normalizedRoot.slice(0, idx) || null;
|
|
24055
|
+
}
|
|
24056
|
+
function listJsonlFiles(rootDir) {
|
|
24057
|
+
if (!(0, import_fs14.existsSync)(rootDir)) {
|
|
24058
|
+
return [];
|
|
24059
|
+
}
|
|
24060
|
+
const files = [];
|
|
24061
|
+
const stack = [rootDir];
|
|
24062
|
+
while (stack.length > 0) {
|
|
24063
|
+
const current = stack.pop();
|
|
24064
|
+
let entries;
|
|
24065
|
+
try {
|
|
24066
|
+
entries = (0, import_fs14.readdirSync)(current, { withFileTypes: true });
|
|
24067
|
+
} catch {
|
|
24068
|
+
continue;
|
|
24069
|
+
}
|
|
24070
|
+
for (const entry of entries) {
|
|
24071
|
+
const fullPath = (0, import_path17.join)(current, entry.name);
|
|
24072
|
+
if (entry.isDirectory()) {
|
|
24073
|
+
stack.push(fullPath);
|
|
24074
|
+
continue;
|
|
24075
|
+
}
|
|
24076
|
+
if (entry.isFile() && (entry.name.endsWith(".jsonl") || entry.name.endsWith(".json"))) {
|
|
24077
|
+
files.push(fullPath);
|
|
24078
|
+
}
|
|
24079
|
+
}
|
|
24080
|
+
}
|
|
24081
|
+
return files;
|
|
24082
|
+
}
|
|
24083
|
+
function uniqueSortedTargets(targets) {
|
|
24084
|
+
const seen = /* @__PURE__ */ new Set();
|
|
24085
|
+
return targets.filter((target) => {
|
|
24086
|
+
const key = `${target.sourceType}:${target.filePath}`;
|
|
24087
|
+
if (seen.has(key)) return false;
|
|
24088
|
+
seen.add(key);
|
|
24089
|
+
return true;
|
|
24090
|
+
}).sort((a, b) => {
|
|
24091
|
+
const aTime = (0, import_fs14.existsSync)(a.filePath) ? (0, import_fs14.statSync)(a.filePath).mtimeMs : 0;
|
|
24092
|
+
const bTime = (0, import_fs14.existsSync)(b.filePath) ? (0, import_fs14.statSync)(b.filePath).mtimeMs : 0;
|
|
24093
|
+
return bTime - aTime;
|
|
24094
|
+
});
|
|
24095
|
+
}
|
|
24096
|
+
function buildCurrentProjectTargets(projectRoot) {
|
|
24097
|
+
const claudeDir = getClaudeConfigDir();
|
|
24098
|
+
const projectRoots = /* @__PURE__ */ new Set([projectRoot]);
|
|
24099
|
+
const mainRepoRoot = getMainRepoRoot(projectRoot);
|
|
24100
|
+
if (mainRepoRoot) projectRoots.add(mainRepoRoot);
|
|
24101
|
+
const claudeWorktreeParent = getClaudeWorktreeParent(projectRoot);
|
|
24102
|
+
if (claudeWorktreeParent) projectRoots.add(claudeWorktreeParent);
|
|
24103
|
+
const targets = [];
|
|
24104
|
+
for (const root of projectRoots) {
|
|
24105
|
+
const encodedDir = (0, import_path17.join)(claudeDir, "projects", encodeProjectPath(root));
|
|
24106
|
+
for (const filePath of listJsonlFiles(encodedDir)) {
|
|
24107
|
+
targets.push({ filePath, sourceType: "project-transcript" });
|
|
24108
|
+
}
|
|
24109
|
+
}
|
|
24110
|
+
const legacyTranscriptsDir = (0, import_path17.join)(claudeDir, "transcripts");
|
|
24111
|
+
for (const filePath of listJsonlFiles(legacyTranscriptsDir)) {
|
|
24112
|
+
targets.push({ filePath, sourceType: "legacy-transcript" });
|
|
24113
|
+
}
|
|
24114
|
+
const omcRoot = getOmcRoot(projectRoot);
|
|
24115
|
+
const sessionSummariesDir = (0, import_path17.join)(omcRoot, "sessions");
|
|
24116
|
+
for (const filePath of listJsonlFiles(sessionSummariesDir)) {
|
|
24117
|
+
targets.push({ filePath, sourceType: "omc-session-summary" });
|
|
24118
|
+
}
|
|
24119
|
+
const replayDir = (0, import_path17.join)(omcRoot, "state");
|
|
24120
|
+
if ((0, import_fs14.existsSync)(replayDir)) {
|
|
24121
|
+
for (const filePath of listJsonlFiles(replayDir)) {
|
|
24122
|
+
if (filePath.includes("agent-replay-") && filePath.endsWith(".jsonl")) {
|
|
24123
|
+
targets.push({ filePath, sourceType: "omc-session-replay" });
|
|
24124
|
+
}
|
|
24125
|
+
}
|
|
24126
|
+
}
|
|
24127
|
+
return uniqueSortedTargets(targets);
|
|
24128
|
+
}
|
|
24129
|
+
function buildAllProjectTargets() {
|
|
24130
|
+
const claudeDir = getClaudeConfigDir();
|
|
24131
|
+
const targets = [];
|
|
24132
|
+
for (const filePath of listJsonlFiles((0, import_path17.join)(claudeDir, "projects"))) {
|
|
24133
|
+
targets.push({ filePath, sourceType: "project-transcript" });
|
|
24134
|
+
}
|
|
24135
|
+
for (const filePath of listJsonlFiles((0, import_path17.join)(claudeDir, "transcripts"))) {
|
|
24136
|
+
targets.push({ filePath, sourceType: "legacy-transcript" });
|
|
24137
|
+
}
|
|
24138
|
+
return uniqueSortedTargets(targets);
|
|
24139
|
+
}
|
|
24140
|
+
function isWithinProject(projectPath, projectRoots) {
|
|
24141
|
+
if (!projectPath) {
|
|
24142
|
+
return false;
|
|
24143
|
+
}
|
|
24144
|
+
const normalizedProjectPath = (0, import_path17.normalize)((0, import_path17.resolve)(projectPath));
|
|
24145
|
+
return projectRoots.some((root) => {
|
|
24146
|
+
const normalizedRoot = (0, import_path17.normalize)((0, import_path17.resolve)(root));
|
|
24147
|
+
return normalizedProjectPath === normalizedRoot || normalizedProjectPath.startsWith(`${normalizedRoot}/`);
|
|
24148
|
+
});
|
|
24149
|
+
}
|
|
24150
|
+
function matchesProjectFilter(projectPath, projectFilter) {
|
|
24151
|
+
if (!projectFilter || projectFilter === "all") {
|
|
24152
|
+
return true;
|
|
24153
|
+
}
|
|
24154
|
+
if (!projectPath) {
|
|
24155
|
+
return false;
|
|
24156
|
+
}
|
|
24157
|
+
return projectPath.toLowerCase().includes(projectFilter.toLowerCase());
|
|
24158
|
+
}
|
|
24159
|
+
function stringLeaves(value, maxLeaves = 24) {
|
|
24160
|
+
const leaves = [];
|
|
24161
|
+
const stack = [value];
|
|
24162
|
+
while (stack.length > 0 && leaves.length < maxLeaves) {
|
|
24163
|
+
const current = stack.pop();
|
|
24164
|
+
if (typeof current === "string") {
|
|
24165
|
+
const compacted = compactWhitespace(current);
|
|
24166
|
+
if (compacted.length > 0) {
|
|
24167
|
+
leaves.push(compacted);
|
|
24168
|
+
}
|
|
24169
|
+
continue;
|
|
24170
|
+
}
|
|
24171
|
+
if (Array.isArray(current)) {
|
|
24172
|
+
stack.push(...current);
|
|
24173
|
+
continue;
|
|
24174
|
+
}
|
|
24175
|
+
if (current && typeof current === "object") {
|
|
24176
|
+
stack.push(...Object.values(current));
|
|
24177
|
+
}
|
|
24178
|
+
}
|
|
24179
|
+
return leaves;
|
|
24180
|
+
}
|
|
24181
|
+
function extractTranscriptTexts(entry) {
|
|
24182
|
+
const texts = [];
|
|
24183
|
+
const message = entry.message;
|
|
24184
|
+
const content = message?.content;
|
|
24185
|
+
if (typeof content === "string") {
|
|
24186
|
+
texts.push(content);
|
|
24187
|
+
} else if (Array.isArray(content)) {
|
|
24188
|
+
for (const block of content) {
|
|
24189
|
+
if (!block || typeof block !== "object") continue;
|
|
24190
|
+
const record2 = block;
|
|
24191
|
+
const blockType = typeof record2.type === "string" ? record2.type : void 0;
|
|
24192
|
+
if ((blockType === "text" || blockType === "thinking" || blockType === "reasoning") && typeof record2.text === "string") {
|
|
24193
|
+
texts.push(record2.text);
|
|
24194
|
+
continue;
|
|
24195
|
+
}
|
|
24196
|
+
if (blockType === "tool_result") {
|
|
24197
|
+
texts.push(...stringLeaves(record2.content));
|
|
24198
|
+
continue;
|
|
24199
|
+
}
|
|
24200
|
+
if (blockType === "tool_use") {
|
|
24201
|
+
const toolName = typeof record2.name === "string" ? record2.name : "tool";
|
|
24202
|
+
const inputText = stringLeaves(record2.input).join(" ");
|
|
24203
|
+
if (inputText) {
|
|
24204
|
+
texts.push(`${toolName} ${inputText}`);
|
|
24205
|
+
}
|
|
24206
|
+
}
|
|
24207
|
+
}
|
|
24208
|
+
}
|
|
24209
|
+
return texts;
|
|
24210
|
+
}
|
|
24211
|
+
function buildTranscriptEntry(entry) {
|
|
24212
|
+
const texts = extractTranscriptTexts(entry);
|
|
24213
|
+
if (texts.length === 0) {
|
|
24214
|
+
return null;
|
|
24215
|
+
}
|
|
24216
|
+
const message = entry.message;
|
|
24217
|
+
const sessionId = typeof entry.sessionId === "string" ? entry.sessionId : typeof entry.session_id === "string" ? entry.session_id : typeof message?.sessionId === "string" ? message.sessionId : void 0;
|
|
24218
|
+
if (!sessionId) {
|
|
24219
|
+
return null;
|
|
24220
|
+
}
|
|
24221
|
+
return {
|
|
24222
|
+
sessionId,
|
|
24223
|
+
agentId: typeof entry.agentId === "string" ? entry.agentId : void 0,
|
|
24224
|
+
timestamp: typeof entry.timestamp === "string" ? entry.timestamp : void 0,
|
|
24225
|
+
projectPath: typeof entry.cwd === "string" ? entry.cwd : void 0,
|
|
24226
|
+
role: typeof message?.role === "string" ? message.role : void 0,
|
|
24227
|
+
entryType: typeof entry.type === "string" ? entry.type : void 0,
|
|
24228
|
+
texts
|
|
24229
|
+
};
|
|
24230
|
+
}
|
|
24231
|
+
function buildJsonArtifactEntry(entry, sourceType) {
|
|
24232
|
+
const sessionId = typeof entry.session_id === "string" ? entry.session_id : typeof entry.sessionId === "string" ? entry.sessionId : void 0;
|
|
24233
|
+
if (!sessionId) {
|
|
24234
|
+
return null;
|
|
24235
|
+
}
|
|
24236
|
+
const texts = stringLeaves(entry);
|
|
24237
|
+
if (texts.length === 0) {
|
|
24238
|
+
return null;
|
|
24239
|
+
}
|
|
24240
|
+
const timestamp = typeof entry.ended_at === "string" ? entry.ended_at : typeof entry.started_at === "string" ? entry.started_at : typeof entry.timestamp === "string" ? entry.timestamp : void 0;
|
|
24241
|
+
const entryType = sourceType === "omc-session-summary" ? "session-summary" : "session-replay";
|
|
24242
|
+
return {
|
|
24243
|
+
sessionId,
|
|
24244
|
+
timestamp,
|
|
24245
|
+
projectPath: typeof entry.cwd === "string" ? entry.cwd : void 0,
|
|
24246
|
+
entryType,
|
|
24247
|
+
texts
|
|
24248
|
+
};
|
|
24249
|
+
}
|
|
24250
|
+
function buildSearchableEntry(entry, sourceType) {
|
|
24251
|
+
if (sourceType === "project-transcript" || sourceType === "legacy-transcript" || sourceType === "omc-session-replay") {
|
|
24252
|
+
return buildTranscriptEntry(entry) ?? (sourceType === "omc-session-replay" ? buildJsonArtifactEntry(entry, sourceType) : null);
|
|
24253
|
+
}
|
|
24254
|
+
if (sourceType === "omc-session-summary") {
|
|
24255
|
+
return buildJsonArtifactEntry(entry, sourceType);
|
|
24256
|
+
}
|
|
24257
|
+
return null;
|
|
24258
|
+
}
|
|
24259
|
+
function findMatchIndex(text, query, caseSensitive) {
|
|
24260
|
+
const haystack = normalizeForSearch(text, caseSensitive);
|
|
24261
|
+
const needle = normalizeForSearch(query, caseSensitive);
|
|
24262
|
+
const directIndex = haystack.indexOf(needle);
|
|
24263
|
+
if (directIndex >= 0) {
|
|
24264
|
+
return directIndex;
|
|
24265
|
+
}
|
|
24266
|
+
const terms = needle.split(/\s+/).filter(Boolean);
|
|
24267
|
+
if (terms.length === 0) return -1;
|
|
24268
|
+
if (terms.every((term) => haystack.includes(term))) {
|
|
24269
|
+
return haystack.indexOf(terms[0]);
|
|
24270
|
+
}
|
|
24271
|
+
return -1;
|
|
24272
|
+
}
|
|
24273
|
+
function createExcerpt(text, matchIndex, contextChars) {
|
|
24274
|
+
const compacted = compactWhitespace(text);
|
|
24275
|
+
if (compacted.length <= contextChars * 2) {
|
|
24276
|
+
return compacted;
|
|
24277
|
+
}
|
|
24278
|
+
const safeIndex = Math.max(0, matchIndex);
|
|
24279
|
+
const start = Math.max(0, safeIndex - contextChars);
|
|
24280
|
+
const end = Math.min(compacted.length, safeIndex + contextChars);
|
|
24281
|
+
const prefix = start > 0 ? "\u2026" : "";
|
|
24282
|
+
const suffix = end < compacted.length ? "\u2026" : "";
|
|
24283
|
+
return `${prefix}${compacted.slice(start, end).trim()}${suffix}`;
|
|
24284
|
+
}
|
|
24285
|
+
function buildScopeMode(project) {
|
|
24286
|
+
if (!project || project === "current") return "current";
|
|
24287
|
+
if (project === "all") return "all";
|
|
24288
|
+
return "project";
|
|
24289
|
+
}
|
|
24290
|
+
async function collectMatchesFromFile(target, options) {
|
|
24291
|
+
const matches = [];
|
|
24292
|
+
const fileMtime = (0, import_fs14.existsSync)(target.filePath) ? (0, import_fs14.statSync)(target.filePath).mtimeMs : 0;
|
|
24293
|
+
if (target.sourceType === "omc-session-summary" && target.filePath.endsWith(".json")) {
|
|
24294
|
+
try {
|
|
24295
|
+
const payload = JSON.parse(await import("fs/promises").then((fs8) => fs8.readFile(target.filePath, "utf-8")));
|
|
24296
|
+
const entry = buildSearchableEntry(payload, target.sourceType);
|
|
24297
|
+
if (!entry) return [];
|
|
24298
|
+
if (options.sessionId && entry.sessionId !== options.sessionId) return [];
|
|
24299
|
+
if (options.projectRoots && options.projectRoots.length > 0 && !isWithinProject(entry.projectPath, options.projectRoots)) return [];
|
|
24300
|
+
if (!matchesProjectFilter(entry.projectPath, options.projectFilter)) return [];
|
|
24301
|
+
const entryEpoch = entry.timestamp ? Date.parse(entry.timestamp) : fileMtime;
|
|
24302
|
+
if (options.sinceEpoch && Number.isFinite(entryEpoch) && entryEpoch < options.sinceEpoch) return [];
|
|
24303
|
+
for (const text of entry.texts) {
|
|
24304
|
+
const matchIndex = findMatchIndex(text, options.query, options.caseSensitive);
|
|
24305
|
+
if (matchIndex < 0) continue;
|
|
24306
|
+
matches.push({
|
|
24307
|
+
sessionId: entry.sessionId,
|
|
24308
|
+
timestamp: entry.timestamp,
|
|
24309
|
+
projectPath: entry.projectPath,
|
|
24310
|
+
sourcePath: target.filePath,
|
|
24311
|
+
sourceType: target.sourceType,
|
|
24312
|
+
line: 1,
|
|
24313
|
+
role: entry.role,
|
|
24314
|
+
entryType: entry.entryType,
|
|
24315
|
+
excerpt: createExcerpt(text, matchIndex, options.contextChars)
|
|
24316
|
+
});
|
|
24317
|
+
break;
|
|
24318
|
+
}
|
|
24319
|
+
} catch {
|
|
24320
|
+
return [];
|
|
24321
|
+
}
|
|
24322
|
+
return matches;
|
|
24323
|
+
}
|
|
24324
|
+
const stream = (0, import_fs14.createReadStream)(target.filePath, { encoding: "utf-8" });
|
|
24325
|
+
const reader = (0, import_readline.createInterface)({ input: stream, crlfDelay: Infinity });
|
|
24326
|
+
let line = 0;
|
|
24327
|
+
try {
|
|
24328
|
+
for await (const rawLine of reader) {
|
|
24329
|
+
line += 1;
|
|
24330
|
+
if (!rawLine.trim()) continue;
|
|
24331
|
+
let parsed;
|
|
24332
|
+
try {
|
|
24333
|
+
parsed = JSON.parse(rawLine);
|
|
24334
|
+
} catch {
|
|
24335
|
+
continue;
|
|
24336
|
+
}
|
|
24337
|
+
const entry = buildSearchableEntry(parsed, target.sourceType);
|
|
24338
|
+
if (!entry) continue;
|
|
24339
|
+
if (options.sessionId && entry.sessionId !== options.sessionId) continue;
|
|
24340
|
+
if (options.projectRoots && options.projectRoots.length > 0 && !isWithinProject(entry.projectPath, options.projectRoots)) continue;
|
|
24341
|
+
if (!matchesProjectFilter(entry.projectPath, options.projectFilter)) continue;
|
|
24342
|
+
const entryEpoch = entry.timestamp ? Date.parse(entry.timestamp) : fileMtime;
|
|
24343
|
+
if (options.sinceEpoch && Number.isFinite(entryEpoch) && entryEpoch < options.sinceEpoch) continue;
|
|
24344
|
+
for (const text of entry.texts) {
|
|
24345
|
+
const matchIndex = findMatchIndex(text, options.query, options.caseSensitive);
|
|
24346
|
+
if (matchIndex < 0) continue;
|
|
24347
|
+
matches.push({
|
|
24348
|
+
sessionId: entry.sessionId,
|
|
24349
|
+
agentId: entry.agentId,
|
|
24350
|
+
timestamp: entry.timestamp,
|
|
24351
|
+
projectPath: entry.projectPath,
|
|
24352
|
+
sourcePath: target.filePath,
|
|
24353
|
+
sourceType: target.sourceType,
|
|
24354
|
+
line,
|
|
24355
|
+
role: entry.role,
|
|
24356
|
+
entryType: entry.entryType,
|
|
24357
|
+
excerpt: createExcerpt(text, matchIndex, options.contextChars)
|
|
24358
|
+
});
|
|
24359
|
+
break;
|
|
24360
|
+
}
|
|
24361
|
+
}
|
|
24362
|
+
} finally {
|
|
24363
|
+
reader.close();
|
|
24364
|
+
stream.destroy();
|
|
24365
|
+
}
|
|
24366
|
+
return matches;
|
|
24367
|
+
}
|
|
24368
|
+
async function searchSessionHistory(rawOptions) {
|
|
24369
|
+
const query = compactWhitespace(rawOptions.query || "");
|
|
24370
|
+
if (!query) {
|
|
24371
|
+
throw new Error("Query cannot be empty");
|
|
24372
|
+
}
|
|
24373
|
+
if (rawOptions.sessionId) {
|
|
24374
|
+
validateSessionId(rawOptions.sessionId);
|
|
24375
|
+
}
|
|
24376
|
+
const limit = Math.max(1, rawOptions.limit ?? DEFAULT_LIMIT);
|
|
24377
|
+
const contextChars = Math.max(20, rawOptions.contextChars ?? DEFAULT_CONTEXT_CHARS);
|
|
24378
|
+
const caseSensitive = rawOptions.caseSensitive ?? false;
|
|
24379
|
+
const sinceEpoch = parseSinceSpec(rawOptions.since);
|
|
24380
|
+
const workingDirectory = validateWorkingDirectory(rawOptions.workingDirectory);
|
|
24381
|
+
const currentProjectRoot = resolveToWorktreeRoot(workingDirectory);
|
|
24382
|
+
const scopeMode = buildScopeMode(rawOptions.project);
|
|
24383
|
+
const projectFilter = scopeMode === "project" ? rawOptions.project : void 0;
|
|
24384
|
+
const currentProjectRoots = [currentProjectRoot].concat(getMainRepoRoot(currentProjectRoot) ?? []).concat(getClaudeWorktreeParent(currentProjectRoot) ?? []).filter((value, index, arr) => Boolean(value) && arr.indexOf(value) === index);
|
|
24385
|
+
const targets = scopeMode === "all" ? buildAllProjectTargets() : buildCurrentProjectTargets(currentProjectRoot);
|
|
24386
|
+
const allMatches = [];
|
|
24387
|
+
for (const target of targets) {
|
|
24388
|
+
const fileMatches = await collectMatchesFromFile(target, {
|
|
24389
|
+
query,
|
|
24390
|
+
caseSensitive,
|
|
24391
|
+
contextChars,
|
|
24392
|
+
sinceEpoch,
|
|
24393
|
+
sessionId: rawOptions.sessionId,
|
|
24394
|
+
projectFilter,
|
|
24395
|
+
projectRoots: scopeMode === "current" ? currentProjectRoots : void 0
|
|
24396
|
+
});
|
|
24397
|
+
allMatches.push(...fileMatches);
|
|
24398
|
+
}
|
|
24399
|
+
allMatches.sort((a, b) => {
|
|
24400
|
+
const aTime = a.timestamp ? Date.parse(a.timestamp) : 0;
|
|
24401
|
+
const bTime = b.timestamp ? Date.parse(b.timestamp) : 0;
|
|
24402
|
+
if (aTime !== bTime) return bTime - aTime;
|
|
24403
|
+
return a.sourcePath.localeCompare(b.sourcePath);
|
|
24404
|
+
});
|
|
24405
|
+
return {
|
|
24406
|
+
query,
|
|
24407
|
+
scope: {
|
|
24408
|
+
mode: scopeMode,
|
|
24409
|
+
project: rawOptions.project,
|
|
24410
|
+
workingDirectory: currentProjectRoot,
|
|
24411
|
+
since: rawOptions.since,
|
|
24412
|
+
caseSensitive
|
|
24413
|
+
},
|
|
24414
|
+
searchedFiles: targets.length,
|
|
24415
|
+
totalMatches: allMatches.length,
|
|
24416
|
+
results: allMatches.slice(0, limit)
|
|
24417
|
+
};
|
|
24418
|
+
}
|
|
24419
|
+
|
|
24420
|
+
// src/tools/session-history-tools.ts
|
|
24421
|
+
function buildToolJson(report) {
|
|
24422
|
+
return JSON.stringify(report, null, 2);
|
|
24423
|
+
}
|
|
24424
|
+
var sessionSearchTool = {
|
|
24425
|
+
name: "session_search",
|
|
24426
|
+
description: "Search prior local session history and transcript artifacts. Returns structured JSON with session ids, timestamps, source paths, and matching excerpts.",
|
|
24427
|
+
schema: {
|
|
24428
|
+
query: external_exports.string().min(1).describe("Text query to search for in prior session history"),
|
|
24429
|
+
limit: external_exports.number().int().positive().optional().describe("Maximum number of matches to return (default: 10)"),
|
|
24430
|
+
sessionId: external_exports.string().optional().describe("Restrict search to a specific session id"),
|
|
24431
|
+
since: external_exports.string().optional().describe("Only include matches since a relative duration (e.g. 7d, 24h) or absolute date"),
|
|
24432
|
+
project: external_exports.string().optional().describe('Project filter. Defaults to current project. Use "all" to search across all local Claude projects.'),
|
|
24433
|
+
caseSensitive: external_exports.boolean().optional().describe("Whether to match case-sensitively (default: false)"),
|
|
24434
|
+
contextChars: external_exports.number().int().positive().optional().describe("Approximate snippet context on each side of a match (default: 120)"),
|
|
24435
|
+
workingDirectory: external_exports.string().optional().describe("Working directory used to determine the current project scope")
|
|
24436
|
+
},
|
|
24437
|
+
handler: async (args) => {
|
|
24438
|
+
try {
|
|
24439
|
+
const report = await searchSessionHistory(args);
|
|
24440
|
+
return {
|
|
24441
|
+
content: [{
|
|
24442
|
+
type: "text",
|
|
24443
|
+
text: buildToolJson(report)
|
|
24444
|
+
}]
|
|
24445
|
+
};
|
|
24446
|
+
} catch (error2) {
|
|
24447
|
+
return {
|
|
24448
|
+
content: [{
|
|
24449
|
+
type: "text",
|
|
24450
|
+
text: `Error searching session history: ${error2 instanceof Error ? error2.message : String(error2)}`
|
|
24451
|
+
}],
|
|
24452
|
+
isError: true
|
|
24453
|
+
};
|
|
24454
|
+
}
|
|
24455
|
+
}
|
|
24456
|
+
};
|
|
24457
|
+
|
|
23943
24458
|
// src/tools/trace-tools.ts
|
|
23944
24459
|
var REPLAY_PREFIX2 = "agent-replay-";
|
|
23945
24460
|
function findLatestSessionId(directory) {
|
|
23946
|
-
const stateDir = (0,
|
|
24461
|
+
const stateDir = (0, import_path18.join)(directory, ".omc", "state");
|
|
23947
24462
|
try {
|
|
23948
|
-
const files = (0,
|
|
24463
|
+
const files = (0, import_fs15.readdirSync)(stateDir).filter((f) => f.startsWith(REPLAY_PREFIX2) && f.endsWith(".jsonl")).map((f) => ({
|
|
23949
24464
|
name: f,
|
|
23950
24465
|
sessionId: f.slice(REPLAY_PREFIX2.length, -".jsonl".length),
|
|
23951
|
-
mtime: (0,
|
|
24466
|
+
mtime: (0, import_fs15.statSync)((0, import_path18.join)(stateDir, f)).mtimeMs
|
|
23952
24467
|
})).sort((a, b) => b.mtime - a.mtime);
|
|
23953
24468
|
return files.length > 0 ? files[0].sessionId : null;
|
|
23954
24469
|
} catch {
|
|
@@ -24287,7 +24802,7 @@ No events recorded.`
|
|
|
24287
24802
|
}
|
|
24288
24803
|
}
|
|
24289
24804
|
};
|
|
24290
|
-
var traceTools = [traceTimelineTool, traceSummaryTool];
|
|
24805
|
+
var traceTools = [traceTimelineTool, traceSummaryTool, sessionSearchTool];
|
|
24291
24806
|
|
|
24292
24807
|
// src/mcp/standalone-server.ts
|
|
24293
24808
|
var allTools = [
|