@mastra/code-sdk 1.7.3-alpha.0 → 1.8.0-alpha.11
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/agent-connections/ownership.d.ts +1 -0
- package/dist/agent-connections/ownership.d.ts.map +1 -1
- package/dist/agent-connections/ownership.js +42 -26
- package/dist/agent-connections/ownership.js.map +1 -1
- package/dist/agent-connections/registry.d.ts.map +1 -1
- package/dist/agent-connections/registry.js +5 -2
- package/dist/agent-connections/registry.js.map +1 -1
- package/dist/agent-connections/session-advertisement.d.ts +20 -0
- package/dist/agent-connections/session-advertisement.d.ts.map +1 -0
- package/dist/agent-connections/session-advertisement.js +79 -0
- package/dist/agent-connections/session-advertisement.js.map +1 -0
- package/dist/agent-connections/tools.d.ts.map +1 -1
- package/dist/agent-connections/tools.js +26 -8
- package/dist/agent-connections/tools.js.map +1 -1
- package/dist/agents/background-completion-events.d.ts +16 -0
- package/dist/agents/background-completion-events.d.ts.map +1 -0
- package/dist/agents/background-completion-events.js +19 -0
- package/dist/agents/background-completion-events.js.map +1 -0
- package/dist/agents/background-completion.d.ts +9 -0
- package/dist/agents/background-completion.d.ts.map +1 -0
- package/dist/agents/background-completion.js +59 -0
- package/dist/agents/background-completion.js.map +1 -0
- package/dist/agents/mastracode-gateway.d.ts +2 -0
- package/dist/agents/mastracode-gateway.d.ts.map +1 -1
- package/dist/agents/mastracode-gateway.js +29 -10
- package/dist/agents/mastracode-gateway.js.map +1 -1
- package/dist/agents/memory.d.ts +1 -1
- package/dist/agents/memory.d.ts.map +1 -1
- package/dist/agents/memory.js +32 -25
- package/dist/agents/memory.js.map +1 -1
- package/dist/agents/model.d.ts +41 -1
- package/dist/agents/model.d.ts.map +1 -1
- package/dist/agents/model.js +141 -7
- package/dist/agents/model.js.map +1 -1
- package/dist/agents/tool-availability.d.ts +2 -0
- package/dist/agents/tool-availability.d.ts.map +1 -1
- package/dist/agents/tool-availability.js +33 -4
- package/dist/agents/tool-availability.js.map +1 -1
- package/dist/agents/tools.d.ts +1 -1
- package/dist/agents/tools.d.ts.map +1 -1
- package/dist/agents/tools.js +30 -2
- package/dist/agents/tools.js.map +1 -1
- package/dist/agents/workspace.d.ts +2 -1
- package/dist/agents/workspace.d.ts.map +1 -1
- package/dist/agents/workspace.js +3 -3
- package/dist/agents/workspace.js.map +1 -1
- package/dist/auth/account-rotation-processor.d.ts +207 -0
- package/dist/auth/account-rotation-processor.d.ts.map +1 -0
- package/dist/auth/account-rotation-processor.js +669 -0
- package/dist/auth/account-rotation-processor.js.map +1 -0
- package/dist/auth/account-routing-context.d.ts +13 -0
- package/dist/auth/account-routing-context.d.ts.map +1 -0
- package/dist/auth/account-routing-context.js +41 -0
- package/dist/auth/account-routing-context.js.map +1 -0
- package/dist/auth/index.d.ts +1 -0
- package/dist/auth/index.d.ts.map +1 -1
- package/dist/auth/index.js +2 -1
- package/dist/auth/providers/anthropic.d.ts.map +1 -1
- package/dist/auth/providers/anthropic.js +2 -8
- package/dist/auth/providers/anthropic.js.map +1 -1
- package/dist/auth/providers/github-copilot.d.ts.map +1 -1
- package/dist/auth/providers/github-copilot.js +34 -12
- package/dist/auth/providers/github-copilot.js.map +1 -1
- package/dist/auth/providers/kimi-coding.d.ts.map +1 -1
- package/dist/auth/providers/kimi-coding.js +2 -6
- package/dist/auth/providers/kimi-coding.js.map +1 -1
- package/dist/auth/providers/openai-codex.d.ts +3 -1
- package/dist/auth/providers/openai-codex.d.ts.map +1 -1
- package/dist/auth/providers/openai-codex.js +50 -24
- package/dist/auth/providers/openai-codex.js.map +1 -1
- package/dist/auth/providers/xai.d.ts +1 -1
- package/dist/auth/providers/xai.d.ts.map +1 -1
- package/dist/auth/providers/xai.js +36 -16
- package/dist/auth/providers/xai.js.map +1 -1
- package/dist/auth/storage.d.ts +130 -8
- package/dist/auth/storage.d.ts.map +1 -1
- package/dist/auth/storage.js +602 -39
- package/dist/auth/storage.js.map +1 -1
- package/dist/auth/types.d.ts +69 -2
- package/dist/auth/types.d.ts.map +1 -1
- package/dist/goal-signal.d.ts +1 -1
- package/dist/goal-signal.d.ts.map +1 -1
- package/dist/goal-signal.js +1 -1
- package/dist/goal-signal.js.map +1 -1
- package/dist/index.d.ts +4 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +127 -54
- package/dist/index.js.map +1 -1
- package/dist/mcp/config.d.ts +17 -2
- package/dist/mcp/config.d.ts.map +1 -1
- package/dist/mcp/config.js +18 -3
- package/dist/mcp/config.js.map +1 -1
- package/dist/mcp/manager.d.ts +2 -1
- package/dist/mcp/manager.d.ts.map +1 -1
- package/dist/mcp/manager.js +13 -8
- package/dist/mcp/manager.js.map +1 -1
- package/dist/mcp/types.d.ts +15 -3
- package/dist/mcp/types.d.ts.map +1 -1
- package/dist/onboarding/custom-packs.d.ts.map +1 -1
- package/dist/onboarding/custom-packs.js +3 -0
- package/dist/onboarding/custom-packs.js.map +1 -1
- package/dist/onboarding/index.js +1 -1
- package/dist/onboarding/packs.d.ts +44 -0
- package/dist/onboarding/packs.d.ts.map +1 -1
- package/dist/onboarding/packs.js +80 -2
- package/dist/onboarding/packs.js.map +1 -1
- package/dist/onboarding/settings.d.ts +33 -0
- package/dist/onboarding/settings.d.ts.map +1 -1
- package/dist/onboarding/settings.js +88 -8
- package/dist/onboarding/settings.js.map +1 -1
- package/dist/plugin.d.ts +12 -0
- package/dist/plugin.d.ts.map +1 -1
- package/dist/plugin.js.map +1 -1
- package/dist/plugins/loader.d.ts.map +1 -1
- package/dist/plugins/loader.js +2 -1
- package/dist/plugins/loader.js.map +1 -1
- package/dist/providers/claude-max.d.ts.map +1 -1
- package/dist/providers/claude-max.js +4 -5
- package/dist/providers/claude-max.js.map +1 -1
- package/dist/providers/github-copilot.d.ts +1 -1
- package/dist/providers/github-copilot.d.ts.map +1 -1
- package/dist/providers/github-copilot.js +89 -37
- package/dist/providers/github-copilot.js.map +1 -1
- package/dist/providers/kimi-coding.d.ts.map +1 -1
- package/dist/providers/kimi-coding.js +16 -2
- package/dist/providers/kimi-coding.js.map +1 -1
- package/dist/providers/openai-codex.d.ts.map +1 -1
- package/dist/providers/openai-codex.js +42 -27
- package/dist/providers/openai-codex.js.map +1 -1
- package/dist/schema.d.ts +28 -1
- package/dist/schema.d.ts.map +1 -1
- package/dist/schema.js +9 -0
- package/dist/schema.js.map +1 -1
- package/dist/tools/workflows/save-workflow.d.ts +1 -1
- package/dist/tools/workflows/save-workflow.d.ts.map +1 -1
- package/dist/workflows/register-primitives.js +2 -2
- package/dist/workflows/register-primitives.js.map +1 -1
- package/package.json +16 -16
package/dist/onboarding/packs.js
CHANGED
|
@@ -53,6 +53,83 @@ function getBuiltinModePack(packId) {
|
|
|
53
53
|
};
|
|
54
54
|
}
|
|
55
55
|
/**
|
|
56
|
+
* All builtin mode packs regardless of provider access (descriptions use the
|
|
57
|
+
* apikey variant). For resolution-time lookups — fallback chains must resolve
|
|
58
|
+
* even when an access probe is stale; actual auth failures surface through
|
|
59
|
+
* the provider call itself.
|
|
60
|
+
*/
|
|
61
|
+
function listBuiltinModePacks() {
|
|
62
|
+
return BUILTIN_MODE_PACKS.map((pack) => ({
|
|
63
|
+
id: pack.id,
|
|
64
|
+
name: pack.name,
|
|
65
|
+
description: pack.description("apikey"),
|
|
66
|
+
models: { ...pack.models }
|
|
67
|
+
}));
|
|
68
|
+
}
|
|
69
|
+
/** A pack id is known when it is a builtin mode pack or a saved custom pack. */
|
|
70
|
+
function isKnownModePackId(packId, savedCustomPacks = []) {
|
|
71
|
+
if (BUILTIN_MODE_PACKS.some((pack) => pack.id === packId)) return true;
|
|
72
|
+
if (!packId.startsWith("custom:")) return false;
|
|
73
|
+
return savedCustomPacks.some((pack) => typeof pack?.name === "string" && `custom:${pack.name}` === packId);
|
|
74
|
+
}
|
|
75
|
+
/**
|
|
76
|
+
* Drop pack-fallback entries whose source or target pack no longer exists
|
|
77
|
+
* (e.g. a deleted custom pack). Shape validation happens before this; here we
|
|
78
|
+
* only prune dangling references, with the same tolerance the rest of settings
|
|
79
|
+
* parsing uses.
|
|
80
|
+
*/
|
|
81
|
+
function pruneUnknownModePackFallbacks(fallbacks, savedCustomPacks = []) {
|
|
82
|
+
const result = {};
|
|
83
|
+
for (const [packId, fallbackId] of Object.entries(fallbacks)) if (isKnownModePackId(packId, savedCustomPacks) && isKnownModePackId(fallbackId, savedCustomPacks)) result[packId] = fallbackId;
|
|
84
|
+
return result;
|
|
85
|
+
}
|
|
86
|
+
/** Drop preferred-account bindings for missing packs or models no longer used by that pack. */
|
|
87
|
+
function pruneUnknownPackAccountPreferences(preferences, savedCustomPacks = [], modePackOverrides = {}) {
|
|
88
|
+
const packModels = /* @__PURE__ */ new Map();
|
|
89
|
+
for (const pack of listBuiltinModePacks()) packModels.set(pack.id, new Set(Object.values({
|
|
90
|
+
...pack.models,
|
|
91
|
+
...modePackOverrides[pack.id]
|
|
92
|
+
})));
|
|
93
|
+
for (const pack of savedCustomPacks) {
|
|
94
|
+
const models = pack?.models && typeof pack.models === "object" ? pack.models : {};
|
|
95
|
+
packModels.set(`custom:${pack.name}`, new Set(Object.values(models)));
|
|
96
|
+
}
|
|
97
|
+
const result = {};
|
|
98
|
+
for (const [packId, modelPreferences] of Object.entries(preferences)) {
|
|
99
|
+
const models = packModels.get(packId);
|
|
100
|
+
if (!models) continue;
|
|
101
|
+
const validEntries = Object.entries(modelPreferences).filter(([modelId]) => models.has(modelId));
|
|
102
|
+
if (validEntries.length > 0) result[packId] = Object.fromEntries(validEntries);
|
|
103
|
+
}
|
|
104
|
+
return result;
|
|
105
|
+
}
|
|
106
|
+
/**
|
|
107
|
+
* Walk `settings.models.packFallbacks` from `startPackId`, returning the pack
|
|
108
|
+
* ids in cascade order starting with the pack itself. Cycles are allowed but
|
|
109
|
+
* the cascade gets exactly one revisit total (Q15: "full circle then one
|
|
110
|
+
* revisit then surface"): the walk stops when the next link would add a pack
|
|
111
|
+
* already in the chain after the revisit was consumed, or when a link
|
|
112
|
+
* dangles at an unknown pack. An A⇄B cycle therefore yields [A, B, A#2] and
|
|
113
|
+
* stops. This cap is the cycle handling for both the fallback model chain
|
|
114
|
+
* (request time) and the /models picker's chain display.
|
|
115
|
+
*/
|
|
116
|
+
function resolveModePackFallbackChain(fallbacks, startPackId, savedCustomPacks = []) {
|
|
117
|
+
const chain = [startPackId];
|
|
118
|
+
let revisitUsed = false;
|
|
119
|
+
let current = startPackId;
|
|
120
|
+
while (true) {
|
|
121
|
+
const next = fallbacks[current];
|
|
122
|
+
if (!next || !isKnownModePackId(next, savedCustomPacks)) break;
|
|
123
|
+
if (chain.includes(next)) {
|
|
124
|
+
if (revisitUsed) break;
|
|
125
|
+
revisitUsed = true;
|
|
126
|
+
}
|
|
127
|
+
chain.push(next);
|
|
128
|
+
current = next;
|
|
129
|
+
}
|
|
130
|
+
return chain;
|
|
131
|
+
}
|
|
132
|
+
/**
|
|
56
133
|
* Build the list of available mode packs based on which providers the user
|
|
57
134
|
* can actually reach (API key or OAuth login).
|
|
58
135
|
*
|
|
@@ -77,7 +154,8 @@ function getAvailableModePacks(access, savedCustomPacks = []) {
|
|
|
77
154
|
models: {
|
|
78
155
|
build: cp.models.build ?? "",
|
|
79
156
|
plan: cp.models.plan ?? "",
|
|
80
|
-
fast: cp.models.fast ?? ""
|
|
157
|
+
fast: cp.models.fast ?? "",
|
|
158
|
+
...typeof cp.models.memory === "string" && cp.models.memory.length > 0 ? { memory: cp.models.memory } : {}
|
|
81
159
|
}
|
|
82
160
|
});
|
|
83
161
|
const hasCustom = savedCustomPacks.length > 0;
|
|
@@ -177,6 +255,6 @@ function selectPreferredOMPack(access, preferredProviderId) {
|
|
|
177
255
|
}
|
|
178
256
|
const ONBOARDING_VERSION = 1;
|
|
179
257
|
//#endregion
|
|
180
|
-
export { ONBOARDING_VERSION, getAvailableModePacks, getAvailableOmPacks, getBuiltinModePack, resolveProviderOMDefault, selectPreferredOMPack };
|
|
258
|
+
export { ONBOARDING_VERSION, getAvailableModePacks, getAvailableOmPacks, getBuiltinModePack, isKnownModePackId, listBuiltinModePacks, pruneUnknownModePackFallbacks, pruneUnknownPackAccountPreferences, resolveModePackFallbackChain, resolveProviderOMDefault, selectPreferredOMPack };
|
|
181
259
|
|
|
182
260
|
//# sourceMappingURL=packs.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"packs.js","names":[],"sources":["../../src/onboarding/packs.ts"],"sourcesContent":["/**\n * Onboarding \"packs\" — predefined model configurations for each mode.\n *\n * Each pack assigns a default model to the build, plan, and fast modes,\n * plus an OM (observational memory) model.\n */\nimport { DEFAULT_OM_MODEL_ID } from '../constants.js';\n\n// ---------------------------------------------------------------------------\n// Types\n// ---------------------------------------------------------------------------\n\nexport interface ModePack {\n id: string;\n name: string;\n description: string;\n models: {\n build: string;\n plan: string;\n fast: string;\n };\n}\n\nexport interface OMPack {\n id: string;\n name: string;\n description: string;\n modelId: string;\n}\n\ninterface BuiltinOMPack {\n id: string;\n providerId: string;\n name: string;\n modelId: string;\n description: (access: Exclude<ProviderAccessLevel, false>) => string;\n}\n\n/** How a provider is accessed: OAuth subscription, API key, or not at all. */\nexport type ProviderAccessLevel = 'oauth' | 'apikey' | false;\n\n/** Which providers the user has access to and how. */\nexport interface ProviderAccess {\n anthropic: ProviderAccessLevel;\n openai: ProviderAccessLevel;\n cerebras: ProviderAccessLevel;\n google: ProviderAccessLevel;\n deepseek: ProviderAccessLevel;\n 'github-copilot': ProviderAccessLevel;\n [provider: string]: ProviderAccessLevel;\n}\n\n// ---------------------------------------------------------------------------\n// Mode Packs\n// ---------------------------------------------------------------------------\n\ninterface BuiltinModePack extends Omit<ModePack, 'description'> {\n providerId: string;\n description: (access: Exclude<ProviderAccessLevel, false>) => string;\n}\n\nconst BUILTIN_MODE_PACKS: BuiltinModePack[] = [\n {\n id: 'anthropic',\n providerId: 'anthropic',\n name: 'Anthropic',\n description: access =>\n access === 'oauth' ? 'All Anthropic models via Max subscription' : 'All Anthropic models via API key',\n models: {\n build: 'anthropic/claude-fable-5',\n plan: 'anthropic/claude-fable-5',\n fast: 'anthropic/claude-haiku-4-5',\n },\n },\n {\n id: 'openai',\n providerId: 'openai',\n name: 'OpenAI',\n description: access =>\n access === 'oauth' ? 'All OpenAI models via Codex subscription' : 'All OpenAI models via API key',\n models: {\n build: 'openai/gpt-5.6-sol',\n plan: 'openai/gpt-5.6-sol',\n fast: 'openai/gpt-5.4-mini',\n },\n },\n {\n id: 'github-copilot',\n providerId: 'github-copilot',\n name: 'GitHub Copilot',\n description: () => 'GitHub Copilot subscription',\n models: {\n build: 'github-copilot/gpt-4.1',\n plan: 'github-copilot/gemini-2.5-pro',\n fast: 'github-copilot/grok-code-fast-1',\n },\n },\n];\n\nexport function getBuiltinModePack(packId: string): (ModePack & { providerId: string }) | undefined {\n const pack = BUILTIN_MODE_PACKS.find(item => item.id === packId);\n if (!pack) return undefined;\n return {\n id: pack.id,\n providerId: pack.providerId,\n name: pack.name,\n description: pack.description('apikey'),\n models: { ...pack.models },\n };\n}\n\n/**\n * Build the list of available mode packs based on which providers the user\n * can actually reach (API key or OAuth login).\n *\n * @param savedCustomPacks Previously saved custom packs from settings.json.\n * These are inserted before the \"New Custom\" option.\n */\nexport function getAvailableModePacks(\n access: ProviderAccess,\n savedCustomPacks: Array<{ name: string; models: Record<string, string> }> = [],\n): ModePack[] {\n const packs: ModePack[] = BUILTIN_MODE_PACKS.flatMap(pack => {\n const providerAccess = access[pack.providerId];\n if (!providerAccess) return [];\n return [\n {\n id: pack.id,\n name: pack.name,\n description: pack.description(providerAccess),\n models: { ...pack.models },\n },\n ];\n });\n\n // Saved custom packs — inserted before the \"New Custom\" option\n for (const cp of savedCustomPacks) {\n packs.push({\n id: `custom:${cp.name}`,\n name: cp.name,\n description: 'Saved custom pack',\n models: {\n build: cp.models.build ?? '',\n plan: cp.models.plan ?? '',\n fast: cp.models.fast ?? '',\n },\n });\n }\n\n // New Custom — always available; user picks each model individually\n const hasCustom = savedCustomPacks.length > 0;\n packs.push({\n id: 'custom',\n name: hasCustom ? 'New Custom' : 'Custom',\n description: 'Choose a model for each mode',\n models: { build: '', plan: '', fast: '' },\n });\n\n return packs;\n}\n\n// ---------------------------------------------------------------------------\n// OM Packs\n// ---------------------------------------------------------------------------\n\nconst BUILTIN_OM_PACKS: BuiltinOMPack[] = [\n {\n id: 'gemini',\n providerId: 'google',\n name: 'Gemini Flash',\n modelId: 'google/gemini-3.5-flash',\n description: access => (access === 'oauth' ? 'Via Google OAuth' : 'Via Google API key'),\n },\n {\n id: 'anthropic',\n providerId: 'anthropic',\n name: 'Claude Haiku',\n modelId: 'anthropic/claude-haiku-4-5',\n description: access => (access === 'oauth' ? 'Via Max subscription' : 'Via Anthropic API key'),\n },\n {\n id: 'openai',\n providerId: 'openai',\n name: 'OpenAI Mini',\n modelId: 'openai/gpt-5.4-mini',\n description: access => (access === 'oauth' ? 'Via Codex subscription' : 'Via OpenAI API key'),\n },\n {\n id: 'deepseek',\n providerId: 'deepseek',\n name: 'DeepSeek',\n modelId: 'deepseek/deepseek-v4-flash',\n description: () => 'Via DeepSeek API key',\n },\n];\n\nfunction normalizeOMProviderId(providerId: string): string {\n return providerId === 'openai-codex' ? 'openai' : providerId;\n}\n\n/** A provider's low-cost OM pack, or a custom pack on `fallbackModelId` when it has none. */\nexport function resolveProviderOMDefault(providerId: string, fallbackModelId = DEFAULT_OM_MODEL_ID): OMPack {\n const normalizedProviderId = normalizeOMProviderId(providerId);\n const builtin = BUILTIN_OM_PACKS.find(pack => pack.providerId === normalizedProviderId);\n if (builtin) {\n return {\n id: builtin.id,\n name: builtin.name,\n description: builtin.description('apikey'),\n modelId: builtin.modelId,\n };\n }\n\n return {\n id: 'custom',\n name: 'Custom',\n description: 'Uses the selected provider model',\n modelId: fallbackModelId || DEFAULT_OM_MODEL_ID,\n };\n}\n\nexport function getAvailableOmPacks(access: ProviderAccess): OMPack[] {\n const packs = BUILTIN_OM_PACKS.flatMap(pack => {\n const providerAccess = access[pack.providerId];\n if (!providerAccess) return [];\n return [\n {\n id: pack.id,\n name: pack.name,\n description: pack.description(providerAccess),\n modelId: pack.modelId,\n },\n ];\n });\n\n // Custom — always available; user picks any model\n packs.push({\n id: 'custom',\n name: 'Custom',\n description: 'Choose any available model',\n modelId: '',\n });\n\n return packs;\n}\n\n/** Best reachable built-in OM pack: preferred provider, then OAuth, then built-in order. */\nexport function selectPreferredOMPack(access: ProviderAccess, preferredProviderId?: string): OMPack | undefined {\n const available = getAvailableOmPacks(access).filter(pack => pack.id !== 'custom');\n\n if (preferredProviderId) {\n const preferredPackId = resolveProviderOMDefault(preferredProviderId).id;\n const preferred = available.find(pack => pack.id === preferredPackId);\n if (preferred) return preferred;\n }\n\n const oauth = available.find(pack => {\n const definition = BUILTIN_OM_PACKS.find(candidate => candidate.id === pack.id);\n return definition ? access[definition.providerId] === 'oauth' : false;\n });\n return oauth ?? available[0];\n}\n\n// ---------------------------------------------------------------------------\n// Current onboarding version — bump when adding new steps\n// ---------------------------------------------------------------------------\n\nexport const ONBOARDING_VERSION = 1;\n"],"mappings":";;;;;;;;AA6DA,MAAM,qBAAwC;CAC5C;EACE,IAAI;EACJ,YAAY;EACZ,MAAM;EACN,cAAa,WACX,WAAW,UAAU,8CAA8C;EACrE,QAAQ;GACN,OAAO;GACP,MAAM;GACN,MAAM;EACR;CACF;CACA;EACE,IAAI;EACJ,YAAY;EACZ,MAAM;EACN,cAAa,WACX,WAAW,UAAU,6CAA6C;EACpE,QAAQ;GACN,OAAO;GACP,MAAM;GACN,MAAM;EACR;CACF;CACA;EACE,IAAI;EACJ,YAAY;EACZ,MAAM;EACN,mBAAmB;EACnB,QAAQ;GACN,OAAO;GACP,MAAM;GACN,MAAM;EACR;CACF;AACF;AAEA,SAAgB,mBAAmB,QAAiE;CAClG,MAAM,OAAO,mBAAmB,MAAK,SAAQ,KAAK,OAAO,MAAM;CAC/D,IAAI,CAAC,MAAM,OAAO,KAAA;CAClB,OAAO;EACL,IAAI,KAAK;EACT,YAAY,KAAK;EACjB,MA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Content":["/**\n * Onboarding \"packs\" — predefined model configurations for each mode.\n *\n * Each pack assigns a default model to the build, plan, and fast modes,\n * plus an OM (observational memory) model.\n */\nimport { DEFAULT_OM_MODEL_ID } from '../constants.js';\n\n// ---------------------------------------------------------------------------\n// Types\n// ---------------------------------------------------------------------------\n\nexport interface ModePack {\n id: string;\n name: string;\n description: string;\n models: {\n build: string;\n plan: string;\n fast: string;\n /**\n * Optional observational-memory model. When set, OM observer/reflector\n * resolve from the pack (and its fallback chain) instead of the standalone\n * OM settings, unless an explicit OM role override exists.\n */\n memory?: string;\n };\n}\n\nexport interface OMPack {\n id: string;\n name: string;\n description: string;\n modelId: string;\n}\n\ninterface BuiltinOMPack {\n id: string;\n providerId: string;\n name: string;\n modelId: string;\n description: (access: Exclude<ProviderAccessLevel, false>) => string;\n}\n\n/** How a provider is accessed: OAuth subscription, API key, or not at all. */\nexport type ProviderAccessLevel = 'oauth' | 'apikey' | false;\n\n/** Which providers the user has access to and how. */\nexport interface ProviderAccess {\n anthropic: ProviderAccessLevel;\n openai: ProviderAccessLevel;\n cerebras: ProviderAccessLevel;\n google: ProviderAccessLevel;\n deepseek: ProviderAccessLevel;\n 'github-copilot': ProviderAccessLevel;\n [provider: string]: ProviderAccessLevel;\n}\n\n// ---------------------------------------------------------------------------\n// Mode Packs\n// ---------------------------------------------------------------------------\n\ninterface BuiltinModePack extends Omit<ModePack, 'description'> {\n providerId: string;\n description: (access: Exclude<ProviderAccessLevel, false>) => string;\n}\n\nconst BUILTIN_MODE_PACKS: BuiltinModePack[] = [\n {\n id: 'anthropic',\n providerId: 'anthropic',\n name: 'Anthropic',\n description: access =>\n access === 'oauth' ? 'All Anthropic models via Max subscription' : 'All Anthropic models via API key',\n models: {\n build: 'anthropic/claude-fable-5',\n plan: 'anthropic/claude-fable-5',\n fast: 'anthropic/claude-haiku-4-5',\n },\n },\n {\n id: 'openai',\n providerId: 'openai',\n name: 'OpenAI',\n description: access =>\n access === 'oauth' ? 'All OpenAI models via Codex subscription' : 'All OpenAI models via API key',\n models: {\n build: 'openai/gpt-5.6-sol',\n plan: 'openai/gpt-5.6-sol',\n fast: 'openai/gpt-5.4-mini',\n },\n },\n {\n id: 'github-copilot',\n providerId: 'github-copilot',\n name: 'GitHub Copilot',\n description: () => 'GitHub Copilot subscription',\n models: {\n build: 'github-copilot/gpt-4.1',\n plan: 'github-copilot/gemini-2.5-pro',\n fast: 'github-copilot/grok-code-fast-1',\n },\n },\n];\n\nexport function getBuiltinModePack(packId: string): (ModePack & { providerId: string }) | undefined {\n const pack = BUILTIN_MODE_PACKS.find(item => item.id === packId);\n if (!pack) return undefined;\n return {\n id: pack.id,\n providerId: pack.providerId,\n name: pack.name,\n description: pack.description('apikey'),\n models: { ...pack.models },\n };\n}\n\n/**\n * All builtin mode packs regardless of provider access (descriptions use the\n * apikey variant). For resolution-time lookups — fallback chains must resolve\n * even when an access probe is stale; actual auth failures surface through\n * the provider call itself.\n */\nexport function listBuiltinModePacks(): ModePack[] {\n return BUILTIN_MODE_PACKS.map(pack => ({\n id: pack.id,\n name: pack.name,\n description: pack.description('apikey'),\n models: { ...pack.models },\n }));\n}\n\n/** A pack id is known when it is a builtin mode pack or a saved custom pack. */\nexport function isKnownModePackId(packId: string, savedCustomPacks: Array<{ name: string }> = []): boolean {\n if (BUILTIN_MODE_PACKS.some(pack => pack.id === packId)) return true;\n if (!packId.startsWith('custom:')) return false;\n // Settings files are user-editable: a malformed entry (null, or an element\n // without `name`) would throw on `pack.name` and the loader's catch-all would\n // replace the whole saved settings object with defaults. An unusable entry is\n // simply not a known pack id.\n return savedCustomPacks.some(pack => typeof pack?.name === 'string' && `custom:${pack.name}` === packId);\n}\n\n/**\n * Drop pack-fallback entries whose source or target pack no longer exists\n * (e.g. a deleted custom pack). Shape validation happens before this; here we\n * only prune dangling references, with the same tolerance the rest of settings\n * parsing uses.\n */\nexport function pruneUnknownModePackFallbacks(\n fallbacks: Record<string, string>,\n savedCustomPacks: Array<{ name: string }> = [],\n): Record<string, string> {\n const result: Record<string, string> = {};\n for (const [packId, fallbackId] of Object.entries(fallbacks)) {\n if (isKnownModePackId(packId, savedCustomPacks) && isKnownModePackId(fallbackId, savedCustomPacks)) {\n result[packId] = fallbackId;\n }\n }\n return result;\n}\n\n/** Drop preferred-account bindings for missing packs or models no longer used by that pack. */\nexport function pruneUnknownPackAccountPreferences(\n preferences: Record<string, Record<string, string>>,\n savedCustomPacks: Array<{ name: string; models: Record<string, string> }> = [],\n modePackOverrides: Record<string, Record<string, string>> = {},\n): Record<string, Record<string, string>> {\n const packModels = new Map<string, Set<string>>();\n for (const pack of listBuiltinModePacks()) {\n packModels.set(pack.id, new Set(Object.values({ ...pack.models, ...modePackOverrides[pack.id] })));\n }\n for (const pack of savedCustomPacks) {\n // Settings files are user-editable: a malformed entry without `models`\n // would otherwise throw here, and the loader's catch-all would replace the\n // whole saved settings object with defaults. Treat it as having no models.\n const models = pack?.models && typeof pack.models === 'object' ? pack.models : {};\n packModels.set(`custom:${pack.name}`, new Set(Object.values(models)));\n }\n\n const result: Record<string, Record<string, string>> = {};\n for (const [packId, modelPreferences] of Object.entries(preferences)) {\n const models = packModels.get(packId);\n if (!models) continue;\n const validEntries = Object.entries(modelPreferences).filter(([modelId]) => models.has(modelId));\n if (validEntries.length > 0) result[packId] = Object.fromEntries(validEntries);\n }\n return result;\n}\n\n/**\n * Walk `settings.models.packFallbacks` from `startPackId`, returning the pack\n * ids in cascade order starting with the pack itself. Cycles are allowed but\n * the cascade gets exactly one revisit total (Q15: \"full circle then one\n * revisit then surface\"): the walk stops when the next link would add a pack\n * already in the chain after the revisit was consumed, or when a link\n * dangles at an unknown pack. An A⇄B cycle therefore yields [A, B, A#2] and\n * stops. This cap is the cycle handling for both the fallback model chain\n * (request time) and the /models picker's chain display.\n */\nexport function resolveModePackFallbackChain(\n fallbacks: Record<string, string>,\n startPackId: string,\n savedCustomPacks: Array<{ name: string }> = [],\n): string[] {\n const chain = [startPackId];\n let revisitUsed = false;\n let current = startPackId;\n while (true) {\n const next = fallbacks[current];\n if (!next || !isKnownModePackId(next, savedCustomPacks)) break;\n if (chain.includes(next)) {\n if (revisitUsed) break;\n revisitUsed = true;\n }\n chain.push(next);\n current = next;\n }\n return chain;\n}\n\n/**\n * Build the list of available mode packs based on which providers the user\n * can actually reach (API key or OAuth login).\n *\n * @param savedCustomPacks Previously saved custom packs from settings.json.\n * These are inserted before the \"New Custom\" option.\n */\nexport function getAvailableModePacks(\n access: ProviderAccess,\n savedCustomPacks: Array<{ name: string; models: Record<string, string> }> = [],\n): ModePack[] {\n const packs: ModePack[] = BUILTIN_MODE_PACKS.flatMap(pack => {\n const providerAccess = access[pack.providerId];\n if (!providerAccess) return [];\n return [\n {\n id: pack.id,\n name: pack.name,\n description: pack.description(providerAccess),\n models: { ...pack.models },\n },\n ];\n });\n\n // Saved custom packs — inserted before the \"New Custom\" option\n for (const cp of savedCustomPacks) {\n packs.push({\n id: `custom:${cp.name}`,\n name: cp.name,\n description: 'Saved custom pack',\n models: {\n build: cp.models.build ?? '',\n plan: cp.models.plan ?? '',\n fast: cp.models.fast ?? '',\n ...(typeof cp.models.memory === 'string' && cp.models.memory.length > 0 ? { memory: cp.models.memory } : {}),\n },\n });\n }\n\n // New Custom — always available; user picks each model individually\n const hasCustom = savedCustomPacks.length > 0;\n packs.push({\n id: 'custom',\n name: hasCustom ? 'New Custom' : 'Custom',\n description: 'Choose a model for each mode',\n models: { build: '', plan: '', fast: '' },\n });\n\n return packs;\n}\n\n// ---------------------------------------------------------------------------\n// OM Packs\n// ---------------------------------------------------------------------------\n\nconst BUILTIN_OM_PACKS: BuiltinOMPack[] = [\n {\n id: 'gemini',\n providerId: 'google',\n name: 'Gemini Flash',\n modelId: 'google/gemini-3.5-flash',\n description: access => (access === 'oauth' ? 'Via Google OAuth' : 'Via Google API key'),\n },\n {\n id: 'anthropic',\n providerId: 'anthropic',\n name: 'Claude Haiku',\n modelId: 'anthropic/claude-haiku-4-5',\n description: access => (access === 'oauth' ? 'Via Max subscription' : 'Via Anthropic API key'),\n },\n {\n id: 'openai',\n providerId: 'openai',\n name: 'OpenAI Mini',\n modelId: 'openai/gpt-5.4-mini',\n description: access => (access === 'oauth' ? 'Via Codex subscription' : 'Via OpenAI API key'),\n },\n {\n id: 'deepseek',\n providerId: 'deepseek',\n name: 'DeepSeek',\n modelId: 'deepseek/deepseek-v4-flash',\n description: () => 'Via DeepSeek API key',\n },\n];\n\nfunction normalizeOMProviderId(providerId: string): string {\n return providerId === 'openai-codex' ? 'openai' : providerId;\n}\n\n/** A provider's low-cost OM pack, or a custom pack on `fallbackModelId` when it has none. */\nexport function resolveProviderOMDefault(providerId: string, fallbackModelId = DEFAULT_OM_MODEL_ID): OMPack {\n const normalizedProviderId = normalizeOMProviderId(providerId);\n const builtin = BUILTIN_OM_PACKS.find(pack => pack.providerId === normalizedProviderId);\n if (builtin) {\n return {\n id: builtin.id,\n name: builtin.name,\n description: builtin.description('apikey'),\n modelId: builtin.modelId,\n };\n }\n\n return {\n id: 'custom',\n name: 'Custom',\n description: 'Uses the selected provider model',\n modelId: fallbackModelId || DEFAULT_OM_MODEL_ID,\n };\n}\n\nexport function getAvailableOmPacks(access: ProviderAccess): OMPack[] {\n const packs = BUILTIN_OM_PACKS.flatMap(pack => {\n const providerAccess = access[pack.providerId];\n if (!providerAccess) return [];\n return [\n {\n id: pack.id,\n name: pack.name,\n description: pack.description(providerAccess),\n modelId: pack.modelId,\n },\n ];\n });\n\n // Custom — always available; user picks any model\n packs.push({\n id: 'custom',\n name: 'Custom',\n description: 'Choose any available model',\n modelId: '',\n });\n\n return packs;\n}\n\n/** Best reachable built-in OM pack: preferred provider, then OAuth, then built-in order. */\nexport function selectPreferredOMPack(access: ProviderAccess, preferredProviderId?: string): OMPack | undefined {\n const available = getAvailableOmPacks(access).filter(pack => pack.id !== 'custom');\n\n if (preferredProviderId) {\n const preferredPackId = resolveProviderOMDefault(preferredProviderId).id;\n const preferred = available.find(pack => pack.id === preferredPackId);\n if (preferred) return preferred;\n }\n\n const oauth = available.find(pack => {\n const definition = BUILTIN_OM_PACKS.find(candidate => candidate.id === pack.id);\n return definition ? access[definition.providerId] === 'oauth' : false;\n });\n return oauth ?? available[0];\n}\n\n// ---------------------------------------------------------------------------\n// Current onboarding version — bump when adding new steps\n// ---------------------------------------------------------------------------\n\nexport const ONBOARDING_VERSION = 1;\n"],"mappings":";;;;;;;;AAmEA,MAAM,qBAAwC;CAC5C;EACE,IAAI;EACJ,YAAY;EACZ,MAAM;EACN,cAAa,WACX,WAAW,UAAU,8CAA8C;EACrE,QAAQ;GACN,OAAO;GACP,MAAM;GACN,MAAM;EACR;CACF;CACA;EACE,IAAI;EACJ,YAAY;EACZ,MAAM;EACN,cAAa,WACX,WAAW,UAAU,6CAA6C;EACpE,QAAQ;GACN,OAAO;GACP,MAAM;GACN,MAAM;EACR;CACF;CACA;EACE,IAAI;EACJ,YAAY;EACZ,MAAM;EACN,mBAAmB;EACnB,QAAQ;GACN,OAAO;GACP,MAAM;GACN,MAAM;EACR;CACF;AACF;AAEA,SAAgB,mBAAmB,QAAiE;CAClG,MAAM,OAAO,mBAAmB,MAAK,SAAQ,KAAK,OAAO,MAAM;CAC/D,IAAI,CAAC,MAAM,OAAO,KAAA;CAClB,OAAO;EACL,IAAI,KAAK;EACT,YAAY,KAAK;EACjB,MAAM,KAAK;EACX,aAAa,KAAK,YAAY,QAAQ;EACtC,QAAQ,EAAE,GAAG,KAAK,OAAO;CAC3B;AACF;;;;;;;AAQA,SAAgB,uBAAmC;CACjD,OAAO,mBAAmB,KAAI,UAAS;EACrC,IAAI,KAAK;EACT,MAAM,KAAK;EACX,aAAa,KAAK,YAAY,QAAQ;EACtC,QAAQ,EAAE,GAAG,KAAK,OAAO;CAC3B,EAAE;AACJ;;AAGA,SAAgB,kBAAkB,QAAgB,mBAA4C,CAAC,GAAY;CACzG,IAAI,mBAAmB,MAAK,SAAQ,KAAK,OAAO,MAAM,GAAG,OAAO;CAChE,IAAI,CAAC,OAA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AAI,WAAW,OAAO;CACxB;CAMA,OAJc,UAAU,MAAK,SAAQ;EACnC,MAAM,aAAa,iBAAiB,MAAK,cAAa,UAAU,OAAO,KAAK,EAAE;EAC9E,OAAO,aAAa,OAAO,WAAW,gBAAgB,UAAU;CAClE,CACW,KAAK,UAAU;AAC5B;AAMA,MAAa,qBAAqB"}
|
|
@@ -169,6 +169,7 @@ export interface BrowserSettings {
|
|
|
169
169
|
/** AgentBrowser-specific settings. */
|
|
170
170
|
agentBrowser?: AgentBrowserSettings;
|
|
171
171
|
}
|
|
172
|
+
export type PackAccountPreferences = Record<string, Record<string, string>>;
|
|
172
173
|
export interface GlobalSettings {
|
|
173
174
|
onboarding: {
|
|
174
175
|
completedAt: string | null;
|
|
@@ -189,6 +190,16 @@ export interface GlobalSettings {
|
|
|
189
190
|
activeModelPackId: string | null;
|
|
190
191
|
/** Per-mode overrides keyed by built-in pack ID. */
|
|
191
192
|
modePackOverrides: Record<string, Record<string, string>>;
|
|
193
|
+
/**
|
|
194
|
+
* Fallback pack per pack ID (packId → packId; builtin ids and
|
|
195
|
+
* "custom:<name>" both allowed). When every account serving a pack's
|
|
196
|
+
* provider is exhausted — or the provider is persistently down — the turn
|
|
197
|
+
* hops to the fallback pack's model. Chains are allowed; a cycle is
|
|
198
|
+
* capped at one revisit per cascade, then the error surfaces.
|
|
199
|
+
*/
|
|
200
|
+
packFallbacks: Record<string, string>;
|
|
201
|
+
/** Preferred OAuth account by pack ID and resolved model ID. */
|
|
202
|
+
packAccountPreferences: Record<string, Record<string, string>>;
|
|
192
203
|
/** Explicit per-mode defaults — used when no activeModelPackId is set. */
|
|
193
204
|
modeDefaults: Record<string, string>;
|
|
194
205
|
/**
|
|
@@ -275,6 +286,7 @@ export interface GlobalSettings {
|
|
|
275
286
|
browser: BrowserSettings;
|
|
276
287
|
shellPassthrough: ShellPassthroughSettings;
|
|
277
288
|
voice: VoiceSettings;
|
|
289
|
+
backgroundTools: BackgroundToolSettings;
|
|
278
290
|
signals: SignalSettings;
|
|
279
291
|
mcp: McpDiscoverySettings;
|
|
280
292
|
observability: ObservabilitySettings;
|
|
@@ -285,6 +297,10 @@ export interface McpDiscoverySettings {
|
|
|
285
297
|
/** Reuse MCP servers from $CODEX_HOME/config.toml or ~/.codex/config.toml. */
|
|
286
298
|
codexGlobal: boolean;
|
|
287
299
|
}
|
|
300
|
+
export interface BackgroundToolSettings {
|
|
301
|
+
/** Allow eligible Mastra Code tools to accept per-call background execution overrides. */
|
|
302
|
+
enabled: boolean;
|
|
303
|
+
}
|
|
288
304
|
export interface SignalSettings {
|
|
289
305
|
/** Opt into local Unix socket PubSub for cross-process signal routing. */
|
|
290
306
|
unixSocketPubSub: boolean;
|
|
@@ -316,6 +332,10 @@ export declare const STORAGE_DEFAULTS: StorageSettings;
|
|
|
316
332
|
/** Default STT engine: on-device macOS recognizer where available, else cloud. */
|
|
317
333
|
export declare function defaultVoiceEngine(): VoiceEngine;
|
|
318
334
|
export declare const WEB_SEARCH_PROVIDER_VALUES: WebSearchProviderSetting[];
|
|
335
|
+
/** Move persisted routing choices when re-authentication changes an account instance id. */
|
|
336
|
+
export declare function migrateAccountPreferences(settings: GlobalSettings, previousAccountId: string, nextAccountId: string): void;
|
|
337
|
+
/** Remove persisted routing choices that point at deleted OAuth account instances. */
|
|
338
|
+
export declare function pruneRemovedAccountPreferences(settings: GlobalSettings, removedAccountIds: Iterable<string>): void;
|
|
319
339
|
export declare function getSettingsPath(): string;
|
|
320
340
|
export declare function getCustomProviderId(name: string): string;
|
|
321
341
|
export declare function toCustomProviderModelId(providerName: string, modelName: string): string;
|
|
@@ -339,6 +359,7 @@ export declare function resolveLspSetting(lsp: boolean | LSPConfig | undefined):
|
|
|
339
359
|
export declare function migrateLegacyVariedPack(settings: GlobalSettings): boolean;
|
|
340
360
|
export declare function loadSettings(filePath?: string): GlobalSettings;
|
|
341
361
|
export declare const THREAD_ACTIVE_MODEL_PACK_ID_KEY = "activeModelPackId";
|
|
362
|
+
export declare const THREAD_FALLBACK_STATUS_KEY = "mastracodeFallbackStatus";
|
|
342
363
|
export interface ThreadSettings {
|
|
343
364
|
activeModelPackId: string | null;
|
|
344
365
|
modeModelIds: Record<string, string>;
|
|
@@ -370,6 +391,18 @@ export declare function resolveModePackModels(settings: GlobalSettings, pack: {
|
|
|
370
391
|
id: string;
|
|
371
392
|
models: Record<string, string>;
|
|
372
393
|
}): Record<string, string>;
|
|
394
|
+
/**
|
|
395
|
+
* Resolve a session's explicitly active pack when its mode model still matches.
|
|
396
|
+
* Model matching alone is not pack identity: multiple packs may intentionally
|
|
397
|
+
* use the same model, and inference would attach an unrelated fallback chain.
|
|
398
|
+
*/
|
|
399
|
+
export declare function findModePackForModel(settings: GlobalSettings, packs: Array<{
|
|
400
|
+
id: string;
|
|
401
|
+
models: Record<string, string>;
|
|
402
|
+
}>, modelId: string, modeId: string, activePackId: string | undefined): {
|
|
403
|
+
id: string;
|
|
404
|
+
models: Record<string, string>;
|
|
405
|
+
} | undefined;
|
|
373
406
|
export declare function resolveModelDefaults(settings: GlobalSettings, builtinPacks: Array<{
|
|
374
407
|
id: string;
|
|
375
408
|
models: Record<string, string>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"settings.d.ts","sourceRoot":"","sources":["../../src/onboarding/settings.ts"],"names":[],"mappings":"AAAA;;;;GAIG;
|
|
1
|
+
{"version":3,"file":"settings.d.ts","sourceRoot":"","sources":["../../src/onboarding/settings.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAKH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAC1D,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AAQxD,OAAO,KAAK,EAAE,oBAAoB,EAAE,mBAAmB,EAAE,MAAM,gBAAgB,CAAC;AAChF,OAAO,EAAE,sBAAsB,EAAE,qBAAqB,EAAE,MAAM,gBAAgB,CAAC;AAC/E,YAAY,EAAE,oBAAoB,EAAE,mBAAmB,EA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AAM,CAAC;IAAC,OAAO,EAAE,MAAM,CAAA;CAAE,CAAC,GACrD,MAAM,GAAG,IAAI,CAYf;AAED;;;;GAIG;AACH,wBAAgB,cAAc,CAC5B,QAAQ,EAAE,cAAc,EACxB,cAAc,EAAE,KAAK,CAAC;IAAE,EAAE,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,MAAM,CAAA;CAAE,CAAC,GACrD,MAAM,GAAG,IAAI,CAEf;AAkCD,wBAAgB,YAAY,CAAC,QAAQ,EAAE,cAAc,EAAE,QAAQ,GAAE,MAA0B,GAAG,IAAI,CASjG;AAKD;;;GAGG;AACH,wBAAgB,kBAAkB,CAAC,WAAW,EAAE,MAAM,GAAG,eAAe,GAAG,SAAS,CAcnF;AAED;;;GAGG;AACH,wBAAgB,kBAAkB,CAAC,WAAW,EAAE,MAAM,EAAE,QAAQ,EAAE,eAAe,GAAG,IAAI,CAMvF;AAED;;;GAGG;AACH,wBAAgB,4BAA4B,CAC1C,WAAW,EAAE,MAAM,GAAG,SAAS,EAC/B,cAAc,EAAE,eAAe,GAC9B,eAAe,GAAG,SAAS,CAS7B;AAMD;;;;GAIG;AACH,wBAAsB,yBAAyB,CAAC,QAAQ,EAAE,eAAe,GAAG,OAAO,CAAC,aAAa,GAAG,SAAS,CAAC,CA4E7G"}
|
|
@@ -3,7 +3,9 @@ import { AuthStorage } from "../auth/storage.js";
|
|
|
3
3
|
import { THINKING_LEVEL_VALUES, isThinkingLevelSetting, resolveDefaultThinkingLevel as resolveDefaultThinkingLevel$1 } from "../thinking.js";
|
|
4
4
|
import { buildCodexStagehandFetch, createCodexMiddleware } from "../providers/openai-codex.js";
|
|
5
5
|
import { DEFAULT_STT_PROVIDER, resolveSTTModel } from "../voice/stt-registry.js";
|
|
6
|
-
import {
|
|
6
|
+
import { pruneUnknownModePackFallbacks, pruneUnknownPackAccountPreferences } from "./packs.js";
|
|
7
|
+
import { randomUUID } from "crypto";
|
|
8
|
+
import { existsSync, mkdirSync, readFileSync, renameSync, rmSync, statSync, writeFileSync } from "fs";
|
|
7
9
|
import { dirname, join } from "path";
|
|
8
10
|
//#region src/onboarding/settings.ts
|
|
9
11
|
/**
|
|
@@ -95,6 +97,8 @@ const DEFAULTS = {
|
|
|
95
97
|
models: {
|
|
96
98
|
activeModelPackId: null,
|
|
97
99
|
modePackOverrides: {},
|
|
100
|
+
packFallbacks: {},
|
|
101
|
+
packAccountPreferences: {},
|
|
98
102
|
modeDefaults: {},
|
|
99
103
|
modeThinkingDefaults: {},
|
|
100
104
|
activeOmPackId: null,
|
|
@@ -138,6 +142,7 @@ const DEFAULTS = {
|
|
|
138
142
|
engine: defaultVoiceEngine(),
|
|
139
143
|
provider: DEFAULT_STT_PROVIDER
|
|
140
144
|
},
|
|
145
|
+
backgroundTools: { enabled: false },
|
|
141
146
|
signals: {
|
|
142
147
|
unixSocketPubSub: false,
|
|
143
148
|
experimentalGithubSignals: false,
|
|
@@ -192,6 +197,45 @@ function parseModePackOverrides(value) {
|
|
|
192
197
|
}
|
|
193
198
|
return result;
|
|
194
199
|
}
|
|
200
|
+
function parsePackFallbacks(value) {
|
|
201
|
+
if (!value || typeof value !== "object") return {};
|
|
202
|
+
const result = {};
|
|
203
|
+
for (const [packId, fallbackId] of Object.entries(value)) if (typeof fallbackId === "string" && fallbackId.length > 0) result[packId] = fallbackId;
|
|
204
|
+
return result;
|
|
205
|
+
}
|
|
206
|
+
/** Shape-parse + drop entries whose source or target pack no longer exists. */
|
|
207
|
+
function loadPackFallbacks(value, customModelPacks) {
|
|
208
|
+
return pruneUnknownModePackFallbacks(parsePackFallbacks(value), customModelPacks);
|
|
209
|
+
}
|
|
210
|
+
function parsePackAccountPreferences(value) {
|
|
211
|
+
if (!value || typeof value !== "object") return {};
|
|
212
|
+
const result = {};
|
|
213
|
+
for (const [packId, modelPreferences] of Object.entries(value)) {
|
|
214
|
+
if (!modelPreferences || typeof modelPreferences !== "object") continue;
|
|
215
|
+
const parsed = Object.fromEntries(Object.entries(modelPreferences).filter((entry) => entry[0].length > 0 && typeof entry[1] === "string" && entry[1].length > 0));
|
|
216
|
+
if (Object.keys(parsed).length > 0) result[packId] = parsed;
|
|
217
|
+
}
|
|
218
|
+
return result;
|
|
219
|
+
}
|
|
220
|
+
function loadPackAccountPreferences(value, customModelPacks, modePackOverrides) {
|
|
221
|
+
return pruneUnknownPackAccountPreferences(parsePackAccountPreferences(value), customModelPacks, modePackOverrides);
|
|
222
|
+
}
|
|
223
|
+
/** Move persisted routing choices when re-authentication changes an account instance id. */
|
|
224
|
+
function migrateAccountPreferences(settings, previousAccountId, nextAccountId) {
|
|
225
|
+
if (previousAccountId === nextAccountId) return;
|
|
226
|
+
for (const modelPreferences of Object.values(settings.models.packAccountPreferences ?? {})) for (const [modelId, accountInstanceId] of Object.entries(modelPreferences)) if (accountInstanceId === previousAccountId) modelPreferences[modelId] = nextAccountId;
|
|
227
|
+
}
|
|
228
|
+
/** Remove persisted routing choices that point at deleted OAuth account instances. */
|
|
229
|
+
function pruneRemovedAccountPreferences(settings, removedAccountIds) {
|
|
230
|
+
const removed = new Set(removedAccountIds);
|
|
231
|
+
if (removed.size === 0) return;
|
|
232
|
+
const next = {};
|
|
233
|
+
for (const [packId, modelPreferences] of Object.entries(settings.models.packAccountPreferences ?? {})) {
|
|
234
|
+
const retained = Object.fromEntries(Object.entries(modelPreferences).filter(([, accountInstanceId]) => !removed.has(accountInstanceId)));
|
|
235
|
+
if (Object.keys(retained).length > 0) next[packId] = retained;
|
|
236
|
+
}
|
|
237
|
+
settings.models.packAccountPreferences = next;
|
|
238
|
+
}
|
|
195
239
|
function parseQuietModeMaxToolPreviewLines(value) {
|
|
196
240
|
const rawValue = typeof value === "number" && Number.isFinite(value) ? value : DEFAULTS.preferences.quietModeMaxToolPreviewLines;
|
|
197
241
|
return Math.min(QUIET_MODE_MAX_TOOL_PREVIEW_LINES_MAX, Math.max(0, Math.floor(rawValue)));
|
|
@@ -213,6 +257,10 @@ function parseGithubPollIntervalMs(value) {
|
|
|
213
257
|
if (intervalMs < 1e4) return DEFAULTS.signals.githubPollIntervalMs;
|
|
214
258
|
return Math.min(intervalMs, GITHUB_POLL_INTERVAL_MAX_MS);
|
|
215
259
|
}
|
|
260
|
+
function parseBackgroundToolSettings(rawBackgroundTools) {
|
|
261
|
+
const raw = rawBackgroundTools && typeof rawBackgroundTools === "object" ? rawBackgroundTools : {};
|
|
262
|
+
return { enabled: typeof raw.enabled === "boolean" ? raw.enabled : DEFAULTS.backgroundTools.enabled };
|
|
263
|
+
}
|
|
216
264
|
function parseSignalSettings(rawSignals) {
|
|
217
265
|
const raw = rawSignals && typeof rawSignals === "object" ? rawSignals : {};
|
|
218
266
|
return {
|
|
@@ -450,6 +498,8 @@ function migrateFromAuth(settingsPath) {
|
|
|
450
498
|
let settings;
|
|
451
499
|
if (existsSync(settingsPath)) try {
|
|
452
500
|
const raw = JSON.parse(readFileSync(settingsPath, "utf-8"));
|
|
501
|
+
const rawCustomPacks = Array.isArray(raw.customModelPacks) ? raw.customModelPacks : [];
|
|
502
|
+
const modePackOverrides = parseModePackOverrides(raw.models?.modePackOverrides);
|
|
453
503
|
settings = {
|
|
454
504
|
onboarding: {
|
|
455
505
|
...DEFAULTS.onboarding,
|
|
@@ -458,8 +508,10 @@ function migrateFromAuth(settingsPath) {
|
|
|
458
508
|
models: {
|
|
459
509
|
...DEFAULTS.models,
|
|
460
510
|
...raw.models,
|
|
461
|
-
modePackOverrides
|
|
462
|
-
modeThinkingDefaults: parseModeThinkingDefaults(raw.models?.modeThinkingDefaults)
|
|
511
|
+
modePackOverrides,
|
|
512
|
+
modeThinkingDefaults: parseModeThinkingDefaults(raw.models?.modeThinkingDefaults),
|
|
513
|
+
packFallbacks: loadPackFallbacks(raw.models?.packFallbacks, rawCustomPacks),
|
|
514
|
+
packAccountPreferences: loadPackAccountPreferences(raw.models?.packAccountPreferences, rawCustomPacks, modePackOverrides)
|
|
463
515
|
},
|
|
464
516
|
preferences: parsePreferences(raw.preferences),
|
|
465
517
|
storage: {
|
|
@@ -483,6 +535,7 @@ function migrateFromAuth(settingsPath) {
|
|
|
483
535
|
browser: parseBrowserSettings(raw.browser),
|
|
484
536
|
shellPassthrough: parseShellPassthroughSettings(raw.shellPassthrough),
|
|
485
537
|
voice: parseVoiceSettings(raw.voice),
|
|
538
|
+
backgroundTools: parseBackgroundToolSettings(raw.backgroundTools),
|
|
486
539
|
signals: parseSignalSettings(raw.signals),
|
|
487
540
|
mcp: parseMcpDiscoverySettings(raw.mcp),
|
|
488
541
|
observability: parseObservabilitySettings(raw.observability)
|
|
@@ -508,7 +561,7 @@ function migrateFromAuth(settingsPath) {
|
|
|
508
561
|
saveSettings(settings, settingsPath);
|
|
509
562
|
for (const key of modelKeys) delete authData[key];
|
|
510
563
|
try {
|
|
511
|
-
|
|
564
|
+
writeFileAtomically(authPath, JSON.stringify(authData, null, 2));
|
|
512
565
|
} catch {}
|
|
513
566
|
return true;
|
|
514
567
|
}
|
|
@@ -542,6 +595,8 @@ function loadSettings(filePath = getSettingsPath()) {
|
|
|
542
595
|
if (!existsSync(filePath)) return rememberLoadedSettings(getNewInstallDefaults());
|
|
543
596
|
try {
|
|
544
597
|
const raw = JSON.parse(readFileSync(filePath, "utf-8"));
|
|
598
|
+
const rawCustomPacks = Array.isArray(raw.customModelPacks) ? raw.customModelPacks : [];
|
|
599
|
+
const modePackOverrides = parseModePackOverrides(raw.models?.modePackOverrides);
|
|
545
600
|
const settings = {
|
|
546
601
|
...raw,
|
|
547
602
|
onboarding: {
|
|
@@ -551,8 +606,10 @@ function loadSettings(filePath = getSettingsPath()) {
|
|
|
551
606
|
models: {
|
|
552
607
|
...DEFAULTS.models,
|
|
553
608
|
...raw.models,
|
|
554
|
-
modePackOverrides
|
|
555
|
-
modeThinkingDefaults: parseModeThinkingDefaults(raw.models?.modeThinkingDefaults)
|
|
609
|
+
modePackOverrides,
|
|
610
|
+
modeThinkingDefaults: parseModeThinkingDefaults(raw.models?.modeThinkingDefaults),
|
|
611
|
+
packFallbacks: loadPackFallbacks(raw.models?.packFallbacks, rawCustomPacks),
|
|
612
|
+
packAccountPreferences: loadPackAccountPreferences(raw.models?.packAccountPreferences, rawCustomPacks, modePackOverrides)
|
|
556
613
|
},
|
|
557
614
|
preferences: parsePreferences(raw.preferences),
|
|
558
615
|
storage: {
|
|
@@ -576,6 +633,7 @@ function loadSettings(filePath = getSettingsPath()) {
|
|
|
576
633
|
browser: parseBrowserSettings(raw.browser),
|
|
577
634
|
shellPassthrough: parseShellPassthroughSettings(raw.shellPassthrough),
|
|
578
635
|
voice: parseVoiceSettings(raw.voice),
|
|
636
|
+
backgroundTools: parseBackgroundToolSettings(raw.backgroundTools),
|
|
579
637
|
signals: parseSignalSettings(raw.signals),
|
|
580
638
|
mcp: parseMcpDiscoverySettings(raw.mcp),
|
|
581
639
|
observability: parseObservabilitySettings(raw.observability)
|
|
@@ -597,6 +655,7 @@ function loadSettings(filePath = getSettingsPath()) {
|
|
|
597
655
|
}
|
|
598
656
|
}
|
|
599
657
|
const THREAD_ACTIVE_MODEL_PACK_ID_KEY = "activeModelPackId";
|
|
658
|
+
const THREAD_FALLBACK_STATUS_KEY = "mastracodeFallbackStatus";
|
|
600
659
|
function parseThreadSettings(metadata) {
|
|
601
660
|
const modeModelIds = {};
|
|
602
661
|
for (const [key, value] of Object.entries(metadata ?? {})) {
|
|
@@ -656,6 +715,15 @@ function resolveModePackModels(settings, pack) {
|
|
|
656
715
|
...settings.models.modePackOverrides?.[pack.id]
|
|
657
716
|
};
|
|
658
717
|
}
|
|
718
|
+
/**
|
|
719
|
+
* Resolve a session's explicitly active pack when its mode model still matches.
|
|
720
|
+
* Model matching alone is not pack identity: multiple packs may intentionally
|
|
721
|
+
* use the same model, and inference would attach an unrelated fallback chain.
|
|
722
|
+
*/
|
|
723
|
+
function findModePackForModel(settings, packs, modelId, modeId, activePackId) {
|
|
724
|
+
const activePack = packs.find((pack) => pack.id === activePackId);
|
|
725
|
+
return activePack && resolveModePackModels(settings, activePack)[modeId] === modelId ? activePack : void 0;
|
|
726
|
+
}
|
|
659
727
|
function resolveModelDefaults(settings, builtinPacks) {
|
|
660
728
|
const { activeModelPackId, modeDefaults } = settings.models;
|
|
661
729
|
if (!activeModelPackId) return modeDefaults;
|
|
@@ -726,13 +794,25 @@ function getSignalSettingsForSave(settings, filePath) {
|
|
|
726
794
|
} catch {}
|
|
727
795
|
return settings.signals;
|
|
728
796
|
}
|
|
797
|
+
function writeFileAtomically(filePath, content) {
|
|
798
|
+
const tempPath = `${filePath}.${process.pid}.${randomUUID()}.tmp`;
|
|
799
|
+
try {
|
|
800
|
+
writeFileSync(tempPath, content, {
|
|
801
|
+
encoding: "utf-8",
|
|
802
|
+
mode: existsSync(filePath) ? statSync(filePath).mode & 511 : 384
|
|
803
|
+
});
|
|
804
|
+
renameSync(tempPath, filePath);
|
|
805
|
+
} finally {
|
|
806
|
+
rmSync(tempPath, { force: true });
|
|
807
|
+
}
|
|
808
|
+
}
|
|
729
809
|
function saveSettings(settings, filePath = getSettingsPath()) {
|
|
730
810
|
const dir = dirname(filePath);
|
|
731
811
|
if (!existsSync(dir)) mkdirSync(dir, { recursive: true });
|
|
732
812
|
const signals = getSignalSettingsForSave(settings, filePath);
|
|
733
813
|
settings.signals = signals;
|
|
734
814
|
loadedSignalSettings.set(settings, cloneSignalSettings(signals));
|
|
735
|
-
|
|
815
|
+
writeFileAtomically(filePath, JSON.stringify(settings, null, 2));
|
|
736
816
|
}
|
|
737
817
|
/** Marker file name to track which provider last used a profile. */
|
|
738
818
|
const PROFILE_PROVIDER_MARKER = ".mastra-provider";
|
|
@@ -844,6 +924,6 @@ async function createBrowserFromSettings(settings) {
|
|
|
844
924
|
throw new Error(`Unsupported browser provider: ${provider}`);
|
|
845
925
|
}
|
|
846
926
|
//#endregion
|
|
847
|
-
export { GITHUB_POLL_INTERVAL_DEFAULT_MS, GITHUB_POLL_INTERVAL_MAX_MS, GITHUB_POLL_INTERVAL_MIN_MS, MASTRA_GATEWAY_DEFAULT_URL, MASTRA_GATEWAY_PROVIDER, MEMORY_GATEWAY_DEFAULT_URL, MEMORY_GATEWAY_PROVIDER, OBSERVABILITY_AUTH_PREFIX, STORAGE_DEFAULTS, THINKING_LEVEL_VALUES, THREAD_ACTIVE_MODEL_PACK_ID_KEY, VIEWPORT_PRESETS, WEB_SEARCH_PROVIDER_VALUES, checkProfileProviderMismatch, createBrowserFromSettings, defaultVoiceEngine, getCustomProviderId, getProfileProvider, getSettingsPath, isThinkingLevelSetting, loadSettings, migrateLegacyVariedPack, parseCustomProviders, parseThreadSettings, parseViewportInput, resolveDefaultThinkingLevel, resolveLspSetting, resolveModePackModels, resolveModelDefaults, resolveOmModel, resolveOmRoleModel, resolveThreadActiveModelPackId, saveSettings, setProfileProvider, stripMastraCodeCustomProviderPrefix, toCustomProviderModelId };
|
|
927
|
+
export { GITHUB_POLL_INTERVAL_DEFAULT_MS, GITHUB_POLL_INTERVAL_MAX_MS, GITHUB_POLL_INTERVAL_MIN_MS, MASTRA_GATEWAY_DEFAULT_URL, MASTRA_GATEWAY_PROVIDER, MEMORY_GATEWAY_DEFAULT_URL, MEMORY_GATEWAY_PROVIDER, OBSERVABILITY_AUTH_PREFIX, STORAGE_DEFAULTS, THINKING_LEVEL_VALUES, THREAD_ACTIVE_MODEL_PACK_ID_KEY, THREAD_FALLBACK_STATUS_KEY, VIEWPORT_PRESETS, WEB_SEARCH_PROVIDER_VALUES, checkProfileProviderMismatch, createBrowserFromSettings, defaultVoiceEngine, findModePackForModel, getCustomProviderId, getProfileProvider, getSettingsPath, isThinkingLevelSetting, loadSettings, migrateAccountPreferences, migrateLegacyVariedPack, parseCustomProviders, parseThreadSettings, parseViewportInput, pruneRemovedAccountPreferences, resolveDefaultThinkingLevel, resolveLspSetting, resolveModePackModels, resolveModelDefaults, resolveOmModel, resolveOmRoleModel, resolveThreadActiveModelPackId, saveSettings, setProfileProvider, stripMastraCodeCustomProviderPrefix, toCustomProviderModelId };
|
|
848
928
|
|
|
849
929
|
//# sourceMappingURL=settings.js.map
|