opencode-matrixx 2.6.4 → 2.6.6
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/oracle/behavioral-summary.d.ts +1 -1
- package/dist/agents/oracle/high-accuracy-mode.d.ts +1 -1
- package/dist/agents/oracle/interview-mode.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 +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 +499 -64
- package/dist/config/index.d.ts +0 -1
- package/dist/config/migrations/model-migration.d.ts +1 -2
- 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/hooks.d.ts +1 -0
- package/dist/config/schema/matrixx-config.d.ts +29 -144
- package/dist/config/schema/model-config.d.ts +0 -22
- package/dist/config/schema/model-presets.d.ts +40 -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 +3 -0
- package/dist/create-hooks.d.ts +1 -0
- package/dist/features/background-agent/handle-index.d.ts +63 -0
- package/dist/features/background-agent/handle-index.test.d.ts +1 -0
- package/dist/features/background-agent/index.d.ts +1 -0
- package/dist/features/background-agent/manager-handles.test.d.ts +1 -0
- package/dist/features/background-agent/manager.d.ts +12 -0
- package/dist/features/builtin-commands/templates/preset.d.ts +1 -0
- package/dist/features/builtin-commands/types.d.ts +1 -1
- 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 +6 -0
- package/dist/features/task-storage/types.d.ts +2 -0
- package/dist/hooks/background-task-blocker/hook.d.ts +10 -0
- package/dist/hooks/background-task-blocker/index.d.ts +1 -0
- package/dist/hooks/index.d.ts +1 -0
- package/dist/hooks/json-error-recovery/hook.d.ts +1 -1
- package/dist/hooks/task-continuation-enforcer/continuation-injection.test.d.ts +1 -0
- package/dist/hooks/task-continuation-enforcer/staleness.d.ts +7 -1
- package/dist/hooks/task-continuation-enforcer/todo.d.ts +8 -0
- package/dist/hooks/task-continuation-enforcer/todo.test.d.ts +1 -0
- package/dist/hooks/tasks-todowrite-disabler/constants.d.ts +1 -1
- package/dist/index.js +923 -624
- package/dist/matrixx.schema.json +114 -244
- 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-tool-guard-hooks.d.ts +2 -1
- package/dist/shared/config-errors.d.ts +3 -0
- package/dist/shared/context-mode-prompt.d.ts +12 -0
- package/dist/shared/context-mode-prompt.test.d.ts +1 -0
- package/dist/shared/index.d.ts +1 -0
- package/dist/shared/merge-categories.d.ts +1 -16
- package/dist/shared/task-system-gating.d.ts +10 -0
- package/dist/tools/background-task/constants.d.ts +0 -1
- package/dist/tools/background-task/index.d.ts +1 -1
- package/dist/tools/background-task/tools.d.ts +0 -1
- package/dist/tools/background-task/types.d.ts +0 -5
- package/dist/tools/delegate-task/categories.d.ts +3 -18
- package/dist/tools/delegate-task/complexity-constants.d.ts +2 -7
- package/dist/tools/delegate-task/executor-types.d.ts +7 -2
- package/dist/tools/delegate-task/sync-task.test.d.ts +1 -0
- package/dist/tools/delegate-task/timing.d.ts +5 -0
- package/dist/tools/delegate-task/timing.test.d.ts +1 -0
- package/dist/tools/delegate-task/types.d.ts +5 -2
- package/dist/tools/index.d.ts +1 -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 +1 -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 -44
- package/dist/shared/tier-resolver.d.ts +0 -26
- package/dist/tools/background-task/create-background-task.d.ts +0 -3
|
@@ -1,22 +1,12 @@
|
|
|
1
|
-
import type { CategoriesConfig, CategoryConfig, ModelRequirements } 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
|
-
tierContext?: TierResolverContext;
|
|
9
7
|
modelRequirements?: ModelRequirements;
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
modelPattern: string;
|
|
13
|
-
fallbackTier?: string;
|
|
14
|
-
fallback?: {
|
|
15
|
-
providers: string[];
|
|
16
|
-
model: string;
|
|
17
|
-
variant?: string;
|
|
18
|
-
}[];
|
|
19
|
-
}>;
|
|
8
|
+
/** Preset entry resolved at call time (session overlay > config active_preset). */
|
|
9
|
+
presetEntry?: ModelPresetEntry;
|
|
20
10
|
}
|
|
21
11
|
interface ResolveCategoryConfigResult {
|
|
22
12
|
config: CategoryConfig;
|
|
@@ -27,11 +17,6 @@ interface ResolveCategoryConfigResult {
|
|
|
27
17
|
/**
|
|
28
18
|
* Resolve the configuration for a given category name.
|
|
29
19
|
* Merges default and user configurations, handles model resolution.
|
|
30
|
-
*
|
|
31
|
-
* Tier resolution: both `userConfig.tier` and `defaultConfig.tier` are
|
|
32
|
-
* resolved against the live provider list (`tierContext`). An explicit
|
|
33
|
-
* `userConfig.model` always wins; an explicit `userConfig.tier` wins
|
|
34
|
-
* over the default tier; otherwise the default tier is used.
|
|
35
20
|
*/
|
|
36
21
|
export declare function resolveCategoryConfig(categoryName: string, options: ResolveCategoryConfigOptions): ResolveCategoryConfigResult | null;
|
|
37
22
|
export {};
|
|
@@ -1,10 +1,7 @@
|
|
|
1
|
-
import type { Tiers } from "../../config/schema";
|
|
2
|
-
import { type TierResolverContext } from "../../shared/tier-resolver";
|
|
3
1
|
import type { ComplexityLevel } from "./complexity-types";
|
|
4
2
|
export type ComplexityDowngradesConfig = Record<string, Record<string, string>>;
|
|
5
3
|
export type ComplexityConfigHolder = {
|
|
6
4
|
complexityDowngrades?: ComplexityDowngradesConfig;
|
|
7
|
-
tiers?: Tiers;
|
|
8
5
|
};
|
|
9
6
|
/**
|
|
10
7
|
* Resolve the model for a given category and complexity level.
|
|
@@ -12,17 +9,15 @@ export type ComplexityConfigHolder = {
|
|
|
12
9
|
* Config-driven: no built-in literals. Downgrade map is resolved as:
|
|
13
10
|
* userDowngrades ?? config.complexityDowngrades?.[category] ?? {}
|
|
14
11
|
* If no entry for this complexity, returns original (no downgrade).
|
|
15
|
-
* If value starts with "tier:", resolves via live tier resolver.
|
|
16
12
|
*
|
|
17
13
|
* @param category - The task category name
|
|
18
14
|
* @param complexity - The complexity level (1-5)
|
|
19
15
|
* @param originalModel - The currently resolved model string
|
|
20
16
|
* @param userDowngrades - Optional per-category user override from CategoryConfig.complexity_downgrades
|
|
21
|
-
* @param config - Optional holder with global complexityDowngrades
|
|
22
|
-
* @param tierContext - Optional live provider context for tier: resolution
|
|
17
|
+
* @param config - Optional holder with global complexityDowngrades
|
|
23
18
|
* @returns The model to use and whether a downgrade was applied
|
|
24
19
|
*/
|
|
25
|
-
export declare function resolveComplexityModel(category: string, complexity: ComplexityLevel, originalModel: string, userDowngrades?: Record<string, string>, config?: ComplexityConfigHolder | ComplexityDowngradesConfig
|
|
20
|
+
export declare function resolveComplexityModel(category: string, complexity: ComplexityLevel, originalModel: string, userDowngrades?: Record<string, string>, config?: ComplexityConfigHolder | ComplexityDowngradesConfig): {
|
|
26
21
|
model: string;
|
|
27
22
|
downgraded: boolean;
|
|
28
23
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { AgentOverrides, BrowserAutomationProvider, CategoriesConfig, ComplexityDowngrades,
|
|
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 {
|
|
@@ -12,7 +12,12 @@ export interface ExecutorContext {
|
|
|
12
12
|
agentOverrides?: AgentOverrides;
|
|
13
13
|
modelRequirements?: ModelRequirements;
|
|
14
14
|
complexityDowngrades?: ComplexityDowngrades;
|
|
15
|
-
|
|
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;
|
|
16
21
|
onSyncSessionCreated?: (event: {
|
|
17
22
|
sessionID: string;
|
|
18
23
|
parentID: string;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -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;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -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, ComplexityDowngrades,
|
|
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 {
|
|
@@ -71,7 +71,10 @@ export interface DelegateTaskToolOptions {
|
|
|
71
71
|
agentOverrides?: AgentOverrides;
|
|
72
72
|
modelRequirements?: ModelRequirements;
|
|
73
73
|
complexityDowngrades?: ComplexityDowngrades;
|
|
74
|
-
|
|
74
|
+
/** Named model presets from plugin config (`model_presets`). */
|
|
75
|
+
modelPresets?: ModelPresets;
|
|
76
|
+
/** Active preset name from plugin config (`active_preset`). */
|
|
77
|
+
activePreset?: string;
|
|
75
78
|
onSyncSessionCreated?: (event: SyncSessionCreatedEvent) => Promise<void>;
|
|
76
79
|
}
|
|
77
80
|
export interface BuildSystemContentInput {
|
package/dist/tools/index.d.ts
CHANGED
|
@@ -14,6 +14,7 @@ export { createPlanDeleteTool } from "./plan/plan-delete";
|
|
|
14
14
|
export { createPlanListTool } from "./plan/plan-list";
|
|
15
15
|
export { createPlanReadTool } from "./plan/plan-read";
|
|
16
16
|
export { createPlanUpdateTool } from "./plan/plan-update";
|
|
17
|
+
export { createPresetTool } from "./preset";
|
|
17
18
|
export { createSessionManagerTools } from "./session-manager";
|
|
18
19
|
export { sessionExists } from "./session-manager/storage";
|
|
19
20
|
export { createSkillTool } from "./skill";
|
|
@@ -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>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "opencode-matrixx",
|
|
3
|
-
"version": "2.6.
|
|
3
|
+
"version": "2.6.6",
|
|
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, config?: MatrixxConfig): 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,44 +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. Patterns are stored as
|
|
6
|
-
* strings in `config.tiers[].modelPattern` and compiled at runtime via
|
|
7
|
-
* `new RegExp` with try/catch (invalid -> never matches). No hardcoded
|
|
8
|
-
* `provider` or model literals — all specs are config-driven via
|
|
9
|
-
* `MatrixxConfig.tiers`. When config is empty, factories return empty/undefined
|
|
10
|
-
* gracefully.
|
|
11
|
-
*/
|
|
12
|
-
export type TierName = string;
|
|
13
|
-
export interface TierSpec {
|
|
14
|
-
name: string;
|
|
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?: string;
|
|
21
|
-
/** Fallbacks used when the live provider list is empty but config provides them. */
|
|
22
|
-
fallback?: {
|
|
23
|
-
providers: string[];
|
|
24
|
-
model: string;
|
|
25
|
-
variant?: string;
|
|
26
|
-
}[];
|
|
27
|
-
}
|
|
28
|
-
export type TiersConfig = Record<string, {
|
|
29
|
-
providerPriority: string[];
|
|
30
|
-
modelPattern: string;
|
|
31
|
-
fallbackTier?: string;
|
|
32
|
-
fallback?: {
|
|
33
|
-
providers: string[];
|
|
34
|
-
model: string;
|
|
35
|
-
variant?: string;
|
|
36
|
-
}[];
|
|
37
|
-
}>;
|
|
38
|
-
export type TierConfigHolder = {
|
|
39
|
-
tiers?: TiersConfig;
|
|
40
|
-
} | null | undefined;
|
|
41
|
-
export declare function buildTierSpecs(config: TierConfigHolder): Record<string, TierSpec>;
|
|
42
|
-
export declare function getTierSpec(tierName: string, config: TierConfigHolder): TierSpec | undefined;
|
|
43
|
-
export declare function getTierNames(config: TierConfigHolder): string[];
|
|
44
|
-
export declare function parseTierReference(value: string | undefined | null, config?: TierConfigHolder): string | null;
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import { type TierConfigHolder } 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: string;
|
|
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 (config-driven, compiled at runtime).
|
|
18
|
-
* 2. Config fallback: pick the first `fallback` whose provider is
|
|
19
|
-
* connected (used at first run when the live cache is cold, user-provided).
|
|
20
|
-
* 3. Recurse into `fallbackTier` if defined.
|
|
21
|
-
*
|
|
22
|
-
* Returns null when no match is possible (no live models, no fallback
|
|
23
|
-
* available, no fallback tier). When config is empty, returns null gracefully.
|
|
24
|
-
*/
|
|
25
|
-
export declare function resolveTier(tier: string, ctx: TierResolverContext, config?: TierConfigHolder): TierResolutionResult | null;
|
|
26
|
-
export declare function parseTierReference(value: string | undefined | null, config?: TierConfigHolder): string | null;
|