@liangjie559567/ultrapower 5.5.13 → 5.5.14
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.claude-plugin/marketplace.json +2 -2
- package/.claude-plugin/plugin.json +2 -2
- package/LICENSE +21 -21
- package/bridge/gyoshu_bridge.py +846 -846
- 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/lib/path-validator.d.ts.map +1 -1
- package/dist/lib/path-validator.js +7 -0
- package/dist/lib/path-validator.js.map +1 -1
- package/docs/CLAUDE.md +1 -1
- package/docs/guides/v5.5.13-new-features.md +234 -0
- package/hooks/run-hook.cmd +0 -0
- package/hooks/session-start +0 -0
- package/package.json +1 -1
- package/scripts/persistent-mode.cjs +605 -605
- package/skills/systematic-debugging/find-polluter.sh +0 -0
- package/skills/writing-skills/graphviz-conventions.dot +171 -171
- package/skills/writing-skills/render-graphs.js +0 -0
- package/templates/axiom/scripts/Check-Memory.ps1 +68 -68
- package/templates/axiom/scripts/Poll-Memory.ps1 +36 -36
- package/templates/axiom/scripts/Watch-Memory.ps1 +149 -149
- package/templates/axiom/scripts/agent-runner.ps1 +101 -101
- package/templates/axiom/scripts/start-reviews.ps1 +19 -19
- package/dist/__tests__/agent-registry.test.d.ts +0 -2
- package/dist/__tests__/agent-registry.test.d.ts.map +0 -1
- package/dist/__tests__/agent-registry.test.js +0 -45
- package/dist/__tests__/agent-registry.test.js.map +0 -1
- package/dist/__tests__/analytics/backfill-dedup.test.d.ts +0 -2
- package/dist/__tests__/analytics/backfill-dedup.test.d.ts.map +0 -1
- package/dist/__tests__/analytics/backfill-dedup.test.js +0 -179
- package/dist/__tests__/analytics/backfill-dedup.test.js.map +0 -1
- package/dist/__tests__/analytics/backfill-engine.test.d.ts +0 -2
- package/dist/__tests__/analytics/backfill-engine.test.d.ts.map +0 -1
- package/dist/__tests__/analytics/backfill-engine.test.js +0 -362
- package/dist/__tests__/analytics/backfill-engine.test.js.map +0 -1
- package/dist/__tests__/analytics/output-estimator.test.d.ts +0 -2
- package/dist/__tests__/analytics/output-estimator.test.d.ts.map +0 -1
- package/dist/__tests__/analytics/output-estimator.test.js +0 -124
- package/dist/__tests__/analytics/output-estimator.test.js.map +0 -1
- package/dist/__tests__/analytics/token-extractor.test.d.ts +0 -2
- package/dist/__tests__/analytics/token-extractor.test.d.ts.map +0 -1
- package/dist/__tests__/analytics/token-extractor.test.js +0 -165
- package/dist/__tests__/analytics/token-extractor.test.js.map +0 -1
- package/dist/__tests__/analytics/token-tracker.test.d.ts +0 -2
- package/dist/__tests__/analytics/token-tracker.test.d.ts.map +0 -1
- package/dist/__tests__/analytics/token-tracker.test.js +0 -189
- package/dist/__tests__/analytics/token-tracker.test.js.map +0 -1
- package/dist/__tests__/analytics/tokscale-adapter.test.d.ts +0 -2
- package/dist/__tests__/analytics/tokscale-adapter.test.d.ts.map +0 -1
- package/dist/__tests__/analytics/tokscale-adapter.test.js +0 -79
- package/dist/__tests__/analytics/tokscale-adapter.test.js.map +0 -1
- package/dist/__tests__/analytics/transcript-parser.test.d.ts +0 -2
- package/dist/__tests__/analytics/transcript-parser.test.d.ts.map +0 -1
- package/dist/__tests__/analytics/transcript-parser.test.js +0 -289
- package/dist/__tests__/analytics/transcript-parser.test.js.map +0 -1
- package/dist/__tests__/analytics/transcript-scanner.test.d.ts +0 -2
- package/dist/__tests__/analytics/transcript-scanner.test.d.ts.map +0 -1
- package/dist/__tests__/analytics/transcript-scanner.test.js +0 -443
- package/dist/__tests__/analytics/transcript-scanner.test.js.map +0 -1
- package/dist/__tests__/analytics/transcript-token-extractor.test.d.ts +0 -2
- package/dist/__tests__/analytics/transcript-token-extractor.test.d.ts.map +0 -1
- package/dist/__tests__/analytics/transcript-token-extractor.test.js +0 -177
- package/dist/__tests__/analytics/transcript-token-extractor.test.js.map +0 -1
- package/dist/__tests__/auto-update.test.d.ts +0 -2
- package/dist/__tests__/auto-update.test.d.ts.map +0 -1
- package/dist/__tests__/auto-update.test.js +0 -451
- package/dist/__tests__/auto-update.test.js.map +0 -1
- package/dist/__tests__/auto-upgrade-prompt.test.d.ts +0 -2
- package/dist/__tests__/auto-upgrade-prompt.test.d.ts.map +0 -1
- package/dist/__tests__/auto-upgrade-prompt.test.js +0 -81
- package/dist/__tests__/auto-upgrade-prompt.test.js.map +0 -1
- package/dist/__tests__/bash-history.test.d.ts +0 -5
- package/dist/__tests__/bash-history.test.d.ts.map +0 -1
- package/dist/__tests__/bash-history.test.js +0 -78
- package/dist/__tests__/bash-history.test.js.map +0 -1
- package/dist/__tests__/cli-config-stop-callback.test.d.ts +0 -2
- package/dist/__tests__/cli-config-stop-callback.test.d.ts.map +0 -1
- package/dist/__tests__/cli-config-stop-callback.test.js +0 -102
- package/dist/__tests__/cli-config-stop-callback.test.js.map +0 -1
- package/dist/__tests__/cli-notify-profile.test.d.ts +0 -2
- package/dist/__tests__/cli-notify-profile.test.d.ts.map +0 -1
- package/dist/__tests__/cli-notify-profile.test.js +0 -213
- package/dist/__tests__/cli-notify-profile.test.js.map +0 -1
- package/dist/__tests__/codex-backoff.test.d.ts +0 -2
- package/dist/__tests__/codex-backoff.test.d.ts.map +0 -1
- package/dist/__tests__/codex-backoff.test.js +0 -143
- package/dist/__tests__/codex-backoff.test.js.map +0 -1
- package/dist/__tests__/compatibility-security.test.d.ts +0 -13
- package/dist/__tests__/compatibility-security.test.d.ts.map +0 -1
- package/dist/__tests__/compatibility-security.test.js +0 -403
- package/dist/__tests__/compatibility-security.test.js.map +0 -1
- package/dist/__tests__/compatibility.test.d.ts +0 -7
- package/dist/__tests__/compatibility.test.d.ts.map +0 -1
- package/dist/__tests__/compatibility.test.js +0 -484
- package/dist/__tests__/compatibility.test.js.map +0 -1
- package/dist/__tests__/consensus-execution-handoff.test.d.ts +0 -14
- package/dist/__tests__/consensus-execution-handoff.test.d.ts.map +0 -1
- package/dist/__tests__/consensus-execution-handoff.test.js +0 -178
- package/dist/__tests__/consensus-execution-handoff.test.js.map +0 -1
- package/dist/__tests__/delegation-enforcement-levels.test.d.ts +0 -9
- package/dist/__tests__/delegation-enforcement-levels.test.d.ts.map +0 -1
- package/dist/__tests__/delegation-enforcement-levels.test.js +0 -583
- package/dist/__tests__/delegation-enforcement-levels.test.js.map +0 -1
- package/dist/__tests__/delegation-enforcer-integration.test.d.ts +0 -6
- package/dist/__tests__/delegation-enforcer-integration.test.d.ts.map +0 -1
- package/dist/__tests__/delegation-enforcer-integration.test.js +0 -136
- package/dist/__tests__/delegation-enforcer-integration.test.js.map +0 -1
- package/dist/__tests__/delegation-enforcer.test.d.ts +0 -5
- package/dist/__tests__/delegation-enforcer.test.d.ts.map +0 -1
- package/dist/__tests__/delegation-enforcer.test.js +0 -209
- package/dist/__tests__/delegation-enforcer.test.js.map +0 -1
- package/dist/__tests__/directory-context-injector.test.d.ts +0 -2
- package/dist/__tests__/directory-context-injector.test.d.ts.map +0 -1
- package/dist/__tests__/directory-context-injector.test.js +0 -186
- package/dist/__tests__/directory-context-injector.test.js.map +0 -1
- package/dist/__tests__/disable-tools.test.d.ts +0 -8
- package/dist/__tests__/disable-tools.test.d.ts.map +0 -1
- package/dist/__tests__/disable-tools.test.js +0 -182
- package/dist/__tests__/disable-tools.test.js.map +0 -1
- package/dist/__tests__/doctor-conflicts.test.d.ts +0 -8
- package/dist/__tests__/doctor-conflicts.test.d.ts.map +0 -1
- package/dist/__tests__/doctor-conflicts.test.js +0 -230
- package/dist/__tests__/doctor-conflicts.test.js.map +0 -1
- package/dist/__tests__/example.test.d.ts +0 -2
- package/dist/__tests__/example.test.d.ts.map +0 -1
- package/dist/__tests__/example.test.js +0 -20
- package/dist/__tests__/example.test.js.map +0 -1
- package/dist/__tests__/helpers/prompt-test-helpers.d.ts +0 -4
- package/dist/__tests__/helpers/prompt-test-helpers.d.ts.map +0 -1
- package/dist/__tests__/helpers/prompt-test-helpers.js +0 -9
- package/dist/__tests__/helpers/prompt-test-helpers.js.map +0 -1
- package/dist/__tests__/hooks/learner/bridge.test.d.ts +0 -11
- package/dist/__tests__/hooks/learner/bridge.test.d.ts.map +0 -1
- package/dist/__tests__/hooks/learner/bridge.test.js +0 -217
- package/dist/__tests__/hooks/learner/bridge.test.js.map +0 -1
- package/dist/__tests__/hooks/learner/parser.test.d.ts +0 -5
- package/dist/__tests__/hooks/learner/parser.test.d.ts.map +0 -1
- package/dist/__tests__/hooks/learner/parser.test.js +0 -219
- package/dist/__tests__/hooks/learner/parser.test.js.map +0 -1
- package/dist/__tests__/hooks-json-paths.test.d.ts +0 -9
- package/dist/__tests__/hooks-json-paths.test.d.ts.map +0 -1
- package/dist/__tests__/hooks-json-paths.test.js +0 -91
- package/dist/__tests__/hooks-json-paths.test.js.map +0 -1
- package/dist/__tests__/hooks.test.d.ts +0 -2
- package/dist/__tests__/hooks.test.d.ts.map +0 -1
- package/dist/__tests__/hooks.test.js +0 -1273
- package/dist/__tests__/hooks.test.js.map +0 -1
- package/dist/__tests__/hud/analytics-display.test.d.ts +0 -2
- package/dist/__tests__/hud/analytics-display.test.d.ts.map +0 -1
- package/dist/__tests__/hud/analytics-display.test.js +0 -236
- package/dist/__tests__/hud/analytics-display.test.js.map +0 -1
- package/dist/__tests__/hud/call-counts.test.d.ts +0 -2
- package/dist/__tests__/hud/call-counts.test.d.ts.map +0 -1
- package/dist/__tests__/hud/call-counts.test.js +0 -90
- package/dist/__tests__/hud/call-counts.test.js.map +0 -1
- package/dist/__tests__/hud/context-warning.test.d.ts +0 -2
- package/dist/__tests__/hud/context-warning.test.d.ts.map +0 -1
- package/dist/__tests__/hud/context-warning.test.js +0 -84
- package/dist/__tests__/hud/context-warning.test.js.map +0 -1
- package/dist/__tests__/hud/cwd.test.d.ts +0 -2
- package/dist/__tests__/hud/cwd.test.d.ts.map +0 -1
- package/dist/__tests__/hud/cwd.test.js +0 -62
- package/dist/__tests__/hud/cwd.test.js.map +0 -1
- package/dist/__tests__/hud/defaults.test.d.ts +0 -2
- package/dist/__tests__/hud/defaults.test.d.ts.map +0 -1
- package/dist/__tests__/hud/defaults.test.js +0 -55
- package/dist/__tests__/hud/defaults.test.js.map +0 -1
- package/dist/__tests__/hud/git.test.d.ts +0 -2
- package/dist/__tests__/hud/git.test.d.ts.map +0 -1
- package/dist/__tests__/hud/git.test.js +0 -110
- package/dist/__tests__/hud/git.test.js.map +0 -1
- package/dist/__tests__/hud/model.test.d.ts +0 -2
- package/dist/__tests__/hud/model.test.d.ts.map +0 -1
- package/dist/__tests__/hud/model.test.js +0 -63
- package/dist/__tests__/hud/model.test.js.map +0 -1
- package/dist/__tests__/hud/render.test.d.ts +0 -2
- package/dist/__tests__/hud/render.test.d.ts.map +0 -1
- package/dist/__tests__/hud/render.test.js +0 -141
- package/dist/__tests__/hud/render.test.js.map +0 -1
- package/dist/__tests__/hud/sanitize.test.d.ts +0 -10
- package/dist/__tests__/hud/sanitize.test.d.ts.map +0 -1
- package/dist/__tests__/hud/sanitize.test.js +0 -138
- package/dist/__tests__/hud/sanitize.test.js.map +0 -1
- package/dist/__tests__/hud/skills.test.d.ts +0 -2
- package/dist/__tests__/hud/skills.test.d.ts.map +0 -1
- package/dist/__tests__/hud/skills.test.js +0 -143
- package/dist/__tests__/hud/skills.test.js.map +0 -1
- package/dist/__tests__/hud/state.test.d.ts +0 -2
- package/dist/__tests__/hud/state.test.d.ts.map +0 -1
- package/dist/__tests__/hud/state.test.js +0 -162
- package/dist/__tests__/hud/state.test.js.map +0 -1
- package/dist/__tests__/hud/thinking.test.d.ts +0 -2
- package/dist/__tests__/hud/thinking.test.d.ts.map +0 -1
- package/dist/__tests__/hud/thinking.test.js +0 -32
- package/dist/__tests__/hud/thinking.test.js.map +0 -1
- package/dist/__tests__/hud/top-agents.test.d.ts +0 -8
- package/dist/__tests__/hud/top-agents.test.d.ts.map +0 -1
- package/dist/__tests__/hud/top-agents.test.js +0 -158
- package/dist/__tests__/hud/top-agents.test.js.map +0 -1
- package/dist/__tests__/hud/usage-api.test.d.ts +0 -5
- package/dist/__tests__/hud/usage-api.test.d.ts.map +0 -1
- package/dist/__tests__/hud/usage-api.test.js +0 -201
- package/dist/__tests__/hud/usage-api.test.js.map +0 -1
- package/dist/__tests__/hud/version-display.test.d.ts +0 -2
- package/dist/__tests__/hud/version-display.test.d.ts.map +0 -1
- package/dist/__tests__/hud/version-display.test.js +0 -107
- package/dist/__tests__/hud/version-display.test.js.map +0 -1
- package/dist/__tests__/hud/windows-platform.test.d.ts +0 -2
- package/dist/__tests__/hud/windows-platform.test.d.ts.map +0 -1
- package/dist/__tests__/hud/windows-platform.test.js +0 -193
- package/dist/__tests__/hud/windows-platform.test.js.map +0 -1
- package/dist/__tests__/hud-agents.test.d.ts +0 -7
- package/dist/__tests__/hud-agents.test.d.ts.map +0 -1
- package/dist/__tests__/hud-agents.test.js +0 -392
- package/dist/__tests__/hud-agents.test.js.map +0 -1
- package/dist/__tests__/hud-axiom.test.d.ts +0 -5
- package/dist/__tests__/hud-axiom.test.d.ts.map +0 -1
- package/dist/__tests__/hud-axiom.test.js +0 -287
- package/dist/__tests__/hud-axiom.test.js.map +0 -1
- package/dist/__tests__/hud-suggestions.test.d.ts +0 -5
- package/dist/__tests__/hud-suggestions.test.d.ts.map +0 -1
- package/dist/__tests__/hud-suggestions.test.js +0 -244
- package/dist/__tests__/hud-suggestions.test.js.map +0 -1
- package/dist/__tests__/hud-windows.test.d.ts +0 -2
- package/dist/__tests__/hud-windows.test.d.ts.map +0 -1
- package/dist/__tests__/hud-windows.test.js +0 -154
- package/dist/__tests__/hud-windows.test.js.map +0 -1
- package/dist/__tests__/inline-prompt-integration.test.d.ts +0 -2
- package/dist/__tests__/inline-prompt-integration.test.d.ts.map +0 -1
- package/dist/__tests__/inline-prompt-integration.test.js +0 -411
- package/dist/__tests__/inline-prompt-integration.test.js.map +0 -1
- package/dist/__tests__/inline-success-shape.test.d.ts +0 -2
- package/dist/__tests__/inline-success-shape.test.d.ts.map +0 -1
- package/dist/__tests__/inline-success-shape.test.js +0 -130
- package/dist/__tests__/inline-success-shape.test.js.map +0 -1
- package/dist/__tests__/installer-hooks-merge.test.d.ts +0 -13
- package/dist/__tests__/installer-hooks-merge.test.d.ts.map +0 -1
- package/dist/__tests__/installer-hooks-merge.test.js +0 -250
- package/dist/__tests__/installer-hooks-merge.test.js.map +0 -1
- package/dist/__tests__/installer-hud-skip.test.d.ts +0 -2
- package/dist/__tests__/installer-hud-skip.test.d.ts.map +0 -1
- package/dist/__tests__/installer-hud-skip.test.js +0 -102
- package/dist/__tests__/installer-hud-skip.test.js.map +0 -1
- package/dist/__tests__/installer.test.d.ts +0 -2
- package/dist/__tests__/installer.test.d.ts.map +0 -1
- package/dist/__tests__/installer.test.js +0 -474
- package/dist/__tests__/installer.test.js.map +0 -1
- package/dist/__tests__/job-management-sqlite.test.d.ts +0 -2
- package/dist/__tests__/job-management-sqlite.test.d.ts.map +0 -1
- package/dist/__tests__/job-management-sqlite.test.js +0 -284
- package/dist/__tests__/job-management-sqlite.test.js.map +0 -1
- package/dist/__tests__/job-management.test.d.ts +0 -2
- package/dist/__tests__/job-management.test.d.ts.map +0 -1
- package/dist/__tests__/job-management.test.js +0 -411
- package/dist/__tests__/job-management.test.js.map +0 -1
- package/dist/__tests__/job-state-db.test.d.ts +0 -2
- package/dist/__tests__/job-state-db.test.d.ts.map +0 -1
- package/dist/__tests__/job-state-db.test.js +0 -611
- package/dist/__tests__/job-state-db.test.js.map +0 -1
- package/dist/__tests__/learner/auto-learner.test.d.ts +0 -7
- package/dist/__tests__/learner/auto-learner.test.d.ts.map +0 -1
- package/dist/__tests__/learner/auto-learner.test.js +0 -507
- package/dist/__tests__/learner/auto-learner.test.js.map +0 -1
- package/dist/__tests__/learner/matcher.test.d.ts +0 -2
- package/dist/__tests__/learner/matcher.test.d.ts.map +0 -1
- package/dist/__tests__/learner/matcher.test.js +0 -330
- package/dist/__tests__/learner/matcher.test.js.map +0 -1
- package/dist/__tests__/live-data.test.d.ts +0 -2
- package/dist/__tests__/live-data.test.d.ts.map +0 -1
- package/dist/__tests__/live-data.test.js +0 -331
- package/dist/__tests__/live-data.test.js.map +0 -1
- package/dist/__tests__/load-agent-prompt.test.d.ts +0 -2
- package/dist/__tests__/load-agent-prompt.test.d.ts.map +0 -1
- package/dist/__tests__/load-agent-prompt.test.js +0 -91
- package/dist/__tests__/load-agent-prompt.test.js.map +0 -1
- package/dist/__tests__/lsp-servers.test.d.ts +0 -2
- package/dist/__tests__/lsp-servers.test.d.ts.map +0 -1
- package/dist/__tests__/lsp-servers.test.js +0 -121
- package/dist/__tests__/lsp-servers.test.js.map +0 -1
- package/dist/__tests__/mcp-fallback-429.test.d.ts +0 -2
- package/dist/__tests__/mcp-fallback-429.test.d.ts.map +0 -1
- package/dist/__tests__/mcp-fallback-429.test.js +0 -164
- package/dist/__tests__/mcp-fallback-429.test.js.map +0 -1
- package/dist/__tests__/mcp-server-workflows.test.d.ts +0 -2
- package/dist/__tests__/mcp-server-workflows.test.d.ts.map +0 -1
- package/dist/__tests__/mcp-server-workflows.test.js +0 -301
- package/dist/__tests__/mcp-server-workflows.test.js.map +0 -1
- package/dist/__tests__/mnemosyne/config.test.d.ts +0 -2
- package/dist/__tests__/mnemosyne/config.test.d.ts.map +0 -1
- package/dist/__tests__/mnemosyne/config.test.js +0 -37
- package/dist/__tests__/mnemosyne/config.test.js.map +0 -1
- package/dist/__tests__/mnemosyne/detector.test.d.ts +0 -2
- package/dist/__tests__/mnemosyne/detector.test.d.ts.map +0 -1
- package/dist/__tests__/mnemosyne/detector.test.js +0 -99
- package/dist/__tests__/mnemosyne/detector.test.js.map +0 -1
- package/dist/__tests__/mnemosyne/finder.test.d.ts +0 -2
- package/dist/__tests__/mnemosyne/finder.test.d.ts.map +0 -1
- package/dist/__tests__/mnemosyne/finder.test.js +0 -105
- package/dist/__tests__/mnemosyne/finder.test.js.map +0 -1
- package/dist/__tests__/mnemosyne/loader.test.d.ts +0 -2
- package/dist/__tests__/mnemosyne/loader.test.d.ts.map +0 -1
- package/dist/__tests__/mnemosyne/loader.test.js +0 -73
- package/dist/__tests__/mnemosyne/loader.test.js.map +0 -1
- package/dist/__tests__/mnemosyne/parser.test.d.ts +0 -2
- package/dist/__tests__/mnemosyne/parser.test.d.ts.map +0 -1
- package/dist/__tests__/mnemosyne/parser.test.js +0 -81
- package/dist/__tests__/mnemosyne/parser.test.js.map +0 -1
- package/dist/__tests__/mnemosyne/validator.test.d.ts +0 -2
- package/dist/__tests__/mnemosyne/validator.test.d.ts.map +0 -1
- package/dist/__tests__/mnemosyne/validator.test.js +0 -85
- package/dist/__tests__/mnemosyne/validator.test.js.map +0 -1
- package/dist/__tests__/model-routing.test.d.ts +0 -2
- package/dist/__tests__/model-routing.test.d.ts.map +0 -1
- package/dist/__tests__/model-routing.test.js +0 -794
- package/dist/__tests__/model-routing.test.js.map +0 -1
- package/dist/__tests__/multi-model-mcp-integration.test.d.ts +0 -2
- package/dist/__tests__/multi-model-mcp-integration.test.d.ts.map +0 -1
- package/dist/__tests__/multi-model-mcp-integration.test.js +0 -69
- package/dist/__tests__/multi-model-mcp-integration.test.js.map +0 -1
- package/dist/__tests__/multi-model-mcp.test.d.ts +0 -2
- package/dist/__tests__/multi-model-mcp.test.d.ts.map +0 -1
- package/dist/__tests__/multi-model-mcp.test.js +0 -145
- package/dist/__tests__/multi-model-mcp.test.js.map +0 -1
- package/dist/__tests__/notepad.test.d.ts +0 -2
- package/dist/__tests__/notepad.test.d.ts.map +0 -1
- package/dist/__tests__/notepad.test.js +0 -374
- package/dist/__tests__/notepad.test.js.map +0 -1
- package/dist/__tests__/omc-tools-contract.test.d.ts +0 -11
- package/dist/__tests__/omc-tools-contract.test.d.ts.map +0 -1
- package/dist/__tests__/omc-tools-contract.test.js +0 -172
- package/dist/__tests__/omc-tools-contract.test.js.map +0 -1
- package/dist/__tests__/omc-tools-server.test.d.ts +0 -2
- package/dist/__tests__/omc-tools-server.test.d.ts.map +0 -1
- package/dist/__tests__/omc-tools-server.test.js +0 -61
- package/dist/__tests__/omc-tools-server.test.js.map +0 -1
- package/dist/__tests__/permission-enforcement.test.d.ts +0 -2
- package/dist/__tests__/permission-enforcement.test.d.ts.map +0 -1
- package/dist/__tests__/permission-enforcement.test.js +0 -194
- package/dist/__tests__/permission-enforcement.test.js.map +0 -1
- package/dist/__tests__/plugin-registry.test.d.ts +0 -2
- package/dist/__tests__/plugin-registry.test.d.ts.map +0 -1
- package/dist/__tests__/plugin-registry.test.js +0 -233
- package/dist/__tests__/plugin-registry.test.js.map +0 -1
- package/dist/__tests__/prompt-file-only.test.d.ts +0 -2
- package/dist/__tests__/prompt-file-only.test.d.ts.map +0 -1
- package/dist/__tests__/prompt-file-only.test.js +0 -263
- package/dist/__tests__/prompt-file-only.test.js.map +0 -1
- package/dist/__tests__/prompt-injection.test.d.ts +0 -2
- package/dist/__tests__/prompt-injection.test.d.ts.map +0 -1
- package/dist/__tests__/prompt-injection.test.js +0 -242
- package/dist/__tests__/prompt-injection.test.js.map +0 -1
- package/dist/__tests__/providers/azure-devops.test.d.ts +0 -2
- package/dist/__tests__/providers/azure-devops.test.d.ts.map +0 -1
- package/dist/__tests__/providers/azure-devops.test.js +0 -158
- package/dist/__tests__/providers/azure-devops.test.js.map +0 -1
- package/dist/__tests__/providers/bitbucket.test.d.ts +0 -2
- package/dist/__tests__/providers/bitbucket.test.d.ts.map +0 -1
- package/dist/__tests__/providers/bitbucket.test.js +0 -170
- package/dist/__tests__/providers/bitbucket.test.js.map +0 -1
- package/dist/__tests__/providers/detection.test.d.ts +0 -2
- package/dist/__tests__/providers/detection.test.d.ts.map +0 -1
- package/dist/__tests__/providers/detection.test.js +0 -181
- package/dist/__tests__/providers/detection.test.js.map +0 -1
- package/dist/__tests__/providers/gitea.test.d.ts +0 -2
- package/dist/__tests__/providers/gitea.test.d.ts.map +0 -1
- package/dist/__tests__/providers/gitea.test.js +0 -212
- package/dist/__tests__/providers/gitea.test.js.map +0 -1
- package/dist/__tests__/providers/github.test.d.ts +0 -2
- package/dist/__tests__/providers/github.test.d.ts.map +0 -1
- package/dist/__tests__/providers/github.test.js +0 -146
- package/dist/__tests__/providers/github.test.js.map +0 -1
- package/dist/__tests__/providers/gitlab.test.d.ts +0 -2
- package/dist/__tests__/providers/gitlab.test.d.ts.map +0 -1
- package/dist/__tests__/providers/gitlab.test.js +0 -149
- package/dist/__tests__/providers/gitlab.test.js.map +0 -1
- package/dist/__tests__/ralph-prd.test.d.ts +0 -2
- package/dist/__tests__/ralph-prd.test.d.ts.map +0 -1
- package/dist/__tests__/ralph-prd.test.js +0 -308
- package/dist/__tests__/ralph-prd.test.js.map +0 -1
- package/dist/__tests__/ralph-progress.test.d.ts +0 -2
- package/dist/__tests__/ralph-progress.test.d.ts.map +0 -1
- package/dist/__tests__/ralph-progress.test.js +0 -312
- package/dist/__tests__/ralph-progress.test.js.map +0 -1
- package/dist/__tests__/rate-limit-wait/daemon.test.d.ts +0 -5
- package/dist/__tests__/rate-limit-wait/daemon.test.d.ts.map +0 -1
- package/dist/__tests__/rate-limit-wait/daemon.test.js +0 -321
- package/dist/__tests__/rate-limit-wait/daemon.test.js.map +0 -1
- package/dist/__tests__/rate-limit-wait/integration.test.d.ts +0 -8
- package/dist/__tests__/rate-limit-wait/integration.test.d.ts.map +0 -1
- package/dist/__tests__/rate-limit-wait/integration.test.js +0 -341
- package/dist/__tests__/rate-limit-wait/integration.test.js.map +0 -1
- package/dist/__tests__/rate-limit-wait/rate-limit-monitor.test.d.ts +0 -5
- package/dist/__tests__/rate-limit-wait/rate-limit-monitor.test.d.ts.map +0 -1
- package/dist/__tests__/rate-limit-wait/rate-limit-monitor.test.js +0 -183
- package/dist/__tests__/rate-limit-wait/rate-limit-monitor.test.js.map +0 -1
- package/dist/__tests__/rate-limit-wait/tmux-detector.test.d.ts +0 -5
- package/dist/__tests__/rate-limit-wait/tmux-detector.test.d.ts.map +0 -1
- package/dist/__tests__/rate-limit-wait/tmux-detector.test.js +0 -312
- package/dist/__tests__/rate-limit-wait/tmux-detector.test.js.map +0 -1
- package/dist/__tests__/release-local.test.d.ts +0 -2
- package/dist/__tests__/release-local.test.d.ts.map +0 -1
- package/dist/__tests__/release-local.test.js +0 -19
- package/dist/__tests__/release-local.test.js.map +0 -1
- package/dist/__tests__/release-steps.test.d.ts +0 -2
- package/dist/__tests__/release-steps.test.d.ts.map +0 -1
- package/dist/__tests__/release-steps.test.js +0 -82
- package/dist/__tests__/release-steps.test.js.map +0 -1
- package/dist/__tests__/session-catalog.test.d.ts +0 -2
- package/dist/__tests__/session-catalog.test.d.ts.map +0 -1
- package/dist/__tests__/session-catalog.test.js +0 -195
- package/dist/__tests__/session-catalog.test.js.map +0 -1
- package/dist/__tests__/session-migration.test.d.ts +0 -2
- package/dist/__tests__/session-migration.test.d.ts.map +0 -1
- package/dist/__tests__/session-migration.test.js +0 -155
- package/dist/__tests__/session-migration.test.js.map +0 -1
- package/dist/__tests__/skills.test.d.ts +0 -2
- package/dist/__tests__/skills.test.d.ts.map +0 -1
- package/dist/__tests__/skills.test.js +0 -207
- package/dist/__tests__/skills.test.js.map +0 -1
- package/dist/__tests__/standalone-server.test.d.ts +0 -2
- package/dist/__tests__/standalone-server.test.d.ts.map +0 -1
- package/dist/__tests__/standalone-server.test.js +0 -53
- package/dist/__tests__/standalone-server.test.js.map +0 -1
- package/dist/__tests__/task-continuation.test.d.ts +0 -2
- package/dist/__tests__/task-continuation.test.d.ts.map +0 -1
- package/dist/__tests__/task-continuation.test.js +0 -743
- package/dist/__tests__/task-continuation.test.js.map +0 -1
- package/dist/__tests__/tools/skills-tools.test.d.ts +0 -2
- package/dist/__tests__/tools/skills-tools.test.d.ts.map +0 -1
- package/dist/__tests__/tools/skills-tools.test.js +0 -63
- package/dist/__tests__/tools/skills-tools.test.js.map +0 -1
- package/dist/__tests__/tools/trace-tools.test.d.ts +0 -2
- package/dist/__tests__/tools/trace-tools.test.d.ts.map +0 -1
- package/dist/__tests__/tools/trace-tools.test.js +0 -237
- package/dist/__tests__/tools/trace-tools.test.js.map +0 -1
- package/dist/__tests__/types.test.d.ts +0 -2
- package/dist/__tests__/types.test.d.ts.map +0 -1
- package/dist/__tests__/types.test.js +0 -78
- package/dist/__tests__/types.test.js.map +0 -1
- package/dist/__tests__/validate-and-read-file.test.d.ts +0 -2
- package/dist/__tests__/validate-and-read-file.test.d.ts.map +0 -1
- package/dist/__tests__/validate-and-read-file.test.js +0 -84
- package/dist/__tests__/validate-and-read-file.test.js.map +0 -1
- package/dist/__tests__/validateMode.test.d.ts +0 -2
- package/dist/__tests__/validateMode.test.d.ts.map +0 -1
- package/dist/__tests__/validateMode.test.js +0 -100
- package/dist/__tests__/validateMode.test.js.map +0 -1
- package/dist/__tests__/version-helper.test.d.ts +0 -2
- package/dist/__tests__/version-helper.test.d.ts.map +0 -1
- package/dist/__tests__/version-helper.test.js +0 -37
- package/dist/__tests__/version-helper.test.js.map +0 -1
- package/dist/agents/__tests__/agent-wrapper.test.d.ts +0 -2
- package/dist/agents/__tests__/agent-wrapper.test.d.ts.map +0 -1
- package/dist/agents/__tests__/agent-wrapper.test.js +0 -37
- package/dist/agents/__tests__/agent-wrapper.test.js.map +0 -1
- package/dist/agents/__tests__/timeout-config.test.d.ts +0 -2
- package/dist/agents/__tests__/timeout-config.test.d.ts.map +0 -1
- package/dist/agents/__tests__/timeout-config.test.js +0 -35
- package/dist/agents/__tests__/timeout-config.test.js.map +0 -1
- package/dist/agents/__tests__/timeout-manager.test.d.ts +0 -2
- package/dist/agents/__tests__/timeout-manager.test.d.ts.map +0 -1
- package/dist/agents/__tests__/timeout-manager.test.js +0 -37
- package/dist/agents/__tests__/timeout-manager.test.js.map +0 -1
- package/dist/agents/coordinator-deprecated.d.ts +0 -18
- package/dist/agents/coordinator-deprecated.d.ts.map +0 -1
- package/dist/agents/coordinator-deprecated.js +0 -38
- package/dist/agents/coordinator-deprecated.js.map +0 -1
- package/dist/cli/commands/__tests__/cleanup.test.d.ts +0 -2
- package/dist/cli/commands/__tests__/cleanup.test.d.ts.map +0 -1
- package/dist/cli/commands/__tests__/cleanup.test.js +0 -37
- package/dist/cli/commands/__tests__/cleanup.test.js.map +0 -1
- package/dist/features/delegation-routing/__tests__/resolver.test.d.ts +0 -2
- package/dist/features/delegation-routing/__tests__/resolver.test.d.ts.map +0 -1
- package/dist/features/delegation-routing/__tests__/resolver.test.js +0 -419
- package/dist/features/delegation-routing/__tests__/resolver.test.js.map +0 -1
- package/dist/features/model-routing/__tests__/external-model-policy.test.d.ts +0 -2
- package/dist/features/model-routing/__tests__/external-model-policy.test.d.ts.map +0 -1
- package/dist/features/model-routing/__tests__/external-model-policy.test.js +0 -475
- package/dist/features/model-routing/__tests__/external-model-policy.test.js.map +0 -1
- package/dist/features/state-manager/__tests__/cache.test.d.ts +0 -2
- package/dist/features/state-manager/__tests__/cache.test.d.ts.map +0 -1
- package/dist/features/state-manager/__tests__/cache.test.js +0 -204
- package/dist/features/state-manager/__tests__/cache.test.js.map +0 -1
- package/dist/features/state-manager/__tests__/encryption-performance.test.d.ts +0 -2
- package/dist/features/state-manager/__tests__/encryption-performance.test.d.ts.map +0 -1
- package/dist/features/state-manager/__tests__/encryption-performance.test.js +0 -42
- package/dist/features/state-manager/__tests__/encryption-performance.test.js.map +0 -1
- package/dist/features/state-manager/__tests__/encryption.test.d.ts +0 -2
- package/dist/features/state-manager/__tests__/encryption.test.d.ts.map +0 -1
- package/dist/features/state-manager/__tests__/encryption.test.js +0 -68
- package/dist/features/state-manager/__tests__/encryption.test.js.map +0 -1
- package/dist/features/wizard/__tests__/engine.test.d.ts +0 -2
- package/dist/features/wizard/__tests__/engine.test.d.ts.map +0 -1
- package/dist/features/wizard/__tests__/engine.test.js +0 -78
- package/dist/features/wizard/__tests__/engine.test.js.map +0 -1
- package/dist/features/wizard/__tests__/recommendation-engine.test.d.ts +0 -2
- package/dist/features/wizard/__tests__/recommendation-engine.test.d.ts.map +0 -1
- package/dist/features/wizard/__tests__/recommendation-engine.test.js +0 -43
- package/dist/features/wizard/__tests__/recommendation-engine.test.js.map +0 -1
- package/dist/hooks/__tests__/askuserquestion-lifecycle.test.d.ts +0 -9
- package/dist/hooks/__tests__/askuserquestion-lifecycle.test.d.ts.map +0 -1
- package/dist/hooks/__tests__/askuserquestion-lifecycle.test.js +0 -110
- package/dist/hooks/__tests__/askuserquestion-lifecycle.test.js.map +0 -1
- package/dist/hooks/__tests__/background-process-guard.test.d.ts +0 -2
- package/dist/hooks/__tests__/background-process-guard.test.d.ts.map +0 -1
- package/dist/hooks/__tests__/background-process-guard.test.js +0 -233
- package/dist/hooks/__tests__/background-process-guard.test.js.map +0 -1
- package/dist/hooks/__tests__/bridge-normalize.test.d.ts +0 -2
- package/dist/hooks/__tests__/bridge-normalize.test.d.ts.map +0 -1
- package/dist/hooks/__tests__/bridge-normalize.test.js +0 -90
- package/dist/hooks/__tests__/bridge-normalize.test.js.map +0 -1
- package/dist/hooks/__tests__/bridge-pkill.test.d.ts +0 -8
- package/dist/hooks/__tests__/bridge-pkill.test.d.ts.map +0 -1
- package/dist/hooks/__tests__/bridge-pkill.test.js +0 -188
- package/dist/hooks/__tests__/bridge-pkill.test.js.map +0 -1
- package/dist/hooks/__tests__/bridge-routing.test.d.ts +0 -9
- package/dist/hooks/__tests__/bridge-routing.test.d.ts.map +0 -1
- package/dist/hooks/__tests__/bridge-routing.test.js +0 -516
- package/dist/hooks/__tests__/bridge-routing.test.js.map +0 -1
- package/dist/hooks/__tests__/bridge-security.test.d.ts +0 -11
- package/dist/hooks/__tests__/bridge-security.test.d.ts.map +0 -1
- package/dist/hooks/__tests__/bridge-security.test.js +0 -498
- package/dist/hooks/__tests__/bridge-security.test.js.map +0 -1
- package/dist/hooks/__tests__/bridge.test.d.ts +0 -2
- package/dist/hooks/__tests__/bridge.test.d.ts.map +0 -1
- package/dist/hooks/__tests__/bridge.test.js +0 -199
- package/dist/hooks/__tests__/bridge.test.js.map +0 -1
- package/dist/hooks/__tests__/compaction-concurrency.test.d.ts +0 -10
- package/dist/hooks/__tests__/compaction-concurrency.test.d.ts.map +0 -1
- package/dist/hooks/__tests__/compaction-concurrency.test.js +0 -313
- package/dist/hooks/__tests__/compaction-concurrency.test.js.map +0 -1
- package/dist/hooks/auto-slash-command/__tests__/detector.test.d.ts +0 -2
- package/dist/hooks/auto-slash-command/__tests__/detector.test.d.ts.map +0 -1
- package/dist/hooks/auto-slash-command/__tests__/detector.test.js +0 -70
- package/dist/hooks/auto-slash-command/__tests__/detector.test.js.map +0 -1
- package/dist/hooks/auto-slash-command/__tests__/executor.test.d.ts +0 -2
- package/dist/hooks/auto-slash-command/__tests__/executor.test.d.ts.map +0 -1
- package/dist/hooks/auto-slash-command/__tests__/executor.test.js +0 -55
- package/dist/hooks/auto-slash-command/__tests__/executor.test.js.map +0 -1
- package/dist/hooks/auto-slash-command/__tests__/index.test.d.ts +0 -2
- package/dist/hooks/auto-slash-command/__tests__/index.test.d.ts.map +0 -1
- package/dist/hooks/auto-slash-command/__tests__/index.test.js +0 -50
- package/dist/hooks/auto-slash-command/__tests__/index.test.js.map +0 -1
- package/dist/hooks/autopilot/__tests__/cancel.test.d.ts +0 -2
- package/dist/hooks/autopilot/__tests__/cancel.test.d.ts.map +0 -1
- package/dist/hooks/autopilot/__tests__/cancel.test.js +0 -606
- package/dist/hooks/autopilot/__tests__/cancel.test.js.map +0 -1
- package/dist/hooks/autopilot/__tests__/prompts.test.d.ts +0 -2
- package/dist/hooks/autopilot/__tests__/prompts.test.d.ts.map +0 -1
- package/dist/hooks/autopilot/__tests__/prompts.test.js +0 -92
- package/dist/hooks/autopilot/__tests__/prompts.test.js.map +0 -1
- package/dist/hooks/autopilot/__tests__/state.test.d.ts +0 -2
- package/dist/hooks/autopilot/__tests__/state.test.d.ts.map +0 -1
- package/dist/hooks/autopilot/__tests__/state.test.js +0 -76
- package/dist/hooks/autopilot/__tests__/state.test.js.map +0 -1
- package/dist/hooks/autopilot/__tests__/summary.test.d.ts +0 -2
- package/dist/hooks/autopilot/__tests__/summary.test.d.ts.map +0 -1
- package/dist/hooks/autopilot/__tests__/summary.test.js +0 -324
- package/dist/hooks/autopilot/__tests__/summary.test.js.map +0 -1
- package/dist/hooks/autopilot/__tests__/transition.test.d.ts +0 -2
- package/dist/hooks/autopilot/__tests__/transition.test.d.ts.map +0 -1
- package/dist/hooks/autopilot/__tests__/transition.test.js +0 -58
- package/dist/hooks/autopilot/__tests__/transition.test.js.map +0 -1
- package/dist/hooks/autopilot/__tests__/transitions.test.d.ts +0 -12
- package/dist/hooks/autopilot/__tests__/transitions.test.d.ts.map +0 -1
- package/dist/hooks/autopilot/__tests__/transitions.test.js +0 -303
- package/dist/hooks/autopilot/__tests__/transitions.test.js.map +0 -1
- package/dist/hooks/autopilot/__tests__/validation.test.d.ts +0 -2
- package/dist/hooks/autopilot/__tests__/validation.test.d.ts.map +0 -1
- package/dist/hooks/autopilot/__tests__/validation.test.js +0 -450
- package/dist/hooks/autopilot/__tests__/validation.test.js.map +0 -1
- package/dist/hooks/beads-context/__tests__/index.test.d.ts +0 -2
- package/dist/hooks/beads-context/__tests__/index.test.d.ts.map +0 -1
- package/dist/hooks/beads-context/__tests__/index.test.js +0 -150
- package/dist/hooks/beads-context/__tests__/index.test.js.map +0 -1
- package/dist/hooks/empty-message-sanitizer/__tests__/index.test.d.ts +0 -2
- package/dist/hooks/empty-message-sanitizer/__tests__/index.test.d.ts.map +0 -1
- package/dist/hooks/empty-message-sanitizer/__tests__/index.test.js +0 -416
- package/dist/hooks/empty-message-sanitizer/__tests__/index.test.js.map +0 -1
- package/dist/hooks/keyword-detector/__tests__/index.test.d.ts +0 -2
- package/dist/hooks/keyword-detector/__tests__/index.test.d.ts.map +0 -1
- package/dist/hooks/keyword-detector/__tests__/index.test.js +0 -868
- package/dist/hooks/keyword-detector/__tests__/index.test.js.map +0 -1
- package/dist/hooks/learner/__tests__/confidence.test.d.ts +0 -2
- package/dist/hooks/learner/__tests__/confidence.test.d.ts.map +0 -1
- package/dist/hooks/learner/__tests__/confidence.test.js +0 -42
- package/dist/hooks/learner/__tests__/confidence.test.js.map +0 -1
- package/dist/hooks/learner/__tests__/detector.test.d.ts +0 -2
- package/dist/hooks/learner/__tests__/detector.test.d.ts.map +0 -1
- package/dist/hooks/learner/__tests__/detector.test.js +0 -170
- package/dist/hooks/learner/__tests__/detector.test.js.map +0 -1
- package/dist/hooks/learner/__tests__/index-manager-filter.test.d.ts +0 -14
- package/dist/hooks/learner/__tests__/index-manager-filter.test.d.ts.map +0 -1
- package/dist/hooks/learner/__tests__/index-manager-filter.test.js +0 -147
- package/dist/hooks/learner/__tests__/index-manager-filter.test.js.map +0 -1
- package/dist/hooks/learner/__tests__/index-manager-import.test.d.ts +0 -2
- package/dist/hooks/learner/__tests__/index-manager-import.test.d.ts.map +0 -1
- package/dist/hooks/learner/__tests__/index-manager-import.test.js +0 -43
- package/dist/hooks/learner/__tests__/index-manager-import.test.js.map +0 -1
- package/dist/hooks/learner/__tests__/index.test.d.ts +0 -2
- package/dist/hooks/learner/__tests__/index.test.d.ts.map +0 -1
- package/dist/hooks/learner/__tests__/index.test.js +0 -48
- package/dist/hooks/learner/__tests__/index.test.js.map +0 -1
- package/dist/hooks/learner/__tests__/learning-queue-parser.test.d.ts +0 -10
- package/dist/hooks/learner/__tests__/learning-queue-parser.test.d.ts.map +0 -1
- package/dist/hooks/learner/__tests__/learning-queue-parser.test.js +0 -131
- package/dist/hooks/learner/__tests__/learning-queue-parser.test.js.map +0 -1
- package/dist/hooks/learner/__tests__/matcher.test.d.ts +0 -2
- package/dist/hooks/learner/__tests__/matcher.test.d.ts.map +0 -1
- package/dist/hooks/learner/__tests__/matcher.test.js +0 -114
- package/dist/hooks/learner/__tests__/matcher.test.js.map +0 -1
- package/dist/hooks/learner/__tests__/promotion.test.d.ts +0 -2
- package/dist/hooks/learner/__tests__/promotion.test.d.ts.map +0 -1
- package/dist/hooks/learner/__tests__/promotion.test.js +0 -146
- package/dist/hooks/learner/__tests__/promotion.test.js.map +0 -1
- package/dist/hooks/learner/__tests__/queue-archiver.test.d.ts +0 -13
- package/dist/hooks/learner/__tests__/queue-archiver.test.d.ts.map +0 -1
- package/dist/hooks/learner/__tests__/queue-archiver.test.js +0 -162
- package/dist/hooks/learner/__tests__/queue-archiver.test.js.map +0 -1
- package/dist/hooks/learner/__tests__/reflection-archiver.test.d.ts +0 -14
- package/dist/hooks/learner/__tests__/reflection-archiver.test.d.ts.map +0 -1
- package/dist/hooks/learner/__tests__/reflection-archiver.test.js +0 -159
- package/dist/hooks/learner/__tests__/reflection-archiver.test.js.map +0 -1
- package/dist/hooks/learner/__tests__/reflection-parser.test.d.ts +0 -14
- package/dist/hooks/learner/__tests__/reflection-parser.test.d.ts.map +0 -1
- package/dist/hooks/learner/__tests__/reflection-parser.test.js +0 -201
- package/dist/hooks/learner/__tests__/reflection-parser.test.js.map +0 -1
- package/dist/hooks/learner/__tests__/validator.test.d.ts +0 -2
- package/dist/hooks/learner/__tests__/validator.test.d.ts.map +0 -1
- package/dist/hooks/learner/__tests__/validator.test.js +0 -123
- package/dist/hooks/learner/__tests__/validator.test.js.map +0 -1
- package/dist/hooks/learner/__tests__/writer.test.d.ts +0 -2
- package/dist/hooks/learner/__tests__/writer.test.d.ts.map +0 -1
- package/dist/hooks/learner/__tests__/writer.test.js +0 -141
- package/dist/hooks/learner/__tests__/writer.test.js.map +0 -1
- package/dist/hooks/mode-registry/__tests__/session-isolation.test.d.ts +0 -2
- package/dist/hooks/mode-registry/__tests__/session-isolation.test.d.ts.map +0 -1
- package/dist/hooks/mode-registry/__tests__/session-isolation.test.js +0 -236
- package/dist/hooks/mode-registry/__tests__/session-isolation.test.js.map +0 -1
- package/dist/hooks/nexus/__tests__/config.test.d.ts +0 -2
- package/dist/hooks/nexus/__tests__/config.test.d.ts.map +0 -1
- package/dist/hooks/nexus/__tests__/config.test.js +0 -38
- package/dist/hooks/nexus/__tests__/config.test.js.map +0 -1
- package/dist/hooks/nexus/__tests__/consciousness-sync.test.d.ts +0 -2
- package/dist/hooks/nexus/__tests__/consciousness-sync.test.d.ts.map +0 -1
- package/dist/hooks/nexus/__tests__/consciousness-sync.test.js +0 -28
- package/dist/hooks/nexus/__tests__/consciousness-sync.test.js.map +0 -1
- package/dist/hooks/nexus/__tests__/data-collector.test.d.ts +0 -2
- package/dist/hooks/nexus/__tests__/data-collector.test.d.ts.map +0 -1
- package/dist/hooks/nexus/__tests__/data-collector.test.js +0 -61
- package/dist/hooks/nexus/__tests__/data-collector.test.js.map +0 -1
- package/dist/hooks/nexus/__tests__/improvement-puller.test.d.ts +0 -2
- package/dist/hooks/nexus/__tests__/improvement-puller.test.d.ts.map +0 -1
- package/dist/hooks/nexus/__tests__/improvement-puller.test.js +0 -49
- package/dist/hooks/nexus/__tests__/improvement-puller.test.js.map +0 -1
- package/dist/hooks/nexus/__tests__/session-end-hook.test.d.ts +0 -2
- package/dist/hooks/nexus/__tests__/session-end-hook.test.d.ts.map +0 -1
- package/dist/hooks/nexus/__tests__/session-end-hook.test.js +0 -39
- package/dist/hooks/nexus/__tests__/session-end-hook.test.js.map +0 -1
- package/dist/hooks/observability/__tests__/observability.test.d.ts +0 -2
- package/dist/hooks/observability/__tests__/observability.test.d.ts.map +0 -1
- package/dist/hooks/observability/__tests__/observability.test.js +0 -176
- package/dist/hooks/observability/__tests__/observability.test.js.map +0 -1
- package/dist/hooks/permission-handler/__tests__/index.test.d.ts +0 -2
- package/dist/hooks/permission-handler/__tests__/index.test.d.ts.map +0 -1
- package/dist/hooks/permission-handler/__tests__/index.test.js +0 -417
- package/dist/hooks/permission-handler/__tests__/index.test.js.map +0 -1
- package/dist/hooks/persistent-mode/__tests__/error-handling.test.d.ts +0 -6
- package/dist/hooks/persistent-mode/__tests__/error-handling.test.d.ts.map +0 -1
- package/dist/hooks/persistent-mode/__tests__/error-handling.test.js +0 -71
- package/dist/hooks/persistent-mode/__tests__/error-handling.test.js.map +0 -1
- package/dist/hooks/persistent-mode/__tests__/ralph-max-iteration.test.d.ts +0 -2
- package/dist/hooks/persistent-mode/__tests__/ralph-max-iteration.test.d.ts.map +0 -1
- package/dist/hooks/persistent-mode/__tests__/ralph-max-iteration.test.js +0 -38
- package/dist/hooks/persistent-mode/__tests__/ralph-max-iteration.test.js.map +0 -1
- package/dist/hooks/persistent-mode/__tests__/tool-error.test.d.ts +0 -6
- package/dist/hooks/persistent-mode/__tests__/tool-error.test.d.ts.map +0 -1
- package/dist/hooks/persistent-mode/__tests__/tool-error.test.js +0 -335
- package/dist/hooks/persistent-mode/__tests__/tool-error.test.js.map +0 -1
- package/dist/hooks/persistent-mode/session-isolation.test.d.ts +0 -2
- package/dist/hooks/persistent-mode/session-isolation.test.d.ts.map +0 -1
- package/dist/hooks/persistent-mode/session-isolation.test.js +0 -491
- package/dist/hooks/persistent-mode/session-isolation.test.js.map +0 -1
- package/dist/hooks/project-memory/__tests__/detector.test.d.ts +0 -5
- package/dist/hooks/project-memory/__tests__/detector.test.d.ts.map +0 -1
- package/dist/hooks/project-memory/__tests__/detector.test.js +0 -165
- package/dist/hooks/project-memory/__tests__/detector.test.js.map +0 -1
- package/dist/hooks/project-memory/__tests__/formatter.test.d.ts +0 -5
- package/dist/hooks/project-memory/__tests__/formatter.test.d.ts.map +0 -1
- package/dist/hooks/project-memory/__tests__/formatter.test.js +0 -262
- package/dist/hooks/project-memory/__tests__/formatter.test.js.map +0 -1
- package/dist/hooks/project-memory/__tests__/integration.test.d.ts +0 -5
- package/dist/hooks/project-memory/__tests__/integration.test.d.ts.map +0 -1
- package/dist/hooks/project-memory/__tests__/integration.test.js +0 -154
- package/dist/hooks/project-memory/__tests__/integration.test.js.map +0 -1
- package/dist/hooks/project-memory/__tests__/learner.test.d.ts +0 -5
- package/dist/hooks/project-memory/__tests__/learner.test.d.ts.map +0 -1
- package/dist/hooks/project-memory/__tests__/learner.test.js +0 -159
- package/dist/hooks/project-memory/__tests__/learner.test.js.map +0 -1
- package/dist/hooks/project-memory/__tests__/storage.test.d.ts +0 -5
- package/dist/hooks/project-memory/__tests__/storage.test.d.ts.map +0 -1
- package/dist/hooks/project-memory/__tests__/storage.test.js +0 -207
- package/dist/hooks/project-memory/__tests__/storage.test.js.map +0 -1
- package/dist/hooks/ralph/__tests__/loop.test.d.ts +0 -2
- package/dist/hooks/ralph/__tests__/loop.test.d.ts.map +0 -1
- package/dist/hooks/ralph/__tests__/loop.test.js +0 -268
- package/dist/hooks/ralph/__tests__/loop.test.js.map +0 -1
- package/dist/hooks/ralph/__tests__/prd.test.d.ts +0 -2
- package/dist/hooks/ralph/__tests__/prd.test.d.ts.map +0 -1
- package/dist/hooks/ralph/__tests__/prd.test.js +0 -197
- package/dist/hooks/ralph/__tests__/prd.test.js.map +0 -1
- package/dist/hooks/ralph/__tests__/progress.test.d.ts +0 -2
- package/dist/hooks/ralph/__tests__/progress.test.d.ts.map +0 -1
- package/dist/hooks/ralph/__tests__/progress.test.js +0 -120
- package/dist/hooks/ralph/__tests__/progress.test.js.map +0 -1
- package/dist/hooks/ralph/__tests__/verifier.test.d.ts +0 -2
- package/dist/hooks/ralph/__tests__/verifier.test.d.ts.map +0 -1
- package/dist/hooks/ralph/__tests__/verifier.test.js +0 -75
- package/dist/hooks/ralph/__tests__/verifier.test.js.map +0 -1
- package/dist/hooks/recovery/__tests__/context-window.test.d.ts +0 -2
- package/dist/hooks/recovery/__tests__/context-window.test.d.ts.map +0 -1
- package/dist/hooks/recovery/__tests__/context-window.test.js +0 -131
- package/dist/hooks/recovery/__tests__/context-window.test.js.map +0 -1
- package/dist/hooks/recovery/__tests__/edit-error.test.d.ts +0 -2
- package/dist/hooks/recovery/__tests__/edit-error.test.d.ts.map +0 -1
- package/dist/hooks/recovery/__tests__/edit-error.test.js +0 -88
- package/dist/hooks/recovery/__tests__/edit-error.test.js.map +0 -1
- package/dist/hooks/recovery/__tests__/index.test.d.ts +0 -2
- package/dist/hooks/recovery/__tests__/index.test.d.ts.map +0 -1
- package/dist/hooks/recovery/__tests__/index.test.js +0 -270
- package/dist/hooks/recovery/__tests__/index.test.js.map +0 -1
- package/dist/hooks/recovery/__tests__/session-recovery.test.d.ts +0 -2
- package/dist/hooks/recovery/__tests__/session-recovery.test.d.ts.map +0 -1
- package/dist/hooks/recovery/__tests__/session-recovery.test.js +0 -129
- package/dist/hooks/recovery/__tests__/session-recovery.test.js.map +0 -1
- package/dist/hooks/recovery/__tests__/storage.test.d.ts +0 -2
- package/dist/hooks/recovery/__tests__/storage.test.d.ts.map +0 -1
- package/dist/hooks/recovery/__tests__/storage.test.js +0 -549
- package/dist/hooks/recovery/__tests__/storage.test.js.map +0 -1
- package/dist/hooks/rules-injector/__tests__/finder.test.d.ts +0 -2
- package/dist/hooks/rules-injector/__tests__/finder.test.d.ts.map +0 -1
- package/dist/hooks/rules-injector/__tests__/finder.test.js +0 -68
- package/dist/hooks/rules-injector/__tests__/finder.test.js.map +0 -1
- package/dist/hooks/rules-injector/__tests__/index.test.d.ts +0 -2
- package/dist/hooks/rules-injector/__tests__/index.test.d.ts.map +0 -1
- package/dist/hooks/rules-injector/__tests__/index.test.js +0 -58
- package/dist/hooks/rules-injector/__tests__/index.test.js.map +0 -1
- package/dist/hooks/rules-injector/__tests__/matcher.test.d.ts +0 -2
- package/dist/hooks/rules-injector/__tests__/matcher.test.d.ts.map +0 -1
- package/dist/hooks/rules-injector/__tests__/matcher.test.js +0 -86
- package/dist/hooks/rules-injector/__tests__/matcher.test.js.map +0 -1
- package/dist/hooks/rules-injector/__tests__/parser.test.d.ts +0 -2
- package/dist/hooks/rules-injector/__tests__/parser.test.d.ts.map +0 -1
- package/dist/hooks/rules-injector/__tests__/parser.test.js +0 -86
- package/dist/hooks/rules-injector/__tests__/parser.test.js.map +0 -1
- package/dist/hooks/session-end/__tests__/callbacks.test.d.ts +0 -2
- package/dist/hooks/session-end/__tests__/callbacks.test.d.ts.map +0 -1
- package/dist/hooks/session-end/__tests__/callbacks.test.js +0 -382
- package/dist/hooks/session-end/__tests__/callbacks.test.js.map +0 -1
- package/dist/hooks/session-end/__tests__/index.test.d.ts +0 -2
- package/dist/hooks/session-end/__tests__/index.test.d.ts.map +0 -1
- package/dist/hooks/session-end/__tests__/index.test.js +0 -77
- package/dist/hooks/session-end/__tests__/index.test.js.map +0 -1
- package/dist/hooks/session-end/__tests__/nexus-integration.test.d.ts +0 -2
- package/dist/hooks/session-end/__tests__/nexus-integration.test.d.ts.map +0 -1
- package/dist/hooks/session-end/__tests__/nexus-integration.test.js +0 -30
- package/dist/hooks/session-end/__tests__/nexus-integration.test.js.map +0 -1
- package/dist/hooks/session-end/__tests__/python-repl-cleanup.test.d.ts +0 -2
- package/dist/hooks/session-end/__tests__/python-repl-cleanup.test.d.ts.map +0 -1
- package/dist/hooks/session-end/__tests__/python-repl-cleanup.test.js +0 -46
- package/dist/hooks/session-end/__tests__/python-repl-cleanup.test.js.map +0 -1
- package/dist/hooks/session-end/__tests__/session-duration.test.d.ts +0 -2
- package/dist/hooks/session-end/__tests__/session-duration.test.d.ts.map +0 -1
- package/dist/hooks/session-end/__tests__/session-duration.test.js +0 -236
- package/dist/hooks/session-end/__tests__/session-duration.test.js.map +0 -1
- package/dist/hooks/session-end/__tests__/session-end-bridge-cleanup.test.d.ts +0 -2
- package/dist/hooks/session-end/__tests__/session-end-bridge-cleanup.test.d.ts.map +0 -1
- package/dist/hooks/session-end/__tests__/session-end-bridge-cleanup.test.js +0 -58
- package/dist/hooks/session-end/__tests__/session-end-bridge-cleanup.test.js.map +0 -1
- package/dist/hooks/setup/__tests__/index.test.d.ts +0 -2
- package/dist/hooks/setup/__tests__/index.test.d.ts.map +0 -1
- package/dist/hooks/setup/__tests__/index.test.js +0 -68
- package/dist/hooks/setup/__tests__/index.test.js.map +0 -1
- package/dist/hooks/setup/__tests__/prune.test.d.ts +0 -2
- package/dist/hooks/setup/__tests__/prune.test.d.ts.map +0 -1
- package/dist/hooks/setup/__tests__/prune.test.js +0 -94
- package/dist/hooks/setup/__tests__/prune.test.js.map +0 -1
- package/dist/hooks/subagent-tracker/__tests__/flow-tracer.test.d.ts +0 -2
- package/dist/hooks/subagent-tracker/__tests__/flow-tracer.test.d.ts.map +0 -1
- package/dist/hooks/subagent-tracker/__tests__/flow-tracer.test.js +0 -107
- package/dist/hooks/subagent-tracker/__tests__/flow-tracer.test.js.map +0 -1
- package/dist/hooks/subagent-tracker/__tests__/flush-race.test.d.ts +0 -2
- package/dist/hooks/subagent-tracker/__tests__/flush-race.test.d.ts.map +0 -1
- package/dist/hooks/subagent-tracker/__tests__/flush-race.test.js +0 -376
- package/dist/hooks/subagent-tracker/__tests__/flush-race.test.js.map +0 -1
- package/dist/hooks/subagent-tracker/__tests__/index.test.d.ts +0 -2
- package/dist/hooks/subagent-tracker/__tests__/index.test.d.ts.map +0 -1
- package/dist/hooks/subagent-tracker/__tests__/index.test.js +0 -818
- package/dist/hooks/subagent-tracker/__tests__/index.test.js.map +0 -1
- package/dist/hooks/subagent-tracker/__tests__/session-replay.test.d.ts +0 -2
- package/dist/hooks/subagent-tracker/__tests__/session-replay.test.d.ts.map +0 -1
- package/dist/hooks/subagent-tracker/__tests__/session-replay.test.js +0 -139
- package/dist/hooks/subagent-tracker/__tests__/session-replay.test.js.map +0 -1
- package/dist/hooks/subagent-tracker/__tests__/syncSleep.test.d.ts +0 -10
- package/dist/hooks/subagent-tracker/__tests__/syncSleep.test.d.ts.map +0 -1
- package/dist/hooks/subagent-tracker/__tests__/syncSleep.test.js +0 -112
- package/dist/hooks/subagent-tracker/__tests__/syncSleep.test.js.map +0 -1
- package/dist/hooks/team-pipeline/__tests__/state.test.d.ts +0 -2
- package/dist/hooks/team-pipeline/__tests__/state.test.d.ts.map +0 -1
- package/dist/hooks/team-pipeline/__tests__/state.test.js +0 -94
- package/dist/hooks/team-pipeline/__tests__/state.test.js.map +0 -1
- package/dist/hooks/team-pipeline/__tests__/transitions.test.d.ts +0 -2
- package/dist/hooks/team-pipeline/__tests__/transitions.test.d.ts.map +0 -1
- package/dist/hooks/team-pipeline/__tests__/transitions.test.js +0 -156
- package/dist/hooks/team-pipeline/__tests__/transitions.test.js.map +0 -1
- package/dist/hooks/think-mode/__tests__/index.test.d.ts +0 -2
- package/dist/hooks/think-mode/__tests__/index.test.d.ts.map +0 -1
- package/dist/hooks/think-mode/__tests__/index.test.js +0 -556
- package/dist/hooks/think-mode/__tests__/index.test.js.map +0 -1
- package/dist/hooks/todo-continuation/__tests__/isUserAbort.test.d.ts +0 -2
- package/dist/hooks/todo-continuation/__tests__/isUserAbort.test.d.ts.map +0 -1
- package/dist/hooks/todo-continuation/__tests__/isUserAbort.test.js +0 -119
- package/dist/hooks/todo-continuation/__tests__/isUserAbort.test.js.map +0 -1
- package/dist/hooks/ultrawork/session-isolation.test.d.ts +0 -2
- package/dist/hooks/ultrawork/session-isolation.test.d.ts.map +0 -1
- package/dist/hooks/ultrawork/session-isolation.test.js +0 -333
- package/dist/hooks/ultrawork/session-isolation.test.js.map +0 -1
- package/dist/installer/__tests__/claude-md-merge.test.d.ts +0 -6
- package/dist/installer/__tests__/claude-md-merge.test.d.ts.map +0 -1
- package/dist/installer/__tests__/claude-md-merge.test.js +0 -220
- package/dist/installer/__tests__/claude-md-merge.test.js.map +0 -1
- package/dist/installer/__tests__/hooks.test.d.ts +0 -6
- package/dist/installer/__tests__/hooks.test.d.ts.map +0 -1
- package/dist/installer/__tests__/hooks.test.js +0 -121
- package/dist/installer/__tests__/hooks.test.js.map +0 -1
- package/dist/installer/__tests__/safe-installer.test.d.ts +0 -6
- package/dist/installer/__tests__/safe-installer.test.d.ts.map +0 -1
- package/dist/installer/__tests__/safe-installer.test.js +0 -185
- package/dist/installer/__tests__/safe-installer.test.js.map +0 -1
- package/dist/lib/__tests__/atomic-write.test.d.ts +0 -2
- package/dist/lib/__tests__/atomic-write.test.d.ts.map +0 -1
- package/dist/lib/__tests__/atomic-write.test.js +0 -196
- package/dist/lib/__tests__/atomic-write.test.js.map +0 -1
- package/dist/lib/__tests__/file-lock.test.d.ts +0 -13
- package/dist/lib/__tests__/file-lock.test.d.ts.map +0 -1
- package/dist/lib/__tests__/file-lock.test.js +0 -122
- package/dist/lib/__tests__/file-lock.test.js.map +0 -1
- package/dist/lib/__tests__/plugin-deps.test.d.ts +0 -2
- package/dist/lib/__tests__/plugin-deps.test.d.ts.map +0 -1
- package/dist/lib/__tests__/plugin-deps.test.js +0 -58
- package/dist/lib/__tests__/plugin-deps.test.js.map +0 -1
- package/dist/lib/__tests__/plugin-marketplace.test.d.ts +0 -2
- package/dist/lib/__tests__/plugin-marketplace.test.d.ts.map +0 -1
- package/dist/lib/__tests__/plugin-marketplace.test.js +0 -52
- package/dist/lib/__tests__/plugin-marketplace.test.js.map +0 -1
- package/dist/lib/__tests__/plugin-registry.test.d.ts +0 -2
- package/dist/lib/__tests__/plugin-registry.test.d.ts.map +0 -1
- package/dist/lib/__tests__/plugin-registry.test.js +0 -241
- package/dist/lib/__tests__/plugin-registry.test.js.map +0 -1
- package/dist/lib/__tests__/plugin-rollback.test.d.ts +0 -2
- package/dist/lib/__tests__/plugin-rollback.test.d.ts.map +0 -1
- package/dist/lib/__tests__/plugin-rollback.test.js +0 -60
- package/dist/lib/__tests__/plugin-rollback.test.js.map +0 -1
- package/dist/lib/__tests__/plugin-security.test.d.ts +0 -2
- package/dist/lib/__tests__/plugin-security.test.d.ts.map +0 -1
- package/dist/lib/__tests__/plugin-security.test.js +0 -70
- package/dist/lib/__tests__/plugin-security.test.js.map +0 -1
- package/dist/lib/__tests__/validateMode.test.d.ts +0 -2
- package/dist/lib/__tests__/validateMode.test.d.ts.map +0 -1
- package/dist/lib/__tests__/validateMode.test.js +0 -61
- package/dist/lib/__tests__/validateMode.test.js.map +0 -1
- package/dist/lib/__tests__/version.test.d.ts +0 -6
- package/dist/lib/__tests__/version.test.d.ts.map +0 -1
- package/dist/lib/__tests__/version.test.js +0 -37
- package/dist/lib/__tests__/version.test.js.map +0 -1
- package/dist/lib/__tests__/worktree-paths.test.d.ts +0 -2
- package/dist/lib/__tests__/worktree-paths.test.d.ts.map +0 -1
- package/dist/lib/__tests__/worktree-paths.test.js +0 -225
- package/dist/lib/__tests__/worktree-paths.test.js.map +0 -1
- package/dist/mcp/__tests__/cli-detection.test.d.ts +0 -2
- package/dist/mcp/__tests__/cli-detection.test.d.ts.map +0 -1
- package/dist/mcp/__tests__/cli-detection.test.js +0 -50
- package/dist/mcp/__tests__/cli-detection.test.js.map +0 -1
- package/dist/mcp/__tests__/codex-core.test.d.ts +0 -2
- package/dist/mcp/__tests__/codex-core.test.d.ts.map +0 -1
- package/dist/mcp/__tests__/codex-core.test.js +0 -143
- package/dist/mcp/__tests__/codex-core.test.js.map +0 -1
- package/dist/mcp/__tests__/codex-integration.test.d.ts +0 -2
- package/dist/mcp/__tests__/codex-integration.test.d.ts.map +0 -1
- package/dist/mcp/__tests__/codex-integration.test.js +0 -59
- package/dist/mcp/__tests__/codex-integration.test.js.map +0 -1
- package/dist/mcp/__tests__/codex-reasoning-effort.test.d.ts +0 -2
- package/dist/mcp/__tests__/codex-reasoning-effort.test.d.ts.map +0 -1
- package/dist/mcp/__tests__/codex-reasoning-effort.test.js +0 -141
- package/dist/mcp/__tests__/codex-reasoning-effort.test.js.map +0 -1
- package/dist/mcp/__tests__/gemini-core.test.d.ts +0 -2
- package/dist/mcp/__tests__/gemini-core.test.d.ts.map +0 -1
- package/dist/mcp/__tests__/gemini-core.test.js +0 -53
- package/dist/mcp/__tests__/gemini-core.test.js.map +0 -1
- package/dist/mcp/__tests__/gemini-integration.test.d.ts +0 -2
- package/dist/mcp/__tests__/gemini-integration.test.d.ts.map +0 -1
- package/dist/mcp/__tests__/gemini-integration.test.js +0 -50
- package/dist/mcp/__tests__/gemini-integration.test.js.map +0 -1
- package/dist/mcp/__tests__/gemini-yolo-env.test.d.ts +0 -2
- package/dist/mcp/__tests__/gemini-yolo-env.test.d.ts.map +0 -1
- package/dist/mcp/__tests__/gemini-yolo-env.test.js +0 -274
- package/dist/mcp/__tests__/gemini-yolo-env.test.js.map +0 -1
- package/dist/mcp/__tests__/job-state-db-deprecation.test.d.ts +0 -2
- package/dist/mcp/__tests__/job-state-db-deprecation.test.d.ts.map +0 -1
- package/dist/mcp/__tests__/job-state-db-deprecation.test.js +0 -166
- package/dist/mcp/__tests__/job-state-db-deprecation.test.js.map +0 -1
- package/dist/mcp/__tests__/omc-tools-server.test.d.ts +0 -2
- package/dist/mcp/__tests__/omc-tools-server.test.d.ts.map +0 -1
- package/dist/mcp/__tests__/omc-tools-server.test.js +0 -108
- package/dist/mcp/__tests__/omc-tools-server.test.js.map +0 -1
- package/dist/mcp/__tests__/prompt-injection.test.d.ts +0 -2
- package/dist/mcp/__tests__/prompt-injection.test.d.ts.map +0 -1
- package/dist/mcp/__tests__/prompt-injection.test.js +0 -86
- package/dist/mcp/__tests__/prompt-injection.test.js.map +0 -1
- package/dist/mcp/__tests__/shared-exec.test.d.ts +0 -2
- package/dist/mcp/__tests__/shared-exec.test.d.ts.map +0 -1
- package/dist/mcp/__tests__/shared-exec.test.js +0 -151
- package/dist/mcp/__tests__/shared-exec.test.js.map +0 -1
- package/dist/notifications/__tests__/config-merge.test.d.ts +0 -2
- package/dist/notifications/__tests__/config-merge.test.d.ts.map +0 -1
- package/dist/notifications/__tests__/config-merge.test.js +0 -242
- package/dist/notifications/__tests__/config-merge.test.js.map +0 -1
- package/dist/notifications/__tests__/config.test.d.ts +0 -2
- package/dist/notifications/__tests__/config.test.d.ts.map +0 -1
- package/dist/notifications/__tests__/config.test.js +0 -227
- package/dist/notifications/__tests__/config.test.js.map +0 -1
- package/dist/notifications/__tests__/dispatcher.test.d.ts +0 -2
- package/dist/notifications/__tests__/dispatcher.test.d.ts.map +0 -1
- package/dist/notifications/__tests__/dispatcher.test.js +0 -898
- package/dist/notifications/__tests__/dispatcher.test.js.map +0 -1
- package/dist/notifications/__tests__/formatter.test.d.ts +0 -2
- package/dist/notifications/__tests__/formatter.test.d.ts.map +0 -1
- package/dist/notifications/__tests__/formatter.test.js +0 -72
- package/dist/notifications/__tests__/formatter.test.js.map +0 -1
- package/dist/notifications/__tests__/notify-registry-integration.test.d.ts +0 -2
- package/dist/notifications/__tests__/notify-registry-integration.test.d.ts.map +0 -1
- package/dist/notifications/__tests__/notify-registry-integration.test.js +0 -349
- package/dist/notifications/__tests__/notify-registry-integration.test.js.map +0 -1
- package/dist/notifications/__tests__/profiles.test.d.ts +0 -2
- package/dist/notifications/__tests__/profiles.test.d.ts.map +0 -1
- package/dist/notifications/__tests__/profiles.test.js +0 -253
- package/dist/notifications/__tests__/profiles.test.js.map +0 -1
- package/dist/notifications/__tests__/reply-config.test.d.ts +0 -2
- package/dist/notifications/__tests__/reply-config.test.d.ts.map +0 -1
- package/dist/notifications/__tests__/reply-config.test.js +0 -213
- package/dist/notifications/__tests__/reply-config.test.js.map +0 -1
- package/dist/notifications/__tests__/reply-listener.test.d.ts +0 -2
- package/dist/notifications/__tests__/reply-listener.test.d.ts.map +0 -1
- package/dist/notifications/__tests__/reply-listener.test.js +0 -431
- package/dist/notifications/__tests__/reply-listener.test.js.map +0 -1
- package/dist/notifications/__tests__/session-registry.test.d.ts +0 -2
- package/dist/notifications/__tests__/session-registry.test.d.ts.map +0 -1
- package/dist/notifications/__tests__/session-registry.test.js +0 -465
- package/dist/notifications/__tests__/session-registry.test.js.map +0 -1
- package/dist/notifications/__tests__/sleepMs.test.d.ts +0 -10
- package/dist/notifications/__tests__/sleepMs.test.d.ts.map +0 -1
- package/dist/notifications/__tests__/sleepMs.test.js +0 -117
- package/dist/notifications/__tests__/sleepMs.test.js.map +0 -1
- package/dist/notifications/__tests__/tmux.test.d.ts +0 -2
- package/dist/notifications/__tests__/tmux.test.d.ts.map +0 -1
- package/dist/notifications/__tests__/tmux.test.js +0 -137
- package/dist/notifications/__tests__/tmux.test.js.map +0 -1
- package/dist/skills/__tests__/ax-context-init.test.d.ts +0 -2
- package/dist/skills/__tests__/ax-context-init.test.d.ts.map +0 -1
- package/dist/skills/__tests__/ax-context-init.test.js +0 -36
- package/dist/skills/__tests__/ax-context-init.test.js.map +0 -1
- package/dist/skills/__tests__/mingw-escape.test.d.ts +0 -9
- package/dist/skills/__tests__/mingw-escape.test.d.ts.map +0 -1
- package/dist/skills/__tests__/mingw-escape.test.js +0 -105
- package/dist/skills/__tests__/mingw-escape.test.js.map +0 -1
- package/dist/team/__tests__/activity-log.test.d.ts +0 -2
- package/dist/team/__tests__/activity-log.test.d.ts.map +0 -1
- package/dist/team/__tests__/activity-log.test.js +0 -141
- package/dist/team/__tests__/activity-log.test.js.map +0 -1
- package/dist/team/__tests__/audit-log.test.d.ts +0 -2
- package/dist/team/__tests__/audit-log.test.d.ts.map +0 -1
- package/dist/team/__tests__/audit-log.test.js +0 -305
- package/dist/team/__tests__/audit-log.test.js.map +0 -1
- package/dist/team/__tests__/bridge-entry.test.d.ts +0 -2
- package/dist/team/__tests__/bridge-entry.test.d.ts.map +0 -1
- package/dist/team/__tests__/bridge-entry.test.js +0 -152
- package/dist/team/__tests__/bridge-entry.test.js.map +0 -1
- package/dist/team/__tests__/bridge-integration.test.d.ts +0 -2
- package/dist/team/__tests__/bridge-integration.test.d.ts.map +0 -1
- package/dist/team/__tests__/bridge-integration.test.js +0 -328
- package/dist/team/__tests__/bridge-integration.test.js.map +0 -1
- package/dist/team/__tests__/capabilities.test.d.ts +0 -2
- package/dist/team/__tests__/capabilities.test.d.ts.map +0 -1
- package/dist/team/__tests__/capabilities.test.js +0 -97
- package/dist/team/__tests__/capabilities.test.js.map +0 -1
- package/dist/team/__tests__/deadlock-detector.test.d.ts +0 -2
- package/dist/team/__tests__/deadlock-detector.test.d.ts.map +0 -1
- package/dist/team/__tests__/deadlock-detector.test.js +0 -50
- package/dist/team/__tests__/deadlock-detector.test.js.map +0 -1
- package/dist/team/__tests__/dependency-graph.test.d.ts +0 -2
- package/dist/team/__tests__/dependency-graph.test.d.ts.map +0 -1
- package/dist/team/__tests__/dependency-graph.test.js +0 -29
- package/dist/team/__tests__/dependency-graph.test.js.map +0 -1
- package/dist/team/__tests__/edge-cases.test.d.ts +0 -16
- package/dist/team/__tests__/edge-cases.test.d.ts.map +0 -1
- package/dist/team/__tests__/edge-cases.test.js +0 -737
- package/dist/team/__tests__/edge-cases.test.js.map +0 -1
- package/dist/team/__tests__/fs-utils.test.d.ts +0 -2
- package/dist/team/__tests__/fs-utils.test.d.ts.map +0 -1
- package/dist/team/__tests__/fs-utils.test.js +0 -74
- package/dist/team/__tests__/fs-utils.test.js.map +0 -1
- package/dist/team/__tests__/git-worktree.test.d.ts +0 -2
- package/dist/team/__tests__/git-worktree.test.d.ts.map +0 -1
- package/dist/team/__tests__/git-worktree.test.js +0 -90
- package/dist/team/__tests__/git-worktree.test.js.map +0 -1
- package/dist/team/__tests__/heartbeat.test.d.ts +0 -2
- package/dist/team/__tests__/heartbeat.test.d.ts.map +0 -1
- package/dist/team/__tests__/heartbeat.test.js +0 -93
- package/dist/team/__tests__/heartbeat.test.js.map +0 -1
- package/dist/team/__tests__/inbox-outbox.test.d.ts +0 -2
- package/dist/team/__tests__/inbox-outbox.test.d.ts.map +0 -1
- package/dist/team/__tests__/inbox-outbox.test.js +0 -220
- package/dist/team/__tests__/inbox-outbox.test.js.map +0 -1
- package/dist/team/__tests__/mcp-team-bridge.test.d.ts +0 -2
- package/dist/team/__tests__/mcp-team-bridge.test.d.ts.map +0 -1
- package/dist/team/__tests__/mcp-team-bridge.test.js +0 -458
- package/dist/team/__tests__/mcp-team-bridge.test.js.map +0 -1
- package/dist/team/__tests__/merge-coordinator.test.d.ts +0 -2
- package/dist/team/__tests__/merge-coordinator.test.d.ts.map +0 -1
- package/dist/team/__tests__/merge-coordinator.test.js +0 -128
- package/dist/team/__tests__/merge-coordinator.test.js.map +0 -1
- package/dist/team/__tests__/message-router.test.d.ts +0 -2
- package/dist/team/__tests__/message-router.test.d.ts.map +0 -1
- package/dist/team/__tests__/message-router.test.js +0 -78
- package/dist/team/__tests__/message-router.test.js.map +0 -1
- package/dist/team/__tests__/outbox-reader.test.d.ts +0 -2
- package/dist/team/__tests__/outbox-reader.test.d.ts.map +0 -1
- package/dist/team/__tests__/outbox-reader.test.js +0 -134
- package/dist/team/__tests__/outbox-reader.test.js.map +0 -1
- package/dist/team/__tests__/permissions.test.d.ts +0 -2
- package/dist/team/__tests__/permissions.test.d.ts.map +0 -1
- package/dist/team/__tests__/permissions.test.js +0 -255
- package/dist/team/__tests__/permissions.test.js.map +0 -1
- package/dist/team/__tests__/prompt-sanitization.test.d.ts +0 -2
- package/dist/team/__tests__/prompt-sanitization.test.d.ts.map +0 -1
- package/dist/team/__tests__/prompt-sanitization.test.js +0 -150
- package/dist/team/__tests__/prompt-sanitization.test.js.map +0 -1
- package/dist/team/__tests__/summary-report.test.d.ts +0 -2
- package/dist/team/__tests__/summary-report.test.d.ts.map +0 -1
- package/dist/team/__tests__/summary-report.test.js +0 -196
- package/dist/team/__tests__/summary-report.test.js.map +0 -1
- package/dist/team/__tests__/task-file-ops.test.d.ts +0 -2
- package/dist/team/__tests__/task-file-ops.test.d.ts.map +0 -1
- package/dist/team/__tests__/task-file-ops.test.js +0 -392
- package/dist/team/__tests__/task-file-ops.test.js.map +0 -1
- package/dist/team/__tests__/task-router.test.d.ts +0 -2
- package/dist/team/__tests__/task-router.test.d.ts.map +0 -1
- package/dist/team/__tests__/task-router.test.js +0 -118
- package/dist/team/__tests__/task-router.test.js.map +0 -1
- package/dist/team/__tests__/team-registration.test.d.ts +0 -2
- package/dist/team/__tests__/team-registration.test.d.ts.map +0 -1
- package/dist/team/__tests__/team-registration.test.js +0 -90
- package/dist/team/__tests__/team-registration.test.js.map +0 -1
- package/dist/team/__tests__/team-status.test.d.ts +0 -2
- package/dist/team/__tests__/team-status.test.d.ts.map +0 -1
- package/dist/team/__tests__/team-status.test.js +0 -146
- package/dist/team/__tests__/team-status.test.js.map +0 -1
- package/dist/team/__tests__/tmux-session.test.d.ts +0 -2
- package/dist/team/__tests__/tmux-session.test.d.ts.map +0 -1
- package/dist/team/__tests__/tmux-session.test.js +0 -60
- package/dist/team/__tests__/tmux-session.test.js.map +0 -1
- package/dist/team/__tests__/unified-team.test.d.ts +0 -2
- package/dist/team/__tests__/unified-team.test.d.ts.map +0 -1
- package/dist/team/__tests__/unified-team.test.js +0 -77
- package/dist/team/__tests__/unified-team.test.js.map +0 -1
- package/dist/team/__tests__/usage-tracker.test.d.ts +0 -2
- package/dist/team/__tests__/usage-tracker.test.d.ts.map +0 -1
- package/dist/team/__tests__/usage-tracker.test.js +0 -106
- package/dist/team/__tests__/usage-tracker.test.js.map +0 -1
- package/dist/team/__tests__/worker-health.test.d.ts +0 -2
- package/dist/team/__tests__/worker-health.test.d.ts.map +0 -1
- package/dist/team/__tests__/worker-health.test.js +0 -129
- package/dist/team/__tests__/worker-health.test.js.map +0 -1
- package/dist/team/__tests__/worker-restart.test.d.ts +0 -2
- package/dist/team/__tests__/worker-restart.test.d.ts.map +0 -1
- package/dist/team/__tests__/worker-restart.test.js +0 -122
- package/dist/team/__tests__/worker-restart.test.js.map +0 -1
- package/dist/tools/__tests__/ast-tools.test.d.ts +0 -2
- package/dist/tools/__tests__/ast-tools.test.d.ts.map +0 -1
- package/dist/tools/__tests__/ast-tools.test.js +0 -178
- package/dist/tools/__tests__/ast-tools.test.js.map +0 -1
- package/dist/tools/__tests__/lsp-tools.test.d.ts +0 -2
- package/dist/tools/__tests__/lsp-tools.test.d.ts.map +0 -1
- package/dist/tools/__tests__/lsp-tools.test.js +0 -252
- package/dist/tools/__tests__/lsp-tools.test.js.map +0 -1
- package/dist/tools/__tests__/schema-conversion.test.d.ts +0 -11
- package/dist/tools/__tests__/schema-conversion.test.d.ts.map +0 -1
- package/dist/tools/__tests__/schema-conversion.test.js +0 -270
- package/dist/tools/__tests__/schema-conversion.test.js.map +0 -1
- package/dist/tools/__tests__/state-tools.test.d.ts +0 -2
- package/dist/tools/__tests__/state-tools.test.d.ts.map +0 -1
- package/dist/tools/__tests__/state-tools.test.js +0 -444
- package/dist/tools/__tests__/state-tools.test.js.map +0 -1
- package/dist/tools/diagnostics/__tests__/index.test.d.ts +0 -2
- package/dist/tools/diagnostics/__tests__/index.test.d.ts.map +0 -1
- package/dist/tools/diagnostics/__tests__/index.test.js +0 -111
- package/dist/tools/diagnostics/__tests__/index.test.js.map +0 -1
- package/dist/tools/diagnostics/__tests__/lsp-aggregator.test.d.ts +0 -2
- package/dist/tools/diagnostics/__tests__/lsp-aggregator.test.d.ts.map +0 -1
- package/dist/tools/diagnostics/__tests__/lsp-aggregator.test.js +0 -120
- package/dist/tools/diagnostics/__tests__/lsp-aggregator.test.js.map +0 -1
- package/dist/tools/diagnostics/__tests__/tsc-runner.test.d.ts +0 -2
- package/dist/tools/diagnostics/__tests__/tsc-runner.test.d.ts.map +0 -1
- package/dist/tools/diagnostics/__tests__/tsc-runner.test.js +0 -86
- package/dist/tools/diagnostics/__tests__/tsc-runner.test.js.map +0 -1
- package/dist/tools/lsp/__tests__/client-eviction.test.d.ts +0 -2
- package/dist/tools/lsp/__tests__/client-eviction.test.d.ts.map +0 -1
- package/dist/tools/lsp/__tests__/client-eviction.test.js +0 -343
- package/dist/tools/lsp/__tests__/client-eviction.test.js.map +0 -1
- package/dist/tools/lsp/__tests__/client-timer-buffer.test.d.ts +0 -11
- package/dist/tools/lsp/__tests__/client-timer-buffer.test.d.ts.map +0 -1
- package/dist/tools/lsp/__tests__/client-timer-buffer.test.js +0 -222
- package/dist/tools/lsp/__tests__/client-timer-buffer.test.js.map +0 -1
- package/dist/tools/lsp/__tests__/client-win32-spawn.test.d.ts +0 -2
- package/dist/tools/lsp/__tests__/client-win32-spawn.test.d.ts.map +0 -1
- package/dist/tools/lsp/__tests__/client-win32-spawn.test.js +0 -84
- package/dist/tools/lsp/__tests__/client-win32-spawn.test.js.map +0 -1
- package/dist/tools/lsp/__tests__/command-exists.test.d.ts +0 -2
- package/dist/tools/lsp/__tests__/command-exists.test.d.ts.map +0 -1
- package/dist/tools/lsp/__tests__/command-exists.test.js +0 -104
- package/dist/tools/lsp/__tests__/command-exists.test.js.map +0 -1
- package/dist/tools/lsp/__tests__/utils.test.d.ts +0 -2
- package/dist/tools/lsp/__tests__/utils.test.d.ts.map +0 -1
- package/dist/tools/lsp/__tests__/utils.test.js +0 -338
- package/dist/tools/lsp/__tests__/utils.test.js.map +0 -1
- package/dist/tools/python-repl/__tests__/bridge-manager-cleanup.test.d.ts +0 -2
- package/dist/tools/python-repl/__tests__/bridge-manager-cleanup.test.d.ts.map +0 -1
- package/dist/tools/python-repl/__tests__/bridge-manager-cleanup.test.js +0 -76
- package/dist/tools/python-repl/__tests__/bridge-manager-cleanup.test.js.map +0 -1
- package/dist/tools/python-repl/__tests__/bridge-manager.test.d.ts +0 -2
- package/dist/tools/python-repl/__tests__/bridge-manager.test.d.ts.map +0 -1
- package/dist/tools/python-repl/__tests__/bridge-manager.test.js +0 -338
- package/dist/tools/python-repl/__tests__/bridge-manager.test.js.map +0 -1
- package/dist/tools/python-repl/__tests__/socket-client.test.d.ts +0 -2
- package/dist/tools/python-repl/__tests__/socket-client.test.d.ts.map +0 -1
- package/dist/tools/python-repl/__tests__/socket-client.test.js +0 -155
- package/dist/tools/python-repl/__tests__/socket-client.test.js.map +0 -1
- package/dist/utils/__tests__/paths.test.d.ts +0 -2
- package/dist/utils/__tests__/paths.test.d.ts.map +0 -1
- package/dist/utils/__tests__/paths.test.js +0 -88
- package/dist/utils/__tests__/paths.test.js.map +0 -1
- package/dist/utils/__tests__/string-width.test.d.ts +0 -6
- package/dist/utils/__tests__/string-width.test.d.ts.map +0 -1
- package/dist/utils/__tests__/string-width.test.js +0 -173
- package/dist/utils/__tests__/string-width.test.js.map +0 -1
- package/dist/verification/tier-selector.test.d.ts +0 -2
- package/dist/verification/tier-selector.test.d.ts.map +0 -1
- package/dist/verification/tier-selector.test.js +0 -282
- package/dist/verification/tier-selector.test.js.map +0 -1
|
@@ -1,605 +1,605 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* OMC Persistent Mode Hook (Node.js)
|
|
5
|
-
* Minimal continuation enforcer for all OMC modes.
|
|
6
|
-
* Stripped down for reliability — no optional imports, no PRD, no notepad pruning.
|
|
7
|
-
*
|
|
8
|
-
* Supported modes: ralph, autopilot, ultrapilot, swarm, ultrawork, ultraqa, pipeline
|
|
9
|
-
*/
|
|
10
|
-
|
|
11
|
-
const {
|
|
12
|
-
existsSync,
|
|
13
|
-
readFileSync,
|
|
14
|
-
writeFileSync,
|
|
15
|
-
readdirSync,
|
|
16
|
-
mkdirSync,
|
|
17
|
-
} = require("fs");
|
|
18
|
-
const { join, dirname, resolve, normalize } = require("path");
|
|
19
|
-
const { homedir } = require("os");
|
|
20
|
-
|
|
21
|
-
async function readStdin(timeoutMs = 5000) {
|
|
22
|
-
return new Promise((resolve) => {
|
|
23
|
-
const chunks = [];
|
|
24
|
-
let settled = false;
|
|
25
|
-
const timeout = setTimeout(() => {
|
|
26
|
-
if (!settled) { settled = true; process.stdin.removeAllListeners(); process.stdin.destroy(); resolve(Buffer.concat(chunks).toString("utf-8")); }
|
|
27
|
-
}, timeoutMs);
|
|
28
|
-
process.stdin.on("data", (chunk) => { chunks.push(chunk); });
|
|
29
|
-
process.stdin.on("end", () => { if (!settled) { settled = true; clearTimeout(timeout); resolve(Buffer.concat(chunks).toString("utf-8")); } });
|
|
30
|
-
process.stdin.on("error", () => { if (!settled) { settled = true; clearTimeout(timeout); resolve(""); } });
|
|
31
|
-
if (process.stdin.readableEnded) { if (!settled) { settled = true; clearTimeout(timeout); resolve(Buffer.concat(chunks).toString("utf-8")); } }
|
|
32
|
-
});
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
function readJsonFile(path) {
|
|
36
|
-
try {
|
|
37
|
-
if (!existsSync(path)) return null;
|
|
38
|
-
return JSON.parse(readFileSync(path, "utf-8"));
|
|
39
|
-
} catch {
|
|
40
|
-
return null;
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
function writeJsonFile(path, data) {
|
|
45
|
-
try {
|
|
46
|
-
// Ensure directory exists
|
|
47
|
-
const dir = dirname(path);
|
|
48
|
-
if (dir && dir !== "." && !existsSync(dir)) {
|
|
49
|
-
mkdirSync(dir, { recursive: true });
|
|
50
|
-
}
|
|
51
|
-
writeFileSync(path, JSON.stringify(data, null, 2));
|
|
52
|
-
return true;
|
|
53
|
-
} catch {
|
|
54
|
-
return false;
|
|
55
|
-
}
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
/**
|
|
59
|
-
* Send stop notification (fire-and-forget, non-blocking).
|
|
60
|
-
* Only notifies on first stop to avoid spam.
|
|
61
|
-
*/
|
|
62
|
-
async function sendStopNotification(modeName, stateData, sessionId, directory) {
|
|
63
|
-
// Only notify once per mode activation
|
|
64
|
-
if (stateData._stopNotified) return;
|
|
65
|
-
|
|
66
|
-
try {
|
|
67
|
-
const pluginRoot = process.env.CLAUDE_PLUGIN_ROOT;
|
|
68
|
-
if (!pluginRoot) return;
|
|
69
|
-
|
|
70
|
-
const { pathToFileURL } = require('url');
|
|
71
|
-
const { notify } = await import(pathToFileURL(join(pluginRoot, 'dist', 'notifications', 'index.js')).href);
|
|
72
|
-
|
|
73
|
-
await notify('session-stop', {
|
|
74
|
-
sessionId: sessionId,
|
|
75
|
-
projectPath: directory,
|
|
76
|
-
activeMode: modeName,
|
|
77
|
-
iteration: stateData.iteration || stateData.reinforcement_count || 1,
|
|
78
|
-
maxIterations: stateData.max_iterations || stateData.max_reinforcements || 100,
|
|
79
|
-
incompleteTasks: undefined, // Caller can override
|
|
80
|
-
}).catch(() => {});
|
|
81
|
-
|
|
82
|
-
// Mark as notified to prevent duplicate notifications
|
|
83
|
-
stateData._stopNotified = true;
|
|
84
|
-
} catch {
|
|
85
|
-
// Notification module not available, skip silently
|
|
86
|
-
}
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
/**
|
|
90
|
-
* Staleness threshold for mode states (2 hours in milliseconds).
|
|
91
|
-
* States older than this are treated as inactive to prevent stale state
|
|
92
|
-
* from causing the stop hook to malfunction in new sessions.
|
|
93
|
-
*/
|
|
94
|
-
const STALE_STATE_THRESHOLD_MS = 2 * 60 * 60 * 1000; // 2 hours
|
|
95
|
-
|
|
96
|
-
/**
|
|
97
|
-
* Check if a state is stale based on its timestamps.
|
|
98
|
-
* A state is considered stale if it hasn't been updated recently.
|
|
99
|
-
* We check both `last_checked_at` and `started_at` - using whichever is more recent.
|
|
100
|
-
*/
|
|
101
|
-
function isStaleState(state) {
|
|
102
|
-
if (!state) return true;
|
|
103
|
-
|
|
104
|
-
const lastChecked = state.last_checked_at
|
|
105
|
-
? new Date(state.last_checked_at).getTime()
|
|
106
|
-
: 0;
|
|
107
|
-
const startedAt = state.started_at ? new Date(state.started_at).getTime() : 0;
|
|
108
|
-
const mostRecent = Math.max(lastChecked, startedAt);
|
|
109
|
-
|
|
110
|
-
if (mostRecent === 0) return true; // No valid timestamps
|
|
111
|
-
|
|
112
|
-
const age = Date.now() - mostRecent;
|
|
113
|
-
return age > STALE_STATE_THRESHOLD_MS;
|
|
114
|
-
}
|
|
115
|
-
|
|
116
|
-
/**
|
|
117
|
-
* Normalize a path for comparison.
|
|
118
|
-
*/
|
|
119
|
-
function normalizePath(p) {
|
|
120
|
-
if (!p) return "";
|
|
121
|
-
let normalized = resolve(p);
|
|
122
|
-
normalized = normalize(normalized);
|
|
123
|
-
normalized = normalized.replace(/[\/\\]+$/, "");
|
|
124
|
-
if (process.platform === "win32") {
|
|
125
|
-
normalized = normalized.toLowerCase();
|
|
126
|
-
}
|
|
127
|
-
return normalized;
|
|
128
|
-
}
|
|
129
|
-
|
|
130
|
-
/**
|
|
131
|
-
* Check if a state belongs to the requesting session.
|
|
132
|
-
* When sessionId is known: require exact match with state.session_id.
|
|
133
|
-
* When sessionId is empty/unknown: only match state without session_id (legacy compat).
|
|
134
|
-
*/
|
|
135
|
-
function isSessionMatch(state, sessionId) {
|
|
136
|
-
if (!state) return false;
|
|
137
|
-
if (sessionId) {
|
|
138
|
-
// Session is known: require exact match
|
|
139
|
-
return state.session_id === sessionId;
|
|
140
|
-
}
|
|
141
|
-
// No session_id from hook: only match legacy state (no session_id in state)
|
|
142
|
-
return !state.session_id;
|
|
143
|
-
}
|
|
144
|
-
|
|
145
|
-
/**
|
|
146
|
-
* Check if a state belongs to the current project.
|
|
147
|
-
*/
|
|
148
|
-
function isStateForCurrentProject(
|
|
149
|
-
state,
|
|
150
|
-
currentDirectory,
|
|
151
|
-
isGlobalState = false,
|
|
152
|
-
) {
|
|
153
|
-
if (!state) return true;
|
|
154
|
-
|
|
155
|
-
if (!state.project_path) {
|
|
156
|
-
if (isGlobalState) {
|
|
157
|
-
return false;
|
|
158
|
-
}
|
|
159
|
-
return true;
|
|
160
|
-
}
|
|
161
|
-
|
|
162
|
-
return normalizePath(state.project_path) === normalizePath(currentDirectory);
|
|
163
|
-
}
|
|
164
|
-
|
|
165
|
-
/**
|
|
166
|
-
* Read state file from local location only.
|
|
167
|
-
*/
|
|
168
|
-
function readStateFile(stateDir, filename) {
|
|
169
|
-
const localPath = join(stateDir, filename);
|
|
170
|
-
const state = readJsonFile(localPath);
|
|
171
|
-
return { state, path: localPath, isGlobal: false };
|
|
172
|
-
}
|
|
173
|
-
|
|
174
|
-
/**
|
|
175
|
-
* Read state file with session-scoped path support and fallback to legacy path.
|
|
176
|
-
*/
|
|
177
|
-
function readStateFileWithSession(stateDir, filename, sessionId) {
|
|
178
|
-
// Try session-scoped path first (and ONLY) when sessionId is available
|
|
179
|
-
if (sessionId && /^[a-zA-Z0-9][a-zA-Z0-9_-]{0,255}$/.test(sessionId)) {
|
|
180
|
-
const sessionsDir = join(stateDir, 'sessions', sessionId);
|
|
181
|
-
const sessionPath = join(sessionsDir, filename);
|
|
182
|
-
const state = readJsonFile(sessionPath);
|
|
183
|
-
if (state) {
|
|
184
|
-
return { state, path: sessionPath, isGlobal: false };
|
|
185
|
-
}
|
|
186
|
-
// Session path not found — do NOT fall back to legacy
|
|
187
|
-
return { state: null, path: null, isGlobal: false };
|
|
188
|
-
}
|
|
189
|
-
// No sessionId: fall back to legacy path (backward compat)
|
|
190
|
-
return readStateFile(stateDir, filename);
|
|
191
|
-
}
|
|
192
|
-
|
|
193
|
-
/**
|
|
194
|
-
* Count incomplete Tasks from Claude Code's native Task system.
|
|
195
|
-
*/
|
|
196
|
-
function countIncompleteTasks(sessionId) {
|
|
197
|
-
if (!sessionId || typeof sessionId !== "string") return 0;
|
|
198
|
-
if (!/^[a-zA-Z0-9][a-zA-Z0-9_-]{0,255}$/.test(sessionId)) return 0;
|
|
199
|
-
|
|
200
|
-
const cfgDir = process.env.CLAUDE_CONFIG_DIR || join(homedir(), ".claude");
|
|
201
|
-
const taskDir = join(cfgDir, "tasks", sessionId);
|
|
202
|
-
if (!existsSync(taskDir)) return 0;
|
|
203
|
-
|
|
204
|
-
let count = 0;
|
|
205
|
-
try {
|
|
206
|
-
const files = readdirSync(taskDir).filter(
|
|
207
|
-
(f) => f.endsWith(".json") && f !== ".lock",
|
|
208
|
-
);
|
|
209
|
-
for (const file of files) {
|
|
210
|
-
try {
|
|
211
|
-
const content = readFileSync(join(taskDir, file), "utf-8");
|
|
212
|
-
const task = JSON.parse(content);
|
|
213
|
-
if (task.status === "pending" || task.status === "in_progress") count++;
|
|
214
|
-
} catch {
|
|
215
|
-
/* skip */
|
|
216
|
-
}
|
|
217
|
-
}
|
|
218
|
-
} catch {
|
|
219
|
-
/* skip */
|
|
220
|
-
}
|
|
221
|
-
return count;
|
|
222
|
-
}
|
|
223
|
-
|
|
224
|
-
function countIncompleteTodos(sessionId, projectDir) {
|
|
225
|
-
let count = 0;
|
|
226
|
-
|
|
227
|
-
// Session-specific todos only (no global scan)
|
|
228
|
-
if (
|
|
229
|
-
sessionId &&
|
|
230
|
-
typeof sessionId === "string" &&
|
|
231
|
-
/^[a-zA-Z0-9][a-zA-Z0-9_-]{0,255}$/.test(sessionId)
|
|
232
|
-
) {
|
|
233
|
-
const sessionTodoPath = join(
|
|
234
|
-
homedir(),
|
|
235
|
-
".claude",
|
|
236
|
-
"todos",
|
|
237
|
-
`${sessionId}.json`,
|
|
238
|
-
);
|
|
239
|
-
try {
|
|
240
|
-
const data = readJsonFile(sessionTodoPath);
|
|
241
|
-
const todos = Array.isArray(data)
|
|
242
|
-
? data
|
|
243
|
-
: Array.isArray(data?.todos)
|
|
244
|
-
? data.todos
|
|
245
|
-
: [];
|
|
246
|
-
count += todos.filter(
|
|
247
|
-
(t) => t.status !== "completed" && t.status !== "cancelled",
|
|
248
|
-
).length;
|
|
249
|
-
} catch {
|
|
250
|
-
/* skip */
|
|
251
|
-
}
|
|
252
|
-
}
|
|
253
|
-
|
|
254
|
-
// Project-local todos only
|
|
255
|
-
for (const path of [
|
|
256
|
-
join(projectDir, ".omc", "todos.json"),
|
|
257
|
-
join(projectDir, ".claude", "todos.json"),
|
|
258
|
-
]) {
|
|
259
|
-
try {
|
|
260
|
-
const data = readJsonFile(path);
|
|
261
|
-
const todos = Array.isArray(data)
|
|
262
|
-
? data
|
|
263
|
-
: Array.isArray(data?.todos)
|
|
264
|
-
? data.todos
|
|
265
|
-
: [];
|
|
266
|
-
count += todos.filter(
|
|
267
|
-
(t) => t.status !== "completed" && t.status !== "cancelled",
|
|
268
|
-
).length;
|
|
269
|
-
} catch {
|
|
270
|
-
/* skip */
|
|
271
|
-
}
|
|
272
|
-
}
|
|
273
|
-
|
|
274
|
-
return count;
|
|
275
|
-
}
|
|
276
|
-
|
|
277
|
-
/**
|
|
278
|
-
* Detect if stop was triggered by context-limit related reasons.
|
|
279
|
-
* When context is exhausted, Claude Code needs to stop so it can compact.
|
|
280
|
-
* Blocking these stops causes a deadlock: can't compact because can't stop,
|
|
281
|
-
* can't continue because context is full.
|
|
282
|
-
*
|
|
283
|
-
* See: https://github.com/liangjie559567/ultrapower/issues/213
|
|
284
|
-
*/
|
|
285
|
-
function isContextLimitStop(data) {
|
|
286
|
-
const reason = (data.stop_reason || data.stopReason || "").toLowerCase();
|
|
287
|
-
|
|
288
|
-
const contextPatterns = [
|
|
289
|
-
"context_limit",
|
|
290
|
-
"context_window",
|
|
291
|
-
"context_exceeded",
|
|
292
|
-
"context_full",
|
|
293
|
-
"max_context",
|
|
294
|
-
"token_limit",
|
|
295
|
-
"max_tokens",
|
|
296
|
-
"conversation_too_long",
|
|
297
|
-
"input_too_long",
|
|
298
|
-
];
|
|
299
|
-
|
|
300
|
-
if (contextPatterns.some((p) => reason.includes(p))) {
|
|
301
|
-
return true;
|
|
302
|
-
}
|
|
303
|
-
|
|
304
|
-
const endTurnReason = (
|
|
305
|
-
data.end_turn_reason ||
|
|
306
|
-
data.endTurnReason ||
|
|
307
|
-
""
|
|
308
|
-
).toLowerCase();
|
|
309
|
-
if (endTurnReason && contextPatterns.some((p) => endTurnReason.includes(p))) {
|
|
310
|
-
return true;
|
|
311
|
-
}
|
|
312
|
-
|
|
313
|
-
return false;
|
|
314
|
-
}
|
|
315
|
-
|
|
316
|
-
/**
|
|
317
|
-
* Detect if stop was triggered by user abort (Ctrl+C, cancel button, etc.)
|
|
318
|
-
*/
|
|
319
|
-
function isUserAbort(data) {
|
|
320
|
-
if (data.user_requested || data.userRequested) return true;
|
|
321
|
-
|
|
322
|
-
const reason = (data.stop_reason || data.stopReason || "").toLowerCase();
|
|
323
|
-
// Exact-match patterns: short generic words that cause false positives with .includes()
|
|
324
|
-
const exactPatterns = ["aborted", "abort", "cancel", "interrupt"];
|
|
325
|
-
// Substring patterns: compound words safe for .includes() matching
|
|
326
|
-
const substringPatterns = [
|
|
327
|
-
"user_cancel",
|
|
328
|
-
"user_interrupt",
|
|
329
|
-
"ctrl_c",
|
|
330
|
-
"manual_stop",
|
|
331
|
-
];
|
|
332
|
-
|
|
333
|
-
return (
|
|
334
|
-
exactPatterns.some((p) => reason === p) ||
|
|
335
|
-
substringPatterns.some((p) => reason.includes(p))
|
|
336
|
-
);
|
|
337
|
-
}
|
|
338
|
-
|
|
339
|
-
async function main() {
|
|
340
|
-
try {
|
|
341
|
-
const input = await readStdin();
|
|
342
|
-
let data = {};
|
|
343
|
-
try {
|
|
344
|
-
data = JSON.parse(input);
|
|
345
|
-
} catch {}
|
|
346
|
-
|
|
347
|
-
const directory = data.cwd || data.directory || process.cwd();
|
|
348
|
-
const sessionId = data.session_id || data.sessionId || "";
|
|
349
|
-
const stateDir = join(directory, ".omc", "state");
|
|
350
|
-
|
|
351
|
-
// CRITICAL: Never block context-limit stops.
|
|
352
|
-
// Blocking these causes a deadlock where Claude Code cannot compact.
|
|
353
|
-
// See: https://github.com/liangjie559567/ultrapower/issues/213
|
|
354
|
-
if (isContextLimitStop(data)) {
|
|
355
|
-
console.log(JSON.stringify({ continue: true, suppressOutput: true }));
|
|
356
|
-
return;
|
|
357
|
-
}
|
|
358
|
-
|
|
359
|
-
// Respect user abort (Ctrl+C, cancel)
|
|
360
|
-
if (isUserAbort(data)) {
|
|
361
|
-
console.log(JSON.stringify({ continue: true, suppressOutput: true }));
|
|
362
|
-
return;
|
|
363
|
-
}
|
|
364
|
-
|
|
365
|
-
// Read all mode states (session-scoped with legacy fallback)
|
|
366
|
-
const ralph = readStateFileWithSession(stateDir, "ralph-state.json", sessionId);
|
|
367
|
-
const autopilot = readStateFileWithSession(stateDir, "autopilot-state.json", sessionId);
|
|
368
|
-
const ultrapilot = readStateFileWithSession(stateDir, "ultrapilot-state.json", sessionId);
|
|
369
|
-
const ultrawork = readStateFileWithSession(stateDir, "ultrawork-state.json", sessionId);
|
|
370
|
-
const ultraqa = readStateFileWithSession(stateDir, "ultraqa-state.json", sessionId);
|
|
371
|
-
const pipeline = readStateFileWithSession(stateDir, "pipeline-state.json", sessionId);
|
|
372
|
-
|
|
373
|
-
// Swarm uses swarm-summary.json (not swarm-state.json) + marker file
|
|
374
|
-
const swarmMarker = existsSync(join(stateDir, "swarm-active.marker"));
|
|
375
|
-
const swarmSummary = readJsonFile(join(stateDir, "swarm-summary.json"));
|
|
376
|
-
|
|
377
|
-
// Count incomplete items (session-specific + project-local only)
|
|
378
|
-
const taskCount = countIncompleteTasks(sessionId);
|
|
379
|
-
const todoCount = countIncompleteTodos(sessionId, directory);
|
|
380
|
-
const totalIncomplete = taskCount + todoCount;
|
|
381
|
-
|
|
382
|
-
// Priority 1: Ralph Loop (explicit persistence mode)
|
|
383
|
-
// Skip if state is stale (older than 2 hours) - prevents blocking new sessions
|
|
384
|
-
if (ralph.state?.active && !isStaleState(ralph.state) && isSessionMatch(ralph.state, sessionId)) {
|
|
385
|
-
const iteration = ralph.state.iteration || 1;
|
|
386
|
-
const maxIter = ralph.state.max_iterations || 100;
|
|
387
|
-
|
|
388
|
-
if (iteration < maxIter) {
|
|
389
|
-
ralph.state.iteration = iteration + 1;
|
|
390
|
-
ralph.state.last_checked_at = new Date().toISOString();
|
|
391
|
-
writeJsonFile(ralph.path, ralph.state);
|
|
392
|
-
|
|
393
|
-
// Fire-and-forget notification
|
|
394
|
-
sendStopNotification('ralph', ralph.state, sessionId, directory).catch(() => {});
|
|
395
|
-
|
|
396
|
-
console.log(
|
|
397
|
-
JSON.stringify({
|
|
398
|
-
decision: "block",
|
|
399
|
-
reason: `[RALPH LOOP - ITERATION ${iteration + 1}/${maxIter}] Work is NOT done. Continue working.\nWhen FULLY complete (after Architect verification), run /ultrapower:cancel to cleanly exit ralph mode and clean up all state files. If cancel fails, retry with /ultrapower:cancel --force.\n${ralph.state.prompt ? `Task: ${ralph.state.prompt}` : ""}`,
|
|
400
|
-
}),
|
|
401
|
-
);
|
|
402
|
-
return;
|
|
403
|
-
}
|
|
404
|
-
}
|
|
405
|
-
|
|
406
|
-
// Priority 2: Autopilot (high-level orchestration)
|
|
407
|
-
if (autopilot.state?.active && !isStaleState(autopilot.state) && isSessionMatch(autopilot.state, sessionId)) {
|
|
408
|
-
const phase = autopilot.state.phase || "unknown";
|
|
409
|
-
if (phase !== "complete") {
|
|
410
|
-
const newCount = (autopilot.state.reinforcement_count || 0) + 1;
|
|
411
|
-
if (newCount <= 20) {
|
|
412
|
-
autopilot.state.reinforcement_count = newCount;
|
|
413
|
-
autopilot.state.last_checked_at = new Date().toISOString();
|
|
414
|
-
writeJsonFile(autopilot.path, autopilot.state);
|
|
415
|
-
|
|
416
|
-
// Fire-and-forget notification
|
|
417
|
-
sendStopNotification('autopilot', autopilot.state, sessionId, directory).catch(() => {});
|
|
418
|
-
|
|
419
|
-
console.log(
|
|
420
|
-
JSON.stringify({
|
|
421
|
-
decision: "block",
|
|
422
|
-
reason: `[AUTOPILOT - Phase: ${phase}] Autopilot not complete. Continue working. When all phases are complete, run /ultrapower:cancel to cleanly exit and clean up state files. If cancel fails, retry with /ultrapower:cancel --force.`,
|
|
423
|
-
}),
|
|
424
|
-
);
|
|
425
|
-
return;
|
|
426
|
-
}
|
|
427
|
-
}
|
|
428
|
-
}
|
|
429
|
-
|
|
430
|
-
// Priority 3: Ultrapilot (parallel autopilot)
|
|
431
|
-
if (ultrapilot.state?.active && !isStaleState(ultrapilot.state) && isSessionMatch(ultrapilot.state, sessionId)) {
|
|
432
|
-
const workers = ultrapilot.state.workers || [];
|
|
433
|
-
const incomplete = workers.filter(
|
|
434
|
-
(w) => w.status !== "complete" && w.status !== "failed",
|
|
435
|
-
).length;
|
|
436
|
-
if (incomplete > 0) {
|
|
437
|
-
const newCount = (ultrapilot.state.reinforcement_count || 0) + 1;
|
|
438
|
-
if (newCount <= 20) {
|
|
439
|
-
ultrapilot.state.reinforcement_count = newCount;
|
|
440
|
-
ultrapilot.state.last_checked_at = new Date().toISOString();
|
|
441
|
-
writeJsonFile(ultrapilot.path, ultrapilot.state);
|
|
442
|
-
|
|
443
|
-
// Fire-and-forget notification
|
|
444
|
-
sendStopNotification('ultrapilot', ultrapilot.state, sessionId, directory).catch(() => {});
|
|
445
|
-
|
|
446
|
-
console.log(
|
|
447
|
-
JSON.stringify({
|
|
448
|
-
decision: "block",
|
|
449
|
-
reason: `[ULTRAPILOT] ${incomplete} workers still running. Continue working. When all workers complete, run /ultrapower:cancel to cleanly exit and clean up state files. If cancel fails, retry with /ultrapower:cancel --force.`,
|
|
450
|
-
}),
|
|
451
|
-
);
|
|
452
|
-
return;
|
|
453
|
-
}
|
|
454
|
-
}
|
|
455
|
-
}
|
|
456
|
-
|
|
457
|
-
// Priority 4: Swarm (coordinated agents with SQLite)
|
|
458
|
-
if (swarmMarker && swarmSummary?.active && !isStaleState(swarmSummary)) {
|
|
459
|
-
const pending =
|
|
460
|
-
(swarmSummary.tasks_pending || 0) + (swarmSummary.tasks_claimed || 0);
|
|
461
|
-
if (pending > 0) {
|
|
462
|
-
const newCount = (swarmSummary.reinforcement_count || 0) + 1;
|
|
463
|
-
if (newCount <= 15) {
|
|
464
|
-
swarmSummary.reinforcement_count = newCount;
|
|
465
|
-
swarmSummary.last_checked_at = new Date().toISOString();
|
|
466
|
-
writeJsonFile(join(stateDir, "swarm-summary.json"), swarmSummary);
|
|
467
|
-
|
|
468
|
-
// Fire-and-forget notification
|
|
469
|
-
sendStopNotification('swarm', swarmSummary, sessionId, directory).catch(() => {});
|
|
470
|
-
|
|
471
|
-
console.log(
|
|
472
|
-
JSON.stringify({
|
|
473
|
-
decision: "block",
|
|
474
|
-
reason: `[SWARM ACTIVE] ${pending} tasks remain. Continue working. When all tasks are done, run /ultrapower:cancel to cleanly exit and clean up state files. If cancel fails, retry with /ultrapower:cancel --force.`,
|
|
475
|
-
}),
|
|
476
|
-
);
|
|
477
|
-
return;
|
|
478
|
-
}
|
|
479
|
-
}
|
|
480
|
-
}
|
|
481
|
-
|
|
482
|
-
// Priority 5: Pipeline (sequential stages)
|
|
483
|
-
if (pipeline.state?.active && !isStaleState(pipeline.state) && isSessionMatch(pipeline.state, sessionId)) {
|
|
484
|
-
const currentStage = pipeline.state.current_stage || 0;
|
|
485
|
-
const totalStages = pipeline.state.stages?.length || 0;
|
|
486
|
-
if (currentStage < totalStages) {
|
|
487
|
-
const newCount = (pipeline.state.reinforcement_count || 0) + 1;
|
|
488
|
-
if (newCount <= 15) {
|
|
489
|
-
pipeline.state.reinforcement_count = newCount;
|
|
490
|
-
pipeline.state.last_checked_at = new Date().toISOString();
|
|
491
|
-
writeJsonFile(pipeline.path, pipeline.state);
|
|
492
|
-
|
|
493
|
-
// Fire-and-forget notification
|
|
494
|
-
sendStopNotification('pipeline', pipeline.state, sessionId, directory).catch(() => {});
|
|
495
|
-
|
|
496
|
-
console.log(
|
|
497
|
-
JSON.stringify({
|
|
498
|
-
decision: "block",
|
|
499
|
-
reason: `[PIPELINE - Stage ${currentStage + 1}/${totalStages}] Pipeline not complete. Continue working. When all stages complete, run /ultrapower:cancel to cleanly exit and clean up state files. If cancel fails, retry with /ultrapower:cancel --force.`,
|
|
500
|
-
}),
|
|
501
|
-
);
|
|
502
|
-
return;
|
|
503
|
-
}
|
|
504
|
-
}
|
|
505
|
-
}
|
|
506
|
-
|
|
507
|
-
// Priority 6: UltraQA (QA cycling)
|
|
508
|
-
if (ultraqa.state?.active && !isStaleState(ultraqa.state) && isSessionMatch(ultraqa.state, sessionId)) {
|
|
509
|
-
const cycle = ultraqa.state.cycle || 1;
|
|
510
|
-
const maxCycles = ultraqa.state.max_cycles || 10;
|
|
511
|
-
if (cycle < maxCycles && !ultraqa.state.all_passing) {
|
|
512
|
-
ultraqa.state.cycle = cycle + 1;
|
|
513
|
-
ultraqa.state.last_checked_at = new Date().toISOString();
|
|
514
|
-
writeJsonFile(ultraqa.path, ultraqa.state);
|
|
515
|
-
|
|
516
|
-
// Fire-and-forget notification
|
|
517
|
-
sendStopNotification('ultraqa', ultraqa.state, sessionId, directory).catch(() => {});
|
|
518
|
-
|
|
519
|
-
console.log(
|
|
520
|
-
JSON.stringify({
|
|
521
|
-
decision: "block",
|
|
522
|
-
reason: `[ULTRAQA - Cycle ${cycle + 1}/${maxCycles}] Tests not all passing. Continue fixing. When all tests pass, run /ultrapower:cancel to cleanly exit and clean up state files. If cancel fails, retry with /ultrapower:cancel --force.`,
|
|
523
|
-
}),
|
|
524
|
-
);
|
|
525
|
-
return;
|
|
526
|
-
}
|
|
527
|
-
}
|
|
528
|
-
|
|
529
|
-
// Priority 7: Ultrawork - ALWAYS continue while active (not just when tasks exist)
|
|
530
|
-
// This prevents false stops from bash errors, transient failures, etc.
|
|
531
|
-
// Session isolation: only block if state belongs to this session (issue #311)
|
|
532
|
-
// Project isolation: only block if state belongs to this project
|
|
533
|
-
if (
|
|
534
|
-
ultrawork.state?.active &&
|
|
535
|
-
!isStaleState(ultrawork.state) &&
|
|
536
|
-
isSessionMatch(ultrawork.state, sessionId) &&
|
|
537
|
-
isStateForCurrentProject(ultrawork.state, directory, ultrawork.isGlobal)
|
|
538
|
-
) {
|
|
539
|
-
const newCount = (ultrawork.state.reinforcement_count || 0) + 1;
|
|
540
|
-
const maxReinforcements = ultrawork.state.max_reinforcements || 50;
|
|
541
|
-
|
|
542
|
-
if (newCount > maxReinforcements) {
|
|
543
|
-
// Max reinforcements reached - allow stop
|
|
544
|
-
console.log(JSON.stringify({ continue: true, suppressOutput: true }));
|
|
545
|
-
return;
|
|
546
|
-
}
|
|
547
|
-
|
|
548
|
-
ultrawork.state.reinforcement_count = newCount;
|
|
549
|
-
ultrawork.state.last_checked_at = new Date().toISOString();
|
|
550
|
-
writeJsonFile(ultrawork.path, ultrawork.state);
|
|
551
|
-
|
|
552
|
-
// Fire-and-forget notification
|
|
553
|
-
sendStopNotification('ultrawork', ultrawork.state, sessionId, directory).catch(() => {});
|
|
554
|
-
|
|
555
|
-
let reason = `[ULTRAWORK #${newCount}/${maxReinforcements}] Mode active.`;
|
|
556
|
-
|
|
557
|
-
if (totalIncomplete > 0) {
|
|
558
|
-
const itemType = taskCount > 0 ? "Tasks" : "todos";
|
|
559
|
-
reason += ` ${totalIncomplete} incomplete ${itemType} remain. Continue working.`;
|
|
560
|
-
} else if (newCount >= 3) {
|
|
561
|
-
// Only suggest cancel after minimum iterations (guard against no-tasks-created scenario)
|
|
562
|
-
reason += ` If all work is complete, run /ultrapower:cancel to cleanly exit ultrawork mode and clean up state files. If cancel fails, retry with /ultrapower:cancel --force. Otherwise, continue working.`;
|
|
563
|
-
} else {
|
|
564
|
-
// Early iterations with no tasks yet - just tell LLM to continue
|
|
565
|
-
reason += ` Continue working - create Tasks to track your progress.`;
|
|
566
|
-
}
|
|
567
|
-
|
|
568
|
-
if (ultrawork.state.original_prompt) {
|
|
569
|
-
reason += `\nTask: ${ultrawork.state.original_prompt}`;
|
|
570
|
-
}
|
|
571
|
-
|
|
572
|
-
console.log(JSON.stringify({ decision: "block", reason }));
|
|
573
|
-
return;
|
|
574
|
-
}
|
|
575
|
-
|
|
576
|
-
// No blocking needed — Claude is truly idle.
|
|
577
|
-
// Send session-idle notification (fire-and-forget) so external integrations
|
|
578
|
-
// (Telegram, Discord) know the session went idle without any active mode.
|
|
579
|
-
if (sessionId) {
|
|
580
|
-
try {
|
|
581
|
-
const pluginRoot = process.env.CLAUDE_PLUGIN_ROOT;
|
|
582
|
-
if (pluginRoot) {
|
|
583
|
-
const { pathToFileURL } = require('url');
|
|
584
|
-
import(pathToFileURL(join(pluginRoot, 'dist', 'notifications', 'index.js')).href)
|
|
585
|
-
.then(({ notify }) =>
|
|
586
|
-
notify('session-idle', {
|
|
587
|
-
sessionId,
|
|
588
|
-
projectPath: directory,
|
|
589
|
-
}).catch(() => {})
|
|
590
|
-
)
|
|
591
|
-
.catch(() => {});
|
|
592
|
-
}
|
|
593
|
-
} catch {
|
|
594
|
-
// Notification module not available, skip silently
|
|
595
|
-
}
|
|
596
|
-
}
|
|
597
|
-
console.log(JSON.stringify({ continue: true, suppressOutput: true }));
|
|
598
|
-
} catch (error) {
|
|
599
|
-
// On any error, allow stop rather than blocking forever
|
|
600
|
-
console.error(`[persistent-mode] Error: ${error.message}`);
|
|
601
|
-
console.log(JSON.stringify({ continue: true, suppressOutput: true }));
|
|
602
|
-
}
|
|
603
|
-
}
|
|
604
|
-
|
|
605
|
-
main();
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* OMC Persistent Mode Hook (Node.js)
|
|
5
|
+
* Minimal continuation enforcer for all OMC modes.
|
|
6
|
+
* Stripped down for reliability — no optional imports, no PRD, no notepad pruning.
|
|
7
|
+
*
|
|
8
|
+
* Supported modes: ralph, autopilot, ultrapilot, swarm, ultrawork, ultraqa, pipeline
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
const {
|
|
12
|
+
existsSync,
|
|
13
|
+
readFileSync,
|
|
14
|
+
writeFileSync,
|
|
15
|
+
readdirSync,
|
|
16
|
+
mkdirSync,
|
|
17
|
+
} = require("fs");
|
|
18
|
+
const { join, dirname, resolve, normalize } = require("path");
|
|
19
|
+
const { homedir } = require("os");
|
|
20
|
+
|
|
21
|
+
async function readStdin(timeoutMs = 5000) {
|
|
22
|
+
return new Promise((resolve) => {
|
|
23
|
+
const chunks = [];
|
|
24
|
+
let settled = false;
|
|
25
|
+
const timeout = setTimeout(() => {
|
|
26
|
+
if (!settled) { settled = true; process.stdin.removeAllListeners(); process.stdin.destroy(); resolve(Buffer.concat(chunks).toString("utf-8")); }
|
|
27
|
+
}, timeoutMs);
|
|
28
|
+
process.stdin.on("data", (chunk) => { chunks.push(chunk); });
|
|
29
|
+
process.stdin.on("end", () => { if (!settled) { settled = true; clearTimeout(timeout); resolve(Buffer.concat(chunks).toString("utf-8")); } });
|
|
30
|
+
process.stdin.on("error", () => { if (!settled) { settled = true; clearTimeout(timeout); resolve(""); } });
|
|
31
|
+
if (process.stdin.readableEnded) { if (!settled) { settled = true; clearTimeout(timeout); resolve(Buffer.concat(chunks).toString("utf-8")); } }
|
|
32
|
+
});
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
function readJsonFile(path) {
|
|
36
|
+
try {
|
|
37
|
+
if (!existsSync(path)) return null;
|
|
38
|
+
return JSON.parse(readFileSync(path, "utf-8"));
|
|
39
|
+
} catch {
|
|
40
|
+
return null;
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
function writeJsonFile(path, data) {
|
|
45
|
+
try {
|
|
46
|
+
// Ensure directory exists
|
|
47
|
+
const dir = dirname(path);
|
|
48
|
+
if (dir && dir !== "." && !existsSync(dir)) {
|
|
49
|
+
mkdirSync(dir, { recursive: true });
|
|
50
|
+
}
|
|
51
|
+
writeFileSync(path, JSON.stringify(data, null, 2));
|
|
52
|
+
return true;
|
|
53
|
+
} catch {
|
|
54
|
+
return false;
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
/**
|
|
59
|
+
* Send stop notification (fire-and-forget, non-blocking).
|
|
60
|
+
* Only notifies on first stop to avoid spam.
|
|
61
|
+
*/
|
|
62
|
+
async function sendStopNotification(modeName, stateData, sessionId, directory) {
|
|
63
|
+
// Only notify once per mode activation
|
|
64
|
+
if (stateData._stopNotified) return;
|
|
65
|
+
|
|
66
|
+
try {
|
|
67
|
+
const pluginRoot = process.env.CLAUDE_PLUGIN_ROOT;
|
|
68
|
+
if (!pluginRoot) return;
|
|
69
|
+
|
|
70
|
+
const { pathToFileURL } = require('url');
|
|
71
|
+
const { notify } = await import(pathToFileURL(join(pluginRoot, 'dist', 'notifications', 'index.js')).href);
|
|
72
|
+
|
|
73
|
+
await notify('session-stop', {
|
|
74
|
+
sessionId: sessionId,
|
|
75
|
+
projectPath: directory,
|
|
76
|
+
activeMode: modeName,
|
|
77
|
+
iteration: stateData.iteration || stateData.reinforcement_count || 1,
|
|
78
|
+
maxIterations: stateData.max_iterations || stateData.max_reinforcements || 100,
|
|
79
|
+
incompleteTasks: undefined, // Caller can override
|
|
80
|
+
}).catch(() => {});
|
|
81
|
+
|
|
82
|
+
// Mark as notified to prevent duplicate notifications
|
|
83
|
+
stateData._stopNotified = true;
|
|
84
|
+
} catch {
|
|
85
|
+
// Notification module not available, skip silently
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
/**
|
|
90
|
+
* Staleness threshold for mode states (2 hours in milliseconds).
|
|
91
|
+
* States older than this are treated as inactive to prevent stale state
|
|
92
|
+
* from causing the stop hook to malfunction in new sessions.
|
|
93
|
+
*/
|
|
94
|
+
const STALE_STATE_THRESHOLD_MS = 2 * 60 * 60 * 1000; // 2 hours
|
|
95
|
+
|
|
96
|
+
/**
|
|
97
|
+
* Check if a state is stale based on its timestamps.
|
|
98
|
+
* A state is considered stale if it hasn't been updated recently.
|
|
99
|
+
* We check both `last_checked_at` and `started_at` - using whichever is more recent.
|
|
100
|
+
*/
|
|
101
|
+
function isStaleState(state) {
|
|
102
|
+
if (!state) return true;
|
|
103
|
+
|
|
104
|
+
const lastChecked = state.last_checked_at
|
|
105
|
+
? new Date(state.last_checked_at).getTime()
|
|
106
|
+
: 0;
|
|
107
|
+
const startedAt = state.started_at ? new Date(state.started_at).getTime() : 0;
|
|
108
|
+
const mostRecent = Math.max(lastChecked, startedAt);
|
|
109
|
+
|
|
110
|
+
if (mostRecent === 0) return true; // No valid timestamps
|
|
111
|
+
|
|
112
|
+
const age = Date.now() - mostRecent;
|
|
113
|
+
return age > STALE_STATE_THRESHOLD_MS;
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
/**
|
|
117
|
+
* Normalize a path for comparison.
|
|
118
|
+
*/
|
|
119
|
+
function normalizePath(p) {
|
|
120
|
+
if (!p) return "";
|
|
121
|
+
let normalized = resolve(p);
|
|
122
|
+
normalized = normalize(normalized);
|
|
123
|
+
normalized = normalized.replace(/[\/\\]+$/, "");
|
|
124
|
+
if (process.platform === "win32") {
|
|
125
|
+
normalized = normalized.toLowerCase();
|
|
126
|
+
}
|
|
127
|
+
return normalized;
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
/**
|
|
131
|
+
* Check if a state belongs to the requesting session.
|
|
132
|
+
* When sessionId is known: require exact match with state.session_id.
|
|
133
|
+
* When sessionId is empty/unknown: only match state without session_id (legacy compat).
|
|
134
|
+
*/
|
|
135
|
+
function isSessionMatch(state, sessionId) {
|
|
136
|
+
if (!state) return false;
|
|
137
|
+
if (sessionId) {
|
|
138
|
+
// Session is known: require exact match
|
|
139
|
+
return state.session_id === sessionId;
|
|
140
|
+
}
|
|
141
|
+
// No session_id from hook: only match legacy state (no session_id in state)
|
|
142
|
+
return !state.session_id;
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
/**
|
|
146
|
+
* Check if a state belongs to the current project.
|
|
147
|
+
*/
|
|
148
|
+
function isStateForCurrentProject(
|
|
149
|
+
state,
|
|
150
|
+
currentDirectory,
|
|
151
|
+
isGlobalState = false,
|
|
152
|
+
) {
|
|
153
|
+
if (!state) return true;
|
|
154
|
+
|
|
155
|
+
if (!state.project_path) {
|
|
156
|
+
if (isGlobalState) {
|
|
157
|
+
return false;
|
|
158
|
+
}
|
|
159
|
+
return true;
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
return normalizePath(state.project_path) === normalizePath(currentDirectory);
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
/**
|
|
166
|
+
* Read state file from local location only.
|
|
167
|
+
*/
|
|
168
|
+
function readStateFile(stateDir, filename) {
|
|
169
|
+
const localPath = join(stateDir, filename);
|
|
170
|
+
const state = readJsonFile(localPath);
|
|
171
|
+
return { state, path: localPath, isGlobal: false };
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
/**
|
|
175
|
+
* Read state file with session-scoped path support and fallback to legacy path.
|
|
176
|
+
*/
|
|
177
|
+
function readStateFileWithSession(stateDir, filename, sessionId) {
|
|
178
|
+
// Try session-scoped path first (and ONLY) when sessionId is available
|
|
179
|
+
if (sessionId && /^[a-zA-Z0-9][a-zA-Z0-9_-]{0,255}$/.test(sessionId)) {
|
|
180
|
+
const sessionsDir = join(stateDir, 'sessions', sessionId);
|
|
181
|
+
const sessionPath = join(sessionsDir, filename);
|
|
182
|
+
const state = readJsonFile(sessionPath);
|
|
183
|
+
if (state) {
|
|
184
|
+
return { state, path: sessionPath, isGlobal: false };
|
|
185
|
+
}
|
|
186
|
+
// Session path not found — do NOT fall back to legacy
|
|
187
|
+
return { state: null, path: null, isGlobal: false };
|
|
188
|
+
}
|
|
189
|
+
// No sessionId: fall back to legacy path (backward compat)
|
|
190
|
+
return readStateFile(stateDir, filename);
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
/**
|
|
194
|
+
* Count incomplete Tasks from Claude Code's native Task system.
|
|
195
|
+
*/
|
|
196
|
+
function countIncompleteTasks(sessionId) {
|
|
197
|
+
if (!sessionId || typeof sessionId !== "string") return 0;
|
|
198
|
+
if (!/^[a-zA-Z0-9][a-zA-Z0-9_-]{0,255}$/.test(sessionId)) return 0;
|
|
199
|
+
|
|
200
|
+
const cfgDir = process.env.CLAUDE_CONFIG_DIR || join(homedir(), ".claude");
|
|
201
|
+
const taskDir = join(cfgDir, "tasks", sessionId);
|
|
202
|
+
if (!existsSync(taskDir)) return 0;
|
|
203
|
+
|
|
204
|
+
let count = 0;
|
|
205
|
+
try {
|
|
206
|
+
const files = readdirSync(taskDir).filter(
|
|
207
|
+
(f) => f.endsWith(".json") && f !== ".lock",
|
|
208
|
+
);
|
|
209
|
+
for (const file of files) {
|
|
210
|
+
try {
|
|
211
|
+
const content = readFileSync(join(taskDir, file), "utf-8");
|
|
212
|
+
const task = JSON.parse(content);
|
|
213
|
+
if (task.status === "pending" || task.status === "in_progress") count++;
|
|
214
|
+
} catch {
|
|
215
|
+
/* skip */
|
|
216
|
+
}
|
|
217
|
+
}
|
|
218
|
+
} catch {
|
|
219
|
+
/* skip */
|
|
220
|
+
}
|
|
221
|
+
return count;
|
|
222
|
+
}
|
|
223
|
+
|
|
224
|
+
function countIncompleteTodos(sessionId, projectDir) {
|
|
225
|
+
let count = 0;
|
|
226
|
+
|
|
227
|
+
// Session-specific todos only (no global scan)
|
|
228
|
+
if (
|
|
229
|
+
sessionId &&
|
|
230
|
+
typeof sessionId === "string" &&
|
|
231
|
+
/^[a-zA-Z0-9][a-zA-Z0-9_-]{0,255}$/.test(sessionId)
|
|
232
|
+
) {
|
|
233
|
+
const sessionTodoPath = join(
|
|
234
|
+
homedir(),
|
|
235
|
+
".claude",
|
|
236
|
+
"todos",
|
|
237
|
+
`${sessionId}.json`,
|
|
238
|
+
);
|
|
239
|
+
try {
|
|
240
|
+
const data = readJsonFile(sessionTodoPath);
|
|
241
|
+
const todos = Array.isArray(data)
|
|
242
|
+
? data
|
|
243
|
+
: Array.isArray(data?.todos)
|
|
244
|
+
? data.todos
|
|
245
|
+
: [];
|
|
246
|
+
count += todos.filter(
|
|
247
|
+
(t) => t.status !== "completed" && t.status !== "cancelled",
|
|
248
|
+
).length;
|
|
249
|
+
} catch {
|
|
250
|
+
/* skip */
|
|
251
|
+
}
|
|
252
|
+
}
|
|
253
|
+
|
|
254
|
+
// Project-local todos only
|
|
255
|
+
for (const path of [
|
|
256
|
+
join(projectDir, ".omc", "todos.json"),
|
|
257
|
+
join(projectDir, ".claude", "todos.json"),
|
|
258
|
+
]) {
|
|
259
|
+
try {
|
|
260
|
+
const data = readJsonFile(path);
|
|
261
|
+
const todos = Array.isArray(data)
|
|
262
|
+
? data
|
|
263
|
+
: Array.isArray(data?.todos)
|
|
264
|
+
? data.todos
|
|
265
|
+
: [];
|
|
266
|
+
count += todos.filter(
|
|
267
|
+
(t) => t.status !== "completed" && t.status !== "cancelled",
|
|
268
|
+
).length;
|
|
269
|
+
} catch {
|
|
270
|
+
/* skip */
|
|
271
|
+
}
|
|
272
|
+
}
|
|
273
|
+
|
|
274
|
+
return count;
|
|
275
|
+
}
|
|
276
|
+
|
|
277
|
+
/**
|
|
278
|
+
* Detect if stop was triggered by context-limit related reasons.
|
|
279
|
+
* When context is exhausted, Claude Code needs to stop so it can compact.
|
|
280
|
+
* Blocking these stops causes a deadlock: can't compact because can't stop,
|
|
281
|
+
* can't continue because context is full.
|
|
282
|
+
*
|
|
283
|
+
* See: https://github.com/liangjie559567/ultrapower/issues/213
|
|
284
|
+
*/
|
|
285
|
+
function isContextLimitStop(data) {
|
|
286
|
+
const reason = (data.stop_reason || data.stopReason || "").toLowerCase();
|
|
287
|
+
|
|
288
|
+
const contextPatterns = [
|
|
289
|
+
"context_limit",
|
|
290
|
+
"context_window",
|
|
291
|
+
"context_exceeded",
|
|
292
|
+
"context_full",
|
|
293
|
+
"max_context",
|
|
294
|
+
"token_limit",
|
|
295
|
+
"max_tokens",
|
|
296
|
+
"conversation_too_long",
|
|
297
|
+
"input_too_long",
|
|
298
|
+
];
|
|
299
|
+
|
|
300
|
+
if (contextPatterns.some((p) => reason.includes(p))) {
|
|
301
|
+
return true;
|
|
302
|
+
}
|
|
303
|
+
|
|
304
|
+
const endTurnReason = (
|
|
305
|
+
data.end_turn_reason ||
|
|
306
|
+
data.endTurnReason ||
|
|
307
|
+
""
|
|
308
|
+
).toLowerCase();
|
|
309
|
+
if (endTurnReason && contextPatterns.some((p) => endTurnReason.includes(p))) {
|
|
310
|
+
return true;
|
|
311
|
+
}
|
|
312
|
+
|
|
313
|
+
return false;
|
|
314
|
+
}
|
|
315
|
+
|
|
316
|
+
/**
|
|
317
|
+
* Detect if stop was triggered by user abort (Ctrl+C, cancel button, etc.)
|
|
318
|
+
*/
|
|
319
|
+
function isUserAbort(data) {
|
|
320
|
+
if (data.user_requested || data.userRequested) return true;
|
|
321
|
+
|
|
322
|
+
const reason = (data.stop_reason || data.stopReason || "").toLowerCase();
|
|
323
|
+
// Exact-match patterns: short generic words that cause false positives with .includes()
|
|
324
|
+
const exactPatterns = ["aborted", "abort", "cancel", "interrupt"];
|
|
325
|
+
// Substring patterns: compound words safe for .includes() matching
|
|
326
|
+
const substringPatterns = [
|
|
327
|
+
"user_cancel",
|
|
328
|
+
"user_interrupt",
|
|
329
|
+
"ctrl_c",
|
|
330
|
+
"manual_stop",
|
|
331
|
+
];
|
|
332
|
+
|
|
333
|
+
return (
|
|
334
|
+
exactPatterns.some((p) => reason === p) ||
|
|
335
|
+
substringPatterns.some((p) => reason.includes(p))
|
|
336
|
+
);
|
|
337
|
+
}
|
|
338
|
+
|
|
339
|
+
async function main() {
|
|
340
|
+
try {
|
|
341
|
+
const input = await readStdin();
|
|
342
|
+
let data = {};
|
|
343
|
+
try {
|
|
344
|
+
data = JSON.parse(input);
|
|
345
|
+
} catch {}
|
|
346
|
+
|
|
347
|
+
const directory = data.cwd || data.directory || process.cwd();
|
|
348
|
+
const sessionId = data.session_id || data.sessionId || "";
|
|
349
|
+
const stateDir = join(directory, ".omc", "state");
|
|
350
|
+
|
|
351
|
+
// CRITICAL: Never block context-limit stops.
|
|
352
|
+
// Blocking these causes a deadlock where Claude Code cannot compact.
|
|
353
|
+
// See: https://github.com/liangjie559567/ultrapower/issues/213
|
|
354
|
+
if (isContextLimitStop(data)) {
|
|
355
|
+
console.log(JSON.stringify({ continue: true, suppressOutput: true }));
|
|
356
|
+
return;
|
|
357
|
+
}
|
|
358
|
+
|
|
359
|
+
// Respect user abort (Ctrl+C, cancel)
|
|
360
|
+
if (isUserAbort(data)) {
|
|
361
|
+
console.log(JSON.stringify({ continue: true, suppressOutput: true }));
|
|
362
|
+
return;
|
|
363
|
+
}
|
|
364
|
+
|
|
365
|
+
// Read all mode states (session-scoped with legacy fallback)
|
|
366
|
+
const ralph = readStateFileWithSession(stateDir, "ralph-state.json", sessionId);
|
|
367
|
+
const autopilot = readStateFileWithSession(stateDir, "autopilot-state.json", sessionId);
|
|
368
|
+
const ultrapilot = readStateFileWithSession(stateDir, "ultrapilot-state.json", sessionId);
|
|
369
|
+
const ultrawork = readStateFileWithSession(stateDir, "ultrawork-state.json", sessionId);
|
|
370
|
+
const ultraqa = readStateFileWithSession(stateDir, "ultraqa-state.json", sessionId);
|
|
371
|
+
const pipeline = readStateFileWithSession(stateDir, "pipeline-state.json", sessionId);
|
|
372
|
+
|
|
373
|
+
// Swarm uses swarm-summary.json (not swarm-state.json) + marker file
|
|
374
|
+
const swarmMarker = existsSync(join(stateDir, "swarm-active.marker"));
|
|
375
|
+
const swarmSummary = readJsonFile(join(stateDir, "swarm-summary.json"));
|
|
376
|
+
|
|
377
|
+
// Count incomplete items (session-specific + project-local only)
|
|
378
|
+
const taskCount = countIncompleteTasks(sessionId);
|
|
379
|
+
const todoCount = countIncompleteTodos(sessionId, directory);
|
|
380
|
+
const totalIncomplete = taskCount + todoCount;
|
|
381
|
+
|
|
382
|
+
// Priority 1: Ralph Loop (explicit persistence mode)
|
|
383
|
+
// Skip if state is stale (older than 2 hours) - prevents blocking new sessions
|
|
384
|
+
if (ralph.state?.active && !isStaleState(ralph.state) && isSessionMatch(ralph.state, sessionId)) {
|
|
385
|
+
const iteration = ralph.state.iteration || 1;
|
|
386
|
+
const maxIter = ralph.state.max_iterations || 100;
|
|
387
|
+
|
|
388
|
+
if (iteration < maxIter) {
|
|
389
|
+
ralph.state.iteration = iteration + 1;
|
|
390
|
+
ralph.state.last_checked_at = new Date().toISOString();
|
|
391
|
+
writeJsonFile(ralph.path, ralph.state);
|
|
392
|
+
|
|
393
|
+
// Fire-and-forget notification
|
|
394
|
+
sendStopNotification('ralph', ralph.state, sessionId, directory).catch(() => {});
|
|
395
|
+
|
|
396
|
+
console.log(
|
|
397
|
+
JSON.stringify({
|
|
398
|
+
decision: "block",
|
|
399
|
+
reason: `[RALPH LOOP - ITERATION ${iteration + 1}/${maxIter}] Work is NOT done. Continue working.\nWhen FULLY complete (after Architect verification), run /ultrapower:cancel to cleanly exit ralph mode and clean up all state files. If cancel fails, retry with /ultrapower:cancel --force.\n${ralph.state.prompt ? `Task: ${ralph.state.prompt}` : ""}`,
|
|
400
|
+
}),
|
|
401
|
+
);
|
|
402
|
+
return;
|
|
403
|
+
}
|
|
404
|
+
}
|
|
405
|
+
|
|
406
|
+
// Priority 2: Autopilot (high-level orchestration)
|
|
407
|
+
if (autopilot.state?.active && !isStaleState(autopilot.state) && isSessionMatch(autopilot.state, sessionId)) {
|
|
408
|
+
const phase = autopilot.state.phase || "unknown";
|
|
409
|
+
if (phase !== "complete") {
|
|
410
|
+
const newCount = (autopilot.state.reinforcement_count || 0) + 1;
|
|
411
|
+
if (newCount <= 20) {
|
|
412
|
+
autopilot.state.reinforcement_count = newCount;
|
|
413
|
+
autopilot.state.last_checked_at = new Date().toISOString();
|
|
414
|
+
writeJsonFile(autopilot.path, autopilot.state);
|
|
415
|
+
|
|
416
|
+
// Fire-and-forget notification
|
|
417
|
+
sendStopNotification('autopilot', autopilot.state, sessionId, directory).catch(() => {});
|
|
418
|
+
|
|
419
|
+
console.log(
|
|
420
|
+
JSON.stringify({
|
|
421
|
+
decision: "block",
|
|
422
|
+
reason: `[AUTOPILOT - Phase: ${phase}] Autopilot not complete. Continue working. When all phases are complete, run /ultrapower:cancel to cleanly exit and clean up state files. If cancel fails, retry with /ultrapower:cancel --force.`,
|
|
423
|
+
}),
|
|
424
|
+
);
|
|
425
|
+
return;
|
|
426
|
+
}
|
|
427
|
+
}
|
|
428
|
+
}
|
|
429
|
+
|
|
430
|
+
// Priority 3: Ultrapilot (parallel autopilot)
|
|
431
|
+
if (ultrapilot.state?.active && !isStaleState(ultrapilot.state) && isSessionMatch(ultrapilot.state, sessionId)) {
|
|
432
|
+
const workers = ultrapilot.state.workers || [];
|
|
433
|
+
const incomplete = workers.filter(
|
|
434
|
+
(w) => w.status !== "complete" && w.status !== "failed",
|
|
435
|
+
).length;
|
|
436
|
+
if (incomplete > 0) {
|
|
437
|
+
const newCount = (ultrapilot.state.reinforcement_count || 0) + 1;
|
|
438
|
+
if (newCount <= 20) {
|
|
439
|
+
ultrapilot.state.reinforcement_count = newCount;
|
|
440
|
+
ultrapilot.state.last_checked_at = new Date().toISOString();
|
|
441
|
+
writeJsonFile(ultrapilot.path, ultrapilot.state);
|
|
442
|
+
|
|
443
|
+
// Fire-and-forget notification
|
|
444
|
+
sendStopNotification('ultrapilot', ultrapilot.state, sessionId, directory).catch(() => {});
|
|
445
|
+
|
|
446
|
+
console.log(
|
|
447
|
+
JSON.stringify({
|
|
448
|
+
decision: "block",
|
|
449
|
+
reason: `[ULTRAPILOT] ${incomplete} workers still running. Continue working. When all workers complete, run /ultrapower:cancel to cleanly exit and clean up state files. If cancel fails, retry with /ultrapower:cancel --force.`,
|
|
450
|
+
}),
|
|
451
|
+
);
|
|
452
|
+
return;
|
|
453
|
+
}
|
|
454
|
+
}
|
|
455
|
+
}
|
|
456
|
+
|
|
457
|
+
// Priority 4: Swarm (coordinated agents with SQLite)
|
|
458
|
+
if (swarmMarker && swarmSummary?.active && !isStaleState(swarmSummary)) {
|
|
459
|
+
const pending =
|
|
460
|
+
(swarmSummary.tasks_pending || 0) + (swarmSummary.tasks_claimed || 0);
|
|
461
|
+
if (pending > 0) {
|
|
462
|
+
const newCount = (swarmSummary.reinforcement_count || 0) + 1;
|
|
463
|
+
if (newCount <= 15) {
|
|
464
|
+
swarmSummary.reinforcement_count = newCount;
|
|
465
|
+
swarmSummary.last_checked_at = new Date().toISOString();
|
|
466
|
+
writeJsonFile(join(stateDir, "swarm-summary.json"), swarmSummary);
|
|
467
|
+
|
|
468
|
+
// Fire-and-forget notification
|
|
469
|
+
sendStopNotification('swarm', swarmSummary, sessionId, directory).catch(() => {});
|
|
470
|
+
|
|
471
|
+
console.log(
|
|
472
|
+
JSON.stringify({
|
|
473
|
+
decision: "block",
|
|
474
|
+
reason: `[SWARM ACTIVE] ${pending} tasks remain. Continue working. When all tasks are done, run /ultrapower:cancel to cleanly exit and clean up state files. If cancel fails, retry with /ultrapower:cancel --force.`,
|
|
475
|
+
}),
|
|
476
|
+
);
|
|
477
|
+
return;
|
|
478
|
+
}
|
|
479
|
+
}
|
|
480
|
+
}
|
|
481
|
+
|
|
482
|
+
// Priority 5: Pipeline (sequential stages)
|
|
483
|
+
if (pipeline.state?.active && !isStaleState(pipeline.state) && isSessionMatch(pipeline.state, sessionId)) {
|
|
484
|
+
const currentStage = pipeline.state.current_stage || 0;
|
|
485
|
+
const totalStages = pipeline.state.stages?.length || 0;
|
|
486
|
+
if (currentStage < totalStages) {
|
|
487
|
+
const newCount = (pipeline.state.reinforcement_count || 0) + 1;
|
|
488
|
+
if (newCount <= 15) {
|
|
489
|
+
pipeline.state.reinforcement_count = newCount;
|
|
490
|
+
pipeline.state.last_checked_at = new Date().toISOString();
|
|
491
|
+
writeJsonFile(pipeline.path, pipeline.state);
|
|
492
|
+
|
|
493
|
+
// Fire-and-forget notification
|
|
494
|
+
sendStopNotification('pipeline', pipeline.state, sessionId, directory).catch(() => {});
|
|
495
|
+
|
|
496
|
+
console.log(
|
|
497
|
+
JSON.stringify({
|
|
498
|
+
decision: "block",
|
|
499
|
+
reason: `[PIPELINE - Stage ${currentStage + 1}/${totalStages}] Pipeline not complete. Continue working. When all stages complete, run /ultrapower:cancel to cleanly exit and clean up state files. If cancel fails, retry with /ultrapower:cancel --force.`,
|
|
500
|
+
}),
|
|
501
|
+
);
|
|
502
|
+
return;
|
|
503
|
+
}
|
|
504
|
+
}
|
|
505
|
+
}
|
|
506
|
+
|
|
507
|
+
// Priority 6: UltraQA (QA cycling)
|
|
508
|
+
if (ultraqa.state?.active && !isStaleState(ultraqa.state) && isSessionMatch(ultraqa.state, sessionId)) {
|
|
509
|
+
const cycle = ultraqa.state.cycle || 1;
|
|
510
|
+
const maxCycles = ultraqa.state.max_cycles || 10;
|
|
511
|
+
if (cycle < maxCycles && !ultraqa.state.all_passing) {
|
|
512
|
+
ultraqa.state.cycle = cycle + 1;
|
|
513
|
+
ultraqa.state.last_checked_at = new Date().toISOString();
|
|
514
|
+
writeJsonFile(ultraqa.path, ultraqa.state);
|
|
515
|
+
|
|
516
|
+
// Fire-and-forget notification
|
|
517
|
+
sendStopNotification('ultraqa', ultraqa.state, sessionId, directory).catch(() => {});
|
|
518
|
+
|
|
519
|
+
console.log(
|
|
520
|
+
JSON.stringify({
|
|
521
|
+
decision: "block",
|
|
522
|
+
reason: `[ULTRAQA - Cycle ${cycle + 1}/${maxCycles}] Tests not all passing. Continue fixing. When all tests pass, run /ultrapower:cancel to cleanly exit and clean up state files. If cancel fails, retry with /ultrapower:cancel --force.`,
|
|
523
|
+
}),
|
|
524
|
+
);
|
|
525
|
+
return;
|
|
526
|
+
}
|
|
527
|
+
}
|
|
528
|
+
|
|
529
|
+
// Priority 7: Ultrawork - ALWAYS continue while active (not just when tasks exist)
|
|
530
|
+
// This prevents false stops from bash errors, transient failures, etc.
|
|
531
|
+
// Session isolation: only block if state belongs to this session (issue #311)
|
|
532
|
+
// Project isolation: only block if state belongs to this project
|
|
533
|
+
if (
|
|
534
|
+
ultrawork.state?.active &&
|
|
535
|
+
!isStaleState(ultrawork.state) &&
|
|
536
|
+
isSessionMatch(ultrawork.state, sessionId) &&
|
|
537
|
+
isStateForCurrentProject(ultrawork.state, directory, ultrawork.isGlobal)
|
|
538
|
+
) {
|
|
539
|
+
const newCount = (ultrawork.state.reinforcement_count || 0) + 1;
|
|
540
|
+
const maxReinforcements = ultrawork.state.max_reinforcements || 50;
|
|
541
|
+
|
|
542
|
+
if (newCount > maxReinforcements) {
|
|
543
|
+
// Max reinforcements reached - allow stop
|
|
544
|
+
console.log(JSON.stringify({ continue: true, suppressOutput: true }));
|
|
545
|
+
return;
|
|
546
|
+
}
|
|
547
|
+
|
|
548
|
+
ultrawork.state.reinforcement_count = newCount;
|
|
549
|
+
ultrawork.state.last_checked_at = new Date().toISOString();
|
|
550
|
+
writeJsonFile(ultrawork.path, ultrawork.state);
|
|
551
|
+
|
|
552
|
+
// Fire-and-forget notification
|
|
553
|
+
sendStopNotification('ultrawork', ultrawork.state, sessionId, directory).catch(() => {});
|
|
554
|
+
|
|
555
|
+
let reason = `[ULTRAWORK #${newCount}/${maxReinforcements}] Mode active.`;
|
|
556
|
+
|
|
557
|
+
if (totalIncomplete > 0) {
|
|
558
|
+
const itemType = taskCount > 0 ? "Tasks" : "todos";
|
|
559
|
+
reason += ` ${totalIncomplete} incomplete ${itemType} remain. Continue working.`;
|
|
560
|
+
} else if (newCount >= 3) {
|
|
561
|
+
// Only suggest cancel after minimum iterations (guard against no-tasks-created scenario)
|
|
562
|
+
reason += ` If all work is complete, run /ultrapower:cancel to cleanly exit ultrawork mode and clean up state files. If cancel fails, retry with /ultrapower:cancel --force. Otherwise, continue working.`;
|
|
563
|
+
} else {
|
|
564
|
+
// Early iterations with no tasks yet - just tell LLM to continue
|
|
565
|
+
reason += ` Continue working - create Tasks to track your progress.`;
|
|
566
|
+
}
|
|
567
|
+
|
|
568
|
+
if (ultrawork.state.original_prompt) {
|
|
569
|
+
reason += `\nTask: ${ultrawork.state.original_prompt}`;
|
|
570
|
+
}
|
|
571
|
+
|
|
572
|
+
console.log(JSON.stringify({ decision: "block", reason }));
|
|
573
|
+
return;
|
|
574
|
+
}
|
|
575
|
+
|
|
576
|
+
// No blocking needed — Claude is truly idle.
|
|
577
|
+
// Send session-idle notification (fire-and-forget) so external integrations
|
|
578
|
+
// (Telegram, Discord) know the session went idle without any active mode.
|
|
579
|
+
if (sessionId) {
|
|
580
|
+
try {
|
|
581
|
+
const pluginRoot = process.env.CLAUDE_PLUGIN_ROOT;
|
|
582
|
+
if (pluginRoot) {
|
|
583
|
+
const { pathToFileURL } = require('url');
|
|
584
|
+
import(pathToFileURL(join(pluginRoot, 'dist', 'notifications', 'index.js')).href)
|
|
585
|
+
.then(({ notify }) =>
|
|
586
|
+
notify('session-idle', {
|
|
587
|
+
sessionId,
|
|
588
|
+
projectPath: directory,
|
|
589
|
+
}).catch(() => {})
|
|
590
|
+
)
|
|
591
|
+
.catch(() => {});
|
|
592
|
+
}
|
|
593
|
+
} catch {
|
|
594
|
+
// Notification module not available, skip silently
|
|
595
|
+
}
|
|
596
|
+
}
|
|
597
|
+
console.log(JSON.stringify({ continue: true, suppressOutput: true }));
|
|
598
|
+
} catch (error) {
|
|
599
|
+
// On any error, allow stop rather than blocking forever
|
|
600
|
+
console.error(`[persistent-mode] Error: ${error.message}`);
|
|
601
|
+
console.log(JSON.stringify({ continue: true, suppressOutput: true }));
|
|
602
|
+
}
|
|
603
|
+
}
|
|
604
|
+
|
|
605
|
+
main();
|