@skaile/workspaces 0.29.0 → 0.30.1
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 +51 -0
- package/dist/{asset-feeds-2V7LZIG7.js → asset-feeds-IWOBYROH.js} +14 -13
- package/dist/asset-feeds-IWOBYROH.js.map +1 -0
- package/dist/asset-manager/index.js +12 -12
- package/dist/asset-manager/installer.js +11 -11
- package/dist/asset-manager/renderers.js +2 -2
- package/dist/asset-manager/src/index.d.ts +27 -0
- package/dist/asset-manager/src/index.d.ts.map +1 -1
- package/dist/asset-manager/src/install-agent.d.ts.map +1 -1
- package/dist/asset-manager/src/installer.d.ts +1 -2
- package/dist/asset-manager/src/installer.d.ts.map +1 -1
- package/dist/asset-manager/src/renderers.d.ts.map +1 -1
- package/dist/bridge/drivers/claude-sdk.js +324 -226
- package/dist/bridge/drivers/claude-sdk.js.map +1 -1
- package/dist/bridge/drivers/codex.js +3 -3
- package/dist/bridge/drivers/codex.js.map +1 -1
- package/dist/bridge/drivers/continue.js +4 -4
- package/dist/bridge/drivers/echo.js +2 -2
- package/dist/bridge/drivers/echo.js.map +1 -1
- package/dist/bridge/drivers/gemini.js +5 -5
- package/dist/bridge/drivers/goose.js +4 -4
- package/dist/bridge/drivers/omp.js +3 -3
- package/dist/bridge/drivers/opencode.js +4 -4
- package/dist/bridge/drivers/qwen.js +5 -5
- package/dist/bridge/index.js +4 -4
- package/dist/bridge/src/drivers/claude-sdk.d.ts +64 -0
- package/dist/bridge/src/drivers/claude-sdk.d.ts.map +1 -1
- package/dist/bridge/src/drivers/echo.d.ts +1 -1
- package/dist/bridge/src/drivers/echo.d.ts.map +1 -1
- package/dist/bridge/src/error-classifier.d.ts.map +1 -1
- package/dist/bridge/src/normalizer.d.ts +5 -0
- package/dist/bridge/src/normalizer.d.ts.map +1 -1
- package/dist/{chunk-LDUNTZB6.js → chunk-26L2B6P6.js} +2 -2
- package/dist/{chunk-LDUNTZB6.js.map → chunk-26L2B6P6.js.map} +1 -1
- package/dist/{chunk-FWHOU3CX.js → chunk-2VKVWN5E.js} +6 -6
- package/dist/{chunk-FWHOU3CX.js.map → chunk-2VKVWN5E.js.map} +1 -1
- package/dist/{chunk-2FS4FPZ7.js → chunk-4AGIEU7V.js} +44 -62
- package/dist/chunk-4AGIEU7V.js.map +1 -0
- package/dist/{chunk-ZONCCO5N.js → chunk-4R6DROGN.js} +30 -32
- package/dist/chunk-4R6DROGN.js.map +1 -0
- package/dist/{chunk-3QQSSRYN.js → chunk-5DQOZFWJ.js} +416 -345
- package/dist/chunk-5DQOZFWJ.js.map +1 -0
- package/dist/{chunk-XFQ2OXYR.js → chunk-5MJJYIL4.js} +3 -3
- package/dist/{chunk-XFQ2OXYR.js.map → chunk-5MJJYIL4.js.map} +1 -1
- package/dist/{chunk-AKSR434V.js → chunk-5XAQDOMU.js} +79 -56
- package/dist/chunk-5XAQDOMU.js.map +1 -0
- package/dist/{chunk-MBOR7D65.js → chunk-67MFR5LS.js} +3 -3
- package/dist/{chunk-MBOR7D65.js.map → chunk-67MFR5LS.js.map} +1 -1
- package/dist/{chunk-7GWYRVAX.js → chunk-6LW7Q53Z.js} +162 -165
- package/dist/chunk-6LW7Q53Z.js.map +1 -0
- package/dist/{chunk-SF4GWVR5.js → chunk-6TCOYFVJ.js} +86 -55
- package/dist/chunk-6TCOYFVJ.js.map +1 -0
- package/dist/{chunk-QMONOHXT.js → chunk-74UKG2LA.js} +3 -3
- package/dist/{chunk-QMONOHXT.js.map → chunk-74UKG2LA.js.map} +1 -1
- package/dist/{chunk-JIQLLZ65.js → chunk-7MANNJ3U.js} +534 -235
- package/dist/chunk-7MANNJ3U.js.map +1 -0
- package/dist/{chunk-7R6W5EQR.js → chunk-ACXLKNIM.js} +2 -2
- package/dist/{chunk-7R6W5EQR.js.map → chunk-ACXLKNIM.js.map} +1 -1
- package/dist/{chunk-3OKP6F2J.js → chunk-AKYEI3D6.js} +9 -9
- package/dist/{chunk-3OKP6F2J.js.map → chunk-AKYEI3D6.js.map} +1 -1
- package/dist/{chunk-CMG3GJ6B.js → chunk-DAI754GK.js} +4 -4
- package/dist/{chunk-CMG3GJ6B.js.map → chunk-DAI754GK.js.map} +1 -1
- package/dist/{chunk-FENG6OO6.js → chunk-FRRTUVUM.js} +4593 -4466
- package/dist/chunk-FRRTUVUM.js.map +1 -0
- package/dist/{chunk-TV72ZJYN.js → chunk-GXC3TYMQ.js} +60 -47
- package/dist/chunk-GXC3TYMQ.js.map +1 -0
- package/dist/{chunk-IERB3UXJ.js → chunk-H5YXL4KI.js} +83 -69
- package/dist/chunk-H5YXL4KI.js.map +1 -0
- package/dist/{chunk-QDJKE557.js → chunk-HRKB2ATT.js} +64 -64
- package/dist/chunk-HRKB2ATT.js.map +1 -0
- package/dist/{chunk-ZEKWHJBB.js → chunk-IZIFMNTI.js} +3 -3
- package/dist/{chunk-ZEKWHJBB.js.map → chunk-IZIFMNTI.js.map} +1 -1
- package/dist/{chunk-24UIWON4.js → chunk-JB35MVBN.js} +167 -156
- package/dist/chunk-JB35MVBN.js.map +1 -0
- package/dist/{chunk-UIZKIUC6.js → chunk-KHZI44SS.js} +3 -3
- package/dist/chunk-KHZI44SS.js.map +1 -0
- package/dist/{chunk-5YO3H5Q4.js → chunk-KY5NY7LB.js} +3 -3
- package/dist/chunk-KY5NY7LB.js.map +1 -0
- package/dist/{chunk-MIH45XPY.js → chunk-LA2YSXEE.js} +1974 -1919
- package/dist/chunk-LA2YSXEE.js.map +1 -0
- package/dist/{chunk-IEJ5IOC3.js → chunk-LFDZYCEO.js} +4 -2
- package/dist/chunk-LFDZYCEO.js.map +1 -0
- package/dist/{chunk-2NOE4AGD.js → chunk-LIK75OJ5.js} +3 -3
- package/dist/{chunk-2NOE4AGD.js.map → chunk-LIK75OJ5.js.map} +1 -1
- package/dist/{chunk-PAYAFNXG.js → chunk-NGJ6E344.js} +104 -74
- package/dist/chunk-NGJ6E344.js.map +1 -0
- package/dist/{chunk-5V5KZQIC.js → chunk-PVMAIVNL.js} +4 -4
- package/dist/{chunk-5V5KZQIC.js.map → chunk-PVMAIVNL.js.map} +1 -1
- package/dist/{chunk-HK5FRWG6.js → chunk-R6O6YWU7.js} +2 -2
- package/dist/{chunk-HK5FRWG6.js.map → chunk-R6O6YWU7.js.map} +1 -1
- package/dist/{chunk-PRLD7EXG.js → chunk-SBGHNXJD.js} +2 -2
- package/dist/{chunk-PRLD7EXG.js.map → chunk-SBGHNXJD.js.map} +1 -1
- package/dist/{chunk-5RBPPBEK.js → chunk-SCJD3FMO.js} +4 -4
- package/dist/{chunk-5RBPPBEK.js.map → chunk-SCJD3FMO.js.map} +1 -1
- package/dist/{chunk-BZ2JU7IP.js → chunk-TU4VZULO.js} +5 -5
- package/dist/{chunk-BZ2JU7IP.js.map → chunk-TU4VZULO.js.map} +1 -1
- package/dist/{chunk-CBNMIKUO.js → chunk-VGFYUD3T.js} +158 -108
- package/dist/chunk-VGFYUD3T.js.map +1 -0
- package/dist/{chunk-Z3XXKR5E.js → chunk-WDMH4UMD.js} +4 -6
- package/dist/chunk-WDMH4UMD.js.map +1 -0
- package/dist/{chunk-W7W66MDZ.js → chunk-X46FY45B.js} +44 -42
- package/dist/chunk-X46FY45B.js.map +1 -0
- package/dist/{chunk-JKNWJ64A.js → chunk-XGCXFX7X.js} +2 -2
- package/dist/{chunk-JKNWJ64A.js.map → chunk-XGCXFX7X.js.map} +1 -1
- package/dist/{chunk-TDZGENVP.js → chunk-XOAF5QAE.js} +2094 -1901
- package/dist/chunk-XOAF5QAE.js.map +1 -0
- package/dist/{chunk-FQHHCICT.js → chunk-XVDXGQ55.js} +226 -226
- package/dist/chunk-XVDXGQ55.js.map +1 -0
- package/dist/{chunk-M4KLIEIJ.js → chunk-YBJLYT4S.js} +3 -3
- package/dist/chunk-YBJLYT4S.js.map +1 -0
- package/dist/{chunk-OKRUTSG7.js → chunk-ZDKJHQY2.js} +2 -2
- package/dist/{chunk-OKRUTSG7.js.map → chunk-ZDKJHQY2.js.map} +1 -1
- package/dist/{chunk-UBCZVONU.js → chunk-ZME3JDA6.js} +3 -3
- package/dist/{chunk-UBCZVONU.js.map → chunk-ZME3JDA6.js.map} +1 -1
- package/dist/cli/index.js +2811 -2662
- package/dist/cli/index.js.map +1 -1
- package/dist/cli/src/asset-feeds.d.ts +0 -9
- package/dist/cli/src/asset-feeds.d.ts.map +1 -1
- package/dist/cli/src/commands/catalog-cmd.d.ts.map +1 -1
- package/dist/cli/src/commands/catalog.d.ts.map +1 -1
- package/dist/cli/src/commands/config.d.ts.map +1 -1
- package/dist/cli/src/commands/deploy.d.ts.map +1 -1
- package/dist/cli/src/commands/integration.d.ts.map +1 -1
- package/dist/cli/src/commands/library-cmd.d.ts.map +1 -1
- package/dist/cli/src/commands/manage.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 +1 -1
- package/dist/cli/src/commands/project.d.ts.map +1 -1
- package/dist/cli/src/commands/show.d.ts.map +1 -1
- package/dist/cli/src/commands/source.d.ts.map +1 -1
- package/dist/cli/src/commands/validate.d.ts.map +1 -1
- package/dist/cli/src/ensure-sources.d.ts.map +1 -1
- package/dist/cli/src/flow-discovery.d.ts.map +1 -1
- package/dist/cli/src/open-registry.d.ts.map +1 -1
- package/dist/cli/src/plugin-store/index.d.ts +4 -6
- package/dist/cli/src/plugin-store/index.d.ts.map +1 -1
- package/dist/cli/src/plugin-store/paths.d.ts +0 -2
- package/dist/cli/src/plugin-store/paths.d.ts.map +1 -1
- package/dist/cli/src/setup.d.ts.map +1 -1
- package/dist/connectors/config.js +9 -9
- package/dist/connectors/index.js +12 -12
- package/dist/connectors/rclone.js +2 -2
- package/dist/connectors/src/connector-prompt.d.ts.map +1 -1
- package/dist/connectors/src/connector-registry.d.ts.map +1 -1
- package/dist/connectors/src/connector-types.d.ts +1 -1
- package/dist/connectors/src/connector-types.d.ts.map +1 -1
- package/dist/connectors/src/index.d.ts +5 -5
- package/dist/connectors/src/index.d.ts.map +1 -1
- package/dist/connectors/src/managed-gitconfig.d.ts.map +1 -1
- package/dist/{connectors-PTCSHCHZ.js → connectors-DY7UBBV5.js} +3 -3
- package/dist/{connectors-PTCSHCHZ.js.map → connectors-DY7UBBV5.js.map} +1 -1
- package/dist/connectors-shared/src/index.d.ts +1 -1
- package/dist/connectors-shared/src/index.d.ts.map +1 -1
- package/dist/core/index.js +8 -8
- package/dist/core/logging.js +1 -1
- package/dist/core/manifest.js +2 -2
- package/dist/core/models.js +1 -1
- package/dist/core/publish-manifest.js +2 -2
- package/dist/core/runtime-assets.js +5 -5
- package/dist/core/src/lock.d.ts +0 -9
- package/dist/core/src/lock.d.ts.map +1 -1
- package/dist/core/src/logging/create-logger.d.ts.map +1 -1
- package/dist/core/src/logging/index.d.ts +11 -11
- package/dist/core/src/logging/index.d.ts.map +1 -1
- package/dist/core/src/logging/log-store.d.ts.map +1 -1
- package/dist/core/src/logging/sinks/no-op-sink.d.ts.map +1 -1
- package/dist/core/src/logging/sinks/sqlite-sink.d.ts.map +1 -1
- package/dist/core/src/manifest.d.ts.map +1 -1
- package/dist/core/src/models.d.ts +6 -0
- package/dist/core/src/models.d.ts.map +1 -1
- package/dist/core/src/publish-manifest.d.ts.map +1 -1
- package/dist/core/src/repo-manager.d.ts +0 -12
- package/dist/core/src/repo-manager.d.ts.map +1 -1
- package/dist/core/src/runtime-assets.d.ts.map +1 -1
- package/dist/core/src/store.d.ts +1 -1
- package/dist/core/src/store.d.ts.map +1 -1
- package/dist/core/src/walker.d.ts.map +1 -1
- package/dist/core/src/workspace-config.d.ts +0 -27
- package/dist/core/src/workspace-config.d.ts.map +1 -1
- package/dist/core/store.js +1 -1
- package/dist/core/workspace-config.js +4 -4
- package/dist/deploy/index.js +8 -8
- package/dist/discovery/index.js +6 -6
- package/dist/discovery/src/asset-kind-registry.d.ts +1 -1
- package/dist/discovery/src/asset-kind-registry.d.ts.map +1 -1
- package/dist/discovery/src/builtin-providers.d.ts.map +1 -1
- package/dist/discovery/src/discover-manifest.d.ts +1 -1
- package/dist/discovery/src/discover-manifest.d.ts.map +1 -1
- package/dist/discovery/src/discover.d.ts +30 -3
- package/dist/discovery/src/discover.d.ts.map +1 -1
- package/dist/discovery/src/domains.d.ts +144 -0
- package/dist/discovery/src/domains.d.ts.map +1 -0
- package/dist/discovery/src/index.d.ts +9 -7
- package/dist/discovery/src/index.d.ts.map +1 -1
- package/dist/discovery/src/source-config.d.ts +1 -1
- package/dist/discovery/src/source-config.d.ts.map +1 -1
- package/dist/discovery/src/tree-entries.d.ts +13 -1
- package/dist/discovery/src/tree-entries.d.ts.map +1 -1
- package/dist/ensure-sources-6GW6UBXY.js +84 -0
- package/dist/ensure-sources-6GW6UBXY.js.map +1 -0
- package/dist/factory-assets/connectors/deploy/adapter.d.ts +1 -1
- package/dist/factory-assets/connectors/deploy/adapter.d.ts.map +1 -1
- package/dist/factory-assets/connectors/deploy.js +12 -12
- package/dist/factory-assets/connectors/devserver/adapter.d.ts +1 -1
- package/dist/factory-assets/connectors/devserver/adapter.d.ts.map +1 -1
- package/dist/factory-assets/connectors/devserver.js +12 -12
- package/dist/factory-assets/connectors/flow/adapter.d.ts +16 -2
- package/dist/factory-assets/connectors/flow/adapter.d.ts.map +1 -1
- package/dist/factory-assets/connectors/flow/adapter.js +12 -12
- package/dist/factory-assets/connectors/flow/engine/flow-kind-provider.d.ts.map +1 -1
- package/dist/factory-assets/connectors/flow/engine/index.d.ts +3 -3
- package/dist/factory-assets/connectors/flow/engine/index.d.ts.map +1 -1
- package/dist/factory-assets/connectors/flow/engine.js +9 -9
- package/dist/factory-assets/connectors/flow/index.d.ts +1 -1
- package/dist/factory-assets/connectors/flow/index.d.ts.map +1 -1
- package/dist/factory-assets/connectors/flow/run-flow.js +15 -15
- package/dist/factory-assets/connectors/flow.js +12 -12
- package/dist/factory-assets/connectors/git/driver.d.ts +32 -0
- package/dist/factory-assets/connectors/git/driver.d.ts.map +1 -1
- package/dist/factory-assets/connectors/git.js +12 -12
- package/dist/factory-assets/connectors/gmail/adapter.d.ts +1 -1
- package/dist/factory-assets/connectors/gmail/adapter.d.ts.map +1 -1
- package/dist/factory-assets/connectors/gmail.js +12 -12
- package/dist/factory-assets/connectors/googledrive.js +12 -12
- package/dist/factory-assets/connectors/local/driver.d.ts +1 -2
- package/dist/factory-assets/connectors/local/driver.d.ts.map +1 -1
- package/dist/factory-assets/connectors/local.js +12 -12
- package/dist/factory-assets/connectors/mattermost/adapter.d.ts +1 -1
- package/dist/factory-assets/connectors/mattermost/adapter.d.ts.map +1 -1
- package/dist/factory-assets/connectors/mattermost.js +12 -12
- package/dist/factory-assets/connectors/memory/adapter.d.ts.map +1 -1
- package/dist/factory-assets/connectors/memory.js +12 -12
- package/dist/factory-assets/connectors/minio/adapter.d.ts +1 -1
- package/dist/factory-assets/connectors/minio/adapter.d.ts.map +1 -1
- package/dist/factory-assets/connectors/minio.js +12 -12
- package/dist/factory-assets/connectors/postgres/adapter.d.ts +6 -1
- package/dist/factory-assets/connectors/postgres/adapter.d.ts.map +1 -1
- package/dist/factory-assets/connectors/postgres.js +12 -12
- package/dist/factory-assets/connectors/s3/driver.d.ts.map +1 -1
- package/dist/factory-assets/connectors/s3.js +12 -12
- package/dist/factory-assets/connectors/sharepoint.js +12 -12
- package/dist/factory-assets/connectors/sqlite/adapter.d.ts +1 -1
- package/dist/factory-assets/connectors/sqlite/adapter.d.ts.map +1 -1
- package/dist/factory-assets/connectors/sqlite.js +12 -12
- package/dist/factory-assets/connectors/static-server/adapter.d.ts +6 -1
- package/dist/factory-assets/connectors/static-server/adapter.d.ts.map +1 -1
- package/dist/factory-assets/connectors/static-server.js +12 -12
- package/dist/factory-assets/connectors/tunnel/adapter.d.ts +1 -1
- package/dist/factory-assets/connectors/tunnel/adapter.d.ts.map +1 -1
- package/dist/factory-assets/connectors/tunnel.js +12 -12
- package/dist/factory-assets/connectors/webdav.js +12 -12
- package/dist/factory-assets/connectors/xstate/adapter.d.ts +1 -1
- package/dist/factory-assets/connectors/xstate/adapter.d.ts.map +1 -1
- package/dist/factory-assets/connectors/xstate-store/adapter.d.ts +7 -0
- package/dist/factory-assets/connectors/xstate-store/adapter.d.ts.map +1 -1
- package/dist/factory-assets/connectors/xstate-store.js +12 -12
- package/dist/factory-assets/connectors/xstate.js +12 -12
- package/dist/flows-JXO3KGC2.js +7 -0
- package/dist/{flows-L3GHQD7F.js.map → flows-JXO3KGC2.js.map} +1 -1
- package/dist/library/index.js +13 -13
- package/dist/library/install.js +9 -9
- package/dist/library/src/config.d.ts.map +1 -1
- package/dist/library/src/index.d.ts +27 -27
- package/dist/library/src/index.d.ts.map +1 -1
- package/dist/library/src/install/index.d.ts +2 -2
- package/dist/library/src/install/index.d.ts.map +1 -1
- package/dist/library/src/install/install-from-manifest.d.ts +0 -21
- package/dist/library/src/install/install-from-manifest.d.ts.map +1 -1
- package/dist/library/src/knowledge/index.d.ts +2 -2
- package/dist/library/src/knowledge/index.d.ts.map +1 -1
- package/dist/library/src/knowledge/knowledge-kind-provider.d.ts.map +1 -1
- package/dist/library/src/local/library.d.ts +2 -2
- package/dist/library/src/local/library.d.ts.map +1 -1
- package/dist/library/src/local/store-paths.d.ts.map +1 -1
- package/dist/library/src/pin-resolver.d.ts.map +1 -1
- package/dist/library/src/preset/apply.d.ts +2 -2
- package/dist/library/src/preset/apply.d.ts.map +1 -1
- package/dist/library/src/preset/index.d.ts +10 -10
- package/dist/library/src/preset/index.d.ts.map +1 -1
- package/dist/library/src/preset/parse.d.ts.map +1 -1
- package/dist/library/src/preset/resolve-item.d.ts +1 -1
- package/dist/library/src/preset/resolve-item.d.ts.map +1 -1
- package/dist/library/src/preset/upgrade.d.ts +1 -1
- package/dist/library/src/preset/upgrade.d.ts.map +1 -1
- package/dist/library/src/remote/index.d.ts +5 -5
- package/dist/library/src/remote/index.d.ts.map +1 -1
- package/dist/library/src/remote/remote-catalog-source.d.ts +1 -1
- package/dist/library/src/remote/remote-catalog-source.d.ts.map +1 -1
- package/dist/library/src/remote/rest-catalog-source.d.ts +1 -1
- package/dist/library/src/remote/rest-catalog-source.d.ts.map +1 -1
- package/dist/library/src/sync/driver.d.ts +1 -1
- package/dist/library/src/sync/driver.d.ts.map +1 -1
- package/dist/library/src/sync/git-driver.d.ts +1 -1
- package/dist/library/src/sync/git-driver.d.ts.map +1 -1
- package/dist/library/src/sync/local-driver.d.ts +1 -1
- package/dist/library/src/sync/local-driver.d.ts.map +1 -1
- package/dist/library/src/workspace-config.d.ts +0 -9
- package/dist/library/src/workspace-config.d.ts.map +1 -1
- package/dist/open-library-SH6NCJM2.js +23 -0
- package/dist/{open-library-3VJY74LQ.js.map → open-library-SH6NCJM2.js.map} +1 -1
- package/dist/paths-YSXGJ7TO.js +15 -0
- package/dist/{paths-CE66L3AL.js.map → paths-YSXGJ7TO.js.map} +1 -1
- package/dist/plugin-registry/src/targets.d.ts +2 -3
- package/dist/plugin-registry/src/targets.d.ts.map +1 -1
- package/dist/{plugin-store-GL5VKYUA.js → plugin-store-2KMDUF7R.js} +11 -14
- package/dist/plugin-store-2KMDUF7R.js.map +1 -0
- package/dist/plugins/index.js +1 -1
- package/dist/plugins/src/asset-kind-registry.d.ts +1 -1
- package/dist/plugins/src/asset-kind-registry.d.ts.map +1 -1
- package/dist/plugins/src/catalog-source.d.ts +5 -0
- package/dist/plugins/src/catalog-source.d.ts.map +1 -1
- package/dist/plugins/src/index.d.ts +5 -5
- package/dist/plugins/src/index.d.ts.map +1 -1
- package/dist/{provider-GAWKFQ3T.js → provider-ZPT443IX.js} +18 -16
- package/dist/provider-ZPT443IX.js.map +1 -0
- package/dist/resolver/index.js +1 -1
- package/dist/resolver/src/preamble.d.ts.map +1 -1
- package/dist/runner/index.js +17 -17
- package/dist/runner/src/builtin-capabilities.d.ts +12 -0
- package/dist/runner/src/builtin-capabilities.d.ts.map +1 -1
- package/dist/runner/src/capability-registry.d.ts.map +1 -1
- package/dist/runner/src/compaction/index.d.ts +0 -4
- package/dist/runner/src/compaction/index.d.ts.map +1 -1
- package/dist/runner/src/compaction/orchestrator.d.ts +23 -2
- package/dist/runner/src/compaction/orchestrator.d.ts.map +1 -1
- package/dist/runner/src/composition/compile.d.ts.map +1 -1
- package/dist/runner/src/composition/index.d.ts +4 -4
- package/dist/runner/src/composition/index.d.ts.map +1 -1
- package/dist/runner/src/composition/resolve.d.ts.map +1 -1
- package/dist/runner/src/composition/types.d.ts +2 -2
- package/dist/runner/src/composition/types.d.ts.map +1 -1
- package/dist/runner/src/config.d.ts +2 -2
- package/dist/runner/src/config.d.ts.map +1 -1
- package/dist/runner/src/define-capability.d.ts +1 -1
- package/dist/runner/src/define-capability.d.ts.map +1 -1
- package/dist/runner/src/external-mcp.d.ts.map +1 -1
- package/dist/runner/src/index.d.ts +9 -9
- package/dist/runner/src/index.d.ts.map +1 -1
- package/dist/runner/src/logging-bootstrap.d.ts +1 -1
- package/dist/runner/src/logging-bootstrap.d.ts.map +1 -1
- package/dist/runner/src/manifest.d.ts.map +1 -1
- package/dist/runner/src/resource-handler.d.ts.map +1 -1
- package/dist/runner/src/resources.d.ts.map +1 -1
- package/dist/runner/src/runner-capabilities.d.ts +25 -0
- package/dist/runner/src/runner-capabilities.d.ts.map +1 -1
- package/dist/runner/src/serve.d.ts.map +1 -1
- package/dist/runner/src/session-builder.d.ts.map +1 -1
- package/dist/sdk/asset-manager.js +12 -12
- package/dist/sdk/bridge.js +4 -4
- package/dist/sdk/core.js +8 -8
- package/dist/sdk/flow.js +9 -9
- package/dist/sdk/index.js +92 -76
- package/dist/sdk/index.js.map +1 -1
- package/dist/sdk/resolver.js +1 -1
- package/dist/sdk/runner.js +17 -17
- package/dist/sdk/session.js +1 -1
- package/dist/sdk/src/agent-session.d.ts +8 -0
- package/dist/sdk/src/agent-session.d.ts.map +1 -1
- package/dist/sdk/src/factory.d.ts.map +1 -1
- package/dist/sdk/src/index.d.ts +2 -2
- package/dist/sdk/src/index.d.ts.map +1 -1
- package/dist/sdk/store.js +1 -1
- package/dist/sdk/telemetry.js +1 -1
- package/dist/secrets/index.js +2 -2
- package/dist/secrets/src/index.d.ts +8 -8
- package/dist/secrets/src/index.d.ts.map +1 -1
- package/dist/secrets/src/lifecycle.d.ts +1 -2
- package/dist/secrets/src/lifecycle.d.ts.map +1 -1
- package/dist/secrets/src/providers/env.d.ts +1 -1
- package/dist/secrets/src/providers/env.d.ts.map +1 -1
- package/dist/secrets/src/providers/local.d.ts +1 -1
- package/dist/secrets/src/providers/local.d.ts.map +1 -1
- package/dist/secrets/src/router.d.ts +1 -1
- package/dist/secrets/src/router.d.ts.map +1 -1
- package/dist/session/index.js +1 -1
- package/dist/session/src/mentions.d.ts.map +1 -1
- package/dist/{sessions-2IUX4P3P.js → sessions-DICDEONJ.js} +3 -3
- package/dist/{sessions-2IUX4P3P.js.map → sessions-DICDEONJ.js.map} +1 -1
- package/dist/{setup-4YMN2BDU.js → setup-6MQ6QWML.js} +198 -175
- package/dist/setup-6MQ6QWML.js.map +1 -0
- package/dist/skills-BMI6H7HI.js +7 -0
- package/dist/{skills-6HJ3WINN.js.map → skills-BMI6H7HI.js.map} +1 -1
- package/dist/store/index.js +1 -1
- package/dist/store/src/index.d.ts +1 -1
- package/dist/store/src/index.d.ts.map +1 -1
- package/dist/store/src/resource-client.d.ts +1 -1
- package/dist/store/src/resource-client.d.ts.map +1 -1
- package/dist/store/src/vue.d.ts.map +1 -1
- package/dist/store/vue.js.map +1 -1
- package/dist/store-client-LDYF4TK4.js +15 -0
- package/dist/{store-client-BCP5LCAZ.js.map → store-client-LDYF4TK4.js.map} +1 -1
- package/dist/telemetry/index.js +1 -1
- package/dist/telemetry/src/context.d.ts.map +1 -1
- package/dist/telemetry/src/index.d.ts +3 -3
- package/dist/telemetry/src/index.d.ts.map +1 -1
- package/dist/telemetry/src/otel/gen-ai.d.ts +1 -1
- package/dist/telemetry/src/otel/gen-ai.d.ts.map +1 -1
- package/dist/telemetry/src/otel/provider.d.ts.map +1 -1
- package/dist/transport/src/index.d.ts +1 -1
- package/dist/transport/src/index.d.ts.map +1 -1
- package/dist/tui/index.js +251 -218
- package/dist/tui/index.js.map +1 -1
- package/dist/tui/src/index.d.ts +2 -2
- package/dist/tui/src/index.d.ts.map +1 -1
- package/dist/tui/src/repl-renderer.d.ts.map +1 -1
- package/dist/tui/src/repl-session.d.ts +1 -1
- package/dist/tui/src/repl-session.d.ts.map +1 -1
- package/dist/tui/src/repl.d.ts.map +1 -1
- package/dist/types/manifests.js +1 -1
- package/dist/types/src/envelope.d.ts +1 -1
- package/dist/types/src/envelope.d.ts.map +1 -1
- package/dist/types/src/manifests/agent.d.ts.map +1 -1
- package/dist/types/src/manifests/connector.d.ts.map +1 -1
- package/dist/types/src/manifests/contract.d.ts.map +1 -1
- package/dist/types/src/manifests/index.d.ts +16 -16
- package/dist/types/src/manifests/index.d.ts.map +1 -1
- package/dist/types/src/manifests/mcp-server.d.ts.map +1 -1
- package/dist/types/src/manifests/mount.d.ts.map +1 -1
- package/dist/types/src/manifests/persona.d.ts.map +1 -1
- package/dist/types/src/manifests/preset.d.ts +0 -18
- package/dist/types/src/manifests/preset.d.ts.map +1 -1
- package/dist/types/src/manifests/prompt.d.ts.map +1 -1
- package/dist/types/src/manifests/ruleset.d.ts.map +1 -1
- package/dist/types/src/manifests/skill.d.ts.map +1 -1
- package/dist/validator-VF5M764T.js +5 -0
- package/dist/{validator-47SQUW3J.js.map → validator-VF5M764T.js.map} +1 -1
- package/dist/workspace-plugin/adapters/mcp.js +6 -6
- package/dist/workspace-plugin/adapters/omp.js +76 -69
- package/dist/workspace-plugin/adapters/omp.js.map +1 -1
- package/dist/workspace-plugin/index.js +2 -2
- package/dist/workspace-plugin/src/adapters/omp.d.ts.map +1 -1
- package/dist/workspace-plugin/src/tools/connectors.d.ts.map +1 -1
- package/dist/workspace-plugin/src/tools/flows.d.ts.map +1 -1
- package/dist/workspace-plugin/src/tools/sessions.d.ts.map +1 -1
- package/dist/workspace-plugin/src/tools/skills.d.ts.map +1 -1
- package/dist/workspace-plugin/src/tools/validator.d.ts.map +1 -1
- package/package.json +1 -2
- package/dist/asset-feeds-2V7LZIG7.js.map +0 -1
- package/dist/chunk-24UIWON4.js.map +0 -1
- package/dist/chunk-2FS4FPZ7.js.map +0 -1
- package/dist/chunk-3QQSSRYN.js.map +0 -1
- package/dist/chunk-5YO3H5Q4.js.map +0 -1
- package/dist/chunk-7GWYRVAX.js.map +0 -1
- package/dist/chunk-AKSR434V.js.map +0 -1
- package/dist/chunk-CBNMIKUO.js.map +0 -1
- package/dist/chunk-FENG6OO6.js.map +0 -1
- package/dist/chunk-FQHHCICT.js.map +0 -1
- package/dist/chunk-IEJ5IOC3.js.map +0 -1
- package/dist/chunk-IERB3UXJ.js.map +0 -1
- package/dist/chunk-JIQLLZ65.js.map +0 -1
- package/dist/chunk-M4KLIEIJ.js.map +0 -1
- package/dist/chunk-MIH45XPY.js.map +0 -1
- package/dist/chunk-PAYAFNXG.js.map +0 -1
- package/dist/chunk-QDJKE557.js.map +0 -1
- package/dist/chunk-SF4GWVR5.js.map +0 -1
- package/dist/chunk-TDZGENVP.js.map +0 -1
- package/dist/chunk-TV72ZJYN.js.map +0 -1
- package/dist/chunk-UIZKIUC6.js.map +0 -1
- package/dist/chunk-W7W66MDZ.js.map +0 -1
- package/dist/chunk-Z3XXKR5E.js.map +0 -1
- package/dist/chunk-ZONCCO5N.js.map +0 -1
- package/dist/ensure-sources-BNSRO5G7.js +0 -74
- package/dist/ensure-sources-BNSRO5G7.js.map +0 -1
- package/dist/flows-L3GHQD7F.js +0 -7
- package/dist/open-library-3VJY74LQ.js +0 -23
- package/dist/paths-CE66L3AL.js +0 -15
- package/dist/plugin-store-GL5VKYUA.js.map +0 -1
- package/dist/provider-GAWKFQ3T.js.map +0 -1
- package/dist/setup-4YMN2BDU.js.map +0 -1
- package/dist/skills-6HJ3WINN.js +0 -7
- package/dist/store-client-BCP5LCAZ.js +0 -15
- package/dist/validator-47SQUW3J.js +0 -5
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { decodeSkaileManifest, SKAILE_MANIFEST_FILENAME } from './chunk-
|
|
2
|
-
import { scanDirectory, parseFrontmatter, bundleDepRefs, fromMcpServerMd } from './chunk-
|
|
3
|
-
import { parseAssetRef, assetRefToStr } from './chunk-
|
|
1
|
+
import { decodeSkaileManifest, SKAILE_MANIFEST_FILENAME } from './chunk-H5YXL4KI.js';
|
|
2
|
+
import { scanDirectory, parseFrontmatter, bundleDepRefs, fromMcpServerMd } from './chunk-4AGIEU7V.js';
|
|
3
|
+
import { parseAssetRef, assetRefToStr } from './chunk-LFDZYCEO.js';
|
|
4
4
|
import { mkdirSync, existsSync, readFileSync, writeFileSync, lstatSync, symlinkSync, rmSync, readdirSync, cpSync } from 'fs';
|
|
5
5
|
import { homedir } from 'os';
|
|
6
6
|
import { join, resolve, relative, dirname, parse as parse$1, basename } from 'path';
|
|
@@ -106,65 +106,75 @@ function unlinkRepo(projectDir, repoName) {
|
|
|
106
106
|
return true;
|
|
107
107
|
}
|
|
108
108
|
function ensureRepo(decl, name, reposDir, opts) {
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
if (links[name]) {
|
|
112
|
-
const linked = links[name];
|
|
113
|
-
if (!existsSync(linked)) {
|
|
114
|
-
throw new Error(
|
|
115
|
-
`Linked path not found: ${linked}. Remove the .skaile/links.yaml entry to clear it.`
|
|
116
|
-
);
|
|
117
|
-
}
|
|
118
|
-
return linked;
|
|
119
|
-
}
|
|
120
|
-
}
|
|
109
|
+
const linked = resolveLinkedOverride(name, opts?.projectDir);
|
|
110
|
+
if (linked) return linked;
|
|
121
111
|
if (decl.path) {
|
|
122
|
-
|
|
123
|
-
const resolved = resolve(projectDir, decl.path);
|
|
124
|
-
if (existsSync(resolved)) return resolved;
|
|
125
|
-
if (!decl.url) {
|
|
126
|
-
throw new Error(`Local repository path not found: ${decl.path} (resolved: ${resolved})`);
|
|
127
|
-
}
|
|
128
|
-
if (!cloneRepo(decl.url, decl.branch ?? "main", resolved)) {
|
|
129
|
-
throw new Error(`Failed to clone ${decl.url} into ${resolved}`);
|
|
130
|
-
}
|
|
131
|
-
if (opts?.pin) checkoutPin(resolved, opts.pin);
|
|
132
|
-
return resolved;
|
|
112
|
+
return ensureLocalPathRepo(decl, reposDir, opts);
|
|
133
113
|
}
|
|
134
114
|
if (decl.url) {
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
115
|
+
return ensureRemoteRepo(decl, name, reposDir, opts);
|
|
116
|
+
}
|
|
117
|
+
throw new Error(`Repository "${name}" has neither url nor path`);
|
|
118
|
+
}
|
|
119
|
+
function resolveLinkedOverride(name, projectDir) {
|
|
120
|
+
if (!projectDir) return null;
|
|
121
|
+
const links = readLinks(projectDir);
|
|
122
|
+
const linked = links[name];
|
|
123
|
+
if (!linked) return null;
|
|
124
|
+
if (!existsSync(linked)) {
|
|
125
|
+
throw new Error(
|
|
126
|
+
`Linked path not found: ${linked}. Remove the .skaile/links.yaml entry to clear it.`
|
|
127
|
+
);
|
|
128
|
+
}
|
|
129
|
+
return linked;
|
|
130
|
+
}
|
|
131
|
+
function ensureLocalPathRepo(decl, reposDir, opts) {
|
|
132
|
+
const projectDir = opts?.projectDir ?? resolve(reposDir, "..");
|
|
133
|
+
const resolved = resolve(projectDir, decl.path);
|
|
134
|
+
if (existsSync(resolved)) return resolved;
|
|
135
|
+
if (!decl.url) {
|
|
136
|
+
throw new Error(`Local repository path not found: ${decl.path} (resolved: ${resolved})`);
|
|
137
|
+
}
|
|
138
|
+
if (!cloneRepo(decl.url, decl.branch ?? "main", resolved)) {
|
|
139
|
+
throw new Error(`Failed to clone ${decl.url} into ${resolved}`);
|
|
140
|
+
}
|
|
141
|
+
if (opts?.pin) checkoutPin(resolved, opts.pin);
|
|
142
|
+
return resolved;
|
|
143
|
+
}
|
|
144
|
+
function ensureRemoteRepo(decl, name, reposDir, opts) {
|
|
145
|
+
const branch = decl.branch ?? "main";
|
|
146
|
+
const globalCache = getGlobalCacheDir();
|
|
147
|
+
const cacheDest = join(globalCache, name);
|
|
148
|
+
if (existsSync(join(cacheDest, ".git"))) {
|
|
149
|
+
if (!opts?.pin) pullRepo(cacheDest, branch);
|
|
150
|
+
} else {
|
|
151
|
+
if (!cloneRepo(decl.url, branch, cacheDest)) {
|
|
152
|
+
throw new Error(`Failed to clone ${decl.url} (branch: ${branch})`);
|
|
144
153
|
}
|
|
145
|
-
|
|
146
|
-
|
|
154
|
+
}
|
|
155
|
+
if (opts?.pin) {
|
|
156
|
+
checkoutPin(cacheDest, opts.pin);
|
|
157
|
+
}
|
|
158
|
+
linkCacheIntoProject(cacheDest, reposDir, name);
|
|
159
|
+
return cacheDest;
|
|
160
|
+
}
|
|
161
|
+
function linkCacheIntoProject(cacheDest, reposDir, name) {
|
|
162
|
+
const projectDest = join(reposDir, name);
|
|
163
|
+
const projectExists = existsSync(projectDest);
|
|
164
|
+
const isSymlink = projectExists && lstatSync(projectDest).isSymbolicLink();
|
|
165
|
+
if (!projectExists) {
|
|
166
|
+
mkdirSync(reposDir, { recursive: true });
|
|
167
|
+
try {
|
|
168
|
+
symlinkSync(cacheDest, projectDest);
|
|
169
|
+
} catch {
|
|
147
170
|
}
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
try {
|
|
154
|
-
symlinkSync(cacheDest, projectDest);
|
|
155
|
-
} catch {
|
|
156
|
-
return cacheDest;
|
|
157
|
-
}
|
|
158
|
-
} else if (!isSymlink) {
|
|
159
|
-
rmSync(projectDest, { recursive: true });
|
|
160
|
-
try {
|
|
161
|
-
symlinkSync(cacheDest, projectDest);
|
|
162
|
-
} catch {
|
|
163
|
-
}
|
|
171
|
+
} else if (!isSymlink) {
|
|
172
|
+
rmSync(projectDest, { recursive: true });
|
|
173
|
+
try {
|
|
174
|
+
symlinkSync(cacheDest, projectDest);
|
|
175
|
+
} catch {
|
|
164
176
|
}
|
|
165
|
-
return cacheDest;
|
|
166
177
|
}
|
|
167
|
-
throw new Error(`Repository "${name}" has neither url nor path`);
|
|
168
178
|
}
|
|
169
179
|
function repoSlugFromGitRemote(rootDir) {
|
|
170
180
|
const r = spawnSync("git", ["-C", rootDir, "config", "--get", "remote.origin.url"], {
|
|
@@ -291,37 +301,7 @@ async function resolveAll(deps, opts) {
|
|
|
291
301
|
if (seen.has(key)) return;
|
|
292
302
|
seen.add(key);
|
|
293
303
|
const sourceCandidates = opts.provenanceIndex.get(key) ?? [];
|
|
294
|
-
const storeCandidates =
|
|
295
|
-
if (opts.stores.length > 0 && opts.storeFetcher) {
|
|
296
|
-
const sourceVersions = sourceCandidates.map((c) => c.version);
|
|
297
|
-
const fetcher = opts.storeFetcher;
|
|
298
|
-
for (const store of opts.stores) {
|
|
299
|
-
let versionsHint = sourceVersions;
|
|
300
|
-
if (versionsHint.length === 0 && needsStoreVersionDiscovery(ref.pin) && fetcher.listVersions) {
|
|
301
|
-
versionsHint = await fetcher.listVersions(
|
|
302
|
-
store.url,
|
|
303
|
-
assetRefToStr({ ...ref, pin: void 0 })
|
|
304
|
-
);
|
|
305
|
-
}
|
|
306
|
-
const candidateVersions = enumerateVersionsForPin(ref.pin, versionsHint);
|
|
307
|
-
for (const v of candidateVersions) {
|
|
308
|
-
if (!v) continue;
|
|
309
|
-
const m = await fetcher.getInstallManifest(store.url, assetRefToStr({ ...ref, pin: v }));
|
|
310
|
-
if (m) {
|
|
311
|
-
storeCandidates.push({
|
|
312
|
-
publisher: ref.publisher,
|
|
313
|
-
kind: ref.kind,
|
|
314
|
-
name: ref.name,
|
|
315
|
-
version: v,
|
|
316
|
-
sourceUrl: m.sourceUrl,
|
|
317
|
-
commit: m.commit,
|
|
318
|
-
files: m.files,
|
|
319
|
-
sha256: m.sha256
|
|
320
|
-
});
|
|
321
|
-
}
|
|
322
|
-
}
|
|
323
|
-
}
|
|
324
|
-
}
|
|
304
|
+
const storeCandidates = await gatherStoreCandidates(ref, ref.publisher, sourceCandidates, opts);
|
|
325
305
|
const all = [...sourceCandidates, ...storeCandidates];
|
|
326
306
|
if (all.length === 0) {
|
|
327
307
|
missing.push(refStr);
|
|
@@ -336,36 +316,23 @@ async function resolveAll(deps, opts) {
|
|
|
336
316
|
const best = versions.sort((a, b) => semver.rcompare(coerceVersion(a), coerceVersion(b)))[0];
|
|
337
317
|
const finalists = filtered.filter((c) => c.version === best);
|
|
338
318
|
const canonicalRef = assetRefToStr({ ...ref, pin: best });
|
|
339
|
-
const
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
}
|
|
357
|
-
if (opts.storeFetcher && opts.stores.length > 0 && sourceCandidates.some((c) => c.version === best) && storeCandidates.some((c) => c.version === best)) {
|
|
358
|
-
for (const store of opts.stores) {
|
|
359
|
-
const d = await opts.storeFetcher.getCanonicalDigest(store.url, canonicalRef);
|
|
360
|
-
if (d && d.sha256 !== chosen.sha256) {
|
|
361
|
-
throw new CanonicalRefConflictError(
|
|
362
|
-
canonicalRef,
|
|
363
|
-
[...finalists, { ...chosen, sourceUrl: store.url, sha256: d.sha256 }],
|
|
364
|
-
[...depChain, refStr]
|
|
365
|
-
);
|
|
366
|
-
}
|
|
367
|
-
}
|
|
368
|
-
}
|
|
319
|
+
const chosen = selectChosenCandidate(
|
|
320
|
+
finalists,
|
|
321
|
+
canonicalRef,
|
|
322
|
+
overridesByRef,
|
|
323
|
+
overridesApplied,
|
|
324
|
+
[...depChain, refStr]
|
|
325
|
+
);
|
|
326
|
+
await crossCheckStoreDigest(
|
|
327
|
+
chosen,
|
|
328
|
+
finalists,
|
|
329
|
+
canonicalRef,
|
|
330
|
+
best,
|
|
331
|
+
sourceCandidates,
|
|
332
|
+
storeCandidates,
|
|
333
|
+
opts,
|
|
334
|
+
[...depChain, refStr]
|
|
335
|
+
);
|
|
369
336
|
resolved.push(chosen);
|
|
370
337
|
resolvedBy.set(key, parent);
|
|
371
338
|
for (const depRef of chosen.deps ?? []) {
|
|
@@ -377,6 +344,72 @@ async function resolveAll(deps, opts) {
|
|
|
377
344
|
}
|
|
378
345
|
return { resolved, missing, resolvedBy, overridesApplied };
|
|
379
346
|
}
|
|
347
|
+
async function gatherStoreCandidates(ref, publisher, sourceCandidates, opts) {
|
|
348
|
+
const storeCandidates = [];
|
|
349
|
+
if (opts.stores.length === 0 || !opts.storeFetcher) return storeCandidates;
|
|
350
|
+
const sourceVersions = sourceCandidates.map((c) => c.version);
|
|
351
|
+
const fetcher = opts.storeFetcher;
|
|
352
|
+
for (const store of opts.stores) {
|
|
353
|
+
let versionsHint = sourceVersions;
|
|
354
|
+
if (versionsHint.length === 0 && needsStoreVersionDiscovery(ref.pin) && fetcher.listVersions) {
|
|
355
|
+
versionsHint = await fetcher.listVersions(
|
|
356
|
+
store.url,
|
|
357
|
+
assetRefToStr({ ...ref, pin: void 0 })
|
|
358
|
+
);
|
|
359
|
+
}
|
|
360
|
+
const candidateVersions = enumerateVersionsForPin(ref.pin, versionsHint);
|
|
361
|
+
for (const v of candidateVersions) {
|
|
362
|
+
if (!v) continue;
|
|
363
|
+
const m = await fetcher.getInstallManifest(store.url, assetRefToStr({ ...ref, pin: v }));
|
|
364
|
+
if (m) {
|
|
365
|
+
storeCandidates.push({
|
|
366
|
+
publisher,
|
|
367
|
+
kind: ref.kind,
|
|
368
|
+
name: ref.name,
|
|
369
|
+
version: v,
|
|
370
|
+
sourceUrl: m.sourceUrl,
|
|
371
|
+
commit: m.commit,
|
|
372
|
+
files: m.files,
|
|
373
|
+
sha256: m.sha256
|
|
374
|
+
});
|
|
375
|
+
}
|
|
376
|
+
}
|
|
377
|
+
}
|
|
378
|
+
return storeCandidates;
|
|
379
|
+
}
|
|
380
|
+
function selectChosenCandidate(finalists, canonicalRef, overridesByRef, overridesApplied, conflictChain) {
|
|
381
|
+
const uniqueShas = Array.from(new Set(finalists.map((c) => c.sha256)));
|
|
382
|
+
if (uniqueShas.length > 1) {
|
|
383
|
+
const override = overridesByRef.get(canonicalRef);
|
|
384
|
+
if (!override) {
|
|
385
|
+
throw new CanonicalRefConflictError(canonicalRef, finalists, conflictChain);
|
|
386
|
+
}
|
|
387
|
+
const pick = finalists.find((c) => c.sourceUrl === override.source);
|
|
388
|
+
if (!pick) {
|
|
389
|
+
throw new Error(
|
|
390
|
+
`override for ${canonicalRef} points at ${override.source}, which is not among the resolved candidates`
|
|
391
|
+
);
|
|
392
|
+
}
|
|
393
|
+
overridesApplied.add(canonicalRef);
|
|
394
|
+
return pick;
|
|
395
|
+
}
|
|
396
|
+
return [...finalists].sort((a, b) => a.sourceUrl.localeCompare(b.sourceUrl))[0];
|
|
397
|
+
}
|
|
398
|
+
async function crossCheckStoreDigest(chosen, finalists, canonicalRef, best, sourceCandidates, storeCandidates, opts, conflictChain) {
|
|
399
|
+
if (!opts.storeFetcher || opts.stores.length === 0 || !sourceCandidates.some((c) => c.version === best) || !storeCandidates.some((c) => c.version === best)) {
|
|
400
|
+
return;
|
|
401
|
+
}
|
|
402
|
+
for (const store of opts.stores) {
|
|
403
|
+
const d = await opts.storeFetcher.getCanonicalDigest(store.url, canonicalRef);
|
|
404
|
+
if (d && d.sha256 !== chosen.sha256) {
|
|
405
|
+
throw new CanonicalRefConflictError(
|
|
406
|
+
canonicalRef,
|
|
407
|
+
[...finalists, { ...chosen, sourceUrl: store.url, sha256: d.sha256 }],
|
|
408
|
+
conflictChain
|
|
409
|
+
);
|
|
410
|
+
}
|
|
411
|
+
}
|
|
412
|
+
}
|
|
380
413
|
function coerceVersion(v) {
|
|
381
414
|
return semver.valid(v) ? v : semver.coerce(v)?.version ?? "0.0.0";
|
|
382
415
|
}
|
|
@@ -534,51 +567,57 @@ function walkWithManifest(clone, manifestPath, index) {
|
|
|
534
567
|
}
|
|
535
568
|
const curatedSource = a.source ?? manifest.source;
|
|
536
569
|
const version = a.version ?? manifestVersion;
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
let commit;
|
|
540
|
-
let metadata;
|
|
541
|
-
let frontmatter;
|
|
542
|
-
if (curatedSource) {
|
|
543
|
-
files = granularFiles(a) ?? [];
|
|
544
|
-
sourceUrl = curatedSource.url;
|
|
545
|
-
commit = curatedSource.commit ?? clone.commit;
|
|
546
|
-
} else {
|
|
547
|
-
files = expandAssetFiles(repoRoot, a);
|
|
548
|
-
verifyNameMatch(repoRoot, files, a.name, a.kind);
|
|
549
|
-
metadata = readMetadata(repoRoot, files, a.kind);
|
|
550
|
-
frontmatter = readContentFrontmatter(repoRoot, files, a.kind);
|
|
551
|
-
sourceUrl = clone.sourceUrl;
|
|
552
|
-
commit = clone.commit;
|
|
553
|
-
}
|
|
570
|
+
const resolved = resolveAssetBytes(clone, repoRoot, a, curatedSource);
|
|
571
|
+
const { files } = resolved;
|
|
554
572
|
const candidate = {
|
|
555
573
|
publisher: assetPublisher,
|
|
556
574
|
kind: a.kind,
|
|
557
575
|
name: a.name,
|
|
558
576
|
version,
|
|
559
|
-
sourceUrl,
|
|
560
|
-
commit,
|
|
577
|
+
sourceUrl: resolved.sourceUrl,
|
|
578
|
+
commit: resolved.commit,
|
|
561
579
|
files,
|
|
562
580
|
sha256: a.sha256 ?? compositeSha256(files),
|
|
563
|
-
metadata,
|
|
581
|
+
metadata: resolved.metadata,
|
|
564
582
|
deps: a.dependencies ?? bundleDeps(repoRoot, files, a.kind)
|
|
565
583
|
};
|
|
566
|
-
|
|
567
|
-
const fmArr = (k) => Array.isArray(frontmatter?.[k]) ? frontmatter[k].filter((x) => typeof x === "string") : void 0;
|
|
568
|
-
const description = a.description ?? fmStr("description");
|
|
569
|
-
const keywords = a.keywords ?? fmArr("keywords");
|
|
570
|
-
const category = a.category ?? fmStr("category");
|
|
571
|
-
const license = a.license ?? manifest.license;
|
|
572
|
-
const homepage = a.homepage ?? manifest.homepage;
|
|
573
|
-
if (description) candidate.description = description;
|
|
574
|
-
if (keywords && keywords.length > 0) candidate.keywords = keywords;
|
|
575
|
-
if (category) candidate.category = category;
|
|
576
|
-
if (license) candidate.license = license;
|
|
577
|
-
if (homepage) candidate.homepage = homepage;
|
|
584
|
+
applyStoreListingMetadata(candidate, a, manifest, resolved.frontmatter);
|
|
578
585
|
push(index, `${assetPublisher}/${a.kind}:${a.name}`, candidate);
|
|
579
586
|
}
|
|
580
587
|
return true;
|
|
581
588
|
}
|
|
589
|
+
function resolveAssetBytes(clone, repoRoot, a, curatedSource) {
|
|
590
|
+
if (curatedSource) {
|
|
591
|
+
return {
|
|
592
|
+
files: granularFiles(a) ?? [],
|
|
593
|
+
sourceUrl: curatedSource.url,
|
|
594
|
+
commit: curatedSource.commit ?? clone.commit
|
|
595
|
+
};
|
|
596
|
+
}
|
|
597
|
+
const files = expandAssetFiles(repoRoot, a);
|
|
598
|
+
verifyNameMatch(repoRoot, files, a.name, a.kind);
|
|
599
|
+
return {
|
|
600
|
+
files,
|
|
601
|
+
sourceUrl: clone.sourceUrl,
|
|
602
|
+
commit: clone.commit,
|
|
603
|
+
metadata: readMetadata(repoRoot, files, a.kind),
|
|
604
|
+
frontmatter: readContentFrontmatter(repoRoot, files, a.kind)
|
|
605
|
+
};
|
|
606
|
+
}
|
|
607
|
+
function applyStoreListingMetadata(candidate, a, manifest, frontmatter) {
|
|
608
|
+
const fmStr = (k) => typeof frontmatter?.[k] === "string" ? frontmatter[k] : void 0;
|
|
609
|
+
const fmArr = (k) => Array.isArray(frontmatter?.[k]) ? frontmatter[k].filter((x) => typeof x === "string") : void 0;
|
|
610
|
+
const description = a.description ?? fmStr("description");
|
|
611
|
+
const keywords = a.keywords ?? fmArr("keywords");
|
|
612
|
+
const category = a.category ?? fmStr("category");
|
|
613
|
+
const license = a.license ?? manifest.license;
|
|
614
|
+
const homepage = a.homepage ?? manifest.homepage;
|
|
615
|
+
if (description) candidate.description = description;
|
|
616
|
+
if (keywords && keywords.length > 0) candidate.keywords = keywords;
|
|
617
|
+
if (category) candidate.category = category;
|
|
618
|
+
if (license) candidate.license = license;
|
|
619
|
+
if (homepage) candidate.homepage = homepage;
|
|
620
|
+
}
|
|
582
621
|
function globFiles(a) {
|
|
583
622
|
if (!Array.isArray(a.files)) return void 0;
|
|
584
623
|
const strings = a.files.filter((f) => typeof f === "string");
|
|
@@ -854,59 +893,8 @@ function mergeSkWorkspaceConfigs(base, overlay) {
|
|
|
854
893
|
connectors: mergeById(base.connectors ?? [], overlay.connectors ?? []),
|
|
855
894
|
// mcp_servers: by id — overlay wins
|
|
856
895
|
mcp_servers: mergeById(base.mcp_servers ?? [], overlay.mcp_servers ?? []),
|
|
857
|
-
agent:
|
|
858
|
-
|
|
859
|
-
context: overlay.agent?.context ?? base.agent?.context,
|
|
860
|
-
permissions: {
|
|
861
|
-
...base.agent?.permissions,
|
|
862
|
-
...stripUndefined(overlay.agent?.permissions),
|
|
863
|
-
deny_write: dedupe([
|
|
864
|
-
...base.agent?.permissions?.deny_write ?? [],
|
|
865
|
-
...overlay.agent?.permissions?.deny_write ?? []
|
|
866
|
-
]),
|
|
867
|
-
deny_read: dedupe([
|
|
868
|
-
...base.agent?.permissions?.deny_read ?? [],
|
|
869
|
-
...overlay.agent?.permissions?.deny_read ?? []
|
|
870
|
-
])
|
|
871
|
-
},
|
|
872
|
-
subagents: {
|
|
873
|
-
...base.agent?.subagents ?? {},
|
|
874
|
-
...overlay.agent?.subagents ?? {}
|
|
875
|
-
},
|
|
876
|
-
hooks: {
|
|
877
|
-
pre_flow: [
|
|
878
|
-
...base.agent?.hooks?.pre_flow ?? [],
|
|
879
|
-
...overlay.agent?.hooks?.pre_flow ?? []
|
|
880
|
-
],
|
|
881
|
-
post_flow: [
|
|
882
|
-
...base.agent?.hooks?.post_flow ?? [],
|
|
883
|
-
...overlay.agent?.hooks?.post_flow ?? []
|
|
884
|
-
],
|
|
885
|
-
pre_node: [
|
|
886
|
-
...base.agent?.hooks?.pre_node ?? [],
|
|
887
|
-
...overlay.agent?.hooks?.pre_node ?? []
|
|
888
|
-
],
|
|
889
|
-
post_node: [
|
|
890
|
-
...base.agent?.hooks?.post_node ?? [],
|
|
891
|
-
...overlay.agent?.hooks?.post_node ?? []
|
|
892
|
-
]
|
|
893
|
-
}
|
|
894
|
-
},
|
|
895
|
-
workspace: {
|
|
896
|
-
directories: dedupe([
|
|
897
|
-
...base.workspace?.directories ?? [],
|
|
898
|
-
...overlay.workspace?.directories ?? []
|
|
899
|
-
]),
|
|
900
|
-
git: {
|
|
901
|
-
init: overlay.workspace?.git?.init ?? base.workspace?.git?.init,
|
|
902
|
-
ignore: dedupe([
|
|
903
|
-
...base.workspace?.git?.ignore ?? [],
|
|
904
|
-
...overlay.workspace?.git?.ignore ?? []
|
|
905
|
-
])
|
|
906
|
-
},
|
|
907
|
-
setup: overlay.workspace?.setup ?? base.workspace?.setup,
|
|
908
|
-
container: overlay.workspace?.container ?? base.workspace?.container
|
|
909
|
-
},
|
|
896
|
+
agent: mergeAgentConfig(base.agent, overlay.agent),
|
|
897
|
+
workspace: mergeWorkspaceConfig(base.workspace, overlay.workspace),
|
|
910
898
|
// secrets: overlay wins entirely
|
|
911
899
|
secrets: overlay.secrets ?? base.secrets,
|
|
912
900
|
// telemetry: overlay wins entirely (raw pass-through)
|
|
@@ -925,6 +913,45 @@ function mergeSkWorkspaceConfigs(base, overlay) {
|
|
|
925
913
|
deploy: overlay.deploy ?? base.deploy
|
|
926
914
|
};
|
|
927
915
|
}
|
|
916
|
+
function mergeAgentConfig(base, overlay) {
|
|
917
|
+
return {
|
|
918
|
+
definition: overlay?.definition ?? base?.definition,
|
|
919
|
+
context: overlay?.context ?? base?.context,
|
|
920
|
+
permissions: {
|
|
921
|
+
...base?.permissions,
|
|
922
|
+
...stripUndefined(overlay?.permissions),
|
|
923
|
+
deny_write: dedupe([
|
|
924
|
+
...base?.permissions?.deny_write ?? [],
|
|
925
|
+
...overlay?.permissions?.deny_write ?? []
|
|
926
|
+
]),
|
|
927
|
+
deny_read: dedupe([
|
|
928
|
+
...base?.permissions?.deny_read ?? [],
|
|
929
|
+
...overlay?.permissions?.deny_read ?? []
|
|
930
|
+
])
|
|
931
|
+
},
|
|
932
|
+
subagents: {
|
|
933
|
+
...base?.subagents ?? {},
|
|
934
|
+
...overlay?.subagents ?? {}
|
|
935
|
+
},
|
|
936
|
+
hooks: {
|
|
937
|
+
pre_flow: [...base?.hooks?.pre_flow ?? [], ...overlay?.hooks?.pre_flow ?? []],
|
|
938
|
+
post_flow: [...base?.hooks?.post_flow ?? [], ...overlay?.hooks?.post_flow ?? []],
|
|
939
|
+
pre_node: [...base?.hooks?.pre_node ?? [], ...overlay?.hooks?.pre_node ?? []],
|
|
940
|
+
post_node: [...base?.hooks?.post_node ?? [], ...overlay?.hooks?.post_node ?? []]
|
|
941
|
+
}
|
|
942
|
+
};
|
|
943
|
+
}
|
|
944
|
+
function mergeWorkspaceConfig(base, overlay) {
|
|
945
|
+
return {
|
|
946
|
+
directories: dedupe([...base?.directories ?? [], ...overlay?.directories ?? []]),
|
|
947
|
+
git: {
|
|
948
|
+
init: overlay?.git?.init ?? base?.git?.init,
|
|
949
|
+
ignore: dedupe([...base?.git?.ignore ?? [], ...overlay?.git?.ignore ?? []])
|
|
950
|
+
},
|
|
951
|
+
setup: overlay?.setup ?? base?.setup,
|
|
952
|
+
container: overlay?.container ?? base?.container
|
|
953
|
+
};
|
|
954
|
+
}
|
|
928
955
|
var KNOWN_DRIVERS = ["omp", "claude-sdk", "codex"];
|
|
929
956
|
var KNOWN_PROVIDERS = [
|
|
930
957
|
"anthropic",
|
|
@@ -958,11 +985,7 @@ function normalizeAgentConfig(raw) {
|
|
|
958
985
|
function normalizeConfig(raw) {
|
|
959
986
|
return normalizeConfigInternal(raw).config;
|
|
960
987
|
}
|
|
961
|
-
function
|
|
962
|
-
const config = {};
|
|
963
|
-
const diagnostics = [];
|
|
964
|
-
if (raw.name) config.name = String(raw.name);
|
|
965
|
-
if (raw.description) config.description = String(raw.description);
|
|
988
|
+
function normalizeAgentConfigSection(raw, config, diagnostics) {
|
|
966
989
|
let agentConfigRaw;
|
|
967
990
|
let agentConfigKey;
|
|
968
991
|
if (raw["agent-config"] !== void 0) {
|
|
@@ -975,31 +998,29 @@ function normalizeConfigInternal(raw) {
|
|
|
975
998
|
agentConfigRaw = raw.agentConfig;
|
|
976
999
|
agentConfigKey = "agentConfig";
|
|
977
1000
|
}
|
|
978
|
-
if (agentConfigRaw
|
|
979
|
-
|
|
980
|
-
diagnostics.push({
|
|
981
|
-
code: "legacy_key_camelcase",
|
|
982
|
-
severity: "warning",
|
|
983
|
-
message: 'Non-canonical key "agentConfig" \u2014 use "agent-config".',
|
|
984
|
-
path: "agentConfig"
|
|
985
|
-
});
|
|
986
|
-
}
|
|
987
|
-
const { profiles, wrappedFlat } = normalizeAgentConfig(
|
|
988
|
-
agentConfigRaw
|
|
989
|
-
);
|
|
990
|
-
if (wrappedFlat) {
|
|
991
|
-
diagnostics.push({
|
|
992
|
-
code: "legacy_agent_config_flat",
|
|
993
|
-
severity: "warning",
|
|
994
|
-
message: 'Flat agent-config block wrapped as the "default" profile \u2014 nest fields under "default:".',
|
|
995
|
-
path: agentConfigKey
|
|
996
|
-
});
|
|
997
|
-
}
|
|
998
|
-
config.agent_config = profiles;
|
|
1001
|
+
if (!agentConfigRaw || typeof agentConfigRaw !== "object" || Array.isArray(agentConfigRaw)) {
|
|
1002
|
+
return;
|
|
999
1003
|
}
|
|
1000
|
-
if (
|
|
1001
|
-
|
|
1004
|
+
if (agentConfigKey === "agentConfig") {
|
|
1005
|
+
diagnostics.push({
|
|
1006
|
+
code: "legacy_key_camelcase",
|
|
1007
|
+
severity: "warning",
|
|
1008
|
+
message: 'Non-canonical key "agentConfig" \u2014 use "agent-config".',
|
|
1009
|
+
path: "agentConfig"
|
|
1010
|
+
});
|
|
1011
|
+
}
|
|
1012
|
+
const { profiles, wrappedFlat } = normalizeAgentConfig(agentConfigRaw);
|
|
1013
|
+
if (wrappedFlat) {
|
|
1014
|
+
diagnostics.push({
|
|
1015
|
+
code: "legacy_agent_config_flat",
|
|
1016
|
+
severity: "warning",
|
|
1017
|
+
message: 'Flat agent-config block wrapped as the "default" profile \u2014 nest fields under "default:".',
|
|
1018
|
+
path: agentConfigKey
|
|
1019
|
+
});
|
|
1002
1020
|
}
|
|
1021
|
+
config.agent_config = profiles;
|
|
1022
|
+
}
|
|
1023
|
+
function assertNoLegacyTopLevelKeys(raw) {
|
|
1003
1024
|
if (raw.repositories !== void 0) {
|
|
1004
1025
|
throw new Error(
|
|
1005
1026
|
"skaile.yaml: unknown top-level key `repositories:`. The schema changed \u2014 see docs/concepts/manifest-schema.md, or ask your AI assistant to apply the `migrate-skaile-manifest` skill."
|
|
@@ -1017,37 +1038,49 @@ function normalizeConfigInternal(raw) {
|
|
|
1017
1038
|
);
|
|
1018
1039
|
}
|
|
1019
1040
|
}
|
|
1020
|
-
|
|
1021
|
-
|
|
1022
|
-
|
|
1023
|
-
|
|
1024
|
-
|
|
1025
|
-
|
|
1026
|
-
|
|
1027
|
-
|
|
1028
|
-
|
|
1029
|
-
|
|
1041
|
+
}
|
|
1042
|
+
function normalizeOverrideEntry(item) {
|
|
1043
|
+
if (!item || typeof item !== "object" || Array.isArray(item)) return null;
|
|
1044
|
+
const o = item;
|
|
1045
|
+
const ref = typeof o.ref === "string" ? o.ref : "";
|
|
1046
|
+
const source = typeof o.source === "string" ? o.source : "";
|
|
1047
|
+
if (!ref || !source) return null;
|
|
1048
|
+
if (typeof o.reason !== "string") {
|
|
1049
|
+
throw new Error(
|
|
1050
|
+
`skaile.yaml: overrides[] entry for ${ref}: reason is required and must be a non-empty string.`
|
|
1051
|
+
);
|
|
1030
1052
|
}
|
|
1031
|
-
if (
|
|
1032
|
-
|
|
1033
|
-
for (const item of raw.overrides) {
|
|
1034
|
-
if (!item || typeof item !== "object" || Array.isArray(item)) continue;
|
|
1035
|
-
const o = item;
|
|
1036
|
-
const ref = typeof o.ref === "string" ? o.ref : "";
|
|
1037
|
-
const source = typeof o.source === "string" ? o.source : "";
|
|
1038
|
-
if (!ref || !source) continue;
|
|
1039
|
-
if (typeof o.reason !== "string") {
|
|
1040
|
-
throw new Error(
|
|
1041
|
-
`skaile.yaml: overrides[] entry for ${ref}: reason is required and must be a non-empty string.`
|
|
1042
|
-
);
|
|
1043
|
-
}
|
|
1044
|
-
if (o.reason.trim().length === 0) {
|
|
1045
|
-
throw new Error(`skaile.yaml: overrides[] entry for ${ref}: reason must not be empty.`);
|
|
1046
|
-
}
|
|
1047
|
-
entries.push({ ref, source, reason: o.reason });
|
|
1048
|
-
}
|
|
1049
|
-
if (entries.length > 0) config.overrides = entries;
|
|
1053
|
+
if (o.reason.trim().length === 0) {
|
|
1054
|
+
throw new Error(`skaile.yaml: overrides[] entry for ${ref}: reason must not be empty.`);
|
|
1050
1055
|
}
|
|
1056
|
+
return { ref, source, reason: o.reason };
|
|
1057
|
+
}
|
|
1058
|
+
function normalizeStoresSection(raw, config) {
|
|
1059
|
+
if (!Array.isArray(raw.stores)) return;
|
|
1060
|
+
const entries = [];
|
|
1061
|
+
for (const item of raw.stores) {
|
|
1062
|
+
if (!item || typeof item !== "object" || Array.isArray(item)) continue;
|
|
1063
|
+
const s = item;
|
|
1064
|
+
const url = typeof s.url === "string" ? s.url : "";
|
|
1065
|
+
if (!url) continue;
|
|
1066
|
+
entries.push({ url });
|
|
1067
|
+
}
|
|
1068
|
+
if (entries.length > 0) config.stores = entries;
|
|
1069
|
+
}
|
|
1070
|
+
function normalizeOverridesSection(raw, config) {
|
|
1071
|
+
if (!Array.isArray(raw.overrides)) return;
|
|
1072
|
+
const entries = [];
|
|
1073
|
+
for (const item of raw.overrides) {
|
|
1074
|
+
const entry = normalizeOverrideEntry(item);
|
|
1075
|
+
if (entry) entries.push(entry);
|
|
1076
|
+
}
|
|
1077
|
+
if (entries.length > 0) config.overrides = entries;
|
|
1078
|
+
}
|
|
1079
|
+
function normalizeConsumptionSection(raw, config) {
|
|
1080
|
+
normalizeStoresSection(raw, config);
|
|
1081
|
+
normalizeOverridesSection(raw, config);
|
|
1082
|
+
}
|
|
1083
|
+
function normalizeStructuralSections(raw, config) {
|
|
1051
1084
|
if (Array.isArray(raw.mounts)) {
|
|
1052
1085
|
config.mounts = raw.mounts;
|
|
1053
1086
|
}
|
|
@@ -1079,6 +1112,8 @@ function normalizeConfigInternal(raw) {
|
|
|
1079
1112
|
if (raw.patches && typeof raw.patches === "object" && !Array.isArray(raw.patches)) {
|
|
1080
1113
|
config.patches = raw.patches;
|
|
1081
1114
|
}
|
|
1115
|
+
}
|
|
1116
|
+
function normalizeDependencySection(raw, config) {
|
|
1082
1117
|
if (Array.isArray(raw.dependencies)) {
|
|
1083
1118
|
config.dependencies = raw.dependencies.filter((d) => typeof d === "string");
|
|
1084
1119
|
}
|
|
@@ -1098,6 +1133,20 @@ function normalizeConfigInternal(raw) {
|
|
|
1098
1133
|
if (raw.telemetry && typeof raw.telemetry === "object" && !Array.isArray(raw.telemetry)) {
|
|
1099
1134
|
config.telemetry = raw.telemetry;
|
|
1100
1135
|
}
|
|
1136
|
+
}
|
|
1137
|
+
function normalizeConfigInternal(raw) {
|
|
1138
|
+
const config = {};
|
|
1139
|
+
const diagnostics = [];
|
|
1140
|
+
if (raw.name) config.name = String(raw.name);
|
|
1141
|
+
if (raw.description) config.description = String(raw.description);
|
|
1142
|
+
normalizeAgentConfigSection(raw, config, diagnostics);
|
|
1143
|
+
if (Array.isArray(raw.startup)) {
|
|
1144
|
+
config.startup = raw.startup;
|
|
1145
|
+
}
|
|
1146
|
+
assertNoLegacyTopLevelKeys(raw);
|
|
1147
|
+
normalizeConsumptionSection(raw, config);
|
|
1148
|
+
normalizeStructuralSections(raw, config);
|
|
1149
|
+
normalizeDependencySection(raw, config);
|
|
1101
1150
|
return { config, diagnostics };
|
|
1102
1151
|
}
|
|
1103
1152
|
function decodeSkaileYaml(text) {
|
|
@@ -1293,30 +1342,33 @@ function mcpDeclFromCatalogEntry(entry) {
|
|
|
1293
1342
|
}
|
|
1294
1343
|
if (entry.description) decl.description = entry.description;
|
|
1295
1344
|
if (m.recipe && typeof m.recipe === "object" && !Array.isArray(m.recipe)) {
|
|
1296
|
-
const
|
|
1297
|
-
|
|
1298
|
-
const rawAttr = typeof r.attr === "string" ? r.attr : void 0;
|
|
1299
|
-
const effectiveAttr = rawAttr ?? (hasFlake ? DEFAULT_RECIPE_ATTR : void 0);
|
|
1300
|
-
if (effectiveAttr !== void 0) {
|
|
1301
|
-
try {
|
|
1302
|
-
validateAssetRecipeAttr(effectiveAttr);
|
|
1303
|
-
if (hasFlake) {
|
|
1304
|
-
validateAssetRecipeFlake(r.flake);
|
|
1305
|
-
decl.recipe = { attr: effectiveAttr, flake: r.flake };
|
|
1306
|
-
if (typeof r.publisher === "string") decl.recipe.publisher = r.publisher;
|
|
1307
|
-
} else {
|
|
1308
|
-
decl.recipe = { attr: effectiveAttr };
|
|
1309
|
-
}
|
|
1310
|
-
} catch (err) {
|
|
1311
|
-
console.warn(
|
|
1312
|
-
`[workspace-config] mcpDeclFromCatalogEntry: invalid recipe for entry "${entry.name}": ${err instanceof Error ? err.message : String(err)}`
|
|
1313
|
-
);
|
|
1314
|
-
}
|
|
1315
|
-
}
|
|
1345
|
+
const recipe = parseCatalogRecipe(m.recipe, entry.name);
|
|
1346
|
+
if (recipe) decl.recipe = recipe;
|
|
1316
1347
|
}
|
|
1317
1348
|
if (!decl.command && !decl.url) return null;
|
|
1318
1349
|
return decl;
|
|
1319
1350
|
}
|
|
1351
|
+
function parseCatalogRecipe(r, entryName) {
|
|
1352
|
+
const hasFlake = typeof r.flake === "string";
|
|
1353
|
+
const rawAttr = typeof r.attr === "string" ? r.attr : void 0;
|
|
1354
|
+
const effectiveAttr = rawAttr ?? (hasFlake ? DEFAULT_RECIPE_ATTR : void 0);
|
|
1355
|
+
if (effectiveAttr === void 0) return null;
|
|
1356
|
+
try {
|
|
1357
|
+
validateAssetRecipeAttr(effectiveAttr);
|
|
1358
|
+
if (hasFlake) {
|
|
1359
|
+
validateAssetRecipeFlake(r.flake);
|
|
1360
|
+
const recipe = { attr: effectiveAttr, flake: r.flake };
|
|
1361
|
+
if (typeof r.publisher === "string") recipe.publisher = r.publisher;
|
|
1362
|
+
return recipe;
|
|
1363
|
+
}
|
|
1364
|
+
return { attr: effectiveAttr };
|
|
1365
|
+
} catch (err) {
|
|
1366
|
+
console.warn(
|
|
1367
|
+
`[workspace-config] mcpDeclFromCatalogEntry: invalid recipe for entry "${entryName}": ${err instanceof Error ? err.message : String(err)}`
|
|
1368
|
+
);
|
|
1369
|
+
return null;
|
|
1370
|
+
}
|
|
1371
|
+
}
|
|
1320
1372
|
function mergeMcpDeclarations(base, overlay) {
|
|
1321
1373
|
return {
|
|
1322
1374
|
id: overlay.id,
|
|
@@ -1332,6 +1384,28 @@ function mergeMcpDeclarations(base, overlay) {
|
|
|
1332
1384
|
};
|
|
1333
1385
|
}
|
|
1334
1386
|
var unscopedTail = (x) => x.includes("/") ? x.split("/").pop() : x;
|
|
1387
|
+
function foldInstanceEnv(decl, instancePath, name) {
|
|
1388
|
+
if (!existsSync(instancePath)) return;
|
|
1389
|
+
try {
|
|
1390
|
+
const instance = JSON.parse(readFileSync(instancePath, "utf8"));
|
|
1391
|
+
const env = { ...decl.env ?? {} };
|
|
1392
|
+
if (instance.config && typeof instance.config === "object") {
|
|
1393
|
+
for (const [k, v] of Object.entries(instance.config)) {
|
|
1394
|
+
if (typeof v === "string") env[k] = v;
|
|
1395
|
+
}
|
|
1396
|
+
}
|
|
1397
|
+
if (instance.resolvedSecrets && typeof instance.resolvedSecrets === "object") {
|
|
1398
|
+
for (const [k, v] of Object.entries(instance.resolvedSecrets)) {
|
|
1399
|
+
if (typeof v === "string") env[k] = v;
|
|
1400
|
+
}
|
|
1401
|
+
}
|
|
1402
|
+
if (Object.keys(env).length > 0) decl.env = env;
|
|
1403
|
+
} catch (err) {
|
|
1404
|
+
console.warn(
|
|
1405
|
+
`[workspace-config] loadMaterializedMcpDeclarations: ignoring malformed ".instance.json" for "${name}": ${err instanceof Error ? err.message : String(err)}`
|
|
1406
|
+
);
|
|
1407
|
+
}
|
|
1408
|
+
}
|
|
1335
1409
|
function loadMaterializedMcpDeclarations(projectDir) {
|
|
1336
1410
|
const dir = join(projectDir, ".skaile/assets/mcp-server");
|
|
1337
1411
|
if (!existsSync(dir)) return [];
|
|
@@ -1351,28 +1425,7 @@ function loadMaterializedMcpDeclarations(projectDir) {
|
|
|
1351
1425
|
const decl = mcpDeclFromCatalogEntry(entry);
|
|
1352
1426
|
if (!decl) continue;
|
|
1353
1427
|
decl.id = entry.name || name;
|
|
1354
|
-
|
|
1355
|
-
if (existsSync(instancePath)) {
|
|
1356
|
-
try {
|
|
1357
|
-
const instance = JSON.parse(readFileSync(instancePath, "utf8"));
|
|
1358
|
-
const env = { ...decl.env ?? {} };
|
|
1359
|
-
if (instance.config && typeof instance.config === "object") {
|
|
1360
|
-
for (const [k, v] of Object.entries(instance.config)) {
|
|
1361
|
-
if (typeof v === "string") env[k] = v;
|
|
1362
|
-
}
|
|
1363
|
-
}
|
|
1364
|
-
if (instance.resolvedSecrets && typeof instance.resolvedSecrets === "object") {
|
|
1365
|
-
for (const [k, v] of Object.entries(instance.resolvedSecrets)) {
|
|
1366
|
-
if (typeof v === "string") env[k] = v;
|
|
1367
|
-
}
|
|
1368
|
-
}
|
|
1369
|
-
if (Object.keys(env).length > 0) decl.env = env;
|
|
1370
|
-
} catch (err) {
|
|
1371
|
-
console.warn(
|
|
1372
|
-
`[workspace-config] loadMaterializedMcpDeclarations: ignoring malformed ".instance.json" for "${name}": ${err instanceof Error ? err.message : String(err)}`
|
|
1373
|
-
);
|
|
1374
|
-
}
|
|
1375
|
-
}
|
|
1428
|
+
foldInstanceEnv(decl, join(subDir, ".instance.json"), name);
|
|
1376
1429
|
result.push(decl);
|
|
1377
1430
|
} catch (err) {
|
|
1378
1431
|
console.warn(
|
|
@@ -1450,31 +1503,49 @@ function catalogEntryFromCandidate(c) {
|
|
|
1450
1503
|
if (c.homepage != null) entry.homepage = c.homepage;
|
|
1451
1504
|
return entry;
|
|
1452
1505
|
}
|
|
1453
|
-
function
|
|
1454
|
-
|
|
1455
|
-
|
|
1456
|
-
|
|
1506
|
+
function lookupMcpCandidate(provenanceIndex, ref) {
|
|
1507
|
+
let candidates;
|
|
1508
|
+
if (ref.publisher) {
|
|
1509
|
+
candidates = provenanceIndex.get(`${ref.publisher}/${ref.kind}:${ref.name}`);
|
|
1510
|
+
}
|
|
1511
|
+
if (!candidates) {
|
|
1512
|
+
for (const [key, arr] of provenanceIndex) {
|
|
1513
|
+
if (key.endsWith(`/${ref.kind}:${ref.name}`)) {
|
|
1514
|
+
candidates = arr;
|
|
1515
|
+
break;
|
|
1516
|
+
}
|
|
1517
|
+
}
|
|
1518
|
+
}
|
|
1519
|
+
return candidates?.[0];
|
|
1520
|
+
}
|
|
1521
|
+
function buildDeclaredMcpNames(explicit, mcpRefStrings) {
|
|
1522
|
+
return /* @__PURE__ */ new Set([
|
|
1523
|
+
...explicit.flatMap((e) => [e.id, unscopedTail(e.id)]),
|
|
1524
|
+
...mcpRefStrings.flatMap((refStr) => {
|
|
1525
|
+
try {
|
|
1526
|
+
const r = parseAssetRef(refStr);
|
|
1527
|
+
return [r.name, unscopedTail(r.name)];
|
|
1528
|
+
} catch {
|
|
1529
|
+
return [];
|
|
1530
|
+
}
|
|
1531
|
+
})
|
|
1532
|
+
]);
|
|
1533
|
+
}
|
|
1534
|
+
function collectMcpRefStrings(dependencies) {
|
|
1457
1535
|
const mcpRefStrings = [];
|
|
1458
|
-
for (const dep of
|
|
1536
|
+
for (const dep of dependencies ?? []) {
|
|
1459
1537
|
try {
|
|
1460
1538
|
const ref = parseAssetRef(dep);
|
|
1461
1539
|
if (ref.kind === "mcp-server") mcpRefStrings.push(dep);
|
|
1462
1540
|
} catch {
|
|
1463
1541
|
}
|
|
1464
1542
|
}
|
|
1465
|
-
|
|
1466
|
-
|
|
1467
|
-
|
|
1468
|
-
|
|
1469
|
-
|
|
1470
|
-
|
|
1471
|
-
if (existing) {
|
|
1472
|
-
byId.set(decl.id, mergeMcpDeclarations(existing, decl));
|
|
1473
|
-
} else {
|
|
1474
|
-
byId.set(decl.id, decl);
|
|
1475
|
-
order.push(decl.id);
|
|
1476
|
-
}
|
|
1477
|
-
};
|
|
1543
|
+
return mcpRefStrings;
|
|
1544
|
+
}
|
|
1545
|
+
function buildMcpProvenanceIndex(sources, projectDir) {
|
|
1546
|
+
return sources.length > 0 ? buildProvenanceIndex(buildSourceClones(sources)) : /* @__PURE__ */ new Map();
|
|
1547
|
+
}
|
|
1548
|
+
function upsertCatalogMcpDecls(mcpRefStrings, provenanceIndex, upsert) {
|
|
1478
1549
|
const seen = /* @__PURE__ */ new Set();
|
|
1479
1550
|
for (const refStr of mcpRefStrings) {
|
|
1480
1551
|
let ref;
|
|
@@ -1485,37 +1556,16 @@ function loadMcpServerDeclarations(projectDir) {
|
|
|
1485
1556
|
}
|
|
1486
1557
|
if (seen.has(ref.name)) continue;
|
|
1487
1558
|
seen.add(ref.name);
|
|
1488
|
-
|
|
1489
|
-
if (ref.publisher) {
|
|
1490
|
-
candidates = provenanceIndex.get(`${ref.publisher}/${ref.kind}:${ref.name}`);
|
|
1491
|
-
}
|
|
1492
|
-
if (!candidates) {
|
|
1493
|
-
for (const [key, arr] of provenanceIndex) {
|
|
1494
|
-
if (key.endsWith(`/${ref.kind}:${ref.name}`)) {
|
|
1495
|
-
candidates = arr;
|
|
1496
|
-
break;
|
|
1497
|
-
}
|
|
1498
|
-
}
|
|
1499
|
-
}
|
|
1500
|
-
const candidate = candidates?.[0];
|
|
1559
|
+
const candidate = lookupMcpCandidate(provenanceIndex, ref);
|
|
1501
1560
|
if (!candidate) continue;
|
|
1502
1561
|
const catalogDecl = mcpDeclFromCatalogEntry(catalogEntryFromCandidate(candidate));
|
|
1503
1562
|
if (!catalogDecl) continue;
|
|
1504
1563
|
upsert(catalogDecl);
|
|
1505
1564
|
}
|
|
1506
|
-
|
|
1565
|
+
}
|
|
1566
|
+
function upsertMaterializedMcpDecls(materialized, explicit, mcpRefStrings, strictYaml, upsert) {
|
|
1507
1567
|
if (strictYaml) {
|
|
1508
|
-
const declaredNames =
|
|
1509
|
-
...explicit.flatMap((e) => [e.id, unscopedTail(e.id)]),
|
|
1510
|
-
...mcpRefStrings.flatMap((refStr) => {
|
|
1511
|
-
try {
|
|
1512
|
-
const r = parseAssetRef(refStr);
|
|
1513
|
-
return [r.name, unscopedTail(r.name)];
|
|
1514
|
-
} catch {
|
|
1515
|
-
return [];
|
|
1516
|
-
}
|
|
1517
|
-
})
|
|
1518
|
-
]);
|
|
1568
|
+
const declaredNames = buildDeclaredMcpNames(explicit, mcpRefStrings);
|
|
1519
1569
|
for (const decl of materialized) {
|
|
1520
1570
|
if (declaredNames.has(decl.id) || declaredNames.has(unscopedTail(decl.id))) upsert(decl);
|
|
1521
1571
|
}
|
|
@@ -1524,6 +1574,27 @@ function loadMcpServerDeclarations(projectDir) {
|
|
|
1524
1574
|
upsert(decl);
|
|
1525
1575
|
}
|
|
1526
1576
|
}
|
|
1577
|
+
}
|
|
1578
|
+
function loadMcpServerDeclarations(projectDir) {
|
|
1579
|
+
const config = resolveSkWorkspaceConfig(projectDir);
|
|
1580
|
+
const explicit = config.mcp_servers ?? [];
|
|
1581
|
+
const materialized = loadMaterializedMcpDeclarations(projectDir);
|
|
1582
|
+
const mcpRefStrings = collectMcpRefStrings(config.dependencies);
|
|
1583
|
+
const provenanceIndex = buildMcpProvenanceIndex(config.sources ?? []);
|
|
1584
|
+
const byId = /* @__PURE__ */ new Map();
|
|
1585
|
+
const order = [];
|
|
1586
|
+
const upsert = (decl) => {
|
|
1587
|
+
const existing = byId.get(decl.id);
|
|
1588
|
+
if (existing) {
|
|
1589
|
+
byId.set(decl.id, mergeMcpDeclarations(existing, decl));
|
|
1590
|
+
} else {
|
|
1591
|
+
byId.set(decl.id, decl);
|
|
1592
|
+
order.push(decl.id);
|
|
1593
|
+
}
|
|
1594
|
+
};
|
|
1595
|
+
upsertCatalogMcpDecls(mcpRefStrings, provenanceIndex, upsert);
|
|
1596
|
+
const strictYaml = process.env.SKAILE_STRICT_YAML === "true";
|
|
1597
|
+
upsertMaterializedMcpDecls(materialized, explicit, mcpRefStrings, strictYaml, upsert);
|
|
1527
1598
|
for (const decl of explicit) {
|
|
1528
1599
|
upsert(decl);
|
|
1529
1600
|
}
|
|
@@ -1557,5 +1628,5 @@ function resolveAgentDir(projectDir) {
|
|
|
1557
1628
|
}
|
|
1558
1629
|
|
|
1559
1630
|
export { COMPACTION_DEFAULTS, CanonicalRefConflictError, DEFAULT_RECIPE_ATTR, SKAILE_YAML_DEFAULT, SKAILE_YAML_SUFFIX, SK_WORKSPACE_DEFAULT_NAME, SK_WORKSPACE_SUFFIX, buildProvenanceIndex, checkRepoStatus, checkoutPin, cloneRepo, decodeSkaileYaml, encodeSkaileYaml, ensureRepo, findWorkspaceRoot, getGlobalCacheDir, getRepoCommit, isWorkspaceConfigFilename, linkRepo, listSkWorkspaceConfigs, loadMcpServerDeclarations, loadSkWorkspaceConfig, mergeSkWorkspaceConfigs, normalizeConfig, pullRepo, readLinks, resolveAgentDir, resolveAll, resolveAsset, resolveSkWorkspaceConfig, saveSkWorkspaceConfig, scanRepo, stageMaterializedSkills, unlinkRepo, validateAssetRecipeAttr, validateAssetRecipeFlake, workspaceConfigFilename, workspaceNameFromFilename, writeLinks };
|
|
1560
|
-
//# sourceMappingURL=chunk-
|
|
1561
|
-
//# sourceMappingURL=chunk-
|
|
1631
|
+
//# sourceMappingURL=chunk-5DQOZFWJ.js.map
|
|
1632
|
+
//# sourceMappingURL=chunk-5DQOZFWJ.js.map
|