@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.
- package/dist/{dist-hfFDNas-.js → dist-B07TBQpE.js} +6 -5
- package/dist/{dist-hfFDNas-.js.map → dist-B07TBQpE.js.map} +1 -1
- package/dist/{dist-CKHUMrWI.cjs → dist-CWqDEEO3.cjs} +6 -5
- package/dist/{dist-CKHUMrWI.cjs.map → dist-CWqDEEO3.cjs.map} +1 -1
- package/dist/docs/SKILL.md +1 -1
- package/dist/docs/assets/SOURCE_MAP.json +1 -1
- package/dist/server/handlers/agent-builder.cjs +1 -1
- package/dist/server/handlers/agent-builder.js +1 -1
- package/dist/server/handlers/agent-controller.cjs +12 -2
- package/dist/server/handlers/agent-controller.cjs.map +1 -1
- package/dist/server/handlers/agent-controller.d.ts +2 -0
- package/dist/server/handlers/agent-controller.d.ts.map +1 -1
- package/dist/server/handlers/agent-controller.js +12 -2
- package/dist/server/handlers/agent-controller.js.map +1 -1
- package/package.json +6 -6
package/dist/docs/SKILL.md
CHANGED
|
@@ -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-
|
|
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-
|
|
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 ? "
|
|
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,
|