@mastra/server 1.72.0-alpha.2 → 1.72.0-alpha.4

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.
@@ -3,7 +3,7 @@ name: mastra-server
3
3
  description: Documentation for @mastra/server. Use when working with @mastra/server APIs, configuration, or implementation.
4
4
  metadata:
5
5
  package: "@mastra/server"
6
- version: "1.72.0-alpha.2"
6
+ version: "1.72.0-alpha.4"
7
7
  ---
8
8
 
9
9
  ## When to use
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "1.72.0-alpha.2",
2
+ "version": "1.72.0-alpha.4",
3
3
  "package": "@mastra/server",
4
4
  "exports": {},
5
5
  "modules": {}
@@ -30,7 +30,7 @@ var agent_builder_exports = /* @__PURE__ */ require_rolldown_runtime.__exportAll
30
30
  });
31
31
  let agentBuilderWorkflowsPromise;
32
32
  async function loadAgentBuilderWorkflows() {
33
- agentBuilderWorkflowsPromise ??= Promise.resolve().then(() => require("../../dist-Cfr6t0cK.cjs")).then((mod) => mod.agentBuilderWorkflows);
33
+ agentBuilderWorkflowsPromise ??= Promise.resolve().then(() => require("../../dist-_n0Mp6PP.cjs")).then((mod) => mod.agentBuilderWorkflows);
34
34
  return agentBuilderWorkflowsPromise;
35
35
  }
36
36
  async function registerAgentBuilderWorkflows(mastra) {
@@ -29,7 +29,7 @@ var agent_builder_exports = /* @__PURE__ */ __exportAll({
29
29
  });
30
30
  let agentBuilderWorkflowsPromise;
31
31
  async function loadAgentBuilderWorkflows() {
32
- agentBuilderWorkflowsPromise ??= import("../../dist-ABdCIqbD.js").then((mod) => mod.agentBuilderWorkflows);
32
+ agentBuilderWorkflowsPromise ??= import("../../dist-Bo9o3JNW.js").then((mod) => mod.agentBuilderWorkflows);
33
33
  return agentBuilderWorkflowsPromise;
34
34
  }
35
35
  async function registerAgentBuilderWorkflows(mastra) {
@@ -125,10 +125,13 @@ function hasSuspendedToolCall(snapshot, toolCallId) {
125
125
  };
126
126
  return visit(snapshot.context);
127
127
  }
128
+ function getDurableLoopWorkflowName(agent) {
129
+ return agent.durableLoopWorkflowName ?? _mastra_core_agent_durable.DurableStepIds.AGENTIC_LOOP;
130
+ }
128
131
  async function validateDurableToolCallAccess({ mastra, agent, runId, toolCallId, requestContext }) {
129
132
  if (!(0, _mastra_core_agent.isDurableAgentLike)(agent)) return;
130
133
  const workflowRun = await (await mastra.getStorage()?.getStore("workflows"))?.getWorkflowRunById({
131
- workflowName: _mastra_core_agent_durable.DurableStepIds.AGENTIC_LOOP,
134
+ workflowName: getDurableLoopWorkflowName(agent),
132
135
  runId
133
136
  });
134
137
  if (!workflowRun) throw new require_http_exception.HTTPException(403, { message: "Access denied: durable run belongs to a different resource" });
@@ -2068,7 +2071,7 @@ const RECOVER_ROUTE = require_route_builder.createRoute({
2068
2071
  });
2069
2072
  if (!(0, _mastra_core_agent.isDurableAgentLike)(agent)) throw new require_http_exception.HTTPException(400, { message: "Agent does not support recover. Only durable agents (createDurableAgent) can recover runs." });
2070
2073
  await require_utils$1.validateRunOwnership(await (await mastra.getStorage()?.getStore("workflows"))?.getWorkflowRunById({
2071
- workflowName: _mastra_core_agent_durable.DurableStepIds.AGENTIC_LOOP,
2074
+ workflowName: getDurableLoopWorkflowName(agent),
2072
2075
  runId
2073
2076
  }), require_utils$1.getEffectiveResourceId(serverRequestContext, void 0));
2074
2077
  return (await agent.recover(runId, { abortSignal })).fullStream;