@mastra/code-sdk 1.8.3-alpha.0 → 1.8.3-alpha.1

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.
@@ -0,0 +1,41 @@
1
+ //#region src/providers/model-ids.ts
2
+ /**
3
+ * Model-id helpers shared by the model gateway and the browser settings
4
+ * module. Kept dependency-free so neither side has to import the other.
5
+ */
6
+ const OPENAI_PREFIX = "openai/";
7
+ const ANTHROPIC_PREFIX = "anthropic/";
8
+ const MASTRA_GATEWAY_PREFIX = "mastra/";
9
+ /** Anthropic's API only accepts dashed ids (`claude-opus-4-6`), but catalogs may list dotted ones. */
10
+ function normalizeAnthropicModelId(modelId) {
11
+ return modelId.replace(/\.(?=\d)/g, "-");
12
+ }
13
+ /**
14
+ * The Codex ChatGPT-account endpoint serves some OpenAI models only under a
15
+ * `-codex` id. Applied wherever a model id is sent over Codex OAuth (chat
16
+ * agents and Stagehand alike) so both paths hit the same upstream model.
17
+ */
18
+ const CODEX_OPENAI_MODEL_REMAPS = {
19
+ "gpt-5.3": "gpt-5.3-codex",
20
+ "gpt-5.2": "gpt-5.2-codex",
21
+ "gpt-5.1": "gpt-5.1-codex",
22
+ "gpt-5.1-mini": "gpt-5.1-codex-mini",
23
+ "gpt-5": "gpt-5-codex"
24
+ };
25
+ function stripMastraGatewayPrefix(modelId) {
26
+ return modelId.startsWith("mastra/") ? modelId.substring(7) : modelId;
27
+ }
28
+ function remapOpenAIModelForCodexOAuth(modelId) {
29
+ const normalizedModelId = stripMastraGatewayPrefix(modelId);
30
+ if (!normalizedModelId.startsWith("openai/")) return modelId;
31
+ const openaiModelId = normalizedModelId.substring(7);
32
+ if (openaiModelId.includes("-codex")) return modelId;
33
+ const codexModelId = CODEX_OPENAI_MODEL_REMAPS[openaiModelId];
34
+ if (!codexModelId) return modelId;
35
+ const remappedModelId = `${OPENAI_PREFIX}${codexModelId}`;
36
+ return modelId.startsWith("mastra/") ? `${MASTRA_GATEWAY_PREFIX}${remappedModelId}` : remappedModelId;
37
+ }
38
+ //#endregion
39
+ export { ANTHROPIC_PREFIX, MASTRA_GATEWAY_PREFIX, OPENAI_PREFIX, normalizeAnthropicModelId, remapOpenAIModelForCodexOAuth, stripMastraGatewayPrefix };
40
+
41
+ //# sourceMappingURL=model-ids.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"model-ids.js","names":[],"sources":["../../src/providers/model-ids.ts"],"sourcesContent":["/**\n * Model-id helpers shared by the model gateway and the browser settings\n * module. Kept dependency-free so neither side has to import the other.\n */\n\nexport const OPENAI_PREFIX = 'openai/';\nexport const ANTHROPIC_PREFIX = 'anthropic/';\nexport const MASTRA_GATEWAY_PREFIX = 'mastra/';\n\n/** Anthropic's API only accepts dashed ids (`claude-opus-4-6`), but catalogs may list dotted ones. */\nexport function normalizeAnthropicModelId(modelId: string): string {\n return modelId.replace(/\\.(?=\\d)/g, '-');\n}\n\n/**\n * The Codex ChatGPT-account endpoint serves some OpenAI models only under a\n * `-codex` id. Applied wherever a model id is sent over Codex OAuth (chat\n * agents and Stagehand alike) so both paths hit the same upstream model.\n */\nconst CODEX_OPENAI_MODEL_REMAPS: Record<string, string> = {\n 'gpt-5.3': 'gpt-5.3-codex',\n 'gpt-5.2': 'gpt-5.2-codex',\n 'gpt-5.1': 'gpt-5.1-codex',\n 'gpt-5.1-mini': 'gpt-5.1-codex-mini',\n 'gpt-5': 'gpt-5-codex',\n};\n\nexport function stripMastraGatewayPrefix(modelId: string): string {\n return modelId.startsWith(MASTRA_GATEWAY_PREFIX) ? modelId.substring(MASTRA_GATEWAY_PREFIX.length) : modelId;\n}\n\nexport function remapOpenAIModelForCodexOAuth(modelId: string): string {\n const normalizedModelId = stripMastraGatewayPrefix(modelId);\n\n if (!normalizedModelId.startsWith(OPENAI_PREFIX)) {\n return modelId;\n }\n\n const openaiModelId = normalizedModelId.substring(OPENAI_PREFIX.length);\n\n if (openaiModelId.includes('-codex')) {\n return modelId;\n }\n\n const codexModelId = CODEX_OPENAI_MODEL_REMAPS[openaiModelId];\n if (!codexModelId) {\n return modelId;\n }\n\n const remappedModelId = `${OPENAI_PREFIX}${codexModelId}`;\n return modelId.startsWith(MASTRA_GATEWAY_PREFIX) ? `${MASTRA_GATEWAY_PREFIX}${remappedModelId}` : remappedModelId;\n}\n"],"mappings":";;;;;AAKA,MAAa,gBAAgB;AAC7B,MAAa,mBAAmB;AAChC,MAAa,wBAAwB;;AAGrC,SAAgB,0BAA0B,SAAyB;CACjE,OAAO,QAAQ,QAAQ,aAAa,GAAG;AACzC;;;;;;AAOA,MAAM,4BAAoD;CACxD,WAAW;CACX,WAAW;CACX,WAAW;CACX,gBAAgB;CAChB,SAAS;AACX;AAEA,SAAgB,yBAAyB,SAAyB;CAChE,OAAO,QAAQ,WAAA,SAAgC,IAAI,QAAQ,UAAU,CAA4B,IAAI;AACvG;AAEA,SAAgB,8BAA8B,SAAyB;CACrE,MAAM,oBAAoB,yBAAyB,OAAO;CAE1D,IAAI,CAAC,kBAAkB,WAAA,SAAwB,GAC7C,OAAO;CAGT,MAAM,gBAAgB,kBAAkB,UAAU,CAAoB;CAEtE,IAAI,cAAc,SAAS,QAAQ,GACjC,OAAO;CAGT,MAAM,eAAe,0BAA0B;CAC/C,IAAI,CAAC,cACH,OAAO;CAGT,MAAM,kBAAkB,GAAG,gBAAgB;CAC3C,OAAO,QAAQ,WAAA,SAAgC,IAAI,GAAG,wBAAwB,oBAAoB;AACpG"}
package/dist/schema.d.ts CHANGED
@@ -108,11 +108,23 @@ export interface MastraCodeState {
108
108
  height: number;
109
109
  } | 'window';
110
110
  cdpUrl?: string;
111
+ profile?: string;
112
+ executablePath?: string;
113
+ scope?: 'shared' | 'thread';
111
114
  stagehand?: {
112
115
  env: 'LOCAL' | 'BROWSERBASE';
113
- apiKey?: string;
114
116
  projectId?: string;
117
+ model?: string;
118
+ preserveUserDataDir?: boolean;
115
119
  };
120
+ agentBrowser?: {
121
+ storageState?: string;
122
+ };
123
+ };
124
+ activeBrowserModel?: {
125
+ modelName?: string;
126
+ source: 'settings' | 'chat-model' | 'codex-oauth' | 'stagehand-default';
127
+ viaCodexOAuth: boolean;
116
128
  };
117
129
  }
118
130
  export declare const stateSchema: z.ZodObject<{
@@ -214,14 +226,34 @@ export declare const stateSchema: z.ZodObject<{
214
226
  height: z.ZodNumber;
215
227
  }, z.core.$strip>, z.ZodLiteral<"window">]>>;
216
228
  cdpUrl: z.ZodOptional<z.ZodString>;
229
+ profile: z.ZodOptional<z.ZodString>;
230
+ executablePath: z.ZodOptional<z.ZodString>;
231
+ scope: z.ZodOptional<z.ZodEnum<{
232
+ thread: "thread";
233
+ shared: "shared";
234
+ }>>;
217
235
  stagehand: z.ZodOptional<z.ZodObject<{
218
236
  env: z.ZodEnum<{
219
237
  LOCAL: "LOCAL";
220
238
  BROWSERBASE: "BROWSERBASE";
221
239
  }>;
222
- apiKey: z.ZodOptional<z.ZodString>;
223
240
  projectId: z.ZodOptional<z.ZodString>;
241
+ model: z.ZodOptional<z.ZodString>;
242
+ preserveUserDataDir: z.ZodOptional<z.ZodBoolean>;
243
+ }, z.core.$strip>>;
244
+ agentBrowser: z.ZodOptional<z.ZodObject<{
245
+ storageState: z.ZodOptional<z.ZodString>;
224
246
  }, z.core.$strip>>;
225
247
  }, z.core.$strip>>;
248
+ activeBrowserModel: z.ZodOptional<z.ZodObject<{
249
+ modelName: z.ZodOptional<z.ZodString>;
250
+ source: z.ZodEnum<{
251
+ settings: "settings";
252
+ "chat-model": "chat-model";
253
+ "codex-oauth": "codex-oauth";
254
+ "stagehand-default": "stagehand-default";
255
+ }>;
256
+ viaCodexOAuth: z.ZodBoolean;
257
+ }, z.core.$strip>>;
226
258
  }, z.core.$strip>;
227
259
  //# sourceMappingURL=schema.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../src/schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,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,GAAG,QAAQ,CAAC;QAC5B,SAAS,CAAC,EAAE;YACV,GAAG,EAAE,OAAO,GAAG,aAAa,CAAC;YAC7B,SAAS,CAAC,EAAE,MAAM,CAAC;YACnB,KAAK,CAAC,EAAE,MAAM,CAAC;YACf,mBAAmB,CAAC,EAAE,OAAO,CAAC;SAC/B,CAAC;QACF,YAAY,CAAC,EAAE;YACb,YAAY,CAAC,EAAE,MAAM,CAAC;SACvB,CAAC;KACH,CAAC;IACF,kBAAkB,CAAC,EAAE;QACnB,SAAS,CAAC,EAAE,MAAM,CAAC;QACnB,MAAM,EAAE,UAAU,GAAG,YAAY,GAAG,aAAa,GAAG,mBAAmB,CAAC;QACxE,aAAa,EAAE,OAAO,CAAC;KACxB,CAAC;CACH;AAED,eAAO,MAAM,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBA8ItB,CAAC"}
package/dist/schema.js CHANGED
@@ -88,11 +88,26 @@ const stateSchema = z.object({
88
88
  height: z.number()
89
89
  }), z.literal("window")]).optional(),
90
90
  cdpUrl: z.string().optional(),
91
+ profile: z.string().optional(),
92
+ executablePath: z.string().optional(),
93
+ scope: z.enum(["shared", "thread"]).optional(),
91
94
  stagehand: z.object({
92
95
  env: z.enum(["LOCAL", "BROWSERBASE"]),
93
- apiKey: z.string().optional(),
94
- projectId: z.string().optional()
95
- }).optional()
96
+ projectId: z.string().optional(),
97
+ model: z.string().optional(),
98
+ preserveUserDataDir: z.boolean().optional()
99
+ }).optional(),
100
+ agentBrowser: z.object({ storageState: z.string().optional() }).optional()
101
+ }).optional(),
102
+ activeBrowserModel: z.object({
103
+ modelName: z.string().optional(),
104
+ source: z.enum([
105
+ "settings",
106
+ "chat-model",
107
+ "codex-oauth",
108
+ "stagehand-default"
109
+ ]),
110
+ viaCodexOAuth: z.boolean()
96
111
  }).optional()
97
112
  });
98
113
  //#endregion
@@ -1 +1 @@
1
- {"version":3,"file":"schema.js","names":[],"sources":["../src/schema.ts"],"sourcesContent":["import { z } from 'zod';\nimport { DEFAULT_CONFIG_DIR, DEFAULT_OM_MODEL_ID } from './constants.js';\nimport { THINKING_LEVEL_VALUES } from './thinking.js';\nimport type { ThinkingLevelSetting } from './thinking.js';\n\nexport type PermissionPolicy = 'allow' | 'ask' | 'deny';\n\nexport type MastraCodeSessionState = {\n currentModelId: string;\n modeId: string;\n};\n\nexport type MastraCodeComposedState = MastraCodeState & MastraCodeSessionState;\n\nexport interface MastraCodeState {\n [key: string]: unknown;\n [key: `subagentModelId_${string}`]: string | undefined;\n subagentModelId?: string;\n projectPath?: string;\n projectName?: string;\n /** Factory project that owns this session. */\n factoryProjectId?: string;\n /** Authoritative organization id seeded by factory at session construction. */\n factoryOrgId?: string;\n /**\n * Factory owns this session but could not resolve its organization. Knowledge\n * capture refuses rather than filing under a substituted identity; without the\n * marker a projectless factory session is indistinguishable from a local one.\n */\n factoryOrgUnresolved?: boolean;\n /** Linked repository used by this session when source-control execution is required. */\n projectRepositoryId?: string;\n /** Active feature branch checked out in the session workdir. */\n branch?: string;\n /**\n * The session's checkout contains third-party content (e.g. a PR branch\n * under review). Project-level instruction files (AGENTS.md, CLAUDE.md)\n * are attacker-writable there and must not be ingested into the system\n * prompt or injected as reminders.\n */\n untrustedCheckout?: boolean;\n /**\n * Trusted git ref (typically the PR's base branch) to serve project\n * instruction files from when the checkout is untrusted. Without it,\n * project-scope instruction files are skipped entirely.\n */\n baseRef?: string;\n /**\n * Skip the home-directory instruction files (~/.claude/AGENTS.md and\n * friends). Hosts running sessions for someone else set this so a run never\n * inherits the machine owner's personal configuration.\n */\n skipGlobalInstructions?: boolean;\n configDir: string;\n homeDir?: string;\n gitBranch?: string;\n lastCommand?: string;\n observerModelId: string;\n reflectorModelId: string;\n observationThreshold: number;\n reflectionThreshold: number;\n cavemanObservations: boolean;\n observeAttachments: 'auto' | boolean;\n omScope?: 'thread' | 'resource';\n /** Explicit model-pack identity for the current thread. */\n activeModelPackId?: string | null;\n /**\n * Pending pack hop written by the account-rotation processor on a cascade\n * hop; cleared back to null once the TUI applies it. Declared here so\n * consumers resolve it as a typed record instead of casting `unknown`.\n */\n mastracodePendingPackFallback?: {\n fromPackId: string;\n toPackId: string;\n toModelId: string;\n threadId?: string;\n reason: 'pool-exhausted' | 'persistent-outage';\n at: string;\n } | null;\n /**\n * Session-level reasoning-effort override. When unset, the effective level is\n * resolved at request time from settings (`models.modeThinkingDefaults[mode]`\n * falling back to `preferences.thinkingLevel`).\n */\n thinkingLevel?: ThinkingLevelSetting;\n yolo: boolean;\n permissionRules: {\n categories: Record<string, PermissionPolicy>;\n tools: Record<string, PermissionPolicy>;\n };\n smartEditing: boolean;\n notifications: 'bell' | 'system' | 'both' | 'off';\n tasks: Array<{\n id?: string;\n content: string;\n status: 'pending' | 'in_progress' | 'completed';\n activeForm: string;\n }>;\n sandboxAllowedPaths: string[];\n pluginSkillPaths: string[];\n pluginCommandPaths: string[];\n pluginInstructions: string[];\n activePlan: {\n title: string;\n plan: string;\n approvedAt: string;\n } | null;\n activeBrowserSettings?: {\n enabled: boolean;\n provider: 'stagehand' | 'agent-browser';\n headless?: boolean;\n viewport?: { width: number; height: number } | 'window';\n cdpUrl?: string;\n stagehand?: {\n env: 'LOCAL' | 'BROWSERBASE';\n apiKey?: string;\n projectId?: string;\n };\n };\n}\n\nexport const stateSchema = z.object({\n // Session-scoped selection.\n // validates state against this schema, so they MUST be declared here — Zod\n // strips unknown keys on parse, which would otherwise silently discard the\n // seeded model and leave the controller with no model selected.\n currentModelId: z.string().optional(),\n modeId: z.string().optional(),\n activeModelPackId: z.string().nullable().optional(),\n subagentModelId: z.string().optional(),\n projectPath: z.string().optional(),\n projectName: z.string().optional(),\n factoryProjectId: z.string().optional(),\n factoryOrgId: z.string().optional(),\n factoryOrgUnresolved: z.boolean().optional(),\n projectRepositoryId: z.string().optional(),\n branch: z.string().optional(),\n // Session operates on an untrusted checkout — suppress AGENTS.md ingestion.\n untrustedCheckout: z.boolean().optional(),\n // Trusted ref to serve instruction files from on untrusted checkouts.\n baseRef: z.string().optional(),\n // Skip the operator machine's home-directory instruction files.\n skipGlobalInstructions: z.boolean().optional(),\n configDir: z.string().default(DEFAULT_CONFIG_DIR),\n homeDir: z.string().optional(),\n gitBranch: z.string().optional(),\n lastCommand: z.string().optional(),\n // Observational Memory model settings\n observerModelId: z.string().default(DEFAULT_OM_MODEL_ID),\n reflectorModelId: z.string().default(DEFAULT_OM_MODEL_ID),\n // Observational Memory threshold settings\n observationThreshold: z.number().default(30_000),\n reflectionThreshold: z.number().default(40_000),\n // Whether observations and reflections use the terse caveman-style instruction.\n // Off by default — caveman style is opt-in via `/om` settings; observers and\n // reflectors fall back to their built-in (prose) behavior unless enabled.\n cavemanObservations: z.boolean().default(false),\n // Whether OM forwards image/file attachment parts to the Observer LLM.\n // 'auto' (default) checks the provider capabilities registry to decide.\n // true/false forces the setting regardless of model capabilities.\n observeAttachments: z.union([z.literal('auto'), z.boolean()]).default('auto'),\n // Observational Memory scope — 'thread' (per-conversation) or 'resource' (shared across threads)\n omScope: z.enum(['thread', 'resource']).optional(),\n // Thinking level for model reasoning effort. Optional: absent means \"no\n // session override\" — the effective level is resolved from settings\n // (per-mode defaults, then the global preference) at request time.\n thinkingLevel: z.preprocess(value => (value === null ? undefined : value), z.enum(THINKING_LEVEL_VALUES).optional()),\n // YOLO mode — auto-approve all tool calls\n yolo: z.boolean().default(false),\n // Permission rules — per-category and per-tool approval policies\n permissionRules: z\n .object({\n categories: z.record(z.string(), z.enum(['allow', 'ask', 'deny'])).default({}),\n tools: z.record(z.string(), z.enum(['allow', 'ask', 'deny'])).default({}),\n })\n .default({ categories: {}, tools: {} }),\n // Smart editing mode — use AST-based analysis for code edits\n smartEditing: z.boolean().default(true),\n // Notification mode — alert when TUI needs user attention\n notifications: z.enum(['bell', 'system', 'both', 'off']).default('off'),\n // Task list (ephemeral per-thread, cleared on thread switch/creation)\n tasks: z\n .array(\n z.object({\n id: z.string().optional(),\n content: z.string(),\n status: z.enum(['pending', 'in_progress', 'completed']),\n activeForm: z.string(),\n }),\n )\n .default([]),\n // Sandbox allowed paths (per-thread, absolute paths allowed in addition to project root)\n sandboxAllowedPaths: z.array(z.string()).default([]),\n // Pending pack hop written by the account-rotation processor on a cascade\n // hop; the TUI consumes it on `state_changed` to apply thread stickiness,\n // then clears it back to null. Must be declared — Zod strips unknown keys.\n mastracodePendingPackFallback: z\n .object({\n fromPackId: z.string(),\n toPackId: z.string(),\n toModelId: z.string(),\n threadId: z.string().optional(),\n reason: z.enum(['pool-exhausted', 'persistent-outage']),\n at: z.string(),\n })\n .nullish(),\n // Asset directories contributed by active plugins.\n pluginSkillPaths: z.array(z.string()).default([]),\n pluginCommandPaths: z.array(z.string()).default([]),\n pluginInstructions: z.array(z.string()).default([]),\n // Active plan (set when a plan is approved in Plan mode)\n activePlan: z\n .object({\n title: z.string(),\n plan: z.string(),\n approvedAt: z.string(),\n })\n .nullable()\n .default(null),\n // Active browser settings (tracks what's actually running vs. what's in the settings file)\n activeBrowserSettings: z\n .object({\n enabled: z.boolean(),\n provider: z.enum(['stagehand', 'agent-browser']),\n headless: z.boolean().optional(),\n viewport: z\n .union([\n z.object({\n width: z.number(),\n height: z.number(),\n }),\n z.literal('window'),\n ])\n .optional(),\n cdpUrl: z.string().optional(),\n stagehand: z\n .object({\n env: z.enum(['LOCAL', 'BROWSERBASE']),\n apiKey: z.string().optional(),\n projectId: z.string().optional(),\n })\n .optional(),\n })\n .optional(),\n});\n"],"mappings":";;;;AAyHA,MAAa,cAAc,EAAE,OAAO;CAKlC,gBAAgB,EAAE,OAAO,CAAC,CAAC,SAAS;CACpC,QAAQ,EAAE,OAAO,CAAC,CAAC,SAAS;CAC5B,mBAAmB,EAAE,OAAO,CAAC,CAAC,SAAS,CAAC,CAAC,SAAS;CAClD,iBAAiB,EAAE,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MAAM,EAAE,OAAO,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC;CAElD,YAAY,EACT,OAAO;EACN,OAAO,EAAE,OAAO;EAChB,MAAM,EAAE,OAAO;EACf,YAAY,EAAE,OAAO;CACvB,CAAC,CAAC,CACD,SAAS,CAAC,CACV,QAAQ,IAAI;CAEf,uBAAuB,EACpB,OAAO;EACN,SAAS,EAAE,QAAQ;EACnB,UAAU,EAAE,KAAK,CAAC,aAAa,eAAe,CAAC;EAC/C,UAAU,EAAE,QAAQ,CAAC,CAAC,SAAS;EAC/B,UAAU,EACP,MAAM,CACL,EAAE,OAAO;GACP,OAAO,EAAE,OAAO;GAChB,QAAQ,EAAE,OAAO;EACnB,CAAC,GACD,EAAE,QAAQ,QAAQ,CACpB,CAAC,CAAC,CACD,SAAS;EACZ,QAAQ,EAAE,OAAO,CAAC,CAAC,SAAS;EAC5B,WAAW,EACR,OAAO;GACN,KAAK,EAAE,KAAK,CAAC,SAAS,aAAa,CAAC;GACpC,QAAQ,EAAE,OAAO,CAAC,CAAC,SAAS;GAC5B,WAAW,EAAE,OAAO,CAAC,CAAC,SAAS;EACjC,CAAC,CAAC,CACD,SAAS;CACd,CAAC,CAAC,CACD,SAAS;AACd,CAAC"}
1
+ {"version":3,"file":"schema.js","names":[],"sources":["../src/schema.ts"],"sourcesContent":["import { z } from 'zod';\nimport { DEFAULT_CONFIG_DIR, DEFAULT_OM_MODEL_ID } from './constants.js';\nimport { THINKING_LEVEL_VALUES } from './thinking.js';\nimport type { ThinkingLevelSetting } from './thinking.js';\n\nexport type PermissionPolicy = 'allow' | 'ask' | 'deny';\n\nexport type MastraCodeSessionState = {\n currentModelId: string;\n modeId: string;\n};\n\nexport type MastraCodeComposedState = MastraCodeState & MastraCodeSessionState;\n\nexport interface MastraCodeState {\n [key: string]: unknown;\n [key: `subagentModelId_${string}`]: string | undefined;\n subagentModelId?: string;\n projectPath?: string;\n projectName?: string;\n /** Factory project that owns this session. */\n factoryProjectId?: string;\n /** Authoritative organization id seeded by factory at session construction. */\n factoryOrgId?: string;\n /**\n * Factory owns this session but could not resolve its organization. Knowledge\n * capture refuses rather than filing under a substituted identity; without the\n * marker a projectless factory session is indistinguishable from a local one.\n */\n factoryOrgUnresolved?: boolean;\n /** Linked repository used by this session when source-control execution is required. */\n projectRepositoryId?: string;\n /** Active feature branch checked out in the session workdir. */\n branch?: string;\n /**\n * The session's checkout contains third-party content (e.g. a PR branch\n * under review). Project-level instruction files (AGENTS.md, CLAUDE.md)\n * are attacker-writable there and must not be ingested into the system\n * prompt or injected as reminders.\n */\n untrustedCheckout?: boolean;\n /**\n * Trusted git ref (typically the PR's base branch) to serve project\n * instruction files from when the checkout is untrusted. Without it,\n * project-scope instruction files are skipped entirely.\n */\n baseRef?: string;\n /**\n * Skip the home-directory instruction files (~/.claude/AGENTS.md and\n * friends). Hosts running sessions for someone else set this so a run never\n * inherits the machine owner's personal configuration.\n */\n skipGlobalInstructions?: boolean;\n configDir: string;\n homeDir?: string;\n gitBranch?: string;\n lastCommand?: string;\n observerModelId: string;\n reflectorModelId: string;\n observationThreshold: number;\n reflectionThreshold: number;\n cavemanObservations: boolean;\n observeAttachments: 'auto' | boolean;\n omScope?: 'thread' | 'resource';\n /** Explicit model-pack identity for the current thread. */\n activeModelPackId?: string | null;\n /**\n * Pending pack hop written by the account-rotation processor on a cascade\n * hop; cleared back to null once the TUI applies it. Declared here so\n * consumers resolve it as a typed record instead of casting `unknown`.\n */\n mastracodePendingPackFallback?: {\n fromPackId: string;\n toPackId: string;\n toModelId: string;\n threadId?: string;\n reason: 'pool-exhausted' | 'persistent-outage';\n at: string;\n } | null;\n /**\n * Session-level reasoning-effort override. When unset, the effective level is\n * resolved at request time from settings (`models.modeThinkingDefaults[mode]`\n * falling back to `preferences.thinkingLevel`).\n */\n thinkingLevel?: ThinkingLevelSetting;\n yolo: boolean;\n permissionRules: {\n categories: Record<string, PermissionPolicy>;\n tools: Record<string, PermissionPolicy>;\n };\n smartEditing: boolean;\n notifications: 'bell' | 'system' | 'both' | 'off';\n tasks: Array<{\n id?: string;\n content: string;\n status: 'pending' | 'in_progress' | 'completed';\n activeForm: string;\n }>;\n sandboxAllowedPaths: string[];\n pluginSkillPaths: string[];\n pluginCommandPaths: string[];\n pluginInstructions: string[];\n activePlan: {\n title: string;\n plan: string;\n approvedAt: string;\n } | null;\n activeBrowserSettings?: {\n enabled: boolean;\n provider: 'stagehand' | 'agent-browser';\n headless?: boolean;\n viewport?: { width: number; height: number } | 'window';\n cdpUrl?: string;\n profile?: string;\n executablePath?: string;\n scope?: 'shared' | 'thread';\n stagehand?: {\n env: 'LOCAL' | 'BROWSERBASE';\n projectId?: string;\n model?: string;\n preserveUserDataDir?: boolean;\n };\n agentBrowser?: {\n storageState?: string;\n };\n };\n activeBrowserModel?: {\n modelName?: string;\n source: 'settings' | 'chat-model' | 'codex-oauth' | 'stagehand-default';\n viaCodexOAuth: boolean;\n };\n}\n\nexport const stateSchema = z.object({\n // Session-scoped selection.\n // validates state against this schema, so they MUST be declared here — Zod\n // strips unknown keys on parse, which would otherwise silently discard the\n // seeded model and leave the controller with no model selected.\n currentModelId: z.string().optional(),\n modeId: z.string().optional(),\n activeModelPackId: z.string().nullable().optional(),\n subagentModelId: z.string().optional(),\n projectPath: z.string().optional(),\n projectName: z.string().optional(),\n factoryProjectId: z.string().optional(),\n factoryOrgId: z.string().optional(),\n factoryOrgUnresolved: z.boolean().optional(),\n projectRepositoryId: z.string().optional(),\n branch: z.string().optional(),\n // Session operates on an untrusted checkout — suppress AGENTS.md ingestion.\n untrustedCheckout: z.boolean().optional(),\n // Trusted ref to serve instruction files from on untrusted checkouts.\n baseRef: z.string().optional(),\n // Skip the operator machine's home-directory instruction files.\n skipGlobalInstructions: z.boolean().optional(),\n configDir: z.string().default(DEFAULT_CONFIG_DIR),\n homeDir: z.string().optional(),\n gitBranch: z.string().optional(),\n lastCommand: z.string().optional(),\n // Observational Memory model settings\n observerModelId: z.string().default(DEFAULT_OM_MODEL_ID),\n reflectorModelId: z.string().default(DEFAULT_OM_MODEL_ID),\n // Observational Memory threshold settings\n observationThreshold: z.number().default(30_000),\n reflectionThreshold: z.number().default(40_000),\n // Whether observations and reflections use the terse caveman-style instruction.\n // Off by default — caveman style is opt-in via `/om` settings; observers and\n // reflectors fall back to their built-in (prose) behavior unless enabled.\n cavemanObservations: z.boolean().default(false),\n // Whether OM forwards image/file attachment parts to the Observer LLM.\n // 'auto' (default) checks the provider capabilities registry to decide.\n // true/false forces the setting regardless of model capabilities.\n observeAttachments: z.union([z.literal('auto'), z.boolean()]).default('auto'),\n // Observational Memory scope — 'thread' (per-conversation) or 'resource' (shared across threads)\n omScope: z.enum(['thread', 'resource']).optional(),\n // Thinking level for model reasoning effort. Optional: absent means \"no\n // session override\" — the effective level is resolved from settings\n // (per-mode defaults, then the global preference) at request time.\n thinkingLevel: z.preprocess(value => (value === null ? undefined : value), z.enum(THINKING_LEVEL_VALUES).optional()),\n // YOLO mode — auto-approve all tool calls\n yolo: z.boolean().default(false),\n // Permission rules — per-category and per-tool approval policies\n permissionRules: z\n .object({\n categories: z.record(z.string(), z.enum(['allow', 'ask', 'deny'])).default({}),\n tools: z.record(z.string(), z.enum(['allow', 'ask', 'deny'])).default({}),\n })\n .default({ categories: {}, tools: {} }),\n // Smart editing mode — use AST-based analysis for code edits\n smartEditing: z.boolean().default(true),\n // Notification mode — alert when TUI needs user attention\n notifications: z.enum(['bell', 'system', 'both', 'off']).default('off'),\n // Task list (ephemeral per-thread, cleared on thread switch/creation)\n tasks: z\n .array(\n z.object({\n id: z.string().optional(),\n content: z.string(),\n status: z.enum(['pending', 'in_progress', 'completed']),\n activeForm: z.string(),\n }),\n )\n .default([]),\n // Sandbox allowed paths (per-thread, absolute paths allowed in addition to project root)\n sandboxAllowedPaths: z.array(z.string()).default([]),\n // Pending pack hop written by the account-rotation processor on a cascade\n // hop; the TUI consumes it on `state_changed` to apply thread stickiness,\n // then clears it back to null. Must be declared — Zod strips unknown keys.\n mastracodePendingPackFallback: z\n .object({\n fromPackId: z.string(),\n toPackId: z.string(),\n toModelId: z.string(),\n threadId: z.string().optional(),\n reason: z.enum(['pool-exhausted', 'persistent-outage']),\n at: z.string(),\n })\n .nullish(),\n // Asset directories contributed by active plugins.\n pluginSkillPaths: z.array(z.string()).default([]),\n pluginCommandPaths: z.array(z.string()).default([]),\n pluginInstructions: z.array(z.string()).default([]),\n // Active plan (set when a plan is approved in Plan mode)\n activePlan: z\n .object({\n title: z.string(),\n plan: z.string(),\n approvedAt: z.string(),\n })\n .nullable()\n .default(null),\n // Active browser settings (tracks what's actually running vs. what's in the settings file)\n activeBrowserSettings: z\n .object({\n enabled: z.boolean(),\n provider: z.enum(['stagehand', 'agent-browser']),\n headless: z.boolean().optional(),\n viewport: z\n .union([\n z.object({\n width: z.number(),\n height: z.number(),\n }),\n z.literal('window'),\n ])\n .optional(),\n cdpUrl: z.string().optional(),\n profile: z.string().optional(),\n executablePath: z.string().optional(),\n scope: z.enum(['shared', 'thread']).optional(),\n stagehand: z\n .object({\n env: z.enum(['LOCAL', 'BROWSERBASE']),\n projectId: z.string().optional(),\n model: z.string().optional(),\n preserveUserDataDir: z.boolean().optional(),\n })\n .optional(),\n agentBrowser: z\n .object({\n storageState: z.string().optional(),\n })\n .optional(),\n })\n .optional(),\n // Model the active Stagehand browser was created with. Resolved once at\n // launch so /browser status reports what is really running even if the\n // user signs in/out of Codex afterwards.\n activeBrowserModel: z\n .object({\n modelName: z.string().optional(),\n source: z.enum(['settings', 'chat-model', 'codex-oauth', 'stagehand-default']),\n viaCodexOAuth: z.boolean(),\n })\n .optional(),\n});\n"],"mappings":";;;;AAqIA,MAAa,cAAc,EAAE,OAAO;CAKlC,gBAAgB,EAAE,OAAO,CAAC,CAAC,SAAS;CACpC,QAAQ,EAAE,OAAO,CAAC,CAAC,SAAS;CAC5B,mBAAmB,EAAE,OAAO,CAAC,CAAC,SAAS,CAAC,CAAC,SAAS;CAClD,iBAAiB,EAAE,OAAO,CAAC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ACd,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mastra/code-sdk",
3
- "version": "1.8.3-alpha.0",
3
+ "version": "1.8.3-alpha.1",
4
4
  "description": "Mastra Code SDK: the agent core behind Mastra Code (everything except the TUI) — build your own UIs and surfaces on top of it",
5
5
  "type": "module",
6
6
  "publishConfig": {
@@ -57,17 +57,17 @@
57
57
  "yaml": "^2.7.1",
58
58
  "zod": "^4.6.4",
59
59
  "@mastra/agent-browser": "0.5.3",
60
- "@mastra/core": "1.71.0-alpha.0",
61
- "@mastra/fastembed": "1.3.1",
62
60
  "@mastra/github-signals": "0.5.0",
63
- "@mastra/duckdb": "1.11.1-alpha.0",
64
- "@mastra/libsql": "1.23.2",
61
+ "@mastra/core": "1.71.0-alpha.1",
62
+ "@mastra/duckdb": "1.11.1-alpha.1",
63
+ "@mastra/libsql": "1.23.3-alpha.0",
65
64
  "@mastra/mcp": "2.1.0",
66
- "@mastra/memory": "1.32.0",
67
- "@mastra/observability": "1.18.0",
68
- "@mastra/pg": "1.27.0",
69
- "@mastra/schema-compat": "1.3.11",
65
+ "@mastra/fastembed": "1.3.2-alpha.0",
66
+ "@mastra/observability": "1.18.1-alpha.0",
67
+ "@mastra/memory": "1.32.1-alpha.0",
70
68
  "@mastra/parallel": "0.1.2",
69
+ "@mastra/pg": "1.27.1-alpha.0",
70
+ "@mastra/schema-compat": "1.3.11",
71
71
  "@mastra/stagehand": "0.3.5",
72
72
  "@mastra/tavily": "1.1.2"
73
73
  },
@@ -80,9 +80,9 @@
80
80
  "typescript": "^6.0.3",
81
81
  "typescript-eslint": "^8.57.0",
82
82
  "vitest": "4.1.11",
83
- "@internal/lint": "0.0.136",
84
83
  "@internal/types-builder": "0.0.111",
85
- "@internal/workspace-test-utils": "0.0.80"
84
+ "@internal/workspace-test-utils": "0.0.80",
85
+ "@internal/lint": "0.0.136"
86
86
  },
87
87
  "engines": {
88
88
  "node": ">=22.19.0"