@mastra/server 1.75.0-alpha.0 → 1.75.0-alpha.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (156) hide show
  1. package/dist/{agent-versions-BA8ug-Iy.js → agent-versions-CTAEDQuT.js} +3 -3
  2. package/dist/agent-versions-CTAEDQuT.js.map +1 -0
  3. package/dist/{agent-versions-BNqDvnn0.cjs → agent-versions-RvvNdlZk.cjs} +3 -3
  4. package/dist/agent-versions-RvvNdlZk.cjs.map +1 -0
  5. package/dist/{api-schema-manifest-BmraF-WX.js → api-schema-manifest-B0p6nxU1.js} +2 -2
  6. package/dist/{api-schema-manifest-BmraF-WX.js.map → api-schema-manifest-B0p6nxU1.js.map} +1 -1
  7. package/dist/{api-schema-manifest-Blh5-4VH.cjs → api-schema-manifest-D9_jxxNw.cjs} +2 -2
  8. package/dist/{api-schema-manifest-Blh5-4VH.cjs.map → api-schema-manifest-D9_jxxNw.cjs.map} +1 -1
  9. package/dist/{dist-DH39C5Bz.js → dist-5xXLv6KR.js} +110 -44
  10. package/dist/{dist-DH39C5Bz.js.map → dist-5xXLv6KR.js.map} +1 -1
  11. package/dist/{dist-DJ7t3yBx.js → dist-8fx1_bLF.js} +3 -3
  12. package/dist/{dist-DJ7t3yBx.js.map → dist-8fx1_bLF.js.map} +1 -1
  13. package/dist/{dist-IDt748Ya.cjs → dist-B6rOIYr_.cjs} +110 -44
  14. package/dist/{dist-IDt748Ya.cjs.map → dist-B6rOIYr_.cjs.map} +1 -1
  15. package/dist/{dist-D1rb-p2Y.js → dist-BCTqy9i3.js} +4 -4
  16. package/dist/{dist-D1rb-p2Y.js.map → dist-BCTqy9i3.js.map} +1 -1
  17. package/dist/{dist-DO5NHh-t.cjs → dist-Bw2XgCSY.cjs} +3 -3
  18. package/dist/{dist-DO5NHh-t.cjs.map → dist-Bw2XgCSY.cjs.map} +1 -1
  19. package/dist/{dist-Dx2Qp8Rj.js → dist-Bz4l8I_x.js} +3 -3
  20. package/dist/{dist-Dx2Qp8Rj.js.map → dist-Bz4l8I_x.js.map} +1 -1
  21. package/dist/{dist-DD1mFVAc.js → dist-C5TZXkhS.js} +3 -3
  22. package/dist/dist-C5TZXkhS.js.map +1 -0
  23. package/dist/{dist-B0uCWZUF.cjs → dist-CgemVduI.cjs} +4 -4
  24. package/dist/{dist-B0uCWZUF.cjs.map → dist-CgemVduI.cjs.map} +1 -1
  25. package/dist/{dist-Bl3UrwJs.js → dist-D1oSHJhK.js} +3 -3
  26. package/dist/{dist-Bl3UrwJs.js.map → dist-D1oSHJhK.js.map} +1 -1
  27. package/dist/{dist-vM0zJcP5.cjs → dist-D5O8s1u2.cjs} +3 -3
  28. package/dist/{dist-vM0zJcP5.cjs.map → dist-D5O8s1u2.cjs.map} +1 -1
  29. package/dist/{dist-BQ0VOLA9.cjs → dist-D5mpJHHH.cjs} +3 -3
  30. package/dist/{dist-BQ0VOLA9.cjs.map → dist-D5mpJHHH.cjs.map} +1 -1
  31. package/dist/{dist-CkFmsB2E.cjs → dist-UACuV_1t.cjs} +3 -3
  32. package/dist/{dist-CkFmsB2E.cjs.map → dist-UACuV_1t.cjs.map} +1 -1
  33. package/dist/{dist-DiEECrlS.js → dist-_RnqhYfY.js} +3 -3
  34. package/dist/{dist-DiEECrlS.js.map → dist-_RnqhYfY.js.map} +1 -1
  35. package/dist/{dist-C2u5Kqxy.cjs → dist-tYOY8gEs.cjs} +3 -3
  36. package/dist/dist-tYOY8gEs.cjs.map +1 -0
  37. package/dist/docs/SKILL.md +1 -1
  38. package/dist/docs/assets/SOURCE_MAP.json +1 -1
  39. package/dist/{helpers-8jl_xtug.cjs → helpers-DhvWjBBJ.cjs} +36 -20
  40. package/dist/helpers-DhvWjBBJ.cjs.map +1 -0
  41. package/dist/{helpers-610L0lwQ.js → helpers-DudW6a17.js} +36 -20
  42. package/dist/helpers-DudW6a17.js.map +1 -0
  43. package/dist/{routes-CcjyQojv.cjs → routes-BuiLQCOQ.cjs} +3 -3
  44. package/dist/{routes-CcjyQojv.cjs.map → routes-BuiLQCOQ.cjs.map} +1 -1
  45. package/dist/{routes-Boe1UThy.js → routes-CJygX0-a.js} +3 -3
  46. package/dist/{routes-Boe1UThy.js.map → routes-CJygX0-a.js.map} +1 -1
  47. package/dist/{schedules-DTYwAXI_.cjs → schedules-Buunf_MT.cjs} +11 -5
  48. package/dist/schedules-Buunf_MT.cjs.map +1 -0
  49. package/dist/{schedules-Cv3CVT2a.js → schedules-OiPV0jLY.js} +11 -5
  50. package/dist/schedules-OiPV0jLY.js.map +1 -0
  51. package/dist/{scorer-versions-nip3xSwF.cjs → scorer-versions-BfGNw7Wp.cjs} +2 -2
  52. package/dist/{scorer-versions-nip3xSwF.cjs.map → scorer-versions-BfGNw7Wp.cjs.map} +1 -1
  53. package/dist/{scorer-versions-CscApWzu.js → scorer-versions-gXsdWw0V.js} +2 -2
  54. package/dist/{scorer-versions-CscApWzu.js.map → scorer-versions-gXsdWw0V.js.map} +1 -1
  55. package/dist/server/auth/helpers.d.ts.map +1 -1
  56. package/dist/server/auth/index.cjs +1 -1
  57. package/dist/server/auth/index.js +1 -1
  58. package/dist/server/handlers/agent-builder.cjs +1 -1
  59. package/dist/server/handlers/agent-builder.js +1 -1
  60. package/dist/server/handlers/agent-controller.cjs +1 -1
  61. package/dist/server/handlers/agent-controller.js +1 -1
  62. package/dist/server/handlers/agent-versions.cjs +1 -1
  63. package/dist/server/handlers/agent-versions.d.ts +998 -22
  64. package/dist/server/handlers/agent-versions.d.ts.map +1 -1
  65. package/dist/server/handlers/agent-versions.js +1 -1
  66. package/dist/server/handlers/agents.cjs +18 -2
  67. package/dist/server/handlers/agents.cjs.map +1 -1
  68. package/dist/server/handlers/agents.d.ts +248 -4
  69. package/dist/server/handlers/agents.d.ts.map +1 -1
  70. package/dist/server/handlers/agents.js +18 -2
  71. package/dist/server/handlers/agents.js.map +1 -1
  72. package/dist/server/handlers/auth.cjs +1 -1
  73. package/dist/server/handlers/auth.js +1 -1
  74. package/dist/server/handlers/conversations.cjs +1 -1
  75. package/dist/server/handlers/conversations.js +1 -1
  76. package/dist/server/handlers/logs.cjs +1 -1
  77. package/dist/server/handlers/logs.js +1 -1
  78. package/dist/server/handlers/memory.cjs +1 -1
  79. package/dist/server/handlers/memory.js +1 -1
  80. package/dist/server/handlers/observability-new-endpoints.d.ts +35 -3
  81. package/dist/server/handlers/observability-new-endpoints.d.ts.map +1 -1
  82. package/dist/server/handlers/plans.cjs +1 -1
  83. package/dist/server/handlers/plans.js +1 -1
  84. package/dist/server/handlers/responses.cjs +1 -1
  85. package/dist/server/handlers/responses.js +1 -1
  86. package/dist/server/handlers/responses.storage.cjs +1 -1
  87. package/dist/server/handlers/responses.storage.js +1 -1
  88. package/dist/server/handlers/schedules.cjs +1 -1
  89. package/dist/server/handlers/schedules.d.ts +26 -13
  90. package/dist/server/handlers/schedules.d.ts.map +1 -1
  91. package/dist/server/handlers/schedules.js +1 -1
  92. package/dist/server/handlers/scorer-versions.cjs +1 -1
  93. package/dist/server/handlers/scorer-versions.js +1 -1
  94. package/dist/server/handlers/stored-agent-favorites.cjs +1 -1
  95. package/dist/server/handlers/stored-agent-favorites.js +1 -1
  96. package/dist/server/handlers/stored-agents.cjs +1 -1
  97. package/dist/server/handlers/stored-agents.d.ts +1065 -89
  98. package/dist/server/handlers/stored-agents.d.ts.map +1 -1
  99. package/dist/server/handlers/stored-agents.js +1 -1
  100. package/dist/server/handlers/stored-scorers.cjs +1 -1
  101. package/dist/server/handlers/stored-scorers.js +1 -1
  102. package/dist/server/handlers/system.cjs +1 -1
  103. package/dist/server/handlers/system.js +1 -1
  104. package/dist/server/handlers/tools.cjs +1 -1
  105. package/dist/server/handlers/tools.js +1 -1
  106. package/dist/server/handlers/utils.cjs +2 -1
  107. package/dist/server/handlers/utils.d.ts +6 -0
  108. package/dist/server/handlers/utils.d.ts.map +1 -1
  109. package/dist/server/handlers/utils.js +2 -2
  110. package/dist/server/handlers/workflow-builder.cjs +1 -1
  111. package/dist/server/handlers/workflow-builder.js +1 -1
  112. package/dist/server/handlers/workflows.cjs +1 -1
  113. package/dist/server/handlers/workflows.js +1 -1
  114. package/dist/server/schemas/agent-versions.d.ts +660 -20
  115. package/dist/server/schemas/agent-versions.d.ts.map +1 -1
  116. package/dist/server/schemas/index.cjs +5 -4
  117. package/dist/server/schemas/index.js +5 -5
  118. package/dist/server/schemas/memory-config.d.ts +130 -0
  119. package/dist/server/schemas/memory-config.d.ts.map +1 -1
  120. package/dist/server/schemas/schedules.d.ts +8 -0
  121. package/dist/server/schemas/schedules.d.ts.map +1 -1
  122. package/dist/server/schemas/stored-agents.d.ts +1430 -150
  123. package/dist/server/schemas/stored-agents.d.ts.map +1 -1
  124. package/dist/server/server-adapter/index.cjs +2 -2
  125. package/dist/server/server-adapter/index.js +2 -2
  126. package/dist/server/server-adapter/routes/observability.d.ts +35 -3
  127. package/dist/server/server-adapter/routes/observability.d.ts.map +1 -1
  128. package/dist/{stored-agents-DTgigNRY.cjs → stored-agents-Dmsel7ey.cjs} +46 -14
  129. package/dist/stored-agents-Dmsel7ey.cjs.map +1 -0
  130. package/dist/{stored-agents-CIdYOdK0.js → stored-agents-ts0bWw8l.js} +41 -15
  131. package/dist/stored-agents-ts0bWw8l.js.map +1 -0
  132. package/dist/{stored-scorers-CziNmnC8.cjs → stored-scorers-DoW6lYh8.cjs} +2 -2
  133. package/dist/{stored-scorers-CziNmnC8.cjs.map → stored-scorers-DoW6lYh8.cjs.map} +1 -1
  134. package/dist/{stored-scorers-DrkDvsU8.js → stored-scorers-DySg7-qS.js} +2 -2
  135. package/dist/{stored-scorers-DrkDvsU8.js.map → stored-scorers-DySg7-qS.js.map} +1 -1
  136. package/dist/{utils-aIu3gkhJ.cjs → utils-HqDZJwRc.cjs} +31 -1
  137. package/dist/utils-HqDZJwRc.cjs.map +1 -0
  138. package/dist/{utils-KsERfbhc.js → utils-KcHk7C0D.js} +26 -2
  139. package/dist/utils-KcHk7C0D.js.map +1 -0
  140. package/dist/{workflow-builder-DTcM8ER3.cjs → workflow-builder-BSjQJCVD.cjs} +2 -2
  141. package/dist/{workflow-builder-DTcM8ER3.cjs.map → workflow-builder-BSjQJCVD.cjs.map} +1 -1
  142. package/dist/{workflow-builder-KRSpDol2.js → workflow-builder-DJ48IzXQ.js} +2 -2
  143. package/dist/{workflow-builder-KRSpDol2.js.map → workflow-builder-DJ48IzXQ.js.map} +1 -1
  144. package/package.json +6 -6
  145. package/dist/agent-versions-BA8ug-Iy.js.map +0 -1
  146. package/dist/agent-versions-BNqDvnn0.cjs.map +0 -1
  147. package/dist/dist-C2u5Kqxy.cjs.map +0 -1
  148. package/dist/dist-DD1mFVAc.js.map +0 -1
  149. package/dist/helpers-610L0lwQ.js.map +0 -1
  150. package/dist/helpers-8jl_xtug.cjs.map +0 -1
  151. package/dist/schedules-Cv3CVT2a.js.map +0 -1
  152. package/dist/schedules-DTYwAXI_.cjs.map +0 -1
  153. package/dist/stored-agents-CIdYOdK0.js.map +0 -1
  154. package/dist/stored-agents-DTgigNRY.cjs.map +0 -1
  155. package/dist/utils-KsERfbhc.js.map +0 -1
  156. package/dist/utils-aIu3gkhJ.cjs.map +0 -1
@@ -1,5 +1,5 @@
1
1
  import { t as defaultOptionsSchema } from "./default-options-oSlrqpuP.js";
2
- import { D as toolsConfigSchema, E as toolConfigSchema, T as storedProcessorGraphSchema, f as modelConfigSchema, j as serializedMemoryConfigSchema, l as instructionsSchema, t as conditionalFieldSchema, x as scorerConfigSchema } from "./stored-agents-CIdYOdK0.js";
2
+ import { D as toolsConfigSchema, E as toolConfigSchema, I as storedMemoryRefSchema, T as storedProcessorGraphSchema, f as modelConfigSchema, l as instructionsSchema, t as conditionalFieldSchema, x as scorerConfigSchema } from "./stored-agents-ts0bWw8l.js";
3
3
  import { i as createListVersionsResponseSchema, r as createCompareVersionsResponseSchema } from "./version-common-Co-USxDX.js";
4
4
  import { z } from "zod/v4";
5
5
  //#region src/server/schemas/agent-versions.ts
@@ -36,7 +36,7 @@ const agentVersionSchema = z.object({
36
36
  mcpClients: conditionalFieldSchema(z.record(z.string(), mcpClientToolsConfigSchema)).optional().describe("Map of stored MCP client IDs to their tool configurations — static or conditional"),
37
37
  inputProcessors: conditionalFieldSchema(storedProcessorGraphSchema).optional().describe("Input processor graph — static or conditional"),
38
38
  outputProcessors: conditionalFieldSchema(storedProcessorGraphSchema).optional().describe("Output processor graph — static or conditional"),
39
- memory: conditionalFieldSchema(serializedMemoryConfigSchema).optional().describe("Memory configuration — static or conditional"),
39
+ memory: conditionalFieldSchema(storedMemoryRefSchema).optional().describe("Memory: registered memory reference or inline config — static or conditional"),
40
40
  scorers: conditionalFieldSchema(z.record(z.string(), scorerConfigSchema)).optional().describe("Scorer keys with optional sampling config — static or conditional"),
41
41
  requestContextSchema: z.record(z.string(), z.unknown()).optional().describe("JSON Schema defining valid request context variables"),
42
42
  changedFields: z.array(z.string()).optional().describe("Array of field names that changed from the previous version"),
@@ -71,4 +71,4 @@ const compareVersionsResponseSchema = createCompareVersionsResponseSchema(agentV
71
71
  //#endregion
72
72
  export { getVersionResponseSchema as a, versionIdPathParams as c, createVersionResponseSchema as i, agentVersionSchema as n, listVersionsResponseSchema as o, compareVersionsResponseSchema as r, restoreVersionResponseSchema as s, agentVersionPathParams as t };
73
73
 
74
- //# sourceMappingURL=agent-versions-BA8ug-Iy.js.map
74
+ //# sourceMappingURL=agent-versions-CTAEDQuT.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"agent-versions-CTAEDQuT.js","names":[],"sources":["../src/server/schemas/agent-versions.ts"],"sourcesContent":["import { z } from 'zod/v4';\nimport { defaultOptionsSchema } from './default-options';\nimport { storedMemoryRefSchema } 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(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 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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AAO,KAAK,CAAC,CAAC,SAAS,+BAA+B;AACrE,CAAC,CACH;;;;AAKA,MAAa,+BAA+B,mBAAmB,SAC7D,2DACF;;;;AAKA,MAAa,gCAET,oCAAoC,kBAAkB"}
@@ -1,5 +1,5 @@
1
1
  const require_default_options = require("./default-options-C7tykjLq.cjs");
2
- const require_stored_agents = require("./stored-agents-DTgigNRY.cjs");
2
+ const require_stored_agents = require("./stored-agents-Dmsel7ey.cjs");
3
3
  const require_version_common = require("./version-common-Bu42Y2QN.cjs");
4
4
  let zod_v4 = require("zod/v4");
5
5
  //#region src/server/schemas/agent-versions.ts
@@ -36,7 +36,7 @@ const agentVersionSchema = zod_v4.z.object({
36
36
  mcpClients: require_stored_agents.conditionalFieldSchema(zod_v4.z.record(zod_v4.z.string(), mcpClientToolsConfigSchema)).optional().describe("Map of stored MCP client IDs to their tool configurations — static or conditional"),
37
37
  inputProcessors: require_stored_agents.conditionalFieldSchema(require_stored_agents.storedProcessorGraphSchema).optional().describe("Input processor graph — static or conditional"),
38
38
  outputProcessors: require_stored_agents.conditionalFieldSchema(require_stored_agents.storedProcessorGraphSchema).optional().describe("Output processor graph — static or conditional"),
39
- memory: require_stored_agents.conditionalFieldSchema(require_stored_agents.serializedMemoryConfigSchema).optional().describe("Memory configuration — static or conditional"),
39
+ memory: require_stored_agents.conditionalFieldSchema(require_stored_agents.storedMemoryRefSchema).optional().describe("Memory: registered memory reference or inline config — static or conditional"),
40
40
  scorers: require_stored_agents.conditionalFieldSchema(zod_v4.z.record(zod_v4.z.string(), require_stored_agents.scorerConfigSchema)).optional().describe("Scorer keys with optional sampling config — static or conditional"),
41
41
  requestContextSchema: zod_v4.z.record(zod_v4.z.string(), zod_v4.z.unknown()).optional().describe("JSON Schema defining valid request context variables"),
42
42
  changedFields: zod_v4.z.array(zod_v4.z.string()).optional().describe("Array of field names that changed from the previous version"),
@@ -118,4 +118,4 @@ Object.defineProperty(exports, "versionIdPathParams", {
118
118
  }
119
119
  });
120
120
 
121
- //# sourceMappingURL=agent-versions-BNqDvnn0.cjs.map
121
+ //# sourceMappingURL=agent-versions-RvvNdlZk.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"agent-versions-RvvNdlZk.cjs","names":["z","toolConfigSchema","instructionsSchema","conditionalFieldSchema","modelConfigSchema","toolsConfigSchema","defaultOptionsSchema","storedProcessorGraphSchema","storedMemoryRefSchema","scorerConfigSchema","createListVersionsResponseSchema","createCompareVersionsResponseSchema"],"sources":["../src/server/schemas/agent-versions.ts"],"sourcesContent":["import { z } from 'zod/v4';\nimport { defaultOptionsSchema } from './default-options';\nimport { storedMemoryRefSchema } 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(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 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;CACzC,IAAI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oC,kBAAkB"}
@@ -1,5 +1,5 @@
1
1
  import { c as schemaToJsonSchema } from "./route-builder-lBil8Cvo.js";
2
- import { t as SERVER_ROUTES } from "./routes-Boe1UThy.js";
2
+ import { t as SERVER_ROUTES } from "./routes-CJygX0-a.js";
3
3
  //#region src/server/server-adapter/api-schema-manifest.ts
4
4
  function convertSchema(schema) {
5
5
  return schema ? schemaToJsonSchema(schema) : void 0;
@@ -52,4 +52,4 @@ function buildApiSchemaManifest(routes = SERVER_ROUTES) {
52
52
  //#endregion
53
53
  export { buildApiSchemaManifest };
54
54
 
55
- //# sourceMappingURL=api-schema-manifest-BmraF-WX.js.map
55
+ //# sourceMappingURL=api-schema-manifest-B0p6nxU1.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"api-schema-manifest-BmraF-WX.js","names":[],"sources":["../src/server/server-adapter/api-schema-manifest.ts"],"sourcesContent":["import type { JSONSchema7 } from '@mastra/schema-compat';\nimport { schemaToJsonSchema } from './openapi-utils';\nimport { SERVER_ROUTES } from './routes/index';\nimport type { ServerRoute } from './routes/index';\n\nexport interface ApiSchemaResponseShape {\n kind: 'array' | 'record' | 'object-property' | 'single' | 'unknown';\n listProperty?: string;\n paginationProperty?: string;\n}\n\nexport interface ApiSchemaManifestRoute {\n method: string;\n path: string;\n responseType: string;\n pathParamSchema?: JSONSchema7;\n queryParamSchema?: JSONSchema7;\n bodySchema?: JSONSchema7;\n responseSchema?: JSONSchema7;\n responseShape: ApiSchemaResponseShape;\n}\n\nexport interface ApiSchemaManifest {\n version: 1;\n routes: ApiSchemaManifestRoute[];\n}\n\nfunction convertSchema(schema: ServerRoute['bodySchema']): JSONSchema7 | undefined {\n return schema ? schemaToJsonSchema(schema) : undefined;\n}\n\nfunction asJsonSchema(value: unknown): JSONSchema7 | undefined {\n return value && typeof value === 'object' && !Array.isArray(value) ? (value as JSONSchema7) : undefined;\n}\n\nfunction schemaType(schema: JSONSchema7 | undefined): JSONSchema7['type'] | undefined {\n const type = schema?.type;\n return Array.isArray(type) ? type.find(Boolean) : type;\n}\n\nfunction inferResponseShape(responseSchema: JSONSchema7 | undefined): ApiSchemaResponseShape {\n if (!responseSchema) return { kind: 'unknown' };\n\n const type = schemaType(responseSchema);\n if (type === 'array') return { kind: 'array' };\n if (type !== 'object') return { kind: 'single' };\n\n const properties =\n responseSchema.properties && !Array.isArray(responseSchema.properties) ? responseSchema.properties : {};\n const propertyNames = Object.keys(properties);\n const paginationProperty = 'page' in properties ? 'page' : 'pagination' in properties ? 'pagination' : undefined;\n const listProperty = Object.entries(properties).find(\n ([, property]) => schemaType(asJsonSchema(property)) === 'array',\n )?.[0];\n\n if (listProperty && (paginationProperty || propertyNames.length <= 2)) {\n return { kind: 'object-property', listProperty, paginationProperty };\n }\n if (responseSchema.additionalProperties && propertyNames.length === 0) return { kind: 'record' };\n return { kind: 'single' };\n}\n\nfunction isManifestRoute(route: ServerRoute): boolean {\n return route.responseType === 'json' && !route.deprecated;\n}\n\nexport function buildApiSchemaManifest(routes: readonly ServerRoute[] = SERVER_ROUTES): ApiSchemaManifest {\n return {\n version: 1,\n routes: routes.filter(isManifestRoute).map(route => {\n const responseSchema = convertSchema(route.responseSchema);\n return {\n method: route.method,\n path: route.path,\n responseType: route.responseType,\n pathParamSchema: convertSchema(route.pathParamSchema),\n queryParamSchema: convertSchema(route.queryParamSchema),\n bodySchema: convertSchema(route.bodySchema),\n responseSchema,\n responseShape: inferResponseShape(responseSchema),\n };\n }),\n };\n}\n"],"mappings":";;;AA2BA,SAAS,cAAc,QAA4D;CACjF,OAAO,SAAS,mBAAmB,MAAM,IAAI,KAAA;AAC/C;AAEA,SAAS,aAAa,OAAyC;CAC7D,OAAO,SAAS,OAAO,UAAU,YAAY,CAAC,MAAM,QAAQ,KAAK,IAAK,QAAwB,KAAA;AAChG;AAEA,SAAS,WAAW,QAAkE;CACpF,MAAM,OAAO,QAAQ;CACrB,OAAO,MAAM,QAAQ,IAAI,IAAI,KAAK,KAAK,OAAO,IAAI;AACpD;A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api-schema-manifest.ts"],"sourcesContent":["import type { JSONSchema7 } from '@mastra/schema-compat';\nimport { schemaToJsonSchema } from './openapi-utils';\nimport { SERVER_ROUTES } from './routes/index';\nimport type { ServerRoute } from './routes/index';\n\nexport interface ApiSchemaResponseShape {\n kind: 'array' | 'record' | 'object-property' | 'single' | 'unknown';\n listProperty?: string;\n paginationProperty?: string;\n}\n\nexport interface ApiSchemaManifestRoute {\n method: string;\n path: string;\n responseType: string;\n pathParamSchema?: JSONSchema7;\n queryParamSchema?: JSONSchema7;\n bodySchema?: JSONSchema7;\n responseSchema?: JSONSchema7;\n responseShape: ApiSchemaResponseShape;\n}\n\nexport interface ApiSchemaManifest {\n version: 1;\n routes: ApiSchemaManifestRoute[];\n}\n\nfunction convertSchema(schema: ServerRoute['bodySchema']): JSONSchema7 | undefined {\n return schema ? schemaToJsonSchema(schema) : undefined;\n}\n\nfunction asJsonSchema(value: unknown): JSONSchema7 | undefined {\n return value && typeof value === 'object' && !Array.isArray(value) ? (value as JSONSchema7) : undefined;\n}\n\nfunction schemaType(schema: JSONSchema7 | undefined): JSONSchema7['type'] | undefined {\n const type = schema?.type;\n return Array.isArray(type) ? type.find(Boolean) : type;\n}\n\nfunction inferResponseShape(responseSchema: JSONSchema7 | undefined): ApiSchemaResponseShape {\n if (!responseSchema) return { kind: 'unknown' };\n\n const type = schemaType(responseSchema);\n if (type === 'array') return { kind: 'array' };\n if (type !== 'object') return { kind: 'single' };\n\n const properties =\n responseSchema.properties && !Array.isArray(responseSchema.properties) ? responseSchema.properties : {};\n const propertyNames = Object.keys(properties);\n const paginationProperty = 'page' in properties ? 'page' : 'pagination' in properties ? 'pagination' : undefined;\n const listProperty = Object.entries(properties).find(\n ([, property]) => schemaType(asJsonSchema(property)) === 'array',\n )?.[0];\n\n if (listProperty && (paginationProperty || propertyNames.length <= 2)) {\n return { kind: 'object-property', listProperty, paginationProperty };\n }\n if (responseSchema.additionalProperties && propertyNames.length === 0) return { kind: 'record' };\n return { kind: 'single' };\n}\n\nfunction isManifestRoute(route: ServerRoute): boolean {\n return route.responseType === 'json' && !route.deprecated;\n}\n\nexport function buildApiSchemaManifest(routes: readonly ServerRoute[] = SERVER_ROUTES): ApiSchemaManifest {\n return {\n version: 1,\n routes: routes.filter(isManifestRoute).map(route => {\n const responseSchema = convertSchema(route.responseSchema);\n return {\n method: route.method,\n path: route.path,\n responseType: route.responseType,\n pathParamSchema: convertSchema(route.pathParamSchema),\n queryParamSchema: convertSchema(route.queryParamSchema),\n bodySchema: convertSchema(route.bodySchema),\n responseSchema,\n responseShape: inferResponseShape(responseSchema),\n };\n }),\n };\n}\n"],"mappings":";;;AA2BA,SAAS,cAAc,QAA4D;CACjF,OAAO,SAAS,mBAAmB,MAAM,IAAI,KAAA;AAC/C;AAEA,SAAS,aAAa,OAAyC;CAC7D,OAAO,SAAS,OAAO,UAAU,YAAY,CAAC,MAAM,QAAQ,KAAK,IAAK,QAAwB,KAAA;AAChG;AAEA,SAAS,WAAW,QAAkE;CACpF,MAAM,OAAO,QAAQ;CACrB,OAAO,MAAM,QAAQ,IAAI,IAAI,KAAK,KAAK,OAAO,IAAI;AACpD;AAEA,SAAS,mBAAmB,gBAAiE;CAC3F,IAAI,CAAC,gBAAgB,OAAO,EAAE,MAAM,UAAU;CAE9C,MAAM,OAAO,WAAW,cAAc;CACtC,IAAI,SAAS,SAAS,OAAO,EAAE,MAAM,QAAQ;CAC7C,IAAI,SAAS,UAAU,OAAO,EAAE,MAAM,SAAS;CAE/C,MAAM,aACJ,eAAe,cAAc,CAAC,MAAM,QAAQ,eAAe,UAAU,IAAI,eAAe,aAAa,CAAC;CACxG,MAAM,gBAAgB,OAAO,KAAK,UAAU;CAC5C,MAAM,qBAAqB,UAAU,aAAa,SAAS,gBAAgB,aAAa,eAAe,KAAA;CACvG,MAAM,eAAe,OAAO,QAAQ,UAAU,CAAC,CAAC,MAC7C,GAAG,cAAc,WAAW,aAAa,QAAQ,CAAC,MAAM,OAC3D,CAAC,GAAG;CAEJ,IAAI,iBAAiB,sBAAsB,cAAc,UAAU,IACjE,OAAO;EAAE,MAAM;EAAmB;EAAc;CAAmB;CAErE,IAAI,eAAe,wBAAwB,cAAc,WAAW,GAAG,OAAO,EAAE,MAAM,SAAS;CAC/F,OAAO,EAAE,MAAM,SAAS;AAC1B;AAEA,SAAS,gBAAgB,OAA6B;CACpD,OAAO,MAAM,iBAAiB,UAAU,CAAC,MAAM;AACjD;AAEA,SAAgB,uBAAuB,SAAiC,eAAkC;CACxG,OAAO;EACL,SAAS;EACT,QAAQ,OAAO,OAAO,eAAe,CAAC,CAAC,KAAI,UAAS;GAClD,MAAM,iBAAiB,cAAc,MAAM,cAAc;GACzD,OAAO;IACL,QAAQ,MAAM;IACd,MAAM,MAAM;IACZ,cAAc,MAAM;IACpB,iBAAiB,cAAc,MAAM,eAAe;IACpD,kBAAkB,cAAc,MAAM,gBAAgB;IACtD,YAAY,cAAc,MAAM,UAAU;IAC1C;IACA,eAAe,mBAAmB,cAAc;GAClD;EACF,CAAC;CACH;AACF"}
@@ -1,6 +1,6 @@
1
1
  require("./rolldown-runtime-Bd6kNlEP.cjs");
2
2
  const require_route_builder = require("./route-builder-2yrD15TL.cjs");
3
- const require_routes = require("./routes-CcjyQojv.cjs");
3
+ const require_routes = require("./routes-BuiLQCOQ.cjs");
4
4
  //#region src/server/server-adapter/api-schema-manifest.ts
5
5
  function convertSchema(schema) {
6
6
  return schema ? require_route_builder.schemaToJsonSchema(schema) : void 0;
@@ -53,4 +53,4 @@ function buildApiSchemaManifest(routes = require_routes.SERVER_ROUTES) {
53
53
  //#endregion
54
54
  exports.buildApiSchemaManifest = buildApiSchemaManifest;
55
55
 
56
- //# sourceMappingURL=api-schema-manifest-Blh5-4VH.cjs.map
56
+ //# sourceMappingURL=api-schema-manifest-D9_jxxNw.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"api-schema-manifest-Blh5-4VH.cjs","names":["schemaToJsonSchema","SERVER_ROUTES"],"sources":["../src/server/server-adapter/api-schema-manifest.ts"],"sourcesContent":["import type { JSONSchema7 } from '@mastra/schema-compat';\nimport { schemaToJsonSchema } from './openapi-utils';\nimport { SERVER_ROUTES } from './routes/index';\nimport type { ServerRoute } from './routes/index';\n\nexport interface ApiSchemaResponseShape {\n kind: 'array' | 'record' | 'object-property' | 'single' | 'unknown';\n listProperty?: string;\n paginationProperty?: string;\n}\n\nexport interface ApiSchemaManifestRoute {\n method: string;\n path: string;\n responseType: string;\n pathParamSchema?: JSONSchema7;\n queryParamSchema?: JSONSchema7;\n bodySchema?: JSONSchema7;\n responseSchema?: JSONSchema7;\n responseShape: ApiSchemaResponseShape;\n}\n\nexport interface ApiSchemaManifest {\n version: 1;\n routes: ApiSchemaManifestRoute[];\n}\n\nfunction convertSchema(schema: ServerRoute['bodySchema']): JSONSchema7 | undefined {\n return schema ? schemaToJsonSchema(schema) : undefined;\n}\n\nfunction asJsonSchema(value: unknown): JSONSchema7 | undefined {\n return value && typeof value === 'object' && !Array.isArray(value) ? (value as JSONSchema7) : undefined;\n}\n\nfunction schemaType(schema: JSONSchema7 | undefined): JSONSchema7['type'] | undefined {\n const type = schema?.type;\n return Array.isArray(type) ? type.find(Boolean) : type;\n}\n\nfunction inferResponseShape(responseSchema: JSONSchema7 | undefined): ApiSchemaResponseShape {\n if (!responseSchema) return { kind: 'unknown' };\n\n const type = schemaType(responseSchema);\n if (type === 'array') return { kind: 'array' };\n if (type !== 'object') return { kind: 'single' };\n\n const properties =\n responseSchema.properties && !Array.isArray(responseSchema.properties) ? responseSchema.properties : {};\n const propertyNames = Object.keys(properties);\n const paginationProperty = 'page' in properties ? 'page' : 'pagination' in properties ? 'pagination' : undefined;\n const listProperty = Object.entries(properties).find(\n ([, property]) => schemaType(asJsonSchema(property)) === 'array',\n )?.[0];\n\n if (listProperty && (paginationProperty || propertyNames.length <= 2)) {\n return { kind: 'object-property', listProperty, paginationProperty };\n }\n if (responseSchema.additionalProperties && propertyNames.length === 0) return { kind: 'record' };\n return { kind: 'single' };\n}\n\nfunction isManifestRoute(route: ServerRoute): boolean {\n return route.responseType === 'json' && !route.deprecated;\n}\n\nexport function buildApiSchemaManifest(routes: readonly ServerRoute[] = SERVER_ROUTES): ApiSchemaManifest {\n return {\n version: 1,\n routes: routes.filter(isManifestRoute).map(route => {\n const responseSchema = convertSchema(route.responseSchema);\n return {\n method: route.method,\n path: route.path,\n responseType: route.responseType,\n pathParamSchema: convertSchema(route.pathParamSchema),\n queryParamSchema: convertSchema(route.queryParamSchema),\n bodySchema: convertSchema(route.bodySchema),\n responseSchema,\n responseShape: inferResponseShape(responseSchema),\n };\n }),\n };\n}\n"],"mappings":";;;;AA2BA,SAAS,cAAc,QAA4D;CACjF,OAAO,SAASA,sBAAAA,mBAAmB,MAAM,IAAI,KAAA;AAC/C;AAEA,SAAS,aAAa,OAAyC;CAC7D,OAAO,SAAS,OAAO,UAAU,YAAY,CAAC,MAAM,QAAQ,KAAK,IAAK,QAAwB,KAAA;AAChG;AAEA,SAAS,WAAW,QAAkE;CACpF,MAAM,OAAO,QAAQ;CACrB,OAAO,MAAM,QAAQ,IAAI,IAAI,KAAK,KAAK,OAAO,IAAI;AACpD;AAEA,SAAS,mBAAmB,gBAAiE;CAC3F,IAAI,CAAC,gBAAgB,OAAO,EAAE,MAAM,UAAU;CAE9C,MAAM,OAAO,WAAW,cAAc;CACtC,IAAI,SAAS,SAAS,OAAO,EAAE,MAAM,QAAQ;CAC7C,IAAI,SAAS,UAAU,OAAO,EAAE,MAAM,SAAS;CAE/C,MAAM,aACJ,eAAe,cAAc,CAAC,MAAM,QAAQ,eAAe,UAAU,IAAI,eAAe,aAAa,CAAC;CACxG,MAAM,gBAAgB,OAAO,KAAK,UAAU;CAC5C,MAAM,qBAAqB,UAAU,aAAa,SAAS,gBAAgB,aAAa,eAAe,KAAA;CACvG,MAAM,eAAe,OAAO,QAAQ,UAAU,CAAC,CAAC,MAC7C,GAAG,cAAc,WAAW,aAAa,QAAQ,CAAC,MAAM,OAC3D,CAAC,GAAG;CAEJ,IAAI,iBAAiB,sBAAsB,cAAc,UAAU,IACjE,OAAO;EAAE,MAAM;EAAmB;EAAc;CAAmB;CAErE,IAAI,eAAe,wBAAwB,cAAc,WAAW,GAAG,OAAO,EAAE,MAAM,SAAS;CAC/F,OAAO,EAAE,MAAM,SAAS;AAC1B;AAEA,SAAS,gBAAgB,OAA6B;CACpD,OAAO,MAAM,iBAAiB,UAAU,CAAC,MAAM;AACjD;AAEA,SAAgB,uBAAuB,SAAiCC,eAAAA,eAAkC;CACxG,OAAO;EACL,SAAS;EACT,QAAQ,OAAO,OAAO,eAAe,CAAC,CAAC,KAAI,UAAS;GAClD,MAAM,iBAAiB,cAAc,MAAM,cAAc;GACzD,OAAO;IACL,QAAQ,MAAM;IACd,MAAM,MAAM;IACZ,cAAc,MAAM;IACpB,iBAAiB,cAAc,MAAM,eAAe;IACpD,kBAAkB,cAAc,MAAM,gBAAgB;IACtD,YAAY,cAAc,MAAM,UAAU;IAC1C;IACA,eAAe,mBAAmB,cAAc;GAClD;EACF,CAAC;CACH;AACF"}
1
+ {"version":3,"file":"api-schema-manifest-D9_jxxNw.cjs","names":["schemaToJsonSchema","SERVER_ROUTES"],"sources":["../src/server/server-adapter/api-schema-manifest.ts"],"sourcesContent":["import type { JSONSchema7 } from '@mastra/schema-compat';\nimport { schemaToJsonSchema } from './openapi-utils';\nimport { SERVER_ROUTES } from './routes/index';\nimport type { ServerRoute } from './routes/index';\n\nexport interface ApiSchemaResponseShape {\n kind: 'array' | 'record' | 'object-property' | 'single' | 'unknown';\n listProperty?: string;\n paginationProperty?: string;\n}\n\nexport interface ApiSchemaManifestRoute {\n method: string;\n path: string;\n responseType: string;\n pathParamSchema?: JSONSchema7;\n queryParamSchema?: JSONSchema7;\n bodySchema?: JSONSchema7;\n responseSchema?: JSONSchema7;\n responseShape: ApiSchemaResponseShape;\n}\n\nexport interface ApiSchemaManifest {\n version: 1;\n routes: ApiSchemaManifestRoute[];\n}\n\nfunction convertSchema(schema: ServerRoute['bodySchema']): JSONSchema7 | undefined {\n return schema ? schemaToJsonSchema(schema) : undefined;\n}\n\nfunction asJsonSchema(value: unknown): JSONSchema7 | undefined {\n return value && typeof value === 'object' && !Array.isArray(value) ? (value as JSONSchema7) : undefined;\n}\n\nfunction schemaType(schema: JSONSchema7 | undefined): JSONSchema7['type'] | undefined {\n const type = schema?.type;\n return Array.isArray(type) ? type.find(Boolean) : type;\n}\n\nfunction inferResponseShape(responseSchema: JSONSchema7 | undefined): ApiSchemaResponseShape {\n if (!responseSchema) return { kind: 'unknown' };\n\n const type = schemaType(responseSchema);\n if (type === 'array') return { kind: 'array' };\n if (type !== 'object') return { kind: 'single' };\n\n const properties =\n responseSchema.properties && !Array.isArray(responseSchema.properties) ? responseSchema.properties : {};\n const propertyNames = Object.keys(properties);\n const paginationProperty = 'page' in properties ? 'page' : 'pagination' in properties ? 'pagination' : undefined;\n const listProperty = Object.entries(properties).find(\n ([, property]) => schemaType(asJsonSchema(property)) === 'array',\n )?.[0];\n\n if (listProperty && (paginationProperty || propertyNames.length <= 2)) {\n return { kind: 'object-property', listProperty, paginationProperty };\n }\n if (responseSchema.additionalProperties && propertyNames.length === 0) return { kind: 'record' };\n return { kind: 'single' };\n}\n\nfunction isManifestRoute(route: ServerRoute): boolean {\n return route.responseType === 'json' && !route.deprecated;\n}\n\nexport function buildApiSchemaManifest(routes: readonly ServerRoute[] = SERVER_ROUTES): ApiSchemaManifest {\n return {\n version: 1,\n routes: routes.filter(isManifestRoute).map(route => {\n const responseSchema = convertSchema(route.responseSchema);\n return {\n method: route.method,\n path: route.path,\n responseType: route.responseType,\n pathParamSchema: convertSchema(route.pathParamSchema),\n queryParamSchema: convertSchema(route.queryParamSchema),\n bodySchema: convertSchema(route.bodySchema),\n responseSchema,\n responseShape: inferResponseShape(responseSchema),\n };\n }),\n };\n}\n"],"mappings":";;;;AA2BA,SAAS,cAAc,QAA4D;CACjF,OAAO,SAASA,sBAAAA,mBAAmB,MAAM,IAA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d,MAAM,MAAM;IACZ,cAAc,MAAM;IACpB,iBAAiB,cAAc,MAAM,eAAe;IACpD,kBAAkB,cAAc,MAAM,gBAAgB;IACtD,YAAY,cAAc,MAAM,UAAU;IAC1C;IACA,eAAe,mBAAmB,cAAc;GAClD;EACF,CAAC;CACH;AACF"}
@@ -2,7 +2,7 @@ import { o as __toESM$1, t as __commonJSMin$1 } from "./rolldown-runtime-maW3aOI
2
2
  import { n as standardSchemaToJSONSchema, r as toStandardSchema$1, t as isStandardSchemaWithJSON$1 } from "./schema-e0VHpMt0-CvPvLS06.js";
3
3
  import "./schema-Xxr5X5Je.js";
4
4
  import { t as require_sync } from "./sync-BG15Yae1.js";
5
- import { openai } from "./dist-Dx2Qp8Rj.js";
5
+ import { openai } from "./dist-Bz4l8I_x.js";
6
6
  import { createRequire } from "module";
7
7
  import * as z4 from "zod/v4";
8
8
  import { z } from "zod/v4";
@@ -4637,7 +4637,7 @@ function splitLines(text) {
4637
4637
  return result;
4638
4638
  }
4639
4639
  //#endregion
4640
- //#region ../memory/dist/src-BV9eXuMM.js
4640
+ //#region ../memory/dist/src-DPOcJ6r0.js
4641
4641
  var __defProp$3 = Object.defineProperty;
4642
4642
  var __exportAll = (all, no_symbols) => {
4643
4643
  let target = {};
@@ -37682,22 +37682,32 @@ var Memory = class Memory extends MastraMemory {
37682
37682
  if (resourceScope && !resourceId && config?.semanticRecall && vectorSearchString) throw new Error("Memory error: Resource-scoped semantic recall is enabled but no resourceId was provided. Either provide a resourceId or explicitly set semanticRecall.scope to 'thread'.");
37683
37683
  let usage;
37684
37684
  if (config?.semanticRecall && vectorSearchString && this.vector) {
37685
- const result = await this.embedMessageContent(vectorSearchString);
37686
- usage = result.usage;
37687
- const { embeddings, dimension } = result;
37688
- const { indexName } = await this.createEmbeddingIndex(dimension, config);
37689
- await Promise.all(embeddings.map(async (embedding) => {
37690
- if (typeof this.vector === `undefined`) throw new Error(`Tried to query vector index ${indexName} but this Memory instance doesn't have an attached vector db.`);
37691
- const scopeFilter = resourceScope ? { resource_id: resourceId } : { thread_id: threadId };
37692
- const userFilter = typeof config.semanticRecall === "object" ? config.semanticRecall.filter : void 0;
37693
- const combinedFilter = userFilter ? { $and: [scopeFilter, userFilter] } : scopeFilter;
37685
+ const scopeFilter = resourceScope ? { resource_id: resourceId } : { thread_id: threadId };
37686
+ const userFilter = typeof config.semanticRecall === "object" ? config.semanticRecall.filter : void 0;
37687
+ const combinedFilter = userFilter ? { $and: [scopeFilter, userFilter] } : scopeFilter;
37688
+ if (this.isSelfEmbedding) {
37689
+ const { indexName } = await this.createEmbeddingIndex(void 0, config);
37694
37690
  vectorResults.push(...await this.vector.query({
37695
37691
  indexName,
37696
- queryVector: embedding,
37692
+ queryText: vectorSearchString,
37697
37693
  topK: vectorConfig.topK,
37698
37694
  filter: combinedFilter
37699
37695
  }));
37700
- }));
37696
+ } else {
37697
+ const result = await this.embedMessageContent(vectorSearchString);
37698
+ usage = result.usage;
37699
+ const { embeddings, dimension } = result;
37700
+ const { indexName } = await this.createEmbeddingIndex(dimension, config);
37701
+ await Promise.all(embeddings.map(async (embedding) => {
37702
+ if (typeof this.vector === `undefined`) throw new Error(`Tried to query vector index ${indexName} but this Memory instance doesn't have an attached vector db.`);
37703
+ vectorResults.push(...await this.vector.query({
37704
+ indexName,
37705
+ queryVector: embedding,
37706
+ topK: vectorConfig.topK,
37707
+ filter: combinedFilter
37708
+ }));
37709
+ }));
37710
+ }
37701
37711
  }
37702
37712
  const threshold = (typeof config.semanticRecall === "object" ? config.semanticRecall : void 0)?.threshold;
37703
37713
  const filteredVectorResults = threshold !== void 0 ? vectorResults.filter((r) => r.score >= threshold) : vectorResults;
@@ -37855,11 +37865,13 @@ var Memory = class Memory extends MastraMemory {
37855
37865
  if (this.vector) this.trackVectorCleanup(this.deleteThreadVectors(threadId));
37856
37866
  }
37857
37867
  /**
37858
- * Prefix shared by every message index. The index for the default embedding
37859
- * dimension is named with the bare prefix; other dimensions add a suffix.
37868
+ * Prefix shared by every message index. The index for the default embedding dimension is named
37869
+ * with the bare prefix; other dimensions add a dimension suffix, and a store that embeds the
37870
+ * text itself adds its own. Built here rather than read from `getEmbeddingIndexName()`, which
37871
+ * answers for one configuration and so would not match indexes written under another.
37860
37872
  */
37861
37873
  get messageIndexPrefix() {
37862
- return this.getEmbeddingIndexName();
37874
+ return `memory${this.vector?.indexSeparator ?? "_"}messages`;
37863
37875
  }
37864
37876
  /**
37865
37877
  * Prefix shared by every observation index. Each observation index adds a dimension suffix.
@@ -38144,13 +38156,24 @@ ${workingMemory}`;
38144
38156
  if (joined) textForEmbedding = joined;
38145
38157
  }
38146
38158
  if (!textForEmbedding) return;
38147
- const result = await this.embedMessageContent(textForEmbedding);
38148
- dimension = result.dimension;
38149
- if (result.usage?.tokens) totalTokens += result.usage.tokens;
38159
+ let embeddings = [];
38160
+ let documents;
38161
+ let chunks;
38162
+ if (this.isSelfEmbedding) {
38163
+ chunks = this.chunkText(textForEmbedding);
38164
+ documents = chunks;
38165
+ } else {
38166
+ const result = await this.embedMessageContent(textForEmbedding);
38167
+ dimension = result.dimension;
38168
+ if (result.usage?.tokens) totalTokens += result.usage.tokens;
38169
+ embeddings = result.embeddings;
38170
+ chunks = result.chunks;
38171
+ }
38150
38172
  const threadMetadata = message.threadId ? threadMetadataMap.get(message.threadId) || {} : {};
38151
38173
  embeddingData.push({
38152
- embeddings: result.embeddings,
38153
- metadata: result.chunks.map(() => ({
38174
+ embeddings,
38175
+ documents,
38176
+ metadata: chunks.map(() => ({
38154
38177
  ...threadMetadata,
38155
38178
  message_id: message.id,
38156
38179
  thread_id: message.threadId,
@@ -38161,16 +38184,23 @@ ${workingMemory}`;
38161
38184
  }))
38162
38185
  });
38163
38186
  }));
38164
- if (embeddingData.length > 0 && dimension !== void 0) {
38187
+ if (embeddingData.length > 0 && (this.isSelfEmbedding || dimension !== void 0)) {
38165
38188
  if (typeof this.vector === `undefined`) throw new Error(`Tried to upsert embeddings but this Memory instance doesn't have an attached vector db.`);
38166
38189
  const { indexName } = await this.createEmbeddingIndex(dimension, config);
38167
38190
  const allVectors = [];
38168
38191
  const allMetadata = [];
38192
+ const allDocuments = [];
38169
38193
  for (const data of embeddingData) {
38170
38194
  allVectors.push(...data.embeddings);
38195
+ if (data.documents) allDocuments.push(...data.documents);
38171
38196
  allMetadata.push(...data.metadata);
38172
38197
  }
38173
- await this.vector.upsert({
38198
+ if (this.isSelfEmbedding) await this.vector.upsert({
38199
+ indexName,
38200
+ documents: allDocuments,
38201
+ metadata: allMetadata
38202
+ });
38203
+ else await this.vector.upsert({
38174
38204
  indexName,
38175
38205
  vectors: allVectors,
38176
38206
  metadata: allMetadata
@@ -38955,11 +38985,22 @@ Notes:
38955
38985
  }
38956
38986
  }
38957
38987
  if (textForEmbedding) {
38958
- const result = await this.embedMessageContent(textForEmbedding);
38959
- dimension = result.dimension;
38988
+ let embeddings = [];
38989
+ let documents;
38990
+ let chunks;
38991
+ if (this.isSelfEmbedding) {
38992
+ chunks = this.chunkText(textForEmbedding);
38993
+ documents = chunks;
38994
+ } else {
38995
+ const result = await this.embedMessageContent(textForEmbedding);
38996
+ dimension = result.dimension;
38997
+ embeddings = result.embeddings;
38998
+ chunks = result.chunks;
38999
+ }
38960
39000
  embeddingData.push({
38961
- embeddings: result.embeddings,
38962
- metadata: result.chunks.map(() => ({
39001
+ embeddings,
39002
+ documents,
39003
+ metadata: chunks.map(() => ({
38963
39004
  message_id: message.id,
38964
39005
  thread_id: existingMessage.threadId,
38965
39006
  resource_id: existingMessage.resourceId,
@@ -38994,15 +39035,22 @@ Notes:
38994
39035
  } catch {
38995
39036
  this.logger.debug("Failed to clean up old vectors during message update");
38996
39037
  }
38997
- if (embeddingData.length > 0 && dimension !== void 0) {
39038
+ if (embeddingData.length > 0 && (this.isSelfEmbedding || dimension !== void 0)) {
38998
39039
  const { indexName } = await this.createEmbeddingIndex(dimension, config);
38999
39040
  const allVectors = [];
39000
39041
  const allMetadata = [];
39042
+ const allDocuments = [];
39001
39043
  for (const data of embeddingData) {
39002
39044
  allVectors.push(...data.embeddings);
39045
+ if (data.documents) allDocuments.push(...data.documents);
39003
39046
  allMetadata.push(...data.metadata);
39004
39047
  }
39005
- await this.vector.upsert({
39048
+ if (this.isSelfEmbedding) await this.vector.upsert({
39049
+ indexName,
39050
+ documents: allDocuments,
39051
+ metadata: allMetadata
39052
+ });
39053
+ else await this.vector.upsert({
39006
39054
  indexName,
39007
39055
  vectors: allVectors,
39008
39056
  metadata: allMetadata
@@ -39189,7 +39237,7 @@ Notes:
39189
39237
  await this.rollbackCopiedThread(memoryStore, result.thread, "OM clone", false, priorDestinationResourceWm);
39190
39238
  throw error;
39191
39239
  }
39192
- if (this.vector && this.embedder && config.semanticRecall) try {
39240
+ if (this.vector && (this.embedder || this.isSelfEmbedding) && config.semanticRecall) try {
39193
39241
  await this.embedCopiedMessagesInBatches(memoryStore, result, config);
39194
39242
  } catch (error) {
39195
39243
  await this.rollbackCopiedThread(memoryStore, result.thread, "embedding", true, priorDestinationResourceWm);
@@ -39258,7 +39306,7 @@ Notes:
39258
39306
  async updateThreadResourceId({ threadId, resourceId, memoryConfig }) {
39259
39307
  const memoryStore = await this.getMemoryStore();
39260
39308
  const config = this.getMergedThreadConfig(memoryConfig);
39261
- const migratesVectors = Boolean(this.vector && this.embedder && config.semanticRecall);
39309
+ const migratesVectors = Boolean(this.vector && (this.embedder || this.isSelfEmbedding) && config.semanticRecall);
39262
39310
  if (!migratesVectors) {
39263
39311
  const existing = await memoryStore.getThreadById({ threadId });
39264
39312
  if (existing && existing.resourceId === resourceId) return existing;
@@ -39364,7 +39412,7 @@ Notes:
39364
39412
  * This is similar to the embedding logic in saveMessages but operates on already-saved messages.
39365
39413
  */
39366
39414
  async embedClonedMessages(messages, config) {
39367
- if (!this.vector || !this.embedder) return;
39415
+ if (!this.vector || !this.embedder && !this.isSelfEmbedding) return;
39368
39416
  const embeddingData = [];
39369
39417
  let dimension;
39370
39418
  await Promise.all(messages.map(async (message) => {
@@ -39375,11 +39423,22 @@ Notes:
39375
39423
  if (joined) textForEmbedding = joined;
39376
39424
  }
39377
39425
  if (!textForEmbedding) return;
39378
- const result = await this.embedMessageContent(textForEmbedding);
39379
- dimension = result.dimension;
39426
+ let embeddings = [];
39427
+ let documents;
39428
+ let chunks;
39429
+ if (this.isSelfEmbedding) {
39430
+ chunks = this.chunkText(textForEmbedding);
39431
+ documents = chunks;
39432
+ } else {
39433
+ const result = await this.embedMessageContent(textForEmbedding);
39434
+ dimension = result.dimension;
39435
+ embeddings = result.embeddings;
39436
+ chunks = result.chunks;
39437
+ }
39380
39438
  embeddingData.push({
39381
- embeddings: result.embeddings,
39382
- metadata: result.chunks.map(() => ({
39439
+ embeddings,
39440
+ documents,
39441
+ metadata: chunks.map(() => ({
39383
39442
  message_id: message.id,
39384
39443
  thread_id: message.threadId,
39385
39444
  resource_id: message.resourceId,
@@ -39389,15 +39448,22 @@ Notes:
39389
39448
  }))
39390
39449
  });
39391
39450
  }));
39392
- if (embeddingData.length > 0 && dimension !== void 0) {
39451
+ if (embeddingData.length > 0 && (this.isSelfEmbedding || dimension !== void 0)) {
39393
39452
  const { indexName } = await this.createEmbeddingIndex(dimension, config);
39394
39453
  const allVectors = [];
39395
39454
  const allMetadata = [];
39455
+ const allDocuments = [];
39396
39456
  for (const data of embeddingData) {
39397
39457
  allVectors.push(...data.embeddings);
39458
+ if (data.documents) allDocuments.push(...data.documents);
39398
39459
  allMetadata.push(...data.metadata);
39399
39460
  }
39400
- await this.vector.upsert({
39461
+ if (this.isSelfEmbedding) await this.vector.upsert({
39462
+ indexName,
39463
+ documents: allDocuments,
39464
+ metadata: allMetadata
39465
+ });
39466
+ else await this.vector.upsert({
39401
39467
  indexName,
39402
39468
  vectors: allVectors,
39403
39469
  metadata: allMetadata
@@ -40378,23 +40444,23 @@ const createModelInstance = async (provider, modelId, version = "v2") => {
40378
40444
  try {
40379
40445
  const providerFn = version === `v1` ? { v1: {
40380
40446
  openai: async () => {
40381
- const { openai } = await import("./dist-Dx2Qp8Rj.js");
40447
+ const { openai } = await import("./dist-Bz4l8I_x.js");
40382
40448
  return openai(modelId);
40383
40449
  },
40384
40450
  anthropic: async () => {
40385
- const { anthropic } = await import("./dist-Bl3UrwJs.js");
40451
+ const { anthropic } = await import("./dist-D1oSHJhK.js");
40386
40452
  return anthropic(modelId);
40387
40453
  },
40388
40454
  groq: async () => {
40389
- const { groq } = await import("./dist-DiEECrlS.js");
40455
+ const { groq } = await import("./dist-_RnqhYfY.js");
40390
40456
  return groq(modelId);
40391
40457
  },
40392
40458
  xai: async () => {
40393
- const { xai } = await import("./dist-D1rb-p2Y.js");
40459
+ const { xai } = await import("./dist-BCTqy9i3.js");
40394
40460
  return xai(modelId);
40395
40461
  },
40396
40462
  google: async () => {
40397
- const { google } = await import("./dist-DJ7t3yBx.js");
40463
+ const { google } = await import("./dist-8fx1_bLF.js");
40398
40464
  return google(modelId);
40399
40465
  }
40400
40466
  } }[version][provider] : () => new ModelRouterLanguageModel(`${provider}/${modelId}`);
@@ -50371,4 +50437,4 @@ const agentBuilderWorkflows = {
50371
50437
  //#endregion
50372
50438
  export { agentBuilderWorkflows };
50373
50439
 
50374
- //# sourceMappingURL=dist-DH39C5Bz.js.map
50440
+ //# sourceMappingURL=dist-5xXLv6KR.js.map