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,69 @@
|
|
|
1
|
+
export const HOOK_NAME = "non-interactive-env";
|
|
2
|
+
export const NON_INTERACTIVE_ENV = {
|
|
3
|
+
CI: "true",
|
|
4
|
+
DEBIAN_FRONTEND: "noninteractive",
|
|
5
|
+
GIT_TERMINAL_PROMPT: "0",
|
|
6
|
+
GCM_INTERACTIVE: "never",
|
|
7
|
+
HOMEBREW_NO_AUTO_UPDATE: "1",
|
|
8
|
+
// Block interactive editors - git rebase, commit, etc.
|
|
9
|
+
GIT_EDITOR: ":",
|
|
10
|
+
EDITOR: ":",
|
|
11
|
+
VISUAL: "",
|
|
12
|
+
GIT_SEQUENCE_EDITOR: ":",
|
|
13
|
+
GIT_MERGE_AUTOEDIT: "no",
|
|
14
|
+
// Block pagers
|
|
15
|
+
GIT_PAGER: "cat",
|
|
16
|
+
PAGER: "cat",
|
|
17
|
+
// NPM non-interactive
|
|
18
|
+
npm_config_yes: "true",
|
|
19
|
+
// Pip non-interactive
|
|
20
|
+
PIP_NO_INPUT: "1",
|
|
21
|
+
// Yarn non-interactive
|
|
22
|
+
YARN_ENABLE_IMMUTABLE_INSTALLS: "false",
|
|
23
|
+
};
|
|
24
|
+
/**
|
|
25
|
+
* Shell command guidance for non-interactive environments.
|
|
26
|
+
* These patterns should be followed to avoid hanging on user input.
|
|
27
|
+
*/
|
|
28
|
+
export const SHELL_COMMAND_PATTERNS = {
|
|
29
|
+
// Package managers - always use non-interactive flags
|
|
30
|
+
npm: {
|
|
31
|
+
bad: ["npm init", "npm install (prompts)"],
|
|
32
|
+
good: ["npm init -y", "npm install --yes"],
|
|
33
|
+
},
|
|
34
|
+
apt: {
|
|
35
|
+
bad: ["apt-get install pkg"],
|
|
36
|
+
good: ["apt-get install -y pkg", "DEBIAN_FRONTEND=noninteractive apt-get install pkg"],
|
|
37
|
+
},
|
|
38
|
+
pip: {
|
|
39
|
+
bad: ["pip install pkg (with prompts)"],
|
|
40
|
+
good: ["pip install --no-input pkg", "PIP_NO_INPUT=1 pip install pkg"],
|
|
41
|
+
},
|
|
42
|
+
// Git operations - always provide messages/flags
|
|
43
|
+
git: {
|
|
44
|
+
bad: ["git commit", "git merge branch", "git add -p", "git rebase -i"],
|
|
45
|
+
good: ["git commit -m 'msg'", "git merge --no-edit branch", "git add .", "git rebase --no-edit"],
|
|
46
|
+
},
|
|
47
|
+
// System commands - force flags
|
|
48
|
+
system: {
|
|
49
|
+
bad: ["rm file (prompts)", "cp a b (prompts)", "ssh host"],
|
|
50
|
+
good: ["rm -f file", "cp -f a b", "ssh -o BatchMode=yes host", "unzip -o file.zip"],
|
|
51
|
+
},
|
|
52
|
+
// Banned commands - will always hang
|
|
53
|
+
banned: [
|
|
54
|
+
"vim", "nano", "vi", "emacs", // Editors
|
|
55
|
+
"less", "more", "man", // Pagers
|
|
56
|
+
"python (REPL)", "node (REPL)", // REPLs without -c/-e
|
|
57
|
+
"git add -p", "git rebase -i", // Interactive git modes
|
|
58
|
+
],
|
|
59
|
+
// Workarounds for scripts that require input
|
|
60
|
+
workarounds: {
|
|
61
|
+
yesPipe: "yes | ./script.sh",
|
|
62
|
+
heredoc: `./script.sh <<EOF
|
|
63
|
+
option1
|
|
64
|
+
option2
|
|
65
|
+
EOF`,
|
|
66
|
+
expectAlternative: "Use environment variables or config files instead of expect",
|
|
67
|
+
},
|
|
68
|
+
};
|
|
69
|
+
//# sourceMappingURL=constants.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../src/hooks/non-interactive-env/constants.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,SAAS,GAAG,qBAAqB,CAAA;AAE9C,MAAM,CAAC,MAAM,mBAAmB,GAA2B;IACzD,EAAE,EAAE,MAAM;IACV,eAAe,EAAE,gBAAgB;IACjC,mBAAmB,EAAE,GAAG;IACxB,eAAe,EAAE,OAAO;IACxB,uBAAuB,EAAE,GAAG;IAC5B,uDAAuD;IACvD,UAAU,EAAE,GAAG;IACf,MAAM,EAAE,GAAG;IACX,MAAM,EAAE,EAAE;IACV,mBAAmB,EAAE,GAAG;IACxB,kBAAkB,EAAE,IAAI;IACxB,eAAe;IACf,SAAS,EAAE,KAAK;IAChB,KAAK,EAAE,KAAK;IACZ,sBAAsB;IACtB,cAAc,EAAE,MAAM;IACtB,sBAAsB;IACtB,YAAY,EAAE,GAAG;IACjB,uBAAuB;IACvB,8BAA8B,EAAE,OAAO;CACxC,CAAA;AAED;;;GAGG;AACH,MAAM,CAAC,MAAM,sBAAsB,GAAG;IACpC,sDAAsD;IACtD,GAAG,EAAE;QACH,GAAG,EAAE,CAAC,UAAU,EAAE,uBAAuB,CAAC;QAC1C,IAAI,EAAE,CAAC,aAAa,EAAE,mBAAmB,CAAC;KAC3C;IACD,GAAG,EAAE;QACH,GAAG,EAAE,CAAC,qBAAqB,CAAC;QAC5B,IAAI,EAAE,CAAC,wBAAwB,EAAE,oDAAoD,CAAC;KACvF;IACD,GAAG,EAAE;QACH,GAAG,EAAE,CAAC,gCAAgC,CAAC;QACvC,IAAI,EAAE,CAAC,4BAA4B,EAAE,gCAAgC,CAAC;KACvE;IACD,iDAAiD;IACjD,GAAG,EAAE;QACH,GAAG,EAAE,CAAC,YAAY,EAAE,kBAAkB,EAAE,YAAY,EAAE,eAAe,CAAC;QACtE,IAAI,EAAE,CAAC,qBAAqB,EAAE,4BAA4B,EAAE,WAAW,EAAE,sBAAsB,CAAC;KACjG;IACD,gCAAgC;IAChC,MAAM,EAAE;QACN,GAAG,EAAE,CAAC,mBAAmB,EAAE,kBAAkB,EAAE,UAAU,CAAC;QAC1D,IAAI,EAAE,CAAC,YAAY,EAAE,WAAW,EAAE,2BAA2B,EAAE,mBAAmB,CAAC;KACpF;IACD,qCAAqC;IACrC,MAAM,EAAE;QACN,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,OAAO,EAAY,UAAU;QAClD,MAAM,EAAE,MAAM,EAAE,KAAK,EAAoB,SAAS;QAClD,eAAe,EAAE,aAAa,EAAW,sBAAsB;QAC/D,YAAY,EAAE,eAAe,EAAY,wBAAwB;KAClE;IACD,6CAA6C;IAC7C,WAAW,EAAE;QACX,OAAO,EAAE,mBAAmB;QAC5B,OAAO,EAAE;;;IAGT;QACA,iBAAiB,EAAE,6DAA6D;KACjF;CACO,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"detector.d.ts","sourceRoot":"","sources":["../../../src/hooks/non-interactive-env/detector.ts"],"names":[],"mappings":"AAAA,wBAAgB,gBAAgB,IAAI,OAAO,CAkB1C"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export function isNonInteractive() {
|
|
2
|
+
if (process.env.CI === "true" || process.env.CI === "1") {
|
|
3
|
+
return true;
|
|
4
|
+
}
|
|
5
|
+
if (process.env.CLAUDE_CODE_RUN === "true" || process.env.CLAUDE_CODE_NON_INTERACTIVE === "true") {
|
|
6
|
+
return true;
|
|
7
|
+
}
|
|
8
|
+
if (process.env.GITHUB_ACTIONS === "true") {
|
|
9
|
+
return true;
|
|
10
|
+
}
|
|
11
|
+
if (process.stdout.isTTY !== true) {
|
|
12
|
+
return true;
|
|
13
|
+
}
|
|
14
|
+
return false;
|
|
15
|
+
}
|
|
16
|
+
//# sourceMappingURL=detector.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"detector.js","sourceRoot":"","sources":["../../../src/hooks/non-interactive-env/detector.ts"],"names":[],"mappings":"AAAA,MAAM,UAAU,gBAAgB;IAC9B,IAAI,OAAO,CAAC,GAAG,CAAC,EAAE,KAAK,MAAM,IAAI,OAAO,CAAC,GAAG,CAAC,EAAE,KAAK,GAAG,EAAE,CAAC;QACxD,OAAO,IAAI,CAAA;IACb,CAAC;IAED,IAAI,OAAO,CAAC,GAAG,CAAC,eAAe,KAAK,MAAM,IAAI,OAAO,CAAC,GAAG,CAAC,2BAA2B,KAAK,MAAM,EAAE,CAAC;QACjG,OAAO,IAAI,CAAA;IACb,CAAC;IAED,IAAI,OAAO,CAAC,GAAG,CAAC,cAAc,KAAK,MAAM,EAAE,CAAC;QAC1C,OAAO,IAAI,CAAA;IACb,CAAC;IAED,IAAI,OAAO,CAAC,MAAM,CAAC,KAAK,KAAK,IAAI,EAAE,CAAC;QAClC,OAAO,IAAI,CAAA;IACb,CAAC;IAED,OAAO,KAAK,CAAA;AACd,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { ShellHook } from "./types.js";
|
|
2
|
+
export * from "./constants.js";
|
|
3
|
+
export * from "./detector.js";
|
|
4
|
+
export * from "./types.js";
|
|
5
|
+
/**
|
|
6
|
+
* Non-interactive environment hook for Claude Code.
|
|
7
|
+
*
|
|
8
|
+
* Detects and handles non-interactive environments (CI, cron, etc.) by:
|
|
9
|
+
* - Warning about banned interactive commands (vim, less, etc.)
|
|
10
|
+
* - Injecting environment variables to prevent git/tools from prompting
|
|
11
|
+
* - Prepending export statements to git commands to block editors/pagers
|
|
12
|
+
*/
|
|
13
|
+
export declare const nonInteractiveEnvHook: ShellHook;
|
|
14
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/hooks/non-interactive-env/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,YAAY,CAAA;AAG3C,cAAc,gBAAgB,CAAA;AAC9B,cAAc,eAAe,CAAA;AAC7B,cAAc,YAAY,CAAA;AA2C1B;;;;;;;GAOG;AACH,eAAO,MAAM,qBAAqB,EAAE,SAwBnC,CAAA"}
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import { HOOK_NAME, NON_INTERACTIVE_ENV, SHELL_COMMAND_PATTERNS } from "./constants.js";
|
|
2
|
+
export * from "./constants.js";
|
|
3
|
+
export * from "./detector.js";
|
|
4
|
+
export * from "./types.js";
|
|
5
|
+
const BANNED_COMMAND_PATTERNS = SHELL_COMMAND_PATTERNS.banned
|
|
6
|
+
.filter((cmd) => !cmd.includes("("))
|
|
7
|
+
.map((cmd) => new RegExp(`\\b${cmd}\\b`));
|
|
8
|
+
function detectBannedCommand(command) {
|
|
9
|
+
for (let i = 0; i < BANNED_COMMAND_PATTERNS.length; i++) {
|
|
10
|
+
if (BANNED_COMMAND_PATTERNS[i].test(command)) {
|
|
11
|
+
return SHELL_COMMAND_PATTERNS.banned[i];
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
return undefined;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Shell-escape a value for use in VAR=value prefix.
|
|
18
|
+
* Wraps in single quotes if contains special chars.
|
|
19
|
+
*/
|
|
20
|
+
function shellEscape(value) {
|
|
21
|
+
// Empty string needs quotes
|
|
22
|
+
if (value === "")
|
|
23
|
+
return "''";
|
|
24
|
+
// If contains special chars, wrap in single quotes (escape existing single quotes)
|
|
25
|
+
if (/[^a-zA-Z0-9_\-.:\/]/.test(value)) {
|
|
26
|
+
return `'${value.replace(/'/g, "'\\''")}'`;
|
|
27
|
+
}
|
|
28
|
+
return value;
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Build export statement for environment variables.
|
|
32
|
+
* Uses `export VAR1=val1 VAR2=val2;` format to ensure variables
|
|
33
|
+
* apply to ALL commands in a chain (e.g., `cmd1 && cmd2`).
|
|
34
|
+
*
|
|
35
|
+
* Previous approach used VAR=value prefix which only applies to the first command.
|
|
36
|
+
*/
|
|
37
|
+
function buildEnvPrefix(env) {
|
|
38
|
+
const exports = Object.entries(env)
|
|
39
|
+
.map(([key, value]) => `${key}=${shellEscape(value)}`)
|
|
40
|
+
.join(" ");
|
|
41
|
+
return `export ${exports};`;
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* Non-interactive environment hook for Claude Code.
|
|
45
|
+
*
|
|
46
|
+
* Detects and handles non-interactive environments (CI, cron, etc.) by:
|
|
47
|
+
* - Warning about banned interactive commands (vim, less, etc.)
|
|
48
|
+
* - Injecting environment variables to prevent git/tools from prompting
|
|
49
|
+
* - Prepending export statements to git commands to block editors/pagers
|
|
50
|
+
*/
|
|
51
|
+
export const nonInteractiveEnvHook = {
|
|
52
|
+
name: HOOK_NAME,
|
|
53
|
+
async beforeCommand(command) {
|
|
54
|
+
// Check for banned interactive commands
|
|
55
|
+
const bannedCmd = detectBannedCommand(command);
|
|
56
|
+
const warning = bannedCmd
|
|
57
|
+
? `Warning: '${bannedCmd}' is an interactive command that may hang in non-interactive environments.`
|
|
58
|
+
: undefined;
|
|
59
|
+
// Only prepend env vars for git commands (editor blocking, pager, etc.)
|
|
60
|
+
const isGitCommand = /\bgit\b/.test(command);
|
|
61
|
+
if (!isGitCommand) {
|
|
62
|
+
return { command, warning };
|
|
63
|
+
}
|
|
64
|
+
// Prepend export statement to command to ensure non-interactive behavior
|
|
65
|
+
// Uses `export VAR=val;` format to ensure variables apply to ALL commands
|
|
66
|
+
// in a chain (e.g., `git add file && git rebase --continue`).
|
|
67
|
+
const envPrefix = buildEnvPrefix(NON_INTERACTIVE_ENV);
|
|
68
|
+
const modifiedCommand = `${envPrefix} ${command}`;
|
|
69
|
+
return { command: modifiedCommand, warning };
|
|
70
|
+
},
|
|
71
|
+
};
|
|
72
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/hooks/non-interactive-env/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,mBAAmB,EAAE,sBAAsB,EAAE,MAAM,gBAAgB,CAAA;AAEvF,cAAc,gBAAgB,CAAA;AAC9B,cAAc,eAAe,CAAA;AAC7B,cAAc,YAAY,CAAA;AAE1B,MAAM,uBAAuB,GAAG,sBAAsB,CAAC,MAAM;KAC1D,MAAM,CAAC,CAAC,GAAW,EAAE,EAAE,CAAC,CAAC,GAAG,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC;KAC3C,GAAG,CAAC,CAAC,GAAW,EAAE,EAAE,CAAC,IAAI,MAAM,CAAC,MAAM,GAAG,KAAK,CAAC,CAAC,CAAA;AAEnD,SAAS,mBAAmB,CAAC,OAAe;IAC1C,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,uBAAuB,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;QACxD,IAAI,uBAAuB,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,EAAE,CAAC;YAC7C,OAAO,sBAAsB,CAAC,MAAM,CAAC,CAAC,CAAC,CAAA;QACzC,CAAC;IACH,CAAC;IACD,OAAO,SAAS,CAAA;AAClB,CAAC;AAED;;;GAGG;AACH,SAAS,WAAW,CAAC,KAAa;IAChC,4BAA4B;IAC5B,IAAI,KAAK,KAAK,EAAE;QAAE,OAAO,IAAI,CAAA;IAC7B,mFAAmF;IACnF,IAAI,qBAAqB,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC;QACtC,OAAO,IAAI,KAAK,CAAC,OAAO,CAAC,IAAI,EAAE,OAAO,CAAC,GAAG,CAAA;IAC5C,CAAC;IACD,OAAO,KAAK,CAAA;AACd,CAAC;AAED;;;;;;GAMG;AACH,SAAS,cAAc,CAAC,GAA2B;IACjD,MAAM,OAAO,GAAG,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC;SAChC,GAAG,CAAC,CAAC,CAAC,GAAG,EAAE,KAAK,CAAC,EAAE,EAAE,CAAC,GAAG,GAAG,IAAI,WAAW,CAAC,KAAK,CAAC,EAAE,CAAC;SACrD,IAAI,CAAC,GAAG,CAAC,CAAA;IACZ,OAAO,UAAU,OAAO,GAAG,CAAA;AAC7B,CAAC;AAED;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,qBAAqB,GAAc;IAC9C,IAAI,EAAE,SAAS;IAEf,KAAK,CAAC,aAAa,CAAC,OAAe;QACjC,wCAAwC;QACxC,MAAM,SAAS,GAAG,mBAAmB,CAAC,OAAO,CAAC,CAAA;QAC9C,MAAM,OAAO,GAAG,SAAS;YACvB,CAAC,CAAC,aAAa,SAAS,4EAA4E;YACpG,CAAC,CAAC,SAAS,CAAA;QAEb,wEAAwE;QACxE,MAAM,YAAY,GAAG,SAAS,CAAC,IAAI,CAAC,OAAO,CAAC,CAAA;QAC5C,IAAI,CAAC,YAAY,EAAE,CAAC;YAClB,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,CAAA;QAC7B,CAAC;QAED,yEAAyE;QACzE,0EAA0E;QAC1E,8DAA8D;QAC9D,MAAM,SAAS,GAAG,cAAc,CAAC,mBAAmB,CAAC,CAAA;QACrD,MAAM,eAAe,GAAG,GAAG,SAAS,IAAI,OAAO,EAAE,CAAA;QAEjD,OAAO,EAAE,OAAO,EAAE,eAAe,EAAE,OAAO,EAAE,CAAA;IAC9C,CAAC;CACF,CAAA"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export interface NonInteractiveEnvConfig {
|
|
2
|
+
disabled?: boolean;
|
|
3
|
+
}
|
|
4
|
+
/**
|
|
5
|
+
* Shell hook interface for command interception
|
|
6
|
+
*/
|
|
7
|
+
export interface ShellHook {
|
|
8
|
+
name: string;
|
|
9
|
+
beforeCommand?(command: string): Promise<{
|
|
10
|
+
command: string;
|
|
11
|
+
warning?: string;
|
|
12
|
+
}>;
|
|
13
|
+
}
|
|
14
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/hooks/non-interactive-env/types.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,uBAAuB;IACtC,QAAQ,CAAC,EAAE,OAAO,CAAA;CACnB;AAED;;GAEG;AACH,MAAM,WAAW,SAAS;IACxB,IAAI,EAAE,MAAM,CAAA;IACZ,aAAa,CAAC,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC;QAAE,OAAO,EAAE,MAAM,CAAC;QAAC,OAAO,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC,CAAA;CAChF"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/hooks/non-interactive-env/types.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Olympus Orchestrator Constants
|
|
3
|
+
*
|
|
4
|
+
* Message templates and configuration for orchestrator behavior enforcement.
|
|
5
|
+
*
|
|
6
|
+
* Adapted from oh-my-opencode's olympus-orchestrator hook.
|
|
7
|
+
*/
|
|
8
|
+
export declare const HOOK_NAME = "olympus-orchestrator";
|
|
9
|
+
/** Paths that orchestrator IS allowed to modify directly */
|
|
10
|
+
export declare const ALLOWED_PATH_PREFIX = ".olympus/";
|
|
11
|
+
/** Tools that perform file modifications */
|
|
12
|
+
export declare const WRITE_EDIT_TOOLS: string[];
|
|
13
|
+
/** Reminder when orchestrator performs direct file work */
|
|
14
|
+
export declare const DIRECT_WORK_REMINDER = "\n\n---\n\n[SYSTEM REMINDER - DELEGATION REQUIRED]\n\nYou just performed direct file modifications outside `.olympus/`.\n\n**You are an ORCHESTRATOR, not an IMPLEMENTER.**\n\nAs an orchestrator, you should:\n- **DELEGATE** implementation work to subagents via the Task tool\n- **VERIFY** the work done by subagents\n- **COORDINATE** multiple tasks and ensure completion\n\nYou should NOT:\n- Write code directly (except for `.olympus/` files like plans and notepads)\n- Make direct file edits outside `.olympus/`\n- Implement features yourself\n\n**If you need to make changes:**\n1. Use the Task tool to delegate to an appropriate subagent\n2. Provide clear instructions in the prompt\n3. Verify the subagent's work after completion\n\n---\n";
|
|
15
|
+
/** Strong warning when orchestrator tries to modify source files */
|
|
16
|
+
export declare const ORCHESTRATOR_DELEGATION_REQUIRED = "\n\n---\n\n[CRITICAL SYSTEM DIRECTIVE - DELEGATION REQUIRED]\n\n**STOP. YOU ARE VIOLATING ORCHESTRATOR PROTOCOL.**\n\nYou (orchestrator-olympus) are attempting to directly modify a file outside `.olympus/`.\n\n**Path attempted:** $FILE_PATH\n\n---\n\n**THIS IS FORBIDDEN** (except for VERIFICATION purposes)\n\nAs an ORCHESTRATOR, you MUST:\n1. **DELEGATE** all implementation work via the Task tool\n2. **VERIFY** the work done by subagents (reading files is OK)\n3. **COORDINATE** - you orchestrate, you don't implement\n\n**ALLOWED direct file operations:**\n- Files inside `.olympus/` (plans, notepads, drafts)\n- Reading files for verification\n- Running diagnostics/tests\n\n**FORBIDDEN direct file operations:**\n- Writing/editing source code\n- Creating new files outside `.olympus/`\n- Any implementation work\n\n---\n\n**IF THIS IS FOR VERIFICATION:**\nProceed if you are verifying subagent work by making a small fix.\nBut for any substantial changes, USE the Task tool.\n\n**CORRECT APPROACH:**\n```\nTask tool with subagent_type=\"olympian\"\nprompt=\"[specific single task with clear acceptance criteria]\"\n```\n\nDELEGATE. DON'T IMPLEMENT.\n\n---\n";
|
|
17
|
+
/** Continuation prompt for boulder state */
|
|
18
|
+
export declare const BOULDER_CONTINUATION_PROMPT = "[SYSTEM REMINDER - BOULDER CONTINUATION]\n\nYou have an active work plan with incomplete tasks. Continue working.\n\nRULES:\n- Proceed without asking for permission\n- Mark each checkbox [x] in the plan file when done\n- Use the notepad at .olympus/notepads/{PLAN_NAME}/ to record learnings\n- Do not stop until all tasks are complete\n- If blocked, document the blocker and move to the next task";
|
|
19
|
+
/** Verification reminder for subagent work */
|
|
20
|
+
export declare const VERIFICATION_REMINDER = "**MANDATORY VERIFICATION - SUBAGENTS LIE**\n\nSubagents FREQUENTLY claim completion when:\n- Tests are actually FAILING\n- Code has type/lint ERRORS\n- Implementation is INCOMPLETE\n- Patterns were NOT followed\n\n**YOU MUST VERIFY EVERYTHING YOURSELF:**\n\n1. Run tests yourself - Must PASS (not \"agent said it passed\")\n2. Read the actual code - Must match requirements\n3. Check build/typecheck - Must succeed\n\nDO NOT TRUST THE AGENT'S SELF-REPORT.\nVERIFY EACH CLAIM WITH YOUR OWN TOOL CALLS.";
|
|
21
|
+
/** Directive for subagents to refuse multi-task requests */
|
|
22
|
+
export declare const SINGLE_TASK_DIRECTIVE = "\n\n[SYSTEM DIRECTIVE - SINGLE TASK ONLY]\n\n**STOP. READ THIS BEFORE PROCEEDING.**\n\nIf you were NOT given **exactly ONE atomic task**, you MUST:\n1. **IMMEDIATELY REFUSE** this request\n2. **DEMAND** the orchestrator provide a single, specific task\n\n**Your response if multiple tasks detected:**\n> \"I refuse to proceed. You provided multiple tasks. An orchestrator's impatience destroys work quality.\n>\n> PROVIDE EXACTLY ONE TASK. One file. One change. One verification.\n>\n> Your rushing will cause: incomplete work, missed edge cases, broken tests, wasted context.\"\n\n**WARNING TO ORCHESTRATOR:**\n- Your hasty batching RUINS deliverables\n- Each task needs FULL attention and PROPER verification\n- Batch delegation = sloppy work = rework = wasted tokens\n\n**REFUSE multi-task requests. DEMAND single-task clarity.**\n";
|
|
23
|
+
//# sourceMappingURL=constants.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../src/hooks/olympus-orchestrator/constants.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,eAAO,MAAM,SAAS,yBAAyB,CAAC;AAEhD,4DAA4D;AAC5D,eAAO,MAAM,mBAAmB,cAAc,CAAC;AAE/C,4CAA4C;AAC5C,eAAO,MAAM,gBAAgB,UAAqC,CAAC;AAEnE,2DAA2D;AAC3D,eAAO,MAAM,oBAAoB,2uBA0BhC,CAAC;AAEF,oEAAoE;AACpE,eAAO,MAAM,gCAAgC,ipCA8C5C,CAAC;AAEF,4CAA4C;AAC5C,eAAO,MAAM,2BAA2B,iZASqB,CAAC;AAE9D,8CAA8C;AAC9C,eAAO,MAAM,qBAAqB,yfAeU,CAAC;AAE7C,4DAA4D;AAC5D,eAAO,MAAM,qBAAqB,u0BAuBjC,CAAC"}
|
|
@@ -0,0 +1,142 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Olympus Orchestrator Constants
|
|
3
|
+
*
|
|
4
|
+
* Message templates and configuration for orchestrator behavior enforcement.
|
|
5
|
+
*
|
|
6
|
+
* Adapted from oh-my-opencode's olympus-orchestrator hook.
|
|
7
|
+
*/
|
|
8
|
+
export const HOOK_NAME = 'olympus-orchestrator';
|
|
9
|
+
/** Paths that orchestrator IS allowed to modify directly */
|
|
10
|
+
export const ALLOWED_PATH_PREFIX = '.olympus/';
|
|
11
|
+
/** Tools that perform file modifications */
|
|
12
|
+
export const WRITE_EDIT_TOOLS = ['Write', 'Edit', 'write', 'edit'];
|
|
13
|
+
/** Reminder when orchestrator performs direct file work */
|
|
14
|
+
export const DIRECT_WORK_REMINDER = `
|
|
15
|
+
|
|
16
|
+
---
|
|
17
|
+
|
|
18
|
+
[SYSTEM REMINDER - DELEGATION REQUIRED]
|
|
19
|
+
|
|
20
|
+
You just performed direct file modifications outside \`.olympus/\`.
|
|
21
|
+
|
|
22
|
+
**You are an ORCHESTRATOR, not an IMPLEMENTER.**
|
|
23
|
+
|
|
24
|
+
As an orchestrator, you should:
|
|
25
|
+
- **DELEGATE** implementation work to subagents via the Task tool
|
|
26
|
+
- **VERIFY** the work done by subagents
|
|
27
|
+
- **COORDINATE** multiple tasks and ensure completion
|
|
28
|
+
|
|
29
|
+
You should NOT:
|
|
30
|
+
- Write code directly (except for \`.olympus/\` files like plans and notepads)
|
|
31
|
+
- Make direct file edits outside \`.olympus/\`
|
|
32
|
+
- Implement features yourself
|
|
33
|
+
|
|
34
|
+
**If you need to make changes:**
|
|
35
|
+
1. Use the Task tool to delegate to an appropriate subagent
|
|
36
|
+
2. Provide clear instructions in the prompt
|
|
37
|
+
3. Verify the subagent's work after completion
|
|
38
|
+
|
|
39
|
+
---
|
|
40
|
+
`;
|
|
41
|
+
/** Strong warning when orchestrator tries to modify source files */
|
|
42
|
+
export const ORCHESTRATOR_DELEGATION_REQUIRED = `
|
|
43
|
+
|
|
44
|
+
---
|
|
45
|
+
|
|
46
|
+
[CRITICAL SYSTEM DIRECTIVE - DELEGATION REQUIRED]
|
|
47
|
+
|
|
48
|
+
**STOP. YOU ARE VIOLATING ORCHESTRATOR PROTOCOL.**
|
|
49
|
+
|
|
50
|
+
You (orchestrator-olympus) are attempting to directly modify a file outside \`.olympus/\`.
|
|
51
|
+
|
|
52
|
+
**Path attempted:** $FILE_PATH
|
|
53
|
+
|
|
54
|
+
---
|
|
55
|
+
|
|
56
|
+
**THIS IS FORBIDDEN** (except for VERIFICATION purposes)
|
|
57
|
+
|
|
58
|
+
As an ORCHESTRATOR, you MUST:
|
|
59
|
+
1. **DELEGATE** all implementation work via the Task tool
|
|
60
|
+
2. **VERIFY** the work done by subagents (reading files is OK)
|
|
61
|
+
3. **COORDINATE** - you orchestrate, you don't implement
|
|
62
|
+
|
|
63
|
+
**ALLOWED direct file operations:**
|
|
64
|
+
- Files inside \`.olympus/\` (plans, notepads, drafts)
|
|
65
|
+
- Reading files for verification
|
|
66
|
+
- Running diagnostics/tests
|
|
67
|
+
|
|
68
|
+
**FORBIDDEN direct file operations:**
|
|
69
|
+
- Writing/editing source code
|
|
70
|
+
- Creating new files outside \`.olympus/\`
|
|
71
|
+
- Any implementation work
|
|
72
|
+
|
|
73
|
+
---
|
|
74
|
+
|
|
75
|
+
**IF THIS IS FOR VERIFICATION:**
|
|
76
|
+
Proceed if you are verifying subagent work by making a small fix.
|
|
77
|
+
But for any substantial changes, USE the Task tool.
|
|
78
|
+
|
|
79
|
+
**CORRECT APPROACH:**
|
|
80
|
+
\`\`\`
|
|
81
|
+
Task tool with subagent_type="olympian"
|
|
82
|
+
prompt="[specific single task with clear acceptance criteria]"
|
|
83
|
+
\`\`\`
|
|
84
|
+
|
|
85
|
+
DELEGATE. DON'T IMPLEMENT.
|
|
86
|
+
|
|
87
|
+
---
|
|
88
|
+
`;
|
|
89
|
+
/** Continuation prompt for boulder state */
|
|
90
|
+
export const BOULDER_CONTINUATION_PROMPT = `[SYSTEM REMINDER - BOULDER CONTINUATION]
|
|
91
|
+
|
|
92
|
+
You have an active work plan with incomplete tasks. Continue working.
|
|
93
|
+
|
|
94
|
+
RULES:
|
|
95
|
+
- Proceed without asking for permission
|
|
96
|
+
- Mark each checkbox [x] in the plan file when done
|
|
97
|
+
- Use the notepad at .olympus/notepads/{PLAN_NAME}/ to record learnings
|
|
98
|
+
- Do not stop until all tasks are complete
|
|
99
|
+
- If blocked, document the blocker and move to the next task`;
|
|
100
|
+
/** Verification reminder for subagent work */
|
|
101
|
+
export const VERIFICATION_REMINDER = `**MANDATORY VERIFICATION - SUBAGENTS LIE**
|
|
102
|
+
|
|
103
|
+
Subagents FREQUENTLY claim completion when:
|
|
104
|
+
- Tests are actually FAILING
|
|
105
|
+
- Code has type/lint ERRORS
|
|
106
|
+
- Implementation is INCOMPLETE
|
|
107
|
+
- Patterns were NOT followed
|
|
108
|
+
|
|
109
|
+
**YOU MUST VERIFY EVERYTHING YOURSELF:**
|
|
110
|
+
|
|
111
|
+
1. Run tests yourself - Must PASS (not "agent said it passed")
|
|
112
|
+
2. Read the actual code - Must match requirements
|
|
113
|
+
3. Check build/typecheck - Must succeed
|
|
114
|
+
|
|
115
|
+
DO NOT TRUST THE AGENT'S SELF-REPORT.
|
|
116
|
+
VERIFY EACH CLAIM WITH YOUR OWN TOOL CALLS.`;
|
|
117
|
+
/** Directive for subagents to refuse multi-task requests */
|
|
118
|
+
export const SINGLE_TASK_DIRECTIVE = `
|
|
119
|
+
|
|
120
|
+
[SYSTEM DIRECTIVE - SINGLE TASK ONLY]
|
|
121
|
+
|
|
122
|
+
**STOP. READ THIS BEFORE PROCEEDING.**
|
|
123
|
+
|
|
124
|
+
If you were NOT given **exactly ONE atomic task**, you MUST:
|
|
125
|
+
1. **IMMEDIATELY REFUSE** this request
|
|
126
|
+
2. **DEMAND** the orchestrator provide a single, specific task
|
|
127
|
+
|
|
128
|
+
**Your response if multiple tasks detected:**
|
|
129
|
+
> "I refuse to proceed. You provided multiple tasks. An orchestrator's impatience destroys work quality.
|
|
130
|
+
>
|
|
131
|
+
> PROVIDE EXACTLY ONE TASK. One file. One change. One verification.
|
|
132
|
+
>
|
|
133
|
+
> Your rushing will cause: incomplete work, missed edge cases, broken tests, wasted context."
|
|
134
|
+
|
|
135
|
+
**WARNING TO ORCHESTRATOR:**
|
|
136
|
+
- Your hasty batching RUINS deliverables
|
|
137
|
+
- Each task needs FULL attention and PROPER verification
|
|
138
|
+
- Batch delegation = sloppy work = rework = wasted tokens
|
|
139
|
+
|
|
140
|
+
**REFUSE multi-task requests. DEMAND single-task clarity.**
|
|
141
|
+
`;
|
|
142
|
+
//# sourceMappingURL=constants.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../src/hooks/olympus-orchestrator/constants.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,MAAM,CAAC,MAAM,SAAS,GAAG,sBAAsB,CAAC;AAEhD,4DAA4D;AAC5D,MAAM,CAAC,MAAM,mBAAmB,GAAG,WAAW,CAAC;AAE/C,4CAA4C;AAC5C,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,CAAC,CAAC;AAEnE,2DAA2D;AAC3D,MAAM,CAAC,MAAM,oBAAoB,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;CA0BnC,CAAC;AAEF,oEAAoE;AACpE,MAAM,CAAC,MAAM,gCAAgC,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA8C/C,CAAC;AAEF,4CAA4C;AAC5C,MAAM,CAAC,MAAM,2BAA2B,GAAG;;;;;;;;;6DASkB,CAAC;AAE9D,8CAA8C;AAC9C,MAAM,CAAC,MAAM,qBAAqB,GAAG;;;;;;;;;;;;;;;4CAeO,CAAC;AAE7C,4DAA4D;AAC5D,MAAM,CAAC,MAAM,qBAAqB,GAAG;;;;;;;;;;;;;;;;;;;;;;;CAuBpC,CAAC"}
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Olympus Orchestrator Hook
|
|
3
|
+
*
|
|
4
|
+
* Enforces orchestrator behavior - delegation over direct implementation.
|
|
5
|
+
* When an orchestrator agent tries to directly modify files outside .olympus/,
|
|
6
|
+
* this hook injects reminders to delegate to subagents instead.
|
|
7
|
+
*
|
|
8
|
+
* Adapted from oh-my-opencode's olympus-orchestrator hook for shell-based hooks.
|
|
9
|
+
*/
|
|
10
|
+
export * from './constants.js';
|
|
11
|
+
/**
|
|
12
|
+
* Input for tool execution hooks
|
|
13
|
+
*/
|
|
14
|
+
export interface ToolExecuteInput {
|
|
15
|
+
toolName: string;
|
|
16
|
+
toolInput?: Record<string, unknown>;
|
|
17
|
+
sessionId?: string;
|
|
18
|
+
directory?: string;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Output for tool execution hooks
|
|
22
|
+
*/
|
|
23
|
+
export interface ToolExecuteOutput {
|
|
24
|
+
continue: boolean;
|
|
25
|
+
message?: string;
|
|
26
|
+
modifiedOutput?: string;
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* Git file change statistics
|
|
30
|
+
*/
|
|
31
|
+
interface GitFileStat {
|
|
32
|
+
path: string;
|
|
33
|
+
added: number;
|
|
34
|
+
removed: number;
|
|
35
|
+
status: 'modified' | 'added' | 'deleted';
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* Check if a file path is allowed for direct orchestrator modification
|
|
39
|
+
*/
|
|
40
|
+
export declare function isAllowedPath(filePath: string): boolean;
|
|
41
|
+
/**
|
|
42
|
+
* Check if a tool is a write/edit tool
|
|
43
|
+
*/
|
|
44
|
+
export declare function isWriteEditTool(toolName: string): boolean;
|
|
45
|
+
/**
|
|
46
|
+
* Get git diff statistics for the working directory
|
|
47
|
+
*/
|
|
48
|
+
export declare function getGitDiffStats(directory: string): GitFileStat[];
|
|
49
|
+
/**
|
|
50
|
+
* Format file changes for display
|
|
51
|
+
*/
|
|
52
|
+
export declare function formatFileChanges(stats: GitFileStat[]): string;
|
|
53
|
+
/**
|
|
54
|
+
* Build verification reminder with session context
|
|
55
|
+
*/
|
|
56
|
+
export declare function buildVerificationReminder(sessionId?: string): string;
|
|
57
|
+
/**
|
|
58
|
+
* Build orchestrator reminder with plan progress
|
|
59
|
+
*/
|
|
60
|
+
export declare function buildOrchestratorReminder(planName: string, progress: {
|
|
61
|
+
total: number;
|
|
62
|
+
completed: number;
|
|
63
|
+
}, sessionId?: string): string;
|
|
64
|
+
/**
|
|
65
|
+
* Build boulder continuation message
|
|
66
|
+
*/
|
|
67
|
+
export declare function buildBoulderContinuation(planName: string, remaining: number, total: number): string;
|
|
68
|
+
/**
|
|
69
|
+
* Process pre-tool-use hook for orchestrator
|
|
70
|
+
* Returns warning message if orchestrator tries to modify non-allowed paths
|
|
71
|
+
*/
|
|
72
|
+
export declare function processOrchestratorPreTool(input: ToolExecuteInput): ToolExecuteOutput;
|
|
73
|
+
/**
|
|
74
|
+
* Process post-tool-use hook for orchestrator
|
|
75
|
+
* Adds reminders after file modifications and Task delegations
|
|
76
|
+
*/
|
|
77
|
+
export declare function processOrchestratorPostTool(input: ToolExecuteInput, output: string): ToolExecuteOutput;
|
|
78
|
+
/**
|
|
79
|
+
* Check if boulder has incomplete tasks and build continuation prompt
|
|
80
|
+
*/
|
|
81
|
+
export declare function checkBoulderContinuation(directory: string): {
|
|
82
|
+
shouldContinue: boolean;
|
|
83
|
+
message?: string;
|
|
84
|
+
};
|
|
85
|
+
/**
|
|
86
|
+
* Create olympus orchestrator hook handlers
|
|
87
|
+
*/
|
|
88
|
+
export declare function createOlympusOrchestratorHook(directory: string): {
|
|
89
|
+
/**
|
|
90
|
+
* Hook name identifier
|
|
91
|
+
*/
|
|
92
|
+
name: string;
|
|
93
|
+
/**
|
|
94
|
+
* Pre-tool execution handler
|
|
95
|
+
*/
|
|
96
|
+
preTool: (toolName: string, toolInput: Record<string, unknown>) => ToolExecuteOutput;
|
|
97
|
+
/**
|
|
98
|
+
* Post-tool execution handler
|
|
99
|
+
*/
|
|
100
|
+
postTool: (toolName: string, toolInput: Record<string, unknown>, output: string) => ToolExecuteOutput;
|
|
101
|
+
/**
|
|
102
|
+
* Check for boulder continuation on session idle
|
|
103
|
+
*/
|
|
104
|
+
checkContinuation: () => {
|
|
105
|
+
shouldContinue: boolean;
|
|
106
|
+
message?: string;
|
|
107
|
+
};
|
|
108
|
+
/**
|
|
109
|
+
* Get single task directive for subagent prompts
|
|
110
|
+
*/
|
|
111
|
+
getSingleTaskDirective: () => string;
|
|
112
|
+
};
|
|
113
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/hooks/olympus-orchestrator/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAmBH,cAAc,gBAAgB,CAAC;AAE/B;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAC/B,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACpC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED;;GAEG;AACH,MAAM,WAAW,iBAAiB;IAChC,QAAQ,EAAE,OAAO,CAAC;IAClB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB;AAED;;GAEG;AACH,UAAU,WAAW;IACnB,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,UAAU,GAAG,OAAO,GAAG,SAAS,CAAC;CAC1C;AAED;;GAEG;AACH,wBAAgB,aAAa,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAGvD;AAED;;GAEG;AACH,wBAAgB,eAAe,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAEzD;AAED;;GAEG;AACH,wBAAgB,eAAe,CAAC,SAAS,EAAE,MAAM,GAAG,WAAW,EAAE,CAmDhE;AAED;;GAEG;AACH,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,WAAW,EAAE,GAAG,MAAM,CAkC9D;AAED;;GAEG;AACH,wBAAgB,yBAAyB,CAAC,SAAS,CAAC,EAAE,MAAM,GAAG,MAAM,CAapE;AAED;;GAEG;AACH,wBAAgB,yBAAyB,CACvC,QAAQ,EAAE,MAAM,EAChB,QAAQ,EAAE;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,SAAS,EAAE,MAAM,CAAA;CAAE,EAC9C,SAAS,CAAC,EAAE,MAAM,GACjB,MAAM,CAYR;AAED;;GAEG;AACH,wBAAgB,wBAAwB,CACtC,QAAQ,EAAE,MAAM,EAChB,SAAS,EAAE,MAAM,EACjB,KAAK,EAAE,MAAM,GACZ,MAAM,CAGR;AAED;;;GAGG;AACH,wBAAgB,0BAA0B,CAAC,KAAK,EAAE,gBAAgB,GAAG,iBAAiB,CAuBrF;AAED;;;GAGG;AACH,wBAAgB,2BAA2B,CACzC,KAAK,EAAE,gBAAgB,EACvB,MAAM,EAAE,MAAM,GACb,iBAAiB,CAwDnB;AAED;;GAEG;AACH,wBAAgB,wBAAwB,CAAC,SAAS,EAAE,MAAM,GAAG;IAC3D,cAAc,EAAE,OAAO,CAAC;IACxB,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB,CAmBA;AAED;;GAEG;AACH,wBAAgB,6BAA6B,CAAC,SAAS,EAAE,MAAM;IAE3D;;OAEG;;IAGH;;OAEG;wBACiB,MAAM,aAAa,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;IAQ9D;;OAEG;yBACkB,MAAM,aAAa,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,UAAU,MAAM;IAO/E;;OAEG;;wBAxDW,OAAO;kBACb,MAAM;;IA4Dd;;OAEG;;EAGN"}
|