@mastra/server 1.82.0-alpha.2 → 1.82.0

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 (265) hide show
  1. package/dist/_types/@mastra_schema-compat@1.3.17/dist/_types/{@internal_ai-sdk-v5@0.0.94 → @internal_ai-sdk-v5@0.0.95}/dist/index.d.ts +1 -1
  2. package/dist/_types/@mastra_schema-compat@1.3.17/dist/_types/{@internal_ai-v6@0.0.94 → @internal_ai-v6@0.0.95}/dist/index.d.ts +3 -3
  3. package/dist/_types/@mastra_schema-compat@1.3.17/dist/provider-compats/anthropic.d.ts +1 -1
  4. package/dist/_types/@mastra_schema-compat@1.3.17/dist/provider-compats/deepseek.d.ts +1 -1
  5. package/dist/_types/@mastra_schema-compat@1.3.17/dist/provider-compats/meta.d.ts +1 -1
  6. package/dist/_types/@mastra_schema-compat@1.3.17/dist/schema.types.d.ts +3 -3
  7. package/dist/{a2a-C_2w6OWn.js → a2a-CoiG3TAj.js} +3 -3
  8. package/dist/{a2a-C_2w6OWn.js.map → a2a-CoiG3TAj.js.map} +1 -1
  9. package/dist/{a2a-CNfj0wRr.cjs → a2a-DvqRdny6.cjs} +3 -3
  10. package/dist/{a2a-CNfj0wRr.cjs.map → a2a-DvqRdny6.cjs.map} +1 -1
  11. package/dist/{agent-builder-CrFZJ1mg.js → agent-builder-C_L1i2eE.js} +43 -40
  12. package/dist/agent-builder-C_L1i2eE.js.map +1 -0
  13. package/dist/{agent-builder-B7B1DSP9.cjs → agent-builder-D0Up9Fw1.cjs} +43 -40
  14. package/dist/agent-builder-D0Up9Fw1.cjs.map +1 -0
  15. package/dist/{agents-DPvMjiDf.js → agents-CgcW6lHt.js} +5 -4
  16. package/dist/agents-CgcW6lHt.js.map +1 -0
  17. package/dist/{agents-Cp4FBxQB.cjs → agents-DOHGWXDa.cjs} +5 -4
  18. package/dist/agents-DOHGWXDa.cjs.map +1 -0
  19. package/dist/{api-schema-manifest-BTfM-0md.js → api-schema-manifest-Ci2qUYHc.js} +2 -2
  20. package/dist/{api-schema-manifest-BTfM-0md.js.map → api-schema-manifest-Ci2qUYHc.js.map} +1 -1
  21. package/dist/{api-schema-manifest-C55f0tmn.cjs → api-schema-manifest-DCHOlOuJ.cjs} +2 -2
  22. package/dist/{api-schema-manifest-C55f0tmn.cjs.map → api-schema-manifest-DCHOlOuJ.cjs.map} +1 -1
  23. package/dist/{builder-registry-CkPRx_vx.cjs → builder-registry-D1_hGKCJ.cjs} +2 -2
  24. package/dist/{builder-registry-CkPRx_vx.cjs.map → builder-registry-D1_hGKCJ.cjs.map} +1 -1
  25. package/dist/{builder-registry-6TFaV4oT.js → builder-registry-m_gHCe12.js} +2 -2
  26. package/dist/{builder-registry-6TFaV4oT.js.map → builder-registry-m_gHCe12.js.map} +1 -1
  27. package/dist/{conversations-6DxLemUg.cjs → conversations-Ch_VuVwY.cjs} +2 -2
  28. package/dist/{conversations-6DxLemUg.cjs.map → conversations-Ch_VuVwY.cjs.map} +1 -1
  29. package/dist/{conversations-DDMCe7th.js → conversations-xS7yHuG1.js} +2 -2
  30. package/dist/{conversations-DDMCe7th.js.map → conversations-xS7yHuG1.js.map} +1 -1
  31. package/dist/{dist-CzWU4AmA.cjs → dist-BKNKucT9.cjs} +422 -286
  32. package/dist/dist-BKNKucT9.cjs.map +1 -0
  33. package/dist/{dist-DDo4vt34.js → dist-CIYZuix4.js} +422 -286
  34. package/dist/dist-CIYZuix4.js.map +1 -0
  35. package/dist/{dist-CjEJaGGe.cjs → dist-DgKeISkr.cjs} +1 -1
  36. package/dist/dist-mNQb9_wX.js +1 -0
  37. package/dist/docs/SKILL.md +1 -1
  38. package/dist/docs/assets/SOURCE_MAP.json +1 -1
  39. package/dist/{editor-builder-BO0Pebws.cjs → editor-builder-CKfy5eZY.cjs} +2 -2
  40. package/dist/{editor-builder-BO0Pebws.cjs.map → editor-builder-CKfy5eZY.cjs.map} +1 -1
  41. package/dist/{editor-builder-CuT_ltBK.js → editor-builder-Ceen28s8.js} +2 -2
  42. package/dist/{editor-builder-CuT_ltBK.js.map → editor-builder-Ceen28s8.js.map} +1 -1
  43. package/dist/{knowledge-DykIi0wH.js → knowledge-Ba74qr0v.js} +89 -2
  44. package/dist/knowledge-Ba74qr0v.js.map +1 -0
  45. package/dist/{knowledge-qu0om3W7.cjs → knowledge-urR7FFG8.cjs} +100 -1
  46. package/dist/knowledge-urR7FFG8.cjs.map +1 -0
  47. package/dist/{plans-UPUTbvxx.cjs → plans-Djcp3C0d.cjs} +2 -2
  48. package/dist/{plans-UPUTbvxx.cjs.map → plans-Djcp3C0d.cjs.map} +1 -1
  49. package/dist/{plans-k4FuteiT.js → plans-nHOnlGzr.js} +2 -2
  50. package/dist/{plans-k4FuteiT.js.map → plans-nHOnlGzr.js.map} +1 -1
  51. package/dist/{probe-image-size-BRHrC0Va.cjs → probe-image-size-BAwk1h6w.cjs} +2 -2
  52. package/dist/{probe-image-size-BRHrC0Va.cjs.map → probe-image-size-BAwk1h6w.cjs.map} +1 -1
  53. package/dist/{probe-image-size-BmIt3CH4.js → probe-image-size-DGTRKrgq.js} +2 -2
  54. package/dist/{probe-image-size-BmIt3CH4.js.map → probe-image-size-DGTRKrgq.js.map} +1 -1
  55. package/dist/{responses-opDOcZYI.cjs → responses-BdOStKtX.cjs} +2 -2
  56. package/dist/{responses-opDOcZYI.cjs.map → responses-BdOStKtX.cjs.map} +1 -1
  57. package/dist/{responses-C8HCkptA.js → responses-CEet9y8G.js} +2 -2
  58. package/dist/{responses-C8HCkptA.js.map → responses-CEet9y8G.js.map} +1 -1
  59. package/dist/{routes-BCoCimCB.js → routes-5FpkkzND.js} +15 -13
  60. package/dist/routes-5FpkkzND.js.map +1 -0
  61. package/dist/{routes-FKc6a2N0.cjs → routes-DU_FlwJP.cjs} +15 -13
  62. package/dist/routes-DU_FlwJP.cjs.map +1 -0
  63. package/dist/{scores-CrpJomkR.js → scores-BaDFGpmr.js} +2 -2
  64. package/dist/{scores-CrpJomkR.js.map → scores-BaDFGpmr.js.map} +1 -1
  65. package/dist/{scores-CNMXAquK.cjs → scores-Bw6Tuga5.cjs} +2 -2
  66. package/dist/{scores-CNMXAquK.cjs.map → scores-Bw6Tuga5.cjs.map} +1 -1
  67. package/dist/server/handlers/a2a.cjs +1 -1
  68. package/dist/server/handlers/a2a.js +1 -1
  69. package/dist/server/handlers/agent-builder.cjs +1 -1
  70. package/dist/server/handlers/agent-builder.d.ts.map +1 -1
  71. package/dist/server/handlers/agent-builder.js +1 -1
  72. package/dist/server/handlers/agent-versions.cjs +1 -1
  73. package/dist/server/handlers/agent-versions.js +1 -1
  74. package/dist/server/handlers/agents.cjs +1 -1
  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/builder-registry.cjs +1 -1
  78. package/dist/server/handlers/builder-registry.js +1 -1
  79. package/dist/server/handlers/conversations.cjs +1 -1
  80. package/dist/server/handlers/conversations.js +1 -1
  81. package/dist/server/handlers/editor-builder.cjs +1 -1
  82. package/dist/server/handlers/editor-builder.js +1 -1
  83. package/dist/server/handlers/favorites-enrichment.cjs +1 -1
  84. package/dist/server/handlers/favorites-enrichment.js +1 -1
  85. package/dist/server/handlers/knowledge.cjs +3 -1
  86. package/dist/server/handlers/knowledge.d.ts +95 -0
  87. package/dist/server/handlers/knowledge.d.ts.map +1 -1
  88. package/dist/server/handlers/knowledge.js +1 -1
  89. package/dist/server/handlers/mcp-client-versions.cjs +1 -1
  90. package/dist/server/handlers/mcp-client-versions.js +1 -1
  91. package/dist/server/handlers/plans.cjs +1 -1
  92. package/dist/server/handlers/plans.js +1 -1
  93. package/dist/server/handlers/prompt-block-versions.cjs +1 -1
  94. package/dist/server/handlers/prompt-block-versions.js +1 -1
  95. package/dist/server/handlers/responses.cjs +1 -1
  96. package/dist/server/handlers/responses.js +1 -1
  97. package/dist/server/handlers/scorer-versions.cjs +1 -1
  98. package/dist/server/handlers/scorer-versions.js +1 -1
  99. package/dist/server/handlers/scores.cjs +1 -1
  100. package/dist/server/handlers/scores.js +1 -1
  101. package/dist/server/handlers/stored-agent-favorites.cjs +2 -2
  102. package/dist/server/handlers/stored-agent-favorites.js +2 -2
  103. package/dist/server/handlers/stored-agents.cjs +2 -2
  104. package/dist/server/handlers/stored-agents.js +2 -2
  105. package/dist/server/handlers/stored-mcp-clients.cjs +1 -1
  106. package/dist/server/handlers/stored-mcp-clients.js +1 -1
  107. package/dist/server/handlers/stored-prompt-blocks.cjs +1 -1
  108. package/dist/server/handlers/stored-prompt-blocks.js +1 -1
  109. package/dist/server/handlers/stored-scorers.cjs +1 -1
  110. package/dist/server/handlers/stored-scorers.js +1 -1
  111. package/dist/server/handlers/stored-skill-favorites.cjs +2 -2
  112. package/dist/server/handlers/stored-skill-favorites.js +2 -2
  113. package/dist/server/handlers/stored-skills.cjs +2 -2
  114. package/dist/server/handlers/stored-skills.js +2 -2
  115. package/dist/server/handlers/stored-workspaces.cjs +1 -1
  116. package/dist/server/handlers/stored-workspaces.js +1 -1
  117. package/dist/server/handlers/system.cjs +1 -1
  118. package/dist/server/handlers/system.js +1 -1
  119. package/dist/server/handlers/tools.cjs +1 -1
  120. package/dist/server/handlers/tools.js +1 -1
  121. package/dist/server/handlers/validate-agent-instructions.cjs +1 -1
  122. package/dist/server/handlers/validate-agent-instructions.js +1 -1
  123. package/dist/server/handlers/workflows.cjs +1 -1
  124. package/dist/server/handlers/workflows.js +1 -1
  125. package/dist/server/handlers.cjs +9 -9
  126. package/dist/server/handlers.js +9 -9
  127. package/dist/server/schemas/agents.d.ts +1 -1
  128. package/dist/server/schemas/knowledge.d.ts +29 -0
  129. package/dist/server/schemas/knowledge.d.ts.map +1 -1
  130. package/dist/server/server-adapter/index.cjs +51 -3
  131. package/dist/server/server-adapter/index.cjs.map +1 -1
  132. package/dist/server/server-adapter/index.js +51 -3
  133. package/dist/server/server-adapter/index.js.map +1 -1
  134. package/dist/server/server-adapter/routes/knowledge.d.ts +93 -0
  135. package/dist/server/server-adapter/routes/knowledge.d.ts.map +1 -1
  136. package/dist/server/utils.d.ts +13 -7
  137. package/dist/server/utils.d.ts.map +1 -1
  138. package/dist/{tools-DP3yJsX7.js → tools-BAmCNGM5.js} +3 -3
  139. package/dist/{tools-DP3yJsX7.js.map → tools-BAmCNGM5.js.map} +1 -1
  140. package/dist/{tools-C6TLcPmD.cjs → tools-CI5oeJWT.cjs} +3 -3
  141. package/dist/{tools-C6TLcPmD.cjs.map → tools-CI5oeJWT.cjs.map} +1 -1
  142. package/dist/{utils-bQ6Jhog6.cjs → utils-BhBJHsqX.cjs} +45 -24
  143. package/dist/{utils-bQ6Jhog6.cjs.map → utils-BhBJHsqX.cjs.map} +1 -1
  144. package/dist/{utils-qaBKOShQ.js → utils-Dy_dQTlK.js} +45 -24
  145. package/dist/{utils-qaBKOShQ.js.map → utils-Dy_dQTlK.js.map} +1 -1
  146. package/dist/{workflows-DrDssVnE.js → workflows-BxXS5AfE.js} +3 -3
  147. package/dist/workflows-BxXS5AfE.js.map +1 -0
  148. package/dist/{workflows-CJxQkruy.cjs → workflows-Cdi6w8JW.cjs} +3 -3
  149. package/dist/workflows-Cdi6w8JW.cjs.map +1 -0
  150. package/package.json +13 -13
  151. package/dist/agent-builder-B7B1DSP9.cjs.map +0 -1
  152. package/dist/agent-builder-CrFZJ1mg.js.map +0 -1
  153. package/dist/agents-Cp4FBxQB.cjs.map +0 -1
  154. package/dist/agents-DPvMjiDf.js.map +0 -1
  155. package/dist/dist-CzWU4AmA.cjs.map +0 -1
  156. package/dist/dist-DDo4vt34.js.map +0 -1
  157. package/dist/dist-FafoYsHK.js +0 -1
  158. package/dist/knowledge-DykIi0wH.js.map +0 -1
  159. package/dist/knowledge-qu0om3W7.cjs.map +0 -1
  160. package/dist/routes-BCoCimCB.js.map +0 -1
  161. package/dist/routes-FKc6a2N0.cjs.map +0 -1
  162. package/dist/workflows-CJxQkruy.cjs.map +0 -1
  163. package/dist/workflows-DrDssVnE.js.map +0 -1
  164. /package/dist/_types/{@internal_voice@0.0.43 → @internal_voice@0.0.44}/dist/_types/@internal_core@0.1.4/dist/request-context/index.d.ts +0 -0
  165. /package/dist/_types/{@internal_voice@0.0.43 → @internal_voice@0.0.44}/dist/_types/@internal_core@0.1.4/dist/routes/index.d.ts +0 -0
  166. /package/dist/_types/{@internal_voice@0.0.43 → @internal_voice@0.0.44}/dist/_types/@internal_core@0.1.4/dist/types/index.d.ts +0 -0
  167. /package/dist/_types/{@internal_voice@0.0.43 → @internal_voice@0.0.44}/dist/_types/zod@4.6.7/v4/classic/checks.d.ts +0 -0
  168. /package/dist/_types/{@internal_voice@0.0.43 → @internal_voice@0.0.44}/dist/_types/zod@4.6.7/v4/classic/coerce.d.ts +0 -0
  169. /package/dist/_types/{@internal_voice@0.0.43 → @internal_voice@0.0.44}/dist/_types/zod@4.6.7/v4/classic/compat.d.ts +0 -0
  170. /package/dist/_types/{@internal_voice@0.0.43 → @internal_voice@0.0.44}/dist/_types/zod@4.6.7/v4/classic/deep-partial.d.ts +0 -0
  171. /package/dist/_types/{@internal_voice@0.0.43 → @internal_voice@0.0.44}/dist/_types/zod@4.6.7/v4/classic/errors.d.ts +0 -0
  172. /package/dist/_types/{@internal_voice@0.0.43 → @internal_voice@0.0.44}/dist/_types/zod@4.6.7/v4/classic/external.d.ts +0 -0
  173. /package/dist/_types/{@internal_voice@0.0.43 → @internal_voice@0.0.44}/dist/_types/zod@4.6.7/v4/classic/from-json-schema.d.ts +0 -0
  174. /package/dist/_types/{@internal_voice@0.0.43 → @internal_voice@0.0.44}/dist/_types/zod@4.6.7/v4/classic/in-out.d.ts +0 -0
  175. /package/dist/_types/{@internal_voice@0.0.43 → @internal_voice@0.0.44}/dist/_types/zod@4.6.7/v4/classic/index.d.ts +0 -0
  176. /package/dist/_types/{@internal_voice@0.0.43 → @internal_voice@0.0.44}/dist/_types/zod@4.6.7/v4/classic/iso.d.ts +0 -0
  177. /package/dist/_types/{@internal_voice@0.0.43 → @internal_voice@0.0.44}/dist/_types/zod@4.6.7/v4/classic/parse.d.ts +0 -0
  178. /package/dist/_types/{@internal_voice@0.0.43 → @internal_voice@0.0.44}/dist/_types/zod@4.6.7/v4/classic/schemas.d.ts +0 -0
  179. /package/dist/_types/{@internal_voice@0.0.43 → @internal_voice@0.0.44}/dist/_types/zod@4.6.7/v4/core/api.d.ts +0 -0
  180. /package/dist/_types/{@internal_voice@0.0.43 → @internal_voice@0.0.44}/dist/_types/zod@4.6.7/v4/core/checks.d.ts +0 -0
  181. /package/dist/_types/{@internal_voice@0.0.43 → @internal_voice@0.0.44}/dist/_types/zod@4.6.7/v4/core/compile.d.ts +0 -0
  182. /package/dist/_types/{@internal_voice@0.0.43 → @internal_voice@0.0.44}/dist/_types/zod@4.6.7/v4/core/core.d.ts +0 -0
  183. /package/dist/_types/{@internal_voice@0.0.43 → @internal_voice@0.0.44}/dist/_types/zod@4.6.7/v4/core/doc.d.ts +0 -0
  184. /package/dist/_types/{@internal_voice@0.0.43 → @internal_voice@0.0.44}/dist/_types/zod@4.6.7/v4/core/errors.d.ts +0 -0
  185. /package/dist/_types/{@internal_voice@0.0.43 → @internal_voice@0.0.44}/dist/_types/zod@4.6.7/v4/core/index.d.ts +0 -0
  186. /package/dist/_types/{@internal_voice@0.0.43 → @internal_voice@0.0.44}/dist/_types/zod@4.6.7/v4/core/json-schema-generator.d.ts +0 -0
  187. /package/dist/_types/{@internal_voice@0.0.43 → @internal_voice@0.0.44}/dist/_types/zod@4.6.7/v4/core/json-schema-processors.d.ts +0 -0
  188. /package/dist/_types/{@internal_voice@0.0.43 → @internal_voice@0.0.44}/dist/_types/zod@4.6.7/v4/core/json-schema.d.ts +0 -0
  189. /package/dist/_types/{@internal_voice@0.0.43 → @internal_voice@0.0.44}/dist/_types/zod@4.6.7/v4/core/memoizer.d.ts +0 -0
  190. /package/dist/_types/{@internal_voice@0.0.43 → @internal_voice@0.0.44}/dist/_types/zod@4.6.7/v4/core/parse.d.ts +0 -0
  191. /package/dist/_types/{@internal_voice@0.0.43 → @internal_voice@0.0.44}/dist/_types/zod@4.6.7/v4/core/regexes.d.ts +0 -0
  192. /package/dist/_types/{@internal_voice@0.0.43 → @internal_voice@0.0.44}/dist/_types/zod@4.6.7/v4/core/registries.d.ts +0 -0
  193. /package/dist/_types/{@internal_voice@0.0.43 → @internal_voice@0.0.44}/dist/_types/zod@4.6.7/v4/core/schemas.d.ts +0 -0
  194. /package/dist/_types/{@internal_voice@0.0.43 → @internal_voice@0.0.44}/dist/_types/zod@4.6.7/v4/core/standard-schema.d.ts +0 -0
  195. /package/dist/_types/{@internal_voice@0.0.43 → @internal_voice@0.0.44}/dist/_types/zod@4.6.7/v4/core/to-json-schema.d.ts +0 -0
  196. /package/dist/_types/{@internal_voice@0.0.43 → @internal_voice@0.0.44}/dist/_types/zod@4.6.7/v4/core/util.d.ts +0 -0
  197. /package/dist/_types/{@internal_voice@0.0.43 → @internal_voice@0.0.44}/dist/_types/zod@4.6.7/v4/core/versions.d.ts +0 -0
  198. /package/dist/_types/{@internal_voice@0.0.43 → @internal_voice@0.0.44}/dist/_types/zod@4.6.7/v4/index.d.cts +0 -0
  199. /package/dist/_types/{@internal_voice@0.0.43 → @internal_voice@0.0.44}/dist/_types/zod@4.6.7/v4/locales/ar.d.ts +0 -0
  200. /package/dist/_types/{@internal_voice@0.0.43 → @internal_voice@0.0.44}/dist/_types/zod@4.6.7/v4/locales/az.d.ts +0 -0
  201. /package/dist/_types/{@internal_voice@0.0.43 → @internal_voice@0.0.44}/dist/_types/zod@4.6.7/v4/locales/be.d.ts +0 -0
  202. /package/dist/_types/{@internal_voice@0.0.43 → @internal_voice@0.0.44}/dist/_types/zod@4.6.7/v4/locales/bg.d.ts +0 -0
  203. /package/dist/_types/{@internal_voice@0.0.43 → @internal_voice@0.0.44}/dist/_types/zod@4.6.7/v4/locales/bn.d.ts +0 -0
  204. /package/dist/_types/{@internal_voice@0.0.43 → @internal_voice@0.0.44}/dist/_types/zod@4.6.7/v4/locales/ca.d.ts +0 -0
  205. /package/dist/_types/{@internal_voice@0.0.43 → @internal_voice@0.0.44}/dist/_types/zod@4.6.7/v4/locales/ckb.d.ts +0 -0
  206. /package/dist/_types/{@internal_voice@0.0.43 → @internal_voice@0.0.44}/dist/_types/zod@4.6.7/v4/locales/cs.d.ts +0 -0
  207. /package/dist/_types/{@internal_voice@0.0.43 → @internal_voice@0.0.44}/dist/_types/zod@4.6.7/v4/locales/da.d.ts +0 -0
  208. /package/dist/_types/{@internal_voice@0.0.43 → @internal_voice@0.0.44}/dist/_types/zod@4.6.7/v4/locales/de.d.ts +0 -0
  209. /package/dist/_types/{@internal_voice@0.0.43 → @internal_voice@0.0.44}/dist/_types/zod@4.6.7/v4/locales/el.d.ts +0 -0
  210. /package/dist/_types/{@internal_voice@0.0.43 → @internal_voice@0.0.44}/dist/_types/zod@4.6.7/v4/locales/en.d.ts +0 -0
  211. /package/dist/_types/{@internal_voice@0.0.43 → @internal_voice@0.0.44}/dist/_types/zod@4.6.7/v4/locales/eo.d.ts +0 -0
  212. /package/dist/_types/{@internal_voice@0.0.43 → @internal_voice@0.0.44}/dist/_types/zod@4.6.7/v4/locales/es.d.ts +0 -0
  213. /package/dist/_types/{@internal_voice@0.0.43 → @internal_voice@0.0.44}/dist/_types/zod@4.6.7/v4/locales/fa.d.ts +0 -0
  214. /package/dist/_types/{@internal_voice@0.0.43 → @internal_voice@0.0.44}/dist/_types/zod@4.6.7/v4/locales/fi.d.ts +0 -0
  215. /package/dist/_types/{@internal_voice@0.0.43 → @internal_voice@0.0.44}/dist/_types/zod@4.6.7/v4/locales/fr-CA.d.ts +0 -0
  216. /package/dist/_types/{@internal_voice@0.0.43 → @internal_voice@0.0.44}/dist/_types/zod@4.6.7/v4/locales/fr.d.ts +0 -0
  217. /package/dist/_types/{@internal_voice@0.0.43 → @internal_voice@0.0.44}/dist/_types/zod@4.6.7/v4/locales/gu.d.ts +0 -0
  218. /package/dist/_types/{@internal_voice@0.0.43 → @internal_voice@0.0.44}/dist/_types/zod@4.6.7/v4/locales/he.d.ts +0 -0
  219. /package/dist/_types/{@internal_voice@0.0.43 → @internal_voice@0.0.44}/dist/_types/zod@4.6.7/v4/locales/hi.d.ts +0 -0
  220. /package/dist/_types/{@internal_voice@0.0.43 → @internal_voice@0.0.44}/dist/_types/zod@4.6.7/v4/locales/hr.d.ts +0 -0
  221. /package/dist/_types/{@internal_voice@0.0.43 → @internal_voice@0.0.44}/dist/_types/zod@4.6.7/v4/locales/hu.d.ts +0 -0
  222. /package/dist/_types/{@internal_voice@0.0.43 → @internal_voice@0.0.44}/dist/_types/zod@4.6.7/v4/locales/hy.d.ts +0 -0
  223. /package/dist/_types/{@internal_voice@0.0.43 → @internal_voice@0.0.44}/dist/_types/zod@4.6.7/v4/locales/id.d.ts +0 -0
  224. /package/dist/_types/{@internal_voice@0.0.43 → @internal_voice@0.0.44}/dist/_types/zod@4.6.7/v4/locales/index.d.ts +0 -0
  225. /package/dist/_types/{@internal_voice@0.0.43 → @internal_voice@0.0.44}/dist/_types/zod@4.6.7/v4/locales/is.d.ts +0 -0
  226. /package/dist/_types/{@internal_voice@0.0.43 → @internal_voice@0.0.44}/dist/_types/zod@4.6.7/v4/locales/it.d.ts +0 -0
  227. /package/dist/_types/{@internal_voice@0.0.43 → @internal_voice@0.0.44}/dist/_types/zod@4.6.7/v4/locales/ja.d.ts +0 -0
  228. /package/dist/_types/{@internal_voice@0.0.43 → @internal_voice@0.0.44}/dist/_types/zod@4.6.7/v4/locales/ka.d.ts +0 -0
  229. /package/dist/_types/{@internal_voice@0.0.43 → @internal_voice@0.0.44}/dist/_types/zod@4.6.7/v4/locales/kh.d.ts +0 -0
  230. /package/dist/_types/{@internal_voice@0.0.43 → @internal_voice@0.0.44}/dist/_types/zod@4.6.7/v4/locales/km.d.ts +0 -0
  231. /package/dist/_types/{@internal_voice@0.0.43 → @internal_voice@0.0.44}/dist/_types/zod@4.6.7/v4/locales/kn.d.ts +0 -0
  232. /package/dist/_types/{@internal_voice@0.0.43 → @internal_voice@0.0.44}/dist/_types/zod@4.6.7/v4/locales/ko.d.ts +0 -0
  233. /package/dist/_types/{@internal_voice@0.0.43 → @internal_voice@0.0.44}/dist/_types/zod@4.6.7/v4/locales/lt.d.ts +0 -0
  234. /package/dist/_types/{@internal_voice@0.0.43 → @internal_voice@0.0.44}/dist/_types/zod@4.6.7/v4/locales/mk.d.ts +0 -0
  235. /package/dist/_types/{@internal_voice@0.0.43 → @internal_voice@0.0.44}/dist/_types/zod@4.6.7/v4/locales/ms.d.ts +0 -0
  236. /package/dist/_types/{@internal_voice@0.0.43 → @internal_voice@0.0.44}/dist/_types/zod@4.6.7/v4/locales/ne.d.ts +0 -0
  237. /package/dist/_types/{@internal_voice@0.0.43 → @internal_voice@0.0.44}/dist/_types/zod@4.6.7/v4/locales/nl.d.ts +0 -0
  238. /package/dist/_types/{@internal_voice@0.0.43 → @internal_voice@0.0.44}/dist/_types/zod@4.6.7/v4/locales/nn.d.ts +0 -0
  239. /package/dist/_types/{@internal_voice@0.0.43 → @internal_voice@0.0.44}/dist/_types/zod@4.6.7/v4/locales/no.d.ts +0 -0
  240. /package/dist/_types/{@internal_voice@0.0.43 → @internal_voice@0.0.44}/dist/_types/zod@4.6.7/v4/locales/ota.d.ts +0 -0
  241. /package/dist/_types/{@internal_voice@0.0.43 → @internal_voice@0.0.44}/dist/_types/zod@4.6.7/v4/locales/pl.d.ts +0 -0
  242. /package/dist/_types/{@internal_voice@0.0.43 → @internal_voice@0.0.44}/dist/_types/zod@4.6.7/v4/locales/ps.d.ts +0 -0
  243. /package/dist/_types/{@internal_voice@0.0.43 → @internal_voice@0.0.44}/dist/_types/zod@4.6.7/v4/locales/pt-BR.d.ts +0 -0
  244. /package/dist/_types/{@internal_voice@0.0.43 → @internal_voice@0.0.44}/dist/_types/zod@4.6.7/v4/locales/pt.d.ts +0 -0
  245. /package/dist/_types/{@internal_voice@0.0.43 → @internal_voice@0.0.44}/dist/_types/zod@4.6.7/v4/locales/ro.d.ts +0 -0
  246. /package/dist/_types/{@internal_voice@0.0.43 → @internal_voice@0.0.44}/dist/_types/zod@4.6.7/v4/locales/ru.d.ts +0 -0
  247. /package/dist/_types/{@internal_voice@0.0.43 → @internal_voice@0.0.44}/dist/_types/zod@4.6.7/v4/locales/sk.d.ts +0 -0
  248. /package/dist/_types/{@internal_voice@0.0.43 → @internal_voice@0.0.44}/dist/_types/zod@4.6.7/v4/locales/sl.d.ts +0 -0
  249. /package/dist/_types/{@internal_voice@0.0.43 → @internal_voice@0.0.44}/dist/_types/zod@4.6.7/v4/locales/sv.d.ts +0 -0
  250. /package/dist/_types/{@internal_voice@0.0.43 → @internal_voice@0.0.44}/dist/_types/zod@4.6.7/v4/locales/ta.d.ts +0 -0
  251. /package/dist/_types/{@internal_voice@0.0.43 → @internal_voice@0.0.44}/dist/_types/zod@4.6.7/v4/locales/tg.d.ts +0 -0
  252. /package/dist/_types/{@internal_voice@0.0.43 → @internal_voice@0.0.44}/dist/_types/zod@4.6.7/v4/locales/th.d.ts +0 -0
  253. /package/dist/_types/{@internal_voice@0.0.43 → @internal_voice@0.0.44}/dist/_types/zod@4.6.7/v4/locales/tk.d.ts +0 -0
  254. /package/dist/_types/{@internal_voice@0.0.43 → @internal_voice@0.0.44}/dist/_types/zod@4.6.7/v4/locales/tr.d.ts +0 -0
  255. /package/dist/_types/{@internal_voice@0.0.43 → @internal_voice@0.0.44}/dist/_types/zod@4.6.7/v4/locales/ua.d.ts +0 -0
  256. /package/dist/_types/{@internal_voice@0.0.43 → @internal_voice@0.0.44}/dist/_types/zod@4.6.7/v4/locales/uk.d.ts +0 -0
  257. /package/dist/_types/{@internal_voice@0.0.43 → @internal_voice@0.0.44}/dist/_types/zod@4.6.7/v4/locales/ur.d.ts +0 -0
  258. /package/dist/_types/{@internal_voice@0.0.43 → @internal_voice@0.0.44}/dist/_types/zod@4.6.7/v4/locales/uz.d.ts +0 -0
  259. /package/dist/_types/{@internal_voice@0.0.43 → @internal_voice@0.0.44}/dist/_types/zod@4.6.7/v4/locales/vi.d.ts +0 -0
  260. /package/dist/_types/{@internal_voice@0.0.43 → @internal_voice@0.0.44}/dist/_types/zod@4.6.7/v4/locales/yo.d.ts +0 -0
  261. /package/dist/_types/{@internal_voice@0.0.43 → @internal_voice@0.0.44}/dist/_types/zod@4.6.7/v4/locales/zh-CN.d.ts +0 -0
  262. /package/dist/_types/{@internal_voice@0.0.43 → @internal_voice@0.0.44}/dist/_types/zod@4.6.7/v4/locales/zh-TW.d.ts +0 -0
  263. /package/dist/_types/{@internal_voice@0.0.43 → @internal_voice@0.0.44}/dist/routes/index.d.ts +0 -0
  264. /package/dist/_types/{@internal_voice@0.0.43 → @internal_voice@0.0.44}/package.json +0 -0
  265. /package/dist/_types/@mastra_schema-compat@1.3.17/dist/_types/{@internal_ai-sdk-v4@0.0.94 → @internal_ai-sdk-v4@0.0.95}/dist/index.d.ts +0 -0
@@ -31,6 +31,13 @@ const knowledgeSearchQuerySchema = zod_v4.z.object({
31
31
  scopeId: scopeIds.optional().describe("Only pages within these scopes"),
32
32
  limit
33
33
  });
34
+ const pageIds = zod_v4.z.union([zod_v4.z.string(), zod_v4.z.array(zod_v4.z.string())]).transform((value) => Array.isArray(value) ? value : [value]).pipe(zod_v4.z.array(pageId).min(1).max(200));
35
+ const knowledgeLinkCountsQuerySchema = zod_v4.z.object({ pageId: pageIds.describe("Pages to count links for; repeat the param for each, at most 200") });
36
+ const knowledgePageLinksQuerySchema = zod_v4.z.object({ direction: zod_v4.z.enum([
37
+ "in",
38
+ "out",
39
+ "both"
40
+ ]).optional().describe("Links into the page, out of it, or both (default)") });
34
41
  const knowledgeActivityQuerySchema = zod_v4.z.object({
35
42
  scopeId: pageId.optional(),
36
43
  pageId: pageId.optional(),
@@ -46,6 +53,20 @@ const knowledgeTreeResponseSchema = payload;
46
53
  const knowledgePageResponseSchema = payload;
47
54
  const knowledgeGraphResponseSchema = payload;
48
55
  const knowledgeSearchResponseSchema = zod_v4.z.object({ results: zod_v4.z.array(payload) });
56
+ const knowledgeLinkCountsResponseSchema = zod_v4.z.object({ counts: zod_v4.z.record(zod_v4.z.string(), zod_v4.z.object({
57
+ in: zod_v4.z.number(),
58
+ out: zod_v4.z.number()
59
+ })) });
60
+ const knowledgePageLinksResponseSchema = zod_v4.z.object({
61
+ edges: zod_v4.z.array(zod_v4.z.object({
62
+ fromPageId: zod_v4.z.string(),
63
+ toPageId: zod_v4.z.string(),
64
+ kind: zod_v4.z.enum(["body", "note"]),
65
+ count: zod_v4.z.number()
66
+ })),
67
+ pages: zod_v4.z.array(payload),
68
+ truncated: zod_v4.z.boolean()
69
+ });
49
70
  const knowledgeActivityResponseSchema = payload;
50
71
  const knowledgeEventsResponseSchema = zod_v4.z.object({
51
72
  kind: zod_v4.z.enum([
@@ -256,6 +277,72 @@ const GET_KNOWLEDGE_PAGE_ROUTE = require_route_builder.createRoute({
256
277
  }
257
278
  }
258
279
  });
280
+ /**
281
+ * The link readers are newer than the page readers, so a core without them answers these routes with 501
282
+ * and the explorer falls back to counting the pages it has loaded.
283
+ */
284
+ function requireLinkReaders() {
285
+ const { readKnowledgePageLinkCounts, readKnowledgePageLinks } = _mastra_core_knowledge;
286
+ if (!readKnowledgePageLinkCounts || !readKnowledgePageLinks) throw new require_http_exception.HTTPException(501, { message: "Knowledge link counts need a newer @mastra/core." });
287
+ return {
288
+ readKnowledgePageLinkCounts,
289
+ readKnowledgePageLinks
290
+ };
291
+ }
292
+ const GET_KNOWLEDGE_LINK_COUNTS_ROUTE = require_route_builder.createRoute({
293
+ method: "GET",
294
+ path: "/knowledge/:knowledgeKey/link-counts",
295
+ responseType: "json",
296
+ pathParamSchema: knowledgePathParams,
297
+ queryParamSchema: knowledgeLinkCountsQuerySchema,
298
+ responseSchema: knowledgeLinkCountsResponseSchema,
299
+ summary: "Count the links into and out of pages",
300
+ description: "Returns, for each page id, how many distinct other pages link to it and it links to, by body [[ref]] or note mention, counted over the whole store and not only pages the caller has loaded. A page the caller cannot read counts as no links, the same as one that does not exist. 501 when the store has no link index.",
301
+ tags: ["Knowledge"],
302
+ requiresAuth: true,
303
+ handler: async ({ mastra, requestContext, knowledgeKey, pageId }) => {
304
+ try {
305
+ const { store, read } = await resolveStore(mastra, requestContext, knowledgeKey);
306
+ const counts = await requireLinkReaders().readKnowledgePageLinkCounts(store, {
307
+ pageIds: pageId,
308
+ read
309
+ });
310
+ if (!counts) throw new require_http_exception.HTTPException(501, { message: "This Knowledge store has no link index." });
311
+ return { counts };
312
+ } catch (error) {
313
+ return require_server_handlers_error.handleError(error, "Error counting Knowledge page links");
314
+ }
315
+ }
316
+ });
317
+ const GET_KNOWLEDGE_PAGE_LINKS_ROUTE = require_route_builder.createRoute({
318
+ method: "GET",
319
+ path: "/knowledge/:knowledgeKey/pages/:pageId/links",
320
+ responseType: "json",
321
+ pathParamSchema: knowledgePagePathParams,
322
+ queryParamSchema: knowledgePageLinksQuerySchema,
323
+ responseSchema: knowledgePageLinksResponseSchema,
324
+ summary: "List a Knowledge page's links",
325
+ description: "Returns the links into and out of one page, bounded, with the readable pages at their other ends. A page the caller cannot read has none. 501 when the store has no link index.",
326
+ tags: ["Knowledge"],
327
+ requiresAuth: true,
328
+ handler: async ({ mastra, requestContext, knowledgeKey, pageId, direction }) => {
329
+ try {
330
+ const { instance, store, read } = await resolveStore(mastra, requestContext, knowledgeKey);
331
+ const links = await requireLinkReaders().readKnowledgePageLinks(store, {
332
+ pageId,
333
+ read,
334
+ direction
335
+ });
336
+ if (!links) throw new require_http_exception.HTTPException(501, { message: "This Knowledge store has no link index." });
337
+ return {
338
+ ...links,
339
+ pages: links.pages.map((page) => ({ ...withDisplayLabel(instance, page) }))
340
+ };
341
+ } catch (error) {
342
+ return require_server_handlers_error.handleError(error, "Error reading Knowledge page links");
343
+ }
344
+ }
345
+ });
259
346
  const GET_KNOWLEDGE_GRAPH_ROUTE = require_route_builder.createRoute({
260
347
  method: "GET",
261
348
  path: "/knowledge/:knowledgeKey/graph",
@@ -440,6 +527,18 @@ Object.defineProperty(exports, "GET_KNOWLEDGE_GRAPH_ROUTE", {
440
527
  return GET_KNOWLEDGE_GRAPH_ROUTE;
441
528
  }
442
529
  });
530
+ Object.defineProperty(exports, "GET_KNOWLEDGE_LINK_COUNTS_ROUTE", {
531
+ enumerable: true,
532
+ get: function() {
533
+ return GET_KNOWLEDGE_LINK_COUNTS_ROUTE;
534
+ }
535
+ });
536
+ Object.defineProperty(exports, "GET_KNOWLEDGE_PAGE_LINKS_ROUTE", {
537
+ enumerable: true,
538
+ get: function() {
539
+ return GET_KNOWLEDGE_PAGE_LINKS_ROUTE;
540
+ }
541
+ });
443
542
  Object.defineProperty(exports, "GET_KNOWLEDGE_PAGE_ROUTE", {
444
543
  enumerable: true,
445
544
  get: function() {
@@ -471,4 +570,4 @@ Object.defineProperty(exports, "STREAM_KNOWLEDGE_EVENTS_ROUTE", {
471
570
  }
472
571
  });
473
572
 
474
- //# sourceMappingURL=knowledge-qu0om3W7.cjs.map
573
+ //# sourceMappingURL=knowledge-urR7FFG8.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"knowledge-urR7FFG8.cjs","names":["z","MASTRA_KNOWLEDGE_PRINCIPALS_KEY","HTTPException","getHandlerFGAProvider","MastraFGAPermissions","coreKnowledge","createRoute","handleError"],"sources":["../src/server/schemas/knowledge.ts","../src/server/handlers/knowledge.ts"],"sourcesContent":["import { z } from 'zod/v4';\n\nexport const knowledgePathParams = z.object({\n knowledgeKey: z.string().describe('Application key the Knowledge instance is registered under'),\n});\n\nexport const knowledgePagePathParams = knowledgePathParams.extend({\n pageId: z.string().min(1).max(512).describe('Knowledge page id'),\n});\n\nconst pageId = z.string().min(1).max(512);\nconst limit = z.coerce.number().int().min(1).max(100).optional();\n\nexport const knowledgeTreeQuerySchema = z.object({\n parentId: pageId.optional().describe('Page whose children to list; omit for the root scopes'),\n cursor: z.string().optional(),\n limit,\n});\n\nexport const knowledgePageQuerySchema = z.object({\n noteCursor: z.string().optional(),\n noteLimit: limit,\n});\n\nexport const knowledgeGraphQuerySchema = z.object({\n rootId: pageId.optional().describe('Page to walk from; omit to walk every root scope'),\n maxPages: z.coerce.number().int().min(1).max(500).optional(),\n});\n\n// A repeated param (`?scopeId=a&scopeId=b`) arrives as an array, a lone one as a string.\nconst scopeIds = z\n .union([z.string(), z.array(z.string())])\n .transform(value => (Array.isArray(value) ? value : [value]))\n .pipe(z.array(pageId).max(20));\n\nexport const knowledgeSearchQuerySchema = z.object({\n q: z.string().min(1).max(200).describe('Text to match in page names, synopses, bodies and notes'),\n scopeId: scopeIds.optional().describe('Only pages within these scopes'),\n limit,\n});\n\nconst pageIds = z\n .union([z.string(), z.array(z.string())])\n .transform(value => (Array.isArray(value) ? value : [value]))\n .pipe(z.array(pageId).min(1).max(200));\n\nexport const knowledgeLinkCountsQuerySchema = z.object({\n pageId: pageIds.describe('Pages to count links for; repeat the param for each, at most 200'),\n});\n\nexport const knowledgePageLinksQuerySchema = z.object({\n direction: z.enum(['in', 'out', 'both']).optional().describe('Links into the page, out of it, or both (default)'),\n});\n\nexport const knowledgeActivityQuerySchema = z.object({\n scopeId: pageId.optional(),\n pageId: pageId.optional(),\n cursor: z.string().optional(),\n limit,\n});\n\n// Payloads come from the @mastra/core/knowledge page readers; the UI package owns their TypeScript shapes.\nconst payload = z.record(z.string(), z.unknown());\n\nexport const listKnowledgeResponseSchema = z.object({\n instances: z.array(z.object({ key: z.string(), id: z.string() })),\n});\nexport const knowledgeTreeResponseSchema = payload;\nexport const knowledgePageResponseSchema = payload;\nexport const knowledgeGraphResponseSchema = payload;\nexport const knowledgeSearchResponseSchema = z.object({ results: z.array(payload) });\nexport const knowledgeLinkCountsResponseSchema = z.object({\n counts: z.record(z.string(), z.object({ in: z.number(), out: z.number() })),\n});\nexport const knowledgePageLinksResponseSchema = z.object({\n edges: z.array(\n z.object({ fromPageId: z.string(), toPageId: z.string(), kind: z.enum(['body', 'note']), count: z.number() }),\n ),\n pages: z.array(payload),\n truncated: z.boolean(),\n});\nexport const knowledgeActivityResponseSchema = payload;\nexport const knowledgeEventsResponseSchema = z.object({\n kind: z.enum(['scope', 'page', 'note', 'pin']),\n op: z.string(),\n pageId: z.string().optional(),\n scopeId: z.string().optional(),\n at: z.string(),\n});\n","import * as coreKnowledge from '@mastra/core/knowledge';\nimport type { Knowledge, KnowledgeChangeEvent } from '@mastra/core/knowledge';\nimport type { Mastra } from '@mastra/core/mastra';\nimport type { RequestContext } from '@mastra/core/request-context';\nimport type { KnowledgeReadScope, KnowledgeStorage } from '@mastra/core/storage';\nimport { MASTRA_KNOWLEDGE_PRINCIPALS_KEY } from '../constants';\nimport { MastraFGAPermissions } from '../fga-permissions';\nimport { HTTPException } from '../http-exception';\nimport {\n knowledgeActivityQuerySchema,\n knowledgeActivityResponseSchema,\n knowledgeEventsResponseSchema,\n knowledgeGraphQuerySchema,\n knowledgeGraphResponseSchema,\n knowledgePagePathParams,\n knowledgePageQuerySchema,\n knowledgePageResponseSchema,\n knowledgePathParams,\n knowledgeSearchQuerySchema,\n knowledgeSearchResponseSchema,\n knowledgeLinkCountsQuerySchema,\n knowledgeLinkCountsResponseSchema,\n knowledgePageLinksQuerySchema,\n knowledgePageLinksResponseSchema,\n knowledgeTreeQuerySchema,\n knowledgeTreeResponseSchema,\n listKnowledgeResponseSchema,\n} from '../schemas/knowledge';\nimport { createRoute } from '../server-adapter/routes/route-builder';\n\nimport { handleError } from './error';\nimport { getHandlerFGAProvider } from './utils';\n\n/**\n * Read-only browsing of Knowledge instances registered on Mastra, for Studio. Nothing here writes.\n *\n * What a caller reads depends on whether the app has auth configured (`server.auth` or `studio.auth`):\n * - No auth: probably a local or test project, so the routes read as the instance owner (`'all'`).\n * - Auth: reads are narrowed to what the signed-in caller can read. The app maps the user to Knowledge\n * principals by setting MASTRA_KNOWLEDGE_PRINCIPALS_KEY in `auth.authorize` (a `string[]`, or `'all'`\n * for an admin); the instance turns them into a read scope with `readScopeFor`. A caller with no\n * mapping is refused with 403.\n *\n * On top of that the path derives `knowledge:read` (`GET /knowledge/...`), and with FGA configured each\n * instance is filtered and gated by `knowledge:read` on that instance. The routes are opt-in\n * (KNOWLEDGE_ROUTES); hosts with their own scoping (Factory) do not mount them.\n */\n\nfunction hasAuth(mastra: Mastra): boolean {\n return Boolean(mastra.getServer?.()?.auth || (mastra as any).getStudio?.()?.auth);\n}\n\nasync function callerReadScope(\n mastra: Mastra,\n requestContext: RequestContext | undefined,\n instance: Knowledge,\n): Promise<KnowledgeReadScope> {\n if (!hasAuth(mastra)) return 'all';\n\n const principals = requestContext?.get(MASTRA_KNOWLEDGE_PRINCIPALS_KEY);\n if (principals === undefined || principals === null) {\n throw new HTTPException(403, {\n message: `Knowledge access is not mapped for this caller. Set request context key \"${MASTRA_KNOWLEDGE_PRINCIPALS_KEY}\" in auth.authorize.`,\n });\n }\n if (principals === 'all') return 'all';\n // The value comes from the app's own authorize code, so a bad one is a host misconfiguration, not a denial.\n if (!Array.isArray(principals) || principals.some(principal => typeof principal !== 'string')) {\n throw new HTTPException(500, {\n message: `Request context key \"${MASTRA_KNOWLEDGE_PRINCIPALS_KEY}\" must be a string array or 'all'.`,\n });\n }\n try {\n return await instance.readScopeFor(principals);\n } catch (error) {\n // A principal that matches no declared scope type: the app's mapping disagrees with its declarations.\n if (error instanceof Error && error.name === 'KnowledgeDeclarationError') {\n throw new HTTPException(500, { message: error.message, cause: error });\n }\n throw error;\n }\n}\n\nasync function accessibleInstances(\n mastra: Mastra,\n requestContext: RequestContext | undefined,\n entries: Array<{ id: string; key: string }>,\n): Promise<Set<string>> {\n const fgaProvider = getHandlerFGAProvider(mastra, requestContext);\n const user = requestContext?.get('user');\n if (!fgaProvider || !user || typeof user !== 'object' || entries.length === 0) {\n return new Set(entries.map(entry => entry.key));\n }\n // FGA names a Knowledge instance by its registered key, as the route metadata does (`:knowledgeKey`).\n const accessible: Array<{ id: string; key: string }> = await fgaProvider.filterAccessible(\n user,\n entries.map(entry => ({ ...entry, id: entry.key })),\n 'knowledge',\n MastraFGAPermissions.KNOWLEDGE_READ,\n );\n return new Set(accessible.map(entry => entry.key));\n}\n\ntype KnowledgePageReaders = Pick<\n typeof coreKnowledge,\n | 'listKnowledgeTreeChildren'\n | 'readKnowledgePage'\n | 'readKnowledgePageActivity'\n | 'readKnowledgePageGraph'\n | 'searchKnowledgeExplorerPages'\n>;\n\n// The page readers first ship in @mastra/core 1.81.0, above this package's peer floor. A named import\n// of an export an older core lacks fails at ESM link time and takes the whole server down, so they are\n// read off the namespace (as in schedules-workflows-shim.ts) and the routes answer 501 without them.\nconst pageReaders: Partial<KnowledgePageReaders> = coreKnowledge;\n\nfunction requirePageReaders(): KnowledgePageReaders {\n const {\n listKnowledgeTreeChildren,\n readKnowledgePage,\n readKnowledgePageActivity,\n readKnowledgePageGraph,\n searchKnowledgeExplorerPages,\n } = pageReaders;\n if (\n !listKnowledgeTreeChildren ||\n !readKnowledgePage ||\n !readKnowledgePageActivity ||\n !readKnowledgePageGraph ||\n !searchKnowledgeExplorerPages\n ) {\n throw new HTTPException(501, { message: 'Knowledge browsing needs @mastra/core 1.81.0 or later.' });\n }\n return {\n listKnowledgeTreeChildren,\n readKnowledgePage,\n readKnowledgePageActivity,\n readKnowledgePageGraph,\n searchKnowledgeExplorerPages,\n };\n}\n\n/**\n * The declared grants between the graph's scopes, each with its principal's display label. Grants are\n * newer than the page readers, so a core without them sends none and the graph still loads.\n */\nasync function graphGrants(\n instance: Knowledge,\n store: KnowledgeStorage,\n pages: readonly coreKnowledge.KnowledgePage[],\n read: KnowledgeReadScope,\n): Promise<Array<coreKnowledge.KnowledgeGraphScopeGrant & { principalLabel?: string }> | undefined> {\n const readGrants = (coreKnowledge as Partial<typeof coreKnowledge>).readKnowledgeScopeGrants;\n const scopeGrants = (instance as Partial<Knowledge>).scopeGrants?.bind(instance);\n if (!readGrants || !scopeGrants) return undefined;\n const grants = await readGrants(store, { pages, read, grantsFor: scopeGrants });\n return grants.map(grant => {\n const principalLabel = instance.scopeLabel?.(grant.principal);\n return principalLabel ? { ...grant, principalLabel } : grant;\n });\n}\n\nasync function resolveStore(\n mastra: Mastra,\n requestContext: RequestContext | undefined,\n knowledgeKey: string | undefined,\n): Promise<{ instance: Knowledge; store: KnowledgeStorage; read: KnowledgeReadScope; readers: KnowledgePageReaders }> {\n const instances = mastra.listKnowledge();\n // Own keys only: `constructor` or `__proto__` must not resolve to an Object.prototype member.\n const instance = knowledgeKey && Object.hasOwn(instances, knowledgeKey) ? instances[knowledgeKey] : undefined;\n if (!knowledgeKey || !instance)\n throw new HTTPException(404, { message: `Knowledge ${knowledgeKey ?? ''} not found` });\n\n // An instance the caller may not read looks the same as one that does not exist.\n const fgaProvider = getHandlerFGAProvider(mastra, requestContext);\n const user = requestContext?.get('user');\n if (fgaProvider && user && typeof user === 'object') {\n const allowed = await fgaProvider.check(user, {\n resource: { type: 'knowledge', id: knowledgeKey },\n permission: MastraFGAPermissions.KNOWLEDGE_READ,\n });\n if (!allowed) throw new HTTPException(404, { message: `Knowledge ${knowledgeKey} not found` });\n }\n const readers = requirePageReaders();\n const read = await callerReadScope(mastra, requestContext, instance);\n return { instance, store: await instance.getStorage(), read, readers };\n}\n\n/**\n * Adds each scope page's declared `displayLabel` with its address's `$params` filled in (`'$orgId policy'`\n * → `'acme policy'`), so the explorer can caption scopes. Scope declarations live in config, not\n * storage, so the readers can't supply it. Older cores without `scopeLabel` send no label.\n */\nfunction withDisplayLabel<T extends { isScope: boolean; address?: string }>(\n instance: Knowledge,\n page: T,\n): T & { displayLabel?: string } {\n if (!page.isScope || !page.address) return page;\n const displayLabel = instance.scopeLabel?.(page.address);\n return displayLabel ? { ...page, displayLabel } : page;\n}\n\nexport const LIST_KNOWLEDGE_ROUTE = createRoute({\n method: 'GET',\n path: '/knowledge',\n responseType: 'json',\n responseSchema: listKnowledgeResponseSchema,\n summary: 'List Knowledge instances',\n description:\n \"Returns the Knowledge instances registered on this Mastra instance, by application key. Without app auth the other Knowledge routes read the whole instance; with auth they read only what the caller's Knowledge principals (MASTRA_KNOWLEDGE_PRINCIPALS_KEY, set in auth.authorize) can read, and refuse an unmapped caller with 403.\",\n tags: ['Knowledge'],\n requiresAuth: true,\n handler: async ({ mastra, requestContext }) => {\n try {\n const all = Object.entries(mastra.listKnowledge()).map(([key, instance]) => ({ key, id: instance.id }));\n const allowed = await accessibleInstances(mastra, requestContext, all);\n return { instances: all.filter(entry => allowed.has(entry.key)) };\n } catch (error) {\n return handleError(error, 'Error listing Knowledge instances');\n }\n },\n});\n\nexport const GET_KNOWLEDGE_TREE_ROUTE = createRoute({\n method: 'GET',\n path: '/knowledge/:knowledgeKey/tree',\n responseType: 'json',\n pathParamSchema: knowledgePathParams,\n queryParamSchema: knowledgeTreeQuerySchema,\n responseSchema: knowledgeTreeResponseSchema,\n summary: 'List one level of the Knowledge page tree',\n description:\n 'Without parentId, returns the root scopes. With parentId, returns its child scopes (first page only) then its child pages in order, paged with cursor.',\n tags: ['Knowledge'],\n requiresAuth: true,\n handler: async ({ mastra, requestContext, knowledgeKey, parentId, cursor, limit }) => {\n try {\n const { instance, store, read, readers } = await resolveStore(mastra, requestContext, knowledgeKey);\n const level = await readers.listKnowledgeTreeChildren(store, {\n parentId: parentId ?? null,\n read,\n // An empty `?cursor=` means no cursor, so root scopes are still listed.\n cursor: cursor || undefined,\n limit,\n });\n return { ...level, pages: level.pages.map(page => withDisplayLabel(instance, page)) };\n } catch (error) {\n return handleError(error, 'Error reading Knowledge tree');\n }\n },\n});\n\nexport const GET_KNOWLEDGE_PAGE_ROUTE = createRoute({\n method: 'GET',\n path: '/knowledge/:knowledgeKey/pages/:pageId',\n responseType: 'json',\n pathParamSchema: knowledgePagePathParams,\n queryParamSchema: knowledgePageQuerySchema,\n responseSchema: knowledgePageResponseSchema,\n summary: 'Get a Knowledge page',\n description:\n 'Returns one page with its ancestors, a page of its notes, its pin, the pages its notes reference and notes elsewhere that mention it; 404 when it does not exist',\n tags: ['Knowledge'],\n requiresAuth: true,\n handler: async ({ mastra, requestContext, knowledgeKey, pageId, noteCursor, noteLimit }) => {\n try {\n const { instance, store, read, readers } = await resolveStore(mastra, requestContext, knowledgeKey);\n const view = await readers.readKnowledgePage(store, { pageId, read, noteCursor, noteLimit });\n if (!view) throw new HTTPException(404, { message: 'Knowledge page not found' });\n const label = <T extends { isScope: boolean; declaration?: string }>(page: T) => withDisplayLabel(instance, page);\n return {\n ...view,\n page: label(view.page),\n ancestors: view.ancestors.map(label),\n related: view.related.map(label),\n };\n } catch (error) {\n return handleError(error, 'Error reading Knowledge page');\n }\n },\n});\n\n/**\n * The link readers are newer than the page readers, so a core without them answers these routes with 501\n * and the explorer falls back to counting the pages it has loaded.\n */\nfunction requireLinkReaders() {\n const { readKnowledgePageLinkCounts, readKnowledgePageLinks } = coreKnowledge as Partial<typeof coreKnowledge>;\n if (!readKnowledgePageLinkCounts || !readKnowledgePageLinks) {\n throw new HTTPException(501, { message: 'Knowledge link counts need a newer @mastra/core.' });\n }\n return { readKnowledgePageLinkCounts, readKnowledgePageLinks };\n}\n\nexport const GET_KNOWLEDGE_LINK_COUNTS_ROUTE = createRoute({\n method: 'GET',\n path: '/knowledge/:knowledgeKey/link-counts',\n responseType: 'json',\n pathParamSchema: knowledgePathParams,\n queryParamSchema: knowledgeLinkCountsQuerySchema,\n responseSchema: knowledgeLinkCountsResponseSchema,\n summary: 'Count the links into and out of pages',\n description:\n 'Returns, for each page id, how many distinct other pages link to it and it links to, by body [[ref]] or note mention, counted over the whole store and not only pages the caller has loaded. A page the caller cannot read counts as no links, the same as one that does not exist. 501 when the store has no link index.',\n tags: ['Knowledge'],\n requiresAuth: true,\n handler: async ({ mastra, requestContext, knowledgeKey, pageId }) => {\n try {\n const { store, read } = await resolveStore(mastra, requestContext, knowledgeKey);\n const counts = await requireLinkReaders().readKnowledgePageLinkCounts(store, { pageIds: pageId, read });\n if (!counts) throw new HTTPException(501, { message: 'This Knowledge store has no link index.' });\n return { counts };\n } catch (error) {\n return handleError(error, 'Error counting Knowledge page links');\n }\n },\n});\n\nexport const GET_KNOWLEDGE_PAGE_LINKS_ROUTE = createRoute({\n method: 'GET',\n path: '/knowledge/:knowledgeKey/pages/:pageId/links',\n responseType: 'json',\n pathParamSchema: knowledgePagePathParams,\n queryParamSchema: knowledgePageLinksQuerySchema,\n responseSchema: knowledgePageLinksResponseSchema,\n summary: \"List a Knowledge page's links\",\n description:\n 'Returns the links into and out of one page, bounded, with the readable pages at their other ends. A page the caller cannot read has none. 501 when the store has no link index.',\n tags: ['Knowledge'],\n requiresAuth: true,\n handler: async ({ mastra, requestContext, knowledgeKey, pageId, direction }) => {\n try {\n const { instance, store, read } = await resolveStore(mastra, requestContext, knowledgeKey);\n const links = await requireLinkReaders().readKnowledgePageLinks(store, { pageId, read, direction });\n if (!links) throw new HTTPException(501, { message: 'This Knowledge store has no link index.' });\n return { ...links, pages: links.pages.map(page => ({ ...withDisplayLabel(instance, page) })) };\n } catch (error) {\n return handleError(error, 'Error reading Knowledge page links');\n }\n },\n});\n\nexport const GET_KNOWLEDGE_GRAPH_ROUTE = createRoute({\n method: 'GET',\n path: '/knowledge/:knowledgeKey/graph',\n responseType: 'json',\n pathParamSchema: knowledgePathParams,\n queryParamSchema: knowledgeGraphQuerySchema,\n responseSchema: knowledgeGraphResponseSchema,\n summary: 'Get a bounded Knowledge page graph',\n description:\n 'Returns pages under rootId (or every root scope) breadth-first with parent and mention edges, bounded; truncated is true when a limit stopped it. grants lists the declared access grants onto the scopes shown, from principal scopes the caller can read. 404 when rootId does not exist.',\n tags: ['Knowledge'],\n requiresAuth: true,\n handler: async ({ mastra, requestContext, knowledgeKey, rootId, maxPages }) => {\n try {\n const { instance, store, read, readers } = await resolveStore(mastra, requestContext, knowledgeKey);\n const graph = await readers.readKnowledgePageGraph(store, {\n read,\n rootId: rootId ?? null,\n ...(maxPages ? { limits: { maxPages } } : {}),\n });\n if (!graph) throw new HTTPException(404, { message: 'Knowledge page not found' });\n const grants = await graphGrants(instance, store, graph.pages, read);\n return {\n ...graph,\n pages: graph.pages.map(page => withDisplayLabel(instance, page)),\n ...(grants ? { grants } : {}),\n };\n } catch (error) {\n return handleError(error, 'Error reading Knowledge graph');\n }\n },\n});\n\nexport const SEARCH_KNOWLEDGE_ROUTE = createRoute({\n method: 'GET',\n path: '/knowledge/:knowledgeKey/search',\n responseType: 'json',\n pathParamSchema: knowledgePathParams,\n queryParamSchema: knowledgeSearchQuerySchema,\n responseSchema: knowledgeSearchResponseSchema,\n summary: 'Search Knowledge pages and notes',\n description: 'Returns pages whose name, synopsis or body, and notes whose text, match the query',\n tags: ['Knowledge'],\n requiresAuth: true,\n handler: async ({ mastra, requestContext, knowledgeKey, q, scopeId, limit }) => {\n try {\n const { instance, store, read, readers } = await resolveStore(mastra, requestContext, knowledgeKey);\n const results = await readers.searchKnowledgeExplorerPages(store, {\n query: q,\n read,\n ...(scopeId?.length ? { scopeIds: scopeId } : {}),\n limit,\n });\n return { results: results.map(hit => ({ ...hit, page: withDisplayLabel(instance, hit.page) })) };\n } catch (error) {\n return handleError(error, 'Error searching Knowledge');\n }\n },\n});\n\nexport const GET_KNOWLEDGE_ACTIVITY_ROUTE = createRoute({\n method: 'GET',\n path: '/knowledge/:knowledgeKey/activity',\n responseType: 'json',\n pathParamSchema: knowledgePathParams,\n queryParamSchema: knowledgeActivityQuerySchema,\n responseSchema: knowledgeActivityResponseSchema,\n summary: 'List recent Knowledge activity',\n description: 'Returns a newest-first page of activity, optionally for one scope or one page',\n tags: ['Knowledge'],\n requiresAuth: true,\n handler: async ({ mastra, requestContext, knowledgeKey, scopeId, pageId, cursor, limit }) => {\n try {\n const { store, read, readers } = await resolveStore(mastra, requestContext, knowledgeKey);\n return { ...(await readers.readKnowledgePageActivity(store, { read, scopeId, pageId, cursor, limit })) };\n } catch (error) {\n return handleError(error, 'Error reading Knowledge activity');\n }\n },\n});\n\nconst KEEPALIVE_MS = 25_000;\n/**\n * The read scope is resolved when the stream opens. Ending it after this long makes the client reconnect,\n * which resolves the caller's read scope again, so a revoked grant stops receiving changes.\n */\nconst STREAM_MAX_AGE_MS = 5 * 60_000;\n\n/**\n * What a viewer may learn about one change: the ids in it they can read, or nothing when they can read\n * none. A page they can read now, or the scope it is (or was, before a move or merge) in, counts; a\n * deleted page is matched by its scope.\n */\nasync function visibleChange(store: KnowledgeStorage, read: KnowledgeReadScope, event: KnowledgeChangeEvent) {\n const readable = async (id: string | undefined) =>\n id !== undefined && (read === 'all' || (await store.getPage({ id, read })) !== null);\n const scopeId = 'scopeId' in event ? event.scopeId : undefined;\n const fromScopeId = 'fromScopeId' in event ? event.fromScopeId : undefined;\n const [page, scope, fromScope] = await Promise.all([\n readable(event.pageId),\n readable(scopeId),\n readable(fromScopeId),\n ]);\n if (!page && !scope && !fromScope) return null;\n return {\n kind: event.kind,\n op: event.op,\n ...(page ? { pageId: event.pageId } : {}),\n ...(scope ? { scopeId } : {}),\n at: event.at.toISOString(),\n };\n}\n\nexport const STREAM_KNOWLEDGE_EVENTS_ROUTE = createRoute({\n method: 'GET',\n path: '/knowledge/:knowledgeKey/events',\n responseType: 'stream',\n streamFormat: 'sse',\n sseFlushOnConnect: true,\n pathParamSchema: knowledgePathParams,\n responseSchema: knowledgeEventsResponseSchema,\n summary: 'Stream Knowledge changes',\n description:\n 'Server-Sent Events, one per committed write the caller can read: { kind, op, pageId?, scopeId?, at }. Ids the caller cannot read are left out, and changes they cannot read at all are not sent. Re-read what changed with the other Knowledge routes.',\n tags: ['Knowledge'],\n requiresAuth: true,\n handler: async ({ mastra, requestContext, knowledgeKey, abortSignal }) => {\n try {\n const { instance, store, read } = await resolveStore(mastra, requestContext, knowledgeKey);\n if (typeof instance.onChange !== 'function') {\n throw new HTTPException(501, { message: 'Knowledge change events need @mastra/core 1.81.0 or later.' });\n }\n const logger = mastra.getLogger();\n let stop = () => {};\n return new ReadableStream({\n start(controller) {\n let open = true;\n // Writes are filtered in order so a viewer never sees a later change before an earlier one.\n let queue = Promise.resolve();\n const unsubscribe = instance.onChange(event => {\n queue = queue.then(async () => {\n const change = await visibleChange(store, read, event).catch(error => {\n logger?.error('Error filtering a Knowledge change', { error });\n return null;\n });\n if (open && change) controller.enqueue(change);\n });\n });\n const keepalive = setInterval(() => open && controller.enqueue(': keepalive\\n\\n'), KEEPALIVE_MS);\n const expire = setTimeout(() => stop(), STREAM_MAX_AGE_MS);\n stop = () => {\n if (!open) return;\n open = false;\n clearInterval(keepalive);\n clearTimeout(expire);\n unsubscribe();\n try {\n controller.close();\n } catch {\n // Already closed\n }\n };\n if (abortSignal?.aborted) stop();\n else abortSignal?.addEventListener('abort', stop, { once: true });\n },\n cancel() {\n stop();\n },\n });\n } catch (error) {\n return handleError(error, 'Error streaming Knowledge changes');\n }\n },\n});\n"],"mappings":";;;;;;;;;;AAEA,MAAa,sBAAsBA,OAAAA,EAAE,OAAO,EAC1C,cAAcA,OAAAA,EAAE,OAAO,CAAC,CAAC,SAAS,4DAA4D,EAChG,CAAC;AAED,MAAa,0BAA0B,oBAAoB,OAAO,EAChE,QAAQA,OAAAA,EAAE,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,GAAG,CAAC,CAAC,SAAS,mBAAmB,EACjE,CAAC;AAED,MAAM,SAASA,OAAAA,EAAE,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,GAAG;AACxC,MAAM,QAAQA,OAAAA,EAAE,OAAO,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,GAAG,CAAC,CAAC,SAAS;AAE/D,MAAa,2BAA2BA,OAAAA,EAAE,OAAO;CAC/C,UAAU,OAAO,SAAS,CAAC,CAAC,SAAS,uDAAuD;CAC5F,QAAQA,OAAAA,EAAE,OAAO,CAAC,CAAC,SAAS;CAC5B;AACF,CAAC;AAED,MAAa,2BAA2BA,OAAAA,EAAE,OAAO;CAC/C,YAAYA,OAAAA,EAAE,OAAO,CAAC,CAAC,SAAS;CAChC,WAAW;AACb,CAAC;AAED,MAAa,4B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T,CAAC;OACD,IAAI,QAAQ,QAAQ,WAAW,QAAQ,MAAM;MAC/C,CAAC;KACH,CAAC;KACD,MAAM,YAAY,kBAAkB,QAAQ,WAAW,QAAQ,iBAAiB,GAAG,YAAY;KAC/F,MAAM,SAAS,iBAAiB,KAAK,GAAG,iBAAiB;KACzD,aAAa;MACX,IAAI,CAAC,MAAM;MACX,OAAO;MACP,cAAc,SAAS;MACvB,aAAa,MAAM;MACnB,YAAY;MACZ,IAAI;OACF,WAAW,MAAM;MACnB,QAAQ,CAER;KACF;KACA,IAAI,aAAa,SAAS,KAAK;UAC1B,aAAa,iBAAiB,SAAS,MAAM,EAAE,MAAM,KAAK,CAAC;IAClE;IACA,SAAS;KACP,KAAK;IACP;GACF,CAAC;EACH,SAAS,OAAO;GACd,OAAOK,8BAAAA,YAAY,OAAO,mCAAmC;EAC/D;CACF;AACF,CAAC"}
@@ -4,7 +4,7 @@ const require_agents = require("./agents-DbnPZXIN.cjs");
4
4
  const require_route_builder = require("./route-builder-CvARmqnA.cjs");
5
5
  const require_server_handlers_error = require("./server/handlers/error.cjs");
6
6
  const require_utils = require("./utils-9PRHHTGC.cjs");
7
- const require_agents$1 = require("./agents-Cp4FBxQB.cjs");
7
+ const require_agents$1 = require("./agents-DOHGWXDa.cjs");
8
8
  let _mastra_core_tools = require("@mastra/core/tools");
9
9
  // src/server/handlers/plans.ts
10
10
  var plans_exports = /* @__PURE__ */ require_rolldown_runtime.__exportAll({ READ_AGENT_PLAN_ROUTE: () => READ_AGENT_PLAN_ROUTE });
@@ -64,4 +64,4 @@ Object.defineProperty(exports, "plans_exports", {
64
64
  }
65
65
  });
66
66
 
67
- //# sourceMappingURL=plans-UPUTbvxx.cjs.map
67
+ //# sourceMappingURL=plans-Djcp3C0d.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"plans-UPUTbvxx.cjs","names":["createRoute","agentIdPathParams","agentPlanQuerySchema","agentPlanResponseSchema","MastraFGAPermissions","getAgentFromSystem","submitPlanTool","HTTPException","handleError"],"sources":["../src/server/handlers/plans.ts"],"sourcesContent":["import { submitPlanTool } from '@mastra/core/tools';\nimport { MastraFGAPermissions } from '../fga-permissions';\nimport { HTTPException } from '../http-exception';\nimport { agentIdPathParams, agentPlanQuerySchema, agentPlanResponseSchema } from '../schemas/agents';\nimport { createRoute } from '../server-adapter/routes/route-builder';\nimport { getAgentFromSystem } from './agents';\nimport { handleError } from './error';\n\nconst PLANS_DIRECTORY = '.mastracode/plans/';\n\nfunction isPlanPath(path: string): boolean {\n if (!path.startsWith(PLANS_DIRECTORY)) return false;\n if (!path.endsWith('.md')) return false;\n if (path.includes('\\\\') || path.includes('\\0')) return false;\n\n const relativePath = path.slice(PLANS_DIRECTORY.length);\n const segments = relativePath.split('/');\n return segments.every(segment => segment.length > 0 && segment !== '.' && segment !== '..');\n}\n\nexport const READ_AGENT_PLAN_ROUTE = createRoute({\n method: 'GET',\n path: '/agents/:agentId/plans/file',\n responseType: 'json',\n pathParamSchema: agentIdPathParams,\n queryParamSchema: agentPlanQuerySchema,\n responseSchema: agentPlanResponseSchema,\n summary: 'Read a submitted agent plan',\n description:\n 'Returns a markdown plan when the agent exposes the core submit_plan capability and the path is under .mastracode/plans/.',\n tags: ['Agents', 'Tools'],\n requiresAuth: true,\n requiresPermission: MastraFGAPermissions.AGENTS_READ,\n handler: async ({ agentId, mastra, path, requestContext, status, versionId }) => {\n try {\n const versionOptions = versionId ? { versionId } : status ? { status } : undefined;\n const agent = await getAgentFromSystem({ mastra, agentId, versionOptions, requestContext });\n const tools = await agent.listTools({ requestContext });\n const hasSubmitPlan = Object.values(tools).some(\n tool => typeof tool === 'object' && tool !== null && 'id' in tool && tool.id === submitPlanTool.id,\n );\n\n if (!hasSubmitPlan) {\n throw new HTTPException(404, { message: 'Plan capability not found' });\n }\n if (!isPlanPath(path)) {\n throw new HTTPException(400, { message: 'Invalid plan path' });\n }\n\n const workspace = await agent.getWorkspace({ requestContext });\n const filesystem = await workspace?.resolveFilesystem({ requestContext });\n if (!filesystem) {\n throw new HTTPException(404, { message: 'No workspace filesystem configured' });\n }\n if (!(await filesystem.exists(path))) {\n throw new HTTPException(404, { message: `Plan file \"${path}\" not found` });\n }\n\n const content = await filesystem.readFile(path, { encoding: 'utf-8' });\n return {\n path,\n content: typeof content === 'string' ? content : content.toString('utf-8'),\n };\n } catch (error) {\n return handleError(error, 'Error reading submitted plan');\n }\n },\n});\n"],"mappings":";;;;;;;;;;AAQA,MAAM,kBAAkB;AAExB,SAAS,WAAW,MAAuB;CACzC,IAAI,CAAC,KAAK,WAAW,eAAe,GAAG,OAAO;CAC9C,IAAI,CAAC,KAAK,SAAS,KAAK,GAAG,OAAO;CAClC,IAAI,KAAK,SAAS,IAAI,KAAK,KAAK,SAAS,IAAI,GAAG,OAAO;CAIvD,OAFqB,KAAK,MAAM,EACJ,CAAC,CAAC,MAAM,GACtB,CAAC,CAAC,OAAM,YAAW,QAAQ,SAAS,KAAK,YAAY,OAAO,YAAY,IAAI;AAC5F;AAEA,MAAa,wBAAwBA,sBAAAA,YAAY;CAC/C,QAAQ;CACR,MAAM;CACN,cAAc;CACd,iBAAiBC,eAAAA;CACjB,kBAAkBC,eAAAA;CAClB,gBAAgBC,eAAAA;CAChB,SAAS;CACT,aACE;CACF,MAAM,CAAC,UAAU,OAAO;CACxB,cAAc;CACd,oBAAoBC,cAAAA,qBAAqB;CACzC,SAAS,OAAO,EAAE,SAAS,QAAQ,MAAM,gBAAgB,QAAQ,gBAAgB;EAC/E,IAAI;GAEF,MAAM,QAAQ,MAAMC,iBAAAA,mBAAmB;IAAE;IAAQ;IAAS,gBADnC,YAAY,EAAE,UAAU,IAAI,SAAS,EAAE,OAAO,IAAI,KAAA;IACC;GAAe,CAAC;GAC1F,MAAM,QAAQ,MAAM,MAAM,UAAU,EAAE,eAAe,CAAC;GAKtD,IAAI,CAJkB,OAAO,OAAO,KAAK,CAAC,CAAC,MACzC,SAAQ,OAAO,SAAS,YAAY,SAAS,QAAQ,QAAQ,QAAQ,KAAK,OAAOC,mBAAAA,eAAe,EAGjF,GACf,MAAM,IAAIC,uBAAAA,cAAc,KAAK,EAAE,SAAS,4BAA4B,CAAC;GAEvE,IAAI,CAAC,WAAW,IAAI,GAClB,MAAM,IAAIA,uBAAAA,cAAc,KAAK,EAAE,SAAS,oBAAoB,CAAC;GAI/D,MAAM,aAAa,OAAM,MADD,MAAM,aAAa,EAAE,eAAe,CAAC,EAAA,EACzB,kBAAkB,EAAE,eAAe,CAAC;GACxE,IAAI,CAAC,YACH,MAAM,IAAIA,uBAAAA,cAAc,KAAK,EAAE,SAAS,qCAAqC,CAAC;GAEhF,IAAI,CAAE,MAAM,WAAW,OAAO,IAAI,GAChC,MAAM,IAAIA,uBAAAA,cAAc,KAAK,EAAE,SAAS,cAAc,KAAK,aAAa,CAAC;GAG3E,MAAM,UAAU,MAAM,WAAW,SAAS,MAAM,EAAE,UAAU,QAAQ,CAAC;GACrE,OAAO;IACL;IACA,SAAS,OAAO,YAAY,WAAW,UAAU,QAAQ,SAAS,OAAO;GAC3E;EACF,SAAS,OAAO;GACd,OAAOC,8BAAAA,YAAY,OAAO,8BAA8B;EAC1D;CACF;AACF,CAAC"}
1
+ {"version":3,"file":"plans-Djcp3C0d.cjs","names":["createRoute","agentIdPathParams","agentPlanQuerySchema","agentPlanResponseSchema","MastraFGAPermissions","getAgentFromSystem","submitPlanTool","HTTPException","handleError"],"sources":["../src/server/handlers/plans.ts"],"sourcesContent":["import { submitPlanTool } from '@mastra/core/tools';\nimport { MastraFGAPermissions } from '../fga-permissions';\nimport { HTTPException } from '../http-exception';\nimport { agentIdPathParams, agentPlanQuerySchema, agentPlanResponseSchema } from '../schemas/agents';\nimport { createRoute } from '../server-adapter/routes/route-builder';\nimport { getAgentFromSystem } from './agents';\nimport { handleError } from './error';\n\nconst PLANS_DIRECTORY = '.mastracode/plans/';\n\nfunction isPlanPath(path: string): boolean {\n if (!path.startsWith(PLANS_DIRECTORY)) return false;\n if (!path.endsWith('.md')) return false;\n if (path.includes('\\\\') || path.includes('\\0')) return false;\n\n const relativePath = path.slice(PLANS_DIRECTORY.length);\n const segments = relativePath.split('/');\n return segments.every(segment => segment.length > 0 && segment !== '.' && segment !== '..');\n}\n\nexport const READ_AGENT_PLAN_ROUTE = createRoute({\n method: 'GET',\n path: '/agents/:agentId/plans/file',\n responseType: 'json',\n pathParamSchema: agentIdPathParams,\n queryParamSchema: agentPlanQuerySchema,\n responseSchema: agentPlanResponseSchema,\n summary: 'Read a submitted agent plan',\n description:\n 'Returns a markdown plan when the agent exposes the core submit_plan capability and the path is under .mastracode/plans/.',\n tags: ['Agents', 'Tools'],\n requiresAuth: true,\n requiresPermission: MastraFGAPermissions.AGENTS_READ,\n handler: async ({ agentId, mastra, path, requestContext, status, versionId }) => {\n try {\n const versionOptions = versionId ? { versionId } : status ? { status } : undefined;\n const agent = await getAgentFromSystem({ mastra, agentId, versionOptions, requestContext });\n const tools = await agent.listTools({ requestContext });\n const hasSubmitPlan = Object.values(tools).some(\n tool => typeof tool === 'object' && tool !== null && 'id' in tool && tool.id === submitPlanTool.id,\n );\n\n if (!hasSubmitPlan) {\n throw new HTTPException(404, { message: 'Plan capability not found' });\n }\n if (!isPlanPath(path)) {\n throw new HTTPException(400, { message: 'Invalid plan path' });\n }\n\n const workspace = await agent.getWorkspace({ requestContext });\n const filesystem = await workspace?.resolveFilesystem({ requestContext });\n if (!filesystem) {\n throw new HTTPException(404, { message: 'No workspace filesystem configured' });\n }\n if (!(await filesystem.exists(path))) {\n throw new HTTPException(404, { message: `Plan file \"${path}\" not found` });\n }\n\n const content = await filesystem.readFile(path, { encoding: 'utf-8' });\n return {\n path,\n content: typeof content === 'string' ? content : content.toString('utf-8'),\n };\n } catch (error) {\n return handleError(error, 'Error reading submitted plan');\n }\n },\n});\n"],"mappings":";;;;;;;;;;AAQA,MAAM,kBAAkB;AAExB,SAAS,WAAW,MAAuB;CACzC,IAAI,CAAC,KAAK,WAAW,eAAe,GAAG,OAAO;CAC9C,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CAAC;GAEhF,IAAI,CAAE,MAAM,WAAW,OAAO,IAAI,GAChC,MAAM,IAAIA,uBAAAA,cAAc,KAAK,EAAE,SAAS,cAAc,KAAK,aAAa,CAAC;GAG3E,MAAM,UAAU,MAAM,WAAW,SAAS,MAAM,EAAE,UAAU,QAAQ,CAAC;GACrE,OAAO;IACL;IACA,SAAS,OAAO,YAAY,WAAW,UAAU,QAAQ,SAAS,OAAO;GAC3E;EACF,SAAS,OAAO;GACd,OAAOC,8BAAAA,YAAY,OAAO,8BAA8B;EAC1D;CACF;AACF,CAAC"}
@@ -4,7 +4,7 @@ import { a as agentIdPathParams, o as agentPlanQuerySchema, s as agentPlanRespon
4
4
  import { n as createRoute } from "./route-builder-BxPrwNog.js";
5
5
  import { handleError } from "./server/handlers/error.js";
6
6
  import { _ as MastraFGAPermissions } from "./utils-B15w-1hm.js";
7
- import { G as getAgentFromSystem } from "./agents-DPvMjiDf.js";
7
+ import { G as getAgentFromSystem } from "./agents-CgcW6lHt.js";
8
8
  import { submitPlanTool } from "@mastra/core/tools";
9
9
  // src/server/handlers/plans.ts
10
10
  var plans_exports = /* @__PURE__ */ __exportAll({ READ_AGENT_PLAN_ROUTE: () => READ_AGENT_PLAN_ROUTE });
@@ -53,4 +53,4 @@ const READ_AGENT_PLAN_ROUTE = createRoute({
53
53
  });
54
54
  export { plans_exports as n, READ_AGENT_PLAN_ROUTE as t };
55
55
 
56
- //# sourceMappingURL=plans-k4FuteiT.js.map
56
+ //# sourceMappingURL=plans-nHOnlGzr.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"plans-k4FuteiT.js","names":[],"sources":["../src/server/handlers/plans.ts"],"sourcesContent":["import { submitPlanTool } from '@mastra/core/tools';\nimport { MastraFGAPermissions } from '../fga-permissions';\nimport { HTTPException } from '../http-exception';\nimport { agentIdPathParams, agentPlanQuerySchema, agentPlanResponseSchema } from '../schemas/agents';\nimport { createRoute } from '../server-adapter/routes/route-builder';\nimport { getAgentFromSystem } from './agents';\nimport { handleError } from './error';\n\nconst PLANS_DIRECTORY = '.mastracode/plans/';\n\nfunction isPlanPath(path: string): boolean {\n if (!path.startsWith(PLANS_DIRECTORY)) return false;\n if (!path.endsWith('.md')) return false;\n if (path.includes('\\\\') || path.includes('\\0')) return false;\n\n const relativePath = path.slice(PLANS_DIRECTORY.length);\n const segments = relativePath.split('/');\n return segments.every(segment => segment.length > 0 && segment !== '.' && segment !== '..');\n}\n\nexport const READ_AGENT_PLAN_ROUTE = createRoute({\n method: 'GET',\n path: '/agents/:agentId/plans/file',\n responseType: 'json',\n pathParamSchema: agentIdPathParams,\n queryParamSchema: agentPlanQuerySchema,\n responseSchema: agentPlanResponseSchema,\n summary: 'Read a submitted agent plan',\n description:\n 'Returns a markdown plan when the agent exposes the core submit_plan capability and the path is under .mastracode/plans/.',\n tags: ['Agents', 'Tools'],\n requiresAuth: true,\n requiresPermission: MastraFGAPermissions.AGENTS_READ,\n handler: async ({ agentId, mastra, path, requestContext, status, versionId }) => {\n try {\n const versionOptions = versionId ? { versionId } : status ? { status } : undefined;\n const agent = await getAgentFromSystem({ mastra, agentId, versionOptions, requestContext });\n const tools = await agent.listTools({ requestContext });\n const hasSubmitPlan = Object.values(tools).some(\n tool => typeof tool === 'object' && tool !== null && 'id' in tool && tool.id === submitPlanTool.id,\n );\n\n if (!hasSubmitPlan) {\n throw new HTTPException(404, { message: 'Plan capability not found' });\n }\n if (!isPlanPath(path)) {\n throw new HTTPException(400, { message: 'Invalid plan path' });\n }\n\n const workspace = await agent.getWorkspace({ requestContext });\n const filesystem = await workspace?.resolveFilesystem({ requestContext });\n if (!filesystem) {\n throw new HTTPException(404, { message: 'No workspace filesystem configured' });\n }\n if (!(await filesystem.exists(path))) {\n throw new HTTPException(404, { message: `Plan file \"${path}\" not found` });\n }\n\n const content = await filesystem.readFile(path, { encoding: 'utf-8' });\n return {\n path,\n content: typeof content === 'string' ? content : content.toString('utf-8'),\n };\n } catch (error) {\n return handleError(error, 'Error reading submitted plan');\n }\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IAAI,cAAc,KAAK,EAAE,SAAS,qCAAqC,CAAC;GAEhF,IAAI,CAAE,MAAM,WAAW,OAAO,IAAI,GAChC,MAAM,IAAI,cAAc,KAAK,EAAE,SAAS,cAAc,KAAK,aAAa,CAAC;GAG3E,MAAM,UAAU,MAAM,WAAW,SAAS,MAAM,EAAE,UAAU,QAAQ,CAAC;GACrE,OAAO;IACL;IACA,SAAS,OAAO,YAAY,WAAW,UAAU,QAAQ,SAAS,OAAO;GAC3E;EACF,SAAS,OAAO;GACd,OAAO,YAAY,OAAO,8BAA8B;EAC1D;CACF;AACF,CAAC"}
1
+ {"version":3,"file":"plans-nHOnlGzr.js","names":[],"sources":["../src/server/handlers/plans.ts"],"sourcesContent":["import { submitPlanTool } from '@mastra/core/tools';\nimport { MastraFGAPermissions } from '../fga-permissions';\nimport { HTTPException } from '../http-exception';\nimport { agentIdPathParams, agentPlanQuerySchema, agentPlanResponseSchema } from '../schemas/agents';\nimport { createRoute } from '../server-adapter/routes/route-builder';\nimport { getAgentFromSystem } from './agents';\nimport { handleError } from './error';\n\nconst PLANS_DIRECTORY = '.mastracode/plans/';\n\nfunction isPlanPath(path: string): boolean {\n if (!path.startsWith(PLANS_DIRECTORY)) return false;\n if (!path.endsWith('.md')) return false;\n if (path.includes('\\\\') || path.includes('\\0')) return false;\n\n const relativePath = path.slice(PLANS_DIRECTORY.length);\n const segments = relativePath.split('/');\n return segments.every(segment => segment.length > 0 && segment !== '.' && segment !== '..');\n}\n\nexport const READ_AGENT_PLAN_ROUTE = createRoute({\n method: 'GET',\n path: '/agents/:agentId/plans/file',\n responseType: 'json',\n pathParamSchema: agentIdPathParams,\n queryParamSchema: agentPlanQuerySchema,\n responseSchema: agentPlanResponseSchema,\n summary: 'Read a submitted agent plan',\n description:\n 'Returns a markdown plan when the agent exposes the core submit_plan capability and the path is under .mastracode/plans/.',\n tags: ['Agents', 'Tools'],\n requiresAuth: true,\n requiresPermission: MastraFGAPermissions.AGENTS_READ,\n handler: async ({ agentId, mastra, path, requestContext, status, versionId }) => {\n try {\n const versionOptions = versionId ? { versionId } : status ? { status } : undefined;\n const agent = await getAgentFromSystem({ mastra, agentId, versionOptions, requestContext });\n const tools = await agent.listTools({ requestContext });\n const hasSubmitPlan = Object.values(tools).some(\n tool => typeof tool === 'object' && tool !== null && 'id' in tool && tool.id === submitPlanTool.id,\n );\n\n if (!hasSubmitPlan) {\n throw new HTTPException(404, { message: 'Plan capability not found' });\n }\n if (!isPlanPath(path)) {\n throw new HTTPException(400, { message: 'Invalid plan path' });\n }\n\n const workspace = await agent.getWorkspace({ requestContext });\n const filesystem = await workspace?.resolveFilesystem({ requestContext });\n if (!filesystem) {\n throw new HTTPException(404, { message: 'No workspace filesystem configured' });\n }\n if (!(await filesystem.exists(path))) {\n throw new HTTPException(404, { message: `Plan file \"${path}\" not found` });\n }\n\n const content = await filesystem.readFile(path, { encoding: 'utf-8' });\n return {\n path,\n content: typeof content === 'string' ? content : content.toString('utf-8'),\n };\n } catch (error) {\n return handleError(error, 'Error reading submitted plan');\n }\n },\n});\n"],"mappings":";;;;;;;;;;AAQA,MAAM,kBAAkB;AAExB,SAAS,WAAW,MAAuB;CACzC,IAAI,CAAC,KAAK,WAAW,eAAe,GAAG,OAAO;CAC9C,IAAI,CAAC,KAAK,SAAS,KAAK,GAAG,OAAO;CAClC,IAAI,KAAK,SAAS,IAAI,KAAK,KAAK,SAAS,IAAI,GAAG,OAAO;CAIvD,OAFqB,KAAK,MAAM,EACJ,CAAC,CAAC,MAAM,GACtB,CAAC,CAAC,OAAM,YAAW,QAAQ,SAAS,KAAK,YAAY,OAAO,YAAY,IAAI;AAC5F;AAEA,MAAa,wBAAwB,YAAY;CAC/C,QAAQ;CACR,MAAM;CACN,cAAc;CACd,iBAAiB;CACjB,kBAAkB;CAClB,gBAAgB;CAChB,SAAS;CACT,aACE;CACF,MAAM,CAAC,UAAU,OAAO;CACxB,cAAc;CACd,oBAAoB,qBAAqB;CACzC,SAAS,OAAO,EAAE,SAAS,QAAQ,MAAM,gBAAgB,QAAQ,gBAAgB;EAC/E,IAAI;GAEF,MAAM,QAAQ,MAAM,mBAAmB;IAAE;IAAQ;IAAS,gBADnC,YAAY,EAAE,UAAU,IAAI,SAAS,EAAE,OAAO,IAAI,KAAA;IACC;GAAe,CAAC;GAC1F,MAAM,QAAQ,MAAM,MAAM,UAAU,EAAE,eAAe,CAAC;GAKtD,IAAI,CAJkB,OAAO,OAAO,KAAK,CAAC,CAAC,MACzC,SAAQ,OAAO,SAAS,YAAY,SAAS,QAAQ,QAAQ,QAAQ,KAAK,OAAO,eAAe,EAGjF,GACf,MAAM,IAAI,cAAc,KAAK,EAAE,SAAS,4BAA4B,CAAC;GAEvE,IAAI,CAAC,WAAW,IAAI,GAClB,MAAM,IAAI,cAAc,KAAK,EAAE,SAAS,oBAAoB,CAAC;GAI/D,MAAM,aAAa,OAAM,MADD,MAAM,aAAa,EAAE,eAAe,CAAC,EAAA,EACzB,kBAAkB,EAAE,eAAe,CAAC;GACxE,IAAI,CAAC,YACH,MAAM,IAAI,cAAc,KAAK,EAAE,SAAS,qCAAqC,CAAC;GAEhF,IAAI,CAAE,MAAM,WAAW,OAAO,IAAI,GAChC,MAAM,IAAI,cAAc,KAAK,EAAE,SAAS,cAAc,KAAK,aAAa,CAAC;GAG3E,MAAM,UAAU,MAAM,WAAW,SAAS,MAAM,EAAE,UAAU,QAAQ,CAAC;GACrE,OAAO;IACL;IACA,SAAS,OAAO,YAAY,WAAW,UAAU,QAAQ,SAAS,OAAO;GAC3E;EACF,SAAS,OAAO;GACd,OAAO,YAAY,OAAO,8BAA8B;EAC1D;CACF;AACF,CAAC"}
@@ -1,5 +1,5 @@
1
1
  const require_rolldown_runtime = require("./rolldown-runtime-10nMEhjP.cjs");
2
- const require_dist = require("./dist-CzWU4AmA.cjs");
2
+ const require_dist = require("./dist-BKNKucT9.cjs");
3
3
  let tty = require("tty");
4
4
  tty = require_rolldown_runtime.__toESM(tty, 1);
5
5
  let process$1 = require("process");
@@ -13303,4 +13303,4 @@ Object.defineProperty(exports, "default", {
13303
13303
  }
13304
13304
  });
13305
13305
 
13306
- //# sourceMappingURL=probe-image-size-BRHrC0Va.cjs.map
13306
+ //# sourceMappingURL=probe-image-size-BAwk1h6w.cjs.map