@mastra/server 1.34.0-alpha.2 → 1.34.0-alpha.3

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 (123) hide show
  1. package/CHANGELOG.md +46 -0
  2. package/dist/_types/@internal_core/dist/index.d.ts +2 -2
  3. package/dist/{api-schema-manifest-ARDWBAEX.js → api-schema-manifest-ONJGSFU6.js} +3 -3
  4. package/dist/{api-schema-manifest-ARDWBAEX.js.map → api-schema-manifest-ONJGSFU6.js.map} +1 -1
  5. package/dist/{api-schema-manifest-5NSXA7KL.cjs → api-schema-manifest-RW2XKWHV.cjs} +4 -4
  6. package/dist/{api-schema-manifest-5NSXA7KL.cjs.map → api-schema-manifest-RW2XKWHV.cjs.map} +1 -1
  7. package/dist/{chunk-ESNUQDZF.js → chunk-3LMGA7MG.js} +3 -3
  8. package/dist/{chunk-ESNUQDZF.js.map → chunk-3LMGA7MG.js.map} +1 -1
  9. package/dist/{chunk-X5A2TL4J.js → chunk-3PY3QBC7.js} +19 -3
  10. package/dist/chunk-3PY3QBC7.js.map +1 -0
  11. package/dist/{chunk-2J4KEVXS.cjs → chunk-42NUNMRC.cjs} +4 -2
  12. package/dist/chunk-42NUNMRC.cjs.map +1 -0
  13. package/dist/{chunk-NF5SYJHK.js → chunk-5HICERRG.js} +4 -3
  14. package/dist/chunk-5HICERRG.js.map +1 -0
  15. package/dist/{chunk-ARZYMGWI.js → chunk-6WVLPY55.js} +3 -3
  16. package/dist/{chunk-ARZYMGWI.js.map → chunk-6WVLPY55.js.map} +1 -1
  17. package/dist/{chunk-F6H72YS6.cjs → chunk-AJEJDKPH.cjs} +71 -41
  18. package/dist/chunk-AJEJDKPH.cjs.map +1 -0
  19. package/dist/{chunk-OM7O4X4K.cjs → chunk-EAK4XE4C.cjs} +7 -7
  20. package/dist/{chunk-OM7O4X4K.cjs.map → chunk-EAK4XE4C.cjs.map} +1 -1
  21. package/dist/{chunk-E6XT4Z7T.cjs → chunk-FTU4TI4A.cjs} +106 -90
  22. package/dist/chunk-FTU4TI4A.cjs.map +1 -0
  23. package/dist/{chunk-4ZBKW547.cjs → chunk-FXOO4Y2Q.cjs} +3 -3
  24. package/dist/{chunk-4ZBKW547.cjs.map → chunk-FXOO4Y2Q.cjs.map} +1 -1
  25. package/dist/{chunk-EQUOHUYY.js → chunk-HPSSFPDP.js} +3 -2
  26. package/dist/chunk-HPSSFPDP.js.map +1 -0
  27. package/dist/{chunk-NGPXVSJ7.cjs → chunk-I7TANA3T.cjs} +17 -17
  28. package/dist/{chunk-NGPXVSJ7.cjs.map → chunk-I7TANA3T.cjs.map} +1 -1
  29. package/dist/{chunk-WZZD4CIN.cjs → chunk-IGIN7S7J.cjs} +4 -4
  30. package/dist/{chunk-WZZD4CIN.cjs.map → chunk-IGIN7S7J.cjs.map} +1 -1
  31. package/dist/{chunk-2QWKN424.js → chunk-KVUAUYOV.js} +3 -3
  32. package/dist/{chunk-2QWKN424.js.map → chunk-KVUAUYOV.js.map} +1 -1
  33. package/dist/{chunk-GBOLSZL6.js → chunk-MFNDUYSI.js} +3 -3
  34. package/dist/{chunk-GBOLSZL6.js.map → chunk-MFNDUYSI.js.map} +1 -1
  35. package/dist/{chunk-VAHE45RB.cjs → chunk-NBJTFFVY.cjs} +25 -25
  36. package/dist/{chunk-VAHE45RB.cjs.map → chunk-NBJTFFVY.cjs.map} +1 -1
  37. package/dist/{chunk-JK2VEZXY.js → chunk-NC5OJJ7J.js} +14 -13
  38. package/dist/chunk-NC5OJJ7J.js.map +1 -0
  39. package/dist/{chunk-XHP3PYRC.js → chunk-PQBLAVC3.js} +3 -3
  40. package/dist/{chunk-XHP3PYRC.js.map → chunk-PQBLAVC3.js.map} +1 -1
  41. package/dist/{chunk-4PIY7NPG.cjs → chunk-PSKJOI66.cjs} +4 -4
  42. package/dist/chunk-PSKJOI66.cjs.map +1 -0
  43. package/dist/{chunk-OPPDUZUL.cjs → chunk-Q4UAJHCH.cjs} +4 -4
  44. package/dist/{chunk-OPPDUZUL.cjs.map → chunk-Q4UAJHCH.cjs.map} +1 -1
  45. package/dist/{chunk-5TAWDJH2.js → chunk-Q5GKSNJQ.js} +4 -4
  46. package/dist/chunk-Q5GKSNJQ.js.map +1 -0
  47. package/dist/{chunk-YYOGSRHT.cjs → chunk-QZFOSTJU.cjs} +3 -2
  48. package/dist/chunk-QZFOSTJU.cjs.map +1 -0
  49. package/dist/{chunk-2NXLZIJF.cjs → chunk-SCGVY5IZ.cjs} +4 -4
  50. package/dist/{chunk-2NXLZIJF.cjs.map → chunk-SCGVY5IZ.cjs.map} +1 -1
  51. package/dist/{chunk-ABVH7BW4.js → chunk-USEYAK7Q.js} +39 -10
  52. package/dist/chunk-USEYAK7Q.js.map +1 -0
  53. package/dist/{chunk-LEU5TVX5.js → chunk-XDG66XR6.js} +4 -4
  54. package/dist/{chunk-LEU5TVX5.js.map → chunk-XDG66XR6.js.map} +1 -1
  55. package/dist/{chunk-TANPK7GG.cjs → chunk-XHDRHNLP.cjs} +129 -128
  56. package/dist/chunk-XHDRHNLP.cjs.map +1 -0
  57. package/dist/{chunk-FWN6TFXW.cjs → chunk-XHPHVJYC.cjs} +24 -24
  58. package/dist/{chunk-FWN6TFXW.cjs.map → chunk-XHPHVJYC.cjs.map} +1 -1
  59. package/dist/{chunk-WHOV7Q57.js → chunk-XIK72ACQ.js} +3 -3
  60. package/dist/{chunk-WHOV7Q57.js.map → chunk-XIK72ACQ.js.map} +1 -1
  61. package/dist/{chunk-EOUFX3SP.js → chunk-YUF2UULB.js} +4 -4
  62. package/dist/{chunk-EOUFX3SP.js.map → chunk-YUF2UULB.js.map} +1 -1
  63. package/dist/{chunk-PEDOEIWP.cjs → chunk-ZFWY6K7L.cjs} +5 -5
  64. package/dist/{chunk-PEDOEIWP.cjs.map → chunk-ZFWY6K7L.cjs.map} +1 -1
  65. package/dist/{chunk-ZMH2QD3D.js → chunk-ZGS4PKNB.js} +4 -4
  66. package/dist/{chunk-ZMH2QD3D.js.map → chunk-ZGS4PKNB.js.map} +1 -1
  67. package/dist/docs/SKILL.md +1 -1
  68. package/dist/docs/assets/SOURCE_MAP.json +1 -1
  69. package/dist/server/handlers/a2a.cjs +14 -14
  70. package/dist/server/handlers/a2a.js +1 -1
  71. package/dist/server/handlers/agent-builder.cjs +16 -16
  72. package/dist/server/handlers/agent-builder.js +1 -1
  73. package/dist/server/handlers/agents.cjs +41 -41
  74. package/dist/server/handlers/agents.d.ts +5 -0
  75. package/dist/server/handlers/agents.d.ts.map +1 -1
  76. package/dist/server/handlers/agents.js +1 -1
  77. package/dist/server/handlers/conversations.cjs +5 -5
  78. package/dist/server/handlers/conversations.js +1 -1
  79. package/dist/server/handlers/observability-new-endpoints.cjs +28 -28
  80. package/dist/server/handlers/observability-new-endpoints.js +1 -1
  81. package/dist/server/handlers/observability-storage-schemas.cjs +10 -6
  82. package/dist/server/handlers/observability-storage-schemas.d.ts +1 -0
  83. package/dist/server/handlers/observability-storage-schemas.d.ts.map +1 -1
  84. package/dist/server/handlers/observability-storage-schemas.js +1 -1
  85. package/dist/server/handlers/observability.cjs +42 -38
  86. package/dist/server/handlers/observability.d.ts +4 -0
  87. package/dist/server/handlers/observability.d.ts.map +1 -1
  88. package/dist/server/handlers/observability.js +2 -2
  89. package/dist/server/handlers/responses.cjs +4 -4
  90. package/dist/server/handlers/responses.js +1 -1
  91. package/dist/server/handlers/scores.cjs +7 -7
  92. package/dist/server/handlers/scores.js +1 -1
  93. package/dist/server/handlers/system.cjs +3 -3
  94. package/dist/server/handlers/system.js +1 -1
  95. package/dist/server/handlers/tools.cjs +6 -6
  96. package/dist/server/handlers/tools.js +1 -1
  97. package/dist/server/handlers/voice.cjs +8 -8
  98. package/dist/server/handlers/voice.js +1 -1
  99. package/dist/server/handlers/workflows.cjs +26 -26
  100. package/dist/server/handlers/workflows.js +1 -1
  101. package/dist/server/handlers.cjs +20 -20
  102. package/dist/server/handlers.js +10 -10
  103. package/dist/server/schemas/agents.d.ts +3 -0
  104. package/dist/server/schemas/agents.d.ts.map +1 -1
  105. package/dist/server/schemas/index.cjs +48 -48
  106. package/dist/server/schemas/index.js +1 -1
  107. package/dist/server/server-adapter/index.cjs +10 -10
  108. package/dist/server/server-adapter/index.js +2 -2
  109. package/dist/server/server-adapter/routes/observability.d.ts +2 -0
  110. package/dist/server/server-adapter/routes/observability.d.ts.map +1 -1
  111. package/package.json +4 -4
  112. package/dist/chunk-2J4KEVXS.cjs.map +0 -1
  113. package/dist/chunk-4PIY7NPG.cjs.map +0 -1
  114. package/dist/chunk-5TAWDJH2.js.map +0 -1
  115. package/dist/chunk-ABVH7BW4.js.map +0 -1
  116. package/dist/chunk-E6XT4Z7T.cjs.map +0 -1
  117. package/dist/chunk-EQUOHUYY.js.map +0 -1
  118. package/dist/chunk-F6H72YS6.cjs.map +0 -1
  119. package/dist/chunk-JK2VEZXY.js.map +0 -1
  120. package/dist/chunk-NF5SYJHK.js.map +0 -1
  121. package/dist/chunk-TANPK7GG.cjs.map +0 -1
  122. package/dist/chunk-X5A2TL4J.js.map +0 -1
  123. package/dist/chunk-YYOGSRHT.cjs.map +0 -1
package/CHANGELOG.md CHANGED
@@ -1,5 +1,51 @@
1
1
  # @mastra/server
2
2
 
3
+ ## 1.34.0-alpha.3
4
+
5
+ ### Minor Changes
6
+
7
+ - Added optional `metadata` to code-defined agents. Pass a `metadata` record to `new Agent({...})`, read it back with `agent.getMetadata()`, and clients can filter on it from the existing `/agents` and `/agents/:agentId` responses without encoding the data into IDs or names. ([#16603](https://github.com/mastra-ai/mastra/pull/16603))
8
+
9
+ Metadata supports the same `DynamicArgument` form as other agent config fields, so it can also be resolved per request from the request context.
10
+
11
+ Stored agents loaded via the editor also expose their metadata through `agent.getMetadata()`, so clients can filter these agents as well. Cloning a runtime agent via `editor.agent.clone()` now carries the source agent's metadata over to the stored clone when the caller does not provide one explicitly.
12
+
13
+ ```ts
14
+ // Static
15
+ const supportAgent = new Agent({
16
+ id: 'support-agent',
17
+ name: 'Support Agent',
18
+ instructions: 'You help customers with support requests.',
19
+ model: 'openai/gpt-5',
20
+ metadata: { type: 'support' },
21
+ });
22
+
23
+ supportAgent.getMetadata(); // { type: 'support' }
24
+
25
+ // Dynamic
26
+ const tenantAgent = new Agent({
27
+ id: 'tenant-agent',
28
+ name: 'Tenant Agent',
29
+ instructions: 'You help customers with tenant-specific tasks.',
30
+ model: 'openai/gpt-5',
31
+ metadata: ({ requestContext }) => ({
32
+ type: 'support',
33
+ tenant: requestContext.get('tenant'),
34
+ }),
35
+ });
36
+
37
+ await tenantAgent.getMetadata({ requestContext }); // { type: 'support', tenant: 'acme' }
38
+ ```
39
+
40
+ ### Patch Changes
41
+
42
+ - Expose `GET /observability/traces/light` and storage support for fetching paginated trace-list rows without span payload data. ([#16608](https://github.com/mastra-ai/mastra/pull/16608))
43
+
44
+ - `GET /api/observability/discovery/metric-names` and `GET /api/observability/discovery/metric-label-values` now accept `limit` as a URL query parameter without pre-parsing. Previously, passing `?limit=10` was rejected as a validation error; callers can now use these endpoints directly from HTTP clients, consistent with other query endpoints (e.g. pagination). ([#16489](https://github.com/mastra-ai/mastra/pull/16489))
45
+
46
+ - Updated dependencies [[`090a647`](https://github.com/mastra-ai/mastra/commit/090a647ba5a66d36f203f9f49457e03a1ff4e6fb), [`090a647`](https://github.com/mastra-ai/mastra/commit/090a647ba5a66d36f203f9f49457e03a1ff4e6fb), [`f84447d`](https://github.com/mastra-ai/mastra/commit/f84447d6c80f3471836a9b300d246b331fb47e0d), [`a1a5b3e`](https://github.com/mastra-ai/mastra/commit/a1a5b3e42ab2ca5161ea21db59ebf28442680fa7), [`af84f57`](https://github.com/mastra-ai/mastra/commit/af84f571ed762e92e8e61c5f9a72363520914274), [`8b3c6f9`](https://github.com/mastra-ai/mastra/commit/8b3c6f90f7879833ba7d1bc70937e1d8f69d0804)]:
47
+ - @mastra/core@1.34.0-alpha.3
48
+
3
49
  ## 1.34.0-alpha.2
4
50
 
5
51
  ### Patch Changes
@@ -2544,7 +2544,7 @@ type GetMetricPercentilesResponse = z.infer<typeof getMetricPercentilesResponseS
2544
2544
 
2545
2545
  declare const getMetricNamesArgsSchema: z.ZodObject<{
2546
2546
  prefix: z.ZodOptional<z.ZodString>;
2547
- limit: z.ZodOptional<z.ZodNumber>;
2547
+ limit: z.ZodOptional<z.ZodCoercedNumber<unknown>>;
2548
2548
  }, z.core.$strip>;
2549
2549
  type GetMetricNamesArgs = z.infer<typeof getMetricNamesArgsSchema>;
2550
2550
  declare const getMetricNamesResponseSchema: z.ZodObject<{
@@ -2563,7 +2563,7 @@ declare const getMetricLabelValuesArgsSchema: z.ZodObject<{
2563
2563
  metricName: z.ZodString;
2564
2564
  labelKey: z.ZodString;
2565
2565
  prefix: z.ZodOptional<z.ZodString>;
2566
- limit: z.ZodOptional<z.ZodNumber>;
2566
+ limit: z.ZodOptional<z.ZodCoercedNumber<unknown>>;
2567
2567
  }, z.core.$strip>;
2568
2568
  type GetMetricLabelValuesArgs = z.infer<typeof getMetricLabelValuesArgsSchema>;
2569
2569
  declare const getMetricLabelValuesResponseSchema: z.ZodObject<{
@@ -1,4 +1,4 @@
1
- import { SERVER_ROUTES } from './chunk-JK2VEZXY.js';
1
+ import { SERVER_ROUTES } from './chunk-NC5OJJ7J.js';
2
2
  import { schemaToJsonSchema } from './chunk-JNBGZHPM.js';
3
3
 
4
4
  // src/server/server-adapter/api-schema-manifest.ts
@@ -52,5 +52,5 @@ function buildApiSchemaManifest(routes = SERVER_ROUTES) {
52
52
  }
53
53
 
54
54
  export { buildApiSchemaManifest };
55
- //# sourceMappingURL=api-schema-manifest-ARDWBAEX.js.map
56
- //# sourceMappingURL=api-schema-manifest-ARDWBAEX.js.map
55
+ //# sourceMappingURL=api-schema-manifest-ONJGSFU6.js.map
56
+ //# sourceMappingURL=api-schema-manifest-ONJGSFU6.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/server/server-adapter/api-schema-manifest.ts"],"names":[],"mappings":";;;;AA2BA,SAAS,cAAc,MAAA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A;AAEL,EAAA,IAAI,YAAA,KAAiB,kBAAA,IAAsB,aAAA,CAAc,MAAA,IAAU,CAAA,CAAA,EAAI;AACrE,IAAA,OAAO,EAAE,IAAA,EAAM,iBAAA,EAAmB,YAAA,EAAc,kBAAA,EAAmB;AAAA,EACrE;AACA,EAAA,IAAI,cAAA,CAAe,wBAAwB,aAAA,CAAc,MAAA,KAAW,GAAG,OAAO,EAAE,MAAM,QAAA,EAAS;AAC/F,EAAA,OAAO,EAAE,MAAM,QAAA,EAAS;AAC1B;AAEA,SAAS,gBAAgB,KAAA,EAA6B;AACpD,EAAA,OAAO,KAAA,CAAM,YAAA,KAAiB,MAAA,IAAU,CAAC,KAAA,CAAM,UAAA;AACjD;AAEO,SAAS,sBAAA,CAAuB,SAAiC,aAAA,EAAkC;AACxG,EAAA,OAAO;AAAA,IACL,OAAA,EAAS,CAAA;AAAA,IACT,QAAQ,MAAA,CAAO,MAAA,CAAO,eAAe,CAAA,CAAE,IAAI,CAAA,KAAA,KAAS;AAClD,MAAA,MAAM,cAAA,GAAiB,aAAA,CAAc,KAAA,CAAM,cAAc,CAAA;AACzD,MAAA,OAAO;AAAA,QACL,QAAQ,KAAA,CAAM,MAAA;AAAA,QACd,MAAM,KAAA,CAAM,IAAA;AAAA,QACZ,cAAc,KAAA,CAAM,YAAA;AAAA,QACpB,eAAA,EAAiB,aAAA,CAAc,KAAA,CAAM,eAAe,CAAA;AAAA,QACpD,gBAAA,EAAkB,aAAA,CAAc,KAAA,CAAM,gBAAgB,CAAA;AAAA,QACtD,UAAA,EAAY,aAAA,CAAc,KAAA,CAAM,UAAU,CAAA;AAAA,QAC1C,cAAA;AAAA,QACA,aAAA,EAAe,mBAAmB,cAAc;AAAA,OAClD;AAAA,IACF,CAAC;AAAA,GACH;AACF","file":"api-schema-manifest-ARDWBAEX.js","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"]}
1
+ {"version":3,"sources":["../src/server/server-adapter/api-schema-manifest.ts"],"names":[],"mappings":";;;;AA2BA,SAAS,cAAc,MAAA,EAA4D;AACjF,EAAA,OAAO,MAAA,GAAS,kBAAA,CAAmB,MAAM,CAAA,GAAI,MAAA;AAC/C;AAEA,SAAS,aAAa,KAAA,EAAyC;AAC7D,EAAA,OAAO,KAAA,IAAS,OAAO,KAAA,KAAU,QAAA,IAAY,CAAC,KAAA,CAAM,OAAA,CAAQ,KAAK,CAAA,GAAK,KAAA,GAAwB,MAAA;AAChG;AAEA,SAAS,WAAW,MAAA,EAAkE;AACpF,EAAA,MAAM,OAAO,MAAA,EAAQ,IAAA;AACrB,EAAA,OAAO,MAAM,OAAA,CAAQ,IAAI,IAAI,IAAA,CAAK,IAAA,CAAK,OAAO,CAAA,GAAI,IAAA;AACpD;AAEA,SAAS,mBAAmB,cAAA,EAAiE;AAC3F,EAAA,IAAI,CAAC,cAAA,EAAgB,OAAO,EAAE,MAAM,SAAA,EAAU;AAE9C,EAAA,MAAM,IAAA,GAAO,WAAW,cAAc,CAAA;AACtC,EAAA,IAAI,IAAA,KAAS,OAAA,EAAS,OAAO,EAAE,MAAM,OAAA,EAAQ;AAC7C,EAAA,IAAI,IAAA,KAAS,QAAA,EAAU,OAAO,EAAE,MAAM,QAAA,EAAS;AAE/C,EAAA,MAAM,UAAA,GACJ,cAAA,CAAe,UAAA,IAAc,CAAC,KAAA,CAAM,OAAA,CAAQ,cAAA,CAAe,UAAU,CAAA,GAAI,cAAA,CAAe,UAAA,GAAa,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Ae,CAAA;AAAA,QACpD,gBAAA,EAAkB,aAAA,CAAc,KAAA,CAAM,gBAAgB,CAAA;AAAA,QACtD,UAAA,EAAY,aAAA,CAAc,KAAA,CAAM,UAAU,CAAA;AAAA,QAC1C,cAAA;AAAA,QACA,aAAA,EAAe,mBAAmB,cAAc;AAAA,OAClD;AAAA,IACF,CAAC;AAAA,GACH;AACF","file":"api-schema-manifest-ONJGSFU6.js","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"]}
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- var chunkTANPK7GG_cjs = require('./chunk-TANPK7GG.cjs');
3
+ var chunkXHDRHNLP_cjs = require('./chunk-XHDRHNLP.cjs');
4
4
  var chunkQO4NGLIB_cjs = require('./chunk-QO4NGLIB.cjs');
5
5
 
6
6
  // src/server/server-adapter/api-schema-manifest.ts
@@ -34,7 +34,7 @@ function inferResponseShape(responseSchema) {
34
34
  function isManifestRoute(route) {
35
35
  return route.responseType === "json" && !route.deprecated;
36
36
  }
37
- function buildApiSchemaManifest(routes = chunkTANPK7GG_cjs.SERVER_ROUTES) {
37
+ function buildApiSchemaManifest(routes = chunkXHDRHNLP_cjs.SERVER_ROUTES) {
38
38
  return {
39
39
  version: 1,
40
40
  routes: routes.filter(isManifestRoute).map((route) => {
@@ -54,5 +54,5 @@ function buildApiSchemaManifest(routes = chunkTANPK7GG_cjs.SERVER_ROUTES) {
54
54
  }
55
55
 
56
56
  exports.buildApiSchemaManifest = buildApiSchemaManifest;
57
- //# sourceMappingURL=api-schema-manifest-5NSXA7KL.cjs.map
58
- //# sourceMappingURL=api-schema-manifest-5NSXA7KL.cjs.map
57
+ //# sourceMappingURL=api-schema-manifest-RW2XKWHV.cjs.map
58
+ //# sourceMappingURL=api-schema-manifest-RW2XKWHV.cjs.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/server/server-adapter/api-schema-manifest.ts"],"names":["schemaToJsonSchema","SERVER_ROUTES"],"mappings":";;;;;;AA2BA,SAAS,cAAc,MAAA,EAA4D;AACjF,EAAA,OAAO,MAAA,GAASA,oCAAA,CAAmB,MAAM,CAAA,GAAI,MAAA;AAC/C;AAEA,SAAS,aAAa,KAAA,EAAyC;AAC7D,EAAA,OAAO,KAAA,IAAS,OAAO,KAAA,KAAU,QAAA,IAAY,CAAC,KAAA,CAAM,OAAA,CAAQ,KAAK,CAAA,GAAK,KAAA,GAAwB,MAAA;AAChG;AAEA,SAAS,WAAW,MAAA,EAAkE;AACpF,EAAA,MAAM,OAAO,MAAA,EAAQ,IAAA;AACrB,EAAA,OAAO,MAAM,OAAA,CAAQ,IAAI,IAAI,IAAA,CAAK,IAAA,CAAK,OAAO,CAAA,GAAI,IAAA;AACpD;AAEA,SAAS,mBAAmB,cAAA,EAAiE;AAC3F,EAAA,IAAI,CAAC,cAAA,EAAgB,OAAO,EAAE,MAAM,SAAA,EAAU;AAE9C,EAAA,MAAM,IAAA,GAAO,WAAW,cAAc,CAAA;AACtC,EAAA,IAAI,IAAA,KAAS,OAAA,EAAS,OAAO,EAAE,MAAM,OAAA,EAAQ;AAC7C,EAAA,IAAI,IAAA,KAAS,QAAA,EAAU,OAAO,EAAE,MAAM,QAAA,EAAS;AAE/C,EAAA,MAAM,UAAA,GACJ,cAAA,CAAe,UAAA,IAAc,CAAC,KAAA,CAAM,OAAA,CAAQ,cAAA,CAAe,UAAU,CAAA,GAAI,cAAA,CAAe,UAAA,GAAa,EAAC;AACxG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;AAAA,QACpD,gBAAA,EAAkB,aAAA,CAAc,KAAA,CAAM,gBAAgB,CAAA;AAAA,QACtD,UAAA,EAAY,aAAA,CAAc,KAAA,CAAM,UAAU,CAAA;AAAA,QAC1C,cAAA;AAAA,QACA,aAAA,EAAe,mBAAmB,cAAc;AAAA,OAClD;AAAA,IACF,CAAC;AAAA,GACH;AACF","file":"api-schema-manifest-5NSXA7KL.cjs","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"]}
1
+ {"version":3,"sources":["../src/server/server-adapter/api-schema-manifest.ts"],"names":["schemaToJsonSchema","SERVER_ROUTES"],"mappings":";;;;;;AA2BA,SAAS,cAAc,MAAA,EAA4D;AACjF,EAAA,OAAO,MAAA,GAASA,oCAAA,CAAmB,MAAM,CAAA,GAAI,MAAA;AAC/C;AAEA,SAAS,aAAa,KAAA,EAAyC;AAC7D,EAAA,OAAO,KAAA,IAAS,OAAO,KAAA,KAAU,QAAA,IAAY,CAAC,KAAA,CAAM,OAAA,CAAQ,KAAK,CAAA,GAAK,KAAA,GAAwB,MAAA;AAChG;AAEA,SAAS,WAAW,MAAA,EAAkE;AACpF,EAAA,MAAM,OAAO,MAAA,EAAQ,IAAA;AACrB,EAAA,OAAO,MAAM,OAAA,CAAQ,IAAI,IAAI,IAAA,CAAK,IAAA,CAAK,OAAO,CAAA,GAAI,IAAA;AACpD;AAEA,SAAS,mBAAmB,cAAA,EAAiE;AAC3F,EAAA,IAAI,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BAAA,EAAkC;AACxG,EAAA,OAAO;AAAA,IACL,OAAA,EAAS,CAAA;AAAA,IACT,QAAQ,MAAA,CAAO,MAAA,CAAO,eAAe,CAAA,CAAE,IAAI,CAAA,KAAA,KAAS;AAClD,MAAA,MAAM,cAAA,GAAiB,aAAA,CAAc,KAAA,CAAM,cAAc,CAAA;AACzD,MAAA,OAAO;AAAA,QACL,QAAQ,KAAA,CAAM,MAAA;AAAA,QACd,MAAM,KAAA,CAAM,IAAA;AAAA,QACZ,cAAc,KAAA,CAAM,YAAA;AAAA,QACpB,eAAA,EAAiB,aAAA,CAAc,KAAA,CAAM,eAAe,CAAA;AAAA,QACpD,gBAAA,EAAkB,aAAA,CAAc,KAAA,CAAM,gBAAgB,CAAA;AAAA,QACtD,UAAA,EAAY,aAAA,CAAc,KAAA,CAAM,UAAU,CAAA;AAAA,QAC1C,cAAA;AAAA,QACA,aAAA,EAAe,mBAAmB,cAAc;AAAA,OAClD;AAAA,IACF,CAAC;AAAA,GACH;AACF","file":"api-schema-manifest-RW2XKWHV.cjs","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"]}
@@ -1,5 +1,5 @@
1
1
  import { listWorkflowsResponseSchema, workflowInfoSchema, workflowIdPathParams, workflowRunsResponseSchema, listWorkflowRunsQuerySchema, workflowRunResultSchema, workflowRunResultQuerySchema, workflowRunPathParams, workflowControlResponseSchema, createWorkflowRunResponseSchema, createWorkflowRunBodySchema, streamWorkflowBodySchema, resumeBodySchema, workflowExecutionResultSchema, startAsyncWorkflowBodySchema, observeWorkflowQuerySchema, restartBodySchema, timeTravelBodySchema } from './chunk-5OOYXBPG.js';
2
- import { streamResponseSchema } from './chunk-EQUOHUYY.js';
2
+ import { streamResponseSchema } from './chunk-HPSSFPDP.js';
3
3
  import { getWorkflowInfo, WorkflowRegistry } from './chunk-YHRGDSTK.js';
4
4
  import { getEffectiveResourceId, validateRunOwnership } from './chunk-JOUPK2UV.js';
5
5
  import { MastraFGAPermissions } from './chunk-6KDKASVR.js';
@@ -1070,5 +1070,5 @@ var RECEIVE_WORKFLOW_EVENT_ROUTE = createRoute({
1070
1070
  });
1071
1071
 
1072
1072
  export { CANCEL_WORKFLOW_RUN_ROUTE, CREATE_WORKFLOW_RUN_ROUTE, DELETE_WORKFLOW_RUN_BY_ID_ROUTE, EXECUTE_WORKFLOW_STEP_ROUTE, GET_WORKFLOW_BY_ID_ROUTE, GET_WORKFLOW_RUN_BY_ID_ROUTE, LIST_WORKFLOWS_ROUTE, LIST_WORKFLOW_RUNS_ROUTE, OBSERVE_STREAM_LEGACY_WORKFLOW_ROUTE, OBSERVE_STREAM_WORKFLOW_ROUTE, RECEIVE_WORKFLOW_EVENT_ROUTE, RESTART_ALL_ACTIVE_WORKFLOW_RUNS_ASYNC_ROUTE, RESTART_ALL_ACTIVE_WORKFLOW_RUNS_ROUTE, RESTART_ASYNC_WORKFLOW_ROUTE, RESTART_WORKFLOW_ROUTE, RESUME_ASYNC_WORKFLOW_ROUTE, RESUME_STREAM_WORKFLOW_ROUTE, RESUME_WORKFLOW_ROUTE, START_ASYNC_WORKFLOW_ROUTE, START_WORKFLOW_RUN_ROUTE, STREAM_LEGACY_WORKFLOW_ROUTE, STREAM_WORKFLOW_ROUTE, TIME_TRAVEL_ASYNC_WORKFLOW_ROUTE, TIME_TRAVEL_STREAM_WORKFLOW_ROUTE, TIME_TRAVEL_WORKFLOW_ROUTE, workflows_exports };
1073
- //# sourceMappingURL=chunk-ESNUQDZF.js.map
1074
- //# sourceMappingURL=chunk-ESNUQDZF.js.map
1073
+ //# sourceMappingURL=chunk-3LMGA7MG.js.map
1074
+ //# sourceMappingURL=chunk-3LMGA7MG.js.map