@mastra/server 1.79.0-alpha.2 → 1.79.0-alpha.3

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.79.0-alpha.2"
6
+ version: "1.79.0-alpha.3"
7
7
  ---
8
8
 
9
9
  ## When to use
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "1.79.0-alpha.2",
2
+ "version": "1.79.0-alpha.3",
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-CKHUMrWI.cjs")).then((mod) => mod.agentBuilderWorkflows);
33
+ agentBuilderWorkflowsPromise ??= Promise.resolve().then(() => require("../../dist-CWqDEEO3.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-hfFDNas-.js").then((mod) => mod.agentBuilderWorkflows);
32
+ agentBuilderWorkflowsPromise ??= import("../../dist-B07TBQpE.js").then((mod) => mod.agentBuilderWorkflows);
33
33
  return agentBuilderWorkflowsPromise;
34
34
  }
35
35
  async function registerAgentBuilderWorkflows(mastra) {
@@ -161,7 +161,16 @@ const steerBodySchema = zod_v4.z.object({
161
161
  const toolApprovalBodySchema = zod_v4.z.object({
162
162
  toolCallId: zod_v4.z.string(),
163
163
  approved: zod_v4.z.boolean(),
164
+ /**
165
+ * Grants the gated tool's category to the thread that owns the call, then
166
+ * approves — the same "always allow" the in-process TUI offers. Requires
167
+ * `approved: true`.
168
+ */
169
+ alwaysAllowCategory: zod_v4.z.boolean().optional(),
164
170
  requestContext: bodyRequestContextSchema
171
+ }).refine((body) => !body.alwaysAllowCategory || body.approved, {
172
+ message: "alwaysAllowCategory requires approved: true",
173
+ path: ["alwaysAllowCategory"]
165
174
  });
166
175
  const toolSuspensionBodySchema = zod_v4.z.object({
167
176
  toolCallId: zod_v4.z.string().min(1),
@@ -663,13 +672,13 @@ const AGENT_CONTROLLER_TOOL_APPROVAL_ROUTE = require_route_builder.createRoute({
663
672
  tags: ["AgentController"],
664
673
  requiresAuth: true,
665
674
  requiresPermission: "agent-controller:execute",
666
- handler: async ({ mastra, controllerId, resourceId, sessionScope, toolCallId, approved, requestContext }) => {
675
+ handler: async ({ mastra, controllerId, resourceId, sessionScope, toolCallId, approved, alwaysAllowCategory, requestContext }) => {
667
676
  try {
668
677
  const session = await getSession(getAgentControllerOrThrow(mastra, controllerId), resourceId, { scope: sessionScope }, requestContext);
669
678
  if ((toolCallId ? session.approval.isArmed({ toolCallId }) : session.approval.isArmed()) || !toolCallId) {
670
679
  const result = session.respondToToolApproval({
671
680
  toolCallId,
672
- decision: approved ? "approve" : "decline",
681
+ decision: !approved ? "decline" : alwaysAllowCategory ? "always_allow_category" : "approve",
673
682
  requestContext
674
683
  });
675
684
  if (!result.accepted) return {
@@ -689,6 +698,7 @@ const AGENT_CONTROLLER_TOOL_APPROVAL_ROUTE = require_route_builder.createRoute({
689
698
  work: session.respondToPersistedToolApproval({
690
699
  toolCallId,
691
700
  approved,
701
+ alwaysAllowCategory,
692
702
  requestContext
693
703
  }).finally(() => session.releaseToolResponse(toolCallId)),
694
704
  session,