oh-my-opencode-kikokikok 2.13.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE.md +82 -0
- package/README.ja.md +1029 -0
- package/README.ko.md +1022 -0
- package/README.md +1100 -0
- package/README.zh-cn.md +1032 -0
- package/dist/agents/api-designer.d.ts +5 -0
- package/dist/agents/build-prompt.d.ts +31 -0
- package/dist/agents/code-indexer.d.ts +5 -0
- package/dist/agents/code-reviewer.d.ts +5 -0
- package/dist/agents/dba.d.ts +5 -0
- package/dist/agents/debugger.d.ts +5 -0
- package/dist/agents/devops-engineer.d.ts +5 -0
- package/dist/agents/document-writer.d.ts +5 -0
- package/dist/agents/enterprise-agents.test.d.ts +1 -0
- package/dist/agents/estimator.d.ts +5 -0
- package/dist/agents/explore.d.ts +5 -0
- package/dist/agents/frontend-ui-ux-engineer.d.ts +5 -0
- package/dist/agents/incident-commander.d.ts +5 -0
- package/dist/agents/index.d.ts +5 -0
- package/dist/agents/knowledge-curator.d.ts +5 -0
- package/dist/agents/librarian.d.ts +5 -0
- package/dist/agents/multimodal-looker.d.ts +5 -0
- package/dist/agents/oracle.d.ts +5 -0
- package/dist/agents/performance-analyst.d.ts +5 -0
- package/dist/agents/plan-prompt.d.ts +61 -0
- package/dist/agents/project-manager.d.ts +5 -0
- package/dist/agents/security-reviewer.d.ts +5 -0
- package/dist/agents/sisyphus-prompt-builder.d.ts +25 -0
- package/dist/agents/sisyphus.d.ts +4 -0
- package/dist/agents/test-engineer.d.ts +5 -0
- package/dist/agents/types.d.ts +49 -0
- package/dist/agents/utils.d.ts +10 -0
- package/dist/agents/utils.test.d.ts +1 -0
- package/dist/auth/antigravity/constants.d.ts +36 -0
- package/dist/auth/antigravity/fetch.d.ts +68 -0
- package/dist/auth/antigravity/index.d.ts +13 -0
- package/dist/auth/antigravity/message-converter.d.ts +54 -0
- package/dist/auth/antigravity/oauth.d.ts +85 -0
- package/dist/auth/antigravity/plugin.d.ts +54 -0
- package/dist/auth/antigravity/project.d.ts +10 -0
- package/dist/auth/antigravity/request.d.ts +104 -0
- package/dist/auth/antigravity/response.d.ts +137 -0
- package/dist/auth/antigravity/thinking.d.ts +234 -0
- package/dist/auth/antigravity/thought-signature-store.d.ts +52 -0
- package/dist/auth/antigravity/token.d.ts +38 -0
- package/dist/auth/antigravity/tools.d.ts +119 -0
- package/dist/auth/antigravity/types.d.ts +205 -0
- package/dist/cli/config-manager.d.ts +94 -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/opencode.d.ts +10 -0
- package/dist/cli/doctor/checks/opencode.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 +23400 -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 +11 -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 +2717 -0
- package/dist/features/background-agent/index.d.ts +2 -0
- package/dist/features/background-agent/manager.d.ts +41 -0
- package/dist/features/background-agent/manager.test.d.ts +1 -0
- package/dist/features/background-agent/types.d.ts +38 -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/types.d.ts +6 -0
- package/dist/features/builtin-skills/api/index.d.ts +1 -0
- package/dist/features/builtin-skills/api/types.d.ts +193 -0
- package/dist/features/builtin-skills/code-index/index.d.ts +1 -0
- package/dist/features/builtin-skills/code-index/types.d.ts +95 -0
- package/dist/features/builtin-skills/db/index.d.ts +1 -0
- package/dist/features/builtin-skills/db/types.d.ts +210 -0
- package/dist/features/builtin-skills/debug/index.d.ts +1 -0
- package/dist/features/builtin-skills/debug/types.d.ts +229 -0
- package/dist/features/builtin-skills/deploy/index.d.ts +1 -0
- package/dist/features/builtin-skills/deploy/types.d.ts +215 -0
- package/dist/features/builtin-skills/incident/index.d.ts +4 -0
- package/dist/features/builtin-skills/incident/types.d.ts +39 -0
- package/dist/features/builtin-skills/index.d.ts +2 -0
- package/dist/features/builtin-skills/oncall/index.d.ts +1 -0
- package/dist/features/builtin-skills/oncall/types.d.ts +223 -0
- package/dist/features/builtin-skills/perf/index.d.ts +1 -0
- package/dist/features/builtin-skills/perf/types.d.ts +170 -0
- package/dist/features/builtin-skills/project/index.d.ts +1 -0
- package/dist/features/builtin-skills/project/types.d.ts +190 -0
- package/dist/features/builtin-skills/review/index.d.ts +4 -0
- package/dist/features/builtin-skills/review/types.d.ts +29 -0
- package/dist/features/builtin-skills/security/index.d.ts +4 -0
- package/dist/features/builtin-skills/security/types.d.ts +35 -0
- package/dist/features/builtin-skills/skills.d.ts +2 -0
- package/dist/features/builtin-skills/test/index.d.ts +1 -0
- package/dist/features/builtin-skills/test/types.d.ts +231 -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 +5 -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 +4 -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 +11 -0
- package/dist/features/hook-message-injector/types.d.ts +43 -0
- package/dist/features/knowledge-repo/cache.d.ts +28 -0
- package/dist/features/knowledge-repo/client.d.ts +39 -0
- package/dist/features/knowledge-repo/client.test.d.ts +1 -0
- package/dist/features/knowledge-repo/conflict-detector.d.ts +28 -0
- package/dist/features/knowledge-repo/index.d.ts +4 -0
- package/dist/features/knowledge-repo/types.d.ts +338 -0
- package/dist/features/mem0-memory/adapter.d.ts +19 -0
- package/dist/features/mem0-memory/adapter.test.d.ts +1 -0
- package/dist/features/mem0-memory/index.d.ts +3 -0
- package/dist/features/mem0-memory/layers.d.ts +29 -0
- package/dist/features/mem0-memory/layers.test.d.ts +1 -0
- package/dist/features/mem0-memory/types.d.ts +45 -0
- package/dist/features/opencode-skill-loader/index.d.ts +3 -0
- package/dist/features/opencode-skill-loader/loader.d.ts +41 -0
- package/dist/features/opencode-skill-loader/loader.test.d.ts +1 -0
- package/dist/features/opencode-skill-loader/merger.d.ts +7 -0
- package/dist/features/opencode-skill-loader/types.d.ts +28 -0
- package/dist/features/skill-mcp-manager/index.d.ts +2 -0
- package/dist/features/skill-mcp-manager/manager.d.ts +21 -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/google-auth.d.ts +3 -0
- package/dist/google-auth.js +1865 -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 +17 -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-executor.d.ts +3 -0
- package/dist/hooks/anthropic-context-window-limit-recovery/pruning-purge-errors.d.ts +7 -0
- package/dist/hooks/anthropic-context-window-limit-recovery/pruning-storage.d.ts +2 -0
- package/dist/hooks/anthropic-context-window-limit-recovery/pruning-supersede.d.ts +6 -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 +42 -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 +7 -0
- package/dist/hooks/auto-slash-command/index.d.ts +8 -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/constants.d.ts +13 -0
- package/dist/hooks/auto-update-checker/index.d.ts +13 -0
- package/dist/hooks/auto-update-checker/types.d.ts +25 -0
- package/dist/hooks/background-notification/index.d.ts +12 -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 +47 -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 +182 -0
- package/dist/hooks/claude-code-hooks/user-prompt-submit.d.ts +22 -0
- package/dist/hooks/comment-checker/cli.d.ts +53 -0
- package/dist/hooks/comment-checker/constants.d.ts +3 -0
- package/dist/hooks/comment-checker/downloader.d.ts +25 -0
- package/dist/hooks/comment-checker/filters/bdd.d.ts +2 -0
- package/dist/hooks/comment-checker/filters/directive.d.ts +2 -0
- package/dist/hooks/comment-checker/filters/docstring.d.ts +2 -0
- package/dist/hooks/comment-checker/filters/index.d.ts +7 -0
- package/dist/hooks/comment-checker/filters/shebang.d.ts +2 -0
- package/dist/hooks/comment-checker/index.d.ts +19 -0
- package/dist/hooks/comment-checker/output/formatter.d.ts +2 -0
- package/dist/hooks/comment-checker/output/index.d.ts +2 -0
- package/dist/hooks/comment-checker/output/xml-builder.d.ts +2 -0
- package/dist/hooks/comment-checker/types.d.ts +31 -0
- package/dist/hooks/compaction-context-injector/index.d.ts +2 -0
- package/dist/hooks/context-window-monitor.d.ts +18 -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-message-sanitizer/index.d.ts +12 -0
- package/dist/hooks/empty-task-response-detector.d.ts +12 -0
- package/dist/hooks/index.d.ts +27 -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 +6 -0
- package/dist/hooks/keyword-detector/detector.d.ts +11 -0
- package/dist/hooks/keyword-detector/index.d.ts +22 -0
- package/dist/hooks/keyword-detector/types.d.ts +4 -0
- package/dist/hooks/knowledge-monitor/conflict-handler.d.ts +19 -0
- package/dist/hooks/knowledge-monitor/conflict-handler.test.d.ts +1 -0
- package/dist/hooks/knowledge-monitor/constants.d.ts +8 -0
- package/dist/hooks/knowledge-monitor/index.d.ts +28 -0
- package/dist/hooks/knowledge-monitor/interruption.d.ts +18 -0
- package/dist/hooks/knowledge-monitor/types.d.ts +41 -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/preemptive-compaction/constants.d.ts +3 -0
- package/dist/hooks/preemptive-compaction/index.d.ts +24 -0
- package/dist/hooks/preemptive-compaction/types.d.ts +17 -0
- package/dist/hooks/ralph-loop/constants.d.ts +5 -0
- package/dist/hooks/ralph-loop/index.d.ts +20 -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 +15 -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/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 +16 -0
- package/dist/hooks/todo-continuation-enforcer.test.d.ts +1 -0
- package/dist/hooks/tool-output-truncator.d.ts +17 -0
- package/dist/index.d.ts +5 -0
- package/dist/index.js +50332 -0
- package/dist/mcp/context7.d.ts +5 -0
- package/dist/mcp/cypress.d.ts +5 -0
- package/dist/mcp/grep-app.d.ts +5 -0
- package/dist/mcp/honeycomb.d.ts +5 -0
- package/dist/mcp/index.d.ts +7 -0
- package/dist/mcp/index.test.d.ts +1 -0
- package/dist/mcp/types.d.ts +10 -0
- package/dist/mcp/vault.d.ts +5 -0
- package/dist/mcp/websearch-exa.d.ts +5 -0
- package/dist/plugin-config.d.ts +4 -0
- package/dist/plugin-handlers/config-handler.d.ts +10 -0
- package/dist/plugin-handlers/index.d.ts +1 -0
- package/dist/plugin-state.d.ts +6 -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/dynamic-truncator.d.ts +27 -0
- package/dist/shared/file-reference-resolver.d.ts +1 -0
- package/dist/shared/file-utils.d.ts +6 -0
- package/dist/shared/frontmatter.d.ts +5 -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 +18 -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 +11 -0
- package/dist/shared/migration.test.d.ts +1 -0
- package/dist/shared/model-sanitizer.d.ts +3 -0
- package/dist/shared/pattern-matcher.d.ts +3 -0
- package/dist/shared/snake-case.d.ts +4 -0
- package/dist/shared/tool-name.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/napi.d.ts +13 -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/glob/cli.d.ts +7 -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 +19 -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 +11 -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/types.d.ts +3 -0
- package/dist/tools/interactive-bash/utils.d.ts +3 -0
- package/dist/tools/knowledge/constants.d.ts +8 -0
- package/dist/tools/knowledge/index.d.ts +2 -0
- package/dist/tools/knowledge/tools.d.ts +5 -0
- package/dist/tools/knowledge/types.d.ts +79 -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 +2 -0
- package/dist/tools/look-at/types.d.ts +4 -0
- package/dist/tools/lsp/client.d.ts +59 -0
- package/dist/tools/lsp/config.d.ts +17 -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 +12 -0
- package/dist/tools/lsp/types.d.ts +156 -0
- package/dist/tools/lsp/utils.d.ts +29 -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 +10 -0
- package/dist/tools/skill/tools.test.d.ts +1 -0
- package/dist/tools/skill/types.d.ts +25 -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 +2 -0
- package/dist/tools/slashcommand/types.d.ts +16 -0
- package/package.json +81 -0
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type { PluginInput } from "@opencode-ai/plugin";
|
|
2
|
+
export * from "./detector";
|
|
3
|
+
export * from "./constants";
|
|
4
|
+
export * from "./types";
|
|
5
|
+
export declare function createKeywordDetectorHook(ctx: PluginInput): {
|
|
6
|
+
"chat.message": (input: {
|
|
7
|
+
sessionID: string;
|
|
8
|
+
agent?: string;
|
|
9
|
+
model?: {
|
|
10
|
+
providerID: string;
|
|
11
|
+
modelID: string;
|
|
12
|
+
};
|
|
13
|
+
messageID?: string;
|
|
14
|
+
}, output: {
|
|
15
|
+
message: Record<string, unknown>;
|
|
16
|
+
parts: Array<{
|
|
17
|
+
type: string;
|
|
18
|
+
text?: string;
|
|
19
|
+
[key: string]: unknown;
|
|
20
|
+
}>;
|
|
21
|
+
}) => Promise<void>;
|
|
22
|
+
};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { KnowledgeCommit } from "../../features/knowledge-repo/types";
|
|
2
|
+
import type { PendingToolCall, ViolationReport, MonitorContext } from "./types";
|
|
3
|
+
export declare class ConflictHandler {
|
|
4
|
+
private detector;
|
|
5
|
+
private activeKnowledge;
|
|
6
|
+
private projectRoot;
|
|
7
|
+
constructor(projectRoot: string);
|
|
8
|
+
setActiveKnowledge(knowledge: KnowledgeCommit[]): void;
|
|
9
|
+
getActiveKnowledge(): KnowledgeCommit[];
|
|
10
|
+
checkFileWrite(filePath: string, content: string, context: MonitorContext): Promise<ViolationReport | null>;
|
|
11
|
+
checkFileEdit(filePath: string, oldString: string, newString: string, context: MonitorContext): Promise<ViolationReport | null>;
|
|
12
|
+
checkBashCommand(command: string, context: MonitorContext): Promise<ViolationReport | null>;
|
|
13
|
+
checkPendingCall(call: PendingToolCall): Promise<ViolationReport | null>;
|
|
14
|
+
private createReport;
|
|
15
|
+
private getHighestSeverity;
|
|
16
|
+
private getRelatedKnowledge;
|
|
17
|
+
private formatViolationMessage;
|
|
18
|
+
private formatSingleViolation;
|
|
19
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export declare const HOOK_NAME = "knowledge-monitor";
|
|
2
|
+
export declare const MONITORED_TOOLS: readonly ["write", "edit", "multiedit", "bash"];
|
|
3
|
+
export type MonitoredTool = (typeof MONITORED_TOOLS)[number];
|
|
4
|
+
export declare const SEVERITY_PRIORITY: Record<string, number>;
|
|
5
|
+
export declare const VIOLATION_HEADER = "[KNOWLEDGE POLICY VIOLATION DETECTED]\n\nYour action conflicts with established knowledge policies.\nReview the violations below and take appropriate action.\n\n";
|
|
6
|
+
export declare const BLOCK_SUFFIX = "\nBLOCKING: This action cannot proceed until violations are resolved.\nEither fix the issue or request a policy exception from a knowledge curator.\n";
|
|
7
|
+
export declare const WARN_SUFFIX = "\nWARNING: This action may proceed, but please acknowledge the policy concern.\nConsider whether your approach aligns with organizational standards.\n";
|
|
8
|
+
export declare const INFO_SUFFIX = "\nINFO: For your awareness. No action required unless relevant to your task.\n";
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { HOOK_NAME } from "./constants";
|
|
2
|
+
import type { KnowledgeMonitorConfig } from "./types";
|
|
3
|
+
import type { KnowledgeCommit } from "../../features/knowledge-repo/types";
|
|
4
|
+
export interface KnowledgeMonitorHook {
|
|
5
|
+
setActiveKnowledge: (knowledge: KnowledgeCommit[]) => void;
|
|
6
|
+
getActiveKnowledge: () => KnowledgeCommit[];
|
|
7
|
+
hooks: {
|
|
8
|
+
"tool.execute.before": (input: {
|
|
9
|
+
tool: string;
|
|
10
|
+
sessionID: string;
|
|
11
|
+
callID: string;
|
|
12
|
+
}, output: {
|
|
13
|
+
args: Record<string, unknown>;
|
|
14
|
+
}) => Promise<void>;
|
|
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
|
+
};
|
|
25
|
+
}
|
|
26
|
+
export declare function createKnowledgeMonitorHook(projectRoot: string, config?: KnowledgeMonitorConfig): KnowledgeMonitorHook;
|
|
27
|
+
export { HOOK_NAME };
|
|
28
|
+
export type { KnowledgeMonitorConfig } from "./types";
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { ConstraintViolation } from "../../features/knowledge-repo/types";
|
|
2
|
+
import type { ViolationReport, InterruptionDecision } from "./types";
|
|
3
|
+
export declare function decideInterruption(report: ViolationReport): InterruptionDecision;
|
|
4
|
+
export declare function formatViolationSummary(violations: ConstraintViolation[]): string;
|
|
5
|
+
export declare function shouldSkipTool(toolName: string, config: {
|
|
6
|
+
ignoredTools?: string[];
|
|
7
|
+
}): boolean;
|
|
8
|
+
export declare function extractFilePath(args: Record<string, unknown>): string | undefined;
|
|
9
|
+
export declare function extractContent(args: Record<string, unknown>): string | undefined;
|
|
10
|
+
export declare function extractEditParams(args: Record<string, unknown>): {
|
|
11
|
+
oldString?: string;
|
|
12
|
+
newString?: string;
|
|
13
|
+
};
|
|
14
|
+
export declare function extractEdits(args: Record<string, unknown>): Array<{
|
|
15
|
+
old_string: string;
|
|
16
|
+
new_string: string;
|
|
17
|
+
}> | undefined;
|
|
18
|
+
export declare function extractCommand(args: Record<string, unknown>): string | undefined;
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import type { ConstraintViolation, KnowledgeCommit, Severity } from "../../features/knowledge-repo/types";
|
|
2
|
+
export interface MonitorContext {
|
|
3
|
+
projectRoot: string;
|
|
4
|
+
sessionId: string;
|
|
5
|
+
toolName: string;
|
|
6
|
+
callId: string;
|
|
7
|
+
}
|
|
8
|
+
export interface PendingToolCall {
|
|
9
|
+
context: MonitorContext;
|
|
10
|
+
filePath?: string;
|
|
11
|
+
content?: string;
|
|
12
|
+
oldString?: string;
|
|
13
|
+
newString?: string;
|
|
14
|
+
edits?: Array<{
|
|
15
|
+
old_string: string;
|
|
16
|
+
new_string: string;
|
|
17
|
+
}>;
|
|
18
|
+
command?: string;
|
|
19
|
+
timestamp: number;
|
|
20
|
+
}
|
|
21
|
+
export interface ViolationReport {
|
|
22
|
+
violations: ConstraintViolation[];
|
|
23
|
+
highestSeverity: Severity;
|
|
24
|
+
message: string;
|
|
25
|
+
shouldBlock: boolean;
|
|
26
|
+
relatedKnowledge: KnowledgeCommit[];
|
|
27
|
+
}
|
|
28
|
+
export interface KnowledgeMonitorConfig {
|
|
29
|
+
enabled?: boolean;
|
|
30
|
+
repositoryRoot?: string;
|
|
31
|
+
checkPreTool?: boolean;
|
|
32
|
+
checkPostTool?: boolean;
|
|
33
|
+
blockOnViolation?: boolean;
|
|
34
|
+
ignorePaths?: string[];
|
|
35
|
+
}
|
|
36
|
+
export interface InterruptionDecision {
|
|
37
|
+
shouldInterrupt: boolean;
|
|
38
|
+
shouldBlock: boolean;
|
|
39
|
+
message: string;
|
|
40
|
+
violations: ConstraintViolation[];
|
|
41
|
+
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
export declare const HOOK_NAME = "non-interactive-env";
|
|
2
|
+
export declare const NON_INTERACTIVE_ENV: Record<string, string>;
|
|
3
|
+
/**
|
|
4
|
+
* Shell command guidance for non-interactive environments.
|
|
5
|
+
* These patterns should be followed to avoid hanging on user input.
|
|
6
|
+
*/
|
|
7
|
+
export declare const SHELL_COMMAND_PATTERNS: {
|
|
8
|
+
readonly npm: {
|
|
9
|
+
readonly bad: readonly ["npm init", "npm install (prompts)"];
|
|
10
|
+
readonly good: readonly ["npm init -y", "npm install --yes"];
|
|
11
|
+
};
|
|
12
|
+
readonly apt: {
|
|
13
|
+
readonly bad: readonly ["apt-get install pkg"];
|
|
14
|
+
readonly good: readonly ["apt-get install -y pkg", "DEBIAN_FRONTEND=noninteractive apt-get install pkg"];
|
|
15
|
+
};
|
|
16
|
+
readonly pip: {
|
|
17
|
+
readonly bad: readonly ["pip install pkg (with prompts)"];
|
|
18
|
+
readonly good: readonly ["pip install --no-input pkg", "PIP_NO_INPUT=1 pip install pkg"];
|
|
19
|
+
};
|
|
20
|
+
readonly git: {
|
|
21
|
+
readonly bad: readonly ["git commit", "git merge branch", "git add -p", "git rebase -i"];
|
|
22
|
+
readonly good: readonly ["git commit -m 'msg'", "git merge --no-edit branch", "git add .", "git rebase --no-edit"];
|
|
23
|
+
};
|
|
24
|
+
readonly system: {
|
|
25
|
+
readonly bad: readonly ["rm file (prompts)", "cp a b (prompts)", "ssh host"];
|
|
26
|
+
readonly good: readonly ["rm -f file", "cp -f a b", "ssh -o BatchMode=yes host", "unzip -o file.zip"];
|
|
27
|
+
};
|
|
28
|
+
readonly banned: readonly ["vim", "nano", "vi", "emacs", "less", "more", "man", "python (REPL)", "node (REPL)", "git add -p", "git rebase -i"];
|
|
29
|
+
readonly workarounds: {
|
|
30
|
+
readonly yesPipe: "yes | ./script.sh";
|
|
31
|
+
readonly heredoc: "./script.sh <<EOF\noption1\noption2\nEOF";
|
|
32
|
+
readonly expectAlternative: "Use environment variables or config files instead of expect";
|
|
33
|
+
};
|
|
34
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function isNonInteractive(): boolean;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { PluginInput } from "@opencode-ai/plugin";
|
|
2
|
+
export * from "./constants";
|
|
3
|
+
export * from "./detector";
|
|
4
|
+
export * from "./types";
|
|
5
|
+
export declare function createNonInteractiveEnvHook(_ctx: PluginInput): {
|
|
6
|
+
"tool.execute.before": (input: {
|
|
7
|
+
tool: string;
|
|
8
|
+
sessionID: string;
|
|
9
|
+
callID: string;
|
|
10
|
+
}, output: {
|
|
11
|
+
args: Record<string, unknown>;
|
|
12
|
+
message?: string;
|
|
13
|
+
}) => Promise<void>;
|
|
14
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import type { PluginInput } from "@opencode-ai/plugin";
|
|
2
|
+
import type { ExperimentalConfig } from "../../config";
|
|
3
|
+
export interface SummarizeContext {
|
|
4
|
+
sessionID: string;
|
|
5
|
+
providerID: string;
|
|
6
|
+
modelID: string;
|
|
7
|
+
usageRatio: number;
|
|
8
|
+
directory: string;
|
|
9
|
+
}
|
|
10
|
+
export type BeforeSummarizeCallback = (ctx: SummarizeContext) => Promise<void> | void;
|
|
11
|
+
export type GetModelLimitCallback = (providerID: string, modelID: string) => number | undefined;
|
|
12
|
+
export interface PreemptiveCompactionOptions {
|
|
13
|
+
experimental?: ExperimentalConfig;
|
|
14
|
+
onBeforeSummarize?: BeforeSummarizeCallback;
|
|
15
|
+
getModelLimit?: GetModelLimitCallback;
|
|
16
|
+
}
|
|
17
|
+
export declare function createPreemptiveCompactionHook(ctx: PluginInput, options?: PreemptiveCompactionOptions): {
|
|
18
|
+
event: ({ event }: {
|
|
19
|
+
event: {
|
|
20
|
+
type: string;
|
|
21
|
+
properties?: unknown;
|
|
22
|
+
};
|
|
23
|
+
}) => Promise<void>;
|
|
24
|
+
};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export interface PreemptiveCompactionState {
|
|
2
|
+
lastCompactionTime: Map<string, number>;
|
|
3
|
+
compactionInProgress: Set<string>;
|
|
4
|
+
}
|
|
5
|
+
export interface TokenInfo {
|
|
6
|
+
input: number;
|
|
7
|
+
output: number;
|
|
8
|
+
reasoning: number;
|
|
9
|
+
cache: {
|
|
10
|
+
read: number;
|
|
11
|
+
write: number;
|
|
12
|
+
};
|
|
13
|
+
}
|
|
14
|
+
export interface ModelLimits {
|
|
15
|
+
context: number;
|
|
16
|
+
output: number;
|
|
17
|
+
}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export declare const HOOK_NAME = "ralph-loop";
|
|
2
|
+
export declare const DEFAULT_STATE_FILE = ".sisyphus/ralph-loop.local.md";
|
|
3
|
+
export declare const COMPLETION_TAG_PATTERN: RegExp;
|
|
4
|
+
export declare const DEFAULT_MAX_ITERATIONS = 100;
|
|
5
|
+
export declare const DEFAULT_COMPLETION_PROMISE = "DONE";
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { PluginInput } from "@opencode-ai/plugin";
|
|
2
|
+
import type { RalphLoopState, RalphLoopOptions } from "./types";
|
|
3
|
+
export * from "./types";
|
|
4
|
+
export * from "./constants";
|
|
5
|
+
export { readState, writeState, clearState, incrementIteration } from "./storage";
|
|
6
|
+
export interface RalphLoopHook {
|
|
7
|
+
event: (input: {
|
|
8
|
+
event: {
|
|
9
|
+
type: string;
|
|
10
|
+
properties?: unknown;
|
|
11
|
+
};
|
|
12
|
+
}) => Promise<void>;
|
|
13
|
+
startLoop: (sessionID: string, prompt: string, options?: {
|
|
14
|
+
maxIterations?: number;
|
|
15
|
+
completionPromise?: string;
|
|
16
|
+
}) => boolean;
|
|
17
|
+
cancelLoop: (sessionID: string) => boolean;
|
|
18
|
+
getState: () => RalphLoopState | null;
|
|
19
|
+
}
|
|
20
|
+
export declare function createRalphLoopHook(ctx: PluginInput, options?: RalphLoopOptions): RalphLoopHook;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { RalphLoopState } from "./types";
|
|
2
|
+
export declare function getStateFilePath(directory: string, customPath?: string): string;
|
|
3
|
+
export declare function readState(directory: string, customPath?: string): RalphLoopState | null;
|
|
4
|
+
export declare function writeState(directory: string, state: RalphLoopState, customPath?: string): boolean;
|
|
5
|
+
export declare function clearState(directory: string, customPath?: string): boolean;
|
|
6
|
+
export declare function incrementIteration(directory: string, customPath?: string): RalphLoopState | null;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { RalphLoopConfig } from "../../config";
|
|
2
|
+
export interface RalphLoopState {
|
|
3
|
+
active: boolean;
|
|
4
|
+
iteration: number;
|
|
5
|
+
max_iterations: number;
|
|
6
|
+
completion_promise: string;
|
|
7
|
+
started_at: string;
|
|
8
|
+
prompt: string;
|
|
9
|
+
session_id?: string;
|
|
10
|
+
}
|
|
11
|
+
export interface RalphLoopOptions {
|
|
12
|
+
config?: RalphLoopConfig;
|
|
13
|
+
getTranscriptPath?: (sessionId: string) => string;
|
|
14
|
+
apiTimeout?: number;
|
|
15
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export declare const OPENCODE_STORAGE: string;
|
|
2
|
+
export declare const RULES_INJECTOR_STORAGE: string;
|
|
3
|
+
export declare const PROJECT_MARKERS: string[];
|
|
4
|
+
export declare const PROJECT_RULE_SUBDIRS: [string, string][];
|
|
5
|
+
export declare const PROJECT_RULE_FILES: string[];
|
|
6
|
+
export declare const GITHUB_INSTRUCTIONS_PATTERN: RegExp;
|
|
7
|
+
export declare const USER_RULE_DIR = ".claude/rules";
|
|
8
|
+
export declare const RULE_EXTENSIONS: string[];
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import type { RuleFileCandidate } from "./types";
|
|
2
|
+
/**
|
|
3
|
+
* Find project root by walking up from startPath.
|
|
4
|
+
* Checks for PROJECT_MARKERS (.git, pyproject.toml, package.json, etc.)
|
|
5
|
+
*
|
|
6
|
+
* @param startPath - Starting path to search from (file or directory)
|
|
7
|
+
* @returns Project root path or null if not found
|
|
8
|
+
*/
|
|
9
|
+
export declare function findProjectRoot(startPath: string): string | null;
|
|
10
|
+
/**
|
|
11
|
+
* Calculate directory distance between a rule file and current file.
|
|
12
|
+
* Distance is based on common ancestor within project root.
|
|
13
|
+
*
|
|
14
|
+
* @param rulePath - Path to the rule file
|
|
15
|
+
* @param currentFile - Path to the current file being edited
|
|
16
|
+
* @param projectRoot - Project root for relative path calculation
|
|
17
|
+
* @returns Distance (0 = same directory, higher = further)
|
|
18
|
+
*/
|
|
19
|
+
export declare function calculateDistance(rulePath: string, currentFile: string, projectRoot: string | null): number;
|
|
20
|
+
/**
|
|
21
|
+
* Find all rule files for a given context.
|
|
22
|
+
* Searches from currentFile upward to projectRoot for rule directories,
|
|
23
|
+
* then user-level directory (~/.claude/rules).
|
|
24
|
+
*
|
|
25
|
+
* IMPORTANT: This searches EVERY directory from file to project root.
|
|
26
|
+
* Not just the project root itself.
|
|
27
|
+
*
|
|
28
|
+
* @param projectRoot - Project root path (or null if outside any project)
|
|
29
|
+
* @param homeDir - User home directory
|
|
30
|
+
* @param currentFile - Current file being edited (for distance calculation)
|
|
31
|
+
* @returns Array of rule file candidates sorted by distance
|
|
32
|
+
*/
|
|
33
|
+
export declare function findRuleFiles(projectRoot: string | null, homeDir: string, currentFile: string): RuleFileCandidate[];
|
|
@@ -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 createRulesInjectorHook(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,21 @@
|
|
|
1
|
+
import type { RuleMetadata } from "./types";
|
|
2
|
+
export interface MatchResult {
|
|
3
|
+
applies: boolean;
|
|
4
|
+
reason?: string;
|
|
5
|
+
}
|
|
6
|
+
/**
|
|
7
|
+
* Check if a rule should apply to the current file based on metadata
|
|
8
|
+
*/
|
|
9
|
+
export declare function shouldApplyRule(metadata: RuleMetadata, currentFilePath: string, projectRoot: string | null): MatchResult;
|
|
10
|
+
/**
|
|
11
|
+
* Check if realPath already exists in cache (symlink deduplication)
|
|
12
|
+
*/
|
|
13
|
+
export declare function isDuplicateByRealPath(realPath: string, cache: Set<string>): boolean;
|
|
14
|
+
/**
|
|
15
|
+
* Create SHA-256 hash of content, truncated to 16 chars
|
|
16
|
+
*/
|
|
17
|
+
export declare function createContentHash(content: string): string;
|
|
18
|
+
/**
|
|
19
|
+
* Check if content hash already exists in cache
|
|
20
|
+
*/
|
|
21
|
+
export declare function isDuplicateByContentHash(hash: string, cache: Set<string>): boolean;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { RuleMetadata } from "./types";
|
|
2
|
+
export interface RuleFrontmatterResult {
|
|
3
|
+
metadata: RuleMetadata;
|
|
4
|
+
body: string;
|
|
5
|
+
}
|
|
6
|
+
/**
|
|
7
|
+
* Parse YAML frontmatter from rule file content
|
|
8
|
+
* Supports:
|
|
9
|
+
* - Single string: globs: "**\/*.py"
|
|
10
|
+
* - Inline array: globs: ["**\/*.py", "src/**\/*.ts"]
|
|
11
|
+
* - Multi-line array:
|
|
12
|
+
* globs:
|
|
13
|
+
* - "**\/*.py"
|
|
14
|
+
* - "src/**\/*.ts"
|
|
15
|
+
* - Comma-separated: globs: "**\/*.py, src/**\/*.ts"
|
|
16
|
+
* - Claude Code 'paths' field (alias for globs)
|
|
17
|
+
*/
|
|
18
|
+
export declare function parseRuleFrontmatter(content: string): RuleFrontmatterResult;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export declare function loadInjectedRules(sessionID: string): {
|
|
2
|
+
contentHashes: Set<string>;
|
|
3
|
+
realPaths: Set<string>;
|
|
4
|
+
};
|
|
5
|
+
export declare function saveInjectedRules(sessionID: string, data: {
|
|
6
|
+
contentHashes: Set<string>;
|
|
7
|
+
realPaths: Set<string>;
|
|
8
|
+
}): void;
|
|
9
|
+
export declare function clearInjectedRules(sessionID: string): void;
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Rule file metadata (Claude Code style frontmatter)
|
|
3
|
+
* Supports both Claude Code format (globs, paths) and GitHub Copilot format (applyTo)
|
|
4
|
+
* @see https://docs.anthropic.com/en/docs/claude-code/settings#rule-files
|
|
5
|
+
* @see https://docs.github.com/en/copilot/customizing-copilot/adding-repository-custom-instructions-for-github-copilot
|
|
6
|
+
*/
|
|
7
|
+
export interface RuleMetadata {
|
|
8
|
+
description?: string;
|
|
9
|
+
globs?: string | string[];
|
|
10
|
+
alwaysApply?: boolean;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* Rule information with path context and content
|
|
14
|
+
*/
|
|
15
|
+
export interface RuleInfo {
|
|
16
|
+
/** Absolute path to the rule file */
|
|
17
|
+
path: string;
|
|
18
|
+
/** Path relative to project root */
|
|
19
|
+
relativePath: string;
|
|
20
|
+
/** Directory distance from target file (0 = same dir) */
|
|
21
|
+
distance: number;
|
|
22
|
+
/** Rule file content (without frontmatter) */
|
|
23
|
+
content: string;
|
|
24
|
+
/** SHA-256 hash of content for deduplication */
|
|
25
|
+
contentHash: string;
|
|
26
|
+
/** Parsed frontmatter metadata */
|
|
27
|
+
metadata: RuleMetadata;
|
|
28
|
+
/** Why this rule matched (e.g., "alwaysApply", "glob: *.ts", "path match") */
|
|
29
|
+
matchReason: string;
|
|
30
|
+
/** Real path after symlink resolution (for duplicate detection) */
|
|
31
|
+
realPath: string;
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* Rule file candidate with discovery context
|
|
35
|
+
*/
|
|
36
|
+
export interface RuleFileCandidate {
|
|
37
|
+
path: string;
|
|
38
|
+
realPath: string;
|
|
39
|
+
isGlobal: boolean;
|
|
40
|
+
distance: number;
|
|
41
|
+
/** Single-file rules (e.g., .github/copilot-instructions.md) always apply without frontmatter */
|
|
42
|
+
isSingleFile?: boolean;
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* Session storage for injected rules tracking
|
|
46
|
+
*/
|
|
47
|
+
export interface InjectedRulesData {
|
|
48
|
+
sessionID: string;
|
|
49
|
+
/** Content hashes of already injected rules */
|
|
50
|
+
injectedHashes: string[];
|
|
51
|
+
/** Real paths of already injected rules (for symlink deduplication) */
|
|
52
|
+
injectedRealPaths: string[];
|
|
53
|
+
updatedAt: number;
|
|
54
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
type Platform = "darwin" | "linux" | "win32" | "unsupported";
|
|
2
|
+
export declare function getNotifySendPath(): Promise<string | null>;
|
|
3
|
+
export declare function getOsascriptPath(): Promise<string | null>;
|
|
4
|
+
export declare function getPowershellPath(): Promise<string | null>;
|
|
5
|
+
export declare function getAfplayPath(): Promise<string | null>;
|
|
6
|
+
export declare function getPaplayPath(): Promise<string | null>;
|
|
7
|
+
export declare function getAplayPath(): Promise<string | null>;
|
|
8
|
+
export declare function startBackgroundCheck(platform: Platform): void;
|
|
9
|
+
export {};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { PluginInput } from "@opencode-ai/plugin";
|
|
2
|
+
interface SessionNotificationConfig {
|
|
3
|
+
title?: string;
|
|
4
|
+
message?: string;
|
|
5
|
+
playSound?: boolean;
|
|
6
|
+
soundPath?: string;
|
|
7
|
+
/** Delay in ms before sending notification to confirm session is still idle (default: 1500) */
|
|
8
|
+
idleConfirmationDelay?: number;
|
|
9
|
+
/** Skip notification if there are incomplete todos (default: true) */
|
|
10
|
+
skipIfIncompleteTodos?: boolean;
|
|
11
|
+
/** Maximum number of sessions to track before cleanup (default: 100) */
|
|
12
|
+
maxTrackedSessions?: number;
|
|
13
|
+
}
|
|
14
|
+
export declare function createSessionNotification(ctx: PluginInput, config?: SessionNotificationConfig): ({ event }: {
|
|
15
|
+
event: {
|
|
16
|
+
type: string;
|
|
17
|
+
properties?: unknown;
|
|
18
|
+
};
|
|
19
|
+
}) => Promise<void>;
|
|
20
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export declare const OPENCODE_STORAGE: string;
|
|
2
|
+
export declare const MESSAGE_STORAGE: string;
|
|
3
|
+
export declare const PART_STORAGE: string;
|
|
4
|
+
export declare const THINKING_TYPES: Set<string>;
|
|
5
|
+
export declare const META_TYPES: Set<string>;
|
|
6
|
+
export declare const CONTENT_TYPES: Set<string>;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type { PluginInput } from "@opencode-ai/plugin";
|
|
2
|
+
import type { ExperimentalConfig } from "../../config";
|
|
3
|
+
export interface SessionRecoveryOptions {
|
|
4
|
+
experimental?: ExperimentalConfig;
|
|
5
|
+
}
|
|
6
|
+
type RecoveryErrorType = "tool_result_missing" | "thinking_block_order" | "thinking_disabled_violation" | null;
|
|
7
|
+
interface MessageInfo {
|
|
8
|
+
id?: string;
|
|
9
|
+
role?: string;
|
|
10
|
+
sessionID?: string;
|
|
11
|
+
parentID?: string;
|
|
12
|
+
error?: unknown;
|
|
13
|
+
}
|
|
14
|
+
export declare function detectErrorType(error: unknown): RecoveryErrorType;
|
|
15
|
+
export interface SessionRecoveryHook {
|
|
16
|
+
handleSessionRecovery: (info: MessageInfo) => Promise<boolean>;
|
|
17
|
+
isRecoverableError: (error: unknown) => boolean;
|
|
18
|
+
setOnAbortCallback: (callback: (sessionID: string) => void) => void;
|
|
19
|
+
setOnRecoveryCompleteCallback: (callback: (sessionID: string) => void) => void;
|
|
20
|
+
}
|
|
21
|
+
export declare function createSessionRecoveryHook(ctx: PluginInput, options?: SessionRecoveryOptions): SessionRecoveryHook;
|
|
22
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { StoredMessageMeta, StoredPart } from "./types";
|
|
2
|
+
export declare function generatePartId(): string;
|
|
3
|
+
export declare function getMessageDir(sessionID: string): string;
|
|
4
|
+
export declare function readMessages(sessionID: string): StoredMessageMeta[];
|
|
5
|
+
export declare function readParts(messageID: string): StoredPart[];
|
|
6
|
+
export declare function hasContent(part: StoredPart): boolean;
|
|
7
|
+
export declare function messageHasContent(messageID: string): boolean;
|
|
8
|
+
export declare function injectTextPart(sessionID: string, messageID: string, text: string): boolean;
|
|
9
|
+
export declare function findEmptyMessages(sessionID: string): string[];
|
|
10
|
+
export declare function findEmptyMessageByIndex(sessionID: string, targetIndex: number): string | null;
|
|
11
|
+
export declare function findFirstEmptyMessage(sessionID: string): string | null;
|
|
12
|
+
export declare function findMessagesWithThinkingBlocks(sessionID: string): string[];
|
|
13
|
+
export declare function findMessagesWithThinkingOnly(sessionID: string): string[];
|
|
14
|
+
export declare function findMessagesWithOrphanThinking(sessionID: string): string[];
|
|
15
|
+
export declare function prependThinkingPart(sessionID: string, messageID: string): boolean;
|
|
16
|
+
export declare function stripThinkingParts(messageID: string): boolean;
|
|
17
|
+
export declare function replaceEmptyTextParts(messageID: string, replacementText: string): boolean;
|
|
18
|
+
export declare function findMessagesWithEmptyTextParts(sessionID: string): string[];
|
|
19
|
+
export declare function findMessageByIndexNeedingThinking(sessionID: string, targetIndex: number): string | null;
|