@skaile/workspaces 1.16.0 → 2.1.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 +309 -0
- package/dist/{asset-feeds-WIBEP37F.js → asset-feeds-FBGBQEYD.js} +25 -24
- package/dist/asset-feeds-FBGBQEYD.js.map +1 -0
- package/dist/asset-manager/catalog-deployer.js +13 -1
- package/dist/asset-manager/index.js +10 -9
- package/dist/asset-manager/installer.js +7 -6
- package/dist/asset-manager/src/catalog-deployer.d.ts +70 -5
- package/dist/asset-manager/src/catalog-deployer.d.ts.map +1 -1
- package/dist/asset-manager/src/index.d.ts +41 -17
- package/dist/asset-manager/src/index.d.ts.map +1 -1
- package/dist/asset-manager/src/mcp-config.d.ts +58 -0
- package/dist/asset-manager/src/mcp-config.d.ts.map +1 -0
- package/dist/bridge/drivers/claude-sdk.js +108 -56
- package/dist/bridge/drivers/claude-sdk.js.map +1 -1
- package/dist/bridge/drivers/codex.js +3 -2
- package/dist/bridge/drivers/codex.js.map +1 -1
- package/dist/bridge/drivers/continue.js +4 -3
- package/dist/bridge/drivers/continue.js.map +1 -1
- package/dist/bridge/drivers/echo.js +3 -2
- package/dist/bridge/drivers/echo.js.map +1 -1
- package/dist/bridge/drivers/gemini.js +5 -4
- package/dist/bridge/drivers/goose.js +4 -3
- package/dist/bridge/drivers/goose.js.map +1 -1
- package/dist/bridge/drivers/omp.js +3 -2
- package/dist/bridge/drivers/omp.js.map +1 -1
- package/dist/bridge/drivers/opencode.js +4 -3
- package/dist/bridge/drivers/opencode.js.map +1 -1
- package/dist/bridge/drivers/qwen.js +5 -4
- package/dist/bridge/drivers/qwen.js.map +1 -1
- package/dist/bridge/index.js +4 -3
- package/dist/bridge/src/drivers/claude-sdk.d.ts.map +1 -1
- package/dist/bridge/src/drivers/scrub-transcript.d.ts +21 -1
- package/dist/bridge/src/drivers/scrub-transcript.d.ts.map +1 -1
- package/dist/{chunk-MO43URUI.js → chunk-2BSXXTUP.js} +7 -7
- package/dist/{chunk-MO43URUI.js.map → chunk-2BSXXTUP.js.map} +1 -1
- package/dist/{chunk-FIUGSIKC.js → chunk-43TAGQ3Z.js} +19 -11
- package/dist/chunk-43TAGQ3Z.js.map +1 -0
- package/dist/{chunk-7J7LQP6T.js → chunk-5BGEYZ7I.js} +31 -19
- package/dist/chunk-5BGEYZ7I.js.map +1 -0
- package/dist/chunk-7GOCNYUV.js +300 -0
- package/dist/chunk-7GOCNYUV.js.map +1 -0
- package/dist/{chunk-KY5NY7LB.js → chunk-BCTU4TN7.js} +11 -11
- package/dist/chunk-BCTU4TN7.js.map +1 -0
- package/dist/chunk-BEAIJRVF.js +159 -0
- package/dist/chunk-BEAIJRVF.js.map +1 -0
- package/dist/{chunk-2TSSCHCQ.js → chunk-BHLNQ4L5.js} +5 -5
- package/dist/{chunk-2TSSCHCQ.js.map → chunk-BHLNQ4L5.js.map} +1 -1
- package/dist/chunk-BK3WL3QK.js +10 -0
- package/dist/chunk-BK3WL3QK.js.map +1 -0
- package/dist/{chunk-TFIFNDT2.js → chunk-BTR3ZJ7S.js} +4 -4
- package/dist/{chunk-TFIFNDT2.js.map → chunk-BTR3ZJ7S.js.map} +1 -1
- package/dist/{chunk-BI2NKPA4.js → chunk-CA5CWLGN.js} +3 -2
- package/dist/chunk-CA5CWLGN.js.map +1 -0
- package/dist/{chunk-STQOPWPS.js → chunk-CTWE7I7Z.js} +4 -4
- package/dist/{chunk-STQOPWPS.js.map → chunk-CTWE7I7Z.js.map} +1 -1
- package/dist/{chunk-GXC3TYMQ.js → chunk-CZZRDYT4.js} +70 -32
- package/dist/chunk-CZZRDYT4.js.map +1 -0
- package/dist/chunk-DYMWJAL4.js +552 -0
- package/dist/chunk-DYMWJAL4.js.map +1 -0
- package/dist/{chunk-ACXLKNIM.js → chunk-E7HKNQTH.js} +10 -4
- package/dist/chunk-E7HKNQTH.js.map +1 -0
- package/dist/{chunk-2BQBWWFX.js → chunk-GUKMNUQK.js} +6 -6
- package/dist/chunk-GUKMNUQK.js.map +1 -0
- package/dist/{chunk-6POODADP.js → chunk-HOL5KD7U.js} +453 -250
- package/dist/chunk-HOL5KD7U.js.map +1 -0
- package/dist/{chunk-C4KVFALU.js → chunk-L26NGI43.js} +3 -3
- package/dist/{chunk-C4KVFALU.js.map → chunk-L26NGI43.js.map} +1 -1
- package/dist/{chunk-MZV6WCF3.js → chunk-MAN7AGQJ.js} +3 -3
- package/dist/{chunk-MZV6WCF3.js.map → chunk-MAN7AGQJ.js.map} +1 -1
- package/dist/{chunk-YULV7UTU.js → chunk-MLYV6WEM.js} +10 -10
- package/dist/{chunk-YULV7UTU.js.map → chunk-MLYV6WEM.js.map} +1 -1
- package/dist/{chunk-O5VCUU6D.js → chunk-N6TYW6EB.js} +4 -4
- package/dist/{chunk-O5VCUU6D.js.map → chunk-N6TYW6EB.js.map} +1 -1
- package/dist/{chunk-EPWY2ABE.js → chunk-PSVF3LDU.js} +5 -5
- package/dist/{chunk-EPWY2ABE.js.map → chunk-PSVF3LDU.js.map} +1 -1
- package/dist/{chunk-M5GJT3D7.js → chunk-PYYL5XMA.js} +3 -3
- package/dist/{chunk-M5GJT3D7.js.map → chunk-PYYL5XMA.js.map} +1 -1
- package/dist/{chunk-BG4XVMG2.js → chunk-RBOPTTTK.js} +286 -151
- package/dist/chunk-RBOPTTTK.js.map +1 -0
- package/dist/{chunk-2IJFUAZB.js → chunk-RK3HU3H3.js} +123 -18
- package/dist/chunk-RK3HU3H3.js.map +1 -0
- package/dist/{chunk-5NZ56R63.js → chunk-RTLQAZAE.js} +18 -6
- package/dist/chunk-RTLQAZAE.js.map +1 -0
- package/dist/{chunk-MNKUZUN2.js → chunk-SGLGA2AZ.js} +3 -3
- package/dist/{chunk-MNKUZUN2.js.map → chunk-SGLGA2AZ.js.map} +1 -1
- package/dist/{chunk-JB35MVBN.js → chunk-U5POE4BA.js} +4 -298
- package/dist/chunk-U5POE4BA.js.map +1 -0
- package/dist/{chunk-A22KZ7GZ.js → chunk-VPXBAEWE.js} +274 -40
- package/dist/chunk-VPXBAEWE.js.map +1 -0
- package/dist/{chunk-ACWCVB5Q.js → chunk-WVPL4OGD.js} +3 -3
- package/dist/{chunk-ACWCVB5Q.js.map → chunk-WVPL4OGD.js.map} +1 -1
- package/dist/{chunk-MB6563TL.js → chunk-XQVP6XWR.js} +3 -3
- package/dist/{chunk-MB6563TL.js.map → chunk-XQVP6XWR.js.map} +1 -1
- package/dist/{chunk-344DEXZS.js → chunk-XSIXGVH6.js} +4 -4
- package/dist/{chunk-344DEXZS.js.map → chunk-XSIXGVH6.js.map} +1 -1
- package/dist/{chunk-BYS6JDZB.js → chunk-Y6VSFX2A.js} +3 -3
- package/dist/{chunk-BYS6JDZB.js.map → chunk-Y6VSFX2A.js.map} +1 -1
- package/dist/{chunk-ISA7R7PK.js → chunk-YODP3STD.js} +90 -40
- package/dist/chunk-YODP3STD.js.map +1 -0
- package/dist/{chunk-WSTY3AWY.js → chunk-ZWFLEMI4.js} +4 -4
- package/dist/{chunk-WSTY3AWY.js.map → chunk-ZWFLEMI4.js.map} +1 -1
- package/dist/cli/index.js +347 -127
- package/dist/cli/index.js.map +1 -1
- package/dist/cli/src/asset-feeds.d.ts +2 -2
- package/dist/cli/src/asset-feeds.d.ts.map +1 -1
- package/dist/cli/src/commands/catalog.d.ts +51 -2
- package/dist/cli/src/commands/catalog.d.ts.map +1 -1
- package/dist/cli/src/commands/connector.d.ts +1 -1
- package/dist/cli/src/commands/connector.d.ts.map +1 -1
- package/dist/cli/src/commands/logs.d.ts.map +1 -1
- package/dist/cli/src/commands/manage.d.ts +30 -3
- package/dist/cli/src/commands/manage.d.ts.map +1 -1
- package/dist/cli/src/commands/project.d.ts +5 -2
- package/dist/cli/src/commands/project.d.ts.map +1 -1
- package/dist/connectors/config.js +7 -6
- package/dist/connectors/index.js +8 -7
- package/dist/connectors/src/connector-manager.d.ts.map +1 -1
- package/dist/connectors/src/watcher.d.ts.map +1 -1
- package/dist/connectors/src/worktree.d.ts +20 -2
- package/dist/connectors/src/worktree.d.ts.map +1 -1
- package/dist/core/index.js +6 -5
- package/dist/core/logging.js +2 -1
- package/dist/core/manifest.js +2 -1
- package/dist/core/runtime-assets.js +4 -3
- package/dist/core/src/fs-deadline.d.ts +84 -0
- package/dist/core/src/fs-deadline.d.ts.map +1 -0
- package/dist/core/src/index.d.ts +4 -3
- package/dist/core/src/index.d.ts.map +1 -1
- package/dist/core/src/manifest.d.ts +142 -18
- package/dist/core/src/manifest.d.ts.map +1 -1
- package/dist/core/src/repo-manager.d.ts +2 -2
- 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/subprocess.d.ts +33 -1
- package/dist/core/src/subprocess.d.ts.map +1 -1
- package/dist/core/src/walker.d.ts +1 -1
- package/dist/core/src/walker.d.ts.map +1 -1
- package/dist/core/src/workspace-config.d.ts +19 -2
- package/dist/core/src/workspace-config.d.ts.map +1 -1
- package/dist/core/workspace-config.js +3 -2
- package/dist/deploy/index.js +12 -7
- package/dist/deploy/index.js.map +1 -1
- package/dist/deploy/src/targets/container-runtime.d.ts.map +1 -1
- package/dist/discovery/index.js +3 -2
- package/dist/{ensure-sources-RSTZONIE.js → ensure-sources-AVCVX7CV.js} +13 -12
- package/dist/ensure-sources-AVCVX7CV.js.map +1 -0
- package/dist/factory-assets/connectors/box.js +8 -7
- package/dist/factory-assets/connectors/deploy/CONNECTOR.md +19 -0
- package/dist/factory-assets/connectors/deploy/adapter.d.ts.map +1 -1
- package/dist/factory-assets/connectors/deploy.js +8 -7
- package/dist/factory-assets/connectors/devserver/adapter.d.ts.map +1 -1
- package/dist/factory-assets/connectors/devserver.js +8 -7
- package/dist/factory-assets/connectors/flow/adapter.js +8 -7
- package/dist/factory-assets/connectors/flow/engine.js +6 -5
- package/dist/factory-assets/connectors/flow/run-flow.js +10 -9
- package/dist/factory-assets/connectors/flow.js +8 -7
- package/dist/factory-assets/connectors/git/driver.d.ts +12 -1
- package/dist/factory-assets/connectors/git/driver.d.ts.map +1 -1
- package/dist/factory-assets/connectors/git.js +8 -7
- package/dist/factory-assets/connectors/gmail.js +8 -7
- package/dist/factory-assets/connectors/googledrive.js +8 -7
- package/dist/factory-assets/connectors/local/driver.d.ts +25 -1
- package/dist/factory-assets/connectors/local/driver.d.ts.map +1 -1
- package/dist/factory-assets/connectors/local.js +8 -7
- package/dist/factory-assets/connectors/mattermost.js +8 -7
- package/dist/factory-assets/connectors/memory.js +8 -7
- package/dist/factory-assets/connectors/minio.js +8 -7
- package/dist/factory-assets/connectors/postgres.js +8 -7
- package/dist/factory-assets/connectors/s3/driver.d.ts +15 -0
- package/dist/factory-assets/connectors/s3/driver.d.ts.map +1 -1
- package/dist/factory-assets/connectors/s3.js +8 -7
- package/dist/factory-assets/connectors/sharepoint.js +8 -7
- package/dist/factory-assets/connectors/sqlite/adapter.d.ts +8 -1
- package/dist/factory-assets/connectors/sqlite/adapter.d.ts.map +1 -1
- package/dist/factory-assets/connectors/sqlite.js +8 -7
- package/dist/factory-assets/connectors/static-server/adapter.d.ts.map +1 -1
- package/dist/factory-assets/connectors/static-server.js +8 -7
- package/dist/factory-assets/connectors/tunnel.js +8 -7
- package/dist/factory-assets/connectors/webdav.js +8 -7
- package/dist/factory-assets/connectors/xstate/adapter.d.ts +6 -0
- package/dist/factory-assets/connectors/xstate/adapter.d.ts.map +1 -1
- package/dist/factory-assets/connectors/xstate-store.js +8 -7
- package/dist/factory-assets/connectors/xstate.js +8 -7
- package/dist/flows-CXVFGR27.js +20 -0
- package/dist/{flows-FHWBCLXF.js.map → flows-CXVFGR27.js.map} +1 -1
- package/dist/{helpers-GUUWPPAX.js → helpers-M5SXB4LL.js} +13 -12
- package/dist/{helpers-GUUWPPAX.js.map → helpers-M5SXB4LL.js.map} +1 -1
- package/dist/library/index.js +8 -7
- package/dist/library/install.js +6 -5
- package/dist/{library-publish-UKKSJP7V.js → library-publish-HVIIQMI6.js} +16 -15
- package/dist/library-publish-HVIIQMI6.js.map +1 -0
- package/dist/{open-library-VALRYGFV.js → open-library-EJQISBWV.js} +14 -13
- package/dist/{open-library-VALRYGFV.js.map → open-library-EJQISBWV.js.map} +1 -1
- package/dist/{paths-5QJJBAND.js → paths-2HMHL25W.js} +11 -10
- package/dist/{paths-5QJJBAND.js.map → paths-2HMHL25W.js.map} +1 -1
- package/dist/plugin-registry/src/deploy-helpers.d.ts +1 -1
- package/dist/{plugin-store-ZBJZ7F6D.js → plugin-store-TLBQ5XRS.js} +8 -7
- package/dist/plugin-store-TLBQ5XRS.js.map +1 -0
- package/dist/{project-IRUJLIVX.js → project-M2COJFPZ.js} +14 -13
- package/dist/{project-IRUJLIVX.js.map → project-M2COJFPZ.js.map} +1 -1
- package/dist/resolver/index.js +13 -1
- package/dist/resolver/src/types.d.ts +7 -0
- package/dist/resolver/src/types.d.ts.map +1 -1
- package/dist/resolver/src/validator.d.ts +8 -1
- package/dist/resolver/src/validator.d.ts.map +1 -1
- package/dist/runner/index.js +13 -12
- package/dist/runner/src/external-mcp.d.ts +1 -1
- package/dist/runner/src/external-mcp.d.ts.map +1 -1
- package/dist/runner/src/mcp-prompt.d.ts +7 -3
- package/dist/runner/src/mcp-prompt.d.ts.map +1 -1
- package/dist/runner/src/mcp-runtime-handlers.d.ts +12 -0
- package/dist/runner/src/mcp-runtime-handlers.d.ts.map +1 -1
- package/dist/runner/src/mixin-resolver.d.ts.map +1 -1
- package/dist/runner/src/recipe-resolver.d.ts +20 -6
- package/dist/runner/src/recipe-resolver.d.ts.map +1 -1
- package/dist/runner/src/resource-handler.d.ts +43 -0
- package/dist/runner/src/resource-handler.d.ts.map +1 -1
- package/dist/runner/src/resources.d.ts +12 -5
- package/dist/runner/src/resources.d.ts.map +1 -1
- package/dist/runner/src/serve.d.ts +31 -5
- package/dist/runner/src/serve.d.ts.map +1 -1
- package/dist/runner/src/session-builder.d.ts +9 -0
- package/dist/runner/src/session-builder.d.ts.map +1 -1
- package/dist/runner/src/session-capability-wiring.d.ts +5 -0
- package/dist/runner/src/session-capability-wiring.d.ts.map +1 -1
- package/dist/runner/src/workspace-migration.d.ts +37 -3
- package/dist/runner/src/workspace-migration.d.ts.map +1 -1
- package/dist/sdk/asset-manager.js +10 -9
- package/dist/sdk/bridge.js +4 -3
- package/dist/sdk/core.js +6 -5
- package/dist/sdk/flow.js +6 -5
- package/dist/sdk/index.js +13 -12
- package/dist/sdk/index.js.map +1 -1
- package/dist/sdk/resolver.js +13 -1
- package/dist/sdk/runner.js +13 -12
- package/dist/sdk/session.js +1 -1
- package/dist/sdk/store.js +1 -1
- package/dist/session/index.js +1 -1
- package/dist/session/src/dispatcher.d.ts.map +1 -1
- package/dist/{setup-WJPNUE32.js → setup-GWXEG3G2.js} +10 -9
- package/dist/setup-GWXEG3G2.js.map +1 -0
- package/dist/skills-YTMGG23D.js +20 -0
- package/dist/{skills-BMI6H7HI.js.map → skills-YTMGG23D.js.map} +1 -1
- package/dist/{source-5KDURFBS.js → source-WMXH2OBW.js} +15 -14
- package/dist/{source-5KDURFBS.js.map → source-WMXH2OBW.js.map} +1 -1
- package/dist/{source-manifest-publish-DPQI44D3.js → source-manifest-publish-MTHUGBAY.js} +17 -16
- package/dist/source-manifest-publish-MTHUGBAY.js.map +1 -0
- package/dist/store/index.js +1 -1
- package/dist/store/src/store.d.ts +9 -0
- package/dist/store/src/store.d.ts.map +1 -1
- package/dist/tui/index.js +13 -12
- package/dist/tui/index.js.map +1 -1
- package/dist/validator-RN64BKFW.js +5 -0
- package/dist/{validator-VF5M764T.js.map → validator-RN64BKFW.js.map} +1 -1
- package/dist/workspace-plugin/adapters/mcp.js +18 -5
- package/dist/workspace-plugin/adapters/mcp.js.map +1 -1
- package/dist/workspace-plugin/adapters/omp.js +10 -10
- package/dist/workspace-plugin/index.js +3 -2
- package/dist/workspace-plugin/src/tools/validator.d.ts.map +1 -1
- package/dist/workspace-plugin/src/utils/ai-assets.d.ts +11 -6
- package/dist/workspace-plugin/src/utils/ai-assets.d.ts.map +1 -1
- package/package.json +1 -1
- package/dist/asset-feeds-WIBEP37F.js.map +0 -1
- package/dist/chunk-2BQBWWFX.js.map +0 -1
- package/dist/chunk-2IJFUAZB.js.map +0 -1
- package/dist/chunk-5NZ56R63.js.map +0 -1
- package/dist/chunk-6POODADP.js.map +0 -1
- package/dist/chunk-7J7LQP6T.js.map +0 -1
- package/dist/chunk-A22KZ7GZ.js.map +0 -1
- package/dist/chunk-ACXLKNIM.js.map +0 -1
- package/dist/chunk-BG4XVMG2.js.map +0 -1
- package/dist/chunk-BI2NKPA4.js.map +0 -1
- package/dist/chunk-BQCGFPHW.js +0 -345
- package/dist/chunk-BQCGFPHW.js.map +0 -1
- package/dist/chunk-FIUGSIKC.js.map +0 -1
- package/dist/chunk-GXC3TYMQ.js.map +0 -1
- package/dist/chunk-ISA7R7PK.js.map +0 -1
- package/dist/chunk-JB35MVBN.js.map +0 -1
- package/dist/chunk-KY5NY7LB.js.map +0 -1
- package/dist/chunk-LV2HPH3C.js +0 -73
- package/dist/chunk-LV2HPH3C.js.map +0 -1
- package/dist/chunk-XCBG2KDC.js +0 -23
- package/dist/chunk-XCBG2KDC.js.map +0 -1
- package/dist/ensure-sources-RSTZONIE.js.map +0 -1
- package/dist/flows-FHWBCLXF.js +0 -7
- package/dist/library-publish-UKKSJP7V.js.map +0 -1
- package/dist/plugin-store-ZBJZ7F6D.js.map +0 -1
- package/dist/setup-WJPNUE32.js.map +0 -1
- package/dist/skills-BMI6H7HI.js +0 -7
- package/dist/source-manifest-publish-DPQI44D3.js.map +0 -1
- package/dist/validator-VF5M764T.js +0 -5
|
@@ -1,19 +1,189 @@
|
|
|
1
|
-
import { resolveLibraryDir, getStoreManifestsDir } from './chunk-
|
|
2
|
-
import { deployAll, removeAsset, createScaffold } from './chunk-
|
|
3
|
-
import { writeLock, buildLockFile, readLock, verifyLock, extractForPatch, generatePatch, savePatch, applyPatch } from './chunk-
|
|
4
|
-
import { resolveRuntimeAssets, factoryAssetRoots } from './chunk-
|
|
5
|
-
import { globalSkaileDir, resolveGlobalBackends, globalCacheRoot, migrateLegacyDir, resolveGlobalSkWorkspaceConfig, resolveSkWorkspaceConfig, getGlobalCacheDir, sourceCacheKey, getRepoCommit, coerceVersion, matchPin, resolveAll, buildProvenanceIndex, ensureRepo, sourceShortName, scanRepo, SKAILE_YAML_DEFAULT, checkRepoStatus, resolveAsset, readLinks, storeManifestSlug } from './chunk-
|
|
6
|
-
import { scanDirectory, parseRequires } from './chunk-
|
|
1
|
+
import { resolveLibraryDir, getStoreManifestsDir } from './chunk-XSIXGVH6.js';
|
|
2
|
+
import { deployAll, removeAsset, createScaffold } from './chunk-CTWE7I7Z.js';
|
|
3
|
+
import { writeLock, buildLockFile, readLock, verifyLock, extractForPatch, generatePatch, savePatch, applyPatch } from './chunk-RTLQAZAE.js';
|
|
4
|
+
import { resolveRuntimeAssets, factoryAssetRoots } from './chunk-5BGEYZ7I.js';
|
|
5
|
+
import { loadMcpServerDeclarations, globalSkaileDir, resolveGlobalBackends, globalCacheRoot, migrateLegacyDir, resolveGlobalSkWorkspaceConfig, resolveSkWorkspaceConfig, getGlobalCacheDir, sourceCacheKey, getRepoCommit, coerceVersion, matchPin, resolveAll, buildProvenanceIndex, ensureRepo, sourceShortName, scanRepo, SKAILE_YAML_DEFAULT, checkRepoStatus, resolveAsset, readLinks, storeManifestSlug } from './chunk-YODP3STD.js';
|
|
6
|
+
import { scanDirectory, parseRequires } from './chunk-DYMWJAL4.js';
|
|
7
7
|
import { parseAssetRef, slugifyAssetName, assetRefToStr } from './chunk-GEEW6SY2.js';
|
|
8
8
|
import { deployedBase, isDeployed, deployedDir } from './chunk-F3HNW354.js';
|
|
9
9
|
import { appendHistory, getRecentHistory, clearHistory } from './chunk-KTBKW2FI.js';
|
|
10
10
|
import { commitChanges } from './chunk-UQ6LFBPZ.js';
|
|
11
11
|
import { spawnSync } from 'child_process';
|
|
12
12
|
import { existsSync, readdirSync, rmSync, lstatSync, unlinkSync, mkdirSync, writeFileSync, readFileSync } from 'fs';
|
|
13
|
-
import { resolve, join, sep, dirname } from 'path';
|
|
13
|
+
import path, { resolve, join, sep, dirname } from 'path';
|
|
14
14
|
import { gt } from 'semver';
|
|
15
15
|
import { stringify, parse } from 'yaml';
|
|
16
|
+
import fs from 'fs/promises';
|
|
16
17
|
|
|
18
|
+
var TARGET_MCP_CONFIG = {
|
|
19
|
+
"claude-code": ".mcp.json"
|
|
20
|
+
};
|
|
21
|
+
var RESERVED_MCP_SERVER_IDS = /* @__PURE__ */ new Set([
|
|
22
|
+
"skaile-connectors",
|
|
23
|
+
"skaile-workspace",
|
|
24
|
+
"skaile-capabilities"
|
|
25
|
+
]);
|
|
26
|
+
var UNSUPPORTED_SECRET_PREFIXES = [
|
|
27
|
+
"vault:",
|
|
28
|
+
"forge:",
|
|
29
|
+
"op:",
|
|
30
|
+
"kp:",
|
|
31
|
+
"oauth:",
|
|
32
|
+
"mount:",
|
|
33
|
+
"connector:",
|
|
34
|
+
"mcp:"
|
|
35
|
+
];
|
|
36
|
+
var WORKSPACE_MARKER = /\$\{workspace\}/g;
|
|
37
|
+
function substituteWorkspace(value, projectDir) {
|
|
38
|
+
return value.replace(WORKSPACE_MARKER, projectDir);
|
|
39
|
+
}
|
|
40
|
+
function renderSecretRef(value) {
|
|
41
|
+
return value.startsWith("env:") ? `\${${value.slice(4)}}` : value;
|
|
42
|
+
}
|
|
43
|
+
function renderValueMap(map, projectDir) {
|
|
44
|
+
if (!map) return void 0;
|
|
45
|
+
const out = {};
|
|
46
|
+
for (const [k, v] of Object.entries(map)) {
|
|
47
|
+
out[k] = renderSecretRef(projectDir ? substituteWorkspace(v, projectDir) : v);
|
|
48
|
+
}
|
|
49
|
+
return Object.keys(out).length > 0 ? out : void 0;
|
|
50
|
+
}
|
|
51
|
+
function findUnsupportedSecretRef(decl) {
|
|
52
|
+
const values = [...Object.values(decl.env ?? {}), ...Object.values(decl.headers ?? {})];
|
|
53
|
+
return values.find((v) => UNSUPPORTED_SECRET_PREFIXES.some((p) => v.startsWith(p)));
|
|
54
|
+
}
|
|
55
|
+
function skipReason(decl) {
|
|
56
|
+
if (RESERVED_MCP_SERVER_IDS.has(decl.id)) return "reserved id";
|
|
57
|
+
if (decl.launcher === "recipe" || decl.launcher == null && decl.recipe != null) {
|
|
58
|
+
return "requires the skaile platform's Nix recipe runtime";
|
|
59
|
+
}
|
|
60
|
+
if (decl.auth === "backend") return "requires a platform-minted credential";
|
|
61
|
+
if (decl.instanceSecretsFolded) return "resolved credentials are folded in from .instance.json";
|
|
62
|
+
const transport = decl.transport ?? "stdio";
|
|
63
|
+
if (transport === "stdio" && !decl.command) return "no command";
|
|
64
|
+
if (transport !== "stdio" && !decl.url) return "no url";
|
|
65
|
+
const badRef = findUnsupportedSecretRef(decl);
|
|
66
|
+
if (badRef) return `unsupported secret reference '${badRef}'`;
|
|
67
|
+
return void 0;
|
|
68
|
+
}
|
|
69
|
+
function buildEntry(decl, projectDir) {
|
|
70
|
+
const transport = decl.transport ?? "stdio";
|
|
71
|
+
if (transport !== "stdio") {
|
|
72
|
+
const entry2 = { type: transport, url: decl.url };
|
|
73
|
+
const headers = renderValueMap(decl.headers);
|
|
74
|
+
if (headers) entry2.headers = headers;
|
|
75
|
+
return entry2;
|
|
76
|
+
}
|
|
77
|
+
const entry = {
|
|
78
|
+
command: substituteWorkspace(decl.command, projectDir)
|
|
79
|
+
};
|
|
80
|
+
const args = decl.args?.map((a) => substituteWorkspace(a, projectDir));
|
|
81
|
+
if (args && args.length > 0) entry.args = args;
|
|
82
|
+
const env = renderValueMap(decl.env, projectDir);
|
|
83
|
+
if (env) entry.env = env;
|
|
84
|
+
return entry;
|
|
85
|
+
}
|
|
86
|
+
function managedStatePath(projectDir) {
|
|
87
|
+
return path.join(projectDir, ".skaile", "mcp-managed.json");
|
|
88
|
+
}
|
|
89
|
+
async function readJsonStrict(p) {
|
|
90
|
+
let raw;
|
|
91
|
+
try {
|
|
92
|
+
raw = await fs.readFile(p, "utf-8");
|
|
93
|
+
} catch {
|
|
94
|
+
return null;
|
|
95
|
+
}
|
|
96
|
+
try {
|
|
97
|
+
return JSON.parse(raw);
|
|
98
|
+
} catch (e) {
|
|
99
|
+
throw new Error(
|
|
100
|
+
`cannot parse ${p}: ${e instanceof Error ? e.message : String(e)}; please fix or remove`
|
|
101
|
+
);
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
async function writeJson(p, value) {
|
|
105
|
+
await fs.mkdir(path.dirname(p), { recursive: true });
|
|
106
|
+
await fs.writeFile(p, `${JSON.stringify(value, null, 2)}
|
|
107
|
+
`);
|
|
108
|
+
}
|
|
109
|
+
async function readManagedIds(projectDir, target) {
|
|
110
|
+
const state = await readJsonStrict(managedStatePath(projectDir));
|
|
111
|
+
const ids = state?.targets?.[target];
|
|
112
|
+
return Array.isArray(ids) ? ids : [];
|
|
113
|
+
}
|
|
114
|
+
async function writeManagedIds(projectDir, target, ids) {
|
|
115
|
+
const p = managedStatePath(projectDir);
|
|
116
|
+
const state = await readJsonStrict(p) ?? { targets: {} };
|
|
117
|
+
const targets = { ...state.targets ?? {} };
|
|
118
|
+
if (ids.length > 0) targets[target] = ids;
|
|
119
|
+
else delete targets[target];
|
|
120
|
+
await writeJson(p, { version: 1, targets });
|
|
121
|
+
}
|
|
122
|
+
function mergeServers(existing, renderable, managedIds, warn, configLabel) {
|
|
123
|
+
const next = { ...existing };
|
|
124
|
+
const managed = new Set(managedIds);
|
|
125
|
+
const owned = [];
|
|
126
|
+
const removed = [];
|
|
127
|
+
for (const id of managed) {
|
|
128
|
+
if (!renderable.has(id) && Object.hasOwn(next, id)) {
|
|
129
|
+
delete next[id];
|
|
130
|
+
removed.push(id);
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
for (const [id, entry] of renderable) {
|
|
134
|
+
if (Object.hasOwn(next, id) && !managed.has(id)) {
|
|
135
|
+
warn(`"${id}" already declared in ${configLabel} by hand \u2014 leaving the existing entry`);
|
|
136
|
+
continue;
|
|
137
|
+
}
|
|
138
|
+
next[id] = entry;
|
|
139
|
+
owned.push(id);
|
|
140
|
+
}
|
|
141
|
+
return { next, owned, removed };
|
|
142
|
+
}
|
|
143
|
+
async function renderMcpServerConfig(projectDir, driverTarget, opts) {
|
|
144
|
+
const warn = opts?.warn ?? ((m) => console.warn(`skaile: ${m}`));
|
|
145
|
+
const relConfig = TARGET_MCP_CONFIG[driverTarget];
|
|
146
|
+
if (!relConfig) return { written: false, servers: [], removed: [], skipped: [] };
|
|
147
|
+
const configPath = path.join(projectDir, relConfig);
|
|
148
|
+
const declarations = await loadMcpServerDeclarations(projectDir);
|
|
149
|
+
const skipped = [];
|
|
150
|
+
const renderable = /* @__PURE__ */ new Map();
|
|
151
|
+
for (const decl of declarations) {
|
|
152
|
+
const reason = skipReason(decl);
|
|
153
|
+
if (reason) {
|
|
154
|
+
skipped.push({ id: decl.id, reason });
|
|
155
|
+
warn(`MCP server "${decl.id}" not written to ${relConfig}: ${reason}`);
|
|
156
|
+
continue;
|
|
157
|
+
}
|
|
158
|
+
renderable.set(decl.id, buildEntry(decl, projectDir));
|
|
159
|
+
}
|
|
160
|
+
const managedIds = await readManagedIds(projectDir, driverTarget);
|
|
161
|
+
const existingFile = await readJsonStrict(configPath);
|
|
162
|
+
if (renderable.size === 0 && managedIds.length === 0 && !existingFile) {
|
|
163
|
+
return { path: configPath, written: false, servers: [], removed: [], skipped };
|
|
164
|
+
}
|
|
165
|
+
const file = existingFile ?? {};
|
|
166
|
+
const existingServers = file.mcpServers ?? {};
|
|
167
|
+
const { next, owned, removed } = mergeServers(
|
|
168
|
+
existingServers,
|
|
169
|
+
renderable,
|
|
170
|
+
managedIds,
|
|
171
|
+
warn,
|
|
172
|
+
relConfig
|
|
173
|
+
);
|
|
174
|
+
const ledgerStale = JSON.stringify(owned) !== JSON.stringify(managedIds);
|
|
175
|
+
if (ledgerStale) await writeManagedIds(projectDir, driverTarget, owned);
|
|
176
|
+
if (Object.keys(next).length === 0 && !existingFile) {
|
|
177
|
+
return { path: configPath, written: false, servers: owned, removed, skipped };
|
|
178
|
+
}
|
|
179
|
+
if (!ledgerStale && JSON.stringify(next) === JSON.stringify(existingServers) && existingFile) {
|
|
180
|
+
return { path: configPath, written: false, servers: owned, removed, skipped };
|
|
181
|
+
}
|
|
182
|
+
await writeJson(configPath, { ...file, mcpServers: next });
|
|
183
|
+
return { path: configPath, written: true, servers: owned, removed, skipped };
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
// asset-manager/src/index.ts
|
|
17
187
|
function normalizeRepoUrl(url) {
|
|
18
188
|
return url.trim().replace(/^git@([^:]+):/, "https://$1/").replace(/^[a-z]+:\/\//i, "").replace(/\.git$/i, "").replace(/\/+$/, "").toLowerCase();
|
|
19
189
|
}
|
|
@@ -48,6 +218,9 @@ var NON_DEPLOYABLE_KINDS = /* @__PURE__ */ new Set([
|
|
|
48
218
|
"ruleset",
|
|
49
219
|
"knowledge"
|
|
50
220
|
]);
|
|
221
|
+
function unscopedName(x) {
|
|
222
|
+
return x.includes("/") ? x.split("/").pop() : x;
|
|
223
|
+
}
|
|
51
224
|
function commonDirPrefix(paths) {
|
|
52
225
|
if (paths.length === 0) return "";
|
|
53
226
|
const dirs = paths.map((p) => p.split("/").slice(0, -1));
|
|
@@ -277,6 +450,26 @@ var AssetManager = class {
|
|
|
277
450
|
deployOptsFor(target, link) {
|
|
278
451
|
return { driverTarget: target, global: this.global, cwd: this.projectDir, link: link === true };
|
|
279
452
|
}
|
|
453
|
+
/**
|
|
454
|
+
* Render the project's declared MCP servers into the driver target's own
|
|
455
|
+
* native MCP config (`<project>/.mcp.json` for `claude-code`), so the coding
|
|
456
|
+
* agent sees the same servers skaile's agent loop wires up.
|
|
457
|
+
*
|
|
458
|
+
* Project scope only: a `--global` install has no project-scope config to
|
|
459
|
+
* write, and the coding agent's user scope is a large user-state file this
|
|
460
|
+
* must not touch. Never fails an install — a render error is warned and
|
|
461
|
+
* swallowed.
|
|
462
|
+
*/
|
|
463
|
+
async renderDriverMcpConfig() {
|
|
464
|
+
if (this.global) return;
|
|
465
|
+
try {
|
|
466
|
+
await renderMcpServerConfig(this.projectDir, this.driverTarget);
|
|
467
|
+
} catch (err) {
|
|
468
|
+
console.warn(
|
|
469
|
+
`skaile: could not render MCP config for ${this.driverTarget}: ${err instanceof Error ? err.message : String(err)}`
|
|
470
|
+
);
|
|
471
|
+
}
|
|
472
|
+
}
|
|
280
473
|
loadConfig() {
|
|
281
474
|
const config = this.global ? resolveGlobalSkWorkspaceConfig() : resolveSkWorkspaceConfig(this.projectDir);
|
|
282
475
|
const sources = config.sources ?? [];
|
|
@@ -390,7 +583,7 @@ var AssetManager = class {
|
|
|
390
583
|
*
|
|
391
584
|
* @returns the matched deploy entries plus the set of `missing` refs covered.
|
|
392
585
|
*/
|
|
393
|
-
resolveLibraryEntries(missing) {
|
|
586
|
+
async resolveLibraryEntries(missing) {
|
|
394
587
|
const resolved = /* @__PURE__ */ new Set();
|
|
395
588
|
if (missing.length === 0) return { entries: [], resolved };
|
|
396
589
|
let librariesRoot;
|
|
@@ -405,7 +598,7 @@ var AssetManager = class {
|
|
|
405
598
|
if (!dirent.isDirectory()) continue;
|
|
406
599
|
const libPath = join(librariesRoot, dirent.name);
|
|
407
600
|
const publisher = readDeclaredPublisher(libPath) ?? slugifyAssetName(dirent.name);
|
|
408
|
-
for (const entry of scanDirectory(libPath, publisher)) {
|
|
601
|
+
for (const entry of await scanDirectory(libPath, publisher)) {
|
|
409
602
|
const key = `${entry.kind}:@${entry.publisher}/${entry.name}`;
|
|
410
603
|
const prev = byKey.get(key);
|
|
411
604
|
if (!prev || gt(coerceVersion(entry.version ?? ""), coerceVersion(prev.version ?? ""))) {
|
|
@@ -510,9 +703,10 @@ var AssetManager = class {
|
|
|
510
703
|
return entries;
|
|
511
704
|
}
|
|
512
705
|
/**
|
|
513
|
-
* Fetch + SHA-verify the bytes of every store-resolved
|
|
514
|
-
* into `.skaile/cache/store/`, reusing the same verified-fetch
|
|
515
|
-
* pointer-only `library.install` uses (`installFromManifest` flat
|
|
706
|
+
* Fetch + SHA-verify the bytes of every store-resolved candidate that needs
|
|
707
|
+
* bytes on disk into `.skaile/cache/store/`, reusing the same verified-fetch
|
|
708
|
+
* path the pointer-only `library.install` uses (`installFromManifest` flat
|
|
709
|
+
* mode). That is the deployable kinds plus `mcp-server` — see the skip guard.
|
|
516
710
|
*
|
|
517
711
|
* @returns Map of candidate key → staged primary-manifest path.
|
|
518
712
|
*/
|
|
@@ -520,7 +714,7 @@ var AssetManager = class {
|
|
|
520
714
|
const staged = /* @__PURE__ */ new Map();
|
|
521
715
|
let installFromManifest;
|
|
522
716
|
for (const c of resolved) {
|
|
523
|
-
if (NON_DEPLOYABLE_KINDS.has(c.kind)) continue;
|
|
717
|
+
if (NON_DEPLOYABLE_KINDS.has(c.kind) && c.kind !== "mcp-server") continue;
|
|
524
718
|
if (!c.files || c.files.length === 0 || !c.sourceUrl || !c.commit) continue;
|
|
525
719
|
if (this.candidateHasLocalBytes(c, repositories)) continue;
|
|
526
720
|
if (!installFromManifest) {
|
|
@@ -631,7 +825,7 @@ var AssetManager = class {
|
|
|
631
825
|
}
|
|
632
826
|
const cloneError = this.ensureSourceClones(repositories, sources);
|
|
633
827
|
if (cloneError) return cloneError;
|
|
634
|
-
const provenanceIndex = buildProvenanceIndex(this.buildClones(repositories), {
|
|
828
|
+
const provenanceIndex = await buildProvenanceIndex(this.buildClones(repositories), {
|
|
635
829
|
projectDir: this.projectDir
|
|
636
830
|
});
|
|
637
831
|
const { resolved, missing, overridesApplied } = await this.resolveWithStores(dependencies, {
|
|
@@ -639,7 +833,7 @@ var AssetManager = class {
|
|
|
639
833
|
overrides,
|
|
640
834
|
stores
|
|
641
835
|
});
|
|
642
|
-
const lib = this.resolveLibraryEntries(missing);
|
|
836
|
+
const lib = await this.resolveLibraryEntries(missing);
|
|
643
837
|
const removed = this.reconcileRemovedAssets(resolved);
|
|
644
838
|
const entries = [...await this.buildCatalogEntries(resolved, repositories), ...lib.entries];
|
|
645
839
|
const deployed = [
|
|
@@ -649,6 +843,7 @@ var AssetManager = class {
|
|
|
649
843
|
)
|
|
650
844
|
)
|
|
651
845
|
];
|
|
846
|
+
await this.renderDriverMcpConfig();
|
|
652
847
|
const lockWritten = resolved.length > 0 || existsSync(this.lockPath);
|
|
653
848
|
if (lockWritten) {
|
|
654
849
|
writeLock(this.lockPath, buildLockFile(resolved, overridesApplied));
|
|
@@ -758,6 +953,16 @@ var AssetManager = class {
|
|
|
758
953
|
const { RemoteCatalogSource } = await import('./library/index.js');
|
|
759
954
|
const src = new RemoteCatalogSource({ baseUrl: storeUrl });
|
|
760
955
|
return src.getCanonicalDigest(ref);
|
|
956
|
+
},
|
|
957
|
+
listVersions: async (storeUrl, ref) => {
|
|
958
|
+
const { RemoteCatalogSource } = await import('./library/index.js');
|
|
959
|
+
const src = new RemoteCatalogSource({ baseUrl: storeUrl });
|
|
960
|
+
try {
|
|
961
|
+
return await src.listVersions(ref);
|
|
962
|
+
} catch (err) {
|
|
963
|
+
console.warn(`skaile: store ${storeUrl} version lookup for ${ref} failed \u2014 ${err}`);
|
|
964
|
+
return [];
|
|
965
|
+
}
|
|
761
966
|
}
|
|
762
967
|
};
|
|
763
968
|
}
|
|
@@ -792,7 +997,7 @@ var AssetManager = class {
|
|
|
792
997
|
}
|
|
793
998
|
return { npmInstalled, npmFailed };
|
|
794
999
|
}
|
|
795
|
-
installLocked(repositories, patches) {
|
|
1000
|
+
async installLocked(repositories, patches) {
|
|
796
1001
|
const lock = this.tryReadLock();
|
|
797
1002
|
if (!lock) {
|
|
798
1003
|
throw new Error("No lock file found. Run `skaile install` first.");
|
|
@@ -848,6 +1053,7 @@ var AssetManager = class {
|
|
|
848
1053
|
)
|
|
849
1054
|
)
|
|
850
1055
|
];
|
|
1056
|
+
await this.renderDriverMcpConfig();
|
|
851
1057
|
return { deployed, removed: [], missing: [], lockWritten: false };
|
|
852
1058
|
}
|
|
853
1059
|
/**
|
|
@@ -873,7 +1079,7 @@ var AssetManager = class {
|
|
|
873
1079
|
} catch {
|
|
874
1080
|
}
|
|
875
1081
|
}
|
|
876
|
-
const provenanceIndex = buildProvenanceIndex(this.buildClones(repositories), {
|
|
1082
|
+
const provenanceIndex = await buildProvenanceIndex(this.buildClones(repositories), {
|
|
877
1083
|
projectDir: this.projectDir
|
|
878
1084
|
});
|
|
879
1085
|
const { resolved, missing, overridesApplied } = await this.resolveWithStores([ref], {
|
|
@@ -881,7 +1087,7 @@ var AssetManager = class {
|
|
|
881
1087
|
overrides,
|
|
882
1088
|
stores
|
|
883
1089
|
});
|
|
884
|
-
const lib = this.resolveLibraryEntries(missing);
|
|
1090
|
+
const lib = await this.resolveLibraryEntries(missing);
|
|
885
1091
|
if (resolved.length === 0 && lib.entries.length === 0) {
|
|
886
1092
|
throw new Error(
|
|
887
1093
|
`Asset not found: ${ref}${missing.length ? ` (missing: ${missing.join(", ")})` : ""}`
|
|
@@ -896,6 +1102,7 @@ var AssetManager = class {
|
|
|
896
1102
|
)
|
|
897
1103
|
];
|
|
898
1104
|
this.addDependencyToConfig(ref);
|
|
1105
|
+
await this.renderDriverMcpConfig();
|
|
899
1106
|
if (resolved.length > 0) {
|
|
900
1107
|
const fresh = buildLockFile(resolved, overridesApplied);
|
|
901
1108
|
const prev = this.tryReadLock();
|
|
@@ -1118,6 +1325,12 @@ var AssetManager = class {
|
|
|
1118
1325
|
/**
|
|
1119
1326
|
* Remove a deployed asset and unregister it from `skaile.yaml`.
|
|
1120
1327
|
*
|
|
1328
|
+
* Deliberately does NOT re-render the driver target's MCP config: the render
|
|
1329
|
+
* step is async (the declaration resolver is), and making this synchronous
|
|
1330
|
+
* method async would break every external caller. A removed MCP server's
|
|
1331
|
+
* generated entry is dropped by the next {@link AssetManager.install} — see
|
|
1332
|
+
* {@link renderMcpServerConfig}.
|
|
1333
|
+
*
|
|
1121
1334
|
* @param ref - Asset ref in `kind:name` form (e.g. `skill:my-skill`).
|
|
1122
1335
|
* @returns `true` if the asset was found and removed, `false` if it was not deployed.
|
|
1123
1336
|
*/
|
|
@@ -1168,13 +1381,13 @@ var AssetManager = class {
|
|
|
1168
1381
|
* Omit to return all kinds.
|
|
1169
1382
|
* @returns Array of matching {@link CatalogEntry} objects from all accessible repositories.
|
|
1170
1383
|
*/
|
|
1171
|
-
search(query, kind) {
|
|
1384
|
+
async search(query, kind) {
|
|
1172
1385
|
const { repositories } = this.loadConfig();
|
|
1173
1386
|
let all = [];
|
|
1174
1387
|
for (const [name, decl] of Object.entries(repositories)) {
|
|
1175
1388
|
const repoDir = this.resolveRepoDir(decl, name);
|
|
1176
1389
|
if (!repoDir) continue;
|
|
1177
|
-
all = [...all, ...scanRepo(repoDir, name)];
|
|
1390
|
+
all = [...all, ...await scanRepo(repoDir, name)];
|
|
1178
1391
|
}
|
|
1179
1392
|
if (kind) all = all.filter((e) => e.kind === kind);
|
|
1180
1393
|
if (query) {
|
|
@@ -1211,14 +1424,14 @@ var AssetManager = class {
|
|
|
1211
1424
|
* @param ref - Asset ref in `kind:name`, `kind:@publisher/name`, or `repo/kind:name` form.
|
|
1212
1425
|
* @returns The matching {@link CatalogEntry}, or `null` when not found.
|
|
1213
1426
|
*/
|
|
1214
|
-
info(ref) {
|
|
1427
|
+
async info(ref) {
|
|
1215
1428
|
const { repositories } = this.loadConfig();
|
|
1216
1429
|
const parsed = parseRefTolerant(ref);
|
|
1217
1430
|
if (!parsed) return null;
|
|
1218
1431
|
for (const [name, decl] of Object.entries(repositories)) {
|
|
1219
1432
|
const repoDir = this.resolveRepoDir(decl, name);
|
|
1220
1433
|
if (!repoDir) continue;
|
|
1221
|
-
const entries = scanRepo(repoDir, name);
|
|
1434
|
+
const entries = await scanRepo(repoDir, name);
|
|
1222
1435
|
const match = entries.find(
|
|
1223
1436
|
(e) => e.kind === parsed.kind && e.name === parsed.name && (!parsed.publisher || e.publisher === parsed.publisher)
|
|
1224
1437
|
);
|
|
@@ -1276,8 +1489,10 @@ var AssetManager = class {
|
|
|
1276
1489
|
*
|
|
1277
1490
|
* - `declared` — in `skaile.yaml`, not yet resolved into the lock.
|
|
1278
1491
|
* - `installed` — declared + locked, and (for deployable kinds) materialized on
|
|
1279
|
-
* disk.
|
|
1280
|
-
*
|
|
1492
|
+
* disk. An `mcp-server` is instead checked against the declarations the runner
|
|
1493
|
+
* would actually wire (store-staged or materialized `MCP.md`); the remaining
|
|
1494
|
+
* non-deployable kinds ({@link NON_DEPLOYABLE_KINDS}) count as installed once
|
|
1495
|
+
* locked — they are resolved at session start with no on-disk footprint here.
|
|
1281
1496
|
* - `drift` — declared + locked but the deployed files are missing on disk.
|
|
1282
1497
|
* - `invalid` — the `dependencies:` entry isn't a parseable canonical ref. Only
|
|
1283
1498
|
* surfaced in the unfiltered listing (a `kind` filter can't classify it).
|
|
@@ -1290,13 +1505,25 @@ var AssetManager = class {
|
|
|
1290
1505
|
* @throws {MissingManifestError} when the project has no `skaile.yaml`.
|
|
1291
1506
|
* @throws {Error} with a `migrate-skaile-manifest` hint on legacy `repositories:` / `ai_resources:` keys.
|
|
1292
1507
|
*/
|
|
1293
|
-
listDeclared(kind) {
|
|
1508
|
+
async listDeclared(kind) {
|
|
1294
1509
|
if (!existsSync(join(this.projectDir, SKAILE_YAML_DEFAULT))) {
|
|
1295
1510
|
throw new MissingManifestError(this.projectDir);
|
|
1296
1511
|
}
|
|
1297
1512
|
const dependencies = resolveSkWorkspaceConfig(this.projectDir).dependencies ?? [];
|
|
1298
1513
|
const lock = this.tryReadLock();
|
|
1299
1514
|
const lockKeys = lock ? Object.keys(lock.assets).map(parseCanonicalLockKey) : [];
|
|
1515
|
+
let wiredMcps;
|
|
1516
|
+
const wiredMcpNames = async () => {
|
|
1517
|
+
if (wiredMcps === void 0) {
|
|
1518
|
+
try {
|
|
1519
|
+
const decls = await loadMcpServerDeclarations(this.projectDir);
|
|
1520
|
+
wiredMcps = new Set(decls.flatMap((d) => [d.id, unscopedName(d.id)]));
|
|
1521
|
+
} catch {
|
|
1522
|
+
wiredMcps = /* @__PURE__ */ new Set();
|
|
1523
|
+
}
|
|
1524
|
+
}
|
|
1525
|
+
return wiredMcps;
|
|
1526
|
+
};
|
|
1300
1527
|
const out = [];
|
|
1301
1528
|
for (const ref of dependencies) {
|
|
1302
1529
|
let parsed;
|
|
@@ -1313,6 +1540,9 @@ var AssetManager = class {
|
|
|
1313
1540
|
let state;
|
|
1314
1541
|
if (!locked) {
|
|
1315
1542
|
state = "declared";
|
|
1543
|
+
} else if (parsed.kind === "mcp-server") {
|
|
1544
|
+
const wired = await wiredMcpNames();
|
|
1545
|
+
state = wired.has(parsed.name) || wired.has(unscopedName(parsed.name)) ? "installed" : "drift";
|
|
1316
1546
|
} else if (NON_DEPLOYABLE_KINDS.has(parsed.kind)) {
|
|
1317
1547
|
state = "installed";
|
|
1318
1548
|
} else {
|
|
@@ -1502,9 +1732,9 @@ var AssetManager = class {
|
|
|
1502
1732
|
* @returns Unified diff string, or `null` when there are no differences or the
|
|
1503
1733
|
* asset is not deployed/resolvable.
|
|
1504
1734
|
*/
|
|
1505
|
-
diff(ref) {
|
|
1735
|
+
async diff(ref) {
|
|
1506
1736
|
const parsed = parseAssetRef(ref);
|
|
1507
|
-
const entry = this.info(ref);
|
|
1737
|
+
const entry = await this.info(ref);
|
|
1508
1738
|
if (!entry) return null;
|
|
1509
1739
|
const deployedPath = join(
|
|
1510
1740
|
deployedBase(parsed.kind, this.driverTarget, this.global, this.projectDir),
|
|
@@ -1531,7 +1761,7 @@ var AssetManager = class {
|
|
|
1531
1761
|
} catch {
|
|
1532
1762
|
}
|
|
1533
1763
|
}
|
|
1534
|
-
const provenanceIndex = buildProvenanceIndex(this.buildClones(repositories), {
|
|
1764
|
+
const provenanceIndex = await buildProvenanceIndex(this.buildClones(repositories), {
|
|
1535
1765
|
projectDir: this.projectDir
|
|
1536
1766
|
});
|
|
1537
1767
|
const { resolved, overridesApplied } = await this.resolveWithStores(dependencies, {
|
|
@@ -1554,8 +1784,8 @@ var AssetManager = class {
|
|
|
1554
1784
|
* @returns Absolute path to the patch working directory.
|
|
1555
1785
|
* @throws When the asset cannot be found in the catalog.
|
|
1556
1786
|
*/
|
|
1557
|
-
patch(ref) {
|
|
1558
|
-
const entry = this.info(ref);
|
|
1787
|
+
async patch(ref) {
|
|
1788
|
+
const entry = await this.info(ref);
|
|
1559
1789
|
if (!entry) throw new Error(`Asset not found: ${ref}`);
|
|
1560
1790
|
return extractForPatch(entry, this.patchDir);
|
|
1561
1791
|
}
|
|
@@ -1569,9 +1799,9 @@ var AssetManager = class {
|
|
|
1569
1799
|
* @returns Absolute path to the generated `.patch` file.
|
|
1570
1800
|
* @throws When the patch working directory does not exist or no differences are found.
|
|
1571
1801
|
*/
|
|
1572
|
-
patchCommit(ref) {
|
|
1802
|
+
async patchCommit(ref) {
|
|
1573
1803
|
const parsed = parseAssetRef(ref);
|
|
1574
|
-
const entry = this.info(ref);
|
|
1804
|
+
const entry = await this.info(ref);
|
|
1575
1805
|
if (!entry) throw new Error(`Asset not found: ${ref}`);
|
|
1576
1806
|
const patchedDir = join(this.patchDir, `${parsed.kind}-${parsed.name}`);
|
|
1577
1807
|
if (!existsSync(patchedDir)) {
|
|
@@ -1593,9 +1823,9 @@ var AssetManager = class {
|
|
|
1593
1823
|
* @param ref - Asset ref in `kind:name` form.
|
|
1594
1824
|
* @throws When the asset is not found, has no repository, or the patch file is missing.
|
|
1595
1825
|
*/
|
|
1596
|
-
patchSubmit(ref) {
|
|
1826
|
+
async patchSubmit(ref) {
|
|
1597
1827
|
const parsed = parseAssetRef(ref);
|
|
1598
|
-
const entry = this.info(ref);
|
|
1828
|
+
const entry = await this.info(ref);
|
|
1599
1829
|
if (!entry?.publisher) throw new Error(`Asset not found or no publisher: ${ref}`);
|
|
1600
1830
|
const { repositories } = this.loadConfig();
|
|
1601
1831
|
const decl = repositories[entry.publisher];
|
|
@@ -1636,12 +1866,12 @@ var AssetManager = class {
|
|
|
1636
1866
|
*
|
|
1637
1867
|
* @returns Array of {@link DepIssue} objects. An empty array means the workspace is healthy.
|
|
1638
1868
|
*/
|
|
1639
|
-
doctor() {
|
|
1869
|
+
async doctor() {
|
|
1640
1870
|
const { repositories } = this.loadConfig();
|
|
1641
1871
|
const deployed = this.listDeployed();
|
|
1642
1872
|
const issues = [];
|
|
1643
1873
|
for (const entry of deployed) {
|
|
1644
|
-
const full = this.info(`${entry.kind}:${entry.name}`);
|
|
1874
|
+
const full = await this.info(`${entry.kind}:${entry.name}`);
|
|
1645
1875
|
if (!full) continue;
|
|
1646
1876
|
for (const req of full.requires) {
|
|
1647
1877
|
if (!isDeployed(
|
|
@@ -1651,7 +1881,11 @@ var AssetManager = class {
|
|
|
1651
1881
|
this.global,
|
|
1652
1882
|
this.projectDir
|
|
1653
1883
|
)) {
|
|
1654
|
-
const inRepos = resolveAsset(
|
|
1884
|
+
const inRepos = await resolveAsset(
|
|
1885
|
+
{ kind: req.kind, name: req.name },
|
|
1886
|
+
repositories,
|
|
1887
|
+
this.reposDir
|
|
1888
|
+
) !== null;
|
|
1655
1889
|
issues.push({
|
|
1656
1890
|
assetKind: entry.kind,
|
|
1657
1891
|
assetName: entry.name,
|
|
@@ -1850,6 +2084,6 @@ var AssetManager = class {
|
|
|
1850
2084
|
}
|
|
1851
2085
|
};
|
|
1852
2086
|
|
|
1853
|
-
export { AssetManager, FACTORY_SOURCE_URL, MissingManifestError, NON_DEPLOYABLE_KINDS, normalizeRepoUrl, parseCanonicalLockKey, parseRefTolerant, softDepName };
|
|
1854
|
-
//# sourceMappingURL=chunk-
|
|
1855
|
-
//# sourceMappingURL=chunk-
|
|
2087
|
+
export { AssetManager, FACTORY_SOURCE_URL, MissingManifestError, NON_DEPLOYABLE_KINDS, normalizeRepoUrl, parseCanonicalLockKey, parseRefTolerant, renderMcpServerConfig, softDepName };
|
|
2088
|
+
//# sourceMappingURL=chunk-VPXBAEWE.js.map
|
|
2089
|
+
//# sourceMappingURL=chunk-VPXBAEWE.js.map
|