@mastra/server 1.60.0-alpha.8 → 1.60.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.
- package/CHANGELOG.md +140 -0
- package/dist/{a2a-Eeib3vfP.cjs → a2a-BtXFFv-0.cjs} +4 -4
- package/dist/{a2a-Eeib3vfP.cjs.map → a2a-BtXFFv-0.cjs.map} +1 -1
- package/dist/{a2a-B5m54dOP.js → a2a-DZhtQeFL.js} +3 -3
- package/dist/{a2a-B5m54dOP.js.map → a2a-DZhtQeFL.js.map} +1 -1
- package/dist/{agent-versions-xeysPGel.cjs → agent-versions-MYjO6Wl1.cjs} +2 -2
- package/dist/{agent-versions-xeysPGel.cjs.map → agent-versions-MYjO6Wl1.cjs.map} +1 -1
- package/dist/{agent-versions-CWEnD62A.js → agent-versions-mFXaw5ma.js} +2 -2
- package/dist/{agent-versions-CWEnD62A.js.map → agent-versions-mFXaw5ma.js.map} +1 -1
- package/dist/{api-schema-manifest-BKTXRheC.js → api-schema-manifest-Bx_zU5qw.js} +2 -2
- package/dist/{api-schema-manifest-BKTXRheC.js.map → api-schema-manifest-Bx_zU5qw.js.map} +1 -1
- package/dist/{api-schema-manifest-BbNdh5Ck.cjs → api-schema-manifest-DPgfugJT.cjs} +4 -3
- package/dist/{api-schema-manifest-BbNdh5Ck.cjs.map → api-schema-manifest-DPgfugJT.cjs.map} +1 -1
- package/dist/{background-tasks-C5G2jJax.cjs → background-tasks-8M9W_27g.cjs} +2 -2
- package/dist/{background-tasks-C5G2jJax.cjs.map → background-tasks-8M9W_27g.cjs.map} +1 -1
- package/dist/{builder-registry-CyaUg_iP.cjs → builder-registry-Dcd_ApmT.cjs} +3 -3
- package/dist/{builder-registry-CyaUg_iP.cjs.map → builder-registry-Dcd_ApmT.cjs.map} +1 -1
- package/dist/{builder-registry-CqLsr39q.js → builder-registry-DnEa4qnF.js} +2 -2
- package/dist/{builder-registry-CqLsr39q.js.map → builder-registry-DnEa4qnF.js.map} +1 -1
- package/dist/{channels-BnFQESMf.js → channels-BO3Zd38V.js} +2 -2
- package/dist/{channels-BnFQESMf.js.map → channels-BO3Zd38V.js.map} +1 -1
- package/dist/{channels-Dzy6VM3w.cjs → channels-D9WRnKzU.cjs} +3 -3
- package/dist/{channels-Dzy6VM3w.cjs.map → channels-D9WRnKzU.cjs.map} +1 -1
- package/dist/{constants-CutMu4A_.js → constants-0jFCWoex.js} +13 -2
- package/dist/constants-0jFCWoex.js.map +1 -0
- package/dist/{constants-CXPpy-Ef.cjs → constants-4IJp_uzj.cjs} +18 -1
- package/dist/constants-4IJp_uzj.cjs.map +1 -0
- package/dist/{conversations-CcFLCCeF.cjs → conversations-PF0eKhIu.cjs} +3 -3
- package/dist/{conversations-CcFLCCeF.cjs.map → conversations-PF0eKhIu.cjs.map} +1 -1
- package/dist/{dist-CAVC0nWG.cjs → dist-2zVeGGHi.cjs} +3 -2
- package/dist/{dist-CAVC0nWG.cjs.map → dist-2zVeGGHi.cjs.map} +1 -1
- package/dist/{dist-D7GkGue6.cjs → dist-8-Z5v77M.cjs} +3 -2
- package/dist/{dist-D7GkGue6.cjs.map → dist-8-Z5v77M.cjs.map} +1 -1
- package/dist/{dist-SKhVwZMV.cjs → dist-Be7Caz3Z.cjs} +3 -2
- package/dist/{dist-SKhVwZMV.cjs.map → dist-Be7Caz3Z.cjs.map} +1 -1
- package/dist/{dist-18h28zlO.cjs → dist-BfVTO0pC.cjs} +3 -2
- package/dist/{dist-18h28zlO.cjs.map → dist-BfVTO0pC.cjs.map} +1 -1
- package/dist/{dist-BD0I5lxM.js → dist-CHJcZQdS.js} +2 -2
- package/dist/{dist-BD0I5lxM.js.map → dist-CHJcZQdS.js.map} +1 -1
- package/dist/{dist-BpRGQqjE.cjs → dist-CJKQBH69.cjs} +2 -2
- package/dist/{dist-BpRGQqjE.cjs.map → dist-CJKQBH69.cjs.map} +1 -1
- package/dist/{dist-sUhxlnJz.js → dist-CRgxcDTg.js} +2 -2
- package/dist/{dist-sUhxlnJz.js.map → dist-CRgxcDTg.js.map} +1 -1
- package/dist/{dist-JdnTASYe.js → dist-CscF1cF8.js} +2 -2
- package/dist/{dist-JdnTASYe.js.map → dist-CscF1cF8.js.map} +1 -1
- package/dist/{dist-CpxQhZED.js → dist-Cw-T1gX6.js} +2818 -309
- package/dist/dist-Cw-T1gX6.js.map +1 -0
- package/dist/{dist-DBP9kw_8.cjs → dist-D4NzuG3G.cjs} +3 -2
- package/dist/{dist-DBP9kw_8.cjs.map → dist-D4NzuG3G.cjs.map} +1 -1
- package/dist/{dist-CpaK1qK1.cjs → dist-DERatX43.cjs} +2819 -310
- package/dist/dist-DERatX43.cjs.map +1 -0
- package/dist/{dist-mcwHCl2a.js → dist-F_Ql1co6.js} +2 -2
- package/dist/{dist-mcwHCl2a.js.map → dist-F_Ql1co6.js.map} +1 -1
- package/dist/{dist-C-9xUY65.js → dist-Jn3uXsoB.js} +2 -2
- package/dist/{dist-C-9xUY65.js.map → dist-Jn3uXsoB.js.map} +1 -1
- package/dist/{dist-DyBO3IVt.js → dist-bAFqx06T.js} +2 -2
- package/dist/{dist-DyBO3IVt.js.map → dist-bAFqx06T.js.map} +1 -1
- package/dist/docs/SKILL.md +1 -1
- package/dist/docs/assets/SOURCE_MAP.json +1 -1
- package/dist/{dynamic-workflows-C-6vmau5.cjs → dynamic-workflows-BZ5ru36x.cjs} +3 -3
- package/dist/{dynamic-workflows-C-6vmau5.cjs.map → dynamic-workflows-BZ5ru36x.cjs.map} +1 -1
- package/dist/{dynamic-workflows-B0TE8mjA.js → dynamic-workflows-C6U0Rdoc.js} +2 -2
- package/dist/{dynamic-workflows-B0TE8mjA.js.map → dynamic-workflows-C6U0Rdoc.js.map} +1 -1
- package/dist/{editor-builder-1L3OIY4K.cjs → editor-builder-BmRQift0.cjs} +2 -2
- package/dist/{editor-builder-1L3OIY4K.cjs.map → editor-builder-BmRQift0.cjs.map} +1 -1
- package/dist/{helpers-C54OMiDG.cjs → helpers-BWxRRShz.cjs} +2 -2
- package/dist/{helpers-C54OMiDG.cjs.map → helpers-BWxRRShz.cjs.map} +1 -1
- package/dist/{helpers-Da9nPOFL.js → helpers-DBAYsA50.js} +2 -2
- package/dist/{helpers-Da9nPOFL.js.map → helpers-DBAYsA50.js.map} +1 -1
- package/dist/index.cjs +1 -0
- package/dist/index.cjs.map +1 -1
- package/dist/{observability-new-endpoints-BC-dasRY.cjs → observability-new-endpoints-gRCFhnRr.cjs} +2 -2
- package/dist/{observability-new-endpoints-BC-dasRY.cjs.map → observability-new-endpoints-gRCFhnRr.cjs.map} +1 -1
- package/dist/{probe-image-size-C2F59z8Z.cjs → probe-image-size-CDCRrXNo.cjs} +140 -33
- package/dist/probe-image-size-CDCRrXNo.cjs.map +1 -0
- package/dist/{probe-image-size-mXCWYNrz.js → probe-image-size-Tf8sNZhU.js} +137 -33
- package/dist/probe-image-size-Tf8sNZhU.js.map +1 -0
- package/dist/{responses-BI25doe1.cjs → responses-CKNdSRkS.cjs} +2 -2
- package/dist/{responses-BI25doe1.cjs.map → responses-CKNdSRkS.cjs.map} +1 -1
- package/dist/{rolldown-runtime-CVvi-lCc.cjs → rolldown-runtime-Bd6kNlEP.cjs} +21 -0
- package/dist/{rolldown-runtime-DuvcJU0W.js → rolldown-runtime-maW3aOIk.js} +10 -1
- package/dist/{route-builder-BAAedfru.cjs → route-builder-CWsok5ci.cjs} +2 -2
- package/dist/{route-builder-BAAedfru.cjs.map → route-builder-CWsok5ci.cjs.map} +1 -1
- package/dist/{routes-iUe0w9eL.js → routes-Bh2p-WqG.js} +5 -5
- package/dist/{routes-iUe0w9eL.js.map → routes-Bh2p-WqG.js.map} +1 -1
- package/dist/{routes-mK_LlDMo.cjs → routes-CdbboDwv.cjs} +10 -10
- package/dist/{routes-mK_LlDMo.cjs.map → routes-CdbboDwv.cjs.map} +1 -1
- package/dist/{schedules-DOK225ZZ.cjs → schedules-7YUg_TRM.cjs} +2 -2
- package/dist/{schedules-DOK225ZZ.cjs.map → schedules-7YUg_TRM.cjs.map} +1 -1
- package/dist/{schema-Bv9OdW1f-CHHI-NTr.cjs → schema-Bv9OdW1f-CxTiW8RD.cjs} +2 -2
- package/dist/{schema-Bv9OdW1f-CHHI-NTr.cjs.map → schema-Bv9OdW1f-CxTiW8RD.cjs.map} +1 -1
- package/dist/schema-CNKnRmv1.cjs +1 -0
- package/dist/{scorer-versions-CdVjOtQO.js → scorer-versions-D0_KP67E.js} +2 -2
- package/dist/{scorer-versions-CdVjOtQO.js.map → scorer-versions-D0_KP67E.js.map} +1 -1
- package/dist/{scorer-versions-CYXtxMTU.cjs → scorer-versions-mL--H4LL.cjs} +2 -2
- package/dist/{scorer-versions-CYXtxMTU.cjs.map → scorer-versions-mL--H4LL.cjs.map} +1 -1
- package/dist/server/a2a/store.cjs +1 -0
- package/dist/server/a2a/store.cjs.map +1 -1
- package/dist/server/auth/index.cjs +3 -2
- package/dist/server/auth/index.js +2 -2
- package/dist/server/browser-stream/index.cjs +1 -0
- package/dist/server/browser-stream/index.cjs.map +1 -1
- package/dist/server/constants.d.ts +11 -0
- package/dist/server/constants.d.ts.map +1 -1
- package/dist/server/handlers/a2a.cjs +2 -1
- package/dist/server/handlers/a2a.js +1 -1
- package/dist/server/handlers/agent-builder.cjs +4 -4
- package/dist/server/handlers/agent-builder.js +3 -3
- package/dist/server/handlers/agent-controller.cjs +53 -36
- package/dist/server/handlers/agent-controller.cjs.map +1 -1
- package/dist/server/handlers/agent-controller.d.ts +22 -2
- package/dist/server/handlers/agent-controller.d.ts.map +1 -1
- package/dist/server/handlers/agent-controller.js +51 -35
- package/dist/server/handlers/agent-controller.js.map +1 -1
- package/dist/server/handlers/agent-versions.cjs +4 -3
- package/dist/server/handlers/agent-versions.cjs.map +1 -1
- package/dist/server/handlers/agent-versions.js +2 -2
- package/dist/server/handlers/agents.cjs +8 -8
- package/dist/server/handlers/agents.d.ts +8 -0
- package/dist/server/handlers/agents.d.ts.map +1 -1
- package/dist/server/handlers/agents.js +5 -5
- package/dist/server/handlers/auth.cjs +16 -7
- package/dist/server/handlers/auth.cjs.map +1 -1
- package/dist/server/handlers/auth.d.ts +10 -4
- package/dist/server/handlers/auth.d.ts.map +1 -1
- package/dist/server/handlers/auth.js +14 -6
- package/dist/server/handlers/auth.js.map +1 -1
- package/dist/server/handlers/author-enrichment.cjs +1 -0
- package/dist/server/handlers/author-enrichment.cjs.map +1 -1
- package/dist/server/handlers/authorship.cjs +2 -1
- package/dist/server/handlers/authorship.cjs.map +1 -1
- package/dist/server/handlers/authorship.js +1 -1
- package/dist/server/handlers/background-tasks.cjs +2 -1
- package/dist/server/handlers/builder-registry.cjs +2 -1
- package/dist/server/handlers/builder-registry.js +1 -1
- package/dist/server/handlers/channels.cjs +2 -1
- package/dist/server/handlers/channels.js +1 -1
- package/dist/server/handlers/conversations.cjs +4 -4
- package/dist/server/handlers/conversations.js +2 -2
- package/dist/server/handlers/datasets.cjs +3 -2
- package/dist/server/handlers/datasets.cjs.map +1 -1
- package/dist/server/handlers/datasets.d.ts +6 -6
- package/dist/server/handlers/datasets.js +1 -1
- package/dist/server/handlers/dynamic-workflows.cjs +2 -1
- package/dist/server/handlers/dynamic-workflows.js +1 -1
- package/dist/server/handlers/editor-builder.cjs +2 -1
- package/dist/server/handlers/error.cjs +1 -0
- package/dist/server/handlers/error.cjs.map +1 -1
- package/dist/server/handlers/favorites-enrichment.cjs +2 -1
- package/dist/server/handlers/favorites-enrichment.cjs.map +1 -1
- package/dist/server/handlers/gateway-memory-client.cjs +1 -0
- package/dist/server/handlers/gateway-memory-client.cjs.map +1 -1
- package/dist/server/handlers/logs.cjs +3 -3
- package/dist/server/handlers/logs.js +2 -2
- package/dist/server/handlers/mcp-client-versions.cjs +3 -2
- package/dist/server/handlers/mcp-client-versions.cjs.map +1 -1
- package/dist/server/handlers/mcp-client-versions.js +1 -1
- package/dist/server/handlers/mcp.cjs +2 -2
- package/dist/server/handlers/mcp.js +1 -1
- package/dist/server/handlers/memory.cjs +3 -3
- package/dist/server/handlers/memory.js +2 -2
- package/dist/server/handlers/observability-list-query-schemas.cjs +1 -0
- package/dist/server/handlers/observability-list-query-schemas.cjs.map +1 -1
- package/dist/server/handlers/observability-new-endpoints.cjs +2 -1
- package/dist/server/handlers/observability-shared.cjs +2 -1
- package/dist/server/handlers/observability-shared.cjs.map +1 -1
- package/dist/server/handlers/observability-storage-schemas.cjs +1 -1
- package/dist/server/handlers/observability.cjs +8 -5
- package/dist/server/handlers/observability.cjs.map +1 -1
- package/dist/server/handlers/observability.d.ts.map +1 -1
- package/dist/server/handlers/observability.js +7 -4
- package/dist/server/handlers/observability.js.map +1 -1
- package/dist/server/handlers/plans.cjs +3 -3
- package/dist/server/handlers/plans.js +2 -2
- package/dist/server/handlers/processor-providers.cjs +2 -1
- package/dist/server/handlers/processor-providers.cjs.map +1 -1
- package/dist/server/handlers/processors.cjs +2 -1
- package/dist/server/handlers/processors.cjs.map +1 -1
- package/dist/server/handlers/prompt-block-versions.cjs +3 -2
- package/dist/server/handlers/prompt-block-versions.cjs.map +1 -1
- package/dist/server/handlers/prompt-block-versions.js +1 -1
- package/dist/server/handlers/responses.adapter.cjs +1 -0
- package/dist/server/handlers/responses.adapter.cjs.map +1 -1
- package/dist/server/handlers/responses.cjs +4 -4
- package/dist/server/handlers/responses.js +2 -2
- package/dist/server/handlers/responses.storage.cjs +2 -1
- package/dist/server/handlers/responses.storage.cjs.map +1 -1
- package/dist/server/handlers/responses.storage.js +1 -1
- package/dist/server/handlers/schedules-workflows-shim.cjs +1 -1
- package/dist/server/handlers/schedules.cjs +2 -1
- package/dist/server/handlers/scorer-versions.cjs +4 -3
- package/dist/server/handlers/scorer-versions.cjs.map +1 -1
- package/dist/server/handlers/scorer-versions.js +2 -2
- package/dist/server/handlers/scores.cjs +2 -2
- package/dist/server/handlers/scores.js +1 -1
- package/dist/server/handlers/skills-sh-shared.cjs +1 -0
- package/dist/server/handlers/skills-sh-shared.cjs.map +1 -1
- package/dist/server/handlers/stored-agent-favorites.cjs +5 -4
- package/dist/server/handlers/stored-agent-favorites.cjs.map +1 -1
- package/dist/server/handlers/stored-agent-favorites.js +2 -2
- package/dist/server/handlers/stored-agents.cjs +7 -5
- package/dist/server/handlers/stored-agents.cjs.map +1 -1
- package/dist/server/handlers/stored-agents.d.ts +32 -0
- package/dist/server/handlers/stored-agents.d.ts.map +1 -1
- package/dist/server/handlers/stored-agents.js +4 -3
- package/dist/server/handlers/stored-agents.js.map +1 -1
- package/dist/server/handlers/stored-mcp-clients.cjs +3 -2
- package/dist/server/handlers/stored-mcp-clients.cjs.map +1 -1
- package/dist/server/handlers/stored-mcp-clients.js +1 -1
- package/dist/server/handlers/stored-prompt-blocks.cjs +3 -2
- package/dist/server/handlers/stored-prompt-blocks.cjs.map +1 -1
- package/dist/server/handlers/stored-prompt-blocks.js +1 -1
- package/dist/server/handlers/stored-scorers.cjs +4 -3
- package/dist/server/handlers/stored-scorers.cjs.map +1 -1
- package/dist/server/handlers/stored-scorers.js +2 -2
- package/dist/server/handlers/stored-skill-favorites.cjs +4 -3
- package/dist/server/handlers/stored-skill-favorites.cjs.map +1 -1
- package/dist/server/handlers/stored-skill-favorites.js +1 -1
- package/dist/server/handlers/stored-skills.cjs +4 -3
- package/dist/server/handlers/stored-skills.cjs.map +1 -1
- package/dist/server/handlers/stored-skills.js +1 -1
- package/dist/server/handlers/stored-workspaces.cjs +3 -2
- package/dist/server/handlers/stored-workspaces.cjs.map +1 -1
- package/dist/server/handlers/stored-workspaces.js +1 -1
- package/dist/server/handlers/system.cjs +3 -2
- package/dist/server/handlers/system.cjs.map +1 -1
- package/dist/server/handlers/system.js +1 -1
- package/dist/server/handlers/test-utils.cjs +1 -0
- package/dist/server/handlers/test-utils.cjs.map +1 -1
- package/dist/server/handlers/tool-providers.cjs +3 -2
- package/dist/server/handlers/tool-providers.cjs.map +1 -1
- package/dist/server/handlers/tool-providers.js +1 -1
- package/dist/server/handlers/tool-schema-overrides.cjs +1 -0
- package/dist/server/handlers/tool-schema-overrides.cjs.map +1 -1
- package/dist/server/handlers/tools.cjs +6 -6
- package/dist/server/handlers/tools.js +3 -3
- package/dist/server/handlers/utils.cjs +2 -1
- package/dist/server/handlers/utils.js +1 -1
- package/dist/server/handlers/validate-agent-instructions.cjs +2 -1
- package/dist/server/handlers/validate-agent-instructions.cjs.map +1 -1
- package/dist/server/handlers/validate-agent-instructions.js +1 -1
- package/dist/server/handlers/validate-avatar.cjs +1 -0
- package/dist/server/handlers/validate-avatar.cjs.map +1 -1
- package/dist/server/handlers/vector.cjs +2 -2
- package/dist/server/handlers/vector.js +1 -1
- package/dist/server/handlers/version-helpers.cjs +1 -0
- package/dist/server/handlers/version-helpers.cjs.map +1 -1
- package/dist/server/handlers/voice.cjs +1 -1
- package/dist/server/handlers/voice.js +1 -1
- package/dist/server/handlers/workflows.cjs +4 -4
- package/dist/server/handlers/workflows.js +3 -3
- package/dist/server/handlers/workspace.cjs +2 -2
- package/dist/server/handlers/workspace.js +1 -1
- package/dist/server/handlers.cjs +3 -2
- package/dist/server/handlers.js +2 -2
- package/dist/server/schemas/datasets.d.ts +3 -3
- package/dist/server/schemas/index.cjs +7 -6
- package/dist/server/schemas/index.js +4 -4
- package/dist/server/schemas/stored-agents.d.ts +40 -7
- package/dist/server/schemas/stored-agents.d.ts.map +1 -1
- package/dist/server/server-adapter/index.cjs +6 -5
- package/dist/server/server-adapter/index.cjs.map +1 -1
- package/dist/server/server-adapter/index.js +4 -4
- package/dist/server/server-adapter/routes/datasets.d.ts +6 -6
- package/dist/{stored-agents-CPxfYRH9.cjs → stored-agents-D6JEb3zN.cjs} +15 -3
- package/dist/stored-agents-D6JEb3zN.cjs.map +1 -0
- package/dist/{stored-agents-BRBZM-Xl.js → stored-agents-DMW5wrF7.js} +15 -3
- package/dist/stored-agents-DMW5wrF7.js.map +1 -0
- package/dist/{stored-scorers-B__LF0Cy.js → stored-scorers-BA4suzgn.js} +2 -2
- package/dist/{stored-scorers-B__LF0Cy.js.map → stored-scorers-BA4suzgn.js.map} +1 -1
- package/dist/{stored-scorers-Cml7jPJv.cjs → stored-scorers-D8IwVM0S.cjs} +2 -2
- package/dist/{stored-scorers-Cml7jPJv.cjs.map → stored-scorers-D8IwVM0S.cjs.map} +1 -1
- package/dist/{sync-djJ8Lmds.js → sync-BG15Yae1.js} +22 -22
- package/dist/{sync-djJ8Lmds.js.map → sync-BG15Yae1.js.map} +1 -1
- package/dist/{sync-BHatXKfg.cjs → sync-C4LbbSKR.cjs} +22 -22
- package/dist/{sync-BHatXKfg.cjs.map → sync-C4LbbSKR.cjs.map} +1 -1
- package/dist/{utils-CljhO7OY.js → utils-B2vd77Fi.js} +2 -2
- package/dist/{utils-CljhO7OY.js.map → utils-B2vd77Fi.js.map} +1 -1
- package/dist/{utils-BkPZAGxS.cjs → utils-CmYnjLcY.cjs} +4 -4
- package/dist/{utils-BkPZAGxS.cjs.map → utils-CmYnjLcY.cjs.map} +1 -1
- package/dist/{utils-CXbhpYYv.cjs → utils-DJMUhfvY.cjs} +3 -3
- package/dist/{utils-CXbhpYYv.cjs.map → utils-DJMUhfvY.cjs.map} +1 -1
- package/dist/{utils-qMLbyf2U.js → utils-Hz8Hc2cd.js} +2 -2
- package/dist/{utils-qMLbyf2U.js.map → utils-Hz8Hc2cd.js.map} +1 -1
- package/package.json +8 -8
- package/dist/constants-CXPpy-Ef.cjs.map +0 -1
- package/dist/constants-CutMu4A_.js.map +0 -1
- package/dist/dist-CpaK1qK1.cjs.map +0 -1
- package/dist/dist-CpxQhZED.js.map +0 -1
- package/dist/probe-image-size-C2F59z8Z.cjs.map +0 -1
- package/dist/probe-image-size-mXCWYNrz.js.map +0 -1
- package/dist/schema-DkBbires.cjs +0 -1
- package/dist/stored-agents-BRBZM-Xl.js.map +0 -1
- package/dist/stored-agents-CPxfYRH9.cjs.map +0 -1
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
+
require("../../rolldown-runtime-Bd6kNlEP.cjs");
|
|
2
3
|
const require_http_exception = require("../../http-exception-CKDHupKw.cjs");
|
|
3
|
-
const require_route_builder = require("../../route-builder-
|
|
4
|
-
const require_utils = require("../../utils-
|
|
4
|
+
const require_route_builder = require("../../route-builder-CWsok5ci.cjs");
|
|
5
|
+
const require_utils = require("../../utils-CmYnjLcY.cjs");
|
|
5
6
|
const require_server_handlers_error = require("./error.cjs");
|
|
6
7
|
const require_version_common = require("../../version-common-AtNRQ5xH.cjs");
|
|
7
|
-
const require_agent_versions = require("../../agent-versions-
|
|
8
|
+
const require_agent_versions = require("../../agent-versions-MYjO6Wl1.cjs");
|
|
8
9
|
const require_server_handlers_validate_agent_instructions = require("./validate-agent-instructions.cjs");
|
|
9
10
|
const require_server_handlers_version_helpers = require("./version-helpers.cjs");
|
|
10
11
|
//#region src/server/handlers/agent-versions.ts
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"agent-versions.cjs","names":["createRoute","agentVersionPathParams","listVersionsQuerySchema","listVersionsResponseSchema","HTTPException","getStoredResourceScope","handleError","createVersionBodySchema","createVersionResponseSchema","extractConfigFromVersion","calculateChangedFields","createVersionWithRetry","enforceRetentionLimit","versionIdPathParams","getVersionResponseSchema","activateVersionResponseSchema","validateAgentInstructionReferences","restoreVersionResponseSchema","deleteVersionResponseSchema","compareVersionsQuerySchema","compareVersionsResponseSchema","computeVersionDiffs"],"sources":["../../../src/server/handlers/agent-versions.ts"],"sourcesContent":["import type { z } from 'zod/v4';\n\nimport { HTTPException } from '../http-exception';\nimport {\n agentVersionPathParams,\n versionIdPathParams,\n listVersionsQuerySchema,\n createVersionBodySchema,\n compareVersionsQuerySchema,\n listVersionsResponseSchema,\n getVersionResponseSchema,\n createVersionResponseSchema,\n activateVersionResponseSchema,\n restoreVersionResponseSchema,\n deleteVersionResponseSchema,\n compareVersionsResponseSchema,\n} from '../schemas/agent-versions';\nimport type { ServerRoute, RouteSchemas, InferParams } from '../server-adapter/routes';\nimport { createRoute } from '../server-adapter/routes/route-builder';\nimport { assertStoredResourceScope, getStoredResourceScope } from '../utils';\n\nimport { handleError } from './error';\nimport { validateAgentInstructionReferences } from './validate-agent-instructions';\nimport {\n extractConfigFromVersion,\n calculateChangedFields,\n computeVersionDiffs,\n createVersionWithRetry,\n enforceRetentionLimit,\n} from './version-helpers';\nimport type { VersionedStoreInterface } from './version-helpers';\n\n/**\n * The config field names that live on version rows (StorageAgentSnapshotType fields).\n * Used to extract config from a version record for comparison and restoration.\n */\nconst SNAPSHOT_CONFIG_FIELDS = [\n 'name',\n 'description',\n 'instructions',\n 'model',\n 'tools',\n 'defaultOptions',\n 'workflows',\n 'agents',\n 'integrationTools',\n 'inputProcessors',\n 'outputProcessors',\n 'memory',\n 'scorers',\n 'requestContextSchema',\n 'mcpClients',\n] as const;\n\n// ============================================================================\n// Route Definitions\n// ============================================================================\n\n/**\n * GET /stored/agents/:agentId/versions - List all versions for an agent\n */\nexport const LIST_AGENT_VERSIONS_ROUTE = createRoute({\n method: 'GET',\n path: '/stored/agents/:agentId/versions',\n requiresAuth: true,\n responseType: 'json',\n pathParamSchema: agentVersionPathParams,\n queryParamSchema: listVersionsQuerySchema,\n responseSchema: listVersionsResponseSchema,\n summary: 'List agent versions',\n description: 'Returns a paginated list of all versions for a stored agent',\n tags: ['Agent Versions'],\n handler: async ({ mastra, agentId, page, perPage, orderBy, requestContext }) => {\n try {\n const storage = mastra.getStorage();\n\n if (!storage) {\n throw new HTTPException(500, { message: 'Storage is not configured' });\n }\n\n const agentsStore = await storage.getStore('agents');\n if (!agentsStore) {\n throw new HTTPException(500, { message: 'Agents storage domain is not available' });\n }\n\n // Verify agent exists in code or storage\n const storedAgent = await agentsStore.getById(agentId);\n let codeAgentExists = false;\n try {\n mastra.getAgentById(agentId);\n codeAgentExists = true;\n } catch {\n // Agent not registered in code\n }\n\n if (!storedAgent && !codeAgentExists) {\n throw new HTTPException(404, { message: `Agent with id ${agentId} not found` });\n }\n assertStoredResourceScope(storedAgent, await getStoredResourceScope(mastra, requestContext));\n\n const result = await agentsStore.listVersions({\n agentId,\n page,\n perPage,\n orderBy,\n });\n\n return result;\n } catch (error) {\n return handleError(error, 'Error listing agent versions');\n }\n },\n});\n\n/**\n * POST /stored/agents/:agentId/versions - Create a new version snapshot\n */\nexport const CREATE_AGENT_VERSION_ROUTE = createRoute({\n method: 'POST',\n path: '/stored/agents/:agentId/versions',\n requiresAuth: true,\n responseType: 'json',\n pathParamSchema: agentVersionPathParams,\n bodySchema: createVersionBodySchema,\n responseSchema: createVersionResponseSchema,\n summary: 'Create agent version',\n description: 'Creates a new version snapshot of the current agent configuration',\n tags: ['Agent Versions'],\n handler: async ({ mastra, agentId, changeMessage, requestContext }) => {\n try {\n const storage = mastra.getStorage();\n\n if (!storage) {\n throw new HTTPException(500, { message: 'Storage is not configured' });\n }\n\n const agentsStore = await storage.getStore('agents');\n if (!agentsStore) {\n throw new HTTPException(500, { message: 'Agents storage domain is not available' });\n }\n\n // Get the current agent to find its active version\n const agent = await agentsStore.getById(agentId);\n if (!agent) {\n throw new HTTPException(404, { message: `Agent with id ${agentId} not found` });\n }\n assertStoredResourceScope(agent, await getStoredResourceScope(mastra, requestContext));\n\n // Get the current active version to snapshot its config\n let currentConfig: Record<string, unknown> = {};\n if (agent.activeVersionId) {\n const activeVersion = await agentsStore.getVersion(agent.activeVersionId);\n if (activeVersion) {\n currentConfig = extractConfigFromVersion(\n activeVersion as unknown as Record<string, unknown>,\n SNAPSHOT_CONFIG_FIELDS,\n );\n }\n }\n\n // Get the latest version to calculate changed fields\n const latestVersion = await agentsStore.getLatestVersion(agentId);\n\n // If no activeVersionId, fall back to latest version config\n if (!agent.activeVersionId && latestVersion) {\n currentConfig = extractConfigFromVersion(\n latestVersion as unknown as Record<string, unknown>,\n SNAPSHOT_CONFIG_FIELDS,\n );\n }\n const previousConfig = latestVersion\n ? extractConfigFromVersion(latestVersion as unknown as Record<string, unknown>, SNAPSHOT_CONFIG_FIELDS)\n : null;\n\n const changedFields = calculateChangedFields(previousConfig, currentConfig);\n\n // Create the new version with retry logic to handle race conditions\n // Config fields are passed top-level\n const { versionId } = await createVersionWithRetry(\n agentsStore as unknown as VersionedStoreInterface,\n agentId,\n 'agentId',\n currentConfig,\n changedFields,\n { changeMessage },\n );\n\n // Get the created version to return\n const version = await agentsStore.getVersion(versionId);\n if (!version) {\n throw new HTTPException(500, { message: 'Failed to retrieve created version' });\n }\n\n // Enforce retention limit - delete oldest versions if we exceed the max\n await enforceRetentionLimit(\n agentsStore as unknown as VersionedStoreInterface,\n agentId,\n 'agentId',\n agent.activeVersionId,\n );\n\n return version;\n } catch (error) {\n return handleError(error, 'Error creating agent version');\n }\n },\n});\n\n/**\n * GET /stored/agents/:agentId/versions/:versionId - Get a specific version\n */\nexport const GET_AGENT_VERSION_ROUTE = createRoute({\n method: 'GET',\n path: '/stored/agents/:agentId/versions/:versionId',\n requiresAuth: true,\n responseType: 'json',\n pathParamSchema: versionIdPathParams,\n responseSchema: getVersionResponseSchema,\n summary: 'Get agent version',\n description: 'Returns a specific version of an agent by its version ID',\n tags: ['Agent Versions'],\n handler: async ({ mastra, agentId, versionId, requestContext }) => {\n try {\n const storage = mastra.getStorage();\n\n if (!storage) {\n throw new HTTPException(500, { message: 'Storage is not configured' });\n }\n\n const agentsStore = await storage.getStore('agents');\n if (!agentsStore) {\n throw new HTTPException(500, { message: 'Agents storage domain is not available' });\n }\n\n const version = await agentsStore.getVersion(versionId);\n\n if (!version) {\n throw new HTTPException(404, { message: `Version with id ${versionId} not found` });\n }\n\n // Verify the version belongs to the specified agent\n if (version.agentId !== agentId) {\n throw new HTTPException(404, { message: `Version with id ${versionId} not found for agent ${agentId}` });\n }\n const agent = await agentsStore.getById(agentId);\n assertStoredResourceScope(agent, await getStoredResourceScope(mastra, requestContext));\n\n return version;\n } catch (error) {\n return handleError(error, 'Error getting agent version');\n }\n },\n});\n\n/**\n * POST /stored/agents/:agentId/versions/:versionId/activate - Set a version as active\n */\nexport const ACTIVATE_AGENT_VERSION_ROUTE = createRoute({\n method: 'POST',\n path: '/stored/agents/:agentId/versions/:versionId/activate',\n requiresAuth: true,\n responseType: 'json',\n pathParamSchema: versionIdPathParams,\n responseSchema: activateVersionResponseSchema,\n summary: 'Activate agent version',\n description: 'Sets a specific version as the active version for the agent',\n tags: ['Agent Versions'],\n handler: async ({ mastra, agentId, versionId, requestContext }) => {\n try {\n const storage = mastra.getStorage();\n\n if (!storage) {\n throw new HTTPException(500, { message: 'Storage is not configured' });\n }\n\n const agentsStore = await storage.getStore('agents');\n if (!agentsStore) {\n throw new HTTPException(500, { message: 'Agents storage domain is not available' });\n }\n\n // Verify agent exists\n const agent = await agentsStore.getById(agentId);\n if (!agent) {\n throw new HTTPException(404, { message: `Agent with id ${agentId} not found` });\n }\n assertStoredResourceScope(agent, await getStoredResourceScope(mastra, requestContext));\n\n // Verify version exists and belongs to this agent\n const version = await agentsStore.getVersion(versionId);\n if (!version) {\n throw new HTTPException(404, { message: `Version with id ${versionId} not found` });\n }\n if (version.agentId !== agentId) {\n throw new HTTPException(404, { message: `Version with id ${versionId} not found for agent ${agentId}` });\n }\n\n await validateAgentInstructionReferences({\n instructions: version.instructions,\n mastra,\n requestContext,\n });\n\n // Update the agent's activeVersionId AND status to 'published'\n await agentsStore.update({\n id: agentId,\n activeVersionId: versionId,\n status: 'published',\n });\n\n // Clear the editor cache so subsequent requests see the new active version\n mastra.getEditor()?.agent.clearCache(agentId);\n\n return {\n success: true,\n message: `Version ${version.versionNumber} is now active`,\n activeVersionId: versionId,\n };\n } catch (error) {\n return handleError(error, 'Error activating agent version');\n }\n },\n});\n\n/**\n * POST /stored/agents/:agentId/versions/:versionId/restore - Restore agent to a version\n */\nexport const RESTORE_AGENT_VERSION_ROUTE = createRoute({\n method: 'POST',\n path: '/stored/agents/:agentId/versions/:versionId/restore',\n requiresAuth: true,\n responseType: 'json',\n pathParamSchema: versionIdPathParams,\n responseSchema: restoreVersionResponseSchema,\n summary: 'Restore agent version',\n description: 'Restores the agent configuration from a version, creating a new version',\n tags: ['Agent Versions'],\n handler: async ({ mastra, agentId, versionId, requestContext }) => {\n try {\n const storage = mastra.getStorage();\n\n if (!storage) {\n throw new HTTPException(500, { message: 'Storage is not configured' });\n }\n\n const agentsStore = await storage.getStore('agents');\n if (!agentsStore) {\n throw new HTTPException(500, { message: 'Agents storage domain is not available' });\n }\n\n // Verify agent exists\n const agent = await agentsStore.getById(agentId);\n if (!agent) {\n throw new HTTPException(404, { message: `Agent with id ${agentId} not found` });\n }\n assertStoredResourceScope(agent, await getStoredResourceScope(mastra, requestContext));\n\n // Get the version to restore\n const versionToRestore = await agentsStore.getVersion(versionId);\n if (!versionToRestore) {\n throw new HTTPException(404, { message: `Version with id ${versionId} not found` });\n }\n if (versionToRestore.agentId !== agentId) {\n throw new HTTPException(404, { message: `Version with id ${versionId} not found for agent ${agentId}` });\n }\n\n // Extract the config fields from the version to restore (top-level, no .snapshot)\n const restoredConfig = extractConfigFromVersion(\n versionToRestore as unknown as Record<string, unknown>,\n SNAPSHOT_CONFIG_FIELDS,\n );\n\n // Update the agent with the config from the version to restore\n await agentsStore.update({\n id: agentId,\n ...restoredConfig,\n });\n\n // Get the latest version to calculate changed fields\n const latestVersion = await agentsStore.getLatestVersion(agentId);\n const previousConfig = latestVersion\n ? extractConfigFromVersion(latestVersion as unknown as Record<string, unknown>, SNAPSHOT_CONFIG_FIELDS)\n : null;\n\n const changedFields = calculateChangedFields(previousConfig, restoredConfig);\n\n // Create a new version with retry logic to handle race conditions\n // Config fields are passed top-level\n const { versionId: newVersionId } = await createVersionWithRetry(\n agentsStore as unknown as VersionedStoreInterface,\n agentId,\n 'agentId',\n restoredConfig,\n changedFields,\n {\n changeMessage: `Restored from version ${versionToRestore.versionNumber}`,\n },\n );\n\n // Do NOT auto-activate the restored version - user must explicitly activate it\n\n // Get the created version to return\n const newVersion = await agentsStore.getVersion(newVersionId);\n if (!newVersion) {\n throw new HTTPException(500, { message: 'Failed to retrieve created version' });\n }\n\n // Enforce retention limit - delete oldest versions if we exceed the max\n // Use the agent's existing activeVersionId\n await enforceRetentionLimit(\n agentsStore as unknown as VersionedStoreInterface,\n agentId,\n 'agentId',\n agent.activeVersionId,\n );\n\n // Clear the editor cache so subsequent requests see the restored config\n mastra.getEditor()?.agent.clearCache(agentId);\n\n return newVersion;\n } catch (error) {\n return handleError(error, 'Error restoring agent version');\n }\n },\n});\n\n/**\n * DELETE /stored/agents/:agentId/versions/:versionId - Delete a version\n */\nexport const DELETE_AGENT_VERSION_ROUTE = createRoute({\n method: 'DELETE',\n path: '/stored/agents/:agentId/versions/:versionId',\n requiresAuth: true,\n responseType: 'json',\n pathParamSchema: versionIdPathParams,\n responseSchema: deleteVersionResponseSchema,\n summary: 'Delete agent version',\n description: 'Deletes a specific version (cannot delete the active version)',\n tags: ['Agent Versions'],\n handler: async ({ mastra, agentId, versionId, requestContext }) => {\n try {\n const storage = mastra.getStorage();\n\n if (!storage) {\n throw new HTTPException(500, { message: 'Storage is not configured' });\n }\n\n const agentsStore = await storage.getStore('agents');\n if (!agentsStore) {\n throw new HTTPException(500, { message: 'Agents storage domain is not available' });\n }\n\n // Verify agent exists\n const agent = await agentsStore.getById(agentId);\n if (!agent) {\n throw new HTTPException(404, { message: `Agent with id ${agentId} not found` });\n }\n assertStoredResourceScope(agent, await getStoredResourceScope(mastra, requestContext));\n\n // Verify version exists and belongs to this agent\n const version = await agentsStore.getVersion(versionId);\n if (!version) {\n throw new HTTPException(404, { message: `Version with id ${versionId} not found` });\n }\n if (version.agentId !== agentId) {\n throw new HTTPException(404, { message: `Version with id ${versionId} not found for agent ${agentId}` });\n }\n\n // Check if this is the active version\n if (agent.activeVersionId === versionId) {\n throw new HTTPException(400, {\n message: 'Cannot delete the active version. Activate a different version first.',\n });\n }\n\n await agentsStore.deleteVersion(versionId);\n\n // Clear the editor cache in case the deleted version affected resolution\n mastra.getEditor()?.agent.clearCache(agentId);\n\n return {\n success: true,\n message: `Version ${version.versionNumber} deleted successfully`,\n };\n } catch (error) {\n return handleError(error, 'Error deleting agent version');\n }\n },\n});\n\n/**\n * GET /stored/agents/:agentId/versions/compare - Compare two versions\n */\nexport const COMPARE_AGENT_VERSIONS_ROUTE: ServerRoute<\n InferParams<typeof agentVersionPathParams, typeof compareVersionsQuerySchema, undefined>,\n z.infer<typeof compareVersionsResponseSchema>,\n 'json',\n RouteSchemas<\n typeof agentVersionPathParams,\n typeof compareVersionsQuerySchema,\n undefined,\n typeof compareVersionsResponseSchema\n >,\n 'GET',\n '/stored/agents/:agentId/versions/compare'\n> = createRoute({\n method: 'GET',\n path: '/stored/agents/:agentId/versions/compare',\n requiresAuth: true,\n responseType: 'json',\n pathParamSchema: agentVersionPathParams,\n queryParamSchema: compareVersionsQuerySchema,\n responseSchema: compareVersionsResponseSchema,\n summary: 'Compare agent versions',\n description: 'Compares two versions and returns the differences between them',\n tags: ['Agent Versions'],\n handler: async ({ mastra, agentId, from, to, requestContext }) => {\n try {\n const storage = mastra.getStorage();\n\n if (!storage) {\n throw new HTTPException(500, { message: 'Storage is not configured' });\n }\n\n const agentsStore = await storage.getStore('agents');\n if (!agentsStore) {\n throw new HTTPException(500, { message: 'Agents storage domain is not available' });\n }\n const agent = await agentsStore.getById(agentId);\n assertStoredResourceScope(agent, await getStoredResourceScope(mastra, requestContext));\n\n // Get both versions\n const fromVersion = await agentsStore.getVersion(from);\n if (!fromVersion) {\n throw new HTTPException(404, { message: `Version with id ${from} not found` });\n }\n if (fromVersion.agentId !== agentId) {\n throw new HTTPException(404, { message: `Version with id ${from} not found for agent ${agentId}` });\n }\n\n const toVersion = await agentsStore.getVersion(to);\n if (!toVersion) {\n throw new HTTPException(404, { message: `Version with id ${to} not found` });\n }\n if (toVersion.agentId !== agentId) {\n throw new HTTPException(404, { message: `Version with id ${to} not found for agent ${agentId}` });\n }\n\n // Extract config fields from both versions (top-level, no .snapshot)\n const fromConfig = extractConfigFromVersion(\n fromVersion as unknown as Record<string, unknown>,\n SNAPSHOT_CONFIG_FIELDS,\n );\n const toConfig = extractConfigFromVersion(\n toVersion as unknown as Record<string, unknown>,\n SNAPSHOT_CONFIG_FIELDS,\n );\n\n // Compute diffs on the config fields\n const diffs = computeVersionDiffs(fromConfig, toConfig);\n\n return {\n diffs,\n fromVersion,\n toVersion,\n };\n } catch (error) {\n return handleError(error, 'Error comparing agent versions');\n }\n },\n});\n"],"mappings":";;;;;;;;;;;;;;AAoCA,MAAM,yBAAyB;CAC7B;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACF;;;;AASA,MAAa,4BAA4BA,sBAAAA,YAAY;CACnD,QAAQ;CACR,MAAM;CACN,cAAc;CACd,cAAc;CACd,iBAAiBC,uBAAAA;CACjB,kBAAkBC,uBAAAA;CAClB,gBAAgBC,uBAAAA;CAChB,SAAS;CACT,aAAa;CACb,MAAM,CAAC,gBAAgB;CACvB,SAAS,OAAO,EAAE,QAAQ,SAAS,MAAM,SAAS,SAAS,qBAAqB;EAC9E,IAAI;GACF,MAAM,UAAU,OAAO,WAAW;GAElC,IAAI,CAAC,SACH,MAAM,IAAIC,uBAAAA,cAAc,KAAK,EAAE,SAAS,4BAA4B,CAAC;GAGvE,MAAM,cAAc,MAAM,QAAQ,SAAS,QAAQ;GACnD,IAAI,CAAC,aACH,MAAM,IAAIA,uBAAAA,cAAc,KAAK,EAAE,SAAS,yCAAyC,CAAC;GAIpF,MAAM,cAAc,MAAM,YAAY,QAAQ,OAAO;GACrD,IAAI,kBAAkB;GACtB,IAAI;IACF,OAAO,aAAa,OAAO;IAC3B,kBAAkB;GACpB,QAAQ,CAER;GAEA,IAAI,CAAC,eAAe,CAAC,iBACnB,MAAM,IAAIA,uBAAAA,cAAc,KAAK,EAAE,SAAS,iBAAiB,QAAQ,YAAY,CAAC;GAEhF,cAAA,0BAA0B,aAAa,MAAMC,cAAAA,uBAAuB,QAAQ,cAAc,CAAC;GAS3F,OAAO,MAPc,YAAY,aAAa;IAC5C;IACA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KAAK,EAAE,SAAS,mBAAmB,KAAK,YAAY,CAAC;GAE/E,IAAI,YAAY,YAAY,SAC1B,MAAM,IAAIA,uBAAAA,cAAc,KAAK,EAAE,SAAS,mBAAmB,KAAK,uBAAuB,UAAU,CAAC;GAGpG,MAAM,YAAY,MAAM,YAAY,WAAW,EAAE;GACjD,IAAI,CAAC,WACH,MAAM,IAAIA,uBAAAA,cAAc,KAAK,EAAE,SAAS,mBAAmB,GAAG,YAAY,CAAC;GAE7E,IAAI,UAAU,YAAY,SACxB,MAAM,IAAIA,uBAAAA,cAAc,KAAK,EAAE,SAAS,mBAAmB,GAAG,uBAAuB,UAAU,CAAC;GAgBlG,OAAO;IACL,OAHYiB,wCAAAA,oBAVKZ,wCAAAA,yBACjB,aACA,sBAQyC,GAN1BA,wCAAAA,yBACf,WACA,sBAImD,CAG/C;IACJ;IACA;GACF;EACF,SAAS,OAAO;GACd,OAAOH,8BAAAA,YAAY,OAAO,gCAAgC;EAC5D;CACF;AACF,CAAC"}
|
|
1
|
+
{"version":3,"file":"agent-versions.cjs","names":["createRoute","agentVersionPathParams","listVersionsQuerySchema","listVersionsResponseSchema","HTTPException","getStoredResourceScope","handleError","createVersionBodySchema","createVersionResponseSchema","extractConfigFromVersion","calculateChangedFields","createVersionWithRetry","enforceRetentionLimit","versionIdPathParams","getVersionResponseSchema","activateVersionResponseSchema","validateAgentInstructionReferences","restoreVersionResponseSchema","deleteVersionResponseSchema","compareVersionsQuerySchema","compareVersionsResponseSchema","computeVersionDiffs"],"sources":["../../../src/server/handlers/agent-versions.ts"],"sourcesContent":["import type { z } from 'zod/v4';\n\nimport { HTTPException } from '../http-exception';\nimport {\n agentVersionPathParams,\n versionIdPathParams,\n listVersionsQuerySchema,\n createVersionBodySchema,\n compareVersionsQuerySchema,\n listVersionsResponseSchema,\n getVersionResponseSchema,\n createVersionResponseSchema,\n activateVersionResponseSchema,\n restoreVersionResponseSchema,\n deleteVersionResponseSchema,\n compareVersionsResponseSchema,\n} from '../schemas/agent-versions';\nimport type { ServerRoute, RouteSchemas, InferParams } from '../server-adapter/routes';\nimport { createRoute } from '../server-adapter/routes/route-builder';\nimport { assertStoredResourceScope, getStoredResourceScope } from '../utils';\n\nimport { handleError } from './error';\nimport { validateAgentInstructionReferences } from './validate-agent-instructions';\nimport {\n extractConfigFromVersion,\n calculateChangedFields,\n computeVersionDiffs,\n createVersionWithRetry,\n enforceRetentionLimit,\n} from './version-helpers';\nimport type { VersionedStoreInterface } from './version-helpers';\n\n/**\n * The config field names that live on version rows (StorageAgentSnapshotType fields).\n * Used to extract config from a version record for comparison and restoration.\n */\nconst SNAPSHOT_CONFIG_FIELDS = [\n 'name',\n 'description',\n 'instructions',\n 'model',\n 'tools',\n 'defaultOptions',\n 'workflows',\n 'agents',\n 'integrationTools',\n 'inputProcessors',\n 'outputProcessors',\n 'memory',\n 'scorers',\n 'requestContextSchema',\n 'mcpClients',\n] as const;\n\n// ============================================================================\n// Route Definitions\n// ============================================================================\n\n/**\n * GET /stored/agents/:agentId/versions - List all versions for an agent\n */\nexport const LIST_AGENT_VERSIONS_ROUTE = createRoute({\n method: 'GET',\n path: '/stored/agents/:agentId/versions',\n requiresAuth: true,\n responseType: 'json',\n pathParamSchema: agentVersionPathParams,\n queryParamSchema: listVersionsQuerySchema,\n responseSchema: listVersionsResponseSchema,\n summary: 'List agent versions',\n description: 'Returns a paginated list of all versions for a stored agent',\n tags: ['Agent Versions'],\n handler: async ({ mastra, agentId, page, perPage, orderBy, requestContext }) => {\n try {\n const storage = mastra.getStorage();\n\n if (!storage) {\n throw new HTTPException(500, { message: 'Storage is not configured' });\n }\n\n const agentsStore = await storage.getStore('agents');\n if (!agentsStore) {\n throw new HTTPException(500, { message: 'Agents storage domain is not available' });\n }\n\n // Verify agent exists in code or storage\n const storedAgent = await agentsStore.getById(agentId);\n let codeAgentExists = false;\n try {\n mastra.getAgentById(agentId);\n codeAgentExists = true;\n } catch {\n // Agent not registered in code\n }\n\n if (!storedAgent && !codeAgentExists) {\n throw new HTTPException(404, { message: `Agent with id ${agentId} not found` });\n }\n assertStoredResourceScope(storedAgent, await getStoredResourceScope(mastra, requestContext));\n\n const result = await agentsStore.listVersions({\n agentId,\n page,\n perPage,\n orderBy,\n });\n\n return result;\n } catch (error) {\n return handleError(error, 'Error listing agent versions');\n }\n },\n});\n\n/**\n * POST /stored/agents/:agentId/versions - Create a new version snapshot\n */\nexport const CREATE_AGENT_VERSION_ROUTE = createRoute({\n method: 'POST',\n path: '/stored/agents/:agentId/versions',\n requiresAuth: true,\n responseType: 'json',\n pathParamSchema: agentVersionPathParams,\n bodySchema: createVersionBodySchema,\n responseSchema: createVersionResponseSchema,\n summary: 'Create agent version',\n description: 'Creates a new version snapshot of the current agent configuration',\n tags: ['Agent Versions'],\n handler: async ({ mastra, agentId, changeMessage, requestContext }) => {\n try {\n const storage = mastra.getStorage();\n\n if (!storage) {\n throw new HTTPException(500, { message: 'Storage is not configured' });\n }\n\n const agentsStore = await storage.getStore('agents');\n if (!agentsStore) {\n throw new HTTPException(500, { message: 'Agents storage domain is not available' });\n }\n\n // Get the current agent to find its active version\n const agent = await agentsStore.getById(agentId);\n if (!agent) {\n throw new HTTPException(404, { message: `Agent with id ${agentId} not found` });\n }\n assertStoredResourceScope(agent, await getStoredResourceScope(mastra, requestContext));\n\n // Get the current active version to snapshot its config\n let currentConfig: Record<string, unknown> = {};\n if (agent.activeVersionId) {\n const activeVersion = await agentsStore.getVersion(agent.activeVersionId);\n if (activeVersion) {\n currentConfig = extractConfigFromVersion(\n activeVersion as unknown as Record<string, unknown>,\n SNAPSHOT_CONFIG_FIELDS,\n );\n }\n }\n\n // Get the latest version to calculate changed fields\n const latestVersion = await agentsStore.getLatestVersion(agentId);\n\n // If no activeVersionId, fall back to latest version config\n if (!agent.activeVersionId && latestVersion) {\n currentConfig = extractConfigFromVersion(\n latestVersion as unknown as Record<string, unknown>,\n SNAPSHOT_CONFIG_FIELDS,\n );\n }\n const previousConfig = latestVersion\n ? extractConfigFromVersion(latestVersion as unknown as Record<string, unknown>, SNAPSHOT_CONFIG_FIELDS)\n : null;\n\n const changedFields = calculateChangedFields(previousConfig, currentConfig);\n\n // Create the new version with retry logic to handle race conditions\n // Config fields are passed top-level\n const { versionId } = await createVersionWithRetry(\n agentsStore as unknown as VersionedStoreInterface,\n agentId,\n 'agentId',\n currentConfig,\n changedFields,\n { changeMessage },\n );\n\n // Get the created version to return\n const version = await agentsStore.getVersion(versionId);\n if (!version) {\n throw new HTTPException(500, { message: 'Failed to retrieve created version' });\n }\n\n // Enforce retention limit - delete oldest versions if we exceed the max\n await enforceRetentionLimit(\n agentsStore as unknown as VersionedStoreInterface,\n agentId,\n 'agentId',\n agent.activeVersionId,\n );\n\n return version;\n } catch (error) {\n return handleError(error, 'Error creating agent version');\n }\n },\n});\n\n/**\n * GET /stored/agents/:agentId/versions/:versionId - Get a specific version\n */\nexport const GET_AGENT_VERSION_ROUTE = createRoute({\n method: 'GET',\n path: '/stored/agents/:agentId/versions/:versionId',\n requiresAuth: true,\n responseType: 'json',\n pathParamSchema: versionIdPathParams,\n responseSchema: getVersionResponseSchema,\n summary: 'Get agent version',\n description: 'Returns a specific version of an agent by its version ID',\n tags: ['Agent Versions'],\n handler: async ({ mastra, agentId, versionId, requestContext }) => {\n try {\n const storage = mastra.getStorage();\n\n if (!storage) {\n throw new HTTPException(500, { message: 'Storage is not configured' });\n }\n\n const agentsStore = await storage.getStore('agents');\n if (!agentsStore) {\n throw new HTTPException(500, { message: 'Agents storage domain is not available' });\n }\n\n const version = await agentsStore.getVersion(versionId);\n\n if (!version) {\n throw new HTTPException(404, { message: `Version with id ${versionId} not found` });\n }\n\n // Verify the version belongs to the specified agent\n if (version.agentId !== agentId) {\n throw new HTTPException(404, { message: `Version with id ${versionId} not found for agent ${agentId}` });\n }\n const agent = await agentsStore.getById(agentId);\n assertStoredResourceScope(agent, await getStoredResourceScope(mastra, requestContext));\n\n return version;\n } catch (error) {\n return handleError(error, 'Error getting agent version');\n }\n },\n});\n\n/**\n * POST /stored/agents/:agentId/versions/:versionId/activate - Set a version as active\n */\nexport const ACTIVATE_AGENT_VERSION_ROUTE = createRoute({\n method: 'POST',\n path: '/stored/agents/:agentId/versions/:versionId/activate',\n requiresAuth: true,\n responseType: 'json',\n pathParamSchema: versionIdPathParams,\n responseSchema: activateVersionResponseSchema,\n summary: 'Activate agent version',\n description: 'Sets a specific version as the active version for the agent',\n tags: ['Agent Versions'],\n handler: async ({ mastra, agentId, versionId, requestContext }) => {\n try {\n const storage = mastra.getStorage();\n\n if (!storage) {\n throw new HTTPException(500, { message: 'Storage is not configured' });\n }\n\n const agentsStore = await storage.getStore('agents');\n if (!agentsStore) {\n throw new HTTPException(500, { message: 'Agents storage domain is not available' });\n }\n\n // Verify agent exists\n const agent = await agentsStore.getById(agentId);\n if (!agent) {\n throw new HTTPException(404, { message: `Agent with id ${agentId} not found` });\n }\n assertStoredResourceScope(agent, await getStoredResourceScope(mastra, requestContext));\n\n // Verify version exists and belongs to this agent\n const version = await agentsStore.getVersion(versionId);\n if (!version) {\n throw new HTTPException(404, { message: `Version with id ${versionId} not found` });\n }\n if (version.agentId !== agentId) {\n throw new HTTPException(404, { message: `Version with id ${versionId} not found for agent ${agentId}` });\n }\n\n await validateAgentInstructionReferences({\n instructions: version.instructions,\n mastra,\n requestContext,\n });\n\n // Update the agent's activeVersionId AND status to 'published'\n await agentsStore.update({\n id: agentId,\n activeVersionId: versionId,\n status: 'published',\n });\n\n // Clear the editor cache so subsequent requests see the new active version\n mastra.getEditor()?.agent.clearCache(agentId);\n\n return {\n success: true,\n message: `Version ${version.versionNumber} is now active`,\n activeVersionId: versionId,\n };\n } catch (error) {\n return handleError(error, 'Error activating agent version');\n }\n },\n});\n\n/**\n * POST /stored/agents/:agentId/versions/:versionId/restore - Restore agent to a version\n */\nexport const RESTORE_AGENT_VERSION_ROUTE = createRoute({\n method: 'POST',\n path: '/stored/agents/:agentId/versions/:versionId/restore',\n requiresAuth: true,\n responseType: 'json',\n pathParamSchema: versionIdPathParams,\n responseSchema: restoreVersionResponseSchema,\n summary: 'Restore agent version',\n description: 'Restores the agent configuration from a version, creating a new version',\n tags: ['Agent Versions'],\n handler: async ({ mastra, agentId, versionId, requestContext }) => {\n try {\n const storage = mastra.getStorage();\n\n if (!storage) {\n throw new HTTPException(500, { message: 'Storage is not configured' });\n }\n\n const agentsStore = await storage.getStore('agents');\n if (!agentsStore) {\n throw new HTTPException(500, { message: 'Agents storage domain is not available' });\n }\n\n // Verify agent exists\n const agent = await agentsStore.getById(agentId);\n if (!agent) {\n throw new HTTPException(404, { message: `Agent with id ${agentId} not found` });\n }\n assertStoredResourceScope(agent, await getStoredResourceScope(mastra, requestContext));\n\n // Get the version to restore\n const versionToRestore = await agentsStore.getVersion(versionId);\n if (!versionToRestore) {\n throw new HTTPException(404, { message: `Version with id ${versionId} not found` });\n }\n if (versionToRestore.agentId !== agentId) {\n throw new HTTPException(404, { message: `Version with id ${versionId} not found for agent ${agentId}` });\n }\n\n // Extract the config fields from the version to restore (top-level, no .snapshot)\n const restoredConfig = extractConfigFromVersion(\n versionToRestore as unknown as Record<string, unknown>,\n SNAPSHOT_CONFIG_FIELDS,\n );\n\n // Update the agent with the config from the version to restore\n await agentsStore.update({\n id: agentId,\n ...restoredConfig,\n });\n\n // Get the latest version to calculate changed fields\n const latestVersion = await agentsStore.getLatestVersion(agentId);\n const previousConfig = latestVersion\n ? extractConfigFromVersion(latestVersion as unknown as Record<string, unknown>, SNAPSHOT_CONFIG_FIELDS)\n : null;\n\n const changedFields = calculateChangedFields(previousConfig, restoredConfig);\n\n // Create a new version with retry logic to handle race conditions\n // Config fields are passed top-level\n const { versionId: newVersionId } = await createVersionWithRetry(\n agentsStore as unknown as VersionedStoreInterface,\n agentId,\n 'agentId',\n restoredConfig,\n changedFields,\n {\n changeMessage: `Restored from version ${versionToRestore.versionNumber}`,\n },\n );\n\n // Do NOT auto-activate the restored version - user must explicitly activate it\n\n // Get the created version to return\n const newVersion = await agentsStore.getVersion(newVersionId);\n if (!newVersion) {\n throw new HTTPException(500, { message: 'Failed to retrieve created version' });\n }\n\n // Enforce retention limit - delete oldest versions if we exceed the max\n // Use the agent's existing activeVersionId\n await enforceRetentionLimit(\n agentsStore as unknown as VersionedStoreInterface,\n agentId,\n 'agentId',\n agent.activeVersionId,\n );\n\n // Clear the editor cache so subsequent requests see the restored config\n mastra.getEditor()?.agent.clearCache(agentId);\n\n return newVersion;\n } catch (error) {\n return handleError(error, 'Error restoring agent version');\n }\n },\n});\n\n/**\n * DELETE /stored/agents/:agentId/versions/:versionId - Delete a version\n */\nexport const DELETE_AGENT_VERSION_ROUTE = createRoute({\n method: 'DELETE',\n path: '/stored/agents/:agentId/versions/:versionId',\n requiresAuth: true,\n responseType: 'json',\n pathParamSchema: versionIdPathParams,\n responseSchema: deleteVersionResponseSchema,\n summary: 'Delete agent version',\n description: 'Deletes a specific version (cannot delete the active version)',\n tags: ['Agent Versions'],\n handler: async ({ mastra, agentId, versionId, requestContext }) => {\n try {\n const storage = mastra.getStorage();\n\n if (!storage) {\n throw new HTTPException(500, { message: 'Storage is not configured' });\n }\n\n const agentsStore = await storage.getStore('agents');\n if (!agentsStore) {\n throw new HTTPException(500, { message: 'Agents storage domain is not available' });\n }\n\n // Verify agent exists\n const agent = await agentsStore.getById(agentId);\n if (!agent) {\n throw new HTTPException(404, { message: `Agent with id ${agentId} not found` });\n }\n assertStoredResourceScope(agent, await getStoredResourceScope(mastra, requestContext));\n\n // Verify version exists and belongs to this agent\n const version = await agentsStore.getVersion(versionId);\n if (!version) {\n throw new HTTPException(404, { message: `Version with id ${versionId} not found` });\n }\n if (version.agentId !== agentId) {\n throw new HTTPException(404, { message: `Version with id ${versionId} not found for agent ${agentId}` });\n }\n\n // Check if this is the active version\n if (agent.activeVersionId === versionId) {\n throw new HTTPException(400, {\n message: 'Cannot delete the active version. Activate a different version first.',\n });\n }\n\n await agentsStore.deleteVersion(versionId);\n\n // Clear the editor cache in case the deleted version affected resolution\n mastra.getEditor()?.agent.clearCache(agentId);\n\n return {\n success: true,\n message: `Version ${version.versionNumber} deleted successfully`,\n };\n } catch (error) {\n return handleError(error, 'Error deleting agent version');\n }\n },\n});\n\n/**\n * GET /stored/agents/:agentId/versions/compare - Compare two versions\n */\nexport const COMPARE_AGENT_VERSIONS_ROUTE: ServerRoute<\n InferParams<typeof agentVersionPathParams, typeof compareVersionsQuerySchema, undefined>,\n z.infer<typeof compareVersionsResponseSchema>,\n 'json',\n RouteSchemas<\n typeof agentVersionPathParams,\n typeof compareVersionsQuerySchema,\n undefined,\n typeof compareVersionsResponseSchema\n >,\n 'GET',\n '/stored/agents/:agentId/versions/compare'\n> = createRoute({\n method: 'GET',\n path: '/stored/agents/:agentId/versions/compare',\n requiresAuth: true,\n responseType: 'json',\n pathParamSchema: agentVersionPathParams,\n queryParamSchema: compareVersionsQuerySchema,\n responseSchema: compareVersionsResponseSchema,\n summary: 'Compare agent versions',\n description: 'Compares two versions and returns the differences between them',\n tags: ['Agent Versions'],\n handler: async ({ mastra, agentId, from, to, requestContext }) => {\n try {\n const storage = mastra.getStorage();\n\n if (!storage) {\n throw new HTTPException(500, { message: 'Storage is not configured' });\n }\n\n const agentsStore = await storage.getStore('agents');\n if (!agentsStore) {\n throw new HTTPException(500, { message: 'Agents storage domain is not available' });\n }\n const agent = await agentsStore.getById(agentId);\n assertStoredResourceScope(agent, await getStoredResourceScope(mastra, requestContext));\n\n // Get both versions\n const fromVersion = await agentsStore.getVersion(from);\n if (!fromVersion) {\n throw new HTTPException(404, { message: `Version with id ${from} not found` });\n }\n if (fromVersion.agentId !== agentId) {\n throw new HTTPException(404, { message: `Version with id ${from} not found for agent ${agentId}` });\n }\n\n const toVersion = await agentsStore.getVersion(to);\n if (!toVersion) {\n throw new HTTPException(404, { message: `Version with id ${to} not found` });\n }\n if (toVersion.agentId !== agentId) {\n throw new HTTPException(404, { message: `Version with id ${to} not found for agent ${agentId}` });\n }\n\n // Extract config fields from both versions (top-level, no .snapshot)\n const fromConfig = extractConfigFromVersion(\n fromVersion as unknown as Record<string, unknown>,\n SNAPSHOT_CONFIG_FIELDS,\n );\n const toConfig = extractConfigFromVersion(\n toVersion as unknown as Record<string, unknown>,\n SNAPSHOT_CONFIG_FIELDS,\n );\n\n // Compute diffs on the config fields\n const diffs = computeVersionDiffs(fromConfig, toConfig);\n\n return {\n diffs,\n fromVersion,\n toVersion,\n };\n } catch (error) {\n return handleError(error, 'Error comparing agent versions');\n }\n },\n});\n"],"mappings":";;;;;;;;;;;;;;;AAoCA,MAAM,yBAAyB;CAC7B;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACF;;;;AASA,MAAa,4BAA4BA,sBAAAA,YAAY;CACnD,QAAQ;CACR,MAAM;CACN,cAAc;CACd,cAAc;CACd,iBAAiBC,uBAAAA;CACjB,kBAAkBC,uBAAAA;CAClB,gBAAgBC,uBAAAA;CAChB,SAAS;CACT,aAAa;CACb,MAAM,CAAC,gBAAgB;CACvB,SAAS,OAAO,EAAE,QAAQ,SAAS,MAAM,SAAS,SAAS,qBAAqB;EAC9E,IAAI;GACF,MAAM,UAAU,OAAO,WAAW;GAElC,IAAI,CAAC,SACH,MAAM,IAAIC,uBAAAA,cAAc,KAAK,EAAE,SAAS,4BAA4B,CAAC;GAGvE,MAAM,cAAc,MAAM,QAAQ,SAAS,QAAQ;GACnD,IAAI,CAAC,aACH,MAAM,IAAIA,uBAAAA,cAAc,KAAK,EAAE,SAAS,yCAAyC,CAAC;GAIpF,MAAM,cAAc,MAAM,YAAY,QAAQ,OAAO;GACrD,IAAI,kBAAkB;GACtB,IAAI;IACF,OAAO,aAAa,OAAO;IAC3B,kBAAkB;GACpB,QAAQ,CAER;GAEA,IAAI,CAAC,eAAe,CAAC,iBACnB,MAAM,IAAIA,uBAAAA,cAAc,KAAK,EAAE,SAAS,iBAAiB,QAAQ,YAAY,CAAC;GAEhF,cAAA,0BAA0B,aAAa,MAAMC,cA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,MAAM,YAAY,WAAW,IAAI;GACrD,IAAI,CAAC,aACH,MAAM,IAAID,uBAAAA,cAAc,KAAK,EAAE,SAAS,mBAAmB,KAAK,YAAY,CAAC;GAE/E,IAAI,YAAY,YAAY,SAC1B,MAAM,IAAIA,uBAAAA,cAAc,KAAK,EAAE,SAAS,mBAAmB,KAAK,uBAAuB,UAAU,CAAC;GAGpG,MAAM,YAAY,MAAM,YAAY,WAAW,EAAE;GACjD,IAAI,CAAC,WACH,MAAM,IAAIA,uBAAAA,cAAc,KAAK,EAAE,SAAS,mBAAmB,GAAG,YAAY,CAAC;GAE7E,IAAI,UAAU,YAAY,SACxB,MAAM,IAAIA,uBAAAA,cAAc,KAAK,EAAE,SAAS,mBAAmB,GAAG,uBAAuB,UAAU,CAAC;GAgBlG,OAAO;IACL,OAHYiB,wCAAAA,oBAVKZ,wCAAAA,yBACjB,aACA,sBAQyC,GAN1BA,wCAAAA,yBACf,WACA,sBAImD,CAG/C;IACJ;IACA;GACF;EACF,SAAS,OAAO;GACd,OAAOH,8BAAAA,YAAY,OAAO,gCAAgC;EAC5D;CACF;AACF,CAAC"}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { t as HTTPException } from "../../http-exception-CyfxZB6W.js";
|
|
2
2
|
import { n as createRoute } from "../../route-builder-YQ_gLIvW.js";
|
|
3
|
-
import { i as getStoredResourceScope, n as assertStoredResourceScope } from "../../utils-
|
|
3
|
+
import { i as getStoredResourceScope, n as assertStoredResourceScope } from "../../utils-B2vd77Fi.js";
|
|
4
4
|
import { handleError } from "./error.js";
|
|
5
5
|
import { a as createVersionBodySchema, n as compareVersionsQuerySchema, o as deleteVersionResponseSchema, s as listVersionsQuerySchema, t as activateVersionResponseSchema } from "../../version-common-CudZ_WuW.js";
|
|
6
|
-
import { a as getVersionResponseSchema, c as versionIdPathParams, i as createVersionResponseSchema, o as listVersionsResponseSchema, r as compareVersionsResponseSchema, s as restoreVersionResponseSchema, t as agentVersionPathParams } from "../../agent-versions-
|
|
6
|
+
import { a as getVersionResponseSchema, c as versionIdPathParams, i as createVersionResponseSchema, o as listVersionsResponseSchema, r as compareVersionsResponseSchema, s as restoreVersionResponseSchema, t as agentVersionPathParams } from "../../agent-versions-mFXaw5ma.js";
|
|
7
7
|
import { validateAgentInstructionReferences } from "./validate-agent-instructions.js";
|
|
8
8
|
import { calculateChangedFields, computeVersionDiffs, createVersionWithRetry, enforceRetentionLimit, extractConfigFromVersion } from "./version-helpers.js";
|
|
9
9
|
//#region src/server/handlers/agent-versions.ts
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
const require_rolldown_runtime = require("../../rolldown-runtime-
|
|
2
|
+
const require_rolldown_runtime = require("../../rolldown-runtime-Bd6kNlEP.cjs");
|
|
3
3
|
const require_http_exception = require("../../http-exception-CKDHupKw.cjs");
|
|
4
4
|
const require_agents = require("../../agents-CLv_RFQx.cjs");
|
|
5
|
-
const require_schema_Bv9OdW1f = require("../../schema-Bv9OdW1f-
|
|
6
|
-
const require_route_builder = require("../../route-builder-
|
|
7
|
-
require("../../schema-
|
|
8
|
-
const require_utils = require("../../utils-
|
|
9
|
-
const require_constants = require("../../constants-
|
|
5
|
+
const require_schema_Bv9OdW1f = require("../../schema-Bv9OdW1f-CxTiW8RD.cjs");
|
|
6
|
+
const require_route_builder = require("../../route-builder-CWsok5ci.cjs");
|
|
7
|
+
require("../../schema-CNKnRmv1.cjs");
|
|
8
|
+
const require_utils = require("../../utils-CmYnjLcY.cjs");
|
|
9
|
+
const require_constants = require("../../constants-4IJp_uzj.cjs");
|
|
10
10
|
const require_server_handlers_error = require("./error.cjs");
|
|
11
|
-
const require_utils$1 = require("../../utils-
|
|
12
|
-
const require_stored_agents = require("../../stored-agents-
|
|
11
|
+
const require_utils$1 = require("../../utils-DJMUhfvY.cjs");
|
|
12
|
+
const require_stored_agents = require("../../stored-agents-D6JEb3zN.cjs");
|
|
13
13
|
const require_workspace = require("../../workspace-Cz9hE2ei.cjs");
|
|
14
14
|
const require_server_handlers_tool_schema_overrides = require("./tool-schema-overrides.cjs");
|
|
15
15
|
let zod_v4 = require("zod/v4");
|
|
@@ -2260,6 +2260,10 @@ export declare const CLONE_AGENT_ROUTE: Omit<import("@mastra/core/server").ApiRo
|
|
|
2260
2260
|
} | undefined;
|
|
2261
2261
|
}[] | null | undefined;
|
|
2262
2262
|
requestContextSchema?: Record<string, unknown> | undefined;
|
|
2263
|
+
durable?: boolean | {
|
|
2264
|
+
maxSteps?: number | undefined;
|
|
2265
|
+
cleanupTimeoutMs?: number | undefined;
|
|
2266
|
+
} | undefined;
|
|
2263
2267
|
}>;
|
|
2264
2268
|
pathParamSchema?: z.ZodType;
|
|
2265
2269
|
queryParamSchema?: z.ZodType;
|
|
@@ -6106,6 +6110,10 @@ export declare const CLONE_AGENT_ROUTE: Omit<import("@mastra/core/server").ApiRo
|
|
|
6106
6110
|
}, z.core.$strip>>;
|
|
6107
6111
|
}, z.core.$strip>>]>, z.ZodBoolean, z.ZodNull]>>;
|
|
6108
6112
|
requestContextSchema: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
6113
|
+
durable: z.ZodOptional<z.ZodUnion<readonly [z.ZodBoolean, z.ZodObject<{
|
|
6114
|
+
maxSteps: z.ZodOptional<z.ZodNumber>;
|
|
6115
|
+
cleanupTimeoutMs: z.ZodOptional<z.ZodNumber>;
|
|
6116
|
+
}, z.core.$strip>]>>;
|
|
6109
6117
|
}, z.core.$strip>> | undefined;
|
|
6110
6118
|
} & {
|
|
6111
6119
|
readonly _mastraSchemaRoute: true;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"agents.d.ts","sourceRoot":"","sources":["../../../src/server/handlers/agents.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAsB,MAAM,oBAAoB,CAAC;AAC/D,OAAO,KAAK,EACV,iBAAiB,EAEjB,uBAAuB,EAGx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;;;;;;;;;;;;;;;;;;;;;;;CAexC,CAAC;AAEH,eAAO,MAAM,wCAAwC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAyBnD,CAAC;AAEH,eAAO,MAAM,kCAAkC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAc7C,CAAC;AAMH,eAAO,MAAM,qBAAqB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA2ChC,CAAC"}
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { r as __exportAll } from "../../rolldown-runtime-maW3aOIk.js";
|
|
2
2
|
import { t as HTTPException } from "../../http-exception-CyfxZB6W.js";
|
|
3
3
|
import { A as providersResponseSchema, C as listSuspendedRunsResponseSchema, D as observeAgentBodySchema, E as modelManagementResponseSchema, F as resumeStreamUntilIdleBodySchema, I as sendAgentMessageBodySchema, J as subscribeAgentThreadBodySchema, K as streamResponseSchema, L as sendAgentSignalBodySchema, M as recoverBodySchema, N as reorderAgentModelListBodySchema, O as observeAgentResponseSchema, P as resumeStreamBodySchema, Q as updateAgentModelInModelListBodySchema, R as sendToolApprovalBodySchema, S as listSuspendedRunsQuerySchema, T as modelConfigIdPathParams, V as serializedAgentSchema, Y as toolCallResponseSchema, Z as updateAgentModelBodySchema, a as agentIdPathParams, b as generateResponseSchema, c as agentSkillPathParams, d as approveNetworkToolCallBodySchema, f as approveToolCallBodySchema, g as enhanceInstructionsResponseSchema, h as enhanceInstructionsBodySchema, i as agentExecutionLegacyBodySchema, j as queueAgentMessageBodySchema, m as declineToolCallBodySchema, n as abortAgentThreadResponseSchema, p as declineNetworkToolCallBodySchema, q as streamUntilIdleBodySchema, r as agentExecutionBodySchema, t as abortAgentThreadBodySchema, u as agentVersionQuerySchema, x as listAgentsResponseSchema, z as sendToolApprovalResponseSchema } from "../../agents-BetrUB_N.js";
|
|
4
4
|
import { n as standardSchemaToJSONSchema, r as toStandardSchema } from "../../schema-Bv9OdW1f-DLSJSqQv.js";
|
|
5
5
|
import { n as createRoute } from "../../route-builder-YQ_gLIvW.js";
|
|
6
6
|
import "../../schema-CGeYTFwm.js";
|
|
7
|
-
import { c as toSlug, l as stringify } from "../../utils-
|
|
8
|
-
import {
|
|
7
|
+
import { c as toSlug, l as stringify } from "../../utils-B2vd77Fi.js";
|
|
8
|
+
import { f as WORKSPACE_TOOLS, h as resolveToolConfig, i as MASTRA_IS_STUDIO_KEY, o as MASTRA_RESOURCE_ID_KEY, p as isReservedRequestContextKey } from "../../constants-0jFCWoex.js";
|
|
9
9
|
import { handleError } from "./error.js";
|
|
10
|
-
import { c as validateBody, d as MastraFGAPermissions, l as validateRunOwnership, n as getEffectiveResourceId, o as requireEffectiveResourceId, r as getEffectiveThreadId, s as sanitizeBody, t as enforceThreadAccess, u as validateThreadOwnership } from "../../utils-
|
|
11
|
-
import { r as createStoredAgentResponseSchema } from "../../stored-agents-
|
|
10
|
+
import { c as validateBody, d as MastraFGAPermissions, l as validateRunOwnership, n as getEffectiveResourceId, o as requireEffectiveResourceId, r as getEffectiveThreadId, s as sanitizeBody, t as enforceThreadAccess, u as validateThreadOwnership } from "../../utils-Hz8Hc2cd.js";
|
|
11
|
+
import { r as createStoredAgentResponseSchema } from "../../stored-agents-DMW5wrF7.js";
|
|
12
12
|
import { O as skillDisambiguationQuerySchema, h as getAgentSkillResponseSchema } from "../../workspace-S5GiJ3Nx.js";
|
|
13
13
|
import { stripInjectedToolOverrideFields } from "./tool-schema-overrides.js";
|
|
14
14
|
import { z } from "zod/v4";
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
+
require("../../rolldown-runtime-Bd6kNlEP.cjs");
|
|
2
3
|
const require_http_exception = require("../../http-exception-CKDHupKw.cjs");
|
|
3
|
-
const require_route_builder = require("../../route-builder-
|
|
4
|
-
const require_constants = require("../../constants-
|
|
4
|
+
const require_route_builder = require("../../route-builder-CWsok5ci.cjs");
|
|
5
|
+
const require_constants = require("../../constants-4IJp_uzj.cjs");
|
|
5
6
|
const require_server_handlers_error = require("./error.cjs");
|
|
6
|
-
const require_helpers = require("../../helpers-
|
|
7
|
+
const require_helpers = require("../../helpers-BWxRRShz.cjs");
|
|
7
8
|
const require_auth = require("../../auth-B8fQdEg-.cjs");
|
|
8
9
|
let zod_v4 = require("zod/v4");
|
|
9
10
|
//#region src/server/handlers/auth.ts
|
|
@@ -53,15 +54,23 @@ function isStudioRequest(request) {
|
|
|
53
54
|
* and must be validated upstream.
|
|
54
55
|
*
|
|
55
56
|
* Priority:
|
|
56
|
-
* 1. X-
|
|
57
|
+
* 1. X-Mastra-Public-Host (proxy chain that rewrites X-Forwarded-Host) → always
|
|
58
|
+
* HTTPS. Some platform gateways — Railway's among them — overwrite
|
|
59
|
+
* X-Forwarded-Host with their own internal domain, which would otherwise
|
|
60
|
+
* leave the app resolving an internal hostname it must never hand to an
|
|
61
|
+
* OAuth provider. An edge that knows the browser-facing host sets this
|
|
62
|
+
* header so it survives that rewrite.
|
|
63
|
+
* 2. X-Forwarded-Host (traditional reverse proxy) → always HTTPS. Knative's
|
|
57
64
|
* queue-proxy overwrites X-Forwarded-Proto based on the internal HTTP
|
|
58
65
|
* connection, so X-Forwarded-Proto is ignored here.
|
|
59
|
-
*
|
|
60
|
-
*
|
|
66
|
+
* 3. Host header with X-Forwarded-Proto (AWS ALB, some proxies) → respect proto.
|
|
67
|
+
* 4. Host header alone → use the scheme from request.url (covers both direct
|
|
61
68
|
* HTTP access and proxies that preserve Host but don't set a proto header).
|
|
62
|
-
*
|
|
69
|
+
* 5. No Host header → fall back to request.url.origin (local dev / direct access).
|
|
63
70
|
*/
|
|
64
71
|
function getPublicOrigin(request) {
|
|
72
|
+
const publicHost = request.headers.get(require_constants.MASTRA_PUBLIC_HOST_HEADER)?.split(",")[0]?.trim();
|
|
73
|
+
if (publicHost) return `https://${publicHost}`;
|
|
65
74
|
const forwardedHost = request.headers.get("x-forwarded-host")?.split(",")[0]?.trim();
|
|
66
75
|
if (forwardedHost) return `https://${forwardedHost}`;
|
|
67
76
|
const host = request.headers.get("host");
|