@mastra/server 1.75.0-alpha.1 → 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-Cg5BAmJ6.js → api-schema-manifest-B0p6nxU1.js} +2 -2
- package/dist/{api-schema-manifest-Cg5BAmJ6.js.map → api-schema-manifest-B0p6nxU1.js.map} +1 -1
- package/dist/{api-schema-manifest-hJw56vOw.cjs → api-schema-manifest-D9_jxxNw.cjs} +2 -2
- package/dist/{api-schema-manifest-hJw56vOw.cjs.map → api-schema-manifest-D9_jxxNw.cjs.map} +1 -1
- package/dist/{dist-BKGwFBci.js → dist-5xXLv6KR.js} +8 -8
- package/dist/{dist-BKGwFBci.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-DL6nu99w.cjs → dist-B6rOIYr_.cjs} +8 -8
- package/dist/{dist-DL6nu99w.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-mJga4N4C.cjs → routes-BuiLQCOQ.cjs} +2 -2
- package/dist/{routes-mJga4N4C.cjs.map → routes-BuiLQCOQ.cjs.map} +1 -1
- package/dist/{routes-obDo67aE.js → routes-CJygX0-a.js} +2 -2
- package/dist/{routes-obDo67aE.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-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 +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 +1 -1
- package/dist/server/handlers/auth.cjs +1 -1
- package/dist/server/handlers/auth.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/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/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/package.json +4 -4
- 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
|
@@ -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 processorGraphEntrySchema,\n processorPhaseSchema,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AS;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,CAAC;AAMD,MAAM,uBAA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AE,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,oBAAoB;CAC9C,aAAa,EAAE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nB,SAAS,EAAE,OAAO;AACpB,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mastra/server",
|
|
3
|
-
"version": "1.75.0-alpha.
|
|
3
|
+
"version": "1.75.0-alpha.2",
|
|
4
4
|
"description": "",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"files": [
|
|
@@ -116,15 +116,15 @@
|
|
|
116
116
|
"vitest": "4.1.11",
|
|
117
117
|
"zod": "^4.6.4",
|
|
118
118
|
"zod-to-ts": "^2.1.0",
|
|
119
|
-
"@internal/core": "0.1.2",
|
|
120
119
|
"@internal/lint": "0.0.140",
|
|
120
|
+
"@internal/test-utils": "0.0.76",
|
|
121
|
+
"@internal/core": "0.1.2",
|
|
121
122
|
"@internal/storage-test-utils": "0.0.136",
|
|
122
123
|
"@internal/types-builder": "0.0.115",
|
|
123
124
|
"@internal/voice": "0.0.38",
|
|
124
125
|
"@mastra/agent-builder": "1.1.26-alpha.1",
|
|
125
126
|
"@mastra/schema-compat": "1.3.13",
|
|
126
|
-
"@
|
|
127
|
-
"@mastra/core": "1.75.0-alpha.1"
|
|
127
|
+
"@mastra/core": "1.75.0-alpha.2"
|
|
128
128
|
},
|
|
129
129
|
"homepage": "https://mastra.ai",
|
|
130
130
|
"repository": {
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"agent-versions-BA8ug-Iy.js","names":[],"sources":["../src/server/schemas/agent-versions.ts"],"sourcesContent":["import { z } from 'zod/v4';\nimport { defaultOptionsSchema } from './default-options';\nimport { serializedMemoryConfigSchema } from './memory-config';\nimport {\n scorerConfigSchema,\n instructionsSchema,\n conditionalFieldSchema,\n modelConfigSchema,\n toolConfigSchema,\n toolsConfigSchema,\n storedProcessorGraphSchema,\n} from './stored-agents';\nimport {\n listVersionsQuerySchema,\n compareVersionsQuerySchema,\n createVersionBodySchema,\n activateVersionResponseSchema,\n deleteVersionResponseSchema,\n versionDiffEntrySchema,\n createListVersionsResponseSchema,\n createCompareVersionsResponseSchema,\n} from './version-common';\n\nconst mcpClientToolsConfigSchema = z.object({\n tools: z.record(z.string(), toolConfigSchema).optional(),\n});\n\n// Re-export shared schemas for backwards compat\nexport {\n listVersionsQuerySchema,\n compareVersionsQuerySchema,\n createVersionBodySchema,\n activateVersionResponseSchema,\n deleteVersionResponseSchema,\n versionDiffEntrySchema,\n};\n\n// ============================================================================\n// Path Parameter Schemas\n// ============================================================================\n\n/**\n * Path parameters for agent version routes\n */\nexport const agentVersionPathParams = z.object({\n agentId: z.string().describe('Unique identifier for the stored agent'),\n});\n\n/**\n * Path parameters for specific version routes\n */\nexport const versionIdPathParams = z.object({\n agentId: z.string().describe('Unique identifier for the stored agent'),\n versionId: z.string().describe('Unique identifier for the version (UUID)'),\n});\n\n// ============================================================================\n// Response Schemas\n// ============================================================================\n\n/**\n * Agent version object schema (full response)\n * Config fields are top-level on the version (no nested snapshot object).\n * Extends StorageAgentSnapshotType fields.\n */\nexport const agentVersionSchema = z.object({\n id: z.string().describe('Unique identifier for the version (UUID)'),\n agentId: z.string().describe('ID of the agent this version belongs to'),\n versionNumber: z.number().describe('Sequential version number (1, 2, 3, ...)'),\n // Top-level config fields (from StorageAgentSnapshotType)\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 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(serializedMemoryConfigSchema)\n .optional()\n .describe('Memory configuration — 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 requestContextSchema: z\n .record(z.string(), z.unknown())\n .optional()\n .describe('JSON Schema defining valid request context variables'),\n // Version metadata fields\n changedFields: z.array(z.string()).optional().describe('Array of field names that changed from the previous version'),\n changeMessage: z.string().optional().describe('Optional message describing the changes'),\n createdAt: z.coerce.date().describe('When this version was created'),\n});\n\n/**\n * Response for GET /stored/agents/:agentId/versions\n */\nexport const listVersionsResponseSchema = createListVersionsResponseSchema(agentVersionSchema);\n\n/**\n * Response for GET /stored/agents/:agentId/versions/:versionId\n */\nexport const getVersionResponseSchema = agentVersionSchema;\n\n/**\n * Response for POST /stored/agents/:agentId/versions\n */\nexport const createVersionResponseSchema = agentVersionSchema.partial().merge(\n z.object({\n // These fields are always present in a version response\n id: z.string().describe('Unique identifier for the version (UUID)'),\n agentId: z.string().describe('ID of the agent this version belongs to'),\n versionNumber: z.number().describe('Sequential version number (1, 2, 3, ...)'),\n createdAt: z.coerce.date().describe('When this version was created'),\n }),\n);\n\n/**\n * Response for POST /stored/agents/:agentId/versions/:versionId/restore\n */\nexport const restoreVersionResponseSchema = agentVersionSchema.describe(\n 'The newly created version from the restored configuration',\n);\n\n/**\n * Response for GET /stored/agents/:agentId/versions/compare\n */\nexport const compareVersionsResponseSchema: ReturnType<\n typeof createCompareVersionsResponseSchema<typeof agentVersionSchema>\n> = createCompareVersionsResponseSchema(agentVersionSchema);\n"],"mappings":";;;;;AAuBA,MAAM,6BAA6B,EAAE,OAAO,EAC1C,OAAO,EAAE,OAAO,EAAE,OAAO,GAAG,gBAAgB,CAAC,CAAC,SAAS,EACzD,CAAC;;;;AAmBD,MAAa,yBAAyB,EAAE,OAAO,EAC7C,SAAS,EAAE,OAAO,CAAC,CAAC,SAAS,wCAAwC,EACvE,CAAC;;;;AAKD,MAAa,sBAAsB,EAAE,OAAO;CAC1C,SAAS,EAAE,OAAO,CAAC,CAAC,SAAS,wCAAwC;CACrE,WAAW,EAAE,OAAO,CAAC,CAAC,SAAS,0CAA0C;AAC3E,CAAC;;;;;;AAWD,MAAa,qBAAqB,EAAE,OAAO;CACzC,IAAI,EAAE,OAAO,CAAC,CAAC,SAAS,0CAA0C;CAClE,SAAS,EAAE,OAAO,CAAC,CAAC,SAAS,yCAAyC;CACtE,eAAe,EAAE,OAAO,CAAC,CAAC,SAAS,0CAA0C;CAE7E,MAAM,EAAE,OAAO,CAAC,CAAC,SAAS,mBAAmB;CAC7C,aAAa,EAAE,OAAO,CAAC,CAAC,SAAS,CAAC,CAAC,SAAS,0BAA0B;CACtE,cAAc;CACd,OAAO,uBAAuB,iBAAiB,CAAC,CAAC,SAC/C,qEACF;CACA,OAAO,uBAAuB,iBAAiB,CAAC,CAC7C,SAAS,CAAC,CACV,SAAS,6DAA6D;CACzE,gBAAgB,uBAAuB,oBAAoB,CAAC,CACzD,SAAS,CAAC,CACV,SAAS,mEAAmE;CAC/E,WAAW,uBAAuB,EAAE,OAAO,EAAE,OAAO,GAAG,gBAAgB,CAAC,CAAC,CACtE,SAAS,CAAC,CACV,SAAS,yEAAyE;CACrF,QAAQ,uBAAuB,EAAE,OAAO,EAAE,OAAO,GAAG,gBAAgB,CAAC,CAAC,CACnE,SAAS,CAAC,CACV,SAAS,mEAAmE;CAC/E,kBAAkB,uBAAuB,EA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AKA,MAAa,+BAA+B,mBAAmB,SAC7D,2DACF;;;;AAKA,MAAa,gCAET,oCAAoC,kBAAkB"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"agent-versions-BNqDvnn0.cjs","names":["z","toolConfigSchema","instructionsSchema","conditionalFieldSchema","modelConfigSchema","toolsConfigSchema","defaultOptionsSchema","storedProcessorGraphSchema","serializedMemoryConfigSchema","scorerConfigSchema","createListVersionsResponseSchema","createCompareVersionsResponseSchema"],"sources":["../src/server/schemas/agent-versions.ts"],"sourcesContent":["import { z } from 'zod/v4';\nimport { defaultOptionsSchema } from './default-options';\nimport { serializedMemoryConfigSchema } from './memory-config';\nimport {\n scorerConfigSchema,\n instructionsSchema,\n conditionalFieldSchema,\n modelConfigSchema,\n toolConfigSchema,\n toolsConfigSchema,\n storedProcessorGraphSchema,\n} from './stored-agents';\nimport {\n listVersionsQuerySchema,\n compareVersionsQuerySchema,\n createVersionBodySchema,\n activateVersionResponseSchema,\n deleteVersionResponseSchema,\n versionDiffEntrySchema,\n createListVersionsResponseSchema,\n createCompareVersionsResponseSchema,\n} from './version-common';\n\nconst mcpClientToolsConfigSchema = z.object({\n tools: z.record(z.string(), toolConfigSchema).optional(),\n});\n\n// Re-export shared schemas for backwards compat\nexport {\n listVersionsQuerySchema,\n compareVersionsQuerySchema,\n createVersionBodySchema,\n activateVersionResponseSchema,\n deleteVersionResponseSchema,\n versionDiffEntrySchema,\n};\n\n// ============================================================================\n// Path Parameter Schemas\n// ============================================================================\n\n/**\n * Path parameters for agent version routes\n */\nexport const agentVersionPathParams = z.object({\n agentId: z.string().describe('Unique identifier for the stored agent'),\n});\n\n/**\n * Path parameters for specific version routes\n */\nexport const versionIdPathParams = z.object({\n agentId: z.string().describe('Unique identifier for the stored agent'),\n versionId: z.string().describe('Unique identifier for the version (UUID)'),\n});\n\n// ============================================================================\n// Response Schemas\n// ============================================================================\n\n/**\n * Agent version object schema (full response)\n * Config fields are top-level on the version (no nested snapshot object).\n * Extends StorageAgentSnapshotType fields.\n */\nexport const agentVersionSchema = z.object({\n id: z.string().describe('Unique identifier for the version (UUID)'),\n agentId: z.string().describe('ID of the agent this version belongs to'),\n versionNumber: z.number().describe('Sequential version number (1, 2, 3, ...)'),\n // Top-level config fields (from StorageAgentSnapshotType)\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 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(serializedMemoryConfigSchema)\n .optional()\n .describe('Memory configuration — 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 requestContextSchema: z\n .record(z.string(), z.unknown())\n .optional()\n .describe('JSON Schema defining valid request context variables'),\n // Version metadata fields\n changedFields: z.array(z.string()).optional().describe('Array of field names that changed from the previous version'),\n changeMessage: z.string().optional().describe('Optional message describing the changes'),\n createdAt: z.coerce.date().describe('When this version was created'),\n});\n\n/**\n * Response for GET /stored/agents/:agentId/versions\n */\nexport const listVersionsResponseSchema = createListVersionsResponseSchema(agentVersionSchema);\n\n/**\n * Response for GET /stored/agents/:agentId/versions/:versionId\n */\nexport const getVersionResponseSchema = agentVersionSchema;\n\n/**\n * Response for POST /stored/agents/:agentId/versions\n */\nexport const createVersionResponseSchema = agentVersionSchema.partial().merge(\n z.object({\n // These fields are always present in a version response\n id: z.string().describe('Unique identifier for the version (UUID)'),\n agentId: z.string().describe('ID of the agent this version belongs to'),\n versionNumber: z.number().describe('Sequential version number (1, 2, 3, ...)'),\n createdAt: z.coerce.date().describe('When this version was created'),\n }),\n);\n\n/**\n * Response for POST /stored/agents/:agentId/versions/:versionId/restore\n */\nexport const restoreVersionResponseSchema = agentVersionSchema.describe(\n 'The newly created version from the restored configuration',\n);\n\n/**\n * Response for GET /stored/agents/:agentId/versions/compare\n */\nexport const compareVersionsResponseSchema: ReturnType<\n typeof createCompareVersionsResponseSchema<typeof agentVersionSchema>\n> = createCompareVersionsResponseSchema(agentVersionSchema);\n"],"mappings":";;;;;AAuBA,MAAM,6BAA6BA,OAAAA,EAAE,OAAO,EAC1C,OAAOA,OAAAA,EAAE,OAAOA,OAAAA,EAAE,OAAO,GAAGC,sBAAAA,gBAAgB,CAAC,CAAC,SAAS,EACzD,CAAC;;;;AAmBD,MAAa,yBAAyBD,OAAAA,EAAE,OAAO,EAC7C,SAASA,OAAAA,EAAE,OAAO,CAAC,CAAC,SAAS,wCAAwC,EACvE,CAAC;;;;AAKD,MAAa,sBAAsBA,OAAAA,EAAE,OAAO;CAC1C,SAASA,OAAAA,EAAE,OAAO,CAAC,CAAC,SAAS,wCAAwC;CACrE,WAAWA,OAAAA,EAAE,OAAO,CAAC,CAAC,SAAS,0CAA0C;AAC3E,CAAC;;;;;;AAWD,MAAa,qBAAqBA,OAAAA,EAAE,OAAO;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AAAA,oCAAoC,kBAAkB"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"dist-C2u5Kqxy.cjs","names":["SecureJSON","TypeValidationError2","InvalidArgumentError2","APICallError2","APICallError3"],"sources":["../../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@ai-sdk/provider/1.1.3/7d8eaddb7973e5820d04ac18a887c85cc63f173732e3c66432ceefbff819b4ac/node_modules/@ai-sdk/provider/dist/index.mjs","../../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/nanoid/3.3.19/bb8b18de8c5719d31b4e1eca475b7409a05b078fc371f92d1bbba7aa803c85d0/node_modules/nanoid/non-secure/index.js","../../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/secure-json-parse/2.7.0/1f65efb0c6ff2d0f745ac6dfe22202b559993ceecd896afead5fc2c075b2d349/node_modules/secure-json-parse/index.js","../../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@ai-sdk/provider-utils/2.2.8/52151efd10e124b032de4a62b4d25d0e5353c6829a00b02bce7f27fe8c7063b7/node_modules/@ai-sdk/provider-utils/dist/index.mjs"],"sourcesContent":["// src/errors/ai-sdk-error.ts\nvar marker = \"vercel.ai.error\";\nvar symbol = Symbol.for(marker);\nvar _a;\nvar _AISDKError = class _AISDKError extends Error {\n /**\n * Creates an AI SDK Error.\n *\n * @param {Object} params - The parameters for creating the error.\n * @param {string} params.name - The name of the error.\n * @param {string} params.message - The error message.\n * @param {unknown} [params.cause] - The underlying cause of the error.\n */\n constructor({\n name: name14,\n message,\n cause\n }) {\n super(message);\n this[_a] = true;\n this.name = name14;\n this.cause = cause;\n }\n /**\n * Checks if the given error is an AI SDK Error.\n * @param {unknown} error - The error to check.\n * @returns {boolean} True if the error is an AI SDK Error, false otherwise.\n */\n static isInstance(error) {\n return _AISDKError.hasMarker(error, marker);\n }\n static hasMarker(error, marker15) {\n const markerSymbol = Symbol.for(marker15);\n return error != null && typeof error === \"object\" && markerSymbol in error && typeof error[markerSymbol] === \"boolean\" && error[markerSymbol] === true;\n }\n};\n_a = symbol;\nvar AISDKError = _AISDKError;\n\n// src/errors/api-call-error.ts\nvar name = \"AI_APICallError\";\nvar marker2 = `vercel.ai.error.${name}`;\nvar symbol2 = Symbol.for(marker2);\nvar _a2;\nvar APICallError = class extends AISDKError {\n constructor({\n message,\n url,\n requestBodyValues,\n statusCode,\n responseHeaders,\n responseBody,\n cause,\n isRetryable = statusCode != null && (statusCode === 408 || // request timeout\n statusCode === 409 || // conflict\n statusCode === 429 || // too many requests\n statusCode >= 500),\n // server error\n data\n }) {\n super({ name, message, cause });\n this[_a2] = true;\n this.url = url;\n this.requestBodyValues = requestBodyValues;\n this.statusCode = statusCode;\n this.responseHeaders = responseHeaders;\n this.responseBody = responseBody;\n this.isRetryable = isRetryable;\n this.data = data;\n }\n static isInstance(error) {\n return AISDKError.hasMarker(error, marker2);\n }\n};\n_a2 = symbol2;\n\n// src/errors/empty-response-body-error.ts\nvar name2 = \"AI_EmptyResponseBodyError\";\nvar marker3 = `vercel.ai.error.${name2}`;\nvar symbol3 = Symbol.for(marker3);\nvar _a3;\nvar EmptyResponseBodyError = class extends AISDKError {\n // used in isInstance\n constructor({ message = \"Empty response body\" } = {}) {\n super({ name: name2, message });\n this[_a3] = true;\n }\n static isInstance(error) {\n return AISDKError.hasMarker(error, marker3);\n }\n};\n_a3 = symbol3;\n\n// src/errors/get-error-message.ts\nfunction getErrorMessage(error) {\n if (error == null) {\n return \"unknown error\";\n }\n if (typeof error === \"string\") {\n return error;\n }\n if (error instanceof Error) {\n return error.message;\n }\n return JSON.stringify(error);\n}\n\n// src/errors/invalid-argument-error.ts\nvar name3 = \"AI_InvalidArgumentError\";\nvar marker4 = `vercel.ai.error.${name3}`;\nvar symbol4 = Symbol.for(marker4);\nvar _a4;\nvar InvalidArgumentError = class extends AISDKError {\n constructor({\n message,\n cause,\n argument\n }) {\n super({ name: name3, message, cause });\n this[_a4] = true;\n this.argument = argument;\n }\n static isInstance(error) {\n return AISDKError.hasMarker(error, marker4);\n }\n};\n_a4 = symbol4;\n\n// src/errors/invalid-prompt-error.ts\nvar name4 = \"AI_InvalidPromptError\";\nvar marker5 = `vercel.ai.error.${name4}`;\nvar symbol5 = Symbol.for(marker5);\nvar _a5;\nvar InvalidPromptError = class extends AISDKError {\n constructor({\n prompt,\n message,\n cause\n }) {\n super({ name: name4, message: `Invalid prompt: ${message}`, cause });\n this[_a5] = true;\n this.prompt = prompt;\n }\n static isInstance(error) {\n return AISDKError.hasMarker(error, marker5);\n }\n};\n_a5 = symbol5;\n\n// src/errors/invalid-response-data-error.ts\nvar name5 = \"AI_InvalidResponseDataError\";\nvar marker6 = `vercel.ai.error.${name5}`;\nvar symbol6 = Symbol.for(marker6);\nvar _a6;\nvar InvalidResponseDataError = class extends AISDKError {\n constructor({\n data,\n message = `Invalid response data: ${JSON.stringify(data)}.`\n }) {\n super({ name: name5, message });\n this[_a6] = true;\n this.data = data;\n }\n static isInstance(error) {\n return AISDKError.hasMarker(error, marker6);\n }\n};\n_a6 = symbol6;\n\n// src/errors/json-parse-error.ts\nvar name6 = \"AI_JSONParseError\";\nvar marker7 = `vercel.ai.error.${name6}`;\nvar symbol7 = Symbol.for(marker7);\nvar _a7;\nvar JSONParseError = class extends AISDKError {\n constructor({ text, cause }) {\n super({\n name: name6,\n message: `JSON parsing failed: Text: ${text}.\nError message: ${getErrorMessage(cause)}`,\n cause\n });\n this[_a7] = true;\n this.text = text;\n }\n static isInstance(error) {\n return AISDKError.hasMarker(error, marker7);\n }\n};\n_a7 = symbol7;\n\n// src/errors/load-api-key-error.ts\nvar name7 = \"AI_LoadAPIKeyError\";\nvar marker8 = `vercel.ai.error.${name7}`;\nvar symbol8 = Symbol.for(marker8);\nvar _a8;\nvar LoadAPIKeyError = class extends AISDKError {\n // used in isInstance\n constructor({ message }) {\n super({ name: name7, message });\n this[_a8] = true;\n }\n static isInstance(error) {\n return AISDKError.hasMarker(error, marker8);\n }\n};\n_a8 = symbol8;\n\n// src/errors/load-setting-error.ts\nvar name8 = \"AI_LoadSettingError\";\nvar marker9 = `vercel.ai.error.${name8}`;\nvar symbol9 = Symbol.for(marker9);\nvar _a9;\nvar LoadSettingError = class extends AISDKError {\n // used in isInstance\n constructor({ message }) {\n super({ name: name8, message });\n this[_a9] = true;\n }\n static isInstance(error) {\n return AISDKError.hasMarker(error, marker9);\n }\n};\n_a9 = symbol9;\n\n// src/errors/no-content-generated-error.ts\nvar name9 = \"AI_NoContentGeneratedError\";\nvar marker10 = `vercel.ai.error.${name9}`;\nvar symbol10 = Symbol.for(marker10);\nvar _a10;\nvar NoContentGeneratedError = class extends AISDKError {\n // used in isInstance\n constructor({\n message = \"No content generated.\"\n } = {}) {\n super({ name: name9, message });\n this[_a10] = true;\n }\n static isInstance(error) {\n return AISDKError.hasMarker(error, marker10);\n }\n};\n_a10 = symbol10;\n\n// src/errors/no-such-model-error.ts\nvar name10 = \"AI_NoSuchModelError\";\nvar marker11 = `vercel.ai.error.${name10}`;\nvar symbol11 = Symbol.for(marker11);\nvar _a11;\nvar NoSuchModelError = class extends AISDKError {\n constructor({\n errorName = name10,\n modelId,\n modelType,\n message = `No such ${modelType}: ${modelId}`\n }) {\n super({ name: errorName, message });\n this[_a11] = true;\n this.modelId = modelId;\n this.modelType = modelType;\n }\n static isInstance(error) {\n return AISDKError.hasMarker(error, marker11);\n }\n};\n_a11 = symbol11;\n\n// src/errors/too-many-embedding-values-for-call-error.ts\nvar name11 = \"AI_TooManyEmbeddingValuesForCallError\";\nvar marker12 = `vercel.ai.error.${name11}`;\nvar symbol12 = Symbol.for(marker12);\nvar _a12;\nvar TooManyEmbeddingValuesForCallError = class extends AISDKError {\n constructor(options) {\n super({\n name: name11,\n message: `Too many values for a single embedding call. The ${options.provider} model \"${options.modelId}\" can only embed up to ${options.maxEmbeddingsPerCall} values per call, but ${options.values.length} values were provided.`\n });\n this[_a12] = true;\n this.provider = options.provider;\n this.modelId = options.modelId;\n this.maxEmbeddingsPerCall = options.maxEmbeddingsPerCall;\n this.values = options.values;\n }\n static isInstance(error) {\n return AISDKError.hasMarker(error, marker12);\n }\n};\n_a12 = symbol12;\n\n// src/errors/type-validation-error.ts\nvar name12 = \"AI_TypeValidationError\";\nvar marker13 = `vercel.ai.error.${name12}`;\nvar symbol13 = Symbol.for(marker13);\nvar _a13;\nvar _TypeValidationError = class _TypeValidationError extends AISDKError {\n constructor({ value, cause }) {\n super({\n name: name12,\n message: `Type validation failed: Value: ${JSON.stringify(value)}.\nError message: ${getErrorMessage(cause)}`,\n cause\n });\n this[_a13] = true;\n this.value = value;\n }\n static isInstance(error) {\n return AISDKError.hasMarker(error, marker13);\n }\n /**\n * Wraps an error into a TypeValidationError.\n * If the cause is already a TypeValidationError with the same value, it returns the cause.\n * Otherwise, it creates a new TypeValidationError.\n *\n * @param {Object} params - The parameters for wrapping the error.\n * @param {unknown} params.value - The value that failed validation.\n * @param {unknown} params.cause - The original error or cause of the validation failure.\n * @returns {TypeValidationError} A TypeValidationError instance.\n */\n static wrap({\n value,\n cause\n }) {\n return _TypeValidationError.isInstance(cause) && cause.value === value ? cause : new _TypeValidationError({ value, cause });\n }\n};\n_a13 = symbol13;\nvar TypeValidationError = _TypeValidationError;\n\n// src/errors/unsupported-functionality-error.ts\nvar name13 = \"AI_UnsupportedFunctionalityError\";\nvar marker14 = `vercel.ai.error.${name13}`;\nvar symbol14 = Symbol.for(marker14);\nvar _a14;\nvar UnsupportedFunctionalityError = class extends AISDKError {\n constructor({\n functionality,\n message = `'${functionality}' functionality not supported.`\n }) {\n super({ name: name13, message });\n this[_a14] = true;\n this.functionality = functionality;\n }\n static isInstance(error) {\n return AISDKError.hasMarker(error, marker14);\n }\n};\n_a14 = symbol14;\n\n// src/json-value/is-json.ts\nfunction isJSONValue(value) {\n if (value === null || typeof value === \"string\" || typeof value === \"number\" || typeof value === \"boolean\") {\n return true;\n }\n if (Array.isArray(value)) {\n return value.every(isJSONValue);\n }\n if (typeof value === \"object\") {\n return Object.entries(value).every(\n ([key, val]) => typeof key === \"string\" && isJSONValue(val)\n );\n }\n return false;\n}\nfunction isJSONArray(value) {\n return Array.isArray(value) && value.every(isJSONValue);\n}\nfunction isJSONObject(value) {\n return value != null && typeof value === \"object\" && Object.entries(value).every(\n ([key, val]) => typeof key === \"string\" && isJSONValue(val)\n );\n}\nexport {\n AISDKError,\n APICallError,\n EmptyResponseBodyError,\n InvalidArgumentError,\n InvalidPromptError,\n InvalidResponseDataError,\n JSONParseError,\n LoadAPIKeyError,\n LoadSettingError,\n NoContentGeneratedError,\n NoSuchModelError,\n TooManyEmbeddingValuesForCallError,\n TypeValidationError,\n UnsupportedFunctionalityError,\n getErrorMessage,\n isJSONArray,\n isJSONObject,\n isJSONValue\n};\n//# sourceMappingURL=index.mjs.map","let urlAlphabet =\n 'useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict'\n\nlet customAlphabet = (alphabet, defaultSize = 21) => {\n return (size = defaultSize) => {\n let id = ''\n let i = size | 0\n while (i-- > 0) {\n id += alphabet[(Math.random() * alphabet.length) | 0]\n }\n return id\n }\n}\n\nlet nanoid = (size = 21) => {\n let id = ''\n let i = size | 0\n while (i-- > 0) {\n id += urlAlphabet[(Math.random() * 64) | 0]\n }\n return id\n}\n\nexport { nanoid, customAlphabet }\n","'use strict'\n\nconst hasBuffer = typeof Buffer !== 'undefined'\nconst suspectProtoRx = /\"(?:_|\\\\u005[Ff])(?:_|\\\\u005[Ff])(?:p|\\\\u0070)(?:r|\\\\u0072)(?:o|\\\\u006[Ff])(?:t|\\\\u0074)(?:o|\\\\u006[Ff])(?:_|\\\\u005[Ff])(?:_|\\\\u005[Ff])\"\\s*:/\nconst suspectConstructorRx = /\"(?:c|\\\\u0063)(?:o|\\\\u006[Ff])(?:n|\\\\u006[Ee])(?:s|\\\\u0073)(?:t|\\\\u0074)(?:r|\\\\u0072)(?:u|\\\\u0075)(?:c|\\\\u0063)(?:t|\\\\u0074)(?:o|\\\\u006[Ff])(?:r|\\\\u0072)\"\\s*:/\n\nfunction _parse (text, reviver, options) {\n // Normalize arguments\n if (options == null) {\n if (reviver !== null && typeof reviver === 'object') {\n options = reviver\n reviver = undefined\n }\n }\n\n if (hasBuffer && Buffer.isBuffer(text)) {\n text = text.toString()\n }\n\n // BOM checker\n if (text && text.charCodeAt(0) === 0xFEFF) {\n text = text.slice(1)\n }\n\n // Parse normally, allowing exceptions\n const obj = JSON.parse(text, reviver)\n\n // Ignore null and non-objects\n if (obj === null || typeof obj !== 'object') {\n return obj\n }\n\n const protoAction = (options && options.protoAction) || 'error'\n const constructorAction = (options && options.constructorAction) || 'error'\n\n // options: 'error' (default) / 'remove' / 'ignore'\n if (protoAction === 'ignore' && constructorAction === 'ignore') {\n return obj\n }\n\n if (protoAction !== 'ignore' && constructorAction !== 'ignore') {\n if (suspectProtoRx.test(text) === false && suspectConstructorRx.test(text) === false) {\n return obj\n }\n } else if (protoAction !== 'ignore' && constructorAction === 'ignore') {\n if (suspectProtoRx.test(text) === false) {\n return obj\n }\n } else {\n if (suspectConstructorRx.test(text) === false) {\n return obj\n }\n }\n\n // Scan result for proto keys\n return filter(obj, { protoAction, constructorAction, safe: options && options.safe })\n}\n\nfunction filter (obj, { protoAction = 'error', constructorAction = 'error', safe } = {}) {\n let next = [obj]\n\n while (next.length) {\n const nodes = next\n next = []\n\n for (const node of nodes) {\n if (protoAction !== 'ignore' && Object.prototype.hasOwnProperty.call(node, '__proto__')) { // Avoid calling node.hasOwnProperty directly\n if (safe === true) {\n return null\n } else if (protoAction === 'error') {\n throw new SyntaxError('Object contains forbidden prototype property')\n }\n\n delete node.__proto__ // eslint-disable-line no-proto\n }\n\n if (constructorAction !== 'ignore' &&\n Object.prototype.hasOwnProperty.call(node, 'constructor') &&\n Object.prototype.hasOwnProperty.call(node.constructor, 'prototype')) { // Avoid calling node.hasOwnProperty directly\n if (safe === true) {\n return null\n } else if (constructorAction === 'error') {\n throw new SyntaxError('Object contains forbidden prototype property')\n }\n\n delete node.constructor\n }\n\n for (const key in node) {\n const value = node[key]\n if (value && typeof value === 'object') {\n next.push(value)\n }\n }\n }\n }\n return obj\n}\n\nfunction parse (text, reviver, options) {\n const stackTraceLimit = Error.stackTraceLimit\n Error.stackTraceLimit = 0\n try {\n return _parse(text, reviver, options)\n } finally {\n Error.stackTraceLimit = stackTraceLimit\n }\n}\n\nfunction safeParse (text, reviver) {\n const stackTraceLimit = Error.stackTraceLimit\n Error.stackTraceLimit = 0\n try {\n return _parse(text, reviver, { safe: true })\n } catch (_e) {\n return null\n } finally {\n Error.stackTraceLimit = stackTraceLimit\n }\n}\n\nmodule.exports = parse\nmodule.exports.default = parse\nmodule.exports.parse = parse\nmodule.exports.safeParse = safeParse\nmodule.exports.scan = filter\n","// src/combine-headers.ts\nfunction combineHeaders(...headers) {\n return headers.reduce(\n (combinedHeaders, currentHeaders) => ({\n ...combinedHeaders,\n ...currentHeaders != null ? currentHeaders : {}\n }),\n {}\n );\n}\n\n// src/convert-async-iterator-to-readable-stream.ts\nfunction convertAsyncIteratorToReadableStream(iterator) {\n return new ReadableStream({\n /**\n * Called when the consumer wants to pull more data from the stream.\n *\n * @param {ReadableStreamDefaultController<T>} controller - The controller to enqueue data into the stream.\n * @returns {Promise<void>}\n */\n async pull(controller) {\n try {\n const { value, done } = await iterator.next();\n if (done) {\n controller.close();\n } else {\n controller.enqueue(value);\n }\n } catch (error) {\n controller.error(error);\n }\n },\n /**\n * Called when the consumer cancels the stream.\n */\n cancel() {\n }\n });\n}\n\n// src/delay.ts\nasync function delay(delayInMs) {\n return delayInMs == null ? Promise.resolve() : new Promise((resolve2) => setTimeout(resolve2, delayInMs));\n}\n\n// src/event-source-parser-stream.ts\nfunction createEventSourceParserStream() {\n let buffer = \"\";\n let event = void 0;\n let data = [];\n let lastEventId = void 0;\n let retry = void 0;\n function parseLine(line, controller) {\n if (line === \"\") {\n dispatchEvent(controller);\n return;\n }\n if (line.startsWith(\":\")) {\n return;\n }\n const colonIndex = line.indexOf(\":\");\n if (colonIndex === -1) {\n handleField(line, \"\");\n return;\n }\n const field = line.slice(0, colonIndex);\n const valueStart = colonIndex + 1;\n const value = valueStart < line.length && line[valueStart] === \" \" ? line.slice(valueStart + 1) : line.slice(valueStart);\n handleField(field, value);\n }\n function dispatchEvent(controller) {\n if (data.length > 0) {\n controller.enqueue({\n event,\n data: data.join(\"\\n\"),\n id: lastEventId,\n retry\n });\n data = [];\n event = void 0;\n retry = void 0;\n }\n }\n function handleField(field, value) {\n switch (field) {\n case \"event\":\n event = value;\n break;\n case \"data\":\n data.push(value);\n break;\n case \"id\":\n lastEventId = value;\n break;\n case \"retry\":\n const parsedRetry = parseInt(value, 10);\n if (!isNaN(parsedRetry)) {\n retry = parsedRetry;\n }\n break;\n }\n }\n return new TransformStream({\n transform(chunk, controller) {\n const { lines, incompleteLine } = splitLines(buffer, chunk);\n buffer = incompleteLine;\n for (let i = 0; i < lines.length; i++) {\n parseLine(lines[i], controller);\n }\n },\n flush(controller) {\n parseLine(buffer, controller);\n dispatchEvent(controller);\n }\n });\n}\nfunction splitLines(buffer, chunk) {\n const lines = [];\n let currentLine = buffer;\n for (let i = 0; i < chunk.length; ) {\n const char = chunk[i++];\n if (char === \"\\n\") {\n lines.push(currentLine);\n currentLine = \"\";\n } else if (char === \"\\r\") {\n lines.push(currentLine);\n currentLine = \"\";\n if (chunk[i] === \"\\n\") {\n i++;\n }\n } else {\n currentLine += char;\n }\n }\n return { lines, incompleteLine: currentLine };\n}\n\n// src/extract-response-headers.ts\nfunction extractResponseHeaders(response) {\n const headers = {};\n response.headers.forEach((value, key) => {\n headers[key] = value;\n });\n return headers;\n}\n\n// src/generate-id.ts\nimport { InvalidArgumentError } from \"@ai-sdk/provider\";\nimport { customAlphabet } from \"nanoid/non-secure\";\nvar createIdGenerator = ({\n prefix,\n size: defaultSize = 16,\n alphabet = \"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz\",\n separator = \"-\"\n} = {}) => {\n const generator = customAlphabet(alphabet, defaultSize);\n if (prefix == null) {\n return generator;\n }\n if (alphabet.includes(separator)) {\n throw new InvalidArgumentError({\n argument: \"separator\",\n message: `The separator \"${separator}\" must not be part of the alphabet \"${alphabet}\".`\n });\n }\n return (size) => `${prefix}${separator}${generator(size)}`;\n};\nvar generateId = createIdGenerator();\n\n// src/get-error-message.ts\nfunction getErrorMessage(error) {\n if (error == null) {\n return \"unknown error\";\n }\n if (typeof error === \"string\") {\n return error;\n }\n if (error instanceof Error) {\n return error.message;\n }\n return JSON.stringify(error);\n}\n\n// src/get-from-api.ts\nimport { APICallError } from \"@ai-sdk/provider\";\n\n// src/remove-undefined-entries.ts\nfunction removeUndefinedEntries(record) {\n return Object.fromEntries(\n Object.entries(record).filter(([_key, value]) => value != null)\n );\n}\n\n// src/is-abort-error.ts\nfunction isAbortError(error) {\n return error instanceof Error && (error.name === \"AbortError\" || error.name === \"TimeoutError\");\n}\n\n// src/get-from-api.ts\nvar getOriginalFetch = () => globalThis.fetch;\nvar getFromApi = async ({\n url,\n headers = {},\n successfulResponseHandler,\n failedResponseHandler,\n abortSignal,\n fetch = getOriginalFetch()\n}) => {\n try {\n const response = await fetch(url, {\n method: \"GET\",\n headers: removeUndefinedEntries(headers),\n signal: abortSignal\n });\n const responseHeaders = extractResponseHeaders(response);\n if (!response.ok) {\n let errorInformation;\n try {\n errorInformation = await failedResponseHandler({\n response,\n url,\n requestBodyValues: {}\n });\n } catch (error) {\n if (isAbortError(error) || APICallError.isInstance(error)) {\n throw error;\n }\n throw new APICallError({\n message: \"Failed to process error response\",\n cause: error,\n statusCode: response.status,\n url,\n responseHeaders,\n requestBodyValues: {}\n });\n }\n throw errorInformation.value;\n }\n try {\n return await successfulResponseHandler({\n response,\n url,\n requestBodyValues: {}\n });\n } catch (error) {\n if (error instanceof Error) {\n if (isAbortError(error) || APICallError.isInstance(error)) {\n throw error;\n }\n }\n throw new APICallError({\n message: \"Failed to process successful response\",\n cause: error,\n statusCode: response.status,\n url,\n responseHeaders,\n requestBodyValues: {}\n });\n }\n } catch (error) {\n if (isAbortError(error)) {\n throw error;\n }\n if (error instanceof TypeError && error.message === \"fetch failed\") {\n const cause = error.cause;\n if (cause != null) {\n throw new APICallError({\n message: `Cannot connect to API: ${cause.message}`,\n cause,\n url,\n isRetryable: true,\n requestBodyValues: {}\n });\n }\n }\n throw error;\n }\n};\n\n// src/load-api-key.ts\nimport { LoadAPIKeyError } from \"@ai-sdk/provider\";\nfunction loadApiKey({\n apiKey,\n environmentVariableName,\n apiKeyParameterName = \"apiKey\",\n description\n}) {\n if (typeof apiKey === \"string\") {\n return apiKey;\n }\n if (apiKey != null) {\n throw new LoadAPIKeyError({\n message: `${description} API key must be a string.`\n });\n }\n if (typeof process === \"undefined\") {\n throw new LoadAPIKeyError({\n message: `${description} API key is missing. Pass it using the '${apiKeyParameterName}' parameter. Environment variables is not supported in this environment.`\n });\n }\n apiKey = process.env[environmentVariableName];\n if (apiKey == null) {\n throw new LoadAPIKeyError({\n message: `${description} API key is missing. Pass it using the '${apiKeyParameterName}' parameter or the ${environmentVariableName} environment variable.`\n });\n }\n if (typeof apiKey !== \"string\") {\n throw new LoadAPIKeyError({\n message: `${description} API key must be a string. The value of the ${environmentVariableName} environment variable is not a string.`\n });\n }\n return apiKey;\n}\n\n// src/load-optional-setting.ts\nfunction loadOptionalSetting({\n settingValue,\n environmentVariableName\n}) {\n if (typeof settingValue === \"string\") {\n return settingValue;\n }\n if (settingValue != null || typeof process === \"undefined\") {\n return void 0;\n }\n settingValue = process.env[environmentVariableName];\n if (settingValue == null || typeof settingValue !== \"string\") {\n return void 0;\n }\n return settingValue;\n}\n\n// src/load-setting.ts\nimport { LoadSettingError } from \"@ai-sdk/provider\";\nfunction loadSetting({\n settingValue,\n environmentVariableName,\n settingName,\n description\n}) {\n if (typeof settingValue === \"string\") {\n return settingValue;\n }\n if (settingValue != null) {\n throw new LoadSettingError({\n message: `${description} setting must be a string.`\n });\n }\n if (typeof process === \"undefined\") {\n throw new LoadSettingError({\n message: `${description} setting is missing. Pass it using the '${settingName}' parameter. Environment variables is not supported in this environment.`\n });\n }\n settingValue = process.env[environmentVariableName];\n if (settingValue == null) {\n throw new LoadSettingError({\n message: `${description} setting is missing. Pass it using the '${settingName}' parameter or the ${environmentVariableName} environment variable.`\n });\n }\n if (typeof settingValue !== \"string\") {\n throw new LoadSettingError({\n message: `${description} setting must be a string. The value of the ${environmentVariableName} environment variable is not a string.`\n });\n }\n return settingValue;\n}\n\n// src/parse-json.ts\nimport {\n JSONParseError,\n TypeValidationError as TypeValidationError2\n} from \"@ai-sdk/provider\";\nimport SecureJSON from \"secure-json-parse\";\n\n// src/validate-types.ts\nimport { TypeValidationError } from \"@ai-sdk/provider\";\n\n// src/validator.ts\nvar validatorSymbol = Symbol.for(\"vercel.ai.validator\");\nfunction validator(validate) {\n return { [validatorSymbol]: true, validate };\n}\nfunction isValidator(value) {\n return typeof value === \"object\" && value !== null && validatorSymbol in value && value[validatorSymbol] === true && \"validate\" in value;\n}\nfunction asValidator(value) {\n return isValidator(value) ? value : zodValidator(value);\n}\nfunction zodValidator(zodSchema) {\n return validator((value) => {\n const result = zodSchema.safeParse(value);\n return result.success ? { success: true, value: result.data } : { success: false, error: result.error };\n });\n}\n\n// src/validate-types.ts\nfunction validateTypes({\n value,\n schema: inputSchema\n}) {\n const result = safeValidateTypes({ value, schema: inputSchema });\n if (!result.success) {\n throw TypeValidationError.wrap({ value, cause: result.error });\n }\n return result.value;\n}\nfunction safeValidateTypes({\n value,\n schema\n}) {\n const validator2 = asValidator(schema);\n try {\n if (validator2.validate == null) {\n return { success: true, value };\n }\n const result = validator2.validate(value);\n if (result.success) {\n return result;\n }\n return {\n success: false,\n error: TypeValidationError.wrap({ value, cause: result.error })\n };\n } catch (error) {\n return {\n success: false,\n error: TypeValidationError.wrap({ value, cause: error })\n };\n }\n}\n\n// src/parse-json.ts\nfunction parseJSON({\n text,\n schema\n}) {\n try {\n const value = SecureJSON.parse(text);\n if (schema == null) {\n return value;\n }\n return validateTypes({ value, schema });\n } catch (error) {\n if (JSONParseError.isInstance(error) || TypeValidationError2.isInstance(error)) {\n throw error;\n }\n throw new JSONParseError({ text, cause: error });\n }\n}\nfunction safeParseJSON({\n text,\n schema\n}) {\n try {\n const value = SecureJSON.parse(text);\n if (schema == null) {\n return { success: true, value, rawValue: value };\n }\n const validationResult = safeValidateTypes({ value, schema });\n return validationResult.success ? { ...validationResult, rawValue: value } : validationResult;\n } catch (error) {\n return {\n success: false,\n error: JSONParseError.isInstance(error) ? error : new JSONParseError({ text, cause: error })\n };\n }\n}\nfunction isParsableJson(input) {\n try {\n SecureJSON.parse(input);\n return true;\n } catch (e) {\n return false;\n }\n}\n\n// src/parse-provider-options.ts\nimport { InvalidArgumentError as InvalidArgumentError2 } from \"@ai-sdk/provider\";\nfunction parseProviderOptions({\n provider,\n providerOptions,\n schema\n}) {\n if ((providerOptions == null ? void 0 : providerOptions[provider]) == null) {\n return void 0;\n }\n const parsedProviderOptions = safeValidateTypes({\n value: providerOptions[provider],\n schema\n });\n if (!parsedProviderOptions.success) {\n throw new InvalidArgumentError2({\n argument: \"providerOptions\",\n message: `invalid ${provider} provider options`,\n cause: parsedProviderOptions.error\n });\n }\n return parsedProviderOptions.value;\n}\n\n// src/post-to-api.ts\nimport { APICallError as APICallError2 } from \"@ai-sdk/provider\";\nvar getOriginalFetch2 = () => globalThis.fetch;\nvar postJsonToApi = async ({\n url,\n headers,\n body,\n failedResponseHandler,\n successfulResponseHandler,\n abortSignal,\n fetch\n}) => postToApi({\n url,\n headers: {\n \"Content-Type\": \"application/json\",\n ...headers\n },\n body: {\n content: JSON.stringify(body),\n values: body\n },\n failedResponseHandler,\n successfulResponseHandler,\n abortSignal,\n fetch\n});\nvar postFormDataToApi = async ({\n url,\n headers,\n formData,\n failedResponseHandler,\n successfulResponseHandler,\n abortSignal,\n fetch\n}) => postToApi({\n url,\n headers,\n body: {\n content: formData,\n values: Object.fromEntries(formData.entries())\n },\n failedResponseHandler,\n successfulResponseHandler,\n abortSignal,\n fetch\n});\nvar postToApi = async ({\n url,\n headers = {},\n body,\n successfulResponseHandler,\n failedResponseHandler,\n abortSignal,\n fetch = getOriginalFetch2()\n}) => {\n try {\n const response = await fetch(url, {\n method: \"POST\",\n headers: removeUndefinedEntries(headers),\n body: body.content,\n signal: abortSignal\n });\n const responseHeaders = extractResponseHeaders(response);\n if (!response.ok) {\n let errorInformation;\n try {\n errorInformation = await failedResponseHandler({\n response,\n url,\n requestBodyValues: body.values\n });\n } catch (error) {\n if (isAbortError(error) || APICallError2.isInstance(error)) {\n throw error;\n }\n throw new APICallError2({\n message: \"Failed to process error response\",\n cause: error,\n statusCode: response.status,\n url,\n responseHeaders,\n requestBodyValues: body.values\n });\n }\n throw errorInformation.value;\n }\n try {\n return await successfulResponseHandler({\n response,\n url,\n requestBodyValues: body.values\n });\n } catch (error) {\n if (error instanceof Error) {\n if (isAbortError(error) || APICallError2.isInstance(error)) {\n throw error;\n }\n }\n throw new APICallError2({\n message: \"Failed to process successful response\",\n cause: error,\n statusCode: response.status,\n url,\n responseHeaders,\n requestBodyValues: body.values\n });\n }\n } catch (error) {\n if (isAbortError(error)) {\n throw error;\n }\n if (error instanceof TypeError && error.message === \"fetch failed\") {\n const cause = error.cause;\n if (cause != null) {\n throw new APICallError2({\n message: `Cannot connect to API: ${cause.message}`,\n cause,\n url,\n requestBodyValues: body.values,\n isRetryable: true\n // retry when network error\n });\n }\n }\n throw error;\n }\n};\n\n// src/resolve.ts\nasync function resolve(value) {\n if (typeof value === \"function\") {\n value = value();\n }\n return Promise.resolve(value);\n}\n\n// src/response-handler.ts\nimport { APICallError as APICallError3, EmptyResponseBodyError } from \"@ai-sdk/provider\";\nvar createJsonErrorResponseHandler = ({\n errorSchema,\n errorToMessage,\n isRetryable\n}) => async ({ response, url, requestBodyValues }) => {\n const responseBody = await response.text();\n const responseHeaders = extractResponseHeaders(response);\n if (responseBody.trim() === \"\") {\n return {\n responseHeaders,\n value: new APICallError3({\n message: response.statusText,\n url,\n requestBodyValues,\n statusCode: response.status,\n responseHeaders,\n responseBody,\n isRetryable: isRetryable == null ? void 0 : isRetryable(response)\n })\n };\n }\n try {\n const parsedError = parseJSON({\n text: responseBody,\n schema: errorSchema\n });\n return {\n responseHeaders,\n value: new APICallError3({\n message: errorToMessage(parsedError),\n url,\n requestBodyValues,\n statusCode: response.status,\n responseHeaders,\n responseBody,\n data: parsedError,\n isRetryable: isRetryable == null ? void 0 : isRetryable(response, parsedError)\n })\n };\n } catch (parseError) {\n return {\n responseHeaders,\n value: new APICallError3({\n message: response.statusText,\n url,\n requestBodyValues,\n statusCode: response.status,\n responseHeaders,\n responseBody,\n isRetryable: isRetryable == null ? void 0 : isRetryable(response)\n })\n };\n }\n};\nvar createEventSourceResponseHandler = (chunkSchema) => async ({ response }) => {\n const responseHeaders = extractResponseHeaders(response);\n if (response.body == null) {\n throw new EmptyResponseBodyError({});\n }\n return {\n responseHeaders,\n value: response.body.pipeThrough(new TextDecoderStream()).pipeThrough(createEventSourceParserStream()).pipeThrough(\n new TransformStream({\n transform({ data }, controller) {\n if (data === \"[DONE]\") {\n return;\n }\n controller.enqueue(\n safeParseJSON({\n text: data,\n schema: chunkSchema\n })\n );\n }\n })\n )\n };\n};\nvar createJsonStreamResponseHandler = (chunkSchema) => async ({ response }) => {\n const responseHeaders = extractResponseHeaders(response);\n if (response.body == null) {\n throw new EmptyResponseBodyError({});\n }\n let buffer = \"\";\n return {\n responseHeaders,\n value: response.body.pipeThrough(new TextDecoderStream()).pipeThrough(\n new TransformStream({\n transform(chunkText, controller) {\n if (chunkText.endsWith(\"\\n\")) {\n controller.enqueue(\n safeParseJSON({\n text: buffer + chunkText,\n schema: chunkSchema\n })\n );\n buffer = \"\";\n } else {\n buffer += chunkText;\n }\n }\n })\n )\n };\n};\nvar createJsonResponseHandler = (responseSchema) => async ({ response, url, requestBodyValues }) => {\n const responseBody = await response.text();\n const parsedResult = safeParseJSON({\n text: responseBody,\n schema: responseSchema\n });\n const responseHeaders = extractResponseHeaders(response);\n if (!parsedResult.success) {\n throw new APICallError3({\n message: \"Invalid JSON response\",\n cause: parsedResult.error,\n statusCode: response.status,\n responseHeaders,\n responseBody,\n url,\n requestBodyValues\n });\n }\n return {\n responseHeaders,\n value: parsedResult.value,\n rawValue: parsedResult.rawValue\n };\n};\nvar createBinaryResponseHandler = () => async ({ response, url, requestBodyValues }) => {\n const responseHeaders = extractResponseHeaders(response);\n if (!response.body) {\n throw new APICallError3({\n message: \"Response body is empty\",\n url,\n requestBodyValues,\n statusCode: response.status,\n responseHeaders,\n responseBody: void 0\n });\n }\n try {\n const buffer = await response.arrayBuffer();\n return {\n responseHeaders,\n value: new Uint8Array(buffer)\n };\n } catch (error) {\n throw new APICallError3({\n message: \"Failed to read response as array buffer\",\n url,\n requestBodyValues,\n statusCode: response.status,\n responseHeaders,\n responseBody: void 0,\n cause: error\n });\n }\n};\nvar createStatusCodeErrorResponseHandler = () => async ({ response, url, requestBodyValues }) => {\n const responseHeaders = extractResponseHeaders(response);\n const responseBody = await response.text();\n return {\n responseHeaders,\n value: new APICallError3({\n message: response.statusText,\n url,\n requestBodyValues,\n statusCode: response.status,\n responseHeaders,\n responseBody\n })\n };\n};\n\n// src/uint8-utils.ts\nvar { btoa, atob } = globalThis;\nfunction convertBase64ToUint8Array(base64String) {\n const base64Url = base64String.replace(/-/g, \"+\").replace(/_/g, \"/\");\n const latin1string = atob(base64Url);\n return Uint8Array.from(latin1string, (byte) => byte.codePointAt(0));\n}\nfunction convertUint8ArrayToBase64(array) {\n let latin1string = \"\";\n for (let i = 0; i < array.length; i++) {\n latin1string += String.fromCodePoint(array[i]);\n }\n return btoa(latin1string);\n}\n\n// src/without-trailing-slash.ts\nfunction withoutTrailingSlash(url) {\n return url == null ? void 0 : url.replace(/\\/$/, \"\");\n}\nexport {\n asValidator,\n combineHeaders,\n convertAsyncIteratorToReadableStream,\n convertBase64ToUint8Array,\n convertUint8ArrayToBase64,\n createBinaryResponseHandler,\n createEventSourceParserStream,\n createEventSourceResponseHandler,\n createIdGenerator,\n createJsonErrorResponseHandler,\n createJsonResponseHandler,\n createJsonStreamResponseHandler,\n createStatusCodeErrorResponseHandler,\n delay,\n extractResponseHeaders,\n generateId,\n getErrorMessage,\n getFromApi,\n isAbortError,\n isParsableJson,\n isValidator,\n loadApiKey,\n loadOptionalSetting,\n loadSetting,\n parseJSON,\n parseProviderOptions,\n postFormDataToApi,\n postJsonToApi,\n postToApi,\n removeUndefinedEntries,\n resolve,\n safeParseJSON,\n safeValidateTypes,\n validateTypes,\n validator,\n validatorSymbol,\n withoutTrailingSlash,\n zodValidator\n};\n//# sourceMappingURL=index.mjs.map"],"x_google_ignoreList":[0,1,2,3],"mappings":";;AACA,IAAI,SAAS;AACb,IAAI,SAAS,OAAO,IAAI,MAAM;AAC9B,IAAI;AACJ,IAAI,cAAc,MAAM,oBAAoB,MAAM;;;;;;;;;CAShD,YAAY,EACV,MAAM,QACN,SACA,SACC;EACD,MAAM,OAAO;EACb,KAAK,MAAM;EACX,KAAK,OAAO;EACZ,KAAK,QAAQ;CACf;;;;;;CAMA,OAAO,WAAW,OAAO;EACvB,OAAO,YAAY,UAAU,OAAO,MAAM;CAC5C;CACA,OAAO,UAAU,OAAO,UAAU;EAChC,MAAM,eAAe,OAAO,IAAI,QAAQ;EACxC,OAAO,SAAS,QAAQ,OAAO,UAAU,YAAY,gBAAgB,SAAS,OAAO,MAAM,kBAAkB,aAAa,MAAM,kBAAkB;CACpJ;AACF;AACA,KAAK;AACL,IAAI,aAAa;AAGjB,IAAI,OAAO;AACX,IAAI,UAAU,mBAAmB;AACjC,IAAI,UAAU,OAAO,IAAI,OAAO;AAChC,IAAI;AACJ,IAAI,eAAe,cAAc,WAAW;CAC1C,YAAY,EACV,SACA,KACA,mBACA,YACA,iBACA,cACA,OACA,cAAc,cAAc,SAAS,eAAe,OACpD,eAAe,OACf,eAAe,OACf,cAAc,MAEd,QACC;EACD,MAAM;GA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