opencode-matrixx 1.1.0 → 2.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +162 -127
- package/bin/matrixx.js +4 -4
- package/dist/agents/agent-builder.d.ts +2 -3
- package/dist/agents/architect/agent.d.ts +2 -2
- package/dist/agents/architect/index.d.ts +4 -4
- package/dist/agents/builtin-agents/agent-overrides.d.ts +1 -1
- package/dist/agents/builtin-agents/atlas-agent.d.ts +1 -1
- package/dist/agents/builtin-agents/available-skills.d.ts +2 -2
- package/dist/agents/builtin-agents/general-agents.d.ts +2 -4
- package/dist/agents/builtin-agents/hephaestus-agent.d.ts +1 -1
- package/dist/agents/builtin-agents/sisyphus-agent.d.ts +1 -1
- package/dist/agents/builtin-agents.d.ts +3 -4
- package/dist/agents/env-context.d.ts +1 -1
- package/dist/agents/index.d.ts +6 -7
- package/dist/agents/keymaker.d.ts +1 -1
- package/dist/agents/morpheus.d.ts +1 -3
- package/dist/agents/mouse/index.d.ts +2 -2
- package/dist/agents/oracle/index.d.ts +3 -3
- package/dist/agents/sati.d.ts +7 -0
- package/dist/agents/seraph.d.ts +1 -1
- package/dist/agents/types.d.ts +6 -6
- package/dist/cli/config-manager/config-context.d.ts +1 -1
- package/dist/cli/config-manager/generate-matrixx-config.d.ts +2 -0
- package/dist/cli/config-manager/opencode-config-format.d.ts +2 -1
- package/dist/cli/config-manager/write-matrixx-config.d.ts +2 -0
- package/dist/cli/config-manager.d.ts +10 -10
- package/dist/cli/doctor/checks/index.d.ts +1 -1
- package/dist/cli/doctor/checks/model-resolution-config.d.ts +2 -2
- package/dist/cli/doctor/checks/model-resolution-details.d.ts +2 -2
- package/dist/cli/doctor/checks/model-resolution-types.d.ts +1 -1
- package/dist/cli/doctor/checks/model-resolution-variant.d.ts +3 -3
- package/dist/cli/doctor/checks/model-resolution.d.ts +2 -2
- package/dist/cli/doctor/checks/system-binary.d.ts +2 -7
- package/dist/cli/doctor/checks/system-loaded-version.d.ts +2 -1
- package/dist/cli/doctor/checks/tools-gh.d.ts +2 -1
- package/dist/cli/doctor/constants.d.ts +2 -0
- package/dist/cli/doctor/formatter.d.ts +1 -1
- package/dist/cli/doctor/index.d.ts +2 -2
- package/dist/cli/doctor/runner.d.ts +1 -1
- package/dist/cli/doctor/types.d.ts +2 -30
- package/dist/cli/index.js +16839 -14585
- package/dist/cli/mcp-oauth/login.d.ts +2 -1
- package/dist/cli/mcp-oauth/logout.d.ts +2 -1
- package/dist/cli/model-fallback-types.d.ts +1 -1
- package/dist/cli/model-fallback.d.ts +3 -4
- package/dist/cli/provider-availability.d.ts +1 -1
- package/dist/cli/run/agent-resolver.d.ts +1 -1
- package/dist/cli/run/event-formatting.d.ts +1 -1
- package/dist/cli/run/event-handlers.d.ts +1 -1
- package/dist/cli/run/event-stream-processor.d.ts +1 -1
- package/dist/cli/run/events.d.ts +1 -1
- package/dist/cli/run/index.d.ts +6 -6
- package/dist/cli/run/json-output.d.ts +1 -1
- package/dist/cli/run/opencode-binary-resolver.d.ts +0 -1
- package/dist/cli/run/poll-for-completion.d.ts +3 -2
- package/dist/cli/run/runner.d.ts +1 -1
- package/dist/config/index.d.ts +3 -3
- package/dist/config/profiles.d.ts +1 -1
- package/dist/config/schema/agent-definitions.d.ts +0 -1
- package/dist/config/schema/agent-names.d.ts +6 -39
- package/dist/config/schema/agent-overrides.d.ts +2 -2
- package/dist/config/schema/claude-code.d.ts +0 -1
- package/dist/config/schema/commands.d.ts +2 -0
- package/dist/config/schema/experimental.d.ts +0 -26
- package/dist/config/schema/hooks.d.ts +3 -1
- package/dist/config/schema/matrixx-config.d.ts +22 -51
- package/dist/config/schema/matrixx-self-config.d.ts +6 -0
- package/dist/config/schema/morpheus.d.ts +2 -1
- package/dist/config/schema/security.d.ts +4 -3
- package/dist/config/schema/skills.d.ts +2 -20
- package/dist/config/schema/websearch.d.ts +0 -5
- package/dist/config/schema.d.ts +10 -12
- package/dist/create-hooks.d.ts +4 -2
- package/dist/create-managers.d.ts +2 -2
- package/dist/create-tools.d.ts +3 -2
- package/dist/features/background-agent/background-task-notification-template.d.ts +2 -1
- package/dist/features/background-agent/constants.d.ts +1 -5
- package/dist/features/background-agent/index.d.ts +3 -3
- package/dist/features/background-agent/loop-detector.d.ts +2 -2
- package/dist/features/background-agent/manager.d.ts +13 -2
- package/dist/features/background-agent/state.d.ts +1 -1
- package/dist/features/background-agent/task-poller.d.ts +3 -2
- package/dist/features/background-agent/types.d.ts +4 -1
- package/dist/features/builtin-commands/index.d.ts +1 -1
- package/dist/features/builtin-commands/templates/end-ultrawork.d.ts +1 -0
- package/dist/features/builtin-commands/templates/handoff.d.ts +1 -1
- package/dist/features/builtin-commands/templates/pickup.d.ts +1 -1
- package/dist/features/builtin-commands/templates/profile.d.ts +1 -0
- package/dist/features/builtin-commands/templates/refactor.d.ts +1 -1
- package/dist/features/builtin-commands/types.d.ts +1 -4
- package/dist/features/builtin-skills/index.d.ts +1 -1
- package/dist/features/builtin-skills/skills/document-reader.d.ts +0 -2
- package/dist/features/builtin-skills/skills/dsl-codegen.d.ts +0 -1
- package/dist/features/builtin-skills/skills/dsl-composition.d.ts +0 -1
- package/dist/features/builtin-skills/skills/dsl-core.d.ts +0 -1
- package/dist/features/builtin-skills/skills/dsl-grammar.d.ts +0 -1
- package/dist/features/builtin-skills/skills/dsl-metamodel.d.ts +0 -1
- package/dist/features/builtin-skills/skills/dsl-model-transformation.d.ts +0 -1
- package/dist/features/builtin-skills/skills/dsl-pyecore-advanced.d.ts +0 -1
- package/dist/features/builtin-skills/skills/dsl-testing.d.ts +0 -1
- package/dist/features/builtin-skills/skills/dsl-textx-ecosystem.d.ts +0 -1
- package/dist/features/builtin-skills/skills/dsl-tooling.d.ts +0 -1
- package/dist/features/builtin-skills/skills/dsl-validation.d.ts +0 -1
- package/dist/features/builtin-skills/skills/frontend-a11y.d.ts +3 -0
- package/dist/features/builtin-skills/skills/frontend-build-tooling.d.ts +3 -0
- package/dist/features/builtin-skills/skills/frontend-perf.d.ts +3 -0
- package/dist/features/builtin-skills/skills/frontend-react-nextjs.d.ts +3 -0
- package/dist/features/builtin-skills/skills/frontend-state-data.d.ts +3 -0
- package/dist/features/builtin-skills/skills/frontend-svelte-sveltekit.d.ts +3 -0
- package/dist/features/builtin-skills/skills/frontend-testing.d.ts +3 -0
- package/dist/features/builtin-skills/skills/index.d.ts +25 -30
- package/dist/features/builtin-skills/skills/matrixx-self-config.d.ts +3 -0
- package/dist/features/builtin-skills/skills/quality-gate.d.ts +2 -0
- package/dist/features/builtin-skills/skills/review-work.d.ts +0 -2
- package/dist/features/builtin-skills/skills/security-api.d.ts +0 -1
- package/dist/features/builtin-skills/skills/security-core.d.ts +0 -1
- package/dist/features/builtin-skills/skills/security-crypto.d.ts +0 -1
- package/dist/features/builtin-skills/skills/security-dast.d.ts +0 -1
- package/dist/features/builtin-skills/skills/security-dependencies.d.ts +0 -1
- package/dist/features/builtin-skills/skills/security-infra.d.ts +0 -1
- package/dist/features/builtin-skills/skills/security-review.d.ts +0 -1
- package/dist/features/builtin-skills/skills/security-sast.d.ts +0 -1
- package/dist/features/builtin-skills/skills/security-secrets.d.ts +0 -1
- package/dist/features/builtin-skills/skills/software-dev.d.ts +2 -0
- package/dist/features/builtin-skills/skills/tdd-enforcer.d.ts +0 -2
- package/dist/features/builtin-skills/skills.d.ts +1 -1
- package/dist/features/claude-code-agent-loader/index.d.ts +1 -1
- package/dist/features/claude-code-command-loader/index.d.ts +1 -1
- package/dist/features/claude-code-command-loader/types.d.ts +2 -1
- package/dist/features/claude-code-mcp-loader/env-expander.d.ts +0 -1
- package/dist/features/claude-code-mcp-loader/index.d.ts +2 -2
- package/dist/features/claude-code-mcp-loader/loader.d.ts +1 -2
- package/dist/features/claude-code-plugin-loader/discovery.d.ts +1 -1
- package/dist/features/claude-code-plugin-loader/index.d.ts +7 -7
- package/dist/features/claude-code-plugin-loader/loader.d.ts +5 -5
- package/dist/features/claude-code-plugin-loader/plugin-path-resolver.d.ts +0 -1
- package/dist/features/claude-code-plugin-loader/types.d.ts +10 -9
- package/dist/features/claude-tasks/index.d.ts +2 -2
- package/dist/features/claude-tasks/session-storage.d.ts +2 -1
- package/dist/features/claude-tasks/storage.d.ts +0 -1
- package/dist/features/claude-tasks/types.d.ts +4 -4
- package/dist/features/context-injector/index.d.ts +1 -1
- package/dist/features/context-injector/injector.d.ts +1 -27
- package/dist/features/handoff/constants.d.ts +8 -0
- package/dist/features/handoff/index.d.ts +4 -0
- package/dist/features/handoff/schema.d.ts +90 -0
- package/dist/{hooks/handoff-injector → features/handoff}/storage.d.ts +2 -0
- package/dist/features/handoff/validate.d.ts +22 -0
- package/dist/features/hook-message-injector/constants.d.ts +1 -1
- package/dist/features/hook-message-injector/index.d.ts +2 -2
- package/dist/features/hook-message-injector/injector.d.ts +2 -2
- package/dist/features/mcp-oauth/dcr.d.ts +3 -9
- package/dist/features/mcp-oauth/index.d.ts +1 -1
- package/dist/features/mcp-oauth/provider.d.ts +4 -4
- package/dist/features/mcp-oauth/schema.d.ts +0 -1
- package/dist/features/mcp-oauth/step-up.d.ts +2 -1
- package/dist/features/mission-state/constants.d.ts +0 -3
- package/dist/features/mission-state/index.d.ts +1 -1
- package/dist/features/mission-state/storage.d.ts +0 -1
- package/dist/features/opencode-skill-loader/index.d.ts +6 -7
- package/dist/features/opencode-skill-loader/loaded-skill-from-path.d.ts +1 -1
- package/dist/features/opencode-skill-loader/loader.d.ts +2 -2
- package/dist/features/opencode-skill-loader/merger/config-skill-entry-loader.d.ts +1 -1
- package/dist/features/opencode-skill-loader/merger/skill-definition-merger.d.ts +1 -1
- package/dist/features/opencode-skill-loader/merger/skills-config-normalizer.d.ts +1 -1
- package/dist/features/opencode-skill-loader/merger.d.ts +3 -2
- package/dist/features/opencode-skill-loader/skill-content.d.ts +3 -4
- package/dist/features/opencode-skill-loader/skill-discovery.d.ts +1 -1
- package/dist/features/opencode-skill-loader/skill-resolution-options.d.ts +1 -2
- package/dist/features/run-continuation-state/index.d.ts +1 -1
- package/dist/features/run-continuation-state/types.d.ts +2 -1
- package/dist/features/skill-mcp-manager/cleanup.d.ts +0 -1
- package/dist/features/skill-mcp-manager/index.d.ts +1 -1
- package/dist/features/skill-mcp-manager/oauth-handler.d.ts +0 -1
- package/dist/features/skill-mcp-manager/types.d.ts +5 -4
- package/dist/features/task-toast-manager/index.d.ts +2 -2
- package/dist/features/task-toast-manager/manager.d.ts +1 -1
- package/dist/features/tmux-subagent/action-executor.d.ts +2 -2
- package/dist/features/tmux-subagent/cleanup.d.ts +1 -9
- package/dist/features/tmux-subagent/decision-engine.d.ts +3 -3
- package/dist/features/tmux-subagent/event-handlers.d.ts +3 -3
- package/dist/features/tmux-subagent/index.d.ts +7 -8
- package/dist/features/tmux-subagent/manager.d.ts +1 -1
- package/dist/features/tmux-subagent/polling.d.ts +0 -18
- package/dist/features/tmux-subagent/session-created-handler.d.ts +1 -1
- package/dist/features/tmux-subagent/session-deleted-handler.d.ts +1 -1
- package/dist/features/tmux-subagent/spawn-action-decider.d.ts +1 -1
- package/dist/features/tool-metadata-store/index.d.ts +1 -1
- package/dist/hooks/anthropic-context-window-limit-recovery/aggressive-truncation-strategy.d.ts +1 -1
- package/dist/hooks/anthropic-context-window-limit-recovery/empty-content-recovery.d.ts +1 -1
- package/dist/hooks/anthropic-context-window-limit-recovery/executor.d.ts +3 -2
- package/dist/hooks/anthropic-context-window-limit-recovery/index.d.ts +5 -5
- package/dist/hooks/anthropic-context-window-limit-recovery/message-builder.d.ts +1 -1
- package/dist/hooks/anthropic-context-window-limit-recovery/message-storage-directory.d.ts +0 -3
- package/dist/hooks/anthropic-context-window-limit-recovery/storage.d.ts +1 -1
- package/dist/hooks/anthropic-context-window-limit-recovery/summarize-retry-strategy.d.ts +1 -1
- package/dist/hooks/architect/index.d.ts +1 -1
- package/dist/hooks/auto-slash-command/executor.d.ts +2 -1
- package/dist/hooks/auto-slash-command/hook.d.ts +1 -1
- package/dist/hooks/auto-slash-command/index.d.ts +3 -3
- package/dist/hooks/auto-slash-command/types.d.ts +0 -5
- package/dist/hooks/auto-update-checker/checker.d.ts +6 -6
- package/dist/hooks/auto-update-checker/constants.d.ts +3 -4
- package/dist/hooks/auto-update-checker/index.d.ts +4 -4
- package/dist/hooks/comment-checker/cli-runner.d.ts +2 -1
- package/dist/hooks/comment-checker/downloader.d.ts +0 -5
- package/dist/hooks/comment-checker/types.d.ts +0 -18
- package/dist/hooks/delegate-task-retry/index.d.ts +2 -2
- package/dist/hooks/design-intent-preserver/constants.d.ts +6 -0
- package/dist/hooks/design-intent-preserver/hook.d.ts +19 -0
- package/dist/hooks/design-intent-preserver/index.d.ts +1 -0
- package/dist/hooks/design-intent-preserver/phase-detector.d.ts +8 -0
- package/dist/hooks/directory-agents-injector/finder.d.ts +1 -1
- package/dist/hooks/directory-agents-injector/hook.d.ts +3 -23
- package/dist/hooks/directory-injector/factory.d.ts +40 -0
- package/dist/hooks/directory-injector/index.d.ts +1 -0
- package/dist/hooks/directory-readme-injector/finder.d.ts +1 -1
- package/dist/hooks/directory-readme-injector/hook.d.ts +3 -23
- package/dist/hooks/env-file-write-guard/hook.d.ts +2 -1
- package/dist/hooks/index.d.ts +43 -41
- package/dist/hooks/interactive-bash-session/constants.d.ts +1 -1
- package/dist/hooks/interactive-bash-session/index.d.ts +0 -2
- package/dist/hooks/interactive-bash-session/parser.d.ts +2 -2
- package/dist/hooks/json-error-recovery/index.d.ts +1 -1
- package/dist/hooks/keyword-detector/analyze/index.d.ts +1 -1
- package/dist/hooks/keyword-detector/constants.d.ts +5 -6
- package/dist/hooks/keyword-detector/detector.d.ts +2 -2
- package/dist/hooks/keyword-detector/index.d.ts +1 -2
- package/dist/hooks/keyword-detector/search/index.d.ts +1 -1
- package/dist/hooks/keyword-detector/ultrawork/index.d.ts +4 -4
- package/dist/hooks/matrix-loop/completion-promise-detector.d.ts +10 -0
- package/dist/hooks/matrix-loop/completion-verifier.d.ts +4 -1
- package/dist/hooks/matrix-loop/constants.d.ts +0 -1
- package/dist/hooks/matrix-loop/index.d.ts +3 -3
- package/dist/hooks/matrix-loop/storage.d.ts +0 -1
- package/dist/hooks/non-interactive-env/index.d.ts +0 -1
- package/dist/hooks/non-interactive-env/non-interactive-env-hook.d.ts +0 -1
- package/dist/hooks/preemptive-compaction-types.d.ts +2 -1
- package/dist/hooks/prometheus-md-only/constants.d.ts +0 -1
- package/dist/hooks/quality-gate/hook.d.ts +18 -0
- package/dist/hooks/rules-injector/index.d.ts +1 -1
- package/dist/hooks/rules-injector/injector.d.ts +1 -0
- package/dist/hooks/rules-injector/matcher.d.ts +2 -1
- package/dist/hooks/rules-injector/output-path.d.ts +2 -1
- package/dist/hooks/rules-injector/parser.d.ts +2 -1
- package/dist/hooks/rules-injector/types.d.ts +0 -21
- package/dist/hooks/runtime-fallback/agent-resolver.d.ts +0 -2
- package/dist/hooks/runtime-fallback/auto-retry-signal.d.ts +2 -1
- package/dist/hooks/runtime-fallback/event-handler.d.ts +1 -1
- package/dist/hooks/runtime-fallback/fallback-retry-dispatcher.d.ts +1 -1
- package/dist/hooks/runtime-fallback/fallback-state.d.ts +1 -3
- package/dist/hooks/runtime-fallback/index.d.ts +1 -1
- package/dist/hooks/runtime-fallback/message-update-handler.d.ts +1 -1
- package/dist/hooks/runtime-fallback/session-status-handler.d.ts +1 -1
- package/dist/hooks/runtime-fallback/types.d.ts +1 -1
- package/dist/hooks/runtime-fallback/visible-assistant-response.d.ts +1 -1
- package/dist/hooks/secret-leak-guard/gitleaks-runner.d.ts +4 -3
- package/dist/hooks/secret-leak-guard/hook.d.ts +2 -1
- package/dist/hooks/session-recovery/constants.d.ts +1 -2
- package/dist/hooks/session-recovery/index.d.ts +3 -3
- package/dist/hooks/session-recovery/storage.d.ts +9 -17
- package/dist/hooks/session-recovery/types.d.ts +3 -5
- package/dist/hooks/start-work/index.d.ts +1 -1
- package/dist/hooks/stop-continuation-guard/hook.d.ts +2 -1
- package/dist/hooks/stop-continuation-guard/index.d.ts +1 -1
- package/dist/hooks/task-notepad/constants.d.ts +10 -0
- package/dist/hooks/task-notepad/hook.d.ts +12 -0
- package/dist/hooks/task-notepad/index.d.ts +3 -0
- package/dist/hooks/task-notepad/types.d.ts +16 -0
- package/dist/hooks/tasks-todowrite-disabler/index.d.ts +1 -1
- package/dist/hooks/think-mode/hook.d.ts +5 -1
- package/dist/hooks/think-mode/index.d.ts +1 -1
- package/dist/hooks/think-mode/switcher.d.ts +1 -0
- package/dist/hooks/think-mode/types.d.ts +3 -2
- package/dist/hooks/todo-continuation-enforcer/continuation-injection.d.ts +1 -1
- package/dist/hooks/todo-continuation-enforcer/countdown.d.ts +1 -1
- package/dist/hooks/unstable-agent-babysitter/index.d.ts +1 -1
- package/dist/hooks/webfetch-redirect-guard/redirect-resolution.d.ts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +64717 -51266
- package/dist/mcp/index.d.ts +1 -1
- package/dist/plugin/chat-message.d.ts +1 -1
- package/dist/plugin/event.d.ts +1 -1
- package/dist/plugin/hooks/create-continuation-hooks.d.ts +1 -1
- package/dist/plugin/hooks/create-core-hooks.d.ts +3 -1
- package/dist/plugin/hooks/create-session-hooks.d.ts +3 -3
- package/dist/plugin/hooks/create-skill-hooks.d.ts +1 -1
- package/dist/plugin/hooks/create-tool-guard-hooks.d.ts +3 -1
- package/dist/plugin/hooks/create-transform-hooks.d.ts +3 -3
- package/dist/plugin/messages-transform.d.ts +1 -0
- package/dist/plugin/session-agent-resolver.d.ts +1 -1
- package/dist/plugin/tool-execute-before.bench.d.ts +1 -0
- package/dist/plugin/tool-execute-before.d.ts +1 -1
- package/dist/plugin/tool-registry.d.ts +1 -1
- package/dist/plugin/unstable-agent-babysitter.d.ts +1 -1
- package/dist/plugin-config.d.ts +24 -1
- package/dist/plugin-handlers/agent-config-handler.d.ts +1 -1
- package/dist/plugin-handlers/config-handler.d.ts +1 -1
- package/dist/plugin-handlers/index.d.ts +6 -6
- package/dist/plugin-interface.d.ts +1 -1
- package/dist/shared/agent-tool-restrictions.d.ts +0 -1
- package/dist/shared/code-patterns.d.ts +2 -0
- package/dist/shared/command-executor/embedded-commands.d.ts +2 -1
- package/dist/shared/command-executor/execute-command.d.ts +1 -1
- package/dist/shared/command-executor.d.ts +0 -2
- package/dist/shared/dynamic-truncator.d.ts +3 -9
- package/dist/shared/error-formatting.d.ts +27 -0
- package/dist/shared/external-plugin-detector.d.ts +2 -1
- package/dist/shared/frontmatter.d.ts +2 -1
- package/dist/shared/git-worktree/index.d.ts +3 -3
- package/dist/shared/index.d.ts +36 -35
- package/dist/shared/is-object.d.ts +1 -0
- package/dist/shared/jsonc-parser.d.ts +2 -1
- package/dist/shared/logger.d.ts +0 -1
- package/dist/shared/migration.d.ts +2 -2
- package/dist/shared/model-availability.d.ts +24 -2
- package/dist/shared/model-suggestion-retry.d.ts +1 -1
- package/dist/shared/normalize-sdk-response.d.ts +2 -1
- package/dist/shared/opencode-config-dir-types.d.ts +0 -1
- package/dist/shared/permission-compat.d.ts +2 -1
- package/dist/shared/port-utils.d.ts +1 -1
- package/dist/shared/session-cursor.d.ts +1 -1
- package/dist/shared/session-injected-paths.d.ts +0 -5
- package/dist/shared/session-model-state.d.ts +2 -3
- package/dist/shared/session-temperature-store.d.ts +3 -0
- package/dist/shared/shell-env.d.ts +2 -18
- package/dist/shared/skill-path-resolver.d.ts +1 -1
- package/dist/shared/system-directive.d.ts +0 -1
- package/dist/shared/tmux/index.d.ts +1 -1
- package/dist/shared/tmux/tmux-utils.d.ts +6 -6
- package/dist/shared/token-cache.d.ts +23 -0
- package/dist/shared/transcript-path.d.ts +1 -0
- package/dist/tools/ast-grep/cli-binary-path-resolution.d.ts +0 -1
- package/dist/tools/ast-grep/constants.d.ts +1 -2
- package/dist/tools/ast-grep/downloader.d.ts +0 -1
- package/dist/tools/ast-grep/index.d.ts +4 -4
- package/dist/tools/ast-grep/result-formatter.d.ts +1 -3
- package/dist/tools/ast-grep/types.d.ts +1 -24
- package/dist/tools/background-task/index.d.ts +2 -2
- package/dist/tools/background-task/time-format.d.ts +0 -1
- package/dist/tools/background-task/tools.d.ts +2 -2
- package/dist/tools/background-task/types.d.ts +0 -19
- package/dist/tools/delegate-agent/background-agent-executor.d.ts +5 -0
- package/dist/tools/{call-omo-agent → delegate-agent}/background-executor.d.ts +3 -3
- package/dist/tools/delegate-agent/constants.d.ts +2 -0
- package/dist/tools/{call-omo-agent → delegate-agent}/index.d.ts +2 -2
- package/dist/tools/{call-omo-agent → delegate-agent}/session-creator.d.ts +2 -2
- package/dist/tools/{call-omo-agent → delegate-agent}/subagent-session-creator.d.ts +2 -2
- package/dist/tools/{call-omo-agent → delegate-agent}/sync-executor.d.ts +3 -3
- package/dist/tools/{call-omo-agent → delegate-agent}/tools.d.ts +1 -1
- package/dist/tools/{call-omo-agent → delegate-agent}/types.d.ts +1 -16
- package/dist/tools/delegate-task/background-continuation.d.ts +1 -1
- package/dist/tools/delegate-task/background-task.d.ts +2 -1
- package/dist/tools/delegate-task/categories.d.ts +5 -3
- package/dist/tools/delegate-task/category-resolver.d.ts +2 -1
- package/dist/tools/delegate-task/constants.d.ts +6 -18
- package/dist/tools/delegate-task/error-formatting.d.ts +4 -13
- package/dist/tools/delegate-task/executor-types.d.ts +1 -2
- package/dist/tools/delegate-task/executor.d.ts +7 -7
- package/dist/tools/delegate-task/index.d.ts +3 -3
- package/dist/tools/delegate-task/parent-context-resolver.d.ts +1 -2
- package/dist/tools/delegate-task/prompt-builder.d.ts +0 -1
- package/dist/tools/delegate-task/skill-resolver.d.ts +1 -2
- package/dist/tools/delegate-task/subagent-resolver.d.ts +1 -1
- package/dist/tools/delegate-task/sync-continuation-deps.d.ts +1 -1
- package/dist/tools/delegate-task/sync-continuation.d.ts +1 -1
- package/dist/tools/delegate-task/sync-prompt-sender.d.ts +2 -1
- package/dist/tools/delegate-task/sync-result-fetcher.d.ts +6 -1
- package/dist/tools/delegate-task/sync-session-poller.d.ts +5 -1
- package/dist/tools/delegate-task/sync-task-deps.d.ts +2 -2
- package/dist/tools/delegate-task/sync-task.d.ts +2 -1
- package/dist/tools/delegate-task/tools.d.ts +1 -1
- package/dist/tools/delegate-task/types.d.ts +2 -3
- package/dist/tools/delegate-task/unstable-agent-task.d.ts +2 -1
- package/dist/tools/glob/cli.d.ts +1 -1
- package/dist/tools/glob/constants.d.ts +1 -1
- package/dist/tools/grep/cli.d.ts +1 -2
- package/dist/tools/grep/constants.d.ts +0 -1
- package/dist/tools/grep/result-formatter.d.ts +1 -2
- package/dist/tools/grep/types.d.ts +0 -4
- package/dist/tools/handoff/archive-handler.d.ts +9 -0
- package/dist/tools/handoff/body-formatter.d.ts +9 -0
- package/dist/tools/handoff/constants.d.ts +17 -0
- package/dist/tools/handoff/create-handler.d.ts +34 -0
- package/dist/tools/handoff/git.d.ts +12 -0
- package/dist/tools/handoff/index.d.ts +3 -0
- package/dist/tools/handoff/list-handler.d.ts +8 -0
- package/dist/tools/handoff/read-handler.d.ts +8 -0
- package/dist/tools/handoff/tools.d.ts +11 -0
- package/dist/tools/hashline-edit/autocorrect-replacement-lines.d.ts +0 -5
- package/dist/tools/hashline-edit/edit-operations.d.ts +2 -1
- package/dist/tools/hashline-edit/edit-text-normalization.d.ts +0 -2
- package/dist/tools/hashline-edit/file-text-canonicalization.d.ts +2 -1
- package/dist/tools/hashline-edit/hash-computation.d.ts +2 -1
- package/dist/tools/hashline-edit/hashline-chunk-formatter.d.ts +1 -1
- package/dist/tools/hashline-edit/hashline-edit-executor.d.ts +1 -1
- package/dist/tools/hashline-edit/index.d.ts +4 -5
- package/dist/tools/hashline-edit/validation.d.ts +0 -2
- package/dist/tools/index.d.ts +8 -7
- package/dist/tools/interactive-bash/constants.d.ts +1 -1
- package/dist/tools/interactive-bash/index.d.ts +1 -1
- package/dist/tools/look-at/index.d.ts +1 -1
- package/dist/tools/lsp/client.d.ts +1 -1
- package/dist/tools/lsp/config.d.ts +1 -1
- package/dist/tools/lsp/constants.d.ts +1 -1
- package/dist/tools/lsp/index.d.ts +4 -4
- package/dist/tools/lsp/lsp-client-transport.d.ts +1 -1
- package/dist/tools/lsp/lsp-client-wrapper.d.ts +1 -5
- package/dist/tools/lsp/lsp-formatters.d.ts +1 -5
- package/dist/tools/lsp/lsp-server.d.ts +1 -1
- package/dist/tools/lsp/tools.d.ts +3 -3
- package/dist/tools/lsp/types.d.ts +8 -7
- package/dist/tools/session-manager/constants.d.ts +1 -1
- package/dist/tools/session-manager/index.d.ts +1 -1
- package/dist/tools/session-manager/session-formatter.d.ts +1 -1
- package/dist/tools/session-manager/storage.d.ts +2 -3
- package/dist/tools/session-manager/types.d.ts +0 -4
- package/dist/tools/skill/constants.d.ts +0 -1
- package/dist/tools/skill/index.d.ts +1 -1
- package/dist/tools/skill/types.d.ts +1 -4
- package/dist/tools/skill-mcp/constants.d.ts +0 -1
- package/dist/tools/skill-mcp/index.d.ts +1 -1
- package/dist/tools/skill-mcp/tools.d.ts +1 -1
- package/dist/tools/slashcommand/index.d.ts +1 -1
- package/dist/tools/slashcommand/types.d.ts +1 -1
- package/dist/tools/task/constants.d.ts +1 -0
- package/dist/tools/task/index.d.ts +1 -2
- package/dist/tools/task/types.d.ts +10 -10
- package/package.json +13 -9
- package/dist/agents/niobe.d.ts +0 -7
- package/dist/agents/zion.d.ts +0 -7
- package/dist/cli/config-manager/generate-omo-config.d.ts +0 -2
- package/dist/cli/config-manager/write-omo-config.d.ts +0 -2
- package/dist/config/schema/dynamic-context-pruning.d.ts +0 -28
- package/dist/config/schema/git-master.d.ts +0 -6
- package/dist/features/background-agent/background-event-handler.d.ts +0 -26
- package/dist/features/background-agent/background-manager-shutdown.d.ts +0 -25
- package/dist/features/background-agent/background-task-completer.d.ts +0 -3
- package/dist/features/background-agent/duration-formatter.d.ts +0 -1
- package/dist/features/background-agent/error-classifier.d.ts +0 -2
- package/dist/features/background-agent/format-duration.d.ts +0 -1
- package/dist/features/background-agent/message-dir.d.ts +0 -1
- package/dist/features/background-agent/notification-builder.d.ts +0 -8
- package/dist/features/background-agent/notification-tracker.d.ts +0 -6
- package/dist/features/background-agent/notify-parent-session.d.ts +0 -10
- package/dist/features/background-agent/parent-session-context-resolver.d.ts +0 -14
- package/dist/features/background-agent/parent-session-notifier.d.ts +0 -3
- package/dist/features/background-agent/poll-running-tasks.d.ts +0 -15
- package/dist/features/background-agent/process-signal.d.ts +0 -2
- package/dist/features/background-agent/result-handler-context.d.ts +0 -8
- package/dist/features/background-agent/result-handler.d.ts +0 -7
- package/dist/features/background-agent/session-idle-event-handler.d.ts +0 -10
- package/dist/features/background-agent/session-output-validator.d.ts +0 -2
- package/dist/features/background-agent/session-task-cleanup.d.ts +0 -10
- package/dist/features/background-agent/session-todo-checker.d.ts +0 -2
- package/dist/features/background-agent/session-validator.d.ts +0 -7
- package/dist/features/background-agent/spawner/background-session-creator.d.ts +0 -10
- package/dist/features/background-agent/spawner/concurrency-key-from-launch-input.d.ts +0 -2
- package/dist/features/background-agent/spawner/parent-directory-resolver.d.ts +0 -6
- package/dist/features/background-agent/spawner/spawner-context.d.ts +0 -11
- package/dist/features/background-agent/spawner/task-factory.d.ts +0 -2
- package/dist/features/background-agent/spawner/task-resumer.d.ts +0 -3
- package/dist/features/background-agent/spawner/task-starter.d.ts +0 -3
- package/dist/features/background-agent/spawner/tmux-callback-invoker.d.ts +0 -8
- package/dist/features/background-agent/spawner.d.ts +0 -14
- package/dist/features/background-agent/stale-task-pruner.d.ts +0 -15
- package/dist/features/background-agent/task-canceller.d.ts +0 -27
- package/dist/features/background-agent/task-completer.d.ts +0 -13
- package/dist/features/background-agent/task-launch.d.ts +0 -15
- package/dist/features/background-agent/task-queries.d.ts +0 -7
- package/dist/features/background-agent/task-queue-processor.d.ts +0 -14
- package/dist/features/background-agent/task-resumer.d.ts +0 -14
- package/dist/features/background-agent/task-starter.d.ts +0 -27
- package/dist/features/background-agent/task-tracker.d.ts +0 -18
- package/dist/features/builtin-skills/skills/academic-review.d.ts +0 -4
- package/dist/features/builtin-skills/skills/academic-writing.d.ts +0 -4
- package/dist/features/builtin-skills/skills/crypto-market-analysis.d.ts +0 -4
- package/dist/features/builtin-skills/skills/crypto-onchain.d.ts +0 -4
- package/dist/features/builtin-skills/skills/crypto-trading.d.ts +0 -4
- package/dist/features/builtin-skills/skills/data-management-plan.d.ts +0 -4
- package/dist/features/builtin-skills/skills/deliverable-writing.d.ts +0 -4
- package/dist/features/builtin-skills/skills/eu-horizon.d.ts +0 -4
- package/dist/features/builtin-skills/skills/git-master-skill-metadata.d.ts +0 -2
- package/dist/features/builtin-skills/skills/grant-writing.d.ts +0 -4
- package/dist/features/builtin-skills/skills/ip-exploitation.d.ts +0 -4
- package/dist/features/builtin-skills/skills/literature-review.d.ts +0 -4
- package/dist/features/builtin-skills/skills/project-management.d.ts +0 -4
- package/dist/features/builtin-skills/skills/research-methodology.d.ts +0 -4
- package/dist/features/builtin-skills/skills/scientific-presentation.d.ts +0 -4
- package/dist/features/builtin-skills/skills/technical-lead.d.ts +0 -4
- package/dist/features/mcp-oauth/resource-indicator.d.ts +0 -2
- package/dist/features/opencode-skill-loader/async-loader.d.ts +0 -6
- package/dist/features/opencode-skill-loader/blocking.d.ts +0 -2
- package/dist/features/opencode-skill-loader/git-master-template-injection.d.ts +0 -2
- package/dist/features/team-mode/index.d.ts +0 -2
- package/dist/features/team-mode/team-layout-tmux/index.d.ts +0 -1
- package/dist/features/team-mode/team-layout-tmux/layout.d.ts +0 -15
- package/dist/features/team-mode/team-worktree/cleanup.d.ts +0 -3
- package/dist/features/team-mode/team-worktree/index.d.ts +0 -2
- package/dist/features/team-mode/team-worktree/manager.d.ts +0 -15
- package/dist/features/team-mode/types.d.ts +0 -210
- package/dist/features/tmux-subagent/manager-cleanup.d.ts +0 -12
- package/dist/features/tmux-subagent/session-cleaner.d.ts +0 -23
- package/dist/features/tmux-subagent/session-message-count.d.ts +0 -1
- package/dist/features/tmux-subagent/session-spawner.d.ts +0 -34
- package/dist/hooks/anthropic-context-window-limit-recovery/deduplication-recovery.d.ts +0 -6
- package/dist/hooks/anthropic-context-window-limit-recovery/pruning-deduplication.d.ts +0 -10
- package/dist/hooks/anthropic-context-window-limit-recovery/pruning-tool-output-truncation.d.ts +0 -6
- package/dist/hooks/anthropic-context-window-limit-recovery/pruning-types.d.ts +0 -36
- package/dist/hooks/claude-code-hooks/claude-code-hooks-hook.d.ts +0 -48
- package/dist/hooks/claude-code-hooks/config-loader.d.ts +0 -13
- package/dist/hooks/claude-code-hooks/config.d.ts +0 -3
- package/dist/hooks/claude-code-hooks/handlers/chat-message-handler.d.ts +0 -19
- package/dist/hooks/claude-code-hooks/handlers/pre-compact-handler.d.ts +0 -7
- package/dist/hooks/claude-code-hooks/handlers/session-event-handler.d.ts +0 -8
- package/dist/hooks/claude-code-hooks/handlers/tool-execute-after-handler.d.ts +0 -11
- package/dist/hooks/claude-code-hooks/handlers/tool-execute-before-handler.d.ts +0 -9
- package/dist/hooks/claude-code-hooks/index.d.ts +0 -1
- package/dist/hooks/claude-code-hooks/plugin-config.d.ts +0 -8
- package/dist/hooks/claude-code-hooks/post-tool-use.d.ts +0 -40
- package/dist/hooks/claude-code-hooks/pre-compact.d.ts +0 -16
- package/dist/hooks/claude-code-hooks/pre-tool-use.d.ts +0 -25
- package/dist/hooks/claude-code-hooks/session-hook-state.d.ts +0 -9
- package/dist/hooks/claude-code-hooks/stop.d.ts +0 -20
- package/dist/hooks/claude-code-hooks/todo.d.ts +0 -12
- package/dist/hooks/claude-code-hooks/tool-input-cache.d.ts +0 -5
- package/dist/hooks/claude-code-hooks/transcript.d.ts +0 -29
- package/dist/hooks/claude-code-hooks/types.d.ts +0 -183
- package/dist/hooks/claude-code-hooks/user-prompt-submit.d.ts +0 -22
- package/dist/hooks/handoff-injector/constants.d.ts +0 -4
- package/dist/hooks/interactive-bash-session/interactive-bash-session-hook.d.ts +0 -23
- package/dist/hooks/interactive-bash-session/interactive-bash-session-tracker.d.ts +0 -21
- package/dist/hooks/interactive-bash-session/tmux-command-parser.d.ts +0 -4
- package/dist/hooks/keyword-detector/types.d.ts +0 -4
- package/dist/hooks/non-interactive-env/types.d.ts +0 -3
- package/dist/hooks/session-recovery/recover-empty-content-message.d.ts +0 -5
- package/dist/plugin-handlers/agent-key-remapper.d.ts +0 -1
- package/dist/shared/available-models-fetcher.d.ts +0 -4
- package/dist/shared/command-executor/execute-hook-command.d.ts +0 -10
- package/dist/shared/command-executor/home-directory.d.ts +0 -1
- package/dist/shared/command-executor/shell-path.d.ts +0 -2
- package/dist/shared/fallback-model-availability.d.ts +0 -5
- package/dist/shared/hook-disabled.d.ts +0 -2
- package/dist/shared/model-cache-availability.d.ts +0 -2
- package/dist/shared/model-name-matcher.d.ts +0 -1
- package/dist/shared/models-json-cache-reader.d.ts +0 -1
- package/dist/shared/open-code-client-accessors.d.ts +0 -3
- package/dist/shared/open-code-client-shapes.d.ts +0 -13
- package/dist/shared/pattern-matcher.d.ts +0 -3
- package/dist/shared/provider-models-cache-model-reader.d.ts +0 -1
- package/dist/shared/snake-case.d.ts +0 -5
- package/dist/shared/tmux/tmux-utils/spawn-process.d.ts +0 -1
- package/dist/shared/tool-name.d.ts +0 -1
- package/dist/tools/background-task/modules/background-cancel.d.ts +0 -4
- package/dist/tools/background-task/modules/background-output.d.ts +0 -3
- package/dist/tools/background-task/modules/background-task.d.ts +0 -3
- package/dist/tools/background-task/modules/formatters.d.ts +0 -11
- package/dist/tools/background-task/modules/message-processing.d.ts +0 -59
- package/dist/tools/background-task/modules/utils.d.ts +0 -16
- package/dist/tools/call-omo-agent/agent-type-normalizer.d.ts +0 -2
- package/dist/tools/call-omo-agent/background-agent-executor.d.ts +0 -5
- package/dist/tools/call-omo-agent/constants.d.ts +0 -2
- package/dist/tools/call-omo-agent/session-completion-poller.d.ts +0 -13
- package/dist/tools/call-omo-agent/session-message-output-extractor.d.ts +0 -17
- package/dist/tools/call-omo-agent/subagent-session-prompter.d.ts +0 -11
- package/dist/tools/call-omo-agent/sync-agent-executor.d.ts +0 -4
- package/dist/tools/delegate-task/skill-content-resolver.d.ts +0 -9
- package/dist/tools/hashline-edit/hashline-edit-diff.d.ts +0 -1
- package/dist/tools/look-at/session-poller.d.ts +0 -8
- /package/dist/features/{opencode-skill-loader/discover-worker.d.ts → background-agent/manager.bench.d.ts} +0 -0
- /package/dist/{tools/delegate-task/time-formatter.d.ts → shared/format-duration.d.ts} +0 -0
- /package/dist/tools/{call-omo-agent → delegate-agent}/completion-poller.d.ts +0 -0
- /package/dist/tools/{call-omo-agent → delegate-agent}/message-dir.d.ts +0 -0
- /package/dist/tools/{call-omo-agent → delegate-agent}/message-processor.d.ts +0 -0
- /package/dist/tools/{call-omo-agent → delegate-agent}/message-storage-directory.d.ts +0 -0
- /package/dist/tools/{call-omo-agent → delegate-agent}/tool-context-with-metadata.d.ts +0 -0
package/dist/create-hooks.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { AvailableSkill } from "./agents/dynamic-agent-prompt-builder";
|
|
2
2
|
import type { HookName, MatrixxConfig } from "./config";
|
|
3
|
-
import type { LoadedSkill } from "./features/opencode-skill-loader/types";
|
|
4
3
|
import type { BackgroundManager } from "./features/background-agent";
|
|
4
|
+
import type { LoadedSkill } from "./features/opencode-skill-loader/types";
|
|
5
5
|
import type { PluginContext } from "./plugin/types";
|
|
6
6
|
export type CreatedHooks = ReturnType<typeof createHooks>;
|
|
7
7
|
export declare function createHooks(args: {
|
|
@@ -22,11 +22,11 @@ export declare function createHooks(args: {
|
|
|
22
22
|
unstableAgentBabysitter: ReturnType<typeof import("./plugin/unstable-agent-babysitter").createUnstableAgentBabysitter> | null;
|
|
23
23
|
backgroundNotificationHook: ReturnType<typeof import("./hooks").createBackgroundNotificationHook> | null;
|
|
24
24
|
atlasHook: ReturnType<typeof import("./hooks").createAtlasHook> | null;
|
|
25
|
-
claudeCodeHooks: ReturnType<typeof import("./hooks").createClaudeCodeHooksHook>;
|
|
26
25
|
keywordDetector: ReturnType<typeof import("./hooks").createKeywordDetectorHook> | null;
|
|
27
26
|
contextInjectorMessagesTransform: ReturnType<typeof import("./features/context-injector").createContextInjectorMessagesTransformHook>;
|
|
28
27
|
thinkingBlockValidator: ReturnType<typeof import("./hooks").createThinkingBlockValidatorHook> | null;
|
|
29
28
|
toolPairValidator: ReturnType<typeof import("./hooks").createToolPairValidatorHook> | null;
|
|
29
|
+
designIntentPreserver: ReturnType<typeof import("./hooks").createDesignIntentPreserverHook> | null;
|
|
30
30
|
commentChecker: ReturnType<typeof import("./hooks").createCommentCheckerHooks> | null;
|
|
31
31
|
toolOutputTruncator: ReturnType<typeof import("./hooks").createToolOutputTruncatorHook> | null;
|
|
32
32
|
directoryAgentsInjector: ReturnType<typeof import("./hooks").createDirectoryAgentsInjectorHook> | null;
|
|
@@ -44,6 +44,8 @@ export declare function createHooks(args: {
|
|
|
44
44
|
readImageResizer: ReturnType<typeof import("./hooks").createReadImageResizerHook> | null;
|
|
45
45
|
webfetchRedirectGuard: ReturnType<typeof import("./hooks").createWebFetchRedirectGuardHook> | null;
|
|
46
46
|
hashlineEditDiffEnhancer: ReturnType<typeof import("./hooks").createHashlineEditDiffEnhancerHook> | null;
|
|
47
|
+
qualityGate: ReturnType<typeof import("./hooks").createQualityGateHook> | null;
|
|
48
|
+
taskNotepad: ReturnType<typeof import("./hooks").createTaskNotepadHook> | null;
|
|
47
49
|
contextWindowMonitor: ReturnType<typeof import("./hooks").createContextWindowMonitorHook> | null;
|
|
48
50
|
preemptiveCompaction: ReturnType<typeof import("./hooks").createPreemptiveCompactionHook> | null;
|
|
49
51
|
sessionRecovery: ReturnType<typeof import("./hooks").createSessionRecoveryHook> | null;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import type { MatrixxConfig } from "./config";
|
|
2
|
-
import type { ModelCacheState } from "./plugin-state";
|
|
3
|
-
import type { PluginContext, TmuxConfig } from "./plugin/types";
|
|
4
2
|
import { BackgroundManager } from "./features/background-agent";
|
|
5
3
|
import { SkillMcpManager } from "./features/skill-mcp-manager";
|
|
6
4
|
import { TmuxSessionManager } from "./features/tmux-subagent";
|
|
5
|
+
import type { PluginContext, TmuxConfig } from "./plugin/types";
|
|
7
6
|
import { createConfigHandler } from "./plugin-handlers";
|
|
7
|
+
import type { ModelCacheState } from "./plugin-state";
|
|
8
8
|
export type Managers = {
|
|
9
9
|
tmuxSessionManager: TmuxSessionManager;
|
|
10
10
|
backgroundManager: BackgroundManager;
|
package/dist/create-tools.d.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import type { AvailableCategory, AvailableSkill } from "./agents/dynamic-agent-prompt-builder";
|
|
2
2
|
import type { MatrixxConfig } from "./config";
|
|
3
3
|
import type { BrowserAutomationProvider } from "./config/schema/browser-automation";
|
|
4
|
+
import type { Managers } from "./create-managers";
|
|
4
5
|
import type { LoadedSkill } from "./features/opencode-skill-loader/types";
|
|
5
6
|
import type { PluginContext, ToolsRecord } from "./plugin/types";
|
|
6
|
-
|
|
7
|
-
export type CreateToolsResult = {
|
|
7
|
+
type CreateToolsResult = {
|
|
8
8
|
filteredTools: ToolsRecord;
|
|
9
9
|
mergedSkills: LoadedSkill[];
|
|
10
10
|
availableSkills: AvailableSkill[];
|
|
@@ -18,3 +18,4 @@ export declare function createTools(args: {
|
|
|
18
18
|
pluginConfig: MatrixxConfig;
|
|
19
19
|
managers: Pick<Managers, "backgroundManager" | "tmuxSessionManager" | "skillMcpManager">;
|
|
20
20
|
}): Promise<CreateToolsResult>;
|
|
21
|
+
export {};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { BackgroundTask } from "./types";
|
|
2
|
-
|
|
2
|
+
type BackgroundTaskNotificationStatus = "COMPLETED" | "CANCELLED" | "INTERRUPTED";
|
|
3
3
|
export declare function buildBackgroundTaskNotificationText(input: {
|
|
4
4
|
task: BackgroundTask;
|
|
5
5
|
duration: string;
|
|
@@ -8,3 +8,4 @@ export declare function buildBackgroundTaskNotificationText(input: {
|
|
|
8
8
|
remainingCount: number;
|
|
9
9
|
completedTasks: BackgroundTask[];
|
|
10
10
|
}): string;
|
|
11
|
+
export {};
|
|
@@ -10,8 +10,8 @@ export declare const DEFAULT_CIRCUIT_BREAKER_ENABLED = true;
|
|
|
10
10
|
export declare const MIN_RUNTIME_BEFORE_STALE_MS = 30000;
|
|
11
11
|
export declare const MIN_IDLE_TIME_MS = 5000;
|
|
12
12
|
export declare const POLLING_INTERVAL_MS = 3000;
|
|
13
|
+
export declare const PRUNE_THROTTLE_MS = 30000;
|
|
13
14
|
export declare const TASK_CLEANUP_DELAY_MS: number;
|
|
14
|
-
export declare const TMUX_CALLBACK_DELAY_MS = 200;
|
|
15
15
|
export type ProcessCleanupEvent = NodeJS.Signals | "beforeExit" | "exit";
|
|
16
16
|
export type OpencodeClient = PluginInput["client"];
|
|
17
17
|
export interface MessagePartInfo {
|
|
@@ -26,10 +26,6 @@ export interface EventProperties {
|
|
|
26
26
|
};
|
|
27
27
|
[key: string]: unknown;
|
|
28
28
|
}
|
|
29
|
-
export interface BackgroundEvent {
|
|
30
|
-
type: string;
|
|
31
|
-
properties?: EventProperties;
|
|
32
|
-
}
|
|
33
29
|
export interface Todo {
|
|
34
30
|
content: string;
|
|
35
31
|
status: string;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export * from "./types";
|
|
2
|
-
export { BackgroundManager, type SubagentSessionCreatedEvent, type OnSubagentSessionCreated } from "./manager";
|
|
3
|
-
export { TaskHistory, type TaskHistoryEntry } from "./task-history";
|
|
4
1
|
export { ConcurrencyManager } from "./concurrency";
|
|
2
|
+
export { BackgroundManager, type OnSubagentSessionCreated, type SubagentSessionCreatedEvent } from "./manager";
|
|
5
3
|
export { TaskStateManager } from "./state";
|
|
4
|
+
export { TaskHistory, type TaskHistoryEntry } from "./task-history";
|
|
5
|
+
export * from "./types";
|
|
@@ -5,12 +5,12 @@ export interface CircuitBreakerSettings {
|
|
|
5
5
|
maxToolCalls: number;
|
|
6
6
|
consecutiveThreshold: number;
|
|
7
7
|
}
|
|
8
|
-
|
|
8
|
+
interface ToolLoopDetectionResult {
|
|
9
9
|
triggered: boolean;
|
|
10
10
|
toolName?: string;
|
|
11
11
|
repeatedCount?: number;
|
|
12
12
|
}
|
|
13
13
|
export declare function resolveCircuitBreakerSettings(config?: BackgroundTaskConfig): CircuitBreakerSettings;
|
|
14
14
|
export declare function recordToolCall(window: ToolCallWindow | undefined, toolName: string, settings: CircuitBreakerSettings, toolInput?: Record<string, unknown> | null): ToolCallWindow;
|
|
15
|
-
export declare function createToolCallSignature(toolName: string, toolInput?: Record<string, unknown> | null): string;
|
|
16
15
|
export declare function detectRepetitiveToolUse(window: ToolCallWindow | undefined): ToolLoopDetectionResult;
|
|
16
|
+
export {};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { PluginInput } from "@opencode-ai/plugin";
|
|
2
|
-
import type { BackgroundTask, LaunchInput, ResumeInput } from "./types";
|
|
3
|
-
import { TaskHistory } from "./task-history";
|
|
4
2
|
import type { BackgroundTaskConfig, TmuxConfig } from "../../config/schema";
|
|
3
|
+
import { TaskHistory } from "./task-history";
|
|
4
|
+
import type { BackgroundTask, LaunchInput, ResumeInput } from "./types";
|
|
5
5
|
interface EventProperties {
|
|
6
6
|
sessionID?: string;
|
|
7
7
|
info?: {
|
|
@@ -30,6 +30,7 @@ export declare class BackgroundManager {
|
|
|
30
30
|
private directory;
|
|
31
31
|
private pollingInterval?;
|
|
32
32
|
private pollingInFlight;
|
|
33
|
+
private lastPruneAt;
|
|
33
34
|
private concurrencyManager;
|
|
34
35
|
private shutdownTriggered;
|
|
35
36
|
private config?;
|
|
@@ -76,6 +77,13 @@ export declare class BackgroundManager {
|
|
|
76
77
|
handleEvent(event: Event): void;
|
|
77
78
|
markForNotification(task: BackgroundTask): void;
|
|
78
79
|
getPendingNotifications(sessionID: string): BackgroundTask[];
|
|
80
|
+
/**
|
|
81
|
+
* Check whether a parent-wake notification is currently in flight
|
|
82
|
+
* for the given parent session. Used by sync-task polling to avoid
|
|
83
|
+
* concluding when a background task just completed but its
|
|
84
|
+
* parent notification hasn't been delivered yet.
|
|
85
|
+
*/
|
|
86
|
+
hasInFlightNotificationForParent(sessionID: string): boolean;
|
|
79
87
|
clearNotifications(sessionID: string): void;
|
|
80
88
|
/**
|
|
81
89
|
* Validates that a session has actual assistant/tool output before marking complete.
|
|
@@ -139,4 +147,7 @@ export declare class BackgroundManager {
|
|
|
139
147
|
shutdown(): void;
|
|
140
148
|
private enqueueNotificationForParent;
|
|
141
149
|
}
|
|
150
|
+
export declare function getMessageDir(sessionID: string): string | null;
|
|
151
|
+
export declare function _resetMessageDirCacheForTesting(): void;
|
|
152
|
+
export declare function _resetPruneThrottleForTesting(): void;
|
|
142
153
|
export {};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { BackgroundTask, LaunchInput } from "./types";
|
|
2
1
|
import type { QueueItem } from "./constants";
|
|
2
|
+
import type { BackgroundTask, LaunchInput } from "./types";
|
|
3
3
|
export declare class TaskStateManager {
|
|
4
4
|
readonly tasks: Map<string, BackgroundTask>;
|
|
5
5
|
readonly notifications: Map<string, BackgroundTask[]>;
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import type { BackgroundTaskConfig } from "../../config/schema";
|
|
2
|
-
import type { BackgroundTask } from "./types";
|
|
3
2
|
import type { ConcurrencyManager } from "./concurrency";
|
|
4
3
|
import type { OpencodeClient } from "./opencode-client";
|
|
4
|
+
import type { BackgroundTask } from "./types";
|
|
5
5
|
export declare function pruneStaleTasksAndNotifications(args: {
|
|
6
6
|
tasks: Map<string, BackgroundTask>;
|
|
7
7
|
notifications: Map<string, BackgroundTask[]>;
|
|
8
8
|
onTaskPruned: (taskId: string, task: BackgroundTask, errorMessage: string) => void;
|
|
9
9
|
}): void;
|
|
10
|
-
|
|
10
|
+
type SessionStatusMap = Record<string, {
|
|
11
11
|
type: string;
|
|
12
12
|
}>;
|
|
13
13
|
export declare function checkAndInterruptStaleTasks(args: {
|
|
@@ -18,3 +18,4 @@ export declare function checkAndInterruptStaleTasks(args: {
|
|
|
18
18
|
notifyParentSession: (task: BackgroundTask) => Promise<void>;
|
|
19
19
|
sessionStatuses?: SessionStatusMap;
|
|
20
20
|
}): Promise<void>;
|
|
21
|
+
export {};
|
|
@@ -4,7 +4,7 @@ export interface ToolCallWindow {
|
|
|
4
4
|
consecutiveCount: number;
|
|
5
5
|
threshold: number;
|
|
6
6
|
}
|
|
7
|
-
|
|
7
|
+
interface TaskProgress {
|
|
8
8
|
toolCalls: number;
|
|
9
9
|
lastTool?: string;
|
|
10
10
|
toolCallWindow?: ToolCallWindow;
|
|
@@ -36,6 +36,7 @@ export interface BackgroundTask {
|
|
|
36
36
|
providerID: string;
|
|
37
37
|
modelID: string;
|
|
38
38
|
variant?: string;
|
|
39
|
+
temperature?: number;
|
|
39
40
|
};
|
|
40
41
|
/** Active concurrency slot key */
|
|
41
42
|
concurrencyKey?: string;
|
|
@@ -70,6 +71,7 @@ export interface LaunchInput {
|
|
|
70
71
|
providerID: string;
|
|
71
72
|
modelID: string;
|
|
72
73
|
variant?: string;
|
|
74
|
+
temperature?: number;
|
|
73
75
|
};
|
|
74
76
|
isUnstableAgent?: boolean;
|
|
75
77
|
skills?: string[];
|
|
@@ -88,3 +90,4 @@ export interface ResumeInput {
|
|
|
88
90
|
parentAgent?: string;
|
|
89
91
|
parentTools?: Record<string, boolean>;
|
|
90
92
|
}
|
|
93
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const END_ULTRAWORK_TEMPLATE = "Deactivate ultrawork mode for the current session.\n\nThis command will:\n1. Remove the <ultrawork-mode> rules block from the active context\n2. Restore default Matrixx behavior (no enforced certainty protocol, no mandatory plan agent, no required acceptance criteria)\n3. Stop ultrawork-specific parallel delegation pressure\n\nAfter running this command:\n- The session continues with normal Matrixx rules\n- Existing todos and plans remain unchanged\n- Already-spawned background tasks continue to completion\n- The deactivation is per-session and clears when the session ends\n\nUse this when you want to exit ultrawork mode explicitly and return to standard behavior. Useful for sub-tasks that should not inherit ultrawork rules, or when switching from heavy-execution to lighter reasoning.";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const HANDOFF_TEMPLATE = "# Handoff Command\n\n## Purpose\n\nUse /handoff when:\n- The current session context is getting too long and quality is degrading\n- You want to start fresh while preserving essential context from this session\n- The context window is approaching capacity\n\nThis creates a detailed context summary
|
|
1
|
+
export declare const HANDOFF_TEMPLATE = "# Handoff Command\n\n## Purpose\n\nUse /handoff when:\n- The current session context is getting too long and quality is degrading\n- You want to start fresh while preserving essential context from this session\n- The context window is approaching capacity\n\nThis creates a detailed context summary written to .matrixx/handoff.md. The next session loads it via /pickup.\n\n---\n\n# PHASE 0: VALIDATE REQUEST\n\nBefore proceeding, confirm:\n- [ ] There is meaningful work or context in this session to preserve\n- [ ] The user wants to create a handoff summary (not just asking about it)\n\nIf the session is nearly empty or has no meaningful context, inform the user there is nothing substantial to hand off.\n\n---\n\n# PHASE 1: GATHER PROGRAMMATIC CONTEXT\n\nExecute these tools to gather concrete data:\n\n1. session_read({ session_id: \"$SESSION_ID\" }) \u2014 full session history\n2. todoread() \u2014 current task progress\n3. Bash({ command: \"git diff --stat HEAD~10..HEAD\" }) \u2014 recent file changes\n4. Bash({ command: \"git status --porcelain\" }) \u2014 uncommitted changes\n\nAnalyze the gathered outputs to understand:\n- What the user asked for (exact wording)\n- What work was completed\n- What tasks remain incomplete\n- What decisions were made\n- What files were modified or discussed\n- What patterns, constraints, or preferences were established\n\n---\n\n# PHASE 2: CALL HANDOFF TOOL\n\nCall the `handoff` tool with `action=\"create\"` and the data you gathered. The tool validates the input and writes the handoff file automatically \u2014 no manual file writing needed.\n\nUse these field mappings for the tool arguments:\n\n```\nhandoff({\n action: \"create\",\n topics: [\"tag1\", \"tag2\"], // Min 1 topic tag, from session context\n user_requests: \"verbatim user msg\", // REQUIRED \u2014 exact wording from session_read\n goal: \"single sentence\", // REQUIRED \u2014 what should be done next\n work_completed: [\"did X\", \"did Y\"], // REQUIRED \u2014 first-person bullet points\n current_state: \"state description\", // REQUIRED \u2014 current codebase/task state\n pending_tasks: [\"task1\", \"task2\"], // Optional \u2014 tasks not yet completed\n key_files: [{path, purpose}], // Optional \u2014 max 10, workspace-relative paths\n important_decisions: [{decision, rationale}], // Optional \u2014 key decisions made\n explicit_constraints: [\"verbatim\"], // Optional \u2014 verbatim constraints only\n context_for_continuation: \"...\" // Optional \u2014 additional context\n})\n```\n\n---\n\n# PHASE 3: INFORM USER\n\nAfter the tool call completes, inform the user:\n\n```\nHandoff saved to .matrixx/handoff.md. Use /pickup in a new opencode session to load this context.\n```\n\n---\n\n# IMPORTANT CONSTRAINTS\n\n- DO gather programmatic context before calling the tool (Phase 1 is mandatory)\n- DO extract user_requests verbatim from session_read output (do not paraphrase)\n- DO keep goal to a single sentence\n- DO use workspace-relative paths for key_files\n- DO NOT attempt to create new sessions programmatically\n- DO NOT exceed 10 files in key_files (max 10)\n- DO NOT include sensitive information (API keys, credentials, secrets)\n- DO use first person perspective for work_completed items\n- DO use plain text with bullets for descriptions (no markdown headers)\n";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const PICKUP_TEMPLATE = "# Pickup Command\n\n## Purpose\n\nUse /pickup to load handoff context from a previous session.\
|
|
1
|
+
export declare const PICKUP_TEMPLATE = "# Pickup Command\n\n## Purpose\n\nUse /pickup to load handoff context from a previous session.\n\n---\n\n# PHASE 1: READ HANDOFF\n\nCall handoff({ action: \"read\" }) to load the handoff context.\n\nIf the response starts with Error:, inform the user:\n\"No handoff context found. Run /handoff in a previous session first to create one.\"\nThen STOP \u2014 do not proceed.\n\n---\n\n# PHASE 2: ACKNOWLEDGE\n\nSummarize the loaded context to the user:\n- What the previous session was working on (Goal)\n- What was completed (Work Completed)\n- What remains (Pending Tasks)\n\nThen state: \"Handoff context loaded. Ready to continue.\"\n\n---\n\n# PHASE 3: ARCHIVE\n\nCall handoff({ action: \"archive\" }) to mark the handoff as consumed.\nThis prevents it from being picked up again.\n\n---\n\n# CONSTRAINTS\n\n- DO call the handoff tool \u2014 do not read files directly\n- DO NOT modify the handoff content \u2014 use it as-is\n- DO begin working immediately if the user included a task with /pickup\n";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const PROFILE_TEMPLATE = "# /profile Command\n\n## Usage\n\n```\n/profile \u2192 List available profiles and show current\n/profile list \u2192 List available profiles\n/profile show \u2192 Show currently active profile\n/profile set <name> \u2192 Change profile (edits project config, instructs to start new session)\n/profile set <name> --global \u2192 Change profile globally (~/.config/opencode/matrixx.jsonc)\n/profile set <name> --project \u2192 Change profile project-scoped (.opencode/matrixx.jsonc)\n```\n\n## Available Profiles\n\n| Profile | Description | Key Characteristic |\n|---------|-------------|-------------------|\n| free | Zero-cost, uses only free/open models | Kimi K2.5 Free, Grok (free), GLM |\n| budget | Cost-optimized for tight budgets | Sonnet/Haiku mix, no Opus |\n| economy | Balanced cost and capability | Primarily Sonnet/Haiku |\n| balanced | Default \u2014 best overall value | Opus/Sonnet/Haiku tiered |\n| performance | Maximum quality, no compromises | Opus for all heavy agents |\n| go | Premium OpenCode Go subscription | Kimi K2.6, DeepSeek V4 Pro, GLM 5.1 |\n\n## How It Works\n\nEach profile sets the `model` field on every agent and category in Matrixx's configuration. When you switch profiles, the agent models are swapped accordingly.\n\nThe profile name is stored in your `matrixx.json` or `matrixx.jsonc` config file. On the next session, Matrixx reads it and applies the profile's model mapping, merging it with any explicit per-agent overrides you may have set.\n\n## Task: Change the Profile\n\nFollow these steps:\n\n### Step 1: Know the Current Config Location\n\nMatrixx reads config from two locations (user config wins over project config):\n- **Project**: `.opencode/matrixx.json` or `.opencode/matrixx.jsonc`\n- **Global**: `~/.config/opencode/matrixx.json` or `~/.config/opencode/matrixx.jsonc`\n\n### Step 2: Determine Which Config File to Edit\n\n- `--global` \u2192 Edit `~/.config/opencode/matrixx.jsonc`\n- `--project` (default) \u2192 Edit `.opencode/matrixx.jsonc`\n- If no flag and neither file exists, use `--project`\n\n### Step 3: Read the Target Config File\n\nUse the `read` tool to read the config file.\n\n### Step 4: Validate the Requested Profile\n\nIf the user asked for `/profile set <name>`, verify `<name>` is in the table above. If not, report the valid profiles and stop.\n\n### Step 5: Update the `profile` Key\n\nSet `\"profile\": \"<name>\"` in the config JSON. If the `profile` key already exists, update it. If it doesn't exist, add it at the top level. Do NOT modify any other keys.\n\n### Step 6: Write the Config File Back\n\nUse the `write` tool (or `edit` tool for minimal changes) to save the updated config.\n\n### Step 7: Confirm and Advise\n\nTell the user:\n1. The profile has been changed to `<name>`\n2. For the change to take effect, they MUST start a new session (`/new` or restart OpenCode)\n3. If they want session-level switching without restarting, suggest using the profile with `--global` or `--project` as appropriate\n\n### Step 8: If `/profile` Was Called Without Arguments\n\nJust list the available profiles and show the current configuration's profile value.";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const REFACTOR_TEMPLATE = "# Intelligent Refactor Command\n\n## Usage\n```\n/refactor <refactoring-target> [--scope=<file|module|project>] [--strategy=<safe|aggressive>]\n\nArguments:\n refactoring-target: What to refactor. Can be:\n - File path: src/auth/handler.ts\n - Symbol name: \"AuthService class\"\n - Pattern: \"all functions using deprecated API\"\n - Description: \"extract validation logic into separate module\"\n\nOptions:\n --scope: Refactoring scope (default: module)\n - file: Single file only\n - module: Module/directory scope\n - project: Entire codebase\n\n --strategy: Risk tolerance (default: safe)\n - safe: Conservative, maximum test coverage required\n - aggressive: Allow broader changes with adequate coverage\n```\n\n## What This Command Does\n\nPerforms intelligent, deterministic refactoring with full codebase awareness. Unlike blind search-and-replace, this command:\n\n1. **Understands your intent** - Analyzes what you actually want to achieve\n2. **Maps the codebase** - Builds a definitive codemap before touching anything\n3. **Assesses risk** - Evaluates test coverage and determines verification strategy\n4. **Plans meticulously** - Creates a detailed plan with Plan agent\n5. **Executes precisely** - Step-by-step refactoring with LSP and AST-grep\n6. **Verifies constantly** - Runs tests after each change to ensure zero regression\n\n---\n\n# PHASE 0: INTENT GATE (MANDATORY FIRST STEP)\n\n**BEFORE ANY ACTION, classify and validate the request.**\n\n## Step 0.1: Parse Request Type\n\n| Signal | Classification | Action |\n|--------|----------------|--------|\n| Specific file/symbol | Explicit | Proceed to codebase analysis |\n| \"Refactor X to Y\" | Clear transformation | Proceed to codebase analysis |\n| \"Improve\", \"Clean up\" | Open-ended | **MUST ask**: \"What specific improvement?\" |\n| Ambiguous scope | Uncertain | **MUST ask**: \"Which modules/files?\" |\n| Missing context | Incomplete | **MUST ask**: \"What's the desired outcome?\" |\n\n## Step 0.2: Validate Understanding\n\nBefore proceeding, confirm:\n- [ ] Target is clearly identified\n- [ ] Desired outcome is understood\n- [ ] Scope is defined (file/module/project)\n- [ ] Success criteria can be articulated\n\n**If ANY of above is unclear, ASK CLARIFYING QUESTION:**\n\n```\nI want to make sure I understand the refactoring goal correctly.\n\n**What I understood**: [interpretation]\n**What I'm unsure about**: [specific ambiguity]\n\nOptions I see:\n1. [Option A] - [implications]\n2. [Option B] - [implications]\n\n**My recommendation**: [suggestion with reasoning]\n\nShould I proceed with [recommendation], or would you prefer differently?\n```\n\n## Step 0.3: Create Initial Todos\n\n**IMMEDIATELY after understanding the request, create todos:**\n\n```\nTodoWrite([\n {\"id\": \"phase-1\", \"content\": \"PHASE 1: Codebase Analysis - launch parallel explore agents\", \"status\": \"pending\", \"priority\": \"high\"},\n {\"id\": \"phase-2\", \"content\": \"PHASE 2: Build Codemap - map dependencies and impact zones\", \"status\": \"pending\", \"priority\": \"high\"},\n {\"id\": \"phase-3\", \"content\": \"PHASE 3: Test Assessment - analyze test coverage and verification strategy\", \"status\": \"pending\", \"priority\": \"high\"},\n {\"id\": \"phase-4\", \"content\": \"PHASE 4: Plan Generation - invoke Plan agent for detailed refactoring plan\", \"status\": \"pending\", \"priority\": \"high\"},\n {\"id\": \"phase-5\", \"content\": \"PHASE 5: Execute Refactoring - step-by-step with continuous verification\", \"status\": \"pending\", \"priority\": \"high\"},\n {\"id\": \"phase-6\", \"content\": \"PHASE 6: Final Verification - full test suite and regression check\", \"status\": \"pending\", \"priority\": \"high\"}\n])\n```\n\n---\n\n# PHASE 1: CODEBASE ANALYSIS (PARALLEL EXPLORATION)\n\n**Mark phase-1 as in_progress.**\n\n## 1.1: Launch Parallel Explore Agents (BACKGROUND)\n\nFire ALL of these simultaneously using `call_omo_agent`:\n\n```\n// Agent 1: Find the refactoring target\ncall_omo_agent(\n subagent_type=\"trinity\",\n run_in_background=true,\n prompt=\"Find all occurrences and definitions of [TARGET]. \n Report: file paths, line numbers, usage patterns.\"\n)\n\n// Agent 2: Find related code\ncall_omo_agent(\n subagent_type=\"trinity\", \n run_in_background=true,\n prompt=\"Find all code that imports, uses, or depends on [TARGET].\n Report: dependency chains, import graphs.\"\n)\n\n// Agent 3: Find similar patterns\ncall_omo_agent(\n subagent_type=\"trinity\",\n run_in_background=true,\n prompt=\"Find similar code patterns to [TARGET] in the codebase.\n Report: analogous implementations, established conventions.\"\n)\n\n// Agent 4: Find tests\ncall_omo_agent(\n subagent_type=\"trinity\",\n run_in_background=true,\n prompt=\"Find all test files related to [TARGET].\n Report: test file paths, test case names, coverage indicators.\"\n)\n\n// Agent 5: Architecture context\ncall_omo_agent(\n subagent_type=\"trinity\",\n run_in_background=true,\n prompt=\"Find architectural patterns and module organization around [TARGET].\n Report: module boundaries, layer structure, design patterns in use.\"\n)\n```\n\n## 1.2: Direct Tool Exploration (WHILE AGENTS RUN)\n\nWhile background agents are running, use direct tools:\n\n### LSP Tools for Precise Analysis:\n\n```typescript\n// Find definition(s)\nLspGotoDefinition(filePath, line, character) // Where is it defined?\n\n// Find ALL usages across workspace\nLspFindReferences(filePath, line, character, includeDeclaration=true)\n\n// Get file structure\nLspDocumentSymbols(filePath) // Hierarchical outline\nLspWorkspaceSymbols(filePath, query=\"[target_symbol]\") // Search by name\n\n// Get current diagnostics\nlsp_diagnostics(filePath) // Errors, warnings before we start\n```\n\n### AST-Grep for Pattern Analysis:\n\n```typescript\n// Find structural patterns\nast_grep_search(\n pattern=\"function $NAME($$$) { $$$ }\", // or relevant pattern\n lang=\"typescript\", // or relevant language\n paths=[\"src/\"]\n)\n\n// Preview refactoring (DRY RUN)\nast_grep_replace(\n pattern=\"[old_pattern]\",\n rewrite=\"[new_pattern]\",\n lang=\"[language]\",\n dryRun=true // ALWAYS preview first\n)\n```\n\n### Grep for Text Patterns:\n\n```\ngrep(pattern=\"[search_term]\", path=\"src/\", include=\"*.ts\")\n```\n\n## 1.3: Collect Background Results\n\n```\nbackground_output(task_id=\"[agent_1_id]\")\nbackground_output(task_id=\"[agent_2_id]\")\n...\n```\n\n**Mark phase-1 as completed after all results collected.**\n\n---\n\n# PHASE 2: BUILD CODEMAP (DEPENDENCY MAPPING)\n\n**Mark phase-2 as in_progress.**\n\n## 2.1: Construct Definitive Codemap\n\nBased on Phase 1 results, build:\n\n```\n## CODEMAP: [TARGET]\n\n### Core Files (Direct Impact)\n- `path/to/file.ts:L10-L50` - Primary definition\n- `path/to/file2.ts:L25` - Key usage\n\n### Dependency Graph\n```\n[TARGET] \n\u251C\u2500\u2500 imports from: \n\u2502 \u251C\u2500\u2500 module-a (types)\n\u2502 \u2514\u2500\u2500 module-b (utils)\n\u251C\u2500\u2500 imported by:\n\u2502 \u251C\u2500\u2500 consumer-1.ts\n\u2502 \u251C\u2500\u2500 consumer-2.ts\n\u2502 \u2514\u2500\u2500 consumer-3.ts\n\u2514\u2500\u2500 used by:\n \u251C\u2500\u2500 handler.ts (direct call)\n \u2514\u2500\u2500 service.ts (dependency injection)\n```\n\n### Impact Zones\n| Zone | Risk Level | Files Affected | Test Coverage |\n|------|------------|----------------|---------------|\n| Core | HIGH | 3 files | 85% covered |\n| Consumers | MEDIUM | 8 files | 70% covered |\n| Edge | LOW | 2 files | 50% covered |\n\n### Established Patterns\n- Pattern A: [description] - used in N places\n- Pattern B: [description] - established convention\n```\n\n## 2.2: Identify Refactoring Constraints\n\nBased on codemap:\n- **MUST follow**: [existing patterns identified]\n- **MUST NOT break**: [critical dependencies]\n- **Safe to change**: [isolated code zones]\n- **Requires migration**: [breaking changes impact]\n\n**Mark phase-2 as completed.**\n\n---\n\n# PHASE 3: TEST ASSESSMENT (VERIFICATION STRATEGY)\n\n**Mark phase-3 as in_progress.**\n\n## 3.1: Detect Test Infrastructure\n\n```bash\n# Check for test commands\ncat package.json | jq '.scripts | keys[] | select(test(\"test\"))'\n\n# Or for Python\nls -la pytest.ini pyproject.toml setup.cfg\n\n# Or for Go\nls -la *_test.go\n```\n\n## 3.2: Analyze Test Coverage\n\n```\n// Find all tests related to target\ncall_omo_agent(\n subagent_type=\"trinity\",\n run_in_background=false, // Need this synchronously\n prompt=\"Analyze test coverage for [TARGET]:\n 1. Which test files cover this code?\n 2. What test cases exist?\n 3. Are there integration tests?\n 4. What edge cases are tested?\n 5. Estimated coverage percentage?\"\n)\n```\n\n## 3.3: Determine Verification Strategy\n\nBased on test analysis:\n\n| Coverage Level | Strategy |\n|----------------|----------|\n| HIGH (>80%) | Run existing tests after each step |\n| MEDIUM (50-80%) | Run tests + add safety assertions |\n| LOW (<50%) | **PAUSE**: Propose adding tests first |\n| NONE | **BLOCK**: Refuse aggressive refactoring |\n\n**If coverage is LOW or NONE, ask user:**\n\n```\nTest coverage for [TARGET] is [LEVEL].\n\n**Risk Assessment**: Refactoring without adequate tests is dangerous.\n\nOptions:\n1. Add tests first, then refactor (RECOMMENDED)\n2. Proceed with extra caution, manual verification required\n3. Abort refactoring\n\nWhich approach do you prefer?\n```\n\n## 3.4: Document Verification Plan\n\n```\n## VERIFICATION PLAN\n\n### Test Commands\n- Unit: `bun test` / `npm test` / `pytest` / etc.\n- Integration: [command if exists]\n- Type check: `tsc --noEmit` / `pyright` / etc.\n\n### Verification Checkpoints\nAfter each refactoring step:\n1. lsp_diagnostics \u2192 zero new errors\n2. Run test command \u2192 all pass\n3. Type check \u2192 clean\n\n### Regression Indicators\n- [Specific test that must pass]\n- [Behavior that must be preserved]\n- [API contract that must not change]\n```\n\n**Mark phase-3 as completed.**\n\n---\n\n# PHASE 4: PLAN GENERATION (PLAN AGENT)\n\n**Mark phase-4 as in_progress.**\n\n## 4.1: Invoke Plan Agent\n\n```\nTask(\n subagent_type=\"plan\",\n prompt=\"Create a detailed refactoring plan:\n\n ## Refactoring Goal\n [User's original request]\n\n ## Codemap (from Phase 2)\n [Insert codemap here]\n\n ## Test Coverage (from Phase 3)\n [Insert verification plan here]\n\n ## Constraints\n - MUST follow existing patterns: [list]\n - MUST NOT break: [critical paths]\n - MUST run tests after each step\n\n ## Requirements\n 1. Break down into atomic refactoring steps\n 2. Each step must be independently verifiable\n 3. Order steps by dependency (what must happen first)\n 4. Specify exact files and line ranges for each step\n 5. Include rollback strategy for each step\n 6. Define commit checkpoints\"\n)\n```\n\n## 4.2: Review and Validate Plan\n\nAfter receiving plan from Plan agent:\n\n1. **Verify completeness**: All identified files addressed?\n2. **Verify safety**: Each step reversible?\n3. **Verify order**: Dependencies respected?\n4. **Verify verification**: Test commands specified?\n\n## 4.3: Register Detailed Todos\n\nConvert Plan agent output into granular todos:\n\n```\nTodoWrite([\n // Each step from the plan becomes a todo\n {\"id\": \"refactor-1\", \"content\": \"Step 1: [description]\", \"status\": \"pending\", \"priority\": \"high\"},\n {\"id\": \"verify-1\", \"content\": \"Verify Step 1: run tests\", \"status\": \"pending\", \"priority\": \"high\"},\n {\"id\": \"refactor-2\", \"content\": \"Step 2: [description]\", \"status\": \"pending\", \"priority\": \"medium\"},\n {\"id\": \"verify-2\", \"content\": \"Verify Step 2: run tests\", \"status\": \"pending\", \"priority\": \"medium\"},\n // ... continue for all steps\n])\n```\n\n**Mark phase-4 as completed.**\n\n---\n\n# PHASE 5: EXECUTE REFACTORING (DETERMINISTIC EXECUTION)\n\n**Mark phase-5 as in_progress.**\n\n## 5.1: Execution Protocol\n\nFor EACH refactoring step:\n\n### Pre-Step\n1. Mark step todo as `in_progress`\n2. Read current file state\n3. Verify lsp_diagnostics is baseline\n\n### Execute Step\nUse appropriate tool:\n\n**For Symbol Renames:**\n```typescript\nlsp_prepare_rename(filePath, line, character) // Validate rename is possible\nlsp_rename(filePath, line, character, newName) // Execute rename\n```\n\n**For Pattern Transformations:**\n```typescript\n// Preview first\nast_grep_replace(pattern, rewrite, lang, dryRun=true)\n\n// If preview looks good, execute\nast_grep_replace(pattern, rewrite, lang, dryRun=false)\n```\n\n**For Structural Changes:**\n```typescript\n// Use Edit tool for precise changes\nedit(filePath, oldString, newString)\n```\n\n### Post-Step Verification (MANDATORY)\n\n```typescript\n// 1. Check diagnostics\nlsp_diagnostics(filePath) // Must be clean or same as baseline\n\n// 2. Run tests\nbash(\"bun test\") // Or appropriate test command\n\n// 3. Type check\nbash(\"tsc --noEmit\") // Or appropriate type check\n```\n\n### Step Completion\n1. If verification passes \u2192 Mark step todo as `completed`\n2. If verification fails \u2192 **STOP AND FIX**\n\n## 5.2: Failure Recovery Protocol\n\nIf ANY verification fails:\n\n1. **STOP** immediately\n2. **REVERT** the failed change\n3. **DIAGNOSE** what went wrong\n4. **OPTIONS**:\n - Fix the issue and retry\n - Skip this step (if optional)\n - Consult oracle agent for help\n - Ask user for guidance\n\n**NEVER proceed to next step with broken tests.**\n\n## 5.3: Commit Checkpoints\n\nAfter each logical group of changes:\n\n```bash\ngit add [changed-files]\ngit commit -m \"refactor(scope): description\n\n[details of what was changed and why]\"\n```\n\n**Mark phase-5 as completed when all refactoring steps done.**\n\n---\n\n# PHASE 6: FINAL VERIFICATION (REGRESSION CHECK)\n\n**Mark phase-6 as in_progress.**\n\n## 6.1: Full Test Suite\n\n```bash\n# Run complete test suite\nbun test # or npm test, pytest, go test, etc.\n```\n\n## 6.2: Type Check\n\n```bash\n# Full type check\ntsc --noEmit # or equivalent\n```\n\n## 6.3: Lint Check\n\n```bash\n# Run linter\neslint . # or equivalent\n```\n\n## 6.4: Build Verification (if applicable)\n\n```bash\n# Ensure build still works\nbun run build # or npm run build, etc.\n```\n\n## 6.5: Final Diagnostics\n\n```typescript\n// Check all changed files\nfor (file of changedFiles) {\n lsp_diagnostics(file) // Must all be clean\n}\n```\n\n## 6.6: Generate Summary\n\n```markdown\n## Refactoring Complete\n\n### What Changed\n- [List of changes made]\n\n### Files Modified\n- `path/to/file.ts` - [what changed]\n- `path/to/file2.ts` - [what changed]\n\n### Verification Results\n- Tests: PASSED (X/Y passing)\n- Type Check: CLEAN\n- Lint: CLEAN\n- Build: SUCCESS\n\n### No Regressions Detected\nAll existing tests pass. No new errors introduced.\n```\n\n**Mark phase-6 as completed.**\n\n---\n\n# CRITICAL RULES\n\n## NEVER DO\n- Skip lsp_diagnostics check after changes\n- Proceed with failing tests\n- Make changes without understanding impact\n- Use `as any`, `@ts-ignore`, `@ts-expect-error`\n- Delete tests to make them pass\n- Commit broken code\n- Refactor without understanding existing patterns\n\n## ALWAYS DO\n- Understand before changing\n- Preview before applying (ast_grep dryRun=true)\n- Verify after every change\n- Follow existing codebase patterns\n- Keep todos updated in real-time\n- Commit at logical checkpoints\n- Report issues immediately\n\n## ABORT CONDITIONS\nIf any of these occur, **STOP and consult user**:\n- Test coverage is zero for target code\n- Changes would break public API\n- Refactoring scope is unclear\n- 3 consecutive verification failures\n- User-defined constraints violated\n\n---\n\n# Tool Usage Philosophy\n\nYou already know these tools. Use them intelligently:\n\n## LSP Tools\nLeverage LSP tools for precision analysis. Key patterns:\n- **Understand before changing**: `LspGotoDefinition` to grasp context\n- **Impact analysis**: `LspFindReferences` to map all usages before modification\n- **Safe refactoring**: `lsp_prepare_rename` \u2192 `lsp_rename` for symbol renames\n- **Continuous verification**: `lsp_diagnostics` after every change\n\n## AST-Grep\nUse `ast_grep_search` and `ast_grep_replace` for structural transformations.\n**Critical**: Always `dryRun=true` first, review, then execute.\n\n## Agents\n- `explore`: Parallel codebase pattern discovery\n- `plan`: Detailed refactoring plan generation\n- `oracle`: Read-only consultation for complex architectural decisions and debugging\n- `librarian`: **Use proactively** when encountering deprecated methods or library migration tasks. Query official docs and OSS examples for modern replacements.\n\n## Deprecated Code & Library Migration\nWhen you encounter deprecated methods/APIs during refactoring:\n1. Fire `librarian` to find the recommended modern alternative\n2. **DO NOT auto-upgrade to latest version** unless user explicitly requests migration\n3. If user requests library migration, use `librarian` to fetch latest API docs before making changes\n\n---\n\n**Remember: Refactoring without tests is reckless. Refactoring without understanding is destructive. This command ensures you do neither.**\n\n<user-request>\n$ARGUMENTS\n</user-request>\n";
|
|
1
|
+
export declare const REFACTOR_TEMPLATE = "# Intelligent Refactor Command\n\n## Usage\n```\n/refactor <refactoring-target> [--scope=<file|module|project>] [--strategy=<safe|aggressive>]\n\nArguments:\n refactoring-target: What to refactor. Can be:\n - File path: src/auth/handler.ts\n - Symbol name: \"AuthService class\"\n - Pattern: \"all functions using deprecated API\"\n - Description: \"extract validation logic into separate module\"\n\nOptions:\n --scope: Refactoring scope (default: module)\n - file: Single file only\n - module: Module/directory scope\n - project: Entire codebase\n\n --strategy: Risk tolerance (default: safe)\n - safe: Conservative, maximum test coverage required\n - aggressive: Allow broader changes with adequate coverage\n```\n\n## What This Command Does\n\nPerforms intelligent, deterministic refactoring with full codebase awareness. Unlike blind search-and-replace, this command:\n\n1. **Understands your intent** - Analyzes what you actually want to achieve\n2. **Maps the codebase** - Builds a definitive codemap before touching anything\n3. **Assesses risk** - Evaluates test coverage and determines verification strategy\n4. **Plans meticulously** - Creates a detailed plan with Plan agent\n5. **Executes precisely** - Step-by-step refactoring with LSP and AST-grep\n6. **Verifies constantly** - Runs tests after each change to ensure zero regression\n\n---\n\n# PHASE 0: INTENT GATE (MANDATORY FIRST STEP)\n\n**BEFORE ANY ACTION, classify and validate the request.**\n\n## Step 0.1: Parse Request Type\n\n| Signal | Classification | Action |\n|--------|----------------|--------|\n| Specific file/symbol | Explicit | Proceed to codebase analysis |\n| \"Refactor X to Y\" | Clear transformation | Proceed to codebase analysis |\n| \"Improve\", \"Clean up\" | Open-ended | **MUST ask**: \"What specific improvement?\" |\n| Ambiguous scope | Uncertain | **MUST ask**: \"Which modules/files?\" |\n| Missing context | Incomplete | **MUST ask**: \"What's the desired outcome?\" |\n\n## Step 0.2: Validate Understanding\n\nBefore proceeding, confirm:\n- [ ] Target is clearly identified\n- [ ] Desired outcome is understood\n- [ ] Scope is defined (file/module/project)\n- [ ] Success criteria can be articulated\n\n**If ANY of above is unclear, ASK CLARIFYING QUESTION:**\n\n```\nI want to make sure I understand the refactoring goal correctly.\n\n**What I understood**: [interpretation]\n**What I'm unsure about**: [specific ambiguity]\n\nOptions I see:\n1. [Option A] - [implications]\n2. [Option B] - [implications]\n\n**My recommendation**: [suggestion with reasoning]\n\nShould I proceed with [recommendation], or would you prefer differently?\n```\n\n## Step 0.3: Create Initial Todos\n\n**IMMEDIATELY after understanding the request, create todos:**\n\n```\nTodoWrite([\n {\"id\": \"phase-1\", \"content\": \"PHASE 1: Codebase Analysis - launch parallel explore agents\", \"status\": \"pending\", \"priority\": \"high\"},\n {\"id\": \"phase-2\", \"content\": \"PHASE 2: Build Codemap - map dependencies and impact zones\", \"status\": \"pending\", \"priority\": \"high\"},\n {\"id\": \"phase-3\", \"content\": \"PHASE 3: Test Assessment - analyze test coverage and verification strategy\", \"status\": \"pending\", \"priority\": \"high\"},\n {\"id\": \"phase-4\", \"content\": \"PHASE 4: Plan Generation - invoke Plan agent for detailed refactoring plan\", \"status\": \"pending\", \"priority\": \"high\"},\n {\"id\": \"phase-5\", \"content\": \"PHASE 5: Execute Refactoring - step-by-step with continuous verification\", \"status\": \"pending\", \"priority\": \"high\"},\n {\"id\": \"phase-6\", \"content\": \"PHASE 6: Final Verification - full test suite and regression check\", \"status\": \"pending\", \"priority\": \"high\"}\n])\n```\n\n---\n\n# PHASE 1: CODEBASE ANALYSIS (PARALLEL EXPLORATION)\n\n**Mark phase-1 as in_progress.**\n\n## 1.1: Launch Parallel Explore Agents (BACKGROUND)\n\nFire ALL of these simultaneously using `delegate_agent`:\n\n```\n// Agent 1: Find the refactoring target\ndelegate_agent(\n subagent_type=\"trinity\",\n run_in_background=true,\n prompt=\"Find all occurrences and definitions of [TARGET]. \n Report: file paths, line numbers, usage patterns.\"\n)\n\n// Agent 2: Find related code\ndelegate_agent(\n subagent_type=\"trinity\", \n run_in_background=true,\n prompt=\"Find all code that imports, uses, or depends on [TARGET].\n Report: dependency chains, import graphs.\"\n)\n\n// Agent 3: Find similar patterns\ndelegate_agent(\n subagent_type=\"trinity\",\n run_in_background=true,\n prompt=\"Find similar code patterns to [TARGET] in the codebase.\n Report: analogous implementations, established conventions.\"\n)\n\n// Agent 4: Find tests\ndelegate_agent(\n subagent_type=\"trinity\",\n run_in_background=true,\n prompt=\"Find all test files related to [TARGET].\n Report: test file paths, test case names, coverage indicators.\"\n)\n\n// Agent 5: Architecture context\ndelegate_agent(\n subagent_type=\"trinity\",\n run_in_background=true,\n prompt=\"Find architectural patterns and module organization around [TARGET].\n Report: module boundaries, layer structure, design patterns in use.\"\n)\n```\n\n## 1.2: Direct Tool Exploration (WHILE AGENTS RUN)\n\nWhile background agents are running, use direct tools:\n\n### LSP Tools for Precise Analysis:\n\n```typescript\n// Find definition(s)\nLspGotoDefinition(filePath, line, character) // Where is it defined?\n\n// Find ALL usages across workspace\nLspFindReferences(filePath, line, character, includeDeclaration=true)\n\n// Get file structure\nLspDocumentSymbols(filePath) // Hierarchical outline\nLspWorkspaceSymbols(filePath, query=\"[target_symbol]\") // Search by name\n\n// Get current diagnostics\nlsp_diagnostics(filePath) // Errors, warnings before we start\n```\n\n### AST-Grep for Pattern Analysis:\n\n```typescript\n// Find structural patterns\nast_grep_search(\n pattern=\"function $NAME($$$) { $$$ }\", // or relevant pattern\n lang=\"typescript\", // or relevant language\n paths=[\"src/\"]\n)\n\n// Preview refactoring (DRY RUN)\nast_grep_replace(\n pattern=\"[old_pattern]\",\n rewrite=\"[new_pattern]\",\n lang=\"[language]\",\n dryRun=true // ALWAYS preview first\n)\n```\n\n### Grep for Text Patterns:\n\n```\ngrep(pattern=\"[search_term]\", path=\"src/\", include=\"*.ts\")\n```\n\n## 1.3: Collect Background Results\n\n```\nbackground_output(task_id=\"[agent_1_id]\")\nbackground_output(task_id=\"[agent_2_id]\")\n...\n```\n\n**Mark phase-1 as completed after all results collected.**\n\n---\n\n# PHASE 2: BUILD CODEMAP (DEPENDENCY MAPPING)\n\n**Mark phase-2 as in_progress.**\n\n## 2.1: Construct Definitive Codemap\n\nBased on Phase 1 results, build:\n\n```\n## CODEMAP: [TARGET]\n\n### Core Files (Direct Impact)\n- `path/to/file.ts:L10-L50` - Primary definition\n- `path/to/file2.ts:L25` - Key usage\n\n### Dependency Graph\n```\n[TARGET] \n\u251C\u2500\u2500 imports from: \n\u2502 \u251C\u2500\u2500 module-a (types)\n\u2502 \u2514\u2500\u2500 module-b (utils)\n\u251C\u2500\u2500 imported by:\n\u2502 \u251C\u2500\u2500 consumer-1.ts\n\u2502 \u251C\u2500\u2500 consumer-2.ts\n\u2502 \u2514\u2500\u2500 consumer-3.ts\n\u2514\u2500\u2500 used by:\n \u251C\u2500\u2500 handler.ts (direct call)\n \u2514\u2500\u2500 service.ts (dependency injection)\n```\n\n### Impact Zones\n| Zone | Risk Level | Files Affected | Test Coverage |\n|------|------------|----------------|---------------|\n| Core | HIGH | 3 files | 85% covered |\n| Consumers | MEDIUM | 8 files | 70% covered |\n| Edge | LOW | 2 files | 50% covered |\n\n### Established Patterns\n- Pattern A: [description] - used in N places\n- Pattern B: [description] - established convention\n```\n\n## 2.2: Identify Refactoring Constraints\n\nBased on codemap:\n- **MUST follow**: [existing patterns identified]\n- **MUST NOT break**: [critical dependencies]\n- **Safe to change**: [isolated code zones]\n- **Requires migration**: [breaking changes impact]\n\n**Mark phase-2 as completed.**\n\n---\n\n# PHASE 3: TEST ASSESSMENT (VERIFICATION STRATEGY)\n\n**Mark phase-3 as in_progress.**\n\n## 3.1: Detect Test Infrastructure\n\n```bash\n# Check for test commands\ncat package.json | jq '.scripts | keys[] | select(test(\"test\"))'\n\n# Or for Python\nls -la pytest.ini pyproject.toml setup.cfg\n\n# Or for Go\nls -la *_test.go\n```\n\n## 3.2: Analyze Test Coverage\n\n```\n// Find all tests related to target\ndelegate_agent(\n subagent_type=\"trinity\",\n run_in_background=false, // Need this synchronously\n prompt=\"Analyze test coverage for [TARGET]:\n 1. Which test files cover this code?\n 2. What test cases exist?\n 3. Are there integration tests?\n 4. What edge cases are tested?\n 5. Estimated coverage percentage?\"\n)\n```\n\n## 3.3: Determine Verification Strategy\n\nBased on test analysis:\n\n| Coverage Level | Strategy |\n|----------------|----------|\n| HIGH (>80%) | Run existing tests after each step |\n| MEDIUM (50-80%) | Run tests + add safety assertions |\n| LOW (<50%) | **PAUSE**: Propose adding tests first |\n| NONE | **BLOCK**: Refuse aggressive refactoring |\n\n**If coverage is LOW or NONE, ask user:**\n\n```\nTest coverage for [TARGET] is [LEVEL].\n\n**Risk Assessment**: Refactoring without adequate tests is dangerous.\n\nOptions:\n1. Add tests first, then refactor (RECOMMENDED)\n2. Proceed with extra caution, manual verification required\n3. Abort refactoring\n\nWhich approach do you prefer?\n```\n\n## 3.4: Document Verification Plan\n\n```\n## VERIFICATION PLAN\n\n### Test Commands\n- Unit: `bun test` / `npm test` / `pytest` / etc.\n- Integration: [command if exists]\n- Type check: `tsc --noEmit` / `pyright` / etc.\n\n### Verification Checkpoints\nAfter each refactoring step:\n1. lsp_diagnostics \u2192 zero new errors\n2. Run test command \u2192 all pass\n3. Type check \u2192 clean\n\n### Regression Indicators\n- [Specific test that must pass]\n- [Behavior that must be preserved]\n- [API contract that must not change]\n```\n\n**Mark phase-3 as completed.**\n\n---\n\n# PHASE 4: PLAN GENERATION (PLAN AGENT)\n\n**Mark phase-4 as in_progress.**\n\n## 4.1: Invoke Plan Agent\n\n```\nTask(\n subagent_type=\"plan\",\n prompt=\"Create a detailed refactoring plan:\n\n ## Refactoring Goal\n [User's original request]\n\n ## Codemap (from Phase 2)\n [Insert codemap here]\n\n ## Test Coverage (from Phase 3)\n [Insert verification plan here]\n\n ## Constraints\n - MUST follow existing patterns: [list]\n - MUST NOT break: [critical paths]\n - MUST run tests after each step\n\n ## Requirements\n 1. Break down into atomic refactoring steps\n 2. Each step must be independently verifiable\n 3. Order steps by dependency (what must happen first)\n 4. Specify exact files and line ranges for each step\n 5. Include rollback strategy for each step\n 6. Define commit checkpoints\"\n)\n```\n\n## 4.2: Review and Validate Plan\n\nAfter receiving plan from Plan agent:\n\n1. **Verify completeness**: All identified files addressed?\n2. **Verify safety**: Each step reversible?\n3. **Verify order**: Dependencies respected?\n4. **Verify verification**: Test commands specified?\n\n## 4.3: Register Detailed Todos\n\nConvert Plan agent output into granular todos:\n\n```\nTodoWrite([\n // Each step from the plan becomes a todo\n {\"id\": \"refactor-1\", \"content\": \"Step 1: [description]\", \"status\": \"pending\", \"priority\": \"high\"},\n {\"id\": \"verify-1\", \"content\": \"Verify Step 1: run tests\", \"status\": \"pending\", \"priority\": \"high\"},\n {\"id\": \"refactor-2\", \"content\": \"Step 2: [description]\", \"status\": \"pending\", \"priority\": \"medium\"},\n {\"id\": \"verify-2\", \"content\": \"Verify Step 2: run tests\", \"status\": \"pending\", \"priority\": \"medium\"},\n // ... continue for all steps\n])\n```\n\n**Mark phase-4 as completed.**\n\n---\n\n# PHASE 5: EXECUTE REFACTORING (DETERMINISTIC EXECUTION)\n\n**Mark phase-5 as in_progress.**\n\n## 5.1: Execution Protocol\n\nFor EACH refactoring step:\n\n### Pre-Step\n1. Mark step todo as `in_progress`\n2. Read current file state\n3. Verify lsp_diagnostics is baseline\n\n### Execute Step\nUse appropriate tool:\n\n**For Symbol Renames:**\n```typescript\nlsp_prepare_rename(filePath, line, character) // Validate rename is possible\nlsp_rename(filePath, line, character, newName) // Execute rename\n```\n\n**For Pattern Transformations:**\n```typescript\n// Preview first\nast_grep_replace(pattern, rewrite, lang, dryRun=true)\n\n// If preview looks good, execute\nast_grep_replace(pattern, rewrite, lang, dryRun=false)\n```\n\n**For Structural Changes:**\n```typescript\n// Use Edit tool for precise changes\nedit(filePath, oldString, newString)\n```\n\n### Post-Step Verification (MANDATORY)\n\n```typescript\n// 1. Check diagnostics\nlsp_diagnostics(filePath) // Must be clean or same as baseline\n\n// 2. Run tests\nbash(\"bun test\") // Or appropriate test command\n\n// 3. Type check\nbash(\"tsc --noEmit\") // Or appropriate type check\n```\n\n### Step Completion\n1. If verification passes \u2192 Mark step todo as `completed`\n2. If verification fails \u2192 **STOP AND FIX**\n\n## 5.2: Failure Recovery Protocol\n\nIf ANY verification fails:\n\n1. **STOP** immediately\n2. **REVERT** the failed change\n3. **DIAGNOSE** what went wrong\n4. **OPTIONS**:\n - Fix the issue and retry\n - Skip this step (if optional)\n - Consult oracle agent for help\n - Ask user for guidance\n\n**NEVER proceed to next step with broken tests.**\n\n## 5.3: Commit Checkpoints\n\nAfter each logical group of changes:\n\n```bash\ngit add [changed-files]\ngit commit -m \"refactor(scope): description\n\n[details of what was changed and why]\"\n```\n\n**Mark phase-5 as completed when all refactoring steps done.**\n\n---\n\n# PHASE 6: FINAL VERIFICATION (REGRESSION CHECK)\n\n**Mark phase-6 as in_progress.**\n\n## 6.1: Full Test Suite\n\n```bash\n# Run complete test suite\nbun test # or npm test, pytest, go test, etc.\n```\n\n## 6.2: Type Check\n\n```bash\n# Full type check\ntsc --noEmit # or equivalent\n```\n\n## 6.3: Lint Check\n\n```bash\n# Run linter\neslint . # or equivalent\n```\n\n## 6.4: Build Verification (if applicable)\n\n```bash\n# Ensure build still works\nbun run build # or npm run build, etc.\n```\n\n## 6.5: Final Diagnostics\n\n```typescript\n// Check all changed files\nfor (file of changedFiles) {\n lsp_diagnostics(file) // Must all be clean\n}\n```\n\n## 6.6: Generate Summary\n\n```markdown\n## Refactoring Complete\n\n### What Changed\n- [List of changes made]\n\n### Files Modified\n- `path/to/file.ts` - [what changed]\n- `path/to/file2.ts` - [what changed]\n\n### Verification Results\n- Tests: PASSED (X/Y passing)\n- Type Check: CLEAN\n- Lint: CLEAN\n- Build: SUCCESS\n\n### No Regressions Detected\nAll existing tests pass. No new errors introduced.\n```\n\n**Mark phase-6 as completed.**\n\n---\n\n# CRITICAL RULES\n\n## NEVER DO\n- Skip lsp_diagnostics check after changes\n- Proceed with failing tests\n- Make changes without understanding impact\n- Use `as any`, `@ts-ignore`, `@ts-expect-error`\n- Delete tests to make them pass\n- Commit broken code\n- Refactor without understanding existing patterns\n\n## ALWAYS DO\n- Understand before changing\n- Preview before applying (ast_grep dryRun=true)\n- Verify after every change\n- Follow existing codebase patterns\n- Keep todos updated in real-time\n- Commit at logical checkpoints\n- Report issues immediately\n\n## ABORT CONDITIONS\nIf any of these occur, **STOP and consult user**:\n- Test coverage is zero for target code\n- Changes would break public API\n- Refactoring scope is unclear\n- 3 consecutive verification failures\n- User-defined constraints violated\n\n---\n\n# Tool Usage Philosophy\n\nYou already know these tools. Use them intelligently:\n\n## LSP Tools\nLeverage LSP tools for precision analysis. Key patterns:\n- **Understand before changing**: `LspGotoDefinition` to grasp context\n- **Impact analysis**: `LspFindReferences` to map all usages before modification\n- **Safe refactoring**: `lsp_prepare_rename` \u2192 `lsp_rename` for symbol renames\n- **Continuous verification**: `lsp_diagnostics` after every change\n\n## AST-Grep\nUse `ast_grep_search` and `ast_grep_replace` for structural transformations.\n**Critical**: Always `dryRun=true` first, review, then execute.\n\n## Agents\n- `explore`: Parallel codebase pattern discovery\n- `plan`: Detailed refactoring plan generation\n- `oracle`: Read-only consultation for complex architectural decisions and debugging\n- `librarian`: **Use proactively** when encountering deprecated methods or library migration tasks. Query official docs and OSS examples for modern replacements.\n\n## Deprecated Code & Library Migration\nWhen you encounter deprecated methods/APIs during refactoring:\n1. Fire `librarian` to find the recommended modern alternative\n2. **DO NOT auto-upgrade to latest version** unless user explicitly requests migration\n3. If user requests library migration, use `librarian` to fetch latest API docs before making changes\n\n---\n\n**Remember: Refactoring without tests is reckless. Refactoring without understanding is destructive. This command ensures you do neither.**\n\n<user-request>\n$ARGUMENTS\n</user-request>\n";
|
|
@@ -1,6 +1,3 @@
|
|
|
1
1
|
import type { CommandDefinition } from "../claude-code-command-loader";
|
|
2
|
-
export type BuiltinCommandName = "init-deep" | "matrix-loop" | "cancel-loop" | "ulw-loop" | "refactor" | "start-work" | "stop-continuation" | "handoff" | "pickup" | "remove-deadcode";
|
|
3
|
-
export interface BuiltinCommandConfig {
|
|
4
|
-
disabled_commands?: BuiltinCommandName[];
|
|
5
|
-
}
|
|
2
|
+
export type BuiltinCommandName = "init-deep" | "matrix-loop" | "cancel-loop" | "ulw-loop" | "refactor" | "start-work" | "stop-continuation" | "handoff" | "pickup" | "remove-deadcode" | "profile" | "end-ultrawork";
|
|
6
3
|
export type BuiltinCommands = Record<string, CommandDefinition>;
|
|
@@ -1,4 +1,2 @@
|
|
|
1
1
|
import type { BuiltinSkill } from "../types";
|
|
2
|
-
export declare const DOCUMENT_READER_SKILL_NAME = "document-reader";
|
|
3
|
-
export declare const DOCUMENT_READER_SKILL_DESCRIPTION = "Read and extract content from local or remote documents (PDF, DOCX, XLSX, PPTX, HTML, images). Use the document_reader MCP tool `convert_to_markdown` with a file: or https: URI. Triggers: 'read the PDF', 'analyze the document', 'extract from .docx', 'summarize the file', 'look at the spreadsheet'.";
|
|
4
2
|
export declare const documentReaderSkill: BuiltinSkill;
|
|
@@ -1,4 +1,3 @@
|
|
|
1
1
|
import type { BuiltinSkill } from "../types";
|
|
2
2
|
export declare const DSL_CODEGEN_SKILL_NAME = "dsl-codegen";
|
|
3
|
-
export declare const DSL_CODEGEN_SKILL_DESCRIPTION = "Code generation and transpiler engineering for DSLs. Source analysis, generator architecture (template/AST-walk/IR), multi-target generation, source maps. Triggers: 'code generation', 'transpile', 'compile to', 'emit', 'codegen', 'M2T'.";
|
|
4
3
|
export declare const dslCodegenSkill: BuiltinSkill;
|
|
@@ -1,4 +1,3 @@
|
|
|
1
1
|
import type { BuiltinSkill } from "../types";
|
|
2
2
|
export declare const DSL_COMPOSITION_SKILL_NAME = "dsl-composition";
|
|
3
|
-
export declare const DSL_COMPOSITION_SKILL_DESCRIPTION = "Language composition and DSL evolution: textX multi-metamodel, grammar extension/inheritance, grammar referencing, DSL evolution (grammar versioning, backward compatibility), model migration, multiple concrete syntaxes for one abstract syntax, language embedding. Triggers: 'language composition', 'grammar extension', 'multi-metamodel', 'DSL evolution', 'model migration', 'grammar versioning', 'language embedding'.";
|
|
4
3
|
export declare const dslCompositionSkill: BuiltinSkill;
|
|
@@ -1,4 +1,3 @@
|
|
|
1
1
|
import type { BuiltinSkill } from "../types";
|
|
2
2
|
export declare const DSL_CORE_SKILL_NAME = "dsl-core";
|
|
3
|
-
export declare const DSL_CORE_SKILL_DESCRIPTION = "DSL engineering foundations: expert constraints, framework selection guide, paradigm coverage, and anti-patterns. Load alongside domain-specific DSL skills (dsl-grammar, dsl-codegen, dsl-metamodel, dsl-tooling). Triggers: 'DSL', 'domain-specific language', 'language design'.";
|
|
4
3
|
export declare const dslCoreSkill: BuiltinSkill;
|
|
@@ -1,4 +1,3 @@
|
|
|
1
1
|
import type { BuiltinSkill } from "../types";
|
|
2
2
|
export declare const DSL_GRAMMAR_SKILL_NAME = "dsl-grammar";
|
|
3
|
-
export declare const DSL_GRAMMAR_SKILL_DESCRIPTION = "Grammar design and parser implementation for DSLs. Domain analysis, formal grammar (BNF/EBNF/PEG), expression precedence, declaration patterns, error recovery, framework adaptation. Triggers: 'grammar', 'BNF', 'EBNF', 'PEG', 'parser', 'lexer', 'ANTLR', 'textX grammar', 'precedence', 'operator'.";
|
|
4
3
|
export declare const dslGrammarSkill: BuiltinSkill;
|
|
@@ -1,4 +1,3 @@
|
|
|
1
1
|
import type { BuiltinSkill } from "../types";
|
|
2
2
|
export declare const DSL_METAMODEL_SKILL_NAME = "dsl-metamodel";
|
|
3
|
-
export declare const DSL_METAMODEL_SKILL_DESCRIPTION = "Metamodeling for DSLs with textX, PyEcore, and EMF-style tools. Complete textX grammar reference (assignments, rule types, references, modifiers), scoping, validation, model transformations. Triggers: 'metamodel', 'PyEcore', 'EMF', 'model-driven', 'M2M', 'textX', 'Ecore', 'scoping', 'obj_processors'.";
|
|
4
3
|
export declare const dslMetamodelSkill: BuiltinSkill;
|
|
@@ -1,4 +1,3 @@
|
|
|
1
1
|
import type { BuiltinSkill } from "../types";
|
|
2
2
|
export declare const DSL_MODEL_TRANSFORMATION_SKILL_NAME = "dsl-model-transformation";
|
|
3
|
-
export declare const DSL_MODEL_TRANSFORMATION_SKILL_DESCRIPTION = "Model-to-model (M2M) transformations: in-place vs out-place, rule-based mapping, transformation chaining, trace models, ATL-style patterns in Python, motra framework, M2T with Jinja2 best practices. Triggers: 'M2M', 'model transformation', 'ATL', 'motra', 'in-place transformation', 'transformation chain'.";
|
|
4
3
|
export declare const dslModelTransformationSkill: BuiltinSkill;
|
|
@@ -1,4 +1,3 @@
|
|
|
1
1
|
import type { BuiltinSkill } from "../types";
|
|
2
2
|
export declare const DSL_PYECORE_ADVANCED_SKILL_NAME = "dsl-pyecore-advanced";
|
|
3
|
-
export declare const DSL_PYECORE_ADVANCED_SKILL_DESCRIPTION = "Advanced PyEcore: serialization (XMI/JSON, ResourceSet, URI), dynamic vs static metamodels (DynamicEPackage, pyecoregen), notifications (EObserver), @EMetaclass decorator, loading .ecore files, EMF interchange, executable models. Triggers: 'XMI', 'ResourceSet', 'pyecoregen', 'DynamicEPackage', 'EObserver', '.ecore', 'EMF interchange'.";
|
|
4
3
|
export declare const dslPyecoreAdvancedSkill: BuiltinSkill;
|
|
@@ -1,4 +1,3 @@
|
|
|
1
1
|
import type { BuiltinSkill } from "../types";
|
|
2
2
|
export declare const DSL_TESTING_SKILL_NAME = "dsl-testing";
|
|
3
|
-
export declare const DSL_TESTING_SKILL_DESCRIPTION = "DSL testing patterns: grammar parsing tests, semantic validation testing (TextXSyntaxError/TextXSemanticError), code generator golden-file testing, property-based testing with Hypothesis, model roundtrip testing, test organization. Triggers: 'test grammar', 'test parser', 'test generator', 'golden file', 'roundtrip test', 'DSL test'.";
|
|
4
3
|
export declare const dslTestingSkill: BuiltinSkill;
|
|
@@ -1,4 +1,3 @@
|
|
|
1
1
|
import type { BuiltinSkill } from "../types";
|
|
2
2
|
export declare const DSL_TEXTX_ECOSYSTEM_SKILL_NAME = "dsl-textx-ecosystem";
|
|
3
|
-
export declare const DSL_TEXTX_ECOSYSTEM_SKILL_DESCRIPTION = "textX ecosystem: registration system (entry points, textx_languages/textx_generators), generator framework (textx generate CLI, Jinja2, GeneratorParam), multi-file models (ModelRepository, FQNImportURI), language composition (grammar extension, multi-metamodel), visualization (dot/PlantUML), textX-LS. Triggers: 'textx generate', 'textx_languages', 'entry points', 'multi-file model', 'language composition', 'textX-LS'.";
|
|
4
3
|
export declare const dslTextxEcosystemSkill: BuiltinSkill;
|
|
@@ -1,4 +1,3 @@
|
|
|
1
1
|
import type { BuiltinSkill } from "../types";
|
|
2
2
|
export declare const DSL_TOOLING_SKILL_NAME = "dsl-tooling";
|
|
3
|
-
export declare const DSL_TOOLING_SKILL_DESCRIPTION = "IDE tooling and internal DSL engineering. Tree-sitter grammars, LSP implementation, syntax highlighting, formatters, fluent APIs, builder patterns, decorators. Triggers: 'tree-sitter', 'LSP', 'syntax highlighting', 'IDE support', 'formatter', 'fluent API', 'builder pattern', 'internal DSL', 'embedded DSL'.";
|
|
4
3
|
export declare const dslToolingSkill: BuiltinSkill;
|
|
@@ -1,4 +1,3 @@
|
|
|
1
1
|
import type { BuiltinSkill } from "../types";
|
|
2
2
|
export declare const DSL_VALIDATION_SKILL_NAME = "dsl-validation";
|
|
3
|
-
export declare const DSL_VALIDATION_SKILL_DESCRIPTION = "Advanced DSL model validation: OCL-style constraint patterns, well-formedness rules, multiplicity/cardinality checks, referential integrity, invariant specifications, constraint categories (structural/semantic/domain), error reporting strategy. Triggers: 'OCL', 'constraint', 'well-formedness', 'invariant', 'model validation', 'cardinality', 'referential integrity'.";
|
|
4
3
|
export declare const dslValidationSkill: BuiltinSkill;
|
|
@@ -1,43 +1,38 @@
|
|
|
1
|
-
export { playwrightSkill, agentBrowserSkill } from "./playwright";
|
|
2
|
-
export { playwrightCliSkill } from "./playwright-cli";
|
|
3
|
-
export { frontendUiUxSkill } from "./frontend-ui-ux";
|
|
4
|
-
export { gitMasterSkill } from "./git-master";
|
|
5
1
|
export { devBrowserSkill } from "./dev-browser";
|
|
2
|
+
export { documentReaderSkill } from "./document-reader";
|
|
3
|
+
export { dslCodegenSkill } from "./dsl-codegen";
|
|
4
|
+
export { dslCompositionSkill } from "./dsl-composition";
|
|
6
5
|
export { dslCoreSkill } from "./dsl-core";
|
|
7
6
|
export { dslGrammarSkill } from "./dsl-grammar";
|
|
8
|
-
export { dslCodegenSkill } from "./dsl-codegen";
|
|
9
7
|
export { dslMetamodelSkill } from "./dsl-metamodel";
|
|
10
|
-
export { dslToolingSkill } from "./dsl-tooling";
|
|
11
|
-
export { euHorizonSkill } from "./eu-horizon";
|
|
12
|
-
export { academicReviewSkill } from "./academic-review";
|
|
13
|
-
export { deliverableWritingSkill } from "./deliverable-writing";
|
|
14
|
-
export { projectManagementSkill } from "./project-management";
|
|
15
|
-
export { technicalLeadSkill } from "./technical-lead";
|
|
16
|
-
export { academicWritingSkill } from "./academic-writing";
|
|
17
|
-
export { researchMethodologySkill } from "./research-methodology";
|
|
18
|
-
export { literatureReviewSkill } from "./literature-review";
|
|
19
|
-
export { grantWritingSkill } from "./grant-writing";
|
|
20
|
-
export { scientificPresentationSkill } from "./scientific-presentation";
|
|
21
|
-
export { dataManagementPlanSkill } from "./data-management-plan";
|
|
22
|
-
export { ipExploitationSkill } from "./ip-exploitation";
|
|
23
|
-
export { dslTextxEcosystemSkill } from "./dsl-textx-ecosystem";
|
|
24
|
-
export { dslPyecoreAdvancedSkill } from "./dsl-pyecore-advanced";
|
|
25
8
|
export { dslModelTransformationSkill } from "./dsl-model-transformation";
|
|
9
|
+
export { dslPyecoreAdvancedSkill } from "./dsl-pyecore-advanced";
|
|
26
10
|
export { dslTestingSkill } from "./dsl-testing";
|
|
11
|
+
export { dslTextxEcosystemSkill } from "./dsl-textx-ecosystem";
|
|
12
|
+
export { dslToolingSkill } from "./dsl-tooling";
|
|
27
13
|
export { dslValidationSkill } from "./dsl-validation";
|
|
28
|
-
export {
|
|
14
|
+
export { frontendA11ySkill } from "./frontend-a11y";
|
|
15
|
+
export { frontendBuildToolingSkill } from "./frontend-build-tooling";
|
|
16
|
+
export { frontendPerfSkill } from "./frontend-perf";
|
|
17
|
+
export { reactNextjsPatternsSkill } from "./frontend-react-nextjs";
|
|
18
|
+
export { frontendStateDataSkill } from "./frontend-state-data";
|
|
19
|
+
export { svelteSveltekitPatternsSkill } from "./frontend-svelte-sveltekit";
|
|
20
|
+
export { frontendTestingSkill } from "./frontend-testing";
|
|
21
|
+
export { frontendUiUxSkill } from "./frontend-ui-ux";
|
|
22
|
+
export { gitMasterSkill } from "./git-master";
|
|
23
|
+
export { matrixxSelfConfigSkill } from "./matrixx-self-config";
|
|
24
|
+
export { agentBrowserSkill, playwrightSkill } from "./playwright";
|
|
25
|
+
export { playwrightCliSkill } from "./playwright-cli";
|
|
26
|
+
export { qualityGateSkill } from "./quality-gate";
|
|
27
|
+
export { reviewWorkSkill } from "./review-work";
|
|
28
|
+
export { securityApiSkill } from "./security-api";
|
|
29
29
|
export { securityCoreSkill } from "./security-core";
|
|
30
|
-
export {
|
|
31
|
-
export { securitySastSkill } from "./security-sast";
|
|
30
|
+
export { securityCryptoSkill } from "./security-crypto";
|
|
32
31
|
export { securityDastSkill } from "./security-dast";
|
|
33
32
|
export { securityDependenciesSkill } from "./security-dependencies";
|
|
34
|
-
export { securityApiSkill } from "./security-api";
|
|
35
|
-
export { securityCryptoSkill } from "./security-crypto";
|
|
36
33
|
export { securityInfraSkill } from "./security-infra";
|
|
37
34
|
export { securityReviewSkill } from "./security-review";
|
|
38
|
-
export {
|
|
39
|
-
export {
|
|
40
|
-
export {
|
|
41
|
-
export { cryptoOnchainSkill } from "./crypto-onchain";
|
|
35
|
+
export { securitySastSkill } from "./security-sast";
|
|
36
|
+
export { securitySecretsSkill } from "./security-secrets";
|
|
37
|
+
export { softwareDevSkill } from "./software-dev";
|
|
42
38
|
export { tddEnforcerSkill } from "./tdd-enforcer";
|
|
43
|
-
export { reviewWorkSkill } from "./review-work";
|
|
@@ -1,4 +1,2 @@
|
|
|
1
1
|
import type { BuiltinSkill } from "../types";
|
|
2
|
-
export declare const REVIEW_WORK_SKILL_NAME = "review-work";
|
|
3
|
-
export declare const REVIEW_WORK_SKILL_DESCRIPTION = "Post-implementation review orchestrator. Launches 5 parallel background sub-agents: Oracle (goal/constraint verification), Oracle (code quality), Oracle (security), unspecified-high (hands-on QA execution), unspecified-high (context mining from GitHub/git/Slack/Notion). All must pass for review to pass. MUST USE after completing any significant implementation work. Triggers: 'review work', 'review my work', 'review changes', 'QA my work', 'verify implementation', 'check my work', 'validate changes', 'post-implementation review'.";
|
|
4
2
|
export declare const reviewWorkSkill: BuiltinSkill;
|