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,171 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Empty Message Sanitizer Hook
|
|
3
|
+
*
|
|
4
|
+
* Sanitizes empty messages to prevent API errors.
|
|
5
|
+
* According to the Anthropic API spec, all messages must have non-empty content
|
|
6
|
+
* except for the optional final assistant message.
|
|
7
|
+
*
|
|
8
|
+
* This hook:
|
|
9
|
+
* 1. Detects messages with no valid content (empty text or no parts)
|
|
10
|
+
* 2. Injects placeholder text to prevent API errors
|
|
11
|
+
* 3. Marks injected content as synthetic
|
|
12
|
+
*
|
|
13
|
+
* NOTE: This sanitizer would ideally run on a message transform hook that executes
|
|
14
|
+
* AFTER all other message processing. In the shell hooks system, this should be
|
|
15
|
+
* invoked at the last stage before messages are sent to the API.
|
|
16
|
+
*
|
|
17
|
+
* Adapted from oh-my-opencode's empty-message-sanitizer hook.
|
|
18
|
+
*/
|
|
19
|
+
import * as fs from 'fs';
|
|
20
|
+
import * as path from 'path';
|
|
21
|
+
import { tmpdir } from 'os';
|
|
22
|
+
import { PLACEHOLDER_TEXT, TOOL_PART_TYPES, HOOK_NAME, DEBUG_PREFIX, } from './constants.js';
|
|
23
|
+
const DEBUG = process.env.EMPTY_MESSAGE_SANITIZER_DEBUG === '1';
|
|
24
|
+
const DEBUG_FILE = path.join(tmpdir(), 'empty-message-sanitizer-debug.log');
|
|
25
|
+
function debugLog(...args) {
|
|
26
|
+
if (DEBUG) {
|
|
27
|
+
const msg = `[${new Date().toISOString()}] ${DEBUG_PREFIX} ${args
|
|
28
|
+
.map((a) => (typeof a === 'object' ? JSON.stringify(a, null, 2) : String(a)))
|
|
29
|
+
.join(' ')}\n`;
|
|
30
|
+
fs.appendFileSync(DEBUG_FILE, msg);
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* Check if a part has non-empty text content
|
|
35
|
+
*/
|
|
36
|
+
export function hasTextContent(part) {
|
|
37
|
+
if (part.type === 'text') {
|
|
38
|
+
const text = part.text;
|
|
39
|
+
return Boolean(text && text.trim().length > 0);
|
|
40
|
+
}
|
|
41
|
+
return false;
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* Check if a part is a tool-related part
|
|
45
|
+
*/
|
|
46
|
+
export function isToolPart(part) {
|
|
47
|
+
return TOOL_PART_TYPES.has(part.type);
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* Check if message parts contain valid content
|
|
51
|
+
* Valid content = non-empty text OR tool parts
|
|
52
|
+
*/
|
|
53
|
+
export function hasValidContent(parts) {
|
|
54
|
+
return parts.some((part) => hasTextContent(part) || isToolPart(part));
|
|
55
|
+
}
|
|
56
|
+
/**
|
|
57
|
+
* Sanitize a single message to ensure it has valid content
|
|
58
|
+
*/
|
|
59
|
+
export function sanitizeMessage(message, isLastMessage, placeholderText = PLACEHOLDER_TEXT) {
|
|
60
|
+
const isAssistant = message.info.role === 'assistant';
|
|
61
|
+
// Skip final assistant message (allowed to be empty per API spec)
|
|
62
|
+
if (isLastMessage && isAssistant) {
|
|
63
|
+
debugLog('skipping final assistant message');
|
|
64
|
+
return false;
|
|
65
|
+
}
|
|
66
|
+
const parts = message.parts;
|
|
67
|
+
// FIX: Removed `&& parts.length > 0` - empty arrays also need sanitization
|
|
68
|
+
// When parts is [], the message has no content and would cause API error:
|
|
69
|
+
// "all messages must have non-empty content except for the optional final assistant message"
|
|
70
|
+
if (!hasValidContent(parts)) {
|
|
71
|
+
debugLog(`sanitizing message ${message.info.id}: no valid content`);
|
|
72
|
+
let injected = false;
|
|
73
|
+
// Try to find an existing empty text part and replace its content
|
|
74
|
+
for (const part of parts) {
|
|
75
|
+
if (part.type === 'text') {
|
|
76
|
+
if (!part.text || !part.text.trim()) {
|
|
77
|
+
part.text = placeholderText;
|
|
78
|
+
part.synthetic = true;
|
|
79
|
+
injected = true;
|
|
80
|
+
debugLog(`replaced empty text in existing part`);
|
|
81
|
+
break;
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
// If no text part was found, inject a new one
|
|
86
|
+
if (!injected) {
|
|
87
|
+
const insertIndex = parts.findIndex((p) => isToolPart(p));
|
|
88
|
+
const newPart = {
|
|
89
|
+
id: `synthetic_${Date.now()}`,
|
|
90
|
+
messageID: message.info.id,
|
|
91
|
+
sessionID: message.info.sessionID ?? '',
|
|
92
|
+
type: 'text',
|
|
93
|
+
text: placeholderText,
|
|
94
|
+
synthetic: true,
|
|
95
|
+
};
|
|
96
|
+
if (insertIndex === -1) {
|
|
97
|
+
// No tool parts, append to end
|
|
98
|
+
parts.push(newPart);
|
|
99
|
+
debugLog(`appended synthetic text part`);
|
|
100
|
+
}
|
|
101
|
+
else {
|
|
102
|
+
// Insert before first tool part
|
|
103
|
+
parts.splice(insertIndex, 0, newPart);
|
|
104
|
+
debugLog(`inserted synthetic text part before tool part`);
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
return true;
|
|
108
|
+
}
|
|
109
|
+
// Also sanitize any empty text parts that exist alongside valid content
|
|
110
|
+
let sanitized = false;
|
|
111
|
+
for (const part of parts) {
|
|
112
|
+
if (part.type === 'text') {
|
|
113
|
+
if (part.text !== undefined && part.text.trim() === '') {
|
|
114
|
+
part.text = placeholderText;
|
|
115
|
+
part.synthetic = true;
|
|
116
|
+
sanitized = true;
|
|
117
|
+
debugLog(`sanitized empty text part in message ${message.info.id}`);
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
return sanitized;
|
|
122
|
+
}
|
|
123
|
+
/**
|
|
124
|
+
* Sanitize all messages in the input
|
|
125
|
+
*/
|
|
126
|
+
export function sanitizeMessages(input, config) {
|
|
127
|
+
const { messages } = input;
|
|
128
|
+
const placeholderText = config?.placeholderText ?? PLACEHOLDER_TEXT;
|
|
129
|
+
debugLog('sanitizing messages', { count: messages.length });
|
|
130
|
+
let sanitizedCount = 0;
|
|
131
|
+
for (let i = 0; i < messages.length; i++) {
|
|
132
|
+
const message = messages[i];
|
|
133
|
+
const isLastMessage = i === messages.length - 1;
|
|
134
|
+
const wasSanitized = sanitizeMessage(message, isLastMessage, placeholderText);
|
|
135
|
+
if (wasSanitized) {
|
|
136
|
+
sanitizedCount++;
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
debugLog(`sanitized ${sanitizedCount} messages`);
|
|
140
|
+
return {
|
|
141
|
+
messages,
|
|
142
|
+
sanitizedCount,
|
|
143
|
+
modified: sanitizedCount > 0,
|
|
144
|
+
};
|
|
145
|
+
}
|
|
146
|
+
/**
|
|
147
|
+
* Create empty message sanitizer hook for Claude Code shell hooks
|
|
148
|
+
*
|
|
149
|
+
* This hook ensures all messages have valid content before being sent to the API.
|
|
150
|
+
* It should be called at the last stage of message processing.
|
|
151
|
+
*/
|
|
152
|
+
export function createEmptyMessageSanitizerHook(config) {
|
|
153
|
+
debugLog('createEmptyMessageSanitizerHook called', { config });
|
|
154
|
+
return {
|
|
155
|
+
/**
|
|
156
|
+
* Sanitize messages (called during message transform phase)
|
|
157
|
+
*/
|
|
158
|
+
sanitize: (input) => {
|
|
159
|
+
return sanitizeMessages(input, config);
|
|
160
|
+
},
|
|
161
|
+
/**
|
|
162
|
+
* Get hook name
|
|
163
|
+
*/
|
|
164
|
+
getName: () => {
|
|
165
|
+
return HOOK_NAME;
|
|
166
|
+
},
|
|
167
|
+
};
|
|
168
|
+
}
|
|
169
|
+
// Re-export constants
|
|
170
|
+
export { PLACEHOLDER_TEXT, TOOL_PART_TYPES, HOOK_NAME, DEBUG_PREFIX, ERROR_PATTERNS, } from './constants.js';
|
|
171
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/hooks/empty-message-sanitizer/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAEH,OAAO,KAAK,EAAE,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AAE;YACpB,OAAO,SAAS,CAAC;QACnB,CAAC;KACF,CAAC;AACJ,CAAC;AAYD,sBAAsB;AACtB,OAAO,EACL,gBAAgB,EAChB,eAAe,EACf,SAAS,EACT,YAAY,EACZ,cAAc,GACf,MAAM,gBAAgB,CAAC"}
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Empty Message Sanitizer Types
|
|
3
|
+
*
|
|
4
|
+
* Type definitions for the empty message sanitizer hook.
|
|
5
|
+
* This hook prevents API errors by ensuring all messages have valid content.
|
|
6
|
+
*
|
|
7
|
+
* Adapted from oh-my-opencode's empty-message-sanitizer hook.
|
|
8
|
+
*/
|
|
9
|
+
/**
|
|
10
|
+
* A message part in Claude Code's message format
|
|
11
|
+
*/
|
|
12
|
+
export interface MessagePart {
|
|
13
|
+
/** Unique identifier for this part */
|
|
14
|
+
id?: string;
|
|
15
|
+
/** Message ID this part belongs to */
|
|
16
|
+
messageID?: string;
|
|
17
|
+
/** Session ID this part belongs to */
|
|
18
|
+
sessionID?: string;
|
|
19
|
+
/** Part type (text, tool, tool_use, tool_result, etc.) */
|
|
20
|
+
type: string;
|
|
21
|
+
/** Text content (for text parts) */
|
|
22
|
+
text?: string;
|
|
23
|
+
/** Whether this is synthetically injected content */
|
|
24
|
+
synthetic?: boolean;
|
|
25
|
+
/** Additional properties */
|
|
26
|
+
[key: string]: unknown;
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* Message info metadata
|
|
30
|
+
*/
|
|
31
|
+
export interface MessageInfo {
|
|
32
|
+
/** Message identifier */
|
|
33
|
+
id: string;
|
|
34
|
+
/** Message role (user, assistant) */
|
|
35
|
+
role: 'user' | 'assistant';
|
|
36
|
+
/** Session ID */
|
|
37
|
+
sessionID?: string;
|
|
38
|
+
/** Additional properties */
|
|
39
|
+
[key: string]: unknown;
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* A message with its parts
|
|
43
|
+
*/
|
|
44
|
+
export interface MessageWithParts {
|
|
45
|
+
/** Message metadata */
|
|
46
|
+
info: MessageInfo;
|
|
47
|
+
/** Message content parts */
|
|
48
|
+
parts: MessagePart[];
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* Input for the empty message sanitizer hook
|
|
52
|
+
*/
|
|
53
|
+
export interface EmptyMessageSanitizerInput {
|
|
54
|
+
/** List of messages to sanitize */
|
|
55
|
+
messages: MessageWithParts[];
|
|
56
|
+
/** Session identifier */
|
|
57
|
+
sessionId?: string;
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* Output from the empty message sanitizer hook
|
|
61
|
+
*/
|
|
62
|
+
export interface EmptyMessageSanitizerOutput {
|
|
63
|
+
/** Sanitized messages */
|
|
64
|
+
messages: MessageWithParts[];
|
|
65
|
+
/** Number of messages sanitized */
|
|
66
|
+
sanitizedCount: number;
|
|
67
|
+
/** Whether any sanitization occurred */
|
|
68
|
+
modified: boolean;
|
|
69
|
+
}
|
|
70
|
+
/**
|
|
71
|
+
* Hook configuration
|
|
72
|
+
*/
|
|
73
|
+
export interface EmptyMessageSanitizerConfig {
|
|
74
|
+
/** Custom placeholder text (default: "[user interrupted]") */
|
|
75
|
+
placeholderText?: string;
|
|
76
|
+
/** Enable debug logging */
|
|
77
|
+
debug?: boolean;
|
|
78
|
+
}
|
|
79
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/hooks/empty-message-sanitizer/types.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH;;GAEG;AACH,MAAM,WAAW,WAAW;IAC1B,sCAAsC;IACtC,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,sCAAsC;IACtC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,sCAAsC;IACtC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,0DAA0D;IAC1D,IAAI,EAAE,MAAM,CAAC;IACb,oCAAoC;IACpC,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,qDAAqD;IACrD,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,4BAA4B;IAC5B,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;CACxB;AAED;;GAEG;AACH,MAAM,WAAW,WAAW;IAC1B,yBAAyB;IACzB,EAAE,EAAE,MAAM,CAAC;IACX,qCAAqC;IACrC,IAAI,EAAE,MAAM,GAAG,WAAW,CAAC;IAC3B,iBAAiB;IACjB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,4BAA4B;IAC5B,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;CACxB;AAED;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAC/B,uBAAuB;IACvB,IAAI,EAAE,WAAW,CAAC;IAClB,4BAA4B;IAC5B,KAAK,EAAE,WAAW,EAAE,CAAC;CACtB;AAED;;GAEG;AACH,MAAM,WAAW,0BAA0B;IACzC,mCAAmC;IACnC,QAAQ,EAAE,gBAAgB,EAAE,CAAC;IAC7B,yBAAyB;IACzB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED;;GAEG;AACH,MAAM,WAAW,2BAA2B;IAC1C,yBAAyB;IACzB,QAAQ,EAAE,gBAAgB,EAAE,CAAC;IAC7B,mCAAmC;IACnC,cAAc,EAAE,MAAM,CAAC;IACvB,wCAAwC;IACxC,QAAQ,EAAE,OAAO,CAAC;CACnB;AAED;;GAEG;AACH,MAAM,WAAW,2BAA2B;IAC1C,8DAA8D;IAC9D,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,2BAA2B;IAC3B,KAAK,CAAC,EAAE,OAAO,CAAC;CACjB"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Empty Message Sanitizer Types
|
|
3
|
+
*
|
|
4
|
+
* Type definitions for the empty message sanitizer hook.
|
|
5
|
+
* This hook prevents API errors by ensuring all messages have valid content.
|
|
6
|
+
*
|
|
7
|
+
* Adapted from oh-my-opencode's empty-message-sanitizer hook.
|
|
8
|
+
*/
|
|
9
|
+
export {};
|
|
10
|
+
//# sourceMappingURL=types.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/hooks/empty-message-sanitizer/types.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Hooks Module for Olympus
|
|
3
|
+
*
|
|
4
|
+
* This module provides the TypeScript bridge for Claude Code's native shell hook system.
|
|
5
|
+
* Shell scripts call these TypeScript functions for complex logic processing.
|
|
6
|
+
*
|
|
7
|
+
* Architecture:
|
|
8
|
+
* - Claude Code runs shell scripts on hook events (UserPromptSubmit, Stop, etc.)
|
|
9
|
+
* - Shell scripts invoke Node.js bridge for complex processing
|
|
10
|
+
* - Bridge returns JSON response that shell passes back to Claude Code
|
|
11
|
+
*/
|
|
12
|
+
export { detectKeywordsWithType, extractPromptText, removeCodeBlocks, type DetectedKeyword, type KeywordType } from './keyword-detector/index.js';
|
|
13
|
+
export { createAscentLoopHook, readAscentState, writeAscentState, clearAscentState, type AscentLoopState, type AscentLoopHook } from './the-ascent/index.js';
|
|
14
|
+
export { createTodoContinuationHook, checkIncompleteTodos, type TodoContinuationHook } from './todo-continuation/index.js';
|
|
15
|
+
export { processHook, type HookInput, type HookOutput } from './bridge.js';
|
|
16
|
+
export { createEditErrorRecoveryHook, detectEditError, injectEditErrorRecovery, processEditOutput, EDIT_ERROR_PATTERNS, EDIT_ERROR_REMINDER, type ToolExecuteInput, type ToolExecuteOutput } from './edit-error-recovery/index.js';
|
|
17
|
+
export { createThinkModeHook, detectThinkKeyword, detectUltrathinkKeyword, extractPromptText as extractThinkPromptText, removeCodeBlocks as removeThinkCodeBlocks, getHighVariant, isAlreadyHighVariant, getThinkingConfig, getClaudeThinkingConfig, clearThinkModeState, getThinkModeState, isThinkModeActive, processThinkMode, shouldActivateThinkMode, shouldActivateUltrathink, THINKING_CONFIGS, type ThinkModeState, type ModelRef, type MessageWithModel, type ThinkModeInput, type ClaudeThinkingConfig, type ThinkingConfig } from './think-mode/index.js';
|
|
18
|
+
export { createRulesInjectorHook, getRulesForPath, findProjectRoot, findRuleFiles, parseRuleFrontmatter, shouldApplyRule, createContentHash, isDuplicateByRealPath, isDuplicateByContentHash, loadInjectedRules, saveInjectedRules, clearInjectedRules, RULES_INJECTOR_STORAGE, PROJECT_MARKERS, PROJECT_RULE_SUBDIRS, PROJECT_RULE_FILES, USER_RULE_DIR, RULE_EXTENSIONS, TRACKED_TOOLS, type RuleMetadata, type RuleInfo, type RuleFileCandidate, type InjectedRulesData, type RuleToInject, type MatchResult, type RuleFrontmatterResult } from './rules-injector/index.js';
|
|
19
|
+
export { createOlympusOrchestratorHook, isAllowedPath, isWriteEditTool, getGitDiffStats, formatFileChanges, buildVerificationReminder, buildOrchestratorReminder, buildBoulderContinuation, checkBoulderContinuation, processOrchestratorPreTool, processOrchestratorPostTool, HOOK_NAME as OLYMPUS_ORCHESTRATOR_HOOK_NAME, ALLOWED_PATH_PREFIX, WRITE_EDIT_TOOLS, DIRECT_WORK_REMINDER, ORCHESTRATOR_DELEGATION_REQUIRED, BOULDER_CONTINUATION_PROMPT, VERIFICATION_REMINDER, SINGLE_TASK_DIRECTIVE, type ToolExecuteInput as OrchestratorToolInput, type ToolExecuteOutput as OrchestratorToolOutput } from './olympus-orchestrator/index.js';
|
|
20
|
+
export { createAutoSlashCommandHook, processSlashCommand, detectSlashCommand, extractPromptText as extractSlashPromptText, parseSlashCommand, removeCodeBlocks as removeSlashCodeBlocks, isExcludedCommand, executeSlashCommand, findCommand, discoverAllCommands, listAvailableCommands, HOOK_NAME as AUTO_SLASH_COMMAND_HOOK_NAME, AUTO_SLASH_COMMAND_TAG_OPEN, AUTO_SLASH_COMMAND_TAG_CLOSE, SLASH_COMMAND_PATTERN, EXCLUDED_COMMANDS, type AutoSlashCommandHookInput, type AutoSlashCommandHookOutput, type ParsedSlashCommand, type AutoSlashCommandResult, type CommandInfo, type CommandMetadata, type CommandScope, type ExecuteResult } from './auto-slash-command/index.js';
|
|
21
|
+
export { createCommentCheckerHook, checkForComments, applyFilters as applyCommentFilters, BDD_KEYWORDS, TYPE_CHECKER_PREFIXES, HOOK_MESSAGE_HEADER as COMMENT_CHECKER_MESSAGE_HEADER, LINE_COMMENT_PATTERNS, EXTENSION_TO_LANGUAGE, type CommentInfo, type CommentCheckResult, type PendingCall as CommentPendingCall, type CommentCheckerConfig } from './comment-checker/index.js';
|
|
22
|
+
export { createContextLimitRecoveryHook, detectContextLimitError, parseContextLimitError, parseTokenLimitError, containsTokenLimitError, TOKEN_LIMIT_PATTERNS, TOKEN_LIMIT_KEYWORDS, CONTEXT_LIMIT_RECOVERY_MESSAGE, CONTEXT_LIMIT_SHORT_MESSAGE, NON_EMPTY_CONTENT_RECOVERY_MESSAGE, TRUNCATION_APPLIED_MESSAGE, RECOVERY_FAILED_MESSAGE, RETRY_CONFIG, TRUNCATE_CONFIG, type ParsedTokenLimitError, type RetryState, type TruncateState, type RecoveryResult, type ContextLimitRecoveryConfig } from './context-window-limit-recovery/index.js';
|
|
23
|
+
export { createPreemptiveCompactionHook, estimateTokens, analyzeContextUsage, getSessionTokenEstimate, resetSessionTokenEstimate, DEFAULT_THRESHOLD as PREEMPTIVE_DEFAULT_THRESHOLD, CRITICAL_THRESHOLD, COMPACTION_COOLDOWN_MS, MAX_WARNINGS, CLAUDE_DEFAULT_CONTEXT_LIMIT, CHARS_PER_TOKEN, CONTEXT_WARNING_MESSAGE, CONTEXT_CRITICAL_MESSAGE, type ContextUsageResult, type PreemptiveCompactionConfig } from './preemptive-compaction/index.js';
|
|
24
|
+
export { createBackgroundNotificationHook, processBackgroundNotification, processBackgroundNotificationHook, checkBackgroundNotifications, handleBackgroundEvent, HOOK_NAME as BACKGROUND_NOTIFICATION_HOOK_NAME, type BackgroundNotificationHookConfig, type BackgroundNotificationHookInput, type BackgroundNotificationHookOutput, type NotificationCheckResult } from './background-notification/index.js';
|
|
25
|
+
export { createDirectoryReadmeInjectorHook, getReadmesForPath, loadInjectedPaths, saveInjectedPaths, clearInjectedPaths, README_INJECTOR_STORAGE, README_FILENAME, TRACKED_TOOLS as README_TRACKED_TOOLS, type InjectedPathsData } from './directory-readme-injector/index.js';
|
|
26
|
+
export { createEmptyMessageSanitizerHook, sanitizeMessages, sanitizeMessage, hasTextContent, isToolPart, hasValidContent, PLACEHOLDER_TEXT, TOOL_PART_TYPES, HOOK_NAME as EMPTY_MESSAGE_SANITIZER_HOOK_NAME, DEBUG_PREFIX as EMPTY_MESSAGE_SANITIZER_DEBUG_PREFIX, ERROR_PATTERNS as EMPTY_MESSAGE_SANITIZER_ERROR_PATTERNS, type MessagePart, type MessageInfo, type MessageWithParts, type EmptyMessageSanitizerInput, type EmptyMessageSanitizerOutput, type EmptyMessageSanitizerConfig } from './empty-message-sanitizer/index.js';
|
|
27
|
+
export { createThinkingBlockValidatorHook, isExtendedThinkingModel, hasContentParts, startsWithThinkingBlock, findPreviousThinkingContent, prependThinkingBlock, validateMessage, validateMessages, getValidationStats, HOOK_NAME as THINKING_BLOCK_VALIDATOR_HOOK_NAME, CONTENT_PART_TYPES, THINKING_PART_TYPES, THINKING_MODEL_PATTERNS, DEFAULT_THINKING_CONTENT, SYNTHETIC_THINKING_ID_PREFIX, PREVENTED_ERROR, type MessagePart as ThinkingValidatorMessagePart, type MessageInfo as ThinkingValidatorMessageInfo, type MessageWithParts as ThinkingValidatorMessageWithParts, type MessagesTransformInput, type MessagesTransformOutput, type MessagesTransformHook, type ValidationResult } from './thinking-block-validator/index.js';
|
|
28
|
+
export { nonInteractiveEnvHook, isNonInteractive, HOOK_NAME as NON_INTERACTIVE_ENV_HOOK_NAME, NON_INTERACTIVE_ENV, SHELL_COMMAND_PATTERNS, type NonInteractiveEnvConfig, type ShellHook } from './non-interactive-env/index.js';
|
|
29
|
+
export { createSessionRecoveryHook, handleSessionRecovery, detectErrorType, isRecoverableError, findEmptyMessages as findRecoveryEmptyMessages, findMessagesWithThinkingBlocks as findRecoveryThinkingBlocks, findMessagesWithOrphanThinking as findRecoveryOrphanThinking, readMessages as readRecoveryMessages, readParts as readRecoveryParts, RECOVERY_MESSAGES, PLACEHOLDER_TEXT as RECOVERY_PLACEHOLDER_TEXT, type MessageData, type RecoveryErrorType, type RecoveryResult as SessionRecoveryResult, type SessionRecoveryConfig, type StoredMessageMeta, type StoredPart, type StoredTextPart, type StoredToolPart } from './session-recovery/index.js';
|
|
30
|
+
export { createAgentUsageReminderHook, loadAgentUsageState, saveAgentUsageState, clearAgentUsageState, TARGET_TOOLS, AGENT_TOOLS, REMINDER_MESSAGE, type AgentUsageState } from './agent-usage-reminder/index.js';
|
|
31
|
+
export { activateUltrawork, deactivateUltrawork, readUltraworkState, writeUltraworkState, incrementReinforcement, shouldReinforceUltrawork, getUltraworkPersistenceMessage, createUltraworkStateHook, type UltraworkState } from './ultrawork-state/index.js';
|
|
32
|
+
export { checkPersistentModes, createHookOutput, type PersistentModeResult } from './persistent-mode/index.js';
|
|
33
|
+
export { getFormatter, isFormatterAvailable, formatFile, getLinter, lintFile, validateCommitMessage, runTypeCheck, runTests, runPreCommitChecks, getPreCommitReminderMessage, getAutoFormatMessage, type FormatConfig, type LintConfig, type CommitConfig, type PreCommitResult } from './plugin-patterns/index.js';
|
|
34
|
+
export { readVerificationState, writeVerificationState, clearVerificationState, startVerification, recordOracleFeedback, getOracleVerificationPrompt, getOracleRejectionContinuationPrompt, detectOracleApproval, detectOracleRejection, type VerificationState } from './ascent-verifier/index.js';
|
|
35
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/hooks/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,EAEL,sBAAsB,EACtB,iBAAiB,EACjB,gBAAgB,E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,OAAO,EAEL,4BAA4B,EAC5B,mBAAmB,EACnB,mBAAmB,EACnB,oBAAoB,EACpB,YAAY,EACZ,WAAW,EACX,gBAAgB,EAChB,KAAK,eAAe,EACrB,MAAM,iCAAiC,CAAC;AAEzC,OAAO,EAEL,iBAAiB,EACjB,mBAAmB,EACnB,kBAAkB,EAClB,mBAAmB,EACnB,sBAAsB,EACtB,wBAAwB,EACxB,8BAA8B,EAC9B,wBAAwB,EACxB,KAAK,cAAc,EACpB,MAAM,4BAA4B,CAAC;AAEpC,OAAO,EAEL,oBAAoB,EACpB,gBAAgB,EAChB,KAAK,oBAAoB,EAC1B,MAAM,4BAA4B,CAAC;AAEpC,OAAO,EAEL,YAAY,EACZ,oBAAoB,EACpB,UAAU,EACV,SAAS,EACT,QAAQ,EACR,qBAAqB,EACrB,YAAY,EACZ,QAAQ,EACR,kBAAkB,EAClB,2BAA2B,EAC3B,oBAAoB,EACpB,KAAK,YAAY,EACjB,KAAK,UAAU,EACf,KAAK,YAAY,EACjB,KAAK,eAAe,EACrB,MAAM,4BAA4B,CAAC;AAEpC,OAAO,EAEL,qBAAqB,EACrB,sBAAsB,EACtB,sBAAsB,EACtB,iBAAiB,EACjB,oBAAoB,EACpB,2BAA2B,EAC3B,oCAAoC,EACpC,oBAAoB,EACpB,qBAAqB,EACrB,KAAK,iBAAiB,EACvB,MAAM,4BAA4B,CAAC"}
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Hooks Module for Olympus
|
|
3
|
+
*
|
|
4
|
+
* This module provides the TypeScript bridge for Claude Code's native shell hook system.
|
|
5
|
+
* Shell scripts call these TypeScript functions for complex logic processing.
|
|
6
|
+
*
|
|
7
|
+
* Architecture:
|
|
8
|
+
* - Claude Code runs shell scripts on hook events (UserPromptSubmit, Stop, etc.)
|
|
9
|
+
* - Shell scripts invoke Node.js bridge for complex processing
|
|
10
|
+
* - Bridge returns JSON response that shell passes back to Claude Code
|
|
11
|
+
*/
|
|
12
|
+
export {
|
|
13
|
+
// Keyword detection
|
|
14
|
+
detectKeywordsWithType, extractPromptText, removeCodeBlocks } from './keyword-detector/index.js';
|
|
15
|
+
export {
|
|
16
|
+
// The Ascent (persistence)
|
|
17
|
+
createAscentLoopHook, readAscentState, writeAscentState, clearAscentState } from './the-ascent/index.js';
|
|
18
|
+
export {
|
|
19
|
+
// Todo Continuation
|
|
20
|
+
createTodoContinuationHook, checkIncompleteTodos } from './todo-continuation/index.js';
|
|
21
|
+
export {
|
|
22
|
+
// Hook Bridge (main entry point for shell scripts)
|
|
23
|
+
processHook } from './bridge.js';
|
|
24
|
+
export {
|
|
25
|
+
// Edit Error Recovery
|
|
26
|
+
createEditErrorRecoveryHook, detectEditError, injectEditErrorRecovery, processEditOutput, EDIT_ERROR_PATTERNS, EDIT_ERROR_REMINDER } from './edit-error-recovery/index.js';
|
|
27
|
+
export {
|
|
28
|
+
// Think Mode
|
|
29
|
+
createThinkModeHook, detectThinkKeyword, detectUltrathinkKeyword, extractPromptText as extractThinkPromptText, removeCodeBlocks as removeThinkCodeBlocks, getHighVariant, isAlreadyHighVariant, getThinkingConfig, getClaudeThinkingConfig, clearThinkModeState, getThinkModeState, isThinkModeActive, processThinkMode, shouldActivateThinkMode, shouldActivateUltrathink, THINKING_CONFIGS } from './think-mode/index.js';
|
|
30
|
+
export {
|
|
31
|
+
// Rules Injector
|
|
32
|
+
createRulesInjectorHook, getRulesForPath, findProjectRoot, findRuleFiles, parseRuleFrontmatter, shouldApplyRule, createContentHash, isDuplicateByRealPath, isDuplicateByContentHash, loadInjectedRules, saveInjectedRules, clearInjectedRules, RULES_INJECTOR_STORAGE, PROJECT_MARKERS, PROJECT_RULE_SUBDIRS, PROJECT_RULE_FILES, USER_RULE_DIR, RULE_EXTENSIONS, TRACKED_TOOLS } from './rules-injector/index.js';
|
|
33
|
+
export {
|
|
34
|
+
// Olympus Orchestrator
|
|
35
|
+
createOlympusOrchestratorHook, isAllowedPath, isWriteEditTool, getGitDiffStats, formatFileChanges, buildVerificationReminder, buildOrchestratorReminder, buildBoulderContinuation, checkBoulderContinuation, processOrchestratorPreTool, processOrchestratorPostTool, HOOK_NAME as OLYMPUS_ORCHESTRATOR_HOOK_NAME, ALLOWED_PATH_PREFIX, WRITE_EDIT_TOOLS, DIRECT_WORK_REMINDER, ORCHESTRATOR_DELEGATION_REQUIRED, BOULDER_CONTINUATION_PROMPT, VERIFICATION_REMINDER, SINGLE_TASK_DIRECTIVE } from './olympus-orchestrator/index.js';
|
|
36
|
+
export {
|
|
37
|
+
// Auto Slash Command
|
|
38
|
+
createAutoSlashCommandHook, processSlashCommand, detectSlashCommand, extractPromptText as extractSlashPromptText, parseSlashCommand, removeCodeBlocks as removeSlashCodeBlocks, isExcludedCommand, executeSlashCommand, findCommand, discoverAllCommands, listAvailableCommands, HOOK_NAME as AUTO_SLASH_COMMAND_HOOK_NAME, AUTO_SLASH_COMMAND_TAG_OPEN, AUTO_SLASH_COMMAND_TAG_CLOSE, SLASH_COMMAND_PATTERN, EXCLUDED_COMMANDS } from './auto-slash-command/index.js';
|
|
39
|
+
export {
|
|
40
|
+
// Comment Checker
|
|
41
|
+
createCommentCheckerHook, checkForComments, applyFilters as applyCommentFilters, BDD_KEYWORDS, TYPE_CHECKER_PREFIXES, HOOK_MESSAGE_HEADER as COMMENT_CHECKER_MESSAGE_HEADER, LINE_COMMENT_PATTERNS, EXTENSION_TO_LANGUAGE } from './comment-checker/index.js';
|
|
42
|
+
export {
|
|
43
|
+
// Context Window Limit Recovery
|
|
44
|
+
createContextLimitRecoveryHook, detectContextLimitError, parseContextLimitError, parseTokenLimitError, containsTokenLimitError, TOKEN_LIMIT_PATTERNS, TOKEN_LIMIT_KEYWORDS, CONTEXT_LIMIT_RECOVERY_MESSAGE, CONTEXT_LIMIT_SHORT_MESSAGE, NON_EMPTY_CONTENT_RECOVERY_MESSAGE, TRUNCATION_APPLIED_MESSAGE, RECOVERY_FAILED_MESSAGE, RETRY_CONFIG, TRUNCATE_CONFIG } from './context-window-limit-recovery/index.js';
|
|
45
|
+
export {
|
|
46
|
+
// Preemptive Compaction
|
|
47
|
+
createPreemptiveCompactionHook, estimateTokens, analyzeContextUsage, getSessionTokenEstimate, resetSessionTokenEstimate, DEFAULT_THRESHOLD as PREEMPTIVE_DEFAULT_THRESHOLD, CRITICAL_THRESHOLD, COMPACTION_COOLDOWN_MS, MAX_WARNINGS, CLAUDE_DEFAULT_CONTEXT_LIMIT, CHARS_PER_TOKEN, CONTEXT_WARNING_MESSAGE, CONTEXT_CRITICAL_MESSAGE } from './preemptive-compaction/index.js';
|
|
48
|
+
export {
|
|
49
|
+
// Background Notification
|
|
50
|
+
createBackgroundNotificationHook, processBackgroundNotification, processBackgroundNotificationHook, checkBackgroundNotifications, handleBackgroundEvent, HOOK_NAME as BACKGROUND_NOTIFICATION_HOOK_NAME } from './background-notification/index.js';
|
|
51
|
+
export {
|
|
52
|
+
// Directory README Injector
|
|
53
|
+
createDirectoryReadmeInjectorHook, getReadmesForPath, loadInjectedPaths, saveInjectedPaths, clearInjectedPaths, README_INJECTOR_STORAGE, README_FILENAME, TRACKED_TOOLS as README_TRACKED_TOOLS } from './directory-readme-injector/index.js';
|
|
54
|
+
export {
|
|
55
|
+
// Empty Message Sanitizer
|
|
56
|
+
createEmptyMessageSanitizerHook, sanitizeMessages, sanitizeMessage, hasTextContent, isToolPart, hasValidContent, PLACEHOLDER_TEXT, TOOL_PART_TYPES, HOOK_NAME as EMPTY_MESSAGE_SANITIZER_HOOK_NAME, DEBUG_PREFIX as EMPTY_MESSAGE_SANITIZER_DEBUG_PREFIX, ERROR_PATTERNS as EMPTY_MESSAGE_SANITIZER_ERROR_PATTERNS } from './empty-message-sanitizer/index.js';
|
|
57
|
+
export {
|
|
58
|
+
// Thinking Block Validator
|
|
59
|
+
createThinkingBlockValidatorHook, isExtendedThinkingModel, hasContentParts, startsWithThinkingBlock, findPreviousThinkingContent, prependThinkingBlock, validateMessage, validateMessages, getValidationStats, HOOK_NAME as THINKING_BLOCK_VALIDATOR_HOOK_NAME, CONTENT_PART_TYPES, THINKING_PART_TYPES, THINKING_MODEL_PATTERNS, DEFAULT_THINKING_CONTENT, SYNTHETIC_THINKING_ID_PREFIX, PREVENTED_ERROR } from './thinking-block-validator/index.js';
|
|
60
|
+
export {
|
|
61
|
+
// Non-Interactive Environment
|
|
62
|
+
nonInteractiveEnvHook, isNonInteractive, HOOK_NAME as NON_INTERACTIVE_ENV_HOOK_NAME, NON_INTERACTIVE_ENV, SHELL_COMMAND_PATTERNS } from './non-interactive-env/index.js';
|
|
63
|
+
export {
|
|
64
|
+
// Session Recovery
|
|
65
|
+
createSessionRecoveryHook, handleSessionRecovery, detectErrorType, isRecoverableError, findEmptyMessages as findRecoveryEmptyMessages, findMessagesWithThinkingBlocks as findRecoveryThinkingBlocks, findMessagesWithOrphanThinking as findRecoveryOrphanThinking, readMessages as readRecoveryMessages, readParts as readRecoveryParts, RECOVERY_MESSAGES, PLACEHOLDER_TEXT as RECOVERY_PLACEHOLDER_TEXT } from './session-recovery/index.js';
|
|
66
|
+
export {
|
|
67
|
+
// Agent Usage Reminder
|
|
68
|
+
createAgentUsageReminderHook, loadAgentUsageState, saveAgentUsageState, clearAgentUsageState, TARGET_TOOLS, AGENT_TOOLS, REMINDER_MESSAGE } from './agent-usage-reminder/index.js';
|
|
69
|
+
export {
|
|
70
|
+
// Ultrawork State (Persistent Mode)
|
|
71
|
+
activateUltrawork, deactivateUltrawork, readUltraworkState, writeUltraworkState, incrementReinforcement, shouldReinforceUltrawork, getUltraworkPersistenceMessage, createUltraworkStateHook } from './ultrawork-state/index.js';
|
|
72
|
+
export {
|
|
73
|
+
// Persistent Mode (Unified Stop Handler)
|
|
74
|
+
checkPersistentModes, createHookOutput } from './persistent-mode/index.js';
|
|
75
|
+
export {
|
|
76
|
+
// Plugin Patterns (Popular Community Patterns)
|
|
77
|
+
getFormatter, isFormatterAvailable, formatFile, getLinter, lintFile, validateCommitMessage, runTypeCheck, runTests, runPreCommitChecks, getPreCommitReminderMessage, getAutoFormatMessage } from './plugin-patterns/index.js';
|
|
78
|
+
export {
|
|
79
|
+
// Ascent Verifier (Oracle-verified completion)
|
|
80
|
+
readVerificationState, writeVerificationState, clearVerificationState, startVerification, recordOracleFeedback, getOracleVerificationPrompt, getOracleRejectionContinuationPrompt, detectOracleApproval, detectOracleRejection } from './ascent-verifier/index.js';
|
|
81
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/hooks/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO;AACL,oBAAoB;AACpB,sBAAsB,EACtB,iBAAiB,EACjB,gBAAgB,EAGjB,MAAM,6BAA6B,CAAC;AAErC,OAAO;AACL,2BAA2B;AAC3B,oBAAoB,EACpB,eAAe,EACf,gBAAgB,EAChB,gBAAgB,EAGjB,MAAM,uBAAuB,CAAC;AAE/B,OAAO;AACL,oBAAoB;AACpB,0BAA0B,EAC1B,oBAAoB,EAErB,MAAM,8BAA8B,CAAC;AAEtC,OAAO;AACL,mDAAmD;AACnD,WAAW,EAGZ,MAAM,aAAa,CAAC;AAErB,OAAO;AACL,sBAAsB;AACtB,2BAA2B,EAC3B,eAAe,EACf,uBAAuB,EACvB,iBAAiB,EACjB,mBAAmB,EACnB,mBAAmB,EAGpB,MAAM,gCAAgC,CAAC;AAExC,OAAO;AACL,aAAa;AACb,mBAAmB,EACnB,kBAAkB,EAClB,uBAAuB,EACvB,iBAAiB,IAAI,sBAAsB,EAC3C,gBAAgB,IAAI,qBAAqB,EACzC,cAAc,EACd,oBAAoB,EACpB,iBAAiB,EACjB,uBAAuB,EACvB,mBAAmB,EACnB,iBAAiB,EACjB,iBAAiB,EACjB,gBAAgB,EAChB,uBAAuB,EACvB,wBAAwB,EACxB,gBAAgB,EAOjB,MAAM,uBAAuB,CAAC;AAE/B,OAAO;AACL,iBAAiB;AACjB,uBAAuB,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B,CAAC"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Keyword Detector Hook
|
|
3
|
+
*
|
|
4
|
+
* Detects magic keywords in user prompts and returns the appropriate
|
|
5
|
+
* mode message to inject into context.
|
|
6
|
+
*
|
|
7
|
+
* Ported from oh-my-opencode's keyword-detector hook.
|
|
8
|
+
*/
|
|
9
|
+
export type KeywordType = 'ultrawork' | 'ultrathink' | 'search' | 'analyze';
|
|
10
|
+
export interface DetectedKeyword {
|
|
11
|
+
type: KeywordType;
|
|
12
|
+
keyword: string;
|
|
13
|
+
position: number;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Remove code blocks from text to prevent false positives
|
|
17
|
+
* Handles both fenced code blocks and inline code
|
|
18
|
+
*/
|
|
19
|
+
export declare function removeCodeBlocks(text: string): string;
|
|
20
|
+
/**
|
|
21
|
+
* Extract prompt text from message parts
|
|
22
|
+
*/
|
|
23
|
+
export declare function extractPromptText(parts: Array<{
|
|
24
|
+
type: string;
|
|
25
|
+
text?: string;
|
|
26
|
+
[key: string]: unknown;
|
|
27
|
+
}>): string;
|
|
28
|
+
/**
|
|
29
|
+
* Detect keywords in text and return matches with type info
|
|
30
|
+
*/
|
|
31
|
+
export declare function detectKeywordsWithType(text: string, _agentName?: string): DetectedKeyword[];
|
|
32
|
+
/**
|
|
33
|
+
* Check if text contains any magic keyword
|
|
34
|
+
*/
|
|
35
|
+
export declare function hasKeyword(text: string): boolean;
|
|
36
|
+
/**
|
|
37
|
+
* Get the highest priority keyword detected
|
|
38
|
+
*/
|
|
39
|
+
export declare function getPrimaryKeyword(text: string): DetectedKeyword | null;
|
|
40
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/hooks/keyword-detector/index.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,MAAM,MAAM,WAAW,GAAG,WAAW,GAAG,YAAY,GAAG,QAAQ,GAAG,SAAS,CAAC;AAE5E,MAAM,WAAW,eAAe;IAC9B,IAAI,EAAE,WAAW,CAAC;IAClB,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE,MAAM,CAAC;CAClB;AAkBD;;;GAGG;AACH,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CASrD;AAED;;GAEG;AACH,wBAAgB,iBAAiB,CAC/B,KAAK,EAAE,KAAK,CAAC;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,IAAI,CAAC,EAAE,MAAM,CAAC;IAAC,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAA;CAAE,CAAC,GACpE,MAAM,CAKR;AAED;;GAEG;AACH,wBAAgB,sBAAsB,CACpC,IAAI,EAAE,MAAM,EACZ,UAAU,CAAC,EAAE,MAAM,GAClB,eAAe,EAAE,CAkBnB;AAED;;GAEG;AACH,wBAAgB,UAAU,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAGhD;AAED;;GAEG;AACH,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,MAAM,GAAG,eAAe,GAAG,IAAI,CAiBtE"}
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Keyword Detector Hook
|
|
3
|
+
*
|
|
4
|
+
* Detects magic keywords in user prompts and returns the appropriate
|
|
5
|
+
* mode message to inject into context.
|
|
6
|
+
*
|
|
7
|
+
* Ported from oh-my-opencode's keyword-detector hook.
|
|
8
|
+
*/
|
|
9
|
+
/**
|
|
10
|
+
* Keyword patterns for each mode
|
|
11
|
+
*/
|
|
12
|
+
const KEYWORD_PATTERNS = {
|
|
13
|
+
ultrawork: /\b(ultrawork|ulw)\b/i,
|
|
14
|
+
ultrathink: /\b(ultrathink|think)\b/i,
|
|
15
|
+
search: /\b(search|find|locate|lookup|explore|discover|scan|grep|query|browse|detect|trace|seek|track|pinpoint|hunt)\b|where\s+is|show\s+me|list\s+all/i,
|
|
16
|
+
analyze: /\b(analyze|analyse|investigate|examine|research|study|deep.?dive|inspect|audit|evaluate|assess|review|diagnose|scrutinize|dissect|debug|comprehend|interpret|breakdown|understand)\b|why\s+is|how\s+does|how\s+to/i
|
|
17
|
+
};
|
|
18
|
+
/**
|
|
19
|
+
* Priority order for keyword detection
|
|
20
|
+
* Higher priority keywords take precedence
|
|
21
|
+
*/
|
|
22
|
+
const KEYWORD_PRIORITY = ['ultrawork', 'ultrathink', 'search', 'analyze'];
|
|
23
|
+
/**
|
|
24
|
+
* Remove code blocks from text to prevent false positives
|
|
25
|
+
* Handles both fenced code blocks and inline code
|
|
26
|
+
*/
|
|
27
|
+
export function removeCodeBlocks(text) {
|
|
28
|
+
// Remove fenced code blocks (``` or ~~~)
|
|
29
|
+
let result = text.replace(/```[\s\S]*?```/g, '');
|
|
30
|
+
result = result.replace(/~~~[\s\S]*?~~~/g, '');
|
|
31
|
+
// Remove inline code (single backticks)
|
|
32
|
+
result = result.replace(/`[^`]+`/g, '');
|
|
33
|
+
return result;
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* Extract prompt text from message parts
|
|
37
|
+
*/
|
|
38
|
+
export function extractPromptText(parts) {
|
|
39
|
+
return parts
|
|
40
|
+
.filter(p => p.type === 'text' && p.text)
|
|
41
|
+
.map(p => p.text)
|
|
42
|
+
.join(' ');
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* Detect keywords in text and return matches with type info
|
|
46
|
+
*/
|
|
47
|
+
export function detectKeywordsWithType(text, _agentName) {
|
|
48
|
+
const detected = [];
|
|
49
|
+
// Check each keyword type
|
|
50
|
+
for (const type of KEYWORD_PRIORITY) {
|
|
51
|
+
const pattern = KEYWORD_PATTERNS[type];
|
|
52
|
+
const match = text.match(pattern);
|
|
53
|
+
if (match && match.index !== undefined) {
|
|
54
|
+
detected.push({
|
|
55
|
+
type,
|
|
56
|
+
keyword: match[0],
|
|
57
|
+
position: match.index
|
|
58
|
+
});
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
return detected;
|
|
62
|
+
}
|
|
63
|
+
/**
|
|
64
|
+
* Check if text contains any magic keyword
|
|
65
|
+
*/
|
|
66
|
+
export function hasKeyword(text) {
|
|
67
|
+
const cleanText = removeCodeBlocks(text);
|
|
68
|
+
return detectKeywordsWithType(cleanText).length > 0;
|
|
69
|
+
}
|
|
70
|
+
/**
|
|
71
|
+
* Get the highest priority keyword detected
|
|
72
|
+
*/
|
|
73
|
+
export function getPrimaryKeyword(text) {
|
|
74
|
+
const cleanText = removeCodeBlocks(text);
|
|
75
|
+
const detected = detectKeywordsWithType(cleanText);
|
|
76
|
+
if (detected.length === 0) {
|
|
77
|
+
return null;
|
|
78
|
+
}
|
|
79
|
+
// Return highest priority (first in KEYWORD_PRIORITY order)
|
|
80
|
+
for (const type of KEYWORD_PRIORITY) {
|
|
81
|
+
const match = detected.find(d => d.type === type);
|
|
82
|
+
if (match) {
|
|
83
|
+
return match;
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
return detected[0];
|
|
87
|
+
}
|
|
88
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/hooks/keyword-detector/index.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAUH;;GAEG;AACH,MAAM,gBAAgB,GAAgC;IACpD,SAAS,EAAE,sBAAsB;IACjC,UAAU,EAAE,yBAAyB;IACrC,MAAM,EAAE,gJAAgJ;IACxJ,OAAO,EAAE,oNAAoN;CAC9N,CAAC;AAEF;;;GAGG;AACH,MAAM,gBAAgB,GAAkB,CAAC,WAAW,EAAE,YAAY,EAAE,QAAQ,EAAE,SAAS,CAAC,CAAC;AAEzF;;;GAGG;AACH,MAAM,UAAU,gBAAgB,CAAC,IAAY;IAC3C,yCAAyC;IACzC,IAAI,MAAM,GAAG,IAAI,CAAC,OAAO,CAAC,iBAAiB,EAAE,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;AACtD,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,iBAAiB,CAAC,IAAY;IAC5C,MAAM,SAAS,GAAG,gBAAgB,CAAC,IAAI,CAAC,CAAC;IACzC,MAAM,QAAQ,GAAG,sBAAsB,CAAC,SAAS,CAAC,CAAC;IAEnD,IAAI,QAAQ,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QAC1B,OAAO,IAAI,CAAC;IACd,CAAC;IAED,4DAA4D;IAC5D,KAAK,MAAM,IAAI,IAAI,gBAAgB,EAAE,CAAC;QACpC,MAAM,KAAK,GAAG,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,KAAK,IAAI,CAAC,CAAC;QAClD,IAAI,KAAK,EAAE,CAAC;YACV,OAAO,KAAK,CAAC;QACf,CAAC;IACH,CAAC;IAED,OAAO,QAAQ,CAAC,CAAC,CAAC,CAAC;AACrB,CAAC"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
export declare const HOOK_NAME = "non-interactive-env";
|
|
2
|
+
export declare const NON_INTERACTIVE_ENV: Record<string, string>;
|
|
3
|
+
/**
|
|
4
|
+
* Shell command guidance for non-interactive environments.
|
|
5
|
+
* These patterns should be followed to avoid hanging on user input.
|
|
6
|
+
*/
|
|
7
|
+
export declare const SHELL_COMMAND_PATTERNS: {
|
|
8
|
+
readonly npm: {
|
|
9
|
+
readonly bad: readonly ["npm init", "npm install (prompts)"];
|
|
10
|
+
readonly good: readonly ["npm init -y", "npm install --yes"];
|
|
11
|
+
};
|
|
12
|
+
readonly apt: {
|
|
13
|
+
readonly bad: readonly ["apt-get install pkg"];
|
|
14
|
+
readonly good: readonly ["apt-get install -y pkg", "DEBIAN_FRONTEND=noninteractive apt-get install pkg"];
|
|
15
|
+
};
|
|
16
|
+
readonly pip: {
|
|
17
|
+
readonly bad: readonly ["pip install pkg (with prompts)"];
|
|
18
|
+
readonly good: readonly ["pip install --no-input pkg", "PIP_NO_INPUT=1 pip install pkg"];
|
|
19
|
+
};
|
|
20
|
+
readonly git: {
|
|
21
|
+
readonly bad: readonly ["git commit", "git merge branch", "git add -p", "git rebase -i"];
|
|
22
|
+
readonly good: readonly ["git commit -m 'msg'", "git merge --no-edit branch", "git add .", "git rebase --no-edit"];
|
|
23
|
+
};
|
|
24
|
+
readonly system: {
|
|
25
|
+
readonly bad: readonly ["rm file (prompts)", "cp a b (prompts)", "ssh host"];
|
|
26
|
+
readonly good: readonly ["rm -f file", "cp -f a b", "ssh -o BatchMode=yes host", "unzip -o file.zip"];
|
|
27
|
+
};
|
|
28
|
+
readonly banned: readonly ["vim", "nano", "vi", "emacs", "less", "more", "man", "python (REPL)", "node (REPL)", "git add -p", "git rebase -i"];
|
|
29
|
+
readonly workarounds: {
|
|
30
|
+
readonly yesPipe: "yes | ./script.sh";
|
|
31
|
+
readonly heredoc: "./script.sh <<EOF\noption1\noption2\nEOF";
|
|
32
|
+
readonly expectAlternative: "Use environment variables or config files instead of expect";
|
|
33
|
+
};
|
|
34
|
+
};
|
|
35
|
+
//# sourceMappingURL=constants.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../src/hooks/non-interactive-env/constants.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,SAAS,wBAAwB,CAAA;AAE9C,eAAO,MAAM,mBAAmB,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAqBtD,CAAA;AAED;;;GAGG;AACH,eAAO,MAAM,sBAAsB;;;;;;;;;;;;;;;;;;;;;;;;;;;CAwCzB,CAAA"}
|