@mastra/server 1.75.0-alpha.4 → 1.75.0-alpha.5

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 (86) hide show
  1. package/dist/{agent-versions-RvvNdlZk.cjs → agent-versions-CivkX9fT.cjs} +2 -2
  2. package/dist/{agent-versions-RvvNdlZk.cjs.map → agent-versions-CivkX9fT.cjs.map} +1 -1
  3. package/dist/{agent-versions-CTAEDQuT.js → agent-versions-oCebJ7rc.js} +2 -2
  4. package/dist/{agent-versions-CTAEDQuT.js.map → agent-versions-oCebJ7rc.js.map} +1 -1
  5. package/dist/{api-schema-manifest-BmNlBOvP.cjs → api-schema-manifest-BKsEMyEs.cjs} +2 -2
  6. package/dist/{api-schema-manifest-BmNlBOvP.cjs.map → api-schema-manifest-BKsEMyEs.cjs.map} +1 -1
  7. package/dist/{api-schema-manifest-Bsnp8kpD.js → api-schema-manifest-KsETdHDS.js} +2 -2
  8. package/dist/{api-schema-manifest-Bsnp8kpD.js.map → api-schema-manifest-KsETdHDS.js.map} +1 -1
  9. package/dist/{channels-DJkXEpTr.cjs → channels-DUdpygCQ.cjs} +39 -1
  10. package/dist/channels-DUdpygCQ.cjs.map +1 -0
  11. package/dist/{channels-DzaCNtXe.js → channels-T1KaEfZX.js} +34 -2
  12. package/dist/channels-T1KaEfZX.js.map +1 -0
  13. package/dist/{dist-DgDFoIF5.cjs → dist-DRLe8Sd-.cjs} +24 -3
  14. package/dist/dist-DRLe8Sd-.cjs.map +1 -0
  15. package/dist/{dist-BFUX7iPi.js → dist-DWXEVDmb.js} +24 -3
  16. package/dist/dist-DWXEVDmb.js.map +1 -0
  17. package/dist/docs/SKILL.md +1 -1
  18. package/dist/docs/assets/SOURCE_MAP.json +1 -1
  19. package/dist/{routes--Al6ya95.js → routes-B_ehFjzs.js} +3 -2
  20. package/dist/routes-B_ehFjzs.js.map +1 -0
  21. package/dist/{routes-CeYKJ-Re.cjs → routes-Op7uJGai.cjs} +3 -2
  22. package/dist/routes-Op7uJGai.cjs.map +1 -0
  23. package/dist/{scorer-versions-BfGNw7Wp.cjs → scorer-versions-B8q9-oF2.cjs} +2 -2
  24. package/dist/{scorer-versions-BfGNw7Wp.cjs.map → scorer-versions-B8q9-oF2.cjs.map} +1 -1
  25. package/dist/{scorer-versions-gXsdWw0V.js → scorer-versions-DGLHODqM.js} +2 -2
  26. package/dist/{scorer-versions-gXsdWw0V.js.map → scorer-versions-DGLHODqM.js.map} +1 -1
  27. package/dist/server/handlers/agent-builder.cjs +1 -1
  28. package/dist/server/handlers/agent-builder.js +1 -1
  29. package/dist/server/handlers/agent-versions.cjs +1 -1
  30. package/dist/server/handlers/agent-versions.d.ts +368 -0
  31. package/dist/server/handlers/agent-versions.d.ts.map +1 -1
  32. package/dist/server/handlers/agent-versions.js +1 -1
  33. package/dist/server/handlers/agents.cjs +1 -1
  34. package/dist/server/handlers/agents.d.ts +92 -0
  35. package/dist/server/handlers/agents.d.ts.map +1 -1
  36. package/dist/server/handlers/agents.js +1 -1
  37. package/dist/server/handlers/channels.cjs +2 -1
  38. package/dist/server/handlers/channels.d.ts +53 -0
  39. package/dist/server/handlers/channels.d.ts.map +1 -1
  40. package/dist/server/handlers/channels.js +2 -2
  41. package/dist/server/handlers/scorer-versions.cjs +1 -1
  42. package/dist/server/handlers/scorer-versions.js +1 -1
  43. package/dist/server/handlers/stored-agent-favorites.cjs +1 -1
  44. package/dist/server/handlers/stored-agent-favorites.js +1 -1
  45. package/dist/server/handlers/stored-agents.cjs +1 -1
  46. package/dist/server/handlers/stored-agents.d.ts +460 -0
  47. package/dist/server/handlers/stored-agents.d.ts.map +1 -1
  48. package/dist/server/handlers/stored-agents.js +1 -1
  49. package/dist/server/handlers/stored-scorers.cjs +1 -1
  50. package/dist/server/handlers/stored-scorers.js +1 -1
  51. package/dist/server/handlers/system.cjs +1 -1
  52. package/dist/server/handlers/system.js +1 -1
  53. package/dist/server/handlers/tool-providers.cjs +2 -1
  54. package/dist/server/handlers/tool-providers.cjs.map +1 -1
  55. package/dist/server/handlers/tool-providers.d.ts.map +1 -1
  56. package/dist/server/handlers/tool-providers.js +2 -1
  57. package/dist/server/handlers/tool-providers.js.map +1 -1
  58. package/dist/server/schemas/agent-versions.d.ts +350 -0
  59. package/dist/server/schemas/agent-versions.d.ts.map +1 -1
  60. package/dist/server/schemas/channels.d.ts +11 -0
  61. package/dist/server/schemas/channels.d.ts.map +1 -1
  62. package/dist/server/schemas/index.cjs +4 -4
  63. package/dist/server/schemas/index.js +4 -4
  64. package/dist/server/schemas/stored-agents.d.ts +989 -149
  65. package/dist/server/schemas/stored-agents.d.ts.map +1 -1
  66. package/dist/server/server-adapter/index.cjs +1 -1
  67. package/dist/server/server-adapter/index.js +1 -1
  68. package/dist/server/server-adapter/routes/channels.d.ts +43 -0
  69. package/dist/server/server-adapter/routes/channels.d.ts.map +1 -1
  70. package/dist/{stored-agents-ts0bWw8l.js → stored-agents-BzIvRgtz.js} +3 -2
  71. package/dist/stored-agents-BzIvRgtz.js.map +1 -0
  72. package/dist/{stored-agents-Dmsel7ey.cjs → stored-agents-DpY3ssfx.cjs} +3 -2
  73. package/dist/stored-agents-DpY3ssfx.cjs.map +1 -0
  74. package/dist/{stored-scorers-DySg7-qS.js → stored-scorers-CAt8hFj2.js} +2 -2
  75. package/dist/{stored-scorers-DySg7-qS.js.map → stored-scorers-CAt8hFj2.js.map} +1 -1
  76. package/dist/{stored-scorers-DoW6lYh8.cjs → stored-scorers-DyeqU2Rj.cjs} +2 -2
  77. package/dist/{stored-scorers-DoW6lYh8.cjs.map → stored-scorers-DyeqU2Rj.cjs.map} +1 -1
  78. package/package.json +6 -6
  79. package/dist/channels-DJkXEpTr.cjs.map +0 -1
  80. package/dist/channels-DzaCNtXe.js.map +0 -1
  81. package/dist/dist-BFUX7iPi.js.map +0 -1
  82. package/dist/dist-DgDFoIF5.cjs.map +0 -1
  83. package/dist/routes--Al6ya95.js.map +0 -1
  84. package/dist/routes-CeYKJ-Re.cjs.map +0 -1
  85. package/dist/stored-agents-Dmsel7ey.cjs.map +0 -1
  86. package/dist/stored-agents-ts0bWw8l.js.map +0 -1
@@ -1 +1 @@
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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CACrD,WAAW,EAAE,OAAO,KAAK;CACzB,WAAW,EAAE,OAAO,KAAK;AAC3B,CAAC,GACD,kBACF,CAAC;AAED,MAAa,mCAAmC,EAAE,OAAO;CACvD,SAAS,EAAE,QAAQ;CACnB,SAAS,EAAE,OAAO;AACpB,CAAC"}
1
+ {"version":3,"file":"stored-scorers-CAt8hFj2.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,M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UAAU,EAAE,OAAO,EAAE,OAAO,GAAG,EAAE,QAAQ,CAAC,CAAC,CAAC,SAAS;CACrD,WAAW,EAAE,OAAO,KAAK;CACzB,WAAW,EAAE,OAAO,KAAK;AAC3B,CAAC,GACD,kBACF,CAAC;AAED,MAAa,mCAAmC,EAAE,OAAO;CACvD,SAAS,EAAE,QAAQ;CACnB,SAAS,EAAE,OAAO;AACpB,CAAC"}
@@ -1,5 +1,5 @@
1
1
  const require_common = require("./common-BkgcoK-2.cjs");
2
- const require_stored_agents = require("./stored-agents-Dmsel7ey.cjs");
2
+ const require_stored_agents = require("./stored-agents-DpY3ssfx.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-DoW6lYh8.cjs.map
158
+ //# sourceMappingURL=stored-scorers-DyeqU2Rj.cjs.map
@@ -1 +1 @@
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,uBAAuBA,OAAAA,EAAE,OAAO;CACpC,OAAOA,OAAAA,EAAE,KAAK,CAAC,aAAa,WAAW,CAAC,CAAC,CAAC,SAAS;CACnD,WAAWA,OAAAA,EAAE,KAAK,CAAC,OAAO,MAAM,CAAC,CAAC,CAAC,SAAS;AAC9C,CAAC;AAID,MAAa,+BAA+BC,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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
+ {"version":3,"file":"stored-scorers-DyeqU2Rj.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,uBAAuBA,OAAAA,EAAE,OAAO;CACpC,OAAOA,OAAAA,EAAE,KAAK,CAAC,aAAa,WAAW,CAAC,CAAC,CAAC,SAAS;CACnD,WAAWA,OAAAA,EAAE,KAAK,CAAC,OAAO,MAAM,CAAC,CAAC,CAAC,SAAS;AAC9C,CAAC;AAID,MAAa,+BAA+BC,eAAAA,2BAA2B,GAAG,CAAC,CAAC,OAAO;CACjF,SAAS,qBAAqB,SAAS;CACvC,QAAQD,OAAAA,EACL,KAAK;EAAC;EAAS;EAAa;CAAU,CAAC,CAAC,CACxC,SAAS,CAAC,CACV,QAAQ,WAAW,CAAC,CACpB,SAAS,kDAAkD;CAC9D,UAAUA,OAAAA,EAAE,OAAO,CAAC,CAAC,SAAS,CAAC,CAAC,SAAS,qCAAqC;CAC9E,UAAUA,OAAAA,EAAE,OAAOA,OAAAA,EAAE,OAAO,GAAGA,OAAAA,EAAE,QAAQ,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,SAAS,4CAA4C;AAC9G,CAAC;AAMD,MAAM,uBAAuBA,OAAAA,EAAE,MAAM,CACnCA,OAAAA,EAAE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T,OAAO;EACN,KAAKA,OAAAA,EAAE,OAAO,CAAC,CAAC,SAAS;EACzB,KAAKA,OAAAA,EAAE,OAAO,CAAC,CAAC,SAAS;CAC3B,CAAC,CAAC,CACD,SAAS;CACZ,cAAcA,OAAAA,EAAE,OAAOA,OAAAA,EAAE,OAAO,GAAGA,OAAAA,EAAE,QAAQ,CAAC,CAAC,CAAC,SAAS;CACzD,iBAAiB,qBAAqB,SAAS;AACjD,CAAC;AAED,MAAa,kCAAkCG,eAAAA,qBAAqB,OAAO,EACzE,mBAAmBH,OAAAA,EAAE,MAAM,kBAAkB,EAC/C,CAAC;AAED,MAAa,gCAAgC;AAC7C,MAAa,mCAAmC;AAEhD,MAAa,mCAAmCA,OAAAA,EAAE,MAAM,CACtDA,OAAAA,EAAE,OAAO;CACP,IAAIA,OAAAA,EAAE,OAAO;CACb,QAAQA,OAAAA,EAAE,OAAO;CACjB,iBAAiBA,OAAAA,EAAE,OAAO,CAAC,CAAC,SAAS;CACrC,UAAUA,OAAAA,EAAE,OAAO,CAAC,CAAC,SAAS;CAC9B,UAAUA,OAAAA,EAAE,OAAOA,OAAAA,EAAE,OAAO,GAAGA,OAAAA,EAAE,QAAQ,CAAC,CAAC,CAAC,SAAS;CACrD,WAAWA,OAAAA,EAAE,OAAO,KAAK;CACzB,WAAWA,OAAAA,EAAE,OAAO,KAAK;AAC3B,CAAC,GACD,kBACF,CAAC;AAED,MAAa,mCAAmCA,OAAAA,EAAE,OAAO;CACvD,SAASA,OAAAA,EAAE,QAAQ;CACnB,SAASA,OAAAA,EAAE,OAAO;AACpB,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mastra/server",
3
- "version": "1.75.0-alpha.4",
3
+ "version": "1.75.0-alpha.5",
4
4
  "description": "",
5
5
  "type": "module",
6
6
  "files": [
@@ -117,14 +117,14 @@
117
117
  "zod": "^4.6.4",
118
118
  "zod-to-ts": "^2.1.0",
119
119
  "@internal/core": "0.1.2",
120
- "@internal/lint": "0.0.140",
120
+ "@internal/test-utils": "0.0.76",
121
+ "@internal/voice": "0.0.38",
121
122
  "@internal/storage-test-utils": "0.0.136",
122
123
  "@internal/types-builder": "0.0.115",
123
- "@internal/voice": "0.0.38",
124
- "@internal/test-utils": "0.0.76",
125
- "@mastra/agent-builder": "1.1.26-alpha.2",
124
+ "@mastra/agent-builder": "1.1.26-alpha.3",
126
125
  "@mastra/schema-compat": "1.3.13",
127
- "@mastra/core": "1.75.0-alpha.4"
126
+ "@mastra/core": "1.75.0-alpha.5",
127
+ "@internal/lint": "0.0.140"
128
128
  },
129
129
  "homepage": "https://mastra.ai",
130
130
  "repository": {
@@ -1 +0,0 @@
1
- {"version":3,"file":"channels-DJkXEpTr.cjs","names":["z","coreFeatures","HTTPException","getCallerAuthorId","hasAdminBypass","hasScopedPermission","createRoute","handleError"],"sources":["../src/server/schemas/channels.ts","../src/server/handlers/channels.ts"],"sourcesContent":["import { z } from 'zod/v4';\n\n// ============================================================================\n// Path Parameter Schemas\n// ============================================================================\n\nexport const channelPlatformPathParams = z.object({\n platform: z.string().describe('Channel platform identifier (e.g., \"slack\")'),\n});\n\nexport const channelAgentPathParams = z.object({\n platform: z.string().describe('Channel platform identifier (e.g., \"slack\")'),\n agentId: z.string().describe('Agent identifier'),\n});\n\n// ============================================================================\n// Body Parameter Schemas\n// ============================================================================\n\nexport const connectChannelBodySchema = z.object({\n agentId: z.string().describe('Agent identifier to connect'),\n options: z.record(z.string(), z.unknown()).optional().describe('Platform-specific connection options'),\n});\n\n// ============================================================================\n// Response Schemas\n// ============================================================================\n\nconst channelPlatformInfoSchema = z.object({\n id: z.string().describe('Platform identifier'),\n name: z.string().describe('Human-readable platform name'),\n isConfigured: z.boolean().describe('Whether the platform is ready to connect agents'),\n connectOptionsSchema: z.record(z.string(), z.unknown()).optional().describe('JSON Schema for connect options'),\n});\n\nconst channelInstallationInfoSchema = z.object({\n id: z.string().describe('Installation identifier'),\n platform: z.string().describe('Platform identifier'),\n agentId: z.string().describe('Connected agent identifier'),\n status: z.enum(['active', 'pending']).describe('Installation status'),\n displayName: z.string().optional().describe('Platform-specific display name'),\n installedAt: z.coerce.date().optional().describe('Installation timestamp'),\n});\n\nconst channelConnectOAuthSchema = z.object({\n type: z.literal('oauth').describe('OAuth-based connection requiring browser redirect'),\n authorizationUrl: z.string().describe('OAuth authorization URL for user redirect'),\n installationId: z.string().describe('Installation identifier'),\n});\n\nconst channelConnectDeepLinkSchema = z.object({\n type: z.literal('deep_link').describe('Deep-link connection requiring native app interaction'),\n url: z.string().describe('Deep link URL to open in platform app'),\n installationId: z.string().describe('Installation identifier'),\n});\n\nconst channelConnectImmediateSchema = z.object({\n type: z.literal('immediate').describe('Immediate connection with no user interaction needed'),\n installationId: z.string().describe('Installation identifier'),\n});\n\nconst channelConnectResultSchema = z.discriminatedUnion('type', [\n channelConnectOAuthSchema,\n channelConnectDeepLinkSchema,\n channelConnectImmediateSchema,\n]);\n\nexport const listChannelPlatformsResponseSchema = z.array(channelPlatformInfoSchema);\n\nexport const listChannelInstallationsResponseSchema = z.array(channelInstallationInfoSchema);\n\nexport const connectChannelResponseSchema = channelConnectResultSchema;\n\nexport const disconnectChannelResponseSchema = z.object({\n success: z.boolean(),\n});\n","import type { Mastra } from '@mastra/core';\nimport type { ChannelProvider } from '@mastra/core/channels';\nimport type { RequestContext } from '@mastra/core/di';\nimport { coreFeatures } from '@mastra/core/features';\n\nimport { MASTRA_USER_KEY } from '../constants';\nimport { HTTPException } from '../http-exception';\nimport {\n channelPlatformPathParams,\n channelAgentPathParams,\n connectChannelBodySchema,\n listChannelPlatformsResponseSchema,\n listChannelInstallationsResponseSchema,\n connectChannelResponseSchema,\n disconnectChannelResponseSchema,\n} from '../schemas/channels';\nimport { createRoute } from '../server-adapter/routes/route-builder';\n\nimport { assertWriteAccess, getCallerAuthorId, hasAdminBypass, hasScopedPermission } from './authorship';\nimport { handleError } from './error';\n\n// ============================================================================\n// Feature gate + helpers\n// ============================================================================\n\nfunction assertChannelsAvailable(): void {\n if (!coreFeatures.has('channels')) {\n throw new HTTPException(501, { message: 'Channels require a newer version of @mastra/core' });\n }\n}\n\n/**\n * Resolves the current channel providers. Prefers `resolveChannels()` so a\n * live resolver (e.g. `channels()` from @mastra/connect) is consulted —\n * connections added after boot are picked up without a restart. Falls back to\n * the static snapshot on older @mastra/core versions without the method.\n */\nasync function resolveChannelProviders(mastra: Mastra): Promise<ChannelProvider[]> {\n const resolveChannels = (mastra as Mastra & { resolveChannels?: () => Promise<Record<string, ChannelProvider>> })\n .resolveChannels;\n const record = typeof resolveChannels === 'function' ? await resolveChannels.call(mastra) : (mastra.channels ?? {});\n return Object.values(record);\n}\n\nasync function getChannelOrThrow(mastra: Mastra, platform: string): Promise<ChannelProvider> {\n const channels = await resolveChannelProviders(mastra);\n const channel = channels.find(c => c.id === platform);\n if (!channel) {\n const available = channels.map(c => c.id).join(', ');\n throw new HTTPException(404, {\n message: `Channel \"${platform}\" is not registered. Available: ${available || 'none'}`,\n });\n }\n return channel;\n}\n\n/**\n * Unified connect/disconnect authorization.\n *\n * - Stored agent exists → same write access as editing the agent record.\n * - Code-defined agent (no stored record) → route's `requiresAuth` is the gate.\n * - Agent doesn't exist anywhere:\n * - connect → 404 (can't connect a channel to a non-existent agent)\n * - disconnect → orphan cleanup, gated on `channels:write`\n */\nasync function assertChannelAgentWriteAccess(\n mastra: Mastra,\n requestContext: RequestContext,\n agentId: string,\n action: 'connect' | 'disconnect',\n): Promise<void> {\n const storage = mastra.getStorage();\n const agentsStore = storage ? await storage.getStore('agents') : null;\n const stored = agentsStore ? await agentsStore.getById(agentId) : null;\n\n if (stored) {\n assertWriteAccess({\n requestContext,\n resource: 'agents',\n resourceId: agentId,\n action: 'edit',\n record: stored,\n });\n return;\n }\n\n // Not in stored-agents (or storage doesn't support it). Check the runtime\n // registry for a code-defined agent.\n const codeDefined = mastra.getAgentById(agentId);\n if (codeDefined) {\n // Code-defined agents have no owner/ACL — route's requiresAuth /\n // requiresPermission is the gate. Pass-through.\n return;\n }\n\n if (action === 'connect') {\n throw new HTTPException(404, { message: `Agent \"${agentId}\" not found` });\n }\n\n // Disconnect against an unknown agentId = orphan cleanup (stored agent was\n // deleted but the channel installation row is still around). Allow it, but\n // gate on channels:write so this isn't an \"any authenticated user\" backdoor.\n // Follow the same no-auth-configured pass-through as assertWriteAccess.\n const callerAuthorId = getCallerAuthorId(requestContext);\n if (!callerAuthorId && !requestContext.get(MASTRA_USER_KEY)) return;\n if (hasAdminBypass(requestContext, 'channels')) return;\n if (hasScopedPermission({ requestContext, resource: 'channels', action: 'write' })) return;\n\n throw new HTTPException(404, { message: 'Not found' });\n}\n\n// ============================================================================\n// Route Definitions\n// ============================================================================\n\n/**\n * GET /channels/platforms - List available channel platforms\n */\nexport const LIST_CHANNEL_PLATFORMS_ROUTE = createRoute({\n method: 'GET',\n path: '/channels/platforms',\n responseType: 'json',\n responseSchema: listChannelPlatformsResponseSchema,\n summary: 'List channel platforms',\n description: 'Returns available channel platforms and their configuration status',\n tags: ['Channels'],\n requiresAuth: true,\n handler: async ({ mastra }) => {\n assertChannelsAvailable();\n try {\n const channels = await resolveChannelProviders(mastra);\n return channels.map(channel => {\n if (channel.getInfo) {\n return channel.getInfo();\n }\n return {\n id: channel.id,\n name: channel.id.charAt(0).toUpperCase() + channel.id.slice(1),\n isConfigured: true,\n };\n });\n } catch (error) {\n return handleError(error, 'Error listing channel platforms');\n }\n },\n});\n\n/**\n * GET /channels/:platform/installations - List installations for a platform\n */\nexport const LIST_CHANNEL_INSTALLATIONS_ROUTE = createRoute({\n method: 'GET',\n path: '/channels/:platform/installations',\n responseType: 'json',\n pathParamSchema: channelPlatformPathParams,\n responseSchema: listChannelInstallationsResponseSchema,\n summary: 'List channel installations',\n description: 'Returns all active and pending installations for a channel platform',\n tags: ['Channels'],\n requiresAuth: true,\n handler: async ({ mastra, platform }) => {\n assertChannelsAvailable();\n try {\n const channel = await getChannelOrThrow(mastra, platform);\n\n if (!channel.listInstallations) {\n return [];\n }\n\n return await channel.listInstallations();\n } catch (error) {\n return handleError(error, 'Error listing channel installations');\n }\n },\n});\n\n/**\n * POST /channels/:platform/connect - Connect an agent to a platform\n */\nexport const CONNECT_CHANNEL_ROUTE = createRoute({\n method: 'POST',\n path: '/channels/:platform/connect',\n responseType: 'json',\n pathParamSchema: channelPlatformPathParams,\n bodySchema: connectChannelBodySchema,\n responseSchema: connectChannelResponseSchema,\n summary: 'Connect agent to channel',\n description: 'Creates a platform app for the agent and returns an OAuth authorization URL',\n tags: ['Channels'],\n requiresAuth: true,\n handler: async ({ mastra, requestContext, platform, agentId, options }) => {\n assertChannelsAvailable();\n try {\n const channel = await getChannelOrThrow(mastra, platform);\n\n if (!channel.connect) {\n throw new HTTPException(400, {\n message: `Channel \"${platform}\" does not support programmatic connection`,\n });\n }\n\n await assertChannelAgentWriteAccess(mastra, requestContext, agentId, 'connect');\n\n return await channel.connect(agentId, options);\n } catch (error) {\n return handleError(error, 'Error connecting agent to channel');\n }\n },\n});\n\n/**\n * POST /channels/:platform/:agentId/disconnect - Disconnect an agent from a platform\n */\nexport const DISCONNECT_CHANNEL_ROUTE = createRoute({\n method: 'POST',\n path: '/channels/:platform/:agentId/disconnect',\n responseType: 'json',\n pathParamSchema: channelAgentPathParams,\n responseSchema: disconnectChannelResponseSchema,\n summary: 'Disconnect agent from channel',\n description: 'Deletes the platform app and cleans up the installation',\n tags: ['Channels'],\n requiresAuth: true,\n handler: async ({ mastra, requestContext, platform, agentId }) => {\n assertChannelsAvailable();\n try {\n const channel = await getChannelOrThrow(mastra, platform);\n\n if (!channel.disconnect) {\n throw new HTTPException(400, {\n message: `Channel \"${platform}\" does not support programmatic disconnection`,\n });\n }\n\n await assertChannelAgentWriteAccess(mastra, requestContext, agentId, 'disconnect');\n\n await channel.disconnect(agentId);\n return { success: true };\n } catch (error) {\n return handleError(error, 'Error disconnecting agent from channel');\n }\n },\n});\n"],"mappings":";;;;;;;;AAMA,MAAa,4BAA4BA,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,CAAC,QAAQ,SACX,MAAM,IAAIJ,uBAAAA,cAAc,KAAK,EAC3B,SAAS,YAAY,SAAS,4CAChC,CAAC;GAGH,MAAM,8BAA8B,QAAQ,gBAAgB,SAAS,SAAS;GAE9E,OAAO,MAAM,QAAQ,QAAQ,SAAS,OAAO;EAC/C,SAAS,OAAO;GACd,OAAOK,8BAAAA,YAAY,OAAO,mCAAmC;EAC/D;CACF;AACF,CAAC;;;;AAKD,MAAa,2BAA2BD,sBAAAA,YAAY;CAClD,QAAQ;CACR,MAAM;CACN,cAAc;CACd,iBAAiB;CACjB,gBAAgB;CAChB,SAAS;CACT,aAAa;CACb,MAAM,CAAC,UAAU;CACjB,cAAc;CACd,SAAS,OAAO,EAAE,QAAQ,gBAAgB,UAAU,cAAc;EAChE,wBAAwB;EACxB,IAAI;GACF,MAAM,UAAU,MAAM,kBAAkB,QAAQ,QAAQ;GAExD,IAAI,CAAC,QAAQ,YACX,MAAM,IAAIJ,uBAAAA,cAAc,KAAK,EAC3B,SAAS,YAAY,SAAS,+CAChC,CAAC;GAGH,MAAM,8BAA8B,QAAQ,gBAAgB,SAAS,YAAY;GAEjF,MAAM,QAAQ,WAAW,OAAO;GAChC,OAAO,EAAE,SAAS,KAAK;EACzB,SAAS,OAAO;GACd,OAAOK,8BAAAA,YAAY,OAAO,wCAAwC;EACpE;CACF;AACF,CAAC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"channels-DzaCNtXe.js","names":[],"sources":["../src/server/schemas/channels.ts","../src/server/handlers/channels.ts"],"sourcesContent":["import { z } from 'zod/v4';\n\n// ============================================================================\n// Path Parameter Schemas\n// ============================================================================\n\nexport const channelPlatformPathParams = z.object({\n platform: z.string().describe('Channel platform identifier (e.g., \"slack\")'),\n});\n\nexport const channelAgentPathParams = z.object({\n platform: z.string().describe('Channel platform identifier (e.g., \"slack\")'),\n agentId: z.string().describe('Agent identifier'),\n});\n\n// ============================================================================\n// Body Parameter Schemas\n// ============================================================================\n\nexport const connectChannelBodySchema = z.object({\n agentId: z.string().describe('Agent identifier to connect'),\n options: z.record(z.string(), z.unknown()).optional().describe('Platform-specific connection options'),\n});\n\n// ============================================================================\n// Response Schemas\n// ============================================================================\n\nconst channelPlatformInfoSchema = z.object({\n id: z.string().describe('Platform identifier'),\n name: z.string().describe('Human-readable platform name'),\n isConfigured: z.boolean().describe('Whether the platform is ready to connect agents'),\n connectOptionsSchema: z.record(z.string(), z.unknown()).optional().describe('JSON Schema for connect options'),\n});\n\nconst channelInstallationInfoSchema = z.object({\n id: z.string().describe('Installation identifier'),\n platform: z.string().describe('Platform identifier'),\n agentId: z.string().describe('Connected agent identifier'),\n status: z.enum(['active', 'pending']).describe('Installation status'),\n displayName: z.string().optional().describe('Platform-specific display name'),\n installedAt: z.coerce.date().optional().describe('Installation timestamp'),\n});\n\nconst channelConnectOAuthSchema = z.object({\n type: z.literal('oauth').describe('OAuth-based connection requiring browser redirect'),\n authorizationUrl: z.string().describe('OAuth authorization URL for user redirect'),\n installationId: z.string().describe('Installation identifier'),\n});\n\nconst channelConnectDeepLinkSchema = z.object({\n type: z.literal('deep_link').describe('Deep-link connection requiring native app interaction'),\n url: z.string().describe('Deep link URL to open in platform app'),\n installationId: z.string().describe('Installation identifier'),\n});\n\nconst channelConnectImmediateSchema = z.object({\n type: z.literal('immediate').describe('Immediate connection with no user interaction needed'),\n installationId: z.string().describe('Installation identifier'),\n});\n\nconst channelConnectResultSchema = z.discriminatedUnion('type', [\n channelConnectOAuthSchema,\n channelConnectDeepLinkSchema,\n channelConnectImmediateSchema,\n]);\n\nexport const listChannelPlatformsResponseSchema = z.array(channelPlatformInfoSchema);\n\nexport const listChannelInstallationsResponseSchema = z.array(channelInstallationInfoSchema);\n\nexport const connectChannelResponseSchema = channelConnectResultSchema;\n\nexport const disconnectChannelResponseSchema = z.object({\n success: z.boolean(),\n});\n","import type { Mastra } from '@mastra/core';\nimport type { ChannelProvider } from '@mastra/core/channels';\nimport type { RequestContext } from '@mastra/core/di';\nimport { coreFeatures } from '@mastra/core/features';\n\nimport { MASTRA_USER_KEY } from '../constants';\nimport { HTTPException } from '../http-exception';\nimport {\n channelPlatformPathParams,\n channelAgentPathParams,\n connectChannelBodySchema,\n listChannelPlatformsResponseSchema,\n listChannelInstallationsResponseSchema,\n connectChannelResponseSchema,\n disconnectChannelResponseSchema,\n} from '../schemas/channels';\nimport { createRoute } from '../server-adapter/routes/route-builder';\n\nimport { assertWriteAccess, getCallerAuthorId, hasAdminBypass, hasScopedPermission } from './authorship';\nimport { handleError } from './error';\n\n// ============================================================================\n// Feature gate + helpers\n// ============================================================================\n\nfunction assertChannelsAvailable(): void {\n if (!coreFeatures.has('channels')) {\n throw new HTTPException(501, { message: 'Channels require a newer version of @mastra/core' });\n }\n}\n\n/**\n * Resolves the current channel providers. Prefers `resolveChannels()` so a\n * live resolver (e.g. `channels()` from @mastra/connect) is consulted —\n * connections added after boot are picked up without a restart. Falls back to\n * the static snapshot on older @mastra/core versions without the method.\n */\nasync function resolveChannelProviders(mastra: Mastra): Promise<ChannelProvider[]> {\n const resolveChannels = (mastra as Mastra & { resolveChannels?: () => Promise<Record<string, ChannelProvider>> })\n .resolveChannels;\n const record = typeof resolveChannels === 'function' ? await resolveChannels.call(mastra) : (mastra.channels ?? {});\n return Object.values(record);\n}\n\nasync function getChannelOrThrow(mastra: Mastra, platform: string): Promise<ChannelProvider> {\n const channels = await resolveChannelProviders(mastra);\n const channel = channels.find(c => c.id === platform);\n if (!channel) {\n const available = channels.map(c => c.id).join(', ');\n throw new HTTPException(404, {\n message: `Channel \"${platform}\" is not registered. Available: ${available || 'none'}`,\n });\n }\n return channel;\n}\n\n/**\n * Unified connect/disconnect authorization.\n *\n * - Stored agent exists → same write access as editing the agent record.\n * - Code-defined agent (no stored record) → route's `requiresAuth` is the gate.\n * - Agent doesn't exist anywhere:\n * - connect → 404 (can't connect a channel to a non-existent agent)\n * - disconnect → orphan cleanup, gated on `channels:write`\n */\nasync function assertChannelAgentWriteAccess(\n mastra: Mastra,\n requestContext: RequestContext,\n agentId: string,\n action: 'connect' | 'disconnect',\n): Promise<void> {\n const storage = mastra.getStorage();\n const agentsStore = storage ? await storage.getStore('agents') : null;\n const stored = agentsStore ? await agentsStore.getById(agentId) : null;\n\n if (stored) {\n assertWriteAccess({\n requestContext,\n resource: 'agents',\n resourceId: agentId,\n action: 'edit',\n record: stored,\n });\n return;\n }\n\n // Not in stored-agents (or storage doesn't support it). Check the runtime\n // registry for a code-defined agent.\n const codeDefined = mastra.getAgentById(agentId);\n if (codeDefined) {\n // Code-defined agents have no owner/ACL — route's requiresAuth /\n // requiresPermission is the gate. Pass-through.\n return;\n }\n\n if (action === 'connect') {\n throw new HTTPException(404, { message: `Agent \"${agentId}\" not found` });\n }\n\n // Disconnect against an unknown agentId = orphan cleanup (stored agent was\n // deleted but the channel installation row is still around). Allow it, but\n // gate on channels:write so this isn't an \"any authenticated user\" backdoor.\n // Follow the same no-auth-configured pass-through as assertWriteAccess.\n const callerAuthorId = getCallerAuthorId(requestContext);\n if (!callerAuthorId && !requestContext.get(MASTRA_USER_KEY)) return;\n if (hasAdminBypass(requestContext, 'channels')) return;\n if (hasScopedPermission({ requestContext, resource: 'channels', action: 'write' })) return;\n\n throw new HTTPException(404, { message: 'Not found' });\n}\n\n// ============================================================================\n// Route Definitions\n// ============================================================================\n\n/**\n * GET /channels/platforms - List available channel platforms\n */\nexport const LIST_CHANNEL_PLATFORMS_ROUTE = createRoute({\n method: 'GET',\n path: '/channels/platforms',\n responseType: 'json',\n responseSchema: listChannelPlatformsResponseSchema,\n summary: 'List channel platforms',\n description: 'Returns available channel platforms and their configuration status',\n tags: ['Channels'],\n requiresAuth: true,\n handler: async ({ mastra }) => {\n assertChannelsAvailable();\n try {\n const channels = await resolveChannelProviders(mastra);\n return channels.map(channel => {\n if (channel.getInfo) {\n return channel.getInfo();\n }\n return {\n id: channel.id,\n name: channel.id.charAt(0).toUpperCase() + channel.id.slice(1),\n isConfigured: true,\n };\n });\n } catch (error) {\n return handleError(error, 'Error listing channel platforms');\n }\n },\n});\n\n/**\n * GET /channels/:platform/installations - List installations for a platform\n */\nexport const LIST_CHANNEL_INSTALLATIONS_ROUTE = createRoute({\n method: 'GET',\n path: '/channels/:platform/installations',\n responseType: 'json',\n pathParamSchema: channelPlatformPathParams,\n responseSchema: listChannelInstallationsResponseSchema,\n summary: 'List channel installations',\n description: 'Returns all active and pending installations for a channel platform',\n tags: ['Channels'],\n requiresAuth: true,\n handler: async ({ mastra, platform }) => {\n assertChannelsAvailable();\n try {\n const channel = await getChannelOrThrow(mastra, platform);\n\n if (!channel.listInstallations) {\n return [];\n }\n\n return await channel.listInstallations();\n } catch (error) {\n return handleError(error, 'Error listing channel installations');\n }\n },\n});\n\n/**\n * POST /channels/:platform/connect - Connect an agent to a platform\n */\nexport const CONNECT_CHANNEL_ROUTE = createRoute({\n method: 'POST',\n path: '/channels/:platform/connect',\n responseType: 'json',\n pathParamSchema: channelPlatformPathParams,\n bodySchema: connectChannelBodySchema,\n responseSchema: connectChannelResponseSchema,\n summary: 'Connect agent to channel',\n description: 'Creates a platform app for the agent and returns an OAuth authorization URL',\n tags: ['Channels'],\n requiresAuth: true,\n handler: async ({ mastra, requestContext, platform, agentId, options }) => {\n assertChannelsAvailable();\n try {\n const channel = await getChannelOrThrow(mastra, platform);\n\n if (!channel.connect) {\n throw new HTTPException(400, {\n message: `Channel \"${platform}\" does not support programmatic connection`,\n });\n }\n\n await assertChannelAgentWriteAccess(mastra, requestContext, agentId, 'connect');\n\n return await channel.connect(agentId, options);\n } catch (error) {\n return handleError(error, 'Error connecting agent to channel');\n }\n },\n});\n\n/**\n * POST /channels/:platform/:agentId/disconnect - Disconnect an agent from a platform\n */\nexport const DISCONNECT_CHANNEL_ROUTE = createRoute({\n method: 'POST',\n path: '/channels/:platform/:agentId/disconnect',\n responseType: 'json',\n pathParamSchema: channelAgentPathParams,\n responseSchema: disconnectChannelResponseSchema,\n summary: 'Disconnect agent from channel',\n description: 'Deletes the platform app and cleans up the installation',\n tags: ['Channels'],\n requiresAuth: true,\n handler: async ({ mastra, requestContext, platform, agentId }) => {\n assertChannelsAvailable();\n try {\n const channel = await getChannelOrThrow(mastra, platform);\n\n if (!channel.disconnect) {\n throw new HTTPException(400, {\n message: `Channel \"${platform}\" does not support programmatic disconnection`,\n });\n }\n\n await assertChannelAgentWriteAccess(mastra, requestContext, agentId, 'disconnect');\n\n await channel.disconnect(agentId);\n return { success: true };\n } catch (error) {\n return handleError(error, 'Error disconnecting agent from channel');\n }\n },\n});\n"],"mappings":";;;;;;;;AAMA,MAAa,4BAA4B,EAAE,OAAO,EAChD,UAAU,EAAE,OAAO,CAAC,CAAC,SAAS,+CAA6C,EAC7E,CAAC;AAED,MAAa,yBAAyB,EAAE,OAAO;CAC7C,UAAU,EAAE,OAAO,CAAC,CAAC,SAAS,+CAA6C;CAC3E,SAAS,EAAE,OAAO,CAAC,CAAC,SAAS,kBAAkB;AACjD,CAAC;AAMD,MAAa,2BAA2B,EAAE,OAAO;CAC/C,SAAS,EAAE,OAAO,CAAC,CAAC,SAAS,6BAA6B;CAC1D,SAAS,EAAE,OAAO,EAAE,OAAO,GAAG,EAAE,QAAQ,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,SAAS,sCAAsC;AACvG,CAAC;AAMD,MAAM,4BAA4B,EAAE,OAAO;CACzC,IAAI,EAAE,OAAO,CAAC,CAAC,SAAS,qBAAqB;CAC7C,MAAM,EAAE,OAAO,CAAC,CAAC,SAAS,8BAA8B;CACxD,cAAc,EAAE,QAAQ,CAAC,CAAC,SAAS,iDAAiD;CACpF,sBAAsB,EAAE,OAAO,EAAE,OAAO,GAAG,EAAE,QAAQ,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,SAAS,iCAAiC;AAC/G,CAAC;AAED,MAAM,gCAAgC,EAAE,OAAO;CAC7C,IAAI,EAAE,OAAO,CAAC,CAAC,SAAS,yBAAyB;CACjD,UAAU,EAAE,OAAO,CAAC,CAAC,SAAS,qBA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