opencode-matrixx 2.6.3 → 2.6.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/agents/dynamic-agent-prompt-builder.d.ts +5 -3
- package/dist/agents/mouse/agent.d.ts +1 -1
- package/dist/agents/oracle/behavioral-summary.d.ts +1 -1
- package/dist/agents/oracle/identity-constraints.d.ts +1 -1
- package/dist/agents/oracle/plan-generation.d.ts +1 -1
- package/dist/agents/oracle/plan-template.d.ts +1 -1
- package/dist/agents/oracle/system-prompt.d.ts +4 -3
- package/dist/agents/smith.d.ts +1 -1
- package/dist/agents/types.d.ts +1 -1
- package/dist/cli/setup/index.d.ts +1 -0
- package/dist/cli/setup/preset-wizard.d.ts +36 -0
- package/dist/cli/setup/types.d.ts +5 -0
- package/dist/cli.js +581 -49
- package/dist/config/index.d.ts +0 -1
- package/dist/config/migrations/index.d.ts +1 -0
- package/dist/config/migrations/model-migration.d.ts +17 -0
- package/dist/config/preset-applier.d.ts +17 -0
- package/dist/config/schema/agent-overrides.d.ts +0 -133
- package/dist/config/schema/categories.d.ts +0 -14
- package/dist/config/schema/commands.d.ts +1 -1
- package/dist/config/schema/failure-counter.d.ts +7 -0
- package/dist/config/schema/hooks.d.ts +1 -0
- package/dist/config/schema/matrixx-config.d.ts +61 -134
- package/dist/config/schema/model-config.d.ts +59 -0
- package/dist/config/schema/model-presets.d.ts +40 -0
- package/dist/config/schema/morpheus.d.ts +4 -0
- package/dist/config/schema/task.d.ts +6 -0
- package/dist/config/schema/tasks.d.ts +25 -0
- package/dist/config/schema.d.ts +5 -0
- package/dist/create-hooks.d.ts +1 -0
- package/dist/features/background-agent/manager.d.ts +8 -0
- package/dist/features/builtin-commands/templates/preset.d.ts +1 -0
- package/dist/features/builtin-commands/templates/start-work.d.ts +1 -1
- package/dist/features/builtin-commands/types.d.ts +1 -1
- package/dist/features/mission-state/plan-storage.d.ts +1 -0
- package/dist/features/mission-state/plan-storage.test.d.ts +1 -0
- package/dist/features/preset-state/index.d.ts +1 -0
- package/dist/features/preset-state/manager.d.ts +5 -0
- package/dist/features/session-state/state.d.ts +32 -0
- package/dist/features/session-state/state.test.d.ts +1 -0
- package/dist/features/task-storage/types.d.ts +3 -0
- package/dist/hooks/context-mode-enforcer/constants.d.ts +1 -1
- package/dist/hooks/failure-counter/counter.d.ts +7 -0
- package/dist/hooks/failure-counter/counter.test.d.ts +1 -0
- package/dist/hooks/failure-counter/hook.d.ts +18 -0
- package/dist/hooks/failure-counter/index.d.ts +3 -0
- package/dist/hooks/failure-counter/patterns.d.ts +6 -0
- package/dist/hooks/failure-counter/patterns.test.d.ts +1 -0
- package/dist/hooks/index.d.ts +1 -0
- package/dist/hooks/interactive-bash-session/hook.test.d.ts +1 -0
- package/dist/hooks/json-error-recovery/hook.d.ts +1 -1
- package/dist/hooks/keyword-detector/analyze/default.d.ts +1 -1
- package/dist/hooks/keyword-detector/search/default.d.ts +1 -1
- package/dist/hooks/keyword-detector/ultrawork/deepseek.d.ts +1 -1
- package/dist/hooks/keyword-detector/ultrawork/default.d.ts +1 -1
- package/dist/hooks/keyword-detector/ultrawork/gemini.d.ts +1 -1
- package/dist/hooks/keyword-detector/ultrawork/glm.d.ts +1 -1
- package/dist/hooks/keyword-detector/ultrawork/mimo.d.ts +1 -1
- package/dist/hooks/stop-continuation-guard/hook.d.ts +3 -2
- package/dist/hooks/stop-continuation-guard/repro.test.d.ts +1 -0
- package/dist/hooks/task-continuation-enforcer/awaiting-user.test.d.ts +1 -0
- package/dist/hooks/task-continuation-enforcer/continuation-injection.d.ts +2 -0
- package/dist/hooks/task-continuation-enforcer/continuation-injection.test.d.ts +1 -0
- package/dist/hooks/task-continuation-enforcer/countdown.d.ts +2 -0
- package/dist/hooks/task-continuation-enforcer/handler.d.ts +2 -0
- package/dist/hooks/task-continuation-enforcer/idle-event.d.ts +2 -0
- package/dist/hooks/task-continuation-enforcer/staleness.d.ts +22 -0
- package/dist/hooks/task-continuation-enforcer/staleness.test.d.ts +1 -0
- package/dist/hooks/task-continuation-enforcer/todo.d.ts +23 -0
- package/dist/hooks/task-continuation-enforcer/todo.test.d.ts +1 -0
- package/dist/hooks/task-continuation-enforcer/types.d.ts +6 -0
- package/dist/hooks/task-edit-guard/constants.d.ts +2 -0
- package/dist/hooks/tasks-todowrite-disabler/constants.d.ts +1 -1
- package/dist/hooks/todo-continuation-enforcer/awaiting-user.test.d.ts +1 -0
- package/dist/hooks/todo-continuation-enforcer/types.d.ts +3 -0
- package/dist/index.js +30326 -29061
- package/dist/matrixx.schema.json +286 -190
- package/dist/mcp/types.d.ts +1 -1
- package/dist/mcp/{grep-app.d.ts → white-rabbit.d.ts} +1 -1
- package/dist/plugin/hooks/create-core-hooks.d.ts +1 -0
- package/dist/plugin/hooks/create-session-hooks.d.ts +2 -1
- package/dist/plugin-handlers/oracle-agent-config-builder.d.ts +2 -1
- package/dist/shared/awaiting-user.d.ts +12 -0
- package/dist/shared/config-errors.d.ts +3 -0
- package/dist/shared/merge-categories.d.ts +0 -4
- package/dist/shared/model-requirements.d.ts +9 -0
- package/dist/shared/task-system-gating.d.ts +10 -0
- package/dist/tools/delegate-task/categories.d.ts +4 -8
- package/dist/tools/delegate-task/complexity-constants.d.ts +10 -11
- package/dist/tools/delegate-task/executor-types.d.ts +9 -1
- package/dist/tools/delegate-task/index.d.ts +1 -1
- package/dist/tools/delegate-task/timing.d.ts +5 -0
- package/dist/tools/delegate-task/types.d.ts +7 -1
- package/dist/tools/index.d.ts +6 -0
- package/dist/tools/plan/constants.d.ts +10 -0
- package/dist/tools/plan/index.d.ts +6 -0
- package/dist/tools/plan/plan-create.d.ts +3 -0
- package/dist/tools/plan/plan-delete.d.ts +3 -0
- package/dist/tools/plan/plan-list.d.ts +3 -0
- package/dist/tools/plan/plan-read.d.ts +3 -0
- package/dist/tools/plan/plan-update.d.ts +3 -0
- package/dist/tools/plan/types.d.ts +28 -0
- package/dist/tools/preset/index.d.ts +1 -0
- package/dist/tools/preset/tools.d.ts +7 -0
- package/dist/tools/task/constants.d.ts +6 -0
- package/dist/tools/task/types.d.ts +2 -0
- package/package.json +1 -1
- package/dist/config/presets.d.ts +0 -4
- package/dist/config/resolve-tiers.d.ts +0 -32
- package/dist/features/builtin-commands/templates/profile.d.ts +0 -1
- package/dist/shared/model-tiers.d.ts +0 -31
- package/dist/shared/tier-resolver.d.ts +0 -26
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export declare const AWAITING_USER_SUPPRESS_MS: number;
|
|
2
|
+
export interface AwaitingUserState {
|
|
3
|
+
awaitingUser?: boolean;
|
|
4
|
+
awaitingUserSince?: number;
|
|
5
|
+
}
|
|
6
|
+
export declare function isAwaitingUserState(state: unknown): boolean;
|
|
7
|
+
export declare function markAwaitingUser(state: unknown, now?: number): void;
|
|
8
|
+
export declare function clearAwaitingUser(state: unknown): void;
|
|
9
|
+
export declare function hasPendingQuestionMessage(messages: Array<unknown>): boolean;
|
|
10
|
+
export declare function isAwaitingUser(state: unknown, messages?: Array<unknown>): boolean;
|
|
11
|
+
export declare function getToolName(properties: Record<string, unknown> | undefined): string | undefined;
|
|
12
|
+
export declare function isQuestionTool(properties: Record<string, unknown> | undefined): boolean;
|
|
@@ -2,6 +2,9 @@ export type ConfigLoadError = {
|
|
|
2
2
|
path: string;
|
|
3
3
|
error: string;
|
|
4
4
|
};
|
|
5
|
+
export declare class ConfigError extends Error {
|
|
6
|
+
constructor(message: string);
|
|
7
|
+
}
|
|
5
8
|
export declare function getConfigLoadErrors(): ConfigLoadError[];
|
|
6
9
|
export declare function clearConfigLoadErrors(): void;
|
|
7
10
|
export declare function addConfigLoadError(error: ConfigLoadError): void;
|
|
@@ -2,9 +2,5 @@ import type { CategoriesConfig, CategoryConfig } from "../config/schema";
|
|
|
2
2
|
/**
|
|
3
3
|
* Merge default and user categories, filtering out disabled ones.
|
|
4
4
|
* Single source of truth for category merging across the codebase.
|
|
5
|
-
*
|
|
6
|
-
* The built-in `DEFAULT_CATEGORIES` registry is now tier-based. Before
|
|
7
|
-
* returning, the tier fields are resolved against the live provider cache
|
|
8
|
-
* (or the static fallback) so callers always see concrete `model:` strings.
|
|
9
5
|
*/
|
|
10
6
|
export declare function mergeCategories(userCategories?: CategoriesConfig): Record<string, CategoryConfig>;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { type ModelRequirements } from "../config/schema/model-config";
|
|
1
2
|
export type FallbackEntry = {
|
|
2
3
|
providers: string[];
|
|
3
4
|
model: string;
|
|
@@ -10,5 +11,13 @@ export type ModelRequirement = {
|
|
|
10
11
|
requiresAnyModel?: boolean;
|
|
11
12
|
requiresProvider?: string[];
|
|
12
13
|
};
|
|
14
|
+
export declare const DEFAULT_AGENT_MODEL_REQUIREMENTS: Record<string, ModelRequirement>;
|
|
15
|
+
export declare const DEFAULT_CATEGORY_MODEL_REQUIREMENTS: Record<string, ModelRequirement>;
|
|
13
16
|
export declare const AGENT_MODEL_REQUIREMENTS: Record<string, ModelRequirement>;
|
|
14
17
|
export declare const CATEGORY_MODEL_REQUIREMENTS: Record<string, ModelRequirement>;
|
|
18
|
+
export declare function getAgentModelRequirements(config?: {
|
|
19
|
+
modelRequirements?: ModelRequirements;
|
|
20
|
+
} | null): Record<string, ModelRequirement>;
|
|
21
|
+
export declare function getCategoryModelRequirements(config?: {
|
|
22
|
+
modelRequirements?: ModelRequirements;
|
|
23
|
+
} | null): Record<string, ModelRequirement>;
|
|
@@ -1,3 +1,13 @@
|
|
|
1
1
|
import type { MatrixxConfig } from "../config/schema";
|
|
2
|
+
import type { TasksConfig } from "../config/schema/tasks";
|
|
2
3
|
export declare const TASK_SYSTEM_DEFAULT: true;
|
|
4
|
+
export type ResolvedTasksConfig = Required<Pick<TasksConfig, "enabled" | "scope" | "session_scoped">> & Pick<TasksConfig, "storage_path" | "task_list_id" | "stale_after_hours" | "pollTimeoutMs">;
|
|
5
|
+
/**
|
|
6
|
+
* Merge the canonical `tasks` section with legacy locations.
|
|
7
|
+
* Explicit `tasks.*` always wins; legacy keys fill the gaps:
|
|
8
|
+
* `experimental.task_system` / `new_task_system_enabled` → enabled,
|
|
9
|
+
* `morpheus.tasks.*` → same-named key, `task.pollTimeoutMs` → pollTimeoutMs.
|
|
10
|
+
* Pure derivation, no mutation — safe to call on every read.
|
|
11
|
+
*/
|
|
12
|
+
export declare function resolveTasksConfig(config: Partial<MatrixxConfig> | undefined | null): ResolvedTasksConfig;
|
|
3
13
|
export declare function isTaskSystemEnabled(config: Partial<MatrixxConfig> | undefined | null): boolean;
|
|
@@ -1,11 +1,12 @@
|
|
|
1
|
-
import type { CategoriesConfig, CategoryConfig } from "../../config/schema";
|
|
2
|
-
import type { TierResolverContext } from "../../shared/tier-resolver";
|
|
1
|
+
import type { CategoriesConfig, CategoryConfig, ModelPresetEntry, ModelRequirements } from "../../config/schema";
|
|
3
2
|
interface ResolveCategoryConfigOptions {
|
|
4
3
|
userCategories?: CategoriesConfig;
|
|
5
4
|
inheritedModel?: string;
|
|
6
5
|
systemDefaultModel?: string;
|
|
7
6
|
availableModels?: Set<string>;
|
|
8
|
-
|
|
7
|
+
modelRequirements?: ModelRequirements;
|
|
8
|
+
/** Preset entry resolved at call time (session overlay > config active_preset). */
|
|
9
|
+
presetEntry?: ModelPresetEntry;
|
|
9
10
|
}
|
|
10
11
|
interface ResolveCategoryConfigResult {
|
|
11
12
|
config: CategoryConfig;
|
|
@@ -16,11 +17,6 @@ interface ResolveCategoryConfigResult {
|
|
|
16
17
|
/**
|
|
17
18
|
* Resolve the configuration for a given category name.
|
|
18
19
|
* Merges default and user configurations, handles model resolution.
|
|
19
|
-
*
|
|
20
|
-
* Tier resolution: both `userConfig.tier` and `defaultConfig.tier` are
|
|
21
|
-
* resolved against the live provider list (`tierContext`). An explicit
|
|
22
|
-
* `userConfig.model` always wins; an explicit `userConfig.tier` wins
|
|
23
|
-
* over the default tier; otherwise the default tier is used.
|
|
24
20
|
*/
|
|
25
21
|
export declare function resolveCategoryConfig(categoryName: string, options: ResolveCategoryConfigOptions): ResolveCategoryConfigResult | null;
|
|
26
22
|
export {};
|
|
@@ -1,24 +1,23 @@
|
|
|
1
1
|
import type { ComplexityLevel } from "./complexity-types";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
*/
|
|
7
|
-
export declare const BUILTIN_COMPLEXITY_DOWNGRADES: Record<string, Partial<Record<ComplexityLevel, string>>>;
|
|
2
|
+
export type ComplexityDowngradesConfig = Record<string, Record<string, string>>;
|
|
3
|
+
export type ComplexityConfigHolder = {
|
|
4
|
+
complexityDowngrades?: ComplexityDowngradesConfig;
|
|
5
|
+
};
|
|
8
6
|
/**
|
|
9
7
|
* Resolve the model for a given category and complexity level.
|
|
10
8
|
*
|
|
11
|
-
*
|
|
12
|
-
*
|
|
13
|
-
*
|
|
9
|
+
* Config-driven: no built-in literals. Downgrade map is resolved as:
|
|
10
|
+
* userDowngrades ?? config.complexityDowngrades?.[category] ?? {}
|
|
11
|
+
* If no entry for this complexity, returns original (no downgrade).
|
|
14
12
|
*
|
|
15
13
|
* @param category - The task category name
|
|
16
14
|
* @param complexity - The complexity level (1-5)
|
|
17
15
|
* @param originalModel - The currently resolved model string
|
|
18
|
-
* @param userDowngrades - Optional per-category user override from CategoryConfig
|
|
16
|
+
* @param userDowngrades - Optional per-category user override from CategoryConfig.complexity_downgrades
|
|
17
|
+
* @param config - Optional holder with global complexityDowngrades
|
|
19
18
|
* @returns The model to use and whether a downgrade was applied
|
|
20
19
|
*/
|
|
21
|
-
export declare function resolveComplexityModel(category: string, complexity: ComplexityLevel, originalModel: string, userDowngrades?: Record<string, string
|
|
20
|
+
export declare function resolveComplexityModel(category: string, complexity: ComplexityLevel, originalModel: string, userDowngrades?: Record<string, string>, config?: ComplexityConfigHolder | ComplexityDowngradesConfig): {
|
|
22
21
|
model: string;
|
|
23
22
|
downgraded: boolean;
|
|
24
23
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { AgentOverrides, BrowserAutomationProvider, CategoriesConfig } from "../../config/schema";
|
|
1
|
+
import type { AgentOverrides, BrowserAutomationProvider, CategoriesConfig, ComplexityDowngrades, ModelPresets, ModelRequirements } from "../../config/schema";
|
|
2
2
|
import type { BackgroundManager } from "../../features/background-agent";
|
|
3
3
|
import type { OpencodeClient } from "./types";
|
|
4
4
|
export interface ExecutorContext {
|
|
@@ -10,6 +10,14 @@ export interface ExecutorContext {
|
|
|
10
10
|
globalModel?: string;
|
|
11
11
|
browserProvider?: BrowserAutomationProvider;
|
|
12
12
|
agentOverrides?: AgentOverrides;
|
|
13
|
+
modelRequirements?: ModelRequirements;
|
|
14
|
+
complexityDowngrades?: ComplexityDowngrades;
|
|
15
|
+
/** Named model presets from plugin config (`model_presets`). */
|
|
16
|
+
modelPresets?: ModelPresets;
|
|
17
|
+
/** Active preset name from plugin config (`active_preset`). */
|
|
18
|
+
activePreset?: string;
|
|
19
|
+
/** Invoking (parent) session ID — its preset overlay propagates to delegated tasks. */
|
|
20
|
+
sessionID?: string;
|
|
13
21
|
onSyncSessionCreated?: (event: {
|
|
14
22
|
sessionID: string;
|
|
15
23
|
parentID: string;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export {
|
|
1
|
+
export { resolveComplexityModel } from "./complexity-constants";
|
|
2
2
|
export { autoScoreComplexity } from "./complexity-scorer";
|
|
3
3
|
export type { ComplexityInput, ComplexityLevel } from "./complexity-types";
|
|
4
4
|
export * from "./constants";
|
|
@@ -8,4 +8,9 @@ export declare function getTimingConfig(): {
|
|
|
8
8
|
SESSION_CONTINUATION_STABILITY_MS: number;
|
|
9
9
|
};
|
|
10
10
|
export declare function __resetTimingConfig(): void;
|
|
11
|
+
/**
|
|
12
|
+
* Set poll timeout from plugin config. Called during plugin initialization.
|
|
13
|
+
* Accepts a value in milliseconds; falls back to 10 min default.
|
|
14
|
+
*/
|
|
15
|
+
export declare function setPollTimeoutMs(ms: number): void;
|
|
11
16
|
export declare function __setTimingConfig(overrides: Partial<ReturnType<typeof getTimingConfig>>): void;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { PluginInput } from "@opencode-ai/plugin";
|
|
2
2
|
import type { AvailableCategory, AvailableSkill } from "../../agents/dynamic-agent-prompt-builder";
|
|
3
|
-
import type { AgentOverrides, BrowserAutomationProvider, CategoriesConfig } from "../../config/schema";
|
|
3
|
+
import type { AgentOverrides, BrowserAutomationProvider, CategoriesConfig, ComplexityDowngrades, ModelPresets, ModelRequirements } from "../../config/schema";
|
|
4
4
|
import type { BackgroundManager } from "../../features/background-agent";
|
|
5
5
|
export type OpencodeClient = PluginInput["client"];
|
|
6
6
|
export interface DelegateTaskArgs {
|
|
@@ -69,6 +69,12 @@ export interface DelegateTaskToolOptions {
|
|
|
69
69
|
availableCategories?: AvailableCategory[];
|
|
70
70
|
availableSkills?: AvailableSkill[];
|
|
71
71
|
agentOverrides?: AgentOverrides;
|
|
72
|
+
modelRequirements?: ModelRequirements;
|
|
73
|
+
complexityDowngrades?: ComplexityDowngrades;
|
|
74
|
+
/** Named model presets from plugin config (`model_presets`). */
|
|
75
|
+
modelPresets?: ModelPresets;
|
|
76
|
+
/** Active preset name from plugin config (`active_preset`). */
|
|
77
|
+
activePreset?: string;
|
|
72
78
|
onSyncSessionCreated?: (event: SyncSessionCreatedEvent) => Promise<void>;
|
|
73
79
|
}
|
|
74
80
|
export interface BuildSystemContentInput {
|
package/dist/tools/index.d.ts
CHANGED
|
@@ -9,6 +9,12 @@ export { createGrepTools } from "./grep";
|
|
|
9
9
|
export { createHandoffTools } from "./handoff";
|
|
10
10
|
export { interactive_bash, startBackgroundCheck as startTmuxCheck } from "./interactive-bash";
|
|
11
11
|
export { createPdfExtractFiguresTool } from "./pdf-extract-figures";
|
|
12
|
+
export { createPlanCreateTool } from "./plan/plan-create";
|
|
13
|
+
export { createPlanDeleteTool } from "./plan/plan-delete";
|
|
14
|
+
export { createPlanListTool } from "./plan/plan-list";
|
|
15
|
+
export { createPlanReadTool } from "./plan/plan-read";
|
|
16
|
+
export { createPlanUpdateTool } from "./plan/plan-update";
|
|
17
|
+
export { createPresetTool } from "./preset";
|
|
12
18
|
export { createSessionManagerTools } from "./session-manager";
|
|
13
19
|
export { sessionExists } from "./session-manager/storage";
|
|
14
20
|
export { createSkillTool } from "./skill";
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Plan Tool Constants
|
|
3
|
+
* Reuses mission-state storage caps with strict scoping for .matrixx/plans/*.md
|
|
4
|
+
*/
|
|
5
|
+
export declare const PLANS_DIR = ".matrixx/plans";
|
|
6
|
+
export declare const MAX_PLAN_FILE_BYTES = 102400;
|
|
7
|
+
export declare const PLAN_FILENAME_KEBAB_REGEX: RegExp;
|
|
8
|
+
export declare const PLAN_BASENAME_KEBAB_REGEX: RegExp;
|
|
9
|
+
export declare const META_TAG_PREFIX = "<!-- plan-persister:";
|
|
10
|
+
export declare const META_TAG_SUFFIX = "-->";
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export { MAX_PLAN_FILE_BYTES, PLAN_FILENAME_KEBAB_REGEX, PLANS_DIR } from "./constants";
|
|
2
|
+
export { createPlanCreateTool } from "./plan-create";
|
|
3
|
+
export { createPlanDeleteTool } from "./plan-delete";
|
|
4
|
+
export { createPlanListTool } from "./plan-list";
|
|
5
|
+
export { createPlanReadTool } from "./plan-read";
|
|
6
|
+
export { createPlanUpdateTool } from "./plan-update";
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import type { RawHashlineEdit } from "../hashline-edit/normalize-edits";
|
|
2
|
+
export declare function resolveDirectory(contextDirectory: unknown, ctxDirectory: unknown): string;
|
|
3
|
+
export declare function validatePlanFilePath(filePath: string, directory: string): {
|
|
4
|
+
resolved: string;
|
|
5
|
+
} | {
|
|
6
|
+
error: string;
|
|
7
|
+
};
|
|
8
|
+
export interface PlanCreateArgs {
|
|
9
|
+
filePath: string;
|
|
10
|
+
content: string;
|
|
11
|
+
}
|
|
12
|
+
export interface PlanReadArgs {
|
|
13
|
+
filePath: string;
|
|
14
|
+
}
|
|
15
|
+
export interface PlanUpdateArgs {
|
|
16
|
+
filePath: string;
|
|
17
|
+
edits: RawHashlineEdit[];
|
|
18
|
+
}
|
|
19
|
+
export interface PlanDeleteArgs {
|
|
20
|
+
filePath: string;
|
|
21
|
+
}
|
|
22
|
+
export interface PlanInfo {
|
|
23
|
+
fileName: string;
|
|
24
|
+
filePath: string;
|
|
25
|
+
mtime: string;
|
|
26
|
+
mtimeMs: number;
|
|
27
|
+
size: number;
|
|
28
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { createPresetTool } from "./tools";
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { type ToolDefinition } from "@opencode-ai/plugin/tool";
|
|
2
|
+
import type { MatrixxConfig } from "../../config";
|
|
3
|
+
export interface PresetToolOptions {
|
|
4
|
+
pluginConfig?: MatrixxConfig;
|
|
5
|
+
directory?: string;
|
|
6
|
+
}
|
|
7
|
+
export declare function createPresetTool(options?: PresetToolOptions): Record<string, ToolDefinition>;
|
|
@@ -1 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Task ID format: `T-` followed by dash-separated alphanumeric segments.
|
|
3
|
+
* Rejects truncated/empty IDs ("T-"), trailing dashes ("T-abc-"), and
|
|
4
|
+
* double dashes ("T-a--b"). Matches generateTaskId() output (T-{uuid}).
|
|
5
|
+
*/
|
|
1
6
|
export declare const TASK_ID_PATTERN: RegExp;
|
|
7
|
+
export declare const DEDUP_WINDOW_MS: number;
|
|
@@ -6,6 +6,8 @@ export declare const TaskStatusSchema: z.ZodEnum<{
|
|
|
6
6
|
in_progress: "in_progress";
|
|
7
7
|
}>;
|
|
8
8
|
export type TaskStatus = z.infer<typeof TaskStatusSchema>;
|
|
9
|
+
/** Task ID must match T-{uuid}-style format (rejects truncated IDs like "T-"). */
|
|
10
|
+
export declare const TaskIdSchema: z.ZodString;
|
|
9
11
|
export declare const TaskObjectSchema: z.ZodObject<{
|
|
10
12
|
id: z.ZodString;
|
|
11
13
|
subject: z.ZodString;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "opencode-matrixx",
|
|
3
|
-
"version": "2.6.
|
|
3
|
+
"version": "2.6.5",
|
|
4
4
|
"description": "The Best AI Agent Harness - Batteries-Included OpenCode Plugin with Multi-Model Orchestration, Parallel Background Agents, and Crafted LSP/AST Tools",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
package/dist/config/presets.d.ts
DELETED
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import type { MatrixxConfig } from "./schema/matrixx-config";
|
|
2
|
-
export declare const PRESET_NAMES: readonly ["minimal", "balanced", "performance", "frontier"];
|
|
3
|
-
export type PresetName = (typeof PRESET_NAMES)[number];
|
|
4
|
-
export declare function expandPreset(preset: PresetName): MatrixxConfig;
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import { type TierResolverContext } from "../shared/tier-resolver";
|
|
2
|
-
import type { MatrixxConfig } from "./schema/matrixx-config";
|
|
3
|
-
interface WithTier {
|
|
4
|
-
model?: string;
|
|
5
|
-
tier?: string;
|
|
6
|
-
}
|
|
7
|
-
/**
|
|
8
|
-
* Walk a merged MatrixxConfig and resolve any `tier: "..."` fields to concrete
|
|
9
|
-
* `model: "..."` strings. The result is a new config object with the `tier`
|
|
10
|
-
* fields cleared (so downstream code never re-resolves them).
|
|
11
|
-
*
|
|
12
|
-
* Precedence (per agent/category):
|
|
13
|
-
* 1. Explicit `model` — kept as-is.
|
|
14
|
-
* 2. Explicit `tier` — resolved against the live provider list.
|
|
15
|
-
* 3. `default_tier` (top-level) — applied to any agent/category without
|
|
16
|
-
* a `model` or `tier` override, then resolved.
|
|
17
|
-
*
|
|
18
|
-
* If a tier cannot be resolved, the entry is left with `tier` set and `model`
|
|
19
|
-
* undefined. The downstream `resolveModelPipeline` will fall through to
|
|
20
|
-
* category defaults and the system default as a last resort.
|
|
21
|
-
*/
|
|
22
|
-
export declare function resolveTiersInConfig(config: MatrixxConfig, ctx: TierResolverContext): MatrixxConfig;
|
|
23
|
-
/**
|
|
24
|
-
* Resolve tier fields in a category registry (e.g. `DEFAULT_CATEGORIES`) and
|
|
25
|
-
* return a new object with `tier` cleared and `model` set where the tier
|
|
26
|
-
* resolved. Entries that already have a concrete `model` are passed through.
|
|
27
|
-
* Used at config load time to pre-resolve the built-in defaults so that
|
|
28
|
-
* downstream code (createBuiltinAgents, buildAgent) only ever sees model
|
|
29
|
-
* strings.
|
|
30
|
-
*/
|
|
31
|
-
export declare function resolveTiersInCategoryRegistry(registry: Record<string, WithTier | undefined>, ctx: TierResolverContext): Record<string, WithTier>;
|
|
32
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
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,31 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Tier registry — abstract model classifications resolved against the live provider list.
|
|
3
|
-
*
|
|
4
|
-
* Tiers are matched by regex against "provider/model" strings, with a `providerPriority`
|
|
5
|
-
* list to choose between providers when multiple match. A `staticFallback` is used at
|
|
6
|
-
* first run when the live provider list is not yet available.
|
|
7
|
-
*
|
|
8
|
-
* Adding a new model does NOT require code changes — the regex patterns intentionally
|
|
9
|
-
* match model families (e.g. `claude-opus`) so a new opus-4-7 model is picked up
|
|
10
|
-
* automatically.
|
|
11
|
-
*/
|
|
12
|
-
export type TierName = "free" | "fast" | "standard" | "premium" | "frontier";
|
|
13
|
-
export interface TierSpec {
|
|
14
|
-
name: TierName;
|
|
15
|
-
/** Provider priority — first provider with a matching model wins. */
|
|
16
|
-
providerPriority: string[];
|
|
17
|
-
/** Regex tested against each "provider/model" string in the live provider list. */
|
|
18
|
-
modelPattern: RegExp;
|
|
19
|
-
/** Tier to recurse into if this tier cannot be satisfied. */
|
|
20
|
-
fallbackTier?: TierName;
|
|
21
|
-
/** Static fallbacks used at first run when the live provider list is empty
|
|
22
|
-
* but the connected providers cache already lists which providers are reachable. */
|
|
23
|
-
staticFallback: {
|
|
24
|
-
providers: string[];
|
|
25
|
-
model: string;
|
|
26
|
-
variant?: string;
|
|
27
|
-
}[];
|
|
28
|
-
}
|
|
29
|
-
export declare const TIER_SPECS: Record<TierName, TierSpec>;
|
|
30
|
-
export declare const TIER_NAMES: TierName[];
|
|
31
|
-
export declare function parseTierReference(value: string | undefined | null): TierName | null;
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import { parseTierReference, type TierName } from "./model-tiers";
|
|
2
|
-
export interface TierResolverContext {
|
|
3
|
-
availableModels: Set<string>;
|
|
4
|
-
connectedProviders: string[] | null;
|
|
5
|
-
}
|
|
6
|
-
export type TierProvenance = "tier-resolved" | "tier-static-fallback";
|
|
7
|
-
export interface TierResolutionResult {
|
|
8
|
-
model: string;
|
|
9
|
-
provenance: TierProvenance;
|
|
10
|
-
tier: TierName;
|
|
11
|
-
}
|
|
12
|
-
/**
|
|
13
|
-
* Resolve a tier alias to a concrete "provider/model" string.
|
|
14
|
-
*
|
|
15
|
-
* Strategy:
|
|
16
|
-
* 1. Live resolution: walk `providerPriority`, test `modelPattern` against
|
|
17
|
-
* each `provider/model` in the available set.
|
|
18
|
-
* 2. Static fallback: pick the first static fallback whose provider is
|
|
19
|
-
* connected (used at first run when the live cache is cold).
|
|
20
|
-
* 3. Recurse into `fallbackTier` if defined.
|
|
21
|
-
*
|
|
22
|
-
* Returns null when no match is possible (no live models, no static fallback
|
|
23
|
-
* available, no fallback tier).
|
|
24
|
-
*/
|
|
25
|
-
export declare function resolveTier(tier: TierName, ctx: TierResolverContext): TierResolutionResult | null;
|
|
26
|
-
export { parseTierReference };
|