@skaile/workspaces 5.13.0 → 5.15.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +108 -0
- package/README.md +1 -1
- package/dist/app-sdk/index.js +1 -1
- package/dist/{asset-feeds-ALMTHLPV.js → asset-feeds-LIDC7547.js} +19 -19
- package/dist/{asset-feeds-ALMTHLPV.js.map → asset-feeds-LIDC7547.js.map} +1 -1
- package/dist/asset-manager/catalog-deployer.js +7 -7
- package/dist/asset-manager/index.js +14 -14
- package/dist/asset-manager/installer.js +9 -9
- package/dist/asset-manager/renderers.js +8 -8
- package/dist/asset-manager/src/index.d.ts +128 -6
- package/dist/asset-manager/src/index.d.ts.map +1 -1
- package/dist/asset-manager/src/install-instances.d.ts +19 -0
- package/dist/asset-manager/src/install-instances.d.ts.map +1 -1
- package/dist/asset-manager/src/installer.d.ts.map +1 -1
- package/dist/asset-manager/src/mcp-config.d.ts +5 -0
- package/dist/asset-manager/src/mcp-config.d.ts.map +1 -1
- package/dist/bridge/drivers/claude-sdk.js +162 -27
- package/dist/bridge/drivers/claude-sdk.js.map +1 -1
- package/dist/bridge/drivers/codex.js +80 -15
- package/dist/bridge/drivers/codex.js.map +1 -1
- package/dist/bridge/drivers/continue.js +10 -9
- package/dist/bridge/drivers/continue.js.map +1 -1
- package/dist/bridge/drivers/echo.js +4 -3
- package/dist/bridge/drivers/echo.js.map +1 -1
- package/dist/bridge/drivers/gemini.js +7 -6
- package/dist/bridge/drivers/goose.js +10 -9
- package/dist/bridge/drivers/goose.js.map +1 -1
- package/dist/bridge/drivers/omp.js +113 -40
- package/dist/bridge/drivers/omp.js.map +1 -1
- package/dist/bridge/drivers/opencode.js +10 -9
- package/dist/bridge/drivers/opencode.js.map +1 -1
- package/dist/bridge/drivers/qwen.js +7 -6
- package/dist/bridge/drivers/qwen.js.map +1 -1
- package/dist/bridge/index.js +14 -13
- package/dist/bridge/src/codex/friendly-error.d.ts +19 -0
- package/dist/bridge/src/codex/friendly-error.d.ts.map +1 -0
- package/dist/bridge/src/drivers/claude-sdk.d.ts +2 -0
- package/dist/bridge/src/drivers/claude-sdk.d.ts.map +1 -1
- package/dist/bridge/src/drivers/claude-self-turns.d.ts +72 -0
- package/dist/bridge/src/drivers/claude-self-turns.d.ts.map +1 -0
- package/dist/bridge/src/drivers/codex.d.ts.map +1 -1
- package/dist/bridge/src/drivers/omp-models-yml.d.ts +17 -7
- package/dist/bridge/src/drivers/omp-models-yml.d.ts.map +1 -1
- package/dist/bridge/src/drivers/omp.d.ts +7 -0
- package/dist/bridge/src/drivers/omp.d.ts.map +1 -1
- package/dist/bridge/src/normalizer.d.ts.map +1 -1
- package/dist/bridge/src/types.d.ts +12 -0
- package/dist/bridge/src/types.d.ts.map +1 -1
- package/dist/{chunk-VLBIME5L.js → chunk-2LTF2ZHH.js} +4 -4
- package/dist/{chunk-VLBIME5L.js.map → chunk-2LTF2ZHH.js.map} +1 -1
- package/dist/chunk-4AKR4XPQ.js +273 -0
- package/dist/chunk-4AKR4XPQ.js.map +1 -0
- package/dist/{chunk-BF422IDP.js → chunk-4QINFQ27.js} +159 -20
- package/dist/chunk-4QINFQ27.js.map +1 -0
- package/dist/{chunk-V5JHD4I2.js → chunk-54TVXZP3.js} +3 -3
- package/dist/{chunk-V5JHD4I2.js.map → chunk-54TVXZP3.js.map} +1 -1
- package/dist/{chunk-XJYBCDY2.js → chunk-74THIMZV.js} +3 -3
- package/dist/{chunk-XJYBCDY2.js.map → chunk-74THIMZV.js.map} +1 -1
- package/dist/{chunk-IY5E7Y5W.js → chunk-ANSZULXH.js} +32 -9
- package/dist/chunk-ANSZULXH.js.map +1 -0
- package/dist/{chunk-J4DB5G36.js → chunk-AVUJBSFA.js} +2 -2
- package/dist/{chunk-J4DB5G36.js.map → chunk-AVUJBSFA.js.map} +1 -1
- package/dist/{chunk-FB3NREF7.js → chunk-AXNX2SKZ.js} +483 -32
- package/dist/chunk-AXNX2SKZ.js.map +1 -0
- package/dist/{chunk-H5U7LNTJ.js → chunk-BFMYYNDT.js} +25 -3
- package/dist/chunk-BFMYYNDT.js.map +1 -0
- package/dist/{chunk-4L4R5LV3.js → chunk-BV7NLPI6.js} +4 -4
- package/dist/{chunk-4L4R5LV3.js.map → chunk-BV7NLPI6.js.map} +1 -1
- package/dist/{chunk-FHDK3BFD.js → chunk-D2MZZ2KB.js} +3 -3
- package/dist/{chunk-FHDK3BFD.js.map → chunk-D2MZZ2KB.js.map} +1 -1
- package/dist/{chunk-F4NJDSR7.js → chunk-D5WTOVLG.js} +7 -4
- package/dist/chunk-D5WTOVLG.js.map +1 -0
- package/dist/{chunk-Y4Z7LGSH.js → chunk-DP6YRAPZ.js} +67 -23
- package/dist/chunk-DP6YRAPZ.js.map +1 -0
- package/dist/{chunk-AHCI4V5L.js → chunk-DPCEQOIZ.js} +3 -3
- package/dist/{chunk-AHCI4V5L.js.map → chunk-DPCEQOIZ.js.map} +1 -1
- package/dist/{chunk-U27JRO5L.js → chunk-ESXZJP4M.js} +3 -3
- package/dist/{chunk-U27JRO5L.js.map → chunk-ESXZJP4M.js.map} +1 -1
- package/dist/{chunk-B7CZYFB2.js → chunk-GLMKS6V6.js} +4 -4
- package/dist/{chunk-B7CZYFB2.js.map → chunk-GLMKS6V6.js.map} +1 -1
- package/dist/{chunk-BVJU2GKE.js → chunk-GQ5OYFVD.js} +4 -271
- package/dist/chunk-GQ5OYFVD.js.map +1 -0
- package/dist/{chunk-PZOO7L26.js → chunk-I3JO3NIZ.js} +4 -4
- package/dist/{chunk-PZOO7L26.js.map → chunk-I3JO3NIZ.js.map} +1 -1
- package/dist/{chunk-L3ZGYSWY.js → chunk-J76LDUDS.js} +91 -18
- package/dist/chunk-J76LDUDS.js.map +1 -0
- package/dist/{chunk-6GICC4RJ.js → chunk-JHP6MIW2.js} +56 -19
- package/dist/chunk-JHP6MIW2.js.map +1 -0
- package/dist/{chunk-PXDWTJ3P.js → chunk-KRRHADE7.js} +5 -5
- package/dist/{chunk-PXDWTJ3P.js.map → chunk-KRRHADE7.js.map} +1 -1
- package/dist/{chunk-NDUYFYJB.js → chunk-KUB4HFGK.js} +12 -7
- package/dist/chunk-KUB4HFGK.js.map +1 -0
- package/dist/{chunk-ZU24LWBI.js → chunk-LEOXPIC6.js} +3 -3
- package/dist/{chunk-ZU24LWBI.js.map → chunk-LEOXPIC6.js.map} +1 -1
- package/dist/{chunk-57SF6W6E.js → chunk-MGM5EJQQ.js} +3 -3
- package/dist/chunk-MGM5EJQQ.js.map +1 -0
- package/dist/{chunk-5SKVCMRC.js → chunk-MKTJZLQM.js} +6 -11
- package/dist/chunk-MKTJZLQM.js.map +1 -0
- package/dist/{chunk-XBYSURMK.js → chunk-N36S36OZ.js} +3 -3
- package/dist/{chunk-XBYSURMK.js.map → chunk-N36S36OZ.js.map} +1 -1
- package/dist/{chunk-NVO6WECE.js → chunk-NKDSU4Q7.js} +6 -6
- package/dist/{chunk-NVO6WECE.js.map → chunk-NKDSU4Q7.js.map} +1 -1
- package/dist/{chunk-OQ5MKDS3.js → chunk-NOF73BUH.js} +27 -6
- package/dist/chunk-NOF73BUH.js.map +1 -0
- package/dist/{chunk-4DLQESIY.js → chunk-O673TBWJ.js} +3 -3
- package/dist/{chunk-4DLQESIY.js.map → chunk-O673TBWJ.js.map} +1 -1
- package/dist/{chunk-DKGEV6SQ.js → chunk-OOQ5Q75W.js} +111 -20
- package/dist/chunk-OOQ5Q75W.js.map +1 -0
- package/dist/{chunk-PYTTF754.js → chunk-PIDMOE7R.js} +4 -4
- package/dist/{chunk-PYTTF754.js.map → chunk-PIDMOE7R.js.map} +1 -1
- package/dist/{chunk-6JKIOPT3.js → chunk-PK5XQBOC.js} +4 -4
- package/dist/{chunk-6JKIOPT3.js.map → chunk-PK5XQBOC.js.map} +1 -1
- package/dist/{chunk-6NQDDCIL.js → chunk-PQF5QHVS.js} +15 -7
- package/dist/chunk-PQF5QHVS.js.map +1 -0
- package/dist/{chunk-HWGYJMME.js → chunk-PV47EEHD.js} +4 -4
- package/dist/{chunk-HWGYJMME.js.map → chunk-PV47EEHD.js.map} +1 -1
- package/dist/{chunk-2H73V6XR.js → chunk-PW3TYWOI.js} +3 -3
- package/dist/{chunk-2H73V6XR.js.map → chunk-PW3TYWOI.js.map} +1 -1
- package/dist/{chunk-ZSMMX3JD.js → chunk-QR7W5JV4.js} +66 -16
- package/dist/chunk-QR7W5JV4.js.map +1 -0
- package/dist/chunk-RTYDYSUV.js +1336 -0
- package/dist/chunk-RTYDYSUV.js.map +1 -0
- package/dist/{chunk-7SMP4GNW.js → chunk-SAKVAG23.js} +7 -6
- package/dist/chunk-SAKVAG23.js.map +1 -0
- package/dist/{chunk-GMDSRSGI.js → chunk-SCUEPCSJ.js} +12 -9
- package/dist/chunk-SCUEPCSJ.js.map +1 -0
- package/dist/{chunk-M3P4BYRK.js → chunk-SP5NGNBV.js} +6 -3
- package/dist/chunk-SP5NGNBV.js.map +1 -0
- package/dist/{chunk-HBZD3MIW.js → chunk-SRKU7QUG.js} +233 -51
- package/dist/chunk-SRKU7QUG.js.map +1 -0
- package/dist/{chunk-2BIESC6S.js → chunk-SZPE55SB.js} +3 -3
- package/dist/{chunk-2BIESC6S.js.map → chunk-SZPE55SB.js.map} +1 -1
- package/dist/{chunk-YTZFSKWL.js → chunk-TCWECSEB.js} +3 -3
- package/dist/{chunk-YTZFSKWL.js.map → chunk-TCWECSEB.js.map} +1 -1
- package/dist/{chunk-J4OYIYFQ.js → chunk-VY6NTFE7.js} +2 -2
- package/dist/{chunk-J4OYIYFQ.js.map → chunk-VY6NTFE7.js.map} +1 -1
- package/dist/{chunk-5FYOM4RF.js → chunk-WWUWMOX2.js} +15 -11
- package/dist/chunk-WWUWMOX2.js.map +1 -0
- package/dist/{chunk-USHB5KEY.js → chunk-WXKNM2JJ.js} +3 -3
- package/dist/{chunk-USHB5KEY.js.map → chunk-WXKNM2JJ.js.map} +1 -1
- package/dist/{chunk-QO7CR3KB.js → chunk-X7DIT65W.js} +4 -4
- package/dist/{chunk-QO7CR3KB.js.map → chunk-X7DIT65W.js.map} +1 -1
- package/dist/{chunk-Y7WKXPWS.js → chunk-XX4C72CC.js} +544 -68
- package/dist/chunk-XX4C72CC.js.map +1 -0
- package/dist/{chunk-VMKMFS2Q.js → chunk-YIDZJHY6.js} +3 -3
- package/dist/{chunk-VMKMFS2Q.js.map → chunk-YIDZJHY6.js.map} +1 -1
- package/dist/{chunk-R6QHJEHE.js → chunk-YL23KWBX.js} +5 -5
- package/dist/{chunk-R6QHJEHE.js.map → chunk-YL23KWBX.js.map} +1 -1
- package/dist/{chunk-4NJ3QQHZ.js → chunk-YUURCZWY.js} +5 -5
- package/dist/{chunk-4NJ3QQHZ.js.map → chunk-YUURCZWY.js.map} +1 -1
- package/dist/{chunk-X4BAYGMT.js → chunk-ZIW34FGO.js} +3 -3
- package/dist/{chunk-X4BAYGMT.js.map → chunk-ZIW34FGO.js.map} +1 -1
- package/dist/cli/index.js +4324 -4078
- package/dist/cli/index.js.map +1 -1
- package/dist/cli/src/agent-checks.d.ts +21 -0
- package/dist/cli/src/agent-checks.d.ts.map +1 -1
- package/dist/cli/src/commands/asset-cmd.d.ts.map +1 -1
- package/dist/cli/src/commands/catalog.d.ts.map +1 -1
- package/dist/cli/src/commands/library-cmd.d.ts.map +1 -1
- package/dist/cli/src/commands/library-index.d.ts +25 -5
- package/dist/cli/src/commands/library-index.d.ts.map +1 -1
- package/dist/cli/src/commands/library-publish.d.ts.map +1 -1
- package/dist/cli/src/commands/outdated.d.ts.map +1 -1
- package/dist/cli/src/commands/plugin-registry-cmd.d.ts.map +1 -1
- package/dist/cli/src/commands/preset-cmd.d.ts.map +1 -1
- package/dist/cli/src/commands/project.d.ts +16 -1
- package/dist/cli/src/commands/project.d.ts.map +1 -1
- package/dist/cli/src/commands/rebuild.d.ts.map +1 -1
- package/dist/cli/src/commands/run.d.ts.map +1 -1
- package/dist/cli/src/commands/serve-preflight.d.ts +5 -6
- package/dist/cli/src/commands/serve-preflight.d.ts.map +1 -1
- package/dist/cli/src/commands/serve.d.ts +19 -0
- package/dist/cli/src/commands/serve.d.ts.map +1 -1
- package/dist/cli/src/commands/session.d.ts.map +1 -1
- package/dist/cli/src/commands/source.d.ts +7 -0
- package/dist/cli/src/commands/source.d.ts.map +1 -1
- package/dist/cli/src/commands/update.d.ts.map +1 -1
- package/dist/cli/src/commands/validate.d.ts +0 -9
- package/dist/cli/src/commands/validate.d.ts.map +1 -1
- package/dist/cli/src/skill-checks.d.ts +8 -1
- package/dist/cli/src/skill-checks.d.ts.map +1 -1
- package/dist/connectors/config.js +5 -5
- package/dist/connectors/index.js +18 -17
- package/dist/connectors/src/config.d.ts.map +1 -1
- package/dist/connectors/src/connector-manager.d.ts +8 -1
- package/dist/connectors/src/connector-manager.d.ts.map +1 -1
- package/dist/connectors/src/connector-prompt.d.ts +9 -0
- package/dist/connectors/src/connector-prompt.d.ts.map +1 -1
- package/dist/{connectors-GFKMKAXV.js → connectors-JQR5RAMC.js} +21 -20
- package/dist/{connectors-GFKMKAXV.js.map → connectors-JQR5RAMC.js.map} +1 -1
- package/dist/connectors-shared/index.js +2 -2
- package/dist/core/index.js +6 -6
- package/dist/core/manifest.js +2 -2
- package/dist/core/models.js +1 -1
- package/dist/core/publish-manifest.js +3 -3
- package/dist/core/ref.js +1 -1
- package/dist/core/runtime-assets.js +5 -5
- package/dist/core/src/driver-sdk.d.ts +31 -0
- package/dist/core/src/driver-sdk.d.ts.map +1 -0
- package/dist/core/src/index.d.ts +3 -2
- package/dist/core/src/index.d.ts.map +1 -1
- package/dist/core/src/lock.d.ts.map +1 -1
- package/dist/core/src/manifest-yaml-editor.d.ts +5 -0
- package/dist/core/src/manifest-yaml-editor.d.ts.map +1 -1
- package/dist/core/src/manifest.d.ts.map +1 -1
- package/dist/core/src/models.d.ts +8 -0
- package/dist/core/src/models.d.ts.map +1 -1
- package/dist/core/src/publish-manifest.d.ts +28 -7
- package/dist/core/src/publish-manifest.d.ts.map +1 -1
- package/dist/core/src/repo-manager.d.ts.map +1 -1
- package/dist/core/src/walker.d.ts +4 -0
- package/dist/core/src/walker.d.ts.map +1 -1
- package/dist/core/src/workspace-config.d.ts +44 -0
- package/dist/core/src/workspace-config.d.ts.map +1 -1
- package/dist/core/workspace-config.js +4 -4
- package/dist/deploy/index.js +6 -6
- package/dist/discovery/index.js +5 -5
- package/dist/{ensure-sources-VUKHL65L.js → ensure-sources-NAGBSMJE.js} +17 -17
- package/dist/{ensure-sources-VUKHL65L.js.map → ensure-sources-NAGBSMJE.js.map} +1 -1
- package/dist/factory-assets/connectors/box.js +18 -17
- package/dist/factory-assets/connectors/deploy.js +18 -17
- package/dist/factory-assets/connectors/devserver.js +18 -17
- package/dist/factory-assets/connectors/flow/adapter.js +18 -17
- package/dist/factory-assets/connectors/flow/engine.js +7 -7
- package/dist/factory-assets/connectors/flow/run-flow.d.ts +5 -0
- package/dist/factory-assets/connectors/flow/run-flow.d.ts.map +1 -1
- package/dist/factory-assets/connectors/flow/run-flow.js +20 -19
- package/dist/factory-assets/connectors/flow.js +18 -17
- package/dist/factory-assets/connectors/git.js +18 -17
- package/dist/factory-assets/connectors/gmail.js +18 -17
- package/dist/factory-assets/connectors/googledrive.js +18 -17
- package/dist/factory-assets/connectors/local.js +18 -17
- package/dist/factory-assets/connectors/mattermost.js +18 -17
- package/dist/factory-assets/connectors/memory.js +18 -17
- package/dist/factory-assets/connectors/minio.js +18 -17
- package/dist/factory-assets/connectors/postgres.js +18 -17
- package/dist/factory-assets/connectors/s3.js +18 -17
- package/dist/factory-assets/connectors/sharepoint.js +18 -17
- package/dist/factory-assets/connectors/sqlite.js +18 -17
- package/dist/factory-assets/connectors/static-server.js +18 -17
- package/dist/factory-assets/connectors/tunnel.js +18 -17
- package/dist/factory-assets/connectors/webdav.js +18 -17
- package/dist/factory-assets/connectors/xstate-store.js +18 -17
- package/dist/factory-assets/connectors/xstate.js +18 -17
- package/dist/{flows-A4YALSZY.js → flows-CYJI3URW.js} +11 -11
- package/dist/{flows-A4YALSZY.js.map → flows-CYJI3URW.js.map} +1 -1
- package/dist/{helpers-53XZW7KF.js → helpers-XFHJDJOA.js} +17 -17
- package/dist/{helpers-53XZW7KF.js.map → helpers-XFHJDJOA.js.map} +1 -1
- package/dist/library/index.js +11 -11
- package/dist/library/install.js +5 -5
- package/dist/library/src/index.d.ts +1 -1
- package/dist/library/src/index.d.ts.map +1 -1
- package/dist/library/src/install/source-fetch-github.d.ts.map +1 -1
- package/dist/library/src/manifest-writer.d.ts +15 -0
- package/dist/library/src/manifest-writer.d.ts.map +1 -1
- package/dist/library/src/remote/remote-catalog-source.d.ts +6 -1
- package/dist/library/src/remote/remote-catalog-source.d.ts.map +1 -1
- package/dist/library/src/remote/rest-catalog-source.d.ts +6 -1
- package/dist/library/src/remote/rest-catalog-source.d.ts.map +1 -1
- package/dist/{library-publish-FFIPWIRM.js → library-publish-FC3ZABR2.js} +91 -29
- package/dist/library-publish-FC3ZABR2.js.map +1 -0
- package/dist/model-endpoint/index.d.ts +2 -0
- package/dist/model-endpoint/index.js +9 -0
- package/dist/model-endpoint/index.js.map +1 -0
- package/dist/model-endpoint/src/index.d.ts +4 -0
- package/dist/model-endpoint/src/index.d.ts.map +1 -0
- package/dist/model-endpoint/src/openai-chat.d.ts +105 -0
- package/dist/model-endpoint/src/openai-chat.d.ts.map +1 -0
- package/dist/model-endpoint/src/openai-responses.d.ts +106 -0
- package/dist/model-endpoint/src/openai-responses.d.ts.map +1 -0
- package/dist/model-endpoint/src/openai-shared.d.ts +77 -0
- package/dist/model-endpoint/src/openai-shared.d.ts.map +1 -0
- package/dist/model-endpoint/src/resolve.d.ts +36 -0
- package/dist/model-endpoint/src/resolve.d.ts.map +1 -0
- package/dist/model-endpoint/src/server.d.ts +16 -0
- package/dist/model-endpoint/src/server.d.ts.map +1 -0
- package/dist/model-endpoint/src/types.d.ts +78 -0
- package/dist/model-endpoint/src/types.d.ts.map +1 -0
- package/dist/open-library-5ET7SAJC.js +40 -0
- package/dist/{open-library-PZAT3TJA.js.map → open-library-5ET7SAJC.js.map} +1 -1
- package/dist/open-registry-X6YQVP7V.js +32 -0
- package/dist/{open-registry-W46UXZ3I.js.map → open-registry-X6YQVP7V.js.map} +1 -1
- package/dist/{paths-KKY3NSBZ.js → paths-NXWIBZCX.js} +9 -9
- package/dist/{paths-KKY3NSBZ.js.map → paths-NXWIBZCX.js.map} +1 -1
- package/dist/{plugin-store-CK7YWRIC.js → plugin-store-BIITCNOZ.js} +8 -8
- package/dist/{plugin-store-CK7YWRIC.js.map → plugin-store-BIITCNOZ.js.map} +1 -1
- package/dist/project-2UXHSVVA.js +82 -0
- package/dist/{project-EZUH7PUJ.js.map → project-2UXHSVVA.js.map} +1 -1
- package/dist/resolver/index.js +7 -7
- package/dist/runner/index.js +35 -32
- package/dist/runner/src/event-gap-buffer.d.ts.map +1 -1
- package/dist/runner/src/model-endpoint-discovery.d.ts +64 -0
- package/dist/runner/src/model-endpoint-discovery.d.ts.map +1 -0
- package/dist/runner/src/resources.d.ts.map +1 -1
- package/dist/runner/src/serve.d.ts +14 -0
- package/dist/runner/src/serve.d.ts.map +1 -1
- package/dist/runner/src/session-builder.d.ts +8 -0
- package/dist/runner/src/session-builder.d.ts.map +1 -1
- package/dist/runner/src/session.d.ts +15 -0
- package/dist/runner/src/session.d.ts.map +1 -1
- package/dist/sdk/asset-manager.js +14 -14
- package/dist/sdk/bridge.js +14 -13
- package/dist/sdk/core.js +6 -6
- package/dist/sdk/flow.js +7 -7
- package/dist/sdk/index.js +35 -32
- package/dist/sdk/index.js.map +1 -1
- package/dist/sdk/resolver.js +7 -7
- package/dist/sdk/runner.js +35 -32
- package/dist/sdk/session.js +2 -2
- package/dist/sdk/transport/ws/server.js +1 -1
- package/dist/sdk/transport/ws.js +1 -1
- package/dist/sdk/transport.js +1 -1
- package/dist/sdk/types.js +1 -1
- package/dist/serve-preflight-GD7IQFA3.js +54 -0
- package/dist/serve-preflight-GD7IQFA3.js.map +1 -0
- package/dist/session/index.js +2 -2
- package/dist/{setup-L632QIHV.js → setup-IKH4R7UN.js} +25 -24
- package/dist/setup-IKH4R7UN.js.map +1 -0
- package/dist/{skills-OY3Y5GKA.js → skills-XVHOXOOH.js} +12 -12
- package/dist/{skills-OY3Y5GKA.js.map → skills-XVHOXOOH.js.map} +1 -1
- package/dist/source-M6IARYNO.js +83 -0
- package/dist/{source-36FHMN5V.js.map → source-M6IARYNO.js.map} +1 -1
- package/dist/source-fetch-github-ST4MFL3D.js +4 -0
- package/dist/{source-fetch-github-PIO6EMMF.js.map → source-fetch-github-ST4MFL3D.js.map} +1 -1
- package/dist/{source-manifest-publish-NIXJSJ22.js → source-manifest-publish-UP2IS2QW.js} +65 -24
- package/dist/source-manifest-publish-UP2IS2QW.js.map +1 -0
- package/dist/transport/index.js +1 -1
- package/dist/transport/src/ws/server.d.ts +16 -0
- package/dist/transport/src/ws/server.d.ts.map +1 -1
- package/dist/transport/ws/server.js +1 -1
- package/dist/transport/ws.js +1 -1
- package/dist/tui/index.js +35 -32
- package/dist/tui/index.js.map +1 -1
- package/dist/types/index.js +1 -1
- package/dist/types/manifests.js +1 -1
- package/dist/types/src/delivery.d.ts.map +1 -1
- package/dist/types/src/events.d.ts +55 -1
- package/dist/types/src/events.d.ts.map +1 -1
- package/dist/types/src/index.d.ts +1 -1
- package/dist/types/src/index.d.ts.map +1 -1
- package/dist/types/src/manifests/mcp-server.d.ts.map +1 -1
- package/dist/types/src/version.d.ts +11 -1
- package/dist/types/src/version.d.ts.map +1 -1
- package/dist/workspace-plugin/adapters/mcp.js +25 -24
- package/dist/workspace-plugin/adapters/omp.js +14 -14
- package/dist/workspace-plugin/index.js +1 -1
- package/dist/workspace-plugin/src/adapters/mcp.d.ts.map +1 -1
- package/package.json +14 -3
- package/dist/chunk-57SF6W6E.js.map +0 -1
- package/dist/chunk-5FYOM4RF.js.map +0 -1
- package/dist/chunk-5SKVCMRC.js.map +0 -1
- package/dist/chunk-6GICC4RJ.js.map +0 -1
- package/dist/chunk-6NQDDCIL.js.map +0 -1
- package/dist/chunk-7SMP4GNW.js.map +0 -1
- package/dist/chunk-BF422IDP.js.map +0 -1
- package/dist/chunk-BVJU2GKE.js.map +0 -1
- package/dist/chunk-DKGEV6SQ.js.map +0 -1
- package/dist/chunk-F4NJDSR7.js.map +0 -1
- package/dist/chunk-FB3NREF7.js.map +0 -1
- package/dist/chunk-GMDSRSGI.js.map +0 -1
- package/dist/chunk-H5U7LNTJ.js.map +0 -1
- package/dist/chunk-HBZD3MIW.js.map +0 -1
- package/dist/chunk-IY5E7Y5W.js.map +0 -1
- package/dist/chunk-L3ZGYSWY.js.map +0 -1
- package/dist/chunk-M3P4BYRK.js.map +0 -1
- package/dist/chunk-NDUYFYJB.js.map +0 -1
- package/dist/chunk-OQ5MKDS3.js.map +0 -1
- package/dist/chunk-PN44DOGP.js +0 -345
- package/dist/chunk-PN44DOGP.js.map +0 -1
- package/dist/chunk-Y4Z7LGSH.js.map +0 -1
- package/dist/chunk-Y7WKXPWS.js.map +0 -1
- package/dist/chunk-ZSMMX3JD.js.map +0 -1
- package/dist/library-publish-FFIPWIRM.js.map +0 -1
- package/dist/open-library-PZAT3TJA.js +0 -40
- package/dist/open-registry-W46UXZ3I.js +0 -32
- package/dist/project-EZUH7PUJ.js +0 -79
- package/dist/serve-preflight-F7MYF747.js +0 -64
- package/dist/serve-preflight-F7MYF747.js.map +0 -1
- package/dist/setup-L632QIHV.js.map +0 -1
- package/dist/source-36FHMN5V.js +0 -42
- package/dist/source-fetch-github-PIO6EMMF.js +0 -4
- package/dist/source-manifest-publish-NIXJSJ22.js.map +0 -1
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { createSpinner } from './chunk-NESV47MF.js';
|
|
2
|
-
import { logInfo, logWarn,
|
|
3
|
-
import { getKindRegistry } from './chunk-
|
|
4
|
-
import { verifyConventionItems } from './chunk-
|
|
5
|
-
import { AssetManager } from './chunk-
|
|
6
|
-
import { readLock } from './chunk-
|
|
7
|
-
import { SourceEntryError, effectiveAgentInstances, resolveSkWorkspaceConfig, resolveAgentDefinitionDir, AgentRefResolutionError } from './chunk-
|
|
2
|
+
import { logInfo, logWarn, logErr, TARGET_DEFAULT_HINT, logOk, colorRef, S, requireProjectConfig, warnLegacyClaudeCopies, formatSoftDepHint } from './chunk-PIDMOE7R.js';
|
|
3
|
+
import { getKindRegistry } from './chunk-YUURCZWY.js';
|
|
4
|
+
import { verifyConventionItems } from './chunk-SRKU7QUG.js';
|
|
5
|
+
import { AssetManager } from './chunk-XX4C72CC.js';
|
|
6
|
+
import { readLock } from './chunk-4QINFQ27.js';
|
|
7
|
+
import { SourceEntryError, effectiveAgentInstances, resolveSkWorkspaceConfig, resolveAgentDefinitionDir, AgentRefResolutionError } from './chunk-J76LDUDS.js';
|
|
8
8
|
import { userConfigPath } from './chunk-L5VSIPQD.js';
|
|
9
9
|
import { SUPPORTED_DRIVER_TARGETS } from './chunk-IG5LZ3WU.js';
|
|
10
|
-
import { parseAssetRef } from './chunk-
|
|
10
|
+
import { parseAssetRef } from './chunk-VY6NTFE7.js';
|
|
11
11
|
import path from 'path';
|
|
12
12
|
import * as p from '@clack/prompts';
|
|
13
13
|
import { Command } from 'commander';
|
|
@@ -69,6 +69,25 @@ function reportMoved(moved, onLine = logWarn) {
|
|
|
69
69
|
function reportReplaced(replaced, onLine = logInfo) {
|
|
70
70
|
for (const r of replaced ?? []) onLine(`${r.ref} replaced ${r.from} \u2192 ${r.to}`);
|
|
71
71
|
}
|
|
72
|
+
function reportRewritten(rewritten, onLine = logInfo) {
|
|
73
|
+
for (const r of rewritten ?? []) {
|
|
74
|
+
for (const f of r.files) onLine(`Rewrote ${f} (agent render changed)`);
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
function reportStoreNotChecked(notChecked) {
|
|
78
|
+
let unreachable = false;
|
|
79
|
+
for (const n of notChecked ?? []) {
|
|
80
|
+
if (n.reason === "unreachable") {
|
|
81
|
+
unreachable = true;
|
|
82
|
+
logErr(`store unreachable: could not check ${n.ref} for updates (${n.detail})`);
|
|
83
|
+
} else if (n.reason === "air-gapped") {
|
|
84
|
+
logInfo(`${n.ref} kept as locked (air-gapped: not checked against the store)`);
|
|
85
|
+
} else {
|
|
86
|
+
logInfo(`${n.ref} kept as locked (${n.detail})`);
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
return unreachable;
|
|
90
|
+
}
|
|
72
91
|
function makeInstallCommand() {
|
|
73
92
|
return new Command("install").description(`Install dependencies from skaile.yaml, or a single asset by ref (${REF_HINT})`).argument("[ref]", `Asset ref to install from the Catalog (${REF_HINT})`).option("--locked", "Install from lock file (CI mode \u2014 fails on drift)").option("--project-dir <path>", "Project directory", process.cwd()).option("--target <agent>", `Agent framework (${TARGET_DEFAULT_HINT})`).option(
|
|
74
93
|
"--global",
|
|
@@ -79,6 +98,9 @@ function makeInstallCommand() {
|
|
|
79
98
|
).option(
|
|
80
99
|
"--link",
|
|
81
100
|
"symlink local-path assets instead of copying (dev loop; machine-local, not for committing)"
|
|
101
|
+
).option(
|
|
102
|
+
"--force",
|
|
103
|
+
"Deploy over a folder no lock entry owns (a hand-made skill of the same name) instead of refusing"
|
|
82
104
|
).action(runInstallCommand);
|
|
83
105
|
}
|
|
84
106
|
function parseHarnessFilter(raw) {
|
|
@@ -106,10 +128,16 @@ async function runRefInstall(ref, opts) {
|
|
|
106
128
|
logErr(`malformed asset ref '${ref}' \u2014 expected ${REF_HINT}`);
|
|
107
129
|
process.exit(1);
|
|
108
130
|
}
|
|
131
|
+
if (!parseAssetRef(ref).pin) {
|
|
132
|
+
logErr(
|
|
133
|
+
`${ref} needs a version: use ${ref}#<version>. A library asset is deployed with \`skaile add ${ref}\`, not \`skaile install\`.`
|
|
134
|
+
);
|
|
135
|
+
process.exit(1);
|
|
136
|
+
}
|
|
109
137
|
const spinner = createSpinner();
|
|
110
138
|
spinner.start(`Installing ${ref}`);
|
|
111
139
|
try {
|
|
112
|
-
const { openCatalogSource, openLibrary } = await import('./open-library-
|
|
140
|
+
const { openCatalogSource, openLibrary } = await import('./open-library-5ET7SAJC.js');
|
|
113
141
|
const catalog = await openCatalogSource({ projectDir: path.resolve(opts.projectDir) });
|
|
114
142
|
if (!supportsInstallManifest(catalog)) {
|
|
115
143
|
throw new Error(
|
|
@@ -135,7 +163,11 @@ async function runRefInstall(ref, opts) {
|
|
|
135
163
|
} catch (err) {
|
|
136
164
|
spinner.stop("Failed");
|
|
137
165
|
const msg = err instanceof Error ? err.message : String(err);
|
|
138
|
-
if (/
|
|
166
|
+
if (/failed: 404\b/.test(msg)) {
|
|
167
|
+
logErr(
|
|
168
|
+
`${ref} is not in the store. For a library asset use \`skaile add ${ref.replace(/#.*$/, "")}\`.`
|
|
169
|
+
);
|
|
170
|
+
} else if (/unreachable/i.test(msg)) {
|
|
139
171
|
logErr(`asset uninstallable \u2014 source commit no longer available (${msg})`);
|
|
140
172
|
} else {
|
|
141
173
|
logErr(msg);
|
|
@@ -152,7 +184,7 @@ async function runYamlInstall(opts) {
|
|
|
152
184
|
}
|
|
153
185
|
requireProjectConfig(projectDir);
|
|
154
186
|
try {
|
|
155
|
-
const { ensureSourcesCloned } = await import('./ensure-sources-
|
|
187
|
+
const { ensureSourcesCloned } = await import('./ensure-sources-NAGBSMJE.js');
|
|
156
188
|
const hydrate = ensureSourcesCloned(projectDir, { quiet: true });
|
|
157
189
|
if (hydrate.cloned.length > 0) {
|
|
158
190
|
logOk(`Cloned source(s): ${hydrate.cloned.join(", ")}`);
|
|
@@ -171,9 +203,10 @@ async function runYamlInstall(opts) {
|
|
|
171
203
|
const spinner = createSpinner();
|
|
172
204
|
spinner.start(opts.locked ? "Installing from lock file" : "Installing dependencies");
|
|
173
205
|
try {
|
|
174
|
-
const result = await am.install({ locked: opts.locked, link: opts.link });
|
|
206
|
+
const result = await am.install({ locked: opts.locked, link: opts.link, force: opts.force });
|
|
207
|
+
const storeUnreachable = result.storeNotChecked?.some((n) => n.reason === "unreachable");
|
|
175
208
|
spinner.stop(
|
|
176
|
-
result.agentInstanceErrors?.length || result.missing.length > 0 ? "Failed" : "Done"
|
|
209
|
+
result.agentInstanceErrors?.length || result.missing.length > 0 || storeUnreachable ? "Failed" : "Done"
|
|
177
210
|
);
|
|
178
211
|
if (result.deployed.length > 0) {
|
|
179
212
|
for (const d of result.deployed) logOk(d);
|
|
@@ -182,6 +215,7 @@ async function runYamlInstall(opts) {
|
|
|
182
215
|
for (const f of r.restored) logInfo(`Restored ${f}`);
|
|
183
216
|
for (const f of r.removed) logInfo(`Removed ${f} (not part of ${r.ref})`);
|
|
184
217
|
}
|
|
218
|
+
reportRewritten(result.rewritten);
|
|
185
219
|
reportPresetExpansions(result.presets);
|
|
186
220
|
reportAgentInstances(result.agentInstances, result.agentFilesRemoved);
|
|
187
221
|
if (result.removed.length > 0) {
|
|
@@ -190,7 +224,7 @@ async function runYamlInstall(opts) {
|
|
|
190
224
|
reportReplaced(result.replaced);
|
|
191
225
|
reportRelocked(result.relocked);
|
|
192
226
|
reportMoved(result.moved);
|
|
193
|
-
if (result.deployed.length === 0 && result.removed.length === 0 && !result.replaced?.length && result.missing.length === 0 && !result.relocked?.length && !result.moved?.length && !result.agentInstanceErrors?.length) {
|
|
227
|
+
if (result.deployed.length === 0 && result.removed.length === 0 && !result.replaced?.length && result.missing.length === 0 && !result.storeNotChecked?.length && !result.relocked?.length && !result.moved?.length && !result.agentInstanceErrors?.length) {
|
|
194
228
|
logInfo("Nothing to install (already up to date).");
|
|
195
229
|
}
|
|
196
230
|
if (result.agentInstanceErrors?.length) {
|
|
@@ -203,6 +237,7 @@ async function runYamlInstall(opts) {
|
|
|
203
237
|
for (const m of result.missing) logErr(`Missing: ${m}${result.missingHints?.[m] ?? ""}`);
|
|
204
238
|
process.exitCode = 1;
|
|
205
239
|
}
|
|
240
|
+
if (reportStoreNotChecked(result.storeNotChecked)) process.exitCode = 1;
|
|
206
241
|
if (result.lockWritten) {
|
|
207
242
|
logInfo(`Lock file written: ${S.dim("skaile.lock.yaml")}`);
|
|
208
243
|
}
|
|
@@ -233,16 +268,18 @@ async function runGlobalInstall(opts, harnesses) {
|
|
|
233
268
|
const spinner = createSpinner();
|
|
234
269
|
spinner.start("Installing global dependencies");
|
|
235
270
|
try {
|
|
236
|
-
const result = await am.install({ locked: opts.locked, link: opts.link });
|
|
237
|
-
|
|
271
|
+
const result = await am.install({ locked: opts.locked, link: opts.link, force: opts.force });
|
|
272
|
+
const storeUnreachable = result.storeNotChecked?.some((n) => n.reason === "unreachable");
|
|
273
|
+
spinner.stop(result.missing.length > 0 || storeUnreachable ? "Failed" : "Done");
|
|
238
274
|
if (result.deployed.length > 0) for (const d of result.deployed) logOk(d);
|
|
239
275
|
reportPresetExpansions(result.presets);
|
|
240
276
|
if (result.removed.length > 0) for (const r of result.removed) logWarn(`Removed: ${r}`);
|
|
241
277
|
reportReplaced(result.replaced);
|
|
242
278
|
reportRelocked(result.relocked);
|
|
243
279
|
reportMoved(result.moved);
|
|
244
|
-
if (result.deployed.length === 0 && result.removed.length === 0 && !result.replaced?.length && result.missing.length === 0 && !result.relocked?.length && !result.moved?.length)
|
|
280
|
+
if (result.deployed.length === 0 && result.removed.length === 0 && !result.replaced?.length && result.missing.length === 0 && !result.storeNotChecked?.length && !result.relocked?.length && !result.moved?.length)
|
|
245
281
|
logInfo("Nothing to install (already up to date).");
|
|
282
|
+
if (reportStoreNotChecked(result.storeNotChecked)) process.exitCode = 1;
|
|
246
283
|
if (result.missing.length > 0) {
|
|
247
284
|
for (const m of result.missing) logErr(`Missing: ${m}${result.missingHints?.[m] ?? ""}`);
|
|
248
285
|
process.exitCode = 1;
|
|
@@ -364,6 +401,6 @@ function makeCleanCommand() {
|
|
|
364
401
|
});
|
|
365
402
|
}
|
|
366
403
|
|
|
367
|
-
export { REF_HINT, editedConventionFiles, makeCheckCommand, makeCleanCommand, makeInstallCommand, reportAgentInstances, reportInstalledSoftDeps, reportMoved, reportPresetExpansions, reportRelocked, reportReplaced, runPointerOnlyInstall, supportsInstallManifest };
|
|
368
|
-
//# sourceMappingURL=chunk-
|
|
369
|
-
//# sourceMappingURL=chunk-
|
|
404
|
+
export { REF_HINT, editedConventionFiles, makeCheckCommand, makeCleanCommand, makeInstallCommand, reportAgentInstances, reportInstalledSoftDeps, reportMoved, reportPresetExpansions, reportRelocked, reportReplaced, reportRewritten, reportStoreNotChecked, runPointerOnlyInstall, supportsInstallManifest };
|
|
405
|
+
//# sourceMappingURL=chunk-JHP6MIW2.js.map
|
|
406
|
+
//# sourceMappingURL=chunk-JHP6MIW2.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../cli/src/commands/project.ts"],"names":["confirm"],"mappings":";;;;;;;;;;;;;;AA8CO,IAAM,QAAA,GAAW;AAGxB,SAAS,gBAAgB,GAAA,EAAsB;AAC7C,EAAA,IAAI;AACF,IAAA,aAAA,CAAc,GAAG,CAAA;AACjB,IAAA,OAAO,IAAA;AAAA,EACT,CAAA,CAAA,MAAQ;AACN,IAAA,OAAO,KAAA;AAAA,EACT;AACF;AAqBO,SAAS,wBAAwB,MAAA,EAAkD;AACxF,EAAA,OACE,OAAQ,QAAgE,kBAAA,KACxE,UAAA;AAEJ;AAwCA,eAAsB,qBAAA,CACpB,KACA,IAAA,EACmC;AACnC,EAAA,IAAI,SAAA;AACJ,EAAA,IAAI;AACF,IAAA,SAAA,GAAY,cAAc,GAAG,CAAA;AAAA,EAC/B,SAAS,CAAA,EAAG;AACV,IAAA,MAAM,IAAI,KAAA;AAAA,MACR,CAAA,qBAAA,EAAwB,GAAG,CAAA,kBAAA,EAAgB,QAAQ,CAAA,EAAA,EAAK,CAAA,YAAa,KAAA,GAAQ,CAAA,CAAE,OAAA,GAAU,MAAA,CAAO,CAAC,CAAC,CAAA;AAAA,KACpG;AAAA,EACF;AACA,EAAA,MAAM,QAAA,GAAW,MAAM,IAAA,CAAK,OAAA,CAAQ,mBAAmB,GAAG,CAAA;AAI1D,EAAA,MAAM,GAAA,GAAM,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AAA,CAAE,GAAA,CAAI,CAAC,CAAC,CAAA,CAAE,CAAA;AAAA,MAC/B;AAAA,IACF;AACA,IAAA,IAAI,KAAK,GAAA,EAAK;AACZ,MAAA,OAAA,CAAQ,GAAA,EAAI;AACZ,MAAA,KAAA,CAAM,sBAAsB,CAAA;AAAA,IAC9B;AAAA,EACF,CAAC,CAAA;AACL","file":"chunk-JHP6MIW2.js","sourcesContent":["import path from \"node:path\";\nimport * as p from \"@clack/prompts\";\nimport {\n AssetManager,\n type InstalledAgentInstance,\n type LibraryMove,\n type ReplacedAsset,\n type RewrittenAgent,\n} from \"@skaile/workspaces/asset-manager\";\nimport {\n AgentRefResolutionError,\n type DriverTarget,\n effectiveAgentInstances,\n type PresetExpansion,\n parseAssetRef,\n readLock,\n resolveAgentDefinitionDir,\n resolveSkWorkspaceConfig,\n SUPPORTED_DRIVER_TARGETS,\n SourceEntryError,\n userConfigPath,\n} from \"@skaile/workspaces/core\";\nimport { verifyConventionItems } from \"@skaile/workspaces/runner\";\nimport type { InstallManifest } from \"@skaile/workspaces/types\";\nimport { Command } from \"commander\";\nimport {\n colorRef,\n requireProjectConfig,\n formatSoftDepHint,\n logErr,\n logInfo,\n logOk,\n logWarn,\n S,\n TARGET_DEFAULT_HINT,\n warnLegacyClaudeCopies,\n} from \"../helpers.ts\";\nimport { createSpinner } from \"../spinner.ts\";\nimport { getKindRegistry } from \"../open-registry.ts\";\n\n/**\n * Canonical asset-ref shape accepted by `skaile install <ref>`:\n * `kind:@<publisher>/<name>#<version>` (the `#` version sigil). Validated via\n * `parseAssetRef` so the CLI shares the single canonical grammar; the legacy\n * trailing-`@version` shape is rejected.\n */\nexport const REF_HINT = \"kind:@<publisher>/<name>#<version> (e.g. skill:@skaile/use-exa#1.0.0)\";\n\n/** True when `ref` parses as a canonical asset ref. */\nfunction isValidAssetRef(ref: string): boolean {\n try {\n parseAssetRef(ref);\n return true;\n } catch {\n return false;\n }\n}\n\n/**\n * Minimal catalog-source surface the pointer-only install path needs.\n * `RemoteCatalogSource` satisfies this — narrowing keeps {@link runPointerOnlyInstall}\n * testable with a hand-rolled stub.\n */\nexport interface InstallManifestSource {\n getInstallManifest(ref: string): Promise<InstallManifest>;\n}\n\n/**\n * Capability check: is this catalog source able to serve install manifests?\n *\n * `openCatalogSource` returns a `RemoteCatalogSource | RestCatalogSource`.\n * Only the tRPC-framed `RemoteCatalogSource` implements `getInstallManifest`;\n * the REST-framed `RestCatalogSource` (the default for any catalog URL other\n * than `https://skaile.store`) does not. Calling it unconditionally would be a\n * runtime `TypeError`, so the pointer-only install path must capability-detect\n * first and fail with a clear, actionable message.\n */\nexport function supportsInstallManifest(source: unknown): source is InstallManifestSource {\n return (\n typeof (source as { getInstallManifest?: unknown } | null | undefined)?.getInstallManifest ===\n \"function\"\n );\n}\n\n/**\n * Minimal library surface the pointer-only install path needs.\n * `LocalIndex` satisfies this.\n */\nexport interface InstallLibrary {\n install(manifest: InstallManifest): Promise<{ installPath: string }>;\n}\n\n/**\n * Result of a pointer-only catalog install.\n */\nexport interface PointerOnlyInstallResult {\n /** Absolute path the verified asset bytes were written to. */\n installPath: string;\n /** The pinned upstream commit SHA the asset was fetched at. */\n commitSha: string;\n /** Number of files in the install manifest. */\n fileCount: number;\n}\n\n/**\n * Pointer-only catalog install — the `skaile install <ref>` code path.\n *\n * 1. Resolves the pointer-only {@link InstallManifest} from the Catalog.\n * 2. Hands it to the library, which fetches each file's bytes directly from\n * the upstream repo at the pinned commit, verifies every per-file SHA256\n * plus the composite SHA256, and only then writes the verified files.\n *\n * Both dependencies are injected so the function is unit-testable without a\n * network round-trip. In production the CLI passes a `RemoteCatalogSource`\n * and a `LocalIndex`.\n *\n * @param ref - Canonical asset ref (`kind:@<publisher>/<name>#<version>`).\n * @param deps - Injected catalog source + library.\n * @returns The install path, pinned commit SHA, and file count.\n * @throws When the ref is malformed, the manifest cannot be resolved, or any\n * hash verification fails. The underlying error message is surfaced as-is.\n */\nexport async function runPointerOnlyInstall(\n ref: string,\n deps: { catalog: InstallManifestSource; library: InstallLibrary },\n): Promise<PointerOnlyInstallResult> {\n let requested: ReturnType<typeof parseAssetRef>;\n try {\n requested = parseAssetRef(ref);\n } catch (e) {\n throw new Error(\n `malformed asset ref '${ref}' — expected ${REF_HINT}: ${e instanceof Error ? e.message : String(e)}`,\n );\n }\n const manifest = await deps.catalog.getInstallManifest(ref);\n // [M1] Identity check: the catalog must not install a different asset than\n // requested. Compare the PARSED refs (kind/publisher/name/pin) so equivalent\n // spellings (optional `kind:`, default `skill`) are treated as the same ref.\n const got = parseAssetRef(manifest.ref);\n if (\n got.kind !== requested.kind ||\n got.publisher !== requested.publisher ||\n got.name !== requested.name ||\n got.pin !== requested.pin\n ) {\n throw new Error(\n `catalog identity mismatch: requested '${ref}' but the catalog returned a manifest for '${manifest.ref}'`,\n );\n }\n const { installPath } = await deps.library.install(manifest);\n return {\n installPath,\n commitSha: manifest.source.commitSha,\n fileCount: manifest.files.length,\n };\n}\n\n/**\n * Print one summary line per `preset:` dependency `skaile install` expanded: how many\n * asset items joined the install set and how many instance items (`library://`,\n * placeholders) were skipped, which only `skaile preset apply` materialises.\n */\nexport function reportPresetExpansions(\n presets: readonly PresetExpansion[] | undefined,\n onLine: (line: string) => void = logInfo,\n): void {\n for (const preset of presets ?? []) {\n onLine(\n `preset ${preset.ref}: ${preset.assets} assets, ${preset.skipped} instance items skipped (apply with skaile preset apply)`,\n );\n }\n}\n\n/**\n * Print one line per agent instance `skaile install` rendered (with the files\n * written) and one per native agent file removed because its instance left `skaile.yaml`.\n */\nexport function reportAgentInstances(\n instances: readonly InstalledAgentInstance[] | undefined,\n removedFiles: readonly string[] | undefined,\n onLine: (line: string) => void = logInfo,\n onRemoved: (line: string) => void = logWarn,\n): void {\n for (const instance of instances ?? []) {\n onLine(`agent ${instance.id}: ${instance.files.join(\", \")}`);\n }\n for (const file of removedFiles ?? []) onRemoved(`Removed: ${file}`);\n}\n\n/** One `Re-locked` line per lock entry `install`/`update` rewrote for an already-locked asset. */\nexport function reportRelocked(\n relocked: string[] | undefined,\n onLine: (line: string) => void = logInfo,\n): void {\n for (const ref of relocked ?? []) onLine(`Re-locked ${ref}`);\n}\n\n/** One `! <ref> moved from <a> to <b>` line per locked asset that now resolves from another library. */\nexport function reportMoved(\n moved: readonly LibraryMove[] | undefined,\n onLine: (line: string) => void = logWarn,\n): void {\n for (const m of moved ?? []) onLine(`${m.ref} moved from ${m.from} to ${m.to}`);\n}\n\n/** One `replaced <old> → <new>` line per asset `install`/`update` moved to another locked version. */\nexport function reportReplaced(\n replaced: readonly ReplacedAsset[] | undefined,\n onLine: (line: string) => void = logInfo,\n): void {\n for (const r of replaced ?? []) onLine(`${r.ref} replaced ${r.from} → ${r.to}`);\n}\n\n/** One `Rewrote <file> (agent render changed)` line per rendered agent file whose bytes the CLI's render changed. */\nexport function reportRewritten(\n rewritten: readonly RewrittenAgent[] | undefined,\n onLine: (line: string) => void = logInfo,\n): void {\n for (const r of rewritten ?? []) {\n for (const f of r.files) onLine(`Rewrote ${f} (agent render changed)`);\n }\n}\n\n/**\n * Say which locked store assets `install`/`update` did not check against the store (p792,\n * p799). A chosen mode (air-gapped, `--no-catalog`) is one info line per asset; a store that\n * did not answer is an error line `store unreachable: could not check <ref> for updates`.\n *\n * @returns Whether any asset could not be checked because the store was unreachable: the\n * command then ends `Failed` with exit 1.\n */\nexport function reportStoreNotChecked(\n notChecked: readonly { ref: string; reason: string; detail: string }[] | undefined,\n): boolean {\n let unreachable = false;\n for (const n of notChecked ?? []) {\n if (n.reason === \"unreachable\") {\n unreachable = true;\n logErr(`store unreachable: could not check ${n.ref} for updates (${n.detail})`);\n } else if (n.reason === \"air-gapped\") {\n logInfo(`${n.ref} kept as locked (air-gapped: not checked against the store)`);\n } else {\n logInfo(`${n.ref} kept as locked (${n.detail})`);\n }\n }\n return unreachable;\n}\n\n/**\n * Creates the `skaile install` command.\n *\n * Two modes, selected by argument shape:\n *\n * - `skaile install` (no positional arg) — reads `skaile.yaml` and deploys all\n * declared assets (and their transitive dependencies) to the configured\n * driver target directory. Supports `--locked` for CI-mode install from a\n * lock file.\n * - `skaile install kind:@<publisher>/<name>#<version>` — pointer-only catalog\n * install: resolves the pointer-only install manifest from the configured\n * Catalog, fetches each file's bytes directly from the upstream repo at the\n * pinned commit, verifies every per-file + the composite SHA256, then writes\n * the verified files into the local Library.\n *\n * @returns Configured {@link Command} ready for `program.addCommand()`.\n * @docLink cli/commands/project#make-install-command\n */\nexport function makeInstallCommand(): Command {\n return new Command(\"install\")\n .description(`Install dependencies from skaile.yaml, or a single asset by ref (${REF_HINT})`)\n .argument(\"[ref]\", `Asset ref to install from the Catalog (${REF_HINT})`)\n .option(\"--locked\", \"Install from lock file (CI mode — fails on drift)\")\n .option(\"--project-dir <path>\", \"Project directory\", process.cwd())\n .option(\"--target <agent>\", `Agent framework (${TARGET_DEFAULT_HINT})`)\n .option(\n \"--global\",\n \"Install the global SSOT (~/.skaile/skaile.yaml), fanning out to every global harness\",\n )\n .option(\n \"--harness <ids>\",\n \"Comma-separated global harnesses to install into (default: all resolved); implies --global\",\n )\n .option(\n \"--link\",\n \"symlink local-path assets instead of copying (dev loop; machine-local, not for committing)\",\n )\n .option(\n \"--force\",\n \"Deploy over a folder no lock entry owns (a hand-made skill of the same name) instead of refusing\",\n )\n .action(runInstallCommand);\n}\n\n/** Options shape accepted by the `skaile install` command action. */\ninterface InstallCommandOptions {\n locked?: boolean;\n projectDir: string;\n target?: string;\n global?: boolean;\n harness?: string;\n link?: boolean;\n force?: boolean;\n}\n\n/**\n * Parse a `--harness a,b` value into validated {@link DriverTarget}s, exiting on\n * an unknown id. Returns `undefined` when the flag is absent (resolve the full\n * global set instead).\n */\nfunction parseHarnessFilter(raw: string | undefined): DriverTarget[] | undefined {\n if (!raw) return undefined;\n const ids = raw\n .split(\",\")\n .map((s) => s.trim())\n .filter(Boolean);\n const out: DriverTarget[] = [];\n for (const id of ids) {\n if (!(SUPPORTED_DRIVER_TARGETS as string[]).includes(id)) {\n logErr(`unknown harness '${id}' — expected one of: ${SUPPORTED_DRIVER_TARGETS.join(\", \")}`);\n process.exit(1);\n }\n out.push(id as DriverTarget);\n }\n return out.length > 0 ? out : undefined;\n}\n\n/**\n * `skaile install` action body. Dispatches by argument shape:\n * a positional `ref` selects pointer-only catalog install, otherwise the\n * legacy `skaile.yaml` install path runs.\n */\nasync function runInstallCommand(\n ref: string | undefined,\n opts: InstallCommandOptions,\n): Promise<void> {\n // ── Pointer-only catalog install: `skaile install <ref>` ──────────────\n if (ref !== undefined) {\n await runRefInstall(ref, opts);\n return;\n }\n\n // ── Legacy install: `skaile install` reads skaile.yaml ────────────────\n await runYamlInstall(opts);\n}\n\n/** Pointer-only catalog install path for `skaile install <ref>`. */\nasync function runRefInstall(ref: string, opts: InstallCommandOptions): Promise<void> {\n if (!isValidAssetRef(ref)) {\n logErr(`malformed asset ref '${ref}' — expected ${REF_HINT}`);\n process.exit(1);\n }\n // The store installs one exact version; without `#<version>` it answers a bare 400, so say\n // what is missing before the call.\n if (!parseAssetRef(ref).pin) {\n logErr(\n `${ref} needs a version: use ${ref}#<version>. A library asset is deployed with \\`skaile add ${ref}\\`, not \\`skaile install\\`.`,\n );\n process.exit(1);\n }\n const spinner = createSpinner();\n spinner.start(`Installing ${ref}`);\n try {\n const { openCatalogSource, openLibrary } = await import(\"../open-library.ts\");\n const catalog = await openCatalogSource({ projectDir: path.resolve(opts.projectDir) });\n // [H2] REST-framed catalogs (the default for any catalog URL other\n // than https://skaile.store) cannot serve install manifests. Detect\n // and fail clearly rather than throwing a runtime TypeError.\n if (!supportsInstallManifest(catalog)) {\n throw new Error(\n \"pointer-only install (skaile install <ref>) requires a tRPC-framed Catalog. \" +\n \"The configured catalog uses REST framing, which does not serve install \" +\n \"manifests. Set catalog.url to https://skaile.store, or catalog.framing: trpc, \" +\n `in ${userConfigPath()}.`,\n );\n }\n const library = await openLibrary();\n try {\n const result = await runPointerOnlyInstall(ref, { catalog, library });\n spinner.stop(\"Done\");\n logOk(`Installed ${colorRef(ref)}`);\n logInfo(`Path: ${S.dim(result.installPath)}`);\n logInfo(`Commit: ${S.dim(result.commitSha)}`);\n logInfo(`Files: ${S.dim(String(result.fileCount))}`);\n logInfo(\n S.dim(\n `Installed globally (see Path above) — use \\`skaile add ${ref}\\` to deploy into this project.`,\n ),\n );\n } finally {\n library.close();\n }\n } catch (err) {\n spinner.stop(\"Failed\");\n const msg = err instanceof Error ? err.message : String(err);\n if (/failed: 404\\b/.test(msg)) {\n logErr(\n `${ref} is not in the store. For a library asset use \\`skaile add ${ref.replace(/#.*$/, \"\")}\\`.`,\n );\n } else if (/unreachable/i.test(msg)) {\n logErr(`asset uninstallable — source commit no longer available (${msg})`);\n } else {\n logErr(msg);\n }\n process.exit(1);\n }\n}\n\n/** Legacy install path for bare `skaile install` (reads skaile.yaml). */\nasync function runYamlInstall(opts: InstallCommandOptions): Promise<void> {\n const projectDir = path.resolve(opts.projectDir);\n\n const harnesses = parseHarnessFilter(opts.harness);\n // `--harness` implies `--global`.\n if (opts.global || harnesses) {\n await runGlobalInstall(opts, harnesses);\n return;\n }\n\n // A project without a readable skaile.yaml stops here, before sources are cloned, assets\n // are deployed or undeployed, or the lock is written.\n requireProjectConfig(projectDir);\n\n // Hydrate sources declared in skaile.yaml before resolving assets, so\n // freshly checked-out projects pull their source clones automatically.\n try {\n const { ensureSourcesCloned } = await import(\"../ensure-sources.ts\");\n const hydrate = ensureSourcesCloned(projectDir, { quiet: true });\n if (hydrate.cloned.length > 0) {\n logOk(`Cloned source(s): ${hydrate.cloned.join(\", \")}`);\n }\n if (hydrate.failed.length > 0) {\n logErr(`Failed to clone source(s): ${hydrate.failed.join(\", \")}`);\n }\n } catch (err) {\n logWarn(`source hydration skipped: ${err instanceof Error ? err.message : String(err)}`);\n }\n\n const am = new AssetManager({\n registry: getKindRegistry(),\n projectDir,\n driverTarget: opts.target as DriverTarget,\n });\n const spinner = createSpinner();\n spinner.start(opts.locked ? \"Installing from lock file\" : \"Installing dependencies\");\n try {\n const result = await am.install({ locked: opts.locked, link: opts.link, force: opts.force });\n const storeUnreachable = result.storeNotChecked?.some((n) => n.reason === \"unreachable\");\n spinner.stop(\n result.agentInstanceErrors?.length || result.missing.length > 0 || storeUnreachable\n ? \"Failed\"\n : \"Done\",\n );\n if (result.deployed.length > 0) {\n for (const d of result.deployed) logOk(d);\n }\n for (const r of result.restored ?? []) {\n for (const f of r.restored) logInfo(`Restored ${f}`);\n for (const f of r.removed) logInfo(`Removed ${f} (not part of ${r.ref})`);\n }\n reportRewritten(result.rewritten);\n reportPresetExpansions(result.presets);\n reportAgentInstances(result.agentInstances, result.agentFilesRemoved);\n if (result.removed.length > 0) {\n for (const r of result.removed) logWarn(`Removed: ${r}`);\n }\n reportReplaced(result.replaced);\n reportRelocked(result.relocked);\n reportMoved(result.moved);\n if (\n result.deployed.length === 0 &&\n result.removed.length === 0 &&\n !result.replaced?.length &&\n result.missing.length === 0 &&\n !result.storeNotChecked?.length &&\n !result.relocked?.length &&\n !result.moved?.length &&\n !result.agentInstanceErrors?.length\n ) {\n logInfo(\"Nothing to install (already up to date).\");\n }\n if (result.agentInstanceErrors?.length) {\n logErr(\n `${result.agentInstanceErrors.length} agent instance(s) could not be rendered (see above)`,\n );\n process.exitCode = 1;\n }\n if (result.missing.length > 0) {\n for (const m of result.missing) logErr(`Missing: ${m}${result.missingHints?.[m] ?? \"\"}`);\n // Partial-miss must fail the process — CI can't otherwise distinguish a\n // clean install from \"half the assets never resolved\".\n process.exitCode = 1;\n }\n if (reportStoreNotChecked(result.storeNotChecked)) process.exitCode = 1;\n if (result.lockWritten) {\n logInfo(`Lock file written: ${S.dim(\"skaile.lock.yaml\")}`);\n }\n warnLegacyClaudeCopies(am);\n // Report-only: surface soft deps the declared assets reference but aren't\n // present. Never a prompt — install is a batch/CI path. Skipped under\n // --locked: that mode is \"restore exactly\", so an `add` nudge would jar.\n if (!opts.locked) await reportInstalledSoftDeps(am);\n } catch (err) {\n spinner.stop(\"Failed\");\n logErr(err instanceof SourceEntryError ? err.message : String(err));\n process.exit(1);\n }\n}\n\n/**\n * Report (never prompt) the body-link soft deps that the declared assets\n * reference but that aren't in the project — the `install` counterpart to the\n * `add`-time soft-dep surface. `install` is a batch/CI path (often non-TTY), so\n * it only ever prints a hint: pulling stays an explicit `skaile add`. Best-effort\n * — `reportSoftDeps` swallows any index failure and returns `[]`.\n */\nexport async function reportInstalledSoftDeps(\n am: Pick<AssetManager, \"listDeclared\" | \"reportSoftDeps\">,\n onHint: (line: string) => void = (l) => logInfo(S.dim(l)),\n): Promise<void> {\n try {\n const declared = (await am.listDeclared()).map((d) => d.ref);\n if (declared.length === 0) return;\n const edges = await am.reportSoftDeps(declared);\n for (const edge of edges) onHint(formatSoftDepHint(edge));\n } catch {\n // Best-effort: a soft-dep report must never fail an install that succeeded.\n }\n}\n\n/**\n * Global cross-harness install: deploy every dep declared in the global SSOT\n * (`~/.skaile/skaile.yaml`) into each resolved global harness's dir under `~`,\n * write the global lock (`~/.skaile/skaile.lock.yaml`), then print per-harness\n * state. `harnesses` is the `--harness` filter (omit for the full resolved set).\n */\nasync function runGlobalInstall(\n opts: InstallCommandOptions,\n harnesses: DriverTarget[] | undefined,\n): Promise<void> {\n const am = new AssetManager({\n registry: getKindRegistry(),\n projectDir: path.resolve(opts.projectDir),\n global: true,\n harnesses,\n });\n const spinner = createSpinner();\n spinner.start(\"Installing global dependencies\");\n try {\n const result = await am.install({ locked: opts.locked, link: opts.link, force: opts.force });\n const storeUnreachable = result.storeNotChecked?.some((n) => n.reason === \"unreachable\");\n spinner.stop(result.missing.length > 0 || storeUnreachable ? \"Failed\" : \"Done\");\n if (result.deployed.length > 0) for (const d of result.deployed) logOk(d);\n reportPresetExpansions(result.presets);\n if (result.removed.length > 0) for (const r of result.removed) logWarn(`Removed: ${r}`);\n reportReplaced(result.replaced);\n reportRelocked(result.relocked);\n reportMoved(result.moved);\n if (\n result.deployed.length === 0 &&\n result.removed.length === 0 &&\n !result.replaced?.length &&\n result.missing.length === 0 &&\n !result.storeNotChecked?.length &&\n !result.relocked?.length &&\n !result.moved?.length\n )\n logInfo(\"Nothing to install (already up to date).\");\n if (reportStoreNotChecked(result.storeNotChecked)) process.exitCode = 1;\n if (result.missing.length > 0) {\n for (const m of result.missing) logErr(`Missing: ${m}${result.missingHints?.[m] ?? \"\"}`);\n process.exitCode = 1;\n }\n if (result.lockWritten) logInfo(`Global lock written: ${S.dim(\"~/.skaile/skaile.lock.yaml\")}`);\n\n // Per-harness reconciliation summary so a partial fan-out is visible.\n const state = am.globalState({});\n const byHarness = new Map<string, number>();\n for (const s of state)\n if (s.state === \"installed\") byHarness.set(s.harness, (byHarness.get(s.harness) ?? 0) + 1);\n for (const [harness, n] of byHarness) logInfo(`${harness}: ${n} installed`);\n } catch (err) {\n spinner.stop(\"Failed\");\n logErr(String(err));\n process.exit(1);\n }\n}\n\n/**\n * Creates the `skaile check` command.\n *\n * Fails (exit 1) on every problem {@link AssetManager.projectState} reports: unmet\n * requirements of deployed assets, a declared dep that never resolved into the lock (its\n * library or source is gone, like `skaile list` showing it as `declared`) or never\n * materialized (e.g. a store-sourced `mcp-server`, #462), a locked asset whose library is\n * gone or whose deployed copy or files are missing, a locked library asset whose files\n * changed since the lock (or whose lock hash predates the shared asset hash), and an\n * `agents.<id>.ref` that binds to no agent. `doctor`, `outdated`, `diff` and\n * `install --locked` take their verdict from the same state.\n *\n * @returns Configured {@link Command} ready for `program.addCommand()`.\n * @docLink cli/commands/project#make-check-command\n */\nexport function makeCheckCommand(): Command {\n return new Command(\"check\")\n .description(\"Check for unmet requirements\")\n .option(\"--project-dir <path>\", \"Project directory\", process.cwd())\n .action(async (opts) => {\n requireProjectConfig(opts.projectDir);\n const am = new AssetManager({\n registry: getKindRegistry(),\n projectDir: path.resolve(opts.projectDir),\n });\n const { gaps } = await am.projectState();\n const edited = await editedConventionFiles(path.resolve(opts.projectDir));\n if (gaps.length === 0 && edited.length === 0) {\n logOk(\"All dependencies satisfied.\");\n } else {\n for (const g of gaps) logErr(g.message);\n for (const e of edited) logErr(e);\n process.exit(1);\n }\n });\n}\n\n/**\n * One message per convention file (SOUL.md, knowledge/, …) of a bound agent that was edited\n * after `skaile rebuild` pinned it: the compile manifest, not the file, is what the agent\n * runs from, so the edit never reaches it. Instances bound to the same agent directory share\n * the files, so one message names every instance that runs from them. A binding that resolves\n * to no agent is a `projectState` gap, not reported here. Shared by `check` and `doctor`.\n */\nexport async function editedConventionFiles(projectDir: string): Promise<string[]> {\n const instances = effectiveAgentInstances(resolveSkWorkspaceConfig(projectDir));\n const byDir = new Map<string, { ref: string; ids: string[] }>();\n for (const [id, instance] of Object.entries(instances)) {\n let agentDir: string | undefined;\n try {\n agentDir = resolveAgentDefinitionDir(projectDir, instance.ref);\n } catch (err) {\n if (err instanceof AgentRefResolutionError) continue;\n throw err;\n }\n if (!agentDir) continue;\n const bound = byDir.get(agentDir);\n if (bound) bound.ids.push(id);\n else byDir.set(agentDir, { ref: instance.ref, ids: [id] });\n }\n const messages: string[] = [];\n for (const [agentDir, { ref, ids }] of byDir) {\n const drifted = await verifyConventionItems({\n agentDir,\n projectDir,\n registry: getKindRegistry(),\n });\n const label = `${ids.length === 1 ? \"instance\" : \"instances\"} ${ids.join(\", \")}`;\n for (const err of drifted) messages.push(`${ref} (${label}): ${err.message}`);\n }\n return messages;\n}\n\n/**\n * Creates the `skaile clean` command.\n *\n * Removes all skaile-managed assets tracked in `skaile.lock.yaml` from the\n * workspace. With `--all` also removes history, patches, repos, and the lock\n * file itself. Preserves unmanaged (manually placed) assets.\n *\n * @returns Configured {@link Command} ready for `program.addCommand()`.\n * @docLink cli/commands/project#make-clean-command\n */\nexport function makeCleanCommand(): Command {\n return new Command(\"clean\")\n .description(\"Remove all skaile-managed assets from the workspace\")\n .option(\"--all\", \"Full reset: also remove history, patches, repos, and lock file\")\n .option(\"--dry-run\", \"Show what would be removed without doing it\")\n .option(\"-y, --yes\", \"Skip confirmation prompt\")\n .option(\"--project-dir <path>\", \"Project directory\", process.cwd())\n .option(\"--target <agent>\", `Agent framework (${TARGET_DEFAULT_HINT})`)\n .action(async (opts) => {\n const am = new AssetManager({\n registry: getKindRegistry(),\n projectDir: path.resolve(opts.projectDir),\n driverTarget: opts.target as DriverTarget,\n });\n\n // Preview: load lock file to show what will be cleaned\n const lock = readLock(path.resolve(opts.projectDir, \"skaile.lock.yaml\"));\n\n if (!lock || Object.keys(lock.assets).length === 0) {\n logInfo(\"Nothing to clean (no skaile-managed assets found).\");\n return;\n }\n\n const assetRefs = Object.keys(lock.assets);\n console.log();\n console.log(` ${S.heading(\"Assets to remove:\")} ${S.dim(`(${assetRefs.length})`)}`);\n for (const ref of assetRefs) {\n console.log(` ${colorRef(ref)}`);\n }\n\n if (opts.all) {\n console.log();\n console.log(` ${S.heading(\"Also removing:\")}`);\n console.log(` ${S.dim(\".skaile/history.yaml\")}`);\n console.log(` ${S.dim(\".skaile/patches/\")}`);\n console.log(` ${S.dim(\"skaile.lock.yaml\")}`);\n }\n\n if (opts.dryRun) {\n console.log();\n logInfo(\"Dry run — no changes made.\");\n return;\n }\n\n if (!opts.yes) {\n const confirm = await p.confirm({ message: \"Proceed?\" });\n if (p.isCancel(confirm) || !confirm) {\n logInfo(\"Cancelled.\");\n return;\n }\n }\n\n const result = am.clean({ all: opts.all });\n\n console.log();\n for (const r of result.removed) {\n logOk(`Removed ${r}`);\n }\n for (const s of result.skipped) {\n logWarn(`Skipped ${s.ref}: ${s.reason}`);\n }\n if (result.unmanaged.length > 0) {\n console.log();\n logInfo(`Kept ${result.unmanaged.length} unmanaged asset(s):`);\n for (const u of result.unmanaged) {\n console.log(` ${S.dim(u)}`);\n }\n }\n if (opts.all) {\n console.log();\n logOk(\"Full reset complete.\");\n }\n });\n}\n"]}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { compositeSha256 } from './chunk-
|
|
2
|
-
import { parseAssetRef } from './chunk-
|
|
1
|
+
import { compositeSha256 } from './chunk-ANSZULXH.js';
|
|
2
|
+
import { parseAssetRef } from './chunk-VY6NTFE7.js';
|
|
3
3
|
import { createHash } from 'crypto';
|
|
4
4
|
import { rm, mkdir, writeFile } from 'fs/promises';
|
|
5
5
|
import { isAbsolute, resolve, sep, join, dirname } from 'path';
|
|
@@ -35,7 +35,7 @@ function longestCommonDirPrefix(paths) {
|
|
|
35
35
|
}
|
|
36
36
|
async function installFromManifest(opts) {
|
|
37
37
|
const { manifest, libraryRoot } = opts;
|
|
38
|
-
const fetcher = opts.fetcher ?? (await import('./source-fetch-github-
|
|
38
|
+
const fetcher = opts.fetcher ?? (await import('./source-fetch-github-ST4MFL3D.js')).fetchAssetFilesFromGitHub;
|
|
39
39
|
if (opts.targetDir !== void 0) {
|
|
40
40
|
return installFlat(manifest, opts.targetDir, fetcher);
|
|
41
41
|
}
|
|
@@ -123,5 +123,5 @@ async function installFlat(manifest, targetDir, fetcher) {
|
|
|
123
123
|
}
|
|
124
124
|
|
|
125
125
|
export { assertSafeManifestPath, installFromManifest, longestCommonDirPrefix };
|
|
126
|
-
//# sourceMappingURL=chunk-
|
|
127
|
-
//# sourceMappingURL=chunk-
|
|
126
|
+
//# sourceMappingURL=chunk-KRRHADE7.js.map
|
|
127
|
+
//# sourceMappingURL=chunk-KRRHADE7.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../library/src/install/install-from-manifest.ts"],"names":[],"mappings":";;;;;;AAgDO,SAAS,sBAAA,CAAuB,aAAqB,CAAA,EAAiB;AAC3E,EAAA,MAAM,MAAM,MAAa;AACvB,IAAA,MAAM,IAAI,KAAA,CAAM,CAAA,yBAAA,EAA4B,CAAC,CAAA,CAAE,CAAA;AAAA,EACjD,CAAA;AACA,EAAA,IAAI,CAAC,CAAA,IAAK,CAAA,CAAE,MAAA,KAAW,GAAG,GAAA,EAAI;AAC9B,EAAA,IAAI,UAAA,CAAW,CAAC,CAAA,IAAK,CAAA,CAAE,UAAA,CAAW,GAAG,CAAA,IAAK,CAAA,C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A,CAAE,IAAA,CAAK,MAAM,SAAA,CAAU,MAAA,GAAS,CAAC,CAAA,GAAI,CAAA,CAAE,IAAA;AAEnE,IAAA,sBAAA,CAAuB,QAAQ,OAAO,CAAA;AACtC,IAAA,MAAM,IAAA,GAAO,IAAA,CAAK,MAAA,EAAQ,OAAO,CAAA;AACjC,IAAA,MAAM,MAAM,OAAA,CAAQ,IAAI,GAAG,EAAE,SAAA,EAAW,MAAM,CAAA;AAC9C,IAAA,MAAM,SAAA,CAAU,MAAM,GAAG,CAAA;AAAA,EAC3B;AAEA,EAAA,OAAO,EAAE,aAAa,MAAA,EAAO;AAC/B","file":"chunk-PXDWTJ3P.js","sourcesContent":["/**\n * Pointer-only install path.\n *\n * Given an {@link InstallManifest} (the Pointer Triple the Catalog hands\n * clients), this:\n *\n * 1. fetches the asset bytes directly from the upstream repo at the pinned\n * commit (via an injectable fetcher, default {@link fetchAssetFilesFromGitHub});\n * 2. verifies EVERY per-file SHA256 against `manifest.files[].sha256`;\n * 3. verifies the composite SHA256 rollup over the sorted\n * `<path>:<sha256>\\n` lines against `manifest.sha256`;\n * 4. writes the verified bytes under `<libraryRoot>/@<publisher>/<name>/<version>`.\n *\n * Any hash mismatch is a hard failure — bytes are not written if per-file\n * verification fails, and the composite check is the second gate.\n *\n * @docLink packages/library/concepts#install\n */\n\nimport { createHash } from \"node:crypto\";\nimport { mkdir, rm, writeFile } from \"node:fs/promises\";\nimport { dirname, isAbsolute, join, resolve, sep } from \"node:path\";\nimport type { InstallManifest } from \"@skaile/workspaces/types\";\n// Narrow module, not the `core` barrel: the barrel's chunks carry `import.meta`,\n// which breaks consumers that transpile this entry to CommonJS.\nimport { parseAssetRef } from \"../../../core/src/models.js\";\nimport { compositeSha256 } from \"../../../core/src/publish-manifest.js\";\n\n/**\n * Validate a single manifest-supplied file path against path traversal.\n *\n * `manifest.files[].path` comes off the network — the attacker controls the\n * entire manifest (and therefore every hash in it), so hash verification can\n * NEVER mitigate a malicious *destination*. A path like\n * `../../../../home/user/.bashrc` or an absolute path would escape\n * `installPath` and yield an arbitrary file write. Every path is checked\n * BEFORE any fetch or write happens; the first bad path aborts the entire\n * install with a hard throw.\n *\n * A path is rejected if ANY of:\n * - it is empty;\n * - it is absolute (`path.isAbsolute`) or has a leading slash;\n * - it contains a `..` segment;\n * - `path.resolve(installPath, p)` is not `installPath` itself and does not\n * start with `installPath + path.sep` (escapes the install dir).\n *\n * @throws An error matching `/unsafe path in manifest/` on the first bad path.\n */\nexport function assertSafeManifestPath(installPath: string, p: string): void {\n const bad = (): never => {\n throw new Error(`unsafe path in manifest: ${p}`);\n };\n if (!p || p.length === 0) bad();\n if (isAbsolute(p) || p.startsWith(\"/\") || p.startsWith(\"\\\\\")) bad();\n const segments = p.split(/[/\\\\]/);\n if (segments.some((s) => s === \"..\")) bad();\n const resolved = resolve(installPath, p);\n if (resolved !== installPath && !resolved.startsWith(installPath + sep)) bad();\n}\n\n/**\n * Validate one component (publisher / name / version) of the attacker-controlled\n * `manifest.ref`.\n *\n * `installPath` is built by joining these components onto `libraryRoot`. A\n * component containing a path separator or a `..` / leading-dot segment would\n * let `installPath` itself escape `libraryRoot` — yielding an arbitrary file\n * write AND, via the pre-write `rm(installPath, { recursive })`, an arbitrary\n * recursive delete. The per-file `assertSafeManifestPath` guard cannot catch\n * this: it only validates each `f.path` *relative to* `installPath`, never\n * `installPath` itself. Components must be plain identifier-like strings.\n *\n * @throws An error matching `/unsafe ref/` on a bad component.\n */\nfunction assertSafeRefComponent(kind: string, value: string): void {\n // Reject empty, leading-dot (covers `.` and `..`), path separators, and\n // ASCII control characters (NUL et al.) — fails a malformed segment fast\n // with a domain-specific error rather than a raw EINVAL deeper in.\n const hasControlChar = [...value].some((c) => c.charCodeAt(0) < 0x20);\n if (!value || value.startsWith(\".\") || /[/\\\\]/.test(value) || hasControlChar) {\n throw new Error(`unsafe ref ${kind} component in manifest: '${value}'`);\n }\n}\n\n/**\n * Longest common **directory** prefix across manifest paths, compared by whole\n * slash-delimited segments (never raw-string — so `app/` and `app-data/` never\n * collide). Each path's basename is excluded, so the result is always a\n * directory prefix and every path keeps a non-empty remainder after stripping.\n *\n * Used by flat mode to reproduce the platform pointer-installer's asset-rooting:\n * the store persists repo-root-relative paths (e.g. `skaile-platform/mcpo/xls/MCP.md`)\n * but the runner scans `.skaile/assets/<kind>/<name>/` for immediate-child files,\n * so this prefix is stripped from the WRITE path while the fetch keeps the full\n * repo path. Returns `''` when there is no common directory (a no-op strip).\n */\nexport function longestCommonDirPrefix(paths: readonly string[]): string {\n if (paths.length === 0) return \"\";\n const dirSegments = paths.map((p) => p.split(\"/\").slice(0, -1));\n let common = dirSegments[0]!;\n for (let i = 1; i < dirSegments.length && common.length > 0; i++) {\n const segs = dirSegments[i]!;\n let n = 0;\n while (n < common.length && n < segs.length && common[n] === segs[n]) n++;\n common = common.slice(0, n);\n }\n return common.join(\"/\");\n}\n\n/**\n * Fetcher signature — fetches `{ path → Buffer }` for the requested paths at\n * a pinned upstream commit. {@link fetchAssetFilesFromGitHub} is the default\n * production implementation; tests inject a mock.\n */\nexport type AssetFetcher = (opts: {\n url: string;\n commitSha: string;\n paths: string[];\n}) => Promise<Record<string, Buffer>>;\n\n/**\n * Options for {@link installFromManifest}.\n */\nexport interface InstallOpts {\n /** The pointer-only install manifest from the Catalog. */\n manifest: InstallManifest;\n /** Filesystem root the asset is installed under (ref-derived mode). */\n libraryRoot: string;\n /**\n * Pluggable fetcher so tests can inject mock data. Defaults to\n * {@link fetchAssetFilesFromGitHub} in production.\n */\n fetcher?: AssetFetcher;\n /**\n * Flat-layout mode. When set, install-core reproduces the platform\n * pointer-installer's behavior: it ignores `libraryRoot`/ref-derivation, does\n * NOT parse `manifest.ref` and does NOT verify the composite sha256, strips\n * the longest-common-dir prefix from each path, per-file sha256-verifies, and\n * writes the stripped paths as immediate children of `targetDir` (what the\n * runner's `.skaile/assets/<kind>/<name>/` scan requires). `installPath` is\n * `targetDir`. Absent → unchanged ref-derived `@<pub>/name/version/<path>`\n * layout with composite verify.\n */\n targetDir?: string;\n}\n\n/**\n * Result of a successful {@link installFromManifest} call.\n */\nexport interface InstallResult {\n /** Absolute path the asset files were written to. */\n installPath: string;\n}\n\n/**\n * Fetch, verify, and write an asset's files per its {@link InstallManifest}.\n *\n * @throws An error matching `/hash mismatch/i` if any per-file SHA256 differs.\n * @throws An error matching `/composite hash mismatch/i` if the rollup differs.\n * @throws An error if the ref is malformed or the fetcher omits a file.\n */\nexport async function installFromManifest(opts: InstallOpts): Promise<InstallResult> {\n const { manifest, libraryRoot } = opts;\n const fetcher =\n opts.fetcher ?? (await import(\"./source-fetch-github.js\")).fetchAssetFilesFromGitHub;\n\n // Flat mode: reproduce the platform pointer-installer's asset-rooted layout.\n // No ref parse, no composite verify — the platform store may not satisfy a\n // ref-grammar or composite, and the runner only needs immediate-child files.\n if (opts.targetDir !== undefined) {\n return installFlat(manifest, opts.targetDir, fetcher);\n }\n\n // 1. Parse ref into install path: `skill:@x/git#1.0.0` → `<root>/@x/git/1.0.0`.\n // Done first so the C1 path-traversal guard can resolve against installPath\n // BEFORE any network fetch happens. The ref is attacker-controlled, so each\n // segment is further validated as a safe path component (H1) after parsing.\n // `parseAssetRef` is the single canonical grammar (`kind:@publisher/name#version`);\n // the legacy trailing-`@version` shape was removed in core and is rejected here.\n let parsed: ReturnType<typeof parseAssetRef>;\n try {\n parsed = parseAssetRef(manifest.ref);\n } catch (e) {\n throw new Error(`invalid ref: ${manifest.ref}: ${e instanceof Error ? e.message : String(e)}`);\n }\n const publisher = parsed.publisher;\n const name = parsed.name;\n const version = parsed.pin;\n if (!publisher) throw new Error(`invalid ref: ${manifest.ref} (missing publisher)`);\n if (!version) throw new Error(`invalid ref: ${manifest.ref} (missing version pin)`);\n assertSafeRefComponent(\"publisher\", publisher);\n assertSafeRefComponent(\"name\", name);\n assertSafeRefComponent(\"version\", version);\n const root = resolve(libraryRoot);\n const installPath = resolve(join(root, `@${publisher}`, name, version));\n // Defense in depth: even with the segment guards above, assert the built\n // installPath stays strictly inside libraryRoot before any write or `rm`.\n if (installPath !== root && !installPath.startsWith(root + sep)) {\n throw new Error(`unsafe install path: ref '${manifest.ref}' resolves outside the library root`);\n }\n\n // 2. [C1] Validate EVERY manifest path against traversal BEFORE fetching.\n // The attacker controls the manifest (and thus all hashes) — hashes verify\n // content, never destination. Reject the whole install on the first bad path.\n for (const f of manifest.files) {\n assertSafeManifestPath(installPath, f.path);\n }\n\n // 3. Fetch all files at the pinned commit.\n const paths = manifest.files.map((f) => f.path);\n const bytes = await fetcher({\n url: manifest.source.url,\n commitSha: manifest.source.commitSha,\n paths,\n });\n\n // 4. Verify per-file SHA256 — hard fail before writing anything. The path\n // key used to read from the fetcher result is re-guarded as defense in depth.\n for (const f of manifest.files) {\n assertSafeManifestPath(installPath, f.path);\n const buf = bytes[f.path];\n if (!buf) throw new Error(`fetcher returned no bytes for ${f.path}`);\n const actual = createHash(\"sha256\").update(buf).digest(\"hex\");\n if (actual !== f.sha256) {\n throw new Error(`hash mismatch for ${f.path}: expected ${f.sha256}, got ${actual}`);\n }\n }\n\n // 5. Verify composite SHA256 over the sorted `<path>:<sha256>\\n` lines.\n const actualComposite = compositeSha256(manifest.files);\n if (actualComposite !== manifest.sha256) {\n throw new Error(`composite hash mismatch: expected ${manifest.sha256}, got ${actualComposite}`);\n }\n\n // 6. [M1] Write all verified files. A failed install must leave NO partial\n // directory: any prior `installPath` is removed first (clean overwrite), and\n // a mid-loop write failure removes the partially-written tree before\n // rethrowing.\n await rm(installPath, { recursive: true, force: true });\n try {\n for (const f of manifest.files) {\n const target = join(installPath, f.path);\n await mkdir(dirname(target), { recursive: true });\n await writeFile(target, bytes[f.path]!);\n }\n } catch (e) {\n await rm(installPath, { recursive: true, force: true }).catch(() => {});\n throw e;\n }\n\n return { installPath };\n}\n\n/**\n * Flat-layout install — the platform pointer-installer's behavior, made canonical\n * in install-core. Validates every path, fetches with the FULL repo paths, per-file\n * sha256-verifies, then strips the longest-common-dir prefix and writes each file\n * as `join(targetDir, path.slice(assetRoot.length + 1))` — immediate children of\n * `targetDir`. No ref parse, no composite check.\n */\nasync function installFlat(\n manifest: InstallManifest,\n targetDir: string,\n fetcher: AssetFetcher,\n): Promise<InstallResult> {\n const target = resolve(targetDir);\n\n // Gate every path before any fetch — the attacker controls the whole manifest.\n for (const f of manifest.files) {\n assertSafeManifestPath(target, f.path);\n }\n\n // Fetch keys off the FULL repo path (matches the upstream tree).\n const paths = manifest.files.map((f) => f.path);\n const bytes = await fetcher({\n url: manifest.source.url,\n commitSha: manifest.source.commitSha,\n paths,\n });\n\n // Strip the asset-root dir prefix from the WRITE path only — the fetch above\n // still keyed off the full repo path. Stripping removes leading whole segments\n // (never the basename), so a non-empty remainder always survives.\n const assetRoot = longestCommonDirPrefix(paths);\n\n for (const f of manifest.files) {\n const buf = bytes[f.path];\n if (!buf) throw new Error(`fetcher returned no bytes for ${f.path}`);\n const actual = createHash(\"sha256\").update(buf).digest(\"hex\");\n if (actual !== f.sha256) {\n throw new Error(`hash mismatch for ${f.path}: expected ${f.sha256}, got ${actual}`);\n }\n const relPath = assetRoot ? f.path.slice(assetRoot.length + 1) : f.path;\n // Re-guard the post-strip destination — it is what we actually write.\n assertSafeManifestPath(target, relPath);\n const dest = join(target, relPath);\n await mkdir(dirname(dest), { recursive: true });\n await writeFile(dest, buf);\n }\n\n return { installPath: target };\n}\n"]}
|
|
1
|
+
{"version":3,"sources":["../library/src/install/install-from-manifest.ts"],"names":[],"mappings":";;;;;;AAgDO,SAAS,sBAAA,CAAuB,aAAqB,CAAA,EAAiB;AAC3E,EAAA,MAAM,MAAM,MAAa;AACvB,IAAA,MAAM,IAAI,KAAA,CAAM,CAAA,yBAAA,EAA4B,CAAC,CAAA,CAAE,CAAA;AAAA,EACjD,CAAA;AACA,EAAA,IAAI,CAAC,CAAA,IAAK,CAAA,CAAE,MAAA,KAAW,GAAG,GAAA,EAAI;AAC9B,EAAA,IAAI,UAAA,CAAW,CAAC,CAAA,IAAK,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AAA,IACpF;AACA,IAAA,MAAM,OAAA,GAAU,YAAY,CAAA,CAAE,IAAA,CAAK,MAAM,SAAA,CAAU,MAAA,GAAS,CAAC,CAAA,GAAI,CAAA,CAAE,IAAA;AAEnE,IAAA,sBAAA,CAAuB,QAAQ,OAAO,CAAA;AACtC,IAAA,MAAM,IAAA,GAAO,IAAA,CAAK,MAAA,EAAQ,OAAO,CAAA;AACjC,IAAA,MAAM,MAAM,OAAA,CAAQ,IAAI,GAAG,EAAE,SAAA,EAAW,MAAM,CAAA;AAC9C,IAAA,MAAM,SAAA,CAAU,MAAM,GAAG,CAAA;AAAA,EAC3B;AAEA,EAAA,OAAO,EAAE,aAAa,MAAA,EAAO;AAC/B","file":"chunk-KRRHADE7.js","sourcesContent":["/**\n * Pointer-only install path.\n *\n * Given an {@link InstallManifest} (the Pointer Triple the Catalog hands\n * clients), this:\n *\n * 1. fetches the asset bytes directly from the upstream repo at the pinned\n * commit (via an injectable fetcher, default {@link fetchAssetFilesFromGitHub});\n * 2. verifies EVERY per-file SHA256 against `manifest.files[].sha256`;\n * 3. verifies the composite SHA256 rollup over the sorted\n * `<path>:<sha256>\\n` lines against `manifest.sha256`;\n * 4. writes the verified bytes under `<libraryRoot>/@<publisher>/<name>/<version>`.\n *\n * Any hash mismatch is a hard failure — bytes are not written if per-file\n * verification fails, and the composite check is the second gate.\n *\n * @docLink packages/library/concepts#install\n */\n\nimport { createHash } from \"node:crypto\";\nimport { mkdir, rm, writeFile } from \"node:fs/promises\";\nimport { dirname, isAbsolute, join, resolve, sep } from \"node:path\";\nimport type { InstallManifest } from \"@skaile/workspaces/types\";\n// Narrow module, not the `core` barrel: the barrel's chunks carry `import.meta`,\n// which breaks consumers that transpile this entry to CommonJS.\nimport { parseAssetRef } from \"../../../core/src/models.js\";\nimport { compositeSha256 } from \"../../../core/src/publish-manifest.js\";\n\n/**\n * Validate a single manifest-supplied file path against path traversal.\n *\n * `manifest.files[].path` comes off the network — the attacker controls the\n * entire manifest (and therefore every hash in it), so hash verification can\n * NEVER mitigate a malicious *destination*. A path like\n * `../../../../home/user/.bashrc` or an absolute path would escape\n * `installPath` and yield an arbitrary file write. Every path is checked\n * BEFORE any fetch or write happens; the first bad path aborts the entire\n * install with a hard throw.\n *\n * A path is rejected if ANY of:\n * - it is empty;\n * - it is absolute (`path.isAbsolute`) or has a leading slash;\n * - it contains a `..` segment;\n * - `path.resolve(installPath, p)` is not `installPath` itself and does not\n * start with `installPath + path.sep` (escapes the install dir).\n *\n * @throws An error matching `/unsafe path in manifest/` on the first bad path.\n */\nexport function assertSafeManifestPath(installPath: string, p: string): void {\n const bad = (): never => {\n throw new Error(`unsafe path in manifest: ${p}`);\n };\n if (!p || p.length === 0) bad();\n if (isAbsolute(p) || p.startsWith(\"/\") || p.startsWith(\"\\\\\")) bad();\n const segments = p.split(/[/\\\\]/);\n if (segments.some((s) => s === \"..\")) bad();\n const resolved = resolve(installPath, p);\n if (resolved !== installPath && !resolved.startsWith(installPath + sep)) bad();\n}\n\n/**\n * Validate one component (publisher / name / version) of the attacker-controlled\n * `manifest.ref`.\n *\n * `installPath` is built by joining these components onto `libraryRoot`. A\n * component containing a path separator or a `..` / leading-dot segment would\n * let `installPath` itself escape `libraryRoot` — yielding an arbitrary file\n * write AND, via the pre-write `rm(installPath, { recursive })`, an arbitrary\n * recursive delete. The per-file `assertSafeManifestPath` guard cannot catch\n * this: it only validates each `f.path` *relative to* `installPath`, never\n * `installPath` itself. Components must be plain identifier-like strings.\n *\n * @throws An error matching `/unsafe ref/` on a bad component.\n */\nfunction assertSafeRefComponent(kind: string, value: string): void {\n // Reject empty, leading-dot (covers `.` and `..`), path separators, and\n // ASCII control characters (NUL et al.) — fails a malformed segment fast\n // with a domain-specific error rather than a raw EINVAL deeper in.\n const hasControlChar = [...value].some((c) => c.charCodeAt(0) < 0x20);\n if (!value || value.startsWith(\".\") || /[/\\\\]/.test(value) || hasControlChar) {\n throw new Error(`unsafe ref ${kind} component in manifest: '${value}'`);\n }\n}\n\n/**\n * Longest common **directory** prefix across manifest paths, compared by whole\n * slash-delimited segments (never raw-string — so `app/` and `app-data/` never\n * collide). Each path's basename is excluded, so the result is always a\n * directory prefix and every path keeps a non-empty remainder after stripping.\n *\n * Used by flat mode to reproduce the platform pointer-installer's asset-rooting:\n * the store persists repo-root-relative paths (e.g. `skaile-platform/mcpo/xls/MCP.md`)\n * but the runner scans `.skaile/assets/<kind>/<name>/` for immediate-child files,\n * so this prefix is stripped from the WRITE path while the fetch keeps the full\n * repo path. Returns `''` when there is no common directory (a no-op strip).\n */\nexport function longestCommonDirPrefix(paths: readonly string[]): string {\n if (paths.length === 0) return \"\";\n const dirSegments = paths.map((p) => p.split(\"/\").slice(0, -1));\n let common = dirSegments[0]!;\n for (let i = 1; i < dirSegments.length && common.length > 0; i++) {\n const segs = dirSegments[i]!;\n let n = 0;\n while (n < common.length && n < segs.length && common[n] === segs[n]) n++;\n common = common.slice(0, n);\n }\n return common.join(\"/\");\n}\n\n/**\n * Fetcher signature — fetches `{ path → Buffer }` for the requested paths at\n * a pinned upstream commit. {@link fetchAssetFilesFromGitHub} is the default\n * production implementation; tests inject a mock.\n */\nexport type AssetFetcher = (opts: {\n url: string;\n commitSha: string;\n paths: string[];\n}) => Promise<Record<string, Buffer>>;\n\n/**\n * Options for {@link installFromManifest}.\n */\nexport interface InstallOpts {\n /** The pointer-only install manifest from the Catalog. */\n manifest: InstallManifest;\n /** Filesystem root the asset is installed under (ref-derived mode). */\n libraryRoot: string;\n /**\n * Pluggable fetcher so tests can inject mock data. Defaults to\n * {@link fetchAssetFilesFromGitHub} in production.\n */\n fetcher?: AssetFetcher;\n /**\n * Flat-layout mode. When set, install-core reproduces the platform\n * pointer-installer's behavior: it ignores `libraryRoot`/ref-derivation, does\n * NOT parse `manifest.ref` and does NOT verify the composite sha256, strips\n * the longest-common-dir prefix from each path, per-file sha256-verifies, and\n * writes the stripped paths as immediate children of `targetDir` (what the\n * runner's `.skaile/assets/<kind>/<name>/` scan requires). `installPath` is\n * `targetDir`. Absent → unchanged ref-derived `@<pub>/name/version/<path>`\n * layout with composite verify.\n */\n targetDir?: string;\n}\n\n/**\n * Result of a successful {@link installFromManifest} call.\n */\nexport interface InstallResult {\n /** Absolute path the asset files were written to. */\n installPath: string;\n}\n\n/**\n * Fetch, verify, and write an asset's files per its {@link InstallManifest}.\n *\n * @throws An error matching `/hash mismatch/i` if any per-file SHA256 differs.\n * @throws An error matching `/composite hash mismatch/i` if the rollup differs.\n * @throws An error if the ref is malformed or the fetcher omits a file.\n */\nexport async function installFromManifest(opts: InstallOpts): Promise<InstallResult> {\n const { manifest, libraryRoot } = opts;\n const fetcher =\n opts.fetcher ?? (await import(\"./source-fetch-github.js\")).fetchAssetFilesFromGitHub;\n\n // Flat mode: reproduce the platform pointer-installer's asset-rooted layout.\n // No ref parse, no composite verify — the platform store may not satisfy a\n // ref-grammar or composite, and the runner only needs immediate-child files.\n if (opts.targetDir !== undefined) {\n return installFlat(manifest, opts.targetDir, fetcher);\n }\n\n // 1. Parse ref into install path: `skill:@x/git#1.0.0` → `<root>/@x/git/1.0.0`.\n // Done first so the C1 path-traversal guard can resolve against installPath\n // BEFORE any network fetch happens. The ref is attacker-controlled, so each\n // segment is further validated as a safe path component (H1) after parsing.\n // `parseAssetRef` is the single canonical grammar (`kind:@publisher/name#version`);\n // the legacy trailing-`@version` shape was removed in core and is rejected here.\n let parsed: ReturnType<typeof parseAssetRef>;\n try {\n parsed = parseAssetRef(manifest.ref);\n } catch (e) {\n throw new Error(`invalid ref: ${manifest.ref}: ${e instanceof Error ? e.message : String(e)}`);\n }\n const publisher = parsed.publisher;\n const name = parsed.name;\n const version = parsed.pin;\n if (!publisher) throw new Error(`invalid ref: ${manifest.ref} (missing publisher)`);\n if (!version) throw new Error(`invalid ref: ${manifest.ref} (missing version pin)`);\n assertSafeRefComponent(\"publisher\", publisher);\n assertSafeRefComponent(\"name\", name);\n assertSafeRefComponent(\"version\", version);\n const root = resolve(libraryRoot);\n const installPath = resolve(join(root, `@${publisher}`, name, version));\n // Defense in depth: even with the segment guards above, assert the built\n // installPath stays strictly inside libraryRoot before any write or `rm`.\n if (installPath !== root && !installPath.startsWith(root + sep)) {\n throw new Error(`unsafe install path: ref '${manifest.ref}' resolves outside the library root`);\n }\n\n // 2. [C1] Validate EVERY manifest path against traversal BEFORE fetching.\n // The attacker controls the manifest (and thus all hashes) — hashes verify\n // content, never destination. Reject the whole install on the first bad path.\n for (const f of manifest.files) {\n assertSafeManifestPath(installPath, f.path);\n }\n\n // 3. Fetch all files at the pinned commit.\n const paths = manifest.files.map((f) => f.path);\n const bytes = await fetcher({\n url: manifest.source.url,\n commitSha: manifest.source.commitSha,\n paths,\n });\n\n // 4. Verify per-file SHA256 — hard fail before writing anything. The path\n // key used to read from the fetcher result is re-guarded as defense in depth.\n for (const f of manifest.files) {\n assertSafeManifestPath(installPath, f.path);\n const buf = bytes[f.path];\n if (!buf) throw new Error(`fetcher returned no bytes for ${f.path}`);\n const actual = createHash(\"sha256\").update(buf).digest(\"hex\");\n if (actual !== f.sha256) {\n throw new Error(`hash mismatch for ${f.path}: expected ${f.sha256}, got ${actual}`);\n }\n }\n\n // 5. Verify composite SHA256 over the sorted `<path>:<sha256>\\n` lines.\n const actualComposite = compositeSha256(manifest.files);\n if (actualComposite !== manifest.sha256) {\n throw new Error(`composite hash mismatch: expected ${manifest.sha256}, got ${actualComposite}`);\n }\n\n // 6. [M1] Write all verified files. A failed install must leave NO partial\n // directory: any prior `installPath` is removed first (clean overwrite), and\n // a mid-loop write failure removes the partially-written tree before\n // rethrowing.\n await rm(installPath, { recursive: true, force: true });\n try {\n for (const f of manifest.files) {\n const target = join(installPath, f.path);\n await mkdir(dirname(target), { recursive: true });\n await writeFile(target, bytes[f.path]!);\n }\n } catch (e) {\n await rm(installPath, { recursive: true, force: true }).catch(() => {});\n throw e;\n }\n\n return { installPath };\n}\n\n/**\n * Flat-layout install — the platform pointer-installer's behavior, made canonical\n * in install-core. Validates every path, fetches with the FULL repo paths, per-file\n * sha256-verifies, then strips the longest-common-dir prefix and writes each file\n * as `join(targetDir, path.slice(assetRoot.length + 1))` — immediate children of\n * `targetDir`. No ref parse, no composite check.\n */\nasync function installFlat(\n manifest: InstallManifest,\n targetDir: string,\n fetcher: AssetFetcher,\n): Promise<InstallResult> {\n const target = resolve(targetDir);\n\n // Gate every path before any fetch — the attacker controls the whole manifest.\n for (const f of manifest.files) {\n assertSafeManifestPath(target, f.path);\n }\n\n // Fetch keys off the FULL repo path (matches the upstream tree).\n const paths = manifest.files.map((f) => f.path);\n const bytes = await fetcher({\n url: manifest.source.url,\n commitSha: manifest.source.commitSha,\n paths,\n });\n\n // Strip the asset-root dir prefix from the WRITE path only — the fetch above\n // still keyed off the full repo path. Stripping removes leading whole segments\n // (never the basename), so a non-empty remainder always survives.\n const assetRoot = longestCommonDirPrefix(paths);\n\n for (const f of manifest.files) {\n const buf = bytes[f.path];\n if (!buf) throw new Error(`fetcher returned no bytes for ${f.path}`);\n const actual = createHash(\"sha256\").update(buf).digest(\"hex\");\n if (actual !== f.sha256) {\n throw new Error(`hash mismatch for ${f.path}: expected ${f.sha256}, got ${actual}`);\n }\n const relPath = assetRoot ? f.path.slice(assetRoot.length + 1) : f.path;\n // Re-guard the post-strip destination — it is what we actually write.\n assertSafeManifestPath(target, relPath);\n const dest = join(target, relPath);\n await mkdir(dirname(dest), { recursive: true });\n await writeFile(dest, buf);\n }\n\n return { installPath: target };\n}\n"]}
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { mountList, mountSync, mountStatus, mountRead, connectorList, connectorRead, connectorWrite, connectorSearch, connectorExec, connectorLoadSkill, connectorDescribe } from './chunk-74THIMZV.js';
|
|
2
|
+
import { flowList, flowShow, flowListSessions, flowGetSession, flowFindFlowForSession } from './chunk-54TVXZP3.js';
|
|
2
3
|
import { sessionList, sessionGet } from './chunk-R6O6YWU7.js';
|
|
3
|
-
import { skillList, skillShow, skillSearch, skillCheckRequirements, skillGetPreamble } from './chunk-
|
|
4
|
+
import { skillList, skillShow, skillSearch, skillCheckRequirements, skillGetPreamble } from './chunk-PK5XQBOC.js';
|
|
4
5
|
import { workspaceValidate, workspaceInfo, workspaceTestSecret, workspaceReload } from './chunk-4ZTPYIBE.js';
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
6
|
+
import { withActivityLabelDefs } from './chunk-D5WTOVLG.js';
|
|
7
|
+
import { loadDriverSdk } from './chunk-4QINFQ27.js';
|
|
7
8
|
import { DEFAULT_DRIVER_ID } from './chunk-5BEFNLOR.js';
|
|
8
9
|
import * as zNS from 'zod';
|
|
9
10
|
|
|
@@ -218,7 +219,11 @@ function buildWorkspaceToolDefs(plugin) {
|
|
|
218
219
|
async function buildWorkspaceMcpServer(plugin) {
|
|
219
220
|
let sdk;
|
|
220
221
|
try {
|
|
221
|
-
sdk = await
|
|
222
|
+
sdk = await loadDriverSdk(
|
|
223
|
+
"@anthropic-ai/claude-agent-sdk",
|
|
224
|
+
plugin.projectDir,
|
|
225
|
+
() => import('@anthropic-ai/claude-agent-sdk')
|
|
226
|
+
);
|
|
222
227
|
} catch {
|
|
223
228
|
return null;
|
|
224
229
|
}
|
|
@@ -246,5 +251,5 @@ async function runMcpServerStdio(plugin) {
|
|
|
246
251
|
}
|
|
247
252
|
|
|
248
253
|
export { buildWorkspaceMcpServer, buildWorkspaceMcpStdioServer, buildWorkspaceToolDefs, runMcpServerStdio };
|
|
249
|
-
//# sourceMappingURL=chunk-
|
|
250
|
-
//# sourceMappingURL=chunk-
|
|
254
|
+
//# sourceMappingURL=chunk-KUB4HFGK.js.map
|
|
255
|
+
//# sourceMappingURL=chunk-KUB4HFGK.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../workspace-plugin/src/adapters/mcp.ts"],"names":["z"],"mappings":";;;;;;;;;;AA6CA,IAAM,OAAA,GAA4B,SAAkB,GAAA,CAAA,OAAA,IAAW,GAAA;AAiCxD,SAAS,u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AM,EAAE,SAAA,EAAU,GAAI,MAAM,OAAO,yCAAmD,CAAA;AACtF,EAAA,MAAM,MAAA,GAAS,IAAI,SAAA,CAAU,EAAE,MAAM,kBAAA,EAAoB,OAAA,EAAS,SAAS,CAAA;AAC3E,EAAA,KAAA,MAAW,GAAA,IAAO,sBAAA,CAAuB,MAAM,CAAA,EAAG;AAChD,IAAA,MAAA,CAAO,YAAA;AAAA,MACL,GAAA,CAAI,IAAA;AAAA,MACJ,EAAE,WAAA,EAAa,GAAA,CAAI,WAAA,EAAa,WAAA,EAAa,IAAI,WAAA,EAAY;AAAA,MAC7D,GAAA,CAAI;AAAA,KACN;AAAA,EACF;AACA,EAAA,OAAO,MAAA;AACT;AAaA,eAAsB,kBAAkB,MAAA,EAAwC;AAC9E,EAAA,MAAM,MAAA,GAAS,MAAM,4BAAA,CAA6B,MAAM,CAAA;AACxD,EAAA,MAAM,EAAE,oBAAA,EAAqB,GAAI,MAAM,OACrC,2CACF,CAAA;AACA,EAAA,MAAM,MAAA,CAAO,OAAA,CAAQ,IAAI,oBAAA,EAAsB,CAAA;AACjD","file":"chunk-KUB4HFGK.js","sourcesContent":["// Static namespace import so bun --compile bundles zod into the binary.\n// Dynamic import(\"zod\") via a string variable evades bun's static analysis\n// and fails at runtime inside /$bunfs/. The unwrap (zNS.z ?? zNS.default\n// ?? zNS) handles both bun's native ESM and vitest's CJS-interop resolver,\n// which return the zod namespace at different keys.\nimport * as zNS from \"zod\";\nimport { loadDriverSdk } from \"@skaile/workspaces/core\";\nimport { DEFAULT_DRIVER_ID } from \"@skaile/workspaces/core/framework\";\nimport { withActivityLabelDefs } from \"@skaile/workspaces/types\";\nimport type { WorkspacePlugin } from \"../plugin.js\";\nimport {\n connectorDescribe,\n connectorExec,\n connectorList,\n connectorLoadSkill,\n connectorRead,\n connectorSearch,\n connectorWrite,\n mountList,\n mountRead,\n mountStatus,\n mountSync,\n} from \"../tools/connectors.js\";\nimport {\n flowFindFlowForSession,\n flowGetSession,\n flowList,\n flowListSessions,\n flowShow,\n} from \"../tools/flows.js\";\nimport { sessionGet, sessionList } from \"../tools/sessions.js\";\nimport {\n skillCheckRequirements,\n skillGetPreamble,\n skillList,\n skillSearch,\n skillShow,\n} from \"../tools/skills.js\";\nimport {\n workspaceInfo,\n workspaceReload,\n workspaceTestSecret,\n workspaceValidate,\n} from \"../tools/validator.js\";\n\nconst zStatic: any = (zNS as any).z ?? (zNS as any).default ?? zNS;\n\n/**\n * One workspace plugin tool — name, description, a zod raw-shape input schema,\n * and an async handler returning a `ToolResult`.\n *\n * Carries **zero MCP/SDK dependency**: the same definitions feed both the\n * in-process Claude Agent SDK server ({@link buildWorkspaceMcpServer}) and the\n * raw stdio MCP server ({@link buildWorkspaceMcpStdioServer}).\n */\nexport interface WorkspaceToolDef {\n name: string;\n description: string;\n inputSchema: Record<string, unknown>;\n handler: (args: any) => Promise<unknown>;\n}\n\n/**\n * Build the 27 workspace plugin tool definitions.\n *\n * Tool groups:\n * - 4 mount tools (`mount_list`, `mount_sync`, `mount_status`, `mount_read`)\n * - 5 flow tools (`flow_list`, `flow_show`, `flow_list_sessions`, `flow_get_session`, `flow_find_flow_for_session`)\n * - 5 skill tools (`skill_list`, `skill_show`, `skill_search`, `skill_check_requirements`, `skill_get_preamble`)\n * - 2 session tools (`session_list`, `session_get`)\n * - 7 connector tools (`connector_list`, `connector_read`, `connector_write`, `connector_search`, `connector_exec`, `connector_load_skill`, `connector_describe`)\n * - 4 workspace tools (`workspace_validate`, `workspace_info`, `workspace_test_secret`, `workspace_reload`)\n *\n * @param plugin - A booted `WorkspacePlugin` instance.\n * @returns The 27 tool definitions, free of any MCP/SDK coupling.\n *\n * @docLink packages/workspace-plugin/concepts#adapters\n */\nexport function buildWorkspaceToolDefs(plugin: WorkspacePlugin): WorkspaceToolDef[] {\n const z: any = zStatic;\n\n const driver = plugin.driver ?? DEFAULT_DRIVER_ID;\n const p = plugin.projectDir;\n\n return [\n // Mount tools\n {\n name: \"mount_list\",\n description: \"List all mounts declared in skaile.yaml with their mount status.\",\n inputSchema: {},\n handler: async () => mountList(plugin.connectorManager),\n },\n {\n name: \"mount_sync\",\n description: \"Sync a mount — pull latest from remote (git, S3, WebDAV).\",\n inputSchema: { mount_id: z.string().describe(\"Mount ID from mount_list\") },\n handler: async ({ mount_id }: { mount_id: string }) =>\n mountSync(plugin.connectorManager, mount_id),\n },\n {\n name: \"mount_status\",\n description: \"Get the mount status and last sync time for a mount.\",\n inputSchema: { mount_id: z.string() },\n handler: async ({ mount_id }: { mount_id: string }) =>\n mountStatus(plugin.connectorManager, mount_id),\n },\n {\n name: \"mount_read\",\n description: \"Read a file from a mounted mount by path.\",\n inputSchema: {\n mount_id: z.string(),\n path: z.string().describe(\"Relative path within the mount\"),\n },\n handler: async ({ mount_id, path }: { mount_id: string; path: string }) =>\n mountRead(plugin.connectorManager, mount_id, path),\n },\n // Flow tools\n {\n name: \"flow_list\",\n description: \"List all available flow definitions from ai-assets.\",\n inputSchema: {},\n handler: async () => flowList(p),\n },\n {\n name: \"flow_show\",\n description: \"Show full flow definition (nodes + edges) for a flow ID.\",\n inputSchema: { flow_id: z.string().describe(\"Flow ID from flow_list\") },\n handler: async ({ flow_id }: { flow_id: string }) => flowShow(p, flow_id),\n },\n {\n name: \"flow_list_sessions\",\n description: \"List past and active flow run sessions for this workspace.\",\n inputSchema: {},\n handler: async () => flowListSessions(p),\n },\n {\n name: \"flow_get_session\",\n description: \"Get driver metadata for a specific flow run session.\",\n inputSchema: { run_id: z.string().describe(\"Run ID from flow_list_sessions\") },\n handler: async ({ run_id }: { run_id: string }) => flowGetSession(p, run_id),\n },\n {\n name: \"flow_find_flow_for_session\",\n description: \"Resolve and return the flow definition used in a past session.\",\n inputSchema: { run_id: z.string() },\n handler: async ({ run_id }: { run_id: string }) => flowFindFlowForSession(p, run_id),\n },\n // Skill tools\n {\n name: \"skill_list\",\n description: \"List all skills in the ai-assets catalog.\",\n inputSchema: {},\n handler: async () => skillList(p),\n },\n {\n name: \"skill_show\",\n description: \"Show the full SKILL.md content for a skill ID.\",\n inputSchema: { skill_id: z.string().describe(\"Skill ID from skill_list\") },\n handler: async ({ skill_id }: { skill_id: string }) => skillShow(p, skill_id),\n },\n {\n name: \"skill_search\",\n description: \"Search skills by name, description, or keywords.\",\n inputSchema: { query: z.string() },\n handler: async ({ query }: { query: string }) => skillSearch(p, query),\n },\n {\n name: \"skill_check_requirements\",\n description: \"Validate that all skill prerequisites are met in the target directory.\",\n inputSchema: {\n skill_id: z.string(),\n target_dir: z\n .string()\n .optional()\n .describe(\"Directory to check against (default: projectDir)\"),\n },\n handler: async ({ skill_id, target_dir }: { skill_id: string; target_dir?: string }) =>\n skillCheckRequirements(p, skill_id, target_dir ?? p),\n },\n {\n name: \"skill_get_preamble\",\n description: \"Get the REQUIRES/INPUT/READS/WRITES DSL preamble for a skill.\",\n inputSchema: { skill_id: z.string() },\n handler: async ({ skill_id }: { skill_id: string }) => skillGetPreamble(p, skill_id),\n },\n // Session tools\n {\n name: \"session_list\",\n description: \"List all past agent run sessions for this workspace, sorted newest first.\",\n inputSchema: {},\n handler: async () => sessionList(p),\n },\n {\n name: \"session_get\",\n description: \"Get full metadata for a specific session by run ID.\",\n inputSchema: { run_id: z.string() },\n handler: async ({ run_id }: { run_id: string }) => sessionGet(p, run_id),\n },\n // Connector tools\n {\n name: \"connector_list\",\n description:\n \"List connectors declared in skaile.yaml as {connected, failed, notice?}. A host-managed mount in `connected` carries `health` {status: ok|stale|failed, errorClass, checkedAt}; if it is not ok, tell the user and do not write to it. `failed` holds connectors that did not connect this session, with the failure reason — their mount paths are dead directories, not synced workspaces.\",\n inputSchema: {},\n handler: async () => connectorList(plugin.connectorManager),\n },\n {\n name: \"connector_read\",\n description: \"Read content from a connector by path.\",\n inputSchema: {\n connector_id: z.string().describe(\"Connector ID from connector_list\"),\n path: z.string().describe(\"Path within the connector\"),\n },\n handler: async ({ connector_id, path }: { connector_id: string; path: string }) =>\n connectorRead(plugin.connectorManager, connector_id, path),\n },\n {\n name: \"connector_write\",\n description: \"Write content to a connector by path.\",\n inputSchema: {\n connector_id: z.string(),\n path: z.string(),\n content: z.string().describe(\"Content to write\"),\n },\n handler: async ({\n connector_id,\n path,\n content,\n }: {\n connector_id: string;\n path: string;\n content: string;\n }) => connectorWrite(plugin.connectorManager, connector_id, path, content),\n },\n {\n name: \"connector_search\",\n description: \"Search within a connector by query string.\",\n inputSchema: {\n connector_id: z.string(),\n query: z.string().describe(\"Search query\"),\n },\n handler: async ({ connector_id, query }: { connector_id: string; query: string }) =>\n connectorSearch(plugin.connectorManager, connector_id, query),\n },\n {\n name: \"connector_exec\",\n description: \"Execute a custom operation on a connector.\",\n inputSchema: {\n connector_id: z.string(),\n operation: z.string().describe(\"Operation name from connector_describe\"),\n args: z.record(z.string(), z.unknown()).describe(\"Operation arguments\"),\n },\n handler: async ({\n connector_id,\n operation,\n args,\n }: {\n connector_id: string;\n operation: string;\n args: Record<string, unknown>;\n }) => connectorExec(plugin.connectorManager, connector_id, operation, args),\n },\n {\n name: \"connector_load_skill\",\n description: \"Load the rendered skill body for a connector (operations + usage).\",\n inputSchema: {\n connector_id: z.string(),\n },\n handler: async ({ connector_id }: { connector_id: string }) =>\n connectorLoadSkill(plugin.connectorManager, connector_id),\n },\n {\n name: \"connector_describe\",\n description: \"Describe a connector's capabilities via its RuntimeSkillDescriptor.\",\n inputSchema: {\n connector_id: z.string(),\n },\n handler: async ({ connector_id }: { connector_id: string }) =>\n connectorDescribe(plugin.connectorManager, connector_id),\n },\n // Validator tools\n {\n name: \"workspace_validate\",\n description: \"Run a full health check: connectors, mounts, secrets, driver binary.\",\n inputSchema: {},\n handler: async () => workspaceValidate(plugin, driver),\n },\n {\n name: \"workspace_info\",\n description: \"Show workspace configuration: driver, model, provider, resource counts.\",\n inputSchema: {},\n handler: async () => workspaceInfo(plugin, driver, plugin.model),\n },\n {\n name: \"workspace_test_secret\",\n description: \"Test resolution of one secret reference (env:VAR, forge:key).\",\n inputSchema: { ref: z.string().describe(\"Secret ref e.g. env:ANTHROPIC_API_KEY\") },\n handler: async ({ ref }: { ref: string }) => workspaceTestSecret(ref),\n },\n {\n name: \"workspace_reload\",\n description: \"Re-read skaile.yaml and re-sync the plugin state.\",\n inputSchema: {},\n handler: async () => workspaceReload(plugin),\n },\n ];\n}\n\n/**\n * Build the **in-process** workspace MCP server via the Claude Agent SDK's\n * `createSdkMcpServer`. This shape is what the runner embeds into a Claude\n * Agent SDK `query()` call — the runner *is* the Claude Agent SDK host.\n *\n * Returns `null` when `@anthropic-ai/claude-agent-sdk` is not installed\n * (graceful degradation for non-Claude-Code environments).\n *\n * For the standalone `skaile mcp-server` stdio subprocess use\n * {@link buildWorkspaceMcpStdioServer} / {@link runMcpServerStdio} instead —\n * those carry no Claude Agent SDK dependency.\n *\n * @param plugin - A booted `WorkspacePlugin` instance.\n * @returns The SDK MCP server object or `null` if the SDK is unavailable.\n *\n * @docLink packages/workspace-plugin/concepts#adapters\n */\nexport async function buildWorkspaceMcpServer(plugin: WorkspacePlugin): Promise<unknown | null> {\n let sdk: any;\n try {\n sdk = await loadDriverSdk(\n \"@anthropic-ai/claude-agent-sdk\",\n plugin.projectDir,\n () => import(\"@anthropic-ai/claude-agent-sdk\"),\n );\n } catch {\n return null;\n }\n return sdk.createSdkMcpServer({\n name: \"skaile-workspace\",\n tools: withActivityLabelDefs(buildWorkspaceToolDefs(plugin), zStatic),\n });\n}\n\n/**\n * Build a **raw stdio** workspace MCP server on `@modelcontextprotocol/sdk` —\n * no Claude Agent SDK. This is the correct shape for the `skaile mcp-server`\n * stdio subprocess that MCP-client agents (Claude Code, Codex, …) spawn.\n * Runs on plain Node.\n *\n * The returned server is not yet connected — call `.connect(transport)` (or\n * use {@link runMcpServerStdio}).\n *\n * @param plugin - A booted `WorkspacePlugin` instance.\n * @returns A `McpServer` with all 27 workspace tools registered.\n *\n * @docLink packages/workspace-plugin/concepts#adapters\n */\nexport async function buildWorkspaceMcpStdioServer(plugin: WorkspacePlugin): Promise<any> {\n const { McpServer } = await import(\"@modelcontextprotocol/sdk/server/mcp.js\" as string);\n const server = new McpServer({ name: \"skaile-workspace\", version: \"1.0.0\" });\n for (const def of buildWorkspaceToolDefs(plugin)) {\n server.registerTool(\n def.name,\n { description: def.description, inputSchema: def.inputSchema },\n def.handler,\n );\n }\n return server;\n}\n\n/**\n * Start the workspace MCP server over stdio transport.\n *\n * Builds the raw `@modelcontextprotocol/sdk` server via\n * {@link buildWorkspaceMcpStdioServer} and connects a `StdioServerTransport`.\n * No `@anthropic-ai/claude-agent-sdk` dependency anywhere on this path.\n *\n * @param plugin - A booted `WorkspacePlugin` instance.\n *\n * @docLink packages/workspace-plugin/concepts#adapters\n */\nexport async function runMcpServerStdio(plugin: WorkspacePlugin): Promise<void> {\n const server = await buildWorkspaceMcpStdioServer(plugin);\n const { StdioServerTransport } = await import(\n \"@modelcontextprotocol/sdk/server/stdio.js\" as string\n );\n await server.connect(new StdioServerTransport());\n}\n"]}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { tryWithFsDeadline, withFsDeadline, fsDeadlineMs } from './chunk-
|
|
1
|
+
import { tryWithFsDeadline, withFsDeadline, fsDeadlineMs } from './chunk-SP5NGNBV.js';
|
|
2
2
|
import { createLogger } from './chunk-BOFL7GIF.js';
|
|
3
3
|
import { stat, mkdir, cp, writeFile, rm } from 'fs/promises';
|
|
4
4
|
import { resolve, sep, join } from 'path';
|
|
@@ -155,5 +155,5 @@ function resolveFlowSkills(flow, allEntries) {
|
|
|
155
155
|
}
|
|
156
156
|
|
|
157
157
|
export { WORKSPACE_MOUNT_ENV_VAR, deployAll, deployCatalogEntry, findAiAssetsRoot, isUnderWorkspaceMount, resolveFlowSkills, undeployCatalogEntry, workspaceMountDirs };
|
|
158
|
-
//# sourceMappingURL=chunk-
|
|
159
|
-
//# sourceMappingURL=chunk-
|
|
158
|
+
//# sourceMappingURL=chunk-LEOXPIC6.js.map
|
|
159
|
+
//# sourceMappingURL=chunk-LEOXPIC6.js.map
|