@mastra/code-sdk 1.1.4-alpha.0 → 1.2.0-alpha.10
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/CHANGELOG.md +161 -0
- package/dist/agents/credential-resolver.d.ts +6 -0
- package/dist/agents/credential-resolver.d.ts.map +1 -1
- package/dist/agents/credential-resolver.js +14 -4
- package/dist/agents/credential-resolver.js.map +1 -1
- package/dist/agents/mastracode-gateway.d.ts.map +1 -1
- package/dist/agents/mastracode-gateway.js +27 -13
- package/dist/agents/mastracode-gateway.js.map +1 -1
- package/dist/agents/model.d.ts +16 -1
- package/dist/agents/model.d.ts.map +1 -1
- package/dist/agents/model.js +26 -7
- package/dist/agents/model.js.map +1 -1
- package/dist/headless/flags.js +1 -1
- package/dist/headless/flags.js.map +1 -1
- package/dist/headless/types.d.ts +2 -2
- package/dist/headless/types.d.ts.map +1 -1
- package/dist/headless/types.js +2 -1
- package/dist/headless/types.js.map +1 -1
- package/dist/hooks/executor.d.ts.map +1 -1
- package/dist/hooks/executor.js +1 -0
- package/dist/hooks/executor.js.map +1 -1
- package/dist/hooks/manager.d.ts +9 -2
- package/dist/hooks/manager.d.ts.map +1 -1
- package/dist/hooks/manager.js +19 -3
- package/dist/hooks/manager.js.map +1 -1
- package/dist/hooks/types.d.ts +20 -0
- package/dist/hooks/types.d.ts.map +1 -1
- package/dist/hooks/types.js.map +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +6 -3
- package/dist/index.js.map +1 -1
- package/dist/mcp/manager.d.ts +27 -0
- package/dist/mcp/manager.d.ts.map +1 -1
- package/dist/mcp/manager.js +128 -10
- package/dist/mcp/manager.js.map +1 -1
- package/dist/mcp/state.d.ts +33 -0
- package/dist/mcp/state.d.ts.map +1 -0
- package/dist/mcp/state.js +88 -0
- package/dist/mcp/state.js.map +1 -0
- package/dist/mcp/types.d.ts +13 -0
- package/dist/mcp/types.d.ts.map +1 -1
- package/dist/onboarding/settings.d.ts +86 -6
- package/dist/onboarding/settings.d.ts.map +1 -1
- package/dist/onboarding/settings.js +145 -13
- package/dist/onboarding/settings.js.map +1 -1
- package/dist/providers/claude-max.d.ts +13 -0
- package/dist/providers/claude-max.d.ts.map +1 -1
- package/dist/providers/claude-max.js +83 -3
- package/dist/providers/claude-max.js.map +1 -1
- package/dist/providers/openai-codex.d.ts +3 -1
- package/dist/providers/openai-codex.d.ts.map +1 -1
- package/dist/providers/openai-codex.js +13 -2
- package/dist/providers/openai-codex.js.map +1 -1
- package/dist/schema.d.ts +11 -5
- package/dist/schema.d.ts.map +1 -1
- package/dist/schema.js +5 -4
- package/dist/schema.js.map +1 -1
- package/package.json +17 -17
|
@@ -55,7 +55,7 @@ export declare const MEMORY_GATEWAY_PROVIDER = "mastra-gateway";
|
|
|
55
55
|
/** @deprecated Renamed to {@link MASTRA_GATEWAY_DEFAULT_URL}. */
|
|
56
56
|
export declare const MEMORY_GATEWAY_DEFAULT_URL = "https://gateway-api.mastra.ai";
|
|
57
57
|
/** Valid persisted thinking level values. */
|
|
58
|
-
export type ThinkingLevelSetting = 'off' | 'low' | 'medium' | 'high' | 'xhigh';
|
|
58
|
+
export type ThinkingLevelSetting = 'off' | 'low' | 'medium' | 'high' | 'xhigh' | 'max';
|
|
59
59
|
/** Browser provider type. */
|
|
60
60
|
export type BrowserProvider = 'stagehand' | 'agent-browser';
|
|
61
61
|
/** Direct TUI `!` shell passthrough mode. */
|
|
@@ -83,11 +83,55 @@ export interface VoiceSettings {
|
|
|
83
83
|
}
|
|
84
84
|
/** Stagehand environment type. */
|
|
85
85
|
export type StagehandEnv = 'LOCAL' | 'BROWSERBASE';
|
|
86
|
+
/**
|
|
87
|
+
* Browser viewport: explicit dimensions, or `'window'` to follow the real
|
|
88
|
+
* browser window instead of emulating a fixed size.
|
|
89
|
+
*/
|
|
90
|
+
export type BrowserViewport = {
|
|
91
|
+
width: number;
|
|
92
|
+
height: number;
|
|
93
|
+
} | 'window';
|
|
94
|
+
/** Named viewport sizes offered by `/browser set viewport`. */
|
|
95
|
+
export declare const VIEWPORT_PRESETS: {
|
|
96
|
+
readonly desktop: {
|
|
97
|
+
readonly width: 1280;
|
|
98
|
+
readonly height: 720;
|
|
99
|
+
};
|
|
100
|
+
readonly 'desktop-hd': {
|
|
101
|
+
readonly width: 1920;
|
|
102
|
+
readonly height: 1080;
|
|
103
|
+
};
|
|
104
|
+
readonly laptop: {
|
|
105
|
+
readonly width: 1440;
|
|
106
|
+
readonly height: 900;
|
|
107
|
+
};
|
|
108
|
+
readonly tablet: {
|
|
109
|
+
readonly width: 768;
|
|
110
|
+
readonly height: 1024;
|
|
111
|
+
};
|
|
112
|
+
readonly mobile: {
|
|
113
|
+
readonly width: 390;
|
|
114
|
+
readonly height: 844;
|
|
115
|
+
};
|
|
116
|
+
};
|
|
117
|
+
export type ViewportPreset = keyof typeof VIEWPORT_PRESETS;
|
|
118
|
+
/**
|
|
119
|
+
* Parse a `WIDTHxHEIGHT` string (e.g. `1280x720`), a preset name, or `window`.
|
|
120
|
+
* Returns undefined when the input is not a usable viewport.
|
|
121
|
+
*/
|
|
122
|
+
export declare function parseViewportInput(input: string): BrowserViewport | undefined;
|
|
86
123
|
/** Stagehand-specific browser settings. */
|
|
87
124
|
export interface StagehandSettings {
|
|
88
125
|
env: StagehandEnv;
|
|
89
126
|
apiKey?: string;
|
|
90
127
|
projectId?: string;
|
|
128
|
+
/**
|
|
129
|
+
* Model Stagehand uses for its AI operations, as `provider/model`
|
|
130
|
+
* (for example `anthropic/claude-sonnet-4-5`). Stagehand resolves the
|
|
131
|
+
* provider's API key from the environment (`ANTHROPIC_API_KEY`,
|
|
132
|
+
* `OPENAI_API_KEY`, and so on). Defaults to Stagehand's own default.
|
|
133
|
+
*/
|
|
134
|
+
model?: string;
|
|
91
135
|
/** Whether to preserve the user data directory after the browser closes. */
|
|
92
136
|
preserveUserDataDir?: boolean;
|
|
93
137
|
}
|
|
@@ -104,11 +148,11 @@ export interface BrowserSettings {
|
|
|
104
148
|
provider: BrowserProvider;
|
|
105
149
|
/** Whether to run headless (no visible browser window). */
|
|
106
150
|
headless: boolean;
|
|
107
|
-
/**
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
151
|
+
/**
|
|
152
|
+
* Browser viewport dimensions, or `'window'` to disable viewport emulation so
|
|
153
|
+
* the page follows the real browser window.
|
|
154
|
+
*/
|
|
155
|
+
viewport?: BrowserViewport;
|
|
112
156
|
/** CDP URL for connecting to an existing browser. */
|
|
113
157
|
cdpUrl?: string;
|
|
114
158
|
/** Path to a Chrome/Chromium user data directory (profile). */
|
|
@@ -142,6 +186,13 @@ export interface GlobalSettings {
|
|
|
142
186
|
activeModelPackId: string | null;
|
|
143
187
|
/** Explicit per-mode overrides — used when no activeModelPackId is set. */
|
|
144
188
|
modeDefaults: Record<string, string>;
|
|
189
|
+
/**
|
|
190
|
+
* Per-mode reasoning-effort defaults (e.g. { build: "high", plan: "xhigh" }).
|
|
191
|
+
* Resolved at request time; falls back to `preferences.thinkingLevel` for
|
|
192
|
+
* modes without an entry. Overridden per-session via /think or the session
|
|
193
|
+
* settings panel.
|
|
194
|
+
*/
|
|
195
|
+
modeThinkingDefaults: Record<string, ThinkingLevelSetting>;
|
|
145
196
|
/**
|
|
146
197
|
* Active OM pack ID (e.g. "gemini", "anthropic", "custom").
|
|
147
198
|
* When set, the OM model is resolved from the pack at startup so pack
|
|
@@ -237,9 +288,22 @@ export declare const OBSERVABILITY_AUTH_PREFIX = "observability:";
|
|
|
237
288
|
export declare const STORAGE_DEFAULTS: StorageSettings;
|
|
238
289
|
/** Default STT engine: on-device macOS recognizer where available, else cloud. */
|
|
239
290
|
export declare function defaultVoiceEngine(): VoiceEngine;
|
|
291
|
+
export declare const THINKING_LEVEL_VALUES: ThinkingLevelSetting[];
|
|
292
|
+
export declare function isThinkingLevelSetting(value: unknown): value is ThinkingLevelSetting;
|
|
240
293
|
export declare function getSettingsPath(): string;
|
|
241
294
|
export declare function getCustomProviderId(name: string): string;
|
|
242
295
|
export declare function toCustomProviderModelId(providerName: string, modelName: string): string;
|
|
296
|
+
/**
|
|
297
|
+
* The shared gateway catalog namespaces provider keys under their owning
|
|
298
|
+
* gateway id, so a custom provider's models surface in the `/models` catalog
|
|
299
|
+
* as `mastracode/<providerId>/<model>` instead of the canonical
|
|
300
|
+
* `<providerId>/<model>` that model resolution expects. Persisting the
|
|
301
|
+
* gateway-qualified id verbatim breaks lookup later (the provider is parsed
|
|
302
|
+
* as `mastracode`). Strip the prefix before saving — but only when the
|
|
303
|
+
* middle segment matches one of the user's configured custom providers, so
|
|
304
|
+
* legitimate `mastracode/...` gateway-routed ids are left untouched.
|
|
305
|
+
*/
|
|
306
|
+
export declare function stripMastraCodeCustomProviderPrefix(modelId: string, customProviders: Array<Pick<CustomProviderSetting, 'name'>>): string;
|
|
243
307
|
export declare function parseCustomProviders(rawProviders: unknown): CustomProviderSetting[];
|
|
244
308
|
export declare function migrateLegacyVariedPack(settings: GlobalSettings): boolean;
|
|
245
309
|
export declare function loadSettings(filePath?: string): GlobalSettings;
|
|
@@ -275,6 +339,22 @@ export declare function resolveModelDefaults(settings: GlobalSettings, builtinPa
|
|
|
275
339
|
id: string;
|
|
276
340
|
models: Record<string, string>;
|
|
277
341
|
}>): Record<string, string>;
|
|
342
|
+
/** Where a resolved default thinking level came from. */
|
|
343
|
+
export type ThinkingLevelSource = 'mode-default' | 'global';
|
|
344
|
+
/**
|
|
345
|
+
* Resolve the default reasoning-effort level for a mode.
|
|
346
|
+
*
|
|
347
|
+
* Lookup order:
|
|
348
|
+
* 1. `models.modeThinkingDefaults[mode]` when set for the mode.
|
|
349
|
+
* 2. The global `preferences.thinkingLevel`.
|
|
350
|
+
*
|
|
351
|
+
* Session-level overrides (via /think or the session settings panel) take
|
|
352
|
+
* precedence over both and are handled by the caller.
|
|
353
|
+
*/
|
|
354
|
+
export declare function resolveDefaultThinkingLevel(settings: GlobalSettings, mode?: string | null): {
|
|
355
|
+
level: ThinkingLevelSetting;
|
|
356
|
+
source: ThinkingLevelSource;
|
|
357
|
+
};
|
|
278
358
|
/**
|
|
279
359
|
* Resolve the effective model ID for one of the two OM roles.
|
|
280
360
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"settings.d.ts","sourceRoot":"","sources":["../../src/onboarding/settings.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAIH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAC1D,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AAMxD,yEAAyE;AACzE,MAAM,WAAW,UAAU;IACzB,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC/B,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,+DAA+D;AAC/D,MAAM,WAAW,qBAAqB;IACpC,IAAI,EAAE,MAAM,CAAC;IACb,GAAG,EAAE,MAAM,CAAC;IACZ,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,MAAM,EAAE,CAAC;CAClB;AAED,4BAA4B;AAC5B,MAAM,MAAM,cAAc,GAAG,QAAQ,GAAG,IAAI,CAAC;AAE7C,wCAAwC;AACxC,MAAM,WAAW,qBAAqB;IACpC,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,4CAA4C;AAC5C,MAAM,WAAW,iBAAiB;IAChC,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,WAAW,CAAC,EAAE,OAAO,CAAC;IAC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T_URL;
|
|
21
|
+
/** Named viewport sizes offered by `/browser set viewport`. */
|
|
22
|
+
const VIEWPORT_PRESETS = {
|
|
23
|
+
desktop: {
|
|
24
|
+
width: 1280,
|
|
25
|
+
height: 720
|
|
26
|
+
},
|
|
27
|
+
"desktop-hd": {
|
|
28
|
+
width: 1920,
|
|
29
|
+
height: 1080
|
|
30
|
+
},
|
|
31
|
+
laptop: {
|
|
32
|
+
width: 1440,
|
|
33
|
+
height: 900
|
|
34
|
+
},
|
|
35
|
+
tablet: {
|
|
36
|
+
width: 768,
|
|
37
|
+
height: 1024
|
|
38
|
+
},
|
|
39
|
+
mobile: {
|
|
40
|
+
width: 390,
|
|
41
|
+
height: 844
|
|
42
|
+
}
|
|
43
|
+
};
|
|
44
|
+
/**
|
|
45
|
+
* Largest viewport dimension accepted. Guards against typos that would launch a
|
|
46
|
+
* browser far larger than any display.
|
|
47
|
+
*/
|
|
48
|
+
const MAX_VIEWPORT_DIMENSION = 1e4;
|
|
49
|
+
function isValidDimension(value) {
|
|
50
|
+
return typeof value === "number" && Number.isInteger(value) && value > 0 && value <= MAX_VIEWPORT_DIMENSION;
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* Parse a `WIDTHxHEIGHT` string (e.g. `1280x720`), a preset name, or `window`.
|
|
54
|
+
* Returns undefined when the input is not a usable viewport.
|
|
55
|
+
*/
|
|
56
|
+
function parseViewportInput(input) {
|
|
57
|
+
const value = input.trim().toLowerCase();
|
|
58
|
+
if (!value) return void 0;
|
|
59
|
+
if (value === "window") return "window";
|
|
60
|
+
if (value in VIEWPORT_PRESETS) return { ...VIEWPORT_PRESETS[value] };
|
|
61
|
+
const match = /^(\d+)\s*[x×]\s*(\d+)$/.exec(value);
|
|
62
|
+
if (!match) return void 0;
|
|
63
|
+
const width = Number(match[1]);
|
|
64
|
+
const height = Number(match[2]);
|
|
65
|
+
if (!isValidDimension(width) || !isValidDimension(height)) return void 0;
|
|
66
|
+
return {
|
|
67
|
+
width,
|
|
68
|
+
height
|
|
69
|
+
};
|
|
70
|
+
}
|
|
21
71
|
/** Auth key prefix for observability tokens stored per-resource in auth.json */
|
|
22
72
|
const OBSERVABILITY_AUTH_PREFIX = "observability:";
|
|
23
73
|
const STORAGE_DEFAULTS = {
|
|
@@ -41,6 +91,7 @@ const DEFAULTS = {
|
|
|
41
91
|
models: {
|
|
42
92
|
activeModelPackId: null,
|
|
43
93
|
modeDefaults: {},
|
|
94
|
+
modeThinkingDefaults: {},
|
|
44
95
|
activeOmPackId: null,
|
|
45
96
|
omModelOverride: null,
|
|
46
97
|
observerModelOverride: null,
|
|
@@ -71,10 +122,7 @@ const DEFAULTS = {
|
|
|
71
122
|
enabled: false,
|
|
72
123
|
provider: "stagehand",
|
|
73
124
|
headless: false,
|
|
74
|
-
viewport: {
|
|
75
|
-
width: 1280,
|
|
76
|
-
height: 720
|
|
77
|
-
},
|
|
125
|
+
viewport: { ...VIEWPORT_PRESETS.desktop },
|
|
78
126
|
stagehand: { env: "LOCAL" }
|
|
79
127
|
},
|
|
80
128
|
shellPassthrough: { mode: "default" },
|
|
@@ -97,7 +145,8 @@ const THINKING_LEVEL_VALUES = [
|
|
|
97
145
|
"low",
|
|
98
146
|
"medium",
|
|
99
147
|
"high",
|
|
100
|
-
"xhigh"
|
|
148
|
+
"xhigh",
|
|
149
|
+
"max"
|
|
101
150
|
];
|
|
102
151
|
const QUIET_MODE_MAX_TOOL_PREVIEW_LINES_MAX = 8;
|
|
103
152
|
const loadedSignalSettings = /* @__PURE__ */ new WeakMap();
|
|
@@ -114,6 +163,15 @@ function signalSettingsEqual(left, right) {
|
|
|
114
163
|
function parseThinkingLevel(value) {
|
|
115
164
|
return typeof value === "string" && THINKING_LEVEL_VALUES.includes(value) ? value : DEFAULTS.preferences.thinkingLevel;
|
|
116
165
|
}
|
|
166
|
+
function isThinkingLevelSetting(value) {
|
|
167
|
+
return typeof value === "string" && THINKING_LEVEL_VALUES.includes(value);
|
|
168
|
+
}
|
|
169
|
+
function parseModeThinkingDefaults(value) {
|
|
170
|
+
if (!value || typeof value !== "object") return {};
|
|
171
|
+
const result = {};
|
|
172
|
+
for (const [mode, level] of Object.entries(value)) if (isThinkingLevelSetting(level)) result[mode] = level;
|
|
173
|
+
return result;
|
|
174
|
+
}
|
|
117
175
|
function parseQuietModeMaxToolPreviewLines(value) {
|
|
118
176
|
const rawValue = typeof value === "number" && Number.isFinite(value) ? value : DEFAULTS.preferences.quietModeMaxToolPreviewLines;
|
|
119
177
|
return Math.min(QUIET_MODE_MAX_TOOL_PREVIEW_LINES_MAX, Math.max(0, Math.floor(rawValue)));
|
|
@@ -160,6 +218,23 @@ function toCustomProviderModelId(providerName, modelName) {
|
|
|
160
218
|
if (trimmedModelName.startsWith(providerPrefix)) return trimmedModelName;
|
|
161
219
|
return `${providerId}/${trimmedModelName}`;
|
|
162
220
|
}
|
|
221
|
+
/**
|
|
222
|
+
* The shared gateway catalog namespaces provider keys under their owning
|
|
223
|
+
* gateway id, so a custom provider's models surface in the `/models` catalog
|
|
224
|
+
* as `mastracode/<providerId>/<model>` instead of the canonical
|
|
225
|
+
* `<providerId>/<model>` that model resolution expects. Persisting the
|
|
226
|
+
* gateway-qualified id verbatim breaks lookup later (the provider is parsed
|
|
227
|
+
* as `mastracode`). Strip the prefix before saving — but only when the
|
|
228
|
+
* middle segment matches one of the user's configured custom providers, so
|
|
229
|
+
* legitimate `mastracode/...` gateway-routed ids are left untouched.
|
|
230
|
+
*/
|
|
231
|
+
function stripMastraCodeCustomProviderPrefix(modelId, customProviders) {
|
|
232
|
+
if (!modelId.startsWith("mastracode/")) return modelId;
|
|
233
|
+
const rest = modelId.slice(11);
|
|
234
|
+
const [providerId, ...modelParts] = rest.split("/");
|
|
235
|
+
if (!providerId || modelParts.length === 0 || modelParts.some((part) => part.length === 0)) return modelId;
|
|
236
|
+
return customProviders.some((provider) => getCustomProviderId(provider.name) === providerId) ? rest : modelId;
|
|
237
|
+
}
|
|
163
238
|
function parseCustomProviders(rawProviders) {
|
|
164
239
|
if (!Array.isArray(rawProviders)) return [];
|
|
165
240
|
const parsedProviders = [];
|
|
@@ -188,13 +263,49 @@ function parseCustomProviders(rawProviders) {
|
|
|
188
263
|
const BROWSER_PROVIDERS = /* @__PURE__ */ new Set(["stagehand", "agent-browser"]);
|
|
189
264
|
const STAGEHAND_ENVS = /* @__PURE__ */ new Set(["LOCAL", "BROWSERBASE"]);
|
|
190
265
|
/**
|
|
266
|
+
* Normalize a Stagehand model id, which must be provider-qualified.
|
|
267
|
+
*
|
|
268
|
+
* Stagehand reads the segment before the first slash as the provider, so a
|
|
269
|
+
* bare id like `gpt-4.1` is rejected as an unknown provider and a trailing
|
|
270
|
+
* slash leaves an empty model name that only fails once a request is made.
|
|
271
|
+
* Neither is usable, so both are dropped here rather than persisted.
|
|
272
|
+
*
|
|
273
|
+
* The provider name itself is checked where the command is issued, which can
|
|
274
|
+
* name the supported providers in an error; this module is on the startup path
|
|
275
|
+
* and only imports Stagehand lazily.
|
|
276
|
+
*
|
|
277
|
+
* @returns the trimmed model id, or undefined when it is unusable.
|
|
278
|
+
*/
|
|
279
|
+
function parseStagehandModel(value) {
|
|
280
|
+
if (typeof value !== "string") return void 0;
|
|
281
|
+
const model = value.trim();
|
|
282
|
+
const separator = model.indexOf("/");
|
|
283
|
+
if (separator <= 0) return void 0;
|
|
284
|
+
return model.slice(separator + 1).trim() ? model : void 0;
|
|
285
|
+
}
|
|
286
|
+
/**
|
|
287
|
+
* Validate a viewport read from settings.json, falling back to the default when
|
|
288
|
+
* it is missing or malformed.
|
|
289
|
+
*/
|
|
290
|
+
function parseStoredViewport(raw) {
|
|
291
|
+
if (raw === "window") return "window";
|
|
292
|
+
if (raw && typeof raw === "object") {
|
|
293
|
+
const { width, height } = raw;
|
|
294
|
+
if (isValidDimension(width) && isValidDimension(height)) return {
|
|
295
|
+
width,
|
|
296
|
+
height
|
|
297
|
+
};
|
|
298
|
+
}
|
|
299
|
+
return { ...VIEWPORT_PRESETS.desktop };
|
|
300
|
+
}
|
|
301
|
+
/**
|
|
191
302
|
* Deep-merge and validate browser settings from JSON.
|
|
192
303
|
* Explicitly validates types to handle malformed settings.json gracefully.
|
|
193
304
|
*/
|
|
194
305
|
function parseBrowserSettings(rawBrowser) {
|
|
195
306
|
const raw = rawBrowser && typeof rawBrowser === "object" ? rawBrowser : {};
|
|
196
|
-
const rawViewport = raw.viewport && typeof raw.viewport === "object" ? raw.viewport : {};
|
|
197
307
|
const rawStagehand = raw.stagehand && typeof raw.stagehand === "object" ? raw.stagehand : {};
|
|
308
|
+
const stagehandModel = parseStagehandModel(rawStagehand.model);
|
|
198
309
|
const rawAgentBrowser = raw.agentBrowser && typeof raw.agentBrowser === "object" ? raw.agentBrowser : {};
|
|
199
310
|
return {
|
|
200
311
|
enabled: typeof raw.enabled === "boolean" ? raw.enabled : DEFAULTS.browser.enabled,
|
|
@@ -203,15 +314,13 @@ function parseBrowserSettings(rawBrowser) {
|
|
|
203
314
|
cdpUrl: typeof raw.cdpUrl === "string" && raw.cdpUrl.trim() ? raw.cdpUrl.trim() : void 0,
|
|
204
315
|
profile: typeof raw.profile === "string" && raw.profile.trim() ? raw.profile.trim() : void 0,
|
|
205
316
|
executablePath: typeof raw.executablePath === "string" && raw.executablePath.trim() ? raw.executablePath.trim() : void 0,
|
|
206
|
-
viewport:
|
|
207
|
-
width: typeof rawViewport.width === "number" ? rawViewport.width : DEFAULTS.browser.viewport.width,
|
|
208
|
-
height: typeof rawViewport.height === "number" ? rawViewport.height : DEFAULTS.browser.viewport.height
|
|
209
|
-
},
|
|
317
|
+
viewport: parseStoredViewport(raw.viewport),
|
|
210
318
|
scope: typeof raw.scope === "string" && (raw.scope === "shared" || raw.scope === "thread") ? raw.scope : void 0,
|
|
211
319
|
stagehand: {
|
|
212
320
|
env: typeof rawStagehand.env === "string" && STAGEHAND_ENVS.has(rawStagehand.env) ? rawStagehand.env : DEFAULTS.browser.stagehand.env,
|
|
213
321
|
...typeof rawStagehand.apiKey === "string" && rawStagehand.apiKey.trim() ? { apiKey: rawStagehand.apiKey.trim() } : {},
|
|
214
322
|
...typeof rawStagehand.projectId === "string" && rawStagehand.projectId.trim() ? { projectId: rawStagehand.projectId.trim() } : {},
|
|
323
|
+
...stagehandModel ? { model: stagehandModel } : {},
|
|
215
324
|
...typeof rawStagehand.preserveUserDataDir === "boolean" ? { preserveUserDataDir: rawStagehand.preserveUserDataDir } : {}
|
|
216
325
|
},
|
|
217
326
|
agentBrowser: typeof rawAgentBrowser.storageState === "string" && rawAgentBrowser.storageState.trim() ? { storageState: rawAgentBrowser.storageState.trim() } : void 0
|
|
@@ -384,7 +493,8 @@ function loadSettings(filePath = getSettingsPath()) {
|
|
|
384
493
|
},
|
|
385
494
|
models: {
|
|
386
495
|
...DEFAULTS.models,
|
|
387
|
-
...raw.models
|
|
496
|
+
...raw.models,
|
|
497
|
+
modeThinkingDefaults: parseModeThinkingDefaults(raw.models?.modeThinkingDefaults)
|
|
388
498
|
},
|
|
389
499
|
preferences: parsePreferences(raw.preferences),
|
|
390
500
|
storage: {
|
|
@@ -494,6 +604,27 @@ function resolveModelDefaults(settings, builtinPacks) {
|
|
|
494
604
|
return modeDefaults;
|
|
495
605
|
}
|
|
496
606
|
/**
|
|
607
|
+
* Resolve the default reasoning-effort level for a mode.
|
|
608
|
+
*
|
|
609
|
+
* Lookup order:
|
|
610
|
+
* 1. `models.modeThinkingDefaults[mode]` when set for the mode.
|
|
611
|
+
* 2. The global `preferences.thinkingLevel`.
|
|
612
|
+
*
|
|
613
|
+
* Session-level overrides (via /think or the session settings panel) take
|
|
614
|
+
* precedence over both and are handled by the caller.
|
|
615
|
+
*/
|
|
616
|
+
function resolveDefaultThinkingLevel(settings, mode) {
|
|
617
|
+
const modeLevel = mode ? settings.models.modeThinkingDefaults[mode] : void 0;
|
|
618
|
+
if (modeLevel) return {
|
|
619
|
+
level: modeLevel,
|
|
620
|
+
source: "mode-default"
|
|
621
|
+
};
|
|
622
|
+
return {
|
|
623
|
+
level: settings.preferences.thinkingLevel,
|
|
624
|
+
source: "global"
|
|
625
|
+
};
|
|
626
|
+
}
|
|
627
|
+
/**
|
|
497
628
|
* Resolve the effective model ID for one of the two OM roles.
|
|
498
629
|
*
|
|
499
630
|
* Lookup order:
|
|
@@ -607,7 +738,8 @@ async function createBrowserFromSettings(settings) {
|
|
|
607
738
|
};
|
|
608
739
|
const authStorage = new AuthStorage();
|
|
609
740
|
const cred = authStorage.get("openai-codex");
|
|
610
|
-
if (
|
|
741
|
+
if (stagehand?.model) stagehandOpts.model = stagehand.model;
|
|
742
|
+
else if (cred?.type === "oauth") {
|
|
611
743
|
const accountId = cred.accountId;
|
|
612
744
|
stagehandOpts.model = {
|
|
613
745
|
modelName: "openai/gpt-5.4-mini",
|
|
@@ -651,6 +783,6 @@ async function createBrowserFromSettings(settings) {
|
|
|
651
783
|
throw new Error(`Unsupported browser provider: ${provider}`);
|
|
652
784
|
}
|
|
653
785
|
//#endregion
|
|
654
|
-
export { MASTRA_GATEWAY_DEFAULT_URL, MASTRA_GATEWAY_PROVIDER, MEMORY_GATEWAY_DEFAULT_URL, MEMORY_GATEWAY_PROVIDER, OBSERVABILITY_AUTH_PREFIX, STORAGE_DEFAULTS, THREAD_ACTIVE_MODEL_PACK_ID_KEY, checkProfileProviderMismatch, createBrowserFromSettings, defaultVoiceEngine, getCustomProviderId, getProfileProvider, getSettingsPath, loadSettings, migrateLegacyVariedPack, parseCustomProviders, parseThreadSettings, resolveModelDefaults, resolveOmModel, resolveOmRoleModel, resolveThreadActiveModelPackId, saveSettings, setProfileProvider, toCustomProviderModelId };
|
|
786
|
+
export { 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, checkProfileProviderMismatch, createBrowserFromSettings, defaultVoiceEngine, getCustomProviderId, getProfileProvider, getSettingsPath, isThinkingLevelSetting, loadSettings, migrateLegacyVariedPack, parseCustomProviders, parseThreadSettings, parseViewportInput, resolveDefaultThinkingLevel, resolveModelDefaults, resolveOmModel, resolveOmRoleModel, resolveThreadActiveModelPackId, saveSettings, setProfileProvider, stripMastraCodeCustomProviderPrefix, toCustomProviderModelId };
|
|
655
787
|
|
|
656
788
|
//# sourceMappingURL=settings.js.map
|