oh-my-musacode 0.0.1
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.md +82 -0
- package/README.ja.md +370 -0
- package/README.md +376 -0
- package/README.zh-cn.md +380 -0
- package/bin/oh-my-musacode-dev.js +80 -0
- package/bin/oh-my-musacode.js +80 -0
- package/bin/platform.js +38 -0
- package/bin/platform.test.ts +148 -0
- package/dist/agents/atlas.d.ts +19 -0
- package/dist/agents/dynamic-agent-prompt-builder.d.ts +30 -0
- package/dist/agents/explore.d.ts +4 -0
- package/dist/agents/index.d.ts +11 -0
- package/dist/agents/librarian.d.ts +4 -0
- package/dist/agents/metis.d.ts +18 -0
- package/dist/agents/momus.d.ts +18 -0
- package/dist/agents/momus.test.d.ts +1 -0
- package/dist/agents/multimodal-looker.d.ts +4 -0
- package/dist/agents/musa-orchestrator-junior.d.ts +7 -0
- package/dist/agents/musa-orchestrator-junior.test.d.ts +1 -0
- package/dist/agents/musa-orchestrator.d.ts +3 -0
- package/dist/agents/oracle.d.ts +4 -0
- package/dist/agents/prometheus-prompt.d.ts +29 -0
- package/dist/agents/prometheus-prompt.test.d.ts +1 -0
- package/dist/agents/sisyphus-junior.d.ts +7 -0
- package/dist/agents/sisyphus-junior.test.d.ts +1 -0
- package/dist/agents/sisyphus.d.ts +3 -0
- package/dist/agents/types.d.ts +50 -0
- package/dist/agents/utils.d.ts +14 -0
- package/dist/agents/utils.test.d.ts +1 -0
- package/dist/cli/config-manager.d.ts +99 -0
- package/dist/cli/config-manager.test.d.ts +1 -0
- package/dist/cli/doctor/checks/auth.d.ts +7 -0
- package/dist/cli/doctor/checks/auth.test.d.ts +1 -0
- package/dist/cli/doctor/checks/config.d.ts +8 -0
- package/dist/cli/doctor/checks/config.test.d.ts +1 -0
- package/dist/cli/doctor/checks/dependencies.d.ts +8 -0
- package/dist/cli/doctor/checks/dependencies.test.d.ts +1 -0
- package/dist/cli/doctor/checks/gh.d.ts +13 -0
- package/dist/cli/doctor/checks/gh.test.d.ts +1 -0
- package/dist/cli/doctor/checks/index.d.ts +11 -0
- package/dist/cli/doctor/checks/lsp.d.ts +8 -0
- package/dist/cli/doctor/checks/lsp.test.d.ts +1 -0
- package/dist/cli/doctor/checks/mcp.d.ts +6 -0
- package/dist/cli/doctor/checks/mcp.test.d.ts +1 -0
- package/dist/cli/doctor/checks/musacode.d.ts +14 -0
- package/dist/cli/doctor/checks/musacode.test.d.ts +1 -0
- package/dist/cli/doctor/checks/plugin.d.ts +4 -0
- package/dist/cli/doctor/checks/plugin.test.d.ts +1 -0
- package/dist/cli/doctor/checks/version.d.ts +4 -0
- package/dist/cli/doctor/checks/version.test.d.ts +1 -0
- package/dist/cli/doctor/constants.d.ts +40 -0
- package/dist/cli/doctor/formatter.d.ts +12 -0
- package/dist/cli/doctor/formatter.test.d.ts +1 -0
- package/dist/cli/doctor/index.d.ts +5 -0
- package/dist/cli/doctor/runner.d.ts +7 -0
- package/dist/cli/doctor/runner.test.d.ts +1 -0
- package/dist/cli/doctor/types.d.ts +91 -0
- package/dist/cli/get-local-version/formatter.d.ts +3 -0
- package/dist/cli/get-local-version/index.d.ts +3 -0
- package/dist/cli/get-local-version/types.d.ts +13 -0
- package/dist/cli/index.d.ts +2 -0
- package/dist/cli/index.js +25243 -0
- package/dist/cli/install.d.ts +2 -0
- package/dist/cli/run/completion.d.ts +2 -0
- package/dist/cli/run/completion.test.d.ts +1 -0
- package/dist/cli/run/events.d.ts +12 -0
- package/dist/cli/run/events.test.d.ts +1 -0
- package/dist/cli/run/index.d.ts +2 -0
- package/dist/cli/run/runner.d.ts +2 -0
- package/dist/cli/run/types.d.ts +71 -0
- package/dist/cli/types.d.ts +27 -0
- package/dist/config/index.d.ts +2 -0
- package/dist/config/schema.d.ts +1835 -0
- package/dist/config/schema.test.d.ts +1 -0
- package/dist/features/background-agent/concurrency.d.ts +27 -0
- package/dist/features/background-agent/concurrency.test.d.ts +1 -0
- package/dist/features/background-agent/index.d.ts +3 -0
- package/dist/features/background-agent/manager.d.ts +104 -0
- package/dist/features/background-agent/manager.test.d.ts +1 -0
- package/dist/features/background-agent/types.d.ts +73 -0
- package/dist/features/boulder-state/constants.d.ts +10 -0
- package/dist/features/boulder-state/index.d.ts +3 -0
- package/dist/features/boulder-state/storage.d.ts +28 -0
- package/dist/features/boulder-state/storage.test.d.ts +1 -0
- package/dist/features/boulder-state/types.d.ts +24 -0
- package/dist/features/builtin-commands/commands.d.ts +2 -0
- package/dist/features/builtin-commands/index.d.ts +2 -0
- package/dist/features/builtin-commands/templates/init-deep.d.ts +1 -0
- package/dist/features/builtin-commands/templates/ralph-loop.d.ts +2 -0
- package/dist/features/builtin-commands/templates/refactor.d.ts +1 -0
- package/dist/features/builtin-commands/templates/start-work.d.ts +1 -0
- package/dist/features/builtin-commands/types.d.ts +6 -0
- package/dist/features/builtin-skills/index.d.ts +2 -0
- package/dist/features/builtin-skills/skills.d.ts +2 -0
- package/dist/features/builtin-skills/types.d.ts +15 -0
- package/dist/features/claude-code-agent-loader/index.d.ts +2 -0
- package/dist/features/claude-code-agent-loader/loader.d.ts +3 -0
- package/dist/features/claude-code-agent-loader/types.d.ts +14 -0
- package/dist/features/claude-code-command-loader/index.d.ts +2 -0
- package/dist/features/claude-code-command-loader/loader.d.ts +6 -0
- package/dist/features/claude-code-command-loader/types.d.ts +42 -0
- package/dist/features/claude-code-mcp-loader/env-expander.d.ts +2 -0
- package/dist/features/claude-code-mcp-loader/index.d.ts +10 -0
- package/dist/features/claude-code-mcp-loader/loader.d.ts +4 -0
- package/dist/features/claude-code-mcp-loader/loader.test.d.ts +1 -0
- package/dist/features/claude-code-mcp-loader/transformer.d.ts +2 -0
- package/dist/features/claude-code-mcp-loader/types.d.ts +35 -0
- package/dist/features/claude-code-plugin-loader/index.d.ts +3 -0
- package/dist/features/claude-code-plugin-loader/loader.d.ts +20 -0
- package/dist/features/claude-code-plugin-loader/types.d.ts +186 -0
- package/dist/features/claude-code-session-state/index.d.ts +1 -0
- package/dist/features/claude-code-session-state/state.d.ts +9 -0
- package/dist/features/claude-code-session-state/state.test.d.ts +1 -0
- package/dist/features/context-injector/collector.d.ts +11 -0
- package/dist/features/context-injector/collector.test.d.ts +1 -0
- package/dist/features/context-injector/index.d.ts +3 -0
- package/dist/features/context-injector/injector.d.ts +39 -0
- package/dist/features/context-injector/injector.test.d.ts +1 -0
- package/dist/features/context-injector/types.d.ts +83 -0
- package/dist/features/hook-message-injector/constants.d.ts +3 -0
- package/dist/features/hook-message-injector/index.d.ts +4 -0
- package/dist/features/hook-message-injector/injector.d.ts +18 -0
- package/dist/features/hook-message-injector/types.d.ts +44 -0
- package/dist/features/musacode-skill-loader/async-loader.d.ts +6 -0
- package/dist/features/musacode-skill-loader/async-loader.test.d.ts +1 -0
- package/dist/features/musacode-skill-loader/blocking.d.ts +2 -0
- package/dist/features/musacode-skill-loader/blocking.test.d.ts +1 -0
- package/dist/features/musacode-skill-loader/discover-worker.d.ts +1 -0
- package/dist/features/musacode-skill-loader/index.d.ts +4 -0
- package/dist/features/musacode-skill-loader/loader.d.ts +16 -0
- package/dist/features/musacode-skill-loader/loader.test.d.ts +1 -0
- package/dist/features/musacode-skill-loader/merger.d.ts +7 -0
- package/dist/features/musacode-skill-loader/skill-content.d.ts +20 -0
- package/dist/features/musacode-skill-loader/skill-content.test.d.ts +1 -0
- package/dist/features/musacode-skill-loader/types.d.ts +34 -0
- package/dist/features/skill-mcp-manager/env-cleaner.d.ts +2 -0
- package/dist/features/skill-mcp-manager/env-cleaner.test.d.ts +1 -0
- package/dist/features/skill-mcp-manager/index.d.ts +2 -0
- package/dist/features/skill-mcp-manager/manager.d.ts +40 -0
- package/dist/features/skill-mcp-manager/manager.test.d.ts +1 -0
- package/dist/features/skill-mcp-manager/types.d.ts +11 -0
- package/dist/features/task-toast-manager/index.d.ts +2 -0
- package/dist/features/task-toast-manager/manager.d.ts +57 -0
- package/dist/features/task-toast-manager/manager.test.d.ts +1 -0
- package/dist/features/task-toast-manager/types.d.ts +21 -0
- package/dist/hooks/agent-usage-reminder/constants.d.ts +5 -0
- package/dist/hooks/agent-usage-reminder/index.d.ts +22 -0
- package/dist/hooks/agent-usage-reminder/storage.d.ts +4 -0
- package/dist/hooks/agent-usage-reminder/types.d.ts +6 -0
- package/dist/hooks/anthropic-context-window-limit-recovery/executor.d.ts +4 -0
- package/dist/hooks/anthropic-context-window-limit-recovery/executor.test.d.ts +1 -0
- package/dist/hooks/anthropic-context-window-limit-recovery/index.d.ts +16 -0
- package/dist/hooks/anthropic-context-window-limit-recovery/parser.d.ts +2 -0
- package/dist/hooks/anthropic-context-window-limit-recovery/pruning-deduplication.d.ts +7 -0
- package/dist/hooks/anthropic-context-window-limit-recovery/pruning-deduplication.test.d.ts +1 -0
- package/dist/hooks/anthropic-context-window-limit-recovery/pruning-types.d.ts +36 -0
- package/dist/hooks/anthropic-context-window-limit-recovery/storage.d.ts +28 -0
- package/dist/hooks/anthropic-context-window-limit-recovery/storage.test.d.ts +1 -0
- package/dist/hooks/anthropic-context-window-limit-recovery/types.d.ts +37 -0
- package/dist/hooks/atlas/index.d.ts +35 -0
- package/dist/hooks/atlas/index.test.d.ts +1 -0
- package/dist/hooks/auto-slash-command/constants.d.ts +5 -0
- package/dist/hooks/auto-slash-command/detector.d.ts +9 -0
- package/dist/hooks/auto-slash-command/detector.test.d.ts +1 -0
- package/dist/hooks/auto-slash-command/executor.d.ts +11 -0
- package/dist/hooks/auto-slash-command/index.d.ts +12 -0
- package/dist/hooks/auto-slash-command/index.test.d.ts +1 -0
- package/dist/hooks/auto-slash-command/types.d.ts +27 -0
- package/dist/hooks/auto-update-checker/cache.d.ts +3 -0
- package/dist/hooks/auto-update-checker/checker.d.ts +20 -0
- package/dist/hooks/auto-update-checker/checker.test.d.ts +1 -0
- package/dist/hooks/auto-update-checker/constants.d.ts +13 -0
- package/dist/hooks/auto-update-checker/index.d.ts +17 -0
- package/dist/hooks/auto-update-checker/index.test.d.ts +1 -0
- package/dist/hooks/auto-update-checker/types.d.ts +25 -0
- package/dist/hooks/background-compaction/index.d.ts +19 -0
- package/dist/hooks/background-notification/index.d.ts +18 -0
- package/dist/hooks/background-notification/types.d.ts +4 -0
- package/dist/hooks/claude-code-hooks/config-loader.d.ts +13 -0
- package/dist/hooks/claude-code-hooks/config.d.ts +3 -0
- package/dist/hooks/claude-code-hooks/index.d.ts +48 -0
- package/dist/hooks/claude-code-hooks/plugin-config.d.ts +8 -0
- package/dist/hooks/claude-code-hooks/post-tool-use.d.ts +40 -0
- package/dist/hooks/claude-code-hooks/pre-compact.d.ts +16 -0
- package/dist/hooks/claude-code-hooks/pre-tool-use.d.ts +25 -0
- package/dist/hooks/claude-code-hooks/stop.d.ts +20 -0
- package/dist/hooks/claude-code-hooks/todo.d.ts +12 -0
- package/dist/hooks/claude-code-hooks/tool-input-cache.d.ts +5 -0
- package/dist/hooks/claude-code-hooks/transcript.d.ts +38 -0
- package/dist/hooks/claude-code-hooks/types.d.ts +183 -0
- package/dist/hooks/claude-code-hooks/user-prompt-submit.d.ts +22 -0
- package/dist/hooks/comment-checker/cli.d.ts +52 -0
- package/dist/hooks/comment-checker/cli.test.d.ts +1 -0
- package/dist/hooks/comment-checker/downloader.d.ts +25 -0
- package/dist/hooks/comment-checker/index.d.ts +19 -0
- package/dist/hooks/comment-checker/types.d.ts +31 -0
- package/dist/hooks/compaction-context-injector/index.d.ts +8 -0
- package/dist/hooks/context-window-monitor.d.ts +18 -0
- package/dist/hooks/delegate-task-retry/index.d.ts +24 -0
- package/dist/hooks/delegate-task-retry/index.test.d.ts +1 -0
- package/dist/hooks/directory-agents-injector/constants.d.ts +3 -0
- package/dist/hooks/directory-agents-injector/index.d.ts +26 -0
- package/dist/hooks/directory-agents-injector/storage.d.ts +3 -0
- package/dist/hooks/directory-agents-injector/types.d.ts +5 -0
- package/dist/hooks/directory-readme-injector/constants.d.ts +3 -0
- package/dist/hooks/directory-readme-injector/index.d.ts +26 -0
- package/dist/hooks/directory-readme-injector/storage.d.ts +3 -0
- package/dist/hooks/directory-readme-injector/types.d.ts +5 -0
- package/dist/hooks/edit-error-recovery/index.d.ts +31 -0
- package/dist/hooks/edit-error-recovery/index.test.d.ts +1 -0
- package/dist/hooks/empty-task-response-detector.d.ts +12 -0
- package/dist/hooks/index.d.ts +29 -0
- package/dist/hooks/interactive-bash-session/constants.d.ts +4 -0
- package/dist/hooks/interactive-bash-session/index.d.ts +23 -0
- package/dist/hooks/interactive-bash-session/storage.d.ts +4 -0
- package/dist/hooks/interactive-bash-session/types.d.ts +10 -0
- package/dist/hooks/keyword-detector/constants.d.ts +12 -0
- package/dist/hooks/keyword-detector/detector.d.ts +11 -0
- package/dist/hooks/keyword-detector/index.d.ts +23 -0
- package/dist/hooks/keyword-detector/index.test.d.ts +1 -0
- package/dist/hooks/keyword-detector/types.d.ts +4 -0
- package/dist/hooks/non-interactive-env/constants.d.ts +34 -0
- package/dist/hooks/non-interactive-env/detector.d.ts +1 -0
- package/dist/hooks/non-interactive-env/index.d.ts +14 -0
- package/dist/hooks/non-interactive-env/index.test.d.ts +1 -0
- package/dist/hooks/non-interactive-env/types.d.ts +3 -0
- package/dist/hooks/prometheus-md-only/constants.d.ts +6 -0
- package/dist/hooks/prometheus-md-only/index.d.ts +12 -0
- package/dist/hooks/prometheus-md-only/index.test.d.ts +1 -0
- package/dist/hooks/ralph-loop/constants.d.ts +5 -0
- package/dist/hooks/ralph-loop/index.d.ts +21 -0
- package/dist/hooks/ralph-loop/index.test.d.ts +1 -0
- package/dist/hooks/ralph-loop/storage.d.ts +6 -0
- package/dist/hooks/ralph-loop/types.d.ts +17 -0
- package/dist/hooks/rules-injector/constants.d.ts +8 -0
- package/dist/hooks/rules-injector/finder.d.ts +33 -0
- package/dist/hooks/rules-injector/finder.test.d.ts +1 -0
- package/dist/hooks/rules-injector/index.d.ts +26 -0
- package/dist/hooks/rules-injector/matcher.d.ts +21 -0
- package/dist/hooks/rules-injector/parser.d.ts +18 -0
- package/dist/hooks/rules-injector/parser.test.d.ts +1 -0
- package/dist/hooks/rules-injector/storage.d.ts +9 -0
- package/dist/hooks/rules-injector/types.d.ts +54 -0
- package/dist/hooks/session-notification-utils.d.ts +9 -0
- package/dist/hooks/session-notification.d.ts +20 -0
- package/dist/hooks/session-notification.test.d.ts +1 -0
- package/dist/hooks/session-recovery/constants.d.ts +6 -0
- package/dist/hooks/session-recovery/index.d.ts +22 -0
- package/dist/hooks/session-recovery/index.test.d.ts +1 -0
- package/dist/hooks/session-recovery/storage.d.ts +19 -0
- package/dist/hooks/session-recovery/types.d.ts +90 -0
- package/dist/hooks/start-work/index.d.ts +16 -0
- package/dist/hooks/start-work/index.test.d.ts +1 -0
- package/dist/hooks/task-resume-info/index.d.ts +11 -0
- package/dist/hooks/think-mode/detector.d.ts +5 -0
- package/dist/hooks/think-mode/index.d.ts +14 -0
- package/dist/hooks/think-mode/index.test.d.ts +1 -0
- package/dist/hooks/think-mode/switcher.d.ts +57 -0
- package/dist/hooks/think-mode/switcher.test.d.ts +1 -0
- package/dist/hooks/think-mode/types.d.ts +21 -0
- package/dist/hooks/thinking-block-validator/index.d.ts +30 -0
- package/dist/hooks/todo-continuation-enforcer.d.ts +17 -0
- package/dist/hooks/todo-continuation-enforcer.test.d.ts +1 -0
- package/dist/hooks/tool-output-truncator.d.ts +17 -0
- package/dist/hooks/tool-output-truncator.test.d.ts +1 -0
- package/dist/index.d.ts +5 -0
- package/dist/index.js +67990 -0
- package/dist/mcp/context7.d.ts +6 -0
- package/dist/mcp/grep-app.d.ts +6 -0
- package/dist/mcp/index.d.ts +9 -0
- package/dist/mcp/index.test.d.ts +1 -0
- package/dist/mcp/types.d.ts +9 -0
- package/dist/mcp/websearch.d.ts +9 -0
- package/dist/plugin-config.d.ts +4 -0
- package/dist/plugin-config.test.d.ts +1 -0
- package/dist/plugin-handlers/config-handler.d.ts +12 -0
- package/dist/plugin-handlers/config-handler.test.d.ts +1 -0
- package/dist/plugin-handlers/index.d.ts +1 -0
- package/dist/plugin-state.d.ts +6 -0
- package/dist/shared/agent-tool-restrictions.d.ts +7 -0
- package/dist/shared/agent-variant.d.ts +5 -0
- package/dist/shared/agent-variant.test.d.ts +1 -0
- package/dist/shared/claude-config-dir.d.ts +1 -0
- package/dist/shared/claude-config-dir.test.d.ts +1 -0
- package/dist/shared/command-executor.d.ts +21 -0
- package/dist/shared/config-errors.d.ts +7 -0
- package/dist/shared/config-path.d.ts +17 -0
- package/dist/shared/data-path.d.ts +14 -0
- package/dist/shared/deep-merge.d.ts +13 -0
- package/dist/shared/deep-merge.test.d.ts +1 -0
- package/dist/shared/dynamic-truncator.d.ts +27 -0
- package/dist/shared/external-plugin-detector.d.ts +18 -0
- package/dist/shared/external-plugin-detector.test.d.ts +1 -0
- package/dist/shared/file-reference-resolver.d.ts +1 -0
- package/dist/shared/file-utils.d.ts +7 -0
- package/dist/shared/first-message-variant.d.ts +11 -0
- package/dist/shared/first-message-variant.test.d.ts +1 -0
- package/dist/shared/frontmatter.d.ts +7 -0
- package/dist/shared/frontmatter.test.d.ts +1 -0
- package/dist/shared/hook-disabled.d.ts +2 -0
- package/dist/shared/index.d.ts +29 -0
- package/dist/shared/jsonc-parser.d.ts +15 -0
- package/dist/shared/jsonc-parser.test.d.ts +1 -0
- package/dist/shared/logger.d.ts +2 -0
- package/dist/shared/migration.d.ts +31 -0
- package/dist/shared/migration.test.d.ts +1 -0
- package/dist/shared/model-resolver.d.ts +19 -0
- package/dist/shared/model-resolver.test.d.ts +1 -0
- package/dist/shared/model-sanitizer.d.ts +3 -0
- package/dist/shared/musacode-config-dir.d.ts +19 -0
- package/dist/shared/musacode-config-dir.test.d.ts +1 -0
- package/dist/shared/musacode-version.d.ts +13 -0
- package/dist/shared/musacode-version.test.d.ts +1 -0
- package/dist/shared/pattern-matcher.d.ts +3 -0
- package/dist/shared/permission-compat.d.ts +27 -0
- package/dist/shared/permission-compat.test.d.ts +1 -0
- package/dist/shared/session-cursor.d.ts +13 -0
- package/dist/shared/session-cursor.test.d.ts +1 -0
- package/dist/shared/shell-env.d.ts +41 -0
- package/dist/shared/shell-env.test.d.ts +1 -0
- package/dist/shared/snake-case.d.ts +4 -0
- package/dist/shared/system-directive.d.ts +31 -0
- package/dist/shared/tool-name.d.ts +1 -0
- package/dist/shared/zip-extractor.d.ts +1 -0
- package/dist/tools/ast-grep/cli.d.ts +15 -0
- package/dist/tools/ast-grep/constants.d.ts +29 -0
- package/dist/tools/ast-grep/downloader.d.ts +5 -0
- package/dist/tools/ast-grep/index.d.ts +8 -0
- package/dist/tools/ast-grep/tools.d.ts +3 -0
- package/dist/tools/ast-grep/types.d.ts +58 -0
- package/dist/tools/ast-grep/utils.d.ts +5 -0
- package/dist/tools/background-task/constants.d.ts +3 -0
- package/dist/tools/background-task/index.d.ts +3 -0
- package/dist/tools/background-task/tools.d.ts +7 -0
- package/dist/tools/background-task/types.d.ts +14 -0
- package/dist/tools/call-omo-agent/constants.d.ts +2 -0
- package/dist/tools/call-omo-agent/index.d.ts +3 -0
- package/dist/tools/call-omo-agent/tools.d.ts +3 -0
- package/dist/tools/call-omo-agent/types.d.ts +24 -0
- package/dist/tools/delegate-task/constants.d.ts +12 -0
- package/dist/tools/delegate-task/index.d.ts +3 -0
- package/dist/tools/delegate-task/tools.d.ts +27 -0
- package/dist/tools/delegate-task/tools.test.d.ts +1 -0
- package/dist/tools/delegate-task/types.d.ts +9 -0
- package/dist/tools/glob/cli.d.ts +11 -0
- package/dist/tools/glob/cli.test.d.ts +1 -0
- package/dist/tools/glob/constants.d.ts +6 -0
- package/dist/tools/glob/index.d.ts +2 -0
- package/dist/tools/glob/tools.d.ts +2 -0
- package/dist/tools/glob/types.d.ts +20 -0
- package/dist/tools/glob/utils.d.ts +2 -0
- package/dist/tools/grep/cli.d.ts +3 -0
- package/dist/tools/grep/constants.d.ts +17 -0
- package/dist/tools/grep/downloader.d.ts +3 -0
- package/dist/tools/grep/downloader.test.d.ts +1 -0
- package/dist/tools/grep/index.d.ts +2 -0
- package/dist/tools/grep/tools.d.ts +2 -0
- package/dist/tools/grep/types.d.ts +36 -0
- package/dist/tools/grep/utils.d.ts +3 -0
- package/dist/tools/index.d.ts +16 -0
- package/dist/tools/interactive-bash/constants.d.ts +3 -0
- package/dist/tools/interactive-bash/index.d.ts +3 -0
- package/dist/tools/interactive-bash/tools.d.ts +7 -0
- package/dist/tools/interactive-bash/utils.d.ts +3 -0
- package/dist/tools/look-at/constants.d.ts +2 -0
- package/dist/tools/look-at/index.d.ts +3 -0
- package/dist/tools/look-at/tools.d.ts +9 -0
- package/dist/tools/look-at/tools.test.d.ts +1 -0
- package/dist/tools/look-at/types.d.ts +4 -0
- package/dist/tools/lsp/client.d.ts +57 -0
- package/dist/tools/lsp/config.d.ts +17 -0
- package/dist/tools/lsp/config.test.d.ts +1 -0
- package/dist/tools/lsp/constants.d.ts +9 -0
- package/dist/tools/lsp/index.d.ts +6 -0
- package/dist/tools/lsp/tools.d.ts +7 -0
- package/dist/tools/lsp/types.d.ts +123 -0
- package/dist/tools/lsp/utils.d.ts +26 -0
- package/dist/tools/session-manager/constants.d.ts +12 -0
- package/dist/tools/session-manager/index.d.ts +3 -0
- package/dist/tools/session-manager/storage.d.ts +12 -0
- package/dist/tools/session-manager/storage.test.d.ts +1 -0
- package/dist/tools/session-manager/tools.d.ts +5 -0
- package/dist/tools/session-manager/tools.test.d.ts +1 -0
- package/dist/tools/session-manager/types.d.ts +89 -0
- package/dist/tools/session-manager/utils.d.ts +11 -0
- package/dist/tools/session-manager/utils.test.d.ts +1 -0
- package/dist/tools/skill/constants.d.ts +3 -0
- package/dist/tools/skill/index.d.ts +3 -0
- package/dist/tools/skill/tools.d.ts +4 -0
- package/dist/tools/skill/tools.test.d.ts +1 -0
- package/dist/tools/skill/types.d.ts +28 -0
- package/dist/tools/skill-mcp/constants.d.ts +2 -0
- package/dist/tools/skill-mcp/index.d.ts +3 -0
- package/dist/tools/skill-mcp/tools.d.ts +11 -0
- package/dist/tools/skill-mcp/tools.test.d.ts +1 -0
- package/dist/tools/skill-mcp/types.d.ts +8 -0
- package/dist/tools/slashcommand/index.d.ts +2 -0
- package/dist/tools/slashcommand/tools.d.ts +5 -0
- package/dist/tools/slashcommand/types.d.ts +24 -0
- package/package.json +89 -0
- package/postinstall.mjs +47 -0
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { ClaudeHooksConfig } from "./types";
|
|
2
|
+
import { type PluginExtendedConfig } from "./config-loader";
|
|
3
|
+
export interface PreCompactContext {
|
|
4
|
+
sessionId: string;
|
|
5
|
+
cwd: string;
|
|
6
|
+
}
|
|
7
|
+
export interface PreCompactResult {
|
|
8
|
+
context: string[];
|
|
9
|
+
elapsedMs?: number;
|
|
10
|
+
hookName?: string;
|
|
11
|
+
continue?: boolean;
|
|
12
|
+
stopReason?: string;
|
|
13
|
+
suppressOutput?: boolean;
|
|
14
|
+
systemMessage?: string;
|
|
15
|
+
}
|
|
16
|
+
export declare function executePreCompactHooks(ctx: PreCompactContext, config: ClaudeHooksConfig | null, extendedConfig?: PluginExtendedConfig | null): Promise<PreCompactResult>;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import type { PermissionDecision, ClaudeHooksConfig } from "./types";
|
|
2
|
+
import { type PluginExtendedConfig } from "./config-loader";
|
|
3
|
+
export interface PreToolUseContext {
|
|
4
|
+
sessionId: string;
|
|
5
|
+
toolName: string;
|
|
6
|
+
toolInput: Record<string, unknown>;
|
|
7
|
+
cwd: string;
|
|
8
|
+
transcriptPath?: string;
|
|
9
|
+
toolUseId?: string;
|
|
10
|
+
permissionMode?: "default" | "plan" | "acceptEdits" | "bypassPermissions";
|
|
11
|
+
}
|
|
12
|
+
export interface PreToolUseResult {
|
|
13
|
+
decision: PermissionDecision;
|
|
14
|
+
reason?: string;
|
|
15
|
+
modifiedInput?: Record<string, unknown>;
|
|
16
|
+
elapsedMs?: number;
|
|
17
|
+
hookName?: string;
|
|
18
|
+
toolName?: string;
|
|
19
|
+
inputLines?: string;
|
|
20
|
+
continue?: boolean;
|
|
21
|
+
stopReason?: string;
|
|
22
|
+
suppressOutput?: boolean;
|
|
23
|
+
systemMessage?: string;
|
|
24
|
+
}
|
|
25
|
+
export declare function executePreToolUseHooks(ctx: PreToolUseContext, config: ClaudeHooksConfig | null, extendedConfig?: PluginExtendedConfig | null): Promise<PreToolUseResult>;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { ClaudeHooksConfig } from "./types";
|
|
2
|
+
import { type PluginExtendedConfig } from "./config-loader";
|
|
3
|
+
export declare function setStopHookActive(sessionId: string, active: boolean): void;
|
|
4
|
+
export declare function getStopHookActive(sessionId: string): boolean;
|
|
5
|
+
export interface StopContext {
|
|
6
|
+
sessionId: string;
|
|
7
|
+
parentSessionId?: string;
|
|
8
|
+
cwd: string;
|
|
9
|
+
transcriptPath?: string;
|
|
10
|
+
permissionMode?: "default" | "acceptEdits" | "bypassPermissions";
|
|
11
|
+
stopHookActive?: boolean;
|
|
12
|
+
}
|
|
13
|
+
export interface StopResult {
|
|
14
|
+
block: boolean;
|
|
15
|
+
reason?: string;
|
|
16
|
+
stopHookActive?: boolean;
|
|
17
|
+
permissionMode?: "default" | "plan" | "acceptEdits" | "bypassPermissions";
|
|
18
|
+
injectPrompt?: string;
|
|
19
|
+
}
|
|
20
|
+
export declare function executeStopHooks(ctx: StopContext, config: ClaudeHooksConfig | null, extendedConfig?: PluginExtendedConfig | null): Promise<StopResult>;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { TodoFile } from "./types";
|
|
2
|
+
export declare function getTodoPath(sessionId: string): string;
|
|
3
|
+
export interface MusaCodeTodo {
|
|
4
|
+
content: string;
|
|
5
|
+
status: string;
|
|
6
|
+
priority: string;
|
|
7
|
+
id: string;
|
|
8
|
+
}
|
|
9
|
+
export declare function loadTodoFile(sessionId: string): TodoFile | null;
|
|
10
|
+
export declare function saveTodoFile(sessionId: string, file: TodoFile): void;
|
|
11
|
+
export declare function saveMusaCodeTodos(sessionId: string, todos: MusaCodeTodo[]): void;
|
|
12
|
+
export declare function deleteTodoFile(sessionId: string): void;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Caches tool_input from PreToolUse for PostToolUse
|
|
3
|
+
*/
|
|
4
|
+
export declare function cacheToolInput(sessionId: string, toolName: string, invocationId: string, toolInput: Record<string, unknown>): void;
|
|
5
|
+
export declare function getToolInput(sessionId: string, toolName: string, invocationId: string): Record<string, unknown> | null;
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import type { TranscriptEntry } from "./types";
|
|
2
|
+
export declare function getTranscriptPath(sessionId: string): string;
|
|
3
|
+
export declare function appendTranscriptEntry(sessionId: string, entry: TranscriptEntry): void;
|
|
4
|
+
export declare function recordToolUse(sessionId: string, toolName: string, toolInput: Record<string, unknown>): void;
|
|
5
|
+
export declare function recordToolResult(sessionId: string, toolName: string, toolInput: Record<string, unknown>, toolOutput: Record<string, unknown>): void;
|
|
6
|
+
export declare function recordUserMessage(sessionId: string, content: string): void;
|
|
7
|
+
export declare function recordAssistantMessage(sessionId: string, content: string): void;
|
|
8
|
+
/**
|
|
9
|
+
* Build Claude Code compatible transcript from session messages
|
|
10
|
+
*
|
|
11
|
+
* PORT FROM DISABLED: This calls client.session.messages() API to fetch
|
|
12
|
+
* the full session history and builds a JSONL file in Claude Code format.
|
|
13
|
+
*
|
|
14
|
+
* @param client MusaCode client instance
|
|
15
|
+
* @param sessionId Session ID
|
|
16
|
+
* @param directory Working directory
|
|
17
|
+
* @param currentToolName Current tool being executed (added as last entry)
|
|
18
|
+
* @param currentToolInput Current tool input
|
|
19
|
+
* @returns Temp file path (caller must call deleteTempTranscript!)
|
|
20
|
+
*/
|
|
21
|
+
export declare function buildTranscriptFromSession(client: {
|
|
22
|
+
session: {
|
|
23
|
+
messages: (opts: {
|
|
24
|
+
path: {
|
|
25
|
+
id: string;
|
|
26
|
+
};
|
|
27
|
+
query?: {
|
|
28
|
+
directory: string;
|
|
29
|
+
};
|
|
30
|
+
}) => Promise<unknown>;
|
|
31
|
+
};
|
|
32
|
+
}, sessionId: string, directory: string, currentToolName: string, currentToolInput: Record<string, unknown>): Promise<string | null>;
|
|
33
|
+
/**
|
|
34
|
+
* Delete temp transcript file (call in finally block)
|
|
35
|
+
*
|
|
36
|
+
* PORT FROM DISABLED: Cleanup mechanism to avoid disk accumulation
|
|
37
|
+
*/
|
|
38
|
+
export declare function deleteTempTranscript(path: string | null): void;
|
|
@@ -0,0 +1,183 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Claude Code Hooks Type Definitions
|
|
3
|
+
* Maps Claude Code hook concepts to MusaCode plugin events
|
|
4
|
+
*/
|
|
5
|
+
export type ClaudeHookEvent = "PreToolUse" | "PostToolUse" | "UserPromptSubmit" | "Stop" | "PreCompact";
|
|
6
|
+
export interface HookMatcher {
|
|
7
|
+
matcher: string;
|
|
8
|
+
hooks: HookCommand[];
|
|
9
|
+
}
|
|
10
|
+
export interface HookCommand {
|
|
11
|
+
type: "command";
|
|
12
|
+
command: string;
|
|
13
|
+
}
|
|
14
|
+
export interface ClaudeHooksConfig {
|
|
15
|
+
PreToolUse?: HookMatcher[];
|
|
16
|
+
PostToolUse?: HookMatcher[];
|
|
17
|
+
UserPromptSubmit?: HookMatcher[];
|
|
18
|
+
Stop?: HookMatcher[];
|
|
19
|
+
PreCompact?: HookMatcher[];
|
|
20
|
+
}
|
|
21
|
+
export interface PreToolUseInput {
|
|
22
|
+
session_id: string;
|
|
23
|
+
transcript_path?: string;
|
|
24
|
+
cwd: string;
|
|
25
|
+
permission_mode?: PermissionMode;
|
|
26
|
+
hook_event_name: "PreToolUse";
|
|
27
|
+
tool_name: string;
|
|
28
|
+
tool_input: Record<string, unknown>;
|
|
29
|
+
tool_use_id?: string;
|
|
30
|
+
hook_source?: HookSource;
|
|
31
|
+
}
|
|
32
|
+
export interface PostToolUseInput {
|
|
33
|
+
session_id: string;
|
|
34
|
+
transcript_path?: string;
|
|
35
|
+
cwd: string;
|
|
36
|
+
permission_mode?: PermissionMode;
|
|
37
|
+
hook_event_name: "PostToolUse";
|
|
38
|
+
tool_name: string;
|
|
39
|
+
tool_input: Record<string, unknown>;
|
|
40
|
+
tool_response: {
|
|
41
|
+
title?: string;
|
|
42
|
+
output?: string;
|
|
43
|
+
[key: string]: unknown;
|
|
44
|
+
};
|
|
45
|
+
tool_use_id?: string;
|
|
46
|
+
hook_source?: HookSource;
|
|
47
|
+
}
|
|
48
|
+
export interface UserPromptSubmitInput {
|
|
49
|
+
session_id: string;
|
|
50
|
+
cwd: string;
|
|
51
|
+
permission_mode?: PermissionMode;
|
|
52
|
+
hook_event_name: "UserPromptSubmit";
|
|
53
|
+
prompt: string;
|
|
54
|
+
session?: {
|
|
55
|
+
id: string;
|
|
56
|
+
};
|
|
57
|
+
hook_source?: HookSource;
|
|
58
|
+
}
|
|
59
|
+
export type PermissionMode = "default" | "plan" | "acceptEdits" | "bypassPermissions";
|
|
60
|
+
export type HookSource = "musacode-plugin";
|
|
61
|
+
export interface StopInput {
|
|
62
|
+
session_id: string;
|
|
63
|
+
transcript_path?: string;
|
|
64
|
+
cwd: string;
|
|
65
|
+
permission_mode?: PermissionMode;
|
|
66
|
+
hook_event_name: "Stop";
|
|
67
|
+
stop_hook_active: boolean;
|
|
68
|
+
todo_path?: string;
|
|
69
|
+
hook_source?: HookSource;
|
|
70
|
+
}
|
|
71
|
+
export interface PreCompactInput {
|
|
72
|
+
session_id: string;
|
|
73
|
+
cwd: string;
|
|
74
|
+
hook_event_name: "PreCompact";
|
|
75
|
+
hook_source?: HookSource;
|
|
76
|
+
}
|
|
77
|
+
export type PermissionDecision = "allow" | "deny" | "ask";
|
|
78
|
+
/**
|
|
79
|
+
* Common JSON fields for all hook outputs (Claude Code spec)
|
|
80
|
+
*/
|
|
81
|
+
export interface HookCommonOutput {
|
|
82
|
+
/** If false, Claude stops entirely */
|
|
83
|
+
continue?: boolean;
|
|
84
|
+
/** Message shown to user when continue=false */
|
|
85
|
+
stopReason?: string;
|
|
86
|
+
/** Suppress output from transcript */
|
|
87
|
+
suppressOutput?: boolean;
|
|
88
|
+
/** Warning/message displayed to user */
|
|
89
|
+
systemMessage?: string;
|
|
90
|
+
}
|
|
91
|
+
export interface PreToolUseOutput extends HookCommonOutput {
|
|
92
|
+
/** Deprecated: use hookSpecificOutput.permissionDecision instead */
|
|
93
|
+
decision?: "allow" | "deny" | "approve" | "block" | "ask";
|
|
94
|
+
/** Deprecated: use hookSpecificOutput.permissionDecisionReason instead */
|
|
95
|
+
reason?: string;
|
|
96
|
+
hookSpecificOutput?: {
|
|
97
|
+
hookEventName: "PreToolUse";
|
|
98
|
+
permissionDecision: PermissionDecision;
|
|
99
|
+
permissionDecisionReason?: string;
|
|
100
|
+
updatedInput?: Record<string, unknown>;
|
|
101
|
+
};
|
|
102
|
+
}
|
|
103
|
+
export interface PostToolUseOutput extends HookCommonOutput {
|
|
104
|
+
decision?: "block";
|
|
105
|
+
reason?: string;
|
|
106
|
+
hookSpecificOutput?: {
|
|
107
|
+
hookEventName: "PostToolUse";
|
|
108
|
+
/** Additional context to provide to Claude */
|
|
109
|
+
additionalContext?: string;
|
|
110
|
+
};
|
|
111
|
+
}
|
|
112
|
+
export interface HookResult {
|
|
113
|
+
exitCode: number;
|
|
114
|
+
stdout?: string;
|
|
115
|
+
stderr?: string;
|
|
116
|
+
}
|
|
117
|
+
export interface TranscriptEntry {
|
|
118
|
+
type: "tool_use" | "tool_result" | "user" | "assistant";
|
|
119
|
+
timestamp: string;
|
|
120
|
+
tool_name?: string;
|
|
121
|
+
tool_input?: Record<string, unknown>;
|
|
122
|
+
tool_output?: Record<string, unknown>;
|
|
123
|
+
content?: string;
|
|
124
|
+
}
|
|
125
|
+
export interface TodoItem {
|
|
126
|
+
id: string;
|
|
127
|
+
content: string;
|
|
128
|
+
status: "pending" | "in_progress" | "completed" | "cancelled";
|
|
129
|
+
priority?: "low" | "medium" | "high";
|
|
130
|
+
created_at: string;
|
|
131
|
+
updated_at?: string;
|
|
132
|
+
}
|
|
133
|
+
export interface ClaudeCodeTodoItem {
|
|
134
|
+
content: string;
|
|
135
|
+
status: string;
|
|
136
|
+
activeForm: string;
|
|
137
|
+
}
|
|
138
|
+
export interface TodoFile {
|
|
139
|
+
session_id: string;
|
|
140
|
+
items: TodoItem[];
|
|
141
|
+
created_at: string;
|
|
142
|
+
updated_at: string;
|
|
143
|
+
}
|
|
144
|
+
export interface StopOutput {
|
|
145
|
+
decision?: "block" | "continue";
|
|
146
|
+
reason?: string;
|
|
147
|
+
stop_hook_active?: boolean;
|
|
148
|
+
permission_mode?: PermissionMode;
|
|
149
|
+
inject_prompt?: string;
|
|
150
|
+
}
|
|
151
|
+
export interface PreCompactOutput extends HookCommonOutput {
|
|
152
|
+
/** Additional context to inject into compaction prompt */
|
|
153
|
+
context?: string[];
|
|
154
|
+
hookSpecificOutput?: {
|
|
155
|
+
hookEventName: "PreCompact";
|
|
156
|
+
/** Additional context strings to inject */
|
|
157
|
+
additionalContext?: string[];
|
|
158
|
+
};
|
|
159
|
+
}
|
|
160
|
+
export type ClaudeCodeContent = {
|
|
161
|
+
type: "text";
|
|
162
|
+
text: string;
|
|
163
|
+
} | {
|
|
164
|
+
type: "tool_use";
|
|
165
|
+
id: string;
|
|
166
|
+
name: string;
|
|
167
|
+
input: Record<string, unknown>;
|
|
168
|
+
} | {
|
|
169
|
+
type: "tool_result";
|
|
170
|
+
tool_use_id: string;
|
|
171
|
+
content: string;
|
|
172
|
+
};
|
|
173
|
+
export interface ClaudeCodeMessage {
|
|
174
|
+
type: "user" | "assistant";
|
|
175
|
+
message: {
|
|
176
|
+
role: "user" | "assistant";
|
|
177
|
+
content: ClaudeCodeContent[];
|
|
178
|
+
};
|
|
179
|
+
}
|
|
180
|
+
export interface PluginConfig {
|
|
181
|
+
disabledHooks?: boolean | ClaudeHookEvent[];
|
|
182
|
+
keywordDetectorDisabled?: boolean;
|
|
183
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type { ClaudeHooksConfig } from "./types";
|
|
2
|
+
import { type PluginExtendedConfig } from "./config-loader";
|
|
3
|
+
export interface MessagePart {
|
|
4
|
+
type: "text" | "tool_use" | "tool_result";
|
|
5
|
+
text?: string;
|
|
6
|
+
[key: string]: unknown;
|
|
7
|
+
}
|
|
8
|
+
export interface UserPromptSubmitContext {
|
|
9
|
+
sessionId: string;
|
|
10
|
+
parentSessionId?: string;
|
|
11
|
+
prompt: string;
|
|
12
|
+
parts: MessagePart[];
|
|
13
|
+
cwd: string;
|
|
14
|
+
permissionMode?: "default" | "acceptEdits" | "bypassPermissions";
|
|
15
|
+
}
|
|
16
|
+
export interface UserPromptSubmitResult {
|
|
17
|
+
block: boolean;
|
|
18
|
+
reason?: string;
|
|
19
|
+
modifiedParts: MessagePart[];
|
|
20
|
+
messages: string[];
|
|
21
|
+
}
|
|
22
|
+
export declare function executeUserPromptSubmitHooks(ctx: UserPromptSubmitContext, config: ClaudeHooksConfig | null, extendedConfig?: PluginExtendedConfig | null): Promise<UserPromptSubmitResult>;
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Asynchronously get comment-checker binary path.
|
|
3
|
+
* Will trigger lazy download if binary not found.
|
|
4
|
+
*/
|
|
5
|
+
export declare function getCommentCheckerPath(): Promise<string | null>;
|
|
6
|
+
/**
|
|
7
|
+
* Synchronously get comment-checker path (no download).
|
|
8
|
+
* Returns cached path or searches known locations.
|
|
9
|
+
*/
|
|
10
|
+
export declare function getCommentCheckerPathSync(): string | null;
|
|
11
|
+
/**
|
|
12
|
+
* Start background initialization.
|
|
13
|
+
* Call this early to trigger download while other init happens.
|
|
14
|
+
*/
|
|
15
|
+
export declare function startBackgroundInit(): void;
|
|
16
|
+
export interface HookInput {
|
|
17
|
+
session_id: string;
|
|
18
|
+
tool_name: string;
|
|
19
|
+
transcript_path: string;
|
|
20
|
+
cwd: string;
|
|
21
|
+
hook_event_name: string;
|
|
22
|
+
tool_input: {
|
|
23
|
+
file_path?: string;
|
|
24
|
+
content?: string;
|
|
25
|
+
old_string?: string;
|
|
26
|
+
new_string?: string;
|
|
27
|
+
edits?: Array<{
|
|
28
|
+
old_string: string;
|
|
29
|
+
new_string: string;
|
|
30
|
+
}>;
|
|
31
|
+
};
|
|
32
|
+
tool_response?: unknown;
|
|
33
|
+
}
|
|
34
|
+
export interface CheckResult {
|
|
35
|
+
hasComments: boolean;
|
|
36
|
+
message: string;
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* Run comment-checker CLI with given input.
|
|
40
|
+
* @param input Hook input to check
|
|
41
|
+
* @param cliPath Optional explicit path to CLI binary
|
|
42
|
+
* @param customPrompt Optional custom prompt to replace default warning message
|
|
43
|
+
*/
|
|
44
|
+
export declare function runCommentChecker(input: HookInput, cliPath?: string, customPrompt?: string): Promise<CheckResult>;
|
|
45
|
+
/**
|
|
46
|
+
* Check if CLI is available (sync check, no download).
|
|
47
|
+
*/
|
|
48
|
+
export declare function isCliAvailable(): boolean;
|
|
49
|
+
/**
|
|
50
|
+
* Check if CLI will be available (async, may trigger download).
|
|
51
|
+
*/
|
|
52
|
+
export declare function ensureCliAvailable(): Promise<boolean>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Get the cache directory for oh-my-musacode binaries.
|
|
3
|
+
* On Windows: Uses %LOCALAPPDATA% or %APPDATA% (Windows conventions)
|
|
4
|
+
* On Unix: Follows XDG Base Directory Specification
|
|
5
|
+
*/
|
|
6
|
+
export declare function getCacheDir(): string;
|
|
7
|
+
/**
|
|
8
|
+
* Get the binary name based on platform.
|
|
9
|
+
*/
|
|
10
|
+
export declare function getBinaryName(): string;
|
|
11
|
+
/**
|
|
12
|
+
* Get the cached binary path if it exists.
|
|
13
|
+
*/
|
|
14
|
+
export declare function getCachedBinaryPath(): string | null;
|
|
15
|
+
/**
|
|
16
|
+
* Download the comment-checker binary from GitHub Releases.
|
|
17
|
+
* Returns the path to the downloaded binary, or null on failure.
|
|
18
|
+
*/
|
|
19
|
+
export declare function downloadCommentChecker(): Promise<string | null>;
|
|
20
|
+
/**
|
|
21
|
+
* Ensure the comment-checker binary is available.
|
|
22
|
+
* First checks cache, then downloads if needed.
|
|
23
|
+
* Returns the binary path or null if unavailable.
|
|
24
|
+
*/
|
|
25
|
+
export declare function ensureCommentCheckerBinary(): Promise<string | null>;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { CommentCheckerConfig } from "../../config/schema";
|
|
2
|
+
export declare function createCommentCheckerHooks(config?: CommentCheckerConfig): {
|
|
3
|
+
"tool.execute.before": (input: {
|
|
4
|
+
tool: string;
|
|
5
|
+
sessionID: string;
|
|
6
|
+
callID: string;
|
|
7
|
+
}, output: {
|
|
8
|
+
args: Record<string, unknown>;
|
|
9
|
+
}) => Promise<void>;
|
|
10
|
+
"tool.execute.after": (input: {
|
|
11
|
+
tool: string;
|
|
12
|
+
sessionID: string;
|
|
13
|
+
callID: string;
|
|
14
|
+
}, output: {
|
|
15
|
+
title: string;
|
|
16
|
+
output: string;
|
|
17
|
+
metadata: unknown;
|
|
18
|
+
}) => Promise<void>;
|
|
19
|
+
};
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
export type CommentType = "line" | "block" | "docstring";
|
|
2
|
+
export interface CommentInfo {
|
|
3
|
+
text: string;
|
|
4
|
+
lineNumber: number;
|
|
5
|
+
filePath: string;
|
|
6
|
+
commentType: CommentType;
|
|
7
|
+
isDocstring: boolean;
|
|
8
|
+
metadata?: Record<string, string>;
|
|
9
|
+
}
|
|
10
|
+
export interface PendingCall {
|
|
11
|
+
filePath: string;
|
|
12
|
+
content?: string;
|
|
13
|
+
oldString?: string;
|
|
14
|
+
newString?: string;
|
|
15
|
+
edits?: Array<{
|
|
16
|
+
old_string: string;
|
|
17
|
+
new_string: string;
|
|
18
|
+
}>;
|
|
19
|
+
tool: "write" | "edit" | "multiedit";
|
|
20
|
+
sessionID: string;
|
|
21
|
+
timestamp: number;
|
|
22
|
+
}
|
|
23
|
+
export interface FileComments {
|
|
24
|
+
filePath: string;
|
|
25
|
+
comments: CommentInfo[];
|
|
26
|
+
}
|
|
27
|
+
export interface FilterResult {
|
|
28
|
+
shouldSkip: boolean;
|
|
29
|
+
reason?: string;
|
|
30
|
+
}
|
|
31
|
+
export type CommentFilter = (comment: CommentInfo) => FilterResult;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { PluginInput } from "@opencode-ai/plugin";
|
|
2
|
+
export declare function createContextWindowMonitorHook(ctx: PluginInput): {
|
|
3
|
+
"tool.execute.after": (input: {
|
|
4
|
+
tool: string;
|
|
5
|
+
sessionID: string;
|
|
6
|
+
callID: string;
|
|
7
|
+
}, output: {
|
|
8
|
+
title: string;
|
|
9
|
+
output: string;
|
|
10
|
+
metadata: unknown;
|
|
11
|
+
}) => Promise<void>;
|
|
12
|
+
event: ({ event }: {
|
|
13
|
+
event: {
|
|
14
|
+
type: string;
|
|
15
|
+
properties?: unknown;
|
|
16
|
+
};
|
|
17
|
+
}) => Promise<void>;
|
|
18
|
+
};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import type { PluginInput } from "@opencode-ai/plugin";
|
|
2
|
+
export interface DelegateTaskErrorPattern {
|
|
3
|
+
pattern: string;
|
|
4
|
+
errorType: string;
|
|
5
|
+
fixHint: string;
|
|
6
|
+
}
|
|
7
|
+
export declare const DELEGATE_TASK_ERROR_PATTERNS: DelegateTaskErrorPattern[];
|
|
8
|
+
export interface DetectedError {
|
|
9
|
+
errorType: string;
|
|
10
|
+
originalOutput: string;
|
|
11
|
+
}
|
|
12
|
+
export declare function detectDelegateTaskError(output: string): DetectedError | null;
|
|
13
|
+
export declare function buildRetryGuidance(errorInfo: DetectedError): string;
|
|
14
|
+
export declare function createDelegateTaskRetryHook(_ctx: PluginInput): {
|
|
15
|
+
"tool.execute.after": (input: {
|
|
16
|
+
tool: string;
|
|
17
|
+
sessionID: string;
|
|
18
|
+
callID: string;
|
|
19
|
+
}, output: {
|
|
20
|
+
title: string;
|
|
21
|
+
output: string;
|
|
22
|
+
metadata: unknown;
|
|
23
|
+
}) => Promise<void>;
|
|
24
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import type { PluginInput } from "@opencode-ai/plugin";
|
|
2
|
+
interface ToolExecuteInput {
|
|
3
|
+
tool: string;
|
|
4
|
+
sessionID: string;
|
|
5
|
+
callID: string;
|
|
6
|
+
}
|
|
7
|
+
interface ToolExecuteOutput {
|
|
8
|
+
title: string;
|
|
9
|
+
output: string;
|
|
10
|
+
metadata: unknown;
|
|
11
|
+
}
|
|
12
|
+
interface ToolExecuteBeforeOutput {
|
|
13
|
+
args: unknown;
|
|
14
|
+
}
|
|
15
|
+
interface EventInput {
|
|
16
|
+
event: {
|
|
17
|
+
type: string;
|
|
18
|
+
properties?: unknown;
|
|
19
|
+
};
|
|
20
|
+
}
|
|
21
|
+
export declare function createDirectoryAgentsInjectorHook(ctx: PluginInput): {
|
|
22
|
+
"tool.execute.before": (input: ToolExecuteInput, output: ToolExecuteBeforeOutput) => Promise<void>;
|
|
23
|
+
"tool.execute.after": (input: ToolExecuteInput, output: ToolExecuteOutput) => Promise<void>;
|
|
24
|
+
event: ({ event }: EventInput) => Promise<void>;
|
|
25
|
+
};
|
|
26
|
+
export {};
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import type { PluginInput } from "@opencode-ai/plugin";
|
|
2
|
+
interface ToolExecuteInput {
|
|
3
|
+
tool: string;
|
|
4
|
+
sessionID: string;
|
|
5
|
+
callID: string;
|
|
6
|
+
}
|
|
7
|
+
interface ToolExecuteOutput {
|
|
8
|
+
title: string;
|
|
9
|
+
output: string;
|
|
10
|
+
metadata: unknown;
|
|
11
|
+
}
|
|
12
|
+
interface ToolExecuteBeforeOutput {
|
|
13
|
+
args: unknown;
|
|
14
|
+
}
|
|
15
|
+
interface EventInput {
|
|
16
|
+
event: {
|
|
17
|
+
type: string;
|
|
18
|
+
properties?: unknown;
|
|
19
|
+
};
|
|
20
|
+
}
|
|
21
|
+
export declare function createDirectoryReadmeInjectorHook(ctx: PluginInput): {
|
|
22
|
+
"tool.execute.before": (input: ToolExecuteInput, output: ToolExecuteBeforeOutput) => Promise<void>;
|
|
23
|
+
"tool.execute.after": (input: ToolExecuteInput, output: ToolExecuteOutput) => Promise<void>;
|
|
24
|
+
event: ({ event }: EventInput) => Promise<void>;
|
|
25
|
+
};
|
|
26
|
+
export {};
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import type { PluginInput } from "@opencode-ai/plugin";
|
|
2
|
+
/**
|
|
3
|
+
* Known Edit tool error patterns that indicate the AI made a mistake
|
|
4
|
+
*/
|
|
5
|
+
export declare const EDIT_ERROR_PATTERNS: readonly ["oldString and newString must be different", "oldString not found", "oldString found multiple times"];
|
|
6
|
+
/**
|
|
7
|
+
* System reminder injected when Edit tool fails due to AI mistake
|
|
8
|
+
* Short, direct, and commanding - forces immediate corrective action
|
|
9
|
+
*/
|
|
10
|
+
export declare const EDIT_ERROR_REMINDER = "\n[EDIT ERROR - IMMEDIATE ACTION REQUIRED]\n\nYou made an Edit mistake. STOP and do this NOW:\n\n1. READ the file immediately to see its ACTUAL current state\n2. VERIFY what the content really looks like (your assumption was wrong)\n3. APOLOGIZE briefly to the user for the error\n4. CONTINUE with corrected action based on the real file content\n\nDO NOT attempt another edit until you've read and verified the file state.\n";
|
|
11
|
+
/**
|
|
12
|
+
* Detects Edit tool errors caused by AI mistakes and injects a recovery reminder
|
|
13
|
+
*
|
|
14
|
+
* This hook catches common Edit tool failures:
|
|
15
|
+
* - oldString and newString must be different (trying to "edit" to same content)
|
|
16
|
+
* - oldString not found (wrong assumption about file content)
|
|
17
|
+
* - oldString found multiple times (ambiguous match, need more context)
|
|
18
|
+
*
|
|
19
|
+
* @see https://github.com/sst.musacode/issues/4718
|
|
20
|
+
*/
|
|
21
|
+
export declare function createEditErrorRecoveryHook(_ctx: PluginInput): {
|
|
22
|
+
"tool.execute.after": (input: {
|
|
23
|
+
tool: string;
|
|
24
|
+
sessionID: string;
|
|
25
|
+
callID: string;
|
|
26
|
+
}, output: {
|
|
27
|
+
title: string;
|
|
28
|
+
output: string;
|
|
29
|
+
metadata: unknown;
|
|
30
|
+
}) => Promise<void>;
|
|
31
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { PluginInput } from "@opencode-ai/plugin";
|
|
2
|
+
export declare function createEmptyTaskResponseDetectorHook(_ctx: PluginInput): {
|
|
3
|
+
"tool.execute.after": (input: {
|
|
4
|
+
tool: string;
|
|
5
|
+
sessionID: string;
|
|
6
|
+
callID: string;
|
|
7
|
+
}, output: {
|
|
8
|
+
title: string;
|
|
9
|
+
output: string;
|
|
10
|
+
metadata: unknown;
|
|
11
|
+
}) => Promise<void>;
|
|
12
|
+
};
|