@mastra/server 1.86.0-alpha.7 → 1.86.0-alpha.8
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/{a2a-WPGF38fX.js → a2a-BfWMjFe2.js} +1 -1
- package/dist/{a2a-vSZkdSRE.cjs → a2a-DQIwTZyo.cjs} +1 -1
- package/dist/{agent-builder-C4AIqOxt.js → agent-builder-DpuK5-6A.js} +2 -2
- package/dist/{agent-builder-dZlRNj1k.cjs → agent-builder-NSemjs4B.cjs} +2 -2
- package/dist/{agent-controller-BHJDvCaS.cjs → agent-controller-BP-CFfsg.cjs} +9 -9
- package/dist/{agent-controller-NRR6SK66.js → agent-controller-CzKnfKkw.js} +9 -9
- package/dist/{agent-versions-CwWhEoU5.cjs → agent-versions-0q4KKmLv.cjs} +12 -12
- package/dist/{agent-versions-DfcKpYNW.js → agent-versions-Pml6WNbA.js} +12 -12
- package/dist/{agents-mjQZV5tv.cjs → agents-BO1mcMDf.cjs} +14 -3
- package/dist/{agents-272TP94y.js → agents-YvaBPFiS.js} +14 -3
- package/dist/{api-schema-manifest-DVkepK_s.cjs → api-schema-manifest-016lHJO2.cjs} +1 -1
- package/dist/{api-schema-manifest-BjhiTdNv.js → api-schema-manifest-CAZsA5Lk.js} +1 -1
- package/dist/{catalogue-BTE9b_mr.cjs → catalogue-Cf7Zz7zb.cjs} +11 -11
- package/dist/{catalogue-DH64Duv-.js → catalogue-DN4dvU88.js} +11 -11
- package/dist/{conversations-CXyaNjLR.js → conversations-4ZO0Pjvk.js} +1 -1
- package/dist/{conversations-BWA_---j.cjs → conversations-BaYtooZZ.cjs} +1 -1
- package/dist/{datasets-C1XJLHN8.js → datasets-CYdtUF8e.js} +4 -1
- package/dist/{datasets-hqDd4IUN.cjs → datasets-CZRqni0N.cjs} +4 -1
- package/dist/dist-Bz6gINFc.js +1 -0
- package/dist/{dist-DGwsCtT4.cjs → dist-DaRCrkAU.cjs} +228 -217
- package/dist/{dist-CSffo32A.cjs → dist-uiPbWl5E.cjs} +1 -1
- package/dist/{dist-Bp1bObAq.js → dist-yny1avqv.js} +228 -217
- package/dist/docs/SKILL.md +1 -1
- package/dist/docs/assets/SOURCE_MAP.json +1 -1
- package/dist/docs/references/reference-observability-tracing-advanced-queries.md +20 -0
- package/dist/{dynamic-workflows-DPgV6qtS.cjs → dynamic-workflows-CEKdGcSr.cjs} +4 -4
- package/dist/{dynamic-workflows-DmkCJ4Lp.js → dynamic-workflows-DF9X_oDG.js} +4 -4
- package/dist/{editor-builder-BS2xogE_.cjs → editor-builder-ChYG8YTs.cjs} +1 -1
- package/dist/{editor-builder-BayzCprJ.js → editor-builder-CwsIbd0F.js} +1 -1
- package/dist/{observability-zr7LDCQG.js → observability-URaJnI_U.js} +1 -1
- package/dist/{observability-Cn4P60P4.cjs → observability-zNA_CVaz.cjs} +1 -1
- package/dist/{plans-xGwuiZUd.js → plans-CbR8EDiT.js} +1 -1
- package/dist/{plans-Bes_LVgv.cjs → plans-k3UN9Nd1.cjs} +1 -1
- package/dist/probe-image-size-DZvSdjzK.js +13297 -0
- package/dist/probe-image-size-z8zXmjaH.cjs +13304 -0
- package/dist/{responses-BH567IZf.cjs → responses-B-BKx236.cjs} +1 -1
- package/dist/{responses-CwQO5y2X.js → responses-Blzxy0XP.js} +1 -1
- package/dist/{routes-CrBCJmjc.js → routes-D-I2voQe.js} +16 -16
- package/dist/{routes-6p-xrUIq.cjs → routes-jiZyt9kU.cjs} +16 -16
- package/dist/{schedules-0ceTSdBB.cjs → schedules-CwL28Eca.cjs} +4 -4
- package/dist/{schedules-D_VfFdAH.js → schedules-RWgPeypN.js} +4 -4
- package/dist/{scorer-versions-Bhdvt-cX.cjs → scorer-versions-DK-PGj7-.cjs} +1 -1
- package/dist/{scorer-versions-DhT7Lj33.js → scorer-versions-oJoK2Exw.js} +1 -1
- package/dist/{scores-CXNkN7Bn.cjs → scores-BikU9phm.cjs} +1 -1
- package/dist/{scores-ksmJiJnJ.js → scores-DAv6Uisq.js} +1 -1
- package/dist/server/handlers/a2a.cjs +1 -1
- package/dist/server/handlers/a2a.js +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 +1 -1
- package/dist/server/handlers/agent-controller.js +1 -1
- package/dist/server/handlers/agent-versions.cjs +1 -1
- package/dist/server/handlers/agent-versions.js +1 -1
- package/dist/server/handlers/agents.cjs +1 -1
- package/dist/server/handlers/agents.js +1 -1
- package/dist/server/handlers/auth.cjs +1 -1
- package/dist/server/handlers/auth.js +1 -1
- package/dist/server/handlers/conversations.cjs +1 -1
- package/dist/server/handlers/conversations.js +1 -1
- package/dist/server/handlers/datasets.cjs +16 -11
- package/dist/server/handlers/datasets.d.ts +6 -0
- package/dist/server/handlers/datasets.js +16 -11
- package/dist/server/handlers/dynamic-workflows.cjs +1 -1
- package/dist/server/handlers/dynamic-workflows.js +1 -1
- package/dist/server/handlers/editor-builder.cjs +1 -1
- package/dist/server/handlers/editor-builder.js +1 -1
- package/dist/server/handlers/favorites-enrichment.cjs +1 -1
- package/dist/server/handlers/favorites-enrichment.js +1 -1
- package/dist/server/handlers/observability.cjs +1 -1
- package/dist/server/handlers/observability.js +1 -1
- package/dist/server/handlers/plans.cjs +1 -1
- package/dist/server/handlers/plans.js +1 -1
- package/dist/server/handlers/responses.cjs +1 -1
- package/dist/server/handlers/responses.js +1 -1
- package/dist/server/handlers/schedules.cjs +1 -1
- package/dist/server/handlers/schedules.js +1 -1
- package/dist/server/handlers/scorer-versions.cjs +1 -1
- package/dist/server/handlers/scorer-versions.js +1 -1
- package/dist/server/handlers/scores.cjs +1 -1
- package/dist/server/handlers/scores.js +1 -1
- package/dist/server/handlers/stored-agent-favorites.cjs +3 -3
- package/dist/server/handlers/stored-agent-favorites.js +3 -3
- package/dist/server/handlers/stored-agents.cjs +2 -2
- package/dist/server/handlers/stored-agents.js +2 -2
- package/dist/server/handlers/stored-scorers.cjs +1 -1
- package/dist/server/handlers/stored-scorers.js +1 -1
- package/dist/server/handlers/stored-skill-favorites.cjs +2 -2
- package/dist/server/handlers/stored-skill-favorites.js +2 -2
- package/dist/server/handlers/stored-skills.cjs +1 -1
- package/dist/server/handlers/stored-skills.js +1 -1
- package/dist/server/handlers/system.cjs +1 -1
- package/dist/server/handlers/system.js +1 -1
- package/dist/server/handlers/tool-providers.cjs +2 -2
- package/dist/server/handlers/tool-providers.js +2 -2
- package/dist/server/handlers/tools.cjs +1 -1
- package/dist/server/handlers/tools.js +1 -1
- package/dist/server/handlers/voice.cjs +1 -1
- package/dist/server/handlers/voice.js +1 -1
- package/dist/server/handlers/workflows.cjs +1 -1
- package/dist/server/handlers/workflows.js +1 -1
- package/dist/server/handlers.cjs +12 -12
- package/dist/server/handlers.js +12 -12
- package/dist/server/schemas/datasets.d.ts +3 -0
- package/dist/server/schemas/index.cjs +6 -6
- package/dist/server/schemas/index.js +6 -6
- package/dist/server/server-adapter/index.cjs +3 -3
- package/dist/server/server-adapter/index.js +3 -3
- package/dist/server/server-adapter/routes/conversations.d.ts +3 -3
- package/dist/server/server-adapter/routes/datasets.d.ts +6 -0
- package/dist/{server-adapter-Ceag3til.cjs → server-adapter-BB2Lw2Ig.cjs} +4 -4
- package/dist/{server-adapter-BGOi-s7x.js → server-adapter-CMJcvkpD.js} +4 -4
- package/dist/{stored-agents-m0Knvv29.cjs → stored-agents-BS4_LGSs.cjs} +32 -32
- package/dist/{stored-agents-DmN_pIIl.js → stored-agents-DcyDMKP2.js} +32 -32
- package/dist/{stored-scorers-2F2k6XSx.js → stored-scorers-Bdz_5k57.js} +1 -1
- package/dist/{stored-scorers-iM2Qq9Nh.cjs → stored-scorers-D8YYszOj.cjs} +1 -1
- package/dist/{tool-providers-Cq3vFqgE.js → tool-providers-BN2Ni06Z.js} +2 -2
- package/dist/{tool-providers-BVwRJTtB.cjs → tool-providers-BeiSkVHu.cjs} +2 -2
- package/dist/{tools-DLZ7go-n.cjs → tools-CoamSJif.cjs} +1 -1
- package/dist/{tools-CY44YtDW.js → tools-DsSk01Ti.js} +1 -1
- package/dist/{voice-DTjrAgqg.js → voice-BFh2Zx5m.js} +1 -1
- package/dist/{voice-NaerSeVQ.cjs → voice-CquR7YyA.cjs} +1 -1
- package/dist/{workflows-gIKukZ1O.cjs → workflows-CHKSHV4f.cjs} +33 -0
- package/dist/{workflows-D3QrUMfm.js → workflows-D5bfbang.js} +33 -0
- package/package.json +3 -3
- package/dist/dist-Bn0zFASI.js +0 -1
- package/dist/probe-image-size-BR5MlnnJ.cjs +0 -13304
- package/dist/probe-image-size-DBCcUUw_.js +0 -13297
|
@@ -3,7 +3,7 @@ import { a as agentCardV1ResponseSchema, i as agentCardResponseSchema, o as agen
|
|
|
3
3
|
import { TaskStoreVersionConflictError } from "./server/a2a/store.js";
|
|
4
4
|
import { n as createRoute } from "./route-builder-Dz18c3qm.js";
|
|
5
5
|
import { r as convertInstructionsToString } from "./utils-C2VRtQjI.js";
|
|
6
|
-
import { G as getAgentFromSystem } from "./agents-
|
|
6
|
+
import { G as getAgentFromSystem } from "./agents-YvaBPFiS.js";
|
|
7
7
|
import { getPublicOrigin } from "./server/handlers/auth.js";
|
|
8
8
|
import { z } from "zod/v4";
|
|
9
9
|
import { isDeepStrictEqual } from "util";
|
|
@@ -3,7 +3,7 @@ const require_a2a = require("./a2a-BsBYrosr.cjs");
|
|
|
3
3
|
const require_server_a2a_store = require("./server/a2a/store.cjs");
|
|
4
4
|
const require_route_builder = require("./route-builder-DjTBxSZN.cjs");
|
|
5
5
|
const require_utils = require("./utils-DQJOBnMo.cjs");
|
|
6
|
-
const require_agents = require("./agents-
|
|
6
|
+
const require_agents = require("./agents-BO1mcMDf.cjs");
|
|
7
7
|
const require_server_handlers_auth = require("./server/handlers/auth.cjs");
|
|
8
8
|
let zod_v4 = require("zod/v4");
|
|
9
9
|
let util = require("util");
|
|
@@ -7,7 +7,7 @@ import { o as optionalRunIdSchema, u as runIdSchema } from "./common-J-yUnHk9.js
|
|
|
7
7
|
import { n as createRoute } from "./route-builder-Dz18c3qm.js";
|
|
8
8
|
import { t as WorkflowRegistry } from "./utils-C2VRtQjI.js";
|
|
9
9
|
import { handleError } from "./server/handlers/error.js";
|
|
10
|
-
import { C as STREAM_LEGACY_WORKFLOW_ROUTE, S as START_WORKFLOW_RUN_ROUTE, _ as RESUME_ASYNC_WORKFLOW_ROUTE, a as GET_WORKFLOW_BY_ID_ROUTE, b as RESUME_WORKFLOW_ROUTE, c as LIST_WORKFLOW_RUNS_ROUTE, d as OBSERVE_STREAM_WORKFLOW_ROUTE, n as CREATE_WORKFLOW_RUN_ROUTE, o as GET_WORKFLOW_RUN_BY_ID_ROUTE, s as LIST_WORKFLOWS_ROUTE, t as CANCEL_WORKFLOW_RUN_ROUTE, u as OBSERVE_STREAM_LEGACY_WORKFLOW_ROUTE, v as RESUME_NO_WAIT_WORKFLOW_ROUTE, w as STREAM_WORKFLOW_ROUTE, x as START_ASYNC_WORKFLOW_ROUTE, y as RESUME_STREAM_WORKFLOW_ROUTE } from "./workflows-
|
|
10
|
+
import { C as STREAM_LEGACY_WORKFLOW_ROUTE, S as START_WORKFLOW_RUN_ROUTE, _ as RESUME_ASYNC_WORKFLOW_ROUTE, a as GET_WORKFLOW_BY_ID_ROUTE, b as RESUME_WORKFLOW_ROUTE, c as LIST_WORKFLOW_RUNS_ROUTE, d as OBSERVE_STREAM_WORKFLOW_ROUTE, n as CREATE_WORKFLOW_RUN_ROUTE, o as GET_WORKFLOW_RUN_BY_ID_ROUTE, s as LIST_WORKFLOWS_ROUTE, t as CANCEL_WORKFLOW_RUN_ROUTE, u as OBSERVE_STREAM_LEGACY_WORKFLOW_ROUTE, v as RESUME_NO_WAIT_WORKFLOW_ROUTE, w as STREAM_WORKFLOW_ROUTE, x as START_ASYNC_WORKFLOW_ROUTE, y as RESUME_STREAM_WORKFLOW_ROUTE } from "./workflows-D5bfbang.js";
|
|
11
11
|
// src/server/handlers/agent-builder.ts
|
|
12
12
|
var agent_builder_exports = /* @__PURE__ */ __exportAll({
|
|
13
13
|
CANCEL_AGENT_BUILDER_ACTION_RUN_ROUTE: () => CANCEL_AGENT_BUILDER_ACTION_RUN_ROUTE,
|
|
@@ -30,7 +30,7 @@ var agent_builder_exports = /* @__PURE__ */ __exportAll({
|
|
|
30
30
|
let createAgentBuilderWorkflowsPromise;
|
|
31
31
|
const agentBuilderWorkflowsByMastra = /* @__PURE__ */ new WeakMap();
|
|
32
32
|
async function registerAgentBuilderWorkflows(mastra) {
|
|
33
|
-
createAgentBuilderWorkflowsPromise ??= import("./dist-
|
|
33
|
+
createAgentBuilderWorkflowsPromise ??= import("./dist-yny1avqv.js").then((mod) => mod.createAgentBuilderWorkflows);
|
|
34
34
|
const create = await createAgentBuilderWorkflowsPromise;
|
|
35
35
|
let agentBuilderWorkflows = agentBuilderWorkflowsByMastra.get(mastra);
|
|
36
36
|
if (!agentBuilderWorkflows) {
|
|
@@ -7,7 +7,7 @@ const require_common = require("./common-D5XxSuvu.cjs");
|
|
|
7
7
|
const require_route_builder = require("./route-builder-DjTBxSZN.cjs");
|
|
8
8
|
const require_utils = require("./utils-DQJOBnMo.cjs");
|
|
9
9
|
const require_server_handlers_error = require("./server/handlers/error.cjs");
|
|
10
|
-
const require_workflows$1 = require("./workflows-
|
|
10
|
+
const require_workflows$1 = require("./workflows-CHKSHV4f.cjs");
|
|
11
11
|
// src/server/handlers/agent-builder.ts
|
|
12
12
|
var agent_builder_exports = /* @__PURE__ */ require_rolldown_runtime.__exportAll({
|
|
13
13
|
CANCEL_AGENT_BUILDER_ACTION_RUN_ROUTE: () => CANCEL_AGENT_BUILDER_ACTION_RUN_ROUTE,
|
|
@@ -30,7 +30,7 @@ var agent_builder_exports = /* @__PURE__ */ require_rolldown_runtime.__exportAll
|
|
|
30
30
|
let createAgentBuilderWorkflowsPromise;
|
|
31
31
|
const agentBuilderWorkflowsByMastra = /* @__PURE__ */ new WeakMap();
|
|
32
32
|
async function registerAgentBuilderWorkflows(mastra) {
|
|
33
|
-
createAgentBuilderWorkflowsPromise ??= Promise.resolve().then(() => require("./dist-
|
|
33
|
+
createAgentBuilderWorkflowsPromise ??= Promise.resolve().then(() => require("./dist-DaRCrkAU.cjs")).then((mod) => mod.createAgentBuilderWorkflows);
|
|
34
34
|
const create = await createAgentBuilderWorkflowsPromise;
|
|
35
35
|
let agentBuilderWorkflows = agentBuilderWorkflowsByMastra.get(mastra);
|
|
36
36
|
if (!agentBuilderWorkflows) {
|
|
@@ -775,7 +775,7 @@ const STREAM_AGENT_CONTROLLER_SESSION_ROUTE = require_route_builder.createRoute(
|
|
|
775
775
|
sseFlushOnConnect: true,
|
|
776
776
|
pathParamSchema: sessionPathParams,
|
|
777
777
|
summary: "Stream controller session events",
|
|
778
|
-
description: "Subscribes to a session
|
|
778
|
+
description: "Subscribes to a session\u2019s event bus and streams events to the client over SSE.",
|
|
779
779
|
tags: ["AgentController", "Streaming"],
|
|
780
780
|
requiresAuth: true,
|
|
781
781
|
requiresPermission: "agent-controller:read",
|
|
@@ -921,7 +921,7 @@ const SEND_AGENT_CONTROLLER_MESSAGE_ROUTE = require_route_builder.createRoute({
|
|
|
921
921
|
bodySchema: sendMessageBodySchema,
|
|
922
922
|
responseSchema: ackResponseSchema,
|
|
923
923
|
summary: "Send a message to a controller session",
|
|
924
|
-
description: "Sends a user message to the session. The reply streams as events on the session
|
|
924
|
+
description: "Sends a user message to the session. The reply streams as events on the session\u2019s SSE stream.",
|
|
925
925
|
tags: ["AgentController", "Streaming"],
|
|
926
926
|
requiresAuth: true,
|
|
927
927
|
requiresPermission: "agent-controller:execute",
|
|
@@ -1340,7 +1340,7 @@ const LIST_AGENT_CONTROLLER_THREADS_ROUTE = require_route_builder.createRoute({
|
|
|
1340
1340
|
queryParamSchema: listThreadsQuerySchema,
|
|
1341
1341
|
responseSchema: listThreadsResponseSchema,
|
|
1342
1342
|
summary: "List session threads",
|
|
1343
|
-
description: "Lists every thread of the session
|
|
1343
|
+
description: "Lists every thread of the session\u2019s resource (not only the session\u2019s own threads), most-recently-updated first. Pass `limit` to return only the newest N (e.g. for a sidebar). Pass `tags` (a JSON-encoded object) to scope the list to threads matching every tag \u2014 e.g. `{ projectPath }` so git worktrees sharing a resourceId each see only their own threads.",
|
|
1344
1344
|
tags: ["AgentController"],
|
|
1345
1345
|
requiresAuth: true,
|
|
1346
1346
|
requiresPermission: "agent-controller:read",
|
|
@@ -1404,7 +1404,7 @@ const SEND_AGENT_CONTROLLER_NOTIFICATION_ROUTE = require_route_builder.createRou
|
|
|
1404
1404
|
runId: zod_v4.z.string().optional()
|
|
1405
1405
|
}),
|
|
1406
1406
|
summary: "Send a notification signal to a session",
|
|
1407
|
-
description: "Delivers a notification to the session
|
|
1407
|
+
description: "Delivers a notification to the session\u2019s current agent/thread. The agent\u2019s delivery policy determines whether the notification wakes an idle thread, is summarised, or is persisted for later.",
|
|
1408
1408
|
tags: ["AgentController"],
|
|
1409
1409
|
requiresAuth: true,
|
|
1410
1410
|
requiresPermission: "agent-controller:execute",
|
|
@@ -1702,7 +1702,7 @@ const GET_AGENT_CONTROLLER_OM_RECORD_ROUTE = require_route_builder.createRoute({
|
|
|
1702
1702
|
pathParamSchema: sessionPathParams,
|
|
1703
1703
|
responseSchema: omRecordResponseSchema,
|
|
1704
1704
|
summary: "Get observational memory record",
|
|
1705
|
-
description: "Returns the current observational memory record for the session
|
|
1705
|
+
description: "Returns the current observational memory record for the session\u2019s thread/resource.",
|
|
1706
1706
|
tags: ["AgentController"],
|
|
1707
1707
|
requiresAuth: true,
|
|
1708
1708
|
requiresPermission: "agent-controller:read",
|
|
@@ -1725,7 +1725,7 @@ const SET_AGENT_CONTROLLER_RESOURCE_ID_ROUTE = require_route_builder.createRoute
|
|
|
1725
1725
|
bodySchema: zod_v4.z.object({ newResourceId: zod_v4.z.string() }),
|
|
1726
1726
|
responseSchema: ackResponseSchema,
|
|
1727
1727
|
summary: "Change the session resource ID",
|
|
1728
|
-
description: "Updates the session
|
|
1728
|
+
description: "Updates the session\u2019s resource identity (e.g. when a user logs in).",
|
|
1729
1729
|
tags: ["AgentController"],
|
|
1730
1730
|
requiresAuth: true,
|
|
1731
1731
|
requiresPermission: "agent-controller:execute",
|
|
@@ -1803,7 +1803,7 @@ const GET_AGENT_CONTROLLER_GOAL_ROUTE = require_route_builder.createRoute({
|
|
|
1803
1803
|
pathParamSchema: sessionPathParams,
|
|
1804
1804
|
responseSchema: goalResponseSchema,
|
|
1805
1805
|
summary: "Get the current goal",
|
|
1806
|
-
description: "Returns the active/paused/done goal objective for the session
|
|
1806
|
+
description: "Returns the active/paused/done goal objective for the session\u2019s thread, if any.",
|
|
1807
1807
|
tags: ["AgentController", "Goals"],
|
|
1808
1808
|
requiresAuth: true,
|
|
1809
1809
|
requiresPermission: "agent-controller:read",
|
|
@@ -1828,7 +1828,7 @@ const SET_AGENT_CONTROLLER_GOAL_ROUTE = require_route_builder.createRoute({
|
|
|
1828
1828
|
bodySchema: setGoalBodySchema,
|
|
1829
1829
|
responseSchema: goalResponseSchema,
|
|
1830
1830
|
summary: "Set a goal",
|
|
1831
|
-
description: "Sets a new objective for the session
|
|
1831
|
+
description: "Sets a new objective for the session\u2019s thread. The agent\u2019s in-loop goal judge evaluates progress after each turn.",
|
|
1832
1832
|
tags: ["AgentController", "Goals"],
|
|
1833
1833
|
requiresAuth: true,
|
|
1834
1834
|
requiresPermission: "agent-controller:execute",
|
|
@@ -1887,7 +1887,7 @@ const CLEAR_AGENT_CONTROLLER_GOAL_ROUTE = require_route_builder.createRoute({
|
|
|
1887
1887
|
pathParamSchema: sessionPathParams,
|
|
1888
1888
|
responseSchema: ackResponseSchema,
|
|
1889
1889
|
summary: "Clear the goal",
|
|
1890
|
-
description: "Removes the active goal from the session
|
|
1890
|
+
description: "Removes the active goal from the session\u2019s thread.",
|
|
1891
1891
|
tags: ["AgentController", "Goals"],
|
|
1892
1892
|
requiresAuth: true,
|
|
1893
1893
|
requiresPermission: "agent-controller:execute",
|
|
@@ -775,7 +775,7 @@ const STREAM_AGENT_CONTROLLER_SESSION_ROUTE = createRoute({
|
|
|
775
775
|
sseFlushOnConnect: true,
|
|
776
776
|
pathParamSchema: sessionPathParams,
|
|
777
777
|
summary: "Stream controller session events",
|
|
778
|
-
description: "Subscribes to a session
|
|
778
|
+
description: "Subscribes to a session\u2019s event bus and streams events to the client over SSE.",
|
|
779
779
|
tags: ["AgentController", "Streaming"],
|
|
780
780
|
requiresAuth: true,
|
|
781
781
|
requiresPermission: "agent-controller:read",
|
|
@@ -921,7 +921,7 @@ const SEND_AGENT_CONTROLLER_MESSAGE_ROUTE = createRoute({
|
|
|
921
921
|
bodySchema: sendMessageBodySchema,
|
|
922
922
|
responseSchema: ackResponseSchema,
|
|
923
923
|
summary: "Send a message to a controller session",
|
|
924
|
-
description: "Sends a user message to the session. The reply streams as events on the session
|
|
924
|
+
description: "Sends a user message to the session. The reply streams as events on the session\u2019s SSE stream.",
|
|
925
925
|
tags: ["AgentController", "Streaming"],
|
|
926
926
|
requiresAuth: true,
|
|
927
927
|
requiresPermission: "agent-controller:execute",
|
|
@@ -1340,7 +1340,7 @@ const LIST_AGENT_CONTROLLER_THREADS_ROUTE = createRoute({
|
|
|
1340
1340
|
queryParamSchema: listThreadsQuerySchema,
|
|
1341
1341
|
responseSchema: listThreadsResponseSchema,
|
|
1342
1342
|
summary: "List session threads",
|
|
1343
|
-
description: "Lists every thread of the session
|
|
1343
|
+
description: "Lists every thread of the session\u2019s resource (not only the session\u2019s own threads), most-recently-updated first. Pass `limit` to return only the newest N (e.g. for a sidebar). Pass `tags` (a JSON-encoded object) to scope the list to threads matching every tag \u2014 e.g. `{ projectPath }` so git worktrees sharing a resourceId each see only their own threads.",
|
|
1344
1344
|
tags: ["AgentController"],
|
|
1345
1345
|
requiresAuth: true,
|
|
1346
1346
|
requiresPermission: "agent-controller:read",
|
|
@@ -1404,7 +1404,7 @@ const SEND_AGENT_CONTROLLER_NOTIFICATION_ROUTE = createRoute({
|
|
|
1404
1404
|
runId: z.string().optional()
|
|
1405
1405
|
}),
|
|
1406
1406
|
summary: "Send a notification signal to a session",
|
|
1407
|
-
description: "Delivers a notification to the session
|
|
1407
|
+
description: "Delivers a notification to the session\u2019s current agent/thread. The agent\u2019s delivery policy determines whether the notification wakes an idle thread, is summarised, or is persisted for later.",
|
|
1408
1408
|
tags: ["AgentController"],
|
|
1409
1409
|
requiresAuth: true,
|
|
1410
1410
|
requiresPermission: "agent-controller:execute",
|
|
@@ -1702,7 +1702,7 @@ const GET_AGENT_CONTROLLER_OM_RECORD_ROUTE = createRoute({
|
|
|
1702
1702
|
pathParamSchema: sessionPathParams,
|
|
1703
1703
|
responseSchema: omRecordResponseSchema,
|
|
1704
1704
|
summary: "Get observational memory record",
|
|
1705
|
-
description: "Returns the current observational memory record for the session
|
|
1705
|
+
description: "Returns the current observational memory record for the session\u2019s thread/resource.",
|
|
1706
1706
|
tags: ["AgentController"],
|
|
1707
1707
|
requiresAuth: true,
|
|
1708
1708
|
requiresPermission: "agent-controller:read",
|
|
@@ -1725,7 +1725,7 @@ const SET_AGENT_CONTROLLER_RESOURCE_ID_ROUTE = createRoute({
|
|
|
1725
1725
|
bodySchema: z.object({ newResourceId: z.string() }),
|
|
1726
1726
|
responseSchema: ackResponseSchema,
|
|
1727
1727
|
summary: "Change the session resource ID",
|
|
1728
|
-
description: "Updates the session
|
|
1728
|
+
description: "Updates the session\u2019s resource identity (e.g. when a user logs in).",
|
|
1729
1729
|
tags: ["AgentController"],
|
|
1730
1730
|
requiresAuth: true,
|
|
1731
1731
|
requiresPermission: "agent-controller:execute",
|
|
@@ -1803,7 +1803,7 @@ const GET_AGENT_CONTROLLER_GOAL_ROUTE = createRoute({
|
|
|
1803
1803
|
pathParamSchema: sessionPathParams,
|
|
1804
1804
|
responseSchema: goalResponseSchema,
|
|
1805
1805
|
summary: "Get the current goal",
|
|
1806
|
-
description: "Returns the active/paused/done goal objective for the session
|
|
1806
|
+
description: "Returns the active/paused/done goal objective for the session\u2019s thread, if any.",
|
|
1807
1807
|
tags: ["AgentController", "Goals"],
|
|
1808
1808
|
requiresAuth: true,
|
|
1809
1809
|
requiresPermission: "agent-controller:read",
|
|
@@ -1828,7 +1828,7 @@ const SET_AGENT_CONTROLLER_GOAL_ROUTE = createRoute({
|
|
|
1828
1828
|
bodySchema: setGoalBodySchema,
|
|
1829
1829
|
responseSchema: goalResponseSchema,
|
|
1830
1830
|
summary: "Set a goal",
|
|
1831
|
-
description: "Sets a new objective for the session
|
|
1831
|
+
description: "Sets a new objective for the session\u2019s thread. The agent\u2019s in-loop goal judge evaluates progress after each turn.",
|
|
1832
1832
|
tags: ["AgentController", "Goals"],
|
|
1833
1833
|
requiresAuth: true,
|
|
1834
1834
|
requiresPermission: "agent-controller:execute",
|
|
@@ -1887,7 +1887,7 @@ const CLEAR_AGENT_CONTROLLER_GOAL_ROUTE = createRoute({
|
|
|
1887
1887
|
pathParamSchema: sessionPathParams,
|
|
1888
1888
|
responseSchema: ackResponseSchema,
|
|
1889
1889
|
summary: "Clear the goal",
|
|
1890
|
-
description: "Removes the active goal from the session
|
|
1890
|
+
description: "Removes the active goal from the session\u2019s thread.",
|
|
1891
1891
|
tags: ["AgentController", "Goals"],
|
|
1892
1892
|
requiresAuth: true,
|
|
1893
1893
|
requiresPermission: "agent-controller:execute",
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
const require_default_options = require("./default-options-DRN81WEQ.cjs");
|
|
2
|
-
const require_stored_agents = require("./stored-agents-
|
|
2
|
+
const require_stored_agents = require("./stored-agents-BS4_LGSs.cjs");
|
|
3
3
|
const require_version_common = require("./version-common-Cc0STXl9.cjs");
|
|
4
4
|
let zod_v4 = require("zod/v4");
|
|
5
5
|
// src/server/schemas/agent-versions.ts
|
|
@@ -27,17 +27,17 @@ const agentVersionSchema = zod_v4.z.object({
|
|
|
27
27
|
name: zod_v4.z.string().describe("Name of the agent"),
|
|
28
28
|
description: zod_v4.z.string().optional().describe("Description of the agent"),
|
|
29
29
|
instructions: require_stored_agents.instructionsSchema,
|
|
30
|
-
model: require_stored_agents.conditionalFieldSchema(require_stored_agents.modelConfigSchema).describe("Model configuration
|
|
31
|
-
tools: require_stored_agents.conditionalFieldSchema(require_stored_agents.toolsConfigSchema).optional().describe("Tool keys mapped to per-tool config
|
|
32
|
-
defaultOptions: require_stored_agents.conditionalFieldSchema(require_default_options.defaultOptionsSchema).optional().describe("Default options for generate/stream calls
|
|
33
|
-
workflows: require_stored_agents.conditionalFieldSchema(zod_v4.z.record(zod_v4.z.string(), require_stored_agents.toolConfigSchema)).optional().describe("Workflow keys with optional per-workflow config
|
|
34
|
-
agents: require_stored_agents.conditionalFieldSchema(zod_v4.z.record(zod_v4.z.string(), require_stored_agents.toolConfigSchema)).optional().describe("Agent keys with optional per-agent config
|
|
35
|
-
integrationTools: require_stored_agents.conditionalFieldSchema(zod_v4.z.record(zod_v4.z.string(), mcpClientToolsConfigSchema)).optional().describe("Map of tool provider IDs to their tool configurations
|
|
36
|
-
mcpClients: require_stored_agents.conditionalFieldSchema(zod_v4.z.record(zod_v4.z.string(), mcpClientToolsConfigSchema)).optional().describe("Map of stored MCP client IDs to their tool configurations
|
|
37
|
-
inputProcessors: require_stored_agents.conditionalFieldSchema(require_stored_agents.storedProcessorGraphSchema).optional().describe("Input processor graph
|
|
38
|
-
outputProcessors: require_stored_agents.conditionalFieldSchema(require_stored_agents.storedProcessorGraphSchema).optional().describe("Output processor graph
|
|
39
|
-
memory: require_stored_agents.conditionalFieldSchema(require_stored_agents.storedMemoryRefSchema).optional().describe("Memory: registered memory reference or inline config
|
|
40
|
-
scorers: require_stored_agents.conditionalFieldSchema(zod_v4.z.record(zod_v4.z.string(), require_stored_agents.scorerConfigSchema)).optional().describe("Scorer keys with optional sampling config
|
|
30
|
+
model: require_stored_agents.conditionalFieldSchema(require_stored_agents.modelConfigSchema).describe("Model configuration \u2014 static value or array of conditional variants"),
|
|
31
|
+
tools: require_stored_agents.conditionalFieldSchema(require_stored_agents.toolsConfigSchema).optional().describe("Tool keys mapped to per-tool config \u2014 static or conditional"),
|
|
32
|
+
defaultOptions: require_stored_agents.conditionalFieldSchema(require_default_options.defaultOptionsSchema).optional().describe("Default options for generate/stream calls \u2014 static or conditional"),
|
|
33
|
+
workflows: require_stored_agents.conditionalFieldSchema(zod_v4.z.record(zod_v4.z.string(), require_stored_agents.toolConfigSchema)).optional().describe("Workflow keys with optional per-workflow config \u2014 static or conditional"),
|
|
34
|
+
agents: require_stored_agents.conditionalFieldSchema(zod_v4.z.record(zod_v4.z.string(), require_stored_agents.toolConfigSchema)).optional().describe("Agent keys with optional per-agent config \u2014 static or conditional"),
|
|
35
|
+
integrationTools: require_stored_agents.conditionalFieldSchema(zod_v4.z.record(zod_v4.z.string(), mcpClientToolsConfigSchema)).optional().describe("Map of tool provider IDs to their tool configurations \u2014 static or conditional"),
|
|
36
|
+
mcpClients: require_stored_agents.conditionalFieldSchema(zod_v4.z.record(zod_v4.z.string(), mcpClientToolsConfigSchema)).optional().describe("Map of stored MCP client IDs to their tool configurations \u2014 static or conditional"),
|
|
37
|
+
inputProcessors: require_stored_agents.conditionalFieldSchema(require_stored_agents.storedProcessorGraphSchema).optional().describe("Input processor graph \u2014 static or conditional"),
|
|
38
|
+
outputProcessors: require_stored_agents.conditionalFieldSchema(require_stored_agents.storedProcessorGraphSchema).optional().describe("Output processor graph \u2014 static or conditional"),
|
|
39
|
+
memory: require_stored_agents.conditionalFieldSchema(require_stored_agents.storedMemoryRefSchema).optional().describe("Memory: registered memory reference or inline config \u2014 static or conditional"),
|
|
40
|
+
scorers: require_stored_agents.conditionalFieldSchema(zod_v4.z.record(zod_v4.z.string(), require_stored_agents.scorerConfigSchema)).optional().describe("Scorer keys with optional sampling config \u2014 static or conditional"),
|
|
41
41
|
requestContextSchema: zod_v4.z.record(zod_v4.z.string(), zod_v4.z.unknown()).optional().describe("JSON Schema defining valid request context variables"),
|
|
42
42
|
changedFields: zod_v4.z.array(zod_v4.z.string()).optional().describe("Array of field names that changed from the previous version"),
|
|
43
43
|
changeMessage: zod_v4.z.string().optional().describe("Optional message describing the changes"),
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { t as defaultOptionsSchema } from "./default-options-Dir6CKnE.js";
|
|
2
|
-
import { D as toolsConfigSchema, E as toolConfigSchema, I as storedMemoryRefSchema, T as storedProcessorGraphSchema, f as modelConfigSchema, l as instructionsSchema, t as conditionalFieldSchema, x as scorerConfigSchema } from "./stored-agents-
|
|
2
|
+
import { D as toolsConfigSchema, E as toolConfigSchema, I as storedMemoryRefSchema, T as storedProcessorGraphSchema, f as modelConfigSchema, l as instructionsSchema, t as conditionalFieldSchema, x as scorerConfigSchema } from "./stored-agents-DcyDMKP2.js";
|
|
3
3
|
import { i as createListVersionsResponseSchema, r as createCompareVersionsResponseSchema } from "./version-common-BLTDO88f.js";
|
|
4
4
|
import { z } from "zod/v4";
|
|
5
5
|
// src/server/schemas/agent-versions.ts
|
|
@@ -27,17 +27,17 @@ const agentVersionSchema = z.object({
|
|
|
27
27
|
name: z.string().describe("Name of the agent"),
|
|
28
28
|
description: z.string().optional().describe("Description of the agent"),
|
|
29
29
|
instructions: instructionsSchema,
|
|
30
|
-
model: conditionalFieldSchema(modelConfigSchema).describe("Model configuration
|
|
31
|
-
tools: conditionalFieldSchema(toolsConfigSchema).optional().describe("Tool keys mapped to per-tool config
|
|
32
|
-
defaultOptions: conditionalFieldSchema(defaultOptionsSchema).optional().describe("Default options for generate/stream calls
|
|
33
|
-
workflows: conditionalFieldSchema(z.record(z.string(), toolConfigSchema)).optional().describe("Workflow keys with optional per-workflow config
|
|
34
|
-
agents: conditionalFieldSchema(z.record(z.string(), toolConfigSchema)).optional().describe("Agent keys with optional per-agent config
|
|
35
|
-
integrationTools: conditionalFieldSchema(z.record(z.string(), mcpClientToolsConfigSchema)).optional().describe("Map of tool provider IDs to their tool configurations
|
|
36
|
-
mcpClients: conditionalFieldSchema(z.record(z.string(), mcpClientToolsConfigSchema)).optional().describe("Map of stored MCP client IDs to their tool configurations
|
|
37
|
-
inputProcessors: conditionalFieldSchema(storedProcessorGraphSchema).optional().describe("Input processor graph
|
|
38
|
-
outputProcessors: conditionalFieldSchema(storedProcessorGraphSchema).optional().describe("Output processor graph
|
|
39
|
-
memory: conditionalFieldSchema(storedMemoryRefSchema).optional().describe("Memory: registered memory reference or inline config
|
|
40
|
-
scorers: conditionalFieldSchema(z.record(z.string(), scorerConfigSchema)).optional().describe("Scorer keys with optional sampling config
|
|
30
|
+
model: conditionalFieldSchema(modelConfigSchema).describe("Model configuration \u2014 static value or array of conditional variants"),
|
|
31
|
+
tools: conditionalFieldSchema(toolsConfigSchema).optional().describe("Tool keys mapped to per-tool config \u2014 static or conditional"),
|
|
32
|
+
defaultOptions: conditionalFieldSchema(defaultOptionsSchema).optional().describe("Default options for generate/stream calls \u2014 static or conditional"),
|
|
33
|
+
workflows: conditionalFieldSchema(z.record(z.string(), toolConfigSchema)).optional().describe("Workflow keys with optional per-workflow config \u2014 static or conditional"),
|
|
34
|
+
agents: conditionalFieldSchema(z.record(z.string(), toolConfigSchema)).optional().describe("Agent keys with optional per-agent config \u2014 static or conditional"),
|
|
35
|
+
integrationTools: conditionalFieldSchema(z.record(z.string(), mcpClientToolsConfigSchema)).optional().describe("Map of tool provider IDs to their tool configurations \u2014 static or conditional"),
|
|
36
|
+
mcpClients: conditionalFieldSchema(z.record(z.string(), mcpClientToolsConfigSchema)).optional().describe("Map of stored MCP client IDs to their tool configurations \u2014 static or conditional"),
|
|
37
|
+
inputProcessors: conditionalFieldSchema(storedProcessorGraphSchema).optional().describe("Input processor graph \u2014 static or conditional"),
|
|
38
|
+
outputProcessors: conditionalFieldSchema(storedProcessorGraphSchema).optional().describe("Output processor graph \u2014 static or conditional"),
|
|
39
|
+
memory: conditionalFieldSchema(storedMemoryRefSchema).optional().describe("Memory: registered memory reference or inline config \u2014 static or conditional"),
|
|
40
|
+
scorers: conditionalFieldSchema(z.record(z.string(), scorerConfigSchema)).optional().describe("Scorer keys with optional sampling config \u2014 static or conditional"),
|
|
41
41
|
requestContextSchema: z.record(z.string(), z.unknown()).optional().describe("JSON Schema defining valid request context variables"),
|
|
42
42
|
changedFields: z.array(z.string()).optional().describe("Array of field names that changed from the previous version"),
|
|
43
43
|
changeMessage: z.string().optional().describe("Optional message describing the changes"),
|
|
@@ -5,7 +5,7 @@ const require_schema_TQPB_dl2 = require("./schema-TQPB_dl2-CJX1q58F.cjs");
|
|
|
5
5
|
const require_utils$1 = require("./utils-j29NB2ZJ.cjs");
|
|
6
6
|
const require_http_exception = require("./http-exception-Co3MbFUf.cjs");
|
|
7
7
|
const require_agents = require("./agents-CH_G37hG.cjs");
|
|
8
|
-
const require_stored_agents = require("./stored-agents-
|
|
8
|
+
const require_stored_agents = require("./stored-agents-BS4_LGSs.cjs");
|
|
9
9
|
const require_workspace = require("./workspace-C5BBUatQ.cjs");
|
|
10
10
|
const require_route_builder = require("./route-builder-DjTBxSZN.cjs");
|
|
11
11
|
const require_server_handlers_agent_access = require("./server/handlers/agent-access.cjs");
|
|
@@ -305,6 +305,16 @@ function hasDurableExecution(agent) {
|
|
|
305
305
|
const native = agent;
|
|
306
306
|
return typeof native.__hasDurableExecution === "function" && native.__hasDurableExecution();
|
|
307
307
|
}
|
|
308
|
+
function usesDurableEngine(agent) {
|
|
309
|
+
const native = agent;
|
|
310
|
+
return typeof native.__hasDurableExecution === "function" ? native.__hasDurableExecution() : void 0;
|
|
311
|
+
}
|
|
312
|
+
/** A forwarding proxy can expose the wrapped agent's hook without implementing it itself. */
|
|
313
|
+
function ownsRunStreamHook(agent) {
|
|
314
|
+
const key = "__subscribeToRunStream";
|
|
315
|
+
const prototype = Object.getPrototypeOf(agent);
|
|
316
|
+
return Object.hasOwn(agent, key) || prototype !== null && key in prototype;
|
|
317
|
+
}
|
|
308
318
|
async function validateDurableToolCallAccess({ mastra, agent, runId, toolCallId, requestContext, threadId, abortSignal }) {
|
|
309
319
|
if (!hasDurableExecution(agent)) return;
|
|
310
320
|
const workflowsStore = await mastra.getStorage()?.getStore("workflows");
|
|
@@ -2333,10 +2343,11 @@ const OBSERVE_AGENT_STREAM_ROUTE = require_route_builder.createRoute({
|
|
|
2333
2343
|
permission: require_utils$1.MastraFGAPermissions.MEMORY_READ
|
|
2334
2344
|
})) throw new require_http_exception.HTTPException(404, { message: "Run not found" });
|
|
2335
2345
|
const durableAgent = (0, _mastra_core_agent.isDurableAgentLike)(agent) ? agent : void 0;
|
|
2346
|
+
const fencedAgent = ownsRunStreamHook(agent) && (usesDurableEngine(agent) ?? durableAgent) ? agent : void 0;
|
|
2336
2347
|
const pubsub = durableAgent?.pubsub ?? getAgentStreamPubSub(agent) ?? mastra.pubsub;
|
|
2337
2348
|
const topic = (0, _mastra_core_agent_durable.AGENT_STREAM_TOPIC)(runId);
|
|
2338
2349
|
const subscribe = (onEvent, onComplete) => {
|
|
2339
|
-
if (typeof
|
|
2350
|
+
if (typeof fencedAgent?.__subscribeToRunStream === "function") return fencedAgent.__subscribeToRunStream(runId, {
|
|
2340
2351
|
offset,
|
|
2341
2352
|
onComplete
|
|
2342
2353
|
}, onEvent);
|
|
@@ -2565,7 +2576,7 @@ const LIST_SUSPENDED_RUNS_ROUTE = require_route_builder.createRoute({
|
|
|
2565
2576
|
queryParamSchema: require_agents.listSuspendedRunsQuerySchema,
|
|
2566
2577
|
responseSchema: require_agents.listSuspendedRunsResponseSchema,
|
|
2567
2578
|
summary: "List suspended runs",
|
|
2568
|
-
description: "Lists suspended agent runs from storage
|
|
2579
|
+
description: "Lists suspended agent runs from storage \u2014 runs waiting on a tool-call approval or on a tool that suspended. Works after a server restart and across instances.",
|
|
2569
2580
|
tags: ["Agents", "Tools"],
|
|
2570
2581
|
requiresAuth: true,
|
|
2571
2582
|
handler: async ({ mastra, agentId, requestContext, ...query }) => {
|
|
@@ -5,7 +5,7 @@ import { n as standardSchemaToJSONSchema, r as toStandardSchema } from "./schema
|
|
|
5
5
|
import { _ as MastraFGAPermissions, a as getEffectiveThreadId, c as mergeBodyRequestContext, d as requireEffectiveResourceId, f as sanitizeBody, g as validateThreadOwnership, h as validateRunOwnership, i as getEffectiveResourceId, m as validateBody, n as enforceThreadAccess, o as getHandlerFGAProvider, p as stripClientCredentialHeaders, r as getContextResourceId, t as applyEffectiveThreadId } from "./utils-CvYihOoy.js";
|
|
6
6
|
import { t as HTTPException } from "./http-exception-CzaWkxMl.js";
|
|
7
7
|
import { $ as toolCallResponseSchema, A as observeAgentBodySchema, B as sendAgentMessageBodySchema, C as generateResponseSchema, E as listSuspendedRunsResponseSchema, F as queueAgentSignalBodySchema, G as serializedAgentSchema, H as sendToolApprovalBodySchema, I as recoverBodySchema, L as reorderAgentModelListBodySchema, N as providersResponseSchema, O as modelConfigIdPathParams, P as queueAgentMessageBodySchema, Q as subscribeAgentThreadBodySchema, R as resumeStreamBodySchema, T as listSuspendedRunsQuerySchema, U as sendToolApprovalResponseSchema, V as sendAgentSignalBodySchema, X as streamResponseSchema, Z as streamUntilIdleBodySchema, _ as declineToolCallBodySchema, a as agentIdPathParams, c as agentRunPathParams, d as agentVersionQuerySchema, f as approveNetworkToolCallBodySchema, g as declineNetworkToolCallBodySchema, h as cancelPendingAgentSignalsResponseSchema, i as agentExecutionLegacyBodySchema, j as observeAgentResponseSchema, k as modelManagementResponseSchema, l as agentSkillPathParams, m as cancelPendingAgentSignalsBodySchema, n as abortAgentThreadResponseSchema, nt as updateAgentModelInModelListBodySchema, p as approveToolCallBodySchema, r as agentExecutionBodySchema, t as abortAgentThreadBodySchema, tt as updateAgentModelBodySchema, v as enhanceInstructionsBodySchema, w as listAgentsResponseSchema, y as enhanceInstructionsResponseSchema, z as resumeStreamUntilIdleBodySchema } from "./agents-B0OpLdbp.js";
|
|
8
|
-
import { r as createStoredAgentResponseSchema } from "./stored-agents-
|
|
8
|
+
import { r as createStoredAgentResponseSchema } from "./stored-agents-DcyDMKP2.js";
|
|
9
9
|
import { O as skillDisambiguationQuerySchema, h as getAgentSkillResponseSchema } from "./workspace-DBDA3UQl.js";
|
|
10
10
|
import { n as createRoute } from "./route-builder-Dz18c3qm.js";
|
|
11
11
|
import { assertStoredAgentAccess } from "./server/handlers/agent-access.js";
|
|
@@ -305,6 +305,16 @@ function hasDurableExecution(agent) {
|
|
|
305
305
|
const native = agent;
|
|
306
306
|
return typeof native.__hasDurableExecution === "function" && native.__hasDurableExecution();
|
|
307
307
|
}
|
|
308
|
+
function usesDurableEngine(agent) {
|
|
309
|
+
const native = agent;
|
|
310
|
+
return typeof native.__hasDurableExecution === "function" ? native.__hasDurableExecution() : void 0;
|
|
311
|
+
}
|
|
312
|
+
/** A forwarding proxy can expose the wrapped agent's hook without implementing it itself. */
|
|
313
|
+
function ownsRunStreamHook(agent) {
|
|
314
|
+
const key = "__subscribeToRunStream";
|
|
315
|
+
const prototype = Object.getPrototypeOf(agent);
|
|
316
|
+
return Object.hasOwn(agent, key) || prototype !== null && key in prototype;
|
|
317
|
+
}
|
|
308
318
|
async function validateDurableToolCallAccess({ mastra, agent, runId, toolCallId, requestContext, threadId, abortSignal }) {
|
|
309
319
|
if (!hasDurableExecution(agent)) return;
|
|
310
320
|
const workflowsStore = await mastra.getStorage()?.getStore("workflows");
|
|
@@ -2333,10 +2343,11 @@ const OBSERVE_AGENT_STREAM_ROUTE = createRoute({
|
|
|
2333
2343
|
permission: MastraFGAPermissions.MEMORY_READ
|
|
2334
2344
|
})) throw new HTTPException(404, { message: "Run not found" });
|
|
2335
2345
|
const durableAgent = isDurableAgentLike(agent) ? agent : void 0;
|
|
2346
|
+
const fencedAgent = ownsRunStreamHook(agent) && (usesDurableEngine(agent) ?? durableAgent) ? agent : void 0;
|
|
2336
2347
|
const pubsub = durableAgent?.pubsub ?? getAgentStreamPubSub(agent) ?? mastra.pubsub;
|
|
2337
2348
|
const topic = AGENT_STREAM_TOPIC(runId);
|
|
2338
2349
|
const subscribe = (onEvent, onComplete) => {
|
|
2339
|
-
if (typeof
|
|
2350
|
+
if (typeof fencedAgent?.__subscribeToRunStream === "function") return fencedAgent.__subscribeToRunStream(runId, {
|
|
2340
2351
|
offset,
|
|
2341
2352
|
onComplete
|
|
2342
2353
|
}, onEvent);
|
|
@@ -2565,7 +2576,7 @@ const LIST_SUSPENDED_RUNS_ROUTE = createRoute({
|
|
|
2565
2576
|
queryParamSchema: listSuspendedRunsQuerySchema,
|
|
2566
2577
|
responseSchema: listSuspendedRunsResponseSchema,
|
|
2567
2578
|
summary: "List suspended runs",
|
|
2568
|
-
description: "Lists suspended agent runs from storage
|
|
2579
|
+
description: "Lists suspended agent runs from storage \u2014 runs waiting on a tool-call approval or on a tool that suspended. Works after a server restart and across instances.",
|
|
2569
2580
|
tags: ["Agents", "Tools"],
|
|
2570
2581
|
requiresAuth: true,
|
|
2571
2582
|
handler: async ({ mastra, agentId, requestContext, ...query }) => {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
require("./rolldown-runtime-10nMEhjP.cjs");
|
|
2
2
|
const require_route_builder = require("./route-builder-DjTBxSZN.cjs");
|
|
3
|
-
const require_routes = require("./routes-
|
|
3
|
+
const require_routes = require("./routes-jiZyt9kU.cjs");
|
|
4
4
|
// src/server/server-adapter/api-schema-manifest.ts
|
|
5
5
|
function convertSchema(schema, io) {
|
|
6
6
|
return schema ? require_route_builder.schemaToJsonSchema(schema, io) : void 0;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { c as schemaToJsonSchema } from "./route-builder-Dz18c3qm.js";
|
|
2
|
-
import { r as SERVER_ROUTES } from "./routes-
|
|
2
|
+
import { r as SERVER_ROUTES } from "./routes-D-I2voQe.js";
|
|
3
3
|
// src/server/server-adapter/api-schema-manifest.ts
|
|
4
4
|
function convertSchema(schema, io) {
|
|
5
5
|
return schema ? schemaToJsonSchema(schema, io) : void 0;
|
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
const require_rolldown_runtime = require("./rolldown-runtime-10nMEhjP.cjs");
|
|
2
2
|
const require_schema_TQPB_dl2 = require("./schema-TQPB_dl2-CJX1q58F.cjs");
|
|
3
3
|
require("./constants-CyNbINin.cjs");
|
|
4
|
-
const require_agents = require("./agents-
|
|
5
|
-
const require_tools = require("./tools-
|
|
6
|
-
const require_workflows = require("./workflows-
|
|
7
|
-
const require_server_adapter = require("./server-adapter-
|
|
8
|
-
const require_routes = require("./routes-
|
|
4
|
+
const require_agents = require("./agents-BO1mcMDf.cjs");
|
|
5
|
+
const require_tools = require("./tools-CoamSJif.cjs");
|
|
6
|
+
const require_workflows = require("./workflows-CHKSHV4f.cjs");
|
|
7
|
+
const require_server_adapter = require("./server-adapter-BB2Lw2Ig.cjs");
|
|
8
|
+
const require_routes = require("./routes-jiZyt9kU.cjs");
|
|
9
9
|
require("./utils-DQJOBnMo.cjs");
|
|
10
10
|
const require_memory = require("./memory-4Izw-l6v.cjs");
|
|
11
|
-
const require_observability = require("./observability-
|
|
11
|
+
const require_observability = require("./observability-zNA_CVaz.cjs");
|
|
12
12
|
const require_observability_new_endpoints = require("./observability-new-endpoints-iRwQxqwY.cjs");
|
|
13
|
-
const require_editor_builder = require("./editor-builder-
|
|
13
|
+
const require_editor_builder = require("./editor-builder-ChYG8YTs.cjs");
|
|
14
14
|
const require_server_handlers_stored_agents = require("./server/handlers/stored-agents.cjs");
|
|
15
|
-
const require_stored_agents = require("./stored-agents-
|
|
15
|
+
const require_stored_agents = require("./stored-agents-BS4_LGSs.cjs");
|
|
16
16
|
let _mastra_core_error = require("@mastra/core/error");
|
|
17
17
|
let _mastra_core_tools = require("@mastra/core/tools");
|
|
18
18
|
let _mastra_core_storage = require("@mastra/core/storage");
|
|
@@ -369,13 +369,13 @@ async function addMemoryTools(kit) {
|
|
|
369
369
|
}, signal));
|
|
370
370
|
}
|
|
371
371
|
// src/server/mcp/toolsets/observability-summary.ts
|
|
372
|
-
const DETAILS = "Call get_trace with a traceId for its span tree, and get_span for a span
|
|
372
|
+
const DETAILS = "Call get_trace with a traceId for its span tree, and get_span for a span\u2019s full input and output.";
|
|
373
373
|
const isRow = (value) => typeof value === "object" && value !== null && !Array.isArray(value);
|
|
374
374
|
const rowsOf = (output, key) => Array.isArray(output[key]) ? output[key].filter(isRow) : [];
|
|
375
375
|
const text = (value, max) => {
|
|
376
376
|
if (typeof value !== "string" || !value) return void 0;
|
|
377
377
|
const line = value.replace(/\s+/g, " ").trim();
|
|
378
|
-
return line.length > max ? `${line.slice(0, max)}
|
|
378
|
+
return line.length > max ? `${line.slice(0, max)}\u2026` : line;
|
|
379
379
|
};
|
|
380
380
|
function duration(row) {
|
|
381
381
|
if (typeof row.durationMs === "number") return `${row.durationMs}ms`;
|
|
@@ -752,7 +752,7 @@ function addObservabilityTools(kit) {
|
|
|
752
752
|
require_observability_new_endpoints.GET_METRIC_LABEL_KEYS,
|
|
753
753
|
require_observability_new_endpoints.GET_METRIC_LABEL_VALUES
|
|
754
754
|
], object({
|
|
755
|
-
metricName: str("List the label keys of this metric (or, with labelKey, one label
|
|
755
|
+
metricName: str("List the label keys of this metric (or, with labelKey, one label\u2019s values)."),
|
|
756
756
|
labelKey: str("With metricName, list the values of this label."),
|
|
757
757
|
prefix: str("Only names or values starting with this."),
|
|
758
758
|
limit: {
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
import { n as standardSchemaToJSONSchema, r as toStandardSchema } from "./schema-TQPB_dl2-CCzMcdDx.js";
|
|
2
2
|
import "./constants-C1ASuP4t.js";
|
|
3
|
-
import { G as getAgentFromSystem, f as GENERATE_AGENT_ROUTE, h as GET_AGENT_BY_ID_ROUTE, v as LIST_AGENTS_ROUTE } from "./agents-
|
|
4
|
-
import { a as LIST_TOOLS_ROUTE, i as GET_TOOL_BY_ID_ROUTE, n as EXECUTE_TOOL_ROUTE, o as findTool } from "./tools-
|
|
5
|
-
import { _ as RESUME_ASYNC_WORKFLOW_ROUTE, a as GET_WORKFLOW_BY_ID_ROUTE, k as listWorkflowsFromSystem, o as GET_WORKFLOW_RUN_BY_ID_ROUTE, s as LIST_WORKFLOWS_ROUTE, t as CANCEL_WORKFLOW_RUN_ROUTE, x as START_ASYNC_WORKFLOW_ROUTE } from "./workflows-
|
|
6
|
-
import { o as checkRouteRBAC, r as authorizeRoute, s as dispatchRoute } from "./server-adapter-
|
|
7
|
-
import { c as getBuiltinMCPCapabilities, s as getEffectivePermission } from "./routes-
|
|
3
|
+
import { G as getAgentFromSystem, f as GENERATE_AGENT_ROUTE, h as GET_AGENT_BY_ID_ROUTE, v as LIST_AGENTS_ROUTE } from "./agents-YvaBPFiS.js";
|
|
4
|
+
import { a as LIST_TOOLS_ROUTE, i as GET_TOOL_BY_ID_ROUTE, n as EXECUTE_TOOL_ROUTE, o as findTool } from "./tools-DsSk01Ti.js";
|
|
5
|
+
import { _ as RESUME_ASYNC_WORKFLOW_ROUTE, a as GET_WORKFLOW_BY_ID_ROUTE, k as listWorkflowsFromSystem, o as GET_WORKFLOW_RUN_BY_ID_ROUTE, s as LIST_WORKFLOWS_ROUTE, t as CANCEL_WORKFLOW_RUN_ROUTE, x as START_ASYNC_WORKFLOW_ROUTE } from "./workflows-D5bfbang.js";
|
|
6
|
+
import { o as checkRouteRBAC, r as authorizeRoute, s as dispatchRoute } from "./server-adapter-CMJcvkpD.js";
|
|
7
|
+
import { c as getBuiltinMCPCapabilities, s as getEffectivePermission } from "./routes-D-I2voQe.js";
|
|
8
8
|
import "./utils-C2VRtQjI.js";
|
|
9
9
|
import { E as UPDATE_THREAD_ROUTE, b as LIST_THREADS_ROUTE, d as GET_MEMORY_STATUS_ROUTE, f as GET_OBSERVATIONAL_MEMORY_ROUTE, g as GET_WORKING_MEMORY_ROUTE, h as GET_THREAD_BY_ID_ROUTE, i as CREATE_THREAD_ROUTE, l as GET_MEMORY_CONFIG_ROUTE, n as CLONE_THREAD_ROUTE, p as GET_RESOURCE_WORKING_MEMORY_ROUTE, t as AWAIT_BUFFER_STATUS_ROUTE, v as LIST_MESSAGES_ROUTE } from "./memory-03B4pe3w.js";
|
|
10
|
-
import { a as GET_TRACE_ROUTE, i as GET_TRACE_LIGHT_ROUTE, o as GET_TRACE_TRAJECTORY_ROUTE, r as GET_SPAN_ROUTE, u as LIST_TRACES_ROUTE } from "./observability-
|
|
10
|
+
import { a as GET_TRACE_ROUTE, i as GET_TRACE_LIGHT_ROUTE, o as GET_TRACE_TRAJECTORY_ROUTE, r as GET_SPAN_ROUTE, u as LIST_TRACES_ROUTE } from "./observability-URaJnI_U.js";
|
|
11
11
|
import { A as GET_TRACE_QUERY_FIELDS, D as GET_SCORE_TIME_SERIES, E as GET_SCORE_PERCENTILES, F as LIST_SCORES, L as QUERY_SPANS, M as LIST_FEEDBACK, N as LIST_LOGS, O as GET_SERVICE_NAMES, R as QUERY_THREADS, S as GET_METRIC_TIME_SERIES, T as GET_SCORE_BREAKDOWN, _ as GET_METRIC_BREAKDOWN, b as GET_METRIC_NAMES, c as GET_ENTITY_NAMES, f as GET_FEEDBACK_AGGREGATE, g as GET_METRIC_AGGREGATE, h as GET_FEEDBACK_TIME_SERIES, j as GET_TRACE_QUERY_VALUES, k as GET_TAGS, l as GET_ENTITY_TYPES, m as GET_FEEDBACK_PERCENTILES, n as AGGREGATE_TRACES, p as GET_FEEDBACK_BREAKDOWN, s as GET_CAPABILITIES, t as AGGREGATE_SPANS, u as GET_ENVIRONMENTS, v as GET_METRIC_LABEL_KEYS, w as GET_SCORE_AGGREGATE, x as GET_METRIC_PERCENTILES, y as GET_METRIC_LABEL_VALUES, z as QUERY_TRACES } from "./observability-new-endpoints-vj6FaEcm.js";
|
|
12
|
-
import { t as GET_EDITOR_BUILDER_AVAILABLE_MODELS_ROUTE } from "./editor-builder-
|
|
12
|
+
import { t as GET_EDITOR_BUILDER_AVAILABLE_MODELS_ROUTE } from "./editor-builder-CwsIbd0F.js";
|
|
13
13
|
import { CREATE_STORED_AGENT_ROUTE, GET_STORED_AGENT_ROUTE, LIST_STORED_AGENTS_ROUTE, UPDATE_STORED_AGENT_ROUTE } from "./server/handlers/stored-agents.js";
|
|
14
|
-
import { O as updateStoredAgentBodySchema, n as createStoredAgentBodySchema } from "./stored-agents-
|
|
14
|
+
import { O as updateStoredAgentBodySchema, n as createStoredAgentBodySchema } from "./stored-agents-DcyDMKP2.js";
|
|
15
15
|
import { ErrorCategory, ErrorDomain, MastraError } from "@mastra/core/error";
|
|
16
16
|
import { createTool } from "@mastra/core/tools";
|
|
17
17
|
import * as coreStorage from "@mastra/core/storage";
|
|
@@ -367,13 +367,13 @@ async function addMemoryTools(kit) {
|
|
|
367
367
|
}, signal));
|
|
368
368
|
}
|
|
369
369
|
// src/server/mcp/toolsets/observability-summary.ts
|
|
370
|
-
const DETAILS = "Call get_trace with a traceId for its span tree, and get_span for a span
|
|
370
|
+
const DETAILS = "Call get_trace with a traceId for its span tree, and get_span for a span\u2019s full input and output.";
|
|
371
371
|
const isRow = (value) => typeof value === "object" && value !== null && !Array.isArray(value);
|
|
372
372
|
const rowsOf = (output, key) => Array.isArray(output[key]) ? output[key].filter(isRow) : [];
|
|
373
373
|
const text = (value, max) => {
|
|
374
374
|
if (typeof value !== "string" || !value) return void 0;
|
|
375
375
|
const line = value.replace(/\s+/g, " ").trim();
|
|
376
|
-
return line.length > max ? `${line.slice(0, max)}
|
|
376
|
+
return line.length > max ? `${line.slice(0, max)}\u2026` : line;
|
|
377
377
|
};
|
|
378
378
|
function duration(row) {
|
|
379
379
|
if (typeof row.durationMs === "number") return `${row.durationMs}ms`;
|
|
@@ -750,7 +750,7 @@ function addObservabilityTools(kit) {
|
|
|
750
750
|
GET_METRIC_LABEL_KEYS,
|
|
751
751
|
GET_METRIC_LABEL_VALUES
|
|
752
752
|
], object({
|
|
753
|
-
metricName: str("List the label keys of this metric (or, with labelKey, one label
|
|
753
|
+
metricName: str("List the label keys of this metric (or, with labelKey, one label\u2019s values)."),
|
|
754
754
|
labelKey: str("With metricName, list the values of this label."),
|
|
755
755
|
prefix: str("Only names or values starting with this."),
|
|
756
756
|
limit: {
|
|
@@ -3,7 +3,7 @@ import { _ as MastraFGAPermissions, g as validateThreadOwnership, i as getEffect
|
|
|
3
3
|
import { t as HTTPException } from "./http-exception-CzaWkxMl.js";
|
|
4
4
|
import { a as createConversationBodySchema, i as conversationObjectSchema, n as conversationIdPathParams, r as conversationItemsListSchema, t as conversationDeletedSchema } from "./conversations-DHrKTI6x.js";
|
|
5
5
|
import { n as createRoute } from "./route-builder-Dz18c3qm.js";
|
|
6
|
-
import { G as getAgentFromSystem } from "./agents-
|
|
6
|
+
import { G as getAgentFromSystem } from "./agents-YvaBPFiS.js";
|
|
7
7
|
import { handleError } from "./server/handlers/error.js";
|
|
8
8
|
import { mapMastraMessagesToConversationItems } from "./server/handlers/responses.adapter.js";
|
|
9
9
|
import { findConversationThreadAcrossAgents, getAgentMemoryStore } from "./server/handlers/responses.storage.js";
|
|
@@ -3,7 +3,7 @@ const require_utils = require("./utils-j29NB2ZJ.cjs");
|
|
|
3
3
|
const require_http_exception = require("./http-exception-Co3MbFUf.cjs");
|
|
4
4
|
const require_conversations = require("./conversations-BVj0Dk2Q.cjs");
|
|
5
5
|
const require_route_builder = require("./route-builder-DjTBxSZN.cjs");
|
|
6
|
-
const require_agents = require("./agents-
|
|
6
|
+
const require_agents = require("./agents-BO1mcMDf.cjs");
|
|
7
7
|
const require_server_handlers_error = require("./server/handlers/error.cjs");
|
|
8
8
|
const require_server_handlers_responses_adapter = require("./server/handlers/responses.adapter.cjs");
|
|
9
9
|
const require_server_handlers_responses_storage = require("./server/handlers/responses.storage.cjs");
|
|
@@ -328,7 +328,10 @@ const triggerExperimentBodySchema = z.object({
|
|
|
328
328
|
provider: z.string().min(1),
|
|
329
329
|
modelId: z.string().min(1)
|
|
330
330
|
}).optional().describe("Model to run an agent target on for this experiment only, instead of the model the agent is configured with. Passed per call; the agent itself is not changed and the model is not stored on the experiment."),
|
|
331
|
-
maxConcurrency: z.number().optional().describe("Maximum concurrent executions"),
|
|
331
|
+
maxConcurrency: z.number().int().positive().optional().describe("Maximum concurrent executions"),
|
|
332
|
+
itemTimeout: z.number().int().positive().optional().describe("Per-item timeout in milliseconds"),
|
|
333
|
+
maxRetries: z.number().int().min(0).optional().describe("Retries per item after a failed attempt (tool-mock and abort errors are never retried)"),
|
|
334
|
+
durable: z.boolean().optional().describe("Start the experiment as a durable evented workflow instead of in this process. Its events go on the Mastra pubsub, so it only runs where something handles them. Only serializable options are allowed."),
|
|
332
335
|
provenance: z.object({
|
|
333
336
|
source: z.string().optional(),
|
|
334
337
|
sourceId: z.string().optional(),
|
|
@@ -328,7 +328,10 @@ const triggerExperimentBodySchema = zod_v4.z.object({
|
|
|
328
328
|
provider: zod_v4.z.string().min(1),
|
|
329
329
|
modelId: zod_v4.z.string().min(1)
|
|
330
330
|
}).optional().describe("Model to run an agent target on for this experiment only, instead of the model the agent is configured with. Passed per call; the agent itself is not changed and the model is not stored on the experiment."),
|
|
331
|
-
maxConcurrency: zod_v4.z.number().optional().describe("Maximum concurrent executions"),
|
|
331
|
+
maxConcurrency: zod_v4.z.number().int().positive().optional().describe("Maximum concurrent executions"),
|
|
332
|
+
itemTimeout: zod_v4.z.number().int().positive().optional().describe("Per-item timeout in milliseconds"),
|
|
333
|
+
maxRetries: zod_v4.z.number().int().min(0).optional().describe("Retries per item after a failed attempt (tool-mock and abort errors are never retried)"),
|
|
334
|
+
durable: zod_v4.z.boolean().optional().describe("Start the experiment as a durable evented workflow instead of in this process. Its events go on the Mastra pubsub, so it only runs where something handles them. Only serializable options are allowed."),
|
|
332
335
|
provenance: zod_v4.z.object({
|
|
333
336
|
source: zod_v4.z.string().optional(),
|
|
334
337
|
sourceId: zod_v4.z.string().optional(),
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { n as openai } from "./dist-yny1avqv.js";
|