@mastra/server 1.86.0-alpha.5 → 1.86.0-alpha.7
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/dist/a2a-BsBYrosr.cjs +0 -2
- package/dist/a2a-C3ClP3C2.js +0 -2
- package/dist/{a2a-DtYL9fy1.js → a2a-WPGF38fX.js} +1 -3
- package/dist/{a2a-BAjf7XaU.cjs → a2a-vSZkdSRE.cjs} +1 -3
- package/dist/{agent-builder-DmGIcMcp.js → agent-builder-C4AIqOxt.js} +1 -3
- package/dist/agent-builder-CSnA_l6K.js +0 -2
- package/dist/agent-builder-DSKjD22s.cjs +0 -2
- package/dist/{agent-builder-NRim1NAX.cjs → agent-builder-dZlRNj1k.cjs} +1 -3
- package/dist/agent-controller-BHJDvCaS.cjs +0 -2
- package/dist/agent-controller-NRR6SK66.js +0 -2
- package/dist/agent-versions-CwWhEoU5.cjs +0 -2
- package/dist/agent-versions-DfcKpYNW.js +0 -2
- package/dist/{agents-CSR862WA.js → agents-272TP94y.js} +19 -9
- package/dist/agents-B0OpLdbp.js +0 -2
- package/dist/agents-CH_G37hG.cjs +0 -2
- package/dist/{agents-DpvoAW1s.cjs → agents-mjQZV5tv.cjs} +19 -9
- package/dist/{api-schema-manifest-CejGItC3.js → api-schema-manifest-BjhiTdNv.js} +1 -3
- package/dist/{api-schema-manifest-CGcUFUp0.cjs → api-schema-manifest-DVkepK_s.cjs} +1 -3
- package/dist/auth-CM5AgF9l.cjs +0 -2
- package/dist/auth-CjT_a76k.js +0 -2
- package/dist/background-tasks-4EZqzWvG.cjs +0 -2
- package/dist/background-tasks-xkwOZ9D_.js +0 -2
- package/dist/builder-registry-BBI_5CBL.cjs +0 -2
- package/dist/builder-registry-WYVRUCgJ.js +0 -2
- package/dist/{catalogue-BEEjZ-fW.cjs → catalogue-BTE9b_mr.cjs} +5 -7
- package/dist/{catalogue-BxyrTkPQ.js → catalogue-DH64Duv-.js} +5 -7
- package/dist/channels-DlsNzITQ.cjs +0 -2
- package/dist/channels-bkX-zz9J.js +0 -2
- package/dist/common-D5XxSuvu.cjs +0 -2
- package/dist/common-J-yUnHk9.js +0 -2
- package/dist/constants-C1ASuP4t.js +0 -2
- package/dist/constants-CyNbINin.cjs +0 -2
- package/dist/conversations-BVj0Dk2Q.cjs +0 -2
- package/dist/{conversations-CCQijwPL.cjs → conversations-BWA_---j.cjs} +1 -3
- package/dist/{conversations-KzKXe3OK.js → conversations-CXyaNjLR.js} +1 -3
- package/dist/conversations-DHrKTI6x.js +0 -2
- package/dist/datasets-C1XJLHN8.js +0 -2
- package/dist/datasets-hqDd4IUN.cjs +0 -2
- package/dist/default-options-DRN81WEQ.cjs +0 -2
- package/dist/default-options-Dir6CKnE.js +0 -2
- package/dist/dist-36GZrEvk.cjs +0 -2
- package/dist/dist-BZGewCGq.cjs +0 -2
- package/dist/dist-Bal15xNO.cjs +0 -2
- package/dist/dist-Bn0zFASI.js +1 -0
- package/dist/{dist-BFqayW55.js → dist-Bp1bObAq.js} +522 -66
- package/dist/dist-CNjm6d2Q.js +0 -2
- package/dist/{dist-CSKnIYx2.cjs → dist-CSffo32A.cjs} +1 -1
- package/dist/dist-CVoi_Dov.js +0 -2
- package/dist/dist-D02J6PZG.cjs +0 -2
- package/dist/dist-DC9qnRcv.js +0 -2
- package/dist/{dist-CLzhYZ2T.cjs → dist-DGwsCtT4.cjs} +522 -66
- package/dist/dist-Dc0g0QSi.js +0 -2
- package/dist/dist-Dwfkbwzg.js +0 -2
- package/dist/dist-lG-fYW7-.cjs +0 -2
- package/dist/docs/SKILL.md +1 -1
- package/dist/docs/assets/SOURCE_MAP.json +1 -1
- package/dist/dynamic-workflows-DPgV6qtS.cjs +0 -2
- package/dist/dynamic-workflows-DmkCJ4Lp.js +0 -2
- package/dist/{editor-builder-vasNoMoK.cjs → editor-builder-BS2xogE_.cjs} +1 -3
- package/dist/{editor-builder-BOqUsHI9.js → editor-builder-BayzCprJ.js} +1 -3
- package/dist/editor-builder-CXLdplIj.js +0 -2
- package/dist/editor-builder-eF2IetF2.cjs +0 -2
- package/dist/favorites-8aieznq3.js +0 -2
- package/dist/favorites-D0CoxxQn.cjs +0 -2
- package/dist/helpers-Zu5ZVxSl.cjs +0 -2
- package/dist/helpers-hFdKABRP.js +0 -2
- package/dist/http-exception-Co3MbFUf.cjs +0 -2
- package/dist/http-exception-CzaWkxMl.js +0 -2
- package/dist/index.cjs +0 -2
- package/dist/index.js +0 -2
- package/dist/knowledge-DAqUHFK5.js +0 -2
- package/dist/knowledge-DL03nbSW.cjs +0 -2
- package/dist/logs-B0dcn5iB.cjs +0 -2
- package/dist/logs-Ca_q8krO.js +0 -2
- package/dist/logs-CqgT7AOV.js +0 -2
- package/dist/logs-YisOj8HR.cjs +0 -2
- package/dist/mcp-B7Q8qwjn.cjs +0 -2
- package/dist/mcp-C060MyHc.cjs +0 -2
- package/dist/mcp-CQ_pR-JC.js +0 -2
- package/dist/mcp-DXvFogeV.js +0 -2
- package/dist/mcp-client-versions-BS99SD4O.cjs +0 -2
- package/dist/mcp-client-versions-Rd-ry9Qa.js +0 -2
- package/dist/memory--xJDrSwF.cjs +0 -2
- package/dist/memory-03B4pe3w.js +0 -2
- package/dist/memory-4Izw-l6v.cjs +0 -2
- package/dist/memory-CCEjoCF6.js +0 -2
- package/dist/message-history-BBVH-ORZ.js +0 -2
- package/dist/message-history-CtELj716.cjs +0 -2
- package/dist/observability-Cn4P60P4.cjs +0 -2
- package/dist/observability-new-endpoints-iRwQxqwY.cjs +0 -2
- package/dist/observability-new-endpoints-vj6FaEcm.js +0 -2
- package/dist/observability-zr7LDCQG.js +0 -2
- package/dist/{plans-DWm5yfiR.cjs → plans-Bes_LVgv.cjs} +1 -3
- package/dist/{plans-CF7WEUSe.js → plans-xGwuiZUd.js} +1 -3
- package/dist/{probe-image-size-qvUx8Kjc.cjs → probe-image-size-BR5MlnnJ.cjs} +1 -3
- package/dist/{probe-image-size-C7QtN5-G.js → probe-image-size-DBCcUUw_.js} +1 -3
- package/dist/processor-providers-CRrcV9ra.cjs +0 -2
- package/dist/processor-providers-WHdDe4aA.js +0 -2
- package/dist/processors-BEut-2a-.cjs +0 -2
- package/dist/processors-IhyRC0xH.js +0 -2
- package/dist/prompt-block-versions-3T-L2loy.js +0 -2
- package/dist/prompt-block-versions-BTdrcaLe.cjs +0 -2
- package/dist/{responses-vS2YsMlq.cjs → responses-BH567IZf.cjs} +1 -3
- package/dist/responses-CTiwnWeF.cjs +0 -2
- package/dist/{responses-C1T0-Hw8.js → responses-CwQO5y2X.js} +1 -3
- package/dist/responses-D-fsDRLd.js +0 -2
- package/dist/route-builder-DjTBxSZN.cjs +0 -2
- package/dist/route-builder-Dz18c3qm.js +0 -2
- package/dist/{routes-BGtkFANE.cjs → routes-6p-xrUIq.cjs} +11 -13
- package/dist/{routes-CIPFz2Tx.js → routes-CrBCJmjc.js} +11 -13
- package/dist/rule-group-4pWeG61q.js +0 -2
- package/dist/rule-group-CIacr-Zz.cjs +0 -2
- package/dist/schedules-0ceTSdBB.cjs +0 -2
- package/dist/schedules-D_VfFdAH.js +0 -2
- package/dist/schema-TQPB_dl2-CCzMcdDx.js +0 -2
- package/dist/schema-TQPB_dl2-CJX1q58F.cjs +0 -2
- package/dist/scorer-versions-Bhdvt-cX.cjs +0 -2
- package/dist/scorer-versions-DhT7Lj33.js +0 -2
- package/dist/scores-BULd4ZBI.js +0 -2
- package/dist/scores-CWCaN4jf.cjs +0 -2
- package/dist/{scores-Cjq0cSLS.cjs → scores-CXNkN7Bn.cjs} +1 -3
- package/dist/{scores-qNLVpqlb.js → scores-ksmJiJnJ.js} +1 -3
- package/dist/server/a2a/store.cjs +0 -2
- package/dist/server/a2a/store.js +0 -2
- package/dist/server/browser-stream/index.cjs +0 -2
- package/dist/server/browser-stream/index.js +0 -2
- package/dist/server/handlers/a2a.cjs +1 -1
- package/dist/server/handlers/a2a.js +1 -1
- package/dist/server/handlers/agent-access.cjs +0 -2
- package/dist/server/handlers/agent-access.js +0 -2
- package/dist/server/handlers/agent-builder.cjs +1 -1
- package/dist/server/handlers/agent-builder.js +1 -1
- package/dist/server/handlers/agent-versions.cjs +0 -2
- package/dist/server/handlers/agent-versions.js +0 -2
- package/dist/server/handlers/agents.cjs +1 -1
- package/dist/server/handlers/agents.js +1 -1
- package/dist/server/handlers/auth.cjs +0 -2
- package/dist/server/handlers/auth.js +0 -2
- package/dist/server/handlers/author-enrichment.cjs +0 -2
- package/dist/server/handlers/author-enrichment.js +0 -2
- package/dist/server/handlers/authorship.cjs +0 -2
- package/dist/server/handlers/authorship.js +0 -2
- package/dist/server/handlers/conversations.cjs +1 -1
- package/dist/server/handlers/conversations.js +1 -1
- package/dist/server/handlers/datasets.cjs +0 -2
- package/dist/server/handlers/datasets.js +0 -2
- package/dist/server/handlers/editor-builder.cjs +1 -1
- package/dist/server/handlers/editor-builder.js +1 -1
- package/dist/server/handlers/error.cjs +0 -2
- package/dist/server/handlers/error.js +0 -2
- package/dist/server/handlers/favorites-enrichment.cjs +1 -3
- package/dist/server/handlers/favorites-enrichment.js +1 -3
- package/dist/server/handlers/gateway-memory-client.cjs +0 -2
- package/dist/server/handlers/gateway-memory-client.js +0 -2
- package/dist/server/handlers/mcp-client-versions.cjs +0 -2
- package/dist/server/handlers/mcp-client-versions.js +0 -2
- package/dist/server/handlers/observability-export.cjs +0 -2
- package/dist/server/handlers/observability-export.js +0 -2
- package/dist/server/handlers/observability-list-query-schemas.cjs +0 -2
- package/dist/server/handlers/observability-list-query-schemas.js +0 -2
- package/dist/server/handlers/observability-shared.cjs +0 -2
- package/dist/server/handlers/observability-shared.js +0 -2
- package/dist/server/handlers/observability-signal-context.cjs +0 -2
- package/dist/server/handlers/observability-signal-context.js +0 -2
- package/dist/server/handlers/observability-storage-schemas.cjs +0 -2
- package/dist/server/handlers/observability-storage-schemas.js +0 -2
- package/dist/server/handlers/plans.cjs +1 -1
- package/dist/server/handlers/plans.js +1 -1
- package/dist/server/handlers/processor-providers.cjs +0 -2
- package/dist/server/handlers/processor-providers.js +0 -2
- package/dist/server/handlers/processors.cjs +0 -2
- package/dist/server/handlers/processors.js +0 -2
- package/dist/server/handlers/prompt-block-versions.cjs +0 -2
- package/dist/server/handlers/prompt-block-versions.js +0 -2
- package/dist/server/handlers/responses.adapter.cjs +0 -2
- package/dist/server/handlers/responses.adapter.js +0 -2
- package/dist/server/handlers/responses.cjs +1 -1
- package/dist/server/handlers/responses.js +1 -1
- package/dist/server/handlers/responses.storage.cjs +0 -2
- package/dist/server/handlers/responses.storage.js +0 -2
- package/dist/server/handlers/schedules-workflows-shim.cjs +0 -2
- package/dist/server/handlers/schedules-workflows-shim.js +0 -2
- package/dist/server/handlers/scorer-versions.cjs +0 -2
- package/dist/server/handlers/scorer-versions.js +0 -2
- package/dist/server/handlers/scores.cjs +1 -1
- package/dist/server/handlers/scores.js +1 -1
- package/dist/server/handlers/skills-sh-shared.cjs +0 -2
- package/dist/server/handlers/skills-sh-shared.js +0 -2
- package/dist/server/handlers/stored-agent-favorites.cjs +1 -3
- package/dist/server/handlers/stored-agent-favorites.js +1 -3
- package/dist/server/handlers/stored-agents.cjs +1 -3
- package/dist/server/handlers/stored-agents.js +1 -3
- package/dist/server/handlers/stored-mcp-clients.cjs +0 -2
- package/dist/server/handlers/stored-mcp-clients.js +0 -2
- package/dist/server/handlers/stored-prompt-blocks.cjs +0 -2
- package/dist/server/handlers/stored-prompt-blocks.js +0 -2
- package/dist/server/handlers/stored-scorers.cjs +0 -2
- package/dist/server/handlers/stored-scorers.js +0 -2
- package/dist/server/handlers/stored-skill-favorites.cjs +1 -3
- package/dist/server/handlers/stored-skill-favorites.js +1 -3
- package/dist/server/handlers/stored-skills.cjs +1 -3
- package/dist/server/handlers/stored-skills.js +1 -3
- package/dist/server/handlers/stored-workspaces.cjs +0 -2
- package/dist/server/handlers/stored-workspaces.js +0 -2
- package/dist/server/handlers/system.cjs +1 -3
- package/dist/server/handlers/system.js +1 -3
- package/dist/server/handlers/test-utils.cjs +0 -2
- package/dist/server/handlers/test-utils.js +0 -2
- package/dist/server/handlers/tool-providers.cjs +0 -2
- package/dist/server/handlers/tool-providers.js +0 -2
- package/dist/server/handlers/tool-schema-overrides.cjs +0 -2
- package/dist/server/handlers/tool-schema-overrides.js +0 -2
- package/dist/server/handlers/tools.cjs +1 -1
- package/dist/server/handlers/tools.js +1 -1
- package/dist/server/handlers/validate-agent-instructions.cjs +0 -2
- package/dist/server/handlers/validate-agent-instructions.js +0 -2
- package/dist/server/handlers/validate-avatar.cjs +0 -2
- package/dist/server/handlers/validate-avatar.js +0 -2
- package/dist/server/handlers/version-helpers.cjs +0 -2
- package/dist/server/handlers/version-helpers.js +0 -2
- package/dist/server/handlers/voice.cjs +1 -1
- package/dist/server/handlers/voice.js +1 -1
- package/dist/server/handlers.cjs +9 -9
- package/dist/server/handlers.js +9 -9
- package/dist/server/mcp/catalogue.d.ts +1 -1
- package/dist/server/mcp/schema.d.ts +1 -1
- package/dist/server/server-adapter/api-schema-manifest.d.ts +1 -1
- package/dist/server/server-adapter/index.cjs +2 -2
- package/dist/server/server-adapter/index.js +2 -2
- package/dist/server/server-adapter/openapi-utils.d.ts +1 -1
- package/dist/server/utils/agent-stream-events.d.ts +1 -0
- package/dist/{server-adapter-DI4I8Pxw.js → server-adapter-BGOi-s7x.js} +1 -3
- package/dist/{server-adapter-Do1caUp0.cjs → server-adapter-Ceag3til.cjs} +1 -3
- package/dist/storage-CVkNJ5eB.js +0 -2
- package/dist/storage-mEqRYYDg.cjs +0 -2
- package/dist/stored-agents-DmN_pIIl.js +0 -2
- package/dist/stored-agents-m0Knvv29.cjs +0 -2
- package/dist/stored-mcp-clients-D14ULUvS.cjs +0 -2
- package/dist/stored-mcp-clients-d_PaPgGc.js +0 -2
- package/dist/stored-prompt-blocks-B5yfQnPC.js +0 -2
- package/dist/stored-prompt-blocks-CqaOxMZ-.cjs +0 -2
- package/dist/stored-scorers-2F2k6XSx.js +0 -2
- package/dist/stored-scorers-iM2Qq9Nh.cjs +0 -2
- package/dist/stored-skills-GNJMp022.js +0 -2
- package/dist/stored-skills-xuecapXy.cjs +0 -2
- package/dist/stored-workspaces-Bswuz00o.js +0 -2
- package/dist/stored-workspaces-g5-GKY38.cjs +0 -2
- package/dist/system-CKTXaHMZ.js +0 -2
- package/dist/system-DKCYwd0y.cjs +0 -2
- package/dist/tool-providers-BVwRJTtB.cjs +0 -2
- package/dist/tool-providers-Cq3vFqgE.js +0 -2
- package/dist/{tools-DqgYXmdT.js → tools-CY44YtDW.js} +1 -3
- package/dist/{tools-Cv7TwNHv.cjs → tools-DLZ7go-n.cjs} +1 -3
- package/dist/utils-C2VRtQjI.js +0 -2
- package/dist/utils-CvYihOoy.js +0 -2
- package/dist/utils-DQJOBnMo.cjs +0 -2
- package/dist/utils-j29NB2ZJ.cjs +0 -2
- package/dist/vector-Bz-glead.js +0 -2
- package/dist/vector-DIFU_fwU.cjs +0 -2
- package/dist/vectors-CPSofSCf.cjs +0 -2
- package/dist/vectors-CadLydEJ.js +0 -2
- package/dist/version-common-BLTDO88f.js +0 -2
- package/dist/version-common-Cc0STXl9.cjs +0 -2
- package/dist/{voice-D-iJiiSN.js → voice-DTjrAgqg.js} +1 -3
- package/dist/{voice-BUAV_TGD.cjs → voice-NaerSeVQ.cjs} +1 -3
- package/dist/workflow-builder-BET96Cr_.js +0 -2
- package/dist/workflow-builder-DpL3Nq6T.cjs +0 -2
- package/dist/workflows-CKcjXfXk.cjs +0 -2
- package/dist/workflows-D3QrUMfm.js +0 -2
- package/dist/workflows-DTxiWG6x.js +0 -2
- package/dist/workflows-gIKukZ1O.cjs +0 -2
- package/dist/workspace-C5BBUatQ.cjs +0 -2
- package/dist/workspace-CgIZRc2P.js +0 -2
- package/dist/workspace-D-Exdj2l.cjs +0 -2
- package/dist/workspace-DBDA3UQl.js +0 -2
- package/package.json +7 -6
- package/dist/a2a-BAjf7XaU.cjs.map +0 -1
- package/dist/a2a-BsBYrosr.cjs.map +0 -1
- package/dist/a2a-C3ClP3C2.js.map +0 -1
- package/dist/a2a-DtYL9fy1.js.map +0 -1
- package/dist/agent-builder-CSnA_l6K.js.map +0 -1
- package/dist/agent-builder-DSKjD22s.cjs.map +0 -1
- package/dist/agent-builder-DmGIcMcp.js.map +0 -1
- package/dist/agent-builder-NRim1NAX.cjs.map +0 -1
- package/dist/agent-controller-BHJDvCaS.cjs.map +0 -1
- package/dist/agent-controller-NRR6SK66.js.map +0 -1
- package/dist/agent-versions-CwWhEoU5.cjs.map +0 -1
- package/dist/agent-versions-DfcKpYNW.js.map +0 -1
- package/dist/agents-B0OpLdbp.js.map +0 -1
- package/dist/agents-CH_G37hG.cjs.map +0 -1
- package/dist/agents-CSR862WA.js.map +0 -1
- package/dist/agents-DpvoAW1s.cjs.map +0 -1
- package/dist/api-schema-manifest-CGcUFUp0.cjs.map +0 -1
- package/dist/api-schema-manifest-CejGItC3.js.map +0 -1
- package/dist/auth-CM5AgF9l.cjs.map +0 -1
- package/dist/auth-CjT_a76k.js.map +0 -1
- package/dist/background-tasks-4EZqzWvG.cjs.map +0 -1
- package/dist/background-tasks-xkwOZ9D_.js.map +0 -1
- package/dist/builder-registry-BBI_5CBL.cjs.map +0 -1
- package/dist/builder-registry-WYVRUCgJ.js.map +0 -1
- package/dist/catalogue-BEEjZ-fW.cjs.map +0 -1
- package/dist/catalogue-BxyrTkPQ.js.map +0 -1
- package/dist/channels-DlsNzITQ.cjs.map +0 -1
- package/dist/channels-bkX-zz9J.js.map +0 -1
- package/dist/common-D5XxSuvu.cjs.map +0 -1
- package/dist/common-J-yUnHk9.js.map +0 -1
- package/dist/constants-C1ASuP4t.js.map +0 -1
- package/dist/constants-CyNbINin.cjs.map +0 -1
- package/dist/conversations-BVj0Dk2Q.cjs.map +0 -1
- package/dist/conversations-CCQijwPL.cjs.map +0 -1
- package/dist/conversations-DHrKTI6x.js.map +0 -1
- package/dist/conversations-KzKXe3OK.js.map +0 -1
- package/dist/datasets-C1XJLHN8.js.map +0 -1
- package/dist/datasets-hqDd4IUN.cjs.map +0 -1
- package/dist/default-options-DRN81WEQ.cjs.map +0 -1
- package/dist/default-options-Dir6CKnE.js.map +0 -1
- package/dist/dist-36GZrEvk.cjs.map +0 -1
- package/dist/dist-BFqayW55.js.map +0 -1
- package/dist/dist-BZGewCGq.cjs.map +0 -1
- package/dist/dist-Bal15xNO.cjs.map +0 -1
- package/dist/dist-CLzhYZ2T.cjs.map +0 -1
- package/dist/dist-CNjm6d2Q.js.map +0 -1
- package/dist/dist-CRbjxGDp.js +0 -1
- package/dist/dist-CVoi_Dov.js.map +0 -1
- package/dist/dist-D02J6PZG.cjs.map +0 -1
- package/dist/dist-DC9qnRcv.js.map +0 -1
- package/dist/dist-Dc0g0QSi.js.map +0 -1
- package/dist/dist-Dwfkbwzg.js.map +0 -1
- package/dist/dist-lG-fYW7-.cjs.map +0 -1
- package/dist/dynamic-workflows-DPgV6qtS.cjs.map +0 -1
- package/dist/dynamic-workflows-DmkCJ4Lp.js.map +0 -1
- package/dist/editor-builder-BOqUsHI9.js.map +0 -1
- package/dist/editor-builder-CXLdplIj.js.map +0 -1
- package/dist/editor-builder-eF2IetF2.cjs.map +0 -1
- package/dist/editor-builder-vasNoMoK.cjs.map +0 -1
- package/dist/favorites-8aieznq3.js.map +0 -1
- package/dist/favorites-D0CoxxQn.cjs.map +0 -1
- package/dist/helpers-Zu5ZVxSl.cjs.map +0 -1
- package/dist/helpers-hFdKABRP.js.map +0 -1
- package/dist/http-exception-Co3MbFUf.cjs.map +0 -1
- package/dist/http-exception-CzaWkxMl.js.map +0 -1
- package/dist/index.cjs.map +0 -1
- package/dist/index.d.ts.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/knowledge-DAqUHFK5.js.map +0 -1
- package/dist/knowledge-DL03nbSW.cjs.map +0 -1
- package/dist/logs-B0dcn5iB.cjs.map +0 -1
- package/dist/logs-Ca_q8krO.js.map +0 -1
- package/dist/logs-CqgT7AOV.js.map +0 -1
- package/dist/logs-YisOj8HR.cjs.map +0 -1
- package/dist/mcp-B7Q8qwjn.cjs.map +0 -1
- package/dist/mcp-C060MyHc.cjs.map +0 -1
- package/dist/mcp-CQ_pR-JC.js.map +0 -1
- package/dist/mcp-DXvFogeV.js.map +0 -1
- package/dist/mcp-client-versions-BS99SD4O.cjs.map +0 -1
- package/dist/mcp-client-versions-Rd-ry9Qa.js.map +0 -1
- package/dist/memory--xJDrSwF.cjs.map +0 -1
- package/dist/memory-03B4pe3w.js.map +0 -1
- package/dist/memory-4Izw-l6v.cjs.map +0 -1
- package/dist/memory-CCEjoCF6.js.map +0 -1
- package/dist/message-history-BBVH-ORZ.js.map +0 -1
- package/dist/message-history-CtELj716.cjs.map +0 -1
- package/dist/observability-Cn4P60P4.cjs.map +0 -1
- package/dist/observability-new-endpoints-iRwQxqwY.cjs.map +0 -1
- package/dist/observability-new-endpoints-vj6FaEcm.js.map +0 -1
- package/dist/observability-zr7LDCQG.js.map +0 -1
- package/dist/plans-CF7WEUSe.js.map +0 -1
- package/dist/plans-DWm5yfiR.cjs.map +0 -1
- package/dist/probe-image-size-C7QtN5-G.js.map +0 -1
- package/dist/probe-image-size-qvUx8Kjc.cjs.map +0 -1
- package/dist/processor-providers-CRrcV9ra.cjs.map +0 -1
- package/dist/processor-providers-WHdDe4aA.js.map +0 -1
- package/dist/processors-BEut-2a-.cjs.map +0 -1
- package/dist/processors-IhyRC0xH.js.map +0 -1
- package/dist/prompt-block-versions-3T-L2loy.js.map +0 -1
- package/dist/prompt-block-versions-BTdrcaLe.cjs.map +0 -1
- package/dist/responses-C1T0-Hw8.js.map +0 -1
- package/dist/responses-CTiwnWeF.cjs.map +0 -1
- package/dist/responses-D-fsDRLd.js.map +0 -1
- package/dist/responses-vS2YsMlq.cjs.map +0 -1
- package/dist/route-builder-DjTBxSZN.cjs.map +0 -1
- package/dist/route-builder-Dz18c3qm.js.map +0 -1
- package/dist/routes-BGtkFANE.cjs.map +0 -1
- package/dist/routes-CIPFz2Tx.js.map +0 -1
- package/dist/rule-group-4pWeG61q.js.map +0 -1
- package/dist/rule-group-CIacr-Zz.cjs.map +0 -1
- package/dist/schedules-0ceTSdBB.cjs.map +0 -1
- package/dist/schedules-D_VfFdAH.js.map +0 -1
- package/dist/schema-TQPB_dl2-CCzMcdDx.js.map +0 -1
- package/dist/schema-TQPB_dl2-CJX1q58F.cjs.map +0 -1
- package/dist/scorer-versions-Bhdvt-cX.cjs.map +0 -1
- package/dist/scorer-versions-DhT7Lj33.js.map +0 -1
- package/dist/scores-BULd4ZBI.js.map +0 -1
- package/dist/scores-CWCaN4jf.cjs.map +0 -1
- package/dist/scores-Cjq0cSLS.cjs.map +0 -1
- package/dist/scores-qNLVpqlb.js.map +0 -1
- package/dist/server/a2a/agent-card-signing.d.ts.map +0 -1
- package/dist/server/a2a/agent-card-v1.d.ts.map +0 -1
- package/dist/server/a2a/protocol.d.ts.map +0 -1
- package/dist/server/a2a/push-notification-sender.d.ts.map +0 -1
- package/dist/server/a2a/push-notification-store.d.ts.map +0 -1
- package/dist/server/a2a/store.cjs.map +0 -1
- package/dist/server/a2a/store.d.ts.map +0 -1
- package/dist/server/a2a/store.js.map +0 -1
- package/dist/server/a2a/task-state.d.ts.map +0 -1
- package/dist/server/a2a/tasks.d.ts.map +0 -1
- package/dist/server/auth/custom-route-matcher.d.ts.map +0 -1
- package/dist/server/auth/defaults.d.ts.map +0 -1
- package/dist/server/auth/helpers.d.ts.map +0 -1
- package/dist/server/auth/index.d.ts.map +0 -1
- package/dist/server/auth/path-pattern.d.ts.map +0 -1
- package/dist/server/browser-stream/index.cjs.map +0 -1
- package/dist/server/browser-stream/index.d.ts.map +0 -1
- package/dist/server/browser-stream/index.js.map +0 -1
- package/dist/server/browser-stream/input-handler.d.ts.map +0 -1
- package/dist/server/browser-stream/types.d.ts.map +0 -1
- package/dist/server/browser-stream/viewer-registry.d.ts.map +0 -1
- package/dist/server/constants.d.ts.map +0 -1
- package/dist/server/fga-permissions.d.ts.map +0 -1
- package/dist/server/handlers/a2a.d.ts.map +0 -1
- package/dist/server/handlers/agent-access.cjs.map +0 -1
- package/dist/server/handlers/agent-access.d.ts.map +0 -1
- package/dist/server/handlers/agent-access.js.map +0 -1
- package/dist/server/handlers/agent-builder.d.ts.map +0 -1
- package/dist/server/handlers/agent-controller.d.ts.map +0 -1
- package/dist/server/handlers/agent-versions.cjs.map +0 -1
- package/dist/server/handlers/agent-versions.d.ts.map +0 -1
- package/dist/server/handlers/agent-versions.js.map +0 -1
- package/dist/server/handlers/agents.d.ts.map +0 -1
- package/dist/server/handlers/auth.cjs.map +0 -1
- package/dist/server/handlers/auth.d.ts.map +0 -1
- package/dist/server/handlers/auth.js.map +0 -1
- package/dist/server/handlers/author-enrichment.cjs.map +0 -1
- package/dist/server/handlers/author-enrichment.d.ts.map +0 -1
- package/dist/server/handlers/author-enrichment.js.map +0 -1
- package/dist/server/handlers/authorship.cjs.map +0 -1
- package/dist/server/handlers/authorship.d.ts.map +0 -1
- package/dist/server/handlers/authorship.js.map +0 -1
- package/dist/server/handlers/background-tasks.d.ts.map +0 -1
- package/dist/server/handlers/builder-registry.d.ts.map +0 -1
- package/dist/server/handlers/channels.d.ts.map +0 -1
- package/dist/server/handlers/conversations.d.ts.map +0 -1
- package/dist/server/handlers/datasets.cjs.map +0 -1
- package/dist/server/handlers/datasets.d.ts.map +0 -1
- package/dist/server/handlers/datasets.js.map +0 -1
- package/dist/server/handlers/dynamic-workflows.d.ts.map +0 -1
- package/dist/server/handlers/editor-builder.d.ts.map +0 -1
- package/dist/server/handlers/error.cjs.map +0 -1
- package/dist/server/handlers/error.d.ts.map +0 -1
- package/dist/server/handlers/error.js.map +0 -1
- package/dist/server/handlers/favorites-enrichment.cjs.map +0 -1
- package/dist/server/handlers/favorites-enrichment.d.ts.map +0 -1
- package/dist/server/handlers/favorites-enrichment.js.map +0 -1
- package/dist/server/handlers/gateway-memory-client.cjs.map +0 -1
- package/dist/server/handlers/gateway-memory-client.d.ts.map +0 -1
- package/dist/server/handlers/gateway-memory-client.js.map +0 -1
- package/dist/server/handlers/knowledge.d.ts.map +0 -1
- package/dist/server/handlers/logs.d.ts.map +0 -1
- package/dist/server/handlers/mcp-client-versions.cjs.map +0 -1
- package/dist/server/handlers/mcp-client-versions.d.ts.map +0 -1
- package/dist/server/handlers/mcp-client-versions.js.map +0 -1
- package/dist/server/handlers/mcp.d.ts.map +0 -1
- package/dist/server/handlers/memory.d.ts.map +0 -1
- package/dist/server/handlers/observability-export.cjs.map +0 -1
- package/dist/server/handlers/observability-export.d.ts.map +0 -1
- package/dist/server/handlers/observability-export.js.map +0 -1
- package/dist/server/handlers/observability-list-query-schemas.cjs.map +0 -1
- package/dist/server/handlers/observability-list-query-schemas.d.ts.map +0 -1
- package/dist/server/handlers/observability-list-query-schemas.js.map +0 -1
- package/dist/server/handlers/observability-new-endpoints.d.ts.map +0 -1
- package/dist/server/handlers/observability-shared.cjs.map +0 -1
- package/dist/server/handlers/observability-shared.d.ts.map +0 -1
- package/dist/server/handlers/observability-shared.js.map +0 -1
- package/dist/server/handlers/observability-signal-context.cjs.map +0 -1
- package/dist/server/handlers/observability-signal-context.d.ts.map +0 -1
- package/dist/server/handlers/observability-signal-context.js.map +0 -1
- package/dist/server/handlers/observability-storage-schemas.cjs.map +0 -1
- package/dist/server/handlers/observability-storage-schemas.d.ts.map +0 -1
- package/dist/server/handlers/observability-storage-schemas.js.map +0 -1
- package/dist/server/handlers/observability.d.ts.map +0 -1
- package/dist/server/handlers/plans.d.ts.map +0 -1
- package/dist/server/handlers/processor-providers.cjs.map +0 -1
- package/dist/server/handlers/processor-providers.d.ts.map +0 -1
- package/dist/server/handlers/processor-providers.js.map +0 -1
- package/dist/server/handlers/processors.cjs.map +0 -1
- package/dist/server/handlers/processors.d.ts.map +0 -1
- package/dist/server/handlers/processors.js.map +0 -1
- package/dist/server/handlers/prompt-block-versions.cjs.map +0 -1
- package/dist/server/handlers/prompt-block-versions.d.ts.map +0 -1
- package/dist/server/handlers/prompt-block-versions.js.map +0 -1
- package/dist/server/handlers/responses.adapter.cjs.map +0 -1
- package/dist/server/handlers/responses.adapter.d.ts.map +0 -1
- package/dist/server/handlers/responses.adapter.js.map +0 -1
- package/dist/server/handlers/responses.d.ts.map +0 -1
- package/dist/server/handlers/responses.storage.cjs.map +0 -1
- package/dist/server/handlers/responses.storage.d.ts.map +0 -1
- package/dist/server/handlers/responses.storage.js.map +0 -1
- package/dist/server/handlers/schedules-workflows-shim.cjs.map +0 -1
- package/dist/server/handlers/schedules-workflows-shim.d.ts.map +0 -1
- package/dist/server/handlers/schedules-workflows-shim.js.map +0 -1
- package/dist/server/handlers/schedules.d.ts.map +0 -1
- package/dist/server/handlers/scorer-versions.cjs.map +0 -1
- package/dist/server/handlers/scorer-versions.d.ts.map +0 -1
- package/dist/server/handlers/scorer-versions.js.map +0 -1
- package/dist/server/handlers/scores.d.ts.map +0 -1
- package/dist/server/handlers/skills-sh-shared.cjs.map +0 -1
- package/dist/server/handlers/skills-sh-shared.d.ts.map +0 -1
- package/dist/server/handlers/skills-sh-shared.js.map +0 -1
- package/dist/server/handlers/stored-agent-favorites.cjs.map +0 -1
- package/dist/server/handlers/stored-agent-favorites.d.ts.map +0 -1
- package/dist/server/handlers/stored-agent-favorites.js.map +0 -1
- package/dist/server/handlers/stored-agents.cjs.map +0 -1
- package/dist/server/handlers/stored-agents.d.ts.map +0 -1
- package/dist/server/handlers/stored-agents.js.map +0 -1
- package/dist/server/handlers/stored-mcp-clients.cjs.map +0 -1
- package/dist/server/handlers/stored-mcp-clients.d.ts.map +0 -1
- package/dist/server/handlers/stored-mcp-clients.js.map +0 -1
- package/dist/server/handlers/stored-prompt-blocks.cjs.map +0 -1
- package/dist/server/handlers/stored-prompt-blocks.d.ts.map +0 -1
- package/dist/server/handlers/stored-prompt-blocks.js.map +0 -1
- package/dist/server/handlers/stored-scorers.cjs.map +0 -1
- package/dist/server/handlers/stored-scorers.d.ts.map +0 -1
- package/dist/server/handlers/stored-scorers.js.map +0 -1
- package/dist/server/handlers/stored-skill-favorites.cjs.map +0 -1
- package/dist/server/handlers/stored-skill-favorites.d.ts.map +0 -1
- package/dist/server/handlers/stored-skill-favorites.js.map +0 -1
- package/dist/server/handlers/stored-skills.cjs.map +0 -1
- package/dist/server/handlers/stored-skills.d.ts.map +0 -1
- package/dist/server/handlers/stored-skills.js.map +0 -1
- package/dist/server/handlers/stored-workspaces.cjs.map +0 -1
- package/dist/server/handlers/stored-workspaces.d.ts.map +0 -1
- package/dist/server/handlers/stored-workspaces.js.map +0 -1
- package/dist/server/handlers/system.cjs.map +0 -1
- package/dist/server/handlers/system.d.ts.map +0 -1
- package/dist/server/handlers/system.js.map +0 -1
- package/dist/server/handlers/test-utils.cjs.map +0 -1
- package/dist/server/handlers/test-utils.d.ts.map +0 -1
- package/dist/server/handlers/test-utils.js.map +0 -1
- package/dist/server/handlers/tool-providers.cjs.map +0 -1
- package/dist/server/handlers/tool-providers.d.ts.map +0 -1
- package/dist/server/handlers/tool-providers.js.map +0 -1
- package/dist/server/handlers/tool-schema-overrides.cjs.map +0 -1
- package/dist/server/handlers/tool-schema-overrides.d.ts.map +0 -1
- package/dist/server/handlers/tool-schema-overrides.js.map +0 -1
- package/dist/server/handlers/tools.d.ts.map +0 -1
- package/dist/server/handlers/utils.d.ts.map +0 -1
- package/dist/server/handlers/validate-agent-instructions.cjs.map +0 -1
- package/dist/server/handlers/validate-agent-instructions.d.ts.map +0 -1
- package/dist/server/handlers/validate-agent-instructions.js.map +0 -1
- package/dist/server/handlers/validate-avatar.cjs.map +0 -1
- package/dist/server/handlers/validate-avatar.d.ts.map +0 -1
- package/dist/server/handlers/validate-avatar.js.map +0 -1
- package/dist/server/handlers/vector.d.ts.map +0 -1
- package/dist/server/handlers/version-helpers.cjs.map +0 -1
- package/dist/server/handlers/version-helpers.d.ts.map +0 -1
- package/dist/server/handlers/version-helpers.js.map +0 -1
- package/dist/server/handlers/voice.d.ts.map +0 -1
- package/dist/server/handlers/workflow-builder.d.ts.map +0 -1
- package/dist/server/handlers/workflows.d.ts.map +0 -1
- package/dist/server/handlers/workspace.d.ts.map +0 -1
- package/dist/server/handlers.d.ts.map +0 -1
- package/dist/server/http-exception.d.ts.map +0 -1
- package/dist/server/mcp/capabilities.d.ts.map +0 -1
- package/dist/server/mcp/catalogue.d.ts.map +0 -1
- package/dist/server/mcp/config.d.ts.map +0 -1
- package/dist/server/mcp/descriptor.d.ts.map +0 -1
- package/dist/server/mcp/oauth.d.ts.map +0 -1
- package/dist/server/mcp/result-size.d.ts.map +0 -1
- package/dist/server/mcp/route.d.ts.map +0 -1
- package/dist/server/mcp/schema.d.ts.map +0 -1
- package/dist/server/mcp/toolsets/memory.d.ts.map +0 -1
- package/dist/server/mcp/toolsets/observability-summary.d.ts.map +0 -1
- package/dist/server/mcp/toolsets/observability.d.ts.map +0 -1
- package/dist/server/mcp/toolsets/stored-agents.d.ts.map +0 -1
- package/dist/server/schemas/__tests__/route-contracts.typetest.d.ts.map +0 -1
- package/dist/server/schemas/a2a.d.ts.map +0 -1
- package/dist/server/schemas/agent-builder.d.ts.map +0 -1
- package/dist/server/schemas/agent-versions.d.ts.map +0 -1
- package/dist/server/schemas/agents.d.ts.map +0 -1
- package/dist/server/schemas/auth.d.ts.map +0 -1
- package/dist/server/schemas/background-tasks.d.ts.map +0 -1
- package/dist/server/schemas/builder-registry.d.ts.map +0 -1
- package/dist/server/schemas/channels.d.ts.map +0 -1
- package/dist/server/schemas/common.d.ts.map +0 -1
- package/dist/server/schemas/conversations.d.ts.map +0 -1
- package/dist/server/schemas/datasets.d.ts.map +0 -1
- package/dist/server/schemas/default-options.d.ts.map +0 -1
- package/dist/server/schemas/dynamic-workflows.d.ts.map +0 -1
- package/dist/server/schemas/editor-builder.d.ts.map +0 -1
- package/dist/server/schemas/favorites.d.ts.map +0 -1
- package/dist/server/schemas/feedback.d.ts.map +0 -1
- package/dist/server/schemas/index.d.ts.map +0 -1
- package/dist/server/schemas/knowledge.d.ts.map +0 -1
- package/dist/server/schemas/logs.d.ts.map +0 -1
- package/dist/server/schemas/mcp-client-versions.d.ts.map +0 -1
- package/dist/server/schemas/mcp.d.ts.map +0 -1
- package/dist/server/schemas/memory-config.d.ts.map +0 -1
- package/dist/server/schemas/memory.d.ts.map +0 -1
- package/dist/server/schemas/message-history.d.ts.map +0 -1
- package/dist/server/schemas/processor-providers.d.ts.map +0 -1
- package/dist/server/schemas/processors.d.ts.map +0 -1
- package/dist/server/schemas/prompt-block-versions.d.ts.map +0 -1
- package/dist/server/schemas/responses.d.ts.map +0 -1
- package/dist/server/schemas/route-contracts.d.ts.map +0 -1
- package/dist/server/schemas/rule-group.d.ts.map +0 -1
- package/dist/server/schemas/schedules.d.ts.map +0 -1
- package/dist/server/schemas/scorer-versions.d.ts.map +0 -1
- package/dist/server/schemas/scores.d.ts.map +0 -1
- package/dist/server/schemas/stored-agents.d.ts.map +0 -1
- package/dist/server/schemas/stored-mcp-clients.d.ts.map +0 -1
- package/dist/server/schemas/stored-prompt-blocks.d.ts.map +0 -1
- package/dist/server/schemas/stored-scorers.d.ts.map +0 -1
- package/dist/server/schemas/stored-skills.d.ts.map +0 -1
- package/dist/server/schemas/stored-workspaces.d.ts.map +0 -1
- package/dist/server/schemas/system.d.ts.map +0 -1
- package/dist/server/schemas/tool-providers.d.ts.map +0 -1
- package/dist/server/schemas/vectors.d.ts.map +0 -1
- package/dist/server/schemas/version-common.d.ts.map +0 -1
- package/dist/server/schemas/workflow-builder.d.ts.map +0 -1
- package/dist/server/schemas/workflows.d.ts.map +0 -1
- package/dist/server/schemas/workspace.d.ts.map +0 -1
- package/dist/server/server-adapter/api-schema-manifest.d.ts.map +0 -1
- package/dist/server/server-adapter/index.d.ts.map +0 -1
- package/dist/server/server-adapter/mcp-auth.d.ts.map +0 -1
- package/dist/server/server-adapter/mcp-disconnect.d.ts.map +0 -1
- package/dist/server/server-adapter/openapi-utils.d.ts.map +0 -1
- package/dist/server/server-adapter/redact.d.ts.map +0 -1
- package/dist/server/server-adapter/routes/a2a.d.ts.map +0 -1
- package/dist/server/server-adapter/routes/agent-builder.d.ts.map +0 -1
- package/dist/server/server-adapter/routes/agent-controller.d.ts.map +0 -1
- package/dist/server/server-adapter/routes/agents.d.ts.map +0 -1
- package/dist/server/server-adapter/routes/auth.d.ts.map +0 -1
- package/dist/server/server-adapter/routes/background-tasks.d.ts.map +0 -1
- package/dist/server/server-adapter/routes/channels.d.ts.map +0 -1
- package/dist/server/server-adapter/routes/conversations.d.ts.map +0 -1
- package/dist/server/server-adapter/routes/datasets.d.ts.map +0 -1
- package/dist/server/server-adapter/routes/dynamic-workflows.d.ts.map +0 -1
- package/dist/server/server-adapter/routes/editor-builder.d.ts.map +0 -1
- package/dist/server/server-adapter/routes/fga-manifest.d.ts.map +0 -1
- package/dist/server/server-adapter/routes/index.d.ts.map +0 -1
- package/dist/server/server-adapter/routes/knowledge.d.ts.map +0 -1
- package/dist/server/server-adapter/routes/legacy.d.ts.map +0 -1
- package/dist/server/server-adapter/routes/logs.d.ts.map +0 -1
- package/dist/server/server-adapter/routes/mcp.d.ts.map +0 -1
- package/dist/server/server-adapter/routes/memory.d.ts.map +0 -1
- package/dist/server/server-adapter/routes/observability.d.ts.map +0 -1
- package/dist/server/server-adapter/routes/permissions.d.ts.map +0 -1
- package/dist/server/server-adapter/routes/processor-providers.d.ts.map +0 -1
- package/dist/server/server-adapter/routes/processors.d.ts.map +0 -1
- package/dist/server/server-adapter/routes/responses.d.ts.map +0 -1
- package/dist/server/server-adapter/routes/route-builder.d.ts.map +0 -1
- package/dist/server/server-adapter/routes/schedules.d.ts.map +0 -1
- package/dist/server/server-adapter/routes/scorers.d.ts.map +0 -1
- package/dist/server/server-adapter/routes/stored-agents.d.ts.map +0 -1
- package/dist/server/server-adapter/routes/stored-mcp-clients.d.ts.map +0 -1
- package/dist/server/server-adapter/routes/stored-prompt-blocks.d.ts.map +0 -1
- package/dist/server/server-adapter/routes/stored-scorers.d.ts.map +0 -1
- package/dist/server/server-adapter/routes/stored-skills.d.ts.map +0 -1
- package/dist/server/server-adapter/routes/stored-workspaces.d.ts.map +0 -1
- package/dist/server/server-adapter/routes/stream-types.d.ts.map +0 -1
- package/dist/server/server-adapter/routes/system.d.ts.map +0 -1
- package/dist/server/server-adapter/routes/tool-providers.d.ts.map +0 -1
- package/dist/server/server-adapter/routes/tools.d.ts.map +0 -1
- package/dist/server/server-adapter/routes/vectors.d.ts.map +0 -1
- package/dist/server/server-adapter/routes/workflows.d.ts.map +0 -1
- package/dist/server/server-adapter/routes/workspace.d.ts.map +0 -1
- package/dist/server/server-adapter/serialize.d.ts.map +0 -1
- package/dist/server/server-adapter/stream-disconnect.d.ts.map +0 -1
- package/dist/server/types.d.ts.map +0 -1
- package/dist/server/utils/agent-stream-events.d.ts.map +0 -1
- package/dist/server/utils/resolve-builder-model-policy.d.ts.map +0 -1
- package/dist/server/utils.d.ts.map +0 -1
- package/dist/server-adapter-DI4I8Pxw.js.map +0 -1
- package/dist/server-adapter-Do1caUp0.cjs.map +0 -1
- package/dist/storage-CVkNJ5eB.js.map +0 -1
- package/dist/storage-mEqRYYDg.cjs.map +0 -1
- package/dist/stored-agents-DmN_pIIl.js.map +0 -1
- package/dist/stored-agents-m0Knvv29.cjs.map +0 -1
- package/dist/stored-mcp-clients-D14ULUvS.cjs.map +0 -1
- package/dist/stored-mcp-clients-d_PaPgGc.js.map +0 -1
- package/dist/stored-prompt-blocks-B5yfQnPC.js.map +0 -1
- package/dist/stored-prompt-blocks-CqaOxMZ-.cjs.map +0 -1
- package/dist/stored-scorers-2F2k6XSx.js.map +0 -1
- package/dist/stored-scorers-iM2Qq9Nh.cjs.map +0 -1
- package/dist/stored-skills-GNJMp022.js.map +0 -1
- package/dist/stored-skills-xuecapXy.cjs.map +0 -1
- package/dist/stored-workspaces-Bswuz00o.js.map +0 -1
- package/dist/stored-workspaces-g5-GKY38.cjs.map +0 -1
- package/dist/system-CKTXaHMZ.js.map +0 -1
- package/dist/system-DKCYwd0y.cjs.map +0 -1
- package/dist/tool-providers-BVwRJTtB.cjs.map +0 -1
- package/dist/tool-providers-Cq3vFqgE.js.map +0 -1
- package/dist/tools-Cv7TwNHv.cjs.map +0 -1
- package/dist/tools-DqgYXmdT.js.map +0 -1
- package/dist/utils-C2VRtQjI.js.map +0 -1
- package/dist/utils-CvYihOoy.js.map +0 -1
- package/dist/utils-DQJOBnMo.cjs.map +0 -1
- package/dist/utils-j29NB2ZJ.cjs.map +0 -1
- package/dist/vector-Bz-glead.js.map +0 -1
- package/dist/vector-DIFU_fwU.cjs.map +0 -1
- package/dist/vectors-CPSofSCf.cjs.map +0 -1
- package/dist/vectors-CadLydEJ.js.map +0 -1
- package/dist/version-common-BLTDO88f.js.map +0 -1
- package/dist/version-common-Cc0STXl9.cjs.map +0 -1
- package/dist/voice-BUAV_TGD.cjs.map +0 -1
- package/dist/voice-D-iJiiSN.js.map +0 -1
- package/dist/workflow-builder-BET96Cr_.js.map +0 -1
- package/dist/workflow-builder-DpL3Nq6T.cjs.map +0 -1
- package/dist/workflows-CKcjXfXk.cjs.map +0 -1
- package/dist/workflows-D3QrUMfm.js.map +0 -1
- package/dist/workflows-DTxiWG6x.js.map +0 -1
- package/dist/workflows-gIKukZ1O.cjs.map +0 -1
- package/dist/workspace-C5BBUatQ.cjs.map +0 -1
- package/dist/workspace-CgIZRc2P.js.map +0 -1
- package/dist/workspace-D-Exdj2l.cjs.map +0 -1
- package/dist/workspace-DBDA3UQl.js.map +0 -1
- /package/dist/_types/{@mastra_schema-compat@1.4.0 → @mastra_schema-compat@1.4.1-alpha.0}/dist/_types/@internal_ai-sdk-v4@0.0.98/dist/index.d.ts +0 -0
- /package/dist/_types/{@mastra_schema-compat@1.4.0 → @mastra_schema-compat@1.4.1-alpha.0}/dist/_types/@internal_ai-sdk-v5@0.0.98/dist/index.d.ts +0 -0
- /package/dist/_types/{@mastra_schema-compat@1.4.0 → @mastra_schema-compat@1.4.1-alpha.0}/dist/_types/@internal_ai-v6@0.0.98/dist/index.d.ts +0 -0
- /package/dist/_types/{@mastra_schema-compat@1.4.0 → @mastra_schema-compat@1.4.1-alpha.0}/dist/_types/@standard-schema_spec@1.1.0/dist/index.d.ts +0 -0
- /package/dist/_types/{@mastra_schema-compat@1.4.0 → @mastra_schema-compat@1.4.1-alpha.0}/dist/_types/@types_json-schema@7.0.15/index.d.ts +0 -0
- /package/dist/_types/{@mastra_schema-compat@1.4.0 → @mastra_schema-compat@1.4.1-alpha.0}/dist/index.d.ts +0 -0
- /package/dist/_types/{@mastra_schema-compat@1.4.0 → @mastra_schema-compat@1.4.1-alpha.0}/dist/null-to-undefined.d.ts +0 -0
- /package/dist/_types/{@mastra_schema-compat@1.4.0 → @mastra_schema-compat@1.4.1-alpha.0}/dist/provider-compats/anthropic.d.ts +0 -0
- /package/dist/_types/{@mastra_schema-compat@1.4.0 → @mastra_schema-compat@1.4.1-alpha.0}/dist/provider-compats/deepseek.d.ts +0 -0
- /package/dist/_types/{@mastra_schema-compat@1.4.0 → @mastra_schema-compat@1.4.1-alpha.0}/dist/provider-compats/google.d.ts +0 -0
- /package/dist/_types/{@mastra_schema-compat@1.4.0 → @mastra_schema-compat@1.4.1-alpha.0}/dist/provider-compats/meta.d.ts +0 -0
- /package/dist/_types/{@mastra_schema-compat@1.4.0 → @mastra_schema-compat@1.4.1-alpha.0}/dist/provider-compats/openai-reasoning.d.ts +0 -0
- /package/dist/_types/{@mastra_schema-compat@1.4.0 → @mastra_schema-compat@1.4.1-alpha.0}/dist/provider-compats/openai.d.ts +0 -0
- /package/dist/_types/{@mastra_schema-compat@1.4.0 → @mastra_schema-compat@1.4.1-alpha.0}/dist/schema-compatibility-v3.d.ts +0 -0
- /package/dist/_types/{@mastra_schema-compat@1.4.0 → @mastra_schema-compat@1.4.1-alpha.0}/dist/schema-compatibility-v4.d.ts +0 -0
- /package/dist/_types/{@mastra_schema-compat@1.4.0 → @mastra_schema-compat@1.4.1-alpha.0}/dist/schema-compatibility.d.ts +0 -0
- /package/dist/_types/{@mastra_schema-compat@1.4.0 → @mastra_schema-compat@1.4.1-alpha.0}/dist/schema.d.ts +0 -0
- /package/dist/_types/{@mastra_schema-compat@1.4.0 → @mastra_schema-compat@1.4.1-alpha.0}/dist/schema.types.d.ts +0 -0
- /package/dist/_types/{@mastra_schema-compat@1.4.0 → @mastra_schema-compat@1.4.1-alpha.0}/dist/standard-schema/standard-schema.d.ts +0 -0
- /package/dist/_types/{@mastra_schema-compat@1.4.0 → @mastra_schema-compat@1.4.1-alpha.0}/dist/standard-schema/standard-schema.types.d.ts +0 -0
- /package/dist/_types/{@mastra_schema-compat@1.4.0 → @mastra_schema-compat@1.4.1-alpha.0}/dist/standard-schema-compat.d.ts +0 -0
- /package/dist/_types/{@mastra_schema-compat@1.4.0 → @mastra_schema-compat@1.4.1-alpha.0}/dist/types.d.ts +0 -0
- /package/dist/_types/{@mastra_schema-compat@1.4.0 → @mastra_schema-compat@1.4.1-alpha.0}/dist/utils.d.ts +0 -0
- /package/dist/_types/{@mastra_schema-compat@1.4.0 → @mastra_schema-compat@1.4.1-alpha.0}/dist/zod-to-json.d.ts +0 -0
- /package/dist/_types/{@mastra_schema-compat@1.4.0 → @mastra_schema-compat@1.4.1-alpha.0}/package.json +0 -0
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"workflows-gIKukZ1O.cjs","names":["HTTPException","WorkflowRegistry","getPublicWorkflowById","createRoute","z","listWorkflowsResponseSchema","getWorkflowInfo","getHandlerFGAProvider","MastraFGAPermissions","handleError","workflowRunCountsResponseSchema","getEffectiveResourceId","workflowIdPathParams","workflowInfoSchema","listWorkflowRunsQuerySchema","workflowRunsResponseSchema","workflowRunPathParams","workflowRunResultQuerySchema","workflowRunResultSchema","validateRunOwnership","workflowControlResponseSchema","optionalRunIdSchema","createWorkflowRunBodySchema","createWorkflowRunResponseSchema","runIdSchema","streamWorkflowBodySchema","resumeBodySchema","streamResponseSchema","startAsyncWorkflowBodySchema","workflowExecutionResultSchema","observeWorkflowQuerySchema","createReplayStream","restartBodySchema","timeTravelBodySchema"],"sources":["../src/server/handlers/workflows.ts"],"sourcesContent":["import type { Mastra } from '@mastra/core';\nimport type { MastraServerCache } from '@mastra/core/cache';\nimport type { RequestContext } from '@mastra/core/di';\nimport type { Event } from '@mastra/core/events';\nimport { createReplayStream } from '@mastra/core/stream';\nimport type {\n WorkflowInfo,\n ChunkType,\n StreamEvent,\n WorkflowStateField,\n WorkflowRunStatus,\n WorkflowRunState,\n} from '@mastra/core/workflows';\nimport { z } from 'zod/v4';\nimport { MastraFGAPermissions } from '../fga-permissions';\nimport { HTTPException } from '../http-exception';\nimport { streamResponseSchema } from '../schemas/agents';\nimport { optionalRunIdSchema, runIdSchema } from '../schemas/common';\nimport {\n createWorkflowRunBodySchema,\n createWorkflowRunResponseSchema,\n listWorkflowRunsQuerySchema,\n listWorkflowsResponseSchema,\n workflowRunCountsResponseSchema,\n restartBodySchema,\n timeTravelBodySchema,\n resumeBodySchema,\n startAsyncWorkflowBodySchema,\n streamWorkflowBodySchema,\n workflowControlResponseSchema,\n workflowExecutionResultSchema,\n workflowIdPathParams,\n workflowInfoSchema,\n workflowRunPathParams,\n workflowRunsResponseSchema,\n workflowRunResultQuerySchema,\n workflowRunResultSchema,\n observeWorkflowQuerySchema,\n} from '../schemas/workflows';\nimport { createRoute } from '../server-adapter/routes/route-builder';\nimport type { Context } from '../types';\nimport { getWorkflowInfo, WorkflowRegistry } from '../utils';\nimport { handleError } from './error';\nimport { getEffectiveResourceId, getHandlerFGAProvider, getPublicWorkflowById, validateRunOwnership } from './utils';\n\n/**\n * Statuses a run cannot come back from. Streaming one of these runIds again would\n * start a fresh execution under the same runId and overwrite its stored snapshot —\n * the in-memory de-dupe that protects concurrent streams only covers runs still held\n * in the workflow's run map, and a finished run has already been dropped from it.\n */\nconst TERMINAL_RUN_STATUSES: WorkflowRunStatus[] = ['success', 'failed', 'canceled', 'tripwire'];\n\n/**\n * A run's result with its step results read: a storage v2 result's `steps` is a loader that\n * reads them from storage, which a response can't carry, so it answers with them as for v1.\n */\nasync function withLoadedSteps<T extends { steps?: unknown }>(result: T): Promise<T> {\n const steps: unknown = result.steps;\n return typeof steps === 'function' ? { ...result, steps: await steps() } : result;\n}\n\n/**\n * Runs whose chunks are already being written to the cache in this process,\n * keyed by runId. A run has exactly one writer: without this, two concurrent\n * requests for the same runId each cache every chunk and the replayed history\n * comes back duplicated.\n */\nconst activeRunStreamCachers = new Set<string>();\n\n/**\n * Cache a run's chunks for later replay and return the stream to hand the client.\n *\n * The cached history belongs to the run, not to whoever happens to be watching,\n * so the caching side is driven by its own reader rather than by the client's\n * consumption. If the client disconnects mid-run its branch is cancelled while\n * this reader keeps draining, so `/observe` still replays a complete history —\n * the failure that makes reconnection necessary is exactly the one the cache has\n * to survive. Chunks buffer in the tee while a client lags, bounded by the run's\n * own length.\n */\nfunction cacheRunStream({\n cache,\n runId,\n source,\n}: {\n cache: MastraServerCache;\n runId: string;\n source: ReadableStream<ChunkType>;\n}): ReadableStream<ChunkType> {\n if (activeRunStreamCachers.has(runId)) {\n return source;\n }\n\n const [toCache, toClient] = source.tee();\n activeRunStreamCachers.add(runId);\n\n void (async () => {\n const reader = toCache.getReader();\n try {\n while (true) {\n const { done, value } = await reader.read();\n if (done) break;\n // Cache failures must not take down the run being streamed.\n await cache.listPush(runId, value).catch(() => {});\n }\n } catch {\n // The source errored; the client's branch surfaces it.\n } finally {\n reader.releaseLock();\n activeRunStreamCachers.delete(runId);\n }\n })();\n\n return toClient;\n}\n\nexport interface WorkflowContext extends Context {\n workflowId?: string;\n runId?: string;\n requestContext?: RequestContext;\n}\n\nexport async function listWorkflowsFromSystem({ mastra, workflowId }: WorkflowContext) {\n const logger = mastra.getLogger();\n\n if (!workflowId) {\n throw new HTTPException(400, { message: 'Workflow ID is required' });\n }\n\n let workflow;\n\n // First check registry for temporary workflows\n workflow = WorkflowRegistry.getWorkflow(workflowId, mastra);\n\n if (!workflow) {\n workflow = getPublicWorkflowById(mastra, workflowId);\n }\n\n if (!workflow) {\n logger.debug('Workflow not found, searching agents for workflow', { workflowId });\n const agents = mastra.listAgents();\n\n if (Object.keys(agents || {}).length) {\n for (const [_, agent] of Object.entries(agents)) {\n try {\n const workflows = await agent.listWorkflows();\n\n if (workflows[workflowId]) {\n workflow = workflows[workflowId];\n break;\n }\n } catch (error) {\n logger.debug('Error getting workflow from agent', error);\n }\n }\n }\n }\n\n if (!workflow) {\n throw new HTTPException(404, { message: 'Workflow not found' });\n }\n\n return { workflow };\n}\n\n// ============================================================================\n// Route Definitions (new pattern - handlers defined inline with createRoute)\n// ============================================================================\n\nexport const LIST_WORKFLOWS_ROUTE = createRoute({\n method: 'GET',\n path: '/workflows',\n responseType: 'json',\n queryParamSchema: z.object({\n partial: z.string().optional(),\n }),\n responseSchema: listWorkflowsResponseSchema,\n summary: 'List all workflows',\n description: 'Returns a list of all available workflows in the system',\n tags: ['Workflows'],\n mcp: {\n toolset: 'workflows',\n name: 'list_workflows',\n description: 'List the workflows you can run, with their ids, names, and descriptions.',\n },\n requiresAuth: true,\n handler: (async ({ mastra, partial, requestContext }: any) => {\n try {\n const workflows = mastra.listWorkflows({ serialized: false });\n const isPartial = partial === 'true';\n const _workflows = Object.entries(workflows).reduce<Record<string, WorkflowInfo>>((acc, [key, workflow]) => {\n acc[key] = getWorkflowInfo(workflow as any, isPartial);\n return acc;\n }, {});\n\n // Filter workflows by FGA if configured\n const fgaProvider = getHandlerFGAProvider(mastra, requestContext);\n const user = requestContext?.get('user');\n if (fgaProvider) {\n if (!user) {\n return {};\n }\n const workflowList = Object.entries(_workflows).map(([id, w]) => ({ id, ...w }));\n const accessible = await fgaProvider.filterAccessible(\n user,\n workflowList,\n 'workflow',\n MastraFGAPermissions.WORKFLOWS_READ,\n );\n const accessibleSet = new Set(accessible.map((w: any) => w.id));\n for (const id of Object.keys(_workflows)) {\n if (!accessibleSet.has(id)) {\n delete _workflows[id];\n }\n }\n }\n\n return _workflows;\n } catch (error) {\n return handleError(error, 'Error getting workflows');\n }\n }) as any,\n});\n\ntype WorkflowRunCounts = { running: number; suspended: number };\n\nconst RUN_COUNTS_CACHE_TTL_MS = 5_000;\n// Keyed by Mastra instance so multiple apps in one process never share counts.\nconst runCountsCache = new WeakMap<object, { at: number; value: Record<string, WorkflowRunCounts> }>();\nlet runCountsNow: () => number = () => Date.now();\n\n/** Test seam — lets TTL expiry be tested without wall-clock waits. */\nexport function __setWorkflowRunCountsNow(now?: () => number) {\n runCountsNow = now ?? (() => Date.now());\n}\n\nexport const LIST_WORKFLOW_RUN_COUNTS_ROUTE = createRoute({\n method: 'GET',\n path: '/workflows/run-counts',\n responseType: 'json',\n responseSchema: workflowRunCountsResponseSchema,\n summary: 'List workflow run counts',\n description:\n 'Returns per-workflow counts of currently running and suspended (awaiting resume) runs, keyed by the workflow registry key used in the Mastra config',\n tags: ['Workflows'],\n requiresAuth: true,\n handler: (async ({ mastra, requestContext }: any) => {\n try {\n const fgaProvider = getHandlerFGAProvider(mastra, requestContext);\n const user = requestContext?.get('user');\n // FGA with no user can never see anything — answer before touching storage.\n if (fgaProvider && !user) {\n return {};\n }\n\n const workflows = mastra.listWorkflows({ serialized: false });\n\n const counts: Record<string, WorkflowRunCounts> = {};\n const workflowIdToRegistryKey = new Map<string, string>();\n for (const [registryKey, workflow] of Object.entries(workflows)) {\n counts[registryKey] = { running: 0, suspended: 0 };\n workflowIdToRegistryKey.set((workflow as any).id, registryKey);\n }\n\n // Runs are scoped to the caller like the runs-listing endpoint: the\n // reserved request-context resource id takes precedence for security.\n const effectiveResourceId = getEffectiveResourceId(requestContext, undefined);\n\n // The shared cache holds the unscoped, unfiltered map — usable only when\n // neither per-user FGA filtering nor a resource scope applies.\n const cacheable = !fgaProvider && !effectiveResourceId;\n if (cacheable) {\n const cached = runCountsCache.get(mastra);\n if (cached && runCountsNow() - cached.at < RUN_COUNTS_CACHE_TTL_MS) {\n return cached.value;\n }\n }\n\n const storage = mastra.getStorage();\n const workflowsStore = storage ? await storage.getStore('workflows') : undefined;\n if (workflowsStore) {\n // Cross-workflow, engine-agnostic: both execution engines persist run\n // status into the same store. Deliberately not listActiveWorkflowRuns,\n // which means running+waiting and covers the default engine only.\n const [running, suspended] = await Promise.all([\n workflowsStore.listWorkflowRuns({ status: 'running', resourceId: effectiveResourceId }),\n workflowsStore.listWorkflowRuns({ status: 'suspended', resourceId: effectiveResourceId }),\n ]);\n for (const run of running.runs) {\n const registryKey = workflowIdToRegistryKey.get(run.workflowName);\n const entry = registryKey ? counts[registryKey] : undefined;\n if (entry) entry.running++;\n }\n for (const run of suspended.runs) {\n const registryKey = workflowIdToRegistryKey.get(run.workflowName);\n const entry = registryKey ? counts[registryKey] : undefined;\n if (entry) entry.suspended++;\n }\n }\n\n if (fgaProvider) {\n const workflowList = Object.keys(counts).map(id => ({ id }));\n const accessible = await fgaProvider.filterAccessible(\n user,\n workflowList,\n 'workflow',\n MastraFGAPermissions.WORKFLOWS_READ,\n );\n const accessibleSet = new Set(accessible.map((w: any) => w.id));\n for (const id of Object.keys(counts)) {\n if (!accessibleSet.has(id)) {\n delete counts[id];\n }\n }\n return counts;\n }\n\n if (cacheable) {\n runCountsCache.set(mastra, { at: runCountsNow(), value: counts });\n }\n return counts;\n } catch (error) {\n return handleError(error, 'Error getting workflow run counts');\n }\n }) as any,\n});\n\nexport const GET_WORKFLOW_BY_ID_ROUTE = createRoute({\n method: 'GET',\n path: '/workflows/:workflowId',\n responseType: 'json',\n pathParamSchema: workflowIdPathParams,\n responseSchema: workflowInfoSchema,\n summary: 'Get workflow by ID',\n description: 'Returns details for a specific workflow',\n tags: ['Workflows'],\n mcp: {\n toolset: 'workflows',\n name: 'get_workflow',\n description: 'Get details for one workflow, including its input schema and steps.',\n },\n requiresAuth: true,\n handler: (async ({ mastra, workflowId }: any) => {\n try {\n if (!workflowId) {\n throw new HTTPException(400, { message: 'Workflow ID is required' });\n }\n const { workflow } = await listWorkflowsFromSystem({ mastra, workflowId });\n return getWorkflowInfo(workflow, false);\n } catch (error) {\n return handleError(error, 'Error getting workflow');\n }\n }) as any,\n});\n\nexport const LIST_WORKFLOW_RUNS_ROUTE = createRoute({\n method: 'GET',\n path: '/workflows/:workflowId/runs',\n responseType: 'json',\n pathParamSchema: workflowIdPathParams,\n queryParamSchema: listWorkflowRunsQuerySchema,\n responseSchema: workflowRunsResponseSchema,\n summary: 'List workflow runs',\n description: 'Returns a paginated list of execution runs for the specified workflow',\n tags: ['Workflows'],\n requiresAuth: true,\n handler: async ({\n mastra,\n workflowId,\n fromDate,\n toDate,\n page,\n perPage,\n limit,\n offset,\n resourceId,\n status,\n summary,\n requestContext,\n }) => {\n try {\n // Use effective resourceId (context key takes precedence over client-provided value)\n const effectiveResourceId = getEffectiveResourceId(requestContext, resourceId);\n\n if (!workflowId) {\n throw new HTTPException(400, { message: 'Workflow ID is required' });\n }\n\n // Support both page/perPage and limit/offset for backwards compatibility\n // If page/perPage provided, use directly; otherwise convert from limit/offset\n let finalPage = page;\n let finalPerPage = perPage;\n\n if (finalPerPage === undefined && limit !== undefined) {\n finalPerPage = limit;\n }\n if (finalPage === undefined && offset !== undefined && finalPerPage !== undefined && finalPerPage > 0) {\n finalPage = Math.floor(offset / finalPerPage);\n }\n\n if (\n finalPerPage !== undefined &&\n (typeof finalPerPage !== 'number' || !Number.isInteger(finalPerPage) || finalPerPage <= 0)\n ) {\n throw new HTTPException(400, { message: 'perPage must be a positive integer' });\n }\n if (finalPage !== undefined && (!Number.isInteger(finalPage) || finalPage < 0)) {\n throw new HTTPException(400, { message: 'page must be a non-negative integer' });\n }\n const { workflow } = await listWorkflowsFromSystem({ mastra, workflowId });\n if (!workflow) {\n throw new HTTPException(404, { message: 'Workflow not found' });\n }\n const workflowRuns = (await workflow.listWorkflowRuns({\n fromDate: fromDate ? (typeof fromDate === 'string' ? new Date(fromDate) : fromDate) : undefined,\n toDate: toDate ? (typeof toDate === 'string' ? new Date(toDate) : toDate) : undefined,\n perPage: finalPerPage,\n page: finalPage,\n resourceId: effectiveResourceId,\n status,\n ...(summary ? { summary: true } : {}),\n })) || {\n runs: [],\n total: 0,\n };\n if (summary) {\n // Adapters may ignore `summary`, so always trim here to keep the response small.\n return {\n ...workflowRuns,\n runs: workflowRuns.runs.map(run => ({ ...run, snapshot: toSummarySnapshot(run.snapshot) })),\n };\n }\n return workflowRuns;\n } catch (error) {\n return handleError(error, 'Error getting workflow runs');\n }\n },\n});\n\nfunction toSummarySnapshot(\n snapshot: WorkflowRunState | string,\n): Pick<WorkflowRunState, 'status' | 'timestamp'> | string {\n let parsed: unknown;\n if (typeof snapshot === 'string') {\n try {\n parsed = JSON.parse(snapshot);\n } catch {\n // Never echo an unparseable (possibly huge) snapshot back in summary mode.\n return '';\n }\n } else {\n parsed = snapshot;\n }\n if (!parsed || typeof parsed !== 'object') return '';\n const { status, timestamp } = parsed as WorkflowRunState;\n return { status, timestamp };\n}\n\nexport const GET_WORKFLOW_RUN_BY_ID_ROUTE = createRoute({\n method: 'GET',\n path: '/workflows/:workflowId/runs/:runId',\n responseType: 'json',\n pathParamSchema: workflowRunPathParams,\n queryParamSchema: workflowRunResultQuerySchema,\n responseSchema: workflowRunResultSchema,\n summary: 'Get workflow run by ID',\n description:\n 'Returns a workflow run with metadata and processed execution state. Use the fields query parameter to reduce payload size by requesting only specific fields (e.g., ?fields=result,steps). Available fields: result, error, payload, steps, activeStepsPath, serializedStepGraph. Metadata fields (runId, workflowName, resourceId, createdAt, updatedAt) and status are always included.',\n tags: ['Workflows'],\n mcp: {\n toolset: 'workflows',\n name: 'get_workflow_run',\n description: 'Get the status and result of a workflow run.',\n },\n requiresAuth: true,\n handler: async ({ mastra, workflowId, runId, fields, withNestedWorkflows, requestContext }) => {\n try {\n const effectiveResourceId = getEffectiveResourceId(requestContext, undefined);\n\n if (!workflowId) {\n throw new HTTPException(400, { message: 'Workflow ID is required' });\n }\n\n if (!runId) {\n throw new HTTPException(400, { message: 'Run ID is required' });\n }\n\n const { workflow } = await listWorkflowsFromSystem({ mastra, workflowId });\n\n if (!workflow) {\n throw new HTTPException(404, { message: 'Workflow not found' });\n }\n\n // Parse fields parameter (comma-separated string)\n const fieldList = fields ? (fields.split(',').map((f: string) => f.trim()) as WorkflowStateField[]) : undefined;\n\n const run = await workflow.getWorkflowRunById(runId, {\n withNestedWorkflows: withNestedWorkflows !== 'false', // Default to true unless explicitly 'false'\n fields: fieldList,\n });\n\n if (!run) {\n throw new HTTPException(404, { message: 'Workflow run not found' });\n }\n\n await validateRunOwnership(run, effectiveResourceId, mastra, requestContext);\n\n return run;\n } catch (error) {\n return handleError(error, 'Error getting workflow run');\n }\n },\n});\n\nexport const DELETE_WORKFLOW_RUN_BY_ID_ROUTE = createRoute({\n method: 'DELETE',\n path: '/workflows/:workflowId/runs/:runId',\n responseType: 'json',\n pathParamSchema: workflowRunPathParams,\n responseSchema: workflowControlResponseSchema,\n summary: 'Delete workflow run by ID',\n description: 'Deletes a specific workflow run by ID',\n tags: ['Workflows'],\n requiresAuth: true,\n handler: async ({ mastra, workflowId, runId, requestContext }) => {\n try {\n const effectiveResourceId = getEffectiveResourceId(requestContext, undefined);\n\n if (!workflowId) {\n throw new HTTPException(400, { message: 'Workflow ID is required' });\n }\n\n if (!runId) {\n throw new HTTPException(400, { message: 'Run ID is required' });\n }\n\n const { workflow } = await listWorkflowsFromSystem({ mastra, workflowId });\n\n if (!workflow) {\n throw new HTTPException(404, { message: 'Workflow not found' });\n }\n\n // Validate ownership before deletion\n const run = await workflow.getWorkflowRunById(runId);\n if (!run) {\n throw new HTTPException(404, { message: 'Workflow run not found' });\n }\n await validateRunOwnership(run, effectiveResourceId, mastra, requestContext);\n\n await workflow.deleteWorkflowRunById(runId);\n\n return { message: 'Workflow run deleted' };\n } catch (error) {\n return handleError(error, 'Error deleting workflow run');\n }\n },\n});\n\nexport const CREATE_WORKFLOW_RUN_ROUTE = createRoute({\n method: 'POST',\n path: '/workflows/:workflowId/create-run',\n responseType: 'json',\n pathParamSchema: workflowIdPathParams,\n queryParamSchema: optionalRunIdSchema,\n bodySchema: createWorkflowRunBodySchema,\n responseSchema: createWorkflowRunResponseSchema,\n summary: 'Create workflow run',\n description: 'Creates a new workflow execution instance with an optional custom run ID',\n tags: ['Workflows'],\n requiresAuth: true,\n // Creating a run is part of the execute flow (Studio/UI calls this before\n // starting/streaming a workflow), so allow either permission. `write` is kept\n // for back-compat with roles that already grant it.\n requiresPermission: ['workflows:write', 'workflows:execute'],\n handler: async ({ mastra, workflowId, runId, resourceId, disableScorers, requestContext }) => {\n try {\n // Use effective resourceId (context key takes precedence over client-provided value)\n const effectiveResourceId = getEffectiveResourceId(requestContext, resourceId);\n\n if (!workflowId) {\n throw new HTTPException(400, { message: 'Workflow ID is required' });\n }\n\n const { workflow } = await listWorkflowsFromSystem({ mastra, workflowId });\n\n if (!workflow) {\n throw new HTTPException(404, { message: 'Workflow not found' });\n }\n\n if (runId) {\n const existingRun = await workflow.getWorkflowRunById(runId, { withNestedWorkflows: false });\n await validateRunOwnership(\n existingRun,\n getEffectiveResourceId(requestContext, undefined),\n mastra,\n requestContext,\n );\n }\n const run = await workflow.createRun({ runId, resourceId: effectiveResourceId, disableScorers });\n\n return { runId: run.runId };\n } catch (error) {\n return handleError(error, 'Error creating workflow run');\n }\n },\n});\n\nexport const STREAM_WORKFLOW_ROUTE = createRoute({\n method: 'POST',\n path: '/workflows/:workflowId/stream',\n responseType: 'stream',\n pathParamSchema: workflowIdPathParams,\n queryParamSchema: runIdSchema,\n bodySchema: streamWorkflowBodySchema,\n summary: 'Stream workflow execution',\n description: 'Executes a workflow and streams the results in real-time',\n tags: ['Workflows'],\n requiresAuth: true,\n handler: async ({ mastra, workflowId, runId, resourceId, requestContext, ...params }) => {\n try {\n // Use effective resourceId (context key takes precedence over client-provided value)\n const effectiveResourceId = getEffectiveResourceId(requestContext, resourceId);\n\n if (!workflowId) {\n throw new HTTPException(400, { message: 'Workflow ID is required' });\n }\n\n if (!runId) {\n throw new HTTPException(400, { message: 'runId required to stream workflow' });\n }\n\n const { workflow } = await listWorkflowsFromSystem({ mastra, workflowId });\n\n if (!workflow) {\n throw new HTTPException(404, { message: 'Workflow not found' });\n }\n\n const existingRun = await workflow.getWorkflowRunById(runId, { withNestedWorkflows: false });\n await validateRunOwnership(\n existingRun,\n getEffectiveResourceId(requestContext, undefined),\n mastra,\n requestContext,\n );\n\n if (existingRun && TERMINAL_RUN_STATUSES.includes(existingRun.status)) {\n throw new HTTPException(409, {\n message:\n `Workflow run ${runId} already finished with status \"${existingRun.status}\". ` +\n `Use /observe to read its stream back, or stream a new runId.`,\n });\n }\n\n const serverCache = mastra.getServerCache();\n\n const run = await workflow.createRun({ runId, resourceId: effectiveResourceId });\n const result = run.stream({ ...params, requestContext });\n\n if (serverCache) {\n return cacheRunStream({ cache: serverCache, runId, source: result.fullStream });\n }\n\n return result.fullStream;\n } catch (error) {\n return handleError(error, 'Error streaming workflow');\n }\n },\n});\n\nexport const RESUME_STREAM_WORKFLOW_ROUTE = createRoute({\n method: 'POST',\n path: '/workflows/:workflowId/resume-stream',\n responseType: 'stream',\n pathParamSchema: workflowIdPathParams,\n queryParamSchema: runIdSchema,\n bodySchema: resumeBodySchema,\n responseSchema: streamResponseSchema,\n summary: 'Resume workflow stream',\n description: 'Resumes a suspended workflow execution and continues streaming results',\n tags: ['Workflows'],\n requiresAuth: true,\n handler: async ({ mastra, workflowId, runId, requestContext, ...params }) => {\n try {\n const effectiveResourceId = getEffectiveResourceId(requestContext, undefined);\n\n if (!workflowId) {\n throw new HTTPException(400, { message: 'Workflow ID is required' });\n }\n\n if (!runId) {\n throw new HTTPException(400, { message: 'runId required to resume workflow' });\n }\n\n const { workflow } = await listWorkflowsFromSystem({ mastra, workflowId });\n\n if (!workflow) {\n throw new HTTPException(404, { message: 'Workflow not found' });\n }\n\n const run = await workflow.getWorkflowRunById(runId);\n\n if (!run) {\n throw new HTTPException(404, { message: 'Workflow run not found' });\n }\n\n await validateRunOwnership(run, effectiveResourceId, mastra, requestContext);\n\n const _run = await workflow.createRun({ runId, resourceId: run.resourceId });\n const serverCache = mastra.getServerCache();\n\n const resumeResult = _run.resumeStream({ ...params, requestContext });\n\n if (serverCache) {\n return cacheRunStream({ cache: serverCache, runId, source: resumeResult.fullStream });\n }\n\n return resumeResult.fullStream;\n } catch (error) {\n return handleError(error, 'Error resuming workflow');\n }\n },\n});\n\nexport const START_ASYNC_WORKFLOW_ROUTE = createRoute({\n method: 'POST',\n path: '/workflows/:workflowId/start-async',\n responseType: 'json',\n pathParamSchema: workflowIdPathParams,\n queryParamSchema: optionalRunIdSchema,\n bodySchema: startAsyncWorkflowBodySchema,\n responseSchema: workflowExecutionResultSchema,\n summary: 'Start workflow asynchronously',\n description: 'Starts a workflow execution asynchronously without streaming results',\n tags: ['Workflows'],\n mcp: {\n toolset: 'workflows',\n name: 'start_workflow',\n description:\n 'Run a workflow and wait for it to finish or suspend. Returns the run id and the result, or the suspend payload.',\n },\n requiresAuth: true,\n handler: async ({ mastra, workflowId, runId, resourceId, requestContext, ...params }) => {\n try {\n // Use effective resourceId (context key takes precedence over client-provided value)\n const effectiveResourceId = getEffectiveResourceId(requestContext, resourceId);\n\n if (!workflowId) {\n throw new HTTPException(400, { message: 'Workflow ID is required' });\n }\n\n const { workflow } = await listWorkflowsFromSystem({ mastra, workflowId });\n\n if (!workflow) {\n throw new HTTPException(404, { message: 'Workflow not found' });\n }\n\n if (runId) {\n const existingRun = await workflow.getWorkflowRunById(runId, { withNestedWorkflows: false });\n await validateRunOwnership(\n existingRun,\n getEffectiveResourceId(requestContext, undefined),\n mastra,\n requestContext,\n );\n }\n const _run = await workflow.createRun({ runId, resourceId: effectiveResourceId });\n const result = await withLoadedSteps(await _run.start({ ...params, requestContext }));\n return result;\n } catch (error) {\n return handleError(error, 'Error starting async workflow');\n }\n },\n});\n\nexport const START_WORKFLOW_RUN_ROUTE = createRoute({\n method: 'POST',\n path: '/workflows/:workflowId/start',\n responseType: 'json',\n pathParamSchema: workflowIdPathParams,\n queryParamSchema: runIdSchema,\n bodySchema: startAsyncWorkflowBodySchema,\n responseSchema: workflowControlResponseSchema,\n summary: 'Start specific workflow run',\n description: 'Starts execution of a specific workflow run by ID',\n tags: ['Workflows'],\n requiresAuth: true,\n handler: async ({ mastra, workflowId, runId, requestContext, ...params }) => {\n try {\n const effectiveResourceId = getEffectiveResourceId(requestContext, undefined);\n\n if (!workflowId) {\n throw new HTTPException(400, { message: 'Workflow ID is required' });\n }\n\n if (!runId) {\n throw new HTTPException(400, { message: 'runId required to start run' });\n }\n\n const { workflow } = await listWorkflowsFromSystem({ mastra, workflowId });\n\n if (!workflow) {\n throw new HTTPException(404, { message: 'Workflow not found' });\n }\n\n const run = await workflow.getWorkflowRunById(runId);\n\n if (!run) {\n throw new HTTPException(404, { message: 'Workflow run not found' });\n }\n\n await validateRunOwnership(run, effectiveResourceId, mastra, requestContext);\n\n const _run = await workflow.createRun({ runId, resourceId: run.resourceId });\n // Fire-and-forget: attach .catch so a rejected start (e.g. invalid input\n // schema) cannot become an unhandledRejection and tear down the process.\n void _run\n .start({\n ...params,\n requestContext,\n })\n .catch(error => {\n mastra.getLogger().error('Failed to start workflow run', { error, workflowId, runId });\n });\n\n return { message: 'Workflow run started' };\n } catch (e) {\n return handleError(e, 'Error starting workflow run');\n }\n },\n});\n\nexport const OBSERVE_STREAM_WORKFLOW_ROUTE = createRoute({\n method: 'POST',\n path: '/workflows/:workflowId/observe',\n responseType: 'stream',\n pathParamSchema: workflowIdPathParams,\n queryParamSchema: observeWorkflowQuerySchema,\n responseSchema: streamResponseSchema,\n summary: 'Observe workflow stream',\n description:\n 'Observes and streams updates from an already running workflow execution. Supports position-based resume with offset for efficient reconnection.',\n tags: ['Workflows'],\n requiresAuth: true,\n handler: async ({ mastra, workflowId, runId, offset, requestContext }) => {\n try {\n const effectiveResourceId = getEffectiveResourceId(requestContext, undefined);\n\n if (!workflowId) {\n throw new HTTPException(400, { message: 'Workflow ID is required' });\n }\n\n if (!runId) {\n throw new HTTPException(400, { message: 'runId required to observe workflow stream' });\n }\n\n const { workflow } = await listWorkflowsFromSystem({ mastra, workflowId });\n\n if (!workflow) {\n throw new HTTPException(404, { message: 'Workflow not found' });\n }\n\n const run = await workflow.getWorkflowRunById(runId);\n\n if (!run) {\n throw new HTTPException(404, { message: 'Workflow run not found' });\n }\n\n await validateRunOwnership(run, effectiveResourceId, mastra, requestContext);\n\n const _run = await workflow.createRun({ runId, resourceId: run.resourceId });\n const serverCache = mastra.getServerCache();\n if (!serverCache) {\n throw new HTTPException(500, { message: 'Server cache not found' });\n }\n\n // Get cached chunks from the specified index (or 0 if not specified)\n const startIndex = offset ?? 0;\n const cachedRunChunks = (await serverCache.listFromTo(runId, startIndex)) as ChunkType[];\n const liveStream = _run.observeStream();\n\n return createReplayStream<ChunkType>({\n history: cachedRunChunks,\n liveSource: liveStream,\n });\n } catch (error) {\n return handleError(error, 'Error observing workflow stream');\n }\n },\n});\n\nexport const RESUME_ASYNC_WORKFLOW_ROUTE = createRoute({\n method: 'POST',\n path: '/workflows/:workflowId/resume-async',\n responseType: 'json',\n pathParamSchema: workflowIdPathParams,\n queryParamSchema: runIdSchema,\n bodySchema: resumeBodySchema,\n responseSchema: workflowExecutionResultSchema,\n summary: 'Resume workflow asynchronously',\n description: 'Resumes a suspended workflow execution asynchronously without streaming',\n tags: ['Workflows'],\n mcp: {\n toolset: 'workflows',\n name: 'resume_workflow_run',\n description: 'Resume a suspended workflow run with resume data and wait for it to finish or suspend again.',\n },\n requiresAuth: true,\n handler: async ({ mastra, workflowId, runId, requestContext, ...params }) => {\n try {\n const effectiveResourceId = getEffectiveResourceId(requestContext, undefined);\n\n if (!workflowId) {\n throw new HTTPException(400, { message: 'Workflow ID is required' });\n }\n\n if (!runId) {\n throw new HTTPException(400, { message: 'runId required to resume workflow' });\n }\n\n const { workflow } = await listWorkflowsFromSystem({ mastra, workflowId });\n\n if (!workflow) {\n throw new HTTPException(404, { message: 'Workflow not found' });\n }\n\n const run = await workflow.getWorkflowRunById(runId);\n\n if (!run) {\n throw new HTTPException(404, { message: 'Workflow run not found' });\n }\n\n await validateRunOwnership(run, effectiveResourceId, mastra, requestContext);\n\n const _run = await workflow.createRun({ runId, resourceId: run.resourceId });\n const result = await withLoadedSteps(await _run.resume({ ...params, requestContext }));\n\n return result;\n } catch (error) {\n return handleError(error, 'Error resuming workflow step');\n }\n },\n});\n\n/**\n * Fire-and-forget resume: dispatches the resume and returns immediately with the runId,\n * without waiting for the workflow to complete. For Inngest-backed workflows this avoids\n * the `getRunOutput()` polling race that the awaiting `resume-async` route can hit.\n *\n * TODO(v2): in Mastra v2 this fire-and-forget behavior should become the behavior of the\n * `resume-async` route (and `Run.resumeAsync()`), and this route should be removed. It is\n * kept separate in v1 to avoid a breaking change to the existing `resume-async` response\n * contract (which returns the full workflow result).\n */\nexport const RESUME_NO_WAIT_WORKFLOW_ROUTE = createRoute({\n method: 'POST',\n path: '/workflows/:workflowId/resume-no-wait',\n responseType: 'json',\n pathParamSchema: workflowIdPathParams,\n queryParamSchema: runIdSchema,\n bodySchema: resumeBodySchema,\n responseSchema: createWorkflowRunResponseSchema,\n summary: 'Resume workflow without waiting',\n description:\n 'Resumes a suspended workflow execution without waiting (fire-and-forget) and returns immediately with the runId. The workflow continues executing in the background.',\n tags: ['Workflows'],\n requiresAuth: true,\n handler: async ({ mastra, workflowId, runId, requestContext, ...params }) => {\n try {\n const effectiveResourceId = getEffectiveResourceId(requestContext, undefined);\n\n if (!workflowId) {\n throw new HTTPException(400, { message: 'Workflow ID is required' });\n }\n\n if (!runId) {\n throw new HTTPException(400, { message: 'runId required to resume workflow' });\n }\n\n const { workflow } = await listWorkflowsFromSystem({ mastra, workflowId });\n\n if (!workflow) {\n throw new HTTPException(404, { message: 'Workflow not found' });\n }\n\n const run = await workflow.getWorkflowRunById(runId);\n\n if (!run) {\n throw new HTTPException(404, { message: 'Workflow run not found' });\n }\n\n await validateRunOwnership(run, effectiveResourceId, mastra, requestContext);\n\n const _run = await workflow.createRun({ runId, resourceId: run.resourceId });\n const result = await _run.resumeAsync({ ...params, requestContext });\n\n return result;\n } catch (error) {\n return handleError(error, 'Error resuming workflow step');\n }\n },\n});\n\nexport const RESUME_WORKFLOW_ROUTE = createRoute({\n method: 'POST',\n path: '/workflows/:workflowId/resume',\n responseType: 'json',\n pathParamSchema: workflowIdPathParams,\n queryParamSchema: runIdSchema,\n bodySchema: resumeBodySchema,\n responseSchema: workflowControlResponseSchema,\n summary: 'Resume workflow',\n description: 'Resumes a suspended workflow execution from a specific step',\n tags: ['Workflows'],\n requiresAuth: true,\n handler: async ({ mastra, workflowId, runId, requestContext, ...params }) => {\n try {\n const effectiveResourceId = getEffectiveResourceId(requestContext, undefined);\n\n if (!workflowId) {\n throw new HTTPException(400, { message: 'Workflow ID is required' });\n }\n\n if (!runId) {\n throw new HTTPException(400, { message: 'runId required to resume workflow' });\n }\n\n const { workflow } = await listWorkflowsFromSystem({ mastra, workflowId });\n\n if (!workflow) {\n throw new HTTPException(404, { message: 'Workflow not found' });\n }\n\n const run = await workflow.getWorkflowRunById(runId);\n\n if (!run) {\n throw new HTTPException(404, { message: 'Workflow run not found' });\n }\n\n await validateRunOwnership(run, effectiveResourceId, mastra, requestContext);\n\n const _run = await workflow.createRun({ runId, resourceId: run.resourceId });\n\n // Fire-and-forget: attach .catch so a rejected resume cannot become an\n // unhandledRejection and tear down the process.\n void _run.resume({ ...params, requestContext }).catch(error => {\n mastra.getLogger().error('Failed to resume workflow run', { error, workflowId, runId });\n });\n\n return { message: 'Workflow run resumed' };\n } catch (error) {\n return handleError(error, 'Error resuming workflow');\n }\n },\n});\n\nexport const RESTART_ASYNC_WORKFLOW_ROUTE = createRoute({\n method: 'POST',\n path: '/workflows/:workflowId/restart-async',\n responseType: 'json',\n pathParamSchema: workflowIdPathParams,\n queryParamSchema: runIdSchema,\n bodySchema: restartBodySchema,\n responseSchema: workflowExecutionResultSchema,\n summary: 'Restart workflow asynchronously',\n description: 'Restarts an active workflow execution asynchronously',\n tags: ['Workflows'],\n requiresAuth: true,\n handler: async ({ mastra, workflowId, runId, requestContext, ...params }) => {\n try {\n const effectiveResourceId = getEffectiveResourceId(requestContext, undefined);\n\n if (!workflowId) {\n throw new HTTPException(400, { message: 'Workflow ID is required' });\n }\n\n if (!runId) {\n throw new HTTPException(400, { message: 'runId required to restart workflow' });\n }\n\n const { workflow } = await listWorkflowsFromSystem({ mastra, workflowId });\n\n if (!workflow) {\n throw new HTTPException(404, { message: 'Workflow not found' });\n }\n\n const run = await workflow.getWorkflowRunById(runId);\n\n if (!run) {\n throw new HTTPException(404, { message: 'Workflow run not found' });\n }\n\n await validateRunOwnership(run, effectiveResourceId, mastra, requestContext);\n\n const _run = await workflow.createRun({ runId, resourceId: run.resourceId });\n const result = await withLoadedSteps(await _run.restart({ ...params, requestContext }));\n\n return result;\n } catch (error) {\n return handleError(error, 'Error restarting workflow');\n }\n },\n});\n\nexport const RESTART_WORKFLOW_ROUTE = createRoute({\n method: 'POST',\n path: '/workflows/:workflowId/restart',\n responseType: 'json',\n pathParamSchema: workflowIdPathParams,\n queryParamSchema: runIdSchema,\n bodySchema: restartBodySchema,\n responseSchema: workflowControlResponseSchema,\n summary: 'Restart workflow',\n description: 'Restarts an active workflow execution',\n tags: ['Workflows'],\n requiresAuth: true,\n handler: async ({ mastra, workflowId, runId, requestContext, ...params }) => {\n try {\n const effectiveResourceId = getEffectiveResourceId(requestContext, undefined);\n\n if (!workflowId) {\n throw new HTTPException(400, { message: 'Workflow ID is required' });\n }\n\n if (!runId) {\n throw new HTTPException(400, { message: 'runId required to restart workflow' });\n }\n\n const { workflow } = await listWorkflowsFromSystem({ mastra, workflowId });\n\n if (!workflow) {\n throw new HTTPException(404, { message: 'Workflow not found' });\n }\n\n const run = await workflow.getWorkflowRunById(runId);\n\n if (!run) {\n throw new HTTPException(404, { message: 'Workflow run not found' });\n }\n\n await validateRunOwnership(run, effectiveResourceId, mastra, requestContext);\n\n const _run = await workflow.createRun({ runId, resourceId: run.resourceId });\n\n void _run.restart({ ...params, requestContext }).catch(error => {\n mastra.getLogger().error('Failed to restart workflow run in background', { error, workflowId, runId });\n });\n\n return { message: 'Workflow run restarted' };\n } catch (error) {\n return handleError(error, 'Error restarting workflow');\n }\n },\n});\n\nexport const RESTART_ALL_ACTIVE_WORKFLOW_RUNS_ASYNC_ROUTE = createRoute({\n method: 'POST',\n path: '/workflows/:workflowId/restart-all-active-workflow-runs-async',\n responseType: 'json',\n pathParamSchema: workflowIdPathParams,\n responseSchema: workflowControlResponseSchema,\n summary: 'Restart all active workflow runs asynchronously',\n description: 'Restarts all active workflow runs asynchronously',\n tags: ['Workflows'],\n requiresAuth: true,\n handler: async ({ mastra, workflowId, requestContext }) => {\n try {\n // Restarting every active run spans all owners, so only a privileged caller may do it:\n // checked as access to a run with no owner.\n await validateRunOwnership(\n { resourceId: null },\n getEffectiveResourceId(requestContext, undefined),\n mastra,\n requestContext,\n );\n if (!workflowId) {\n throw new HTTPException(400, { message: 'Workflow ID is required' });\n }\n\n const { workflow } = await listWorkflowsFromSystem({ mastra, workflowId });\n\n if (!workflow) {\n throw new HTTPException(404, { message: 'Workflow not found' });\n }\n\n await workflow.restartAllActiveWorkflowRuns();\n\n return { message: 'All active workflow runs restarted' };\n } catch (error) {\n return handleError(error, 'Error restarting workflow');\n }\n },\n});\n\nexport const RESTART_ALL_ACTIVE_WORKFLOW_RUNS_ROUTE = createRoute({\n method: 'POST',\n path: '/workflows/:workflowId/restart-all-active-workflow-runs',\n responseType: 'json',\n pathParamSchema: workflowIdPathParams,\n responseSchema: workflowControlResponseSchema,\n summary: 'Restart all active workflow runs',\n description: 'Restarts all active workflow runs',\n tags: ['Workflows'],\n requiresAuth: true,\n handler: async ({ mastra, workflowId, requestContext }) => {\n try {\n // Restarting every active run spans all owners, so only a privileged caller may do it:\n // checked as access to a run with no owner.\n await validateRunOwnership(\n { resourceId: null },\n getEffectiveResourceId(requestContext, undefined),\n mastra,\n requestContext,\n );\n if (!workflowId) {\n throw new HTTPException(400, { message: 'Workflow ID is required' });\n }\n\n const { workflow } = await listWorkflowsFromSystem({ mastra, workflowId });\n\n if (!workflow) {\n throw new HTTPException(404, { message: 'Workflow not found' });\n }\n\n void workflow.restartAllActiveWorkflowRuns().catch(error => {\n mastra.getLogger().error('Failed to restart active workflow runs', { error, workflowId });\n });\n\n return { message: 'All active workflow runs restarted' };\n } catch (error) {\n return handleError(error, 'Error restarting workflow');\n }\n },\n});\n\nexport const TIME_TRAVEL_ASYNC_WORKFLOW_ROUTE = createRoute({\n method: 'POST',\n path: '/workflows/:workflowId/time-travel-async',\n responseType: 'json',\n pathParamSchema: workflowIdPathParams,\n queryParamSchema: runIdSchema,\n bodySchema: timeTravelBodySchema,\n responseSchema: workflowExecutionResultSchema,\n summary: 'Time travel workflow asynchronously',\n description: 'Time travels a workflow run asynchronously without streaming',\n tags: ['Workflows'],\n requiresAuth: true,\n handler: async ({ mastra, workflowId, runId, requestContext, ...params }) => {\n try {\n const effectiveResourceId = getEffectiveResourceId(requestContext, undefined);\n\n if (!workflowId) {\n throw new HTTPException(400, { message: 'Workflow ID is required' });\n }\n\n if (!runId) {\n throw new HTTPException(400, { message: 'runId required to time travel workflow' });\n }\n\n const { workflow } = await listWorkflowsFromSystem({ mastra, workflowId });\n\n if (!workflow) {\n throw new HTTPException(404, { message: 'Workflow not found' });\n }\n\n const run = await workflow.getWorkflowRunById(runId);\n\n if (!run) {\n throw new HTTPException(404, { message: 'Workflow run not found' });\n }\n\n await validateRunOwnership(run, effectiveResourceId, mastra, requestContext);\n\n const _run = await workflow.createRun({ runId, resourceId: run.resourceId });\n const result = await withLoadedSteps(await _run.timeTravel({ ...params, requestContext }));\n\n return result;\n } catch (error) {\n return handleError(error, 'Error time traveling workflow');\n }\n },\n});\n\nexport const TIME_TRAVEL_WORKFLOW_ROUTE = createRoute({\n method: 'POST',\n path: '/workflows/:workflowId/time-travel',\n responseType: 'json',\n pathParamSchema: workflowIdPathParams,\n queryParamSchema: runIdSchema,\n bodySchema: timeTravelBodySchema,\n responseSchema: workflowControlResponseSchema,\n summary: 'Time travel workflow',\n description: 'Time travels a workflow run, starting from a specific step',\n tags: ['Workflows'],\n requiresAuth: true,\n handler: async ({ mastra, workflowId, runId, requestContext, ...params }) => {\n try {\n const effectiveResourceId = getEffectiveResourceId(requestContext, undefined);\n\n if (!workflowId) {\n throw new HTTPException(400, { message: 'Workflow ID is required' });\n }\n\n if (!runId) {\n throw new HTTPException(400, { message: 'runId required to time travel workflow' });\n }\n\n const { workflow } = await listWorkflowsFromSystem({ mastra, workflowId });\n\n if (!workflow) {\n throw new HTTPException(404, { message: 'Workflow not found' });\n }\n\n const run = await workflow.getWorkflowRunById(runId);\n\n if (!run) {\n throw new HTTPException(404, { message: 'Workflow run not found' });\n }\n\n await validateRunOwnership(run, effectiveResourceId, mastra, requestContext);\n\n const _run = await workflow.createRun({ runId, resourceId: run.resourceId });\n\n // Fire-and-forget: attach .catch so a rejected time travel cannot become\n // an unhandledRejection and tear down the process.\n void _run.timeTravel({ ...params, requestContext }).catch(error => {\n mastra.getLogger().error('Failed to time travel workflow run', { error, workflowId, runId });\n });\n\n return { message: 'Workflow run time travel started' };\n } catch (error) {\n return handleError(error, 'Error time traveling workflow');\n }\n },\n});\n\nexport const TIME_TRAVEL_STREAM_WORKFLOW_ROUTE = createRoute({\n method: 'POST',\n path: '/workflows/:workflowId/time-travel-stream',\n responseType: 'stream',\n pathParamSchema: workflowIdPathParams,\n queryParamSchema: runIdSchema,\n bodySchema: timeTravelBodySchema,\n summary: 'Time travel workflow stream',\n description: 'Time travels a workflow run, starting from a specific step, and streams the results in real-time',\n tags: ['Workflows'],\n requiresAuth: true,\n handler: async ({ mastra, workflowId, runId, requestContext, ...params }) => {\n try {\n const effectiveResourceId = getEffectiveResourceId(requestContext, undefined);\n\n if (!workflowId) {\n throw new HTTPException(400, { message: 'Workflow ID is required' });\n }\n\n if (!runId) {\n throw new HTTPException(400, { message: 'runId required to time travel workflow stream' });\n }\n\n const { workflow } = await listWorkflowsFromSystem({ mastra, workflowId });\n\n if (!workflow) {\n throw new HTTPException(404, { message: 'Workflow not found' });\n }\n\n // Validate ownership of existing run before time traveling\n const existingRun = await workflow.getWorkflowRunById(runId);\n if (!existingRun) {\n throw new HTTPException(404, { message: 'Workflow run not found' });\n }\n await validateRunOwnership(existingRun, effectiveResourceId, mastra, requestContext);\n\n const serverCache = mastra.getServerCache();\n\n const run = await workflow.createRun({ runId, resourceId: existingRun.resourceId });\n const result = run.timeTravelStream({ ...params, requestContext });\n\n if (serverCache) {\n return cacheRunStream({ cache: serverCache, runId, source: result.fullStream });\n }\n\n return result.fullStream;\n } catch (error) {\n return handleError(error, 'Error time traveling workflow stream');\n }\n },\n});\n\nexport const CANCEL_WORKFLOW_RUN_ROUTE = createRoute({\n method: 'POST',\n path: '/workflows/:workflowId/runs/:runId/cancel',\n responseType: 'json',\n pathParamSchema: workflowRunPathParams,\n responseSchema: workflowControlResponseSchema,\n summary: 'Cancel workflow run',\n description: 'Cancels an in-progress workflow execution',\n tags: ['Workflows'],\n mcp: {\n toolset: 'workflows',\n name: 'cancel_workflow_run',\n description: 'Cancel an in-progress workflow run.',\n },\n requiresAuth: true,\n handler: async ({ mastra, workflowId, runId, requestContext }) => {\n try {\n const effectiveResourceId = getEffectiveResourceId(requestContext, undefined);\n\n if (!workflowId) {\n throw new HTTPException(400, { message: 'Workflow ID is required' });\n }\n\n if (!runId) {\n throw new HTTPException(400, { message: 'runId required to cancel workflow run' });\n }\n\n const { workflow } = await listWorkflowsFromSystem({ mastra, workflowId });\n\n if (!workflow) {\n throw new HTTPException(404, { message: 'Workflow not found' });\n }\n\n const run = await workflow.getWorkflowRunById(runId);\n\n if (!run) {\n throw new HTTPException(404, { message: 'Workflow run not found' });\n }\n\n await validateRunOwnership(run, effectiveResourceId, mastra, requestContext);\n\n const _run = await workflow.createRun({ runId, resourceId: run.resourceId });\n\n await _run.cancel();\n\n return { message: 'Workflow run cancelled' };\n } catch (error) {\n return handleError(error, 'Error canceling workflow run');\n }\n },\n});\n\n// Legacy routes (deprecated)\nexport const STREAM_LEGACY_WORKFLOW_ROUTE = createRoute({\n method: 'POST',\n path: '/workflows/:workflowId/stream-legacy',\n responseType: 'stream',\n pathParamSchema: workflowIdPathParams,\n queryParamSchema: runIdSchema,\n bodySchema: streamWorkflowBodySchema,\n responseSchema: streamResponseSchema,\n summary: '[DEPRECATED] Stream workflow with legacy format',\n description: 'Legacy endpoint for streaming workflow execution. Use /workflows/:workflowId/stream instead.',\n tags: ['Workflows', 'Legacy'],\n requiresAuth: true,\n handler: async ({ mastra, workflowId, runId, resourceId, requestContext, ...params }) => {\n try {\n const effectiveResourceId = getEffectiveResourceId(requestContext, resourceId);\n\n if (!workflowId) {\n throw new HTTPException(400, { message: 'Workflow ID is required' });\n }\n\n if (!runId) {\n throw new HTTPException(400, { message: 'runId required to resume workflow' });\n }\n\n const { workflow } = await listWorkflowsFromSystem({ mastra, workflowId });\n\n if (!workflow) {\n throw new HTTPException(404, { message: 'Workflow not found' });\n }\n\n const serverCache = mastra.getServerCache();\n\n if (runId) {\n const existingRun = await workflow.getWorkflowRunById(runId, { withNestedWorkflows: false });\n await validateRunOwnership(\n existingRun,\n getEffectiveResourceId(requestContext, undefined),\n mastra,\n requestContext,\n );\n }\n const run = await workflow.createRun({ runId, resourceId: effectiveResourceId });\n const result = run.streamLegacy({\n ...params,\n requestContext,\n onChunk: async chunk => {\n if (serverCache) {\n const cacheKey = runId;\n await serverCache.listPush(cacheKey, chunk);\n }\n },\n });\n\n return result.stream;\n } catch (error) {\n return handleError(error, 'Error executing workflow');\n }\n },\n});\n\nexport const OBSERVE_STREAM_LEGACY_WORKFLOW_ROUTE = createRoute({\n method: 'POST',\n path: '/workflows/:workflowId/observe-stream-legacy',\n responseType: 'stream',\n pathParamSchema: workflowIdPathParams,\n queryParamSchema: runIdSchema,\n responseSchema: streamResponseSchema,\n summary: '[DEPRECATED] Observe workflow stream with legacy format',\n description: 'Legacy endpoint for observing workflow stream. Use /workflows/:workflowId/observe instead.',\n tags: ['Workflows', 'Legacy'],\n requiresAuth: true,\n handler: async ({ mastra, workflowId, runId, requestContext }) => {\n try {\n const effectiveResourceId = getEffectiveResourceId(requestContext, undefined);\n\n if (!workflowId) {\n throw new HTTPException(400, { message: 'Workflow ID is required' });\n }\n\n if (!runId) {\n throw new HTTPException(400, { message: 'runId required to observe workflow stream' });\n }\n\n const { workflow } = await listWorkflowsFromSystem({ mastra, workflowId });\n\n if (!workflow) {\n throw new HTTPException(404, { message: 'Workflow not found' });\n }\n\n const run = await workflow.getWorkflowRunById(runId);\n\n if (!run) {\n throw new HTTPException(404, { message: 'Workflow run not found' });\n }\n\n await validateRunOwnership(run, effectiveResourceId, mastra, requestContext);\n\n const _run = await workflow.createRun({ runId, resourceId: run.resourceId });\n const serverCache = mastra.getServerCache();\n if (!serverCache) {\n throw new HTTPException(500, { message: 'Server cache not found' });\n }\n\n // Get cached chunks and create replay stream\n const cachedRunChunks = (await serverCache.listFromTo(runId, 0)) as StreamEvent[];\n const result = _run.observeStreamLegacy();\n\n if (!result.stream) {\n throw new HTTPException(500, { message: 'Failed to create observe stream' });\n }\n\n return createReplayStream<StreamEvent>({\n history: cachedRunChunks,\n liveSource: result.stream,\n });\n } catch (error) {\n return handleError(error, 'Error observing workflow stream');\n }\n },\n});\n\n// ============================================================================\n// Worker Step Execution Endpoint\n// Used by standalone OrchestrationWorker instances with HttpRemoteStrategy.\n// ============================================================================\n\n// Identifies the workflow a nested step runs under, up to the top-level run.\n// Nested workflows are usually reachable only from their parent's step graph.\nexport type StepExecutionParentWorkflow = {\n workflowId: string;\n runId: string;\n executionPath: number[];\n parentWorkflow?: StepExecutionParentWorkflow;\n};\n\nconst stepExecutionParentWorkflowSchema: z.ZodType<StepExecutionParentWorkflow> = z.lazy(() =>\n z.object({\n workflowId: z.string(),\n runId: z.string(),\n executionPath: z.array(z.number().int().nonnegative()),\n parentWorkflow: stepExecutionParentWorkflowSchema.optional(),\n }),\n);\n\n// `workflowId` and `runId` are taken from path params (single source of\n// truth); they are intentionally omitted from the request body schema.\nconst stepExecutionBodySchema = z.object({\n stepId: z.string(),\n executionPath: z.array(z.number().int().nonnegative()),\n parentWorkflow: stepExecutionParentWorkflowSchema.optional(),\n stepResults: z.record(z.string(), z.unknown()),\n state: z.record(z.string(), z.unknown()),\n requestContext: z.record(z.string(), z.unknown()),\n input: z.unknown().optional(),\n resumeData: z.unknown().optional(),\n retryCount: z.number().int().nonnegative().optional(),\n foreachIdx: z.number().int().nonnegative().optional(),\n format: z.enum(['legacy', 'vnext']).optional(),\n perStep: z.boolean().optional(),\n validateInputs: z.boolean().optional(),\n storageVersion: z.union([z.literal(1), z.literal(2)]).optional(),\n});\n\ntype StepExecutionBody = z.infer<typeof stepExecutionBodySchema>;\n\ninterface StepExecutionHandlerArgs extends StepExecutionBody {\n mastra: Mastra;\n workflowId: string;\n runId: string;\n}\n\n// Reuse the InProcessStrategy across requests for a given Mastra instance.\n// The strategy is stateless beyond its mastra reference, but allocating it\n// per request triggers a dynamic import on the hot path.\n//\n// The dynamic import is required by `pnpm --filter ./packages/server\n// check:core-imports`: `@mastra/core/worker` is a new subpath that older\n// peer-dep floors don't expose, so a static import would fail the check.\n// Once the floor is bumped, this can become a static import.\ntype StepStrategy = { executeStep: (p: unknown) => Promise<unknown> };\nconst strategyByMastra = new WeakMap<Mastra, StepStrategy>();\n\nasync function getStepStrategy(mastra: Mastra): Promise<StepStrategy> {\n let cached = strategyByMastra.get(mastra);\n if (!cached) {\n const { InProcessStrategy } = await import('@mastra/core/worker');\n cached = new InProcessStrategy({ mastra }) as unknown as StepStrategy;\n strategyByMastra.set(mastra, cached);\n }\n return cached;\n}\n\n// Step execution returns the worker's StepResult. Its shape is dynamic\n// and depends on the step's output schema.\nconst stepExecutionResponseSchema = z.unknown();\n\nexport const EXECUTE_WORKFLOW_STEP_ROUTE = createRoute({\n method: 'POST',\n path: '/workflows/:workflowId/runs/:runId/steps/execute',\n responseType: 'json',\n pathParamSchema: workflowRunPathParams,\n bodySchema: stepExecutionBodySchema,\n responseSchema: stepExecutionResponseSchema,\n summary: 'Execute a workflow step',\n description:\n 'Internal endpoint used by standalone OrchestrationWorker instances to execute workflow steps remotely via HttpRemoteStrategy.',\n tags: ['Workflows', 'Worker'],\n requiresAuth: true,\n handler: (async ({ mastra, workflowId, runId, ...body }: StepExecutionHandlerArgs) => {\n try {\n // The adapter replaces the body's requestContext with the server-built context.\n const candidate = body.requestContext as unknown as RequestContext | undefined;\n const serverRequestContext = typeof candidate?.get === 'function' ? candidate : undefined;\n const workflowsStore = await mastra.getStorage()?.getStore('workflows');\n const existingRun = await workflowsStore?.getWorkflowRunById({ runId, workflowName: workflowId });\n await validateRunOwnership(\n existingRun,\n getEffectiveResourceId(serverRequestContext, undefined),\n mastra,\n serverRequestContext,\n );\n // Auth is enforced by the framework via `requiresAuth: true` and the\n // deployer's `authenticateToken` provider. Note that when NO auth\n // provider is configured, the framework currently treats the route\n // as public (see ServerAdapter.checkRouteAuth). Operators deploying\n // standalone workers must configure an auth provider to gate this\n // endpoint — there is no implicit fail-closed.\n const strategy = await getStepStrategy(mastra);\n const result = await strategy.executeStep({\n workflowId,\n runId,\n stepId: body.stepId,\n executionPath: body.executionPath,\n parentWorkflow: body.parentWorkflow,\n stepResults: body.stepResults,\n state: body.state,\n requestContext: body.requestContext,\n input: body.input,\n resumeData: body.resumeData,\n retryCount: body.retryCount,\n foreachIdx: body.foreachIdx,\n format: body.format,\n perStep: body.perStep,\n validateInputs: body.validateInputs,\n storageVersion: body.storageVersion,\n });\n\n return result;\n } catch (error) {\n return handleError(error, 'Error executing workflow step');\n }\n }) as any,\n});\n\n// Wire shape of an Event delivered through a push-mode broker. Validates the\n// fields `WorkflowEventProcessor` depends on; broker envelopes routinely carry\n// extra metadata that isn't part of `Event` itself, so we passthrough the rest.\n// `createdAt` is an ISO timestamp on the wire — the handler converts it to a\n// `Date` before forwarding to `Mastra.handleWorkflowEvent`.\nconst workflowEventSchema = z.object({\n id: z.string(),\n type: z.string(),\n data: z.unknown(),\n runId: z.string(),\n createdAt: z.string(),\n index: z.number().optional(),\n deliveryAttempt: z.number().optional(),\n});\n\nconst receiveWorkflowEventBodySchema = z.object({\n event: workflowEventSchema.passthrough(),\n});\n\nconst receiveWorkflowEventResponseSchema = z.object({\n ok: z.boolean(),\n retry: z.boolean().optional(),\n});\n\ninterface ReceiveWorkflowEventHandlerArgs {\n mastra: Mastra;\n event: Event;\n requestContext?: RequestContext;\n}\n\n/**\n * Generic push receive endpoint for workflow events. A push-mode broker\n * (GCP Pub/Sub push subscription, SNS, EventBridge) — or a per-broker adapter\n * that decodes the broker's envelope first — POSTs each event here and the\n * response code tells the broker whether to retry:\n *\n * - 200/204 → ack\n * - 5xx → transient, retry with backoff\n * - 4xx → poison, drop / send to DLQ\n *\n * Auth is enforced through the framework's standard `requiresAuth` flow.\n * Operators MUST configure an `authenticateToken` provider that recognizes\n * whatever credential the broker attaches (e.g. a Google-signed OIDC token\n * for GCP Pub/Sub push). Without an auth provider the endpoint is effectively\n * public — same caveat as `EXECUTE_WORKFLOW_STEP_ROUTE`.\n */\nexport const RECEIVE_WORKFLOW_EVENT_ROUTE = createRoute({\n method: 'POST',\n path: '/workflows/events',\n responseType: 'json',\n bodySchema: receiveWorkflowEventBodySchema,\n responseSchema: receiveWorkflowEventResponseSchema,\n summary: 'Receive a workflow event from a push-mode broker',\n description:\n 'Push-mode entry point for workflow events. Brokers (GCP Pub/Sub push, SNS, EventBridge) POST each event here; Mastra processes it through the same pipeline as pull-mode workers.',\n tags: ['Workflows', 'Worker'],\n requiresAuth: true,\n // Broker push endpoint: it advances runtime state rather than editing\n // definitions, so `workflows:execute` is the more accurate fit. `write` is\n // kept for back-compat with service principals that already grant it.\n requiresPermission: ['workflows:write', 'workflows:execute'],\n handler: (async ({ mastra, event, requestContext }: ReceiveWorkflowEventHandlerArgs) => {\n try {\n const workflowName = (event.data as { workflowId?: unknown } | undefined)?.workflowId;\n const workflowsStore = await mastra.getStorage()?.getStore('workflows');\n const existingRun = await workflowsStore?.getWorkflowRunById({\n runId: event.runId,\n ...(typeof workflowName === 'string' ? { workflowName } : {}),\n });\n await validateRunOwnership(\n existingRun,\n getEffectiveResourceId(requestContext, undefined),\n mastra,\n requestContext,\n );\n // The wire schema carries `createdAt` as a string; coerce to Date here\n // before handing off to the in-process pipeline, which expects an `Event`.\n const rawCreatedAt = (event as unknown as { createdAt: unknown }).createdAt;\n const createdAt = rawCreatedAt instanceof Date ? rawCreatedAt : new Date(rawCreatedAt as string);\n if (Number.isNaN(createdAt.getTime())) {\n throw new HTTPException(400, { message: 'Invalid createdAt' });\n }\n return await mastra.handleWorkflowEvent({ ...event, createdAt });\n } catch (error) {\n return handleError(error, 'Error receiving workflow event');\n }\n }) as any,\n});\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAmDA,MAAM,wBAA6C;CAAC;CAAW;CAAU;CAAY;AAAU;;;;;AAM/F,eAAe,gBAA+C,QAAuB;CACnF,MAAM,QAAiB,OAAO;CAC9B,OAAO,OAAO,UAAU,aAAa;EAAE,GAAG;EAAQ,OAAO,MAAM,MAAM;CAAE,IAAI;AAC7E;;;;;;;AAQA,MAAM,yCAAyB,IAAI,IAAY;;;;;;;;;;;;AAa/C,SAAS,eAAe,EACtB,OACA,OACA,UAK4B;CAC5B,IAAI,uBAAuB,IAAI,KAAK,GAClC,OAAO;CAGT,MAAM,CAAC,SAAS,YAAY,OAAO,IAAI;CACvC,uBAAuB,IAAI,KAAK;CAEhC,CAAM,YAAY;EAChB,MAAM,SAAS,QAAQ,UAAU;EACjC,IAAI;GACF,OAAO,MAAM;IACX,MAAM,EAAE,MAAM,UAAU,MAAM,OAAO,KAAK;IAC1C,IAAI,MAAM;IAEV,MAAM,MAAM,SAAS,OAAO,KAAK,CAAC,CAAC,YAAY,CAAC,CAAC;GACnD;EACF,QAAQ,CAER,UAAU;GACR,OAAO,YAAY;GACnB,uBAAuB,OAAO,KAAK;EACrC;CACF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AAO,qBAAsD;EACtF,IAAI;GACF,MAAM,eAAgB,MAAM,MAA+C;GAE3E,MAAM,cAAc,OAAM,MADG,OAAO,WAAW,CAAC,EAAE,SAAS,WAAW,EAAA,EAC5B,mBAAmB;IAC3D,OAAO,MAAM;IACb,GAAI,OAAO,iBAAiB,WAAW,EAAE,aAAa,IAAI,CAAC;GAC7D,CAAC;GACD,MAAMgB,cAAAA,qBACJ,aACAR,cAAAA,uBAAuB,gBAAgB,KAAA,CAAS,GAChD,QACA,cACF;GAGA,MAAM,eAAgB,MAA4C;GAClE,MAAM,YAAY,wBAAwB,OAAO,eAAe,IAAI,KAAK,YAAsB;GAC/F,IAAI,OAAO,MAAM,UAAU,QAAQ,CAAC,GAClC,MAAM,IAAIX,uBAAAA,cAAc,KAAK,EAAE,SAAS,oBAAoB,CAAC;GAE/D,OAAO,MAAM,OAAO,oBAAoB;IAAE,GAAG;IAAO;GAAU,CAAC;EACjE,SAAS,OAAO;GACd,OAAOS,8BAAAA,YAAY,OAAO,gCAAgC;EAC5D;CACF;AACF,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"workspace-C5BBUatQ.cjs","names":["z"],"sources":["../src/server/schemas/workspace.ts"],"sourcesContent":["/**\n * Workspace Schemas\n *\n * All Zod schemas for workspace operations including:\n * - Filesystem operations (read, write, list, delete, mkdir, stat)\n * - Search operations (search, index)\n * - Skills operations (list, get, search, references)\n */\n\nimport { z } from 'zod/v4';\n\n// =============================================================================\n// Shared Field Schemas\n// =============================================================================\n\n/**\n * Boolean flag schema for query/body params that may arrive as strings.\n *\n * `z.coerce.boolean()` applies JavaScript truthiness, so the nonempty string\n * `\"false\"` coerces to `true`. The client SDK serializes explicit booleans with\n * `String(...)`, sending the literal `\"false\"` when a caller disables a flag,\n * which would otherwise flip the flag on. Accept `\"true\"`/`\"false\"` explicitly\n * and pass every other value through unchanged.\n */\nconst coercedBooleanSchema = z.preprocess(value => {\n if (value === 'true') return true;\n if (value === 'false') return false;\n return value;\n}, z.boolean());\n\n// =============================================================================\n// Filesystem Path Schemas\n// =============================================================================\n\nexport const fsPathParams = z.object({\n path: z.string().describe('File or directory path'),\n});\n\nexport const workspaceIdPathParams = z.object({\n workspaceId: z.string().describe('Workspace ID'),\n});\n\n// =============================================================================\n// Filesystem Query Schemas\n// =============================================================================\n\nexport const fsReadQuerySchema = z.object({\n path: z.string().describe('Path to the file to read'),\n encoding: z.string().optional().describe('Encoding for text files (default: utf-8)'),\n});\n\nexport const fsListQuerySchema = z.object({\n path: z.string().describe('Path to the directory to list'),\n recursive: coercedBooleanSchema.optional().describe('Include subdirectories'),\n});\n\nexport const fsStatQuerySchema = z.object({\n path: z.string().describe('Path to get info about'),\n});\n\nexport const fsDeleteQuerySchema = z.object({\n path: z.string().describe('Path to delete'),\n recursive: coercedBooleanSchema.optional().describe('Delete directories recursively'),\n force: coercedBooleanSchema.optional().describe(\"Don't error if path doesn't exist\"),\n});\n\n// =============================================================================\n// Filesystem Body Schemas\n// =============================================================================\n\nexport const fsWriteBodySchema = z.object({\n path: z.string().describe('Path to write to'),\n content: z.string().describe('Content to write (text or base64-encoded binary)'),\n encoding: z.enum(['utf-8', 'base64']).optional().default('utf-8').describe('Content encoding'),\n recursive: coercedBooleanSchema.optional().describe('Create parent directories if needed'),\n});\n\nexport const fsMkdirBodySchema = z.object({\n path: z.string().describe('Directory path to create'),\n recursive: coercedBooleanSchema.optional().describe('Create parent directories if needed'),\n});\n\n// =============================================================================\n// Filesystem Response Schemas\n// =============================================================================\n\nexport const fileEntrySchema = z.object({\n name: z.string(),\n type: z.enum(['file', 'directory']),\n size: z.number().optional(),\n mount: z\n .object({\n provider: z.string(),\n icon: z.string().optional(),\n displayName: z.string().optional(),\n description: z.string().optional(),\n status: z\n .enum([\n 'pending',\n 'initializing',\n 'ready',\n 'starting',\n 'running',\n 'stopping',\n 'stopped',\n 'destroying',\n 'destroyed',\n 'error',\n ])\n .optional(),\n error: z.string().optional(),\n })\n .optional(),\n});\n\nexport const fsReadResponseSchema = z.object({\n path: z.string(),\n content: z.string(),\n type: z.enum(['file', 'directory']),\n size: z.number().optional(),\n mimeType: z.string().optional(),\n});\n\nexport const fsWriteResponseSchema = z.object({\n success: z.boolean(),\n path: z.string(),\n});\n\nexport const fsListResponseSchema = z.object({\n path: z.string(),\n entries: z.array(fileEntrySchema),\n});\n\nexport const fsDeleteResponseSchema = z.object({\n success: z.boolean(),\n path: z.string(),\n});\n\nexport const fsMkdirResponseSchema = z.object({\n success: z.boolean(),\n path: z.string(),\n});\n\nexport const fsStatResponseSchema = z.object({\n path: z.string(),\n type: z.enum(['file', 'directory']),\n size: z.number().optional(),\n createdAt: z.string().optional(),\n modifiedAt: z.string().optional(),\n mimeType: z.string().optional(),\n});\n\n// =============================================================================\n// Search Schemas\n// =============================================================================\n\nexport const searchQuerySchema = z.object({\n query: z.string().describe('Search query text'),\n topK: z.coerce.number().optional().default(5).describe('Maximum number of results'),\n mode: z.enum(['bm25', 'vector', 'hybrid']).optional().describe('Search mode'),\n minScore: z.coerce.number().optional().describe('Minimum relevance score threshold'),\n});\n\nexport const searchResultSchema = z.object({\n id: z.string().describe('Document ID (file path)'),\n content: z.string(),\n score: z.number(),\n lineRange: z\n .object({\n start: z.number(),\n end: z.number(),\n })\n .optional(),\n scoreDetails: z\n .object({\n vector: z.number().optional(),\n bm25: z.number().optional(),\n })\n .optional(),\n});\n\nexport const searchResponseSchema = z.object({\n results: z.array(searchResultSchema),\n query: z.string(),\n mode: z.enum(['bm25', 'vector', 'hybrid']),\n});\n\nexport const indexBodySchema = z.object({\n path: z.string().describe('Path to use as document ID'),\n content: z.string().describe('Content to index'),\n metadata: z.record(z.string(), z.unknown()).optional().describe('Optional metadata'),\n});\n\nexport const indexResponseSchema = z.object({\n success: z.boolean(),\n path: z.string(),\n});\n\n// =============================================================================\n// Mount Schemas\n// =============================================================================\n\nexport const mountInfoSchema = z.object({\n path: z.string().describe('Mount path'),\n provider: z.string().describe('Filesystem provider type'),\n readOnly: z.boolean().describe('Whether the mount is read-only'),\n displayName: z.string().optional().describe('Human-readable name'),\n icon: z.string().optional().describe('UI icon identifier'),\n name: z.string().optional().describe('Filesystem instance name'),\n});\n\n// =============================================================================\n// Workspace Info Schema\n// =============================================================================\n\nexport const workspaceInfoResponseSchema = z.object({\n isWorkspaceConfigured: z.boolean(),\n id: z.string().optional(),\n name: z.string().optional(),\n status: z.string().optional(),\n capabilities: z\n .object({\n hasFilesystem: z.boolean(),\n hasDynamicFilesystem: z\n .boolean()\n .optional()\n .describe('True when the filesystem comes from a resolver, so file routes cannot browse it'),\n hasSandbox: z.boolean(),\n canBM25: z.boolean(),\n canVector: z.boolean(),\n canHybrid: z.boolean(),\n hasSkills: z.boolean(),\n })\n .optional(),\n safety: z\n .object({\n readOnly: z.boolean(),\n })\n .optional(),\n filesystem: z\n .object({\n id: z.string(),\n name: z.string(),\n provider: z.string(),\n status: z.string().optional(),\n error: z.string().optional(),\n readOnly: z.boolean().optional(),\n icon: z.string().optional(),\n metadata: z.record(z.string(), z.unknown()).optional(),\n })\n .optional(),\n mounts: z.array(mountInfoSchema).optional().describe('Mount points (only present for CompositeFilesystem)'),\n});\n\nconst workspaceItemSchema = z.object({\n id: z.string(),\n name: z.string(),\n status: z.string(),\n source: z.enum(['mastra', 'agent']),\n agentId: z.string().optional(),\n agentName: z.string().optional(),\n capabilities: z.object({\n hasFilesystem: z.boolean(),\n hasDynamicFilesystem: z\n .boolean()\n .optional()\n .describe('True when the filesystem comes from a resolver, so file routes cannot browse it'),\n hasSandbox: z.boolean(),\n canBM25: z.boolean(),\n canVector: z.boolean(),\n canHybrid: z.boolean(),\n hasSkills: z.boolean(),\n }),\n safety: z.object({\n readOnly: z.boolean(),\n }),\n});\n\nexport const listWorkspacesResponseSchema = z.object({\n workspaces: z.array(workspaceItemSchema),\n});\n\n// =============================================================================\n// Skills Path Parameter Schemas\n// =============================================================================\n\nexport const skillNamePathParams = workspaceIdPathParams.extend({\n skillName: z.string().min(1).describe('Skill name identifier'),\n});\n\nexport const skillReferencePathParams = skillNamePathParams.extend({\n referencePath: z.string().min(1).describe('Reference file path'),\n});\n\n// Optional query param for disambiguating same-named skills\nexport const skillDisambiguationQuerySchema = z.object({\n path: z.string().optional().describe('Skill path for disambiguation when multiple skills share the same name'),\n});\n\n// =============================================================================\n// Skills Query Parameter Schemas\n// =============================================================================\n\nexport const searchSkillsQuerySchema = z.object({\n query: z.string().describe('Search query text'),\n topK: z.coerce.number().optional().default(5).describe('Maximum number of results'),\n minScore: z.coerce.number().optional().describe('Minimum relevance score threshold'),\n skillNames: z.string().optional().describe('Comma-separated list of skill names to search within'),\n includeReferences: coercedBooleanSchema.optional().default(true).describe('Include reference files in search'),\n});\n\n// =============================================================================\n// Skills Response Schemas\n// =============================================================================\n\nexport const skillMetadataSchema = z.object({\n name: z.string(),\n description: z.string(),\n license: z.string().optional(),\n compatibility: z.unknown().optional(),\n metadata: z.record(z.string(), z.unknown()).optional(),\n path: z.string(),\n});\n\nexport const skillSourceSchema = z.discriminatedUnion('type', [\n z.object({ type: z.literal('external'), packagePath: z.string() }),\n z.object({ type: z.literal('local'), projectPath: z.string() }),\n z.object({ type: z.literal('managed'), mastraPath: z.string() }),\n]);\n\nexport const skillSchema = skillMetadataSchema.extend({\n instructions: z.string(),\n source: skillSourceSchema,\n references: z.array(z.string()),\n scripts: z.array(z.string()),\n assets: z.array(z.string()),\n});\n\n/**\n * Source info for skills installed via skills.sh\n * Stored in .meta.json when a skill is installed\n */\nexport const skillsShSourceSchema = z.object({\n owner: z.string().describe('GitHub owner/org'),\n repo: z.string().describe('GitHub repository'),\n});\n\nexport const skillMetadataWithPathSchema = skillMetadataSchema.extend({\n /** Source info for skills installed via skills.sh (from .meta.json) */\n skillsShSource: skillsShSourceSchema.optional(),\n});\n\nexport const listSkillsResponseSchema = z.object({\n skills: z.array(skillMetadataWithPathSchema),\n isSkillsConfigured: z.boolean().describe('Whether skills are configured in the workspace'),\n});\n\nexport const getSkillResponseSchema = skillSchema;\n\n/**\n * Agent skill response schema - similar to skillSchema but with optional fields\n * for when full skill details aren't available (e.g., inherited skills without\n * direct access to the Skills instance).\n */\nexport const getAgentSkillResponseSchema = skillMetadataSchema.extend({\n path: z.string().optional(),\n instructions: z.string().optional(),\n source: skillSourceSchema.optional(),\n references: z.array(z.string()).optional(),\n scripts: z.array(z.string()).optional(),\n assets: z.array(z.string()).optional(),\n});\n\nexport const skillReferenceResponseSchema = z.object({\n skillName: z.string(),\n referencePath: z.string(),\n content: z.string(),\n});\n\nexport const listReferencesResponseSchema = z.object({\n skillName: z.string(),\n references: z.array(z.string()),\n});\n\nexport const skillSearchResultSchema = z.object({\n skillName: z.string(),\n skillPath: z.string(),\n source: z.string(),\n content: z.string(),\n score: z.number(),\n lineRange: z\n .object({\n start: z.number(),\n end: z.number(),\n })\n .optional(),\n scoreDetails: z\n .object({\n vector: z.number().optional(),\n bm25: z.number().optional(),\n })\n .optional(),\n});\n\nexport const searchSkillsResponseSchema = z.object({\n results: z.array(skillSearchResultSchema),\n query: z.string(),\n});\n\n// =============================================================================\n// skills.sh Proxy Schemas\n// =============================================================================\n\nexport const skillsShSearchQuerySchema = z.object({\n q: z.string().describe('Search query'),\n limit: z.coerce.number().optional().default(10).describe('Maximum number of results'),\n});\n\nexport const skillsShPopularQuerySchema = z.object({\n limit: z.coerce.number().optional().default(10).describe('Maximum number of results'),\n offset: z.coerce.number().optional().default(0).describe('Offset for pagination'),\n});\n\nexport const skillsShSkillSchema = z.object({\n id: z.string(),\n name: z.string(),\n installs: z.number(),\n topSource: z.string(),\n});\n\nexport const skillsShSearchResponseSchema = z.object({\n query: z.string(),\n searchType: z.string(),\n skills: z.array(skillsShSkillSchema),\n count: z.number(),\n});\n\nexport const skillsShListResponseSchema = z.object({\n skills: z.array(skillsShSkillSchema),\n count: z.number(),\n limit: z.number(),\n offset: z.number(),\n});\n\nexport const skillsShPreviewQuerySchema = z.object({\n owner: z.string().describe('GitHub repository owner'),\n repo: z.string().describe('GitHub repository name'),\n path: z.string().describe('Path to skill within repo'),\n});\n\nexport const skillsShPreviewResponseSchema = z.object({\n content: z.string(),\n});\n\nexport const skillsShInstallBodySchema = z.object({\n owner: z.string().describe('GitHub repository owner'),\n repo: z.string().describe('GitHub repository name'),\n skillName: z.string().describe('Skill name from skills.sh'),\n mount: z.string().optional().describe('Mount path to install into (for CompositeFilesystem)'),\n});\n\nexport const skillsShInstallResponseSchema = z.object({\n success: z.boolean(),\n skillName: z.string(),\n installedPath: z.string(),\n filesWritten: z.number(),\n});\n\nexport const skillsShRemoveBodySchema = z.object({\n skillName: z.string().describe('Name of the installed skill to remove'),\n});\n\nexport const skillsShRemoveResponseSchema = z.object({\n success: z.boolean(),\n skillName: z.string(),\n removedPath: z.string(),\n});\n\nexport const skillsShUpdateBodySchema = z.object({\n skillName: z.string().optional().describe('Specific skill to update, or omit to update all'),\n});\n\nexport const skillsShUpdateResponseSchema = z.object({\n updated: z.array(\n z.object({\n skillName: z.string(),\n success: z.boolean(),\n filesWritten: z.number().optional(),\n error: z.string().optional(),\n }),\n ),\n});\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAwBA,MAAM,uBAAuBA,OAAAA,EAAE,YAAW,UAAS;CACjD,IAAI,UAAU,QAAQ,OAAO;CAC7B,IAAI,UAAU,SAAS,OAAO;CAC9B,OAAO;AACT,GAAGA,OAAAA,EAAE,QAAQ,CAAC;AAMd,MAAa,eAAeA,OAAAA,EAAE,OAAO,EACnC,MAAMA,OAAAA,EAAE,OAAO,CAAC,CAAC,SAAS,wBAAwB,EACpD,CAAC;AAED,MAAa,wBAAwBA,OAAAA,EAAE,OAAO,EAC5C,aAAaA,OAAAA,EAAE,OAAO,CAAC,CAAC,SAAS,cAAc,EACjD,CAAC;AAMD,MAAa,oBAAoBA,OAAAA,EAAE,OAAO;CACxC,MAAMA,OAAAA,EAAE,OAAO,CAAC,CAAC,SAAS,0BAA0B;CACpD,UAAUA,OAAAA,EAAE,OAAO,CAAC,CAAC,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AAED,MAAa,+BAA+BA,OAAAA,EAAE,OAAO;CACnD,SAASA,OAAAA,EAAE,QAAQ;CACnB,WAAWA,OAAAA,EAAE,OAAO;CACpB,aAAaA,OAAAA,EAAE,OAAO;AACxB,CAAC;AAED,MAAa,2BAA2BA,OAAAA,EAAE,OAAO,EAC/C,WAAWA,OAAAA,EAAE,OAAO,CAAC,CAAC,SAAS,CAAC,CAAC,SAAS,iDAAiD,EAC7F,CAAC;AAED,MAAa,+BAA+BA,OAAAA,EAAE,OAAO,EACnD,SAASA,OAAAA,EAAE,MACTA,OAAAA,EAAE,OAAO;CACP,WAAWA,OAAAA,EAAE,OAAO;CACpB,SAASA,OAAAA,EAAE,QAAQ;CACnB,cAAcA,OAAAA,EAAE,OAAO,CAAC,CAAC,SAAS;CAClC,OAAOA,OAAAA,EAAE,OAAO,CAAC,CAAC,SAAS;AAC7B,CAAC,CACH,EACF,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"workspace-CgIZRc2P.js","names":[],"sources":["../src/server/handlers/workspace.ts"],"sourcesContent":["/**\n * Workspace Handlers\n *\n * Unified handlers for workspace operations including:\n * - Filesystem operations (read, write, list, delete, mkdir, stat)\n * - Search operations (search, index)\n * - Skills operations (list, get, search, references)\n */\n\nimport { coreFeatures } from '@mastra/core/features';\nimport type { RequestContext } from '@mastra/core/request-context';\nimport type { Workspace, WorkspaceSkills, WorkspaceFilesystem, CompositeFilesystem } from '@mastra/core/workspace';\n\nimport { HTTPException } from '../http-exception';\nimport {\n // Workspace info\n workspaceInfoResponseSchema,\n listWorkspacesResponseSchema,\n workspaceIdPathParams,\n // Filesystem schemas\n fsReadQuerySchema,\n fsListQuerySchema,\n fsStatQuerySchema,\n fsDeleteQuerySchema,\n fsWriteBodySchema,\n fsMkdirBodySchema,\n fsReadResponseSchema,\n fsWriteResponseSchema,\n fsListResponseSchema,\n fsDeleteResponseSchema,\n fsMkdirResponseSchema,\n fsStatResponseSchema,\n // Search schemas\n searchQuerySchema,\n searchResponseSchema,\n indexBodySchema,\n indexResponseSchema,\n // Skills schemas\n skillNamePathParams,\n skillDisambiguationQuerySchema,\n skillReferencePathParams,\n searchSkillsQuerySchema,\n listSkillsResponseSchema,\n getSkillResponseSchema,\n skillReferenceResponseSchema,\n listReferencesResponseSchema,\n searchSkillsResponseSchema,\n // skills.sh proxy schemas\n skillsShSearchQuerySchema,\n skillsShPopularQuerySchema,\n skillsShSearchResponseSchema,\n skillsShListResponseSchema,\n skillsShPreviewQuerySchema,\n skillsShInstallBodySchema,\n skillsShInstallResponseSchema,\n skillsShPreviewResponseSchema,\n skillsShRemoveBodySchema,\n skillsShRemoveResponseSchema,\n skillsShUpdateBodySchema,\n skillsShUpdateResponseSchema,\n} from '../schemas/workspace';\nimport { createRoute } from '../server-adapter/routes/route-builder';\nimport { assertStoredAgentAccess, listAgentsVisibleTo } from './agent-access';\nimport { assertReadAccess } from './authorship';\nimport { handleError } from './error';\n\n// =============================================================================\n// Constants\n// =============================================================================\n\n/** Directory path for skills installed via skills.sh */\nconst SKILLS_SH_DIR = '.agents/skills';\n\n// =============================================================================\n// Helper Functions\n// =============================================================================\n\n/**\n * Runtime check for CompositeFilesystem using duck typing.\n * Uses a type-only import so older @mastra/core versions (< 1.3.0) work fine.\n */\nfunction isCompositeFilesystem(fs: unknown): fs is CompositeFilesystem {\n return !!fs && typeof fs === 'object' && 'mounts' in fs && fs.mounts instanceof Map;\n}\n\n/**\n * Check if an error is a workspace filesystem not-found error.\n * Handles Node.js ENOENT and workspace FileNotFoundError/DirectoryNotFoundError.\n */\nfunction isFilesystemNotFoundError(error: unknown): boolean {\n if (!error || typeof error !== 'object') return false;\n\n // Check for Node.js native ENOENT\n if ('code' in error && error.code === 'ENOENT') return true;\n\n // Check for workspace FileNotFoundError / DirectoryNotFoundError\n if ('name' in error) {\n const name = error.name;\n if (name === 'FileNotFoundError' || name === 'DirectoryNotFoundError') return true;\n }\n\n return false;\n}\n\n/**\n * Check if an error is a workspace filesystem permission error.\n * Handles Node.js EACCES and workspace PermissionError.\n */\nfunction isFilesystemPermissionError(error: unknown): boolean {\n if (!error || typeof error !== 'object') return false;\n\n if ('code' in error && error.code === 'EACCES') return true;\n\n if ('name' in error && error.name === 'PermissionError') return true;\n\n return false;\n}\n\n/**\n * Workspace-specific error handler.\n * Converts filesystem errors to appropriate HTTP status codes,\n * then falls back to generic handler.\n */\nfunction handleWorkspaceError(error: unknown, defaultMessage: string): never {\n if (isFilesystemNotFoundError(error)) {\n const message = error instanceof Error ? error.message : 'Not found';\n throw new HTTPException(404, { message });\n }\n if (isFilesystemPermissionError(error)) {\n const message = error instanceof Error ? error.message : 'Permission denied';\n throw new HTTPException(403, { message });\n }\n return handleError(error, defaultMessage);\n}\n\n/**\n * Throws if workspace v1 is not supported by the current version of @mastra/core.\n */\nfunction requireWorkspaceV1Support(): void {\n if (!coreFeatures.has('workspaces-v1')) {\n throw new HTTPException(501, {\n message: 'Workspace v1 not supported by this version of @mastra/core. Please upgrade to a newer version.',\n });\n }\n}\n\n/**\n * Get a workspace by ID from Mastra's workspace registry.\n *\n * Backwards compatible: Falls back to searching through agents if\n * mastra.getWorkspaceById() is not available (older @mastra/core versions).\n */\nasync function getWorkspaceById(\n mastra: any,\n workspaceId: string,\n requestContext: RequestContext,\n): Promise<Workspace | undefined> {\n requireWorkspaceV1Support();\n\n // Check if the global workspace matches\n const globalWorkspace = mastra.getWorkspace?.();\n if (globalWorkspace?.id === workspaceId) {\n return globalWorkspace;\n }\n\n // Try direct registry lookup if available (newer @mastra/core versions)\n if (typeof mastra.getWorkspaceById === 'function') {\n let workspace: Workspace | undefined;\n try {\n // `optional` skips the error log on a miss; older cores ignore it and throw instead.\n workspace = mastra.getWorkspaceById(workspaceId, { optional: true });\n } catch {\n // Workspace not found in registry\n return undefined;\n }\n if (!workspace) return undefined;\n // A stored agent's workspace is as private as the agent: treat it as missing for callers who can't see the agent.\n const entry = typeof mastra.listWorkspaces === 'function' ? mastra.listWorkspaces()[workspaceId] : undefined;\n if (entry?.source === 'agent' && entry.agentId) {\n if (\n !(await isAgentWorkspaceVisible(\n mastra,\n { agentId: entry.agentId, agentSource: entry.agentSource },\n requestContext,\n ))\n )\n return undefined;\n }\n return workspace;\n }\n\n // Fallback: Search through agents for the workspace (older @mastra/core versions)\n const agents = listAgentsVisibleTo(mastra.listAgents?.(), requestContext);\n for (const agent of Object.values(agents)) {\n if ((agent as any).hasOwnWorkspace?.()) {\n const agentWorkspace = await (agent as any).getWorkspace?.();\n if (agentWorkspace?.id === workspaceId) {\n return agentWorkspace;\n }\n }\n }\n\n return undefined;\n}\n\n/**\n * Get skills from a specific workspace by ID.\n * Note: getWorkspaceById already checks for workspace v1 support.\n */\nasync function getSkillsById(\n mastra: any,\n workspaceId: string,\n requestContext: RequestContext,\n): Promise<WorkspaceSkills | undefined> {\n const workspace = await getWorkspaceById(mastra, workspaceId, requestContext);\n return workspace?.skills;\n}\n\n/**\n * Agents register their workspace once used, so a registered workspace can belong to a stored agent the caller can't\n * see. Editing a stored agent unregisters it from Mastra but leaves its workspace registered, so an agent that isn't\n * registered is checked against its stored record. With no record, a workspace a stored agent registered is hidden:\n * its agent was deleted, and an async workspace factory can still register it after the delete's cleanup. Lookup\n * errors hide the workspace.\n */\nasync function isAgentWorkspaceVisible(\n mastra: any,\n entry: { agentId: string; agentSource?: string },\n requestContext: RequestContext,\n): Promise<boolean> {\n const { agentId } = entry;\n try {\n let agent;\n try {\n agent = mastra.getAgentById(agentId);\n } catch {\n agent = undefined;\n }\n if (agent) {\n assertStoredAgentAccess({ agent, agentId, requestContext, access: 'read' });\n return true;\n }\n const agentsStore = await mastra.getStorage()?.getStore('agents');\n const record = await agentsStore?.getById(agentId);\n if (record) {\n assertReadAccess({ requestContext, resource: 'stored-agents', resourceId: agentId, record });\n return true;\n }\n return entry.agentSource !== 'stored';\n } catch {\n return false;\n }\n}\n\n/**\n * Build the install path for a skill from skills.sh.\n *\n * For CompositeFilesystem: resolves the requested mount (or first writable),\n * validates it is writable, and returns `<mount>/.agents/skills/<skillId>`.\n * For non-composite: returns `.agents/skills/<skillId>` (unchanged behavior).\n */\n/** Strip a single trailing slash (leaves `/` alone). */\nfunction stripTrailingSlash(p: string): string {\n return p.length > 1 && p.endsWith('/') ? p.slice(0, -1) : p;\n}\n\nfunction buildSkillInstallPath(filesystem: WorkspaceFilesystem, safeSkillId: string, requestedMount?: string): string {\n if (isCompositeFilesystem(filesystem)) {\n if (requestedMount) {\n // Validate the requested mount exists\n const mountFs = filesystem.mounts.get(requestedMount);\n if (!mountFs) {\n throw new HTTPException(400, {\n message: `Mount \"${requestedMount}\" not found. Available mounts: ${filesystem.mountPaths.join(', ')}`,\n });\n }\n if (mountFs.readOnly) {\n throw new HTTPException(403, { message: `Mount \"${requestedMount}\" is read-only` });\n }\n return `${stripTrailingSlash(requestedMount)}/${SKILLS_SH_DIR}/${safeSkillId}`;\n }\n\n // Default: use first writable mount\n for (const [mountPath, mountFs] of filesystem.mounts) {\n if (!mountFs.readOnly) {\n return `${stripTrailingSlash(mountPath)}/${SKILLS_SH_DIR}/${safeSkillId}`;\n }\n }\n\n throw new HTTPException(403, { message: 'No writable mount available for skill installation' });\n }\n\n // Non-composite: standard path\n return `${SKILLS_SH_DIR}/${safeSkillId}`;\n}\n\n// =============================================================================\n// List All Workspaces Route\n// =============================================================================\n\nexport const LIST_WORKSPACES_ROUTE = createRoute({\n method: 'GET',\n path: '/workspaces',\n responseType: 'json',\n responseSchema: listWorkspacesResponseSchema,\n summary: 'List all workspaces',\n description: 'Returns all workspaces from both Mastra instance and agents',\n tags: ['Workspace'],\n handler: async ({ mastra, requestContext }) => {\n try {\n requireWorkspaceV1Support();\n\n const workspaces: Array<{\n id: string;\n name: string;\n status: string;\n source: 'mastra' | 'agent';\n agentId?: string;\n agentName?: string;\n capabilities: {\n hasFilesystem: boolean;\n hasDynamicFilesystem: boolean;\n hasSandbox: boolean;\n canBM25: boolean;\n canVector: boolean;\n canHybrid: boolean;\n hasSkills: boolean;\n };\n safety: {\n readOnly: boolean;\n };\n }> = [];\n\n // Prefer the workspace registry if available (duck-type check for newer @mastra/core).\n // This avoids calling dynamic workspace functions without proper request context.\n // Dynamic workspaces get lazily registered during agent execution (stream/generate).\n if (typeof mastra.listWorkspaces === 'function') {\n const registeredWorkspaces = mastra.listWorkspaces();\n\n for (const [, entry] of Object.entries(registeredWorkspaces)) {\n // Newer @mastra/core returns { workspace, source, agentId?, agentName? }.\n // Older versions return a bare Workspace object — detect via duck-typing.\n const ws: Workspace = (entry as any).workspace ?? entry;\n const source: 'mastra' | 'agent' = (entry as any).source ?? 'mastra';\n const agentId: string | undefined = (entry as any).agentId;\n const agentName: string | undefined = (entry as any).agentName;\n // Agents register their workspace here once used; skip those of stored agents the caller can't see.\n const agentSource: string | undefined = (entry as any).agentSource;\n if (\n source === 'agent' &&\n agentId &&\n !(await isAgentWorkspaceVisible(mastra, { agentId, agentSource }, requestContext))\n ) {\n continue;\n }\n\n workspaces.push({\n id: ws.id,\n name: ws.name,\n status: ws.status,\n source,\n ...(source === 'agent' && agentId ? { agentId, ...(agentName != null ? { agentName } : {}) } : {}),\n capabilities: {\n hasFilesystem: ws.hasFilesystemConfig(),\n hasDynamicFilesystem: !ws.filesystem && ws.hasFilesystemConfig(),\n hasSandbox: ws.hasSandboxConfig(),\n canBM25: ws.canBM25,\n canVector: ws.canVector,\n canHybrid: ws.canHybrid,\n hasSkills: !!ws.skills,\n },\n safety: {\n readOnly: ws.filesystem?.readOnly ?? false,\n },\n });\n }\n } else {\n // Fallback for older @mastra/core without workspace registry:\n // Check global workspace and loop through agents\n const seenIds = new Set<string>();\n const globalWorkspace = mastra.getWorkspace?.();\n if (globalWorkspace) {\n seenIds.add(globalWorkspace.id);\n workspaces.push({\n id: globalWorkspace.id,\n name: globalWorkspace.name,\n status: globalWorkspace.status,\n source: 'mastra',\n capabilities: {\n hasFilesystem: globalWorkspace.hasFilesystemConfig(),\n hasDynamicFilesystem: !globalWorkspace.filesystem && globalWorkspace.hasFilesystemConfig(),\n hasSandbox: globalWorkspace.hasSandboxConfig(),\n canBM25: globalWorkspace.canBM25,\n canVector: globalWorkspace.canVector,\n canHybrid: globalWorkspace.canHybrid,\n hasSkills: !!globalWorkspace.skills,\n },\n safety: {\n readOnly: globalWorkspace.filesystem?.readOnly ?? false,\n },\n });\n }\n\n const agents = listAgentsVisibleTo(mastra.listAgents?.(), requestContext);\n for (const [agentId, agent] of Object.entries(agents)) {\n if ((agent as any).hasOwnWorkspace?.()) {\n try {\n const agentWorkspace = await (agent as any).getWorkspace?.();\n if (agentWorkspace && !seenIds.has(agentWorkspace.id)) {\n seenIds.add(agentWorkspace.id);\n workspaces.push({\n id: agentWorkspace.id,\n name: agentWorkspace.name,\n status: agentWorkspace.status,\n source: 'agent',\n agentId,\n agentName: (agent as any).name,\n capabilities: {\n hasFilesystem: agentWorkspace.hasFilesystemConfig(),\n hasDynamicFilesystem: !agentWorkspace.filesystem && agentWorkspace.hasFilesystemConfig(),\n hasSandbox: agentWorkspace.hasSandboxConfig(),\n canBM25: agentWorkspace.canBM25,\n canVector: agentWorkspace.canVector,\n canHybrid: agentWorkspace.canHybrid,\n hasSkills: !!agentWorkspace.skills,\n },\n safety: {\n readOnly: agentWorkspace.filesystem?.readOnly ?? false,\n },\n });\n }\n } catch {\n continue;\n }\n }\n }\n }\n\n return { workspaces };\n } catch (error) {\n return handleWorkspaceError(error, 'Error listing workspaces');\n }\n },\n});\n\n// =============================================================================\n// Get Workspace Route\n// =============================================================================\n\nexport const GET_WORKSPACE_ROUTE = createRoute({\n method: 'GET',\n path: '/workspaces/:workspaceId',\n responseType: 'json',\n pathParamSchema: workspaceIdPathParams,\n responseSchema: workspaceInfoResponseSchema,\n summary: 'Get workspace info',\n description: 'Returns information about a specific workspace and its capabilities',\n tags: ['Workspace'],\n handler: async ({ mastra, requestContext, workspaceId }) => {\n try {\n const workspace = await getWorkspaceById(mastra, workspaceId, requestContext);\n\n if (!workspace) {\n return {\n isWorkspaceConfigured: false,\n };\n }\n\n const fsInfo = await workspace.filesystem?.getInfo?.();\n\n // Build mounts array for CompositeFilesystem\n let mounts:\n | Array<{\n path: string;\n provider: string;\n readOnly: boolean;\n displayName?: string;\n icon?: string;\n name?: string;\n }>\n | undefined;\n\n if (isCompositeFilesystem(workspace.filesystem)) {\n mounts = [];\n for (const [mountPath, mountFs] of workspace.filesystem.mounts) {\n try {\n const info = await mountFs.getInfo?.();\n mounts.push({\n path: mountPath,\n provider: info?.provider ?? mountFs.provider ?? 'unknown',\n readOnly: mountFs.readOnly ?? false,\n displayName: mountFs.displayName ?? info?.name ?? mountFs.name,\n icon: info?.icon,\n name: mountFs.name,\n });\n } catch {\n mounts.push({\n path: mountPath,\n provider: mountFs.provider ?? 'unknown',\n readOnly: mountFs.readOnly ?? true,\n name: mountFs.name,\n });\n }\n }\n }\n\n return {\n isWorkspaceConfigured: true,\n id: workspace.id,\n name: workspace.name,\n status: workspace.status,\n capabilities: {\n hasFilesystem: workspace.hasFilesystemConfig(),\n hasDynamicFilesystem: !workspace.filesystem && workspace.hasFilesystemConfig(),\n hasSandbox: workspace.hasSandboxConfig(),\n canBM25: workspace.canBM25,\n canVector: workspace.canVector,\n canHybrid: workspace.canHybrid,\n hasSkills: !!workspace.skills,\n },\n safety: {\n readOnly: workspace.filesystem?.readOnly ?? false,\n },\n filesystem: fsInfo\n ? {\n id: fsInfo.id,\n name: fsInfo.name,\n provider: fsInfo.provider,\n status: fsInfo.status,\n error: fsInfo.error,\n readOnly: fsInfo.readOnly,\n icon: fsInfo.icon,\n metadata: fsInfo.metadata,\n }\n : undefined,\n mounts,\n };\n } catch (error) {\n return handleWorkspaceError(error, 'Error getting workspace info');\n }\n },\n});\n\n// =============================================================================\n// Filesystem Routes\n// =============================================================================\n\nexport const WORKSPACE_FS_READ_ROUTE = createRoute({\n method: 'GET',\n path: '/workspaces/:workspaceId/fs/read',\n responseType: 'json',\n pathParamSchema: workspaceIdPathParams,\n queryParamSchema: fsReadQuerySchema,\n responseSchema: fsReadResponseSchema,\n summary: 'Read file content',\n description: 'Returns the content of a file at the specified path',\n tags: ['Workspace'],\n handler: async ({ mastra, requestContext, path, encoding, workspaceId }) => {\n try {\n requireWorkspaceV1Support();\n\n if (!path) {\n throw new HTTPException(400, { message: 'Path is required' });\n }\n\n const workspace = await getWorkspaceById(mastra, workspaceId, requestContext);\n if (!workspace?.filesystem) {\n throw new HTTPException(404, { message: 'No workspace filesystem configured' });\n }\n\n const decodedPath = path;\n\n // Check if path exists\n if (!(await workspace.filesystem.exists(decodedPath))) {\n throw new HTTPException(404, { message: `Path \"${decodedPath}\" not found` });\n }\n\n // Read file content\n const content = await workspace.filesystem.readFile(decodedPath, {\n encoding: (encoding as BufferEncoding) || 'utf-8',\n });\n\n return {\n path: decodedPath,\n content: typeof content === 'string' ? content : content.toString('utf-8'),\n type: 'file' as const,\n };\n } catch (error) {\n return handleWorkspaceError(error, 'Error reading file');\n }\n },\n});\n\nexport const WORKSPACE_FS_WRITE_ROUTE = createRoute({\n method: 'POST',\n path: '/workspaces/:workspaceId/fs/write',\n responseType: 'json',\n pathParamSchema: workspaceIdPathParams,\n bodySchema: fsWriteBodySchema,\n responseSchema: fsWriteResponseSchema,\n summary: 'Write file content',\n description: 'Writes content to a file at the specified path. Supports base64 encoding for binary files.',\n tags: ['Workspace'],\n handler: async ({ mastra, requestContext, path, content, encoding, recursive, workspaceId }) => {\n try {\n requireWorkspaceV1Support();\n\n if (!path || content === undefined) {\n throw new HTTPException(400, { message: 'Path and content are required' });\n }\n\n const workspace = await getWorkspaceById(mastra, workspaceId, requestContext);\n if (!workspace?.filesystem) {\n throw new HTTPException(404, { message: 'No workspace filesystem configured' });\n }\n\n if (workspace.filesystem?.readOnly) {\n throw new HTTPException(403, { message: 'Workspace is in read-only mode' });\n }\n\n const decodedPath = path;\n\n // Handle base64-encoded content for binary files\n let fileContent: string | Buffer = content;\n if (encoding === 'base64') {\n fileContent = Buffer.from(content, 'base64');\n }\n\n await workspace.filesystem.writeFile(decodedPath, fileContent, { recursive: recursive ?? true });\n\n return {\n success: true,\n path: decodedPath,\n };\n } catch (error) {\n return handleWorkspaceError(error, 'Error writing file');\n }\n },\n});\n\nexport const WORKSPACE_FS_LIST_ROUTE = createRoute({\n method: 'GET',\n path: '/workspaces/:workspaceId/fs/list',\n responseType: 'json',\n pathParamSchema: workspaceIdPathParams,\n queryParamSchema: fsListQuerySchema,\n responseSchema: fsListResponseSchema,\n summary: 'List directory contents',\n description: 'Returns a list of files and directories at the specified path',\n tags: ['Workspace'],\n handler: async ({ mastra, requestContext, path, recursive, workspaceId }) => {\n try {\n requireWorkspaceV1Support();\n\n if (!path) {\n throw new HTTPException(400, { message: 'Path is required' });\n }\n\n const workspace = await getWorkspaceById(mastra, workspaceId, requestContext);\n if (!workspace?.filesystem) {\n return {\n path,\n entries: [],\n error: 'No workspace filesystem configured',\n };\n }\n\n const decodedPath = path;\n\n // Check if path exists\n if (!(await workspace.filesystem.exists(decodedPath))) {\n throw new HTTPException(404, { message: `Path \"${decodedPath}\" not found` });\n }\n\n const entries = await workspace.filesystem.readdir(decodedPath, { recursive });\n\n return {\n path: decodedPath,\n entries,\n };\n } catch (error) {\n return handleWorkspaceError(error, 'Error listing directory');\n }\n },\n});\n\nexport const WORKSPACE_FS_DELETE_ROUTE = createRoute({\n method: 'DELETE',\n path: '/workspaces/:workspaceId/fs/delete',\n responseType: 'json',\n pathParamSchema: workspaceIdPathParams,\n queryParamSchema: fsDeleteQuerySchema,\n responseSchema: fsDeleteResponseSchema,\n summary: 'Delete file or directory',\n description: 'Deletes a file or directory at the specified path',\n tags: ['Workspace'],\n handler: async ({ mastra, requestContext, path, recursive, force, workspaceId }) => {\n try {\n requireWorkspaceV1Support();\n\n if (!path) {\n throw new HTTPException(400, { message: 'Path is required' });\n }\n\n const workspace = await getWorkspaceById(mastra, workspaceId, requestContext);\n if (!workspace?.filesystem) {\n throw new HTTPException(404, { message: 'No workspace filesystem configured' });\n }\n\n if (workspace.filesystem?.readOnly) {\n throw new HTTPException(403, { message: 'Workspace is in read-only mode' });\n }\n\n const decodedPath = path;\n\n // Check if path exists (unless force is true)\n const exists = await workspace.filesystem.exists(decodedPath);\n if (!exists && !force) {\n throw new HTTPException(404, { message: `Path \"${decodedPath}\" not found` });\n }\n\n if (exists) {\n // Try to delete as file first, then as directory\n try {\n await workspace.filesystem.deleteFile(decodedPath, { force });\n } catch {\n await workspace.filesystem.rmdir(decodedPath, { recursive, force });\n }\n }\n\n return {\n success: true,\n path: decodedPath,\n };\n } catch (error) {\n return handleWorkspaceError(error, 'Error deleting path');\n }\n },\n});\n\nexport const WORKSPACE_FS_MKDIR_ROUTE = createRoute({\n method: 'POST',\n path: '/workspaces/:workspaceId/fs/mkdir',\n responseType: 'json',\n pathParamSchema: workspaceIdPathParams,\n bodySchema: fsMkdirBodySchema,\n responseSchema: fsMkdirResponseSchema,\n summary: 'Create directory',\n description: 'Creates a directory at the specified path',\n tags: ['Workspace'],\n handler: async ({ mastra, requestContext, path, recursive, workspaceId }) => {\n try {\n requireWorkspaceV1Support();\n\n if (!path) {\n throw new HTTPException(400, { message: 'Path is required' });\n }\n\n const workspace = await getWorkspaceById(mastra, workspaceId, requestContext);\n if (!workspace?.filesystem) {\n throw new HTTPException(404, { message: 'No workspace filesystem configured' });\n }\n\n if (workspace.filesystem?.readOnly) {\n throw new HTTPException(403, { message: 'Workspace is in read-only mode' });\n }\n\n const decodedPath = path;\n\n await workspace.filesystem.mkdir(decodedPath, { recursive: recursive ?? true });\n\n return {\n success: true,\n path: decodedPath,\n };\n } catch (error) {\n return handleWorkspaceError(error, 'Error creating directory');\n }\n },\n});\n\nexport const WORKSPACE_FS_STAT_ROUTE = createRoute({\n method: 'GET',\n path: '/workspaces/:workspaceId/fs/stat',\n responseType: 'json',\n pathParamSchema: workspaceIdPathParams,\n queryParamSchema: fsStatQuerySchema,\n responseSchema: fsStatResponseSchema,\n summary: 'Get file/directory info',\n description: 'Returns metadata about a file or directory',\n tags: ['Workspace'],\n handler: async ({ mastra, requestContext, path, workspaceId }) => {\n try {\n requireWorkspaceV1Support();\n\n if (!path) {\n throw new HTTPException(400, { message: 'Path is required' });\n }\n\n const workspace = await getWorkspaceById(mastra, workspaceId, requestContext);\n if (!workspace?.filesystem) {\n throw new HTTPException(404, { message: 'No workspace filesystem configured' });\n }\n\n const decodedPath = path;\n\n // Check if path exists\n if (!(await workspace.filesystem.exists(decodedPath))) {\n throw new HTTPException(404, { message: `Path \"${decodedPath}\" not found` });\n }\n\n const stat = await workspace.filesystem.stat(decodedPath);\n\n return {\n path: stat.path,\n type: stat.type,\n size: stat.size,\n createdAt: stat.createdAt?.toISOString(),\n modifiedAt: stat.modifiedAt?.toISOString(),\n mimeType: stat.mimeType,\n };\n } catch (error) {\n return handleWorkspaceError(error, 'Error getting file info');\n }\n },\n});\n\n// =============================================================================\n// Search Routes\n// =============================================================================\n\nexport const WORKSPACE_SEARCH_ROUTE = createRoute({\n method: 'GET',\n path: '/workspaces/:workspaceId/search',\n responseType: 'json',\n pathParamSchema: workspaceIdPathParams,\n queryParamSchema: searchQuerySchema,\n responseSchema: searchResponseSchema,\n summary: 'Search workspace content',\n description: 'Searches across indexed workspace content using BM25, vector, or hybrid search',\n tags: ['Workspace'],\n handler: async ({ mastra, requestContext, query, topK, mode, minScore, workspaceId }) => {\n try {\n requireWorkspaceV1Support();\n\n if (!query) {\n throw new HTTPException(400, { message: 'Search query is required' });\n }\n\n const workspace = await getWorkspaceById(mastra, workspaceId, requestContext);\n if (!workspace) {\n return {\n results: [],\n query,\n mode: mode || 'bm25',\n };\n }\n\n // Check search capabilities\n const canSearch = workspace.canBM25 || workspace.canVector;\n if (!canSearch) {\n return {\n results: [],\n query,\n mode: mode || 'bm25',\n };\n }\n\n // Determine search mode based on capabilities\n let searchMode = mode;\n if (!searchMode) {\n if (workspace.canHybrid) {\n searchMode = 'hybrid';\n } else if (workspace.canVector) {\n searchMode = 'vector';\n } else {\n searchMode = 'bm25';\n }\n }\n\n const results = await workspace.search(query, {\n topK: topK || 5,\n mode: searchMode,\n minScore,\n });\n\n return {\n results: results.map(r => ({\n id: r.id,\n content: r.content,\n score: r.score,\n lineRange: r.lineRange,\n scoreDetails: r.scoreDetails,\n })),\n query,\n mode: searchMode,\n };\n } catch (error) {\n return handleWorkspaceError(error, 'Error searching workspace');\n }\n },\n});\n\nexport const WORKSPACE_INDEX_ROUTE = createRoute({\n method: 'POST',\n path: '/workspaces/:workspaceId/index',\n responseType: 'json',\n pathParamSchema: workspaceIdPathParams,\n bodySchema: indexBodySchema,\n responseSchema: indexResponseSchema,\n summary: 'Index content for search',\n description: 'Indexes content for later search operations',\n tags: ['Workspace'],\n handler: async ({ mastra, requestContext, path, content, metadata, workspaceId }) => {\n try {\n requireWorkspaceV1Support();\n\n if (!path || content === undefined) {\n throw new HTTPException(400, { message: 'Path and content are required' });\n }\n\n const workspace = await getWorkspaceById(mastra, workspaceId, requestContext);\n if (!workspace) {\n throw new HTTPException(404, { message: 'No workspace configured' });\n }\n\n const canSearch = workspace.canBM25 || workspace.canVector;\n if (!canSearch) {\n throw new HTTPException(400, { message: 'Workspace does not have search configured' });\n }\n\n await workspace.index(path, content, { metadata });\n\n return {\n success: true,\n path,\n };\n } catch (error) {\n return handleWorkspaceError(error, 'Error indexing content');\n }\n },\n});\n\n// =============================================================================\n// Skills Routes (under /workspaces/:workspaceId/skills)\n// =============================================================================\n\n/** Path prefix for skills installed via skills.sh (with trailing slash for prefix matching) */\nconst SKILLS_SH_PATH_PREFIX = `${SKILLS_SH_DIR}/`;\n\nexport const WORKSPACE_LIST_SKILLS_ROUTE = createRoute({\n method: 'GET',\n path: '/workspaces/:workspaceId/skills',\n responseType: 'json',\n pathParamSchema: workspaceIdPathParams,\n responseSchema: listSkillsResponseSchema,\n summary: 'List all skills',\n description: 'Returns a list of all discovered skills with their metadata',\n tags: ['Workspace', 'Skills'],\n handler: async ({ mastra, workspaceId, requestContext }) => {\n try {\n requireWorkspaceV1Support();\n\n const workspace = await getWorkspaceById(mastra, workspaceId, requestContext);\n const skills = workspace?.skills;\n if (!skills) {\n return { skills: [], isSkillsConfigured: false };\n }\n\n // Refresh skills with request context (handles dynamic skill resolvers)\n await skills.maybeRefresh({ requestContext });\n\n const skillsList = await skills.list();\n\n // Enrich skills with skills.sh source info where applicable\n const enrichedSkills = await Promise.all(\n skillsList.map(async skillMeta => {\n let skillsShSource: { owner: string; repo: string } | undefined;\n\n // For skills installed via skills.sh, read source info from .meta.json.\n // Uses includes() because glob-discovered paths may have a leading slash\n // or be nested (e.g., '/.agents/skills/foo', '/src/.agents/skills/foo').\n if (skillMeta.path.includes(SKILLS_SH_PATH_PREFIX) && workspace.filesystem) {\n try {\n const metaPath = `${skillMeta.path}/.meta.json`;\n const metaContent = await workspace.filesystem.readFile(metaPath);\n const metaText = typeof metaContent === 'string' ? metaContent : metaContent.toString('utf-8');\n const meta = JSON.parse(metaText) as { owner?: string; repo?: string };\n if (meta.owner && meta.repo) {\n skillsShSource = { owner: meta.owner, repo: meta.repo };\n }\n } catch {\n // .meta.json might not exist or be invalid - that's ok\n }\n }\n\n return {\n name: skillMeta.name,\n description: skillMeta.description,\n license: skillMeta.license,\n compatibility: skillMeta.compatibility,\n metadata: skillMeta.metadata,\n path: skillMeta.path,\n skillsShSource,\n };\n }),\n );\n\n return {\n skills: enrichedSkills,\n isSkillsConfigured: true,\n };\n } catch (error) {\n return handleWorkspaceError(error, 'Error listing skills');\n }\n },\n});\n\nexport const WORKSPACE_GET_SKILL_ROUTE = createRoute({\n method: 'GET',\n path: '/workspaces/:workspaceId/skills/:skillName',\n responseType: 'json',\n pathParamSchema: skillNamePathParams,\n queryParamSchema: skillDisambiguationQuerySchema,\n responseSchema: getSkillResponseSchema,\n summary: 'Get skill details',\n description: 'Returns the full details of a specific skill including instructions and file lists',\n tags: ['Workspace', 'Skills'],\n handler: async ({ mastra, skillName, path, workspaceId, requestContext }) => {\n try {\n requireWorkspaceV1Support();\n\n if (!skillName) {\n throw new HTTPException(400, { message: 'Skill name is required' });\n }\n\n // Use the optional ?path= query param for disambiguation, otherwise fall back to name\n const identifier = path ?? skillName;\n\n const skills = await getSkillsById(mastra, workspaceId, requestContext);\n if (!skills) {\n throw new HTTPException(404, { message: 'No workspace with skills configured' });\n }\n\n // Refresh skills with request context (handles dynamic skill resolvers)\n await skills.maybeRefresh({ requestContext });\n\n const skill = await skills.get(identifier);\n if (!skill) {\n throw new HTTPException(404, { message: `Skill \"${identifier}\" not found` });\n }\n\n return {\n name: skill.name,\n description: skill.description,\n license: skill.license,\n compatibility: skill.compatibility,\n metadata: skill.metadata,\n path: skill.path,\n instructions: skill.instructions,\n source: skill.source,\n references: skill.references,\n scripts: skill.scripts,\n assets: skill.assets,\n };\n } catch (error) {\n return handleWorkspaceError(error, 'Error getting skill');\n }\n },\n});\n\nexport const WORKSPACE_LIST_SKILL_REFERENCES_ROUTE = createRoute({\n method: 'GET',\n path: '/workspaces/:workspaceId/skills/:skillName/references',\n responseType: 'json',\n pathParamSchema: skillNamePathParams,\n queryParamSchema: skillDisambiguationQuerySchema,\n responseSchema: listReferencesResponseSchema,\n summary: 'List skill references',\n description: 'Returns a list of all reference file paths for a skill',\n tags: ['Workspace', 'Skills'],\n handler: async ({ mastra, skillName, path, workspaceId, requestContext }) => {\n try {\n requireWorkspaceV1Support();\n\n if (!skillName) {\n throw new HTTPException(400, { message: 'Skill name is required' });\n }\n\n // Use the optional ?path= query param for disambiguation, otherwise fall back to name\n const identifier = path ?? skillName;\n\n const skills = await getSkillsById(mastra, workspaceId, requestContext);\n if (!skills) {\n throw new HTTPException(404, { message: 'No workspace with skills configured' });\n }\n\n // Refresh skills with request context (handles dynamic skill resolvers)\n await skills.maybeRefresh({ requestContext });\n\n const skill = await skills.get(identifier);\n if (!skill) {\n throw new HTTPException(404, { message: `Skill \"${identifier}\" not found` });\n }\n\n const references = await skills.listReferences(identifier);\n\n return {\n skillName: skill.name,\n references,\n };\n } catch (error) {\n return handleWorkspaceError(error, 'Error listing skill references');\n }\n },\n});\n\nexport const WORKSPACE_GET_SKILL_REFERENCE_ROUTE = createRoute({\n method: 'GET',\n path: '/workspaces/:workspaceId/skills/:skillName/references/:referencePath',\n responseType: 'json',\n pathParamSchema: skillReferencePathParams,\n queryParamSchema: skillDisambiguationQuerySchema,\n responseSchema: skillReferenceResponseSchema,\n summary: 'Get skill reference content',\n description: 'Returns the content of a specific reference file from a skill',\n tags: ['Workspace', 'Skills'],\n handler: async ({ mastra, skillName, path: skillPath, referencePath, workspaceId, requestContext }) => {\n try {\n requireWorkspaceV1Support();\n\n // Use the optional ?path= query param for disambiguation, otherwise fall back to name\n const identifier = skillPath ?? skillName;\n\n const skills = await getSkillsById(mastra, workspaceId, requestContext);\n if (!skills) {\n throw new HTTPException(404, { message: 'No workspace with skills configured' });\n }\n\n // Refresh skills with request context (handles dynamic skill resolvers)\n await skills.maybeRefresh({ requestContext });\n\n // Resolve skill to get its name for the response\n const skill = await skills.get(identifier);\n if (!skill) {\n throw new HTTPException(404, { message: `Skill \"${identifier}\" not found` });\n }\n\n const decodedPath = referencePath;\n\n // Prevent path traversal via the reference path parameter\n assertSafeFilePath(decodedPath);\n\n // getReference expects a path relative to skill.path, so prepend 'references/'\n // since the URL path already contains the literal /references/ segment\n const content = await skills.getReference(identifier, `references/${decodedPath}`);\n if (content === null) {\n throw new HTTPException(404, {\n message: `Reference \"${decodedPath}\" not found in skill \"${identifier}\"`,\n });\n }\n\n return {\n skillName: skill.name,\n referencePath: decodedPath,\n content,\n };\n } catch (error) {\n return handleWorkspaceError(error, 'Error getting skill reference');\n }\n },\n});\n\nexport const WORKSPACE_SEARCH_SKILLS_ROUTE = createRoute({\n method: 'GET',\n path: '/workspaces/:workspaceId/skills/search',\n responseType: 'json',\n pathParamSchema: workspaceIdPathParams,\n queryParamSchema: searchSkillsQuerySchema,\n responseSchema: searchSkillsResponseSchema,\n summary: 'Search skills',\n description: 'Searches across all skills content using BM25 keyword search',\n tags: ['Workspace', 'Skills'],\n handler: async ({ mastra, query, topK, minScore, skillNames, includeReferences, workspaceId, requestContext }) => {\n try {\n requireWorkspaceV1Support();\n\n if (!query) {\n throw new HTTPException(400, { message: 'Search query is required' });\n }\n\n const skills = await getSkillsById(mastra, workspaceId, requestContext);\n if (!skills) {\n return {\n results: [],\n query,\n };\n }\n\n // Refresh skills with request context (handles dynamic skill resolvers)\n await skills.maybeRefresh({ requestContext });\n\n // Parse comma-separated skill names if provided\n const skillNamesList = skillNames ? skillNames.split(',').map((s: string) => s.trim()) : undefined;\n\n const results = await skills.search(query, {\n topK: topK || 5,\n minScore,\n skillNames: skillNamesList,\n includeReferences: includeReferences ?? true,\n });\n\n return {\n results: results.map(r => ({\n skillName: r.skillName,\n skillPath: r.skillPath,\n source: r.source,\n content: r.content,\n score: r.score,\n lineRange: r.lineRange,\n scoreDetails: r.scoreDetails,\n })),\n query,\n };\n } catch (error) {\n return handleWorkspaceError(error, 'Error searching skills');\n }\n },\n});\n\n// =============================================================================\n// skills.sh Proxy Routes\n// =============================================================================\n\nconst SKILLS_SH_API_URL = 'https://skills-api-production.up.railway.app';\n\nexport const WORKSPACE_SKILLS_SH_SEARCH_ROUTE = createRoute({\n method: 'GET',\n path: '/workspaces/:workspaceId/skills-sh/search',\n responseType: 'json',\n pathParamSchema: workspaceIdPathParams,\n queryParamSchema: skillsShSearchQuerySchema,\n responseSchema: skillsShSearchResponseSchema,\n summary: 'Search skills on skills.sh',\n description: 'Proxies search requests to skills.sh API to avoid CORS issues',\n tags: ['Workspace', 'Skills'],\n handler: async ({ q, limit }) => {\n try {\n const controller = new AbortController();\n const timeoutId = setTimeout(() => controller.abort(), 10000);\n\n const url = `${SKILLS_SH_API_URL}/api/skills?query=${encodeURIComponent(q)}&pageSize=${limit}`;\n const response = await fetch(url, { signal: controller.signal });\n clearTimeout(timeoutId);\n\n if (!response.ok) {\n throw new HTTPException(502, {\n message: `Skills API error: ${response.status} ${response.statusText}`,\n });\n }\n\n const data = (await response.json()) as {\n skills: Array<{\n skillId: string;\n name: string;\n installs: number;\n source: string;\n owner: string;\n repo: string;\n githubUrl: string;\n displayName: string;\n }>;\n total: number;\n page: number;\n pageSize: number;\n totalPages: number;\n };\n return {\n query: q,\n searchType: 'query',\n skills: data.skills.map(s => ({ id: s.skillId, name: s.name, installs: s.installs, topSource: s.source })),\n count: data.total,\n };\n } catch (error) {\n if (error instanceof HTTPException) {\n throw error;\n }\n return handleError(error, 'Error searching skills');\n }\n },\n});\n\nexport const WORKSPACE_SKILLS_SH_POPULAR_ROUTE = createRoute({\n method: 'GET',\n path: '/workspaces/:workspaceId/skills-sh/popular',\n responseType: 'json',\n pathParamSchema: workspaceIdPathParams,\n queryParamSchema: skillsShPopularQuerySchema,\n responseSchema: skillsShListResponseSchema,\n summary: 'Get popular skills from skills.sh',\n description: 'Proxies popular skills requests to skills.sh API to avoid CORS issues',\n tags: ['Workspace', 'Skills'],\n handler: async ({ limit, offset }) => {\n try {\n const controller = new AbortController();\n const timeoutId = setTimeout(() => controller.abort(), 10000);\n\n const page = offset > 0 ? Math.floor(offset / limit) + 1 : 1;\n const url = `${SKILLS_SH_API_URL}/api/skills/top?pageSize=${limit}&page=${page}`;\n const response = await fetch(url, { signal: controller.signal });\n clearTimeout(timeoutId);\n\n if (!response.ok) {\n throw new HTTPException(502, {\n message: `Skills API error: ${response.status} ${response.statusText}`,\n });\n }\n\n const data = (await response.json()) as {\n skills: Array<{\n skillId: string;\n name: string;\n installs: number;\n source: string;\n owner: string;\n repo: string;\n githubUrl: string;\n displayName: string;\n }>;\n total: number;\n };\n return {\n skills: data.skills.map(s => ({ id: s.skillId, name: s.name, installs: s.installs, topSource: s.source })),\n count: data.total,\n limit,\n offset,\n };\n } catch (error) {\n if (error instanceof HTTPException) {\n throw error;\n }\n return handleError(error, 'Error fetching popular skills');\n }\n },\n});\n\n// =============================================================================\n// Skills API helpers\n// =============================================================================\n\n/**\n * Validate skill name to prevent path traversal attacks.\n * Only allows alphanumeric characters, hyphens, and underscores.\n */\nconst SKILL_NAME_REGEX = /^[a-z0-9][a-z0-9-_]*$/i;\n\nfunction assertSafeSkillName(name: string): string {\n if (!SKILL_NAME_REGEX.test(name)) {\n throw new HTTPException(400, {\n message: `Invalid skill name \"${name}\". Names must start with alphanumeric and contain only letters, numbers, hyphens, and underscores.`,\n });\n }\n return name;\n}\n\n/**\n * Validate that a file path is safe (no traversal, no absolute paths).\n * Prevents malicious API responses from writing files outside the skill directory.\n */\nfunction assertSafeFilePath(filePath: string): string {\n // Reject absolute paths\n if (filePath.startsWith('/') || /^[a-zA-Z]:/.test(filePath)) {\n throw new HTTPException(400, {\n message: `Invalid file path \"${filePath}\". Absolute paths are not allowed.`,\n });\n }\n // Reject path traversal attempts\n const segments = filePath.split('/');\n for (const segment of segments) {\n if (segment === '..' || segment === '.') {\n throw new HTTPException(400, {\n message: `Invalid file path \"${filePath}\". Path traversal is not allowed.`,\n });\n }\n }\n return filePath;\n}\n\ninterface SkillFileEntry {\n path: string;\n content: string;\n encoding: 'utf-8' | 'base64';\n}\n\ninterface SkillFilesResponse {\n skillId: string;\n owner: string;\n repo: string;\n branch: string;\n files: SkillFileEntry[];\n}\n\n/**\n * Fetch skill files from the Skills API.\n * Returns all files for a skill with their content.\n */\nasync function fetchSkillFiles(owner: string, repo: string, skillName: string): Promise<SkillFilesResponse | null> {\n const controller = new AbortController();\n const timeoutId = setTimeout(() => controller.abort(), 30000); // 30s for file downloads\n\n const url = `${SKILLS_SH_API_URL}/api/skills/${encodeURIComponent(owner)}/${encodeURIComponent(repo)}/${encodeURIComponent(skillName)}/files`;\n const response = await fetch(url, { signal: controller.signal });\n clearTimeout(timeoutId);\n\n if (!response.ok) {\n if (response.status === 404) {\n return null;\n }\n throw new Error(`Skills API error: ${response.status} ${response.statusText}`);\n }\n\n return (await response.json()) as SkillFilesResponse;\n}\n\n// =============================================================================\n// skills.sh Preview Route\n// =============================================================================\n\nexport const WORKSPACE_SKILLS_SH_PREVIEW_ROUTE = createRoute({\n method: 'GET',\n path: '/workspaces/:workspaceId/skills-sh/preview',\n responseType: 'json',\n pathParamSchema: workspaceIdPathParams,\n queryParamSchema: skillsShPreviewQuerySchema,\n responseSchema: skillsShPreviewResponseSchema,\n summary: 'Preview skill content',\n description: 'Fetches the skill content from the Skills API.',\n tags: ['Workspace', 'Skills'],\n handler: async ({ owner, repo, path: skillName }) => {\n try {\n const controller = new AbortController();\n const timeoutId = setTimeout(() => controller.abort(), 10000);\n\n const url = `${SKILLS_SH_API_URL}/api/skills/${encodeURIComponent(owner)}/${encodeURIComponent(repo)}/${encodeURIComponent(skillName)}/content`;\n const response = await fetch(url, { signal: controller.signal });\n clearTimeout(timeoutId);\n\n if (!response.ok) {\n throw new HTTPException(404, {\n message: `Could not find skill \"${skillName}\" for ${owner}/${repo}`,\n });\n }\n\n const data = (await response.json()) as { instructions: string; raw: string };\n const content = data.instructions || data.raw || '';\n\n if (!content) {\n throw new HTTPException(404, {\n message: `No content available for skill \"${skillName}\"`,\n });\n }\n\n return { content };\n } catch (error) {\n if (error instanceof HTTPException) {\n throw error;\n }\n return handleError(error, 'Error fetching skill preview');\n }\n },\n});\n\n// =============================================================================\n// skills.sh Install Route\n// =============================================================================\n\nexport const WORKSPACE_SKILLS_SH_INSTALL_ROUTE = createRoute({\n method: 'POST',\n path: '/workspaces/:workspaceId/skills-sh/install',\n responseType: 'json',\n pathParamSchema: workspaceIdPathParams,\n bodySchema: skillsShInstallBodySchema,\n responseSchema: skillsShInstallResponseSchema,\n summary: 'Install skill from Skills API',\n description: 'Installs a skill by fetching files from the Skills API and writing to workspace filesystem.',\n tags: ['Workspace', 'Skills'],\n handler: async ({ mastra, requestContext, workspaceId, owner, repo, skillName, mount }) => {\n try {\n requireWorkspaceV1Support();\n\n const workspace = await getWorkspaceById(mastra, workspaceId, requestContext);\n if (!workspace) {\n throw new HTTPException(404, { message: 'Workspace not found' });\n }\n\n if (!workspace.filesystem) {\n throw new HTTPException(400, { message: 'Workspace filesystem not available' });\n }\n\n if (workspace.filesystem.readOnly) {\n throw new HTTPException(403, { message: 'Workspace is read-only' });\n }\n\n // Fetch skill files from the Skills API\n const result = await fetchSkillFiles(owner, repo, skillName);\n if (!result || result.files.length === 0) {\n throw new HTTPException(404, {\n message: `Could not find skill \"${skillName}\" in ${owner}/${repo}.`,\n });\n }\n\n // Validate skill name to prevent path traversal\n const safeSkillId = assertSafeSkillName(result.skillId);\n const installPath = buildSkillInstallPath(workspace.filesystem, safeSkillId, mount);\n\n // Ensure the skills directory exists\n try {\n await workspace.filesystem.mkdir(installPath, { recursive: true });\n } catch {\n // Directory might already exist\n }\n\n // Write all files to the workspace\n let filesWritten = 0;\n for (const file of result.files) {\n // Validate file path to prevent path traversal from API response\n const safePath = assertSafeFilePath(file.path);\n const filePath = `${installPath}/${safePath}`;\n\n // Create subdirectory if needed\n if (safePath.includes('/')) {\n const dirPath = filePath.substring(0, filePath.lastIndexOf('/'));\n try {\n await workspace.filesystem.mkdir(dirPath, { recursive: true });\n } catch {\n // Directory might already exist\n }\n }\n\n const content = file.encoding === 'base64' ? Buffer.from(file.content, 'base64') : file.content;\n await workspace.filesystem.writeFile(filePath, content);\n filesWritten++;\n }\n\n // Write metadata file for update support\n const metadata = {\n skillName: result.skillId,\n owner: result.owner,\n repo: result.repo,\n branch: result.branch,\n installedAt: new Date().toISOString(),\n };\n await workspace.filesystem.writeFile(`${installPath}/.meta.json`, JSON.stringify(metadata, null, 2));\n filesWritten++;\n\n // Surgically update the skills cache for the newly installed skill\n if (workspace.skills?.addSkill) {\n try {\n await workspace.skills.addSkill(installPath);\n } catch (cacheError) {\n console.warn(\n `[skills-sh] Failed to update cache after install: ${cacheError instanceof Error ? cacheError.message : String(cacheError)}`,\n );\n }\n }\n\n return {\n success: true,\n skillName: result.skillId,\n installedPath: installPath,\n filesWritten,\n };\n } catch (error) {\n if (error instanceof HTTPException) {\n throw error;\n }\n return handleError(error, 'Error installing skill');\n }\n },\n});\n\n/**\n * Interface for skill metadata stored in .meta.json\n */\ninterface SkillMetaFile {\n skillName: string;\n owner: string;\n repo: string;\n branch: string;\n installedAt: string;\n}\n\nexport const WORKSPACE_SKILLS_SH_REMOVE_ROUTE = createRoute({\n method: 'POST',\n path: '/workspaces/:workspaceId/skills-sh/remove',\n responseType: 'json',\n pathParamSchema: workspaceIdPathParams,\n bodySchema: skillsShRemoveBodySchema,\n responseSchema: skillsShRemoveResponseSchema,\n summary: 'Remove an installed skill',\n description: 'Removes an installed skill by deleting its directory. Does not require sandbox.',\n tags: ['Workspace', 'Skills'],\n handler: async ({ mastra, requestContext, workspaceId, skillName }) => {\n try {\n requireWorkspaceV1Support();\n\n const workspace = await getWorkspaceById(mastra, workspaceId, requestContext);\n if (!workspace) {\n throw new HTTPException(404, { message: 'Workspace not found' });\n }\n\n if (!workspace.filesystem) {\n throw new HTTPException(400, { message: 'Workspace filesystem not available' });\n }\n\n if (workspace.filesystem.readOnly) {\n throw new HTTPException(403, { message: 'Workspace is read-only' });\n }\n\n // Validate skill name to prevent path traversal\n const safeSkillName = assertSafeSkillName(skillName);\n\n // Look up the skill's actual path from the cache (supports glob-discovered skills).\n // Only use the discovered path if it's under the skills.sh directory to avoid\n // accidentally deleting a locally-authored skill with the same name.\n const allSkills = await workspace.skills?.list();\n const matchingSkill = allSkills?.find(s => s.name === safeSkillName && s.path.includes(SKILLS_SH_PATH_PREFIX));\n const skillPath = matchingSkill?.path ?? buildSkillInstallPath(workspace.filesystem, safeSkillName);\n\n // Check if skill exists on filesystem\n try {\n await workspace.filesystem.stat(skillPath);\n } catch {\n throw new HTTPException(404, { message: `Skill \"${skillName}\" not found at ${skillPath}` });\n }\n\n // Delete the skill directory\n await workspace.filesystem.rmdir(skillPath, { recursive: true });\n\n // Surgically remove the skill from the cache\n if (workspace.skills?.removeSkill) {\n try {\n await workspace.skills.removeSkill(skillPath);\n } catch (cacheError) {\n console.warn(\n `[skills-sh] Failed to update cache after remove: ${cacheError instanceof Error ? cacheError.message : String(cacheError)}`,\n );\n }\n }\n\n return {\n success: true,\n skillName,\n removedPath: skillPath,\n };\n } catch (error) {\n if (error instanceof HTTPException) {\n throw error;\n }\n return handleError(error, 'Error removing skill');\n }\n },\n});\n\nexport const WORKSPACE_SKILLS_SH_UPDATE_ROUTE = createRoute({\n method: 'POST',\n path: '/workspaces/:workspaceId/skills-sh/update',\n responseType: 'json',\n pathParamSchema: workspaceIdPathParams,\n bodySchema: skillsShUpdateBodySchema,\n responseSchema: skillsShUpdateResponseSchema,\n summary: 'Update installed skills',\n description:\n 'Updates installed skills by re-fetching from GitHub. Specify skillName to update one, or omit to update all.',\n tags: ['Workspace', 'Skills'],\n handler: async ({ mastra, requestContext, workspaceId, skillName }) => {\n try {\n requireWorkspaceV1Support();\n\n const workspace = await getWorkspaceById(mastra, workspaceId, requestContext);\n if (!workspace) {\n throw new HTTPException(404, { message: 'Workspace not found' });\n }\n\n if (!workspace.filesystem) {\n throw new HTTPException(400, { message: 'Workspace filesystem not available' });\n }\n\n if (workspace.filesystem.readOnly) {\n throw new HTTPException(403, { message: 'Workspace is read-only' });\n }\n\n const results: Array<{\n skillName: string;\n success: boolean;\n filesWritten?: number;\n error?: string;\n }> = [];\n\n // Build list of { skillName, basePath } entries to update.\n // basePath is the parent of the skill directory (e.g., `.agents/skills`).\n let skillsToUpdate: Array<{ name: string; basePath: string }>;\n\n if (skillName) {\n const safeName = assertSafeSkillName(skillName);\n\n // Try to find the installed path via discovery first\n const allSkills = await workspace.skills?.list();\n const discoveredSkill = allSkills?.find(s => s.name === safeName && s.path.includes(SKILLS_SH_PATH_PREFIX));\n let basePath: string;\n if (discoveredSkill?.path) {\n // Derive basePath by removing the skill name suffix from the discovered path\n basePath = discoveredSkill.path.substring(0, discoveredSkill.path.lastIndexOf('/'));\n } else {\n basePath = SKILLS_SH_DIR;\n }\n skillsToUpdate = [{ name: safeName, basePath }];\n } else {\n // Update all: scan `.agents/skills` under each writable mount (or just SKILLS_SH_DIR)\n skillsToUpdate = [];\n const dirsToScan: string[] = [];\n\n if (isCompositeFilesystem(workspace.filesystem)) {\n for (const [mountPath, mountFs] of workspace.filesystem.mounts) {\n if (!mountFs.readOnly) {\n dirsToScan.push(`${stripTrailingSlash(mountPath)}/${SKILLS_SH_DIR}`);\n }\n }\n } else {\n dirsToScan.push(SKILLS_SH_DIR);\n }\n\n for (const dir of dirsToScan) {\n try {\n const entries = await workspace.filesystem.readdir(dir);\n for (const e of entries) {\n if (e.type === 'directory') {\n skillsToUpdate.push({ name: e.name, basePath: dir });\n }\n }\n } catch {\n // Directory doesn't exist or isn't readable - skip\n }\n }\n\n if (skillsToUpdate.length === 0) {\n return { updated: [] };\n }\n }\n\n for (const { name: skill, basePath } of skillsToUpdate) {\n // Validate each skill name for safety\n try {\n assertSafeSkillName(skill);\n } catch {\n results.push({\n skillName: skill,\n success: false,\n error: 'Invalid skill name',\n });\n continue;\n }\n const installPath = `${basePath}/${skill}`;\n const metaPath = `${installPath}/.meta.json`;\n try {\n const metaContent = await workspace.filesystem.readFile(metaPath, { encoding: 'utf-8' });\n const meta: SkillMetaFile = JSON.parse(metaContent as string);\n\n // Re-fetch skill files from the Skills API\n const fetchResult = await fetchSkillFiles(meta.owner, meta.repo, meta.skillName);\n\n if (!fetchResult || fetchResult.files.length === 0) {\n results.push({\n skillName: skill,\n success: false,\n error: 'No files found in skill directory',\n });\n continue;\n }\n\n let filesWritten = 0;\n\n for (const file of fetchResult.files) {\n // Validate file path to prevent path traversal from API response\n const safePath = assertSafeFilePath(file.path);\n const filePath = `${installPath}/${safePath}`;\n\n if (safePath.includes('/')) {\n const dirPath = filePath.substring(0, filePath.lastIndexOf('/'));\n try {\n await workspace.filesystem.mkdir(dirPath, { recursive: true });\n } catch {\n // Directory might already exist\n }\n }\n\n const content = file.encoding === 'base64' ? Buffer.from(file.content, 'base64') : file.content;\n await workspace.filesystem.writeFile(filePath, content);\n filesWritten++;\n }\n\n // Update metadata with new install time and branch\n const updatedMeta: SkillMetaFile = {\n ...meta,\n branch: fetchResult.branch,\n installedAt: new Date().toISOString(),\n };\n await workspace.filesystem.writeFile(metaPath, JSON.stringify(updatedMeta, null, 2));\n filesWritten++;\n\n // Surgically update the skills cache for the updated skill\n if (workspace.skills?.addSkill) {\n try {\n await workspace.skills.addSkill(installPath);\n } catch (cacheError) {\n console.warn(\n `[skills-sh] Failed to update cache after update: ${cacheError instanceof Error ? cacheError.message : String(cacheError)}`,\n );\n }\n }\n\n results.push({\n skillName: skill,\n success: true,\n filesWritten,\n });\n } catch (error) {\n results.push({\n skillName: skill,\n success: false,\n error: error instanceof Error ? error.message : 'Unknown error',\n });\n }\n }\n\n return { updated: results };\n } catch (error) {\n if (error instanceof HTTPException) {\n throw error;\n }\n return handleError(error, 'Error updating skills');\n }\n },\n});\n\nexport const WORKSPACE_SKILLS_SH_ROUTES = [\n WORKSPACE_SKILLS_SH_SEARCH_ROUTE,\n WORKSPACE_SKILLS_SH_POPULAR_ROUTE,\n WORKSPACE_SKILLS_SH_PREVIEW_ROUTE,\n WORKSPACE_SKILLS_SH_INSTALL_ROUTE,\n WORKSPACE_SKILLS_SH_REMOVE_ROUTE,\n WORKSPACE_SKILLS_SH_UPDATE_ROUTE,\n];\n\n// =============================================================================\n// Route Collections\n// =============================================================================\n\nexport const WORKSPACE_FS_ROUTES = [\n WORKSPACE_FS_READ_ROUTE,\n WORKSPACE_FS_WRITE_ROUTE,\n WORKSPACE_FS_LIST_ROUTE,\n WORKSPACE_FS_DELETE_ROUTE,\n WORKSPACE_FS_MKDIR_ROUTE,\n WORKSPACE_FS_STAT_ROUTE,\n];\n\nexport const WORKSPACE_SEARCH_ROUTES = [WORKSPACE_SEARCH_ROUTE, WORKSPACE_INDEX_ROUTE];\n\n// IMPORTANT: Search route must come before the parameterized routes\n// to avoid /api/workspace/skills/search being matched as /api/workspace/skills/:skillName\nexport const WORKSPACE_SKILLS_ROUTES = [\n WORKSPACE_SEARCH_SKILLS_ROUTE,\n WORKSPACE_LIST_SKILLS_ROUTE,\n WORKSPACE_GET_SKILL_ROUTE,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