oh-my-claude-sisyphus 1.4.1 → 1.6.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/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 +17 -1
- package/dist/agents/index.d.ts.map +1 -1
- package/dist/agents/index.js +21 -1
- package/dist/agents/index.js.map +1 -1
- 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/oracle.d.ts +13 -0
- package/dist/agents/oracle.d.ts.map +1 -0
- package/dist/agents/oracle.js +149 -0
- package/dist/agents/oracle.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/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/features/auto-update.d.ts +52 -0
- package/dist/features/auto-update.d.ts.map +1 -1
- package/dist/features/auto-update.js +167 -0
- package/dist/features/auto-update.js.map +1 -1
- 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/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 +367 -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/index.d.ts +5 -1
- package/dist/features/index.d.ts.map +1 -1
- package/dist/features/index.js +25 -1
- package/dist/features/index.js.map +1 -1
- 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/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 +225 -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 +31 -0
- package/dist/hooks/index.d.ts.map +1 -0
- package/dist/hooks/index.js +69 -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/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 +237 -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/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/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 +66 -0
- package/dist/hooks/thinking-block-validator/index.d.ts.map +1 -0
- package/dist/hooks/thinking-block-validator/index.js +205 -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/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +12 -0
- package/dist/index.js.map +1 -1
- package/dist/installer/index.d.ts +1 -1
- package/dist/installer/index.d.ts.map +1 -1
- package/dist/installer/index.js +232 -1
- package/dist/installer/index.js.map +1 -1
- package/package.json +1 -1
- package/scripts/install.sh +181 -3
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
export const HOOK_NAME = "non-interactive-env";
|
|
2
|
+
export const NON_INTERACTIVE_ENV = {
|
|
3
|
+
CI: "true",
|
|
4
|
+
DEBIAN_FRONTEND: "noninteractive",
|
|
5
|
+
GIT_TERMINAL_PROMPT: "0",
|
|
6
|
+
GCM_INTERACTIVE: "never",
|
|
7
|
+
HOMEBREW_NO_AUTO_UPDATE: "1",
|
|
8
|
+
// Block interactive editors - git rebase, commit, etc.
|
|
9
|
+
GIT_EDITOR: ":",
|
|
10
|
+
EDITOR: ":",
|
|
11
|
+
VISUAL: "",
|
|
12
|
+
GIT_SEQUENCE_EDITOR: ":",
|
|
13
|
+
GIT_MERGE_AUTOEDIT: "no",
|
|
14
|
+
// Block pagers
|
|
15
|
+
GIT_PAGER: "cat",
|
|
16
|
+
PAGER: "cat",
|
|
17
|
+
// NPM non-interactive
|
|
18
|
+
npm_config_yes: "true",
|
|
19
|
+
// Pip non-interactive
|
|
20
|
+
PIP_NO_INPUT: "1",
|
|
21
|
+
// Yarn non-interactive
|
|
22
|
+
YARN_ENABLE_IMMUTABLE_INSTALLS: "false",
|
|
23
|
+
};
|
|
24
|
+
/**
|
|
25
|
+
* Shell command guidance for non-interactive environments.
|
|
26
|
+
* These patterns should be followed to avoid hanging on user input.
|
|
27
|
+
*/
|
|
28
|
+
export const SHELL_COMMAND_PATTERNS = {
|
|
29
|
+
// Package managers - always use non-interactive flags
|
|
30
|
+
npm: {
|
|
31
|
+
bad: ["npm init", "npm install (prompts)"],
|
|
32
|
+
good: ["npm init -y", "npm install --yes"],
|
|
33
|
+
},
|
|
34
|
+
apt: {
|
|
35
|
+
bad: ["apt-get install pkg"],
|
|
36
|
+
good: ["apt-get install -y pkg", "DEBIAN_FRONTEND=noninteractive apt-get install pkg"],
|
|
37
|
+
},
|
|
38
|
+
pip: {
|
|
39
|
+
bad: ["pip install pkg (with prompts)"],
|
|
40
|
+
good: ["pip install --no-input pkg", "PIP_NO_INPUT=1 pip install pkg"],
|
|
41
|
+
},
|
|
42
|
+
// Git operations - always provide messages/flags
|
|
43
|
+
git: {
|
|
44
|
+
bad: ["git commit", "git merge branch", "git add -p", "git rebase -i"],
|
|
45
|
+
good: ["git commit -m 'msg'", "git merge --no-edit branch", "git add .", "git rebase --no-edit"],
|
|
46
|
+
},
|
|
47
|
+
// System commands - force flags
|
|
48
|
+
system: {
|
|
49
|
+
bad: ["rm file (prompts)", "cp a b (prompts)", "ssh host"],
|
|
50
|
+
good: ["rm -f file", "cp -f a b", "ssh -o BatchMode=yes host", "unzip -o file.zip"],
|
|
51
|
+
},
|
|
52
|
+
// Banned commands - will always hang
|
|
53
|
+
banned: [
|
|
54
|
+
"vim", "nano", "vi", "emacs", // Editors
|
|
55
|
+
"less", "more", "man", // Pagers
|
|
56
|
+
"python (REPL)", "node (REPL)", // REPLs without -c/-e
|
|
57
|
+
"git add -p", "git rebase -i", // Interactive git modes
|
|
58
|
+
],
|
|
59
|
+
// Workarounds for scripts that require input
|
|
60
|
+
workarounds: {
|
|
61
|
+
yesPipe: "yes | ./script.sh",
|
|
62
|
+
heredoc: `./script.sh <<EOF
|
|
63
|
+
option1
|
|
64
|
+
option2
|
|
65
|
+
EOF`,
|
|
66
|
+
expectAlternative: "Use environment variables or config files instead of expect",
|
|
67
|
+
},
|
|
68
|
+
};
|
|
69
|
+
//# sourceMappingURL=constants.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../src/hooks/non-interactive-env/constants.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,SAAS,GAAG,qBAAqB,CAAA;AAE9C,MAAM,CAAC,MAAM,mBAAmB,GAA2B;IACzD,EAAE,EAAE,MAAM;IACV,eAAe,EAAE,gBAAgB;IACjC,mBAAmB,EAAE,GAAG;IACxB,eAAe,EAAE,OAAO;IACxB,uBAAuB,EAAE,GAAG;IAC5B,uDAAuD;IACvD,UAAU,EAAE,GAAG;IACf,MAAM,EAAE,GAAG;IACX,MAAM,EAAE,EAAE;IACV,mBAAmB,EAAE,GAAG;IACxB,kBAAkB,EAAE,IAAI;IACxB,eAAe;IACf,SAAS,EAAE,KAAK;IAChB,KAAK,EAAE,KAAK;IACZ,sBAAsB;IACtB,cAAc,EAAE,MAAM;IACtB,sBAAsB;IACtB,YAAY,EAAE,GAAG;IACjB,uBAAuB;IACvB,8BAA8B,EAAE,OAAO;CACxC,CAAA;AAED;;;GAGG;AACH,MAAM,CAAC,MAAM,sBAAsB,GAAG;IACpC,sDAAsD;IACtD,GAAG,EAAE;QACH,GAAG,EAAE,CAAC,UAAU,EAAE,uBAAuB,CAAC;QAC1C,IAAI,EAAE,CAAC,aAAa,EAAE,mBAAmB,CAAC;KAC3C;IACD,GAAG,EAAE;QACH,GAAG,EAAE,CAAC,qBAAqB,CAAC;QAC5B,IAAI,EAAE,CAAC,wBAAwB,EAAE,oDAAoD,CAAC;KACvF;IACD,GAAG,EAAE;QACH,GAAG,EAAE,CAAC,gCAAgC,CAAC;QACvC,IAAI,EAAE,CAAC,4BAA4B,EAAE,gCAAgC,CAAC;KACvE;IACD,iDAAiD;IACjD,GAAG,EAAE;QACH,GAAG,EAAE,CAAC,YAAY,EAAE,kBAAkB,EAAE,YAAY,EAAE,eAAe,CAAC;QACtE,IAAI,EAAE,CAAC,qBAAqB,EAAE,4BAA4B,EAAE,WAAW,EAAE,sBAAsB,CAAC;KACjG;IACD,gCAAgC;IAChC,MAAM,EAAE;QACN,GAAG,EAAE,CAAC,mBAAmB,EAAE,kBAAkB,EAAE,UAAU,CAAC;QAC1D,IAAI,EAAE,CAAC,YAAY,EAAE,WAAW,EAAE,2BAA2B,EAAE,mBAAmB,CAAC;KACpF;IACD,qCAAqC;IACrC,MAAM,EAAE;QACN,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,OAAO,EAAY,UAAU;QAClD,MAAM,EAAE,MAAM,EAAE,KAAK,EAAoB,SAAS;QAClD,eAAe,EAAE,aAAa,EAAW,sBAAsB;QAC/D,YAAY,EAAE,eAAe,EAAY,wBAAwB;KAClE;IACD,6CAA6C;IAC7C,WAAW,EAAE;QACX,OAAO,EAAE,mBAAmB;QAC5B,OAAO,EAAE;;;IAGT;QACA,iBAAiB,EAAE,6DAA6D;KACjF;CACO,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"detector.d.ts","sourceRoot":"","sources":["../../../src/hooks/non-interactive-env/detector.ts"],"names":[],"mappings":"AAAA,wBAAgB,gBAAgB,IAAI,OAAO,CAkB1C"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export function isNonInteractive() {
|
|
2
|
+
if (process.env.CI === "true" || process.env.CI === "1") {
|
|
3
|
+
return true;
|
|
4
|
+
}
|
|
5
|
+
if (process.env.CLAUDE_CODE_RUN === "true" || process.env.CLAUDE_CODE_NON_INTERACTIVE === "true") {
|
|
6
|
+
return true;
|
|
7
|
+
}
|
|
8
|
+
if (process.env.GITHUB_ACTIONS === "true") {
|
|
9
|
+
return true;
|
|
10
|
+
}
|
|
11
|
+
if (process.stdout.isTTY !== true) {
|
|
12
|
+
return true;
|
|
13
|
+
}
|
|
14
|
+
return false;
|
|
15
|
+
}
|
|
16
|
+
//# sourceMappingURL=detector.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"detector.js","sourceRoot":"","sources":["../../../src/hooks/non-interactive-env/detector.ts"],"names":[],"mappings":"AAAA,MAAM,UAAU,gBAAgB;IAC9B,IAAI,OAAO,CAAC,GAAG,CAAC,EAAE,KAAK,MAAM,IAAI,OAAO,CAAC,GAAG,CAAC,EAAE,KAAK,GAAG,EAAE,CAAC;QACxD,OAAO,IAAI,CAAA;IACb,CAAC;IAED,IAAI,OAAO,CAAC,GAAG,CAAC,eAAe,KAAK,MAAM,IAAI,OAAO,CAAC,GAAG,CAAC,2BAA2B,KAAK,MAAM,EAAE,CAAC;QACjG,OAAO,IAAI,CAAA;IACb,CAAC;IAED,IAAI,OAAO,CAAC,GAAG,CAAC,cAAc,KAAK,MAAM,EAAE,CAAC;QAC1C,OAAO,IAAI,CAAA;IACb,CAAC;IAED,IAAI,OAAO,CAAC,MAAM,CAAC,KAAK,KAAK,IAAI,EAAE,CAAC;QAClC,OAAO,IAAI,CAAA;IACb,CAAC;IAED,OAAO,KAAK,CAAA;AACd,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { ShellHook } from "./types.js";
|
|
2
|
+
export * from "./constants.js";
|
|
3
|
+
export * from "./detector.js";
|
|
4
|
+
export * from "./types.js";
|
|
5
|
+
/**
|
|
6
|
+
* Non-interactive environment hook for Claude Code.
|
|
7
|
+
*
|
|
8
|
+
* Detects and handles non-interactive environments (CI, cron, etc.) by:
|
|
9
|
+
* - Warning about banned interactive commands (vim, less, etc.)
|
|
10
|
+
* - Injecting environment variables to prevent git/tools from prompting
|
|
11
|
+
* - Prepending export statements to git commands to block editors/pagers
|
|
12
|
+
*/
|
|
13
|
+
export declare const nonInteractiveEnvHook: ShellHook;
|
|
14
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/hooks/non-interactive-env/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,YAAY,CAAA;AAG3C,cAAc,gBAAgB,CAAA;AAC9B,cAAc,eAAe,CAAA;AAC7B,cAAc,YAAY,CAAA;AA2C1B;;;;;;;GAOG;AACH,eAAO,MAAM,qBAAqB,EAAE,SAwBnC,CAAA"}
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import { HOOK_NAME, NON_INTERACTIVE_ENV, SHELL_COMMAND_PATTERNS } from "./constants.js";
|
|
2
|
+
export * from "./constants.js";
|
|
3
|
+
export * from "./detector.js";
|
|
4
|
+
export * from "./types.js";
|
|
5
|
+
const BANNED_COMMAND_PATTERNS = SHELL_COMMAND_PATTERNS.banned
|
|
6
|
+
.filter((cmd) => !cmd.includes("("))
|
|
7
|
+
.map((cmd) => new RegExp(`\\b${cmd}\\b`));
|
|
8
|
+
function detectBannedCommand(command) {
|
|
9
|
+
for (let i = 0; i < BANNED_COMMAND_PATTERNS.length; i++) {
|
|
10
|
+
if (BANNED_COMMAND_PATTERNS[i].test(command)) {
|
|
11
|
+
return SHELL_COMMAND_PATTERNS.banned[i];
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
return undefined;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Shell-escape a value for use in VAR=value prefix.
|
|
18
|
+
* Wraps in single quotes if contains special chars.
|
|
19
|
+
*/
|
|
20
|
+
function shellEscape(value) {
|
|
21
|
+
// Empty string needs quotes
|
|
22
|
+
if (value === "")
|
|
23
|
+
return "''";
|
|
24
|
+
// If contains special chars, wrap in single quotes (escape existing single quotes)
|
|
25
|
+
if (/[^a-zA-Z0-9_\-.:\/]/.test(value)) {
|
|
26
|
+
return `'${value.replace(/'/g, "'\\''")}'`;
|
|
27
|
+
}
|
|
28
|
+
return value;
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Build export statement for environment variables.
|
|
32
|
+
* Uses `export VAR1=val1 VAR2=val2;` format to ensure variables
|
|
33
|
+
* apply to ALL commands in a chain (e.g., `cmd1 && cmd2`).
|
|
34
|
+
*
|
|
35
|
+
* Previous approach used VAR=value prefix which only applies to the first command.
|
|
36
|
+
*/
|
|
37
|
+
function buildEnvPrefix(env) {
|
|
38
|
+
const exports = Object.entries(env)
|
|
39
|
+
.map(([key, value]) => `${key}=${shellEscape(value)}`)
|
|
40
|
+
.join(" ");
|
|
41
|
+
return `export ${exports};`;
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* Non-interactive environment hook for Claude Code.
|
|
45
|
+
*
|
|
46
|
+
* Detects and handles non-interactive environments (CI, cron, etc.) by:
|
|
47
|
+
* - Warning about banned interactive commands (vim, less, etc.)
|
|
48
|
+
* - Injecting environment variables to prevent git/tools from prompting
|
|
49
|
+
* - Prepending export statements to git commands to block editors/pagers
|
|
50
|
+
*/
|
|
51
|
+
export const nonInteractiveEnvHook = {
|
|
52
|
+
name: HOOK_NAME,
|
|
53
|
+
async beforeCommand(command) {
|
|
54
|
+
// Check for banned interactive commands
|
|
55
|
+
const bannedCmd = detectBannedCommand(command);
|
|
56
|
+
const warning = bannedCmd
|
|
57
|
+
? `Warning: '${bannedCmd}' is an interactive command that may hang in non-interactive environments.`
|
|
58
|
+
: undefined;
|
|
59
|
+
// Only prepend env vars for git commands (editor blocking, pager, etc.)
|
|
60
|
+
const isGitCommand = /\bgit\b/.test(command);
|
|
61
|
+
if (!isGitCommand) {
|
|
62
|
+
return { command, warning };
|
|
63
|
+
}
|
|
64
|
+
// Prepend export statement to command to ensure non-interactive behavior
|
|
65
|
+
// Uses `export VAR=val;` format to ensure variables apply to ALL commands
|
|
66
|
+
// in a chain (e.g., `git add file && git rebase --continue`).
|
|
67
|
+
const envPrefix = buildEnvPrefix(NON_INTERACTIVE_ENV);
|
|
68
|
+
const modifiedCommand = `${envPrefix} ${command}`;
|
|
69
|
+
return { command: modifiedCommand, warning };
|
|
70
|
+
},
|
|
71
|
+
};
|
|
72
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/hooks/non-interactive-env/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,mBAAmB,EAAE,sBAAsB,EAAE,MAAM,gBAAgB,CAAA;AAEvF,cAAc,gBAAgB,CAAA;AAC9B,cAAc,eAAe,CAAA;AAC7B,cAAc,YAAY,CAAA;AAE1B,MAAM,uBAAuB,GAAG,sBAAsB,CAAC,MAAM;KAC1D,MAAM,CAAC,CAAC,GAAW,EAAE,EAAE,CAAC,CAAC,GAAG,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC;KAC3C,GAAG,CAAC,CAAC,GAAW,EAAE,EAAE,CAAC,IAAI,MAAM,CAAC,MAAM,GAAG,KAAK,CAAC,CAAC,CAAA;AAEnD,SAAS,mBAAmB,CAAC,OAAe;IAC1C,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,uBAAuB,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;QACxD,IAAI,uBAAuB,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,EAAE,CAAC;YAC7C,OAAO,sBAAsB,CAAC,MAAM,CAAC,CAAC,CAAC,CAAA;QACzC,CAAC;IACH,CAAC;IACD,OAAO,SAAS,CAAA;AAClB,CAAC;AAED;;;GAGG;AACH,SAAS,WAAW,CAAC,KAAa;IAChC,4BAA4B;IAC5B,IAAI,KAAK,KAAK,EAAE;QAAE,OAAO,IAAI,CAAA;IAC7B,mFAAmF;IACnF,IAAI,qBAAqB,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC;QACtC,OAAO,IAAI,KAAK,CAAC,OAAO,CAAC,IAAI,EAAE,OAAO,CAAC,GAAG,CAAA;IAC5C,CAAC;IACD,OAAO,KAAK,CAAA;AACd,CAAC;AAED;;;;;;GAMG;AACH,SAAS,cAAc,CAAC,GAA2B;IACjD,MAAM,OAAO,GAAG,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC;SAChC,GAAG,CAAC,CAAC,CAAC,GAAG,EAAE,KAAK,CAAC,EAAE,EAAE,CAAC,GAAG,GAAG,IAAI,WAAW,CAAC,KAAK,CAAC,EAAE,CAAC;SACrD,IAAI,CAAC,GAAG,CAAC,CAAA;IACZ,OAAO,UAAU,OAAO,GAAG,CAAA;AAC7B,CAAC;AAED;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,qBAAqB,GAAc;IAC9C,IAAI,EAAE,SAAS;IAEf,KAAK,CAAC,aAAa,CAAC,OAAe;QACjC,wCAAwC;QACxC,MAAM,SAAS,GAAG,mBAAmB,CAAC,OAAO,CAAC,CAAA;QAC9C,MAAM,OAAO,GAAG,SAAS;YACvB,CAAC,CAAC,aAAa,SAAS,4EAA4E;YACpG,CAAC,CAAC,SAAS,CAAA;QAEb,wEAAwE;QACxE,MAAM,YAAY,GAAG,SAAS,CAAC,IAAI,CAAC,OAAO,CAAC,CAAA;QAC5C,IAAI,CAAC,YAAY,EAAE,CAAC;YAClB,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,CAAA;QAC7B,CAAC;QAED,yEAAyE;QACzE,0EAA0E;QAC1E,8DAA8D;QAC9D,MAAM,SAAS,GAAG,cAAc,CAAC,mBAAmB,CAAC,CAAA;QACrD,MAAM,eAAe,GAAG,GAAG,SAAS,IAAI,OAAO,EAAE,CAAA;QAEjD,OAAO,EAAE,OAAO,EAAE,eAAe,EAAE,OAAO,EAAE,CAAA;IAC9C,CAAC;CACF,CAAA"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export interface NonInteractiveEnvConfig {
|
|
2
|
+
disabled?: boolean;
|
|
3
|
+
}
|
|
4
|
+
/**
|
|
5
|
+
* Shell hook interface for command interception
|
|
6
|
+
*/
|
|
7
|
+
export interface ShellHook {
|
|
8
|
+
name: string;
|
|
9
|
+
beforeCommand?(command: string): Promise<{
|
|
10
|
+
command: string;
|
|
11
|
+
warning?: string;
|
|
12
|
+
}>;
|
|
13
|
+
}
|
|
14
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/hooks/non-interactive-env/types.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,uBAAuB;IACtC,QAAQ,CAAC,EAAE,OAAO,CAAA;CACnB;AAED;;GAEG;AACH,MAAM,WAAW,SAAS;IACxB,IAAI,EAAE,MAAM,CAAA;IACZ,aAAa,CAAC,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC;QAAE,OAAO,EAAE,MAAM,CAAC;QAAC,OAAO,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC,CAAA;CAChF"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/hooks/non-interactive-env/types.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Preemptive Compaction Constants
|
|
3
|
+
*
|
|
4
|
+
* Thresholds and messages for context usage monitoring.
|
|
5
|
+
*
|
|
6
|
+
* Adapted from oh-my-opencode's preemptive-compaction hook.
|
|
7
|
+
*/
|
|
8
|
+
/**
|
|
9
|
+
* Default threshold ratio to trigger warning (85%)
|
|
10
|
+
*/
|
|
11
|
+
export declare const DEFAULT_THRESHOLD = 0.85;
|
|
12
|
+
/**
|
|
13
|
+
* Critical threshold ratio (95%)
|
|
14
|
+
*/
|
|
15
|
+
export declare const CRITICAL_THRESHOLD = 0.95;
|
|
16
|
+
/**
|
|
17
|
+
* Minimum tokens before considering compaction
|
|
18
|
+
*/
|
|
19
|
+
export declare const MIN_TOKENS_FOR_COMPACTION = 50000;
|
|
20
|
+
/**
|
|
21
|
+
* Cooldown period between compaction warnings (1 minute)
|
|
22
|
+
*/
|
|
23
|
+
export declare const COMPACTION_COOLDOWN_MS = 60000;
|
|
24
|
+
/**
|
|
25
|
+
* Maximum warnings per session before stopping
|
|
26
|
+
*/
|
|
27
|
+
export declare const MAX_WARNINGS = 3;
|
|
28
|
+
/**
|
|
29
|
+
* Default context limits for Claude models
|
|
30
|
+
*/
|
|
31
|
+
export declare const CLAUDE_DEFAULT_CONTEXT_LIMIT: number;
|
|
32
|
+
/**
|
|
33
|
+
* Average characters per token estimate
|
|
34
|
+
*/
|
|
35
|
+
export declare const CHARS_PER_TOKEN = 4;
|
|
36
|
+
/**
|
|
37
|
+
* Warning message when context usage is high
|
|
38
|
+
*/
|
|
39
|
+
export declare const CONTEXT_WARNING_MESSAGE = "CONTEXT WINDOW WARNING - APPROACHING LIMIT\n\nYour context usage is getting high. Consider these actions to prevent hitting the limit:\n\n1. USE COMPACT COMMAND\n - Run /compact to summarize the conversation\n - This frees up context space while preserving important information\n\n2. BE MORE CONCISE\n - Show only relevant code portions\n - Use file paths instead of full code blocks\n - Summarize instead of repeating information\n\n3. FOCUS YOUR REQUESTS\n - Work on one task at a time\n - Complete current tasks before starting new ones\n - Avoid unnecessary back-and-forth\n\nCurrent Status: Context usage is high but recoverable.\nAction recommended: Use /compact when convenient.\n";
|
|
40
|
+
/**
|
|
41
|
+
* Critical warning message when context is almost full
|
|
42
|
+
*/
|
|
43
|
+
export declare const CONTEXT_CRITICAL_MESSAGE = "CRITICAL: CONTEXT WINDOW ALMOST FULL\n\nYour context usage is critically high. Immediate action required:\n\n1. COMPACT NOW\n - Run /compact immediately to summarize the conversation\n - Without compaction, the next few messages may fail\n\n2. AVOID LARGE OUTPUTS\n - Do not show full files\n - Use summaries instead of detailed outputs\n - Be as concise as possible\n\n3. PREPARE FOR SESSION HANDOFF\n - If compaction doesn't help enough, prepare to continue in a new session\n - Note your current progress and next steps\n\nWARNING: Further messages may fail if context is not reduced.\nAction required: Run /compact now.\n";
|
|
44
|
+
/**
|
|
45
|
+
* Message when compaction was successful
|
|
46
|
+
*/
|
|
47
|
+
export declare const COMPACTION_SUCCESS_MESSAGE = "Context compacted successfully. Session can continue normally.";
|
|
48
|
+
//# sourceMappingURL=constants.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../src/hooks/preemptive-compaction/constants.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH;;GAEG;AACH,eAAO,MAAM,iBAAiB,OAAO,CAAC;AAEtC;;GAEG;AACH,eAAO,MAAM,kBAAkB,OAAO,CAAC;AAEvC;;GAEG;AACH,eAAO,MAAM,yBAAyB,QAAS,CAAC;AAEhD;;GAEG;AACH,eAAO,MAAM,sBAAsB,QAAS,CAAC;AAE7C;;GAEG;AACH,eAAO,MAAM,YAAY,IAAI,CAAC;AAE9B;;GAEG;AACH,eAAO,MAAM,4BAA4B,QAI5B,CAAC;AAEd;;GAEG;AACH,eAAO,MAAM,eAAe,IAAI,CAAC;AAEjC;;GAEG;AACH,eAAO,MAAM,uBAAuB,qsBAoBnC,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,wBAAwB,ooBAmBpC,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,0BAA0B,mEAAmE,CAAC"}
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Preemptive Compaction Constants
|
|
3
|
+
*
|
|
4
|
+
* Thresholds and messages for context usage monitoring.
|
|
5
|
+
*
|
|
6
|
+
* Adapted from oh-my-opencode's preemptive-compaction hook.
|
|
7
|
+
*/
|
|
8
|
+
/**
|
|
9
|
+
* Default threshold ratio to trigger warning (85%)
|
|
10
|
+
*/
|
|
11
|
+
export const DEFAULT_THRESHOLD = 0.85;
|
|
12
|
+
/**
|
|
13
|
+
* Critical threshold ratio (95%)
|
|
14
|
+
*/
|
|
15
|
+
export const CRITICAL_THRESHOLD = 0.95;
|
|
16
|
+
/**
|
|
17
|
+
* Minimum tokens before considering compaction
|
|
18
|
+
*/
|
|
19
|
+
export const MIN_TOKENS_FOR_COMPACTION = 50_000;
|
|
20
|
+
/**
|
|
21
|
+
* Cooldown period between compaction warnings (1 minute)
|
|
22
|
+
*/
|
|
23
|
+
export const COMPACTION_COOLDOWN_MS = 60_000;
|
|
24
|
+
/**
|
|
25
|
+
* Maximum warnings per session before stopping
|
|
26
|
+
*/
|
|
27
|
+
export const MAX_WARNINGS = 3;
|
|
28
|
+
/**
|
|
29
|
+
* Default context limits for Claude models
|
|
30
|
+
*/
|
|
31
|
+
export const CLAUDE_DEFAULT_CONTEXT_LIMIT = process.env.ANTHROPIC_1M_CONTEXT === 'true' ||
|
|
32
|
+
process.env.VERTEX_ANTHROPIC_1M_CONTEXT === 'true'
|
|
33
|
+
? 1_000_000
|
|
34
|
+
: 200_000;
|
|
35
|
+
/**
|
|
36
|
+
* Average characters per token estimate
|
|
37
|
+
*/
|
|
38
|
+
export const CHARS_PER_TOKEN = 4;
|
|
39
|
+
/**
|
|
40
|
+
* Warning message when context usage is high
|
|
41
|
+
*/
|
|
42
|
+
export const CONTEXT_WARNING_MESSAGE = `CONTEXT WINDOW WARNING - APPROACHING LIMIT
|
|
43
|
+
|
|
44
|
+
Your context usage is getting high. Consider these actions to prevent hitting the limit:
|
|
45
|
+
|
|
46
|
+
1. USE COMPACT COMMAND
|
|
47
|
+
- Run /compact to summarize the conversation
|
|
48
|
+
- This frees up context space while preserving important information
|
|
49
|
+
|
|
50
|
+
2. BE MORE CONCISE
|
|
51
|
+
- Show only relevant code portions
|
|
52
|
+
- Use file paths instead of full code blocks
|
|
53
|
+
- Summarize instead of repeating information
|
|
54
|
+
|
|
55
|
+
3. FOCUS YOUR REQUESTS
|
|
56
|
+
- Work on one task at a time
|
|
57
|
+
- Complete current tasks before starting new ones
|
|
58
|
+
- Avoid unnecessary back-and-forth
|
|
59
|
+
|
|
60
|
+
Current Status: Context usage is high but recoverable.
|
|
61
|
+
Action recommended: Use /compact when convenient.
|
|
62
|
+
`;
|
|
63
|
+
/**
|
|
64
|
+
* Critical warning message when context is almost full
|
|
65
|
+
*/
|
|
66
|
+
export const CONTEXT_CRITICAL_MESSAGE = `CRITICAL: CONTEXT WINDOW ALMOST FULL
|
|
67
|
+
|
|
68
|
+
Your context usage is critically high. Immediate action required:
|
|
69
|
+
|
|
70
|
+
1. COMPACT NOW
|
|
71
|
+
- Run /compact immediately to summarize the conversation
|
|
72
|
+
- Without compaction, the next few messages may fail
|
|
73
|
+
|
|
74
|
+
2. AVOID LARGE OUTPUTS
|
|
75
|
+
- Do not show full files
|
|
76
|
+
- Use summaries instead of detailed outputs
|
|
77
|
+
- Be as concise as possible
|
|
78
|
+
|
|
79
|
+
3. PREPARE FOR SESSION HANDOFF
|
|
80
|
+
- If compaction doesn't help enough, prepare to continue in a new session
|
|
81
|
+
- Note your current progress and next steps
|
|
82
|
+
|
|
83
|
+
WARNING: Further messages may fail if context is not reduced.
|
|
84
|
+
Action required: Run /compact now.
|
|
85
|
+
`;
|
|
86
|
+
/**
|
|
87
|
+
* Message when compaction was successful
|
|
88
|
+
*/
|
|
89
|
+
export const COMPACTION_SUCCESS_MESSAGE = `Context compacted successfully. Session can continue normally.`;
|
|
90
|
+
//# sourceMappingURL=constants.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../src/hooks/preemptive-compaction/constants.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH;;GAEG;AACH,MAAM,CAAC,MAAM,iBAAiB,GAAG,IAAI,CAAC;AAEtC;;GAEG;AACH,MAAM,CAAC,MAAM,kBAAkB,GAAG,IAAI,CAAC;AAEvC;;GAEG;AACH,MAAM,CAAC,MAAM,yBAAyB,GAAG,MAAM,CAAC;AAEhD;;GAEG;AACH,MAAM,CAAC,MAAM,sBAAsB,GAAG,MAAM,CAAC;AAE7C;;GAEG;AACH,MAAM,CAAC,MAAM,YAAY,GAAG,CAAC,CAAC;AAE9B;;GAEG;AACH,MAAM,CAAC,MAAM,4BAA4B,GACvC,OAAO,CAAC,GAAG,CAAC,oBAAoB,KAAK,MAAM;IAC3C,OAAO,CAAC,GAAG,CAAC,2BAA2B,KAAK,MAAM;IAChD,CAAC,CAAC,SAAS;IACX,CAAC,CAAC,OAAO,CAAC;AAEd;;GAEG;AACH,MAAM,CAAC,MAAM,eAAe,GAAG,CAAC,CAAC;AAEjC;;GAEG;AACH,MAAM,CAAC,MAAM,uBAAuB,GAAG;;;;;;;;;;;;;;;;;;;;CAoBtC,CAAC;AAEF;;GAEG;AACH,MAAM,CAAC,MAAM,wBAAwB,GAAG;;;;;;;;;;;;;;;;;;;CAmBvC,CAAC;AAEF;;GAEG;AACH,MAAM,CAAC,MAAM,0BAA0B,GAAG,gEAAgE,CAAC"}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Preemptive Compaction Hook
|
|
3
|
+
*
|
|
4
|
+
* Monitors context usage and warns before hitting the context limit.
|
|
5
|
+
* Encourages proactive compaction to prevent context overflow.
|
|
6
|
+
*
|
|
7
|
+
* Adapted from oh-my-opencode's preemptive-compaction hook.
|
|
8
|
+
*
|
|
9
|
+
* Note: This is a simplified version for Claude Code's shell hook system.
|
|
10
|
+
* The original uses OpenCode's plugin event system for automatic summarization.
|
|
11
|
+
* This version injects warning messages to prompt manual compaction.
|
|
12
|
+
*/
|
|
13
|
+
import type { ContextUsageResult, PreemptiveCompactionConfig } from './types.js';
|
|
14
|
+
/**
|
|
15
|
+
* Estimate tokens from text content
|
|
16
|
+
*/
|
|
17
|
+
export declare function estimateTokens(text: string): number;
|
|
18
|
+
/**
|
|
19
|
+
* Analyze context usage based on conversation content
|
|
20
|
+
*/
|
|
21
|
+
export declare function analyzeContextUsage(content: string, config?: PreemptiveCompactionConfig): ContextUsageResult;
|
|
22
|
+
/**
|
|
23
|
+
* Create preemptive compaction hook
|
|
24
|
+
*
|
|
25
|
+
* This hook monitors context usage and injects warning messages
|
|
26
|
+
* when approaching the context limit.
|
|
27
|
+
*/
|
|
28
|
+
export declare function createPreemptiveCompactionHook(config?: PreemptiveCompactionConfig): {
|
|
29
|
+
/**
|
|
30
|
+
* PostToolUse - Check context usage after large tool outputs
|
|
31
|
+
*/
|
|
32
|
+
postToolUse: (input: {
|
|
33
|
+
tool_name: string;
|
|
34
|
+
session_id: string;
|
|
35
|
+
tool_input: Record<string, unknown>;
|
|
36
|
+
tool_response?: string;
|
|
37
|
+
}) => string | null;
|
|
38
|
+
/**
|
|
39
|
+
* Stop event - Check context before stopping
|
|
40
|
+
*/
|
|
41
|
+
stop: (input: {
|
|
42
|
+
session_id: string;
|
|
43
|
+
}) => string | null;
|
|
44
|
+
};
|
|
45
|
+
/**
|
|
46
|
+
* Get estimated token usage for a session
|
|
47
|
+
*/
|
|
48
|
+
export declare function getSessionTokenEstimate(sessionId: string): number;
|
|
49
|
+
/**
|
|
50
|
+
* Reset token estimate for a session (e.g., after compaction)
|
|
51
|
+
*/
|
|
52
|
+
export declare function resetSessionTokenEstimate(sessionId: string): void;
|
|
53
|
+
export type { PreemptiveCompactionState, TokenInfo, ModelLimits, ContextUsageResult, PreemptiveCompactionConfig, } from './types.js';
|
|
54
|
+
export { DEFAULT_THRESHOLD, CRITICAL_THRESHOLD, MIN_TOKENS_FOR_COMPACTION, COMPACTION_COOLDOWN_MS, MAX_WARNINGS, CLAUDE_DEFAULT_CONTEXT_LIMIT, CHARS_PER_TOKEN, CONTEXT_WARNING_MESSAGE, CONTEXT_CRITICAL_MESSAGE, COMPACTION_SUCCESS_MESSAGE, } from './constants.js';
|
|
55
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/hooks/preemptive-compaction/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAkBH,OAAO,KAAK,EAIV,kBAAkB,EAClB,0BAA0B,EAC3B,MAAM,YAAY,CAAC;AAyDpB;;GAEG;AACH,wBAAgB,cAAc,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAEnD;AAED;;GAEG;AACH,wBAAgB,mBAAmB,CACjC,OAAO,EAAE,MAAM,EACf,MAAM,CAAC,EAAE,0BAA0B,GAClC,kBAAkB,CAyBpB;AA+DD;;;;;GAKG;AACH,wBAAgB,8BAA8B,CAC5C,MAAM,CAAC,EAAE,0BAA0B;IAiBjC;;OAEG;yBACkB;QACnB,SAAS,EAAE,MAAM,CAAC;QAClB,UAAU,EAAE,MAAM,CAAC;QACnB,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;QACpC,aAAa,CAAC,EAAE,MAAM,CAAC;KACxB,KAAG,MAAM,GAAG,IAAI;IAwDjB;;OAEG;kBACW;QAAE,UAAU,EAAE,MAAM,CAAA;KAAE,KAAG,MAAM,GAAG,IAAI;EAevD;AAED;;GAEG;AACH,wBAAgB,uBAAuB,CAAC,SAAS,EAAE,MAAM,GAAG,MAAM,CAGjE;AAED;;GAEG;AACH,wBAAgB,yBAAyB,CAAC,SAAS,EAAE,MAAM,GAAG,IAAI,CAOjE;AAGD,YAAY,EACV,yBAAyB,EACzB,SAAS,EACT,WAAW,EACX,kBAAkB,EAClB,0BAA0B,GAC3B,MAAM,YAAY,CAAC;AAEpB,OAAO,EACL,iBAAiB,EACjB,kBAAkB,EAClB,yBAAyB,EACzB,sBAAsB,EACtB,YAAY,EACZ,4BAA4B,EAC5B,eAAe,EACf,uBAAuB,EACvB,wBAAwB,EACxB,0BAA0B,GAC3B,MAAM,gBAAgB,CAAC"}
|