olympus-ai 1.0.0
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/LICENSE +21 -0
- package/README.md +691 -0
- package/dist/__tests__/example.test.d.ts +2 -0
- package/dist/__tests__/example.test.d.ts.map +1 -0
- package/dist/__tests__/example.test.js +20 -0
- package/dist/__tests__/example.test.js.map +1 -0
- package/dist/__tests__/hooks.test.d.ts +2 -0
- package/dist/__tests__/hooks.test.d.ts.map +1 -0
- package/dist/__tests__/hooks.test.js +644 -0
- package/dist/__tests__/hooks.test.js.map +1 -0
- package/dist/__tests__/installer.test.d.ts +2 -0
- package/dist/__tests__/installer.test.d.ts.map +1 -0
- package/dist/__tests__/installer.test.js +369 -0
- package/dist/__tests__/installer.test.js.map +1 -0
- package/dist/__tests__/model-routing.test.d.ts +2 -0
- package/dist/__tests__/model-routing.test.d.ts.map +1 -0
- package/dist/__tests__/model-routing.test.js +814 -0
- package/dist/__tests__/model-routing.test.js.map +1 -0
- package/dist/__tests__/skills.test.d.ts +2 -0
- package/dist/__tests__/skills.test.d.ts.map +1 -0
- package/dist/__tests__/skills.test.js +126 -0
- package/dist/__tests__/skills.test.js.map +1 -0
- package/dist/__tests__/types.test.d.ts +2 -0
- package/dist/__tests__/types.test.d.ts.map +1 -0
- package/dist/__tests__/types.test.js +77 -0
- package/dist/__tests__/types.test.js.map +1 -0
- package/dist/agents/definitions.d.ts +105 -0
- package/dist/agents/definitions.d.ts.map +1 -0
- package/dist/agents/definitions.js +1379 -0
- package/dist/agents/definitions.js.map +1 -0
- package/dist/agents/document-writer.d.ts +11 -0
- package/dist/agents/document-writer.d.ts.map +1 -0
- package/dist/agents/document-writer.js +209 -0
- package/dist/agents/document-writer.js.map +1 -0
- package/dist/agents/explore.d.ts +12 -0
- package/dist/agents/explore.d.ts.map +1 -0
- package/dist/agents/explore.js +103 -0
- package/dist/agents/explore.js.map +1 -0
- package/dist/agents/frontend-engineer.d.ts +11 -0
- package/dist/agents/frontend-engineer.d.ts.map +1 -0
- package/dist/agents/frontend-engineer.js +115 -0
- package/dist/agents/frontend-engineer.js.map +1 -0
- package/dist/agents/index.d.ts +21 -0
- package/dist/agents/index.d.ts.map +1 -0
- package/dist/agents/index.js +27 -0
- package/dist/agents/index.js.map +1 -0
- package/dist/agents/librarian.d.ts +12 -0
- package/dist/agents/librarian.d.ts.map +1 -0
- package/dist/agents/librarian.js +103 -0
- package/dist/agents/librarian.js.map +1 -0
- package/dist/agents/metis.d.ts +12 -0
- package/dist/agents/metis.d.ts.map +1 -0
- package/dist/agents/metis.js +117 -0
- package/dist/agents/metis.js.map +1 -0
- package/dist/agents/momus.d.ts +12 -0
- package/dist/agents/momus.d.ts.map +1 -0
- package/dist/agents/momus.js +128 -0
- package/dist/agents/momus.js.map +1 -0
- package/dist/agents/multimodal-looker.d.ts +11 -0
- package/dist/agents/multimodal-looker.d.ts.map +1 -0
- package/dist/agents/multimodal-looker.js +70 -0
- package/dist/agents/multimodal-looker.js.map +1 -0
- package/dist/agents/olympian.d.ts +12 -0
- package/dist/agents/olympian.d.ts.map +1 -0
- package/dist/agents/olympian.js +93 -0
- package/dist/agents/olympian.js.map +1 -0
- package/dist/agents/oracle.d.ts +13 -0
- package/dist/agents/oracle.d.ts.map +1 -0
- package/dist/agents/oracle.js +191 -0
- package/dist/agents/oracle.js.map +1 -0
- package/dist/agents/orchestrator-olympus.d.ts +11 -0
- package/dist/agents/orchestrator-olympus.d.ts.map +1 -0
- package/dist/agents/orchestrator-olympus.js +115 -0
- package/dist/agents/orchestrator-olympus.js.map +1 -0
- package/dist/agents/orchestrator-sisyphus.d.ts +11 -0
- package/dist/agents/orchestrator-sisyphus.d.ts.map +1 -0
- package/dist/agents/orchestrator-sisyphus.js +115 -0
- package/dist/agents/orchestrator-sisyphus.js.map +1 -0
- package/dist/agents/prometheus.d.ts +12 -0
- package/dist/agents/prometheus.d.ts.map +1 -0
- package/dist/agents/prometheus.js +156 -0
- package/dist/agents/prometheus.js.map +1 -0
- package/dist/agents/qa-tester.d.ts +16 -0
- package/dist/agents/qa-tester.d.ts.map +1 -0
- package/dist/agents/qa-tester.js +367 -0
- package/dist/agents/qa-tester.js.map +1 -0
- package/dist/agents/sisyphus-junior.d.ts +12 -0
- package/dist/agents/sisyphus-junior.d.ts.map +1 -0
- package/dist/agents/sisyphus-junior.js +93 -0
- package/dist/agents/sisyphus-junior.js.map +1 -0
- package/dist/agents/types.d.ts +120 -0
- package/dist/agents/types.d.ts.map +1 -0
- package/dist/agents/types.js +38 -0
- package/dist/agents/types.js.map +1 -0
- package/dist/agents/utils.d.ts +49 -0
- package/dist/agents/utils.d.ts.map +1 -0
- package/dist/agents/utils.js +164 -0
- package/dist/agents/utils.js.map +1 -0
- package/dist/cli/index.d.ts +13 -0
- package/dist/cli/index.d.ts.map +1 -0
- package/dist/cli/index.js +496 -0
- package/dist/cli/index.js.map +1 -0
- package/dist/commands/index.d.ts +78 -0
- package/dist/commands/index.d.ts.map +1 -0
- package/dist/commands/index.js +148 -0
- package/dist/commands/index.js.map +1 -0
- package/dist/config/index.d.ts +5 -0
- package/dist/config/index.d.ts.map +1 -0
- package/dist/config/index.js +5 -0
- package/dist/config/index.js.map +1 -0
- package/dist/config/loader.d.ts +49 -0
- package/dist/config/loader.d.ts.map +1 -0
- package/dist/config/loader.js +380 -0
- package/dist/config/loader.js.map +1 -0
- package/dist/features/auto-update.d.ts +187 -0
- package/dist/features/auto-update.d.ts.map +1 -0
- package/dist/features/auto-update.js +539 -0
- package/dist/features/auto-update.js.map +1 -0
- package/dist/features/background-agent/concurrency.d.ts +53 -0
- package/dist/features/background-agent/concurrency.d.ts.map +1 -0
- package/dist/features/background-agent/concurrency.js +121 -0
- package/dist/features/background-agent/concurrency.js.map +1 -0
- package/dist/features/background-agent/index.d.ts +12 -0
- package/dist/features/background-agent/index.d.ts.map +1 -0
- package/dist/features/background-agent/index.js +12 -0
- package/dist/features/background-agent/index.js.map +1 -0
- package/dist/features/background-agent/manager.d.ts +134 -0
- package/dist/features/background-agent/manager.d.ts.map +1 -0
- package/dist/features/background-agent/manager.js +412 -0
- package/dist/features/background-agent/manager.js.map +1 -0
- package/dist/features/background-agent/types.d.ts +99 -0
- package/dist/features/background-agent/types.d.ts.map +1 -0
- package/dist/features/background-agent/types.js +9 -0
- package/dist/features/background-agent/types.js.map +1 -0
- package/dist/features/background-tasks.d.ts +99 -0
- package/dist/features/background-tasks.d.ts.map +1 -0
- package/dist/features/background-tasks.js +265 -0
- package/dist/features/background-tasks.js.map +1 -0
- package/dist/features/boulder-state/constants.d.ts +20 -0
- package/dist/features/boulder-state/constants.d.ts.map +1 -0
- package/dist/features/boulder-state/constants.js +20 -0
- package/dist/features/boulder-state/constants.js.map +1 -0
- package/dist/features/boulder-state/index.d.ts +12 -0
- package/dist/features/boulder-state/index.d.ts.map +1 -0
- package/dist/features/boulder-state/index.js +13 -0
- package/dist/features/boulder-state/index.js.map +1 -0
- package/dist/features/boulder-state/storage.d.ts +58 -0
- package/dist/features/boulder-state/storage.d.ts.map +1 -0
- package/dist/features/boulder-state/storage.js +174 -0
- package/dist/features/boulder-state/storage.js.map +1 -0
- package/dist/features/boulder-state/types.d.ts +48 -0
- package/dist/features/boulder-state/types.d.ts.map +1 -0
- package/dist/features/boulder-state/types.js +10 -0
- package/dist/features/boulder-state/types.js.map +1 -0
- package/dist/features/builtin-skills/index.d.ts +10 -0
- package/dist/features/builtin-skills/index.d.ts.map +1 -0
- package/dist/features/builtin-skills/index.js +10 -0
- package/dist/features/builtin-skills/index.js.map +1 -0
- package/dist/features/builtin-skills/skills.d.ts +21 -0
- package/dist/features/builtin-skills/skills.d.ts.map +1 -0
- package/dist/features/builtin-skills/skills.js +1082 -0
- package/dist/features/builtin-skills/skills.js.map +1 -0
- package/dist/features/builtin-skills/types.d.ts +60 -0
- package/dist/features/builtin-skills/types.d.ts.map +1 -0
- package/dist/features/builtin-skills/types.js +9 -0
- package/dist/features/builtin-skills/types.js.map +1 -0
- package/dist/features/context-injector/collector.d.ts +56 -0
- package/dist/features/context-injector/collector.d.ts.map +1 -0
- package/dist/features/context-injector/collector.js +122 -0
- package/dist/features/context-injector/collector.js.map +1 -0
- package/dist/features/context-injector/index.d.ts +12 -0
- package/dist/features/context-injector/index.d.ts.map +1 -0
- package/dist/features/context-injector/index.js +13 -0
- package/dist/features/context-injector/index.js.map +1 -0
- package/dist/features/context-injector/injector.d.ts +47 -0
- package/dist/features/context-injector/injector.d.ts.map +1 -0
- package/dist/features/context-injector/injector.js +103 -0
- package/dist/features/context-injector/injector.js.map +1 -0
- package/dist/features/context-injector/types.d.ts +103 -0
- package/dist/features/context-injector/types.d.ts.map +1 -0
- package/dist/features/context-injector/types.js +11 -0
- package/dist/features/context-injector/types.js.map +1 -0
- package/dist/features/continuation-enforcement.d.ts +36 -0
- package/dist/features/continuation-enforcement.d.ts.map +1 -0
- package/dist/features/continuation-enforcement.js +175 -0
- package/dist/features/continuation-enforcement.js.map +1 -0
- package/dist/features/index.d.ts +12 -0
- package/dist/features/index.d.ts.map +1 -0
- package/dist/features/index.js +49 -0
- package/dist/features/index.js.map +1 -0
- package/dist/features/magic-keywords.d.ts +28 -0
- package/dist/features/magic-keywords.d.ts.map +1 -0
- package/dist/features/magic-keywords.js +421 -0
- package/dist/features/magic-keywords.js.map +1 -0
- package/dist/features/model-routing/index.d.ts +34 -0
- package/dist/features/model-routing/index.d.ts.map +1 -0
- package/dist/features/model-routing/index.js +48 -0
- package/dist/features/model-routing/index.js.map +1 -0
- package/dist/features/model-routing/prompts/haiku.d.ts +54 -0
- package/dist/features/model-routing/prompts/haiku.d.ts.map +1 -0
- package/dist/features/model-routing/prompts/haiku.js +141 -0
- package/dist/features/model-routing/prompts/haiku.js.map +1 -0
- package/dist/features/model-routing/prompts/index.d.ts +45 -0
- package/dist/features/model-routing/prompts/index.d.ts.map +1 -0
- package/dist/features/model-routing/prompts/index.js +116 -0
- package/dist/features/model-routing/prompts/index.js.map +1 -0
- package/dist/features/model-routing/prompts/opus.d.ts +34 -0
- package/dist/features/model-routing/prompts/opus.d.ts.map +1 -0
- package/dist/features/model-routing/prompts/opus.js +153 -0
- package/dist/features/model-routing/prompts/opus.js.map +1 -0
- package/dist/features/model-routing/prompts/sonnet.d.ts +38 -0
- package/dist/features/model-routing/prompts/sonnet.d.ts.map +1 -0
- package/dist/features/model-routing/prompts/sonnet.js +149 -0
- package/dist/features/model-routing/prompts/sonnet.js.map +1 -0
- package/dist/features/model-routing/router.d.ts +92 -0
- package/dist/features/model-routing/router.d.ts.map +1 -0
- package/dist/features/model-routing/router.js +267 -0
- package/dist/features/model-routing/router.js.map +1 -0
- package/dist/features/model-routing/rules.d.ts +32 -0
- package/dist/features/model-routing/rules.d.ts.map +1 -0
- package/dist/features/model-routing/rules.js +224 -0
- package/dist/features/model-routing/rules.js.map +1 -0
- package/dist/features/model-routing/scorer.d.ts +35 -0
- package/dist/features/model-routing/scorer.d.ts.map +1 -0
- package/dist/features/model-routing/scorer.js +241 -0
- package/dist/features/model-routing/scorer.js.map +1 -0
- package/dist/features/model-routing/signals.d.ts +26 -0
- package/dist/features/model-routing/signals.d.ts.map +1 -0
- package/dist/features/model-routing/signals.js +283 -0
- package/dist/features/model-routing/signals.js.map +1 -0
- package/dist/features/model-routing/types.d.ts +195 -0
- package/dist/features/model-routing/types.d.ts.map +1 -0
- package/dist/features/model-routing/types.js +86 -0
- package/dist/features/model-routing/types.js.map +1 -0
- package/dist/hooks/agent-usage-reminder/constants.d.ts +17 -0
- package/dist/hooks/agent-usage-reminder/constants.d.ts.map +1 -0
- package/dist/hooks/agent-usage-reminder/constants.js +58 -0
- package/dist/hooks/agent-usage-reminder/constants.js.map +1 -0
- package/dist/hooks/agent-usage-reminder/index.d.ts +36 -0
- package/dist/hooks/agent-usage-reminder/index.d.ts.map +1 -0
- package/dist/hooks/agent-usage-reminder/index.js +89 -0
- package/dist/hooks/agent-usage-reminder/index.js.map +1 -0
- package/dist/hooks/agent-usage-reminder/storage.d.ts +12 -0
- package/dist/hooks/agent-usage-reminder/storage.d.ts.map +1 -0
- package/dist/hooks/agent-usage-reminder/storage.js +39 -0
- package/dist/hooks/agent-usage-reminder/storage.js.map +1 -0
- package/dist/hooks/agent-usage-reminder/types.d.ts +14 -0
- package/dist/hooks/agent-usage-reminder/types.d.ts.map +1 -0
- package/dist/hooks/agent-usage-reminder/types.js +9 -0
- package/dist/hooks/agent-usage-reminder/types.js.map +1 -0
- package/dist/hooks/ascent-verifier/index.d.ts +72 -0
- package/dist/hooks/ascent-verifier/index.d.ts.map +1 -0
- package/dist/hooks/ascent-verifier/index.js +223 -0
- package/dist/hooks/ascent-verifier/index.js.map +1 -0
- package/dist/hooks/auto-slash-command/constants.d.ts +19 -0
- package/dist/hooks/auto-slash-command/constants.d.ts.map +1 -0
- package/dist/hooks/auto-slash-command/constants.js +28 -0
- package/dist/hooks/auto-slash-command/constants.js.map +1 -0
- package/dist/hooks/auto-slash-command/detector.d.ts +33 -0
- package/dist/hooks/auto-slash-command/detector.d.ts.map +1 -0
- package/dist/hooks/auto-slash-command/detector.js +73 -0
- package/dist/hooks/auto-slash-command/detector.js.map +1 -0
- package/dist/hooks/auto-slash-command/executor.d.ts +29 -0
- package/dist/hooks/auto-slash-command/executor.d.ts.map +1 -0
- package/dist/hooks/auto-slash-command/executor.js +214 -0
- package/dist/hooks/auto-slash-command/executor.js.map +1 -0
- package/dist/hooks/auto-slash-command/index.d.ts +53 -0
- package/dist/hooks/auto-slash-command/index.d.ts.map +1 -0
- package/dist/hooks/auto-slash-command/index.js +105 -0
- package/dist/hooks/auto-slash-command/index.js.map +1 -0
- package/dist/hooks/auto-slash-command/types.d.ts +77 -0
- package/dist/hooks/auto-slash-command/types.d.ts.map +1 -0
- package/dist/hooks/auto-slash-command/types.js +9 -0
- package/dist/hooks/auto-slash-command/types.js.map +1 -0
- package/dist/hooks/background-notification/index.d.ts +60 -0
- package/dist/hooks/background-notification/index.d.ts.map +1 -0
- package/dist/hooks/background-notification/index.js +180 -0
- package/dist/hooks/background-notification/index.js.map +1 -0
- package/dist/hooks/background-notification/types.d.ts +64 -0
- package/dist/hooks/background-notification/types.d.ts.map +1 -0
- package/dist/hooks/background-notification/types.js +8 -0
- package/dist/hooks/background-notification/types.js.map +1 -0
- package/dist/hooks/bridge.d.ts +68 -0
- package/dist/hooks/bridge.d.ts.map +1 -0
- package/dist/hooks/bridge.js +321 -0
- package/dist/hooks/bridge.js.map +1 -0
- package/dist/hooks/comment-checker/constants.d.ts +28 -0
- package/dist/hooks/comment-checker/constants.d.ts.map +1 -0
- package/dist/hooks/comment-checker/constants.js +189 -0
- package/dist/hooks/comment-checker/constants.js.map +1 -0
- package/dist/hooks/comment-checker/filters.d.ts +39 -0
- package/dist/hooks/comment-checker/filters.d.ts.map +1 -0
- package/dist/hooks/comment-checker/filters.js +126 -0
- package/dist/hooks/comment-checker/filters.js.map +1 -0
- package/dist/hooks/comment-checker/index.d.ts +58 -0
- package/dist/hooks/comment-checker/index.d.ts.map +1 -0
- package/dist/hooks/comment-checker/index.js +298 -0
- package/dist/hooks/comment-checker/index.js.map +1 -0
- package/dist/hooks/comment-checker/types.d.ts +88 -0
- package/dist/hooks/comment-checker/types.d.ts.map +1 -0
- package/dist/hooks/comment-checker/types.js +9 -0
- package/dist/hooks/comment-checker/types.js.map +1 -0
- package/dist/hooks/context-window-limit-recovery/constants.d.ts +28 -0
- package/dist/hooks/context-window-limit-recovery/constants.d.ts.map +1 -0
- package/dist/hooks/context-window-limit-recovery/constants.js +85 -0
- package/dist/hooks/context-window-limit-recovery/constants.js.map +1 -0
- package/dist/hooks/context-window-limit-recovery/index.d.ts +62 -0
- package/dist/hooks/context-window-limit-recovery/index.d.ts.map +1 -0
- package/dist/hooks/context-window-limit-recovery/index.js +201 -0
- package/dist/hooks/context-window-limit-recovery/index.js.map +1 -0
- package/dist/hooks/context-window-limit-recovery/parser.d.ts +31 -0
- package/dist/hooks/context-window-limit-recovery/parser.d.ts.map +1 -0
- package/dist/hooks/context-window-limit-recovery/parser.js +241 -0
- package/dist/hooks/context-window-limit-recovery/parser.js.map +1 -0
- package/dist/hooks/context-window-limit-recovery/types.d.ts +84 -0
- package/dist/hooks/context-window-limit-recovery/types.d.ts.map +1 -0
- package/dist/hooks/context-window-limit-recovery/types.js +34 -0
- package/dist/hooks/context-window-limit-recovery/types.js.map +1 -0
- package/dist/hooks/directory-readme-injector/constants.d.ts +15 -0
- package/dist/hooks/directory-readme-injector/constants.d.ts.map +1 -0
- package/dist/hooks/directory-readme-injector/constants.js +17 -0
- package/dist/hooks/directory-readme-injector/constants.js.map +1 -0
- package/dist/hooks/directory-readme-injector/index.d.ts +41 -0
- package/dist/hooks/directory-readme-injector/index.d.ts.map +1 -0
- package/dist/hooks/directory-readme-injector/index.js +162 -0
- package/dist/hooks/directory-readme-injector/index.js.map +1 -0
- package/dist/hooks/directory-readme-injector/storage.d.ts +20 -0
- package/dist/hooks/directory-readme-injector/storage.d.ts.map +1 -0
- package/dist/hooks/directory-readme-injector/storage.js +56 -0
- package/dist/hooks/directory-readme-injector/storage.js.map +1 -0
- package/dist/hooks/directory-readme-injector/types.d.ts +20 -0
- package/dist/hooks/directory-readme-injector/types.d.ts.map +1 -0
- package/dist/hooks/directory-readme-injector/types.js +9 -0
- package/dist/hooks/directory-readme-injector/types.js.map +1 -0
- package/dist/hooks/edit-error-recovery/index.d.ts +62 -0
- package/dist/hooks/edit-error-recovery/index.d.ts.map +1 -0
- package/dist/hooks/edit-error-recovery/index.js +89 -0
- package/dist/hooks/edit-error-recovery/index.js.map +1 -0
- package/dist/hooks/empty-message-sanitizer/constants.d.ts +33 -0
- package/dist/hooks/empty-message-sanitizer/constants.d.ts.map +1 -0
- package/dist/hooks/empty-message-sanitizer/constants.js +37 -0
- package/dist/hooks/empty-message-sanitizer/constants.js.map +1 -0
- package/dist/hooks/empty-message-sanitizer/index.d.ts +59 -0
- package/dist/hooks/empty-message-sanitizer/index.d.ts.map +1 -0
- package/dist/hooks/empty-message-sanitizer/index.js +171 -0
- package/dist/hooks/empty-message-sanitizer/index.js.map +1 -0
- package/dist/hooks/empty-message-sanitizer/types.d.ts +79 -0
- package/dist/hooks/empty-message-sanitizer/types.d.ts.map +1 -0
- package/dist/hooks/empty-message-sanitizer/types.js +10 -0
- package/dist/hooks/empty-message-sanitizer/types.js.map +1 -0
- package/dist/hooks/index.d.ts +35 -0
- package/dist/hooks/index.d.ts.map +1 -0
- package/dist/hooks/index.js +81 -0
- package/dist/hooks/index.js.map +1 -0
- package/dist/hooks/keyword-detector/index.d.ts +40 -0
- package/dist/hooks/keyword-detector/index.d.ts.map +1 -0
- package/dist/hooks/keyword-detector/index.js +88 -0
- package/dist/hooks/keyword-detector/index.js.map +1 -0
- package/dist/hooks/non-interactive-env/constants.d.ts +35 -0
- package/dist/hooks/non-interactive-env/constants.d.ts.map +1 -0
- package/dist/hooks/non-interactive-env/constants.js +69 -0
- package/dist/hooks/non-interactive-env/constants.js.map +1 -0
- package/dist/hooks/non-interactive-env/detector.d.ts +2 -0
- package/dist/hooks/non-interactive-env/detector.d.ts.map +1 -0
- package/dist/hooks/non-interactive-env/detector.js +16 -0
- package/dist/hooks/non-interactive-env/detector.js.map +1 -0
- package/dist/hooks/non-interactive-env/index.d.ts +14 -0
- package/dist/hooks/non-interactive-env/index.d.ts.map +1 -0
- package/dist/hooks/non-interactive-env/index.js +72 -0
- package/dist/hooks/non-interactive-env/index.js.map +1 -0
- package/dist/hooks/non-interactive-env/types.d.ts +14 -0
- package/dist/hooks/non-interactive-env/types.d.ts.map +1 -0
- package/dist/hooks/non-interactive-env/types.js +2 -0
- package/dist/hooks/non-interactive-env/types.js.map +1 -0
- package/dist/hooks/olympus-orchestrator/constants.d.ts +23 -0
- package/dist/hooks/olympus-orchestrator/constants.d.ts.map +1 -0
- package/dist/hooks/olympus-orchestrator/constants.js +142 -0
- package/dist/hooks/olympus-orchestrator/constants.js.map +1 -0
- package/dist/hooks/olympus-orchestrator/index.d.ts +113 -0
- package/dist/hooks/olympus-orchestrator/index.d.ts.map +1 -0
- package/dist/hooks/olympus-orchestrator/index.js +283 -0
- package/dist/hooks/olympus-orchestrator/index.js.map +1 -0
- package/dist/hooks/persistent-mode/index.d.ts +40 -0
- package/dist/hooks/persistent-mode/index.d.ts.map +1 -0
- package/dist/hooks/persistent-mode/index.js +322 -0
- package/dist/hooks/persistent-mode/index.js.map +1 -0
- package/dist/hooks/plugin-patterns/index.d.ts +107 -0
- package/dist/hooks/plugin-patterns/index.d.ts.map +1 -0
- package/dist/hooks/plugin-patterns/index.js +289 -0
- package/dist/hooks/plugin-patterns/index.js.map +1 -0
- package/dist/hooks/preemptive-compaction/constants.d.ts +48 -0
- package/dist/hooks/preemptive-compaction/constants.d.ts.map +1 -0
- package/dist/hooks/preemptive-compaction/constants.js +90 -0
- package/dist/hooks/preemptive-compaction/constants.js.map +1 -0
- package/dist/hooks/preemptive-compaction/index.d.ts +55 -0
- package/dist/hooks/preemptive-compaction/index.d.ts.map +1 -0
- package/dist/hooks/preemptive-compaction/index.js +227 -0
- package/dist/hooks/preemptive-compaction/index.js.map +1 -0
- package/dist/hooks/preemptive-compaction/types.d.ts +76 -0
- package/dist/hooks/preemptive-compaction/types.d.ts.map +1 -0
- package/dist/hooks/preemptive-compaction/types.js +9 -0
- package/dist/hooks/preemptive-compaction/types.js.map +1 -0
- package/dist/hooks/ralph-loop/index.d.ts +60 -0
- package/dist/hooks/ralph-loop/index.d.ts.map +1 -0
- package/dist/hooks/ralph-loop/index.js +155 -0
- package/dist/hooks/ralph-loop/index.js.map +1 -0
- package/dist/hooks/ralph-verifier/index.d.ts +72 -0
- package/dist/hooks/ralph-verifier/index.d.ts.map +1 -0
- package/dist/hooks/ralph-verifier/index.js +223 -0
- package/dist/hooks/ralph-verifier/index.js.map +1 -0
- package/dist/hooks/rules-injector/constants.d.ts +25 -0
- package/dist/hooks/rules-injector/constants.d.ts.map +1 -0
- package/dist/hooks/rules-injector/constants.js +40 -0
- package/dist/hooks/rules-injector/constants.js.map +1 -0
- package/dist/hooks/rules-injector/finder.d.ts +24 -0
- package/dist/hooks/rules-injector/finder.d.ts.map +1 -0
- package/dist/hooks/rules-injector/finder.js +215 -0
- package/dist/hooks/rules-injector/finder.js.map +1 -0
- package/dist/hooks/rules-injector/index.d.ts +45 -0
- package/dist/hooks/rules-injector/index.d.ts.map +1 -0
- package/dist/hooks/rules-injector/index.js +187 -0
- package/dist/hooks/rules-injector/index.js.map +1 -0
- package/dist/hooks/rules-injector/matcher.d.ts +25 -0
- package/dist/hooks/rules-injector/matcher.d.ts.map +1 -0
- package/dist/hooks/rules-injector/matcher.js +70 -0
- package/dist/hooks/rules-injector/matcher.js.map +1 -0
- package/dist/hooks/rules-injector/parser.d.ts +20 -0
- package/dist/hooks/rules-injector/parser.d.ts.map +1 -0
- package/dist/hooks/rules-injector/parser.js +179 -0
- package/dist/hooks/rules-injector/parser.js.map +1 -0
- package/dist/hooks/rules-injector/storage.d.ts +26 -0
- package/dist/hooks/rules-injector/storage.d.ts.map +1 -0
- package/dist/hooks/rules-injector/storage.js +61 -0
- package/dist/hooks/rules-injector/storage.js.map +1 -0
- package/dist/hooks/rules-injector/types.d.ts +101 -0
- package/dist/hooks/rules-injector/types.d.ts.map +1 -0
- package/dist/hooks/rules-injector/types.js +10 -0
- package/dist/hooks/rules-injector/types.js.map +1 -0
- package/dist/hooks/session-recovery/constants.d.ts +56 -0
- package/dist/hooks/session-recovery/constants.d.ts.map +1 -0
- package/dist/hooks/session-recovery/constants.js +78 -0
- package/dist/hooks/session-recovery/constants.js.map +1 -0
- package/dist/hooks/session-recovery/index.d.ts +53 -0
- package/dist/hooks/session-recovery/index.d.ts.map +1 -0
- package/dist/hooks/session-recovery/index.js +321 -0
- package/dist/hooks/session-recovery/index.js.map +1 -0
- package/dist/hooks/session-recovery/storage.d.ts +76 -0
- package/dist/hooks/session-recovery/storage.d.ts.map +1 -0
- package/dist/hooks/session-recovery/storage.js +383 -0
- package/dist/hooks/session-recovery/storage.js.map +1 -0
- package/dist/hooks/session-recovery/types.d.ts +145 -0
- package/dist/hooks/session-recovery/types.d.ts.map +1 -0
- package/dist/hooks/session-recovery/types.js +8 -0
- package/dist/hooks/session-recovery/types.js.map +1 -0
- package/dist/hooks/sisyphus-orchestrator/constants.d.ts +23 -0
- package/dist/hooks/sisyphus-orchestrator/constants.d.ts.map +1 -0
- package/dist/hooks/sisyphus-orchestrator/constants.js +142 -0
- package/dist/hooks/sisyphus-orchestrator/constants.js.map +1 -0
- package/dist/hooks/sisyphus-orchestrator/index.d.ts +113 -0
- package/dist/hooks/sisyphus-orchestrator/index.d.ts.map +1 -0
- package/dist/hooks/sisyphus-orchestrator/index.js +283 -0
- package/dist/hooks/sisyphus-orchestrator/index.js.map +1 -0
- package/dist/hooks/the-ascent/index.d.ts +60 -0
- package/dist/hooks/the-ascent/index.d.ts.map +1 -0
- package/dist/hooks/the-ascent/index.js +155 -0
- package/dist/hooks/the-ascent/index.js.map +1 -0
- package/dist/hooks/think-mode/detector.d.ts +28 -0
- package/dist/hooks/think-mode/detector.d.ts.map +1 -0
- package/dist/hooks/think-mode/detector.js +105 -0
- package/dist/hooks/think-mode/detector.js.map +1 -0
- package/dist/hooks/think-mode/index.d.ts +70 -0
- package/dist/hooks/think-mode/index.d.ts.map +1 -0
- package/dist/hooks/think-mode/index.js +144 -0
- package/dist/hooks/think-mode/index.js.map +1 -0
- package/dist/hooks/think-mode/switcher.d.ts +39 -0
- package/dist/hooks/think-mode/switcher.d.ts.map +1 -0
- package/dist/hooks/think-mode/switcher.js +180 -0
- package/dist/hooks/think-mode/switcher.js.map +1 -0
- package/dist/hooks/think-mode/types.d.ts +60 -0
- package/dist/hooks/think-mode/types.d.ts.map +1 -0
- package/dist/hooks/think-mode/types.js +9 -0
- package/dist/hooks/think-mode/types.js.map +1 -0
- package/dist/hooks/thinking-block-validator/constants.d.ts +37 -0
- package/dist/hooks/thinking-block-validator/constants.d.ts.map +1 -0
- package/dist/hooks/thinking-block-validator/constants.js +50 -0
- package/dist/hooks/thinking-block-validator/constants.js.map +1 -0
- package/dist/hooks/thinking-block-validator/index.d.ts +35 -0
- package/dist/hooks/thinking-block-validator/index.d.ts.map +1 -0
- package/dist/hooks/thinking-block-validator/index.js +156 -0
- package/dist/hooks/thinking-block-validator/index.js.map +1 -0
- package/dist/hooks/thinking-block-validator/types.d.ts +67 -0
- package/dist/hooks/thinking-block-validator/types.d.ts.map +1 -0
- package/dist/hooks/thinking-block-validator/types.js +9 -0
- package/dist/hooks/thinking-block-validator/types.js.map +1 -0
- package/dist/hooks/todo-continuation/index.d.ts +39 -0
- package/dist/hooks/todo-continuation/index.d.ts.map +1 -0
- package/dist/hooks/todo-continuation/index.js +140 -0
- package/dist/hooks/todo-continuation/index.js.map +1 -0
- package/dist/hooks/ultrawork-state/index.d.ts +60 -0
- package/dist/hooks/ultrawork-state/index.d.ts.map +1 -0
- package/dist/hooks/ultrawork-state/index.js +207 -0
- package/dist/hooks/ultrawork-state/index.js.map +1 -0
- package/dist/index.d.ts +117 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +175 -0
- package/dist/index.js.map +1 -0
- package/dist/installer/hooks.d.ts +196 -0
- package/dist/installer/hooks.d.ts.map +1 -0
- package/dist/installer/hooks.js +1385 -0
- package/dist/installer/hooks.js.map +1 -0
- package/dist/installer/index.d.ts +92 -0
- package/dist/installer/index.d.ts.map +1 -0
- package/dist/installer/index.js +2249 -0
- package/dist/installer/index.js.map +1 -0
- package/dist/mcp/index.d.ts +6 -0
- package/dist/mcp/index.d.ts.map +1 -0
- package/dist/mcp/index.js +5 -0
- package/dist/mcp/index.js.map +1 -0
- package/dist/mcp/servers.d.ts +77 -0
- package/dist/mcp/servers.d.ts.map +1 -0
- package/dist/mcp/servers.js +122 -0
- package/dist/mcp/servers.js.map +1 -0
- package/dist/shared/index.d.ts +5 -0
- package/dist/shared/index.d.ts.map +1 -0
- package/dist/shared/index.js +5 -0
- package/dist/shared/index.js.map +1 -0
- package/dist/shared/types.d.ts +159 -0
- package/dist/shared/types.d.ts.map +1 -0
- package/dist/shared/types.js +5 -0
- package/dist/shared/types.js.map +1 -0
- package/dist/tools/ast-tools.d.ts +63 -0
- package/dist/tools/ast-tools.d.ts.map +1 -0
- package/dist/tools/ast-tools.js +450 -0
- package/dist/tools/ast-tools.js.map +1 -0
- package/dist/tools/index.d.ts +52 -0
- package/dist/tools/index.d.ts.map +1 -0
- package/dist/tools/index.js +120 -0
- package/dist/tools/index.js.map +1 -0
- package/dist/tools/lsp/client.d.ts +201 -0
- package/dist/tools/lsp/client.d.ts.map +1 -0
- package/dist/tools/lsp/client.js +454 -0
- package/dist/tools/lsp/client.js.map +1 -0
- package/dist/tools/lsp/index.d.ts +9 -0
- package/dist/tools/lsp/index.d.ts.map +1 -0
- package/dist/tools/lsp/index.js +7 -0
- package/dist/tools/lsp/index.js.map +1 -0
- package/dist/tools/lsp/servers.d.ts +37 -0
- package/dist/tools/lsp/servers.d.ts.map +1 -0
- package/dist/tools/lsp/servers.js +149 -0
- package/dist/tools/lsp/servers.js.map +1 -0
- package/dist/tools/lsp/utils.d.ts +58 -0
- package/dist/tools/lsp/utils.d.ts.map +1 -0
- package/dist/tools/lsp/utils.js +236 -0
- package/dist/tools/lsp/utils.js.map +1 -0
- package/dist/tools/lsp-tools.d.ts +151 -0
- package/dist/tools/lsp-tools.d.ts.map +1 -0
- package/dist/tools/lsp-tools.js +358 -0
- package/dist/tools/lsp-tools.js.map +1 -0
- package/package.json +85 -0
- package/scripts/claude-sisyphus.sh +9 -0
- package/scripts/install.sh +1774 -0
- package/scripts/keyword-detector.mjs +209 -0
- package/scripts/keyword-detector.sh +71 -0
- package/scripts/persistent-mode.mjs +241 -0
- package/scripts/persistent-mode.sh +300 -0
- package/scripts/post-tool-verifier.mjs +217 -0
- package/scripts/post-tool-verifier.sh +196 -0
- package/scripts/pre-tool-enforcer.mjs +99 -0
- package/scripts/pre-tool-enforcer.sh +76 -0
- package/scripts/sisyphus-aliases.sh +18 -0
- package/scripts/stop-continuation.sh +31 -0
- package/scripts/test-pr25.sh +525 -0
- package/scripts/uninstall.sh +171 -0
|
@@ -0,0 +1,300 @@
|
|
|
1
|
+
#!/bin/bash
|
|
2
|
+
# Olympus Persistent Mode Hook
|
|
3
|
+
# Unified handler for ultrawork, the-ascent, and todo continuation
|
|
4
|
+
# Prevents stopping when work remains incomplete
|
|
5
|
+
|
|
6
|
+
# Read stdin
|
|
7
|
+
INPUT=$(cat)
|
|
8
|
+
|
|
9
|
+
# Get session ID and directory
|
|
10
|
+
SESSION_ID=""
|
|
11
|
+
DIRECTORY=""
|
|
12
|
+
if command -v jq &> /dev/null; then
|
|
13
|
+
SESSION_ID=$(echo "$INPUT" | jq -r '.sessionId // .session_id // ""' 2>/dev/null)
|
|
14
|
+
DIRECTORY=$(echo "$INPUT" | jq -r '.directory // ""' 2>/dev/null)
|
|
15
|
+
fi
|
|
16
|
+
|
|
17
|
+
# Default to current directory
|
|
18
|
+
if [ -z "$DIRECTORY" ]; then
|
|
19
|
+
DIRECTORY=$(pwd)
|
|
20
|
+
fi
|
|
21
|
+
|
|
22
|
+
# Check for active ultrawork state
|
|
23
|
+
ULTRAWORK_STATE=""
|
|
24
|
+
if [ -f "$DIRECTORY/.olympus/ultrawork-state.json" ]; then
|
|
25
|
+
ULTRAWORK_STATE=$(cat "$DIRECTORY/.olympus/ultrawork-state.json" 2>/dev/null)
|
|
26
|
+
elif [ -f "$HOME/.claude/ultrawork-state.json" ]; then
|
|
27
|
+
ULTRAWORK_STATE=$(cat "$HOME/.claude/ultrawork-state.json" 2>/dev/null)
|
|
28
|
+
fi
|
|
29
|
+
|
|
30
|
+
# Check for active ascent loop
|
|
31
|
+
ASCENT_STATE=""
|
|
32
|
+
if [ -f "$DIRECTORY/.olympus/ascent-state.json" ]; then
|
|
33
|
+
ASCENT_STATE=$(cat "$DIRECTORY/.olympus/ascent-state.json" 2>/dev/null)
|
|
34
|
+
fi
|
|
35
|
+
|
|
36
|
+
# Check for verification state (oracle verification)
|
|
37
|
+
VERIFICATION_STATE=""
|
|
38
|
+
if [ -f "$DIRECTORY/.olympus/ascent-verification.json" ]; then
|
|
39
|
+
VERIFICATION_STATE=$(cat "$DIRECTORY/.olympus/ascent-verification.json" 2>/dev/null)
|
|
40
|
+
fi
|
|
41
|
+
|
|
42
|
+
# Check for incomplete todos
|
|
43
|
+
INCOMPLETE_COUNT=0
|
|
44
|
+
TODOS_DIR="$HOME/.claude/todos"
|
|
45
|
+
if [ -d "$TODOS_DIR" ]; then
|
|
46
|
+
for todo_file in "$TODOS_DIR"/*.json; do
|
|
47
|
+
if [ -f "$todo_file" ]; then
|
|
48
|
+
if command -v jq &> /dev/null; then
|
|
49
|
+
COUNT=$(jq '[.[] | select(.status != "completed" and .status != "cancelled")] | length' "$todo_file" 2>/dev/null || echo "0")
|
|
50
|
+
INCOMPLETE_COUNT=$((INCOMPLETE_COUNT + COUNT))
|
|
51
|
+
else
|
|
52
|
+
# Fallback: count "pending" or "in_progress" occurrences
|
|
53
|
+
COUNT=$(grep -c '"status"[[:space:]]*:[[:space:]]*"pending\|in_progress"' "$todo_file" 2>/dev/null) || COUNT=0
|
|
54
|
+
INCOMPLETE_COUNT=$((INCOMPLETE_COUNT + COUNT))
|
|
55
|
+
fi
|
|
56
|
+
fi
|
|
57
|
+
done
|
|
58
|
+
fi
|
|
59
|
+
|
|
60
|
+
# Check project todos as well
|
|
61
|
+
for todo_path in "$DIRECTORY/.olympus/todos.json" "$DIRECTORY/.claude/todos.json"; do
|
|
62
|
+
if [ -f "$todo_path" ]; then
|
|
63
|
+
if command -v jq &> /dev/null; then
|
|
64
|
+
COUNT=$(jq 'if type == "array" then [.[] | select(.status != "completed" and .status != "cancelled")] | length else 0 end' "$todo_path" 2>/dev/null || echo "0")
|
|
65
|
+
INCOMPLETE_COUNT=$((INCOMPLETE_COUNT + COUNT))
|
|
66
|
+
else
|
|
67
|
+
# Fallback: count "pending" or "in_progress" occurrences
|
|
68
|
+
COUNT=$(grep -c '"status"[[:space:]]*:[[:space:]]*"pending\|in_progress"' "$todo_path" 2>/dev/null) || COUNT=0
|
|
69
|
+
INCOMPLETE_COUNT=$((INCOMPLETE_COUNT + COUNT))
|
|
70
|
+
fi
|
|
71
|
+
fi
|
|
72
|
+
done
|
|
73
|
+
|
|
74
|
+
# Priority 1: The Ascent with Oracle Verification
|
|
75
|
+
if [ -n "$ASCENT_STATE" ]; then
|
|
76
|
+
IS_ACTIVE=$(echo "$ASCENT_STATE" | jq -r '.active // false' 2>/dev/null)
|
|
77
|
+
if [ "$IS_ACTIVE" = "true" ]; then
|
|
78
|
+
ITERATION=$(echo "$ASCENT_STATE" | jq -r '.iteration // 1' 2>/dev/null)
|
|
79
|
+
MAX_ITER=$(echo "$ASCENT_STATE" | jq -r '.max_iterations // 10' 2>/dev/null)
|
|
80
|
+
PROMISE=$(echo "$ASCENT_STATE" | jq -r '.completion_promise // "TASK_COMPLETE"' 2>/dev/null)
|
|
81
|
+
PROMPT=$(echo "$ASCENT_STATE" | jq -r '.prompt // ""' 2>/dev/null)
|
|
82
|
+
|
|
83
|
+
# Check if oracle verification is pending
|
|
84
|
+
if [ -n "$VERIFICATION_STATE" ]; then
|
|
85
|
+
IS_PENDING=$(echo "$VERIFICATION_STATE" | jq -r '.pending // false' 2>/dev/null)
|
|
86
|
+
if [ "$IS_PENDING" = "true" ]; then
|
|
87
|
+
ATTEMPT=$(echo "$VERIFICATION_STATE" | jq -r '.verification_attempts // 0' 2>/dev/null)
|
|
88
|
+
MAX_ATTEMPTS=$(echo "$VERIFICATION_STATE" | jq -r '.max_verification_attempts // 3' 2>/dev/null)
|
|
89
|
+
ORIGINAL_TASK=$(echo "$VERIFICATION_STATE" | jq -r '.original_task // ""' 2>/dev/null)
|
|
90
|
+
COMPLETION_CLAIM=$(echo "$VERIFICATION_STATE" | jq -r '.completion_claim // ""' 2>/dev/null)
|
|
91
|
+
ORACLE_FEEDBACK=$(echo "$VERIFICATION_STATE" | jq -r '.oracle_feedback // ""' 2>/dev/null)
|
|
92
|
+
NEXT_ATTEMPT=$((ATTEMPT + 1))
|
|
93
|
+
|
|
94
|
+
FEEDBACK_SECTION=""
|
|
95
|
+
if [ -n "$ORACLE_FEEDBACK" ] && [ "$ORACLE_FEEDBACK" != "null" ]; then
|
|
96
|
+
FEEDBACK_SECTION="\n**Previous Oracle Feedback (rejected):**\n$ORACLE_FEEDBACK\n"
|
|
97
|
+
fi
|
|
98
|
+
|
|
99
|
+
cat << EOF
|
|
100
|
+
{"continue": false, "reason": "<ascent-verification>\n\n[ORACLE VERIFICATION REQUIRED - Attempt $NEXT_ATTEMPT/$MAX_ATTEMPTS]\n\nThe agent claims the task is complete. Before accepting, YOU MUST verify with Oracle.\n\n**Original Task:**\n$ORIGINAL_TASK\n\n**Completion Claim:**\n$COMPLETION_CLAIM\n$FEEDBACK_SECTION\n## MANDATORY VERIFICATION STEPS\n\n1. **Spawn Oracle Agent** for verification:\n \`\`\`\n Task(subagent_type=\"oracle\", prompt=\"Verify this task completion claim...\")\n \`\`\`\n\n2. **Oracle must check:**\n - Are ALL requirements from the original task met?\n - Is the implementation complete, not partial?\n - Are there any obvious bugs or issues?\n - Does the code compile/run without errors?\n - Are tests passing (if applicable)?\n\n3. **Based on Oracle's response:**\n - If APPROVED: Output \`<oracle-approved>VERIFIED_COMPLETE</oracle-approved>\`\n - If REJECTED: Continue working on the identified issues\n\nDO NOT output the completion promise again until Oracle approves.\n\n</ascent-verification>\n\n---\n"}
|
|
101
|
+
EOF
|
|
102
|
+
exit 0
|
|
103
|
+
fi
|
|
104
|
+
fi
|
|
105
|
+
|
|
106
|
+
if [ "$ITERATION" -lt "$MAX_ITER" ]; then
|
|
107
|
+
# Increment iteration
|
|
108
|
+
NEW_ITER=$((ITERATION + 1))
|
|
109
|
+
echo "$ASCENT_STATE" | jq ".iteration = $NEW_ITER" > "$DIRECTORY/.olympus/ascent-state.json" 2>/dev/null
|
|
110
|
+
|
|
111
|
+
cat << EOF
|
|
112
|
+
{"continue": false, "reason": "<the-ascent-continuation>\n\n[ASCENT LOOP - ITERATION $NEW_ITER/$MAX_ITER]\n\nYour previous attempt did not output the completion promise. The work is NOT done yet.\n\nCRITICAL INSTRUCTIONS:\n1. Review your progress and the original task\n2. Check your todo list - are ALL items marked complete?\n3. Continue from where you left off\n4. When FULLY complete, output: <promise>$PROMISE</promise>\n5. Do NOT stop until the task is truly done\n\nOriginal task: $PROMPT\n\n</the-ascent-continuation>\n\n---\n"}
|
|
113
|
+
EOF
|
|
114
|
+
exit 0
|
|
115
|
+
fi
|
|
116
|
+
fi
|
|
117
|
+
fi
|
|
118
|
+
|
|
119
|
+
# Priority 1.5: Verification Requirements (build/test/git/background)
|
|
120
|
+
VERIFICATION_FAILURES=()
|
|
121
|
+
|
|
122
|
+
# Check 1: Build verification
|
|
123
|
+
BUILD_ISSUES=""
|
|
124
|
+
if [ -f "$DIRECTORY/package.json" ]; then
|
|
125
|
+
if command -v jq &> /dev/null; then
|
|
126
|
+
BUILD_SCRIPT=$(jq -r '.scripts.build // empty' "$DIRECTORY/package.json" 2>/dev/null)
|
|
127
|
+
if [ -n "$BUILD_SCRIPT" ]; then
|
|
128
|
+
# Check if build directory exists or recent build artifacts
|
|
129
|
+
if [ ! -d "$DIRECTORY/dist" ] && [ ! -d "$DIRECTORY/build" ] && [ ! -d "$DIRECTORY/out" ]; then
|
|
130
|
+
BUILD_ISSUES="Build script exists but no build artifacts found (dist/build/out). Run 'npm run build' to verify."
|
|
131
|
+
fi
|
|
132
|
+
fi
|
|
133
|
+
fi
|
|
134
|
+
elif [ -f "$DIRECTORY/Makefile" ]; then
|
|
135
|
+
# Check for common make targets
|
|
136
|
+
if grep -q "^build:" "$DIRECTORY/Makefile" 2>/dev/null; then
|
|
137
|
+
BUILD_ISSUES="Makefile with build target detected. Run 'make build' to verify before stopping."
|
|
138
|
+
fi
|
|
139
|
+
elif [ -f "$DIRECTORY/Cargo.toml" ]; then
|
|
140
|
+
# Check for Rust build artifacts
|
|
141
|
+
if [ ! -d "$DIRECTORY/target/release" ] && [ ! -d "$DIRECTORY/target/debug" ]; then
|
|
142
|
+
BUILD_ISSUES="Rust project detected but no build artifacts found. Run 'cargo build' to verify."
|
|
143
|
+
fi
|
|
144
|
+
fi
|
|
145
|
+
|
|
146
|
+
if [ -n "$BUILD_ISSUES" ]; then
|
|
147
|
+
VERIFICATION_FAILURES+=("BUILD: $BUILD_ISSUES")
|
|
148
|
+
fi
|
|
149
|
+
|
|
150
|
+
# Check 2: Test failures in recent output
|
|
151
|
+
TEST_ISSUES=""
|
|
152
|
+
if [ -f "$DIRECTORY/package.json" ]; then
|
|
153
|
+
if command -v jq &> /dev/null; then
|
|
154
|
+
TEST_SCRIPT=$(jq -r '.scripts.test // empty' "$DIRECTORY/package.json" 2>/dev/null)
|
|
155
|
+
if [ -n "$TEST_SCRIPT" ]; then
|
|
156
|
+
# Check for test artifacts or recent test run indicators
|
|
157
|
+
TEST_ISSUES="Test script exists. Run 'npm test' to verify all tests pass before stopping."
|
|
158
|
+
fi
|
|
159
|
+
fi
|
|
160
|
+
elif [ -f "$DIRECTORY/pytest.ini" ] || [ -f "$DIRECTORY/setup.py" ] || [ -d "$DIRECTORY/tests" ]; then
|
|
161
|
+
TEST_ISSUES="Python test directory/config detected. Run tests to verify before stopping."
|
|
162
|
+
elif [ -f "$DIRECTORY/Cargo.toml" ]; then
|
|
163
|
+
TEST_ISSUES="Rust project detected. Run 'cargo test' to verify before stopping."
|
|
164
|
+
fi
|
|
165
|
+
|
|
166
|
+
# Check for recent test failure indicators in common log locations
|
|
167
|
+
for log_file in "$DIRECTORY/test-results.log" "$DIRECTORY/.test-output" "$HOME/.claude/last-test-run.log"; do
|
|
168
|
+
if [ -f "$log_file" ]; then
|
|
169
|
+
if grep -qi "FAIL\|ERROR\|failed" "$log_file" 2>/dev/null; then
|
|
170
|
+
TEST_ISSUES="Recent test failures detected in $log_file. Fix failures before stopping."
|
|
171
|
+
break
|
|
172
|
+
fi
|
|
173
|
+
fi
|
|
174
|
+
done
|
|
175
|
+
|
|
176
|
+
if [ -n "$TEST_ISSUES" ]; then
|
|
177
|
+
VERIFICATION_FAILURES+=("TEST: $TEST_ISSUES")
|
|
178
|
+
fi
|
|
179
|
+
|
|
180
|
+
# Check 3: Git status - uncommitted changes
|
|
181
|
+
GIT_ISSUES=""
|
|
182
|
+
if [ -d "$DIRECTORY/.git" ]; then
|
|
183
|
+
# Check for uncommitted changes
|
|
184
|
+
cd "$DIRECTORY" 2>/dev/null
|
|
185
|
+
if [ -n "$(git status --porcelain 2>/dev/null)" ]; then
|
|
186
|
+
CHANGED_FILES=$(git status --porcelain 2>/dev/null | wc -l)
|
|
187
|
+
GIT_ISSUES="$CHANGED_FILES uncommitted file(s). Consider committing changes or verify they should be discarded."
|
|
188
|
+
fi
|
|
189
|
+
# Check for unpushed commits
|
|
190
|
+
UNPUSHED=$(git log @{u}.. --oneline 2>/dev/null | wc -l)
|
|
191
|
+
if [ "$UNPUSHED" -gt 0 ]; then
|
|
192
|
+
if [ -n "$GIT_ISSUES" ]; then
|
|
193
|
+
GIT_ISSUES="$GIT_ISSUES Also, $UNPUSHED unpushed commit(s) exist."
|
|
194
|
+
else
|
|
195
|
+
GIT_ISSUES="$UNPUSHED unpushed commit(s). Consider pushing to remote or verify local-only is intended."
|
|
196
|
+
fi
|
|
197
|
+
fi
|
|
198
|
+
fi
|
|
199
|
+
|
|
200
|
+
if [ -n "$GIT_ISSUES" ]; then
|
|
201
|
+
VERIFICATION_FAILURES+=("GIT: $GIT_ISSUES")
|
|
202
|
+
fi
|
|
203
|
+
|
|
204
|
+
# Check 4: Background tasks still running
|
|
205
|
+
BACKGROUND_ISSUES=""
|
|
206
|
+
BACKGROUND_DIR="$HOME/.claude/background-tasks"
|
|
207
|
+
if [ -d "$BACKGROUND_DIR" ]; then
|
|
208
|
+
RUNNING_TASKS=0
|
|
209
|
+
for task_file in "$BACKGROUND_DIR"/*.json; do
|
|
210
|
+
if [ -f "$task_file" ]; then
|
|
211
|
+
if command -v jq &> /dev/null; then
|
|
212
|
+
STATUS=$(jq -r '.status // ""' "$task_file" 2>/dev/null)
|
|
213
|
+
if [ "$STATUS" = "running" ] || [ "$STATUS" = "pending" ]; then
|
|
214
|
+
RUNNING_TASKS=$((RUNNING_TASKS + 1))
|
|
215
|
+
fi
|
|
216
|
+
else
|
|
217
|
+
# Fallback: check for running/pending status
|
|
218
|
+
if grep -q '"status"[[:space:]]*:[[:space:]]*"running\|pending"' "$task_file" 2>/dev/null; then
|
|
219
|
+
RUNNING_TASKS=$((RUNNING_TASKS + 1))
|
|
220
|
+
fi
|
|
221
|
+
fi
|
|
222
|
+
fi
|
|
223
|
+
done
|
|
224
|
+
|
|
225
|
+
if [ "$RUNNING_TASKS" -gt 0 ]; then
|
|
226
|
+
BACKGROUND_ISSUES="$RUNNING_TASKS background task(s) still running. Wait for completion or verify results."
|
|
227
|
+
fi
|
|
228
|
+
fi
|
|
229
|
+
|
|
230
|
+
if [ -n "$BACKGROUND_ISSUES" ]; then
|
|
231
|
+
VERIFICATION_FAILURES+=("BACKGROUND: $BACKGROUND_ISSUES")
|
|
232
|
+
fi
|
|
233
|
+
|
|
234
|
+
# If any verification failures exist, block stopping
|
|
235
|
+
if [ ${#VERIFICATION_FAILURES[@]} -gt 0 ]; then
|
|
236
|
+
FAILURE_LIST=""
|
|
237
|
+
for failure in "${VERIFICATION_FAILURES[@]}"; do
|
|
238
|
+
FAILURE_LIST="$FAILURE_LIST\n- $failure"
|
|
239
|
+
done
|
|
240
|
+
|
|
241
|
+
cat << EOF
|
|
242
|
+
{"continue": false, "reason": "<verification-requirements>\n\n[VERIFICATION REQUIREMENTS NOT MET]\n\nBefore stopping, you must address the following verification requirements:\n$FAILURE_LIST\n\n## REQUIRED ACTIONS:\n\n1. **Build Verification**: If build scripts exist, run them and verify success\n2. **Test Verification**: Run all tests and ensure they pass\n3. **Git Status**: Review uncommitted/unpushed changes - commit or verify intentional\n4. **Background Tasks**: Wait for or check results of running background tasks\n\n**You cannot stop until these verifications are complete.**\n\nAddress each issue above, then you may conclude.\n\n</verification-requirements>\n\n---\n"}
|
|
243
|
+
EOF
|
|
244
|
+
exit 0
|
|
245
|
+
fi
|
|
246
|
+
|
|
247
|
+
# Priority 2: Ultrawork Mode with incomplete todos
|
|
248
|
+
if [ -n "$ULTRAWORK_STATE" ] && [ "$INCOMPLETE_COUNT" -gt 0 ]; then
|
|
249
|
+
# Check if active (with jq fallback)
|
|
250
|
+
IS_ACTIVE=""
|
|
251
|
+
if command -v jq &> /dev/null; then
|
|
252
|
+
IS_ACTIVE=$(echo "$ULTRAWORK_STATE" | jq -r '.active // false' 2>/dev/null)
|
|
253
|
+
else
|
|
254
|
+
# Fallback: grep for "active": true
|
|
255
|
+
if echo "$ULTRAWORK_STATE" | grep -q '"active"[[:space:]]*:[[:space:]]*true'; then
|
|
256
|
+
IS_ACTIVE="true"
|
|
257
|
+
fi
|
|
258
|
+
fi
|
|
259
|
+
|
|
260
|
+
if [ "$IS_ACTIVE" = "true" ]; then
|
|
261
|
+
# Get reinforcement count (with fallback)
|
|
262
|
+
REINFORCE_COUNT=0
|
|
263
|
+
if command -v jq &> /dev/null; then
|
|
264
|
+
REINFORCE_COUNT=$(echo "$ULTRAWORK_STATE" | jq -r '.reinforcement_count // 0' 2>/dev/null)
|
|
265
|
+
else
|
|
266
|
+
REINFORCE_COUNT=$(echo "$ULTRAWORK_STATE" | grep -oP '"reinforcement_count"[[:space:]]*:[[:space:]]*\K[0-9]+' 2>/dev/null) || REINFORCE_COUNT=0
|
|
267
|
+
fi
|
|
268
|
+
NEW_COUNT=$((REINFORCE_COUNT + 1))
|
|
269
|
+
|
|
270
|
+
# Get original prompt (with fallback)
|
|
271
|
+
ORIGINAL_PROMPT=""
|
|
272
|
+
if command -v jq &> /dev/null; then
|
|
273
|
+
ORIGINAL_PROMPT=$(echo "$ULTRAWORK_STATE" | jq -r '.original_prompt // ""' 2>/dev/null)
|
|
274
|
+
else
|
|
275
|
+
ORIGINAL_PROMPT=$(echo "$ULTRAWORK_STATE" | grep -oP '"original_prompt"[[:space:]]*:[[:space:]]*"\K[^"]+' 2>/dev/null) || ORIGINAL_PROMPT=""
|
|
276
|
+
fi
|
|
277
|
+
|
|
278
|
+
# Update state file (best effort)
|
|
279
|
+
if command -v jq &> /dev/null; then
|
|
280
|
+
echo "$ULTRAWORK_STATE" | jq ".reinforcement_count = $NEW_COUNT | .last_checked_at = \"$(date -Iseconds)\"" > "$DIRECTORY/.olympus/ultrawork-state.json" 2>/dev/null
|
|
281
|
+
fi
|
|
282
|
+
|
|
283
|
+
cat << EOF
|
|
284
|
+
{"continue": false, "reason": "<ultrawork-persistence>\n\n[ULTRAWORK MODE STILL ACTIVE - Reinforcement #$NEW_COUNT]\n\nYour ultrawork session is NOT complete. $INCOMPLETE_COUNT incomplete todos remain.\n\nREMEMBER THE ULTRAWORK RULES:\n- **PARALLEL**: Fire independent calls simultaneously - NEVER wait sequentially\n- **BACKGROUND FIRST**: Use Task(run_in_background=true) for exploration (10+ concurrent)\n- **TODO**: Track EVERY step. Mark complete IMMEDIATELY after each\n- **VERIFY**: Check ALL requirements met before done\n- **NO Premature Stopping**: ALL TODOs must be complete\n\nContinue working on the next pending task. DO NOT STOP until all tasks are marked complete.\n\nOriginal task: $ORIGINAL_PROMPT\n\n</ultrawork-persistence>\n\n---\n"}
|
|
285
|
+
EOF
|
|
286
|
+
exit 0
|
|
287
|
+
fi
|
|
288
|
+
fi
|
|
289
|
+
|
|
290
|
+
# Priority 3: Todo Continuation (baseline)
|
|
291
|
+
if [ "$INCOMPLETE_COUNT" -gt 0 ]; then
|
|
292
|
+
cat << EOF
|
|
293
|
+
{"continue": false, "reason": "<todo-continuation>\n\n[SYSTEM REMINDER - TODO CONTINUATION]\n\nIncomplete tasks remain in your todo list ($INCOMPLETE_COUNT remaining). Continue working on the next pending task.\n\n- Proceed without asking for permission\n- Mark each task complete when finished\n- Do not stop until all tasks are done\n\n</todo-continuation>\n\n---\n"}
|
|
294
|
+
EOF
|
|
295
|
+
exit 0
|
|
296
|
+
fi
|
|
297
|
+
|
|
298
|
+
# No blocking needed
|
|
299
|
+
echo '{"continue": true}'
|
|
300
|
+
exit 0
|
|
@@ -0,0 +1,217 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* PostToolUse Hook: Verification Reminder System (Node.js)
|
|
5
|
+
* Monitors tool execution and provides contextual guidance
|
|
6
|
+
* Cross-platform: Windows, macOS, Linux
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
import { existsSync, readFileSync, writeFileSync, mkdirSync } from 'fs';
|
|
10
|
+
import { join } from 'path';
|
|
11
|
+
import { homedir } from 'os';
|
|
12
|
+
|
|
13
|
+
// State file for session tracking
|
|
14
|
+
const STATE_FILE = join(homedir(), '.claude', '.session-stats.json');
|
|
15
|
+
|
|
16
|
+
// Ensure state directory exists
|
|
17
|
+
try {
|
|
18
|
+
const stateDir = join(homedir(), '.claude');
|
|
19
|
+
if (!existsSync(stateDir)) {
|
|
20
|
+
mkdirSync(stateDir, { recursive: true });
|
|
21
|
+
}
|
|
22
|
+
} catch {}
|
|
23
|
+
|
|
24
|
+
// Read all stdin
|
|
25
|
+
async function readStdin() {
|
|
26
|
+
const chunks = [];
|
|
27
|
+
for await (const chunk of process.stdin) {
|
|
28
|
+
chunks.push(chunk);
|
|
29
|
+
}
|
|
30
|
+
return Buffer.concat(chunks).toString('utf-8');
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
// Load session statistics
|
|
34
|
+
function loadStats() {
|
|
35
|
+
try {
|
|
36
|
+
if (existsSync(STATE_FILE)) {
|
|
37
|
+
return JSON.parse(readFileSync(STATE_FILE, 'utf-8'));
|
|
38
|
+
}
|
|
39
|
+
} catch {}
|
|
40
|
+
return { sessions: {} };
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
// Save session statistics
|
|
44
|
+
function saveStats(stats) {
|
|
45
|
+
try {
|
|
46
|
+
writeFileSync(STATE_FILE, JSON.stringify(stats, null, 2));
|
|
47
|
+
} catch {}
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
// Update stats for this session
|
|
51
|
+
function updateStats(toolName, sessionId) {
|
|
52
|
+
const stats = loadStats();
|
|
53
|
+
|
|
54
|
+
if (!stats.sessions[sessionId]) {
|
|
55
|
+
stats.sessions[sessionId] = {
|
|
56
|
+
tool_counts: {},
|
|
57
|
+
last_tool: '',
|
|
58
|
+
total_calls: 0,
|
|
59
|
+
started_at: Math.floor(Date.now() / 1000)
|
|
60
|
+
};
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
const session = stats.sessions[sessionId];
|
|
64
|
+
session.tool_counts[toolName] = (session.tool_counts[toolName] || 0) + 1;
|
|
65
|
+
session.last_tool = toolName;
|
|
66
|
+
session.total_calls = (session.total_calls || 0) + 1;
|
|
67
|
+
session.updated_at = Math.floor(Date.now() / 1000);
|
|
68
|
+
|
|
69
|
+
saveStats(stats);
|
|
70
|
+
return session.tool_counts[toolName];
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
// Detect failures in Bash output
|
|
74
|
+
function detectBashFailure(output) {
|
|
75
|
+
const errorPatterns = [
|
|
76
|
+
/error:/i,
|
|
77
|
+
/failed/i,
|
|
78
|
+
/cannot/i,
|
|
79
|
+
/permission denied/i,
|
|
80
|
+
/command not found/i,
|
|
81
|
+
/no such file/i,
|
|
82
|
+
/exit code: [1-9]/i,
|
|
83
|
+
/exit status [1-9]/i,
|
|
84
|
+
/fatal:/i,
|
|
85
|
+
/abort/i,
|
|
86
|
+
];
|
|
87
|
+
|
|
88
|
+
return errorPatterns.some(pattern => pattern.test(output));
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
// Detect background operation
|
|
92
|
+
function detectBackgroundOperation(output) {
|
|
93
|
+
const bgPatterns = [
|
|
94
|
+
/started/i,
|
|
95
|
+
/running/i,
|
|
96
|
+
/background/i,
|
|
97
|
+
/async/i,
|
|
98
|
+
/task_id/i,
|
|
99
|
+
/spawned/i,
|
|
100
|
+
];
|
|
101
|
+
|
|
102
|
+
return bgPatterns.some(pattern => pattern.test(output));
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
// Detect write failure
|
|
106
|
+
function detectWriteFailure(output) {
|
|
107
|
+
const errorPatterns = [
|
|
108
|
+
/error/i,
|
|
109
|
+
/failed/i,
|
|
110
|
+
/permission denied/i,
|
|
111
|
+
/read-only/i,
|
|
112
|
+
/not found/i,
|
|
113
|
+
];
|
|
114
|
+
|
|
115
|
+
return errorPatterns.some(pattern => pattern.test(output));
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
// Generate contextual message
|
|
119
|
+
function generateMessage(toolName, toolOutput, sessionId, toolCount) {
|
|
120
|
+
let message = '';
|
|
121
|
+
|
|
122
|
+
switch (toolName) {
|
|
123
|
+
case 'Bash':
|
|
124
|
+
if (detectBashFailure(toolOutput)) {
|
|
125
|
+
message = 'Command failed. Please investigate the error and fix before continuing.';
|
|
126
|
+
} else if (detectBackgroundOperation(toolOutput)) {
|
|
127
|
+
message = 'Background operation detected. Remember to verify results before proceeding.';
|
|
128
|
+
}
|
|
129
|
+
break;
|
|
130
|
+
|
|
131
|
+
case 'Task':
|
|
132
|
+
if (detectWriteFailure(toolOutput)) {
|
|
133
|
+
message = 'Task delegation failed. Verify agent name and parameters.';
|
|
134
|
+
} else if (detectBackgroundOperation(toolOutput)) {
|
|
135
|
+
message = 'Background task launched. Use TaskOutput to check results when needed.';
|
|
136
|
+
} else if (toolCount > 5) {
|
|
137
|
+
message = `Multiple tasks delegated (${toolCount} total). Track their completion status.`;
|
|
138
|
+
}
|
|
139
|
+
break;
|
|
140
|
+
|
|
141
|
+
case 'Edit':
|
|
142
|
+
if (detectWriteFailure(toolOutput)) {
|
|
143
|
+
message = 'Edit operation failed. Verify file exists and content matches exactly.';
|
|
144
|
+
} else {
|
|
145
|
+
message = 'Code modified. Verify changes work as expected before marking complete.';
|
|
146
|
+
}
|
|
147
|
+
break;
|
|
148
|
+
|
|
149
|
+
case 'Write':
|
|
150
|
+
if (detectWriteFailure(toolOutput)) {
|
|
151
|
+
message = 'Write operation failed. Check file permissions and directory existence.';
|
|
152
|
+
} else {
|
|
153
|
+
message = 'File written. Test the changes to ensure they work correctly.';
|
|
154
|
+
}
|
|
155
|
+
break;
|
|
156
|
+
|
|
157
|
+
case 'TodoWrite':
|
|
158
|
+
if (/created|added/i.test(toolOutput)) {
|
|
159
|
+
message = 'Todo list updated. Proceed with next task on the list.';
|
|
160
|
+
} else if (/completed|done/i.test(toolOutput)) {
|
|
161
|
+
message = 'Task marked complete. Continue with remaining todos.';
|
|
162
|
+
} else if (/in_progress/i.test(toolOutput)) {
|
|
163
|
+
message = 'Task marked in progress. Focus on completing this task.';
|
|
164
|
+
}
|
|
165
|
+
break;
|
|
166
|
+
|
|
167
|
+
case 'Read':
|
|
168
|
+
if (toolCount > 10) {
|
|
169
|
+
message = `Extensive reading (${toolCount} files). Consider using Grep for pattern searches.`;
|
|
170
|
+
}
|
|
171
|
+
break;
|
|
172
|
+
|
|
173
|
+
case 'Grep':
|
|
174
|
+
if (/^0$|no matches/i.test(toolOutput)) {
|
|
175
|
+
message = 'No matches found. Verify pattern syntax or try broader search.';
|
|
176
|
+
}
|
|
177
|
+
break;
|
|
178
|
+
|
|
179
|
+
case 'Glob':
|
|
180
|
+
if (!toolOutput.trim() || /no files/i.test(toolOutput)) {
|
|
181
|
+
message = 'No files matched pattern. Verify glob syntax and directory.';
|
|
182
|
+
}
|
|
183
|
+
break;
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
return message;
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
async function main() {
|
|
190
|
+
try {
|
|
191
|
+
const input = await readStdin();
|
|
192
|
+
const data = JSON.parse(input);
|
|
193
|
+
|
|
194
|
+
const toolName = data.toolName || '';
|
|
195
|
+
const toolOutput = data.toolOutput || '';
|
|
196
|
+
const sessionId = data.sessionId || 'unknown';
|
|
197
|
+
|
|
198
|
+
// Update session statistics
|
|
199
|
+
const toolCount = updateStats(toolName, sessionId);
|
|
200
|
+
|
|
201
|
+
// Generate contextual message
|
|
202
|
+
const message = generateMessage(toolName, toolOutput, sessionId, toolCount);
|
|
203
|
+
|
|
204
|
+
// Build response
|
|
205
|
+
const response = { continue: true };
|
|
206
|
+
if (message) {
|
|
207
|
+
response.message = message;
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
console.log(JSON.stringify(response, null, 2));
|
|
211
|
+
} catch (error) {
|
|
212
|
+
// On error, always continue
|
|
213
|
+
console.log(JSON.stringify({ continue: true }));
|
|
214
|
+
}
|
|
215
|
+
}
|
|
216
|
+
|
|
217
|
+
main();
|