@mastra/server 1.75.0-alpha.0 → 1.75.0-alpha.2
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/{agent-versions-BA8ug-Iy.js → agent-versions-CTAEDQuT.js} +3 -3
- package/dist/agent-versions-CTAEDQuT.js.map +1 -0
- package/dist/{agent-versions-BNqDvnn0.cjs → agent-versions-RvvNdlZk.cjs} +3 -3
- package/dist/agent-versions-RvvNdlZk.cjs.map +1 -0
- package/dist/{api-schema-manifest-BmraF-WX.js → api-schema-manifest-B0p6nxU1.js} +2 -2
- package/dist/{api-schema-manifest-BmraF-WX.js.map → api-schema-manifest-B0p6nxU1.js.map} +1 -1
- package/dist/{api-schema-manifest-Blh5-4VH.cjs → api-schema-manifest-D9_jxxNw.cjs} +2 -2
- package/dist/{api-schema-manifest-Blh5-4VH.cjs.map → api-schema-manifest-D9_jxxNw.cjs.map} +1 -1
- package/dist/{dist-DH39C5Bz.js → dist-5xXLv6KR.js} +110 -44
- package/dist/{dist-DH39C5Bz.js.map → dist-5xXLv6KR.js.map} +1 -1
- package/dist/{dist-DJ7t3yBx.js → dist-8fx1_bLF.js} +3 -3
- package/dist/{dist-DJ7t3yBx.js.map → dist-8fx1_bLF.js.map} +1 -1
- package/dist/{dist-IDt748Ya.cjs → dist-B6rOIYr_.cjs} +110 -44
- package/dist/{dist-IDt748Ya.cjs.map → dist-B6rOIYr_.cjs.map} +1 -1
- package/dist/{dist-D1rb-p2Y.js → dist-BCTqy9i3.js} +4 -4
- package/dist/{dist-D1rb-p2Y.js.map → dist-BCTqy9i3.js.map} +1 -1
- package/dist/{dist-DO5NHh-t.cjs → dist-Bw2XgCSY.cjs} +3 -3
- package/dist/{dist-DO5NHh-t.cjs.map → dist-Bw2XgCSY.cjs.map} +1 -1
- package/dist/{dist-Dx2Qp8Rj.js → dist-Bz4l8I_x.js} +3 -3
- package/dist/{dist-Dx2Qp8Rj.js.map → dist-Bz4l8I_x.js.map} +1 -1
- package/dist/{dist-DD1mFVAc.js → dist-C5TZXkhS.js} +3 -3
- package/dist/dist-C5TZXkhS.js.map +1 -0
- package/dist/{dist-B0uCWZUF.cjs → dist-CgemVduI.cjs} +4 -4
- package/dist/{dist-B0uCWZUF.cjs.map → dist-CgemVduI.cjs.map} +1 -1
- package/dist/{dist-Bl3UrwJs.js → dist-D1oSHJhK.js} +3 -3
- package/dist/{dist-Bl3UrwJs.js.map → dist-D1oSHJhK.js.map} +1 -1
- package/dist/{dist-vM0zJcP5.cjs → dist-D5O8s1u2.cjs} +3 -3
- package/dist/{dist-vM0zJcP5.cjs.map → dist-D5O8s1u2.cjs.map} +1 -1
- package/dist/{dist-BQ0VOLA9.cjs → dist-D5mpJHHH.cjs} +3 -3
- package/dist/{dist-BQ0VOLA9.cjs.map → dist-D5mpJHHH.cjs.map} +1 -1
- package/dist/{dist-CkFmsB2E.cjs → dist-UACuV_1t.cjs} +3 -3
- package/dist/{dist-CkFmsB2E.cjs.map → dist-UACuV_1t.cjs.map} +1 -1
- package/dist/{dist-DiEECrlS.js → dist-_RnqhYfY.js} +3 -3
- package/dist/{dist-DiEECrlS.js.map → dist-_RnqhYfY.js.map} +1 -1
- package/dist/{dist-C2u5Kqxy.cjs → dist-tYOY8gEs.cjs} +3 -3
- package/dist/dist-tYOY8gEs.cjs.map +1 -0
- package/dist/docs/SKILL.md +1 -1
- package/dist/docs/assets/SOURCE_MAP.json +1 -1
- package/dist/{helpers-8jl_xtug.cjs → helpers-DhvWjBBJ.cjs} +36 -20
- package/dist/helpers-DhvWjBBJ.cjs.map +1 -0
- package/dist/{helpers-610L0lwQ.js → helpers-DudW6a17.js} +36 -20
- package/dist/helpers-DudW6a17.js.map +1 -0
- package/dist/{routes-CcjyQojv.cjs → routes-BuiLQCOQ.cjs} +3 -3
- package/dist/{routes-CcjyQojv.cjs.map → routes-BuiLQCOQ.cjs.map} +1 -1
- package/dist/{routes-Boe1UThy.js → routes-CJygX0-a.js} +3 -3
- package/dist/{routes-Boe1UThy.js.map → routes-CJygX0-a.js.map} +1 -1
- package/dist/{schedules-DTYwAXI_.cjs → schedules-Buunf_MT.cjs} +11 -5
- package/dist/schedules-Buunf_MT.cjs.map +1 -0
- package/dist/{schedules-Cv3CVT2a.js → schedules-OiPV0jLY.js} +11 -5
- package/dist/schedules-OiPV0jLY.js.map +1 -0
- package/dist/{scorer-versions-nip3xSwF.cjs → scorer-versions-BfGNw7Wp.cjs} +2 -2
- package/dist/{scorer-versions-nip3xSwF.cjs.map → scorer-versions-BfGNw7Wp.cjs.map} +1 -1
- package/dist/{scorer-versions-CscApWzu.js → scorer-versions-gXsdWw0V.js} +2 -2
- package/dist/{scorer-versions-CscApWzu.js.map → scorer-versions-gXsdWw0V.js.map} +1 -1
- package/dist/server/auth/helpers.d.ts.map +1 -1
- package/dist/server/auth/index.cjs +1 -1
- package/dist/server/auth/index.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.d.ts +998 -22
- package/dist/server/handlers/agent-versions.d.ts.map +1 -1
- package/dist/server/handlers/agent-versions.js +1 -1
- package/dist/server/handlers/agents.cjs +18 -2
- package/dist/server/handlers/agents.cjs.map +1 -1
- package/dist/server/handlers/agents.d.ts +248 -4
- package/dist/server/handlers/agents.d.ts.map +1 -1
- package/dist/server/handlers/agents.js +18 -2
- package/dist/server/handlers/agents.js.map +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/logs.cjs +1 -1
- package/dist/server/handlers/logs.js +1 -1
- package/dist/server/handlers/memory.cjs +1 -1
- package/dist/server/handlers/memory.js +1 -1
- package/dist/server/handlers/observability-new-endpoints.d.ts +35 -3
- package/dist/server/handlers/observability-new-endpoints.d.ts.map +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/responses.storage.cjs +1 -1
- package/dist/server/handlers/responses.storage.js +1 -1
- package/dist/server/handlers/schedules.cjs +1 -1
- package/dist/server/handlers/schedules.d.ts +26 -13
- package/dist/server/handlers/schedules.d.ts.map +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/stored-agent-favorites.cjs +1 -1
- package/dist/server/handlers/stored-agent-favorites.js +1 -1
- package/dist/server/handlers/stored-agents.cjs +1 -1
- package/dist/server/handlers/stored-agents.d.ts +1065 -89
- package/dist/server/handlers/stored-agents.d.ts.map +1 -1
- package/dist/server/handlers/stored-agents.js +1 -1
- package/dist/server/handlers/stored-scorers.cjs +1 -1
- package/dist/server/handlers/stored-scorers.js +1 -1
- package/dist/server/handlers/system.cjs +1 -1
- package/dist/server/handlers/system.js +1 -1
- package/dist/server/handlers/tools.cjs +1 -1
- package/dist/server/handlers/tools.js +1 -1
- package/dist/server/handlers/utils.cjs +2 -1
- package/dist/server/handlers/utils.d.ts +6 -0
- package/dist/server/handlers/utils.d.ts.map +1 -1
- package/dist/server/handlers/utils.js +2 -2
- package/dist/server/handlers/workflow-builder.cjs +1 -1
- package/dist/server/handlers/workflow-builder.js +1 -1
- package/dist/server/handlers/workflows.cjs +1 -1
- package/dist/server/handlers/workflows.js +1 -1
- package/dist/server/schemas/agent-versions.d.ts +660 -20
- package/dist/server/schemas/agent-versions.d.ts.map +1 -1
- package/dist/server/schemas/index.cjs +5 -4
- package/dist/server/schemas/index.js +5 -5
- package/dist/server/schemas/memory-config.d.ts +130 -0
- package/dist/server/schemas/memory-config.d.ts.map +1 -1
- package/dist/server/schemas/schedules.d.ts +8 -0
- package/dist/server/schemas/schedules.d.ts.map +1 -1
- package/dist/server/schemas/stored-agents.d.ts +1430 -150
- package/dist/server/schemas/stored-agents.d.ts.map +1 -1
- package/dist/server/server-adapter/index.cjs +2 -2
- package/dist/server/server-adapter/index.js +2 -2
- package/dist/server/server-adapter/routes/observability.d.ts +35 -3
- package/dist/server/server-adapter/routes/observability.d.ts.map +1 -1
- package/dist/{stored-agents-DTgigNRY.cjs → stored-agents-Dmsel7ey.cjs} +46 -14
- package/dist/stored-agents-Dmsel7ey.cjs.map +1 -0
- package/dist/{stored-agents-CIdYOdK0.js → stored-agents-ts0bWw8l.js} +41 -15
- package/dist/stored-agents-ts0bWw8l.js.map +1 -0
- package/dist/{stored-scorers-CziNmnC8.cjs → stored-scorers-DoW6lYh8.cjs} +2 -2
- package/dist/{stored-scorers-CziNmnC8.cjs.map → stored-scorers-DoW6lYh8.cjs.map} +1 -1
- package/dist/{stored-scorers-DrkDvsU8.js → stored-scorers-DySg7-qS.js} +2 -2
- package/dist/{stored-scorers-DrkDvsU8.js.map → stored-scorers-DySg7-qS.js.map} +1 -1
- package/dist/{utils-aIu3gkhJ.cjs → utils-HqDZJwRc.cjs} +31 -1
- package/dist/utils-HqDZJwRc.cjs.map +1 -0
- package/dist/{utils-KsERfbhc.js → utils-KcHk7C0D.js} +26 -2
- package/dist/utils-KcHk7C0D.js.map +1 -0
- package/dist/{workflow-builder-DTcM8ER3.cjs → workflow-builder-BSjQJCVD.cjs} +2 -2
- package/dist/{workflow-builder-DTcM8ER3.cjs.map → workflow-builder-BSjQJCVD.cjs.map} +1 -1
- package/dist/{workflow-builder-KRSpDol2.js → workflow-builder-DJ48IzXQ.js} +2 -2
- package/dist/{workflow-builder-KRSpDol2.js.map → workflow-builder-DJ48IzXQ.js.map} +1 -1
- package/package.json +6 -6
- package/dist/agent-versions-BA8ug-Iy.js.map +0 -1
- package/dist/agent-versions-BNqDvnn0.cjs.map +0 -1
- package/dist/dist-C2u5Kqxy.cjs.map +0 -1
- package/dist/dist-DD1mFVAc.js.map +0 -1
- package/dist/helpers-610L0lwQ.js.map +0 -1
- package/dist/helpers-8jl_xtug.cjs.map +0 -1
- package/dist/schedules-Cv3CVT2a.js.map +0 -1
- package/dist/schedules-DTYwAXI_.cjs.map +0 -1
- package/dist/stored-agents-CIdYOdK0.js.map +0 -1
- package/dist/stored-agents-DTgigNRY.cjs.map +0 -1
- package/dist/utils-KsERfbhc.js.map +0 -1
- package/dist/utils-aIu3gkhJ.cjs.map +0 -1
|
@@ -68,13 +68,7 @@ const serializedObservationalMemoryConfigObjectSchema = z.object({
|
|
|
68
68
|
reflection: serializedReflectionConfigSchema.optional().describe("Reflection step configuration")
|
|
69
69
|
});
|
|
70
70
|
const serializedObservationalMemoryConfigSchema = z.union([z.boolean(), serializedObservationalMemoryConfigObjectSchema]);
|
|
71
|
-
|
|
72
|
-
* Serialized memory configuration matching SerializedMemoryConfig from @mastra/core
|
|
73
|
-
*
|
|
74
|
-
* Note: workingMemory and threads are omitted as they are not part of SerializedMemoryConfig
|
|
75
|
-
* @see packages/core/src/memory/types.ts
|
|
76
|
-
*/
|
|
77
|
-
const serializedMemoryConfigSchema = z.object({
|
|
71
|
+
const serializedMemoryConfigFields = {
|
|
78
72
|
vector: z.union([z.string(), z.literal(false)]).optional().describe("Vector database identifier or false to disable"),
|
|
79
73
|
options: z.object({
|
|
80
74
|
readOnly: z.boolean().optional(),
|
|
@@ -86,7 +80,9 @@ const serializedMemoryConfigSchema = z.object({
|
|
|
86
80
|
embedder: z.string().optional().describe("Embedding model ID in the format \"provider/model\" (e.g., \"openai/text-embedding-3-small\")"),
|
|
87
81
|
embedderOptions: z.record(z.string(), z.unknown()).optional().describe("Options to pass to the embedder, omitting telemetry"),
|
|
88
82
|
observationalMemory: serializedObservationalMemoryConfigSchema.optional().describe("Serialized observational memory configuration")
|
|
89
|
-
}
|
|
83
|
+
};
|
|
84
|
+
/** If semanticRecall is enabled (true or object), both vector and embedder are required */
|
|
85
|
+
function hasSemanticRecallDependencies(data) {
|
|
90
86
|
const semanticRecall = data.options?.semanticRecall;
|
|
91
87
|
if (semanticRecall === true || typeof semanticRecall === "object" && semanticRecall !== null) {
|
|
92
88
|
const hasVector = typeof data.vector === "string" && data.vector.length > 0;
|
|
@@ -94,10 +90,40 @@ const serializedMemoryConfigSchema = z.object({
|
|
|
94
90
|
return hasVector && hasEmbedder;
|
|
95
91
|
}
|
|
96
92
|
return true;
|
|
97
|
-
}
|
|
93
|
+
}
|
|
94
|
+
const semanticRecallRefinement = {
|
|
98
95
|
message: "Semantic recall requires both vector and embedder to be configured",
|
|
99
96
|
path: ["options", "semanticRecall"]
|
|
100
|
-
}
|
|
97
|
+
};
|
|
98
|
+
/**
|
|
99
|
+
* Serialized memory configuration matching SerializedMemoryConfig from @mastra/core
|
|
100
|
+
*
|
|
101
|
+
* Note: workingMemory and threads are omitted as they are not part of SerializedMemoryConfig
|
|
102
|
+
* @see packages/core/src/memory/types.ts
|
|
103
|
+
*/
|
|
104
|
+
const serializedMemoryConfigSchema = z.object(serializedMemoryConfigFields).refine(hasSemanticRecallDependencies, semanticRecallRefinement);
|
|
105
|
+
/**
|
|
106
|
+
* Stored-agent memory: a reference to a Memory instance registered on Mastra,
|
|
107
|
+
* an explicitly tagged inline config, or a legacy untagged inline config.
|
|
108
|
+
*
|
|
109
|
+
* The legacy branch rejects any `type` key so a malformed reference
|
|
110
|
+
* (e.g. `{ type: 'id' }` without `memoryId`) is not stripped to `{}` and
|
|
111
|
+
* silently accepted as an empty inline config.
|
|
112
|
+
*/
|
|
113
|
+
const storedMemoryRefSchema = z.union([
|
|
114
|
+
z.object({
|
|
115
|
+
type: z.literal("id"),
|
|
116
|
+
memoryId: z.string().min(1).describe("Registry key (or id) of a Memory instance registered on Mastra")
|
|
117
|
+
}),
|
|
118
|
+
z.object({
|
|
119
|
+
type: z.literal("inline"),
|
|
120
|
+
config: serializedMemoryConfigSchema
|
|
121
|
+
}),
|
|
122
|
+
z.object({
|
|
123
|
+
...serializedMemoryConfigFields,
|
|
124
|
+
type: z.never().optional()
|
|
125
|
+
}).refine(hasSemanticRecallDependencies, semanticRecallRefinement)
|
|
126
|
+
]);
|
|
101
127
|
//#endregion
|
|
102
128
|
//#region src/server/schemas/stored-agents.ts
|
|
103
129
|
/**
|
|
@@ -337,7 +363,7 @@ const snapshotConfigSchema = z.object({
|
|
|
337
363
|
mcpClients: conditionalFieldSchema(z.record(z.string(), mcpClientToolsConfigSchema)).optional().describe("Map of stored MCP client IDs to their tool configurations — static or conditional"),
|
|
338
364
|
inputProcessors: conditionalFieldSchema(storedProcessorGraphSchema).optional().describe("Input processor graph — static or conditional"),
|
|
339
365
|
outputProcessors: conditionalFieldSchema(storedProcessorGraphSchema).optional().describe("Output processor graph — static or conditional"),
|
|
340
|
-
memory: conditionalFieldSchema(
|
|
366
|
+
memory: conditionalFieldSchema(storedMemoryRefSchema).optional().describe("Memory: registered memory reference or inline config — static or conditional"),
|
|
341
367
|
scorers: conditionalFieldSchema(z.record(z.string(), scorerConfigSchema)).optional().describe("Scorer keys with optional sampling config — static or conditional"),
|
|
342
368
|
skills: conditionalFieldSchema(skillsConfigSchema).optional().describe("Skill IDs mapped to per-skill config — static or conditional"),
|
|
343
369
|
workspace: conditionalFieldSchema(workspaceRefSchema).optional().describe("Workspace reference (stored ID or inline config) — static or conditional"),
|
|
@@ -377,7 +403,7 @@ const createStoredAgentBodySchema = z.object({
|
|
|
377
403
|
/**
|
|
378
404
|
* Snapshot config schema for updates where nullable fields (like memory) can be set to null to clear them.
|
|
379
405
|
*/
|
|
380
|
-
const snapshotConfigUpdateSchema = snapshotConfigSchema.extend({ memory: z.union([conditionalFieldSchema(
|
|
406
|
+
const snapshotConfigUpdateSchema = snapshotConfigSchema.extend({ memory: z.union([conditionalFieldSchema(storedMemoryRefSchema), z.null()]).optional().describe("Memory: registered memory reference or inline config — static, conditional, or null to disable memory") });
|
|
381
407
|
/**
|
|
382
408
|
* PATCH /stored/agents/:storedAgentId - Update stored agent body
|
|
383
409
|
* Optional metadata-level fields + optional config fields
|
|
@@ -433,7 +459,7 @@ const storedAgentSchema = z.object({
|
|
|
433
459
|
mcpClients: conditionalFieldSchema(z.record(z.string(), mcpClientToolsConfigSchema)).optional().describe("Map of stored MCP client IDs to their tool configurations — static or conditional"),
|
|
434
460
|
inputProcessors: conditionalFieldSchema(storedProcessorGraphSchema).optional().describe("Input processor graph — static or conditional"),
|
|
435
461
|
outputProcessors: conditionalFieldSchema(storedProcessorGraphSchema).optional().describe("Output processor graph — static or conditional"),
|
|
436
|
-
memory: conditionalFieldSchema(
|
|
462
|
+
memory: conditionalFieldSchema(storedMemoryRefSchema).optional().describe("Memory: registered memory reference or inline config — static or conditional"),
|
|
437
463
|
scorers: conditionalFieldSchema(z.record(z.string(), scorerConfigSchema)).optional().describe("Scorer keys with optional sampling config — static or conditional"),
|
|
438
464
|
skills: conditionalFieldSchema(skillsConfigSchema).optional().describe("Skill IDs mapped to per-skill config — static or conditional"),
|
|
439
465
|
workspace: conditionalFieldSchema(workspaceRefSchema).optional().describe("Workspace reference (stored ID or inline config) — static or conditional"),
|
|
@@ -523,6 +549,6 @@ const previewInstructionsBodySchema = z.object({
|
|
|
523
549
|
*/
|
|
524
550
|
const previewInstructionsResponseSchema = z.object({ result: z.string().describe("The resolved instructions string") });
|
|
525
551
|
//#endregion
|
|
526
|
-
export { semanticRecallSchema as A, storedAgentIdPathParams as C, toolsConfigSchema as D, toolConfigSchema as E, serializedReflectionConfigSchema as F,
|
|
552
|
+
export { semanticRecallSchema as A, storedAgentIdPathParams as C, toolsConfigSchema as D, toolConfigSchema as E, serializedReflectionConfigSchema as F, storedMemoryRefSchema as I, titleGenerationSchema as L, serializedObservationConfigSchema as M, serializedObservationalMemoryConfigObjectSchema as N, updateStoredAgentBodySchema as O, serializedObservationalMemoryConfigSchema as P, snapshotConfigSchema as S, storedProcessorGraphSchema as T, processorGraphEntrySchema as _, exportStoredAgentBodySchema as a, resolvedAuthorSchema as b, getStoredAgentResponseSchema as c, listStoredAgentsResponseSchema as d, modelConfigSchema as f, previewInstructionsResponseSchema as g, previewInstructionsBodySchema as h, deleteStoredAgentResponseSchema as i, serializedMemoryConfigSchema as j, updateStoredAgentResponseSchema as k, instructionsSchema as l, openStoredAgentChangeRequestResponseSchema as m, createStoredAgentBodySchema as n, exportStoredAgentResponseSchema as o, openStoredAgentChangeRequestBodySchema as p, createStoredAgentResponseSchema as r, getStoredAgentDependentsResponseSchema as s, conditionalFieldSchema as t, listStoredAgentsQuerySchema as u, processorGraphStepSchema as v, storedAgentSchema as w, scorerConfigSchema as x, processorPhaseSchema as y };
|
|
527
553
|
|
|
528
|
-
//# sourceMappingURL=stored-agents-
|
|
554
|
+
//# sourceMappingURL=stored-agents-ts0bWw8l.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"stored-agents-ts0bWw8l.js","names":["workspaceSnapshotConfigSchema"],"sources":["../src/server/schemas/memory-config.ts","../src/server/schemas/stored-agents.ts"],"sourcesContent":["import { z } from 'zod/v4';\nimport { lastMessagesSchema, messageHistorySchema } from './message-history';\n\n/**\n * Shared memory configuration schemas for agent storage\n * These schemas match the SerializedMemoryConfig type from @mastra/core\n */\n\n/**\n * Semantic recall configuration for vector-based memory retrieval\n */\nexport const semanticRecallSchema = z.object({\n topK: z.number().describe('Number of semantically similar messages to retrieve'),\n messageRange: z\n .union([\n z.number(),\n z.object({\n before: z.number(),\n after: z.number(),\n }),\n ])\n .describe('Amount of surrounding context to include with each retrieved message'),\n scope: z.enum(['thread', 'resource']).optional().describe('Scope for semantic search queries'),\n threshold: z.number().min(0).max(1).optional().describe('Minimum similarity score threshold'),\n indexName: z.string().optional().describe('Index name for the vector store'),\n});\n\n/**\n * Title generation configuration\n * When stored, the model is serialized as a ModelRouterModelId string (provider/model-name format)\n */\nexport const titleGenerationSchema = z.union([\n z.boolean(),\n z.object({\n model: z\n .string()\n .optional()\n .describe(\"Model ID in format provider/model-name (ModelRouterModelId); defaults to the agent's own model\"),\n instructions: z.string().optional().describe('Custom instructions for title generation'),\n minMessages: z\n .number()\n .int()\n .min(1)\n .optional()\n .describe('Minimum number of thread messages required before a title is generated'),\n emitEvent: z\n .boolean()\n .optional()\n .describe('Emit the generated title as a data-thread-title chunk on the run stream'),\n }),\n]);\n\n/**\n * Observation step configuration for observational memory\n */\nexport const serializedObservationConfigSchema = z.object({\n model: z.string().optional().describe('Observer model ID'),\n messageTokens: z.number().optional().describe('Token threshold that triggers observation'),\n modelSettings: z.record(z.string(), z.unknown()).optional().describe('Model settings (temperature, etc.)'),\n providerOptions: z\n .record(z.string(), z.record(z.string(), z.unknown()).optional())\n .optional()\n .describe('Provider-specific options'),\n maxTokensPerBatch: z.number().optional().describe('Maximum tokens per batch'),\n bufferTokens: z\n .union([z.number(), z.literal(false)])\n .optional()\n .describe('Async buffering interval or false'),\n bufferActivation: z.number().optional().describe('Ratio of buffered observations to activate'),\n blockAfter: z.number().optional().describe('Token threshold for synchronous blocking'),\n});\n\n/**\n * Reflection step configuration for observational memory\n */\nexport const serializedReflectionConfigSchema = z.object({\n model: z.string().optional().describe('Reflector model ID'),\n observationTokens: z.number().optional().describe('Token threshold that triggers reflection'),\n modelSettings: z.record(z.string(), z.unknown()).optional().describe('Model settings (temperature, etc.)'),\n providerOptions: z\n .record(z.string(), z.record(z.string(), z.unknown()).optional())\n .optional()\n .describe('Provider-specific options'),\n blockAfter: z.number().optional().describe('Token threshold for synchronous blocking'),\n bufferActivation: z.number().optional().describe('Ratio for async reflection buffering'),\n});\n\n/**\n * Serialized observational memory configuration\n */\nexport const serializedObservationalMemoryConfigObjectSchema = z.object({\n model: z.string().optional().describe('Model ID for both Observer and Reflector'),\n scope: z.enum(['resource', 'thread']).optional().describe('Memory scope'),\n shareTokenBudget: z.boolean().optional().describe('Share token budget between messages and observations'),\n observation: serializedObservationConfigSchema.optional().describe('Observation step configuration'),\n reflection: serializedReflectionConfigSchema.optional().describe('Reflection step configuration'),\n});\n\nexport const serializedObservationalMemoryConfigSchema = z.union([\n z.boolean(),\n serializedObservationalMemoryConfigObjectSchema,\n]);\n\nconst serializedMemoryConfigFields = {\n vector: z\n .union([z.string(), z.literal(false)])\n .optional()\n .describe('Vector database identifier or false to disable'),\n options: z\n .object({\n readOnly: z.boolean().optional(),\n lastMessages: lastMessagesSchema.optional(),\n messageHistory: messageHistorySchema.optional(),\n semanticRecall: z.union([z.boolean(), semanticRecallSchema]).optional(),\n generateTitle: titleGenerationSchema.optional(),\n })\n .optional()\n .describe('Memory behavior configuration, excluding workingMemory and threads'),\n embedder: z\n .string()\n .optional()\n .describe('Embedding model ID in the format \"provider/model\" (e.g., \"openai/text-embedding-3-small\")'),\n embedderOptions: z\n .record(z.string(), z.unknown())\n .optional()\n .describe('Options to pass to the embedder, omitting telemetry'),\n observationalMemory: serializedObservationalMemoryConfigSchema\n .optional()\n .describe('Serialized observational memory configuration'),\n};\n\ntype SerializedMemoryConfigData = z.infer<z.ZodObject<typeof serializedMemoryConfigFields>>;\n\n/** If semanticRecall is enabled (true or object), both vector and embedder are required */\nfunction hasSemanticRecallDependencies(data: SerializedMemoryConfigData): boolean {\n const semanticRecall = data.options?.semanticRecall;\n const semanticRecallEnabled =\n semanticRecall === true || (typeof semanticRecall === 'object' && semanticRecall !== null);\n\n if (semanticRecallEnabled) {\n const hasVector = typeof data.vector === 'string' && data.vector.length > 0;\n const hasEmbedder = typeof data.embedder === 'string' && data.embedder.length > 0;\n return hasVector && hasEmbedder;\n }\n return true;\n}\n\nconst semanticRecallRefinement = {\n message: 'Semantic recall requires both vector and embedder to be configured',\n path: ['options', 'semanticRecall'],\n};\n\n/**\n * Serialized memory configuration matching SerializedMemoryConfig from @mastra/core\n *\n * Note: workingMemory and threads are omitted as they are not part of SerializedMemoryConfig\n * @see packages/core/src/memory/types.ts\n */\nexport const serializedMemoryConfigSchema = z\n .object(serializedMemoryConfigFields)\n .refine(hasSemanticRecallDependencies, semanticRecallRefinement);\n\n/**\n * Stored-agent memory: a reference to a Memory instance registered on Mastra,\n * an explicitly tagged inline config, or a legacy untagged inline config.\n *\n * The legacy branch rejects any `type` key so a malformed reference\n * (e.g. `{ type: 'id' }` without `memoryId`) is not stripped to `{}` and\n * silently accepted as an empty inline config.\n */\nexport const storedMemoryRefSchema = z.union([\n z.object({\n type: z.literal('id'),\n memoryId: z.string().min(1).describe('Registry key (or id) of a Memory instance registered on Mastra'),\n }),\n z.object({\n type: z.literal('inline'),\n config: serializedMemoryConfigSchema,\n }),\n z\n .object({ ...serializedMemoryConfigFields, type: z.never().optional() })\n .refine(hasSemanticRecallDependencies, semanticRecallRefinement),\n]);\n","import { z } from 'zod/v4';\nimport { paginationInfoSchema, createPagePaginationSchema, statusQuerySchema } from './common';\nimport { defaultOptionsSchema } from './default-options';\nimport { storedMemoryRefSchema } from './memory-config';\nimport { ruleGroupSchema } from './rule-group';\nimport { workspaceSnapshotConfigSchema } from './stored-workspaces';\nimport { toolProvidersSchema } from './tool-providers';\n\n// ============================================================================\n// Path Parameter Schemas\n// ============================================================================\n\n/**\n * Path parameter for stored agent ID\n */\nexport const storedAgentIdPathParams = z.object({\n storedAgentId: z.string().describe('Unique identifier for the stored agent'),\n});\n\n// ============================================================================\n// Query Parameter Schemas\n// ============================================================================\n\n/**\n * Storage order by configuration\n */\nconst storageOrderBySchema = z.object({\n field: z.enum(['createdAt', 'updatedAt']).optional(),\n direction: z.enum(['ASC', 'DESC']).optional(),\n});\n\nexport { statusQuerySchema };\n\n/**\n * GET /stored/agents - List stored agents\n */\nexport const listStoredAgentsQuerySchema = createPagePaginationSchema(100).extend({\n orderBy: storageOrderBySchema.optional(),\n status: z\n .enum(['draft', 'published', 'archived'])\n .optional()\n .default('published')\n .describe('Filter agents by status (defaults to published)'),\n authorId: z.string().optional().describe('Filter agents by author identifier'),\n visibility: z.enum(['public']).optional().describe('Filter to only public agents'),\n metadata: z.record(z.string(), z.unknown()).optional().describe('Filter agents by metadata key-value pairs'),\n favoritedOnly: z\n .stringbool()\n .optional()\n .describe('When true, return only agents favorited by the caller (requires the `favorites` EE feature)'),\n pinFavoritedFor: z\n .string()\n .optional()\n .describe(\n 'When set, treat the given subject (user/role) as the favoriting principal for `favoritedOnly` instead of the caller',\n ),\n});\n\n// ============================================================================\n// Body Parameter Schemas\n// ============================================================================\n\n/**\n * Scorer config schema with optional sampling and rules\n */\nconst scorerConfigSchema = z.object({\n description: z.string().optional(),\n sampling: z\n .union([\n z.object({ type: z.literal('none') }),\n z.object({ type: z.literal('ratio'), rate: z.number().min(0).max(1) }),\n ])\n .optional(),\n rules: ruleGroupSchema.optional(),\n});\n\n/**\n * Agent instruction block schema for prompt-block-based instructions.\n */\nconst agentInstructionBlockSchema = z.discriminatedUnion('type', [\n z.object({ type: z.literal('text'), content: z.string() }),\n z.object({ type: z.literal('prompt_block_ref'), id: z.string() }),\n z.object({ type: z.literal('prompt_block'), content: z.string(), rules: ruleGroupSchema.optional() }),\n]);\n\n/**\n * Creates a schema for a field that can be either a static value or an array of conditional variants.\n * Each variant has a `value` and an optional `rules` (RuleGroup) that determines when it applies.\n */\nfunction conditionalFieldSchema<T extends z.ZodTypeAny>(valueSchema: T) {\n const variantSchema = z.object({\n value: valueSchema,\n rules: ruleGroupSchema.optional(),\n });\n return z.union([valueSchema, z.array(variantSchema)]);\n}\n\n/**\n * Instructions can be a plain string or an array of instruction blocks (text + prompt_block references).\n */\nexport const instructionsSchema = z\n .union([z.string(), z.array(agentInstructionBlockSchema)])\n .describe('System instructions for the agent (string or array of instruction blocks)');\n\n/** Base model config schema (reused across snapshot and response schemas) */\nconst modelConfigSchema = z\n .object({\n provider: z.string().describe('Model provider (e.g., openai, anthropic)'),\n name: z.string().describe('Model name (e.g., gpt-4o, claude-3-opus)'),\n })\n .passthrough();\n\n/** Per-tool config schema */\nconst toolConfigSchema = z.object({ description: z.string().optional(), rules: ruleGroupSchema.optional() });\n\n/** Base tools config schema */\nconst toolsConfigSchema = z.record(z.string(), toolConfigSchema);\n\n/** MCP client tools config schema — specifies which tools to use from an MCP client/server */\nconst mcpClientToolsConfigSchema = z.object({\n tools: z.record(z.string(), toolConfigSchema).optional(),\n});\n\n/** Per-skill config schema */\nconst skillConfigSchema = z.object({\n description: z.string().optional(),\n instructions: z.string().optional(),\n pin: z.string().optional(),\n strategy: z.enum(['latest', 'live']).optional(),\n});\n\n/** Skills config: skill IDs mapped to per-skill config */\nconst skillsConfigSchema = z.record(z.string(), skillConfigSchema);\n\n/** Workspace reference: a stored workspace ID, inline config, or a registered workspace provider */\nconst workspaceRefSchema = z.discriminatedUnion('type', [\n z.object({ type: z.literal('id'), workspaceId: z.string() }),\n z.object({ type: z.literal('inline'), config: workspaceSnapshotConfigSchema }),\n z.object({\n type: z.literal('provider'),\n provider: z.string().describe('Workspace provider identifier'),\n config: z.record(z.string(), z.unknown()).describe('Provider-specific configuration'),\n }),\n]);\n\n/** Screencast options for streaming browser frames */\nconst screencastOptionsSchema = z.object({\n format: z.enum(['jpeg', 'png']).optional().describe('Image format (default: jpeg)'),\n quality: z.number().min(0).max(100).optional().describe('JPEG quality 0-100 (default: 80)'),\n maxWidth: z.number().optional().describe('Max width in pixels (default: 1280)'),\n maxHeight: z.number().optional().describe('Max height in pixels (default: 720)'),\n everyNthFrame: z.number().optional().describe('Capture every Nth frame (default: 1)'),\n});\n\n/** Browser config: serializable browser configuration for stored agents */\nconst browserConfigSchema = z.object({\n provider: z.string().describe('Browser provider type (e.g., stagehand, playwright)'),\n headless: z.boolean().optional().describe('Run browser in headless mode (default: true)'),\n viewport: z\n .object({\n width: z.number().describe('Viewport width in pixels'),\n height: z.number().describe('Viewport height in pixels'),\n })\n .optional()\n .describe('Browser viewport dimensions'),\n timeout: z.number().optional().describe('Default timeout in milliseconds (default: 10000)'),\n screencast: screencastOptionsSchema.optional().describe('Screencast options for streaming browser frames'),\n});\n\n/** Browser reference: inline browser configuration */\nconst browserRefSchema = z.object({\n type: z.literal('inline'),\n config: browserConfigSchema,\n});\n\n/**\n * Processor phase enum matching ProcessorPhase type\n */\nconst processorPhaseSchema = z.enum([\n 'processInput',\n 'processInputStep',\n 'processOutputStream',\n 'processOutputResult',\n 'processOutputStep',\n 'processToolResult',\n]);\n\n/**\n * A single processor step in a stored processor graph.\n */\nconst processorGraphStepSchema = z.object({\n id: z.string().describe('Unique ID for this step within the graph'),\n providerId: z.string().describe('ProcessorProvider ID that creates this processor'),\n config: z.record(z.string(), z.unknown()).describe('Configuration matching the provider configSchema'),\n enabledPhases: z.array(processorPhaseSchema).min(1).describe('Which processor phases to enable'),\n});\n\n/**\n * Processor graph entry schema.\n * Simplified version of SerializedStepFlowEntry, supporting step, parallel, and conditional.\n *\n * Uses a fixed nesting depth (3 levels) to avoid infinite recursion\n * when converting to JSON Schema / OpenAPI.\n */\n\n/** Depth 3 (leaf): only step entries allowed */\nconst processorGraphEntryDepth3 = z.discriminatedUnion('type', [\n z.object({ type: z.literal('step'), step: processorGraphStepSchema }),\n]);\n\n/** Depth 2: step, parallel, and conditional — children limited to depth 3 */\nconst processorGraphEntryDepth2 = z.discriminatedUnion('type', [\n z.object({ type: z.literal('step'), step: processorGraphStepSchema }),\n z.object({ type: z.literal('parallel'), branches: z.array(z.array(processorGraphEntryDepth3)) }),\n z.object({\n type: z.literal('conditional'),\n conditions: z.array(\n z.object({\n steps: z.array(processorGraphEntryDepth3),\n rules: ruleGroupSchema.optional(),\n }),\n ),\n }),\n]);\n\n/** Depth 1 (top-level): step, parallel, and conditional — children limited to depth 2 */\nconst processorGraphEntrySchema = z.discriminatedUnion('type', [\n z.object({ type: z.literal('step'), step: processorGraphStepSchema }),\n z.object({ type: z.literal('parallel'), branches: z.array(z.array(processorGraphEntryDepth2)) }),\n z.object({\n type: z.literal('conditional'),\n conditions: z.array(\n z.object({\n steps: z.array(processorGraphEntryDepth2),\n rules: ruleGroupSchema.optional(),\n }),\n ),\n }),\n]);\n\n/**\n * A stored processor graph representing a pipeline of processors.\n */\nconst storedProcessorGraphSchema = z.object({\n steps: z.array(processorGraphEntrySchema).describe('Ordered list of processor graph entries'),\n});\n\n/**\n * Agent snapshot config fields (name, description, instructions, model, tools, etc.)\n * These live in version snapshots, not on the thin agent record.\n *\n * Fields that support conditional variants (StorageConditionalField) can be either\n * a static value OR an array of { value, rules? } variants evaluated at request time.\n */\n/**\n * Serializable durable-execution opt-in. Mirrors `StorageDurableConfig`:\n * `cache`/`pubsub` are live runtime objects and cannot be persisted, so they are\n * not accepted here. Intentionally not a conditional field — durability is\n * decided when the agent is registered, not per request.\n */\nconst durableConfigSchema = z.union([\n z.boolean(),\n z.object({\n maxSteps: z.number().int().positive().optional(),\n cleanupTimeoutMs: z.number().int().nonnegative().optional(),\n }),\n]);\n\nconst snapshotConfigSchema = z.object({\n name: z.string().describe('Name of the agent'),\n description: z.string().optional().describe('Description of the agent'),\n instructions: instructionsSchema,\n model: conditionalFieldSchema(modelConfigSchema).describe(\n 'Model configuration — static value or array of conditional variants',\n ),\n tools: conditionalFieldSchema(toolsConfigSchema)\n .optional()\n .describe('Tool keys mapped to per-tool config — static or conditional'),\n defaultOptions: conditionalFieldSchema(defaultOptionsSchema)\n .optional()\n .describe('Default options for generate/stream calls — static or conditional'),\n workflows: conditionalFieldSchema(z.record(z.string(), toolConfigSchema))\n .optional()\n .describe('Workflow keys with optional per-workflow config — static or conditional'),\n agents: conditionalFieldSchema(z.record(z.string(), toolConfigSchema))\n .optional()\n .describe('Agent keys with optional per-agent config — static or conditional'),\n integrationTools: conditionalFieldSchema(z.record(z.string(), mcpClientToolsConfigSchema))\n .optional()\n .describe('Map of tool provider IDs to their tool configurations — static or conditional'),\n toolProviders: conditionalFieldSchema(toolProvidersSchema)\n .optional()\n .describe(\n 'Tool provider connections and per-tool config (provider-agnostic). Coexists with the deprecated `integrationTools` field.',\n ),\n mcpClients: conditionalFieldSchema(z.record(z.string(), mcpClientToolsConfigSchema))\n .optional()\n .describe('Map of stored MCP client IDs to their tool configurations — static or conditional'),\n inputProcessors: conditionalFieldSchema(storedProcessorGraphSchema)\n .optional()\n .describe('Input processor graph — static or conditional'),\n outputProcessors: conditionalFieldSchema(storedProcessorGraphSchema)\n .optional()\n .describe('Output processor graph — static or conditional'),\n memory: conditionalFieldSchema(storedMemoryRefSchema)\n .optional()\n .describe('Memory: registered memory reference or inline config — static or conditional'),\n scorers: conditionalFieldSchema(z.record(z.string(), scorerConfigSchema))\n .optional()\n .describe('Scorer keys with optional sampling config — static or conditional'),\n skills: conditionalFieldSchema(skillsConfigSchema)\n .optional()\n .describe('Skill IDs mapped to per-skill config — static or conditional'),\n workspace: conditionalFieldSchema(workspaceRefSchema)\n .optional()\n .describe('Workspace reference (stored ID or inline config) — static or conditional'),\n browser: z\n .union([conditionalFieldSchema(browserRefSchema), z.boolean(), z.null()])\n .optional()\n .describe('Browser configuration — object config, true (apply default), false/null (disable)'),\n requestContextSchema: z\n .record(z.string(), z.unknown())\n .optional()\n .describe('JSON Schema defining valid request context variables for conditional rule evaluation'),\n durable: durableConfigSchema\n .optional()\n .describe(\n 'Opt this agent into durable execution when it is hydrated. Cache and pubsub are inherited from the Mastra instance; without distributed backends durability is process-local. Does not enable automatic recovery — that stays `recovery.durableAgents`.',\n ),\n});\n\n/**\n * Agent metadata fields (authorId, metadata, visibility) that live on the thin agent record.\n */\nconst agentMetadataSchema = z.object({\n authorId: z.string().optional().describe('Author identifier for multi-tenant filtering'),\n metadata: z.record(z.string(), z.unknown()).optional().describe('Additional metadata for the agent'),\n visibility: z\n .enum(['private', 'public'])\n .optional()\n .describe('Agent visibility: private (owner/admin only) or public (any reader)'),\n});\n\n/**\n * Snapshot config schema for create where `model` is optional. When omitted, the\n * builder applies `defaults.model` from `/editor/builder/settings` server-side.\n */\nconst snapshotConfigCreateSchema = snapshotConfigSchema.extend({\n model: conditionalFieldSchema(modelConfigSchema)\n .optional()\n .describe(\n 'Model configuration — static value or array of conditional variants. ' +\n 'When omitted, the builder default model is applied server-side.',\n ),\n});\n\n/**\n * POST /stored/agents - Create stored agent body\n * Flat union of agent-record fields + config fields\n * The id is optional — if not provided, it will be derived from the agent name via slugify.\n */\nexport const createStoredAgentBodySchema = z\n .object({\n id: z.string().optional().describe('Unique identifier for the agent. If not provided, derived from name.'),\n authorId: z.string().optional().describe('Author identifier for multi-tenant filtering'),\n metadata: z.record(z.string(), z.unknown()).optional().describe('Additional metadata for the agent'),\n visibility: z\n .enum(['private', 'public'])\n .optional()\n .describe('Agent visibility: private (owner/admin only) or public (any reader)'),\n autoPublish: z\n .boolean()\n .optional()\n .describe(\n 'Publish the initial version so the agent resolves at status=\"published\". Defaults to true when omitted. ' +\n 'Pass false to stage the agent as an unpublished draft — useful when overriding a code-defined agent, ' +\n 'whose code definition keeps serving traffic until the override is published.',\n ),\n })\n .merge(snapshotConfigCreateSchema);\n\n/**\n * Snapshot config schema for updates where nullable fields (like memory) can be set to null to clear them.\n */\nconst snapshotConfigUpdateSchema = snapshotConfigSchema.extend({\n memory: z\n .union([conditionalFieldSchema(storedMemoryRefSchema), z.null()])\n .optional()\n .describe('Memory: registered memory reference or inline config — static, conditional, or null to disable memory'),\n});\n\n/**\n * PATCH /stored/agents/:storedAgentId - Update stored agent body\n * Optional metadata-level fields + optional config fields\n */\nexport const updateStoredAgentBodySchema = agentMetadataSchema\n .partial()\n .merge(snapshotConfigUpdateSchema.partial())\n .extend({\n changeMessage: z\n .string()\n .trim()\n .max(500)\n .optional()\n .describe('Optional message describing the changes for the auto-created version'),\n autoPublish: z\n .boolean()\n .optional()\n .describe('Immediately activate the auto-created version. Defaults to false when omitted.'),\n });\n\nexport const exportStoredAgentBodySchema = snapshotConfigUpdateSchema.partial();\n\nexport const openStoredAgentChangeRequestBodySchema = exportStoredAgentBodySchema.extend({\n changeMessage: z.string().trim().max(500).optional(),\n userName: z.string().trim().min(1).max(120).optional(),\n inspectOnly: z.boolean().optional(),\n});\n\n// ============================================================================\n// Response Schemas\n// ============================================================================\n\n/**\n * Resolved author object — server-side enrichment of `authorId` against the\n * configured auth provider. Only `id` is required; the other fields mirror\n * what `/auth/me` exposes and are optional because providers may not return\n * every field.\n */\nexport const resolvedAuthorSchema = z.object({\n id: z.string(),\n name: z.string().optional(),\n email: z.string().optional(),\n avatarUrl: z.string().optional(),\n});\n\n/**\n * Stored agent object schema (resolved response: thin record + version config)\n * Represents StorageResolvedAgentType\n */\nexport const storedAgentSchema = z.object({\n // Thin agent record fields\n id: z.string(),\n status: z.string().describe('Agent status: draft or published'),\n activeVersionId: z.string().optional(),\n authorId: z.string().optional(),\n author: resolvedAuthorSchema.optional().describe('Resolved author identity (when an auth provider is configured)'),\n metadata: z.record(z.string(), z.unknown()).optional(),\n visibility: z.enum(['private', 'public']).optional(),\n favoriteCount: z.number().int().nonnegative().optional().describe('Number of users who have favorited this agent'),\n isFavorited: z.boolean().optional().describe('Whether the requesting user has favorited this agent'),\n createdAt: z.coerce.date(),\n updatedAt: z.coerce.date(),\n // Version snapshot config fields (resolved from active version)\n name: z.string().describe('Name of the agent'),\n description: z.string().optional().describe('Description of the agent'),\n instructions: instructionsSchema,\n model: conditionalFieldSchema(modelConfigSchema).describe(\n 'Model configuration — static value or array of conditional variants',\n ),\n tools: conditionalFieldSchema(toolsConfigSchema)\n .optional()\n .describe('Tool keys mapped to per-tool config — static or conditional'),\n defaultOptions: conditionalFieldSchema(defaultOptionsSchema)\n .optional()\n .describe('Default options for generate/stream calls — static or conditional'),\n workflows: conditionalFieldSchema(z.record(z.string(), toolConfigSchema))\n .optional()\n .describe('Workflow keys with optional per-workflow config — static or conditional'),\n agents: conditionalFieldSchema(z.record(z.string(), toolConfigSchema))\n .optional()\n .describe('Agent keys with optional per-agent config — static or conditional'),\n integrationTools: conditionalFieldSchema(z.record(z.string(), mcpClientToolsConfigSchema))\n .optional()\n .describe('Map of tool provider IDs to their tool configurations — static or conditional'),\n toolProviders: conditionalFieldSchema(toolProvidersSchema)\n .optional()\n .describe(\n 'Tool provider connections and per-tool config (provider-agnostic). Coexists with the deprecated `integrationTools` field.',\n ),\n mcpClients: conditionalFieldSchema(z.record(z.string(), mcpClientToolsConfigSchema))\n .optional()\n .describe('Map of stored MCP client IDs to their tool configurations — static or conditional'),\n inputProcessors: conditionalFieldSchema(storedProcessorGraphSchema)\n .optional()\n .describe('Input processor graph — static or conditional'),\n outputProcessors: conditionalFieldSchema(storedProcessorGraphSchema)\n .optional()\n .describe('Output processor graph — static or conditional'),\n memory: conditionalFieldSchema(storedMemoryRefSchema)\n .optional()\n .describe('Memory: registered memory reference or inline config — static or conditional'),\n scorers: conditionalFieldSchema(z.record(z.string(), scorerConfigSchema))\n .optional()\n .describe('Scorer keys with optional sampling config — static or conditional'),\n skills: conditionalFieldSchema(skillsConfigSchema)\n .optional()\n .describe('Skill IDs mapped to per-skill config — static or conditional'),\n workspace: conditionalFieldSchema(workspaceRefSchema)\n .optional()\n .describe('Workspace reference (stored ID or inline config) — static or conditional'),\n browser: z\n .union([conditionalFieldSchema(browserRefSchema), z.boolean(), z.null()])\n .optional()\n .describe('Browser configuration — object config, true (apply default), false/null (disable)'),\n requestContextSchema: z\n .record(z.string(), z.unknown())\n .optional()\n .describe('JSON Schema defining valid request context variables'),\n durable: durableConfigSchema.optional().describe('Whether this agent is hydrated with durable execution enabled'),\n});\n\n/**\n * Response for GET /stored/agents\n */\nexport const listStoredAgentsResponseSchema = paginationInfoSchema.extend({\n agents: z.array(storedAgentSchema),\n});\n\n/**\n * Response for GET /stored/agents/:storedAgentId\n */\nexport const getStoredAgentResponseSchema = storedAgentSchema;\n\n/**\n * Response for POST /stored/agents\n */\nexport const createStoredAgentResponseSchema = storedAgentSchema;\n\n/**\n * Response for PATCH /stored/agents/:storedAgentId\n *\n * The response can be either:\n * 1. A thin agent record (no version) - only has id, status, dates, etc.\n * 2. A resolved agent (with version) - has all config fields from the version\n *\n * We use a union to handle both cases properly.\n */\nexport const updateStoredAgentResponseSchema = z.union([\n // Thin agent record (no version config)\n z.object({\n id: z.string(),\n status: z.string(),\n activeVersionId: z.string().optional(),\n authorId: z.string().optional(),\n metadata: z.record(z.string(), z.unknown()).optional(),\n visibility: z.enum(['private', 'public']).optional(),\n createdAt: z.coerce.date(),\n updatedAt: z.coerce.date(),\n }),\n // Resolved agent (thin record + version config)\n storedAgentSchema,\n]);\n\n/**\n * Response for DELETE /stored/agents/:storedAgentId\n */\nexport const deleteStoredAgentResponseSchema = z.object({\n success: z.boolean(),\n message: z.string(),\n});\n\n/**\n * Response for GET /stored/agents/:storedAgentId/dependents\n *\n * `dependents` lists caller-readable stored agents whose resolved `agents` map\n * references the target. Includes both public and the caller's own private\n * agents — anything the caller already has read access to.\n * `hiddenCount` aggregates references from agents the caller cannot read\n * (cross-workspace private agents). Only populated when the target agent is\n * public, to avoid leaking cross-workspace structure for private targets.\n */\nexport const getStoredAgentDependentsResponseSchema = z.object({\n dependents: z.array(\n z.object({\n id: z.string(),\n name: z.string(),\n }),\n ),\n hiddenCount: z.number().int().nonnegative(),\n});\n\nexport const exportStoredAgentResponseSchema = z.object({\n agentId: z.string(),\n fileName: z.string(),\n content: z.string(),\n config: z.record(z.string(), z.unknown()),\n});\n\nexport const openStoredAgentChangeRequestResponseSchema = z.object({\n id: z.union([z.string(), z.number()]).optional(),\n url: z.string(),\n ref: z.string().optional(),\n});\n\n// ============================================================================\n// Preview Instructions Schemas\n// ============================================================================\n\n/**\n * POST /stored/agents/preview-instructions - Preview resolved instructions\n */\nexport const previewInstructionsBodySchema = z.object({\n blocks: z.array(agentInstructionBlockSchema).describe('Array of instruction blocks to resolve'),\n context: z\n .record(z.string(), z.unknown())\n .optional()\n .default({})\n .describe('Request context for variable interpolation and rule evaluation'),\n});\n\n/**\n * Response for POST /stored/agents/preview-instructions\n */\nexport const previewInstructionsResponseSchema = z.object({\n result: z.string().describe('The resolved instructions string'),\n});\n\n/**\n * Exported for use in agent-versions.ts schemas\n */\nexport {\n snapshotConfigSchema,\n scorerConfigSchema,\n conditionalFieldSchema,\n modelConfigSchema,\n storedProcessorGraphSchema,\n processorGraphStepSchema,\n processorGraphE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,OAAO,CAAC,CAAC,SAAS;AAC3B,CAAC;;;;AASD,MAAa,gCAAgC,EAAE,OAAO;CACpD,QAAQ,EAAE,MAAM,2BAA2B,CAAC,CAAC,SAAS,wCAAwC;CAC9F,SAAS,EACN,OAAO,EAAE,OAAO,GAAG,EAAE,QAAQ,CAAC,CAAC,CAC/B,SAAS,CAAC,CACV,QAAQ,CAAC,CAAC,CAAC,CACX,SAAS,gEAAgE;AAC9E,CAAC;;;;AAKD,MAAa,oCAAoC,EAAE,OAAO,EACxD,QAAQ,EAAE,OAAO,CAAC,CAAC,SAAS,kCAAkC,EAChE,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
const require_common = require("./common-BkgcoK-2.cjs");
|
|
2
|
-
const require_stored_agents = require("./stored-agents-
|
|
2
|
+
const require_stored_agents = require("./stored-agents-Dmsel7ey.cjs");
|
|
3
3
|
let zod_v4 = require("zod/v4");
|
|
4
4
|
//#region src/server/schemas/stored-scorers.ts
|
|
5
5
|
const storedScorerIdPathParams = zod_v4.z.object({ storedScorerId: zod_v4.z.string().describe("Unique identifier for the stored scorer definition") });
|
|
@@ -155,4 +155,4 @@ Object.defineProperty(exports, "updateStoredScorerResponseSchema", {
|
|
|
155
155
|
}
|
|
156
156
|
});
|
|
157
157
|
|
|
158
|
-
//# sourceMappingURL=stored-scorers-
|
|
158
|
+
//# sourceMappingURL=stored-scorers-DoW6lYh8.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"stored-scorers-
|
|
1
|
+
{"version":3,"file":"stored-scorers-DoW6lYh8.cjs","names":["z","createPagePaginationSchema","modelConfigSchema","paginationInfoSchema"],"sources":["../src/server/schemas/stored-scorers.ts"],"sourcesContent":["import { z } from 'zod/v4';\n\nimport { paginationInfoSchema, createPagePaginationSchema, statusQuerySchema } from './common';\nimport { modelConfigSchema } from './stored-agents';\n\n// ============================================================================\n// Path Parameter Schemas\n// ============================================================================\n\nexport const storedScorerIdPathParams = z.object({\n storedScorerId: z.string().describe('Unique identifier for the stored scorer definition'),\n});\n\n// ============================================================================\n// Query Parameter Schemas\n// ============================================================================\n\nconst storageOrderBySchema = z.object({\n field: z.enum(['createdAt', 'updatedAt']).optional(),\n direction: z.enum(['ASC', 'DESC']).optional(),\n});\n\nexport { statusQuerySchema };\n\nexport const listStoredScorersQuerySchema = createPagePaginationSchema(100).extend({\n orderBy: storageOrderBySchema.optional(),\n status: z\n .enum(['draft', 'published', 'archived'])\n .optional()\n .default('published')\n .describe('Filter scorers by status (defaults to published)'),\n authorId: z.string().optional().describe('Filter scorers by author identifier'),\n metadata: z.record(z.string(), z.unknown()).optional().describe('Filter scorers by metadata key-value pairs'),\n});\n\n// ============================================================================\n// Body Parameter Schemas\n// ============================================================================\n\nconst samplingConfigSchema = z.union([\n z.object({ type: z.literal('none') }),\n z.object({ type: z.literal('ratio'), rate: z.number().min(0).max(1) }),\n]);\n\nconst scorerTypeEnum = z\n .enum([\n 'llm-judge',\n 'answer-relevancy',\n 'answer-similarity',\n 'bias',\n 'context-precision',\n 'context-relevance',\n 'faithfulness',\n 'hallucination',\n 'noise-sensitivity',\n 'prompt-alignment',\n 'tool-call-accuracy',\n 'toxicity',\n ])\n .describe('Scorer type: llm-judge for custom, or a preset type name');\n\nconst snapshotConfigSchema = z.object({\n name: z.string().describe('Name of the scorer'),\n description: z.string().optional().describe('Description of the scorer'),\n type: scorerTypeEnum,\n model: modelConfigSchema.optional().describe('Model configuration for LLM judge'),\n instructions: z.string().optional().describe('System instructions for the judge LLM (used when type is llm-judge)'),\n scoreRange: z\n .object({\n min: z.number().optional().describe('Minimum score value (default: 0)'),\n max: z.number().optional().describe('Maximum score value (default: 1)'),\n })\n .optional()\n .describe('Score range configuration (used when type is llm-judge)'),\n presetConfig: z.record(z.string(), z.unknown()).optional().describe('Serializable config options for preset scorers'),\n defaultSampling: samplingConfigSchema.optional().describe('Default sampling configuration'),\n});\n\nexport const createStoredScorerBodySchema = z\n .object({\n id: z.string().optional().describe('Unique identifier. If not provided, derived from name.'),\n authorId: z.string().optional().describe('Author identifier for multi-tenant filtering'),\n metadata: z.record(z.string(), z.unknown()).optional().describe('Additional metadata for the scorer'),\n })\n .merge(snapshotConfigSchema);\n\nexport const updateStoredScorerBodySchema = z\n .object({\n authorId: z.string().optional(),\n metadata: z.record(z.string(), z.unknown()).optional(),\n })\n .partial()\n .merge(snapshotConfigSchema.partial());\n\n// ============================================================================\n// Response Schemas\n// ============================================================================\n\nexport const storedScorerSchema = z.object({\n id: z.string(),\n status: z.string().describe('Scorer status: draft, published, or archived'),\n activeVersionId: z.string().optional(),\n authorId: z.string().optional(),\n metadata: z.record(z.string(), z.unknown()).optional(),\n createdAt: z.coerce.date(),\n updatedAt: z.coerce.date(),\n name: z.string().describe('Name of the scorer'),\n description: z.string().optional().describe('Description of the scorer'),\n type: scorerTypeEnum,\n model: modelConfigSchema.optional(),\n instructions: z.string().optional().describe('System instructions for the judge LLM'),\n scoreRange: z\n .object({\n min: z.number().optional(),\n max: z.number().optional(),\n })\n .optional(),\n presetConfig: z.record(z.string(), z.unknown()).optional(),\n defaultSampling: samplingConfigSchema.optional(),\n});\n\nexport const listStoredScorersResponseSchema = paginationInfoSchema.extend({\n scorerDefinitions: z.array(storedScorerSchema),\n});\n\nexport const getStoredScorerResponseSchema = storedScorerSchema;\nexport const createStoredScorerResponseSchema = storedScorerSchema;\n\nexport const updateStoredScorerResponseSchema = z.union([\n z.object({\n id: z.string(),\n status: z.string(),\n activeVersionId: z.string().optional(),\n authorId: z.string().optional(),\n metadata: z.record(z.string(), z.unknown()).optional(),\n createdAt: z.coerce.date(),\n updatedAt: z.coerce.date(),\n }),\n storedScorerSchema,\n]);\n\nexport const deleteStoredScorerResponseSchema = z.object({\n success: z.boolean(),\n message: z.string(),\n});\n"],"mappings":";;;;AASA,MAAa,2BAA2BA,OAAAA,EAAE,OAAO,EAC/C,gBAAgBA,OAAAA,EAAE,OAAO,CAAC,CAAC,SAAS,oDAAoD,EAC1F,C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CACb,QAAQA,OAAAA,EAAE,OAAO;CACjB,iBAAiBA,OAAAA,EAAE,OAAO,CAAC,CAAC,SAAS;CACrC,UAAUA,OAAAA,EAAE,OAAO,CAAC,CAAC,SAAS;CAC9B,UAAUA,OAAAA,EAAE,OAAOA,OAAAA,EAAE,OAAO,GAAGA,OAAAA,EAAE,QAAQ,CAAC,CAAC,CAAC,SAAS;CACrD,WAAWA,OAAAA,EAAE,OAAO,KAAK;CACzB,WAAWA,OAAAA,EAAE,OAAO,KAAK;AAC3B,CAAC,GACD,kBACF,CAAC;AAED,MAAa,mCAAmCA,OAAAA,EAAE,OAAO;CACvD,SAASA,OAAAA,EAAE,QAAQ;CACnB,SAASA,OAAAA,EAAE,OAAO;AACpB,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { i as createPagePaginationSchema, s as paginationInfoSchema } from "./common-tSamNYpt.js";
|
|
2
|
-
import { f as modelConfigSchema } from "./stored-agents-
|
|
2
|
+
import { f as modelConfigSchema } from "./stored-agents-ts0bWw8l.js";
|
|
3
3
|
import { z } from "zod/v4";
|
|
4
4
|
//#region src/server/schemas/stored-scorers.ts
|
|
5
5
|
const storedScorerIdPathParams = z.object({ storedScorerId: z.string().describe("Unique identifier for the stored scorer definition") });
|
|
@@ -96,4 +96,4 @@ const deleteStoredScorerResponseSchema = z.object({
|
|
|
96
96
|
//#endregion
|
|
97
97
|
export { listStoredScorersQuerySchema as a, storedScorerSchema as c, getStoredScorerResponseSchema as i, updateStoredScorerBodySchema as l, createStoredScorerResponseSchema as n, listStoredScorersResponseSchema as o, deleteStoredScorerResponseSchema as r, storedScorerIdPathParams as s, createStoredScorerBodySchema as t, updateStoredScorerResponseSchema as u };
|
|
98
98
|
|
|
99
|
-
//# sourceMappingURL=stored-scorers-
|
|
99
|
+
//# sourceMappingURL=stored-scorers-DySg7-qS.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"stored-scorers-
|
|
1
|
+
{"version":3,"file":"stored-scorers-DySg7-qS.js","names":[],"sources":["../src/server/schemas/stored-scorers.ts"],"sourcesContent":["import { z } from 'zod/v4';\n\nimport { paginationInfoSchema, createPagePaginationSchema, statusQuerySchema } from './common';\nimport { modelConfigSchema } from './stored-agents';\n\n// ============================================================================\n// Path Parameter Schemas\n// ============================================================================\n\nexport const storedScorerIdPathParams = z.object({\n storedScorerId: z.string().describe('Unique identifier for the stored scorer definition'),\n});\n\n// ============================================================================\n// Query Parameter Schemas\n// ============================================================================\n\nconst storageOrderBySchema = z.object({\n field: z.enum(['createdAt', 'updatedAt']).optional(),\n direction: z.enum(['ASC', 'DESC']).optional(),\n});\n\nexport { statusQuerySchema };\n\nexport const listStoredScorersQuerySchema = createPagePaginationSchema(100).extend({\n orderBy: storageOrderBySchema.optional(),\n status: z\n .enum(['draft', 'published', 'archived'])\n .optional()\n .default('published')\n .describe('Filter scorers by status (defaults to published)'),\n authorId: z.string().optional().describe('Filter scorers by author identifier'),\n metadata: z.record(z.string(), z.unknown()).optional().describe('Filter scorers by metadata key-value pairs'),\n});\n\n// ============================================================================\n// Body Parameter Schemas\n// ============================================================================\n\nconst samplingConfigSchema = z.union([\n z.object({ type: z.literal('none') }),\n z.object({ type: z.literal('ratio'), rate: z.number().min(0).max(1) }),\n]);\n\nconst scorerTypeEnum = z\n .enum([\n 'llm-judge',\n 'answer-relevancy',\n 'answer-similarity',\n 'bias',\n 'context-precision',\n 'context-relevance',\n 'faithfulness',\n 'hallucination',\n 'noise-sensitivity',\n 'prompt-alignment',\n 'tool-call-accuracy',\n 'toxicity',\n ])\n .describe('Scorer type: llm-judge for custom, or a preset type name');\n\nconst snapshotConfigSchema = z.object({\n name: z.string().describe('Name of the scorer'),\n description: z.string().optional().describe('Description of the scorer'),\n type: scorerTypeEnum,\n model: modelConfigSchema.optional().describe('Model configuration for LLM judge'),\n instructions: z.string().optional().describe('System instructions for the judge LLM (used when type is llm-judge)'),\n scoreRange: z\n .object({\n min: z.number().optional().describe('Minimum score value (default: 0)'),\n max: z.number().optional().describe('Maximum score value (default: 1)'),\n })\n .optional()\n .describe('Score range configuration (used when type is llm-judge)'),\n presetConfig: z.record(z.string(), z.unknown()).optional().describe('Serializable config options for preset scorers'),\n defaultSampling: samplingConfigSchema.optional().describe('Default sampling configuration'),\n});\n\nexport const createStoredScorerBodySchema = z\n .object({\n id: z.string().optional().describe('Unique identifier. If not provided, derived from name.'),\n authorId: z.string().optional().describe('Author identifier for multi-tenant filtering'),\n metadata: z.record(z.string(), z.unknown()).optional().describe('Additional metadata for the scorer'),\n })\n .merge(snapshotConfigSchema);\n\nexport const updateStoredScorerBodySchema = z\n .object({\n authorId: z.string().optional(),\n metadata: z.record(z.string(), z.unknown()).optional(),\n })\n .partial()\n .merge(snapshotConfigSchema.partial());\n\n// ============================================================================\n// Response Schemas\n// ============================================================================\n\nexport const storedScorerSchema = z.object({\n id: z.string(),\n status: z.string().describe('Scorer status: draft, published, or archived'),\n activeVersionId: z.string().optional(),\n authorId: z.string().optional(),\n metadata: z.record(z.string(), z.unknown()).optional(),\n createdAt: z.coerce.date(),\n updatedAt: z.coerce.date(),\n name: z.string().describe('Name of the scorer'),\n description: z.string().optional().describe('Description of the scorer'),\n type: scorerTypeEnum,\n model: modelConfigSchema.optional(),\n instructions: z.string().optional().describe('System instructions for the judge LLM'),\n scoreRange: z\n .object({\n min: z.number().optional(),\n max: z.number().optional(),\n })\n .optional(),\n presetConfig: z.record(z.string(), z.unknown()).optional(),\n defaultSampling: samplingConfigSchema.optional(),\n});\n\nexport const listStoredScorersResponseSchema = paginationInfoSchema.extend({\n scorerDefinitions: z.array(storedScorerSchema),\n});\n\nexport const getStoredScorerResponseSchema = storedScorerSchema;\nexport const createStoredScorerResponseSchema = storedScorerSchema;\n\nexport const updateStoredScorerResponseSchema = z.union([\n z.object({\n id: z.string(),\n status: z.string(),\n activeVersionId: z.string().optional(),\n authorId: z.string().optional(),\n metadata: z.record(z.string(), z.unknown()).optional(),\n createdAt: z.coerce.date(),\n updatedAt: z.coerce.date(),\n }),\n storedScorerSchema,\n]);\n\nexport const deleteStoredScorerResponseSchema = z.object({\n success: z.boolean(),\n message: z.string(),\n});\n"],"mappings":";;;;AASA,MAAa,2BAA2B,EAAE,OAAO,EAC/C,gBAAgB,EAAE,OAAO,CAAC,CAAC,SAAS,oDAAoD,EAC1F,CAAC;AAMD,MAAM,uBAAuB,EAAE,OAAO;CACpC,OAAO,EAAE,KAAK,CAAC,aAAa,WAAW,CAAC,CAAC,CAAC,SAAS;CACnD,WAAW,EAAE,KAAK,CAAC,OAAO,MAAM,CAAC,CAAC,CAAC,SAAS;AAC9C,CAAC;AAID,MAAa,+BAA+B,2BAA2B,GAAG,CAAC,CAAC,OAAO;CACjF,SAAS,qBAAqB,SAAS;CACvC,QAAQ,EACL,KAAK;EAAC;EAAS;EAAa;CAAU,CAAC,CAAC,CACxC,SAAS,CAAC,CACV,QAAQ,WAAW,CAAC,CACpB,SAAS,kDAAkD;CAC9D,UAAU,EAAE,OAAO,CAAC,CAAC,SAAS,CAAC,CAAC,SAAS,qCAAqC;CAC9E,UAAU,EAAE,OAAO,EAAE,OAAO,GAAG,EAAE,QAAQ,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,SAAS,4CAA4C;AAC9G,CAAC;AAMD,MAAM,uBAAuB,EAAE,MAAM,CACnC,EAAE,OAAO,EAAE,MAAM,EAAE,QAAQ,MAAM,EAAE,CAAC,GACpC,EAAE,OAAO;CAAE,MAAM,EAAE,QAAQ,OAAO;CAAG,MAAM,EAAE,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC;AAAE,CAAC,CACvE,CAAC;AAED,MAAM,iBAAiB,EACpB,KAAK;CACJ;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACF,CAAC,CAAC,CACD,SAAS,0DAA0D;AAEtE,MAAM,uBAAuB,EAAE,OAAO;CACpC,MAAM,EAAE,OAAO,CAAC,CAAC,SAAS,oBAA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SAAS,EAAE,QAAQ;CACnB,SAAS,EAAE,OAAO;AACpB,CAAC"}
|
|
@@ -68,6 +68,30 @@ function validateBody(body) {
|
|
|
68
68
|
function sanitizeBody(body, disallowedKeys) {
|
|
69
69
|
for (const key of disallowedKeys) if (key in body) delete body[key];
|
|
70
70
|
}
|
|
71
|
+
const CREDENTIAL_HEADER_NAMES = /* @__PURE__ */ new Set([
|
|
72
|
+
"authorization",
|
|
73
|
+
"proxy-authorization",
|
|
74
|
+
"x-api-key",
|
|
75
|
+
"api-key",
|
|
76
|
+
"x-goog-api-key",
|
|
77
|
+
"cookie"
|
|
78
|
+
]);
|
|
79
|
+
/**
|
|
80
|
+
* Removes credential-bearing headers from client-supplied `modelSettings.headers`
|
|
81
|
+
* so a caller's own auth (e.g. the app's bearer token) can never override the
|
|
82
|
+
* provider credential configured on the server. Non-credential headers are kept.
|
|
83
|
+
*/
|
|
84
|
+
function stripClientCredentialHeaders(body) {
|
|
85
|
+
const modelSettings = body.modelSettings;
|
|
86
|
+
if (!modelSettings || typeof modelSettings !== "object") return;
|
|
87
|
+
const headers = modelSettings.headers;
|
|
88
|
+
if (!headers || typeof headers !== "object") return;
|
|
89
|
+
const kept = Object.fromEntries(Object.entries(headers).filter(([name]) => !CREDENTIAL_HEADER_NAMES.has(name.toLowerCase())));
|
|
90
|
+
body.modelSettings = {
|
|
91
|
+
...modelSettings,
|
|
92
|
+
headers: kept
|
|
93
|
+
};
|
|
94
|
+
}
|
|
71
95
|
function parsePerPage(value, defaultValue = 100, max = 1e3) {
|
|
72
96
|
if ((value || "").trim().toLowerCase() === "false") return false;
|
|
73
97
|
const parsed = parseInt(value || String(defaultValue), 10);
|
|
@@ -223,6 +247,12 @@ Object.defineProperty(exports, "sanitizeBody", {
|
|
|
223
247
|
return sanitizeBody;
|
|
224
248
|
}
|
|
225
249
|
});
|
|
250
|
+
Object.defineProperty(exports, "stripClientCredentialHeaders", {
|
|
251
|
+
enumerable: true,
|
|
252
|
+
get: function() {
|
|
253
|
+
return stripClientCredentialHeaders;
|
|
254
|
+
}
|
|
255
|
+
});
|
|
226
256
|
Object.defineProperty(exports, "validateBody", {
|
|
227
257
|
enumerable: true,
|
|
228
258
|
get: function() {
|
|
@@ -242,4 +272,4 @@ Object.defineProperty(exports, "validateThreadOwnership", {
|
|
|
242
272
|
}
|
|
243
273
|
});
|
|
244
274
|
|
|
245
|
-
//# sourceMappingURL=utils-
|
|
275
|
+
//# sourceMappingURL=utils-HqDZJwRc.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utils-HqDZJwRc.cjs","names":["authEE","HTTPException","isReservedRequestContextKey","MASTRA_RESOURCE_ID_KEY","MastraMemory"],"sources":["../src/server/fga-permissions.ts","../src/server/handlers/utils.ts"],"sourcesContent":["/**\n * Safe re-export of `MastraFGAPermissions` from `@mastra/core/auth/ee`.\n *\n * Why this shim exists:\n * `MastraFGAPermissions` was introduced in `@mastra/core@1.32.0`. Earlier\n * versions of `@mastra/core` ship `@mastra/core/auth/ee` but do not export\n * this constant. A direct named import (`import { MastraFGAPermissions }\n * from '@mastra/core/auth/ee'`) fails at ESM link time when this version\n * of `@mastra/server` is paired with `@mastra/core < 1.32.0`, taking the\n * entire user bundle down before any code runs.\n *\n * A namespace import tolerates missing names — `ns.MissingExport` is just\n * `undefined`, no link-time error. We then expose the permission map.\n *\n * Fallback values:\n * If the consuming `@mastra/core` does not export `MastraFGAPermissions`,\n * we substitute a hardcoded map of the canonical permission strings used\n * by routes in `@mastra/server`. This preserves the explicit RBAC\n * permission overrides those routes already had as string literals in\n * `@mastra/server@1.31.0` (e.g. `requiresPermission: \"agents:execute\"`\n * on `/v1/responses`). Without this fallback, `requiresPermission` would\n * be `undefined` on old core and the auth layer would derive the wrong\n * permission from the route path (e.g. `v1:write` instead of\n * `agents:execute`), breaking RBAC users who upgrade `@mastra/server`\n * but stay on `@mastra/core@1.31.0`.\n *\n * Once the consuming `@mastra/core` is on `1.32.0+` the values are real\n * and behaviour is identical to a direct named import.\n */\n\nimport * as authEE from '@mastra/core/auth/ee';\n\n// Canonical strings for the FGA permission keys actually referenced by\n// `@mastra/server` source. Mirrors `MastraFGAPermissions` in\n// `@mastra/core@1.32.0+` for these specific keys, and matches the string\n// literals previously hardcoded on the same routes in `@mastra/server@1.31.0`.\nconst FALLBACK_PERMISSIONS = {\n AGENTS_CREATE: 'agents:create',\n AGENTS_DELETE: 'agents:delete',\n AGENTS_EXECUTE: 'agents:execute',\n AGENTS_READ: 'agents:read',\n MEMORY_DELETE: 'memory:delete',\n MEMORY_READ: 'memory:read',\n MEMORY_WRITE: 'memory:write',\n TOOLS_EXECUTE: 'tools:execute',\n TOOLS_READ: 'tools:read',\n STORED_WORKFLOWS_READ: 'stored-workflows:read',\n STORED_WORKFLOWS_WRITE: 'stored-workflows:write',\n WORKFLOWS_EXECUTE: 'workflows:execute',\n WORKFLOWS_READ: 'workflows:read',\n} as const;\n\nconst realPermissions = (authEE as any).MastraFGAPermissions;\n\n// Typed as `any` on purpose: consumers of `@mastra/server` may run their\n// typecheck against a `@mastra/core` that doesn't export `MastraFGAPermissions`\n// (anything < 1.32.0). Pinning to the real type would push that name into the\n// emitted `.d.ts` and break downstream typecheck. `any` lets the property\n// accesses (`MastraFGAPermissions.AGENTS_READ`) flow through cleanly on every\n// supported core.\nexport const MastraFGAPermissions: any =\n realPermissions && Object.keys(realPermissions).length > 0 ? realPermissions : FALLBACK_PERMISSIONS;\n","import type { MastraFGAPermissionInput } from '@mastra/core/auth/ee';\nimport type { RequestContext } from '@mastra/core/di';\nimport { MastraMemory } from '@mastra/core/memory';\nimport { MASTRA_RESOURCE_ID_KEY, MASTRA_THREAD_ID_KEY, isReservedRequestContextKey } from '../constants';\nimport { MastraFGAPermissions } from '../fga-permissions';\nimport { HTTPException } from '../http-exception';\n\n// Validation helper\nexport function validateBody(body: Record<string, unknown>) {\n const errorResponse = Object.entries(body).reduce<Record<string, string>>((acc, [key, value]) => {\n if (!value) {\n acc[key] = `Argument \"${key}\" is required`;\n }\n return acc;\n }, {});\n\n if (Object.keys(errorResponse).length > 0) {\n throw new HTTPException(400, { message: Object.values(errorResponse)[0] });\n }\n}\n\n/**\n * sanitizes the body by removing disallowed keys.\n * @param body body to sanitize\n * @param disallowedKeys keys to remove from the body\n */\nexport function sanitizeBody(body: Record<string, unknown>, disallowedKeys: string[]) {\n for (const key of disallowedKeys) {\n if (key in body) {\n delete body[key];\n }\n }\n}\n\nconst CREDENTIAL_HEADER_NAMES = new Set([\n 'authorization',\n 'proxy-authorization',\n 'x-api-key',\n 'api-key',\n 'x-goog-api-key',\n 'cookie',\n]);\n\n/**\n * Removes credential-bearing headers from client-supplied `modelSettings.headers`\n * so a caller's own auth (e.g. the app's bearer token) can never override the\n * provider credential configured on the server. Non-credential headers are kept.\n */\nexport function stripClientCredentialHeaders(body: Record<string, unknown>) {\n const modelSettings = body.modelSettings;\n if (!modelSettings || typeof modelSettings !== 'object') return;\n const headers = (modelSettings as { headers?: unknown }).headers;\n if (!headers || typeof headers !== 'object') return;\n\n const kept = Object.fromEntries(\n Object.entries(headers).filter(([name]) => !CREDENTIAL_HEADER_NAMES.has(name.toLowerCase())),\n );\n body.modelSettings = { ...modelSettings, headers: kept };\n}\n\nexport function parsePerPage(\n value: string | undefined,\n defaultValue: number = 100,\n max: number = 1000,\n): number | false {\n const normalized = (value || '').trim().toLowerCase();\n // Handle explicit false to bypass pagination\n if (normalized === 'false') {\n return false;\n }\n const parsed = parseInt(value || String(defaultValue), 10);\n if (isNaN(parsed)) return defaultValue;\n return Math.min(max, Math.max(1, parsed));\n}\n\n/**\n * Parses filter query parameters into a key-value object.\n */\nexport function parseFilters(filters: string | string[] | undefined): Record<string, string> | undefined {\n if (!filters) return undefined;\n\n return Object.fromEntries(\n (Array.isArray(filters) ? filters : [filters]).map((attr: string) => {\n const [key, ...valueParts] = attr.split(':');\n const value = valueParts.join(':'); // ✅ Handles colons in values\n return [key, value];\n }),\n );\n}\n\n/**\n * Merges a body-supplied requestContext into the trusted server RequestContext.\n * The server context is authoritative: reserved keys are skipped and body values\n * only fill keys the server context has not already set.\n */\nexport function mergeBodyRequestContext(serverRequestContext: RequestContext, bodyRequestContext: unknown): void {\n if (!bodyRequestContext || typeof bodyRequestContext !== 'object') {\n return;\n }\n\n for (const [key, value] of Object.entries(bodyRequestContext)) {\n if (isReservedRequestContextKey(key)) continue;\n if (serverRequestContext.get(key) === undefined) {\n serverRequestContext.set(key, value);\n }\n }\n}\n\n// ============================================================================\n// Authorization Utilities\n// ============================================================================\n\n/**\n * Gets the effective resourceId, preferring the reserved key from requestContext\n * over client-provided values for security.\n */\nexport function getEffectiveResourceId(\n requestContext: RequestContext | undefined,\n clientResourceId: string | undefined,\n): string | undefined {\n const contextResourceId = requestContext?.get(MASTRA_RESOURCE_ID_KEY) as string | undefined;\n return contextResourceId || clientResourceId;\n}\n\n/**\n * Returns the resource id resolved from the request context alone (set via\n * `mapUserToResourceId` or the `x-resource-id` header), ignoring any\n * client-provided value. Its presence indicates a resource-scoped caller;\n * its absence indicates a privileged/service context.\n */\nexport function getContextResourceId(requestContext: RequestContext | undefined): string | undefined {\n return requestContext?.get(MASTRA_RESOURCE_ID_KEY) as string | undefined;\n}\n\n/**\n * Ensures a memory request has a resolvable resource ID. The body's\n * `memory.resource` is optional so authenticated setups can rely on the\n * server-derived resource ID (MASTRA_RESOURCE_ID_KEY set via mapUserToResourceId).\n * When neither the body nor the request context provides one, reject with a\n * clear 400 instead of failing deep inside agent execution.\n */\nexport function requireEffectiveResourceId(\n effectiveResourceId: string | undefined,\n): asserts effectiveResourceId is string {\n if (!effectiveResourceId) {\n throw new HTTPException(400, {\n message:\n 'A resource ID is required when using memory. Provide memory.resource in the request body, or configure server auth with mapUserToResourceId to derive it from the authenticated user.',\n });\n }\n}\n\n/**\n * Gets the effective threadId, preferring the reserved key from requestContext\n * over client-provided values for security.\n */\nexport function getEffectiveThreadId(\n requestContext: RequestContext | undefined,\n clientThreadId: string | undefined,\n): string | undefined {\n const contextThreadId = requestContext?.get(MASTRA_THREAD_ID_KEY) as string | undefined;\n return contextThreadId || clientThreadId;\n}\n\n/**\n * Validates that a thread belongs to the specified resourceId.\n * Throws 403 if the thread exists but belongs to a different resource.\n * Threads with no resourceId are accessible to all (shared threads).\n */\nexport async function validateThreadOwnership(\n thread: { resourceId?: string | null } | null | undefined,\n effectiveResourceId: string | undefined,\n): Promise<void> {\n if (thread && effectiveResourceId && thread.resourceId && thread.resourceId !== effectiveResourceId) {\n throw new HTTPException(403, { message: 'Access denied: thread belongs to a different resource' });\n }\n}\n\n/**\n * Validates both coarse resource ownership and fine-grained thread access.\n * FGA enforcement is a no-op when no FGA provider is configured.\n */\nexport async function enforceThreadAccess({\n mastra,\n requestContext,\n threadId,\n thread,\n effectiveResourceId,\n permission = MastraFGAPermissions.MEMORY_READ,\n}: {\n mastra: any;\n requestContext?: RequestContext;\n threadId: string;\n thread?: { resourceId?: string | null } | null;\n effectiveResourceId?: string;\n permission?: MastraFGAPermissionInput;\n}): Promise<void> {\n await validateThreadOwnership(thread, effectiveResourceId);\n\n const fgaProvider = mastra?.getServer?.()?.fga;\n if (!fgaProvider) {\n return;\n }\n\n const user = requestContext?.get('user');\n if (!user || typeof user !== 'object') {\n throw new HTTPException(403, { message: 'FGA authorization denied: authenticated user is required' });\n }\n\n await MastraMemory.checkThreadFGA({\n mastra,\n user: user as { id: string; [key: string]: unknown },\n threadId,\n resourceId: thread?.resourceId ?? effectiveResourceId,\n requestContext,\n permission,\n });\n}\n\n/**\n * Validates that a workflow run belongs to the specified resourceId.\n * Throws 403 if the run exists but belongs to a different resource.\n */\nexport async function validateRunOwnership(\n run: { resourceId?: string | null } | null | undefined,\n effectiveResourceId: string | undefined,\n): Promise<void> {\n if (run && effectiveResourceId && run.resourceId && run.resourceId !== effectiveResourceId) {\n throw new HTTPException(403, { message: 'Access denied: workflow run belongs to a different resource' });\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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ACe;CACf,IAAI,UAAU,uBAAuB,OAAO,cAAc,OAAO,eAAe,qBAC9E,MAAM,IAAIA,uBAAAA,cAAc,KAAK,EAAE,SAAS,wDAAwD,CAAC;AAErG;;;;;AAMA,eAAsB,oBAAoB,EACxC,QACA,gBACA,UACA,QACA,qBACA,aAAa,qBAAqB,eAQlB;CAChB,MAAM,wBAAwB,QAAQ,mBAAmB;CAGzD,IAAI,CADgB,QAAQ,YAAY,CAAC,EAAE,KAEzC;CAGF,MAAM,OAAO,gBAAgB,IAAI,MAAM;CACvC,IAAI,CAAC,QAAQ,OAAO,SAAS,UAC3B,MAAM,IAAIA,uBAAAA,cAAc,KAAK,EAAE,SAAS,2DAA2D,CAAC;CAGtG,MAAMG,oBAAAA,aAAa,eAAe;EAChC;EACM;EACN;EACA,YAAY,QAAQ,cAAc;EAClC;EACA;CACF,CAAC;AACH;;;;;AAMA,eAAsB,qBACpB,KACA,qBACe;CACf,IAAI,OAAO,uBAAuB,IAAI,cAAc,IAAI,eAAe,qBACrE,MAAM,IAAIH,uBAAAA,cAAc,KAAK,EAAE,SAAS,8DAA8D,CAAC;AAE3G"}
|
|
@@ -66,6 +66,30 @@ function validateBody(body) {
|
|
|
66
66
|
function sanitizeBody(body, disallowedKeys) {
|
|
67
67
|
for (const key of disallowedKeys) if (key in body) delete body[key];
|
|
68
68
|
}
|
|
69
|
+
const CREDENTIAL_HEADER_NAMES = /* @__PURE__ */ new Set([
|
|
70
|
+
"authorization",
|
|
71
|
+
"proxy-authorization",
|
|
72
|
+
"x-api-key",
|
|
73
|
+
"api-key",
|
|
74
|
+
"x-goog-api-key",
|
|
75
|
+
"cookie"
|
|
76
|
+
]);
|
|
77
|
+
/**
|
|
78
|
+
* Removes credential-bearing headers from client-supplied `modelSettings.headers`
|
|
79
|
+
* so a caller's own auth (e.g. the app's bearer token) can never override the
|
|
80
|
+
* provider credential configured on the server. Non-credential headers are kept.
|
|
81
|
+
*/
|
|
82
|
+
function stripClientCredentialHeaders(body) {
|
|
83
|
+
const modelSettings = body.modelSettings;
|
|
84
|
+
if (!modelSettings || typeof modelSettings !== "object") return;
|
|
85
|
+
const headers = modelSettings.headers;
|
|
86
|
+
if (!headers || typeof headers !== "object") return;
|
|
87
|
+
const kept = Object.fromEntries(Object.entries(headers).filter(([name]) => !CREDENTIAL_HEADER_NAMES.has(name.toLowerCase())));
|
|
88
|
+
body.modelSettings = {
|
|
89
|
+
...modelSettings,
|
|
90
|
+
headers: kept
|
|
91
|
+
};
|
|
92
|
+
}
|
|
69
93
|
function parsePerPage(value, defaultValue = 100, max = 1e3) {
|
|
70
94
|
if ((value || "").trim().toLowerCase() === "false") return false;
|
|
71
95
|
const parsed = parseInt(value || String(defaultValue), 10);
|
|
@@ -161,6 +185,6 @@ async function validateRunOwnership(run, effectiveResourceId) {
|
|
|
161
185
|
if (run && effectiveResourceId && run.resourceId && run.resourceId !== effectiveResourceId) throw new HTTPException(403, { message: "Access denied: workflow run belongs to a different resource" });
|
|
162
186
|
}
|
|
163
187
|
//#endregion
|
|
164
|
-
export { mergeBodyRequestContext as a, requireEffectiveResourceId as c,
|
|
188
|
+
export { mergeBodyRequestContext as a, requireEffectiveResourceId as c, validateBody as d, validateRunOwnership as f, getEffectiveThreadId as i, sanitizeBody as l, MastraFGAPermissions as m, getContextResourceId as n, parseFilters as o, validateThreadOwnership as p, getEffectiveResourceId as r, parsePerPage as s, enforceThreadAccess as t, stripClientCredentialHeaders as u };
|
|
165
189
|
|
|
166
|
-
//# sourceMappingURL=utils-
|
|
190
|
+
//# sourceMappingURL=utils-KcHk7C0D.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utils-KcHk7C0D.js","names":[],"sources":["../src/server/fga-permissions.ts","../src/server/handlers/utils.ts"],"sourcesContent":["/**\n * Safe re-export of `MastraFGAPermissions` from `@mastra/core/auth/ee`.\n *\n * Why this shim exists:\n * `MastraFGAPermissions` was introduced in `@mastra/core@1.32.0`. Earlier\n * versions of `@mastra/core` ship `@mastra/core/auth/ee` but do not export\n * this constant. A direct named import (`import { MastraFGAPermissions }\n * from '@mastra/core/auth/ee'`) fails at ESM link time when this version\n * of `@mastra/server` is paired with `@mastra/core < 1.32.0`, taking the\n * entire user bundle down before any code runs.\n *\n * A namespace import tolerates missing names — `ns.MissingExport` is just\n * `undefined`, no link-time error. We then expose the permission map.\n *\n * Fallback values:\n * If the consuming `@mastra/core` does not export `MastraFGAPermissions`,\n * we substitute a hardcoded map of the canonical permission strings used\n * by routes in `@mastra/server`. This preserves the explicit RBAC\n * permission overrides those routes already had as string literals in\n * `@mastra/server@1.31.0` (e.g. `requiresPermission: \"agents:execute\"`\n * on `/v1/responses`). Without this fallback, `requiresPermission` would\n * be `undefined` on old core and the auth layer would derive the wrong\n * permission from the route path (e.g. `v1:write` instead of\n * `agents:execute`), breaking RBAC users who upgrade `@mastra/server`\n * but stay on `@mastra/core@1.31.0`.\n *\n * Once the consuming `@mastra/core` is on `1.32.0+` the values are real\n * and behaviour is identical to a direct named import.\n */\n\nimport * as authEE from '@mastra/core/auth/ee';\n\n// Canonical strings for the FGA permission keys actually referenced by\n// `@mastra/server` source. Mirrors `MastraFGAPermissions` in\n// `@mastra/core@1.32.0+` for these specific keys, and matches the string\n// literals previously hardcoded on the same routes in `@mastra/server@1.31.0`.\nconst FALLBACK_PERMISSIONS = {\n AGENTS_CREATE: 'agents:create',\n AGENTS_DELETE: 'agents:delete',\n AGENTS_EXECUTE: 'agents:execute',\n AGENTS_READ: 'agents:read',\n MEMORY_DELETE: 'memory:delete',\n MEMORY_READ: 'memory:read',\n MEMORY_WRITE: 'memory:write',\n TOOLS_EXECUTE: 'tools:execute',\n TOOLS_READ: 'tools:read',\n STORED_WORKFLOWS_READ: 'stored-workflows:read',\n STORED_WORKFLOWS_WRITE: 'stored-workflows:write',\n WORKFLOWS_EXECUTE: 'workflows:execute',\n WORKFLOWS_READ: 'workflows:read',\n} as const;\n\nconst realPermissions = (authEE as any).MastraFGAPermissions;\n\n// Typed as `any` on purpose: consumers of `@mastra/server` may run their\n// typecheck against a `@mastra/core` that doesn't export `MastraFGAPermissions`\n// (anything < 1.32.0). Pinning to the real type would push that name into the\n// emitted `.d.ts` and break downstream typecheck. `any` lets the property\n// accesses (`MastraFGAPermissions.AGENTS_READ`) flow through cleanly on every\n// supported core.\nexport const MastraFGAPermissions: any =\n realPermissions && Object.keys(realPermissions).length > 0 ? realPermissions : FALLBACK_PERMISSIONS;\n","import type { MastraFGAPermissionInput } from '@mastra/core/auth/ee';\nimport type { RequestContext } from '@mastra/core/di';\nimport { MastraMemory } from '@mastra/core/memory';\nimport { MASTRA_RESOURCE_ID_KEY, MASTRA_THREAD_ID_KEY, isReservedRequestContextKey } from '../constants';\nimport { MastraFGAPermissions } from '../fga-permissions';\nimport { HTTPException } from '../http-exception';\n\n// Validation helper\nexport function validateBody(body: Record<string, unknown>) {\n const errorResponse = Object.entries(body).reduce<Record<string, string>>((acc, [key, value]) => {\n if (!value) {\n acc[key] = `Argument \"${key}\" is required`;\n }\n return acc;\n }, {});\n\n if (Object.keys(errorResponse).length > 0) {\n throw new HTTPException(400, { message: Object.values(errorResponse)[0] });\n }\n}\n\n/**\n * sanitizes the body by removing disallowed keys.\n * @param body body to sanitize\n * @param disallowedKeys keys to remove from the body\n */\nexport function sanitizeBody(body: Record<string, unknown>, disallowedKeys: string[]) {\n for (const key of disallowedKeys) {\n if (key in body) {\n delete body[key];\n }\n }\n}\n\nconst CREDENTIAL_HEADER_NAMES = new Set([\n 'authorization',\n 'proxy-authorization',\n 'x-api-key',\n 'api-key',\n 'x-goog-api-key',\n 'cookie',\n]);\n\n/**\n * Removes credential-bearing headers from client-supplied `modelSettings.headers`\n * so a caller's own auth (e.g. the app's bearer token) can never override the\n * provider credential configured on the server. Non-credential headers are kept.\n */\nexport function stripClientCredentialHeaders(body: Record<string, unknown>) {\n const modelSettings = body.modelSettings;\n if (!modelSettings || typeof modelSettings !== 'object') return;\n const headers = (modelSettings as { headers?: unknown }).headers;\n if (!headers || typeof headers !== 'object') return;\n\n const kept = Object.fromEntries(\n Object.entries(headers).filter(([name]) => !CREDENTIAL_HEADER_NAMES.has(name.toLowerCase())),\n );\n body.modelSettings = { ...modelSettings, headers: kept };\n}\n\nexport function parsePerPage(\n value: string | undefined,\n defaultValue: number = 100,\n max: number = 1000,\n): number | false {\n const normalized = (value || '').trim().toLowerCase();\n // Handle explicit false to bypass pagination\n if (normalized === 'false') {\n return false;\n }\n const parsed = parseInt(value || String(defaultValue), 10);\n if (isNaN(parsed)) return defaultValue;\n return Math.min(max, Math.max(1, parsed));\n}\n\n/**\n * Parses filter query parameters into a key-value object.\n */\nexport function parseFilters(filters: string | string[] | undefined): Record<string, string> | undefined {\n if (!filters) return undefined;\n\n return Object.fromEntries(\n (Array.isArray(filters) ? filters : [filters]).map((attr: string) => {\n const [key, ...valueParts] = attr.split(':');\n const value = valueParts.join(':'); // ✅ Handles colons in values\n return [key, value];\n }),\n );\n}\n\n/**\n * Merges a body-supplied requestContext into the trusted server RequestContext.\n * The server context is authoritative: reserved keys are skipped and body values\n * only fill keys the server context has not already set.\n */\nexport function mergeBodyRequestContext(serverRequestContext: RequestContext, bodyRequestContext: unknown): void {\n if (!bodyRequestContext || typeof bodyRequestContext !== 'object') {\n return;\n }\n\n for (const [key, value] of Object.entries(bodyRequestContext)) {\n if (isReservedRequestContextKey(key)) continue;\n if (serverRequestContext.get(key) === undefined) {\n serverRequestContext.set(key, value);\n }\n }\n}\n\n// ============================================================================\n// Authorization Utilities\n// ============================================================================\n\n/**\n * Gets the effective resourceId, preferring the reserved key from requestContext\n * over client-provided values for security.\n */\nexport function getEffectiveResourceId(\n requestContext: RequestContext | undefined,\n clientResourceId: string | undefined,\n): string | undefined {\n const contextResourceId = requestContext?.get(MASTRA_RESOURCE_ID_KEY) as string | undefined;\n return contextResourceId || clientResourceId;\n}\n\n/**\n * Returns the resource id resolved from the request context alone (set via\n * `mapUserToResourceId` or the `x-resource-id` header), ignoring any\n * client-provided value. Its presence indicates a resource-scoped caller;\n * its absence indicates a privileged/service context.\n */\nexport function getContextResourceId(requestContext: RequestContext | undefined): string | undefined {\n return requestContext?.get(MASTRA_RESOURCE_ID_KEY) as string | undefined;\n}\n\n/**\n * Ensures a memory request has a resolvable resource ID. The body's\n * `memory.resource` is optional so authenticated setups can rely on the\n * server-derived resource ID (MASTRA_RESOURCE_ID_KEY set via mapUserToResourceId).\n * When neither the body nor the request context provides one, reject with a\n * clear 400 instead of failing deep inside agent execution.\n */\nexport function requireEffectiveResourceId(\n effectiveResourceId: string | undefined,\n): asserts effectiveResourceId is string {\n if (!effectiveResourceId) {\n throw new HTTPException(400, {\n message:\n 'A resource ID is required when using memory. Provide memory.resource in the request body, or configure server auth with mapUserToResourceId to derive it from the authenticated user.',\n });\n }\n}\n\n/**\n * Gets the effective threadId, preferring the reserved key from requestContext\n * over client-provided values for security.\n */\nexport function getEffectiveThreadId(\n requestContext: RequestContext | undefined,\n clientThreadId: string | undefined,\n): string | undefined {\n const contextThreadId = requestContext?.get(MASTRA_THREAD_ID_KEY) as string | undefined;\n return contextThreadId || clientThreadId;\n}\n\n/**\n * Validates that a thread belongs to the specified resourceId.\n * Throws 403 if the thread exists but belongs to a different resource.\n * Threads with no resourceId are accessible to all (shared threads).\n */\nexport async function validateThreadOwnership(\n thread: { resourceId?: string | null } | null | undefined,\n effectiveResourceId: string | undefined,\n): Promise<void> {\n if (thread && effectiveResourceId && thread.resourceId && thread.resourceId !== effectiveResourceId) {\n throw new HTTPException(403, { message: 'Access denied: thread belongs to a different resource' });\n }\n}\n\n/**\n * Validates both coarse resource ownership and fine-grained thread access.\n * FGA enforcement is a no-op when no FGA provider is configured.\n */\nexport async function enforceThreadAccess({\n mastra,\n requestContext,\n threadId,\n thread,\n effectiveResourceId,\n permission = MastraFGAPermissions.MEMORY_READ,\n}: {\n mastra: any;\n requestContext?: RequestContext;\n threadId: string;\n thread?: { resourceId?: string | null } | null;\n effectiveResourceId?: string;\n permission?: MastraFGAPermissionInput;\n}): Promise<void> {\n await validateThreadOwnership(thread, effectiveResourceId);\n\n const fgaProvider = mastra?.getServer?.()?.fga;\n if (!fgaProvider) {\n return;\n }\n\n const user = requestContext?.get('user');\n if (!user || typeof user !== 'object') {\n throw new HTTPException(403, { message: 'FGA authorization denied: authenticated user is required' });\n }\n\n await MastraMemory.checkThreadFGA({\n mastra,\n user: user as { id: string; [key: string]: unknown },\n threadId,\n resourceId: thread?.resourceId ?? effectiveResourceId,\n requestContext,\n permission,\n });\n}\n\n/**\n * Validates that a workflow run belongs to the specified resourceId.\n * Throws 403 if the run exists but belongs to a different resource.\n */\nexport async function validateRunOwnership(\n run: { resourceId?: string | null } | null | undefined,\n effectiveResourceId: string | undefined,\n): Promise<void> {\n if (run && effectiveResourceId && run.resourceId && run.resourceId !== effectiveResourceId) {\n throw new HTTPException(403, { message: 'Access denied: workflow run belongs to a different resource' });\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAoCA,MAAM,uBAAuB;CAC3B,eAAe;CACf,eAAe;CACf,gBAAgB;CAChB,aAAa;CACb,eAAe;CACf,aAAa;CACb,cAAc;CACd,eAAe;CACf,YAAY;CACZ,uBAAuB;CACvB,wBAAwB;CACxB,mBAAmB;CACnB,gBAAgB;AAClB;AAEA,MAAM,kBAAmB,OAAe;AAQxC,MAAa,uBACX,mBAAmB,OAAO,KAAK,eAAe,CAAC,CAAC,SAAS,IAAI,kBAAkB;;;ACrDjF,SAAgB,aAAa,MAA+B;CAC1D,MAAM,gBAAgB,OAAO,QAAQ,IAAI,CAAC,CAAC,QAAgC,KAAK,CAAC,KAAK,WAAW;EAC/F,IAAI,CAAC,OACH,IAAI,OAAO,aAAa,IAAI;EAE9B,OAAO;CACT,GAAG,CAAC,CAAC;CAEL,IAAI,OAAO,KAAK,aAAa,CAAC,CAAC,SAAS,GACtC,MAAM,IAAI,cAAc,KAAK,EAAE,SAAS,OAAO,OAAO,aAAa,CAAC,CAAC,GAAG,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
|
|
@@ -2,7 +2,7 @@ const require_http_exception = require("./http-exception-CKDHupKw.cjs");
|
|
|
2
2
|
const require_agents = require("./agents-DwJE1tsB.cjs");
|
|
3
3
|
const require_route_builder = require("./route-builder-2yrD15TL.cjs");
|
|
4
4
|
const require_server_handlers_error = require("./server/handlers/error.cjs");
|
|
5
|
-
const require_utils = require("./utils-
|
|
5
|
+
const require_utils = require("./utils-HqDZJwRc.cjs");
|
|
6
6
|
const require_editor_builder = require("./editor-builder-Dm6jviKJ.cjs");
|
|
7
7
|
let zod_v4 = require("zod/v4");
|
|
8
8
|
//#region src/server/schemas/workflow-builder.ts
|
|
@@ -112,4 +112,4 @@ Object.defineProperty(exports, "STREAM_WORKFLOW_BUILDER_ROUTE", {
|
|
|
112
112
|
}
|
|
113
113
|
});
|
|
114
114
|
|
|
115
|
-
//# sourceMappingURL=workflow-builder-
|
|
115
|
+
//# sourceMappingURL=workflow-builder-BSjQJCVD.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"workflow-builder-
|
|
1
|
+
{"version":3,"file":"workflow-builder-BSjQJCVD.cjs","names":["z","builderModelPolicySchema","createRoute","handleError","agentExecutionBodySchema","streamResponseSchema","HTTPException","getEffectiveResourceId","getEffectiveThreadId","enforceThreadAccess"],"sources":["../src/server/schemas/workflow-builder.ts","../src/server/handlers/workflow-builder.ts"],"sourcesContent":["import { z } from 'zod/v4';\nimport { builderModelPolicySchema } from './editor-builder';\n\nexport const workflowBuilderSettingsResponseSchema = z.object({\n enabled: z.boolean(),\n modelPolicy: builderModelPolicySchema.optional(),\n});\n\nexport type WorkflowBuilderSettingsResponse = z.infer<typeof workflowBuilderSettingsResponseSchema>;\n","import { HTTPException } from '../http-exception';\nimport { agentExecutionBodySchema, streamResponseSchema } from '../schemas/agents';\nimport { workflowBuilderSettingsResponseSchema } from '../schemas/workflow-builder';\nimport { createRoute } from '../server-adapter/routes/route-builder';\nimport { handleError } from './error';\nimport {\n enforceThreadAccess,\n getEffectiveResourceId,\n getEffectiveThreadId,\n mergeBodyRequestContext,\n requireEffectiveResourceId,\n validateBody,\n} from './utils';\n\nexport const GET_WORKFLOW_BUILDER_SETTINGS_ROUTE = createRoute({\n method: 'GET',\n path: '/editor/workflow-builder/settings',\n responseType: 'json',\n responseSchema: workflowBuilderSettingsResponseSchema,\n summary: 'Get persisted workflow builder settings',\n description: 'Returns whether the editor-owned persisted workflow builder is available',\n tags: ['Editor'],\n requiresAuth: true,\n requiresPermission: 'stored-workflows:read',\n handler: async ({ mastra }) => {\n try {\n const editor = mastra.getEditor();\n if (!editor || typeof editor.resolveWorkflowBuilder !== 'function') return { enabled: false };\n if (!editor.hasEnabledWorkflowBuilderConfig?.()) return { enabled: false };\n\n const builder = await editor.resolveWorkflowBuilder();\n return {\n enabled: builder?.enabled === true,\n modelPolicy: builder?.getModelPolicy(),\n };\n } catch (error) {\n return handleError(error, 'Error getting workflow builder settings');\n }\n },\n});\n\nexport const STREAM_WORKFLOW_BUILDER_ROUTE = createRoute({\n method: 'POST',\n path: '/editor/workflow-builder/stream',\n responseType: 'stream' as const,\n streamFormat: 'sse' as const,\n bodySchema: agentExecutionBodySchema,\n responseSchema: streamResponseSchema,\n summary: 'Stream persisted workflow builder response',\n description: 'Streams from the hidden editor-owned workflow builder agent',\n tags: ['Editor'],\n requiresAuth: true,\n requiresPermission: 'stored-workflows:write',\n handler: async ({ mastra, abortSignal, requestContext: serverRequestContext, ...params }) => {\n try {\n const editor = mastra.getEditor();\n if (!editor?.hasEnabledWorkflowBuilderConfig?.() || typeof editor.resolveWorkflowBuilder !== 'function') {\n throw new HTTPException(404, { message: 'Workflow builder is not enabled' });\n }\n\n const builder = await editor.resolveWorkflowBuilder();\n if (!builder?.enabled) throw new HTTPException(404, { message: 'Workflow builder is not enabled' });\n const agent = builder.getAgent();\n\n const { messages, memory: memoryOption, requestContext: bodyRequestContext, ...rest } = params;\n validateBody({ messages });\n\n mergeBodyRequestContext(serverRequestContext, bodyRequestContext);\n\n let authorizedMemoryOption = memoryOption;\n if (memoryOption) {\n const clientThreadId = typeof memoryOption.thread === 'string' ? memoryOption.thread : memoryOption.thread?.id;\n const effectiveResourceId = getEffectiveResourceId(serverRequestContext, memoryOption.resource);\n requireEffectiveResourceId(effectiveResourceId);\n const effectiveThreadId = getEffectiveThreadId(serverRequestContext, clientThreadId);\n\n if (effectiveThreadId) {\n const memory = await agent.getMemory({ requestContext: serverRequestContext });\n const thread = await memory?.getThreadById({ threadId: effectiveThreadId });\n if (thread) {\n await enforceThreadAccess({\n mastra,\n requestContext: serverRequestContext,\n threadId: effectiveThreadId,\n thread,\n effectiveResourceId,\n permission: 'memory:write',\n });\n }\n }\n\n authorizedMemoryOption = {\n ...memoryOption,\n resource: effectiveResourceId ?? memoryOption.resource,\n thread: effectiveThreadId ?? memoryOption.thread,\n };\n }\n\n const { structuredOutput, ...streamOptions } = rest;\n const options: Record<string, any> = {\n ...streamOptions,\n requestContext: serverRequestContext,\n memory: authorizedMemoryOption,\n abortSignal,\n };\n const result = structuredOutput\n ? await agent.stream(messages, { ...options, structuredOutput })\n : await agent.stream(messages, options);\n return result.fullStream;\n } catch (error) {\n return handleError(error, 'Error streaming workflow builder response');\n }\n },\n});\n"],"mappings":";;;;;;;;AAGA,MAAa,wCAAwCA,OAAAA,EAAE,OAAO;CAC5D,SAASA,OAAAA,EAAE,QAAQ;CACnB,aAAaC,uBAAAA,yBAAyB,SAAS;AACjD,CAAC;;;ACQD,MAAa,sCAAsCC,sBAAAA,YAAY;CAC7D,QAAQ;CACR,MAAM;CACN,cAAc;CACd,gBAAgB;CAChB,SAAS;CACT,aAAa;CACb,MAAM,CAAC,QAAQ;CACf,cAAc;CACd,oBAAoB;CACpB,SAAS,OAAO,EAAE,aAAa;EAC7B,IAAI;GACF,MAAM,SAAS,OAAO,UAAU;GAChC,IAAI,CAAC,UAAU,OAAO,OAAO,2BAA2B,YAAY,OAAO,EAAE,SAAS,MAAM;GAC5F,IAAI,CAAC,OAAO,kC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AErB,MAAM,SAAS,OAAM,MADA,MAAM,UAAU,EAAE,gBAAgB,qBAAqB,CAAC,EAAA,EAChD,cAAc,EAAE,UAAU,kBAAkB,CAAC;KAC1E,IAAI,QACF,MAAMC,cAAAA,oBAAoB;MACxB;MACA,gBAAgB;MAChB,UAAU;MACV;MACA;MACA,YAAY;KACd,CAAC;IAEL;IAEA,yBAAyB;KACvB,GAAG;KACH,UAAU,uBAAuB,aAAa;KAC9C,QAAQ,qBAAqB,aAAa;IAC5C;GACF;GAEA,MAAM,EAAE,kBAAkB,GAAG,kBAAkB;GAC/C,MAAM,UAA+B;IACnC,GAAG;IACH,gBAAgB;IAChB,QAAQ;IACR;GACF;GAIA,QAHe,mBACX,MAAM,MAAM,OAAO,UAAU;IAAE,GAAG;IAAS;GAAiB,CAAC,IAC7D,MAAM,MAAM,OAAO,UAAU,OAAO,EAAA,CAC1B;EAChB,SAAS,OAAO;GACd,OAAON,8BAAAA,YAAY,OAAO,2CAA2C;EACvE;CACF;AACF,CAAC"}
|
|
@@ -2,7 +2,7 @@ import { t as HTTPException } from "./http-exception-CyfxZB6W.js";
|
|
|
2
2
|
import { J as streamResponseSchema, r as agentExecutionBodySchema } from "./agents-kOz1lr_e.js";
|
|
3
3
|
import { n as createRoute } from "./route-builder-lBil8Cvo.js";
|
|
4
4
|
import { handleError } from "./server/handlers/error.js";
|
|
5
|
-
import { a as mergeBodyRequestContext, c as requireEffectiveResourceId, i as getEffectiveThreadId, r as getEffectiveResourceId, t as enforceThreadAccess
|
|
5
|
+
import { a as mergeBodyRequestContext, c as requireEffectiveResourceId, d as validateBody, i as getEffectiveThreadId, r as getEffectiveResourceId, t as enforceThreadAccess } from "./utils-KcHk7C0D.js";
|
|
6
6
|
import { a as builderModelPolicySchema } from "./editor-builder-BLi1jvZd.js";
|
|
7
7
|
import { z } from "zod/v4";
|
|
8
8
|
//#endregion
|
|
@@ -99,4 +99,4 @@ const STREAM_WORKFLOW_BUILDER_ROUTE = createRoute({
|
|
|
99
99
|
//#endregion
|
|
100
100
|
export { STREAM_WORKFLOW_BUILDER_ROUTE as n, GET_WORKFLOW_BUILDER_SETTINGS_ROUTE as t };
|
|
101
101
|
|
|
102
|
-
//# sourceMappingURL=workflow-builder-
|
|
102
|
+
//# sourceMappingURL=workflow-builder-DJ48IzXQ.js.map
|