oh-my-claude-sisyphus 3.5.8 → 3.6.1
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/agents/executor-high.md +2 -0
- package/agents/executor-low.md +2 -0
- package/agents/executor.md +2 -0
- package/agents/templates/base-agent.md +9 -0
- package/commands/cancel.md +8 -8
- package/commands/omc-setup.md +3 -3
- package/commands/release.md +1 -1
- package/commands/swarm.md +350 -148
- package/dist/__tests__/analytics/transcript-scanner.test.js +69 -27
- package/dist/__tests__/analytics/transcript-scanner.test.js.map +1 -1
- package/dist/__tests__/hooks.test.js +10 -9
- package/dist/__tests__/hooks.test.js.map +1 -1
- package/dist/__tests__/installer.test.js +2 -1
- package/dist/__tests__/installer.test.js.map +1 -1
- package/dist/agents/preamble.d.ts +14 -0
- package/dist/agents/preamble.d.ts.map +1 -0
- package/dist/agents/preamble.js +26 -0
- package/dist/agents/preamble.js.map +1 -0
- package/dist/analytics/session-manager.d.ts +24 -0
- package/dist/analytics/session-manager.d.ts.map +1 -1
- package/dist/analytics/session-manager.js +98 -9
- package/dist/analytics/session-manager.js.map +1 -1
- package/dist/analytics/transcript-scanner.d.ts +9 -8
- package/dist/analytics/transcript-scanner.d.ts.map +1 -1
- package/dist/analytics/transcript-scanner.js +146 -16
- package/dist/analytics/transcript-scanner.js.map +1 -1
- package/dist/cli/analytics.js +0 -0
- package/dist/cli/index.js +0 -0
- package/dist/hooks/autopilot/__tests__/cancel.test.js +14 -4
- package/dist/hooks/autopilot/__tests__/cancel.test.js.map +1 -1
- package/dist/hooks/autopilot/__tests__/state.test.js +1 -0
- package/dist/hooks/autopilot/__tests__/state.test.js.map +1 -1
- package/dist/hooks/autopilot/__tests__/summary.test.js +38 -3
- package/dist/hooks/autopilot/__tests__/summary.test.js.map +1 -1
- package/dist/hooks/autopilot/state.d.ts +1 -1
- package/dist/hooks/autopilot/state.d.ts.map +1 -1
- package/dist/hooks/autopilot/state.js +15 -8
- package/dist/hooks/autopilot/state.js.map +1 -1
- package/dist/hooks/empty-message-sanitizer/__tests__/index.test.d.ts +2 -0
- package/dist/hooks/empty-message-sanitizer/__tests__/index.test.d.ts.map +1 -0
- package/dist/hooks/empty-message-sanitizer/__tests__/index.test.js +416 -0
- package/dist/hooks/empty-message-sanitizer/__tests__/index.test.js.map +1 -0
- package/dist/hooks/index.d.ts +2 -0
- package/dist/hooks/index.d.ts.map +1 -1
- package/dist/hooks/index.js +7 -0
- package/dist/hooks/index.js.map +1 -1
- package/dist/hooks/keyword-detector/__tests__/index.test.d.ts +2 -0
- package/dist/hooks/keyword-detector/__tests__/index.test.d.ts.map +1 -0
- package/dist/hooks/keyword-detector/__tests__/index.test.js +427 -0
- package/dist/hooks/keyword-detector/__tests__/index.test.js.map +1 -0
- package/dist/hooks/mode-registry/index.d.ts +135 -0
- package/dist/hooks/mode-registry/index.d.ts.map +1 -0
- package/dist/hooks/mode-registry/index.js +445 -0
- package/dist/hooks/mode-registry/index.js.map +1 -0
- package/dist/hooks/mode-registry/types.d.ts +31 -0
- package/dist/hooks/mode-registry/types.d.ts.map +1 -0
- package/dist/hooks/mode-registry/types.js +7 -0
- package/dist/hooks/mode-registry/types.js.map +1 -0
- package/dist/hooks/ralph/loop.js +6 -6
- package/dist/hooks/ralph/loop.js.map +1 -1
- package/dist/hooks/swarm/__tests__/claiming.test.d.ts +2 -0
- package/dist/hooks/swarm/__tests__/claiming.test.d.ts.map +1 -0
- package/dist/hooks/swarm/__tests__/claiming.test.js +170 -0
- package/dist/hooks/swarm/__tests__/claiming.test.js.map +1 -0
- package/dist/hooks/swarm/__tests__/index.test.d.ts +2 -0
- package/dist/hooks/swarm/__tests__/index.test.d.ts.map +1 -0
- package/dist/hooks/swarm/__tests__/index.test.js +157 -0
- package/dist/hooks/swarm/__tests__/index.test.js.map +1 -0
- package/dist/hooks/swarm/__tests__/mode-registry.test.d.ts +2 -0
- package/dist/hooks/swarm/__tests__/mode-registry.test.d.ts.map +1 -0
- package/dist/hooks/swarm/__tests__/mode-registry.test.js +177 -0
- package/dist/hooks/swarm/__tests__/mode-registry.test.js.map +1 -0
- package/dist/hooks/swarm/claiming.d.ts +101 -0
- package/dist/hooks/swarm/claiming.d.ts.map +1 -0
- package/dist/hooks/swarm/claiming.js +460 -0
- package/dist/hooks/swarm/claiming.js.map +1 -0
- package/dist/hooks/swarm/index.d.ts +221 -0
- package/dist/hooks/swarm/index.d.ts.map +1 -0
- package/dist/hooks/swarm/index.js +413 -0
- package/dist/hooks/swarm/index.js.map +1 -0
- package/dist/hooks/swarm/state.d.ts +94 -0
- package/dist/hooks/swarm/state.d.ts.map +1 -0
- package/dist/hooks/swarm/state.js +530 -0
- package/dist/hooks/swarm/state.js.map +1 -0
- package/dist/hooks/swarm/types.d.ts +116 -0
- package/dist/hooks/swarm/types.d.ts.map +1 -0
- package/dist/hooks/swarm/types.js +22 -0
- package/dist/hooks/swarm/types.js.map +1 -0
- package/dist/hooks/think-mode/__tests__/index.test.d.ts +2 -0
- package/dist/hooks/think-mode/__tests__/index.test.d.ts.map +1 -0
- package/dist/hooks/think-mode/__tests__/index.test.js +556 -0
- package/dist/hooks/think-mode/__tests__/index.test.js.map +1 -0
- package/dist/hooks/ultrapilot/decomposer.d.ts +141 -0
- package/dist/hooks/ultrapilot/decomposer.d.ts.map +1 -0
- package/dist/hooks/ultrapilot/decomposer.js +377 -0
- package/dist/hooks/ultrapilot/decomposer.js.map +1 -0
- package/dist/hooks/ultrapilot/index.d.ts +31 -0
- package/dist/hooks/ultrapilot/index.d.ts.map +1 -1
- package/dist/hooks/ultrapilot/index.js +43 -2
- package/dist/hooks/ultrapilot/index.js.map +1 -1
- package/dist/hooks/ultrapilot/state.d.ts +1 -1
- package/dist/hooks/ultrapilot/state.d.ts.map +1 -1
- package/dist/hooks/ultrapilot/state.js +7 -0
- package/dist/hooks/ultrapilot/state.js.map +1 -1
- package/dist/hooks/ultraqa/index.js +5 -5
- package/dist/hooks/ultraqa/index.js.map +1 -1
- package/dist/hooks/ultrawork/index.js +3 -3
- package/dist/hooks/ultrawork/index.js.map +1 -1
- package/dist/installer/index.d.ts.map +1 -1
- package/dist/installer/index.js +8 -0
- package/dist/installer/index.js.map +1 -1
- package/package.json +3 -1
- package/skills/autopilot/SKILL.md +18 -0
- package/skills/cancel/SKILL.md +166 -141
- package/skills/ecomode/SKILL.md +14 -0
- package/skills/omc-setup/SKILL.md +27 -3
- package/skills/pipeline/SKILL.md +13 -0
- package/skills/ralph/SKILL.md +22 -1
- package/skills/release/SKILL.md +1 -1
- package/skills/swarm/SKILL.md +521 -197
- package/skills/ultrapilot/SKILL.md +82 -13
- package/skills/ultraqa/SKILL.md +13 -0
- package/skills/ultrawork/SKILL.md +14 -0
- package/dist/__tests__/analytics/analytics-summary.test.d.ts +0 -2
- package/dist/__tests__/analytics/analytics-summary.test.d.ts.map +0 -1
- package/dist/__tests__/analytics/analytics-summary.test.js +0 -267
- package/dist/__tests__/analytics/analytics-summary.test.js.map +0 -1
- package/dist/__tests__/analytics/cost-estimator.test.d.ts +0 -2
- package/dist/__tests__/analytics/cost-estimator.test.d.ts.map +0 -1
- package/dist/__tests__/analytics/cost-estimator.test.js +0 -212
- package/dist/__tests__/analytics/cost-estimator.test.js.map +0 -1
- package/dist/__tests__/hooks/auto-slash-command/executor.test.d.ts +0 -7
- package/dist/__tests__/hooks/auto-slash-command/executor.test.d.ts.map +0 -1
- package/dist/__tests__/hooks/auto-slash-command/executor.test.js +0 -374
- package/dist/__tests__/hooks/auto-slash-command/executor.test.js.map +0 -1
- package/dist/__tests__/hud/auto-tracking.integration.test.d.ts +0 -2
- package/dist/__tests__/hud/auto-tracking.integration.test.d.ts.map +0 -1
- package/dist/__tests__/hud/auto-tracking.integration.test.js +0 -12
- package/dist/__tests__/hud/auto-tracking.integration.test.js.map +0 -1
- package/dist/__tests__/learned-skills/config.test.d.ts +0 -2
- package/dist/__tests__/learned-skills/config.test.d.ts.map +0 -1
- package/dist/__tests__/learned-skills/config.test.js +0 -37
- package/dist/__tests__/learned-skills/config.test.js.map +0 -1
- package/dist/__tests__/learned-skills/detector.test.d.ts +0 -2
- package/dist/__tests__/learned-skills/detector.test.d.ts.map +0 -1
- package/dist/__tests__/learned-skills/detector.test.js +0 -99
- package/dist/__tests__/learned-skills/detector.test.js.map +0 -1
- package/dist/__tests__/learned-skills/finder.test.d.ts +0 -2
- package/dist/__tests__/learned-skills/finder.test.d.ts.map +0 -1
- package/dist/__tests__/learned-skills/finder.test.js +0 -59
- package/dist/__tests__/learned-skills/finder.test.js.map +0 -1
- package/dist/__tests__/learned-skills/loader.test.d.ts +0 -2
- package/dist/__tests__/learned-skills/loader.test.d.ts.map +0 -1
- package/dist/__tests__/learned-skills/loader.test.js +0 -69
- package/dist/__tests__/learned-skills/loader.test.js.map +0 -1
- package/dist/__tests__/learned-skills/parser.test.d.ts +0 -2
- package/dist/__tests__/learned-skills/parser.test.d.ts.map +0 -1
- package/dist/__tests__/learned-skills/parser.test.js +0 -81
- package/dist/__tests__/learned-skills/parser.test.js.map +0 -1
- package/dist/__tests__/learned-skills/validator.test.d.ts +0 -2
- package/dist/__tests__/learned-skills/validator.test.d.ts.map +0 -1
- package/dist/__tests__/learned-skills/validator.test.js +0 -85
- package/dist/__tests__/learned-skills/validator.test.js.map +0 -1
- package/dist/agents/document-writer.d.ts +0 -11
- package/dist/agents/document-writer.d.ts.map +0 -1
- package/dist/agents/document-writer.js +0 -209
- package/dist/agents/document-writer.js.map +0 -1
- package/dist/agents/frontend-engineer.d.ts +0 -11
- package/dist/agents/frontend-engineer.d.ts.map +0 -1
- package/dist/agents/frontend-engineer.js +0 -115
- package/dist/agents/frontend-engineer.js.map +0 -1
- package/dist/agents/librarian.d.ts +0 -12
- package/dist/agents/librarian.d.ts.map +0 -1
- package/dist/agents/librarian.js +0 -103
- package/dist/agents/librarian.js.map +0 -1
- package/dist/agents/metis.d.ts +0 -12
- package/dist/agents/metis.d.ts.map +0 -1
- package/dist/agents/metis.js +0 -117
- package/dist/agents/metis.js.map +0 -1
- package/dist/agents/momus.d.ts +0 -12
- package/dist/agents/momus.d.ts.map +0 -1
- package/dist/agents/momus.js +0 -128
- package/dist/agents/momus.js.map +0 -1
- package/dist/agents/multimodal-looker.d.ts +0 -11
- package/dist/agents/multimodal-looker.d.ts.map +0 -1
- package/dist/agents/multimodal-looker.js +0 -70
- package/dist/agents/multimodal-looker.js.map +0 -1
- package/dist/agents/oracle.d.ts +0 -13
- package/dist/agents/oracle.d.ts.map +0 -1
- package/dist/agents/oracle.js +0 -191
- package/dist/agents/oracle.js.map +0 -1
- package/dist/agents/orchestrator-sisyphus.d.ts +0 -11
- package/dist/agents/orchestrator-sisyphus.d.ts.map +0 -1
- package/dist/agents/orchestrator-sisyphus.js +0 -115
- package/dist/agents/orchestrator-sisyphus.js.map +0 -1
- package/dist/agents/prometheus.d.ts +0 -12
- package/dist/agents/prometheus.d.ts.map +0 -1
- package/dist/agents/prometheus.js +0 -195
- package/dist/agents/prometheus.js.map +0 -1
- package/dist/agents/sisyphus-junior.d.ts +0 -12
- package/dist/agents/sisyphus-junior.d.ts.map +0 -1
- package/dist/agents/sisyphus-junior.js +0 -93
- package/dist/agents/sisyphus-junior.js.map +0 -1
- package/dist/cli/components/CostDashboard.d.ts +0 -15
- package/dist/cli/components/CostDashboard.d.ts.map +0 -1
- package/dist/cli/components/CostDashboard.js +0 -15
- package/dist/cli/components/CostDashboard.js.map +0 -1
- package/dist/cli/components/LiveStats.d.ts +0 -16
- package/dist/cli/components/LiveStats.d.ts.map +0 -1
- package/dist/cli/components/LiveStats.js +0 -16
- package/dist/cli/components/LiveStats.js.map +0 -1
- package/dist/cli/components/SessionBrowser.d.ts +0 -14
- package/dist/cli/components/SessionBrowser.d.ts.map +0 -1
- package/dist/cli/components/SessionBrowser.js +0 -14
- package/dist/cli/components/SessionBrowser.js.map +0 -1
- package/dist/cli/tui.d.ts +0 -21
- package/dist/cli/tui.d.ts.map +0 -1
- package/dist/cli/tui.js +0 -21
- package/dist/cli/tui.js.map +0 -1
- package/dist/hooks/autopilot/signals.d.ts +0 -20
- package/dist/hooks/autopilot/signals.d.ts.map +0 -1
- package/dist/hooks/autopilot/signals.js +0 -75
- package/dist/hooks/autopilot/signals.js.map +0 -1
- package/dist/hooks/autopilot/summary.d.ts +0 -27
- package/dist/hooks/autopilot/summary.d.ts.map +0 -1
- package/dist/hooks/autopilot/summary.js +0 -160
- package/dist/hooks/autopilot/summary.js.map +0 -1
- package/dist/hooks/autopilot/transition.d.ts +0 -39
- package/dist/hooks/autopilot/transition.d.ts.map +0 -1
- package/dist/hooks/autopilot/transition.js +0 -216
- package/dist/hooks/autopilot/transition.js.map +0 -1
- package/dist/hooks/context-window-limit-recovery/constants.d.ts +0 -28
- package/dist/hooks/context-window-limit-recovery/constants.d.ts.map +0 -1
- package/dist/hooks/context-window-limit-recovery/constants.js +0 -85
- package/dist/hooks/context-window-limit-recovery/constants.js.map +0 -1
- package/dist/hooks/context-window-limit-recovery/index.d.ts +0 -62
- package/dist/hooks/context-window-limit-recovery/index.d.ts.map +0 -1
- package/dist/hooks/context-window-limit-recovery/index.js +0 -201
- package/dist/hooks/context-window-limit-recovery/index.js.map +0 -1
- package/dist/hooks/context-window-limit-recovery/parser.d.ts +0 -31
- package/dist/hooks/context-window-limit-recovery/parser.d.ts.map +0 -1
- package/dist/hooks/context-window-limit-recovery/parser.js +0 -241
- package/dist/hooks/context-window-limit-recovery/parser.js.map +0 -1
- package/dist/hooks/context-window-limit-recovery/types.d.ts +0 -84
- package/dist/hooks/context-window-limit-recovery/types.d.ts.map +0 -1
- package/dist/hooks/context-window-limit-recovery/types.js +0 -34
- package/dist/hooks/context-window-limit-recovery/types.js.map +0 -1
- package/dist/hooks/edit-error-recovery/index.d.ts +0 -62
- package/dist/hooks/edit-error-recovery/index.d.ts.map +0 -1
- package/dist/hooks/edit-error-recovery/index.js +0 -89
- package/dist/hooks/edit-error-recovery/index.js.map +0 -1
- package/dist/hooks/learned-skills/config.d.ts +0 -53
- package/dist/hooks/learned-skills/config.d.ts.map +0 -1
- package/dist/hooks/learned-skills/config.js +0 -103
- package/dist/hooks/learned-skills/config.js.map +0 -1
- package/dist/hooks/learned-skills/constants.d.ts +0 -24
- package/dist/hooks/learned-skills/constants.d.ts.map +0 -1
- package/dist/hooks/learned-skills/constants.js +0 -26
- package/dist/hooks/learned-skills/constants.js.map +0 -1
- package/dist/hooks/learned-skills/detection-hook.d.ts +0 -39
- package/dist/hooks/learned-skills/detection-hook.d.ts.map +0 -1
- package/dist/hooks/learned-skills/detection-hook.js +0 -83
- package/dist/hooks/learned-skills/detection-hook.js.map +0 -1
- package/dist/hooks/learned-skills/detector.d.ts +0 -30
- package/dist/hooks/learned-skills/detector.d.ts.map +0 -1
- package/dist/hooks/learned-skills/detector.js +0 -150
- package/dist/hooks/learned-skills/detector.js.map +0 -1
- package/dist/hooks/learned-skills/finder.d.ts +0 -21
- package/dist/hooks/learned-skills/finder.d.ts.map +0 -1
- package/dist/hooks/learned-skills/finder.js +0 -117
- package/dist/hooks/learned-skills/finder.js.map +0 -1
- package/dist/hooks/learned-skills/index.d.ts +0 -62
- package/dist/hooks/learned-skills/index.d.ts.map +0 -1
- package/dist/hooks/learned-skills/index.js +0 -137
- package/dist/hooks/learned-skills/index.js.map +0 -1
- package/dist/hooks/learned-skills/loader.d.ts +0 -20
- package/dist/hooks/learned-skills/loader.d.ts.map +0 -1
- package/dist/hooks/learned-skills/loader.js +0 -107
- package/dist/hooks/learned-skills/loader.js.map +0 -1
- package/dist/hooks/learned-skills/parser.d.ts +0 -21
- package/dist/hooks/learned-skills/parser.d.ts.map +0 -1
- package/dist/hooks/learned-skills/parser.js +0 -190
- package/dist/hooks/learned-skills/parser.js.map +0 -1
- package/dist/hooks/learned-skills/promotion.d.ts +0 -29
- package/dist/hooks/learned-skills/promotion.d.ts.map +0 -1
- package/dist/hooks/learned-skills/promotion.js +0 -87
- package/dist/hooks/learned-skills/promotion.js.map +0 -1
- package/dist/hooks/learned-skills/types.d.ts +0 -109
- package/dist/hooks/learned-skills/types.d.ts.map +0 -1
- package/dist/hooks/learned-skills/types.js +0 -8
- package/dist/hooks/learned-skills/types.js.map +0 -1
- package/dist/hooks/learned-skills/validator.d.ts +0 -15
- package/dist/hooks/learned-skills/validator.d.ts.map +0 -1
- package/dist/hooks/learned-skills/validator.js +0 -87
- package/dist/hooks/learned-skills/validator.js.map +0 -1
- package/dist/hooks/learned-skills/writer.d.ts +0 -27
- package/dist/hooks/learned-skills/writer.d.ts.map +0 -1
- package/dist/hooks/learned-skills/writer.js +0 -126
- package/dist/hooks/learned-skills/writer.js.map +0 -1
- package/dist/hooks/mnemosyne/config.d.ts +0 -53
- package/dist/hooks/mnemosyne/config.d.ts.map +0 -1
- package/dist/hooks/mnemosyne/config.js +0 -103
- package/dist/hooks/mnemosyne/config.js.map +0 -1
- package/dist/hooks/mnemosyne/constants.d.ts +0 -24
- package/dist/hooks/mnemosyne/constants.d.ts.map +0 -1
- package/dist/hooks/mnemosyne/constants.js +0 -26
- package/dist/hooks/mnemosyne/constants.js.map +0 -1
- package/dist/hooks/mnemosyne/detection-hook.d.ts +0 -39
- package/dist/hooks/mnemosyne/detection-hook.d.ts.map +0 -1
- package/dist/hooks/mnemosyne/detection-hook.js +0 -83
- package/dist/hooks/mnemosyne/detection-hook.js.map +0 -1
- package/dist/hooks/mnemosyne/detector.d.ts +0 -30
- package/dist/hooks/mnemosyne/detector.d.ts.map +0 -1
- package/dist/hooks/mnemosyne/detector.js +0 -150
- package/dist/hooks/mnemosyne/detector.js.map +0 -1
- package/dist/hooks/mnemosyne/finder.d.ts +0 -21
- package/dist/hooks/mnemosyne/finder.d.ts.map +0 -1
- package/dist/hooks/mnemosyne/finder.js +0 -117
- package/dist/hooks/mnemosyne/finder.js.map +0 -1
- package/dist/hooks/mnemosyne/index.d.ts +0 -62
- package/dist/hooks/mnemosyne/index.d.ts.map +0 -1
- package/dist/hooks/mnemosyne/index.js +0 -137
- package/dist/hooks/mnemosyne/index.js.map +0 -1
- package/dist/hooks/mnemosyne/loader.d.ts +0 -20
- package/dist/hooks/mnemosyne/loader.d.ts.map +0 -1
- package/dist/hooks/mnemosyne/loader.js +0 -113
- package/dist/hooks/mnemosyne/loader.js.map +0 -1
- package/dist/hooks/mnemosyne/parser.d.ts +0 -21
- package/dist/hooks/mnemosyne/parser.d.ts.map +0 -1
- package/dist/hooks/mnemosyne/parser.js +0 -190
- package/dist/hooks/mnemosyne/parser.js.map +0 -1
- package/dist/hooks/mnemosyne/promotion.d.ts +0 -29
- package/dist/hooks/mnemosyne/promotion.d.ts.map +0 -1
- package/dist/hooks/mnemosyne/promotion.js +0 -87
- package/dist/hooks/mnemosyne/promotion.js.map +0 -1
- package/dist/hooks/mnemosyne/types.d.ts +0 -109
- package/dist/hooks/mnemosyne/types.d.ts.map +0 -1
- package/dist/hooks/mnemosyne/types.js +0 -8
- package/dist/hooks/mnemosyne/types.js.map +0 -1
- package/dist/hooks/mnemosyne/validator.d.ts +0 -15
- package/dist/hooks/mnemosyne/validator.d.ts.map +0 -1
- package/dist/hooks/mnemosyne/validator.js +0 -87
- package/dist/hooks/mnemosyne/validator.js.map +0 -1
- package/dist/hooks/mnemosyne/writer.d.ts +0 -27
- package/dist/hooks/mnemosyne/writer.d.ts.map +0 -1
- package/dist/hooks/mnemosyne/writer.js +0 -126
- package/dist/hooks/mnemosyne/writer.js.map +0 -1
- package/dist/hooks/ralph-loop/index.d.ts +0 -116
- package/dist/hooks/ralph-loop/index.d.ts.map +0 -1
- package/dist/hooks/ralph-loop/index.js +0 -322
- package/dist/hooks/ralph-loop/index.js.map +0 -1
- package/dist/hooks/ralph-prd/index.d.ts +0 -130
- package/dist/hooks/ralph-prd/index.d.ts.map +0 -1
- package/dist/hooks/ralph-prd/index.js +0 -310
- package/dist/hooks/ralph-prd/index.js.map +0 -1
- package/dist/hooks/ralph-progress/index.d.ts +0 -102
- package/dist/hooks/ralph-progress/index.d.ts.map +0 -1
- package/dist/hooks/ralph-progress/index.js +0 -408
- package/dist/hooks/ralph-progress/index.js.map +0 -1
- package/dist/hooks/ralph-verifier/index.d.ts +0 -72
- package/dist/hooks/ralph-verifier/index.d.ts.map +0 -1
- package/dist/hooks/ralph-verifier/index.js +0 -223
- package/dist/hooks/ralph-verifier/index.js.map +0 -1
- package/dist/hooks/session-recovery/constants.d.ts +0 -56
- package/dist/hooks/session-recovery/constants.d.ts.map +0 -1
- package/dist/hooks/session-recovery/constants.js +0 -78
- package/dist/hooks/session-recovery/constants.js.map +0 -1
- package/dist/hooks/session-recovery/index.d.ts +0 -53
- package/dist/hooks/session-recovery/index.d.ts.map +0 -1
- package/dist/hooks/session-recovery/index.js +0 -321
- package/dist/hooks/session-recovery/index.js.map +0 -1
- package/dist/hooks/session-recovery/storage.d.ts +0 -76
- package/dist/hooks/session-recovery/storage.d.ts.map +0 -1
- package/dist/hooks/session-recovery/storage.js +0 -383
- package/dist/hooks/session-recovery/storage.js.map +0 -1
- package/dist/hooks/session-recovery/types.d.ts +0 -145
- package/dist/hooks/session-recovery/types.d.ts.map +0 -1
- package/dist/hooks/session-recovery/types.js +0 -8
- package/dist/hooks/session-recovery/types.js.map +0 -1
- package/dist/hooks/sisyphus-orchestrator/constants.d.ts +0 -23
- package/dist/hooks/sisyphus-orchestrator/constants.d.ts.map +0 -1
- package/dist/hooks/sisyphus-orchestrator/constants.js +0 -142
- package/dist/hooks/sisyphus-orchestrator/constants.js.map +0 -1
- package/dist/hooks/sisyphus-orchestrator/index.d.ts +0 -113
- package/dist/hooks/sisyphus-orchestrator/index.d.ts.map +0 -1
- package/dist/hooks/sisyphus-orchestrator/index.js +0 -309
- package/dist/hooks/sisyphus-orchestrator/index.js.map +0 -1
- package/dist/hooks/ultraqa-loop/index.d.ts +0 -94
- package/dist/hooks/ultraqa-loop/index.d.ts.map +0 -1
- package/dist/hooks/ultraqa-loop/index.js +0 -216
- package/dist/hooks/ultraqa-loop/index.js.map +0 -1
- package/dist/hooks/ultrawork-state/index.d.ts +0 -62
- package/dist/hooks/ultrawork-state/index.d.ts.map +0 -1
- package/dist/hooks/ultrawork-state/index.js +0 -208
- package/dist/hooks/ultrawork-state/index.js.map +0 -1
- package/dist/hud/sisyphus-state.d.ts +0 -31
- package/dist/hud/sisyphus-state.d.ts.map +0 -1
- package/dist/hud/sisyphus-state.js +0 -163
- package/dist/hud/sisyphus-state.js.map +0 -1
|
@@ -0,0 +1,427 @@
|
|
|
1
|
+
import { describe, it, expect } from 'vitest';
|
|
2
|
+
import { removeCodeBlocks, extractPromptText, detectKeywordsWithType, hasKeyword, getPrimaryKeyword, } from '../index.js';
|
|
3
|
+
describe('keyword-detector', () => {
|
|
4
|
+
describe('removeCodeBlocks', () => {
|
|
5
|
+
it('should remove fenced code blocks with triple backticks', () => {
|
|
6
|
+
const text = 'Before ```code here``` after';
|
|
7
|
+
expect(removeCodeBlocks(text)).toBe('Before after');
|
|
8
|
+
});
|
|
9
|
+
it('should remove fenced code blocks with tildes', () => {
|
|
10
|
+
const text = 'Before ~~~code here~~~ after';
|
|
11
|
+
expect(removeCodeBlocks(text)).toBe('Before after');
|
|
12
|
+
});
|
|
13
|
+
it('should remove multiline fenced code blocks', () => {
|
|
14
|
+
const text = `Hello
|
|
15
|
+
\`\`\`javascript
|
|
16
|
+
const x = 1;
|
|
17
|
+
const y = 2;
|
|
18
|
+
\`\`\`
|
|
19
|
+
World`;
|
|
20
|
+
expect(removeCodeBlocks(text)).toBe(`Hello
|
|
21
|
+
|
|
22
|
+
World`);
|
|
23
|
+
});
|
|
24
|
+
it('should remove inline code with single backticks', () => {
|
|
25
|
+
const text = 'Use `autopilot` command here';
|
|
26
|
+
expect(removeCodeBlocks(text)).toBe('Use command here');
|
|
27
|
+
});
|
|
28
|
+
it('should handle nested backticks in fenced blocks', () => {
|
|
29
|
+
// The regex matches ```...``` greedily, so ```const x = `test````
|
|
30
|
+
// matches from first ``` to the triple backtick at the end
|
|
31
|
+
const text = 'Before ```const x = `test` ``` after';
|
|
32
|
+
expect(removeCodeBlocks(text)).toBe('Before after');
|
|
33
|
+
});
|
|
34
|
+
it('should handle multiple code blocks', () => {
|
|
35
|
+
const text = '`a` middle `b` end';
|
|
36
|
+
expect(removeCodeBlocks(text)).toBe(' middle end');
|
|
37
|
+
});
|
|
38
|
+
it('should handle empty input', () => {
|
|
39
|
+
expect(removeCodeBlocks('')).toBe('');
|
|
40
|
+
});
|
|
41
|
+
it('should return text unchanged when no code blocks', () => {
|
|
42
|
+
const text = 'Regular text without code';
|
|
43
|
+
expect(removeCodeBlocks(text)).toBe('Regular text without code');
|
|
44
|
+
});
|
|
45
|
+
it('should handle code blocks with language specifier', () => {
|
|
46
|
+
const text = '```typescript\nconst x = 1;\n``` done';
|
|
47
|
+
expect(removeCodeBlocks(text)).toBe(' done');
|
|
48
|
+
});
|
|
49
|
+
});
|
|
50
|
+
describe('extractPromptText', () => {
|
|
51
|
+
it('should extract text from text parts', () => {
|
|
52
|
+
const parts = [
|
|
53
|
+
{ type: 'text', text: 'Hello' },
|
|
54
|
+
{ type: 'text', text: 'World' },
|
|
55
|
+
];
|
|
56
|
+
expect(extractPromptText(parts)).toBe('Hello World');
|
|
57
|
+
});
|
|
58
|
+
it('should ignore non-text parts', () => {
|
|
59
|
+
const parts = [
|
|
60
|
+
{ type: 'text', text: 'Hello' },
|
|
61
|
+
{ type: 'image', url: 'http://example.com' },
|
|
62
|
+
{ type: 'text', text: 'World' },
|
|
63
|
+
];
|
|
64
|
+
expect(extractPromptText(parts)).toBe('Hello World');
|
|
65
|
+
});
|
|
66
|
+
it('should handle empty parts array', () => {
|
|
67
|
+
expect(extractPromptText([])).toBe('');
|
|
68
|
+
});
|
|
69
|
+
it('should handle parts with no text', () => {
|
|
70
|
+
const parts = [
|
|
71
|
+
{ type: 'text' },
|
|
72
|
+
{ type: 'text', text: 'Valid' },
|
|
73
|
+
];
|
|
74
|
+
expect(extractPromptText(parts)).toBe('Valid');
|
|
75
|
+
});
|
|
76
|
+
it('should handle undefined text gracefully', () => {
|
|
77
|
+
const parts = [
|
|
78
|
+
{ type: 'text', text: undefined },
|
|
79
|
+
{ type: 'text', text: 'Hello' },
|
|
80
|
+
];
|
|
81
|
+
expect(extractPromptText(parts)).toBe('Hello');
|
|
82
|
+
});
|
|
83
|
+
it('should handle all non-text parts', () => {
|
|
84
|
+
const parts = [
|
|
85
|
+
{ type: 'image' },
|
|
86
|
+
{ type: 'tool_use' },
|
|
87
|
+
];
|
|
88
|
+
expect(extractPromptText(parts)).toBe('');
|
|
89
|
+
});
|
|
90
|
+
});
|
|
91
|
+
describe('detectKeywordsWithType', () => {
|
|
92
|
+
describe('ralph keyword', () => {
|
|
93
|
+
it('should detect ralph keyword', () => {
|
|
94
|
+
const result = detectKeywordsWithType('Please ralph this task');
|
|
95
|
+
const ralphMatch = result.find((r) => r.type === 'ralph');
|
|
96
|
+
expect(ralphMatch).toBeDefined();
|
|
97
|
+
expect(ralphMatch?.keyword).toBe('ralph');
|
|
98
|
+
});
|
|
99
|
+
it('should detect "don\'t stop" keyword', () => {
|
|
100
|
+
const result = detectKeywordsWithType("Don't stop until done");
|
|
101
|
+
const ralphMatch = result.find((r) => r.type === 'ralph');
|
|
102
|
+
expect(ralphMatch).toBeDefined();
|
|
103
|
+
});
|
|
104
|
+
it('should detect "must complete" keyword', () => {
|
|
105
|
+
const result = detectKeywordsWithType('You must complete this task');
|
|
106
|
+
const ralphMatch = result.find((r) => r.type === 'ralph');
|
|
107
|
+
expect(ralphMatch).toBeDefined();
|
|
108
|
+
});
|
|
109
|
+
it('should detect "until done" keyword', () => {
|
|
110
|
+
const result = detectKeywordsWithType('Keep going until done');
|
|
111
|
+
const ralphMatch = result.find((r) => r.type === 'ralph');
|
|
112
|
+
expect(ralphMatch).toBeDefined();
|
|
113
|
+
});
|
|
114
|
+
});
|
|
115
|
+
describe('autopilot keyword', () => {
|
|
116
|
+
it('should detect autopilot keyword', () => {
|
|
117
|
+
const result = detectKeywordsWithType('Run in autopilot mode');
|
|
118
|
+
const autopilotMatch = result.find((r) => r.type === 'autopilot');
|
|
119
|
+
expect(autopilotMatch).toBeDefined();
|
|
120
|
+
});
|
|
121
|
+
it('should detect "auto pilot" with space', () => {
|
|
122
|
+
const result = detectKeywordsWithType('Enable auto pilot');
|
|
123
|
+
const autopilotMatch = result.find((r) => r.type === 'autopilot');
|
|
124
|
+
expect(autopilotMatch).toBeDefined();
|
|
125
|
+
});
|
|
126
|
+
it('should detect "auto-pilot" with hyphen', () => {
|
|
127
|
+
const result = detectKeywordsWithType('Enable auto-pilot mode');
|
|
128
|
+
const autopilotMatch = result.find((r) => r.type === 'autopilot');
|
|
129
|
+
expect(autopilotMatch).toBeDefined();
|
|
130
|
+
});
|
|
131
|
+
it('should detect "autonomous" keyword', () => {
|
|
132
|
+
const result = detectKeywordsWithType('Run in autonomous mode');
|
|
133
|
+
const autopilotMatch = result.find((r) => r.type === 'autopilot');
|
|
134
|
+
expect(autopilotMatch).toBeDefined();
|
|
135
|
+
});
|
|
136
|
+
it('should detect "full auto" keyword', () => {
|
|
137
|
+
const result = detectKeywordsWithType('Go full auto on this');
|
|
138
|
+
const autopilotMatch = result.find((r) => r.type === 'autopilot');
|
|
139
|
+
expect(autopilotMatch).toBeDefined();
|
|
140
|
+
});
|
|
141
|
+
it('should detect "fullsend" keyword', () => {
|
|
142
|
+
const result = detectKeywordsWithType('fullsend this implementation');
|
|
143
|
+
const autopilotMatch = result.find((r) => r.type === 'autopilot');
|
|
144
|
+
expect(autopilotMatch).toBeDefined();
|
|
145
|
+
});
|
|
146
|
+
it('should detect autopilot phrase "build me"', () => {
|
|
147
|
+
const result = detectKeywordsWithType('build me a web app');
|
|
148
|
+
const autopilotMatch = result.find((r) => r.type === 'autopilot');
|
|
149
|
+
expect(autopilotMatch).toBeDefined();
|
|
150
|
+
});
|
|
151
|
+
it('should detect autopilot phrase "create me"', () => {
|
|
152
|
+
const result = detectKeywordsWithType('create me a new feature');
|
|
153
|
+
const autopilotMatch = result.find((r) => r.type === 'autopilot');
|
|
154
|
+
expect(autopilotMatch).toBeDefined();
|
|
155
|
+
});
|
|
156
|
+
it('should detect autopilot phrase "make me"', () => {
|
|
157
|
+
const result = detectKeywordsWithType('make me a dashboard');
|
|
158
|
+
const autopilotMatch = result.find((r) => r.type === 'autopilot');
|
|
159
|
+
expect(autopilotMatch).toBeDefined();
|
|
160
|
+
});
|
|
161
|
+
it('should detect autopilot phrase "i want a"', () => {
|
|
162
|
+
const result = detectKeywordsWithType('i want a new login page');
|
|
163
|
+
const autopilotMatch = result.find((r) => r.type === 'autopilot');
|
|
164
|
+
expect(autopilotMatch).toBeDefined();
|
|
165
|
+
});
|
|
166
|
+
it('should detect autopilot phrase "handle it all"', () => {
|
|
167
|
+
const result = detectKeywordsWithType('Just handle it all');
|
|
168
|
+
const autopilotMatch = result.find((r) => r.type === 'autopilot');
|
|
169
|
+
expect(autopilotMatch).toBeDefined();
|
|
170
|
+
});
|
|
171
|
+
it('should detect autopilot phrase "end to end"', () => {
|
|
172
|
+
const result = detectKeywordsWithType('Build this end to end');
|
|
173
|
+
const autopilotMatch = result.find((r) => r.type === 'autopilot');
|
|
174
|
+
expect(autopilotMatch).toBeDefined();
|
|
175
|
+
});
|
|
176
|
+
it('should detect autopilot phrase "e2e this"', () => {
|
|
177
|
+
const result = detectKeywordsWithType('e2e this feature');
|
|
178
|
+
const autopilotMatch = result.find((r) => r.type === 'autopilot');
|
|
179
|
+
expect(autopilotMatch).toBeDefined();
|
|
180
|
+
});
|
|
181
|
+
});
|
|
182
|
+
describe('ultrawork keyword', () => {
|
|
183
|
+
it('should detect ultrawork keyword', () => {
|
|
184
|
+
const result = detectKeywordsWithType('Do ultrawork on this');
|
|
185
|
+
const ultraworkMatch = result.find((r) => r.type === 'ultrawork');
|
|
186
|
+
expect(ultraworkMatch).toBeDefined();
|
|
187
|
+
});
|
|
188
|
+
it('should detect ulw abbreviation', () => {
|
|
189
|
+
const result = detectKeywordsWithType('ulw this code');
|
|
190
|
+
const ultraworkMatch = result.find((r) => r.type === 'ultrawork');
|
|
191
|
+
expect(ultraworkMatch).toBeDefined();
|
|
192
|
+
});
|
|
193
|
+
});
|
|
194
|
+
describe('ultrathink keyword', () => {
|
|
195
|
+
it('should detect ultrathink keyword', () => {
|
|
196
|
+
const result = detectKeywordsWithType('ultrathink about this problem');
|
|
197
|
+
const ultrathinkMatch = result.find((r) => r.type === 'ultrathink');
|
|
198
|
+
expect(ultrathinkMatch).toBeDefined();
|
|
199
|
+
});
|
|
200
|
+
it('should detect think keyword', () => {
|
|
201
|
+
const result = detectKeywordsWithType('think about this problem');
|
|
202
|
+
const ultrathinkMatch = result.find((r) => r.type === 'ultrathink');
|
|
203
|
+
expect(ultrathinkMatch).toBeDefined();
|
|
204
|
+
});
|
|
205
|
+
});
|
|
206
|
+
describe('search keyword', () => {
|
|
207
|
+
it('should detect search keyword', () => {
|
|
208
|
+
const result = detectKeywordsWithType('search for files');
|
|
209
|
+
const searchMatch = result.find((r) => r.type === 'search');
|
|
210
|
+
expect(searchMatch).toBeDefined();
|
|
211
|
+
});
|
|
212
|
+
it('should detect find keyword', () => {
|
|
213
|
+
const result = detectKeywordsWithType('find the bug');
|
|
214
|
+
const searchMatch = result.find((r) => r.type === 'search');
|
|
215
|
+
expect(searchMatch).toBeDefined();
|
|
216
|
+
});
|
|
217
|
+
it('should detect locate keyword', () => {
|
|
218
|
+
const result = detectKeywordsWithType('locate the function');
|
|
219
|
+
const searchMatch = result.find((r) => r.type === 'search');
|
|
220
|
+
expect(searchMatch).toBeDefined();
|
|
221
|
+
});
|
|
222
|
+
it('should detect "where is" phrase', () => {
|
|
223
|
+
const result = detectKeywordsWithType('where is the config');
|
|
224
|
+
const searchMatch = result.find((r) => r.type === 'search');
|
|
225
|
+
expect(searchMatch).toBeDefined();
|
|
226
|
+
});
|
|
227
|
+
it('should detect "show me" phrase', () => {
|
|
228
|
+
const result = detectKeywordsWithType('show me the files');
|
|
229
|
+
const searchMatch = result.find((r) => r.type === 'search');
|
|
230
|
+
expect(searchMatch).toBeDefined();
|
|
231
|
+
});
|
|
232
|
+
it('should detect "list all" phrase', () => {
|
|
233
|
+
const result = detectKeywordsWithType('list all components');
|
|
234
|
+
const searchMatch = result.find((r) => r.type === 'search');
|
|
235
|
+
expect(searchMatch).toBeDefined();
|
|
236
|
+
});
|
|
237
|
+
it('should detect grep keyword', () => {
|
|
238
|
+
const result = detectKeywordsWithType('grep for errors');
|
|
239
|
+
const searchMatch = result.find((r) => r.type === 'search');
|
|
240
|
+
expect(searchMatch).toBeDefined();
|
|
241
|
+
});
|
|
242
|
+
});
|
|
243
|
+
describe('analyze keyword', () => {
|
|
244
|
+
it('should detect analyze keyword', () => {
|
|
245
|
+
const result = detectKeywordsWithType('analyze this code');
|
|
246
|
+
const analyzeMatch = result.find((r) => r.type === 'analyze');
|
|
247
|
+
expect(analyzeMatch).toBeDefined();
|
|
248
|
+
});
|
|
249
|
+
it('should detect analyse (British spelling) keyword', () => {
|
|
250
|
+
const result = detectKeywordsWithType('analyse this code');
|
|
251
|
+
const analyzeMatch = result.find((r) => r.type === 'analyze');
|
|
252
|
+
expect(analyzeMatch).toBeDefined();
|
|
253
|
+
});
|
|
254
|
+
it('should detect investigate keyword', () => {
|
|
255
|
+
const result = detectKeywordsWithType('investigate the issue');
|
|
256
|
+
const analyzeMatch = result.find((r) => r.type === 'analyze');
|
|
257
|
+
expect(analyzeMatch).toBeDefined();
|
|
258
|
+
});
|
|
259
|
+
it('should detect debug keyword', () => {
|
|
260
|
+
const result = detectKeywordsWithType('debug this function');
|
|
261
|
+
const analyzeMatch = result.find((r) => r.type === 'analyze');
|
|
262
|
+
expect(analyzeMatch).toBeDefined();
|
|
263
|
+
});
|
|
264
|
+
it('should detect "why is" phrase', () => {
|
|
265
|
+
const result = detectKeywordsWithType('why is this failing');
|
|
266
|
+
const analyzeMatch = result.find((r) => r.type === 'analyze');
|
|
267
|
+
expect(analyzeMatch).toBeDefined();
|
|
268
|
+
});
|
|
269
|
+
it('should detect "how does" phrase', () => {
|
|
270
|
+
const result = detectKeywordsWithType('how does this work');
|
|
271
|
+
const analyzeMatch = result.find((r) => r.type === 'analyze');
|
|
272
|
+
expect(analyzeMatch).toBeDefined();
|
|
273
|
+
});
|
|
274
|
+
it('should detect "how to" phrase', () => {
|
|
275
|
+
const result = detectKeywordsWithType('how to fix this bug');
|
|
276
|
+
const analyzeMatch = result.find((r) => r.type === 'analyze');
|
|
277
|
+
expect(analyzeMatch).toBeDefined();
|
|
278
|
+
});
|
|
279
|
+
it('should detect deep-dive keyword', () => {
|
|
280
|
+
const result = detectKeywordsWithType('deep-dive into the module');
|
|
281
|
+
const analyzeMatch = result.find((r) => r.type === 'analyze');
|
|
282
|
+
expect(analyzeMatch).toBeDefined();
|
|
283
|
+
});
|
|
284
|
+
it('should detect deepdive keyword', () => {
|
|
285
|
+
const result = detectKeywordsWithType('deepdive the architecture');
|
|
286
|
+
const analyzeMatch = result.find((r) => r.type === 'analyze');
|
|
287
|
+
expect(analyzeMatch).toBeDefined();
|
|
288
|
+
});
|
|
289
|
+
});
|
|
290
|
+
describe('case insensitivity', () => {
|
|
291
|
+
it('should detect RALPH in uppercase', () => {
|
|
292
|
+
const result = detectKeywordsWithType('RALPH this task');
|
|
293
|
+
const ralphMatch = result.find((r) => r.type === 'ralph');
|
|
294
|
+
expect(ralphMatch).toBeDefined();
|
|
295
|
+
});
|
|
296
|
+
it('should detect AUTOPILOT in uppercase', () => {
|
|
297
|
+
const result = detectKeywordsWithType('AUTOPILOT mode');
|
|
298
|
+
const autopilotMatch = result.find((r) => r.type === 'autopilot');
|
|
299
|
+
expect(autopilotMatch).toBeDefined();
|
|
300
|
+
});
|
|
301
|
+
it('should detect mixed case keywords', () => {
|
|
302
|
+
const result = detectKeywordsWithType('UltraThink about this');
|
|
303
|
+
const ultrathinkMatch = result.find((r) => r.type === 'ultrathink');
|
|
304
|
+
expect(ultrathinkMatch).toBeDefined();
|
|
305
|
+
});
|
|
306
|
+
});
|
|
307
|
+
describe('code block exclusion', () => {
|
|
308
|
+
it('should not detect keyword inside fenced code block', () => {
|
|
309
|
+
const text = '```\nautopilot\n```';
|
|
310
|
+
const result = detectKeywordsWithType(text);
|
|
311
|
+
expect(result.length).toBe(0);
|
|
312
|
+
});
|
|
313
|
+
it('should not detect keyword inside inline code', () => {
|
|
314
|
+
const text = 'Use `autopilot` command';
|
|
315
|
+
const result = detectKeywordsWithType(text);
|
|
316
|
+
expect(result.length).toBe(0);
|
|
317
|
+
});
|
|
318
|
+
it('should detect keyword outside code block but not inside', () => {
|
|
319
|
+
const text = 'autopilot ```autopilot``` end';
|
|
320
|
+
const result = detectKeywordsWithType(text);
|
|
321
|
+
const autopilotMatches = result.filter((r) => r.type === 'autopilot');
|
|
322
|
+
expect(autopilotMatches.length).toBeGreaterThan(0);
|
|
323
|
+
});
|
|
324
|
+
});
|
|
325
|
+
describe('edge cases', () => {
|
|
326
|
+
it('should handle empty input', () => {
|
|
327
|
+
const result = detectKeywordsWithType('');
|
|
328
|
+
expect(result.length).toBe(0);
|
|
329
|
+
});
|
|
330
|
+
it('should handle whitespace only input', () => {
|
|
331
|
+
const result = detectKeywordsWithType(' \n\t ');
|
|
332
|
+
expect(result.length).toBe(0);
|
|
333
|
+
});
|
|
334
|
+
it('should handle special characters', () => {
|
|
335
|
+
const result = detectKeywordsWithType('!@#$%^&*()');
|
|
336
|
+
expect(result.length).toBe(0);
|
|
337
|
+
});
|
|
338
|
+
it('should return position of detected keywords', () => {
|
|
339
|
+
const text = 'Please autopilot this';
|
|
340
|
+
const result = detectKeywordsWithType(text);
|
|
341
|
+
const autopilotMatch = result.find((r) => r.type === 'autopilot');
|
|
342
|
+
expect(autopilotMatch?.position).toBeGreaterThanOrEqual(0);
|
|
343
|
+
});
|
|
344
|
+
it('should detect multiple different keyword types', () => {
|
|
345
|
+
const text = 'autopilot and analyze this';
|
|
346
|
+
const result = detectKeywordsWithType(text);
|
|
347
|
+
const types = result.map((r) => r.type);
|
|
348
|
+
expect(types).toContain('autopilot');
|
|
349
|
+
expect(types).toContain('analyze');
|
|
350
|
+
});
|
|
351
|
+
});
|
|
352
|
+
});
|
|
353
|
+
describe('hasKeyword', () => {
|
|
354
|
+
it('should return true when keyword exists', () => {
|
|
355
|
+
expect(hasKeyword('autopilot this')).toBe(true);
|
|
356
|
+
});
|
|
357
|
+
it('should return true for ralph keyword', () => {
|
|
358
|
+
expect(hasKeyword('ralph the task')).toBe(true);
|
|
359
|
+
});
|
|
360
|
+
it('should return false when no keyword exists', () => {
|
|
361
|
+
expect(hasKeyword('regular text here')).toBe(false);
|
|
362
|
+
});
|
|
363
|
+
it('should return false for empty input', () => {
|
|
364
|
+
expect(hasKeyword('')).toBe(false);
|
|
365
|
+
});
|
|
366
|
+
it('should return false when keyword is inside code block', () => {
|
|
367
|
+
expect(hasKeyword('```autopilot```')).toBe(false);
|
|
368
|
+
});
|
|
369
|
+
it('should return true when keyword is outside code block', () => {
|
|
370
|
+
expect(hasKeyword('autopilot ```other code```')).toBe(true);
|
|
371
|
+
});
|
|
372
|
+
});
|
|
373
|
+
describe('getPrimaryKeyword', () => {
|
|
374
|
+
describe('priority order', () => {
|
|
375
|
+
it('should return ralph over autopilot', () => {
|
|
376
|
+
const result = getPrimaryKeyword('ralph and autopilot');
|
|
377
|
+
expect(result?.type).toBe('ralph');
|
|
378
|
+
});
|
|
379
|
+
it('should return autopilot over ultrawork', () => {
|
|
380
|
+
const result = getPrimaryKeyword('autopilot and ultrawork');
|
|
381
|
+
expect(result?.type).toBe('autopilot');
|
|
382
|
+
});
|
|
383
|
+
it('should return ultrawork over ultrathink', () => {
|
|
384
|
+
const result = getPrimaryKeyword('ultrawork and ultrathink');
|
|
385
|
+
expect(result?.type).toBe('ultrawork');
|
|
386
|
+
});
|
|
387
|
+
it('should return ultrathink over search', () => {
|
|
388
|
+
const result = getPrimaryKeyword('think and search');
|
|
389
|
+
expect(result?.type).toBe('ultrathink');
|
|
390
|
+
});
|
|
391
|
+
it('should return search over analyze', () => {
|
|
392
|
+
const result = getPrimaryKeyword('find and debug');
|
|
393
|
+
expect(result?.type).toBe('search');
|
|
394
|
+
});
|
|
395
|
+
it('should return analyze when it is the only keyword', () => {
|
|
396
|
+
const result = getPrimaryKeyword('analyze this code');
|
|
397
|
+
expect(result?.type).toBe('analyze');
|
|
398
|
+
});
|
|
399
|
+
});
|
|
400
|
+
it('should return null when no keyword found', () => {
|
|
401
|
+
const result = getPrimaryKeyword('regular text');
|
|
402
|
+
expect(result).toBeNull();
|
|
403
|
+
});
|
|
404
|
+
it('should return null for empty input', () => {
|
|
405
|
+
const result = getPrimaryKeyword('');
|
|
406
|
+
expect(result).toBeNull();
|
|
407
|
+
});
|
|
408
|
+
it('should return null when keyword is in code block', () => {
|
|
409
|
+
const result = getPrimaryKeyword('```autopilot```');
|
|
410
|
+
expect(result).toBeNull();
|
|
411
|
+
});
|
|
412
|
+
it('should return keyword with correct type and position', () => {
|
|
413
|
+
const result = getPrimaryKeyword('autopilot this task');
|
|
414
|
+
expect(result).not.toBeNull();
|
|
415
|
+
expect(result?.type).toBe('autopilot');
|
|
416
|
+
expect(result?.keyword).toBeDefined();
|
|
417
|
+
expect(result?.position).toBeGreaterThanOrEqual(0);
|
|
418
|
+
});
|
|
419
|
+
it('should handle complex text with multiple keywords', () => {
|
|
420
|
+
const text = 'Please ralph this and then autopilot the rest, think about it and analyze';
|
|
421
|
+
const result = getPrimaryKeyword(text);
|
|
422
|
+
// ralph has highest priority
|
|
423
|
+
expect(result?.type).toBe('ralph');
|
|
424
|
+
});
|
|
425
|
+
});
|
|
426
|
+
});
|
|
427
|
+
//# sourceMappingURL=index.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.test.js","sourceRoot":"","sources":["../../../../src/hooks/keyword-detector/__tests__/index.test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,EAAE,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAC9C,OAAO,EACL,gBAAgB,EAChB,iBAAiB,E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AAM,EAAE,IAAI,CAAC,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;YACvC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,WAAW,EAAE,CAAC;YACtC,MAAM,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAC,sBAAsB,CAAC,CAAC,CAAC,CAAC;QACrD,CAAC,CAAC,CAAC;QAEH,EAAE,CAAC,mDAAmD,EAAE,GAAG,EAAE;YAC3D,MAAM,IAAI,GAAG,2EAA2E,CAAC;YACzF,MAAM,MAAM,GAAG,iBAAiB,CAAC,IAAI,CAAC,CAAC;YACvC,6BAA6B;YAC7B,MAAM,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QACrC,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Mode Registry - Centralized Mode State Detection
|
|
3
|
+
*
|
|
4
|
+
* CRITICAL: This module uses ONLY file-based detection.
|
|
5
|
+
* It NEVER imports from mode modules to avoid circular dependencies.
|
|
6
|
+
*
|
|
7
|
+
* Mode modules import FROM this registry (unidirectional).
|
|
8
|
+
*
|
|
9
|
+
* All modes store state in `.omc/state/` subdirectory for consistency.
|
|
10
|
+
*/
|
|
11
|
+
import type { ExecutionMode, ModeConfig, ModeStatus, CanStartResult } from './types.js';
|
|
12
|
+
export type { ExecutionMode, ModeConfig, ModeStatus, CanStartResult } from './types.js';
|
|
13
|
+
/**
|
|
14
|
+
* Stale marker threshold (1 hour)
|
|
15
|
+
* Markers older than this are auto-removed to prevent crashed sessions from blocking indefinitely.
|
|
16
|
+
* NOTE: We cannot check database activity here due to circular dependency constraints.
|
|
17
|
+
* Legitimate long-running swarms (>1 hour) may have markers removed - acceptable trade-off.
|
|
18
|
+
*/
|
|
19
|
+
export declare const STALE_MARKER_THRESHOLD: number;
|
|
20
|
+
/**
|
|
21
|
+
* Mode configuration registry
|
|
22
|
+
*
|
|
23
|
+
* Maps each mode to its state file location and detection method.
|
|
24
|
+
* All paths are relative to .omc/state/ directory.
|
|
25
|
+
*/
|
|
26
|
+
declare const MODE_CONFIGS: Record<ExecutionMode, ModeConfig>;
|
|
27
|
+
export { MODE_CONFIGS };
|
|
28
|
+
/**
|
|
29
|
+
* Get the state directory path
|
|
30
|
+
*/
|
|
31
|
+
export declare function getStateDir(cwd: string): string;
|
|
32
|
+
/**
|
|
33
|
+
* Ensure the state directory exists
|
|
34
|
+
*/
|
|
35
|
+
export declare function ensureStateDir(cwd: string): void;
|
|
36
|
+
/**
|
|
37
|
+
* Get the full path to a mode's state file
|
|
38
|
+
*/
|
|
39
|
+
export declare function getStateFilePath(cwd: string, mode: ExecutionMode): string;
|
|
40
|
+
/**
|
|
41
|
+
* Get the full path to a mode's marker file
|
|
42
|
+
*/
|
|
43
|
+
export declare function getMarkerFilePath(cwd: string, mode: ExecutionMode): string | null;
|
|
44
|
+
/**
|
|
45
|
+
* Get the global state file path (in ~/.claude/) for modes that support it
|
|
46
|
+
*/
|
|
47
|
+
export declare function getGlobalStateFilePath(mode: ExecutionMode): string | null;
|
|
48
|
+
/**
|
|
49
|
+
* Check if a specific mode is currently active
|
|
50
|
+
*
|
|
51
|
+
* @param mode - The mode to check
|
|
52
|
+
* @param cwd - Working directory
|
|
53
|
+
* @returns true if the mode is active
|
|
54
|
+
*/
|
|
55
|
+
export declare function isModeActive(mode: ExecutionMode, cwd: string): boolean;
|
|
56
|
+
/**
|
|
57
|
+
* Check if a mode has active state (file exists)
|
|
58
|
+
*/
|
|
59
|
+
export declare function hasModeState(cwd: string, mode: ExecutionMode): boolean;
|
|
60
|
+
/**
|
|
61
|
+
* Get all modes that currently have state files
|
|
62
|
+
*/
|
|
63
|
+
export declare function getActiveModes(cwd: string): ExecutionMode[];
|
|
64
|
+
/**
|
|
65
|
+
* Get the currently active exclusive mode (if any)
|
|
66
|
+
*
|
|
67
|
+
* @param cwd - Working directory
|
|
68
|
+
* @returns The active mode or null
|
|
69
|
+
*/
|
|
70
|
+
export declare function getActiveExclusiveMode(cwd: string): ExecutionMode | null;
|
|
71
|
+
/**
|
|
72
|
+
* Check if a new mode can be started
|
|
73
|
+
*
|
|
74
|
+
* @param mode - The mode to start
|
|
75
|
+
* @param cwd - Working directory
|
|
76
|
+
* @returns CanStartResult with allowed status and blocker info
|
|
77
|
+
*/
|
|
78
|
+
export declare function canStartMode(mode: ExecutionMode, cwd: string): CanStartResult;
|
|
79
|
+
/**
|
|
80
|
+
* Get status of all modes
|
|
81
|
+
*
|
|
82
|
+
* @param cwd - Working directory
|
|
83
|
+
* @returns Array of mode statuses
|
|
84
|
+
*/
|
|
85
|
+
export declare function getAllModeStatuses(cwd: string): ModeStatus[];
|
|
86
|
+
/**
|
|
87
|
+
* Clear all state files for a mode
|
|
88
|
+
*
|
|
89
|
+
* Deletes:
|
|
90
|
+
* - Local state file (.omc/state/{mode}-state.json)
|
|
91
|
+
* - Local marker file if applicable
|
|
92
|
+
* - Global state file if applicable (~/.claude/{mode}-state.json)
|
|
93
|
+
*
|
|
94
|
+
* @returns true if all files were deleted successfully (or didn't exist)
|
|
95
|
+
*/
|
|
96
|
+
export declare function clearModeState(mode: ExecutionMode, cwd: string): boolean;
|
|
97
|
+
/**
|
|
98
|
+
* Clear all mode states (force clear)
|
|
99
|
+
*/
|
|
100
|
+
export declare function clearAllModeStates(cwd: string): boolean;
|
|
101
|
+
/**
|
|
102
|
+
* Create a marker file to indicate a mode is active
|
|
103
|
+
*
|
|
104
|
+
* Called when starting a SQLite-based mode (like swarm).
|
|
105
|
+
*
|
|
106
|
+
* @param mode - The mode being started
|
|
107
|
+
* @param cwd - Working directory
|
|
108
|
+
* @param metadata - Optional metadata to store in marker
|
|
109
|
+
*/
|
|
110
|
+
export declare function createModeMarker(mode: ExecutionMode, cwd: string, metadata?: Record<string, unknown>): boolean;
|
|
111
|
+
/**
|
|
112
|
+
* Remove a marker file to indicate a mode has stopped
|
|
113
|
+
*
|
|
114
|
+
* Called when stopping a SQLite-based mode (like swarm).
|
|
115
|
+
*
|
|
116
|
+
* @param mode - The mode being stopped
|
|
117
|
+
* @param cwd - Working directory
|
|
118
|
+
*/
|
|
119
|
+
export declare function removeModeMarker(mode: ExecutionMode, cwd: string): boolean;
|
|
120
|
+
/**
|
|
121
|
+
* Read metadata from a marker file
|
|
122
|
+
*
|
|
123
|
+
* @param mode - The mode to read
|
|
124
|
+
* @param cwd - Working directory
|
|
125
|
+
*/
|
|
126
|
+
export declare function readModeMarker(mode: ExecutionMode, cwd: string): Record<string, unknown> | null;
|
|
127
|
+
/**
|
|
128
|
+
* Force remove a marker file regardless of staleness
|
|
129
|
+
* Used for manual cleanup by users
|
|
130
|
+
*
|
|
131
|
+
* @param mode - The mode to clean up
|
|
132
|
+
* @param cwd - Working directory
|
|
133
|
+
*/
|
|
134
|
+
export declare function forceRemoveMarker(mode: ExecutionMode, cwd: string): boolean;
|
|
135
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/hooks/mode-registry/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAIH,OAAO,KAAK,EAAE,aAAa,EAAE,UAAU,EAAE,UAAU,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAExF,YAAY,EAAE,aAAa,EAAE,UAAU,EAAE,UAAU,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAExF;;;;;GAKG;AACH,eAAO,MAAM,sBAAsB,QAAiB,CAAC;AAErD;;;;;GAKG;AACH,QAAA,MAAM,YAAY,EAAE,MAAM,CAAC,aAAa,EAAE,UAAU,CA+CnD,CAAC;AAGF,OAAO,EAAE,YAAY,EAAE,CAAC;AAOxB;;GAEG;AACH,wBAAgB,WAAW,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAE/C;AAED;;GAEG;AACH,wBAAgB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