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,73 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Auto Slash Command Detector
|
|
3
|
+
*
|
|
4
|
+
* Detects slash commands in user prompts.
|
|
5
|
+
*
|
|
6
|
+
* Adapted from oh-my-opencode's auto-slash-command hook.
|
|
7
|
+
*/
|
|
8
|
+
import { SLASH_COMMAND_PATTERN, EXCLUDED_COMMANDS, } from './constants.js';
|
|
9
|
+
/** Pattern to match code blocks */
|
|
10
|
+
const CODE_BLOCK_PATTERN = /```[\s\S]*?```/g;
|
|
11
|
+
/**
|
|
12
|
+
* Remove code blocks from text to prevent false positives
|
|
13
|
+
*/
|
|
14
|
+
export function removeCodeBlocks(text) {
|
|
15
|
+
return text.replace(CODE_BLOCK_PATTERN, '');
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Parse a slash command from text
|
|
19
|
+
*/
|
|
20
|
+
export function parseSlashCommand(text) {
|
|
21
|
+
const trimmed = text.trim();
|
|
22
|
+
if (!trimmed.startsWith('/')) {
|
|
23
|
+
return null;
|
|
24
|
+
}
|
|
25
|
+
const match = trimmed.match(SLASH_COMMAND_PATTERN);
|
|
26
|
+
if (!match) {
|
|
27
|
+
return null;
|
|
28
|
+
}
|
|
29
|
+
const [raw, command, args] = match;
|
|
30
|
+
return {
|
|
31
|
+
command: command.toLowerCase(),
|
|
32
|
+
args: args.trim(),
|
|
33
|
+
raw,
|
|
34
|
+
};
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* Check if a command should be excluded from auto-expansion
|
|
38
|
+
*/
|
|
39
|
+
export function isExcludedCommand(command) {
|
|
40
|
+
return EXCLUDED_COMMANDS.has(command.toLowerCase());
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* Detect a slash command in user input text
|
|
44
|
+
* Returns null if no command detected or if command is excluded
|
|
45
|
+
*/
|
|
46
|
+
export function detectSlashCommand(text) {
|
|
47
|
+
// Remove code blocks first
|
|
48
|
+
const textWithoutCodeBlocks = removeCodeBlocks(text);
|
|
49
|
+
const trimmed = textWithoutCodeBlocks.trim();
|
|
50
|
+
// Must start with slash
|
|
51
|
+
if (!trimmed.startsWith('/')) {
|
|
52
|
+
return null;
|
|
53
|
+
}
|
|
54
|
+
const parsed = parseSlashCommand(trimmed);
|
|
55
|
+
if (!parsed) {
|
|
56
|
+
return null;
|
|
57
|
+
}
|
|
58
|
+
// Check exclusion list
|
|
59
|
+
if (isExcludedCommand(parsed.command)) {
|
|
60
|
+
return null;
|
|
61
|
+
}
|
|
62
|
+
return parsed;
|
|
63
|
+
}
|
|
64
|
+
/**
|
|
65
|
+
* Extract text content from message parts array
|
|
66
|
+
*/
|
|
67
|
+
export function extractPromptText(parts) {
|
|
68
|
+
return parts
|
|
69
|
+
.filter((p) => p.type === 'text')
|
|
70
|
+
.map((p) => p.text || '')
|
|
71
|
+
.join(' ');
|
|
72
|
+
}
|
|
73
|
+
//# sourceMappingURL=detector.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"detector.js","sourceRoot":"","sources":["../../../src/hooks/auto-slash-command/detector.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EACL,qBAAqB,EACrB,iBAAiB,GAClB,MAAM,gBAAgB,CAAC;AAGxB,mCAAmC;AACnC,MAAM,kBAAkB,GAAG,iBAAiB,CAAC;AAE7C;;GAEG;AACH,MAAM,UAAU,gBAAgB,CAAC,IAAY;IAC3C,OAAO,IAAI,CAAC,OAAO,CAAC,kBAAkB,EAAE,EAAE,CAAC,CAAC;AAC9C,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,iBAAiB,CAAC,IAAY;IAC5C,MAAM,OAAO,GAAG,IAAI,CAAC,IAAI,EAAE,CAAC;IAE5B,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,GAAG,CAAC,EAAE,CAAC;QAC7B,OAAO,IAAI,CA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CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,IAAI,EAAE,CAAC;SACxB,IAAI,CAAC,GAAG,CAAC,CAAC;AACf,CAAC"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Auto Slash Command Executor
|
|
3
|
+
*
|
|
4
|
+
* Discovers and executes slash commands from various sources.
|
|
5
|
+
*
|
|
6
|
+
* Adapted from oh-my-opencode's auto-slash-command hook.
|
|
7
|
+
*/
|
|
8
|
+
import type { ParsedSlashCommand, CommandInfo, CommandScope, ExecuteResult } from './types.js';
|
|
9
|
+
/**
|
|
10
|
+
* Discover all available commands from multiple sources
|
|
11
|
+
*/
|
|
12
|
+
export declare function discoverAllCommands(): CommandInfo[];
|
|
13
|
+
/**
|
|
14
|
+
* Find a specific command by name
|
|
15
|
+
*/
|
|
16
|
+
export declare function findCommand(commandName: string): CommandInfo | null;
|
|
17
|
+
/**
|
|
18
|
+
* Execute a slash command and return replacement text
|
|
19
|
+
*/
|
|
20
|
+
export declare function executeSlashCommand(parsed: ParsedSlashCommand): ExecuteResult;
|
|
21
|
+
/**
|
|
22
|
+
* List all available commands
|
|
23
|
+
*/
|
|
24
|
+
export declare function listAvailableCommands(): Array<{
|
|
25
|
+
name: string;
|
|
26
|
+
description: string;
|
|
27
|
+
scope: CommandScope;
|
|
28
|
+
}>;
|
|
29
|
+
//# sourceMappingURL=executor.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"executor.d.ts","sourceRoot":"","sources":["../../../src/hooks/auto-slash-command/executor.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAKH,OAAO,KAAK,EACV,kBAAkB,EAClB,WAAW,EAEX,YAAY,EACZ,aAAa,EACd,MAAM,YAAY,CAAC;AA+FpB;;GAEG;AACH,wBAAgB,mBAAmB,IAAI,WAAW,EAAE,CAiDnD;AAED;;GAEG;AACH,wBAAgB,WAAW,CAAC,WAAW,EAAE,MAAM,GAAG,WAAW,GAAG,IAAI,CAOnE;AAiDD;;GAEG;AACH,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,kBAAkB,GAAG,aAAa,CAwB7E;AAED;;GAEG;AACH,wBAAgB,qBAAqB,IAAI,KAAK,CAAC;IAC7C,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,KAAK,EAAE,YAAY,CAAC;CACrB,CAAC,CAOD"}
|
|
@@ -0,0 +1,214 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Auto Slash Command Executor
|
|
3
|
+
*
|
|
4
|
+
* Discovers and executes slash commands from various sources.
|
|
5
|
+
*
|
|
6
|
+
* Adapted from oh-my-opencode's auto-slash-command hook.
|
|
7
|
+
*/
|
|
8
|
+
import { existsSync, readdirSync, readFileSync } from 'fs';
|
|
9
|
+
import { join, basename } from 'path';
|
|
10
|
+
import { homedir } from 'os';
|
|
11
|
+
/** Claude config directory */
|
|
12
|
+
const CLAUDE_CONFIG_DIR = join(homedir(), '.claude');
|
|
13
|
+
/**
|
|
14
|
+
* Parse YAML-like frontmatter from markdown file
|
|
15
|
+
* Simple implementation - supports basic key: value format
|
|
16
|
+
*/
|
|
17
|
+
function parseFrontmatter(content) {
|
|
18
|
+
const frontmatterRegex = /^---\r?\n([\s\S]*?)\r?\n---\r?\n?([\s\S]*)$/;
|
|
19
|
+
const match = content.match(frontmatterRegex);
|
|
20
|
+
if (!match) {
|
|
21
|
+
return { data: {}, body: content };
|
|
22
|
+
}
|
|
23
|
+
const [, yamlContent, body] = match;
|
|
24
|
+
const data = {};
|
|
25
|
+
for (const line of yamlContent.split('\n')) {
|
|
26
|
+
const colonIndex = line.indexOf(':');
|
|
27
|
+
if (colonIndex === -1)
|
|
28
|
+
continue;
|
|
29
|
+
const key = line.slice(0, colonIndex).trim();
|
|
30
|
+
let value = line.slice(colonIndex + 1).trim();
|
|
31
|
+
// Remove surrounding quotes
|
|
32
|
+
if ((value.startsWith('"') && value.endsWith('"')) ||
|
|
33
|
+
(value.startsWith("'") && value.endsWith("'"))) {
|
|
34
|
+
value = value.slice(1, -1);
|
|
35
|
+
}
|
|
36
|
+
data[key] = value;
|
|
37
|
+
}
|
|
38
|
+
return { data, body };
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* Discover commands from a directory
|
|
42
|
+
*/
|
|
43
|
+
function discoverCommandsFromDir(commandsDir, scope) {
|
|
44
|
+
if (!existsSync(commandsDir)) {
|
|
45
|
+
return [];
|
|
46
|
+
}
|
|
47
|
+
let entries;
|
|
48
|
+
try {
|
|
49
|
+
entries = readdirSync(commandsDir, { withFileTypes: true });
|
|
50
|
+
}
|
|
51
|
+
catch {
|
|
52
|
+
return [];
|
|
53
|
+
}
|
|
54
|
+
const commands = [];
|
|
55
|
+
for (const entry of entries) {
|
|
56
|
+
// Only process .md files
|
|
57
|
+
if (!entry.isFile() || !entry.name.endsWith('.md'))
|
|
58
|
+
continue;
|
|
59
|
+
const commandPath = join(commandsDir, entry.name);
|
|
60
|
+
const commandName = basename(entry.name, '.md');
|
|
61
|
+
try {
|
|
62
|
+
const content = readFileSync(commandPath, 'utf-8');
|
|
63
|
+
const { data, body } = parseFrontmatter(content);
|
|
64
|
+
const metadata = {
|
|
65
|
+
name: commandName,
|
|
66
|
+
description: data.description || '',
|
|
67
|
+
argumentHint: data['argument-hint'],
|
|
68
|
+
model: data.model,
|
|
69
|
+
agent: data.agent,
|
|
70
|
+
};
|
|
71
|
+
commands.push({
|
|
72
|
+
name: commandName,
|
|
73
|
+
path: commandPath,
|
|
74
|
+
metadata,
|
|
75
|
+
content: body,
|
|
76
|
+
scope,
|
|
77
|
+
});
|
|
78
|
+
}
|
|
79
|
+
catch {
|
|
80
|
+
continue;
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
return commands;
|
|
84
|
+
}
|
|
85
|
+
/**
|
|
86
|
+
* Discover all available commands from multiple sources
|
|
87
|
+
*/
|
|
88
|
+
export function discoverAllCommands() {
|
|
89
|
+
const userCommandsDir = join(CLAUDE_CONFIG_DIR, 'commands');
|
|
90
|
+
const projectCommandsDir = join(process.cwd(), '.claude', 'commands');
|
|
91
|
+
const skillsDir = join(CLAUDE_CONFIG_DIR, 'skills');
|
|
92
|
+
const userCommands = discoverCommandsFromDir(userCommandsDir, 'user');
|
|
93
|
+
const projectCommands = discoverCommandsFromDir(projectCommandsDir, 'project');
|
|
94
|
+
// Discover skills (each skill directory may have a SKILL.md)
|
|
95
|
+
const skillCommands = [];
|
|
96
|
+
if (existsSync(skillsDir)) {
|
|
97
|
+
try {
|
|
98
|
+
const skillDirs = readdirSync(skillsDir, { withFileTypes: true });
|
|
99
|
+
for (const dir of skillDirs) {
|
|
100
|
+
if (!dir.isDirectory())
|
|
101
|
+
continue;
|
|
102
|
+
const skillPath = join(skillsDir, dir.name, 'SKILL.md');
|
|
103
|
+
if (existsSync(skillPath)) {
|
|
104
|
+
try {
|
|
105
|
+
const content = readFileSync(skillPath, 'utf-8');
|
|
106
|
+
const { data, body } = parseFrontmatter(content);
|
|
107
|
+
const metadata = {
|
|
108
|
+
name: data.name || dir.name,
|
|
109
|
+
description: data.description || '',
|
|
110
|
+
argumentHint: data['argument-hint'],
|
|
111
|
+
model: data.model,
|
|
112
|
+
agent: data.agent,
|
|
113
|
+
};
|
|
114
|
+
skillCommands.push({
|
|
115
|
+
name: data.name || dir.name,
|
|
116
|
+
path: skillPath,
|
|
117
|
+
metadata,
|
|
118
|
+
content: body,
|
|
119
|
+
scope: 'skill',
|
|
120
|
+
});
|
|
121
|
+
}
|
|
122
|
+
catch {
|
|
123
|
+
continue;
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
catch {
|
|
129
|
+
// Ignore errors reading skills directory
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
// Priority: project > user > skills
|
|
133
|
+
return [...projectCommands, ...userCommands, ...skillCommands];
|
|
134
|
+
}
|
|
135
|
+
/**
|
|
136
|
+
* Find a specific command by name
|
|
137
|
+
*/
|
|
138
|
+
export function findCommand(commandName) {
|
|
139
|
+
const allCommands = discoverAllCommands();
|
|
140
|
+
return (allCommands.find((cmd) => cmd.name.toLowerCase() === commandName.toLowerCase()) ?? null);
|
|
141
|
+
}
|
|
142
|
+
/**
|
|
143
|
+
* Resolve $ARGUMENTS placeholder in command content
|
|
144
|
+
*/
|
|
145
|
+
function resolveArguments(content, args) {
|
|
146
|
+
return content.replace(/\$ARGUMENTS/g, args || '(no arguments provided)');
|
|
147
|
+
}
|
|
148
|
+
/**
|
|
149
|
+
* Format command template with metadata header
|
|
150
|
+
*/
|
|
151
|
+
function formatCommandTemplate(cmd, args) {
|
|
152
|
+
const sections = [];
|
|
153
|
+
sections.push(`<command-name>/${cmd.name}</command-name>\n`);
|
|
154
|
+
if (cmd.metadata.description) {
|
|
155
|
+
sections.push(`**Description**: ${cmd.metadata.description}\n`);
|
|
156
|
+
}
|
|
157
|
+
if (args) {
|
|
158
|
+
sections.push(`**Arguments**: ${args}\n`);
|
|
159
|
+
}
|
|
160
|
+
if (cmd.metadata.model) {
|
|
161
|
+
sections.push(`**Model**: ${cmd.metadata.model}\n`);
|
|
162
|
+
}
|
|
163
|
+
if (cmd.metadata.agent) {
|
|
164
|
+
sections.push(`**Agent**: ${cmd.metadata.agent}\n`);
|
|
165
|
+
}
|
|
166
|
+
sections.push(`**Scope**: ${cmd.scope}\n`);
|
|
167
|
+
sections.push('---\n');
|
|
168
|
+
// Resolve arguments in content
|
|
169
|
+
const resolvedContent = resolveArguments(cmd.content || '', args);
|
|
170
|
+
sections.push(resolvedContent.trim());
|
|
171
|
+
if (args && !cmd.content?.includes('$ARGUMENTS')) {
|
|
172
|
+
sections.push('\n\n---\n');
|
|
173
|
+
sections.push('## User Request\n');
|
|
174
|
+
sections.push(args);
|
|
175
|
+
}
|
|
176
|
+
return sections.join('\n');
|
|
177
|
+
}
|
|
178
|
+
/**
|
|
179
|
+
* Execute a slash command and return replacement text
|
|
180
|
+
*/
|
|
181
|
+
export function executeSlashCommand(parsed) {
|
|
182
|
+
const command = findCommand(parsed.command);
|
|
183
|
+
if (!command) {
|
|
184
|
+
return {
|
|
185
|
+
success: false,
|
|
186
|
+
error: `Command "/${parsed.command}" not found. Available commands are in ~/.claude/commands/ or .claude/commands/`,
|
|
187
|
+
};
|
|
188
|
+
}
|
|
189
|
+
try {
|
|
190
|
+
const template = formatCommandTemplate(command, parsed.args);
|
|
191
|
+
return {
|
|
192
|
+
success: true,
|
|
193
|
+
replacementText: template,
|
|
194
|
+
};
|
|
195
|
+
}
|
|
196
|
+
catch (err) {
|
|
197
|
+
return {
|
|
198
|
+
success: false,
|
|
199
|
+
error: `Failed to load command "/${parsed.command}": ${err instanceof Error ? err.message : String(err)}`,
|
|
200
|
+
};
|
|
201
|
+
}
|
|
202
|
+
}
|
|
203
|
+
/**
|
|
204
|
+
* List all available commands
|
|
205
|
+
*/
|
|
206
|
+
export function listAvailableCommands() {
|
|
207
|
+
const commands = discoverAllCommands();
|
|
208
|
+
return commands.map((cmd) => ({
|
|
209
|
+
name: cmd.name,
|
|
210
|
+
description: cmd.metadata.description,
|
|
211
|
+
scope: cmd.scope,
|
|
212
|
+
}));
|
|
213
|
+
}
|
|
214
|
+
//# sourceMappingURL=executor.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"executor.js","sourceRoot":"","sources":["../../../src/hooks/auto-slash-command/executor.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,IAAI,CAAC;AAC3D,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,MAAM,CAAC;AACtC,OAAO,EAAE,OAAO,EAAE,MAAM,IAAI,CAAC;AAS7B,8BAA8B;AAC9B,MAAM,iBAAiB,GAAG,IAAI,CAAC,OAAO,EAAE,EAAE,SAAS,CAAC,CAAC;AAErD;;;GAGG;AACH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AM,OAAO,GAAG,WAAW,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;IAE5C,IAAI,CAAC,OAAO,EAAE,CAAC;QACb,OAAO;YACL,OAAO,EAAE,KAAK;YACd,KAAK,EAAE,aAAa,MAAM,CAAC,OAAO,iFAAiF;SACpH,CAAC;IACJ,CAAC;IAED,IAAI,CAAC;QACH,MAAM,QAAQ,GAAG,qBAAqB,CAAC,OAAO,EAAE,MAAM,CAAC,IAAI,CAAC,CAAC;QAC7D,OAAO;YACL,OAAO,EAAE,IAAI;YACb,eAAe,EAAE,QAAQ;SAC1B,CAAC;IACJ,CAAC;IAAC,OAAO,GAAG,EAAE,CAAC;QACb,OAAO;YACL,OAAO,EAAE,KAAK;YACd,KAAK,EAAE,4BAA4B,MAAM,CAAC,OAAO,MAC/C,GAAG,YAAY,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CACjD,EAAE;SACH,CAAC;IACJ,CAAC;AACH,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,qBAAqB;IAKnC,MAAM,QAAQ,GAAG,mBAAmB,EAAE,CAAC;IACvC,OAAO,QAAQ,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC;QAC5B,IAAI,EAAE,GAAG,CAAC,IAAI;QACd,WAAW,EAAE,GAAG,CAAC,QAAQ,CAAC,WAAW;QACrC,KAAK,EAAE,GAAG,CAAC,KAAK;KACjB,CAAC,CAAC,CAAC;AACN,CAAC"}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Auto Slash Command Hook
|
|
3
|
+
*
|
|
4
|
+
* Detects and expands slash commands in user prompts.
|
|
5
|
+
* Complements Claude Code's native slash command system by adding:
|
|
6
|
+
* - Skill-based commands from ~/.claude/skills/
|
|
7
|
+
* - Project-level commands from .claude/commands/
|
|
8
|
+
* - Template expansion with $ARGUMENTS placeholder
|
|
9
|
+
*
|
|
10
|
+
* Adapted from oh-my-opencode's auto-slash-command hook.
|
|
11
|
+
*/
|
|
12
|
+
import type { AutoSlashCommandHookInput, AutoSlashCommandResult } from './types.js';
|
|
13
|
+
export * from './types.js';
|
|
14
|
+
export * from './constants.js';
|
|
15
|
+
export { detectSlashCommand, extractPromptText, parseSlashCommand, removeCodeBlocks, isExcludedCommand, } from './detector.js';
|
|
16
|
+
export { executeSlashCommand, findCommand, discoverAllCommands, listAvailableCommands, } from './executor.js';
|
|
17
|
+
/**
|
|
18
|
+
* Create auto slash command hook handlers
|
|
19
|
+
*/
|
|
20
|
+
export declare function createAutoSlashCommandHook(): {
|
|
21
|
+
/**
|
|
22
|
+
* Hook name identifier
|
|
23
|
+
*/
|
|
24
|
+
name: "auto-slash-command";
|
|
25
|
+
/**
|
|
26
|
+
* Process a user message to detect and expand slash commands
|
|
27
|
+
*/
|
|
28
|
+
processMessage: (input: AutoSlashCommandHookInput, parts: Array<{
|
|
29
|
+
type: string;
|
|
30
|
+
text?: string;
|
|
31
|
+
}>) => AutoSlashCommandResult;
|
|
32
|
+
/**
|
|
33
|
+
* Get list of available commands
|
|
34
|
+
*/
|
|
35
|
+
listCommands: () => {
|
|
36
|
+
name: string;
|
|
37
|
+
description: string;
|
|
38
|
+
scope: import("./types.js").CommandScope;
|
|
39
|
+
}[];
|
|
40
|
+
/**
|
|
41
|
+
* Find a specific command by name
|
|
42
|
+
*/
|
|
43
|
+
findCommand: (name: string) => import("./types.js").CommandInfo | null;
|
|
44
|
+
/**
|
|
45
|
+
* Clear processed commands cache for a session
|
|
46
|
+
*/
|
|
47
|
+
clearSession: (sessionId: string) => void;
|
|
48
|
+
};
|
|
49
|
+
/**
|
|
50
|
+
* Process a prompt for slash command expansion (simple utility function)
|
|
51
|
+
*/
|
|
52
|
+
export declare function processSlashCommand(prompt: string): AutoSlashCommandResult;
|
|
53
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/hooks/auto-slash-command/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAgBH,OAAO,KAAK,EACV,yBAAyB,EACzB,sBAAsB,EACvB,MAAM,YAAY,CAAC;AAGpB,cAAc,YAAY,CAAC;AAC3B,cAAc,gBAAgB,CAAC;AAC/B,OAAO,EACL,kBAAkB,EAClB,iBAAiB,EACjB,iBAAiB,EACjB,gBAAgB,EAChB,iBAAiB,GAClB,MAAM,eAAe,CAAC;AACvB,OAAO,EACL,mBAAmB,EACnB,WAAW,EACX,mBAAmB,EACnB,qBAAqB,GACtB,MAAM,eAAe,CAAC;AAKvB;;GAEG;AACH,wBAAgB,0BAA0B;IAEtC;;OAEG;;IAGH;;OAEG;4BAEM,yBAAyB,SACzB,KAAK,CAAC;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,IAAI,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC,KAC5C,sBAAsB;IA+CzB;;OAEG;;;;;;IAKH;;OAEG;wBACiB,MAAM;IAI1B;;OAEG;8BACuB,MAAM;EAanC;AAED;;GAEG;AACH,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,MAAM,GAAG,sBAAsB,CAM1E"}
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Auto Slash Command Hook
|
|
3
|
+
*
|
|
4
|
+
* Detects and expands slash commands in user prompts.
|
|
5
|
+
* Complements Claude Code's native slash command system by adding:
|
|
6
|
+
* - Skill-based commands from ~/.claude/skills/
|
|
7
|
+
* - Project-level commands from .claude/commands/
|
|
8
|
+
* - Template expansion with $ARGUMENTS placeholder
|
|
9
|
+
*
|
|
10
|
+
* Adapted from oh-my-opencode's auto-slash-command hook.
|
|
11
|
+
*/
|
|
12
|
+
import { detectSlashCommand, extractPromptText, } from './detector.js';
|
|
13
|
+
import { executeSlashCommand, findCommand, listAvailableCommands, } from './executor.js';
|
|
14
|
+
import { HOOK_NAME, AUTO_SLASH_COMMAND_TAG_OPEN, AUTO_SLASH_COMMAND_TAG_CLOSE, } from './constants.js';
|
|
15
|
+
// Re-export all submodules
|
|
16
|
+
export * from './types.js';
|
|
17
|
+
export * from './constants.js';
|
|
18
|
+
export { detectSlashCommand, extractPromptText, parseSlashCommand, removeCodeBlocks, isExcludedCommand, } from './detector.js';
|
|
19
|
+
export { executeSlashCommand, findCommand, discoverAllCommands, listAvailableCommands, } from './executor.js';
|
|
20
|
+
/** Track processed commands to avoid duplicate expansion */
|
|
21
|
+
const sessionProcessedCommands = new Set();
|
|
22
|
+
/**
|
|
23
|
+
* Create auto slash command hook handlers
|
|
24
|
+
*/
|
|
25
|
+
export function createAutoSlashCommandHook() {
|
|
26
|
+
return {
|
|
27
|
+
/**
|
|
28
|
+
* Hook name identifier
|
|
29
|
+
*/
|
|
30
|
+
name: HOOK_NAME,
|
|
31
|
+
/**
|
|
32
|
+
* Process a user message to detect and expand slash commands
|
|
33
|
+
*/
|
|
34
|
+
processMessage: (input, parts) => {
|
|
35
|
+
const promptText = extractPromptText(parts);
|
|
36
|
+
// Skip if already processed (contains our tags)
|
|
37
|
+
if (promptText.includes(AUTO_SLASH_COMMAND_TAG_OPEN) ||
|
|
38
|
+
promptText.includes(AUTO_SLASH_COMMAND_TAG_CLOSE)) {
|
|
39
|
+
return { detected: false };
|
|
40
|
+
}
|
|
41
|
+
const parsed = detectSlashCommand(promptText);
|
|
42
|
+
if (!parsed) {
|
|
43
|
+
return { detected: false };
|
|
44
|
+
}
|
|
45
|
+
// Deduplicate within session
|
|
46
|
+
const commandKey = `${input.sessionId}:${input.messageId}:${parsed.command}`;
|
|
47
|
+
if (sessionProcessedCommands.has(commandKey)) {
|
|
48
|
+
return { detected: false };
|
|
49
|
+
}
|
|
50
|
+
sessionProcessedCommands.add(commandKey);
|
|
51
|
+
// Execute the command
|
|
52
|
+
const result = executeSlashCommand(parsed);
|
|
53
|
+
if (result.success && result.replacementText) {
|
|
54
|
+
const taggedContent = `${AUTO_SLASH_COMMAND_TAG_OPEN}\n${result.replacementText}\n${AUTO_SLASH_COMMAND_TAG_CLOSE}`;
|
|
55
|
+
return {
|
|
56
|
+
detected: true,
|
|
57
|
+
parsedCommand: parsed,
|
|
58
|
+
injectedMessage: taggedContent,
|
|
59
|
+
};
|
|
60
|
+
}
|
|
61
|
+
// Command not found or error
|
|
62
|
+
const errorMessage = `${AUTO_SLASH_COMMAND_TAG_OPEN}\n[AUTO-SLASH-COMMAND ERROR]\n${result.error}\n\nOriginal input: ${parsed.raw}\n${AUTO_SLASH_COMMAND_TAG_CLOSE}`;
|
|
63
|
+
return {
|
|
64
|
+
detected: true,
|
|
65
|
+
parsedCommand: parsed,
|
|
66
|
+
injectedMessage: errorMessage,
|
|
67
|
+
};
|
|
68
|
+
},
|
|
69
|
+
/**
|
|
70
|
+
* Get list of available commands
|
|
71
|
+
*/
|
|
72
|
+
listCommands: () => {
|
|
73
|
+
return listAvailableCommands();
|
|
74
|
+
},
|
|
75
|
+
/**
|
|
76
|
+
* Find a specific command by name
|
|
77
|
+
*/
|
|
78
|
+
findCommand: (name) => {
|
|
79
|
+
return findCommand(name);
|
|
80
|
+
},
|
|
81
|
+
/**
|
|
82
|
+
* Clear processed commands cache for a session
|
|
83
|
+
*/
|
|
84
|
+
clearSession: (sessionId) => {
|
|
85
|
+
// Clear all commands for this session
|
|
86
|
+
const keysToDelete = [];
|
|
87
|
+
for (const key of sessionProcessedCommands) {
|
|
88
|
+
if (key.startsWith(`${sessionId}:`)) {
|
|
89
|
+
keysToDelete.push(key);
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
for (const key of keysToDelete) {
|
|
93
|
+
sessionProcessedCommands.delete(key);
|
|
94
|
+
}
|
|
95
|
+
},
|
|
96
|
+
};
|
|
97
|
+
}
|
|
98
|
+
/**
|
|
99
|
+
* Process a prompt for slash command expansion (simple utility function)
|
|
100
|
+
*/
|
|
101
|
+
export function processSlashCommand(prompt) {
|
|
102
|
+
const hook = createAutoSlashCommandHook();
|
|
103
|
+
return hook.processMessage({}, [{ type: 'text', text: prompt }]);
|
|
104
|
+
}
|
|
105
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/hooks/auto-slash-command/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,EACL,kBAAkB,EAClB,iBAAiB,GAClB,MAAM,eAAe,CAAC;AACvB,OAAO,EACL,mBAAmB,EACnB,WAAW,EACX,qBAAqB,GACtB,MAAM,eAAe,CAAC;AACvB,OAAO,EACL,SAAS,EACT,2BAA2B,EAC3B,4BAA4B,GAC7B,MAAM,gBAAgB,CAAC;AAMxB,2BAA2B;AAC3B,cAAc,YAAY,CAAC;AAC3B,cAAc,gBAAgB,CAAC;AAC/B,OAAO,EACL,kBAAkB,EAClB,iBAAiB,EACjB,iBAAiB,EACjB,gBAAgB,EAChB,iBAAiB,GAClB,MAAM,eAAe,CAAC;AACvB,OAAO,EACL,mBAAmB,EACnB,WAAW,EACX,mBAAmB,EACnB,qBAAqB,GACtB,MAAM,eAAe,CAAC;AAEvB,4DAA4D;AAC5D,MAAM,wBAAwB,GAAG,IAAI,GAAG,EAAU,CAAC;AAEnD;;GAEG;AACH,MAAM,UAAU,0BAA0B;IACxC,OAAO;QACL;;WAEG;QACH,IAAI,EAAE,SAAS;QAEf;;WAEG;QACH,cAAc,EAAE,CACd,KAAgC,EAChC,KAA6C,EACrB,EAAE;YAC1B,MAAM,UAAU,GAAG,iBAAiB,CAAC,KAAK,CAAC,CAAC;YAE5C,gDAAgD;YAChD,IACE,UAAU,CAAC,QAAQ,CAAC,2BAA2B,CAAC;gBAChD,UAAU,CAAC,QAAQ,CAAC,4BAA4B,CAAC,EACjD,CAAC;gBACD,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAE,CAAC;YAC7B,CAAC;YAED,MAAM,MAAM,GAAG,kBAAkB,CAAC,UAAU,CAA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AAiB,EAAE,EAAE;YAClC,sCAAsC;YACtC,MAAM,YAAY,GAAa,EAAE,CAAC;YAClC,KAAK,MAAM,GAAG,IAAI,wBAAwB,EAAE,CAAC;gBAC3C,IAAI,GAAG,CAAC,UAAU,CAAC,GAAG,SAAS,GAAG,CAAC,EAAE,CAAC;oBACpC,YAAY,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;gBACzB,CAAC;YACH,CAAC;YACD,KAAK,MAAM,GAAG,IAAI,YAAY,EAAE,CAAC;gBAC/B,wBAAwB,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;YACvC,CAAC;QACH,CAAC;KACF,CAAC;AACJ,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,mBAAmB,CAAC,MAAc;IAChD,MAAM,IAAI,GAAG,0BAA0B,EAAE,CAAC;IAC1C,OAAO,IAAI,CAAC,cAAc,CACxB,EAAE,EACF,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC,CACjC,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Auto Slash Command Types
|
|
3
|
+
*
|
|
4
|
+
* Type definitions for slash command detection and execution.
|
|
5
|
+
*
|
|
6
|
+
* Adapted from oh-my-opencode's auto-slash-command hook.
|
|
7
|
+
*/
|
|
8
|
+
/**
|
|
9
|
+
* Input for auto slash command hook
|
|
10
|
+
*/
|
|
11
|
+
export interface AutoSlashCommandHookInput {
|
|
12
|
+
sessionId?: string;
|
|
13
|
+
messageId?: string;
|
|
14
|
+
agent?: string;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Output for auto slash command hook
|
|
18
|
+
*/
|
|
19
|
+
export interface AutoSlashCommandHookOutput {
|
|
20
|
+
parts: Array<{
|
|
21
|
+
type: string;
|
|
22
|
+
text?: string;
|
|
23
|
+
[key: string]: unknown;
|
|
24
|
+
}>;
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Parsed slash command from user input
|
|
28
|
+
*/
|
|
29
|
+
export interface ParsedSlashCommand {
|
|
30
|
+
/** The command name without the leading slash */
|
|
31
|
+
command: string;
|
|
32
|
+
/** Arguments passed to the command */
|
|
33
|
+
args: string;
|
|
34
|
+
/** Raw matched text */
|
|
35
|
+
raw: string;
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* Result of auto slash command detection
|
|
39
|
+
*/
|
|
40
|
+
export interface AutoSlashCommandResult {
|
|
41
|
+
detected: boolean;
|
|
42
|
+
parsedCommand?: ParsedSlashCommand;
|
|
43
|
+
injectedMessage?: string;
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* Command scope indicating where it was discovered
|
|
47
|
+
*/
|
|
48
|
+
export type CommandScope = 'user' | 'project' | 'skill';
|
|
49
|
+
/**
|
|
50
|
+
* Command metadata from frontmatter
|
|
51
|
+
*/
|
|
52
|
+
export interface CommandMetadata {
|
|
53
|
+
name: string;
|
|
54
|
+
description: string;
|
|
55
|
+
argumentHint?: string;
|
|
56
|
+
model?: string;
|
|
57
|
+
agent?: string;
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* Discovered command information
|
|
61
|
+
*/
|
|
62
|
+
export interface CommandInfo {
|
|
63
|
+
name: string;
|
|
64
|
+
path?: string;
|
|
65
|
+
metadata: CommandMetadata;
|
|
66
|
+
content?: string;
|
|
67
|
+
scope: CommandScope;
|
|
68
|
+
}
|
|
69
|
+
/**
|
|
70
|
+
* Result of executing a slash command
|
|
71
|
+
*/
|
|
72
|
+
export interface ExecuteResult {
|
|
73
|
+
success: boolean;
|
|
74
|
+
replacementText?: string;
|
|
75
|
+
error?: string;
|
|
76
|
+
}
|
|
77
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/hooks/auto-slash-command/types.ts"],"names":[],"mappings":"AAAA;;;;;;G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,OAAO,CAAC;IACjB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/hooks/auto-slash-command/types.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG"}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Background Notification Hook
|
|
3
|
+
*
|
|
4
|
+
* Handles notifications for background tasks completing.
|
|
5
|
+
* Integrates with the BackgroundManager to show task completion status.
|
|
6
|
+
*
|
|
7
|
+
* Adapted from oh-my-opencode's background-notification hook for Claude Code's
|
|
8
|
+
* shell hooks system.
|
|
9
|
+
*/
|
|
10
|
+
import type { BackgroundManager, BackgroundTask } from '../../features/background-agent/index.js';
|
|
11
|
+
import type { BackgroundNotificationHookConfig, BackgroundNotificationHookInput, BackgroundNotificationHookOutput, NotificationCheckResult } from './types.js';
|
|
12
|
+
export type { BackgroundNotificationHookConfig, BackgroundNotificationHookInput, BackgroundNotificationHookOutput, NotificationCheckResult, } from './types.js';
|
|
13
|
+
/** Hook name identifier */
|
|
14
|
+
export declare const HOOK_NAME = "background-notification";
|
|
15
|
+
/**
|
|
16
|
+
* Check for pending background notifications
|
|
17
|
+
*/
|
|
18
|
+
export declare function checkBackgroundNotifications(sessionId: string, manager: BackgroundManager, config?: BackgroundNotificationHookConfig): NotificationCheckResult;
|
|
19
|
+
/**
|
|
20
|
+
* Process background notification event
|
|
21
|
+
*/
|
|
22
|
+
export declare function processBackgroundNotification(input: BackgroundNotificationHookInput, config?: BackgroundNotificationHookConfig): BackgroundNotificationHookOutput;
|
|
23
|
+
/**
|
|
24
|
+
* Handle event from BackgroundManager
|
|
25
|
+
* This is called by the BackgroundManager when tasks complete
|
|
26
|
+
*/
|
|
27
|
+
export declare function handleBackgroundEvent(event: {
|
|
28
|
+
type: string;
|
|
29
|
+
properties?: Record<string, unknown>;
|
|
30
|
+
}, manager: BackgroundManager): void;
|
|
31
|
+
/**
|
|
32
|
+
* Create background notification hook handlers
|
|
33
|
+
*/
|
|
34
|
+
export declare function createBackgroundNotificationHook(manager: BackgroundManager, config?: BackgroundNotificationHookConfig): {
|
|
35
|
+
/**
|
|
36
|
+
* Hook name identifier
|
|
37
|
+
*/
|
|
38
|
+
name: string;
|
|
39
|
+
/**
|
|
40
|
+
* Process an event (for shell hook compatibility)
|
|
41
|
+
*/
|
|
42
|
+
event: (input: BackgroundNotificationHookInput) => Promise<BackgroundNotificationHookOutput>;
|
|
43
|
+
/**
|
|
44
|
+
* Check for pending notifications without clearing them
|
|
45
|
+
*/
|
|
46
|
+
check: (sessionId: string) => NotificationCheckResult;
|
|
47
|
+
/**
|
|
48
|
+
* Manually clear notifications for a session
|
|
49
|
+
*/
|
|
50
|
+
clear: (sessionId: string) => void;
|
|
51
|
+
/**
|
|
52
|
+
* Get all pending notifications without clearing
|
|
53
|
+
*/
|
|
54
|
+
getPending: (sessionId: string) => BackgroundTask[];
|
|
55
|
+
};
|
|
56
|
+
/**
|
|
57
|
+
* Simple utility function for shell hook integration
|
|
58
|
+
*/
|
|
59
|
+
export declare function processBackgroundNotificationHook(input: BackgroundNotificationHookInput, config?: BackgroundNotificationHookConfig): Promise<BackgroundNotificationHookOutput>;
|
|
60
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/hooks/background-notification/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAGH,OAAO,KAAK,EAAE,iBAAiB,EAAE,cAAc,EAAE,MAAM,0CAA0C,CAAC;AAClG,OAAO,KAAK,EACV,gCAAgC,EAChC,+BAA+B,EAC/B,gCAAgC,EAChC,uBAAuB,EACxB,MAAM,YAAY,CAAC;AAGpB,YAAY,EACV,gCAAgC,EAChC,+BAA+B,EAC/B,gCAAgC,EAChC,uBAAuB,GAC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