@mastra/code-sdk 1.11.0-alpha.8 → 1.11.1-alpha.0

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/schema.d.ts CHANGED
@@ -6,6 +6,24 @@ export type MastraCodeSessionState = {
6
6
  modeId: string;
7
7
  };
8
8
  export type MastraCodeComposedState = MastraCodeState & MastraCodeSessionState;
9
+ export interface ModelRouteEntry {
10
+ id: string;
11
+ label: string;
12
+ modelId: string;
13
+ accountId?: string;
14
+ memoryModelId?: string;
15
+ }
16
+ export interface ModelRoute {
17
+ entries: ModelRouteEntry[];
18
+ }
19
+ export interface PendingModelFallback {
20
+ fromEntryId: string;
21
+ toEntryId: string;
22
+ toModelId: string;
23
+ threadId?: string;
24
+ reason: 'pool-exhausted' | 'persistent-outage';
25
+ at: string;
26
+ }
9
27
  export interface MastraCodeState {
10
28
  [key: string]: unknown;
11
29
  [key: `subagentModelId_${string}`]: string | undefined;
@@ -56,21 +74,10 @@ export interface MastraCodeState {
56
74
  cavemanObservations: boolean;
57
75
  observeAttachments: 'auto' | boolean;
58
76
  omScope?: 'thread' | 'resource';
59
- /** Explicit model-pack identity for the current thread. */
60
- activeModelPackId?: string | null;
61
- /**
62
- * Pending pack hop written by the account-rotation processor on a cascade
63
- * hop; cleared back to null once the TUI applies it. Declared here so
64
- * consumers resolve it as a typed record instead of casting `unknown`.
65
- */
66
- mastracodePendingPackFallback?: {
67
- fromPackId: string;
68
- toPackId: string;
69
- toModelId: string;
70
- threadId?: string;
71
- reason: 'pool-exhausted' | 'persistent-outage';
72
- at: string;
73
- } | null;
77
+ /** Ordered host-supplied model and account fallback route for this thread. */
78
+ modelRoute?: ModelRoute;
79
+ /** One-hop fallback intent written by account rotation and consumed by the host. */
80
+ mastracodePendingModelFallback?: PendingModelFallback | null;
74
81
  /**
75
82
  * Session-level reasoning-effort override. When unset, the effective level is
76
83
  * resolved at request time from settings (`models.modeThinkingDefaults[mode]`
@@ -130,7 +137,15 @@ export interface MastraCodeState {
130
137
  export declare const stateSchema: z.ZodObject<{
131
138
  currentModelId: z.ZodOptional<z.ZodString>;
132
139
  modeId: z.ZodOptional<z.ZodString>;
133
- activeModelPackId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
140
+ modelRoute: z.ZodOptional<z.ZodObject<{
141
+ entries: z.ZodArray<z.ZodObject<{
142
+ id: z.ZodString;
143
+ label: z.ZodString;
144
+ modelId: z.ZodString;
145
+ accountId: z.ZodOptional<z.ZodString>;
146
+ memoryModelId: z.ZodOptional<z.ZodString>;
147
+ }, z.core.$strip>>;
148
+ }, z.core.$strip>>;
134
149
  subagentModelId: z.ZodOptional<z.ZodString>;
135
150
  projectPath: z.ZodOptional<z.ZodString>;
136
151
  projectName: z.ZodOptional<z.ZodString>;
@@ -195,9 +210,9 @@ export declare const stateSchema: z.ZodObject<{
195
210
  activeForm: z.ZodString;
196
211
  }, z.core.$strip>>>;
197
212
  sandboxAllowedPaths: z.ZodDefault<z.ZodArray<z.ZodString>>;
198
- mastracodePendingPackFallback: z.ZodOptional<z.ZodNullable<z.ZodObject<{
199
- fromPackId: z.ZodString;
200
- toPackId: z.ZodString;
213
+ mastracodePendingModelFallback: z.ZodOptional<z.ZodNullable<z.ZodObject<{
214
+ fromEntryId: z.ZodString;
215
+ toEntryId: z.ZodString;
201
216
  toModelId: z.ZodString;
202
217
  threadId: z.ZodOptional<z.ZodString>;
203
218
  reason: z.ZodEnum<{
@@ -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,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,eAAe,CAAC;AAE1D,MAAM,MAAM,gBAAgB,GAAG,OAAO,GAAG,KAAK,GAAG,MAAM,CAAC;AAExD,MAAM,MAAM,sBAAsB,GAAG;IACnC,cAAc,EAAE,MAAM,CAAC;IACvB,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od";
5
5
  const stateSchema = z.object({
6
6
  currentModelId: z.string().optional(),
7
7
  modeId: z.string().optional(),
8
- activeModelPackId: z.string().nullable().optional(),
8
+ modelRoute: z.object({ entries: z.array(z.object({
9
+ id: z.string().max(512),
10
+ label: z.string().max(512),
11
+ modelId: z.string().max(512),
12
+ accountId: z.string().max(512).optional(),
13
+ memoryModelId: z.string().max(512).optional()
14
+ })).max(32) }).optional(),
9
15
  subagentModelId: z.string().optional(),
10
16
  projectPath: z.string().optional(),
11
17
  projectName: z.string().optional(),
@@ -63,9 +69,9 @@ const stateSchema = z.object({
63
69
  activeForm: z.string()
64
70
  })).default([]),
65
71
  sandboxAllowedPaths: z.array(z.string()).default([]),
66
- mastracodePendingPackFallback: z.object({
67
- fromPackId: z.string(),
68
- toPackId: z.string(),
72
+ mastracodePendingModelFallback: z.object({
73
+ fromEntryId: z.string(),
74
+ toEntryId: z.string(),
69
75
  toModelId: z.string(),
70
76
  threadId: z.string().optional(),
71
77
  reason: z.enum(["pool-exhausted", "persistent-outage"]),
@@ -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 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,CAAC,SAAS;CACrC,aAAa,EAAE,OAAO,CAAC,CAAC,SAAS;CACjC,aAAa,EAAE,OAAO,CAAC,CAAC,SAAS;CACjC,kBAAkB,EAA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AULT_OM_MODEL_ID,\n MODEL_ROUTE_MAX_ENTRIES,\n MODEL_ROUTE_MAX_FIELD_LENGTH,\n} 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 ModelRouteEntry {\n id: string;\n label: string;\n modelId: string;\n accountId?: string;\n memoryModelId?: string;\n}\n\nexport interface ModelRoute {\n entries: ModelRouteEntry[];\n}\n\nexport interface PendingModelFallback {\n fromEntryId: string;\n toEntryId: string;\n toModelId: string;\n threadId?: string;\n reason: 'pool-exhausted' | 'persistent-outage';\n at: string;\n}\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 /** Ordered host-supplied model and account fallback route for this thread. */\n modelRoute?: ModelRoute;\n /** One-hop fallback intent written by account rotation and consumed by the host. */\n mastracodePendingModelFallback?: PendingModelFallback | 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. The controller validates state against this\n // schema, so these keys must be declared here — Zod strips unknown keys.\n currentModelId: z.string().optional(),\n modeId: z.string().optional(),\n modelRoute: z\n .object({\n entries: z\n .array(\n z.object({\n id: z.string().max(MODEL_ROUTE_MAX_FIELD_LENGTH),\n label: z.string().max(MODEL_ROUTE_MAX_FIELD_LENGTH),\n modelId: z.string().max(MODEL_ROUTE_MAX_FIELD_LENGTH),\n accountId: z.string().max(MODEL_ROUTE_MAX_FIELD_LENGTH).optional(),\n memoryModelId: z.string().max(MODEL_ROUTE_MAX_FIELD_LENGTH).optional(),\n }),\n )\n .max(MODEL_ROUTE_MAX_ENTRIES),\n })\n .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 route hop written by account rotation. The host consumes it on\n // `state_changed` to apply thread stickiness, then clears it back to null.\n mastracodePendingModelFallback: z\n .object({\n fromEntryId: z.string(),\n toEntryId: 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":";;;;AAoJA,MAAa,cAAc,EAAE,OAAO;CAGlC,gBAAgB,EAAE,OAAO,CAAC,CAAC,SAAS;CACpC,QAAQ,EAAE,OAAO,CAAC,CAAC,SAAS;CAC5B,YAAY,EACT,OAAO,EACN,SAAS,EACN,MACC,EAAE,OAAO;EACP,IAAI,EAAE,OAAO,CAAC,CAAC,IAAA,GAAgC;EAC/C,OAAO,EAAE,OAAO,CAAC,CAAC,IAAA,GAAgC;EAClD,SAAS,EAAE,OAAO,CAAC,CAAC,IAAA,GAAgC;EACpD,WAAW,EAAE,OAAO,CAAC,CAAC,IAAA,GAAgC,CAAC,CAAC,SAAS;EACjE,eAAe,EAAE,OAAO,CAAC,CAAC,IAAA,GAAgC,CAAC,CAAC,SAAS;CACvE,CAAC,CACH,CAAC,CACA,IAAA,EAA2B,EAChC,CAAC,CAAC,CACD,SAAS;CACZ,iBAAiB,EAAE,OAAO,CAAC,CAAC,SAAS;CACrC,aAAa,EAAE,OAAO,CAAC,CAAC,SAAS;CACjC,aAAa,EAAE,OAAO,CAAC,CAAC,SAAS;CACjC,kBAAkB,EAAE,OAAO,CAAC,CAAC,SAAS;CACtC,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DK: 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": {
@@ -56,23 +56,23 @@
56
56
  "execa": "^9.6.1",
57
57
  "libsql": "^0.5.29",
58
58
  "posthog-node": "^5.46.1",
59
- "smol-toml": "1.8.0",
59
+ "smol-toml": "1.9.0",
60
60
  "tokenx": "^1.3.0",
61
61
  "vscode-jsonrpc": "^8.2.1",
62
62
  "vscode-languageserver-protocol": "^3.17.5",
63
63
  "yaml": "^2.7.1",
64
64
  "zod": "^4.6.4",
65
- "@mastra/agent-browser": "0.5.3",
66
- "@mastra/duckdb": "1.13.0-alpha.3",
67
- "@mastra/core": "1.75.0-alpha.6",
68
- "@mastra/fastembed": "1.3.2",
69
- "@mastra/libsql": "1.25.1-alpha.0",
65
+ "@mastra/core": "1.76.0-alpha.0",
70
66
  "@mastra/github-signals": "0.5.1",
71
- "@mastra/observability": "1.18.4-alpha.0",
67
+ "@mastra/fastembed": "1.3.2",
68
+ "@mastra/duckdb": "1.14.0-alpha.0",
69
+ "@mastra/agent-browser": "0.5.3",
70
+ "@mastra/memory": "1.36.0",
71
+ "@mastra/observability": "1.19.0-alpha.0",
72
+ "@mastra/mcp": "2.2.0",
72
73
  "@mastra/parallel": "0.1.2",
73
- "@mastra/memory": "1.36.0-alpha.4",
74
- "@mastra/pg": "1.30.0-alpha.4",
75
- "@mastra/mcp": "2.2.0-alpha.1",
74
+ "@mastra/libsql": "1.25.1",
75
+ "@mastra/pg": "1.31.0-alpha.0",
76
76
  "@mastra/schema-compat": "1.3.13",
77
77
  "@mastra/tavily": "1.1.2",
78
78
  "@mastra/stagehand": "0.3.5"
@@ -86,9 +86,9 @@
86
86
  "typescript": "^6.0.3",
87
87
  "typescript-eslint": "^8.57.0",
88
88
  "vitest": "4.1.11",
89
- "@internal/lint": "0.0.140",
90
- "@internal/types-builder": "0.0.115",
91
- "@internal/workspace-test-utils": "0.0.84"
89
+ "@internal/types-builder": "0.0.116",
90
+ "@internal/workspace-test-utils": "0.0.85",
91
+ "@internal/lint": "0.0.141"
92
92
  },
93
93
  "engines": {
94
94
  "node": ">=22.19.0"