@mastra/code-sdk 1.15.1-alpha.3 → 1.15.1-alpha.5

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.
Files changed (208) hide show
  1. package/dist/acp/agent.js +1 -2
  2. package/dist/acp/errors.js +1 -2
  3. package/dist/acp/event-mapper.js +1 -2
  4. package/dist/acp/index.js +1 -2
  5. package/dist/acp/runtime.js +1 -2
  6. package/dist/acp/server.js +1 -2
  7. package/dist/acp/skills.js +1 -2
  8. package/dist/agent-connections/messaging-processor.js +1 -2
  9. package/dist/agent-connections/ownership.js +1 -2
  10. package/dist/agent-connections/registry.js +1 -2
  11. package/dist/agent-connections/session-advertisement.js +1 -2
  12. package/dist/agent-connections/signal-provider.js +1 -2
  13. package/dist/agent-connections/state-processor.js +1 -2
  14. package/dist/agent-connections/thread-state.js +1 -2
  15. package/dist/agent-connections/tools.js +1 -2
  16. package/dist/agent-connections/types.js +1 -2
  17. package/dist/agent-connections/untrusted-text.js +1 -2
  18. package/dist/agents/background-completion-events.js +1 -2
  19. package/dist/agents/background-completion.js +1 -2
  20. package/dist/agents/context-audit.js +1 -2
  21. package/dist/agents/credential-resolver.js +1 -2
  22. package/dist/agents/custom-provider-source.js +1 -2
  23. package/dist/agents/instructions.js +1 -2
  24. package/dist/agents/mastracode-gateway.d.ts.map +1 -1
  25. package/dist/agents/mastracode-gateway.js +6 -5
  26. package/dist/agents/mastracode-gateway.js.map +1 -1
  27. package/dist/agents/memory.js +1 -2
  28. package/dist/agents/model.js +1 -2
  29. package/dist/agents/modes/build.js +1 -2
  30. package/dist/agents/modes/explore.js +1 -2
  31. package/dist/agents/modes/plan.js +1 -2
  32. package/dist/agents/prompts/agent-instructions.js +1 -2
  33. package/dist/agents/prompts/build.js +1 -2
  34. package/dist/agents/prompts/fast.js +1 -2
  35. package/dist/agents/prompts/index.js +1 -2
  36. package/dist/agents/prompts/model.js +1 -2
  37. package/dist/agents/prompts/plan.js +1 -2
  38. package/dist/agents/prompts/tool-guidance.js +1 -2
  39. package/dist/agents/sandbox-filesystem.d.ts.map +1 -1
  40. package/dist/agents/sandbox-filesystem.js +9 -7
  41. package/dist/agents/sandbox-filesystem.js.map +1 -1
  42. package/dist/agents/subagents/execute.js +1 -2
  43. package/dist/agents/subagents/explore.js +1 -2
  44. package/dist/agents/subagents/plan.js +1 -2
  45. package/dist/agents/thread-caveman-state.js +1 -2
  46. package/dist/agents/tool-availability.js +1 -2
  47. package/dist/agents/tools.js +1 -2
  48. package/dist/agents/workflow-builder-agent.js +1 -2
  49. package/dist/agents/workspace.js +1 -2
  50. package/dist/analytics.js +1 -2
  51. package/dist/auth/account-rotation-processor.js +1 -2
  52. package/dist/auth/account-routing-context.js +1 -2
  53. package/dist/auth/authorization-input.js +1 -2
  54. package/dist/auth/device-code.js +1 -2
  55. package/dist/auth/pkce.js +1 -2
  56. package/dist/auth/provider-auth-error.d.ts +2 -0
  57. package/dist/auth/provider-auth-error.d.ts.map +1 -1
  58. package/dist/auth/provider-auth-error.js +8 -3
  59. package/dist/auth/provider-auth-error.js.map +1 -1
  60. package/dist/auth/providers/anthropic.js +1 -2
  61. package/dist/auth/providers/github-copilot.js +1 -2
  62. package/dist/auth/providers/kimi-coding.js +1 -2
  63. package/dist/auth/providers/openai-codex.js +1 -2
  64. package/dist/auth/providers/xai.js +1 -2
  65. package/dist/auth/storage.js +1 -2
  66. package/dist/clipboard/index.js +1 -2
  67. package/dist/constants.js +1 -2
  68. package/dist/error-classification.js +1 -2
  69. package/dist/evals/context-builder.js +1 -2
  70. package/dist/evals/scorers/classify-command.d.ts +1 -2
  71. package/dist/evals/scorers/classify-command.d.ts.map +1 -1
  72. package/dist/evals/scorers/classify-command.js +7 -17
  73. package/dist/evals/scorers/classify-command.js.map +1 -1
  74. package/dist/evals/scorers/efficiency.js +1 -2
  75. package/dist/evals/scorers/extract-tools.js +1 -2
  76. package/dist/evals/scorers/outcome.d.ts.map +1 -1
  77. package/dist/evals/scorers/outcome.js +36 -22
  78. package/dist/evals/scorers/outcome.js.map +1 -1
  79. package/dist/experimental-agent.js +1 -2
  80. package/dist/factory/client.js +1 -2
  81. package/dist/factory/remote-controller.js +1 -2
  82. package/dist/factory/remote-session.js +1 -2
  83. package/dist/goal-manager.js +1 -2
  84. package/dist/goal-signal.js +1 -2
  85. package/dist/headless/cli.js +1 -2
  86. package/dist/headless/flags.js +1 -2
  87. package/dist/headless/format.js +1 -2
  88. package/dist/headless/policy.js +1 -2
  89. package/dist/headless/run-mc.js +1 -2
  90. package/dist/headless/types.js +1 -2
  91. package/dist/hooks/config.js +1 -2
  92. package/dist/hooks/executor.js +1 -2
  93. package/dist/hooks/manager.js +1 -2
  94. package/dist/hooks/types.js +1 -2
  95. package/dist/index.js +1 -2
  96. package/dist/ipc/ipc-reporter.js +1 -2
  97. package/dist/knowledge-inspector.js +1 -2
  98. package/dist/knowledge-scope.js +1 -2
  99. package/dist/lsp/client.d.ts.map +1 -1
  100. package/dist/lsp/client.js +1 -2
  101. package/dist/lsp/client.js.map +1 -1
  102. package/dist/lsp/language.js +1 -2
  103. package/dist/lsp/manager.js +1 -2
  104. package/dist/lsp/server.js +1 -2
  105. package/dist/lsp/workspace.js +1 -2
  106. package/dist/mcp/config.js +1 -2
  107. package/dist/mcp/manager.js +1 -2
  108. package/dist/mcp/state.js +1 -2
  109. package/dist/onboarding/custom-packs.js +1 -2
  110. package/dist/onboarding/custom-providers.js +1 -2
  111. package/dist/onboarding/om-settings.js +1 -2
  112. package/dist/onboarding/pack-activation.js +1 -2
  113. package/dist/onboarding/packs.js +1 -2
  114. package/dist/onboarding/settings.js +1 -2
  115. package/dist/permissions.js +1 -2
  116. package/dist/platform/index.js +1 -2
  117. package/dist/plugin.js +1 -2
  118. package/dist/plugins/dependencies.js +1 -2
  119. package/dist/plugins/install.js +1 -2
  120. package/dist/plugins/loader.js +1 -2
  121. package/dist/plugins/manager.js +1 -2
  122. package/dist/plugins/manifest.js +1 -2
  123. package/dist/plugins/package-link.js +1 -2
  124. package/dist/plugins/paths.js +1 -2
  125. package/dist/plugins/registry.js +1 -2
  126. package/dist/plugins/scaffold.js +1 -2
  127. package/dist/plugins/signal-lane.js +1 -2
  128. package/dist/process-memory-diagnostics.js +1 -2
  129. package/dist/processors/plan-rejection-abort.js +1 -2
  130. package/dist/providers/amazon-bedrock-gateway.js +1 -2
  131. package/dist/providers/amazon-bedrock.js +1 -2
  132. package/dist/providers/anthropic-prompt-cache.js +1 -2
  133. package/dist/providers/anthropic-thinking.js +1 -2
  134. package/dist/providers/claude-max.d.ts.map +1 -1
  135. package/dist/providers/claude-max.js +4 -4
  136. package/dist/providers/claude-max.js.map +1 -1
  137. package/dist/providers/github-copilot-gateway.js +1 -2
  138. package/dist/providers/github-copilot.d.ts.map +1 -1
  139. package/dist/providers/github-copilot.js +5 -5
  140. package/dist/providers/github-copilot.js.map +1 -1
  141. package/dist/providers/google-thinking.js +1 -2
  142. package/dist/providers/kimi-coding.d.ts.map +1 -1
  143. package/dist/providers/kimi-coding.js +8 -7
  144. package/dist/providers/kimi-coding.js.map +1 -1
  145. package/dist/providers/model-ids.js +1 -2
  146. package/dist/providers/openai-codex.d.ts +15 -0
  147. package/dist/providers/openai-codex.d.ts.map +1 -1
  148. package/dist/providers/openai-codex.js +50 -11
  149. package/dist/providers/openai-codex.js.map +1 -1
  150. package/dist/providers/provider-thinking.js +1 -2
  151. package/dist/providers/thinking-request.js +1 -2
  152. package/dist/providers/xai.d.ts.map +1 -1
  153. package/dist/providers/xai.js +5 -5
  154. package/dist/providers/xai.js.map +1 -1
  155. package/dist/schedules/interval.js +1 -2
  156. package/dist/schedules/prompt.js +1 -2
  157. package/dist/schedules/run-script.js +1 -2
  158. package/dist/schedules/scheduler.js +1 -2
  159. package/dist/schedules/tools.js +1 -2
  160. package/dist/schema.js +1 -2
  161. package/dist/theme-palette.js +1 -2
  162. package/dist/thinking-catalog.js +1 -2
  163. package/dist/thinking.js +1 -2
  164. package/dist/tool-names.js +1 -2
  165. package/dist/tools/request-sandbox-access.js +1 -2
  166. package/dist/tools/utils.js +1 -2
  167. package/dist/tools/web-search.js +1 -2
  168. package/dist/tools/workflows/create-workflow.js +1 -2
  169. package/dist/tools/workflows/delete-workflow.js +1 -2
  170. package/dist/tools/workflows/ephemeral-memory.js +1 -2
  171. package/dist/tools/workflows/extract-json-schema.js +1 -2
  172. package/dist/tools/workflows/get-workflow.js +1 -2
  173. package/dist/tools/workflows/list-available-agents.js +1 -2
  174. package/dist/tools/workflows/list-available-classifiers.js +1 -2
  175. package/dist/tools/workflows/list-available-tools.js +1 -2
  176. package/dist/tools/workflows/list-available-workflows.js +1 -2
  177. package/dist/tools/workflows/list-workflows.js +1 -2
  178. package/dist/tools/workflows/run-workflow.js +1 -2
  179. package/dist/tools/workflows/save-workflow.js +1 -2
  180. package/dist/tools/workflows/tool-ids.js +1 -2
  181. package/dist/utils/binaries.js +1 -2
  182. package/dist/utils/debug-log.js +1 -2
  183. package/dist/utils/discarding-scores-storage.js +1 -2
  184. package/dist/utils/errors.js +1 -2
  185. package/dist/utils/gateway-sync.js +1 -2
  186. package/dist/utils/local-observability.js +1 -2
  187. package/dist/utils/maintenance-lock.js +1 -2
  188. package/dist/utils/notification-dispatch.js +1 -2
  189. package/dist/utils/open-url.js +1 -2
  190. package/dist/utils/path-security.js +1 -2
  191. package/dist/utils/plan-diff.js +1 -2
  192. package/dist/utils/plans.js +1 -2
  193. package/dist/utils/project.js +1 -2
  194. package/dist/utils/prune-cli.js +1 -2
  195. package/dist/utils/signals-pubsub.js +1 -2
  196. package/dist/utils/slash-command-loader.js +1 -2
  197. package/dist/utils/slash-command-processor.js +1 -2
  198. package/dist/utils/stdin-pipe.js +1 -2
  199. package/dist/utils/storage-factory.js +1 -2
  200. package/dist/utils/storage-maintenance.js +1 -2
  201. package/dist/utils/thread-lock.js +1 -2
  202. package/dist/utils/token-estimator.js +1 -2
  203. package/dist/utils/update-check.js +1 -2
  204. package/dist/utils/wake-session.js +1 -2
  205. package/dist/voice/stt-registry.js +1 -2
  206. package/dist/workflows/register-primitives.js +1 -2
  207. package/dist/workflows/service.js +1 -2
  208. package/package.json +36 -32
@@ -2,7 +2,7 @@ import { runWorkflow } from "../../workflows/service.js";
2
2
  import { withEphemeralMemory } from "./ephemeral-memory.js";
3
3
  import { createTool } from "@mastra/core/tools";
4
4
  import { z } from "zod";
5
- //#region src/tools/workflows/run-workflow.ts
5
+ // src/tools/workflows/run-workflow.ts
6
6
  const runWorkflowTool = createTool({
7
7
  id: "run-workflow",
8
8
  description: "Run a saved workflow by id with the provided input data. Returns the run result inline. Use when the user asks you to \"run X\", \"execute X\", or asks for the outcome of a saved workflow.",
@@ -46,7 +46,6 @@ const runWorkflowTool = createTool({
46
46
  });
47
47
  }
48
48
  });
49
- //#endregion
50
49
  export { runWorkflowTool };
51
50
 
52
51
  //# sourceMappingURL=run-workflow.js.map
@@ -1,7 +1,7 @@
1
1
  import { createTool } from "@mastra/core/tools";
2
2
  import { z } from "zod";
3
3
  import { WORKFLOW_BUILDER_MAPPING_CONFIG_DESCRIPTION as MAPPING_CONFIG_DESCRIPTION, normalizeWorkflowBuilderDefinition, workflowBuilderDefinitionSchema } from "@mastra/core/workflows/builder";
4
- //#region src/tools/workflows/save-workflow.ts
4
+ // src/tools/workflows/save-workflow.ts
5
5
  const workflowDefinitionInputSchema = z.preprocess(normalizeWorkflowBuilderDefinition, workflowBuilderDefinitionSchema);
6
6
  const saveWorkflowTool = createTool({
7
7
  id: "save-workflow",
@@ -22,7 +22,6 @@ const saveWorkflowTool = createTool({
22
22
  };
23
23
  }
24
24
  });
25
- //#endregion
26
25
  export { MAPPING_CONFIG_DESCRIPTION, saveWorkflowTool, workflowDefinitionInputSchema };
27
26
 
28
27
  //# sourceMappingURL=save-workflow.js.map
@@ -1,4 +1,4 @@
1
- //#region src/tools/workflows/tool-ids.ts
1
+ // src/tools/workflows/tool-ids.ts
2
2
  const WORKFLOW_AUTHORING_TOOL_IDS = {
3
3
  listAgents: "list-available-agents",
4
4
  listClassifiers: "list-available-classifiers",
@@ -14,7 +14,6 @@ const WORKFLOW_MANAGEMENT_TOOL_IDS = {
14
14
  deleteWorkflow: "delete-workflow"
15
15
  };
16
16
  const WORKFLOW_BUILDER_NOISE_TOOL_IDS = [...Object.values(WORKFLOW_AUTHORING_TOOL_IDS), ...Object.values(WORKFLOW_MANAGEMENT_TOOL_IDS)];
17
- //#endregion
18
17
  export { WORKFLOW_AUTHORING_TOOL_IDS, WORKFLOW_BUILDER_NOISE_TOOL_IDS, WORKFLOW_MANAGEMENT_TOOL_IDS };
19
18
 
20
19
  //# sourceMappingURL=tool-ids.js.map
@@ -1,5 +1,5 @@
1
1
  import { execFile, execFileSync } from "child_process";
2
- //#region src/utils/binaries.ts
2
+ // src/utils/binaries.ts
3
3
  const COMMON_BINARIES = [
4
4
  "python",
5
5
  "python3",
@@ -72,7 +72,6 @@ async function detectCommonBinariesAsync() {
72
72
  inFlightPromise = null;
73
73
  }
74
74
  }
75
- //#endregion
76
75
  export { detectCommonBinaries, detectCommonBinariesAsync };
77
76
 
78
77
  //# sourceMappingURL=binaries.js.map
@@ -1,7 +1,7 @@
1
1
  import { getAppDataDir } from "./project.js";
2
2
  import * as path$1 from "path";
3
3
  import * as fs$1 from "fs";
4
- //#region src/utils/debug-log.ts
4
+ // src/utils/debug-log.ts
5
5
  const MAX_LOG_SIZE = 5242880;
6
6
  const KEEP_SIZE = 4194304;
7
7
  /**
@@ -53,7 +53,6 @@ function setupDebugLogging() {
53
53
  console.warn = noop;
54
54
  }
55
55
  }
56
- //#endregion
57
56
  export { setupDebugLogging, truncateLogFile };
58
57
 
59
58
  //# sourceMappingURL=debug-log.js.map
@@ -1,5 +1,5 @@
1
1
  import { ScoresStorage } from "@mastra/core/storage";
2
- //#region src/utils/discarding-scores-storage.ts
2
+ // src/utils/discarding-scores-storage.ts
3
3
  /**
4
4
  * A scores domain that accepts writes and keeps nothing.
5
5
  *
@@ -48,7 +48,6 @@ function empty(pagination) {
48
48
  scores: []
49
49
  };
50
50
  }
51
- //#endregion
52
51
  export { DiscardingScoresStorage };
53
52
 
54
53
  //# sourceMappingURL=discarding-scores-storage.js.map
@@ -1,5 +1,5 @@
1
1
  import "../auth/provider-auth-error.js";
2
- //#region src/utils/errors.ts
2
+ // src/utils/errors.ts
3
3
  /**
4
4
  * Error handling utilities for the Mastra Code TUI.
5
5
  * Parses API errors and provides user-friendly messages.
@@ -190,7 +190,6 @@ async function withRetry(fn, options = {}) {
190
190
  }
191
191
  throw lastError?.originalError || /* @__PURE__ */ new Error("Retry failed");
192
192
  }
193
- //#endregion
194
193
  export { parseError, sleep, withRetry };
195
194
 
196
195
  //# sourceMappingURL=errors.js.map
@@ -1,5 +1,5 @@
1
1
  import { GatewayRegistry } from "@mastra/core/llm";
2
- //#region src/utils/gateway-sync.ts
2
+ // src/utils/gateway-sync.ts
3
3
  /**
4
4
  * Gateway sync utility for keeping the model registry up to date.
5
5
  *
@@ -55,7 +55,6 @@ function stopGatewaySync() {
55
55
  syncInterval = null;
56
56
  }
57
57
  }
58
- //#endregion
59
58
  export { startGatewaySync, stopGatewaySync, syncGateways };
60
59
 
61
60
  //# sourceMappingURL=gateway-sync.js.map
@@ -1,4 +1,4 @@
1
- //#region src/utils/local-observability.ts
1
+ // src/utils/local-observability.ts
2
2
  /**
3
3
  * Age limits for the local trace store: 14 days for spans, metrics and logs,
4
4
  * 30 days for scores and feedback. Spans, logs and scores use the same windows
@@ -51,7 +51,6 @@ async function openLocalObservabilityStore(path) {
51
51
  pruned: pruneExistingTables(store).catch(() => [])
52
52
  };
53
53
  }
54
- //#endregion
55
54
  export { LOCAL_OBSERVABILITY_RETENTION, openLocalObservabilityStore };
56
55
 
57
56
  //# sourceMappingURL=local-observability.js.map
@@ -1,7 +1,7 @@
1
1
  import { getAppDataDir } from "./project.js";
2
2
  import path from "path";
3
3
  import fs from "fs";
4
- //#region src/utils/maintenance-lock.ts
4
+ // src/utils/maintenance-lock.ts
5
5
  /**
6
6
  * Mutual exclusion between storage maintenance (`mastracode prune`) and running
7
7
  * mastracode sessions, using the same pid-file / stale-PID pattern as
@@ -193,7 +193,6 @@ function acquireMaintenanceLock() {
193
193
  }
194
194
  return release;
195
195
  }
196
- //#endregion
197
196
  export { MALFORMED_PID_FILE_GRACE_MS, MaintenanceLockError, UNKNOWN_OWNER, acquireMaintenanceLock, getLiveSessionPids, getMaintenanceLockOwner, getMaintenanceLockPath, registerSession, registerSessionAndWaitForMaintenance, resetSessionRegistrationsForTesting, unregisterSession };
198
197
 
199
198
  //# sourceMappingURL=maintenance-lock.js.map
@@ -1,7 +1,7 @@
1
1
  import { notificationDispatchLeaseKey } from "./signals-pubsub.js";
2
2
  import { dispatchDueNotifications } from "@mastra/core/notifications";
3
3
  import { AsyncLocalStorage } from "async_hooks";
4
- //#region src/utils/notification-dispatch.ts
4
+ // src/utils/notification-dispatch.ts
5
5
  const DEFAULT_INTERVAL_MS = 1e4;
6
6
  const DEFAULT_LEASE_TTL_MS = 6e4;
7
7
  /**
@@ -125,7 +125,6 @@ function createResourceNotificationDispatcher(options) {
125
125
  tick
126
126
  };
127
127
  }
128
- //#endregion
129
128
  export { createResourceNotificationDispatcher, isDispatchingNotificationsFor, shouldHoldNotificationDelivery };
130
129
 
131
130
  //# sourceMappingURL=notification-dispatch.js.map
@@ -1,5 +1,5 @@
1
1
  import { spawn } from "child_process";
2
- //#region src/utils/open-url.ts
2
+ // src/utils/open-url.ts
3
3
  /**
4
4
  * Best-effort browser opening for OAuth and other login flows.
5
5
  */
@@ -24,7 +24,6 @@ function openUrlInBrowser(url) {
24
24
  child.on("error", () => {});
25
25
  child.unref();
26
26
  }
27
- //#endregion
28
27
  export { openUrlInBrowser };
29
28
 
30
29
  //# sourceMappingURL=open-url.js.map
@@ -1,10 +1,9 @@
1
1
  import path from "path";
2
- //#region src/utils/path-security.ts
2
+ // src/utils/path-security.ts
3
3
  function isPathWithinRoot(candidatePath, rootPath) {
4
4
  const relativePath = path.relative(rootPath, candidatePath);
5
5
  return relativePath === "" || !relativePath.startsWith(`..${path.sep}`) && relativePath !== ".." && !path.isAbsolute(relativePath);
6
6
  }
7
- //#endregion
8
7
  export { isPathWithinRoot };
9
8
 
10
9
  //# sourceMappingURL=path-security.js.map
@@ -1,4 +1,4 @@
1
- //#region src/utils/plan-diff.ts
1
+ // src/utils/plan-diff.ts
2
2
  /** Produce structured diff entries between two plan texts using an LCS diff. */
3
3
  function generatePlanDiff(oldText, newText) {
4
4
  const oldLines = oldText.split(/\r?\n/);
@@ -56,7 +56,6 @@ function shouldShowDiff(previousPlan, plan, maxChangedRatio = .5) {
56
56
  if (changed === 0) return false;
57
57
  return changed / Math.max(entries.length, 1) <= maxChangedRatio;
58
58
  }
59
- //#endregion
60
59
  export { generatePlanDiff, shouldShowDiff };
61
60
 
62
61
  //# sourceMappingURL=plan-diff.js.map
@@ -2,7 +2,7 @@ import { DEFAULT_CONFIG_DIR } from "../constants.js";
2
2
  import { getAppDataDir } from "./project.js";
3
3
  import path from "path";
4
4
  import fs from "fs/promises";
5
- //#region src/utils/plans.ts
5
+ // src/utils/plans.ts
6
6
  /** Global plans directory for approved-plan archives. */
7
7
  function getPlansDir() {
8
8
  return process.env.MASTRA_PLANS_DIR ?? path.join(getAppDataDir(), "plans");
@@ -111,7 +111,6 @@ async function approvePlanFile(opts) {
111
111
  });
112
112
  return path.basename(planPath);
113
113
  }
114
- //#endregion
115
114
  export { approvePlanFile, getLocalPlansDir, getLocalPlansRelativeDir, getPlanFilename, getPlansDir, getSuggestedPlanRelativePath, isPlanFilePath, readPlanFile, resolvePlanPath, savePlanToDisk };
116
115
 
117
116
  //# sourceMappingURL=plans.js.map
@@ -4,7 +4,7 @@ import { createHash } from "crypto";
4
4
  import fs from "fs";
5
5
  import { execFile, execSync } from "child_process";
6
6
  import os from "os";
7
- //#region src/utils/project.ts
7
+ // src/utils/project.ts
8
8
  /**
9
9
  * Project detection utilities
10
10
  *
@@ -358,7 +358,6 @@ function loadStringField(filePath, field) {
358
358
  return null;
359
359
  }
360
360
  }
361
- //#endregion
362
361
  export { detectProject, getAppDataDir, getCurrentGitBranch, getCurrentGitBranchAsync, getDatabasePath, getObservabilityDatabasePath, getOmScope, getResourceIdOverride, getStorageConfig, getUserId, getUserName, getVectorDatabasePath };
363
362
 
364
363
  //# sourceMappingURL=project.js.map
@@ -6,7 +6,7 @@ import { DEFAULT_RETENTION, createStorageMaintenance, resolveLocalDbFiles, runSt
6
6
  import { createStorage, createVectorStore } from "./storage-factory.js";
7
7
  import path from "path";
8
8
  import { LibSQLVector } from "@mastra/libsql";
9
- //#region src/utils/prune-cli.ts
9
+ // src/utils/prune-cli.ts
10
10
  /**
11
11
  * `mastracode prune` — storage maintenance from a non-interactive shell.
12
12
  *
@@ -121,7 +121,6 @@ function describeStorageTarget(config) {
121
121
  if (config.connectionString) return `pg ${redactUrl(config.connectionString)}`;
122
122
  return `pg postgres://${`${config.host ?? "localhost"}${config.port ? `:${config.port}` : ""}`}/${config.database ?? ""}`;
123
123
  }
124
- //#endregion
125
124
  export { describeStorageTarget, runPruneCommand };
126
125
 
127
126
  //# sourceMappingURL=prune-cli.js.map
@@ -1,7 +1,7 @@
1
1
  import { isAbsolute, join } from "path";
2
2
  import { mkdir } from "fs/promises";
3
3
  import { PubSub, UnixSocketPubSub } from "@mastra/core/events";
4
- //#region src/utils/signals-pubsub.ts
4
+ // src/utils/signals-pubsub.ts
5
5
  const DEFAULT_SOCKET_ROOT = "/tmp/mc";
6
6
  const SHARED_SCOPE_DIR = "_shared";
7
7
  const THREAD_STREAM_PREFIX = "agent.thread-stream.";
@@ -406,7 +406,6 @@ var SignalsPubSub = class extends PubSub {
406
406
  function createSignalsPubSub(resourceId, options) {
407
407
  return new SignalsPubSub(resourceId, options);
408
408
  }
409
- //#endregion
410
409
  export { createSignalsPubSub, notificationDispatchLeaseKey };
411
410
 
412
411
  //# sourceMappingURL=signals-pubsub.js.map
@@ -3,7 +3,7 @@ import { isPathWithinRoot } from "./path-security.js";
3
3
  import * as path$1 from "path";
4
4
  import { promises } from "fs";
5
5
  import { parse } from "yaml";
6
- //#region src/utils/slash-command-loader.ts
6
+ // src/utils/slash-command-loader.ts
7
7
  /**
8
8
  * Parse a command file and extract metadata and template
9
9
  * Supports both frontmatter-based and plain markdown files
@@ -136,7 +136,6 @@ Shell commands with !command will be executed and output included.
136
136
  console.error("Error initializing commands directory:", error);
137
137
  }
138
138
  }
139
- //#endregion
140
139
  export { extractCommandName, getProjectCommandsDir, initCommandsDirectory, loadCustomCommands, parseCommandFile, scanCommandDirectory };
141
140
 
142
141
  //# sourceMappingURL=slash-command-loader.js.map
@@ -1,7 +1,7 @@
1
1
  import * as path$1 from "path";
2
2
  import { promises } from "fs";
3
3
  import { execSync } from "child_process";
4
- //#region src/utils/slash-command-processor.ts
4
+ // src/utils/slash-command-processor.ts
5
5
  /**
6
6
  * Process a slash command by replacing variables and executing shell commands
7
7
  */
@@ -103,7 +103,6 @@ function groupCommandsByNamespace(commands) {
103
103
  }
104
104
  return groups;
105
105
  }
106
- //#endregion
107
106
  export { formatCommandForDisplay, groupCommandsByNamespace, processSlashCommand };
108
107
 
109
108
  //# sourceMappingURL=slash-command-processor.js.map
@@ -1,6 +1,6 @@
1
1
  import * as fs$1 from "fs";
2
2
  import * as tty from "tty";
3
- //#region src/utils/stdin-pipe.ts
3
+ // src/utils/stdin-pipe.ts
4
4
  /** Maximum piped input size (1 MB). Content beyond this is truncated. */
5
5
  const MAX_PIPE_BYTES = 1048576;
6
6
  /**
@@ -90,7 +90,6 @@ function reopenStdinFromTTY() {
90
90
  });
91
91
  return true;
92
92
  }
93
- //#endregion
94
93
  export { drainPipedStdin, reopenStdinFromTTY, sanitizePipedOutput };
95
94
 
96
95
  //# sourceMappingURL=stdin-pipe.js.map
@@ -1,7 +1,7 @@
1
1
  import { getDatabasePath, getVectorDatabasePath } from "./project.js";
2
2
  import { DEFAULT_RETENTION } from "./storage-maintenance.js";
3
3
  import { LibSQLStore, LibSQLVector } from "@mastra/libsql";
4
- //#region src/utils/storage-factory.ts
4
+ // src/utils/storage-factory.ts
5
5
  const MASTRA_CODE_LOCAL_PRAGMAS = {
6
6
  cacheSize: -128e3,
7
7
  mmapSize: 536870912
@@ -115,7 +115,6 @@ async function createVectorStore(config, effectiveBackend = config.backend) {
115
115
  authToken: libsqlConfig.vectorAuthToken
116
116
  });
117
117
  }
118
- //#endregion
119
118
  export { MASTRA_CODE_LOCAL_PRAGMAS, buildLibSQLStore, buildLibSQLVector, createStorage, createVectorStore };
120
119
 
121
120
  //# sourceMappingURL=storage-factory.js.map
@@ -4,7 +4,7 @@ import { closeSync, existsSync, openSync, readSync, renameSync, rmSync, statSync
4
4
  import { setFlagsFromString } from "v8";
5
5
  import { runInNewContext } from "vm";
6
6
  import Database from "libsql";
7
- //#region src/utils/storage-maintenance.ts
7
+ // src/utils/storage-maintenance.ts
8
8
  /**
9
9
  * Storage maintenance — retention defaults and disk reclamation for mastracode.
10
10
  *
@@ -349,7 +349,6 @@ async function runStorageMaintenance(opts) {
349
349
  const saved = compacted.reduce((sum, r) => sum + Math.max(0, r.bytesBefore - r.bytesAfter), 0);
350
350
  log(skipSummary ? `Reclaimed ${formatBytes(saved)}; ${skipSummary}.` : `Reclaimed ${formatBytes(saved)}.`);
351
351
  }
352
- //#endregion
353
352
  export { DEFAULT_RETENTION, createStorageMaintenance, formatBytes, reclaimLibSQLDisk, requiredFreeBytes, resolveLocalDbFiles, runStorageMaintenance };
354
353
 
355
354
  //# sourceMappingURL=storage-maintenance.js.map
@@ -1,7 +1,7 @@
1
1
  import { getAppDataDir } from "./project.js";
2
2
  import * as path$1 from "path";
3
3
  import * as fs$1 from "fs";
4
- //#region src/utils/thread-lock.ts
4
+ // src/utils/thread-lock.ts
5
5
  /**
6
6
  * Thread lock — ensures only one process writes to a thread at a time.
7
7
  *
@@ -106,7 +106,6 @@ function releaseAllThreadLocks() {
106
106
  }
107
107
  } catch {}
108
108
  }
109
- //#endregion
110
109
  export { ThreadLockError, acquireThreadLock, getThreadLockOwner, releaseAllThreadLocks, releaseThreadLock };
111
110
 
112
111
  //# sourceMappingURL=thread-lock.js.map
@@ -1,5 +1,5 @@
1
1
  import { estimateTokenCount, sliceByTokens } from "tokenx";
2
- //#region src/utils/token-estimator.ts
2
+ // src/utils/token-estimator.ts
3
3
  function sanitizeInput(text) {
4
4
  if (!text) return "";
5
5
  return (typeof text === `string` ? text : JSON.stringify(text)).replaceAll(`<|endoftext|>`, ``).replaceAll(`<|endofprompt|>`, ``);
@@ -15,7 +15,6 @@ function truncateStringForTokenEstimate(text, desiredTokenCount, fromEnd = true)
15
15
  return `[Truncated ~${totalTokens - desiredTokenCount} tokens]
16
16
  ${kept}`;
17
17
  }
18
- //#endregion
19
18
  export { tokenEstimate, truncateStringForTokenEstimate };
20
19
 
21
20
  //# sourceMappingURL=token-estimator.js.map
@@ -3,7 +3,7 @@ import { readFileSync, realpathSync } from "fs";
3
3
  import { execFile } from "child_process";
4
4
  import { homedir } from "os";
5
5
  import { fileURLToPath } from "url";
6
- //#region src/utils/update-check.ts
6
+ // src/utils/update-check.ts
7
7
  /**
8
8
  * Check for newer versions of mastracode on npm.
9
9
  */
@@ -427,7 +427,6 @@ async function performUpdate(pm, targetVersion, plan) {
427
427
  }
428
428
  });
429
429
  }
430
- //#endregion
431
430
  export { detectPackageManager, fetchChangelog, fetchLatestVersion, getCurrentVersion, getInstallCommand, isNewerVersion, locateOwnInstall, parseChangelog, performUpdate, planUpdate, resolveUpdateOutcome, runUpdate };
432
431
 
433
432
  //# sourceMappingURL=update-check.js.map
@@ -1,6 +1,6 @@
1
1
  import { findSessionForThread } from "../agents/background-completion.js";
2
2
  import { notificationDispatchLeaseKey } from "./signals-pubsub.js";
3
- //#region src/utils/wake-session.ts
3
+ // src/utils/wake-session.ts
4
4
  /** A session here serves the thread's resource, but the thread belongs to another project. */
5
5
  const FOREIGN_THREAD = Symbol("foreign-thread");
6
6
  /** A stable key for a session's thread scope, or `undefined` when it has none. */
@@ -80,7 +80,6 @@ function threadLeaseScope(session, metadata = {}) {
80
80
  if (!keys.every((key) => metadata[key] !== void 0)) return void 0;
81
81
  return threadScopeKey(Object.fromEntries(keys.map((key) => [key, String(metadata[key])])));
82
82
  }
83
- //#endregion
84
83
  export { FOREIGN_THREAD, findWakeSession, sessionLeaseScopes, threadScopeKey };
85
84
 
86
85
  //# sourceMappingURL=wake-session.js.map
@@ -1,4 +1,4 @@
1
- //#region src/voice/stt-registry.ts
1
+ // src/voice/stt-registry.ts
2
2
  /**
3
3
  * The curated STT catalog. Order matters: the first entry for a provider is its
4
4
  * default model, and the first overall entry (`openai`/`whisper-1`) is the
@@ -138,7 +138,6 @@ function resolveSTTModel(provider, model) {
138
138
  }
139
139
  return DEFAULT_STT_MODEL;
140
140
  }
141
- //#endregion
142
141
  export { DEFAULT_STT_MODEL, DEFAULT_STT_PROVIDER, STT_MODELS, defaultModelForProvider, resolveSTTModel, sttModelsForProvider, sttProviders };
143
142
 
144
143
  //# sourceMappingURL=stt-registry.js.map
@@ -5,7 +5,7 @@ import { LazyNotificationsStorage } from "../agents/tools.js";
5
5
  import { workflowBuilderAgent } from "../agents/workflow-builder-agent.js";
6
6
  import { LocalFilesystem, LocalSandbox, Workspace, createWorkspaceTools } from "@mastra/core/workspace";
7
7
  import { createNotificationInboxTool } from "@mastra/core/notifications";
8
- //#region src/workflows/register-primitives.ts
8
+ // src/workflows/register-primitives.ts
9
9
  async function registerWorkflowBuilderPrimitives(mastra, options) {
10
10
  const { projectPath, allowedPaths = [], codeAgent, mcpManager } = options;
11
11
  mastra.addAgent(workflowBuilderAgent, "workflow-builder");
@@ -37,7 +37,6 @@ async function registerWorkflowBuilderPrimitives(mastra, options) {
37
37
  }
38
38
  if (mcpManager) for (const [toolId, tool] of Object.entries(mcpManager.getTools())) mastra.addTool(tool, toolId);
39
39
  }
40
- //#endregion
41
40
  export { registerWorkflowBuilderPrimitives };
42
41
 
43
42
  //# sourceMappingURL=register-primitives.js.map
@@ -1,4 +1,4 @@
1
- //#region src/workflows/service.ts
1
+ // src/workflows/service.ts
2
2
  async function workflowDefinitionsStore(mastra) {
3
3
  const storage = mastra.getStorage();
4
4
  if (!storage) throw new Error("Storage is not configured on the Mastra instance.");
@@ -47,7 +47,6 @@ async function runWorkflow(mastra, workflowId, inputData, requestContext, onEven
47
47
  } catch {}
48
48
  return await output.result;
49
49
  }
50
- //#endregion
51
50
  export { deleteWorkflow, getWorkflow, listWorkflows, runWorkflow };
52
51
 
53
52
  //# sourceMappingURL=service.js.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mastra/code-sdk",
3
- "version": "1.15.1-alpha.3",
3
+ "version": "1.15.1-alpha.5",
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": {
@@ -45,50 +45,54 @@
45
45
  "url": "https://github.com/mastra-ai/mastra/issues"
46
46
  },
47
47
  "dependencies": {
48
- "@agentclientprotocol/sdk": "^0.21.0",
49
- "@ai-sdk/amazon-bedrock": "^3.0.140",
50
- "@ai-sdk/anthropic": "^3.0.133",
51
- "@ai-sdk/openai": "^3.0.130",
52
- "@ai-sdk/openai-compatible": "^2.0.85",
53
- "@ast-grep/napi": "^0.42.0",
54
- "@aws-sdk/credential-providers": "^3.1095.0",
55
- "ai": "^6.0.309",
48
+ "@agentclientprotocol/sdk": "^0.21.1",
49
+ "@ai-sdk/amazon-bedrock": "^3.0.141",
50
+ "@ai-sdk/anthropic": "^3.0.135",
51
+ "@ai-sdk/openai": "^3.0.131",
52
+ "@ai-sdk/openai-compatible": "^2.0.87",
53
+ "@ast-grep/napi": "^0.42.3",
54
+ "@aws-sdk/credential-providers": "^3.1156.0",
55
+ "ai": "^6.0.315",
56
56
  "execa": "^9.6.1",
57
57
  "libsql": "^0.5.29",
58
- "posthog-node": "^5.46.1",
58
+ "posthog-node": "^5.57.1",
59
59
  "smol-toml": "1.9.0",
60
- "tokenx": "^1.3.0",
60
+ "tokenx": "^1.6.0",
61
61
  "vscode-jsonrpc": "^8.2.1",
62
- "vscode-languageserver-protocol": "^3.18.4",
63
- "yaml": "^2.7.1",
62
+ "vscode-languageserver-protocol": "^3.18.5",
63
+ "yaml": "^2.9.1",
64
64
  "zod": "^4.6.7",
65
- "@mastra/agent-browser": "0.5.4",
66
- "@mastra/client-js": "1.57.0-alpha.3",
67
- "@mastra/core": "1.80.0-alpha.3",
68
- "@mastra/fastembed": "1.3.5-alpha.1",
69
- "@mastra/duckdb": "1.16.0-alpha.0",
65
+ "@mastra/agent-browser": "0.5.5-alpha.0",
66
+ "@mastra/client-js": "1.57.0-alpha.4",
67
+ "@mastra/duckdb": "1.16.0-alpha.1",
70
68
  "@mastra/github-signals": "0.5.2",
71
- "@mastra/libsql": "1.27.0",
72
- "@mastra/mcp": "2.6.0-alpha.0",
73
- "@mastra/memory": "1.39.1-alpha.1",
74
- "@mastra/parallel": "0.1.3",
75
- "@mastra/observability": "1.21.1-alpha.1",
76
- "@mastra/pg": "1.33.0-alpha.1",
77
- "@mastra/schema-compat": "1.3.16",
78
- "@mastra/stagehand": "0.3.7-alpha.0",
79
- "@mastra/tavily": "1.1.3"
69
+ "@mastra/mcp": "2.6.0-alpha.1",
70
+ "@mastra/libsql": "1.27.1-alpha.0",
71
+ "@mastra/fastembed": "1.3.5-alpha.2",
72
+ "@mastra/parallel": "0.1.4-alpha.0",
73
+ "@mastra/pg": "1.33.0-alpha.2",
74
+ "@mastra/memory": "1.39.1-alpha.2",
75
+ "@mastra/schema-compat": "1.3.17-alpha.0",
76
+ "@mastra/stagehand": "0.3.7-alpha.1",
77
+ "@mastra/tavily": "1.1.3",
78
+ "@mastra/observability": "1.21.1-alpha.2"
80
79
  },
81
80
  "devDependencies": {
82
- "@copilotkit/aimock": "^1.29.0",
81
+ "@copilotkit/aimock": "^1.46.0",
83
82
  "@libsql/client": "^0.18.0",
84
- "@types/node": "22.20.5",
83
+ "@types/node": "22.19.15",
84
+ "msw": "^2.12.11",
85
85
  "tsdown": "0.23.1",
86
- "tsx": "^4.23.1",
86
+ "tsx": "^4.23.15",
87
87
  "typescript": "^6.0.3",
88
88
  "vitest": "4.1.12",
89
- "@internal/lint": "0.0.145",
90
89
  "@internal/types-builder": "0.0.120",
91
- "@internal/workspace-test-utils": "0.0.89"
90
+ "@internal/workspace-test-utils": "0.0.89",
91
+ "@internal/lint": "0.0.145",
92
+ "@mastra/core": "1.80.0-alpha.4"
93
+ },
94
+ "peerDependencies": {
95
+ "@mastra/core": ">=1.80.0-0 <2.0.0-0"
92
96
  },
93
97
  "engines": {
94
98
  "node": ">=22.19.0"