opencode-matrixx 2.1.0 → 2.3.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 +150 -43
- package/dist/agents/bdd-contract.d.ts +7 -0
- package/dist/agents/builtin-agents/architect-agent.d.ts +1 -0
- package/dist/agents/builtin-agents/general-agents.d.ts +1 -0
- package/dist/agents/builtin-agents/{hephaestus-agent.d.ts → keymaker-agent.d.ts} +2 -0
- package/dist/agents/builtin-agents/model-resolution.d.ts +2 -1
- package/dist/agents/builtin-agents/morpheus-agent.d.ts +2 -0
- package/dist/agents/builtin-agents.d.ts +1 -1
- package/dist/agents/dynamic-agent-prompt-builder.d.ts +2 -1
- package/dist/agents/env-context.d.ts +1 -1
- package/dist/agents/index.d.ts +1 -1
- package/dist/agents/merovingian.d.ts +2 -2
- package/dist/agents/mouse/agent.d.ts +5 -2
- package/dist/agents/mouse/deepseek.d.ts +16 -0
- package/dist/agents/mouse/index.d.ts +3 -0
- package/dist/agents/mouse/mimo.d.ts +15 -0
- package/dist/agents/mouse/qwen.d.ts +16 -0
- package/dist/agents/mouse/shared.d.ts +7 -0
- package/dist/agents/types.d.ts +4 -1
- package/dist/config/index.d.ts +3 -4
- package/dist/config/presets.d.ts +4 -0
- package/dist/config/resolve-tiers.d.ts +32 -0
- package/dist/config/schema/agent-names.d.ts +9 -17
- package/dist/config/schema/agent-overrides.d.ts +133 -0
- package/dist/config/schema/assembly.d.ts +13 -0
- package/dist/config/schema/categories.d.ts +16 -1
- package/dist/config/schema/commands.d.ts +10 -0
- package/dist/config/schema/dcp.d.ts +16 -0
- package/dist/config/schema/hooks.d.ts +2 -1
- package/dist/config/schema/matrixx-config.d.ts +169 -19
- package/dist/config/schema/security.d.ts +0 -5
- package/dist/config/schema.d.ts +4 -1
- package/dist/create-hooks.d.ts +2 -0
- package/dist/features/assembly-state/index.d.ts +1 -0
- package/dist/features/assembly-state/manager.d.ts +6 -0
- package/dist/features/background-agent/error-helpers.d.ts +6 -0
- package/dist/features/background-agent/manager.d.ts +6 -8
- package/dist/features/background-agent/message-dir.d.ts +5 -0
- package/dist/features/background-agent/notification-builder.d.ts +17 -0
- package/dist/features/bdd/schema.d.ts +434 -0
- package/dist/features/bdd/types.d.ts +2 -0
- package/dist/features/builtin-commands/templates/assembly.d.ts +1 -0
- package/dist/features/builtin-commands/templates/bdd-backend.d.ts +1 -0
- package/dist/features/builtin-commands/templates/bdd-contract.d.ts +1 -0
- package/dist/features/builtin-commands/templates/bdd-frontend.d.ts +1 -0
- package/dist/features/builtin-commands/templates/bdd-pipeline.d.ts +1 -0
- package/dist/features/builtin-commands/templates/bdd-tests.d.ts +1 -0
- package/dist/features/builtin-commands/templates/dcp-profile.d.ts +1 -0
- package/dist/features/builtin-commands/templates/research.d.ts +1 -0
- package/dist/features/builtin-commands/templates/ultrawork.d.ts +1 -0
- package/dist/features/builtin-commands/types.d.ts +2 -2
- package/dist/features/builtin-skills/lazy-skill-helper.d.ts +17 -0
- package/dist/features/builtin-skills/skills/bdd-backend.d.ts +3 -0
- package/dist/features/builtin-skills/skills/bdd-contract.d.ts +3 -0
- package/dist/features/builtin-skills/skills/bdd-frontend.d.ts +3 -0
- package/dist/features/builtin-skills/skills/bdd-tests.d.ts +3 -0
- package/dist/features/builtin-skills/skills/docker-master.d.ts +2 -0
- package/dist/features/builtin-skills/skills/index.d.ts +7 -0
- package/dist/features/builtin-skills/skills/remove-ai-slops.d.ts +2 -0
- package/dist/features/builtin-skills/skills/ulw-research.d.ts +2 -0
- package/dist/features/command-loader/loader.d.ts +3 -0
- package/dist/features/hook-message-injector/injector.d.ts +1 -2
- package/dist/features/mission-state/constants.d.ts +10 -0
- package/dist/features/mission-state/index.d.ts +2 -0
- package/dist/features/mission-state/plan-storage.d.ts +48 -0
- package/dist/features/mission-state/rehydrate.d.ts +21 -0
- package/dist/features/mission-state/types.d.ts +46 -0
- package/dist/features/opencode-skill-loader/loader.d.ts +1 -3
- package/dist/features/opencode-skill-loader/skill-definition-record.d.ts +1 -1
- package/dist/features/opencode-skill-loader/types.d.ts +1 -1
- package/dist/features/skill-mcp-manager/connection-type.d.ts +2 -3
- package/dist/features/skill-mcp-manager/connection.d.ts +3 -4
- package/dist/features/skill-mcp-manager/manager.d.ts +2 -3
- package/dist/features/skill-mcp-manager/oauth-handler.d.ts +3 -3
- package/dist/features/skill-mcp-manager/types.d.ts +16 -4
- package/dist/features/tmux-subagent/index.d.ts +0 -2
- package/dist/features/ultrawork-state/index.d.ts +1 -0
- package/dist/features/ultrawork-state/manager.d.ts +6 -0
- package/dist/hooks/auto-update-checker/cache.d.ts +0 -2
- package/dist/hooks/auto-update-checker/index.d.ts +1 -1
- package/dist/hooks/env-context-injector/index.d.ts +23 -0
- package/dist/hooks/index.d.ts +2 -0
- package/dist/hooks/interactive-bash-session/parser.d.ts +0 -6
- package/dist/hooks/plan-persister/hook.d.ts +20 -0
- package/dist/hooks/plan-persister/index.d.ts +2 -0
- package/dist/index.js +44832 -26999
- package/dist/plugin/hooks/create-continuation-hooks.d.ts +2 -1
- package/dist/plugin/hooks/create-core-hooks.d.ts +1 -0
- package/dist/plugin/hooks/create-transform-hooks.d.ts +2 -1
- package/dist/plugin-config.d.ts +1 -1
- package/dist/plugin-handlers/agent-config-handler.d.ts +2 -0
- package/dist/plugin-handlers/plugin-components-loader.d.ts +1 -1
- package/dist/plugin-handlers/prometheus-agent-config-builder.d.ts +1 -0
- package/dist/shared/index.d.ts +2 -1
- package/dist/shared/merge-categories.d.ts +4 -0
- package/dist/shared/model-resolution-pipeline.d.ts +1 -24
- package/dist/shared/model-resolution-types.d.ts +4 -0
- package/dist/shared/model-resolver.d.ts +4 -2
- package/dist/shared/model-tiers.d.ts +31 -0
- package/dist/shared/opencode-config-dir.d.ts +1 -2
- package/dist/shared/session-directory-resolver.d.ts +0 -6
- package/dist/shared/tier-resolver.d.ts +26 -0
- package/dist/shared/tool-guards.d.ts +16 -0
- package/dist/tools/assembly/assembly-executor.d.ts +17 -0
- package/dist/tools/assembly/constants.d.ts +6 -0
- package/dist/tools/assembly/index.d.ts +2 -0
- package/dist/tools/assembly/provider-selector.d.ts +3 -0
- package/dist/tools/assembly/synthesizer.d.ts +3 -0
- package/dist/tools/assembly/tool-description.d.ts +2 -0
- package/dist/tools/assembly/tools.d.ts +10 -0
- package/dist/tools/assembly/types.d.ts +25 -0
- package/dist/tools/assembly/voter-spawner.d.ts +3 -0
- package/dist/tools/bdd-create-contract/constants.d.ts +1 -0
- package/dist/tools/bdd-create-contract/index.d.ts +3 -0
- package/dist/tools/bdd-create-contract/tools.d.ts +3 -0
- package/dist/tools/bdd-create-contract/types.d.ts +12 -0
- package/dist/tools/bdd-parse-gherkin/constants.d.ts +1 -0
- package/dist/tools/bdd-parse-gherkin/index.d.ts +3 -0
- package/dist/tools/bdd-parse-gherkin/tools.d.ts +5 -0
- package/dist/tools/bdd-parse-gherkin/types.d.ts +9 -0
- package/dist/tools/bdd-pipeline/analysis-report-sections.d.ts +10 -0
- package/dist/tools/bdd-pipeline/analysis-report.d.ts +9 -0
- package/dist/tools/bdd-pipeline/constants.d.ts +4 -0
- package/dist/tools/bdd-pipeline/feature-resolver.d.ts +5 -0
- package/dist/{features/run-continuation-state → tools/bdd-pipeline}/index.d.ts +1 -1
- package/dist/tools/bdd-pipeline/pipeline-runner.d.ts +6 -0
- package/dist/tools/bdd-pipeline/subagent-runner.d.ts +14 -0
- package/dist/tools/bdd-pipeline/tools.d.ts +5 -0
- package/dist/tools/bdd-pipeline/types.d.ts +74 -0
- package/dist/tools/bdd-validate-contract/index.d.ts +1 -0
- package/dist/tools/bdd-validate-contract/tools.d.ts +21 -0
- package/dist/tools/delegate-task/categories.d.ts +7 -0
- package/dist/tools/delegate-task/category-resolver.d.ts +6 -0
- package/dist/tools/delegate-task/complexity-constants.d.ts +24 -0
- package/dist/tools/delegate-task/complexity-scorer.d.ts +31 -0
- package/dist/tools/delegate-task/complexity-types.d.ts +10 -0
- package/dist/tools/delegate-task/executor-types.d.ts +1 -0
- package/dist/tools/delegate-task/index.d.ts +3 -0
- package/dist/tools/delegate-task/types.d.ts +8 -0
- package/dist/tools/handoff/constants.d.ts +0 -3
- package/dist/tools/index.d.ts +5 -0
- package/dist/tools/task/todo-sync.d.ts +1 -1
- package/package.json +22 -32
- package/bin/matrixx.js +0 -80
- package/bin/platform.js +0 -38
- package/bin/platform.test.ts +0 -148
- package/dist/agents/builtin-agents/environment-context.d.ts +0 -2
- package/dist/cli/cli-installer.d.ts +0 -2
- package/dist/cli/cli-program.d.ts +0 -1
- package/dist/cli/config-manager/add-plugin-to-opencode-config.d.ts +0 -2
- package/dist/cli/config-manager/add-provider-config.d.ts +0 -2
- package/dist/cli/config-manager/antigravity-provider-configuration.d.ts +0 -122
- package/dist/cli/config-manager/auth-plugins.d.ts +0 -3
- package/dist/cli/config-manager/bun-install.d.ts +0 -7
- package/dist/cli/config-manager/config-context.d.ts +0 -13
- package/dist/cli/config-manager/deep-merge-record.d.ts +0 -1
- package/dist/cli/config-manager/detect-current-config.d.ts +0 -2
- package/dist/cli/config-manager/ensure-config-directory-exists.d.ts +0 -1
- package/dist/cli/config-manager/format-error-with-suggestion.d.ts +0 -1
- package/dist/cli/config-manager/generate-matrixx-config.d.ts +0 -2
- package/dist/cli/config-manager/jsonc-provider-editor.d.ts +0 -1
- package/dist/cli/config-manager/npm-dist-tags.d.ts +0 -7
- package/dist/cli/config-manager/opencode-binary.d.ts +0 -2
- package/dist/cli/config-manager/opencode-config-format.d.ts +0 -6
- package/dist/cli/config-manager/parse-opencode-config-file.d.ts +0 -10
- package/dist/cli/config-manager/plugin-name-with-version.d.ts +0 -1
- package/dist/cli/config-manager/write-matrixx-config.d.ts +0 -2
- package/dist/cli/config-manager.d.ts +0 -14
- package/dist/cli/doctor/checks/config.d.ts +0 -2
- package/dist/cli/doctor/checks/dependencies.d.ts +0 -4
- package/dist/cli/doctor/checks/index.d.ts +0 -7
- package/dist/cli/doctor/checks/model-resolution-cache.d.ts +0 -2
- package/dist/cli/doctor/checks/model-resolution-config.d.ts +0 -2
- package/dist/cli/doctor/checks/model-resolution-details.d.ts +0 -6
- package/dist/cli/doctor/checks/model-resolution-effective-model.d.ts +0 -3
- package/dist/cli/doctor/checks/model-resolution-types.d.ts +0 -37
- package/dist/cli/doctor/checks/model-resolution-variant.d.ts +0 -5
- package/dist/cli/doctor/checks/model-resolution.d.ts +0 -6
- package/dist/cli/doctor/checks/system-binary.d.ts +0 -8
- package/dist/cli/doctor/checks/system-loaded-version.d.ts +0 -10
- package/dist/cli/doctor/checks/system-plugin.d.ts +0 -15
- package/dist/cli/doctor/checks/system.d.ts +0 -3
- package/dist/cli/doctor/checks/tools-gh.d.ts +0 -11
- package/dist/cli/doctor/checks/tools-lsp.d.ts +0 -6
- package/dist/cli/doctor/checks/tools-mcp.d.ts +0 -3
- package/dist/cli/doctor/checks/tools.d.ts +0 -3
- package/dist/cli/doctor/constants.d.ts +0 -31
- package/dist/cli/doctor/format-default.d.ts +0 -2
- package/dist/cli/doctor/format-shared.d.ts +0 -6
- package/dist/cli/doctor/format-status.d.ts +0 -2
- package/dist/cli/doctor/format-verbose.d.ts +0 -2
- package/dist/cli/doctor/formatter.d.ts +0 -3
- package/dist/cli/doctor/index.d.ts +0 -5
- package/dist/cli/doctor/runner.d.ts +0 -5
- package/dist/cli/doctor/types.d.ts +0 -96
- package/dist/cli/fallback-chain-resolution.d.ts +0 -10
- package/dist/cli/get-local-version/formatter.d.ts +0 -3
- package/dist/cli/get-local-version/get-local-version.d.ts +0 -2
- package/dist/cli/get-local-version/index.d.ts +0 -2
- package/dist/cli/get-local-version/types.d.ts +0 -13
- package/dist/cli/index.d.ts +0 -2
- package/dist/cli/index.js +0 -30691
- package/dist/cli/install-validators.d.ts +0 -31
- package/dist/cli/install.d.ts +0 -2
- package/dist/cli/mcp-oauth/index.d.ts +0 -6
- package/dist/cli/mcp-oauth/login.d.ts +0 -7
- package/dist/cli/mcp-oauth/logout.d.ts +0 -5
- package/dist/cli/mcp-oauth/status.d.ts +0 -1
- package/dist/cli/model-fallback-types.d.ts +0 -25
- package/dist/cli/model-fallback.d.ts +0 -4
- package/dist/cli/provider-availability.d.ts +0 -4
- package/dist/cli/provider-model-id-transform.d.ts +0 -1
- package/dist/cli/run/agent-resolver.d.ts +0 -5
- package/dist/cli/run/completion.d.ts +0 -2
- package/dist/cli/run/event-formatting.d.ts +0 -3
- package/dist/cli/run/event-handlers.d.ts +0 -10
- package/dist/cli/run/event-state.d.ts +0 -13
- package/dist/cli/run/event-stream-processor.d.ts +0 -3
- package/dist/cli/run/events.d.ts +0 -4
- package/dist/cli/run/index.d.ts +0 -9
- package/dist/cli/run/json-output.d.ts +0 -12
- package/dist/cli/run/on-complete-hook.d.ts +0 -7
- package/dist/cli/run/opencode-bin-path.d.ts +0 -3
- package/dist/cli/run/opencode-binary-resolver.d.ts +0 -4
- package/dist/cli/run/poll-for-completion.d.ts +0 -9
- package/dist/cli/run/runner.d.ts +0 -5
- package/dist/cli/run/server-connection.d.ts +0 -6
- package/dist/cli/run/session-resolver.d.ts +0 -6
- package/dist/cli/run/types.d.ts +0 -119
- package/dist/cli/tui-install-prompts.d.ts +0 -2
- package/dist/cli/tui-installer.d.ts +0 -2
- package/dist/cli/types.d.ts +0 -36
- package/dist/config/profiles.d.ts +0 -4
- package/dist/config/schema/claude-code.d.ts +0 -10
- package/dist/features/background-agent/background-task-notification-template.d.ts +0 -11
- package/dist/features/background-agent/opencode-client.d.ts +0 -2
- package/dist/features/background-agent/task-poller.d.ts +0 -21
- package/dist/features/claude-code-command-loader/loader.d.ts +0 -6
- package/dist/features/claude-code-mcp-loader/index.d.ts +0 -10
- package/dist/features/claude-code-mcp-loader/loader.d.ts +0 -3
- package/dist/features/claude-code-mcp-loader/transformer.d.ts +0 -2
- package/dist/features/claude-code-mcp-loader/types.d.ts +0 -39
- package/dist/features/claude-code-plugin-loader/agent-loader.d.ts +0 -3
- package/dist/features/claude-code-plugin-loader/command-loader.d.ts +0 -3
- package/dist/features/claude-code-plugin-loader/discovery.d.ts +0 -2
- package/dist/features/claude-code-plugin-loader/hook-loader.d.ts +0 -2
- package/dist/features/claude-code-plugin-loader/index.d.ts +0 -10
- package/dist/features/claude-code-plugin-loader/loader.d.ts +0 -20
- package/dist/features/claude-code-plugin-loader/mcp-server-loader.d.ts +0 -3
- package/dist/features/claude-code-plugin-loader/plugin-path-resolver.d.ts +0 -1
- package/dist/features/claude-code-plugin-loader/skill-loader.d.ts +0 -3
- package/dist/features/claude-code-plugin-loader/types.d.ts +0 -187
- package/dist/features/claude-tasks/index.d.ts +0 -3
- package/dist/features/claude-tasks/session-storage.d.ts +0 -10
- package/dist/features/mcp-oauth/index.d.ts +0 -3
- package/dist/features/mcp-oauth/schema.d.ts +0 -5
- package/dist/features/run-continuation-state/constants.d.ts +0 -1
- package/dist/features/run-continuation-state/storage.d.ts +0 -6
- package/dist/features/run-continuation-state/types.d.ts +0 -13
- package/dist/features/tmux-subagent/cleanup.d.ts +0 -1
- package/dist/features/tmux-subagent/polling.d.ts +0 -1
- package/dist/hooks/session-recovery/recover-empty-content-message-sdk.d.ts +0 -13
- package/dist/hooks/task-reminder/hook.d.ts +0 -19
- package/dist/hooks/task-reminder/index.d.ts +0 -1
- package/dist/shared/claude-config-dir.d.ts +0 -1
- package/dist/tools/delegate-agent/background-agent-executor.d.ts +0 -5
- package/dist/tools/delegate-agent/message-storage-directory.d.ts +0 -1
- package/dist/tools/delegate-agent/subagent-session-creator.d.ts +0 -10
- package/dist/tools/delegate-agent/tool-context-with-metadata.d.ts +0 -10
- package/postinstall.mjs +0 -43
- /package/dist/features/{claude-code-agent-loader → agent-loader}/index.d.ts +0 -0
- /package/dist/features/{claude-code-agent-loader → agent-loader}/loader.d.ts +0 -0
- /package/dist/features/{claude-code-agent-loader → agent-loader}/types.d.ts +0 -0
- /package/dist/features/{claude-code-command-loader → command-loader}/index.d.ts +0 -0
- /package/dist/features/{claude-code-command-loader → command-loader}/types.d.ts +0 -0
- /package/dist/features/{claude-code-session-state → session-state}/index.d.ts +0 -0
- /package/dist/features/{claude-code-session-state → session-state}/state.d.ts +0 -0
- /package/dist/features/{claude-code-mcp-loader → skill-mcp-manager}/env-expander.d.ts +0 -0
- /package/dist/features/{claude-tasks → task-storage}/storage.d.ts +0 -0
- /package/dist/features/{claude-tasks → task-storage}/types.d.ts +0 -0
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Plan Persistence Storage
|
|
3
|
+
*
|
|
4
|
+
* Atomic file operations for plan files.
|
|
5
|
+
* Reuses the write-temp-then-rename pattern from handoff/storage.ts.
|
|
6
|
+
*/
|
|
7
|
+
import type { PlanMeta } from "./types";
|
|
8
|
+
/**
|
|
9
|
+
* Ensure the .matrixx/plans directory exists under the project root.
|
|
10
|
+
*/
|
|
11
|
+
export declare function ensurePlanDir(directory: string): boolean;
|
|
12
|
+
/**
|
|
13
|
+
* Read a plan file's content.
|
|
14
|
+
* Returns null if the file does not exist, is too large, or cannot be read.
|
|
15
|
+
*/
|
|
16
|
+
export declare function readPlanFile(planPath: string): string | null;
|
|
17
|
+
/**
|
|
18
|
+
* Atomic write: write to a .tmp.{pid} file, then rename over the target.
|
|
19
|
+
* Prevents partial/corrupt files on crash mid-write.
|
|
20
|
+
*/
|
|
21
|
+
export declare function atomicWrite(filePath: string, content: string): boolean;
|
|
22
|
+
/**
|
|
23
|
+
* Write content to a plan file using atomic write.
|
|
24
|
+
* Ensures the plan directory exists first.
|
|
25
|
+
*/
|
|
26
|
+
export declare function writePlanFile(directory: string, planPath: string, content: string): boolean;
|
|
27
|
+
/**
|
|
28
|
+
* Sync markdown checkbox status to match todos.
|
|
29
|
+
*
|
|
30
|
+
* For each `- [ ]` or `- [x]` line, finds the matching todo by content
|
|
31
|
+
* and marks it completed if the todo status is completed/cancelled.
|
|
32
|
+
* Lines without a matching todo keep their current state.
|
|
33
|
+
*/
|
|
34
|
+
export declare function syncCheckboxes(content: string, todos: Array<{
|
|
35
|
+
content: string;
|
|
36
|
+
status: string;
|
|
37
|
+
}>): string;
|
|
38
|
+
/**
|
|
39
|
+
* Append or replace the <!-- plan-persister: ... --> metadata comment.
|
|
40
|
+
*
|
|
41
|
+
* If a comment already exists at the end of the file, it is replaced in-place.
|
|
42
|
+
* Otherwise, the tag is appended after the last line.
|
|
43
|
+
*/
|
|
44
|
+
export declare function upsertMetadataComment(content: string, meta: PlanMeta): string;
|
|
45
|
+
/**
|
|
46
|
+
* Extract PlanMeta from an HTML comment, or null if absent/malformed.
|
|
47
|
+
*/
|
|
48
|
+
export declare function parseMetadataComment(content: string): PlanMeta | null;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Plan Persistence Rehydration
|
|
3
|
+
*
|
|
4
|
+
* Builds rehydration context from mission state + plan file for injection
|
|
5
|
+
* after compaction or session start.
|
|
6
|
+
*/
|
|
7
|
+
import type { RehydrationContext } from "./types";
|
|
8
|
+
/**
|
|
9
|
+
* Build a rehydration context from mission state + plan file.
|
|
10
|
+
*
|
|
11
|
+
* Returns null when:
|
|
12
|
+
* - No mission file exists
|
|
13
|
+
* - Mission has no active_plan
|
|
14
|
+
* - Plan file is missing
|
|
15
|
+
* - Plan is 100% complete (no point rehydrating a finished plan)
|
|
16
|
+
*/
|
|
17
|
+
export declare function buildRehydrationContext(directory: string): RehydrationContext | null;
|
|
18
|
+
/**
|
|
19
|
+
* Find active plan path from mission state.
|
|
20
|
+
*/
|
|
21
|
+
export declare function findActivePlan(directory: string): string | null;
|
|
@@ -24,3 +24,49 @@ export interface PlanProgress {
|
|
|
24
24
|
/** Whether all tasks are done */
|
|
25
25
|
isComplete: boolean;
|
|
26
26
|
}
|
|
27
|
+
/**
|
|
28
|
+
* Plan Persistence Types
|
|
29
|
+
* Machine-parseable metadata appended as HTML comment to plan files
|
|
30
|
+
*/
|
|
31
|
+
/** Machine-parseable metadata appended as HTML comment to plan files */
|
|
32
|
+
export interface PlanMeta {
|
|
33
|
+
/** Plan file name without .md extension */
|
|
34
|
+
id: string;
|
|
35
|
+
/** ISO timestamp of last write */
|
|
36
|
+
updatedAt: string;
|
|
37
|
+
/** Session ID that triggered the last write */
|
|
38
|
+
sessionId: string;
|
|
39
|
+
/** Total todo count at time of write */
|
|
40
|
+
todoTotal: number;
|
|
41
|
+
/** Completed todo count at time of write */
|
|
42
|
+
todoCompleted: number;
|
|
43
|
+
/** Git HEAD at time of write (optional) */
|
|
44
|
+
gitHead?: {
|
|
45
|
+
sha: string;
|
|
46
|
+
branch?: string;
|
|
47
|
+
};
|
|
48
|
+
}
|
|
49
|
+
/** Events the plan-persister hook listens to */
|
|
50
|
+
export type PlanPersistEvent = {
|
|
51
|
+
type: "session.idle";
|
|
52
|
+
sessionID: string;
|
|
53
|
+
} | {
|
|
54
|
+
type: "session.compacted";
|
|
55
|
+
sessionID: string;
|
|
56
|
+
};
|
|
57
|
+
/** Return value of buildRehydrationContext */
|
|
58
|
+
export interface RehydrationContext {
|
|
59
|
+
planName: string;
|
|
60
|
+
planPath: string;
|
|
61
|
+
content: string;
|
|
62
|
+
progress: {
|
|
63
|
+
total: number;
|
|
64
|
+
completed: number;
|
|
65
|
+
};
|
|
66
|
+
directive: string;
|
|
67
|
+
}
|
|
68
|
+
/** Options for the plan-persister hook */
|
|
69
|
+
export interface PlanPersistenceOptions {
|
|
70
|
+
/** Project root directory */
|
|
71
|
+
directory: string;
|
|
72
|
+
}
|
|
@@ -1,7 +1,5 @@
|
|
|
1
|
-
import type { CommandDefinition } from "../
|
|
1
|
+
import type { CommandDefinition } from "../command-loader/types";
|
|
2
2
|
import type { LoadedSkill } from "./types";
|
|
3
|
-
export declare function loadUserSkills(): Promise<Record<string, CommandDefinition>>;
|
|
4
|
-
export declare function loadProjectSkills(directory?: string): Promise<Record<string, CommandDefinition>>;
|
|
5
3
|
export declare function loadOpencodeGlobalSkills(): Promise<Record<string, CommandDefinition>>;
|
|
6
4
|
export declare function loadOpencodeProjectSkills(directory?: string): Promise<Record<string, CommandDefinition>>;
|
|
7
5
|
interface DiscoverSkillsOptions {
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import type { CommandDefinition } from "../
|
|
1
|
+
import type { CommandDefinition } from "../command-loader/types";
|
|
2
2
|
import type { LoadedSkill } from "./types";
|
|
3
3
|
export declare function skillsToCommandDefinitionRecord(skills: LoadedSkill[]): Record<string, CommandDefinition>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { CommandDefinition } from "../
|
|
1
|
+
import type { CommandDefinition } from "../command-loader/types";
|
|
2
2
|
import type { SkillMcpConfig } from "../skill-mcp-manager/types";
|
|
3
3
|
export type SkillScope = "builtin" | "config" | "user" | "project" | "opencode" | "opencode-project";
|
|
4
4
|
export interface SkillMetadata {
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
import type { ConnectionType } from "./types";
|
|
1
|
+
import type { ConnectionType, McpServerDefinition } from "./types";
|
|
3
2
|
/**
|
|
4
3
|
* Determines connection type from MCP server configuration.
|
|
5
4
|
* Priority: explicit type field > url presence > command presence
|
|
6
5
|
*/
|
|
7
|
-
export declare function getConnectionType(config:
|
|
6
|
+
export declare function getConnectionType(config: McpServerDefinition): ConnectionType | null;
|
|
@@ -1,15 +1,14 @@
|
|
|
1
1
|
import type { Client } from "@modelcontextprotocol/sdk/client/index.js";
|
|
2
|
-
import type {
|
|
3
|
-
import type { SkillMcpClientInfo, SkillMcpManagerState } from "./types";
|
|
2
|
+
import type { McpServerDefinition, SkillMcpClientInfo, SkillMcpManagerState } from "./types";
|
|
4
3
|
export declare function getOrCreateClient(params: {
|
|
5
4
|
state: SkillMcpManagerState;
|
|
6
5
|
clientKey: string;
|
|
7
6
|
info: SkillMcpClientInfo;
|
|
8
|
-
config:
|
|
7
|
+
config: McpServerDefinition;
|
|
9
8
|
}): Promise<Client>;
|
|
10
9
|
export declare function getOrCreateClientWithRetryImpl(params: {
|
|
11
10
|
state: SkillMcpManagerState;
|
|
12
11
|
clientKey: string;
|
|
13
12
|
info: SkillMcpClientInfo;
|
|
14
|
-
config:
|
|
13
|
+
config: McpServerDefinition;
|
|
15
14
|
}): Promise<Client>;
|
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
import type { Client } from "@modelcontextprotocol/sdk/client/index.js";
|
|
2
2
|
import type { Prompt, Resource, Tool } from "@modelcontextprotocol/sdk/types.js";
|
|
3
|
-
import type {
|
|
4
|
-
import type { SkillMcpClientInfo, SkillMcpServerContext } from "./types";
|
|
3
|
+
import type { McpServerDefinition, SkillMcpClientInfo, SkillMcpServerContext } from "./types";
|
|
5
4
|
export declare class SkillMcpManager {
|
|
6
5
|
private readonly state;
|
|
7
6
|
private getClientKey;
|
|
8
|
-
getOrCreateClient(info: SkillMcpClientInfo, config:
|
|
7
|
+
getOrCreateClient(info: SkillMcpClientInfo, config: McpServerDefinition): Promise<Client>;
|
|
9
8
|
disconnectSession(sessionID: string): Promise<void>;
|
|
10
9
|
disconnectAll(): Promise<void>;
|
|
11
10
|
listTools(info: SkillMcpClientInfo, context: SkillMcpServerContext): Promise<Tool[]>;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import type { ClaudeCodeMcpServer } from "../claude-code-mcp-loader/types";
|
|
2
1
|
import { McpOAuthProvider } from "../mcp-oauth/provider";
|
|
3
|
-
|
|
2
|
+
import type { McpServerDefinition } from "./types";
|
|
3
|
+
export declare function buildHttpRequestInit(config: McpServerDefinition, authProviders: Map<string, McpOAuthProvider>): Promise<RequestInit | undefined>;
|
|
4
4
|
export declare function handleStepUpIfNeeded(params: {
|
|
5
5
|
error: Error;
|
|
6
|
-
config:
|
|
6
|
+
config: McpServerDefinition;
|
|
7
7
|
authProviders: Map<string, McpOAuthProvider>;
|
|
8
8
|
}): Promise<boolean>;
|
|
@@ -1,16 +1,28 @@
|
|
|
1
1
|
import type { Client } from "@modelcontextprotocol/sdk/client/index.js";
|
|
2
2
|
import type { StdioClientTransport } from "@modelcontextprotocol/sdk/client/stdio.js";
|
|
3
3
|
import type { StreamableHTTPClientTransport } from "@modelcontextprotocol/sdk/client/streamableHttp.js";
|
|
4
|
-
import type { ClaudeCodeMcpServer } from "../claude-code-mcp-loader/types";
|
|
5
4
|
import type { McpOAuthProvider } from "../mcp-oauth/provider";
|
|
6
|
-
export
|
|
5
|
+
export interface McpServerDefinition {
|
|
6
|
+
type?: "http" | "sse" | "stdio";
|
|
7
|
+
url?: string;
|
|
8
|
+
command?: string;
|
|
9
|
+
args?: string[];
|
|
10
|
+
env?: Record<string, string>;
|
|
11
|
+
headers?: Record<string, string>;
|
|
12
|
+
oauth?: {
|
|
13
|
+
clientId?: string;
|
|
14
|
+
scopes?: string[];
|
|
15
|
+
};
|
|
16
|
+
disabled?: boolean;
|
|
17
|
+
}
|
|
18
|
+
export type SkillMcpConfig = Record<string, McpServerDefinition>;
|
|
7
19
|
export interface SkillMcpClientInfo {
|
|
8
20
|
serverName: string;
|
|
9
21
|
skillName: string;
|
|
10
22
|
sessionID: string;
|
|
11
23
|
}
|
|
12
24
|
export interface SkillMcpServerContext {
|
|
13
|
-
config:
|
|
25
|
+
config: McpServerDefinition;
|
|
14
26
|
skillName: string;
|
|
15
27
|
}
|
|
16
28
|
/**
|
|
@@ -51,6 +63,6 @@ export interface SkillMcpClientConnectionParams {
|
|
|
51
63
|
state: SkillMcpManagerState;
|
|
52
64
|
clientKey: string;
|
|
53
65
|
info: SkillMcpClientInfo;
|
|
54
|
-
config:
|
|
66
|
+
config: McpServerDefinition;
|
|
55
67
|
}
|
|
56
68
|
export {};
|
|
@@ -1,10 +1,8 @@
|
|
|
1
1
|
export * from "./action-executor";
|
|
2
|
-
export * from "./cleanup";
|
|
3
2
|
export * from "./decision-engine";
|
|
4
3
|
export * from "./event-handlers";
|
|
5
4
|
export * from "./manager";
|
|
6
5
|
export * from "./pane-state-querier";
|
|
7
|
-
export * from "./polling";
|
|
8
6
|
export * from "./polling-constants";
|
|
9
7
|
export * from "./session-created-event";
|
|
10
8
|
export * from "./session-created-handler";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { _resetUltraworkStateForTesting, clearUltraworkState, disableUltrawork, enableUltrawork, getUltraworkState, } from "./manager";
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export declare function getUltraworkState(sessionID: string): "enabled" | "disabled" | undefined;
|
|
2
|
+
export declare function enableUltrawork(sessionID: string): void;
|
|
3
|
+
export declare function disableUltrawork(sessionID: string): void;
|
|
4
|
+
export declare function clearUltraworkState(sessionID: string): void;
|
|
5
|
+
/** @internal */
|
|
6
|
+
export declare function _resetUltraworkStateForTesting(): void;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export {
|
|
1
|
+
export { invalidatePackage } from "./cache";
|
|
2
2
|
export { checkForUpdate } from "./checker";
|
|
3
3
|
export { createAutoUpdateCheckerHook } from "./hook";
|
|
4
4
|
export type { AutoUpdateCheckerOptions, UpdateCheckResult } from "./types";
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import type { Message, Part } from "@opencode-ai/sdk";
|
|
2
|
+
interface MessageWithParts {
|
|
3
|
+
info: Message;
|
|
4
|
+
parts: Part[];
|
|
5
|
+
}
|
|
6
|
+
type MessagesTransformHook = {
|
|
7
|
+
"experimental.chat.messages.transform"?: (input: Record<string, never>, output: {
|
|
8
|
+
messages: MessageWithParts[];
|
|
9
|
+
}) => Promise<void>;
|
|
10
|
+
};
|
|
11
|
+
/**
|
|
12
|
+
* Env-Context Injector Transform Hook
|
|
13
|
+
*
|
|
14
|
+
* Appends the <matrixx-env> block (date, time, timezone, locale, year)
|
|
15
|
+
* to the last user message in each turn.
|
|
16
|
+
*
|
|
17
|
+
* This ensures the system prompt (agent config) is 100% static and
|
|
18
|
+
* byte-identical across all turns in a session, enabling provider-side
|
|
19
|
+
* prefix caching (Anthropic prompt caching, DeepSeek KV cache, OpenAI
|
|
20
|
+
* auto-cache).
|
|
21
|
+
*/
|
|
22
|
+
export declare function createEnvContextInjectorHook(): MessagesTransformHook;
|
|
23
|
+
export {};
|
package/dist/hooks/index.d.ts
CHANGED
|
@@ -16,6 +16,7 @@ export { createDirectoryAgentsInjectorHook } from "./directory-agents-injector";
|
|
|
16
16
|
export { createDirectoryReadmeInjectorHook } from "./directory-readme-injector";
|
|
17
17
|
export { createEditErrorRecoveryHook } from "./edit-error-recovery";
|
|
18
18
|
export { createEmptyTaskResponseDetectorHook } from "./empty-task-response-detector";
|
|
19
|
+
export { createEnvContextInjectorHook } from "./env-context-injector";
|
|
19
20
|
export { createEnvFileWriteGuardHook } from "./env-file-write-guard";
|
|
20
21
|
export { createHashlineEditDiffEnhancerHook } from "./hashline-edit-diff-enhancer";
|
|
21
22
|
export { createHashlineReadEnhancerHook } from "./hashline-read-enhancer";
|
|
@@ -25,6 +26,7 @@ export { createKeywordDetectorHook } from "./keyword-detector";
|
|
|
25
26
|
export { createMatrixLoopHook, type MatrixLoopHook } from "./matrix-loop";
|
|
26
27
|
export { createMouseNotepadHook } from "./mouse-notepad";
|
|
27
28
|
export { createNonInteractiveEnvHook } from "./non-interactive-env";
|
|
29
|
+
export { createPlanPersister } from "./plan-persister";
|
|
28
30
|
export { createPreemptiveCompactionHook } from "./preemptive-compaction";
|
|
29
31
|
export { createOracleMdOnlyHook } from "./prometheus-md-only";
|
|
30
32
|
export { createQualityGateHook } from "./quality-gate/hook";
|
|
@@ -3,12 +3,6 @@
|
|
|
3
3
|
* Handles single/double quotes and backslash escapes
|
|
4
4
|
*/
|
|
5
5
|
export declare function tokenizeCommand(cmd: string): string[];
|
|
6
|
-
/**
|
|
7
|
-
* Normalize session name by stripping :window and .pane suffixes
|
|
8
|
-
* e.g., "matrixx-x:1" -> "matrixx-x", "matrixx-x:1.2" -> "matrixx-x"
|
|
9
|
-
*/
|
|
10
|
-
export declare function normalizeSessionName(name: string): string;
|
|
11
|
-
export declare function findFlagValue(tokens: string[], flag: string): string | null;
|
|
12
6
|
/**
|
|
13
7
|
* Extract session name from tokens, considering the subCommand
|
|
14
8
|
* For new-session: prioritize -s over -t
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Plan Persister Hook
|
|
3
|
+
*
|
|
4
|
+
* Continuation hook that persists active plan state (todos + metadata)
|
|
5
|
+
* to the plan file on session.idle, and builds rehydration context
|
|
6
|
+
* for injection after compaction.
|
|
7
|
+
*/
|
|
8
|
+
import type { PluginInput } from "@opencode-ai/plugin";
|
|
9
|
+
import type { PlanPersistenceOptions } from "../../features/mission-state/types";
|
|
10
|
+
export interface PlanPersister {
|
|
11
|
+
buildRehydrationContext: (sessionID: string) => string | null;
|
|
12
|
+
capture: (sessionID: string) => Promise<void>;
|
|
13
|
+
event: (input: {
|
|
14
|
+
event: {
|
|
15
|
+
type: string;
|
|
16
|
+
properties?: unknown;
|
|
17
|
+
};
|
|
18
|
+
}) => Promise<void>;
|
|
19
|
+
}
|
|
20
|
+
export declare function createPlanPersister(ctx: PluginInput, options: PlanPersistenceOptions): PlanPersister;
|