@skaile/workspaces 5.2.0 → 5.4.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 +72 -0
- package/README.md +9 -2
- package/dist/{asset-feeds-WDIB3E6H.js → asset-feeds-3MVRNS5U.js} +12 -12
- package/dist/{asset-feeds-WDIB3E6H.js.map → asset-feeds-3MVRNS5U.js.map} +1 -1
- package/dist/asset-manager/catalog-deployer.js +9 -9
- package/dist/asset-manager/index.js +13 -13
- package/dist/asset-manager/installer.js +9 -9
- package/dist/asset-manager/src/index.d.ts +22 -3
- package/dist/asset-manager/src/index.d.ts.map +1 -1
- package/dist/asset-manager/src/installer.d.ts +9 -1
- package/dist/asset-manager/src/installer.d.ts.map +1 -1
- package/dist/bridge/drivers/claude-sdk.js +11 -11
- package/dist/bridge/drivers/codex.js +10 -10
- package/dist/bridge/drivers/continue.js +12 -12
- package/dist/bridge/drivers/echo.js +1 -1
- package/dist/bridge/drivers/gemini.js +5 -5
- package/dist/bridge/drivers/goose.js +12 -12
- package/dist/bridge/drivers/omp.js +2 -2
- package/dist/bridge/drivers/opencode.js +12 -12
- package/dist/bridge/drivers/qwen.js +5 -5
- package/dist/bridge/index.js +12 -12
- package/dist/{chunk-WMEPS6S4.js → chunk-2XXAVTTO.js} +3 -3
- package/dist/{chunk-WMEPS6S4.js.map → chunk-2XXAVTTO.js.map} +1 -1
- package/dist/{chunk-KGGT6MUM.js → chunk-37DN45RR.js} +19 -7
- package/dist/chunk-37DN45RR.js.map +1 -0
- package/dist/chunk-5NH3U6N5.js +15 -0
- package/dist/{chunk-BZXR6SW5.js.map → chunk-5NH3U6N5.js.map} +1 -1
- package/dist/{chunk-P2EM6FNQ.js → chunk-6IGFSUTE.js} +23 -36
- package/dist/chunk-6IGFSUTE.js.map +1 -0
- package/dist/{chunk-EOGNW74K.js → chunk-7KITVWXK.js} +25 -23
- package/dist/chunk-7KITVWXK.js.map +1 -0
- package/dist/{chunk-S6KNDUAU.js → chunk-A67BHJCH.js} +5 -5
- package/dist/{chunk-S6KNDUAU.js.map → chunk-A67BHJCH.js.map} +1 -1
- package/dist/{chunk-3E2TIPBZ.js → chunk-AE42DHSH.js} +2 -2
- package/dist/{chunk-3E2TIPBZ.js.map → chunk-AE42DHSH.js.map} +1 -1
- package/dist/{chunk-L257BENF.js → chunk-BATL2CWI.js} +128 -32
- package/dist/chunk-BATL2CWI.js.map +1 -0
- package/dist/{chunk-2MEMXBLC.js → chunk-BHUHGLNS.js} +5 -5
- package/dist/{chunk-2MEMXBLC.js.map → chunk-BHUHGLNS.js.map} +1 -1
- package/dist/{chunk-XIYXBHLN.js → chunk-DTV7HL5R.js} +2 -2
- package/dist/{chunk-XIYXBHLN.js.map → chunk-DTV7HL5R.js.map} +1 -1
- package/dist/{chunk-BJQUSAGB.js → chunk-GCYD4EGY.js} +4 -4
- package/dist/{chunk-BJQUSAGB.js.map → chunk-GCYD4EGY.js.map} +1 -1
- package/dist/{chunk-EB6OPURC.js → chunk-HTKZ4AOW.js} +3 -3
- package/dist/{chunk-EB6OPURC.js.map → chunk-HTKZ4AOW.js.map} +1 -1
- package/dist/{chunk-OFNXRI4L.js → chunk-IDUGP4V7.js} +3 -3
- package/dist/{chunk-OFNXRI4L.js.map → chunk-IDUGP4V7.js.map} +1 -1
- package/dist/{chunk-ANWHAGM7.js → chunk-JAJG4G5E.js} +3 -3
- package/dist/{chunk-ANWHAGM7.js.map → chunk-JAJG4G5E.js.map} +1 -1
- package/dist/{chunk-PU5VY7KF.js → chunk-JCATNLY3.js} +4 -4
- package/dist/{chunk-PU5VY7KF.js.map → chunk-JCATNLY3.js.map} +1 -1
- package/dist/{chunk-77GKEZ2R.js → chunk-JEA32KB6.js} +3 -3
- package/dist/{chunk-77GKEZ2R.js.map → chunk-JEA32KB6.js.map} +1 -1
- package/dist/{chunk-7Y43UXKA.js → chunk-JELTQ4H7.js} +3 -3
- package/dist/{chunk-7Y43UXKA.js.map → chunk-JELTQ4H7.js.map} +1 -1
- package/dist/{chunk-R3QW7CA5.js → chunk-JF26V3BC.js} +7 -7
- package/dist/chunk-JF26V3BC.js.map +1 -0
- package/dist/{chunk-XOTJVCJB.js → chunk-JKWU6ULI.js} +3 -3
- package/dist/{chunk-XOTJVCJB.js.map → chunk-JKWU6ULI.js.map} +1 -1
- package/dist/{chunk-ARUJBGAH.js → chunk-KXTO7HON.js} +3 -3
- package/dist/{chunk-ARUJBGAH.js.map → chunk-KXTO7HON.js.map} +1 -1
- package/dist/{chunk-2QZG5VJQ.js → chunk-LAI7X6I2.js} +3 -3
- package/dist/{chunk-2QZG5VJQ.js.map → chunk-LAI7X6I2.js.map} +1 -1
- package/dist/{chunk-YANDJSMN.js → chunk-LFMX2UEF.js} +3 -3
- package/dist/{chunk-YANDJSMN.js.map → chunk-LFMX2UEF.js.map} +1 -1
- package/dist/{chunk-BUNBKRJZ.js → chunk-LUBS5DXY.js} +3 -3
- package/dist/{chunk-BUNBKRJZ.js.map → chunk-LUBS5DXY.js.map} +1 -1
- package/dist/{chunk-TLKM4M47.js → chunk-MFHKHXDE.js} +6 -3
- package/dist/chunk-MFHKHXDE.js.map +1 -0
- package/dist/chunk-NESV47MF.js +20 -0
- package/dist/chunk-NESV47MF.js.map +1 -0
- package/dist/{chunk-6OWIEFZ2.js → chunk-OANSNVCP.js} +5 -5
- package/dist/{chunk-6OWIEFZ2.js.map → chunk-OANSNVCP.js.map} +1 -1
- package/dist/{chunk-MGHUSFYQ.js → chunk-ONWTPXVU.js} +8 -8
- package/dist/{chunk-MGHUSFYQ.js.map → chunk-ONWTPXVU.js.map} +1 -1
- package/dist/{chunk-DD3OZLRD.js → chunk-OXE5A6H6.js} +3 -3
- package/dist/{chunk-DD3OZLRD.js.map → chunk-OXE5A6H6.js.map} +1 -1
- package/dist/{chunk-BIMEKYOE.js → chunk-QEXEHXX5.js} +15 -18
- package/dist/chunk-QEXEHXX5.js.map +1 -0
- package/dist/{chunk-TVJBJLXR.js → chunk-QK756IRJ.js} +13 -13
- package/dist/{chunk-TVJBJLXR.js.map → chunk-QK756IRJ.js.map} +1 -1
- package/dist/{chunk-UDBN3LZU.js → chunk-RD6GE4HU.js} +4 -4
- package/dist/{chunk-UDBN3LZU.js.map → chunk-RD6GE4HU.js.map} +1 -1
- package/dist/{chunk-IOUIC2ZD.js → chunk-SQBPE66C.js} +8 -8
- package/dist/{chunk-IOUIC2ZD.js.map → chunk-SQBPE66C.js.map} +1 -1
- package/dist/{chunk-YRF5CYHR.js → chunk-SR4RFKHM.js} +36 -5
- package/dist/chunk-SR4RFKHM.js.map +1 -0
- package/dist/{chunk-BWOLP6KQ.js → chunk-U6ORGQHZ.js} +3 -3
- package/dist/{chunk-BWOLP6KQ.js.map → chunk-U6ORGQHZ.js.map} +1 -1
- package/dist/{chunk-RXPC4KBW.js → chunk-UAAAERXI.js} +3 -3
- package/dist/{chunk-RXPC4KBW.js.map → chunk-UAAAERXI.js.map} +1 -1
- package/dist/chunk-UKDFOOEG.js +22 -0
- package/dist/chunk-UKDFOOEG.js.map +1 -0
- package/dist/{chunk-6ZCVROWW.js → chunk-UNRZCQD4.js} +6 -6
- package/dist/{chunk-6ZCVROWW.js.map → chunk-UNRZCQD4.js.map} +1 -1
- package/dist/{chunk-ZSFTCMZL.js → chunk-VETH6MDG.js} +19 -19
- package/dist/{chunk-ZSFTCMZL.js.map → chunk-VETH6MDG.js.map} +1 -1
- package/dist/{chunk-4YE7OYTB.js → chunk-VKSA2CDJ.js} +5 -6
- package/dist/chunk-VKSA2CDJ.js.map +1 -0
- package/dist/{chunk-OABIGSUY.js → chunk-WX74MVNA.js} +2 -2
- package/dist/chunk-WX74MVNA.js.map +1 -0
- package/dist/{chunk-U6K3I3AX.js → chunk-XGIS325V.js} +3 -3
- package/dist/{chunk-U6K3I3AX.js.map → chunk-XGIS325V.js.map} +1 -1
- package/dist/{chunk-FJTC5YFO.js → chunk-XMQAV6T3.js} +3 -3
- package/dist/{chunk-FJTC5YFO.js.map → chunk-XMQAV6T3.js.map} +1 -1
- package/dist/{chunk-B4J4RGNY.js → chunk-Y5OCUOXF.js} +34 -19
- package/dist/chunk-Y5OCUOXF.js.map +1 -0
- package/dist/{chunk-LZ5RH6LD.js → chunk-Y7UBRRKG.js} +89 -128
- package/dist/chunk-Y7UBRRKG.js.map +1 -0
- package/dist/{chunk-PHKFFJ4I.js → chunk-ZIYYMR6Y.js} +3 -3
- package/dist/{chunk-PHKFFJ4I.js.map → chunk-ZIYYMR6Y.js.map} +1 -1
- package/dist/{chunk-JPR7EPIM.js → chunk-ZUZ5LLZ2.js} +4 -4
- package/dist/{chunk-JPR7EPIM.js.map → chunk-ZUZ5LLZ2.js.map} +1 -1
- package/dist/cli/index.js +796 -583
- package/dist/cli/index.js.map +1 -1
- package/dist/cli/src/commands/asset-cmd.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 +33 -3
- package/dist/cli/src/commands/catalog.d.ts.map +1 -1
- package/dist/cli/src/commands/library-cmd.d.ts.map +1 -1
- package/dist/cli/src/commands/library-index.d.ts +57 -1
- package/dist/cli/src/commands/library-index.d.ts.map +1 -1
- package/dist/cli/src/commands/library-publish.d.ts.map +1 -1
- package/dist/cli/src/commands/npx.d.ts.map +1 -1
- package/dist/cli/src/commands/outdated.d.ts +3 -1
- package/dist/cli/src/commands/outdated.d.ts.map +1 -1
- package/dist/cli/src/commands/project.d.ts.map +1 -1
- package/dist/cli/src/commands/skailify-lib.d.ts +3 -2
- package/dist/cli/src/commands/skailify-lib.d.ts.map +1 -1
- package/dist/cli/src/commands/update.d.ts.map +1 -1
- package/dist/cli/src/commands/validate.d.ts.map +1 -1
- package/dist/cli/src/setup.d.ts.map +1 -1
- package/dist/cli/src/skill-checks.d.ts +21 -0
- package/dist/cli/src/skill-checks.d.ts.map +1 -0
- package/dist/cli/src/spinner.d.ts +24 -0
- package/dist/cli/src/spinner.d.ts.map +1 -0
- package/dist/connectors/config.js +6 -6
- package/dist/connectors/index.js +15 -15
- package/dist/{connectors-GUN4MRWR.js → connectors-OB3OAZTK.js} +18 -18
- package/dist/{connectors-GUN4MRWR.js.map → connectors-OB3OAZTK.js.map} +1 -1
- package/dist/core/index.js +8 -8
- 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/ref.js +1 -1
- package/dist/core/runtime-assets.js +6 -6
- package/dist/core/src/asset-roots.d.ts +8 -0
- package/dist/core/src/asset-roots.d.ts.map +1 -1
- package/dist/core/src/cache-paths.d.ts +6 -0
- package/dist/core/src/cache-paths.d.ts.map +1 -1
- package/dist/core/src/index.d.ts +2 -2
- package/dist/core/src/index.d.ts.map +1 -1
- package/dist/core/src/lock.d.ts.map +1 -1
- package/dist/core/src/models.d.ts +7 -0
- package/dist/core/src/models.d.ts.map +1 -1
- package/dist/core/src/publish-manifest.d.ts +26 -2
- package/dist/core/src/publish-manifest.d.ts.map +1 -1
- package/dist/core/src/repo-manager.d.ts.map +1 -1
- package/dist/core/src/walker.d.ts.map +1 -1
- package/dist/core/store.js +2 -2
- package/dist/core/workspace-config.js +5 -5
- package/dist/deploy/index.js +8 -8
- package/dist/discovery/index.js +4 -4
- package/dist/discovery/src/discover-manifest.d.ts.map +1 -1
- package/dist/discovery/src/discover.d.ts.map +1 -1
- package/dist/discovery/src/hash.d.ts +45 -23
- package/dist/discovery/src/hash.d.ts.map +1 -1
- package/dist/discovery/src/index.d.ts +2 -0
- package/dist/discovery/src/index.d.ts.map +1 -1
- package/dist/discovery/src/parse-manifest.d.ts +27 -0
- package/dist/discovery/src/parse-manifest.d.ts.map +1 -0
- package/dist/discovery/src/tree-entries.d.ts.map +1 -1
- package/dist/{ensure-sources-VCPA762L.js → ensure-sources-Z3KKLEM6.js} +16 -16
- package/dist/{ensure-sources-VCPA762L.js.map → ensure-sources-Z3KKLEM6.js.map} +1 -1
- package/dist/factory-assets/README.md +2 -2
- package/dist/factory-assets/connectors/box.js +15 -15
- package/dist/factory-assets/connectors/deploy.js +15 -15
- package/dist/factory-assets/connectors/devserver.js +15 -15
- package/dist/factory-assets/connectors/flow/adapter.js +15 -15
- package/dist/factory-assets/connectors/flow/engine.js +9 -9
- package/dist/factory-assets/connectors/flow/run-flow.js +17 -17
- package/dist/factory-assets/connectors/flow.js +15 -15
- package/dist/factory-assets/connectors/git.js +15 -15
- package/dist/factory-assets/connectors/gmail.js +15 -15
- package/dist/factory-assets/connectors/googledrive.js +15 -15
- package/dist/factory-assets/connectors/local.js +15 -15
- package/dist/factory-assets/connectors/mattermost.js +15 -15
- package/dist/factory-assets/connectors/memory.js +15 -15
- package/dist/factory-assets/connectors/minio.js +15 -15
- package/dist/factory-assets/connectors/postgres.js +15 -15
- package/dist/factory-assets/connectors/s3.js +15 -15
- package/dist/factory-assets/connectors/sharepoint.js +15 -15
- package/dist/factory-assets/connectors/sqlite.js +15 -15
- package/dist/factory-assets/connectors/static-server.js +15 -15
- package/dist/factory-assets/connectors/tunnel.js +15 -15
- package/dist/factory-assets/connectors/webdav.js +15 -15
- package/dist/factory-assets/connectors/xstate-store.js +15 -15
- package/dist/factory-assets/connectors/xstate.js +15 -15
- package/dist/factory-assets/skills/authoring-skaile-assets/SKILL.md +17 -15
- package/dist/factory-assets/skills/authoring-skaile-manifests/SKILL.md +20 -17
- package/dist/factory-assets/skills/skaile-author-asset/SKILL.md +82 -71
- package/dist/factory-assets/skills/skaile-manage-workspace/SKILL.md +17 -11
- package/dist/factory-assets/skills/skailify/SKILL.md +8 -4
- package/dist/{flows-BOB5YA5R.js → flows-DTADYIXH.js} +13 -13
- package/dist/{flows-BOB5YA5R.js.map → flows-DTADYIXH.js.map} +1 -1
- package/dist/{helpers-ZGK4R5MZ.js → helpers-F2RFRT5D.js} +16 -16
- package/dist/{helpers-ZGK4R5MZ.js.map → helpers-F2RFRT5D.js.map} +1 -1
- package/dist/library/index.js +11 -11
- package/dist/library/install.js +3 -2
- package/dist/library/src/config.d.ts +5 -4
- package/dist/library/src/config.d.ts.map +1 -1
- package/dist/library/src/index.d.ts +1 -1
- package/dist/library/src/index.d.ts.map +1 -1
- package/dist/library/src/install/install-from-manifest.d.ts.map +1 -1
- package/dist/library/src/local/install-library-asset.d.ts +3 -2
- package/dist/library/src/local/install-library-asset.d.ts.map +1 -1
- package/dist/library/src/local/library.d.ts.map +1 -1
- package/dist/library/src/manifest-writer.d.ts +6 -0
- package/dist/library/src/manifest-writer.d.ts.map +1 -1
- package/dist/library/src/sync/git-driver.d.ts +8 -0
- package/dist/library/src/sync/git-driver.d.ts.map +1 -1
- package/dist/{library-publish-RIP6NBYA.js → library-publish-62RFU74A.js} +47 -26
- package/dist/library-publish-62RFU74A.js.map +1 -0
- package/dist/{open-library-4IJTBVTR.js → open-library-NVG3CZUO.js} +19 -19
- package/dist/{open-library-4IJTBVTR.js.map → open-library-NVG3CZUO.js.map} +1 -1
- package/dist/open-registry-IYH6W6CN.js +32 -0
- package/dist/{open-registry-G5DI4RPU.js.map → open-registry-IYH6W6CN.js.map} +1 -1
- package/dist/paths-STQO4FYF.js +22 -0
- package/dist/{paths-L5XLUC3D.js.map → paths-STQO4FYF.js.map} +1 -1
- package/dist/{plugin-store-QENDYZ63.js → plugin-store-2DTEIJTG.js} +10 -10
- package/dist/{plugin-store-QENDYZ63.js.map → plugin-store-2DTEIJTG.js.map} +1 -1
- package/dist/{project-4INCIIZI.js → project-44LM6SRV.js} +18 -17
- package/dist/{project-4INCIIZI.js.map → project-44LM6SRV.js.map} +1 -1
- package/dist/resolver/index.js +9 -9
- package/dist/runner/index.js +25 -25
- package/dist/sdk/asset-manager.js +13 -13
- package/dist/sdk/bridge.js +12 -12
- package/dist/sdk/core.js +8 -8
- package/dist/sdk/flow.js +9 -9
- package/dist/sdk/index.js +25 -25
- package/dist/sdk/resolver.js +9 -9
- package/dist/sdk/runner.js +25 -25
- package/dist/secrets/index.js +2 -2
- package/dist/{setup-RG4PJJUW.js → setup-4BV5ZWOZ.js} +24 -23
- package/dist/setup-4BV5ZWOZ.js.map +1 -0
- package/dist/skills-M7OU3WMP.js +26 -0
- package/dist/{skills-CL45F7AG.js.map → skills-M7OU3WMP.js.map} +1 -1
- package/dist/{source-LJOI5AXU.js → source-HTT6CXUP.js} +20 -20
- package/dist/{source-LJOI5AXU.js.map → source-HTT6CXUP.js.map} +1 -1
- package/dist/{source-manifest-publish-QEJML4VS.js → source-manifest-publish-CPXUX3CL.js} +22 -22
- package/dist/{source-manifest-publish-QEJML4VS.js.map → source-manifest-publish-CPXUX3CL.js.map} +1 -1
- package/dist/tui/index.js +25 -25
- package/dist/workspace-plugin/adapters/mcp.js +22 -22
- package/dist/workspace-plugin/adapters/omp.js +14 -14
- package/dist/workspace-plugin/index.js +1 -1
- package/package.json +1 -1
- package/dist/chunk-4YE7OYTB.js.map +0 -1
- package/dist/chunk-B4J4RGNY.js.map +0 -1
- package/dist/chunk-BIMEKYOE.js.map +0 -1
- package/dist/chunk-BZXR6SW5.js +0 -15
- package/dist/chunk-EOGNW74K.js.map +0 -1
- package/dist/chunk-KGGT6MUM.js.map +0 -1
- package/dist/chunk-L257BENF.js.map +0 -1
- package/dist/chunk-LZ5RH6LD.js.map +0 -1
- package/dist/chunk-OABIGSUY.js.map +0 -1
- package/dist/chunk-P2EM6FNQ.js.map +0 -1
- package/dist/chunk-R3QW7CA5.js.map +0 -1
- package/dist/chunk-TLKM4M47.js.map +0 -1
- package/dist/chunk-YRF5CYHR.js.map +0 -1
- package/dist/library-publish-RIP6NBYA.js.map +0 -1
- package/dist/open-registry-G5DI4RPU.js +0 -32
- package/dist/paths-L5XLUC3D.js +0 -22
- package/dist/setup-RG4PJJUW.js.map +0 -1
- package/dist/skills-CL45F7AG.js +0 -26
package/dist/cli/index.js
CHANGED
|
@@ -1,22 +1,24 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import { makeProvidersCommand, loadRegistryView, addProviderEntry, ProviderRegistryWriteError } from '../chunk-
|
|
3
|
-
import { makeSourceCommand, syncProjectSources } from '../chunk-
|
|
4
|
-
import { AI_RESOURCES } from '../chunk-
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import '../chunk-
|
|
14
|
-
import '../chunk-
|
|
2
|
+
import { makeProvidersCommand, loadRegistryView, addProviderEntry, ProviderRegistryWriteError } from '../chunk-OANSNVCP.js';
|
|
3
|
+
import { makeSourceCommand, syncProjectSources } from '../chunk-QK756IRJ.js';
|
|
4
|
+
import { AI_RESOURCES } from '../chunk-ZUZ5LLZ2.js';
|
|
5
|
+
import { checkSkillManifest } from '../chunk-UKDFOOEG.js';
|
|
6
|
+
import { getStoreConfig, storeFetch, deviceLogin, loadStoreAuthConfig, logout, hasStoredAuth, isStoreAuthenticated, getStoreToken, getStoreIdentity, assetEntryRef, refFor } from '../chunk-A67BHJCH.js';
|
|
7
|
+
import { makeInstallCommand, makeCheckCommand, makeCleanCommand, reportInstalledSoftDeps } from '../chunk-7KITVWXK.js';
|
|
8
|
+
import { createSpinner } from '../chunk-NESV47MF.js';
|
|
9
|
+
import { openCatalogSource, openLibraryManager, openLibrary } from '../chunk-JF26V3BC.js';
|
|
10
|
+
import { logErr, S, logOk, logInfo, logWarn, TARGET_DEFAULT_HINT, warnLegacyClaudeCopies, kindColorPad, kindColor, colorRef, formatSoftDepSection, bareSoftDepName, formatSoftDepHint, formatRelativeTime, formatSoftDepRemovePreview, formatSoftDepAddPreview, fitWidth, KIND_COL_WIDTH } from '../chunk-JEA32KB6.js';
|
|
11
|
+
import { createFullRegistry } from '../chunk-5NH3U6N5.js';
|
|
12
|
+
import { LocalSecretsProvider } from '../chunk-HTKZ4AOW.js';
|
|
13
|
+
import { runAgentChat, loadSessionById, loadSession, listSessions, setCurrentSession, deleteSession, clearSession, loadAgentManifest, compileComposition, MarkdownStreamer, resolveMixin } from '../chunk-VETH6MDG.js';
|
|
14
|
+
import { buildClaudePluginFiles } from '../chunk-DTV7HL5R.js';
|
|
15
|
+
import '../chunk-BHUHGLNS.js';
|
|
16
|
+
import '../chunk-XMQAV6T3.js';
|
|
15
17
|
import '../chunk-R6O6YWU7.js';
|
|
16
|
-
import '../chunk-
|
|
17
|
-
import '../chunk-
|
|
18
|
+
import '../chunk-GCYD4EGY.js';
|
|
19
|
+
import '../chunk-JELTQ4H7.js';
|
|
18
20
|
import '../chunk-4ZTPYIBE.js';
|
|
19
|
-
import '../chunk-
|
|
21
|
+
import '../chunk-OXE5A6H6.js';
|
|
20
22
|
import '../chunk-X5YPJV4N.js';
|
|
21
23
|
import '../chunk-O7SG5PC2.js';
|
|
22
24
|
import '../chunk-7QBNJTTQ.js';
|
|
@@ -25,53 +27,53 @@ import '../chunk-5LKOAX7I.js';
|
|
|
25
27
|
import '../chunk-32NA4TVC.js';
|
|
26
28
|
import '../chunk-W3UDISS2.js';
|
|
27
29
|
import '../chunk-HCYS7GFP.js';
|
|
28
|
-
import { runFlow, resumeFlow } from '../chunk-
|
|
30
|
+
import { runFlow, resumeFlow } from '../chunk-SQBPE66C.js';
|
|
29
31
|
import '../chunk-4R6DROGN.js';
|
|
30
|
-
import { validateFlowVersions, parseSkillFrontmatter } from '../chunk-
|
|
31
|
-
import '../chunk-
|
|
32
|
+
import { validateFlowVersions, parseSkillFrontmatter } from '../chunk-JAJG4G5E.js';
|
|
33
|
+
import '../chunk-JKWU6ULI.js';
|
|
32
34
|
import '../chunk-CT6NQSA4.js';
|
|
33
|
-
import '../chunk-
|
|
35
|
+
import '../chunk-ONWTPXVU.js';
|
|
34
36
|
import '../chunk-QMWMSZQ4.js';
|
|
35
|
-
import '../chunk-
|
|
36
|
-
import '../chunk-
|
|
37
|
-
import '../chunk-
|
|
37
|
+
import '../chunk-RD6GE4HU.js';
|
|
38
|
+
import '../chunk-IDUGP4V7.js';
|
|
39
|
+
import '../chunk-LAI7X6I2.js';
|
|
38
40
|
import '../chunk-EINLFFP6.js';
|
|
39
41
|
import '../chunk-LOO5CB5M.js';
|
|
40
42
|
import '../chunk-BNUZEYC3.js';
|
|
41
|
-
import '../chunk-
|
|
43
|
+
import '../chunk-LUBS5DXY.js';
|
|
42
44
|
import '../chunk-XBSQ4KMC.js';
|
|
43
45
|
import '../chunk-YROR332M.js';
|
|
44
|
-
import { getProviderPreset, AI_PROVIDER_PRESETS } from '../chunk-
|
|
46
|
+
import { getProviderPreset, AI_PROVIDER_PRESETS } from '../chunk-AE42DHSH.js';
|
|
45
47
|
import '../chunk-6E6PKKAD.js';
|
|
46
48
|
import '../chunk-IFGTRL2I.js';
|
|
47
|
-
import { projectAiAssetsRoots, loadFlow, loadAllFlowEntries, findFlowFileInRoots } from '../chunk-
|
|
49
|
+
import { projectAiAssetsRoots, loadFlow, loadAllFlowEntries, findFlowFileInRoots } from '../chunk-UAAAERXI.js';
|
|
48
50
|
import '../chunk-37FTLYFP.js';
|
|
49
51
|
import '../chunk-QZLWJETK.js';
|
|
50
52
|
import '../chunk-XUUYAS3Z.js';
|
|
51
53
|
import { nodeLabel, nodeSkillAsset, nodeIsInert, nodeIsOptional, nodeRunKind, flowSkillVersionPins } from '../chunk-NFGRW3L7.js';
|
|
52
54
|
import '../chunk-QCI6D7E4.js';
|
|
53
55
|
import '../chunk-K2K7OF4P.js';
|
|
54
|
-
import { AssetManager, NON_DEPLOYABLE_KINDS, MissingManifestError, parseRefTolerant, normalizeRepoUrl, FACTORY_SOURCE_URL } from '../chunk-
|
|
55
|
-
import { cloneOrInitGitRepo, ensureGitRepo,
|
|
56
|
-
import '../chunk-
|
|
57
|
-
import '../chunk-
|
|
56
|
+
import { AssetManager, NON_DEPLOYABLE_KINDS, MissingManifestError, parseRefTolerant, normalizeRepoUrl, FACTORY_SOURCE_URL } from '../chunk-BATL2CWI.js';
|
|
57
|
+
import { cloneOrInitGitRepo, ensureGitRepo, setManifestPublisher, syncManifestWithDisk, isGitRepo, assertManifestEditable, installLibraryAsset, missingRootAssets, stampManifestPublisher, upsertManifestAsset, getStoreManifestsDir, getDefaultValue, isSecretPlaceholder } from '../chunk-Y5OCUOXF.js';
|
|
58
|
+
import { parseManifestFile } from '../chunk-Y7UBRRKG.js';
|
|
59
|
+
import '../chunk-VKSA2CDJ.js';
|
|
58
60
|
import '../chunk-R7FOF242.js';
|
|
59
61
|
import '../chunk-ZDKJHQY2.js';
|
|
60
|
-
import '../chunk-
|
|
62
|
+
import '../chunk-37DN45RR.js';
|
|
61
63
|
import '../chunk-CGYEHQOX.js';
|
|
62
|
-
import { resolveSettings, globalSettingsPath, projectSettingsPath, loadSettings, saveSettings, WorkspaceYamlEditor, resolveLibraryDir, checkAgentSkillConformance, readLock, workspaceProviderRegistryPath, userProviderRegistryPath, loadProviderRegistryFile, aiResourceRoots } from '../chunk-
|
|
64
|
+
import { resolveSettings, globalSettingsPath, projectSettingsPath, loadSettings, saveSettings, WorkspaceYamlEditor, resolveLibraryDir, checkAgentSkillConformance, globalInstallDir, GLOBAL_INSTALL_DIR_NAME, readLock, workspaceProviderRegistryPath, userProviderRegistryPath, loadProviderRegistryFile, aiResourceRoots } from '../chunk-QEXEHXX5.js';
|
|
63
65
|
import '../chunk-4GY63JU6.js';
|
|
64
|
-
import { factoryAssetRoots } from '../chunk-
|
|
65
|
-
import '../chunk-
|
|
66
|
+
import { factoryAssetRoots } from '../chunk-JCATNLY3.js';
|
|
67
|
+
import '../chunk-XGIS325V.js';
|
|
66
68
|
import { DEFAULT_DRIVER_ID, DRIVER_DEFAULTS } from '../chunk-5BEFNLOR.js';
|
|
67
69
|
import { findKindDirs } from '../chunk-A2ULN3KX.js';
|
|
68
|
-
import { sourceCacheKey, getGlobalCacheDir, resolveAgentDir, AgentRefResolutionError, matchPin, coerceVersion, loadSkWorkspaceConfig, resolveSkWorkspaceConfig, storeManifestSlug, isWorkspaceConfigFilename } from '../chunk-
|
|
69
|
-
import { globalCacheRoot, globalSkaileDir } from '../chunk-
|
|
70
|
+
import { sourceCacheKey, getGlobalCacheDir, resolveAgentDir, AgentRefResolutionError, matchPin, coerceVersion, loadSkWorkspaceConfig, resolveSkWorkspaceConfig, storeManifestSlug, isWorkspaceConfigFilename } from '../chunk-6IGFSUTE.js';
|
|
71
|
+
import { globalCacheRoot, globalSkaileDir, userConfigPath } from '../chunk-MFHKHXDE.js';
|
|
70
72
|
import { SUPPORTED_DRIVER_TARGETS } from '../chunk-TOSHZX4C.js';
|
|
71
|
-
import { loadSkPublishManifest, SKAILE_MANIFEST_FILENAME, decodeSkaileManifest } from '../chunk-
|
|
73
|
+
import { loadSkPublishManifest, SKAILE_MANIFEST_FILENAME, decodeSkaileManifest } from '../chunk-SR4RFKHM.js';
|
|
72
74
|
import { pluginTitle } from '../chunk-RVRB27AN.js';
|
|
73
|
-
import { parseFrontmatter, scanDirectory } from '../chunk-
|
|
74
|
-
import { parseAssetRef, ASSET_KINDS, isValidAssetName, slugifyAssetName, ASSET_NAME_HINT, assetRefToStr } from '../chunk-
|
|
75
|
+
import { parseFrontmatter, scanDirectory } from '../chunk-LFMX2UEF.js';
|
|
76
|
+
import { parseAssetRef, ASSET_KINDS, isValidAssetName, slugifyAssetName, ASSET_NAME_HINT, assetRefToStr } from '../chunk-WX74MVNA.js';
|
|
75
77
|
import { portableSpawn, portableSpawnSync } from '../chunk-ICSCSM5D.js';
|
|
76
78
|
import { openSqlite } from '../chunk-JMKB7IB4.js';
|
|
77
79
|
import { parseModelRef, resolveEntryBaseUrl } from '../chunk-MJHSLODD.js';
|
|
@@ -80,22 +82,22 @@ import '../chunk-BOFL7GIF.js';
|
|
|
80
82
|
import '../chunk-KTBKW2FI.js';
|
|
81
83
|
import '../chunk-UQ6LFBPZ.js';
|
|
82
84
|
import '../chunk-TNWXGHLD.js';
|
|
83
|
-
import { validatePreset
|
|
85
|
+
import { validatePreset } from '../chunk-5CYEWBPB.js';
|
|
84
86
|
import '../chunk-NSBPE2FW.js';
|
|
85
|
-
import * as
|
|
86
|
-
import
|
|
87
|
-
import * as
|
|
88
|
-
import
|
|
87
|
+
import * as fs12 from 'fs';
|
|
88
|
+
import fs12__default, { readFileSync, existsSync, mkdirSync, writeFileSync, lstatSync, rmSync, readdirSync, statSync } from 'fs';
|
|
89
|
+
import * as path36 from 'path';
|
|
90
|
+
import path36__default, { resolve, join } from 'path';
|
|
89
91
|
import { fileURLToPath } from 'url';
|
|
90
92
|
import { Help, Command, Option } from 'commander';
|
|
91
93
|
import { rcompare } from 'semver';
|
|
92
|
-
import * as
|
|
94
|
+
import * as p4 from '@clack/prompts';
|
|
93
95
|
import pc5 from 'picocolors';
|
|
94
|
-
import * as os from 'os';
|
|
95
96
|
import { parse, stringify, parseDocument } from 'yaml';
|
|
97
|
+
import * as os from 'os';
|
|
96
98
|
import * as readline from 'readline';
|
|
97
99
|
import { createInterface } from 'readline';
|
|
98
|
-
import
|
|
100
|
+
import fs6 from 'fs/promises';
|
|
99
101
|
import { parse as parse$1, stringify as stringify$1 } from 'smol-toml';
|
|
100
102
|
import { execSync, spawnSync } from 'child_process';
|
|
101
103
|
import * as readline2 from 'readline/promises';
|
|
@@ -132,10 +134,14 @@ async function runSearch(kind, query, opts) {
|
|
|
132
134
|
query = kind;
|
|
133
135
|
kind = void 0;
|
|
134
136
|
}
|
|
137
|
+
if (kind && query === void 0 && !ASSET_KINDS.includes(kind)) {
|
|
138
|
+
query = kind;
|
|
139
|
+
kind = void 0;
|
|
140
|
+
}
|
|
135
141
|
const showLocal = !opts.store;
|
|
136
142
|
const showStore = !opts.local;
|
|
137
143
|
const { resolveConfig } = await import('../library/index.js');
|
|
138
|
-
const airGapped = resolveConfig({ projectDir:
|
|
144
|
+
const airGapped = resolveConfig({ projectDir: path36__default.resolve(opts.projectDir) }).catalog.cache_ttl === 0;
|
|
139
145
|
if (showLocal) {
|
|
140
146
|
await searchLocal(query, kind, opts, showStore, airGapped);
|
|
141
147
|
}
|
|
@@ -144,7 +150,7 @@ async function runSearch(kind, query, opts) {
|
|
|
144
150
|
}
|
|
145
151
|
}
|
|
146
152
|
async function searchIndex(query, kind) {
|
|
147
|
-
const { openLibrary: openLibrary2 } = await import('../open-library-
|
|
153
|
+
const { openLibrary: openLibrary2 } = await import('../open-library-NVG3CZUO.js');
|
|
148
154
|
const library = await openLibrary2();
|
|
149
155
|
try {
|
|
150
156
|
const defs = await library.listAssetDefs(kind ? { kind } : {});
|
|
@@ -176,8 +182,8 @@ async function searchIndex(query, kind) {
|
|
|
176
182
|
}
|
|
177
183
|
}
|
|
178
184
|
async function searchFactory(projectDir, query, kind) {
|
|
179
|
-
const prefixes = factoryAssetRoots().map((r) => r.endsWith(
|
|
180
|
-
const isFactoryPath = (
|
|
185
|
+
const prefixes = factoryAssetRoots().map((r) => r.endsWith(path36__default.sep) ? r : r + path36__default.sep);
|
|
186
|
+
const isFactoryPath = (p6) => prefixes.some((fp) => p6 === fp.slice(0, -1) || p6.startsWith(fp));
|
|
181
187
|
try {
|
|
182
188
|
const entries = await new AssetManager({ projectDir }).search(query, kind);
|
|
183
189
|
return entries.filter((e) => isFactoryPath(e.source));
|
|
@@ -193,11 +199,11 @@ function unionEntries(indexed, factory) {
|
|
|
193
199
|
return [...indexed, ...factory.filter((e) => !seen.has(entryDedupKey(e)))];
|
|
194
200
|
}
|
|
195
201
|
async function searchLocal(query, kind, opts, showStore, airGapped) {
|
|
196
|
-
const projectDir =
|
|
202
|
+
const projectDir = path36__default.resolve(opts.projectDir);
|
|
197
203
|
const factory = await searchFactory(projectDir, query, kind);
|
|
198
204
|
let entries = unionEntries(await searchIndex(query, kind), factory);
|
|
199
205
|
if (entries.length === 0 && !query && !kind && !airGapped) {
|
|
200
|
-
const { autoSyncForSearch } = await import('../source-
|
|
206
|
+
const { autoSyncForSearch } = await import('../source-HTT6CXUP.js');
|
|
201
207
|
if (await autoSyncForSearch(projectDir)) {
|
|
202
208
|
entries = unionEntries(await searchIndex(query, kind), factory);
|
|
203
209
|
}
|
|
@@ -216,31 +222,70 @@ async function searchLocal(query, kind, opts, showStore, airGapped) {
|
|
|
216
222
|
}
|
|
217
223
|
printLocalEntries(entries);
|
|
218
224
|
}
|
|
225
|
+
var MIN_LOCAL_DESCRIPTION_WIDTH = 10;
|
|
226
|
+
function layoutLocalTable(rows, width, style = {}) {
|
|
227
|
+
const styleRef = style.ref ?? ((s) => s);
|
|
228
|
+
const styleVer = style.version ?? ((s) => s);
|
|
229
|
+
const gap = COLUMN_GAP.length;
|
|
230
|
+
const indent = 2;
|
|
231
|
+
const pad = " ".repeat(indent);
|
|
232
|
+
const nameW = Math.max(4, ...rows.map((r) => r.ref.length));
|
|
233
|
+
const verW = Math.max(0, ...rows.map((r) => r.version.length));
|
|
234
|
+
const verSpan = verW > 0 ? gap + verW : 0;
|
|
235
|
+
const refCell = (ref) => styleRef(ref) + " ".repeat(nameW - ref.length);
|
|
236
|
+
const lines = [];
|
|
237
|
+
const descW = width - (indent + nameW + gap + verSpan);
|
|
238
|
+
if (descW >= MIN_LOCAL_DESCRIPTION_WIDTH) {
|
|
239
|
+
for (const r of rows) {
|
|
240
|
+
const desc = truncateText(r.description, descW);
|
|
241
|
+
const descCell = verW > 0 ? desc.padEnd(descW) : desc;
|
|
242
|
+
lines.push(
|
|
243
|
+
`${pad}${refCell(r.ref)}${COLUMN_GAP}${descCell}${r.version ? `${COLUMN_GAP}${styleVer(r.version)}` : ""}`
|
|
244
|
+
);
|
|
245
|
+
}
|
|
246
|
+
return { ruleWidth: nameW + gap + descW + verSpan, lines };
|
|
247
|
+
}
|
|
248
|
+
if (indent + nameW + verSpan <= width) {
|
|
249
|
+
for (const r of rows) {
|
|
250
|
+
lines.push(
|
|
251
|
+
verW > 0 ? `${pad}${refCell(r.ref)}${r.version ? `${COLUMN_GAP}${styleVer(r.version)}` : ""}` : `${pad}${styleRef(r.ref)}`
|
|
252
|
+
);
|
|
253
|
+
}
|
|
254
|
+
return { ruleWidth: nameW + verSpan, lines };
|
|
255
|
+
}
|
|
256
|
+
const subPad = " ".repeat(indent + 2);
|
|
257
|
+
const subDescW = width - (indent + 2) - verSpan;
|
|
258
|
+
for (const r of rows) {
|
|
259
|
+
lines.push(`${pad}${styleRef(r.ref)}`);
|
|
260
|
+
const desc = subDescW >= MIN_LOCAL_DESCRIPTION_WIDTH ? truncateText(r.description, subDescW) : "";
|
|
261
|
+
const descCell = r.version && desc ? desc.padEnd(subDescW) : desc;
|
|
262
|
+
const parts = [descCell, r.version ? styleVer(r.version) : ""].filter((s) => s !== "");
|
|
263
|
+
if (parts.length > 0) lines.push(`${subPad}${parts.join(COLUMN_GAP)}`);
|
|
264
|
+
}
|
|
265
|
+
return { ruleWidth: Math.max(1, Math.min(nameW, width - indent)), lines };
|
|
266
|
+
}
|
|
219
267
|
function printLocalEntries(entries, width = terminalWidth()) {
|
|
220
268
|
const byKind = /* @__PURE__ */ new Map();
|
|
221
269
|
for (const e of entries) {
|
|
222
270
|
if (!byKind.has(e.kind)) byKind.set(e.kind, []);
|
|
223
271
|
byKind.get(e.kind).push(e);
|
|
224
272
|
}
|
|
225
|
-
const verOf = (e) => e.version ? `v${e.version}` : "";
|
|
226
273
|
for (const [k, items] of byKind) {
|
|
227
|
-
const
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
274
|
+
const { ruleWidth, lines } = layoutLocalTable(
|
|
275
|
+
items.map((e) => ({
|
|
276
|
+
ref: localEntryRef(e),
|
|
277
|
+
description: e.description,
|
|
278
|
+
version: e.version ? `v${e.version}` : ""
|
|
279
|
+
})),
|
|
280
|
+
width,
|
|
281
|
+
{ ref: S.cmd, version: S.dim }
|
|
282
|
+
);
|
|
231
283
|
console.log();
|
|
232
284
|
console.log(
|
|
233
285
|
` ${kindColor(k)} ${S.heading(`${k.toUpperCase()}S`)} ${S.dim(`(${items.length})`)}`
|
|
234
286
|
);
|
|
235
|
-
console.log(` ${S.rule(
|
|
236
|
-
for (const
|
|
237
|
-
const desc = truncateText(e.description, descW);
|
|
238
|
-
const ver = verOf(e);
|
|
239
|
-
const descCell = ver ? desc.padEnd(descW) : desc;
|
|
240
|
-
console.log(
|
|
241
|
-
` ${S.cmd(localEntryRef(e).padEnd(nameW))}${COLUMN_GAP}${descCell}${ver ? `${COLUMN_GAP}${S.dim(ver)}` : ""}`
|
|
242
|
-
);
|
|
243
|
-
}
|
|
287
|
+
console.log(` ${S.rule(Math.max(1, Math.min(ruleWidth, width - 2)))}`);
|
|
288
|
+
for (const line of lines) console.log(line);
|
|
244
289
|
}
|
|
245
290
|
console.log(`
|
|
246
291
|
${S.dim(`${entries.length} total`)}
|
|
@@ -267,9 +312,9 @@ async function searchStore(query, kind, opts, airGapped) {
|
|
|
267
312
|
logInfo("air-gapped (cache_ttl: 0) \u2014 local sources only");
|
|
268
313
|
return;
|
|
269
314
|
}
|
|
270
|
-
const { openCatalogSource: openCatalogSource2, LocalCatalogDisabledError } = await import('../open-library-
|
|
315
|
+
const { openCatalogSource: openCatalogSource2, LocalCatalogDisabledError } = await import('../open-library-NVG3CZUO.js');
|
|
271
316
|
try {
|
|
272
|
-
const remote = await openCatalogSource2({ projectDir:
|
|
317
|
+
const remote = await openCatalogSource2({ projectDir: path36__default.resolve(opts.projectDir) });
|
|
273
318
|
const assets = await remote.listAssets(kind ? { kind } : {});
|
|
274
319
|
const results = filterCatalogAssets(assets, query);
|
|
275
320
|
if (results.length > 0) {
|
|
@@ -293,7 +338,7 @@ async function searchStore(query, kind, opts, airGapped) {
|
|
|
293
338
|
}
|
|
294
339
|
}
|
|
295
340
|
function makeSearchCommand() {
|
|
296
|
-
return new Command("search").description("Search across all repos").argument("[kind]", "Filter by asset kind").argument("[query]", "Search query").option("--project-dir <path>", "Project directory", process.cwd()).option("--store", "Search only the store").option("--local", "Search only local repos").action(async (kind, query, opts) => {
|
|
341
|
+
return new Command("search").description("Search across all repos").argument("[kind]", "Filter by asset kind (a single non-kind argument is the query)").argument("[query]", "Search query").option("--project-dir <path>", "Project directory", process.cwd()).option("--store", "Search only the store").option("--local", "Search only local repos").action(async (kind, query, opts) => {
|
|
297
342
|
await runSearch(kind, query, opts);
|
|
298
343
|
});
|
|
299
344
|
}
|
|
@@ -385,23 +430,27 @@ function makeAddCommand() {
|
|
|
385
430
|
}
|
|
386
431
|
const harnesses = parseHarnessFilter(opts.harness);
|
|
387
432
|
const am2 = new AssetManager({
|
|
388
|
-
projectDir:
|
|
433
|
+
projectDir: path36__default.resolve(opts.projectDir),
|
|
389
434
|
global: opts.global || harnesses !== void 0,
|
|
390
435
|
harnesses,
|
|
391
436
|
driverTarget: opts.target
|
|
392
437
|
});
|
|
393
|
-
const
|
|
394
|
-
|
|
438
|
+
const spinner = createSpinner();
|
|
439
|
+
spinner.start(`Adding ${ref}`);
|
|
395
440
|
try {
|
|
396
|
-
const
|
|
397
|
-
|
|
441
|
+
const libraryOf = /* @__PURE__ */ new Map();
|
|
442
|
+
const added = await am2.add(ref, {
|
|
443
|
+
link: opts.link,
|
|
444
|
+
onLibraryOrigin: (deployedRef, library) => libraryOf.set(deployedRef, library)
|
|
445
|
+
});
|
|
446
|
+
spinner.stop("Done");
|
|
398
447
|
await promptSoftDepAdds(am2, ref, {
|
|
399
448
|
isTTY: !!process.stdin.isTTY,
|
|
400
449
|
link: opts.link,
|
|
401
450
|
withSoftDeps: opts.withSoftDeps,
|
|
402
451
|
noSoftDeps: opts.softDeps === false,
|
|
403
|
-
confirm: (message) =>
|
|
404
|
-
isCancel:
|
|
452
|
+
confirm: (message) => p4.confirm({ message, initialValue: false }),
|
|
453
|
+
isCancel: p4.isCancel,
|
|
405
454
|
onAdded: logOk,
|
|
406
455
|
onError: logErr,
|
|
407
456
|
onHint: (line) => logInfo(S.dim(line))
|
|
@@ -413,10 +462,15 @@ function makeAddCommand() {
|
|
|
413
462
|
`Recorded in skaile.yaml${kind === "mcp-server" ? " (bytes fetched + verified into .skaile/cache/store)" : ""}. ${kind} assets are not deployed into the driver target \u2014 they are wired when skaile runs the agent.`
|
|
414
463
|
);
|
|
415
464
|
else logInfo("Nothing to deploy (already up to date).");
|
|
416
|
-
} else
|
|
465
|
+
} else {
|
|
466
|
+
for (const a of added) {
|
|
467
|
+
const library = libraryOf.get(a);
|
|
468
|
+
logOk(library ? `${a} (library ${library})` : a);
|
|
469
|
+
}
|
|
470
|
+
}
|
|
417
471
|
await reportBundleMembership(am2, ref, (line) => logInfo(S.dim(line)));
|
|
418
472
|
} catch (err) {
|
|
419
|
-
|
|
473
|
+
spinner.stop("Failed");
|
|
420
474
|
logErr(String(err));
|
|
421
475
|
process.exit(1);
|
|
422
476
|
}
|
|
@@ -429,7 +483,7 @@ function makeRemoveCommand() {
|
|
|
429
483
|
).option("--target <agent>", `Driver target (${TARGET_DEFAULT_HINT})`).option("--no-soft-deps", "skip the orphaned-soft-dep prompt (don't remove, don't report)").action(async (ref, opts) => {
|
|
430
484
|
const harnesses = parseHarnessFilter(opts.harness);
|
|
431
485
|
const am2 = new AssetManager({
|
|
432
|
-
projectDir:
|
|
486
|
+
projectDir: path36__default.resolve(opts.projectDir),
|
|
433
487
|
global: opts.global || harnesses !== void 0,
|
|
434
488
|
harnesses,
|
|
435
489
|
driverTarget: opts.target
|
|
@@ -443,8 +497,8 @@ function makeRemoveCommand() {
|
|
|
443
497
|
await promptSoftDepRemovals(am2, ref, {
|
|
444
498
|
isTTY: !!process.stdin.isTTY,
|
|
445
499
|
noSoftDeps: opts.softDeps === false,
|
|
446
|
-
confirm: (message) =>
|
|
447
|
-
isCancel:
|
|
500
|
+
confirm: (message) => p4.confirm({ message, initialValue: false }),
|
|
501
|
+
isCancel: p4.isCancel,
|
|
448
502
|
onRemoved: logOk,
|
|
449
503
|
onHint: (line) => logInfo(S.dim(line))
|
|
450
504
|
});
|
|
@@ -471,7 +525,7 @@ function makeListCommand() {
|
|
|
471
525
|
return;
|
|
472
526
|
}
|
|
473
527
|
const am2 = new AssetManager({
|
|
474
|
-
projectDir:
|
|
528
|
+
projectDir: path36__default.resolve(opts.projectDir),
|
|
475
529
|
driverTarget: opts.target
|
|
476
530
|
});
|
|
477
531
|
let declared;
|
|
@@ -518,7 +572,7 @@ function makeListCommand() {
|
|
|
518
572
|
}
|
|
519
573
|
function runGlobalList(kind, opts, harnesses) {
|
|
520
574
|
const am2 = new AssetManager({
|
|
521
|
-
projectDir:
|
|
575
|
+
projectDir: path36__default.resolve(opts.projectDir),
|
|
522
576
|
global: true,
|
|
523
577
|
harnesses
|
|
524
578
|
});
|
|
@@ -589,7 +643,7 @@ async function resolveInfoEntry(am2, ref, opts) {
|
|
|
589
643
|
return { entry: match ?? deployed };
|
|
590
644
|
}
|
|
591
645
|
const lookup = opts.storeLookup ?? (async (filter) => {
|
|
592
|
-
const { resolveCatalogSource } = await import('../open-library-
|
|
646
|
+
const { resolveCatalogSource } = await import('../open-library-NVG3CZUO.js');
|
|
593
647
|
const { source, close } = await resolveCatalogSource({ projectDir: opts.projectDir });
|
|
594
648
|
try {
|
|
595
649
|
return await source.listAssets(filter);
|
|
@@ -605,7 +659,7 @@ async function resolveInfoEntry(am2, ref, opts) {
|
|
|
605
659
|
);
|
|
606
660
|
return { entry: hit ? catalogAssetToEntry(hit) : null };
|
|
607
661
|
} catch (err) {
|
|
608
|
-
const { LocalCatalogDisabledError } = await import('../open-library-
|
|
662
|
+
const { LocalCatalogDisabledError } = await import('../open-library-NVG3CZUO.js');
|
|
609
663
|
const storeNote = err instanceof Error ? err.message : String(err);
|
|
610
664
|
const disabled = err instanceof LocalCatalogDisabledError || /catalog\.url/i.test(storeNote);
|
|
611
665
|
return { entry: null, storeNote, ...disabled ? { storeDisabled: true } : {} };
|
|
@@ -616,12 +670,12 @@ function infoNotFoundHint(ref, lookup) {
|
|
|
616
670
|
if (!lookup.storeNote)
|
|
617
671
|
return `'${ref}' not found in local sources, deployed assets, or the store. ${sync}, or ${S.cmd("skaile search --store")} to browse the store.`;
|
|
618
672
|
if (lookup.storeDisabled)
|
|
619
|
-
return `'${ref}' not found in local sources or deployed assets, and the remote store is disabled (${lookup.storeNote}). ${sync}, or set ${S.cmd("catalog.url")} in
|
|
673
|
+
return `'${ref}' not found in local sources or deployed assets, and the remote store is disabled (${lookup.storeNote}). ${sync}, or set ${S.cmd("catalog.url")} in ${userConfigPath()} to query the store.`;
|
|
620
674
|
return `'${ref}' not found locally and the store could not be queried (${lookup.storeNote}). ${sync}, or retry when the store is reachable.`;
|
|
621
675
|
}
|
|
622
676
|
function makeInfoCommand() {
|
|
623
677
|
return new Command("info").description("Show asset metadata, deps, deploy status").argument("<ref>", "Asset reference (kind:name)").option("--project-dir <path>", "Project directory", process.cwd()).action(async (ref, opts) => {
|
|
624
|
-
const projectDir =
|
|
678
|
+
const projectDir = path36__default.resolve(opts.projectDir);
|
|
625
679
|
const am2 = new AssetManager({ projectDir });
|
|
626
680
|
const lookup = await resolveInfoEntry(am2, ref, { projectDir });
|
|
627
681
|
const entry = lookup.entry;
|
|
@@ -657,7 +711,7 @@ function makeCreateCommand() {
|
|
|
657
711
|
new Option("-k, --kind <kind>", "Asset kind").default("skill").choices([...ASSET_KINDS])
|
|
658
712
|
).option("-d, --dir <dir>", "Target directory (default: cwd)").action((name, opts) => {
|
|
659
713
|
const am2 = new AssetManager({ projectDir: process.cwd() });
|
|
660
|
-
const destDir = opts.dir ?
|
|
714
|
+
const destDir = opts.dir ? path36__default.resolve(opts.dir) : process.cwd();
|
|
661
715
|
const result = am2.create(name, opts.kind, destDir);
|
|
662
716
|
if (result.ok) logOk(`Created ${kindColor(opts.kind)}: ${pc5.dim(result.path)}`);
|
|
663
717
|
else {
|
|
@@ -668,7 +722,7 @@ function makeCreateCommand() {
|
|
|
668
722
|
}
|
|
669
723
|
function makeDoctorCommand() {
|
|
670
724
|
return new Command("doctor").description("Scan for missing dependency chains").argument("[name]", "Check a specific asset (kind:name)").option("--project-dir <path>", "Project directory", process.cwd()).action(async (name, opts) => {
|
|
671
|
-
const am2 = new AssetManager({ projectDir:
|
|
725
|
+
const am2 = new AssetManager({ projectDir: path36__default.resolve(opts.projectDir) });
|
|
672
726
|
const issues = await am2.doctor();
|
|
673
727
|
if (issues.length === 0) {
|
|
674
728
|
logOk("No missing dependencies.");
|
|
@@ -690,27 +744,145 @@ function makeDoctorCommand() {
|
|
|
690
744
|
console.log();
|
|
691
745
|
});
|
|
692
746
|
}
|
|
747
|
+
async function indexLibrary(lib, index) {
|
|
748
|
+
const { LocalCatalogSource } = await import('../library/index.js');
|
|
749
|
+
const own = index ?? await openLibrary();
|
|
750
|
+
try {
|
|
751
|
+
const source = new LocalCatalogSource(own, lib.id, lib.path, createFullRegistry());
|
|
752
|
+
const res = await source.sync();
|
|
753
|
+
return {
|
|
754
|
+
assetsFound: res.assetsFound,
|
|
755
|
+
assetsUpdated: res.assetsUpdated,
|
|
756
|
+
errors: res.errors
|
|
757
|
+
};
|
|
758
|
+
} finally {
|
|
759
|
+
if (!index) own.close();
|
|
760
|
+
}
|
|
761
|
+
}
|
|
762
|
+
function resolveLibraryPublisherDetailed(lib, opts, storeIdentity) {
|
|
763
|
+
const bare = (p6) => p6.startsWith("@") ? p6.slice(1) : p6;
|
|
764
|
+
if (opts.publisher?.trim()) return { publisher: bare(opts.publisher.trim()), source: "flag" };
|
|
765
|
+
const declared = loadSkPublishManifest(lib.path)?.publisher?.trim();
|
|
766
|
+
if (declared) return { publisher: bare(declared), source: "manifest" };
|
|
767
|
+
const identity = (storeIdentity?.githubLogin ?? storeIdentity?.username)?.trim();
|
|
768
|
+
if (identity) return { publisher: identity, source: "identity" };
|
|
769
|
+
try {
|
|
770
|
+
return { publisher: slugifyAssetName(lib.name), source: "library-name" };
|
|
771
|
+
} catch {
|
|
772
|
+
return { publisher: "library", source: "library-name" };
|
|
773
|
+
}
|
|
774
|
+
}
|
|
775
|
+
function resolveLibraryPublisher(lib, opts, storeIdentity) {
|
|
776
|
+
return resolveLibraryPublisherDetailed(lib, opts, storeIdentity).publisher;
|
|
777
|
+
}
|
|
778
|
+
function stampAssetPublisher(assetDir, publisher) {
|
|
779
|
+
const markers = ["SKILL.md", "AGENT.md", "CONTRACT.md"];
|
|
780
|
+
let markerFile;
|
|
781
|
+
for (const m of markers) {
|
|
782
|
+
if (fs12.existsSync(path36.join(assetDir, m))) {
|
|
783
|
+
markerFile = path36.join(assetDir, m);
|
|
784
|
+
break;
|
|
785
|
+
}
|
|
786
|
+
}
|
|
787
|
+
if (!markerFile) {
|
|
788
|
+
const promptMd = fs12.readdirSync(assetDir).find((f) => f.endsWith(".prompt.md"));
|
|
789
|
+
if (promptMd) markerFile = path36.join(assetDir, promptMd);
|
|
790
|
+
}
|
|
791
|
+
if (!markerFile) return;
|
|
792
|
+
try {
|
|
793
|
+
const { data, body } = parseFrontmatter(fs12.readFileSync(markerFile, "utf8"));
|
|
794
|
+
const meta = data.metadata && typeof data.metadata === "object" && !Array.isArray(data.metadata) ? { ...data.metadata } : {};
|
|
795
|
+
if (meta.publisher != null) return;
|
|
796
|
+
meta.publisher = publisher;
|
|
797
|
+
data.metadata = meta;
|
|
798
|
+
const fm = stringify(data).trimEnd();
|
|
799
|
+
fs12.writeFileSync(markerFile, `---
|
|
800
|
+
${fm}
|
|
801
|
+
---
|
|
802
|
+
|
|
803
|
+
${body}
|
|
804
|
+
`, "utf8");
|
|
805
|
+
} catch {
|
|
806
|
+
}
|
|
807
|
+
}
|
|
808
|
+
async function registerLibraryAsset(lib, index, input) {
|
|
809
|
+
const { publisher, source } = resolveLibraryPublisherDetailed(
|
|
810
|
+
lib,
|
|
811
|
+
{ publisher: input.publisher },
|
|
812
|
+
getStoreIdentity()
|
|
813
|
+
);
|
|
814
|
+
if (source === "library-name") {
|
|
815
|
+
logWarn(
|
|
816
|
+
`No publisher given and not signed in \u2014 using the library name "${publisher}" as the publisher. Pass --publisher <name> or run \`skaile store login\`; change it later with \`skaile library set ${lib.name} publisher=<name>\`.`
|
|
817
|
+
);
|
|
818
|
+
}
|
|
819
|
+
stampAssetPublisher(input.assetDir, publisher);
|
|
820
|
+
stampManifestPublisher(lib.path, publisher);
|
|
821
|
+
upsertManifestAsset(lib.path, {
|
|
822
|
+
kind: input.kind,
|
|
823
|
+
name: input.name,
|
|
824
|
+
root: path36.relative(lib.path, input.assetDir) || input.name,
|
|
825
|
+
version: input.version,
|
|
826
|
+
publisher
|
|
827
|
+
});
|
|
828
|
+
const idx = await indexLibrary(lib, index);
|
|
829
|
+
for (const e of idx.errors) logWarn(e);
|
|
830
|
+
return { publisher, ref: refFor(input.kind, publisher, input.name, input.version) };
|
|
831
|
+
}
|
|
832
|
+
var LIBRARY_UPGRADE_DOCS = "https://github.com/skaile-ai/workspaces/blob/main/docs/sections/cli/commands/library.md#upgrading-a-4x-library";
|
|
833
|
+
var DOMAIN_REMOVED_HINT = `Domains were removed in 5.0 \u2014 delete DOMAIN.md files; group assets with .claude-plugin/marketplace.json. See ${LIBRARY_UPGRADE_DOCS}`;
|
|
834
|
+
function countDomainFiles(root) {
|
|
835
|
+
let count = 0;
|
|
836
|
+
const walk = (dir) => {
|
|
837
|
+
let entries;
|
|
838
|
+
try {
|
|
839
|
+
entries = fs12.readdirSync(dir, { withFileTypes: true });
|
|
840
|
+
} catch {
|
|
841
|
+
return;
|
|
842
|
+
}
|
|
843
|
+
for (const entry of entries) {
|
|
844
|
+
if (entry.isDirectory()) {
|
|
845
|
+
if (!entry.name.startsWith(".") && entry.name !== "node_modules") {
|
|
846
|
+
walk(path36.join(dir, entry.name));
|
|
847
|
+
}
|
|
848
|
+
} else if (entry.name === "DOMAIN.md") {
|
|
849
|
+
count++;
|
|
850
|
+
}
|
|
851
|
+
}
|
|
852
|
+
};
|
|
853
|
+
walk(root);
|
|
854
|
+
return count;
|
|
855
|
+
}
|
|
856
|
+
function warnIgnoredDomainFiles(root) {
|
|
857
|
+
const count = countDomainFiles(root);
|
|
858
|
+
if (count > 0) {
|
|
859
|
+
logWarn(
|
|
860
|
+
`${count} DOMAIN.md file(s) are ignored since 5.0 (domains were removed) \u2014 delete them; group assets with .claude-plugin/marketplace.json. See ${LIBRARY_UPGRADE_DOCS}`
|
|
861
|
+
);
|
|
862
|
+
}
|
|
863
|
+
return count;
|
|
864
|
+
}
|
|
693
865
|
var DEFAULT_IMPORT_VERSION = "0.1.0";
|
|
694
866
|
var DEFAULT_IMPORT_STAGE = "alpha";
|
|
695
867
|
function claudeSkillRoots() {
|
|
696
868
|
const roots = [];
|
|
697
869
|
const override = process.env.SKAILE_CLAUDE_SKILLS_DIR;
|
|
698
870
|
if (override) roots.push(override);
|
|
699
|
-
roots.push(
|
|
871
|
+
roots.push(path36.join(os.homedir(), ".claude", "skills"));
|
|
700
872
|
return roots;
|
|
701
873
|
}
|
|
702
874
|
function resolveImportSource(nameOrPath) {
|
|
703
|
-
const asPath =
|
|
704
|
-
if (
|
|
705
|
-
const dir =
|
|
706
|
-
const skillFile =
|
|
707
|
-
if (
|
|
875
|
+
const asPath = path36.resolve(nameOrPath);
|
|
876
|
+
if (fs12.existsSync(asPath)) {
|
|
877
|
+
const dir = fs12.statSync(asPath).isDirectory() ? asPath : path36.dirname(asPath);
|
|
878
|
+
const skillFile = path36.join(dir, "SKILL.md");
|
|
879
|
+
if (fs12.existsSync(skillFile)) return { dir, skillFile, via: "path" };
|
|
708
880
|
}
|
|
709
|
-
if (!nameOrPath.includes(
|
|
881
|
+
if (!nameOrPath.includes(path36.sep) && !nameOrPath.startsWith(".")) {
|
|
710
882
|
for (const root of claudeSkillRoots()) {
|
|
711
|
-
const dir =
|
|
712
|
-
const skillFile =
|
|
713
|
-
if (
|
|
883
|
+
const dir = path36.join(root, nameOrPath);
|
|
884
|
+
const skillFile = path36.join(dir, "SKILL.md");
|
|
885
|
+
if (fs12.existsSync(skillFile)) return { dir, skillFile, via: "claude-skills" };
|
|
714
886
|
}
|
|
715
887
|
}
|
|
716
888
|
return null;
|
|
@@ -740,9 +912,9 @@ function normalizeSkillContent(raw, opts = {}) {
|
|
|
740
912
|
notes.push(`stamped metadata.stage: ${existingMeta.stage}`);
|
|
741
913
|
}
|
|
742
914
|
if (existingMeta.tags == null) {
|
|
743
|
-
const keywords = Array.isArray(data.keywords) ? data.keywords : [];
|
|
744
|
-
|
|
745
|
-
|
|
915
|
+
const keywords = Array.isArray(data.keywords) ? data.keywords.filter((k) => typeof k === "string") : [];
|
|
916
|
+
if (keywords.length > 0) {
|
|
917
|
+
existingMeta.tags = keywords;
|
|
746
918
|
notes.push("promoted top-level keywords \u2192 metadata.tags");
|
|
747
919
|
}
|
|
748
920
|
}
|
|
@@ -787,9 +959,21 @@ async function resolveDefByRef(library, ref, opts) {
|
|
|
787
959
|
function withCanonicalRef(def) {
|
|
788
960
|
return { ref: catalogAssetRef(def), ...def };
|
|
789
961
|
}
|
|
962
|
+
function resolveLibraryOption(opts) {
|
|
963
|
+
if (opts.library && opts.to && opts.library !== opts.to) {
|
|
964
|
+
logErr(
|
|
965
|
+
`Conflicting options: --library "${opts.library}" and --to "${opts.to}". Use --library.`
|
|
966
|
+
);
|
|
967
|
+
process.exit(1);
|
|
968
|
+
}
|
|
969
|
+
return opts.library ?? opts.to;
|
|
970
|
+
}
|
|
790
971
|
function makeAssetCommand() {
|
|
791
972
|
const cmd = new Command("asset").description("Author and install AI assets");
|
|
792
|
-
cmd.command("import <name-or-path>").description("Import + skailify an existing coding-agent skill into a library").option("--
|
|
973
|
+
cmd.command("import <name-or-path>").description("Import + skailify an existing coding-agent skill into a library").option("--library <library>", "Target library (default: auto / personal)").addOption(new Option("--to <library>", "Alias for --library").hideHelp()).option("--version <semver>", "Version to stamp when the skill ships none").option("--stage <stage>", "Lifecycle stage to stamp (default: alpha)").option("--no-normalize", "Copy verbatim \u2014 skip frontmatter normalization").option(
|
|
974
|
+
"--publisher <name>",
|
|
975
|
+
"Publisher for the imported skill (default: the library's, else your store login)"
|
|
976
|
+
).option("--commit", "Auto-commit in git-backed libraries", false).action(
|
|
793
977
|
async (nameOrPath, opts) => {
|
|
794
978
|
const src = resolveImportSource(nameOrPath);
|
|
795
979
|
if (!src) {
|
|
@@ -799,18 +983,19 @@ function makeAssetCommand() {
|
|
|
799
983
|
process.exit(1);
|
|
800
984
|
}
|
|
801
985
|
logInfo(`Source: ${S.dim(src.dir)} (${src.via})`);
|
|
802
|
-
const
|
|
986
|
+
const libraryName = resolveLibraryOption(opts);
|
|
987
|
+
const { manager, library, close } = await openLibraryManager();
|
|
803
988
|
try {
|
|
804
989
|
let target;
|
|
805
|
-
if (
|
|
806
|
-
target = await manager.requireLibrary(
|
|
990
|
+
if (libraryName) {
|
|
991
|
+
target = await manager.requireLibrary(libraryName);
|
|
807
992
|
} else {
|
|
808
993
|
const found = await manager.findDefaultLibrary();
|
|
809
994
|
const def = found && found.ownership !== "reader" ? found : void 0;
|
|
810
995
|
target = def ?? (await manager.ensurePersonalLibrary(resolveLibraryDir())).library;
|
|
811
996
|
}
|
|
812
997
|
if (target.ownership === "reader") {
|
|
813
|
-
logErr(`Library "${target.name}" is read-only (ownership=reader). Choose --
|
|
998
|
+
logErr(`Library "${target.name}" is read-only (ownership=reader). Choose --library.`);
|
|
814
999
|
process.exit(1);
|
|
815
1000
|
}
|
|
816
1001
|
try {
|
|
@@ -819,40 +1004,37 @@ function makeAssetCommand() {
|
|
|
819
1004
|
logErr(err instanceof Error ? err.message : String(err));
|
|
820
1005
|
process.exit(1);
|
|
821
1006
|
}
|
|
822
|
-
const rawSkill =
|
|
1007
|
+
const rawSkill = fs12.readFileSync(src.skillFile, "utf8");
|
|
823
1008
|
const norm = opts.normalize ? normalizeSkillContent(rawSkill, {
|
|
824
|
-
fallbackName:
|
|
1009
|
+
fallbackName: path36.basename(src.dir),
|
|
825
1010
|
version: opts.version,
|
|
826
1011
|
stage: opts.stage
|
|
827
|
-
}) : { content: rawSkill, name:
|
|
1012
|
+
}) : { content: rawSkill, name: path36.basename(src.dir), changed: false, notes: [] };
|
|
828
1013
|
if (!opts.normalize && !isValidAssetName(norm.name)) {
|
|
829
1014
|
logWarn(
|
|
830
1015
|
`Name "${norm.name}" is not canonical (kebab-case); \`skaile validate\` will reject this manifest entry. Drop --no-normalize to slugify it.`
|
|
831
1016
|
);
|
|
832
1017
|
}
|
|
833
|
-
const destDir =
|
|
834
|
-
if (
|
|
1018
|
+
const destDir = path36.join(target.path, norm.name);
|
|
1019
|
+
if (fs12.existsSync(destDir)) {
|
|
835
1020
|
logErr(`Destination already exists: ${destDir}`);
|
|
836
1021
|
process.exit(1);
|
|
837
1022
|
}
|
|
838
|
-
|
|
839
|
-
|
|
1023
|
+
fs12.cpSync(src.dir, destDir, { recursive: true });
|
|
1024
|
+
fs12.writeFileSync(path36.join(destDir, "SKILL.md"), norm.content, "utf8");
|
|
840
1025
|
for (const note of norm.notes) logInfo(` \u2022 ${note}`);
|
|
841
1026
|
const fm = parseFrontmatter(norm.content).data;
|
|
842
|
-
const descRaw = fm.description;
|
|
843
|
-
const description = typeof descRaw === "string" ? descRaw.trim() : void 0;
|
|
844
1027
|
for (const f of checkAgentSkillConformance(fm, { dirName: norm.name })) {
|
|
845
1028
|
logWarn(`conformance: ${f.field} \u2014 ${f.message}`);
|
|
846
1029
|
}
|
|
847
|
-
const
|
|
848
|
-
const
|
|
1030
|
+
const fmVersion = fm.metadata?.version;
|
|
1031
|
+
const { ref } = await registerLibraryAsset(target, library, {
|
|
849
1032
|
kind: "skill",
|
|
850
1033
|
name: norm.name,
|
|
851
|
-
|
|
852
|
-
version: opts.version,
|
|
853
|
-
|
|
1034
|
+
assetDir: destDir,
|
|
1035
|
+
version: fmVersion != null ? String(fmVersion) : opts.version ?? DEFAULT_IMPORT_VERSION,
|
|
1036
|
+
publisher: opts.publisher
|
|
854
1037
|
});
|
|
855
|
-
logOk(`${up.added ? "Added" : "Updated"} manifest entry skill:${norm.name}`);
|
|
856
1038
|
if (target.backend === "git" && opts.commit) {
|
|
857
1039
|
const { spawnSync: spawnSync2 } = await import('child_process');
|
|
858
1040
|
spawnSync2("git", ["add", "--", destDir], { cwd: target.path, stdio: "inherit" });
|
|
@@ -864,28 +1046,30 @@ function makeAssetCommand() {
|
|
|
864
1046
|
logWarn("Nothing committed (working tree clean or commit aborted).");
|
|
865
1047
|
}
|
|
866
1048
|
}
|
|
867
|
-
logOk(`Imported ${S.cmd(
|
|
1049
|
+
logOk(`Imported ${S.cmd(ref)} \u2192 ${target.name}`);
|
|
1050
|
+
logInfo(`Indexed \u2014 add it with ${S.cmd(`skaile add ${ref}`)}`);
|
|
868
1051
|
logInfo(`Verify: ${S.cmd(`skaile validate ${target.path}`)}`);
|
|
869
1052
|
} finally {
|
|
870
1053
|
close();
|
|
871
1054
|
}
|
|
872
1055
|
}
|
|
873
1056
|
);
|
|
874
|
-
cmd.command("migrate <path>").description("Move/copy/link a workspace asset into a library").option("--
|
|
1057
|
+
cmd.command("migrate <path>").description("Move/copy/link a workspace asset into a library").option("--library <library>", "Target library (default: auto)").addOption(new Option("--to <library>", "Alias for --library").hideHelp()).option("--mode <mode>", "copy | move | link", "copy").option("--commit", "Auto-commit in git-backed libraries", false).action(
|
|
875
1058
|
async (srcPath, opts) => {
|
|
876
1059
|
if (!["copy", "move", "link"].includes(opts.mode)) {
|
|
877
1060
|
logErr(`Invalid --mode "${opts.mode}". Expected: copy | move | link.`);
|
|
878
1061
|
process.exit(1);
|
|
879
1062
|
}
|
|
880
|
-
if (!
|
|
1063
|
+
if (!fs12.existsSync(srcPath)) {
|
|
881
1064
|
logErr(`Source path does not exist: ${srcPath}`);
|
|
882
1065
|
process.exit(1);
|
|
883
1066
|
}
|
|
1067
|
+
const libraryName = resolveLibraryOption(opts);
|
|
884
1068
|
const { manager, close } = await openLibraryManager();
|
|
885
1069
|
try {
|
|
886
1070
|
let target;
|
|
887
|
-
if (
|
|
888
|
-
target = await manager.requireLibrary(
|
|
1071
|
+
if (libraryName) {
|
|
1072
|
+
target = await manager.requireLibrary(libraryName);
|
|
889
1073
|
} else {
|
|
890
1074
|
const found = await manager.findDefaultLibrary();
|
|
891
1075
|
const def = found && found.ownership !== "reader" ? found : void 0;
|
|
@@ -898,27 +1082,27 @@ function makeAssetCommand() {
|
|
|
898
1082
|
}
|
|
899
1083
|
if (target.ownership === "reader") {
|
|
900
1084
|
logErr(
|
|
901
|
-
`Library "${target.name}" is read-only (ownership=reader). Choose another with --
|
|
1085
|
+
`Library "${target.name}" is read-only (ownership=reader). Choose another with --library.`
|
|
902
1086
|
);
|
|
903
1087
|
process.exit(1);
|
|
904
1088
|
}
|
|
905
|
-
const basename2 =
|
|
1089
|
+
const basename2 = path36.basename(srcPath);
|
|
906
1090
|
const destDir = target.path;
|
|
907
|
-
|
|
908
|
-
const destPath =
|
|
909
|
-
if (
|
|
1091
|
+
fs12.mkdirSync(destDir, { recursive: true });
|
|
1092
|
+
const destPath = path36.join(destDir, basename2);
|
|
1093
|
+
if (fs12.existsSync(destPath)) {
|
|
910
1094
|
logErr(`Destination already exists: ${destPath}`);
|
|
911
1095
|
process.exit(1);
|
|
912
1096
|
}
|
|
913
1097
|
switch (opts.mode) {
|
|
914
1098
|
case "copy":
|
|
915
|
-
|
|
1099
|
+
fs12.cpSync(srcPath, destPath, { recursive: true });
|
|
916
1100
|
break;
|
|
917
1101
|
case "move":
|
|
918
|
-
|
|
1102
|
+
fs12.renameSync(srcPath, destPath);
|
|
919
1103
|
break;
|
|
920
1104
|
case "link":
|
|
921
|
-
|
|
1105
|
+
fs12.symlinkSync(path36.resolve(srcPath), destPath);
|
|
922
1106
|
break;
|
|
923
1107
|
}
|
|
924
1108
|
if (target.backend === "git" && opts.commit) {
|
|
@@ -992,7 +1176,7 @@ function makeAssetCommand() {
|
|
|
992
1176
|
}
|
|
993
1177
|
);
|
|
994
1178
|
cmd.addCommand(makeListCommand());
|
|
995
|
-
cmd.command("show <ref>").description("Show details for an asset by canonical ref").action(async (ref) => {
|
|
1179
|
+
cmd.command("show <ref>").description("Show details for an asset by canonical ref (prints JSON)").option("--json", "Print JSON (the default and only output format)").action(async (ref, _opts) => {
|
|
996
1180
|
const { library, close } = await openLibraryManager();
|
|
997
1181
|
try {
|
|
998
1182
|
const def = await resolveDefByRef(library, ref);
|
|
@@ -1048,14 +1232,14 @@ function makeAuthCommand() {
|
|
|
1048
1232
|
}
|
|
1049
1233
|
function collectCacheTargets(scope) {
|
|
1050
1234
|
const out = [];
|
|
1051
|
-
out.push(
|
|
1052
|
-
out.push(
|
|
1053
|
-
out.push(
|
|
1235
|
+
out.push(path36__default.join(scope.projectDir, ".skaile", "cache"));
|
|
1236
|
+
out.push(path36__default.join(scope.projectDir, ".skaile", "store-cache"));
|
|
1237
|
+
out.push(path36__default.join(scope.projectDir, ".skaile", "repos"));
|
|
1054
1238
|
if (scope.global) {
|
|
1055
1239
|
out.push(globalCacheRoot());
|
|
1056
1240
|
const home = globalSkaileDir();
|
|
1057
|
-
out.push(
|
|
1058
|
-
out.push(
|
|
1241
|
+
out.push(path36__default.join(home, "repos"));
|
|
1242
|
+
out.push(path36__default.join(home, "catalog-cache"));
|
|
1059
1243
|
}
|
|
1060
1244
|
return out;
|
|
1061
1245
|
}
|
|
@@ -1069,7 +1253,7 @@ function dirSize(target) {
|
|
|
1069
1253
|
function dirSizeOfDir(dir) {
|
|
1070
1254
|
let total = 0;
|
|
1071
1255
|
for (const ent of readdirSync(dir, { withFileTypes: true })) {
|
|
1072
|
-
const child =
|
|
1256
|
+
const child = path36__default.join(dir, ent.name);
|
|
1073
1257
|
if (ent.isSymbolicLink()) continue;
|
|
1074
1258
|
if (ent.isDirectory()) total += dirSizeOfDir(child);
|
|
1075
1259
|
else if (ent.isFile()) total += statSync(child).size;
|
|
@@ -1095,7 +1279,7 @@ function makeCacheCommand() {
|
|
|
1095
1279
|
const cmd = new Command("cache").description("Inspect and reclaim the re-derivable cache");
|
|
1096
1280
|
cmd.command("clean").description("Remove the project cache (.skaile/cache); --global also clears ~/.skaile/cache").option("--global", "Also clear the global cache (sources + catalog) and legacy dirs").option("--dry-run", "Show what would be removed without doing it").option("-y, --yes", "Skip confirmation prompt").option("--project-dir <path>", "Project directory", process.cwd()).action(async (opts) => {
|
|
1097
1281
|
const targets = collectCacheTargets({
|
|
1098
|
-
projectDir:
|
|
1282
|
+
projectDir: path36__default.resolve(opts.projectDir),
|
|
1099
1283
|
global: opts.global
|
|
1100
1284
|
}).filter((t) => existsSync(t));
|
|
1101
1285
|
if (targets.length === 0) {
|
|
@@ -1112,10 +1296,10 @@ function makeCacheCommand() {
|
|
|
1112
1296
|
return;
|
|
1113
1297
|
}
|
|
1114
1298
|
if (!opts.yes) {
|
|
1115
|
-
const ok = await
|
|
1299
|
+
const ok = await p4.confirm({
|
|
1116
1300
|
message: opts.global ? "Clear project AND global cache?" : "Clear project cache?"
|
|
1117
1301
|
});
|
|
1118
|
-
if (
|
|
1302
|
+
if (p4.isCancel(ok) || !ok) {
|
|
1119
1303
|
logInfo("Cancelled.");
|
|
1120
1304
|
return;
|
|
1121
1305
|
}
|
|
@@ -1125,12 +1309,12 @@ function makeCacheCommand() {
|
|
|
1125
1309
|
for (const r of removed) logOk(`Removed ${r}`);
|
|
1126
1310
|
});
|
|
1127
1311
|
cmd.command("dir").description("Print the resolved cache roots").option("--global", "Include the global cache root").option("--project-dir <path>", "Project directory", process.cwd()).action((opts) => {
|
|
1128
|
-
console.log(
|
|
1312
|
+
console.log(path36__default.join(path36__default.resolve(opts.projectDir), ".skaile", "cache"));
|
|
1129
1313
|
if (opts.global) console.log(globalCacheRoot());
|
|
1130
1314
|
});
|
|
1131
1315
|
cmd.command("size").description("Show cache disk usage per directory").option("--global", "Include the global cache").option("--project-dir <path>", "Project directory", process.cwd()).action((opts) => {
|
|
1132
1316
|
const targets = collectCacheTargets({
|
|
1133
|
-
projectDir:
|
|
1317
|
+
projectDir: path36__default.resolve(opts.projectDir),
|
|
1134
1318
|
global: opts.global
|
|
1135
1319
|
});
|
|
1136
1320
|
console.log();
|
|
@@ -1146,7 +1330,7 @@ function makeCatalogCommand() {
|
|
|
1146
1330
|
const catalog = new Command("catalog").description("Catalog source health and configuration");
|
|
1147
1331
|
catalog.command("test").description("Probe the configured catalog source and report status").option("--project-dir <path>", "Project directory (for project-level config overlay)").option("--url <url>", "Override the catalog URL for this probe").option("--force", "Probe the network even in air-gapped mode (cache_ttl: 0)").action(async (opts) => {
|
|
1148
1332
|
const { resolveConfig, isLocalCatalogUrl, trpcGetUrl } = await import('../library/index.js');
|
|
1149
|
-
const projectDir = opts.projectDir ?
|
|
1333
|
+
const projectDir = opts.projectDir ? path36__default.resolve(opts.projectDir) : void 0;
|
|
1150
1334
|
const cfg = resolveConfig({ projectDir });
|
|
1151
1335
|
const baseUrl = opts.url ?? cfg.catalog.url;
|
|
1152
1336
|
if (isLocalCatalogUrl(baseUrl)) {
|
|
@@ -1164,7 +1348,7 @@ function makeCatalogCommand() {
|
|
|
1164
1348
|
});
|
|
1165
1349
|
catalog.command("info").description("Print the resolved catalog configuration (url, framing, cacheTtlMs)").option("--project-dir <path>", "Project directory (for project-level config overlay)").action(async (opts) => {
|
|
1166
1350
|
const { resolveConfig } = await import('../library/index.js');
|
|
1167
|
-
const projectDir = opts.projectDir ?
|
|
1351
|
+
const projectDir = opts.projectDir ? path36__default.resolve(opts.projectDir) : void 0;
|
|
1168
1352
|
const cfg = resolveConfig({ projectDir });
|
|
1169
1353
|
console.log(`url: ${cfg.catalog.url}`);
|
|
1170
1354
|
console.log(`framing: ${cfg.catalog.framing}`);
|
|
@@ -1173,7 +1357,7 @@ function makeCatalogCommand() {
|
|
|
1173
1357
|
return catalog;
|
|
1174
1358
|
}
|
|
1175
1359
|
async function runLocalCatalogTest(projectDir) {
|
|
1176
|
-
const { resolveCatalogSource } = await import('../open-library-
|
|
1360
|
+
const { resolveCatalogSource } = await import('../open-library-NVG3CZUO.js');
|
|
1177
1361
|
let resolved;
|
|
1178
1362
|
try {
|
|
1179
1363
|
resolved = await resolveCatalogSource({ projectDir });
|
|
@@ -1215,11 +1399,11 @@ async function runRemoteCatalogProbe(baseUrl, probeUrl) {
|
|
|
1215
1399
|
logErr(`${probeUrl} responded ${res.status} ${res.statusText} (${ms}ms)`);
|
|
1216
1400
|
if (res.status === 404) {
|
|
1217
1401
|
logInfo(
|
|
1218
|
-
|
|
1402
|
+
`Got 404 from catalog.listKinds. Check the URL prefix in ${userConfigPath()} \u2014 Skaile mirrors must expose \`/trpc/catalog.*\` at the configured baseUrl.`
|
|
1219
1403
|
);
|
|
1220
1404
|
} else {
|
|
1221
1405
|
logInfo(
|
|
1222
|
-
|
|
1406
|
+
`Verify the URL in ${userConfigPath()} and any auth requirements on private mirrors.`
|
|
1223
1407
|
);
|
|
1224
1408
|
}
|
|
1225
1409
|
process.exitCode = 1;
|
|
@@ -1243,7 +1427,7 @@ async function runRemoteCatalogProbe(baseUrl, probeUrl) {
|
|
|
1243
1427
|
} else {
|
|
1244
1428
|
logErr(`Could not reach ${probeUrl}: ${err instanceof Error ? err.message : String(err)}`);
|
|
1245
1429
|
}
|
|
1246
|
-
logInfo(
|
|
1430
|
+
logInfo(`Verify the URL in ${userConfigPath()} and that the catalog backend is deployed.`);
|
|
1247
1431
|
process.exitCode = 1;
|
|
1248
1432
|
} finally {
|
|
1249
1433
|
clearTimeout(timeout);
|
|
@@ -1317,8 +1501,8 @@ async function scanLibraryFlowEntries() {
|
|
|
1317
1501
|
const indexPath = resolveIndexPath();
|
|
1318
1502
|
if (!existsSync(indexPath)) return entries;
|
|
1319
1503
|
const [{ authoringLibraries }, { createFullRegistry: createFullRegistry2 }] = await Promise.all([
|
|
1320
|
-
import('../open-library-
|
|
1321
|
-
import('../open-registry-
|
|
1504
|
+
import('../open-library-NVG3CZUO.js'),
|
|
1505
|
+
import('../open-registry-IYH6W6CN.js')
|
|
1322
1506
|
]);
|
|
1323
1507
|
const index = new LocalIndex({ indexPath });
|
|
1324
1508
|
try {
|
|
@@ -1375,11 +1559,11 @@ function findSkills() {
|
|
|
1375
1559
|
return deduped;
|
|
1376
1560
|
}
|
|
1377
1561
|
function walkSkills(dir, out) {
|
|
1378
|
-
for (const entry of
|
|
1379
|
-
const full =
|
|
1562
|
+
for (const entry of fs12__default.readdirSync(dir, { withFileTypes: true })) {
|
|
1563
|
+
const full = path36__default.join(dir, entry.name);
|
|
1380
1564
|
if (entry.isDirectory()) {
|
|
1381
|
-
const skillMd =
|
|
1382
|
-
if (
|
|
1565
|
+
const skillMd = path36__default.join(full, "SKILL.md");
|
|
1566
|
+
if (fs12__default.existsSync(skillMd)) {
|
|
1383
1567
|
out.push({ name: entry.name, path: full, skillPath: skillMd });
|
|
1384
1568
|
} else {
|
|
1385
1569
|
walkSkills(full, out);
|
|
@@ -1400,10 +1584,10 @@ function resolveFlowIds() {
|
|
|
1400
1584
|
}
|
|
1401
1585
|
}
|
|
1402
1586
|
function resolveSessionIds(projectDir) {
|
|
1403
|
-
const sessionsDir =
|
|
1404
|
-
if (!
|
|
1587
|
+
const sessionsDir = path36__default.join(projectDir, ".skaile", "sessions");
|
|
1588
|
+
if (!fs12__default.existsSync(sessionsDir)) return [];
|
|
1405
1589
|
try {
|
|
1406
|
-
return
|
|
1590
|
+
return fs12__default.readdirSync(sessionsDir).filter((f) => f.endsWith(".json")).map((f) => f.slice(0, -".json".length));
|
|
1407
1591
|
} catch {
|
|
1408
1592
|
return [];
|
|
1409
1593
|
}
|
|
@@ -1460,12 +1644,12 @@ var API_KEY_PREFIX = "apiKey.";
|
|
|
1460
1644
|
function collectWorkspaceDefaults(projectDir) {
|
|
1461
1645
|
const wsDefaults = {};
|
|
1462
1646
|
const ws = resolveSkWorkspaceConfig(projectDir);
|
|
1463
|
-
const
|
|
1464
|
-
if (
|
|
1465
|
-
if (
|
|
1466
|
-
if (
|
|
1467
|
-
if (
|
|
1468
|
-
if (
|
|
1647
|
+
const p6 = ws.agent_config?.default ?? {};
|
|
1648
|
+
if (p6.driver) wsDefaults.driver = p6.driver;
|
|
1649
|
+
if (p6.model) wsDefaults.model = p6.model;
|
|
1650
|
+
if (p6.skills_dir) wsDefaults.skills_dir = p6.skills_dir;
|
|
1651
|
+
if (p6.agents_dir) wsDefaults.agents_dir = p6.agents_dir;
|
|
1652
|
+
if (p6.prompts_dir) wsDefaults.prompts_dir = p6.prompts_dir;
|
|
1469
1653
|
for (const [role, target] of Object.entries(ws.roles ?? {})) {
|
|
1470
1654
|
wsDefaults[`@${role}`] = target;
|
|
1471
1655
|
}
|
|
@@ -1542,7 +1726,7 @@ function printResolvedPathsSection(config) {
|
|
|
1542
1726
|
console.log(` ${S.label("prompts:".padEnd(16))} ${config.promptsDir ?? paths.promptsDir}`);
|
|
1543
1727
|
}
|
|
1544
1728
|
async function showConfig(opts) {
|
|
1545
|
-
const projectDir = opts.projectDir ?
|
|
1729
|
+
const projectDir = opts.projectDir ? path36__default.resolve(opts.projectDir) : process.cwd();
|
|
1546
1730
|
let config;
|
|
1547
1731
|
let wsDefaults;
|
|
1548
1732
|
try {
|
|
@@ -1587,13 +1771,13 @@ function makeConfigCommand() {
|
|
|
1587
1771
|
const cmd = new Command("config").description("Manage personal config (.skaile/settings.json)");
|
|
1588
1772
|
cmd.command("show").description("Show effective config with sources").option("--project-dir <path>", "Project directory").action((opts) => showConfig(opts));
|
|
1589
1773
|
cmd.command("get <key>").description("Get an effective config value").option("--project-dir <path>", "Project directory").action(async (key, opts) => {
|
|
1590
|
-
const projectDir = opts.projectDir ?
|
|
1774
|
+
const projectDir = opts.projectDir ? path36__default.resolve(opts.projectDir) : process.cwd();
|
|
1591
1775
|
const config = await resolveSettings(projectDir);
|
|
1592
1776
|
const value = config[key];
|
|
1593
1777
|
console.log(value ?? S.dim("(not set)"));
|
|
1594
1778
|
});
|
|
1595
1779
|
cmd.command("set <key> <value>").description("Set a personal config value (driver, model, apiKey.<provider>)").option("--project-dir <path>", "Project directory").option("--global", "Write to ~/.skaile/settings.json instead of project-local").action(async (key, value, opts) => {
|
|
1596
|
-
const projectDir = opts.projectDir ?
|
|
1780
|
+
const projectDir = opts.projectDir ? path36__default.resolve(opts.projectDir) : process.cwd();
|
|
1597
1781
|
if (key === "provider" || key === "cloud" || key === "cloudConfig") {
|
|
1598
1782
|
logErr(
|
|
1599
1783
|
`'${key}' is no longer a setting \u2014 an endpoint is an AI provider registry entry and a session selects one with a model reference.
|
|
@@ -1933,8 +2117,8 @@ function makeConnectorCommand() {
|
|
|
1933
2117
|
async (driver, opts) => {
|
|
1934
2118
|
const { installNpmPackages } = await import('../connectors/index.js');
|
|
1935
2119
|
const { scanDirectory: scanDirectory2, factoryAssetRoots: factoryAssetRoots2, WorkspaceYamlEditor: WorkspaceYamlEditor2 } = await import('../core/index.js');
|
|
1936
|
-
const projectDir =
|
|
1937
|
-
const yamlPath =
|
|
2120
|
+
const projectDir = path36__default.resolve(opts.projectDir);
|
|
2121
|
+
const yamlPath = path36__default.join(projectDir, "skaile.yaml");
|
|
1938
2122
|
if (!existsSync(yamlPath)) {
|
|
1939
2123
|
logErr("No skaile.yaml found in current directory. Run 'skaile init' first.");
|
|
1940
2124
|
process.exit(1);
|
|
@@ -1994,8 +2178,8 @@ ${installResult.output}`);
|
|
|
1994
2178
|
);
|
|
1995
2179
|
cmd.command("remove <id>").option("--project-dir <path>", "Workspace directory", process.cwd()).description("Remove a connector from skaile.yaml by its instance ID").action(async (id, opts) => {
|
|
1996
2180
|
const { WorkspaceYamlEditor: WorkspaceYamlEditor2 } = await import('../core/index.js');
|
|
1997
|
-
const projectDir =
|
|
1998
|
-
const yamlPath =
|
|
2181
|
+
const projectDir = path36__default.resolve(opts.projectDir);
|
|
2182
|
+
const yamlPath = path36__default.join(projectDir, "skaile.yaml");
|
|
1999
2183
|
if (!existsSync(yamlPath)) {
|
|
2000
2184
|
logErr("No skaile.yaml found in current directory.");
|
|
2001
2185
|
process.exit(1);
|
|
@@ -2012,7 +2196,7 @@ ${installResult.output}`);
|
|
|
2012
2196
|
cmd.command("status [id]").option("--project-dir <path>", "Workspace directory", process.cwd()).description("Connect and report health status for one or all connectors").action(async (id, opts) => {
|
|
2013
2197
|
const res = await import('../connectors/index.js');
|
|
2014
2198
|
res.registerBuiltinConnectors();
|
|
2015
|
-
const projectDir =
|
|
2199
|
+
const projectDir = path36__default.resolve(opts.projectDir);
|
|
2016
2200
|
const declarations = res.loadConnectorDeclarations(projectDir);
|
|
2017
2201
|
if (declarations.length === 0) {
|
|
2018
2202
|
console.log("No connectors configured in skaile.yaml.");
|
|
@@ -2036,7 +2220,7 @@ ${installResult.output}`);
|
|
|
2036
2220
|
await manager.disconnectAll();
|
|
2037
2221
|
});
|
|
2038
2222
|
cmd.command("list").description("List all configured connectors").option("--project-dir <path>", "Workspace directory", process.cwd()).action(async (opts) => {
|
|
2039
|
-
const projectDir =
|
|
2223
|
+
const projectDir = path36__default.resolve(opts.projectDir);
|
|
2040
2224
|
const manager = await connectConnectors(projectDir);
|
|
2041
2225
|
try {
|
|
2042
2226
|
console.log(JSON.stringify(manager.listConnectors(), null, 2));
|
|
@@ -2045,7 +2229,7 @@ ${installResult.output}`);
|
|
|
2045
2229
|
}
|
|
2046
2230
|
});
|
|
2047
2231
|
cmd.command("sync [id]").description("Re-sync a filesystem-face connector or all of them (git pull, S3 refresh, etc.)").option("--all", "Sync all connectors").option("--project-dir <path>", "Workspace directory", process.cwd()).action(async (id, opts) => {
|
|
2048
|
-
const projectDir =
|
|
2232
|
+
const projectDir = path36__default.resolve(opts.projectDir);
|
|
2049
2233
|
const manager = await connectConnectors(projectDir);
|
|
2050
2234
|
try {
|
|
2051
2235
|
if (opts.all) {
|
|
@@ -2069,7 +2253,7 @@ ${installResult.output}`);
|
|
|
2069
2253
|
}
|
|
2070
2254
|
});
|
|
2071
2255
|
cmd.command("ops <id>").description("List available operations for a connector").option("--project-dir <path>", "Workspace directory", process.cwd()).action(async (id, opts) => {
|
|
2072
|
-
const projectDir =
|
|
2256
|
+
const projectDir = path36__default.resolve(opts.projectDir);
|
|
2073
2257
|
const manager = await connectConnectors(projectDir);
|
|
2074
2258
|
try {
|
|
2075
2259
|
if (!manager.has(id)) {
|
|
@@ -2084,7 +2268,7 @@ ${installResult.output}`);
|
|
|
2084
2268
|
}
|
|
2085
2269
|
});
|
|
2086
2270
|
cmd.command("read <id> <resource-path>").description("Read content from a connector").option("--project-dir <path>", "Workspace directory", process.cwd()).action(async (id, resourcePath, opts) => {
|
|
2087
|
-
const projectDir =
|
|
2271
|
+
const projectDir = path36__default.resolve(opts.projectDir);
|
|
2088
2272
|
const manager = await connectConnectors(projectDir);
|
|
2089
2273
|
try {
|
|
2090
2274
|
const content = await manager.read(id, resourcePath);
|
|
@@ -2094,7 +2278,7 @@ ${installResult.output}`);
|
|
|
2094
2278
|
}
|
|
2095
2279
|
});
|
|
2096
2280
|
cmd.command("write <id> <resource-path> <content>").description("Write content to a connector at a path").option("--project-dir <path>", "Workspace directory", process.cwd()).action(async (id, resourcePath, content, opts) => {
|
|
2097
|
-
const projectDir =
|
|
2281
|
+
const projectDir = path36__default.resolve(opts.projectDir);
|
|
2098
2282
|
const manager = await connectConnectors(projectDir);
|
|
2099
2283
|
try {
|
|
2100
2284
|
await manager.write(id, resourcePath, { data: content });
|
|
@@ -2104,7 +2288,7 @@ ${installResult.output}`);
|
|
|
2104
2288
|
}
|
|
2105
2289
|
});
|
|
2106
2290
|
cmd.command("entries <id> [resource-path]").description("List entries in a connector (files, keys, rows, etc)").option("--project-dir <path>", "Workspace directory", process.cwd()).option("--recursive", "Include nested entries").option("--limit <n>", "Maximum entries to return", parsePositiveIntOption).action(async (id, resourcePath, opts) => {
|
|
2107
|
-
const projectDir =
|
|
2291
|
+
const projectDir = path36__default.resolve(opts.projectDir);
|
|
2108
2292
|
const manager = await connectConnectors(projectDir);
|
|
2109
2293
|
try {
|
|
2110
2294
|
const entries = await manager.list(id, resourcePath, {
|
|
@@ -2117,7 +2301,7 @@ ${installResult.output}`);
|
|
|
2117
2301
|
}
|
|
2118
2302
|
});
|
|
2119
2303
|
cmd.command("search <id> <query>").description("Search within a connector for matching content").option("--project-dir <path>", "Workspace directory", process.cwd()).action(async (id, query, opts) => {
|
|
2120
|
-
const projectDir =
|
|
2304
|
+
const projectDir = path36__default.resolve(opts.projectDir);
|
|
2121
2305
|
const manager = await connectConnectors(projectDir);
|
|
2122
2306
|
try {
|
|
2123
2307
|
const results = await manager.search(id, query);
|
|
@@ -2127,7 +2311,7 @@ ${installResult.output}`);
|
|
|
2127
2311
|
}
|
|
2128
2312
|
});
|
|
2129
2313
|
cmd.command("delete <id> <resource-path>").description("Delete an entry from a connector").option("--project-dir <path>", "Workspace directory", process.cwd()).action(async (id, resourcePath, opts) => {
|
|
2130
|
-
const projectDir =
|
|
2314
|
+
const projectDir = path36__default.resolve(opts.projectDir);
|
|
2131
2315
|
const manager = await connectConnectors(projectDir);
|
|
2132
2316
|
try {
|
|
2133
2317
|
const ok = await manager.delete(id, resourcePath);
|
|
@@ -2137,7 +2321,7 @@ ${installResult.output}`);
|
|
|
2137
2321
|
}
|
|
2138
2322
|
});
|
|
2139
2323
|
cmd.command("run <id> <op> [args...]").description("Run a custom adapter operation (e.g. git log, sqlite query)").option("--project-dir <path>", "Workspace directory", process.cwd()).allowUnknownOption().action(async (id, op, args, opts) => {
|
|
2140
|
-
const projectDir =
|
|
2324
|
+
const projectDir = path36__default.resolve(opts.projectDir);
|
|
2141
2325
|
const manager = await connectConnectors(projectDir);
|
|
2142
2326
|
try {
|
|
2143
2327
|
if (!manager.has(id)) {
|
|
@@ -2246,7 +2430,7 @@ function envRecord() {
|
|
|
2246
2430
|
async function buildDeployContext(projectDir) {
|
|
2247
2431
|
const { resolveSkWorkspaceConfig: resolveSkWorkspaceConfig2 } = await import('../core/index.js');
|
|
2248
2432
|
const config = resolveSkWorkspaceConfig2(projectDir);
|
|
2249
|
-
const workspaceId = config.name ??
|
|
2433
|
+
const workspaceId = config.name ?? path36__default.basename(projectDir);
|
|
2250
2434
|
let log;
|
|
2251
2435
|
try {
|
|
2252
2436
|
const { createLogger } = await import('../core/logging.js');
|
|
@@ -2278,13 +2462,13 @@ async function ensureTargetsRegistered(projectDir) {
|
|
|
2278
2462
|
const { resolveSkWorkspaceConfig: resolveSkWorkspaceConfig2 } = await import('../core/index.js');
|
|
2279
2463
|
const config = resolveSkWorkspaceConfig2(projectDir);
|
|
2280
2464
|
if (config.plugins && config.plugins.length > 0) {
|
|
2281
|
-
const { ensurePluginsLoaded } = await import('../plugin-store-
|
|
2465
|
+
const { ensurePluginsLoaded } = await import('../plugin-store-2DTEIJTG.js');
|
|
2282
2466
|
const result = await ensurePluginsLoaded(projectDir, config.plugins, pluginRegistry);
|
|
2283
2467
|
for (const f of result.failed) logWarn(f.error);
|
|
2284
2468
|
}
|
|
2285
2469
|
}
|
|
2286
2470
|
async function runUp(opts) {
|
|
2287
|
-
const projectDir =
|
|
2471
|
+
const projectDir = path36__default.resolve(opts.projectDir);
|
|
2288
2472
|
await ensureTargetsRegistered(projectDir);
|
|
2289
2473
|
const { resolveSkWorkspaceConfig: resolveSkWorkspaceConfig2 } = await import('../core/index.js');
|
|
2290
2474
|
const { resolveDeployTarget, pluginRegistry } = await import('../plugin-registry/index.js');
|
|
@@ -2352,7 +2536,7 @@ async function restoreFromHandle(projectDir) {
|
|
|
2352
2536
|
return { target, handle, ctx };
|
|
2353
2537
|
}
|
|
2354
2538
|
async function runDown(opts) {
|
|
2355
|
-
const projectDir =
|
|
2539
|
+
const projectDir = path36__default.resolve(opts.projectDir);
|
|
2356
2540
|
const restored = await restoreFromHandle(projectDir);
|
|
2357
2541
|
if (!restored) return;
|
|
2358
2542
|
await restored.handle.stop();
|
|
@@ -2361,7 +2545,7 @@ async function runDown(opts) {
|
|
|
2361
2545
|
logOk(`Stopped ${S.cmd(restored.target.id)} and cleared the handle.`);
|
|
2362
2546
|
}
|
|
2363
2547
|
async function runStatus(opts) {
|
|
2364
|
-
const projectDir =
|
|
2548
|
+
const projectDir = path36__default.resolve(opts.projectDir);
|
|
2365
2549
|
const restored = await restoreFromHandle(projectDir);
|
|
2366
2550
|
if (!restored) return;
|
|
2367
2551
|
const health = await restored.handle.health();
|
|
@@ -2375,7 +2559,7 @@ async function runStatus(opts) {
|
|
|
2375
2559
|
console.log();
|
|
2376
2560
|
}
|
|
2377
2561
|
async function runLogs(opts) {
|
|
2378
|
-
const projectDir =
|
|
2562
|
+
const projectDir = path36__default.resolve(opts.projectDir);
|
|
2379
2563
|
const restored = await restoreFromHandle(projectDir);
|
|
2380
2564
|
if (!restored) return;
|
|
2381
2565
|
if (!restored.handle.logs) {
|
|
@@ -2399,7 +2583,7 @@ function makeDeployCommand() {
|
|
|
2399
2583
|
}
|
|
2400
2584
|
function makeDiffCommand() {
|
|
2401
2585
|
return new Command("diff").description("Show changes between deployed and source versions").argument("<ref>", "Asset reference (kind:name)").option("--project-dir <path>", "Project directory", process.cwd()).action(async (ref, opts) => {
|
|
2402
|
-
const am2 = new AssetManager({ projectDir:
|
|
2586
|
+
const am2 = new AssetManager({ projectDir: path36__default.resolve(opts.projectDir) });
|
|
2403
2587
|
const result = await am2.diff(ref);
|
|
2404
2588
|
switch (result.status) {
|
|
2405
2589
|
case "not-found":
|
|
@@ -2421,7 +2605,7 @@ function makeDiffCommand() {
|
|
|
2421
2605
|
function makeFlowCommand() {
|
|
2422
2606
|
const cmd = new Command("flow").description("Manage flows");
|
|
2423
2607
|
cmd.command("list").description("List available flows").option("--project-dir <path>", "Project directory", process.cwd()).action(async (opts) => {
|
|
2424
|
-
const flows = await discoverFlowsWithLibraries(
|
|
2608
|
+
const flows = await discoverFlowsWithLibraries(path36__default.resolve(opts.projectDir));
|
|
2425
2609
|
if (flows.length === 0) {
|
|
2426
2610
|
logInfo("No flows found.");
|
|
2427
2611
|
return;
|
|
@@ -2436,7 +2620,7 @@ function makeFlowCommand() {
|
|
|
2436
2620
|
console.log();
|
|
2437
2621
|
});
|
|
2438
2622
|
cmd.command("show <id>").description("Show flow details and node graph").option("--project-dir <path>", "Project directory", process.cwd()).action(async (id, opts) => {
|
|
2439
|
-
const flows = await discoverFlowsWithLibraries(
|
|
2623
|
+
const flows = await discoverFlowsWithLibraries(path36__default.resolve(opts.projectDir));
|
|
2440
2624
|
const flow = flows.find((f) => f.id === id);
|
|
2441
2625
|
if (!flow) {
|
|
2442
2626
|
logErr(`Flow not found: ${id}`);
|
|
@@ -2468,7 +2652,7 @@ function makeFlowCommand() {
|
|
|
2468
2652
|
function makeHistoryCommand() {
|
|
2469
2653
|
const cmd = new Command("history").description("Show recent add/remove/update actions");
|
|
2470
2654
|
cmd.argument("[limit]", "Number of entries to show", "20").option("--project-dir <path>", "Project directory", process.cwd()).action((limitStr, opts) => {
|
|
2471
|
-
const am2 = new AssetManager({ projectDir:
|
|
2655
|
+
const am2 = new AssetManager({ projectDir: path36__default.resolve(opts.projectDir) });
|
|
2472
2656
|
const limit = parseInt(limitStr, 10) || 20;
|
|
2473
2657
|
const entries = am2.history(limit);
|
|
2474
2658
|
if (entries.length === 0) {
|
|
@@ -2488,7 +2672,7 @@ function makeHistoryCommand() {
|
|
|
2488
2672
|
console.log();
|
|
2489
2673
|
});
|
|
2490
2674
|
cmd.command("clear").description("Clear action history").option("--project-dir <path>", "Project directory", process.cwd()).action((opts) => {
|
|
2491
|
-
const am2 = new AssetManager({ projectDir:
|
|
2675
|
+
const am2 = new AssetManager({ projectDir: path36__default.resolve(opts.projectDir) });
|
|
2492
2676
|
am2.clearHistory();
|
|
2493
2677
|
logOk("History cleared.");
|
|
2494
2678
|
});
|
|
@@ -2501,12 +2685,12 @@ var MCP_SERVER_ENTRY = {
|
|
|
2501
2685
|
env: {}
|
|
2502
2686
|
};
|
|
2503
2687
|
function pluginDir(projectDir) {
|
|
2504
|
-
return
|
|
2688
|
+
return path36__default.join(projectDir, ".claude", "plugins", "skaile");
|
|
2505
2689
|
}
|
|
2506
|
-
async function readJsonStrict(
|
|
2690
|
+
async function readJsonStrict(p6) {
|
|
2507
2691
|
let raw;
|
|
2508
2692
|
try {
|
|
2509
|
-
raw = await
|
|
2693
|
+
raw = await fs6.readFile(p6, "utf-8");
|
|
2510
2694
|
} catch {
|
|
2511
2695
|
return null;
|
|
2512
2696
|
}
|
|
@@ -2514,37 +2698,37 @@ async function readJsonStrict(p7) {
|
|
|
2514
2698
|
return JSON.parse(raw);
|
|
2515
2699
|
} catch (e) {
|
|
2516
2700
|
throw new Error(
|
|
2517
|
-
`cannot parse ${
|
|
2701
|
+
`cannot parse ${p6}: ${e instanceof Error ? e.message : String(e)}; please fix or remove`
|
|
2518
2702
|
);
|
|
2519
2703
|
}
|
|
2520
2704
|
}
|
|
2521
|
-
async function writeJson(
|
|
2522
|
-
await
|
|
2523
|
-
await
|
|
2705
|
+
async function writeJson(p6, value) {
|
|
2706
|
+
await fs6.mkdir(path36__default.dirname(p6), { recursive: true });
|
|
2707
|
+
await fs6.writeFile(p6, `${JSON.stringify(value, null, 2)}
|
|
2524
2708
|
`);
|
|
2525
2709
|
}
|
|
2526
2710
|
async function copyDir(src, dest) {
|
|
2527
|
-
await
|
|
2528
|
-
const entries = await
|
|
2711
|
+
await fs6.mkdir(dest, { recursive: true });
|
|
2712
|
+
const entries = await fs6.readdir(src, { withFileTypes: true });
|
|
2529
2713
|
for (const entry of entries) {
|
|
2530
|
-
const srcPath =
|
|
2531
|
-
const destPath =
|
|
2714
|
+
const srcPath = path36__default.join(src, entry.name);
|
|
2715
|
+
const destPath = path36__default.join(dest, entry.name);
|
|
2532
2716
|
if (entry.isDirectory()) await copyDir(srcPath, destPath);
|
|
2533
|
-
else await
|
|
2717
|
+
else await fs6.copyFile(srcPath, destPath);
|
|
2534
2718
|
}
|
|
2535
2719
|
}
|
|
2536
2720
|
async function install(projectDir, opts) {
|
|
2537
2721
|
return opts?.full ? installFullPlugin(projectDir) : installMcp(projectDir);
|
|
2538
2722
|
}
|
|
2539
2723
|
async function installMcp(projectDir) {
|
|
2540
|
-
const mcpPath =
|
|
2724
|
+
const mcpPath = path36__default.join(projectDir, ".claude", "mcp.json");
|
|
2541
2725
|
const existing = await readJsonStrict(mcpPath) ?? {};
|
|
2542
2726
|
const mcpServers = { ...existing.mcpServers ?? {} };
|
|
2543
2727
|
const previous = mcpServers[SKAILE_MCP_NAME];
|
|
2544
2728
|
const matches = previous && JSON.stringify(previous) === JSON.stringify(MCP_SERVER_ENTRY);
|
|
2545
2729
|
let warning;
|
|
2546
2730
|
if (previous && !matches) {
|
|
2547
|
-
warning = `overwrote existing ${SKAILE_MCP_NAME} entry in ${
|
|
2731
|
+
warning = `overwrote existing ${SKAILE_MCP_NAME} entry in ${path36__default.relative(projectDir, mcpPath)}`;
|
|
2548
2732
|
}
|
|
2549
2733
|
mcpServers[SKAILE_MCP_NAME] = MCP_SERVER_ENTRY;
|
|
2550
2734
|
await writeJson(mcpPath, { ...existing, mcpServers });
|
|
@@ -2553,15 +2737,15 @@ async function installMcp(projectDir) {
|
|
|
2553
2737
|
async function installFullPlugin(projectDir) {
|
|
2554
2738
|
const dir = pluginDir(projectDir);
|
|
2555
2739
|
for (const [rel, content] of Object.entries(buildClaudePluginFiles())) {
|
|
2556
|
-
const dest =
|
|
2557
|
-
await
|
|
2558
|
-
await
|
|
2740
|
+
const dest = path36__default.join(dir, rel);
|
|
2741
|
+
await fs6.mkdir(path36__default.dirname(dest), { recursive: true });
|
|
2742
|
+
await fs6.writeFile(dest, content);
|
|
2559
2743
|
}
|
|
2560
|
-
const projectSkillsDir =
|
|
2744
|
+
const projectSkillsDir = path36__default.join(projectDir, ".skaile", "skills");
|
|
2561
2745
|
if (existsSync(projectSkillsDir)) {
|
|
2562
|
-
await copyDir(projectSkillsDir,
|
|
2746
|
+
await copyDir(projectSkillsDir, path36__default.join(dir, "skills"));
|
|
2563
2747
|
}
|
|
2564
|
-
const settingsPath =
|
|
2748
|
+
const settingsPath = path36__default.join(projectDir, ".claude", "settings.json");
|
|
2565
2749
|
const settings = await readJsonStrict(settingsPath) ?? {};
|
|
2566
2750
|
const plugins = settings.plugins ?? [];
|
|
2567
2751
|
if (!plugins.includes(dir)) plugins.push(dir);
|
|
@@ -2569,13 +2753,13 @@ async function installFullPlugin(projectDir) {
|
|
|
2569
2753
|
return { changed: true, method: "plugin" };
|
|
2570
2754
|
}
|
|
2571
2755
|
async function uninstall(projectDir) {
|
|
2572
|
-
const settingsPath =
|
|
2573
|
-
const mcpPath =
|
|
2756
|
+
const settingsPath = path36__default.join(projectDir, ".claude", "settings.json");
|
|
2757
|
+
const mcpPath = path36__default.join(projectDir, ".claude", "mcp.json");
|
|
2574
2758
|
const dir = pluginDir(projectDir);
|
|
2575
2759
|
let changed = false;
|
|
2576
2760
|
const settings = await readJsonStrict(settingsPath);
|
|
2577
2761
|
if (settings && Array.isArray(settings.plugins)) {
|
|
2578
|
-
const next = settings.plugins.filter((
|
|
2762
|
+
const next = settings.plugins.filter((p6) => p6 !== dir);
|
|
2579
2763
|
if (next.length !== settings.plugins.length) {
|
|
2580
2764
|
changed = true;
|
|
2581
2765
|
const updated = { ...settings, plugins: next };
|
|
@@ -2584,7 +2768,7 @@ async function uninstall(projectDir) {
|
|
|
2584
2768
|
}
|
|
2585
2769
|
}
|
|
2586
2770
|
if (existsSync(dir)) {
|
|
2587
|
-
await
|
|
2771
|
+
await fs6.rm(dir, { recursive: true, force: true });
|
|
2588
2772
|
changed = true;
|
|
2589
2773
|
}
|
|
2590
2774
|
const mcp = await readJsonStrict(mcpPath);
|
|
@@ -2594,7 +2778,7 @@ async function uninstall(projectDir) {
|
|
|
2594
2778
|
const updated = { ...mcp, mcpServers: rest };
|
|
2595
2779
|
if (Object.keys(rest).length === 0) delete updated.mcpServers;
|
|
2596
2780
|
if (Object.keys(updated).length === 0) {
|
|
2597
|
-
await
|
|
2781
|
+
await fs6.unlink(mcpPath);
|
|
2598
2782
|
} else {
|
|
2599
2783
|
await writeJson(mcpPath, updated);
|
|
2600
2784
|
}
|
|
@@ -2604,12 +2788,12 @@ async function uninstall(projectDir) {
|
|
|
2604
2788
|
async function detectInstall(projectDir) {
|
|
2605
2789
|
const dir = pluginDir(projectDir);
|
|
2606
2790
|
const settings = await readJsonStrict(
|
|
2607
|
-
|
|
2791
|
+
path36__default.join(projectDir, ".claude", "settings.json")
|
|
2608
2792
|
);
|
|
2609
|
-
if (existsSync(
|
|
2793
|
+
if (existsSync(path36__default.join(dir, ".claude-plugin", "plugin.json")) && settings?.plugins?.includes(dir)) {
|
|
2610
2794
|
return { method: "plugin", pluginPath: dir };
|
|
2611
2795
|
}
|
|
2612
|
-
const mcp = await readJsonStrict(
|
|
2796
|
+
const mcp = await readJsonStrict(path36__default.join(projectDir, ".claude", "mcp.json"));
|
|
2613
2797
|
if (mcp?.mcpServers && SKAILE_MCP_NAME in mcp.mcpServers) {
|
|
2614
2798
|
return { method: "mcp" };
|
|
2615
2799
|
}
|
|
@@ -2618,11 +2802,11 @@ async function detectInstall(projectDir) {
|
|
|
2618
2802
|
async function enable(projectDir) {
|
|
2619
2803
|
const detected = await detectInstall(projectDir);
|
|
2620
2804
|
if (!detected) throw new Error("plugin not installed for claude-code");
|
|
2621
|
-
const settingsPath =
|
|
2805
|
+
const settingsPath = path36__default.join(projectDir, ".claude", "settings.json");
|
|
2622
2806
|
const settings = await readJsonStrict(settingsPath) ?? {};
|
|
2623
2807
|
if (detected.method === "plugin") {
|
|
2624
2808
|
const disabled2 = settings.disabledPlugins ?? [];
|
|
2625
|
-
const next2 = disabled2.filter((
|
|
2809
|
+
const next2 = disabled2.filter((p6) => p6 !== detected.pluginPath);
|
|
2626
2810
|
if (next2.length === disabled2.length) return { changed: false };
|
|
2627
2811
|
const updated2 = { ...settings, disabledPlugins: next2 };
|
|
2628
2812
|
if (next2.length === 0) delete updated2.disabledPlugins;
|
|
@@ -2640,7 +2824,7 @@ async function enable(projectDir) {
|
|
|
2640
2824
|
async function disable(projectDir) {
|
|
2641
2825
|
const detected = await detectInstall(projectDir);
|
|
2642
2826
|
if (!detected) throw new Error("plugin not installed for claude-code");
|
|
2643
|
-
const settingsPath =
|
|
2827
|
+
const settingsPath = path36__default.join(projectDir, ".claude", "settings.json");
|
|
2644
2828
|
const settings = await readJsonStrict(settingsPath) ?? {};
|
|
2645
2829
|
if (detected.method === "plugin") {
|
|
2646
2830
|
const list2 = settings.disabledPlugins ?? [];
|
|
@@ -2660,12 +2844,12 @@ async function disable(projectDir) {
|
|
|
2660
2844
|
return { changed: true };
|
|
2661
2845
|
}
|
|
2662
2846
|
async function status(projectDir) {
|
|
2663
|
-
const settingsPath =
|
|
2664
|
-
const mcpPath =
|
|
2847
|
+
const settingsPath = path36__default.join(projectDir, ".claude", "settings.json");
|
|
2848
|
+
const mcpPath = path36__default.join(projectDir, ".claude", "mcp.json");
|
|
2665
2849
|
const dir = pluginDir(projectDir);
|
|
2666
2850
|
const settings = await readJsonStrict(settingsPath);
|
|
2667
2851
|
const mcp = await readJsonStrict(mcpPath);
|
|
2668
|
-
const pluginInstalled = !!(existsSync(
|
|
2852
|
+
const pluginInstalled = !!(existsSync(path36__default.join(dir, ".claude-plugin", "plugin.json")) && settings?.plugins?.includes(dir));
|
|
2669
2853
|
const mcpInstalled = !!(mcp?.mcpServers && SKAILE_MCP_NAME in mcp.mcpServers);
|
|
2670
2854
|
if (!pluginInstalled && !mcpInstalled) {
|
|
2671
2855
|
return {
|
|
@@ -2683,7 +2867,7 @@ async function status(projectDir) {
|
|
|
2683
2867
|
installed: "yes",
|
|
2684
2868
|
enabled: disabled2 ? "no" : "yes",
|
|
2685
2869
|
method: "plugin",
|
|
2686
|
-
location:
|
|
2870
|
+
location: path36__default.relative(projectDir, dir)
|
|
2687
2871
|
};
|
|
2688
2872
|
}
|
|
2689
2873
|
const disabled = settings?.disabledMcpjsonServers?.includes(SKAILE_MCP_NAME) ?? false;
|
|
@@ -2692,7 +2876,7 @@ async function status(projectDir) {
|
|
|
2692
2876
|
installed: "yes",
|
|
2693
2877
|
enabled: disabled ? "no" : "yes",
|
|
2694
2878
|
method: "mcp",
|
|
2695
|
-
location:
|
|
2879
|
+
location: path36__default.relative(projectDir, mcpPath)
|
|
2696
2880
|
};
|
|
2697
2881
|
}
|
|
2698
2882
|
var SKAILE_MCP_NAME2 = "skaile-workspace";
|
|
@@ -2703,10 +2887,10 @@ function buildEntry(projectDir) {
|
|
|
2703
2887
|
env: { SKAILE_PROJECT_DIR: projectDir }
|
|
2704
2888
|
};
|
|
2705
2889
|
}
|
|
2706
|
-
async function readConfig(
|
|
2890
|
+
async function readConfig(p6) {
|
|
2707
2891
|
let raw;
|
|
2708
2892
|
try {
|
|
2709
|
-
raw = await
|
|
2893
|
+
raw = await fs6.readFile(p6, "utf-8");
|
|
2710
2894
|
} catch {
|
|
2711
2895
|
return null;
|
|
2712
2896
|
}
|
|
@@ -2714,41 +2898,41 @@ async function readConfig(p7) {
|
|
|
2714
2898
|
return parse$1(raw);
|
|
2715
2899
|
} catch (e) {
|
|
2716
2900
|
throw new Error(
|
|
2717
|
-
`cannot parse ${
|
|
2901
|
+
`cannot parse ${p6}: ${e instanceof Error ? e.message : String(e)}; please fix or remove`
|
|
2718
2902
|
);
|
|
2719
2903
|
}
|
|
2720
2904
|
}
|
|
2721
|
-
async function writeConfig(
|
|
2722
|
-
await
|
|
2905
|
+
async function writeConfig(p6, value) {
|
|
2906
|
+
await fs6.mkdir(path36__default.dirname(p6), { recursive: true });
|
|
2723
2907
|
const cleaned = {};
|
|
2724
2908
|
for (const [k, v] of Object.entries(value)) {
|
|
2725
2909
|
if (v === void 0) continue;
|
|
2726
2910
|
cleaned[k] = v;
|
|
2727
2911
|
}
|
|
2728
|
-
await
|
|
2912
|
+
await fs6.writeFile(p6, stringify$1(cleaned));
|
|
2729
2913
|
}
|
|
2730
2914
|
function configPath(projectDir) {
|
|
2731
|
-
return
|
|
2915
|
+
return path36__default.join(projectDir, ".codex", "config.toml");
|
|
2732
2916
|
}
|
|
2733
2917
|
async function install2(projectDir) {
|
|
2734
|
-
const
|
|
2735
|
-
const cfg = await readConfig(
|
|
2918
|
+
const p6 = configPath(projectDir);
|
|
2919
|
+
const cfg = await readConfig(p6) ?? {};
|
|
2736
2920
|
const next = buildEntry(projectDir);
|
|
2737
2921
|
const servers = { ...cfg.mcp_servers ?? {} };
|
|
2738
2922
|
const previous = servers[SKAILE_MCP_NAME2];
|
|
2739
2923
|
const matches = previous && JSON.stringify(previous) === JSON.stringify(next);
|
|
2740
2924
|
let warning;
|
|
2741
2925
|
if (previous && !matches) {
|
|
2742
|
-
warning = `overwrote existing ${SKAILE_MCP_NAME2} entry in ${
|
|
2926
|
+
warning = `overwrote existing ${SKAILE_MCP_NAME2} entry in ${path36__default.relative(projectDir, p6)}`;
|
|
2743
2927
|
}
|
|
2744
2928
|
if (matches) return { changed: false, method: "toml" };
|
|
2745
2929
|
servers[SKAILE_MCP_NAME2] = next;
|
|
2746
|
-
await writeConfig(
|
|
2930
|
+
await writeConfig(p6, { ...cfg, mcp_servers: servers });
|
|
2747
2931
|
return { changed: true, method: "toml", warning };
|
|
2748
2932
|
}
|
|
2749
2933
|
async function uninstall2(projectDir) {
|
|
2750
|
-
const
|
|
2751
|
-
const cfg = await readConfig(
|
|
2934
|
+
const p6 = configPath(projectDir);
|
|
2935
|
+
const cfg = await readConfig(p6);
|
|
2752
2936
|
if (!cfg?.mcp_servers || !(SKAILE_MCP_NAME2 in cfg.mcp_servers)) {
|
|
2753
2937
|
return { changed: false };
|
|
2754
2938
|
}
|
|
@@ -2756,15 +2940,15 @@ async function uninstall2(projectDir) {
|
|
|
2756
2940
|
const updated = { ...cfg, mcp_servers: rest };
|
|
2757
2941
|
if (Object.keys(rest).length === 0) delete updated.mcp_servers;
|
|
2758
2942
|
if (Object.keys(updated).length === 0) {
|
|
2759
|
-
await
|
|
2943
|
+
await fs6.unlink(p6);
|
|
2760
2944
|
} else {
|
|
2761
|
-
await writeConfig(
|
|
2945
|
+
await writeConfig(p6, updated);
|
|
2762
2946
|
}
|
|
2763
2947
|
return { changed: true };
|
|
2764
2948
|
}
|
|
2765
2949
|
async function status2(projectDir) {
|
|
2766
|
-
const
|
|
2767
|
-
const cfg = await readConfig(
|
|
2950
|
+
const p6 = configPath(projectDir);
|
|
2951
|
+
const cfg = await readConfig(p6);
|
|
2768
2952
|
const installed = !!(cfg?.mcp_servers && SKAILE_MCP_NAME2 in cfg.mcp_servers);
|
|
2769
2953
|
if (!installed) {
|
|
2770
2954
|
return {
|
|
@@ -2780,43 +2964,43 @@ async function status2(projectDir) {
|
|
|
2780
2964
|
installed: "yes",
|
|
2781
2965
|
enabled: "n/a",
|
|
2782
2966
|
method: "mcp",
|
|
2783
|
-
location:
|
|
2967
|
+
location: path36__default.relative(projectDir, p6)
|
|
2784
2968
|
};
|
|
2785
2969
|
}
|
|
2786
2970
|
async function install3(projectDir) {
|
|
2787
|
-
const extDir =
|
|
2788
|
-
const extPath =
|
|
2789
|
-
await
|
|
2971
|
+
const extDir = path36__default.join(projectDir, ".omp", "extensions");
|
|
2972
|
+
const extPath = path36__default.join(extDir, "skaile.ts");
|
|
2973
|
+
await fs6.mkdir(extDir, { recursive: true });
|
|
2790
2974
|
const { WorkspacePlugin } = await import('../workspace-plugin/index.js');
|
|
2791
2975
|
const plugin = new WorkspacePlugin({ projectDir });
|
|
2792
2976
|
const nextSrc = await plugin.buildOmpExtensionSource();
|
|
2793
2977
|
let prevSrc = null;
|
|
2794
2978
|
try {
|
|
2795
|
-
prevSrc = await
|
|
2979
|
+
prevSrc = await fs6.readFile(extPath, "utf-8");
|
|
2796
2980
|
} catch {
|
|
2797
2981
|
}
|
|
2798
2982
|
if (prevSrc === nextSrc) return { changed: false, method: "generated" };
|
|
2799
|
-
await
|
|
2983
|
+
await fs6.writeFile(extPath, nextSrc);
|
|
2800
2984
|
return { changed: true, method: "generated" };
|
|
2801
2985
|
}
|
|
2802
2986
|
async function uninstall3(projectDir) {
|
|
2803
|
-
const extPath =
|
|
2987
|
+
const extPath = path36__default.join(projectDir, ".omp", "extensions", "skaile.ts");
|
|
2804
2988
|
try {
|
|
2805
|
-
await
|
|
2989
|
+
await fs6.unlink(extPath);
|
|
2806
2990
|
return { changed: true };
|
|
2807
2991
|
} catch {
|
|
2808
2992
|
return { changed: false };
|
|
2809
2993
|
}
|
|
2810
2994
|
}
|
|
2811
2995
|
async function status3(projectDir) {
|
|
2812
|
-
const extPath =
|
|
2996
|
+
const extPath = path36__default.join(projectDir, ".omp", "extensions", "skaile.ts");
|
|
2813
2997
|
if (existsSync(extPath)) {
|
|
2814
2998
|
return {
|
|
2815
2999
|
harness: "omp",
|
|
2816
3000
|
installed: "yes",
|
|
2817
3001
|
enabled: "n/a",
|
|
2818
3002
|
method: "extension",
|
|
2819
|
-
location:
|
|
3003
|
+
location: path36__default.relative(projectDir, extPath)
|
|
2820
3004
|
};
|
|
2821
3005
|
}
|
|
2822
3006
|
return {
|
|
@@ -2879,7 +3063,7 @@ async function installCodex(projectDir) {
|
|
|
2879
3063
|
console.log(` ${S.dim("\u2192")} Restart Codex CLI to pick up the change.`);
|
|
2880
3064
|
}
|
|
2881
3065
|
async function runInstall(opts) {
|
|
2882
|
-
const projectDir =
|
|
3066
|
+
const projectDir = path36__default.resolve(opts.projectDir);
|
|
2883
3067
|
const targets = resolveDriver(opts.driver);
|
|
2884
3068
|
let exitCode = 0;
|
|
2885
3069
|
if (targets.includes("claude-code")) {
|
|
@@ -2913,7 +3097,7 @@ async function uninstallCodex(projectDir) {
|
|
|
2913
3097
|
else logInfo(`codex: not installed`);
|
|
2914
3098
|
}
|
|
2915
3099
|
async function runUninstall(opts) {
|
|
2916
|
-
const projectDir =
|
|
3100
|
+
const projectDir = path36__default.resolve(opts.projectDir);
|
|
2917
3101
|
const targets = resolveDriver(opts.driver);
|
|
2918
3102
|
let exitCode = 0;
|
|
2919
3103
|
if (targets.includes("claude-code")) {
|
|
@@ -2956,7 +3140,7 @@ async function toggleTarget(t, projectDir, action3) {
|
|
|
2956
3140
|
});
|
|
2957
3141
|
}
|
|
2958
3142
|
async function runToggle(opts, action3) {
|
|
2959
|
-
const projectDir =
|
|
3143
|
+
const projectDir = path36__default.resolve(opts.projectDir);
|
|
2960
3144
|
const requestedAll = opts.driver === "all";
|
|
2961
3145
|
const targets = resolveDriver(opts.driver);
|
|
2962
3146
|
const usageError = checkToggleSupported(targets, requestedAll, action3);
|
|
@@ -2968,7 +3152,7 @@ async function runToggle(opts, action3) {
|
|
|
2968
3152
|
return exitCode;
|
|
2969
3153
|
}
|
|
2970
3154
|
async function runStatus2(opts) {
|
|
2971
|
-
const projectDir =
|
|
3155
|
+
const projectDir = path36__default.resolve(opts.projectDir);
|
|
2972
3156
|
const targets = resolveDriver(opts.driver);
|
|
2973
3157
|
const rows = [];
|
|
2974
3158
|
let exitCode = 0;
|
|
@@ -2997,7 +3181,7 @@ function printStatusTable(rows) {
|
|
|
2997
3181
|
const widths = cols.map(
|
|
2998
3182
|
(c) => Math.max(c.header.length, ...rows.map((r) => String(r[c.key] ?? "").length))
|
|
2999
3183
|
);
|
|
3000
|
-
const fmtRow = (parts) => parts.map((
|
|
3184
|
+
const fmtRow = (parts) => parts.map((p6, i) => p6.padEnd(widths[i] ?? p6.length)).join(" ");
|
|
3001
3185
|
console.log();
|
|
3002
3186
|
console.log(` ${S.heading(fmtRow(cols.map((c) => c.header)))}`);
|
|
3003
3187
|
for (const r of rows) {
|
|
@@ -3039,7 +3223,7 @@ async function runHook(event) {
|
|
|
3039
3223
|
await plugin.shutdown();
|
|
3040
3224
|
return;
|
|
3041
3225
|
}
|
|
3042
|
-
const store = new PluginStore(
|
|
3226
|
+
const store = new PluginStore(path36__default.join(projectDir, ".skaile", "plugin-state.json"));
|
|
3043
3227
|
await store.load();
|
|
3044
3228
|
const status4 = store.get("connector:status");
|
|
3045
3229
|
if (status4 && typeof status4 === "object" && Object.keys(status4).length > 0) {
|
|
@@ -3099,37 +3283,6 @@ function makeIntegrationCommand() {
|
|
|
3099
3283
|
cmd.action(() => cmd.help());
|
|
3100
3284
|
return cmd;
|
|
3101
3285
|
}
|
|
3102
|
-
|
|
3103
|
-
// cli/src/commands/library-index.ts
|
|
3104
|
-
async function indexLibrary(lib, index) {
|
|
3105
|
-
const { LocalCatalogSource } = await import('../library/index.js');
|
|
3106
|
-
const own = index ?? await openLibrary();
|
|
3107
|
-
try {
|
|
3108
|
-
const source = new LocalCatalogSource(own, lib.id, lib.path, createFullRegistry());
|
|
3109
|
-
const res = await source.sync();
|
|
3110
|
-
return {
|
|
3111
|
-
assetsFound: res.assetsFound,
|
|
3112
|
-
assetsUpdated: res.assetsUpdated,
|
|
3113
|
-
errors: res.errors
|
|
3114
|
-
};
|
|
3115
|
-
} finally {
|
|
3116
|
-
if (!index) own.close();
|
|
3117
|
-
}
|
|
3118
|
-
}
|
|
3119
|
-
function resolveLibraryPublisher(lib, opts, storeIdentity) {
|
|
3120
|
-
if (opts.publisher?.trim()) return opts.publisher.trim();
|
|
3121
|
-
const declared = loadSkPublishManifest(lib.path)?.publisher?.trim();
|
|
3122
|
-
if (declared) return declared.startsWith("@") ? declared.slice(1) : declared;
|
|
3123
|
-
const identity = (storeIdentity?.githubLogin ?? storeIdentity?.username)?.trim();
|
|
3124
|
-
if (identity) return identity;
|
|
3125
|
-
try {
|
|
3126
|
-
return slugifyAssetName(lib.name);
|
|
3127
|
-
} catch {
|
|
3128
|
-
return "library";
|
|
3129
|
-
}
|
|
3130
|
-
}
|
|
3131
|
-
|
|
3132
|
-
// cli/src/commands/library-cmd.ts
|
|
3133
3286
|
function exitOnSyncError(err) {
|
|
3134
3287
|
logErr(err instanceof Error ? err.message : String(err));
|
|
3135
3288
|
process.exit(1);
|
|
@@ -3143,10 +3296,42 @@ function assertManifestEditableOrExit(libraryPath) {
|
|
|
3143
3296
|
}
|
|
3144
3297
|
async function assertLibraryPathFree(manager, dir, exceptId) {
|
|
3145
3298
|
const clash = (await manager.listLibraries()).find(
|
|
3146
|
-
(l) => l.id !== exceptId &&
|
|
3299
|
+
(l) => l.id !== exceptId && path36.resolve(l.path) === dir
|
|
3147
3300
|
);
|
|
3148
3301
|
if (clash) throw new Error(`${dir} is already registered as library "${clash.name}".`);
|
|
3149
3302
|
}
|
|
3303
|
+
function canonicalDir(dir) {
|
|
3304
|
+
const abs = path36.resolve(dir);
|
|
3305
|
+
return fs12.existsSync(abs) ? fs12.realpathSync(abs) : abs;
|
|
3306
|
+
}
|
|
3307
|
+
function refuseGlobalInstallFolder(name, dir) {
|
|
3308
|
+
const reserved = globalInstallDir();
|
|
3309
|
+
const rel = path36.relative(canonicalDir(reserved), canonicalDir(dir));
|
|
3310
|
+
const inside = rel === "" || !rel.startsWith("..") && !path36.isAbsolute(rel);
|
|
3311
|
+
if (name === GLOBAL_INSTALL_DIR_NAME || inside) {
|
|
3312
|
+
logErr(
|
|
3313
|
+
`"${GLOBAL_INSTALL_DIR_NAME}" is reserved: ${reserved} holds assets from \`skaile install\`, not a library you author.`
|
|
3314
|
+
);
|
|
3315
|
+
process.exit(1);
|
|
3316
|
+
}
|
|
3317
|
+
}
|
|
3318
|
+
function readOriginTracking(dir) {
|
|
3319
|
+
if (!isGitRepo(dir)) return null;
|
|
3320
|
+
const origin = spawnSync("git", ["remote", "get-url", "origin"], { cwd: dir, encoding: "utf-8" });
|
|
3321
|
+
const url = origin.status === 0 ? origin.stdout.trim() : "";
|
|
3322
|
+
if (!url) return null;
|
|
3323
|
+
const head = spawnSync("git", ["symbolic-ref", "--short", "HEAD"], {
|
|
3324
|
+
cwd: dir,
|
|
3325
|
+
encoding: "utf-8"
|
|
3326
|
+
});
|
|
3327
|
+
return { url, branch: head.status === 0 && head.stdout.trim() || "main" };
|
|
3328
|
+
}
|
|
3329
|
+
function requireGitBackend(lib, verb) {
|
|
3330
|
+
if (lib.backend !== "git") {
|
|
3331
|
+
logErr(`\`library ${verb}\` only applies to git-backed libraries.`);
|
|
3332
|
+
process.exit(1);
|
|
3333
|
+
}
|
|
3334
|
+
}
|
|
3150
3335
|
function scaffoldLibraryFiles(dir, name) {
|
|
3151
3336
|
const readme = `# ${name}
|
|
3152
3337
|
|
|
@@ -3176,9 +3361,9 @@ by the same ref.
|
|
|
3176
3361
|
];
|
|
3177
3362
|
const written = [];
|
|
3178
3363
|
for (const [file, content] of files) {
|
|
3179
|
-
const target =
|
|
3180
|
-
if (
|
|
3181
|
-
|
|
3364
|
+
const target = path36.join(dir, file);
|
|
3365
|
+
if (fs12.existsSync(target)) continue;
|
|
3366
|
+
fs12.writeFileSync(target, content, "utf8");
|
|
3182
3367
|
written.push(file);
|
|
3183
3368
|
}
|
|
3184
3369
|
return written;
|
|
@@ -3253,12 +3438,13 @@ function makeLibraryCommand() {
|
|
|
3253
3438
|
);
|
|
3254
3439
|
process.exit(1);
|
|
3255
3440
|
}
|
|
3256
|
-
const libPath = opts.path ?
|
|
3257
|
-
|
|
3441
|
+
const libPath = opts.path ? path36.resolve(opts.path) : path36.join(resolveLibraryDir(), name);
|
|
3442
|
+
refuseGlobalInstallFolder(name, libPath);
|
|
3443
|
+
if (fs12.existsSync(libPath) && !fs12.statSync(libPath).isDirectory()) {
|
|
3258
3444
|
logErr(`${libPath} exists and is not a directory.`);
|
|
3259
3445
|
process.exit(1);
|
|
3260
3446
|
}
|
|
3261
|
-
const { manager, close } = await openLibraryManager();
|
|
3447
|
+
const { manager, library, close } = await openLibraryManager();
|
|
3262
3448
|
try {
|
|
3263
3449
|
if (await manager.getLibrary(name)) {
|
|
3264
3450
|
logErr(`A library named "${name}" is already registered.`);
|
|
@@ -3268,6 +3454,7 @@ function makeLibraryCommand() {
|
|
|
3268
3454
|
const hasDefault = (await manager.listLibraries()).some((l) => l.isDefault);
|
|
3269
3455
|
let backend = "local";
|
|
3270
3456
|
let backendConfig;
|
|
3457
|
+
let adoptedOrigin = false;
|
|
3271
3458
|
if (opts.git) {
|
|
3272
3459
|
const { branch, reason } = cloneOrInitGitRepo(libPath, opts.git, "main");
|
|
3273
3460
|
if (reason) {
|
|
@@ -3278,9 +3465,16 @@ function makeLibraryCommand() {
|
|
|
3278
3465
|
backend = "git";
|
|
3279
3466
|
backendConfig = { url: opts.git, branch, authHint: "ssh" };
|
|
3280
3467
|
} else {
|
|
3281
|
-
|
|
3468
|
+
const origin = readOriginTracking(libPath);
|
|
3469
|
+
if (origin) {
|
|
3470
|
+
backend = "git";
|
|
3471
|
+
backendConfig = { url: origin.url, branch: origin.branch, authHint: "ssh" };
|
|
3472
|
+
adoptedOrigin = true;
|
|
3473
|
+
} else {
|
|
3474
|
+
fs12.mkdirSync(libPath, { recursive: true });
|
|
3475
|
+
}
|
|
3282
3476
|
}
|
|
3283
|
-
const blank =
|
|
3477
|
+
const blank = fs12.readdirSync(libPath).every((entry) => entry === ".git");
|
|
3284
3478
|
const isDefault = !hasDefault && ownership !== "reader";
|
|
3285
3479
|
await manager.addLibrary({
|
|
3286
3480
|
name,
|
|
@@ -3295,6 +3489,16 @@ function makeLibraryCommand() {
|
|
|
3295
3489
|
`Library "${name}" ${blank ? "created" : "registered"} at ${libPath}${isDefault ? " (default)" : ""}`
|
|
3296
3490
|
);
|
|
3297
3491
|
if (scaffolded.length > 0) logInfo(`Scaffolded ${scaffolded.join(", ")}.`);
|
|
3492
|
+
if (adoptedOrigin && backendConfig) {
|
|
3493
|
+
logInfo(`Adopted existing git clone as a git library tracking ${backendConfig.url}.`);
|
|
3494
|
+
}
|
|
3495
|
+
if (!blank) {
|
|
3496
|
+
const lib = await manager.requireLibrary(name);
|
|
3497
|
+
const res = await indexLibrary(lib, library);
|
|
3498
|
+
for (const e of res.errors) logWarn(e);
|
|
3499
|
+
logOk(`Indexed ${res.assetsUpdated} asset(s) from ${name}.`);
|
|
3500
|
+
warnIgnoredDomainFiles(libPath);
|
|
3501
|
+
}
|
|
3298
3502
|
} catch (err) {
|
|
3299
3503
|
exitOnSyncError(err);
|
|
3300
3504
|
} finally {
|
|
@@ -3326,7 +3530,7 @@ function makeLibraryCommand() {
|
|
|
3326
3530
|
});
|
|
3327
3531
|
cmd.command("create <kind> <name>").description("Scaffold a new asset inside the default (or named) library").addOption(new Option("--kind <kind>", "Asset kind override").choices([...ASSET_KINDS])).option("--library <name>", "Target library (default: the default-marked one)").option("--dir <dir>", "Target directory inside the library (default: library root)").option("--publisher <name>", "Publisher for the new asset (default: the library's default)").option(
|
|
3328
3532
|
"--description <text>",
|
|
3329
|
-
"Description for the
|
|
3533
|
+
"Description for the asset's frontmatter \u2014 say what it does and when to use it (default: a TODO placeholder `skaile validate` rejects)"
|
|
3330
3534
|
).action(
|
|
3331
3535
|
async (kind, name, opts) => {
|
|
3332
3536
|
if (!ASSET_KINDS.includes(kind)) {
|
|
@@ -3346,7 +3550,7 @@ function makeLibraryCommand() {
|
|
|
3346
3550
|
assertManifestEditableOrExit(target.path);
|
|
3347
3551
|
const effectiveKind = opts.kind ?? kind;
|
|
3348
3552
|
const am2 = new AssetManager({ projectDir: process.cwd() });
|
|
3349
|
-
const destDir = opts.dir ?
|
|
3553
|
+
const destDir = opts.dir ? path36.join(target.path, opts.dir) : target.path;
|
|
3350
3554
|
const res = am2.create(name, effectiveKind, destDir, { description: opts.description });
|
|
3351
3555
|
if (!res.ok) {
|
|
3352
3556
|
logErr(res.path);
|
|
@@ -3358,21 +3562,14 @@ function makeLibraryCommand() {
|
|
|
3358
3562
|
"Description is a TODO placeholder \u2014 edit it (what the skill does and when to use it) or `skaile validate` will fail."
|
|
3359
3563
|
);
|
|
3360
3564
|
}
|
|
3361
|
-
const
|
|
3362
|
-
stampAssetPublisher(res.path, publisher);
|
|
3363
|
-
stampManifestPublisher(target.path, publisher);
|
|
3364
|
-
upsertManifestAsset(target.path, {
|
|
3565
|
+
const { ref } = await registerLibraryAsset(target, library, {
|
|
3365
3566
|
kind: effectiveKind,
|
|
3366
3567
|
name,
|
|
3367
|
-
|
|
3568
|
+
assetDir: res.path,
|
|
3368
3569
|
version: "0.1.0",
|
|
3369
|
-
publisher
|
|
3570
|
+
publisher: opts.publisher
|
|
3370
3571
|
});
|
|
3371
|
-
|
|
3372
|
-
for (const e of idx.errors) logWarn(e);
|
|
3373
|
-
logOk(
|
|
3374
|
-
`Indexed \u2014 add it with \`skaile add ${refFor(effectiveKind, publisher, name, "0.1.0")}\``
|
|
3375
|
-
);
|
|
3572
|
+
logOk(`Indexed \u2014 add it with \`skaile add ${ref}\``);
|
|
3376
3573
|
} finally {
|
|
3377
3574
|
close();
|
|
3378
3575
|
}
|
|
@@ -3402,34 +3599,59 @@ function makeLibraryCommand() {
|
|
|
3402
3599
|
const { manager, close } = await openLibraryManager();
|
|
3403
3600
|
try {
|
|
3404
3601
|
const lib = await manager.requireLibrary(oldName);
|
|
3405
|
-
const parent =
|
|
3406
|
-
const newPath =
|
|
3407
|
-
|
|
3602
|
+
const parent = path36.dirname(lib.path);
|
|
3603
|
+
const newPath = path36.join(parent, newName);
|
|
3604
|
+
refuseGlobalInstallFolder(newName, newPath);
|
|
3605
|
+
if (fs12.existsSync(newPath)) {
|
|
3408
3606
|
logErr(`Target directory already exists: ${newPath}`);
|
|
3409
3607
|
process.exit(1);
|
|
3410
3608
|
}
|
|
3411
|
-
|
|
3609
|
+
fs12.renameSync(lib.path, newPath);
|
|
3412
3610
|
await manager.updateLibrary(lib.id, { name: newName, path: newPath });
|
|
3413
3611
|
logOk(`Renamed ${oldName} \u2192 ${newName}`);
|
|
3414
3612
|
} finally {
|
|
3415
3613
|
close();
|
|
3416
3614
|
}
|
|
3417
3615
|
});
|
|
3418
|
-
cmd.command("set <name> <field=value>").description(
|
|
3616
|
+
cmd.command("set <name> <field=value>").description(
|
|
3617
|
+
"Update a single library field (ownership, isDefault, path, publisher, backendConfig.<key>)"
|
|
3618
|
+
).action(async (name, expr) => {
|
|
3419
3619
|
const [field, ...rest] = expr.split("=");
|
|
3420
3620
|
const value = rest.join("=");
|
|
3421
|
-
const { manager, close } = await openLibraryManager();
|
|
3621
|
+
const { manager, library, close } = await openLibraryManager();
|
|
3422
3622
|
try {
|
|
3423
3623
|
const lib = await manager.requireLibrary(name);
|
|
3624
|
+
if (field === "publisher") {
|
|
3625
|
+
const publisher = value.trim().replace(/^@/, "");
|
|
3626
|
+
if (!/^[^\s/#@]+$/.test(publisher)) {
|
|
3627
|
+
logErr(
|
|
3628
|
+
`Invalid publisher "${value}": expected a bare name like "acme" (no @, /, # or spaces).`
|
|
3629
|
+
);
|
|
3630
|
+
process.exit(1);
|
|
3631
|
+
}
|
|
3632
|
+
if (lib.ownership === "reader") {
|
|
3633
|
+
logErr(
|
|
3634
|
+
`Library "${lib.name}" is read-only (ownership=reader); its publisher is not yours to set.`
|
|
3635
|
+
);
|
|
3636
|
+
process.exit(1);
|
|
3637
|
+
}
|
|
3638
|
+
assertManifestEditableOrExit(lib.path);
|
|
3639
|
+
setManifestPublisher(lib.path, publisher);
|
|
3640
|
+
const res = await indexLibrary(lib, library);
|
|
3641
|
+
for (const e of res.errors) logWarn(e);
|
|
3642
|
+
logOk(`Updated ${name}.publisher \u2192 ${publisher}`);
|
|
3643
|
+
return;
|
|
3644
|
+
}
|
|
3424
3645
|
const patch = {};
|
|
3425
3646
|
if (field === "ownership") patch.ownership = value;
|
|
3426
3647
|
else if (field === "isDefault") patch.isDefault = value === "true";
|
|
3427
3648
|
else if (field === "path") {
|
|
3428
|
-
const dir =
|
|
3429
|
-
if (!
|
|
3649
|
+
const dir = path36.resolve(value);
|
|
3650
|
+
if (!fs12.existsSync(dir) || !fs12.statSync(dir).isDirectory()) {
|
|
3430
3651
|
logErr(`Directory does not exist: ${dir}. \`library set path=\` does not move files.`);
|
|
3431
3652
|
process.exit(1);
|
|
3432
3653
|
}
|
|
3654
|
+
refuseGlobalInstallFolder(null, dir);
|
|
3433
3655
|
await assertLibraryPathFree(manager, dir, lib.id);
|
|
3434
3656
|
patch.path = dir;
|
|
3435
3657
|
} else if (field.startsWith("backendConfig.")) {
|
|
@@ -3458,11 +3680,11 @@ function makeLibraryCommand() {
|
|
|
3458
3680
|
const { manager, close } = await openLibraryManager();
|
|
3459
3681
|
try {
|
|
3460
3682
|
if (!opts.yes) {
|
|
3461
|
-
const confirmed = await
|
|
3683
|
+
const confirmed = await p4.confirm({
|
|
3462
3684
|
message: `Remove library "${name}"${opts.purge ? " AND delete its directory" : ""}?`,
|
|
3463
3685
|
initialValue: false
|
|
3464
3686
|
});
|
|
3465
|
-
if (!confirmed ||
|
|
3687
|
+
if (!confirmed || p4.isCancel(confirmed)) {
|
|
3466
3688
|
logInfo("Cancelled.");
|
|
3467
3689
|
return;
|
|
3468
3690
|
}
|
|
@@ -3477,10 +3699,11 @@ function makeLibraryCommand() {
|
|
|
3477
3699
|
const { manager, close } = await openLibraryManager();
|
|
3478
3700
|
try {
|
|
3479
3701
|
const lib = await manager.requireLibrary(name);
|
|
3702
|
+
requireGitBackend(lib, "sync");
|
|
3480
3703
|
const drv = manager.driverFor(lib.backend);
|
|
3481
3704
|
const pull = await drv.pull(lib);
|
|
3482
3705
|
logInfo(`Pulled: applied=${pull.applied}, conflicts=${pull.conflicts.length}`);
|
|
3483
|
-
if (lib.ownership === "owner"
|
|
3706
|
+
if (lib.ownership === "owner") {
|
|
3484
3707
|
const push = await drv.push(lib);
|
|
3485
3708
|
logInfo(`Pushed: ${push.pushed}`);
|
|
3486
3709
|
}
|
|
@@ -3507,8 +3730,14 @@ function makeLibraryCommand() {
|
|
|
3507
3730
|
logInfo(`Removed manifest entry ${ref} (root ${a.root} is gone)`);
|
|
3508
3731
|
}
|
|
3509
3732
|
const res = await indexLibrary(lib, library);
|
|
3510
|
-
|
|
3733
|
+
const unparsable = res.errors.filter((e) => e.includes("ManifestSchemaError:"));
|
|
3734
|
+
for (const e of res.errors) (unparsable.includes(e) ? logErr : logWarn)(e);
|
|
3511
3735
|
logOk(`Indexed ${res.assetsUpdated} asset(s) from ${name}.`);
|
|
3736
|
+
warnIgnoredDomainFiles(lib.path);
|
|
3737
|
+
if (unparsable.length > 0) {
|
|
3738
|
+
logErr(`${unparsable.length} asset(s) skipped: manifest could not be parsed.`);
|
|
3739
|
+
process.exitCode = 1;
|
|
3740
|
+
}
|
|
3512
3741
|
} finally {
|
|
3513
3742
|
close();
|
|
3514
3743
|
}
|
|
@@ -3517,6 +3746,7 @@ function makeLibraryCommand() {
|
|
|
3517
3746
|
const { manager, close } = await openLibraryManager();
|
|
3518
3747
|
try {
|
|
3519
3748
|
const lib = await manager.requireLibrary(name);
|
|
3749
|
+
requireGitBackend(lib, "pull");
|
|
3520
3750
|
const res = await manager.driverFor(lib.backend).pull(lib);
|
|
3521
3751
|
if (res.conflicts.length > 0) {
|
|
3522
3752
|
logWarn(`Conflicts: ${res.conflicts.map((c) => c.path).join(", ")}`);
|
|
@@ -3533,6 +3763,7 @@ function makeLibraryCommand() {
|
|
|
3533
3763
|
const { manager, close } = await openLibraryManager();
|
|
3534
3764
|
try {
|
|
3535
3765
|
const lib = await manager.requireLibrary(name);
|
|
3766
|
+
requireGitBackend(lib, "push");
|
|
3536
3767
|
const res = await manager.driverFor(lib.backend).push(lib, { force: opts.force });
|
|
3537
3768
|
logOk(`Pushed (${res.pushed}).`);
|
|
3538
3769
|
} catch (err) {
|
|
@@ -3557,10 +3788,7 @@ function makeLibraryCommand() {
|
|
|
3557
3788
|
const { manager, close } = await openLibraryManager();
|
|
3558
3789
|
try {
|
|
3559
3790
|
const lib = await manager.requireLibrary(name);
|
|
3560
|
-
|
|
3561
|
-
logErr("`library commit` only applies to git-backed libraries.");
|
|
3562
|
-
process.exit(1);
|
|
3563
|
-
}
|
|
3791
|
+
requireGitBackend(lib, "commit");
|
|
3564
3792
|
if (!isGitRepo(lib.path)) {
|
|
3565
3793
|
logErr(
|
|
3566
3794
|
`${lib.path} is not a git repository. Run \`skaile library link ${name} <url>\` to initialise it.`
|
|
@@ -3597,6 +3825,10 @@ function makeLibraryCommand() {
|
|
|
3597
3825
|
close();
|
|
3598
3826
|
}
|
|
3599
3827
|
});
|
|
3828
|
+
cmd.command("domain", { hidden: true }).description("Removed in 5.0 (domains were removed)").allowUnknownOption().allowExcessArguments().argument("[args...]").action(() => {
|
|
3829
|
+
logErr(DOMAIN_REMOVED_HINT);
|
|
3830
|
+
process.exit(1);
|
|
3831
|
+
});
|
|
3600
3832
|
cmd.command("git <name> [args...]").description("Pass-through: run arbitrary git commands inside the library").allowUnknownOption().passThroughOptions().action(async (name, rawArgs) => {
|
|
3601
3833
|
const args = rawArgs[0] === "--" ? rawArgs.slice(1) : rawArgs;
|
|
3602
3834
|
const { manager, close } = await openLibraryManager();
|
|
@@ -3617,16 +3849,16 @@ function makeLibraryCommand() {
|
|
|
3617
3849
|
"With --create-repo: create the repo private (the store only accepts public repos)"
|
|
3618
3850
|
).option("--ref <gitref>", "Git ref to ingest (default: the library branch or main)").option("--dry-run", "Print the plan; push nothing and call no store endpoint").action(
|
|
3619
3851
|
async (lib, opts) => {
|
|
3620
|
-
const { runLibraryPublish } = await import('../library-publish-
|
|
3852
|
+
const { runLibraryPublish } = await import('../library-publish-62RFU74A.js');
|
|
3621
3853
|
await withStoreErrorHandling(() => runLibraryPublish(lib, opts));
|
|
3622
3854
|
}
|
|
3623
3855
|
);
|
|
3624
3856
|
cmd.command("register <lib>").description("Register the library's manifest without pushing (bytes already on github)").option("--asset <ref>", "Publish only the single asset matching this ref/name").option("--ref <gitref>", "Git ref to ingest (default: the library branch or main)").option("--dry-run", "Print the plan; call no store endpoint").action(async (lib, opts) => {
|
|
3625
|
-
const { runLibraryRegister } = await import('../library-publish-
|
|
3857
|
+
const { runLibraryRegister } = await import('../library-publish-62RFU74A.js');
|
|
3626
3858
|
await withStoreErrorHandling(() => runLibraryRegister(lib, opts));
|
|
3627
3859
|
});
|
|
3628
3860
|
cmd.command("yank <lib>").description("Retract the library's published assets from the store").option("--asset <ref>", "Yank only the single asset matching this ref/name").action(async (lib, opts) => {
|
|
3629
|
-
const { runLibraryYank } = await import('../library-publish-
|
|
3861
|
+
const { runLibraryYank } = await import('../library-publish-62RFU74A.js');
|
|
3630
3862
|
await withStoreErrorHandling(() => runLibraryYank(lib, opts));
|
|
3631
3863
|
});
|
|
3632
3864
|
return cmd;
|
|
@@ -3639,36 +3871,6 @@ async function withStoreErrorHandling(fn) {
|
|
|
3639
3871
|
process.exit(1);
|
|
3640
3872
|
}
|
|
3641
3873
|
}
|
|
3642
|
-
function stampAssetPublisher(assetDir, publisher) {
|
|
3643
|
-
const markers = ["SKILL.md", "AGENT.md", "CONTRACT.md"];
|
|
3644
|
-
let markerFile;
|
|
3645
|
-
for (const m of markers) {
|
|
3646
|
-
if (fs11.existsSync(path35.join(assetDir, m))) {
|
|
3647
|
-
markerFile = path35.join(assetDir, m);
|
|
3648
|
-
break;
|
|
3649
|
-
}
|
|
3650
|
-
}
|
|
3651
|
-
if (!markerFile) {
|
|
3652
|
-
const promptMd = fs11.readdirSync(assetDir).find((f) => f.endsWith(".prompt.md"));
|
|
3653
|
-
if (promptMd) markerFile = path35.join(assetDir, promptMd);
|
|
3654
|
-
}
|
|
3655
|
-
if (!markerFile) return;
|
|
3656
|
-
try {
|
|
3657
|
-
const { data, body } = parseFrontmatter(fs11.readFileSync(markerFile, "utf8"));
|
|
3658
|
-
const meta = data.metadata && typeof data.metadata === "object" && !Array.isArray(data.metadata) ? { ...data.metadata } : {};
|
|
3659
|
-
if (meta.publisher != null) return;
|
|
3660
|
-
meta.publisher = publisher;
|
|
3661
|
-
data.metadata = meta;
|
|
3662
|
-
const fm = stringify(data).trimEnd();
|
|
3663
|
-
fs11.writeFileSync(markerFile, `---
|
|
3664
|
-
${fm}
|
|
3665
|
-
---
|
|
3666
|
-
|
|
3667
|
-
${body}
|
|
3668
|
-
`, "utf8");
|
|
3669
|
-
} catch {
|
|
3670
|
-
}
|
|
3671
|
-
}
|
|
3672
3874
|
async function printPerLibraryStatus(name, asJson) {
|
|
3673
3875
|
const { manager, close } = await openLibraryManager();
|
|
3674
3876
|
try {
|
|
@@ -3707,9 +3909,9 @@ async function printOverallStatus(projectDir, asJson) {
|
|
|
3707
3909
|
} catch {
|
|
3708
3910
|
secretsStrategy = "unavailable";
|
|
3709
3911
|
}
|
|
3710
|
-
const resolvedProjectDir =
|
|
3711
|
-
const hasWorkspaceConfig = existsSync(
|
|
3712
|
-
const hasLockFile = existsSync(
|
|
3912
|
+
const resolvedProjectDir = path36.resolve(projectDir);
|
|
3913
|
+
const hasWorkspaceConfig = existsSync(path36.join(resolvedProjectDir, "skaile.yaml"));
|
|
3914
|
+
const hasLockFile = existsSync(path36.join(resolvedProjectDir, "skaile.lock.yaml"));
|
|
3713
3915
|
let assignments = [];
|
|
3714
3916
|
if (hasWorkspaceConfig) {
|
|
3715
3917
|
try {
|
|
@@ -4316,7 +4518,7 @@ function scheduleSoftDepPreview() {
|
|
|
4316
4518
|
}
|
|
4317
4519
|
async function loadAssets() {
|
|
4318
4520
|
softDepPreviewCache.clear();
|
|
4319
|
-
const { gatherAssetFeeds } = await import('../asset-feeds-
|
|
4521
|
+
const { gatherAssetFeeds } = await import('../asset-feeds-3MVRNS5U.js');
|
|
4320
4522
|
const { entries, notes } = await gatherAssetFeeds(am, am.projectDir);
|
|
4321
4523
|
if (notes.length > 0) {
|
|
4322
4524
|
state.message = notes.map((n) => `[${n.feed}] ${n.message}`).join(" \u2022 ");
|
|
@@ -4336,7 +4538,7 @@ function rebuildSourceTree() {
|
|
|
4336
4538
|
rebuildVisibleSources();
|
|
4337
4539
|
}
|
|
4338
4540
|
function sourceOrgRepo(s) {
|
|
4339
|
-
const parts = s.path.split(
|
|
4541
|
+
const parts = s.path.split(path36__default.sep).filter(Boolean);
|
|
4340
4542
|
if (parts.length < 2) return null;
|
|
4341
4543
|
return { org: parts[parts.length - 2], repo: parts[parts.length - 1] };
|
|
4342
4544
|
}
|
|
@@ -4483,13 +4685,13 @@ function reconcileCollapsedSets(rows) {
|
|
|
4483
4685
|
async function loadSourcesAndLibraries() {
|
|
4484
4686
|
try {
|
|
4485
4687
|
const [{ openLibraryManager: openLibraryManager2 }, { getGlobalCacheDir: getGlobalCacheDir2, globalSkaileDir: globalSkaileDir2 }] = await Promise.all([
|
|
4486
|
-
import('../open-library-
|
|
4688
|
+
import('../open-library-NVG3CZUO.js'),
|
|
4487
4689
|
import('../core/index.js')
|
|
4488
4690
|
]);
|
|
4489
4691
|
const { manager, library, close } = await openLibraryManager2();
|
|
4490
4692
|
try {
|
|
4491
4693
|
const newRoot = getGlobalCacheDir2();
|
|
4492
|
-
const legacyRoot =
|
|
4694
|
+
const legacyRoot = path36__default.join(globalSkaileDir2(), "sources");
|
|
4493
4695
|
const isSourceRow = (l) => l.path.startsWith(newRoot) || l.path.startsWith(legacyRoot);
|
|
4494
4696
|
const libs = await manager.listLibraries();
|
|
4495
4697
|
const defs = await library.listAssetDefs();
|
|
@@ -5425,13 +5627,13 @@ async function run(projectDir) {
|
|
|
5425
5627
|
}
|
|
5426
5628
|
function makeManageCommand() {
|
|
5427
5629
|
return new Command("manage").description("Interactive TUI for managing assets, sources, and libraries").option("--project-dir <path>", "Project directory", process.cwd()).action(async (opts) => {
|
|
5428
|
-
await run(
|
|
5630
|
+
await run(path36__default.resolve(opts.projectDir));
|
|
5429
5631
|
});
|
|
5430
5632
|
}
|
|
5431
5633
|
function makeMcpServerCommand() {
|
|
5432
5634
|
return new Command("mcp-server").description("Start skaile workspace MCP server (stdio transport)").option("--project-dir <path>", "Project directory (default: cwd)", process.cwd()).action(async (opts) => {
|
|
5433
|
-
const
|
|
5434
|
-
const projectDir =
|
|
5635
|
+
const path39 = await import('path');
|
|
5636
|
+
const projectDir = path39.default.resolve(opts.projectDir);
|
|
5435
5637
|
const { LogStore, StdoutSink, registerLogStore } = await import('../core/logging.js');
|
|
5436
5638
|
registerLogStore(
|
|
5437
5639
|
new LogStore({
|
|
@@ -5601,7 +5803,7 @@ function workspaceConfigFiles(dir) {
|
|
|
5601
5803
|
} catch {
|
|
5602
5804
|
return [];
|
|
5603
5805
|
}
|
|
5604
|
-
return names.filter((name) => isWorkspaceConfigFilename(name)).sort().map((name) =>
|
|
5806
|
+
return names.filter((name) => isWorkspaceConfigFilename(name)).sort().map((name) => path36__default.join(dir, name));
|
|
5605
5807
|
}
|
|
5606
5808
|
function readAgentConfigBlock(raw) {
|
|
5607
5809
|
const key = AGENT_CONFIG_KEYS.find((candidate) => raw[candidate] !== void 0);
|
|
@@ -5613,7 +5815,7 @@ function readAgentConfigBlock(raw) {
|
|
|
5613
5815
|
return flat ? { key, profiles: { default: profiles }, flat } : { key, profiles, flat };
|
|
5614
5816
|
}
|
|
5615
5817
|
function planProviderMigration(options) {
|
|
5616
|
-
const projectDir =
|
|
5818
|
+
const projectDir = path36__default.resolve(options.projectDir);
|
|
5617
5819
|
const registryPath = options.workspace ? workspaceProviderRegistryPath(projectDir) : userProviderRegistryPath();
|
|
5618
5820
|
const plan = {
|
|
5619
5821
|
registryPath,
|
|
@@ -5629,7 +5831,7 @@ function planProviderMigration(options) {
|
|
|
5629
5831
|
raw = parseDocument(readFileSync(file, "utf-8")).toJS() ?? {};
|
|
5630
5832
|
} catch (error) {
|
|
5631
5833
|
plan.warnings.push(
|
|
5632
|
-
`${
|
|
5834
|
+
`${path36__default.basename(file)}: not valid YAML (${error instanceof Error ? error.message : String(error)}) \u2014 skipped`
|
|
5633
5835
|
);
|
|
5634
5836
|
continue;
|
|
5635
5837
|
}
|
|
@@ -5678,7 +5880,7 @@ function planProviderMigration(options) {
|
|
|
5678
5880
|
});
|
|
5679
5881
|
if (!model) {
|
|
5680
5882
|
plan.warnings.push(
|
|
5681
|
-
`${
|
|
5883
|
+
`${path36__default.basename(file)}: profile '${profile}' had no model: \u2014 it now resolves against registry order. Pin it with 'model: ${providerId}/<modelId>'.`
|
|
5682
5884
|
);
|
|
5683
5885
|
}
|
|
5684
5886
|
touched = true;
|
|
@@ -5745,7 +5947,7 @@ function printPlan(plan) {
|
|
|
5745
5947
|
for (const entry of plan.entries) {
|
|
5746
5948
|
const base = entry.entry.base_url ?? S.dim("(transport-derived)");
|
|
5747
5949
|
console.log(
|
|
5748
|
-
` ${S.label(`${
|
|
5950
|
+
` ${S.label(`${path36__default.basename(entry.file)} ${entry.profile}`)} provider: ${entry.legacy.provider}, cloud: ${entry.legacy.cloud}`
|
|
5749
5951
|
);
|
|
5750
5952
|
console.log(` \u2192 providers.yml ${S.bold(entry.providerId)} ${base}`);
|
|
5751
5953
|
console.log(
|
|
@@ -5761,7 +5963,7 @@ function printPlan(plan) {
|
|
|
5761
5963
|
console.log();
|
|
5762
5964
|
}
|
|
5763
5965
|
async function runMigrateProviders(opts) {
|
|
5764
|
-
const projectDir = opts.projectDir ?
|
|
5966
|
+
const projectDir = opts.projectDir ? path36__default.resolve(opts.projectDir) : process.cwd();
|
|
5765
5967
|
const plan = planProviderMigration({ projectDir, workspace: opts.workspace });
|
|
5766
5968
|
for (const warning of plan.warnings) logWarn(warning);
|
|
5767
5969
|
if (plan.entries.length === 0 && Object.keys(plan.providers).length === 0) {
|
|
@@ -5821,8 +6023,8 @@ function makeNpxCommand() {
|
|
|
5821
6023
|
skills.command("add <url>").description(
|
|
5822
6024
|
"Clone a repo, register it in the project's skaile.yaml sources[], and install a skill from it"
|
|
5823
6025
|
).requiredOption("--skill <name>", "Skill name to install from the repo").option("--project-dir <path>", "Project directory", process.cwd()).option("--target <agent>", `Agent framework (${TARGET_DEFAULT_HINT})`).option("--global", "Deploy globally").action(async (url, opts) => {
|
|
5824
|
-
const projectDir =
|
|
5825
|
-
const projYaml =
|
|
6026
|
+
const projectDir = path36__default.resolve(opts.projectDir);
|
|
6027
|
+
const projYaml = path36__default.join(projectDir, "skaile.yaml");
|
|
5826
6028
|
if (!existsSync(projYaml)) {
|
|
5827
6029
|
logErr(`No skaile.yaml in ${projectDir} \u2014 run \`skaile init\` first.`);
|
|
5828
6030
|
process.exit(1);
|
|
@@ -5833,18 +6035,18 @@ function makeNpxCommand() {
|
|
|
5833
6035
|
);
|
|
5834
6036
|
process.exit(1);
|
|
5835
6037
|
}
|
|
5836
|
-
const
|
|
6038
|
+
const spinner = createSpinner();
|
|
5837
6039
|
const key = sourceCacheKey(url);
|
|
5838
|
-
const clonePath =
|
|
5839
|
-
|
|
6040
|
+
const clonePath = path36__default.join(getGlobalCacheDir(), key);
|
|
6041
|
+
spinner.start(`Cloning ${url}`);
|
|
5840
6042
|
try {
|
|
5841
6043
|
if (!existsSync(clonePath)) {
|
|
5842
|
-
mkdirSync(
|
|
6044
|
+
mkdirSync(path36__default.dirname(clonePath), { recursive: true });
|
|
5843
6045
|
execSync(`git clone ${url} ${clonePath}`, { stdio: "ignore" });
|
|
5844
6046
|
}
|
|
5845
|
-
|
|
6047
|
+
spinner.stop(`Cloned to ${key}`);
|
|
5846
6048
|
} catch (err) {
|
|
5847
|
-
|
|
6049
|
+
spinner.stop("Clone failed");
|
|
5848
6050
|
logErr(err instanceof Error ? err.message : String(err));
|
|
5849
6051
|
process.exit(1);
|
|
5850
6052
|
}
|
|
@@ -5864,10 +6066,10 @@ function makeNpxCommand() {
|
|
|
5864
6066
|
}
|
|
5865
6067
|
const skillRef = `skill:@${publisher}/${skillName}`;
|
|
5866
6068
|
const am2 = new AssetManager({ projectDir, global: opts.global, driverTarget: opts.target });
|
|
5867
|
-
|
|
6069
|
+
spinner.start(`Installing ${skillRef}`);
|
|
5868
6070
|
try {
|
|
5869
6071
|
const added = await am2.add(skillRef);
|
|
5870
|
-
|
|
6072
|
+
spinner.stop("Done");
|
|
5871
6073
|
if (added.length === 0) {
|
|
5872
6074
|
logInfo(`${opts.skill} already deployed or not found in source.`);
|
|
5873
6075
|
} else {
|
|
@@ -5875,7 +6077,7 @@ function makeNpxCommand() {
|
|
|
5875
6077
|
}
|
|
5876
6078
|
logInfo(`Source registered in skaile.yaml \u2014 manage via ${S.cmd("skaile source")}.`);
|
|
5877
6079
|
} catch (err) {
|
|
5878
|
-
|
|
6080
|
+
spinner.stop("Failed");
|
|
5879
6081
|
logErr(err.message);
|
|
5880
6082
|
process.exit(1);
|
|
5881
6083
|
}
|
|
@@ -5885,7 +6087,7 @@ function makeNpxCommand() {
|
|
|
5885
6087
|
return npx;
|
|
5886
6088
|
}
|
|
5887
6089
|
function resolvePublisher(clonePath, url) {
|
|
5888
|
-
const manifestPath =
|
|
6090
|
+
const manifestPath = path36__default.join(clonePath, SKAILE_MANIFEST_FILENAME);
|
|
5889
6091
|
if (existsSync(manifestPath)) {
|
|
5890
6092
|
try {
|
|
5891
6093
|
const { manifest } = decodeSkaileManifest(readFileSync(manifestPath, "utf8"));
|
|
@@ -5898,12 +6100,12 @@ function resolvePublisher(clonePath, url) {
|
|
|
5898
6100
|
return url.match(/github\.com[/:]([^/]+)\/[^/]+/)?.[1];
|
|
5899
6101
|
}
|
|
5900
6102
|
function resolveSkillName(clonePath, requested) {
|
|
5901
|
-
const skillsDir =
|
|
5902
|
-
if (existsSync(
|
|
6103
|
+
const skillsDir = path36__default.join(clonePath, "skills");
|
|
6104
|
+
if (existsSync(path36__default.join(skillsDir, requested, "SKILL.md"))) return requested;
|
|
5903
6105
|
if (!existsSync(skillsDir)) return requested;
|
|
5904
6106
|
for (const entry of readdirSync(skillsDir, { withFileTypes: true })) {
|
|
5905
6107
|
if (!entry.isDirectory()) continue;
|
|
5906
|
-
const md =
|
|
6108
|
+
const md = path36__default.join(skillsDir, entry.name, "SKILL.md");
|
|
5907
6109
|
if (!existsSync(md)) continue;
|
|
5908
6110
|
try {
|
|
5909
6111
|
const { data } = parseFrontmatter(readFileSync(md, "utf8"));
|
|
@@ -5933,7 +6135,7 @@ function makeOutdatedCommand() {
|
|
|
5933
6135
|
)
|
|
5934
6136
|
).action(async (filter, opts) => {
|
|
5935
6137
|
const am2 = new AssetManager({
|
|
5936
|
-
projectDir:
|
|
6138
|
+
projectDir: path36__default.resolve(opts.projectDir),
|
|
5937
6139
|
driverTarget: opts.target
|
|
5938
6140
|
});
|
|
5939
6141
|
const entries = await am2.outdated();
|
|
@@ -5951,19 +6153,24 @@ function makeOutdatedCommand() {
|
|
|
5951
6153
|
console.log(S.heading(" Outdated Assets"));
|
|
5952
6154
|
console.log(` ${S.rule(refW + 34)}`);
|
|
5953
6155
|
for (const e of filtered) {
|
|
5954
|
-
const status4 = e.library !== void 0 ? `${e.currentVersion} \u2192 ${e.latestVersion} ${S.dim(`(library ${e.library})`)}` : `${e.behind} commit(s) behind`;
|
|
6156
|
+
const status4 = e.problem !== void 0 ? e.problem : e.library !== void 0 ? `${e.currentVersion} \u2192 ${e.latestVersion} ${S.dim(`(library ${e.library})`)}` : `${e.behind} commit(s) behind`;
|
|
5955
6157
|
console.log(
|
|
5956
|
-
` ${colorRef(outdatedRef(e))}${" ".repeat(refW - outdatedRef(e).length)} ${pc5.yellow(status4)}`
|
|
6158
|
+
` ${colorRef(outdatedRef(e))}${" ".repeat(refW - outdatedRef(e).length)} ${e.problem !== void 0 ? pc5.red(status4) : pc5.yellow(status4)}`
|
|
5957
6159
|
);
|
|
5958
6160
|
}
|
|
5959
6161
|
console.log();
|
|
5960
|
-
|
|
6162
|
+
if (filtered.some((e) => e.problem === void 0)) {
|
|
6163
|
+
logWarn(`Run ${S.cmd("skaile update")} to re-deploy.`);
|
|
6164
|
+
}
|
|
6165
|
+
if (filtered.some((e) => e.problem !== void 0)) {
|
|
6166
|
+
logWarn(`Run ${S.cmd("skaile install")} to restore or re-lock the broken assets.`);
|
|
6167
|
+
}
|
|
5961
6168
|
});
|
|
5962
6169
|
}
|
|
5963
6170
|
function makePatchCommand() {
|
|
5964
6171
|
const cmd = new Command("patch").description("Patch workflow for skill improvement");
|
|
5965
6172
|
cmd.command("extract <ref>").alias("start").description("Extract asset for local editing").option("--project-dir <path>", "Project directory", process.cwd()).action(async (ref, opts) => {
|
|
5966
|
-
const am2 = new AssetManager({ projectDir:
|
|
6173
|
+
const am2 = new AssetManager({ projectDir: path36__default.resolve(opts.projectDir) });
|
|
5967
6174
|
try {
|
|
5968
6175
|
const dest = await am2.patch(ref);
|
|
5969
6176
|
logOk(`Extracted to ${S.dim(dest)}`);
|
|
@@ -5974,7 +6181,7 @@ function makePatchCommand() {
|
|
|
5974
6181
|
}
|
|
5975
6182
|
});
|
|
5976
6183
|
cmd.command("commit <ref>").description("Generate .patch file from edits").option("--project-dir <path>", "Project directory", process.cwd()).action(async (ref, opts) => {
|
|
5977
|
-
const am2 = new AssetManager({ projectDir:
|
|
6184
|
+
const am2 = new AssetManager({ projectDir: path36__default.resolve(opts.projectDir) });
|
|
5978
6185
|
try {
|
|
5979
6186
|
const patchFile = await am2.patchCommit(ref);
|
|
5980
6187
|
logOk(`Patch saved to ${S.dim(patchFile)}`);
|
|
@@ -5985,7 +6192,7 @@ function makePatchCommand() {
|
|
|
5985
6192
|
}
|
|
5986
6193
|
});
|
|
5987
6194
|
cmd.command("submit <ref>").description("Apply patch to repo clone and prepare for PR").option("--project-dir <path>", "Project directory", process.cwd()).action(async (ref, opts) => {
|
|
5988
|
-
const am2 = new AssetManager({ projectDir:
|
|
6195
|
+
const am2 = new AssetManager({ projectDir: path36__default.resolve(opts.projectDir) });
|
|
5989
6196
|
try {
|
|
5990
6197
|
await am2.patchSubmit(ref);
|
|
5991
6198
|
logOk("Patch applied to repo clone and committed.");
|
|
@@ -5998,7 +6205,7 @@ function makePatchCommand() {
|
|
|
5998
6205
|
}
|
|
5999
6206
|
});
|
|
6000
6207
|
cmd.command("remove <ref>").description("Remove local patch after upstream merge").option("--project-dir <path>", "Project directory", process.cwd()).action((ref, opts) => {
|
|
6001
|
-
const am2 = new AssetManager({ projectDir:
|
|
6208
|
+
const am2 = new AssetManager({ projectDir: path36__default.resolve(opts.projectDir) });
|
|
6002
6209
|
am2.patchRemove(ref);
|
|
6003
6210
|
logOk(`Patch removed for ${ref}`);
|
|
6004
6211
|
});
|
|
@@ -6016,7 +6223,7 @@ function action2(fn) {
|
|
|
6016
6223
|
};
|
|
6017
6224
|
}
|
|
6018
6225
|
async function reconcileAndReport(projectDir, plugins) {
|
|
6019
|
-
const { reconcilePlugins } = await import('../plugin-store-
|
|
6226
|
+
const { reconcilePlugins } = await import('../plugin-store-2DTEIJTG.js');
|
|
6020
6227
|
if (plugins.length === 0) {
|
|
6021
6228
|
logInfo("No plugins declared \u2014 nothing to reconcile.");
|
|
6022
6229
|
return;
|
|
@@ -6030,10 +6237,10 @@ async function reconcileAndReport(projectDir, plugins) {
|
|
|
6030
6237
|
}
|
|
6031
6238
|
}
|
|
6032
6239
|
async function runInstall2(spec, opts) {
|
|
6033
|
-
const projectDir =
|
|
6240
|
+
const projectDir = path36__default.resolve(opts.projectDir);
|
|
6034
6241
|
const { WorkspaceYamlEditor: WorkspaceYamlEditor2 } = await import('../core/index.js');
|
|
6035
|
-
const { specName } = await import('../plugin-store-
|
|
6036
|
-
const yamlPath =
|
|
6242
|
+
const { specName } = await import('../plugin-store-2DTEIJTG.js');
|
|
6243
|
+
const yamlPath = path36__default.join(projectDir, "skaile.yaml");
|
|
6037
6244
|
const editor = WorkspaceYamlEditor2.load(yamlPath);
|
|
6038
6245
|
const replaced = editor.addPlugin(spec, specName);
|
|
6039
6246
|
editor.save();
|
|
@@ -6042,10 +6249,10 @@ async function runInstall2(spec, opts) {
|
|
|
6042
6249
|
await reconcileAndReport(projectDir, editor.getPlugins());
|
|
6043
6250
|
}
|
|
6044
6251
|
async function runRemove(name, opts) {
|
|
6045
|
-
const projectDir =
|
|
6252
|
+
const projectDir = path36__default.resolve(opts.projectDir);
|
|
6046
6253
|
const { WorkspaceYamlEditor: WorkspaceYamlEditor2 } = await import('../core/index.js');
|
|
6047
|
-
const { specName } = await import('../plugin-store-
|
|
6048
|
-
const yamlPath =
|
|
6254
|
+
const { specName } = await import('../plugin-store-2DTEIJTG.js');
|
|
6255
|
+
const yamlPath = path36__default.join(projectDir, "skaile.yaml");
|
|
6049
6256
|
const editor = WorkspaceYamlEditor2.load(yamlPath);
|
|
6050
6257
|
const removed = editor.removePlugin(name, specName);
|
|
6051
6258
|
if (!removed) {
|
|
@@ -6057,7 +6264,7 @@ async function runRemove(name, opts) {
|
|
|
6057
6264
|
await reconcileAndReport(projectDir, editor.getPlugins());
|
|
6058
6265
|
}
|
|
6059
6266
|
async function runList(opts) {
|
|
6060
|
-
const projectDir =
|
|
6267
|
+
const projectDir = path36__default.resolve(opts.projectDir);
|
|
6061
6268
|
const { resolveSkWorkspaceConfig: resolveSkWorkspaceConfig2 } = await import('../core/index.js');
|
|
6062
6269
|
const config = resolveSkWorkspaceConfig2(projectDir);
|
|
6063
6270
|
const declared = config.plugins ?? [];
|
|
@@ -6072,7 +6279,7 @@ async function runList(opts) {
|
|
|
6072
6279
|
const registry = createPluginRegistry();
|
|
6073
6280
|
if (declared.length > 0) {
|
|
6074
6281
|
try {
|
|
6075
|
-
const { loadPlugins } = await import('../plugin-store-
|
|
6282
|
+
const { loadPlugins } = await import('../plugin-store-2DTEIJTG.js');
|
|
6076
6283
|
const result = await loadPlugins(projectDir, declared, registry);
|
|
6077
6284
|
for (const f of result.failed) logWarn(f.error);
|
|
6078
6285
|
} catch (err) {
|
|
@@ -6247,7 +6454,7 @@ function neededSources(config, lock) {
|
|
|
6247
6454
|
}
|
|
6248
6455
|
function sourcesWithSidecar(sources) {
|
|
6249
6456
|
const dir = getStoreManifestsDir();
|
|
6250
|
-
return sources.filter((s) => existsSync(
|
|
6457
|
+
return sources.filter((s) => existsSync(path36.join(dir, `${storeManifestSlug(s.url)}.yaml`))).map((s) => s.url);
|
|
6251
6458
|
}
|
|
6252
6459
|
function compact(obj) {
|
|
6253
6460
|
const out = {};
|
|
@@ -6339,8 +6546,8 @@ function redactSecrets(preset, findings) {
|
|
|
6339
6546
|
}
|
|
6340
6547
|
return { preset: next, keys };
|
|
6341
6548
|
}
|
|
6342
|
-
function placeholderKey(itemId,
|
|
6343
|
-
return `${itemId}_${
|
|
6549
|
+
function placeholderKey(itemId, path39) {
|
|
6550
|
+
return `${itemId}_${path39}`.replace(/[^a-zA-Z0-9]+/g, "_").replace(/^_+|_+$/g, "").toUpperCase();
|
|
6344
6551
|
}
|
|
6345
6552
|
function setAtPath(root, segments, value) {
|
|
6346
6553
|
let node = root;
|
|
@@ -6363,7 +6570,7 @@ function makePresetCommand() {
|
|
|
6363
6570
|
cmd.command("init [name]").description("Scaffold a new .preset.yaml file").option("--dir <path>", "Output directory", process.cwd()).action(async (name, opts) => {
|
|
6364
6571
|
const presetName = name ?? "my-preset";
|
|
6365
6572
|
const filename = `${presetName}.preset.yaml`;
|
|
6366
|
-
const outPath =
|
|
6573
|
+
const outPath = path36__default.join(path36__default.resolve(opts.dir), filename);
|
|
6367
6574
|
if (existsSync(outPath)) {
|
|
6368
6575
|
logErr(`File already exists: ${outPath}`);
|
|
6369
6576
|
logInfo("Choose a different name or remove the existing file.");
|
|
@@ -6396,7 +6603,7 @@ function makePresetCommand() {
|
|
|
6396
6603
|
return cmd;
|
|
6397
6604
|
}
|
|
6398
6605
|
async function runPresetExport(name, opts) {
|
|
6399
|
-
const projectDir =
|
|
6606
|
+
const projectDir = path36__default.resolve(opts.projectDir);
|
|
6400
6607
|
const file = loadSkWorkspaceConfig(projectDir);
|
|
6401
6608
|
if (!file) {
|
|
6402
6609
|
logErr(`No skaile.yaml found in ${projectDir}`);
|
|
@@ -6406,7 +6613,7 @@ async function runPresetExport(name, opts) {
|
|
|
6406
6613
|
const presetName = name ?? file.config.name ?? "my-preset";
|
|
6407
6614
|
let lock = null;
|
|
6408
6615
|
try {
|
|
6409
|
-
lock = readLock(
|
|
6616
|
+
lock = readLock(path36__default.join(projectDir, "skaile.lock.yaml"));
|
|
6410
6617
|
} catch {
|
|
6411
6618
|
lock = null;
|
|
6412
6619
|
}
|
|
@@ -6447,7 +6654,7 @@ async function runPresetExport(name, opts) {
|
|
|
6447
6654
|
const contents = header ? `${header}
|
|
6448
6655
|
${body}` : body;
|
|
6449
6656
|
if (opts.out && opts.dir !== process.cwd()) logWarn("--dir is ignored when --out is set.");
|
|
6450
|
-
const outPath = opts.out ?
|
|
6657
|
+
const outPath = opts.out ? path36__default.resolve(opts.out) : path36__default.join(path36__default.resolve(opts.dir), `${presetName}.preset.yaml`);
|
|
6451
6658
|
if (existsSync(outPath) && !opts.force) {
|
|
6452
6659
|
logErr(`File already exists: ${outPath}`);
|
|
6453
6660
|
logInfo("Pass --force to overwrite, or choose a different --out/--dir.");
|
|
@@ -6459,7 +6666,7 @@ ${body}` : body;
|
|
|
6459
6666
|
logErr(`Failed to write ${outPath}: ${e.message}`);
|
|
6460
6667
|
process.exit(1);
|
|
6461
6668
|
}
|
|
6462
|
-
logOk(`Exported ${S.brand(
|
|
6669
|
+
logOk(`Exported ${S.brand(path36__default.basename(outPath))}`);
|
|
6463
6670
|
logInfo(`Path: ${outPath}`);
|
|
6464
6671
|
if (unresolved.length > 0) {
|
|
6465
6672
|
console.error(S.err("This file is NOT safe to share."));
|
|
@@ -6500,13 +6707,13 @@ function collectInput(value, acc) {
|
|
|
6500
6707
|
return acc;
|
|
6501
6708
|
}
|
|
6502
6709
|
async function runPresetApply(filePath, opts) {
|
|
6503
|
-
const projectDir =
|
|
6710
|
+
const projectDir = path36__default.resolve(opts.projectDir);
|
|
6504
6711
|
const file = loadSkWorkspaceConfig(projectDir);
|
|
6505
6712
|
if (!file) {
|
|
6506
6713
|
logErr("No skaile.yaml \u2014 run `skaile init` first");
|
|
6507
6714
|
process.exit(1);
|
|
6508
6715
|
}
|
|
6509
|
-
const resolved =
|
|
6716
|
+
const resolved = path36__default.resolve(filePath);
|
|
6510
6717
|
if (!existsSync(resolved)) {
|
|
6511
6718
|
logErr(`File not found: ${resolved}`);
|
|
6512
6719
|
process.exit(1);
|
|
@@ -6722,7 +6929,7 @@ async function reportNestedPresetRefs(preset) {
|
|
|
6722
6929
|
}
|
|
6723
6930
|
async function checkPresetCycles(preset, resolved) {
|
|
6724
6931
|
const { detectCycles } = await import('../discovery/index.js');
|
|
6725
|
-
const presetRef =
|
|
6932
|
+
const presetRef = path36__default.basename(resolved, ".preset.yaml");
|
|
6726
6933
|
const edges = [];
|
|
6727
6934
|
for (const item of preset.items) {
|
|
6728
6935
|
if (item.ref) {
|
|
@@ -6774,7 +6981,7 @@ function printPresetSummary(preset, placeholderCount, hasWarnings) {
|
|
|
6774
6981
|
}
|
|
6775
6982
|
}
|
|
6776
6983
|
async function runPresetValidate(filePath) {
|
|
6777
|
-
const resolved =
|
|
6984
|
+
const resolved = path36__default.resolve(filePath);
|
|
6778
6985
|
const preset = await loadPresetForValidation(resolved);
|
|
6779
6986
|
await reportNestedPresetRefs(preset);
|
|
6780
6987
|
await checkPresetCycles(preset, resolved);
|
|
@@ -6824,11 +7031,11 @@ items:
|
|
|
6824
7031
|
}
|
|
6825
7032
|
function makeRebuildCommand() {
|
|
6826
7033
|
return new Command("rebuild").description("Re-snapshot inline-snapshot composition items and bump prompt version").argument("[agent]", "Agent name or path (defaults to current project agent)").option("--project-dir <dir>", "Project directory", process.cwd()).action(async (agentArg, opts) => {
|
|
6827
|
-
const projectDir =
|
|
7034
|
+
const projectDir = path36__default.resolve(opts.projectDir);
|
|
6828
7035
|
let agentDir;
|
|
6829
7036
|
if (agentArg) {
|
|
6830
7037
|
if (agentArg.includes("/") || agentArg.includes("\\")) {
|
|
6831
|
-
agentDir =
|
|
7038
|
+
agentDir = path36__default.resolve(projectDir, agentArg);
|
|
6832
7039
|
} else {
|
|
6833
7040
|
let resolved;
|
|
6834
7041
|
try {
|
|
@@ -6837,7 +7044,7 @@ function makeRebuildCommand() {
|
|
|
6837
7044
|
if (!(err instanceof AgentRefResolutionError)) throw err;
|
|
6838
7045
|
logWarn(`${err.message} \u2014 using "${agentArg}"`);
|
|
6839
7046
|
}
|
|
6840
|
-
agentDir = resolved ??
|
|
7047
|
+
agentDir = resolved ?? path36__default.resolve(projectDir, agentArg);
|
|
6841
7048
|
}
|
|
6842
7049
|
} else {
|
|
6843
7050
|
let resolved;
|
|
@@ -6938,7 +7145,7 @@ function makeFlowEventHandler() {
|
|
|
6938
7145
|
}
|
|
6939
7146
|
function makeRunCommand() {
|
|
6940
7147
|
const cmd = new Command("run").description("Start a flow or run a single-shot text prompt").argument("[flow-id-or-text...]", "Flow ID or text prompt").option("--project-dir <path>", "Project directory", process.cwd()).option("--driver <name>", "Harness to run (claude-sdk, codex, omp)").option("--model <name>", "Model override").option("--label <label>", "Human-readable session label").option("--dry-run", "Print plan without executing").option("--skill <name>", "Skill name (for single-shot mode)").action(async (positional, opts) => {
|
|
6941
|
-
const projectDir =
|
|
7148
|
+
const projectDir = path36__default.resolve(opts.projectDir);
|
|
6942
7149
|
const cliDriver = opts.driver;
|
|
6943
7150
|
const dryRun = opts.dryRun ?? false;
|
|
6944
7151
|
let flowId = positional[0];
|
|
@@ -6948,7 +7155,7 @@ function makeRunCommand() {
|
|
|
6948
7155
|
logErr("No flows available.");
|
|
6949
7156
|
process.exit(1);
|
|
6950
7157
|
}
|
|
6951
|
-
const selected = await
|
|
7158
|
+
const selected = await p4.select({
|
|
6952
7159
|
message: "Select a flow to run",
|
|
6953
7160
|
options: flows.map((f) => ({
|
|
6954
7161
|
value: f.id,
|
|
@@ -6956,8 +7163,8 @@ function makeRunCommand() {
|
|
|
6956
7163
|
hint: f.description
|
|
6957
7164
|
}))
|
|
6958
7165
|
});
|
|
6959
|
-
if (
|
|
6960
|
-
|
|
7166
|
+
if (p4.isCancel(selected)) {
|
|
7167
|
+
p4.cancel("Cancelled.");
|
|
6961
7168
|
process.exit(0);
|
|
6962
7169
|
}
|
|
6963
7170
|
flowId = selected;
|
|
@@ -7039,7 +7246,7 @@ function makeRunCommand() {
|
|
|
7039
7246
|
}
|
|
7040
7247
|
function makeResumeCommand() {
|
|
7041
7248
|
const cmd = new Command("resume").description("Resume current session").option("--project-dir <path>", "Project directory", process.cwd()).option("--session <run-id>", "Target session by runId").option("--dry-run", "Print plan without executing").action(async (opts) => {
|
|
7042
|
-
const projectDir =
|
|
7249
|
+
const projectDir = path36__default.resolve(opts.projectDir);
|
|
7043
7250
|
const sessionId = opts.session;
|
|
7044
7251
|
const dryRun = opts.dryRun ?? false;
|
|
7045
7252
|
const session = sessionId ? await loadSessionById(projectDir, sessionId) : await loadSession(projectDir);
|
|
@@ -7066,7 +7273,7 @@ function makeResumeCommand() {
|
|
|
7066
7273
|
}
|
|
7067
7274
|
function makeStatusCommand() {
|
|
7068
7275
|
return new Command("status").description("Show current session state").option("--project-dir <path>", "Project directory", process.cwd()).action(async (opts) => {
|
|
7069
|
-
const projectDir =
|
|
7276
|
+
const projectDir = path36__default.resolve(opts.projectDir);
|
|
7070
7277
|
const session = await loadSession(projectDir);
|
|
7071
7278
|
if (!session) {
|
|
7072
7279
|
logInfo("No active session.");
|
|
@@ -7091,7 +7298,7 @@ function makeStatusCommand() {
|
|
|
7091
7298
|
}
|
|
7092
7299
|
function makeClearCommand() {
|
|
7093
7300
|
return new Command("clear").description("Unset current session pointer").option("--project-dir <path>", "Project directory", process.cwd()).action(async (opts) => {
|
|
7094
|
-
const projectDir =
|
|
7301
|
+
const projectDir = path36__default.resolve(opts.projectDir);
|
|
7095
7302
|
await clearSession(projectDir);
|
|
7096
7303
|
logOk("Session cleared.");
|
|
7097
7304
|
});
|
|
@@ -7101,7 +7308,7 @@ function makeReplCommand() {
|
|
|
7101
7308
|
const { findWorkspaceRoot } = await import('../core/index.js');
|
|
7102
7309
|
const { startRepl } = await import('../tui/index.js');
|
|
7103
7310
|
const os2 = await import('os');
|
|
7104
|
-
const userCwd =
|
|
7311
|
+
const userCwd = path36__default.resolve(opts.projectDir ?? process.cwd());
|
|
7105
7312
|
const workspaceRoot = findWorkspaceRoot(userCwd);
|
|
7106
7313
|
let projectDir;
|
|
7107
7314
|
let agentCwd;
|
|
@@ -7116,20 +7323,20 @@ function makeReplCommand() {
|
|
|
7116
7323
|
console.log();
|
|
7117
7324
|
logWarn(`No skaile.yaml found in ${S.cmd(userCwd)} or any parent directory.`);
|
|
7118
7325
|
console.log();
|
|
7119
|
-
const shouldCreate = await
|
|
7326
|
+
const shouldCreate = await p4.confirm({
|
|
7120
7327
|
message: "Create a temporary workspace? (session state in /tmp/)"
|
|
7121
7328
|
});
|
|
7122
|
-
if (
|
|
7123
|
-
|
|
7329
|
+
if (p4.isCancel(shouldCreate) || !shouldCreate) {
|
|
7330
|
+
p4.cancel("Cancelled.");
|
|
7124
7331
|
process.exit(0);
|
|
7125
7332
|
}
|
|
7126
|
-
const tmpDir =
|
|
7333
|
+
const tmpDir = fs12__default.mkdtempSync(path36__default.join(os2.tmpdir(), "skaile-repl-"));
|
|
7127
7334
|
projectDir = tmpDir;
|
|
7128
7335
|
agentCwd = userCwd;
|
|
7129
7336
|
logOk(`Temporary workspace: ${S.cmd(tmpDir)}`);
|
|
7130
7337
|
if (!driverOverride) {
|
|
7131
|
-
const claudeDir =
|
|
7132
|
-
if (
|
|
7338
|
+
const claudeDir = path36__default.join(os2.homedir(), ".claude");
|
|
7339
|
+
if (fs12__default.existsSync(claudeDir)) {
|
|
7133
7340
|
driverOverride = "claude-sdk";
|
|
7134
7341
|
logInfo(`Detected ${S.cmd("~/.claude")} \u2192 using ${S.cmd("claude-sdk")} harness`);
|
|
7135
7342
|
} else {
|
|
@@ -7201,12 +7408,12 @@ function makeServeCommand() {
|
|
|
7201
7408
|
);
|
|
7202
7409
|
}
|
|
7203
7410
|
async function ensurePluginsLoadedForServe(projectDir) {
|
|
7204
|
-
const { logInfo: logInfo2, logWarn: logWarn2 } = await import('../helpers-
|
|
7411
|
+
const { logInfo: logInfo2, logWarn: logWarn2 } = await import('../helpers-F2RFRT5D.js');
|
|
7205
7412
|
try {
|
|
7206
7413
|
const { resolveSkWorkspaceConfig: resolveSkWorkspaceConfig2 } = await import('../core/index.js');
|
|
7207
7414
|
const config = resolveSkWorkspaceConfig2(projectDir);
|
|
7208
7415
|
if (!config.plugins || config.plugins.length === 0) return;
|
|
7209
|
-
const { ensurePluginsLoaded } = await import('../plugin-store-
|
|
7416
|
+
const { ensurePluginsLoaded } = await import('../plugin-store-2DTEIJTG.js');
|
|
7210
7417
|
const { pluginRegistry } = await import('../plugin-registry/index.js');
|
|
7211
7418
|
const result = await ensurePluginsLoaded(projectDir, config.plugins, pluginRegistry);
|
|
7212
7419
|
if (result.loaded.length > 0) {
|
|
@@ -7220,21 +7427,21 @@ async function ensurePluginsLoadedForServe(projectDir) {
|
|
|
7220
7427
|
}
|
|
7221
7428
|
}
|
|
7222
7429
|
async function runCompileTest(opts) {
|
|
7223
|
-
const { logOk: logOk2, logErr: logErr2, logInfo: logInfo2, S: S2 } = await import('../helpers-
|
|
7430
|
+
const { logOk: logOk2, logErr: logErr2, logInfo: logInfo2, S: S2 } = await import('../helpers-F2RFRT5D.js');
|
|
7224
7431
|
const { tmpdir } = await import('os');
|
|
7225
|
-
const { dirname: dirname3, join:
|
|
7432
|
+
const { dirname: dirname3, join: join7, resolve: resolve5 } = await import('path');
|
|
7226
7433
|
const { fileURLToPath: fileURLToPath2 } = await import('url');
|
|
7227
|
-
const { unlinkSync, existsSync:
|
|
7434
|
+
const { unlinkSync, existsSync: existsSync16 } = await import('fs');
|
|
7228
7435
|
const { spawn } = await import('child_process');
|
|
7229
7436
|
const { portableSpawnSync: portableSpawnSync2 } = await import('../core/index.js');
|
|
7230
|
-
const { MONOREPO_ROOT } = await import('../paths-
|
|
7437
|
+
const { MONOREPO_ROOT } = await import('../paths-STQO4FYF.js');
|
|
7231
7438
|
if (MONOREPO_ROOT === null) {
|
|
7232
7439
|
logErr2("--compile-test is only available inside the skaile-dev workspace.");
|
|
7233
7440
|
logInfo2("Run it from a checkout of skaile-ai/skaile-dev (the monorepo shell).");
|
|
7234
7441
|
process.exitCode = 2;
|
|
7235
7442
|
return;
|
|
7236
7443
|
}
|
|
7237
|
-
const outfile =
|
|
7444
|
+
const outfile = join7(tmpdir(), `skaile-compile-test-${Date.now()}`);
|
|
7238
7445
|
const __thisFile = fileURLToPath2(import.meta.url);
|
|
7239
7446
|
const entryPoint = resolve5(dirname3(__thisFile), "..", "index.ts");
|
|
7240
7447
|
logInfo2(`Building compiled binary...`);
|
|
@@ -7289,7 +7496,7 @@ async function runCompileTest(opts) {
|
|
|
7289
7496
|
} catch {
|
|
7290
7497
|
}
|
|
7291
7498
|
try {
|
|
7292
|
-
if (
|
|
7499
|
+
if (existsSync16(outfile)) unlinkSync(outfile);
|
|
7293
7500
|
} catch {
|
|
7294
7501
|
}
|
|
7295
7502
|
}
|
|
@@ -7710,7 +7917,7 @@ function resolveMode(opts) {
|
|
|
7710
7917
|
if (opts.forceLocal && opts.forceRemote) {
|
|
7711
7918
|
throw new Error("Cannot use both --local and --remote");
|
|
7712
7919
|
}
|
|
7713
|
-
const startDir =
|
|
7920
|
+
const startDir = path36__default.resolve(opts.projectDir ?? process.cwd());
|
|
7714
7921
|
const localDb = findLogsDb(startDir);
|
|
7715
7922
|
if (opts.forceLocal) {
|
|
7716
7923
|
if (!localDb) {
|
|
@@ -7743,14 +7950,14 @@ function resolveMode(opts) {
|
|
|
7743
7950
|
function findLogsDb(startDir) {
|
|
7744
7951
|
let dir = startDir;
|
|
7745
7952
|
for (let i = 0; i < MAX_WALK_LEVELS; i++) {
|
|
7746
|
-
const candidate =
|
|
7953
|
+
const candidate = path36__default.join(dir, ".skaile", "logs.db");
|
|
7747
7954
|
if (existsSync(candidate)) {
|
|
7748
7955
|
try {
|
|
7749
7956
|
if (statSync(candidate).isFile()) return candidate;
|
|
7750
7957
|
} catch {
|
|
7751
7958
|
}
|
|
7752
7959
|
}
|
|
7753
|
-
const parent =
|
|
7960
|
+
const parent = path36__default.dirname(dir);
|
|
7754
7961
|
if (parent === dir) return void 0;
|
|
7755
7962
|
dir = parent;
|
|
7756
7963
|
}
|
|
@@ -7925,7 +8132,7 @@ function parsePositiveInt(value, flag) {
|
|
|
7925
8132
|
function makeSessionCommand() {
|
|
7926
8133
|
const cmd = new Command("session").description("Manage sessions");
|
|
7927
8134
|
cmd.command("list").description("List all sessions for a project").option("--project-dir <path>", "Project directory", process.cwd()).action(async (opts) => {
|
|
7928
|
-
const projectDir =
|
|
8135
|
+
const projectDir = path36__default.resolve(opts.projectDir);
|
|
7929
8136
|
const sessions = await listSessions(projectDir);
|
|
7930
8137
|
const current = await loadSession(projectDir);
|
|
7931
8138
|
if (sessions.length === 0) {
|
|
@@ -7953,7 +8160,7 @@ function makeSessionCommand() {
|
|
|
7953
8160
|
console.log();
|
|
7954
8161
|
});
|
|
7955
8162
|
cmd.command("show <run-id>").description("Show a specific session").option("--project-dir <path>", "Project directory", process.cwd()).action(async (runId, opts) => {
|
|
7956
|
-
const projectDir =
|
|
8163
|
+
const projectDir = path36__default.resolve(opts.projectDir);
|
|
7957
8164
|
const session = await loadSessionById(projectDir, runId);
|
|
7958
8165
|
if (!session) {
|
|
7959
8166
|
logErr(`Session not found: ${runId}`);
|
|
@@ -7962,12 +8169,12 @@ function makeSessionCommand() {
|
|
|
7962
8169
|
console.log(JSON.stringify(session, null, 2));
|
|
7963
8170
|
});
|
|
7964
8171
|
cmd.command("switch <run-id>").description("Switch the current session").option("--project-dir <path>", "Project directory", process.cwd()).action(async (runId, opts) => {
|
|
7965
|
-
const projectDir =
|
|
8172
|
+
const projectDir = path36__default.resolve(opts.projectDir);
|
|
7966
8173
|
await setCurrentSession(projectDir, runId);
|
|
7967
8174
|
logOk(`Switched to session: ${S.dim(runId.slice(0, 8))}`);
|
|
7968
8175
|
});
|
|
7969
8176
|
cmd.command("delete <run-id>").description("Delete a session").option("--project-dir <path>", "Project directory", process.cwd()).action(async (runId, opts) => {
|
|
7970
|
-
const projectDir =
|
|
8177
|
+
const projectDir = path36__default.resolve(opts.projectDir);
|
|
7971
8178
|
await deleteSession(projectDir, runId);
|
|
7972
8179
|
logOk(`Deleted session: ${S.dim(runId.slice(0, 8))}`);
|
|
7973
8180
|
});
|
|
@@ -8021,12 +8228,12 @@ function showOverview(am2) {
|
|
|
8021
8228
|
}
|
|
8022
8229
|
async function showAsset(am2, kind, name) {
|
|
8023
8230
|
const entry = await am2.info(`${kind}:${name}`);
|
|
8024
|
-
if (entry?.source &&
|
|
8231
|
+
if (entry?.source && fs12__default.existsSync(entry.source)) {
|
|
8025
8232
|
console.log();
|
|
8026
8233
|
console.log(` ${kindColor(entry.kind)} ${S.heading(entry.name)}`);
|
|
8027
8234
|
console.log(` ${S.rule(40)}`);
|
|
8028
8235
|
console.log();
|
|
8029
|
-
console.log(
|
|
8236
|
+
console.log(fs12__default.readFileSync(entry.source, "utf-8"));
|
|
8030
8237
|
return;
|
|
8031
8238
|
}
|
|
8032
8239
|
logErr(`Asset not found: ${kind}:${name}`);
|
|
@@ -8035,7 +8242,7 @@ async function showAsset(am2, kind, name) {
|
|
|
8035
8242
|
function makeShowCommand() {
|
|
8036
8243
|
return new Command("show").description("Show deployed assets overview, or print asset content").argument("[kind]", "Asset kind (skill, agent, prompt, flow, bundle, contract)").argument("[name]", "Asset name").option("--project-dir <path>", "Project directory", process.cwd()).option("--target <agent>", `Agent framework (${TARGET_DEFAULT_HINT})`).action(async (kind, name, opts) => {
|
|
8037
8244
|
const am2 = new AssetManager({
|
|
8038
|
-
projectDir:
|
|
8245
|
+
projectDir: path36__default.resolve(opts.projectDir),
|
|
8039
8246
|
driverTarget: opts.target
|
|
8040
8247
|
});
|
|
8041
8248
|
if (!kind) {
|
|
@@ -8098,14 +8305,14 @@ function makeStoreCommand() {
|
|
|
8098
8305
|
});
|
|
8099
8306
|
store.command("mode <auto|local|remote>").description("Set the catalog resolution mode (not yet wired)").action((_mode) => {
|
|
8100
8307
|
logErr(
|
|
8101
|
-
|
|
8308
|
+
`\`skaile store mode\` is scaffolded but not yet wired. Store config lives at ${path36__default.join(globalSkaileDir(), "store", "config.yaml")}.`
|
|
8102
8309
|
);
|
|
8103
8310
|
process.exit(2);
|
|
8104
8311
|
});
|
|
8105
8312
|
store.command("search <query>").description("Search the AI Asset Store catalog by name, description, or publisher").option("--kind <kind>", "Filter by asset kind (skill, agent, prompt, flow, \u2026)").option("-C, --project-dir <dir>", "Project directory (catalog config overlay)", process.cwd()).action(async (query, opts) => {
|
|
8106
|
-
const { openCatalogSource: openCatalogSource2, LocalCatalogDisabledError } = await import('../open-library-
|
|
8313
|
+
const { openCatalogSource: openCatalogSource2, LocalCatalogDisabledError } = await import('../open-library-NVG3CZUO.js');
|
|
8107
8314
|
try {
|
|
8108
|
-
const remote = await openCatalogSource2({ projectDir:
|
|
8315
|
+
const remote = await openCatalogSource2({ projectDir: path36__default.resolve(opts.projectDir) });
|
|
8109
8316
|
const assets = await remote.listAssets(opts.kind ? { kind: opts.kind } : {});
|
|
8110
8317
|
const results = filterCatalogAssets(assets, query);
|
|
8111
8318
|
if (results.length === 0) {
|
|
@@ -8122,7 +8329,7 @@ function makeStoreCommand() {
|
|
|
8122
8329
|
} catch (e) {
|
|
8123
8330
|
if (e instanceof LocalCatalogDisabledError) {
|
|
8124
8331
|
logErr(
|
|
8125
|
-
|
|
8332
|
+
`Remote catalog disabled (catalog.url: local). Set \`catalog.url: https://skaile.store\` in ${userConfigPath()}.`
|
|
8126
8333
|
);
|
|
8127
8334
|
} else {
|
|
8128
8335
|
logErr(`Store search failed: ${e.message}`);
|
|
@@ -8131,10 +8338,10 @@ function makeStoreCommand() {
|
|
|
8131
8338
|
}
|
|
8132
8339
|
});
|
|
8133
8340
|
store.command("show <ref>").description("Show a store asset's details + provenance (source, files, integrity)").option("-C, --project-dir <dir>", "Project directory (catalog config overlay)", process.cwd()).action(async (ref, opts) => {
|
|
8134
|
-
const { openCatalogSource: openCatalogSource2, LocalCatalogDisabledError } = await import('../open-library-
|
|
8135
|
-
const { supportsInstallManifest } = await import('../project-
|
|
8341
|
+
const { openCatalogSource: openCatalogSource2, LocalCatalogDisabledError } = await import('../open-library-NVG3CZUO.js');
|
|
8342
|
+
const { supportsInstallManifest } = await import('../project-44LM6SRV.js');
|
|
8136
8343
|
try {
|
|
8137
|
-
const remote = await openCatalogSource2({ projectDir:
|
|
8344
|
+
const remote = await openCatalogSource2({ projectDir: path36__default.resolve(opts.projectDir) });
|
|
8138
8345
|
const asset = await remote.resolve(ref);
|
|
8139
8346
|
if (!asset) {
|
|
8140
8347
|
logErr(`Not found in store: ${ref} (try a full ref, e.g. skill:@publisher/name#version)`);
|
|
@@ -8184,7 +8391,7 @@ function makeStoreCommand() {
|
|
|
8184
8391
|
} catch (e) {
|
|
8185
8392
|
if (e instanceof LocalCatalogDisabledError) {
|
|
8186
8393
|
logErr(
|
|
8187
|
-
|
|
8394
|
+
`Remote catalog disabled (catalog.url: local). Set \`catalog.url: https://skaile.store\` in ${userConfigPath()}.`
|
|
8188
8395
|
);
|
|
8189
8396
|
} else {
|
|
8190
8397
|
logErr(`Store show failed: ${e.message}`);
|
|
@@ -8256,7 +8463,7 @@ function printTree(node, prefix = "", isLast = true) {
|
|
|
8256
8463
|
}
|
|
8257
8464
|
function makeTreeCommand() {
|
|
8258
8465
|
return new Command("tree").description("Show full dependency tree").option("--project-dir <path>", "Project directory", process.cwd()).action(async (opts) => {
|
|
8259
|
-
const am2 = new AssetManager({ projectDir:
|
|
8466
|
+
const am2 = new AssetManager({ projectDir: path36__default.resolve(opts.projectDir) });
|
|
8260
8467
|
const root = am2.tree();
|
|
8261
8468
|
if (root.children.length === 0) {
|
|
8262
8469
|
logInfo("No dependencies in lock file. Run `skaile install` first.");
|
|
@@ -8279,10 +8486,10 @@ function makeUpdateCommand() {
|
|
|
8279
8486
|
return new Command("update").description("Refresh the Catalog cache and re-deploy outdated assets in the current project").argument("[name]", "Update a specific asset (kind:name)").option("--project-dir <path>", "Project directory", process.cwd()).option("--no-catalog", "Skip refreshing the catalog cache").option("--catalog-only", "Refresh the catalog cache only; do not re-deploy assets").option("--no-sync", "Skip syncing sources from upstream before re-deploying").option("-y, --yes", "Sync sources without the confirmation prompt").action(
|
|
8280
8487
|
async (_name, opts) => {
|
|
8281
8488
|
if (opts.catalog !== false) {
|
|
8282
|
-
const catalogSpinner =
|
|
8489
|
+
const catalogSpinner = createSpinner();
|
|
8283
8490
|
catalogSpinner.start("Refreshing catalog cache");
|
|
8284
8491
|
try {
|
|
8285
|
-
const remote = await openCatalogSource({ projectDir:
|
|
8492
|
+
const remote = await openCatalogSource({ projectDir: path36__default.resolve(opts.projectDir) });
|
|
8286
8493
|
const result2 = await remote.refresh();
|
|
8287
8494
|
catalogSpinner.stop(
|
|
8288
8495
|
`Catalog refreshed: ${S.heading(String(result2.assetsCached))} assets cached`
|
|
@@ -8295,9 +8502,9 @@ function makeUpdateCommand() {
|
|
|
8295
8502
|
}
|
|
8296
8503
|
}
|
|
8297
8504
|
if (opts.catalogOnly) return;
|
|
8298
|
-
const projectDir =
|
|
8505
|
+
const projectDir = path36__default.resolve(opts.projectDir);
|
|
8299
8506
|
if (await shouldSyncSources(opts)) {
|
|
8300
|
-
const syncSpinner =
|
|
8507
|
+
const syncSpinner = createSpinner();
|
|
8301
8508
|
syncSpinner.start("Syncing sources");
|
|
8302
8509
|
const { total, synced, failed } = await syncProjectSources(projectDir);
|
|
8303
8510
|
syncSpinner.stop(
|
|
@@ -8305,10 +8512,10 @@ function makeUpdateCommand() {
|
|
|
8305
8512
|
);
|
|
8306
8513
|
}
|
|
8307
8514
|
const am2 = new AssetManager({ projectDir });
|
|
8308
|
-
const
|
|
8309
|
-
|
|
8515
|
+
const spinner = createSpinner();
|
|
8516
|
+
spinner.start("Re-deploying assets");
|
|
8310
8517
|
const result = await am2.install();
|
|
8311
|
-
|
|
8518
|
+
spinner.stop("Done");
|
|
8312
8519
|
if (result.deployed.length > 0) {
|
|
8313
8520
|
for (const d of result.deployed) logOk(`Updated ${d}`);
|
|
8314
8521
|
} else {
|
|
@@ -8320,12 +8527,12 @@ function makeUpdateCommand() {
|
|
|
8320
8527
|
async function shouldSyncSources(opts) {
|
|
8321
8528
|
if (opts.sync === false) return false;
|
|
8322
8529
|
if (opts.yes || !process.stdin.isTTY) return true;
|
|
8323
|
-
const answer = await
|
|
8530
|
+
const answer = await p4.confirm({
|
|
8324
8531
|
message: "Sync sources from upstream before re-deploying?",
|
|
8325
8532
|
initialValue: true
|
|
8326
8533
|
});
|
|
8327
|
-
if (
|
|
8328
|
-
|
|
8534
|
+
if (p4.isCancel(answer)) {
|
|
8535
|
+
p4.cancel("Cancelled.");
|
|
8329
8536
|
process.exit(130);
|
|
8330
8537
|
}
|
|
8331
8538
|
return answer;
|
|
@@ -8351,12 +8558,12 @@ function findManifestCandidates(rootPath) {
|
|
|
8351
8558
|
function walk(dir) {
|
|
8352
8559
|
let entries;
|
|
8353
8560
|
try {
|
|
8354
|
-
entries =
|
|
8561
|
+
entries = fs12__default.readdirSync(dir, { withFileTypes: true });
|
|
8355
8562
|
} catch {
|
|
8356
8563
|
return;
|
|
8357
8564
|
}
|
|
8358
8565
|
for (const entry of entries) {
|
|
8359
|
-
const fullPath =
|
|
8566
|
+
const fullPath = path36__default.join(dir, entry.name);
|
|
8360
8567
|
if (entry.isDirectory()) {
|
|
8361
8568
|
if (!SKIP_DIRS.has(entry.name)) walk(fullPath);
|
|
8362
8569
|
} else if (entry.isFile()) {
|
|
@@ -8372,11 +8579,6 @@ function findManifestCandidates(rootPath) {
|
|
|
8372
8579
|
walk(rootPath);
|
|
8373
8580
|
return candidates;
|
|
8374
8581
|
}
|
|
8375
|
-
function parseMdFrontmatter(content) {
|
|
8376
|
-
const fmMatch = content.match(/^---\n([\s\S]*?)\n---\n?/);
|
|
8377
|
-
if (!fmMatch) return null;
|
|
8378
|
-
return { frontmatter: parse(fmMatch[1]), body: content.slice(fmMatch[0].length).trim() };
|
|
8379
|
-
}
|
|
8380
8582
|
function checkManifestIdentity(kind, parsed) {
|
|
8381
8583
|
if (parsed === null || typeof parsed !== "object") return null;
|
|
8382
8584
|
const obj = parsed;
|
|
@@ -8397,25 +8599,20 @@ function checkManifestIdentity(kind, parsed) {
|
|
|
8397
8599
|
return null;
|
|
8398
8600
|
}
|
|
8399
8601
|
function parseManifestCandidate(c, absRoot) {
|
|
8400
|
-
const content =
|
|
8401
|
-
|
|
8402
|
-
|
|
8403
|
-
|
|
8404
|
-
return { kind: "skip" };
|
|
8405
|
-
}
|
|
8406
|
-
return { kind: "value", parsed: md.frontmatter, body: md.body };
|
|
8407
|
-
}
|
|
8408
|
-
try {
|
|
8409
|
-
const parsed = c.filePath.endsWith(".json") ? JSON.parse(content) : parse(content);
|
|
8410
|
-
return { kind: "value", parsed };
|
|
8411
|
-
} catch (e) {
|
|
8412
|
-
const relPath = path35__default.relative(absRoot, c.filePath);
|
|
8413
|
-
logErr(`${relPath} \u2014 parse error: ${e instanceof Error ? e.message : String(e)}`);
|
|
8602
|
+
const content = fs12__default.readFileSync(c.filePath, "utf-8");
|
|
8603
|
+
const res = parseManifestFile(c.filePath, content);
|
|
8604
|
+
if (!res.ok) {
|
|
8605
|
+
logErr(`${path36__default.relative(absRoot, c.filePath)} [${c.kind}] \u2014 parse error: ${res.reason}`);
|
|
8414
8606
|
return { kind: "error" };
|
|
8415
8607
|
}
|
|
8608
|
+
return {
|
|
8609
|
+
kind: "value",
|
|
8610
|
+
parsed: res.data,
|
|
8611
|
+
body: c.filePath.endsWith(".md") ? parseFrontmatter(content).body : void 0
|
|
8612
|
+
};
|
|
8416
8613
|
}
|
|
8417
8614
|
function validateManifestCandidate(c, parsed, body, absRoot, registry, strictConformance) {
|
|
8418
|
-
const relPath =
|
|
8615
|
+
const relPath = path36__default.relative(absRoot, c.filePath);
|
|
8419
8616
|
let errors = 0;
|
|
8420
8617
|
let warnings = 0;
|
|
8421
8618
|
const identityError = checkManifestIdentity(c.kind, parsed);
|
|
@@ -8424,11 +8621,10 @@ function validateManifestCandidate(c, parsed, body, absRoot, registry, strictCon
|
|
|
8424
8621
|
errors++;
|
|
8425
8622
|
}
|
|
8426
8623
|
if (c.kind === "skill" && parsed && typeof parsed === "object") {
|
|
8427
|
-
const dirName =
|
|
8428
|
-
const
|
|
8429
|
-
|
|
8430
|
-
|
|
8431
|
-
if (strictConformance) {
|
|
8624
|
+
const dirName = path36__default.basename(path36__default.dirname(c.filePath));
|
|
8625
|
+
for (const f of checkSkillManifest(parsed, body, dirName)) {
|
|
8626
|
+
const line = `${relPath} [${f.tag}] \u2014 ${f.text}`;
|
|
8627
|
+
if (f.conformance && strictConformance) {
|
|
8432
8628
|
logErr(line);
|
|
8433
8629
|
errors++;
|
|
8434
8630
|
} else {
|
|
@@ -8437,10 +8633,6 @@ function validateManifestCandidate(c, parsed, body, absRoot, registry, strictCon
|
|
|
8437
8633
|
}
|
|
8438
8634
|
}
|
|
8439
8635
|
}
|
|
8440
|
-
if (c.kind === "skill" && body?.replace(/^#[^\n]*\n+/, "") === SKILL_BODY_PLACEHOLDER) {
|
|
8441
|
-
logWarn(`${relPath} [skill] \u2014 body is still the scaffold placeholder; write the skill prompt`);
|
|
8442
|
-
warnings++;
|
|
8443
|
-
}
|
|
8444
8636
|
const provider = registry.getProvider(c.kind);
|
|
8445
8637
|
if (!provider) {
|
|
8446
8638
|
logWarn(`${relPath} [${c.kind}] \u2014 kind "${c.kind}" is not registered, skipping validation`);
|
|
@@ -8456,8 +8648,8 @@ function validateManifestCandidate(c, parsed, body, absRoot, registry, strictCon
|
|
|
8456
8648
|
return { errors, warnings };
|
|
8457
8649
|
}
|
|
8458
8650
|
function validateManifests(rootPath, strictConformance) {
|
|
8459
|
-
const absRoot =
|
|
8460
|
-
if (!
|
|
8651
|
+
const absRoot = path36__default.resolve(rootPath);
|
|
8652
|
+
if (!fs12__default.existsSync(absRoot)) {
|
|
8461
8653
|
logErr(`Path does not exist: ${absRoot}`);
|
|
8462
8654
|
return { total: 0, errors: 1, warnings: 0 };
|
|
8463
8655
|
}
|
|
@@ -8467,7 +8659,6 @@ function validateManifests(rootPath, strictConformance) {
|
|
|
8467
8659
|
let warnings = 0;
|
|
8468
8660
|
for (const c of candidates) {
|
|
8469
8661
|
const parseResult = parseManifestCandidate(c, absRoot);
|
|
8470
|
-
if (parseResult.kind === "skip") continue;
|
|
8471
8662
|
if (parseResult.kind === "error") {
|
|
8472
8663
|
errors++;
|
|
8473
8664
|
continue;
|
|
@@ -8490,12 +8681,12 @@ function findWorkspaceManifests(rootPath) {
|
|
|
8490
8681
|
function walk(dir) {
|
|
8491
8682
|
let entries;
|
|
8492
8683
|
try {
|
|
8493
|
-
entries =
|
|
8684
|
+
entries = fs12__default.readdirSync(dir, { withFileTypes: true });
|
|
8494
8685
|
} catch {
|
|
8495
8686
|
return;
|
|
8496
8687
|
}
|
|
8497
8688
|
for (const entry of entries) {
|
|
8498
|
-
const full =
|
|
8689
|
+
const full = path36__default.join(dir, entry.name);
|
|
8499
8690
|
if (entry.isDirectory()) {
|
|
8500
8691
|
if (!SKIP_DIRS.has(entry.name)) walk(full);
|
|
8501
8692
|
} else if (entry.isFile() && /(^|\.)skaile\.yaml$/.test(entry.name)) {
|
|
@@ -8558,14 +8749,14 @@ function validateWorkspaceAssets(parsed, relPath) {
|
|
|
8558
8749
|
return errors;
|
|
8559
8750
|
}
|
|
8560
8751
|
function validateWorkspaceManifests(rootPath) {
|
|
8561
|
-
const absRoot =
|
|
8752
|
+
const absRoot = path36__default.resolve(rootPath);
|
|
8562
8753
|
const files = findWorkspaceManifests(absRoot);
|
|
8563
8754
|
let errors = 0;
|
|
8564
8755
|
for (const file of files) {
|
|
8565
|
-
const relPath =
|
|
8756
|
+
const relPath = path36__default.relative(absRoot, file);
|
|
8566
8757
|
let parsed;
|
|
8567
8758
|
try {
|
|
8568
|
-
parsed = parse(
|
|
8759
|
+
parsed = parse(fs12__default.readFileSync(file, "utf-8")) ?? {};
|
|
8569
8760
|
} catch (e) {
|
|
8570
8761
|
logErr(`${relPath} \u2014 parse error: ${e instanceof Error ? e.message : String(e)}`);
|
|
8571
8762
|
errors++;
|
|
@@ -8577,7 +8768,7 @@ function validateWorkspaceManifests(rootPath) {
|
|
|
8577
8768
|
return { total: files.length, errors };
|
|
8578
8769
|
}
|
|
8579
8770
|
function validatePublishManifestRoots(rootPath) {
|
|
8580
|
-
const absRoot =
|
|
8771
|
+
const absRoot = path36__default.resolve(rootPath);
|
|
8581
8772
|
const manifest = loadSkPublishManifest(absRoot);
|
|
8582
8773
|
if (!manifest) return 0;
|
|
8583
8774
|
const missing = missingRootAssets(absRoot, manifest);
|
|
@@ -8589,8 +8780,8 @@ function validatePublishManifestRoots(rootPath) {
|
|
|
8589
8780
|
return missing.length;
|
|
8590
8781
|
}
|
|
8591
8782
|
var EXCLUDED_PATHS = ["skaileup-shared/", "external/", "docs/"];
|
|
8592
|
-
function toPosix(
|
|
8593
|
-
return
|
|
8783
|
+
function toPosix(p6) {
|
|
8784
|
+
return p6.split(path36__default.sep).join("/");
|
|
8594
8785
|
}
|
|
8595
8786
|
function isExcludedPath(relPath) {
|
|
8596
8787
|
const rel = toPosix(relPath);
|
|
@@ -8598,9 +8789,9 @@ function isExcludedPath(relPath) {
|
|
|
8598
8789
|
}
|
|
8599
8790
|
function collectAssetVersions() {
|
|
8600
8791
|
const assets = [];
|
|
8601
|
-
if (!
|
|
8792
|
+
if (!fs12__default.existsSync(AI_RESOURCES)) return assets;
|
|
8602
8793
|
const kindDirs = (kindDirName) => findKindDirs(AI_RESOURCES, kindDirName).filter(
|
|
8603
|
-
(dir) => !isExcludedPath(
|
|
8794
|
+
(dir) => !isExcludedPath(path36__default.relative(AI_RESOURCES, dir))
|
|
8604
8795
|
);
|
|
8605
8796
|
for (const dir of kindDirs("skills")) collectSkillVersions(dir, assets);
|
|
8606
8797
|
for (const dir of kindDirs("agents")) collectAgentVersions(dir, assets);
|
|
@@ -8610,10 +8801,10 @@ function collectAssetVersions() {
|
|
|
8610
8801
|
return assets.filter((a) => !seen.has(a.filePath) && seen.add(a.filePath));
|
|
8611
8802
|
}
|
|
8612
8803
|
function collectFlowVersions(dir, out) {
|
|
8613
|
-
for (const f of
|
|
8804
|
+
for (const f of fs12__default.readdirSync(dir)) {
|
|
8614
8805
|
if (!f.endsWith(".flow.yaml")) continue;
|
|
8615
|
-
const fp =
|
|
8616
|
-
const content =
|
|
8806
|
+
const fp = path36__default.join(dir, f);
|
|
8807
|
+
const content = fs12__default.readFileSync(fp, "utf-8");
|
|
8617
8808
|
const parsed = parse(content);
|
|
8618
8809
|
out.push({
|
|
8619
8810
|
kind: "flow",
|
|
@@ -8624,10 +8815,10 @@ function collectFlowVersions(dir, out) {
|
|
|
8624
8815
|
}
|
|
8625
8816
|
}
|
|
8626
8817
|
function collectPromptVersions(dir, out) {
|
|
8627
|
-
for (const f of
|
|
8818
|
+
for (const f of fs12__default.readdirSync(dir)) {
|
|
8628
8819
|
if (!f.endsWith(".prompt.md")) continue;
|
|
8629
|
-
const fp =
|
|
8630
|
-
const content =
|
|
8820
|
+
const fp = path36__default.join(dir, f);
|
|
8821
|
+
const content = fs12__default.readFileSync(fp, "utf-8");
|
|
8631
8822
|
const fm = parseSkillFrontmatter(content);
|
|
8632
8823
|
out.push({
|
|
8633
8824
|
kind: "prompt",
|
|
@@ -8638,12 +8829,12 @@ function collectPromptVersions(dir, out) {
|
|
|
8638
8829
|
}
|
|
8639
8830
|
}
|
|
8640
8831
|
function collectSkillVersions(dir, out) {
|
|
8641
|
-
for (const entry of
|
|
8832
|
+
for (const entry of fs12__default.readdirSync(dir, { withFileTypes: true })) {
|
|
8642
8833
|
if (!entry.isDirectory()) continue;
|
|
8643
|
-
const full =
|
|
8644
|
-
const skillMd =
|
|
8645
|
-
if (
|
|
8646
|
-
const content =
|
|
8834
|
+
const full = path36__default.join(dir, entry.name);
|
|
8835
|
+
const skillMd = path36__default.join(full, "SKILL.md");
|
|
8836
|
+
if (fs12__default.existsSync(skillMd)) {
|
|
8837
|
+
const content = fs12__default.readFileSync(skillMd, "utf-8");
|
|
8647
8838
|
const fm = parseSkillFrontmatter(content);
|
|
8648
8839
|
out.push({
|
|
8649
8840
|
kind: "skill",
|
|
@@ -8657,11 +8848,11 @@ function collectSkillVersions(dir, out) {
|
|
|
8657
8848
|
}
|
|
8658
8849
|
}
|
|
8659
8850
|
function collectAgentVersions(dir, out) {
|
|
8660
|
-
for (const entry of
|
|
8851
|
+
for (const entry of fs12__default.readdirSync(dir, { withFileTypes: true })) {
|
|
8661
8852
|
if (!entry.isDirectory()) continue;
|
|
8662
|
-
const agentYaml =
|
|
8663
|
-
if (!
|
|
8664
|
-
const content =
|
|
8853
|
+
const agentYaml = path36__default.join(dir, entry.name, "agent.yaml");
|
|
8854
|
+
if (!fs12__default.existsSync(agentYaml)) continue;
|
|
8855
|
+
const content = fs12__default.readFileSync(agentYaml, "utf-8");
|
|
8665
8856
|
const parsed = parse(content);
|
|
8666
8857
|
out.push({
|
|
8667
8858
|
kind: "agent",
|
|
@@ -8672,15 +8863,15 @@ function collectAgentVersions(dir, out) {
|
|
|
8672
8863
|
}
|
|
8673
8864
|
}
|
|
8674
8865
|
function assetLocation(a) {
|
|
8675
|
-
return toPosix(
|
|
8866
|
+
return toPosix(path36__default.relative(AI_RESOURCES, a.filePath));
|
|
8676
8867
|
}
|
|
8677
8868
|
function findChangelogUnit(assetRelPath, root) {
|
|
8678
|
-
let dir =
|
|
8869
|
+
let dir = path36__default.posix.dirname(toPosix(assetRelPath));
|
|
8679
8870
|
for (; ; ) {
|
|
8680
8871
|
const candidate = dir === "." ? "CHANGELOG.md" : `${dir}/CHANGELOG.md`;
|
|
8681
|
-
if (
|
|
8872
|
+
if (fs12__default.existsSync(path36__default.join(root, candidate))) return candidate;
|
|
8682
8873
|
if (dir === ".") return null;
|
|
8683
|
-
dir =
|
|
8874
|
+
dir = path36__default.posix.dirname(dir);
|
|
8684
8875
|
}
|
|
8685
8876
|
}
|
|
8686
8877
|
function checkChangelogUnits(modifiedFiles, root) {
|
|
@@ -8718,7 +8909,7 @@ function filterToChangedAssets(assets) {
|
|
|
8718
8909
|
encoding: "utf-8"
|
|
8719
8910
|
});
|
|
8720
8911
|
const changedFiles = new Set(
|
|
8721
|
-
diffOutput.trim().split("\n").filter(Boolean).map((f) =>
|
|
8912
|
+
diffOutput.trim().split("\n").filter(Boolean).map((f) => path36__default.resolve(AI_RESOURCES, f))
|
|
8722
8913
|
);
|
|
8723
8914
|
return assets.filter((a) => changedFiles.has(a.filePath));
|
|
8724
8915
|
} catch {
|
|
@@ -8746,7 +8937,7 @@ function checkVersionBumps(assets) {
|
|
|
8746
8937
|
let warnings = 0;
|
|
8747
8938
|
for (const a of assets) {
|
|
8748
8939
|
if (!a.version) continue;
|
|
8749
|
-
const relPath =
|
|
8940
|
+
const relPath = path36__default.relative(AI_RESOURCES, a.filePath);
|
|
8750
8941
|
try {
|
|
8751
8942
|
const headContent = execSync(`git show HEAD:${relPath}`, {
|
|
8752
8943
|
cwd: AI_RESOURCES,
|
|
@@ -8778,7 +8969,7 @@ function checkFlowVersionPins(assets) {
|
|
|
8778
8969
|
pins = flowSkillVersionPins(loadFlow(f.filePath));
|
|
8779
8970
|
} catch (err) {
|
|
8780
8971
|
logWarn(
|
|
8781
|
-
`flow:${f.name} (${
|
|
8972
|
+
`flow:${f.name} (${path36__default.relative(AI_RESOURCES, f.filePath)}) \u2014 could not be read: ${err instanceof Error ? err.message : err}`
|
|
8782
8973
|
);
|
|
8783
8974
|
warnings++;
|
|
8784
8975
|
continue;
|
|
@@ -8828,7 +9019,7 @@ function makeValidateCommand() {
|
|
|
8828
9019
|
"--strict-conformance",
|
|
8829
9020
|
"Treat Agent Skills (agentskills.io) standard findings as errors"
|
|
8830
9021
|
).action((targetPath, opts) => {
|
|
8831
|
-
const absPath =
|
|
9022
|
+
const absPath = path36__default.resolve(targetPath);
|
|
8832
9023
|
logInfo(`Validating manifests in ${absPath}`);
|
|
8833
9024
|
const { total, errors, warnings } = validateManifests(
|
|
8834
9025
|
absPath,
|
|
@@ -8838,6 +9029,7 @@ function makeValidateCommand() {
|
|
|
8838
9029
|
const rootErrors = validatePublishManifestRoots(absPath);
|
|
8839
9030
|
const totalErrors = errors + ws.errors + rootErrors;
|
|
8840
9031
|
console.log();
|
|
9032
|
+
warnIgnoredDomainFiles(absPath);
|
|
8841
9033
|
logInfo(`Scanned ${total} asset manifest(s) and ${ws.total} skaile.yaml file(s)`);
|
|
8842
9034
|
if (warnings > 0) logWarn(`${warnings} warning(s)`);
|
|
8843
9035
|
if (totalErrors === 0) {
|
|
@@ -8970,7 +9162,7 @@ function whyEmptyMessage(ref, declared) {
|
|
|
8970
9162
|
}
|
|
8971
9163
|
function makeWhyCommand() {
|
|
8972
9164
|
return new Command("why").description("Show why an asset is installed (dependency chain)").argument("<ref>", "Asset reference (kind:name)").option("--project-dir <path>", "Project directory", process.cwd()).action(async (ref, opts) => {
|
|
8973
|
-
const am2 = new AssetManager({ projectDir:
|
|
9165
|
+
const am2 = new AssetManager({ projectDir: path36__default.resolve(opts.projectDir) });
|
|
8974
9166
|
const chain = am2.why(ref);
|
|
8975
9167
|
if (chain.length === 0) {
|
|
8976
9168
|
let declared;
|
|
@@ -9004,7 +9196,7 @@ function makeWhyCommand() {
|
|
|
9004
9196
|
var _defaultFormatHelp = Help.prototype.formatHelp;
|
|
9005
9197
|
var pkg = JSON.parse(
|
|
9006
9198
|
readFileSync(
|
|
9007
|
-
|
|
9199
|
+
path36__default.resolve(path36__default.dirname(fileURLToPath(import.meta.url)), "../../package.json"),
|
|
9008
9200
|
"utf-8"
|
|
9009
9201
|
)
|
|
9010
9202
|
);
|
|
@@ -9126,7 +9318,7 @@ program.command("init [project-dir]").description("Initialize a project director
|
|
|
9126
9318
|
(projectDir, opts) => runInit(projectDir, opts)
|
|
9127
9319
|
);
|
|
9128
9320
|
async function runInit(projectDir, opts) {
|
|
9129
|
-
const { mkdirSync: mkdirSync4, writeFileSync:
|
|
9321
|
+
const { mkdirSync: mkdirSync4, writeFileSync: writeFileSync6 } = await import('fs');
|
|
9130
9322
|
const { stringify: stringify2 } = await import('yaml');
|
|
9131
9323
|
const { DRIVER_TARGETS, SUPPORTED_DRIVER_TARGETS: SUPPORTED_DRIVER_TARGETS2 } = await import('../core/index.js');
|
|
9132
9324
|
const harness = opts.harness;
|
|
@@ -9135,32 +9327,32 @@ async function runInit(projectDir, opts) {
|
|
|
9135
9327
|
process.exitCode = 1;
|
|
9136
9328
|
return;
|
|
9137
9329
|
}
|
|
9138
|
-
const resolved =
|
|
9139
|
-
const projectName =
|
|
9330
|
+
const resolved = path36__default.resolve(projectDir ?? ".");
|
|
9331
|
+
const projectName = path36__default.basename(resolved);
|
|
9140
9332
|
const created = [];
|
|
9141
|
-
const { existsSync:
|
|
9142
|
-
if (!
|
|
9333
|
+
const { existsSync: existsSync16 } = await import('fs');
|
|
9334
|
+
if (!existsSync16(resolved)) {
|
|
9143
9335
|
mkdirSync4(resolved, { recursive: true });
|
|
9144
9336
|
created.push(".");
|
|
9145
9337
|
}
|
|
9146
|
-
const skaileDir =
|
|
9147
|
-
if (!
|
|
9148
|
-
mkdirSync4(
|
|
9338
|
+
const skaileDir = path36__default.join(resolved, ".skaile");
|
|
9339
|
+
if (!existsSync16(skaileDir)) {
|
|
9340
|
+
mkdirSync4(path36__default.join(skaileDir, "sessions"), { recursive: true });
|
|
9149
9341
|
created.push(".skaile/");
|
|
9150
9342
|
}
|
|
9151
|
-
const settingsPath =
|
|
9152
|
-
if (!
|
|
9153
|
-
|
|
9343
|
+
const settingsPath = path36__default.join(skaileDir, "settings.json");
|
|
9344
|
+
if (!existsSync16(settingsPath)) {
|
|
9345
|
+
writeFileSync6(settingsPath, "{}\n");
|
|
9154
9346
|
created.push(".skaile/settings.json");
|
|
9155
9347
|
}
|
|
9156
|
-
const wsConfigPath =
|
|
9157
|
-
if (!
|
|
9158
|
-
|
|
9348
|
+
const wsConfigPath = path36__default.join(resolved, "skaile.yaml");
|
|
9349
|
+
if (!existsSync16(wsConfigPath)) {
|
|
9350
|
+
writeFileSync6(wsConfigPath, stringify2(buildInitWorkspaceConfig(projectName, harness)));
|
|
9159
9351
|
created.push("skaile.yaml");
|
|
9160
9352
|
}
|
|
9161
9353
|
for (const dir of new Set(Object.values(DRIVER_TARGETS[harness].local))) {
|
|
9162
|
-
const full =
|
|
9163
|
-
if (!
|
|
9354
|
+
const full = path36__default.join(resolved, dir);
|
|
9355
|
+
if (!existsSync16(full)) {
|
|
9164
9356
|
mkdirSync4(full, { recursive: true });
|
|
9165
9357
|
created.push(`${dir}/`);
|
|
9166
9358
|
}
|
|
@@ -9190,8 +9382,8 @@ function buildInitWorkspaceConfig(projectName, harness) {
|
|
|
9190
9382
|
}
|
|
9191
9383
|
async function initGitScaffold(resolved, created) {
|
|
9192
9384
|
const { execSync: execSync3 } = await import('child_process');
|
|
9193
|
-
const { existsSync:
|
|
9194
|
-
const gitignorePath =
|
|
9385
|
+
const { existsSync: existsSync16, readFileSync: readFileSync9, writeFileSync: writeFileSync6 } = await import('fs');
|
|
9386
|
+
const gitignorePath = path36__default.join(resolved, ".gitignore");
|
|
9195
9387
|
const entries = [
|
|
9196
9388
|
"node_modules/",
|
|
9197
9389
|
".skaile/sessions/",
|
|
@@ -9208,16 +9400,16 @@ async function initGitScaffold(resolved, created) {
|
|
|
9208
9400
|
".env",
|
|
9209
9401
|
".env.local"
|
|
9210
9402
|
];
|
|
9211
|
-
const existing =
|
|
9403
|
+
const existing = existsSync16(gitignorePath) ? readFileSync9(gitignorePath, "utf-8") : "";
|
|
9212
9404
|
const have = new Set(existing.split("\n").map((l) => l.trim()));
|
|
9213
9405
|
const append = entries.filter((e) => !have.has(e));
|
|
9214
9406
|
if (append.length > 0) {
|
|
9215
9407
|
const prefix = existing && !existing.endsWith("\n") ? "\n" : "";
|
|
9216
|
-
|
|
9408
|
+
writeFileSync6(gitignorePath, `${existing + prefix}${append.join("\n")}
|
|
9217
9409
|
`);
|
|
9218
9410
|
if (!existing) created.push(".gitignore");
|
|
9219
9411
|
}
|
|
9220
|
-
if (!
|
|
9412
|
+
if (!existsSync16(path36__default.join(resolved, ".git"))) {
|
|
9221
9413
|
try {
|
|
9222
9414
|
execSync3("git init", { cwd: resolved, stdio: "pipe" });
|
|
9223
9415
|
created.push(".git/");
|
|
@@ -9229,10 +9421,10 @@ async function initGitScaffold(resolved, created) {
|
|
|
9229
9421
|
}
|
|
9230
9422
|
async function bootstrapUserConfig() {
|
|
9231
9423
|
try {
|
|
9232
|
-
const
|
|
9233
|
-
const { userConfigPath, saveConfig, getConfigDefaults } = await import('../library/index.js');
|
|
9234
|
-
const userCfgPath =
|
|
9235
|
-
if (!
|
|
9424
|
+
const fs13 = await import('fs');
|
|
9425
|
+
const { userConfigPath: userConfigPath2, saveConfig, getConfigDefaults } = await import('../library/index.js');
|
|
9426
|
+
const userCfgPath = userConfigPath2();
|
|
9427
|
+
if (!fs13.existsSync(userCfgPath)) {
|
|
9236
9428
|
const defaults = getConfigDefaults();
|
|
9237
9429
|
saveConfig(userCfgPath, {
|
|
9238
9430
|
catalog: { url: defaults.catalog.url, cache_ttl: defaults.catalog.cache_ttl }
|
|
@@ -9247,7 +9439,7 @@ async function bootstrapUserConfig() {
|
|
|
9247
9439
|
}
|
|
9248
9440
|
async function hydrateInitSources(resolved, created) {
|
|
9249
9441
|
try {
|
|
9250
|
-
const { ensureSourcesCloned } = await import('../ensure-sources-
|
|
9442
|
+
const { ensureSourcesCloned } = await import('../ensure-sources-Z3KKLEM6.js');
|
|
9251
9443
|
const hydrate = ensureSourcesCloned(resolved, { quiet: true });
|
|
9252
9444
|
for (const n of hydrate.cloned) created.push(`~/.skaile/cache/sources/${n}/`);
|
|
9253
9445
|
if (hydrate.failed.length > 0) {
|
|
@@ -9263,7 +9455,7 @@ function printInitSummary(resolved, projectDir, created) {
|
|
|
9263
9455
|
logOk(`Initialized project at ${S.heading(resolved)}`);
|
|
9264
9456
|
console.log();
|
|
9265
9457
|
console.log(S.heading(" Next steps:"));
|
|
9266
|
-
const isCurrentDir = resolved ===
|
|
9458
|
+
const isCurrentDir = resolved === path36__default.resolve(".");
|
|
9267
9459
|
let step = 1;
|
|
9268
9460
|
if (!isCurrentDir) {
|
|
9269
9461
|
console.log(` ${S.dim(`${step}.`)} ${S.cmd(`cd ${projectDir}`)}`);
|
|
@@ -9287,7 +9479,7 @@ function printInitSummary(resolved, projectDir, created) {
|
|
|
9287
9479
|
console.log();
|
|
9288
9480
|
}
|
|
9289
9481
|
program.command("setup").description("Interactive provider setup wizard").action(async () => {
|
|
9290
|
-
const { cmdSetup } = await import('../setup-
|
|
9482
|
+
const { cmdSetup } = await import('../setup-4BV5ZWOZ.js');
|
|
9291
9483
|
await cmdSetup([], { projectDir: process.cwd() });
|
|
9292
9484
|
});
|
|
9293
9485
|
program.addCommand(makeInstallCommand());
|
|
@@ -9340,13 +9532,34 @@ program.addCommand(makeSourceCommand());
|
|
|
9340
9532
|
program.addCommand(makeLibraryCommand());
|
|
9341
9533
|
program.addCommand(makeAssetCommand());
|
|
9342
9534
|
program.addCommand(makePresetCommand());
|
|
9343
|
-
program.command("path").description("Show resolved paths").action(() => {
|
|
9535
|
+
program.command("path").description("Show resolved paths (honours SKAILE_HOME and the per-path overrides)").action(async () => {
|
|
9536
|
+
const { globalCacheRoot: globalCacheRoot2, globalSkaileDir: globalSkaileDir2, resolveLibraryDir: resolveLibraryDir2, userConfigPath: userConfigPath2 } = await import('../core/index.js');
|
|
9537
|
+
const { getStoreRoot, resolveIndexPath } = await import('../library/index.js');
|
|
9538
|
+
const rows = [
|
|
9539
|
+
["skaile-home", globalSkaileDir2()],
|
|
9540
|
+
["config", userConfigPath2()],
|
|
9541
|
+
["index", resolveIndexPath()],
|
|
9542
|
+
["libraries", resolveLibraryDir2()],
|
|
9543
|
+
["store", getStoreRoot()],
|
|
9544
|
+
["cache", globalCacheRoot2()],
|
|
9545
|
+
["ai-assets", AI_RESOURCES],
|
|
9546
|
+
["patches-dir", ".skaile/patches/"]
|
|
9547
|
+
];
|
|
9548
|
+
const width = Math.max(...rows.map(([label]) => label.length));
|
|
9344
9549
|
console.log();
|
|
9345
|
-
|
|
9346
|
-
|
|
9550
|
+
for (const [label, value] of rows) {
|
|
9551
|
+
console.log(` ${S.dim(label.padEnd(width))} ${S.heading(value)}`);
|
|
9552
|
+
}
|
|
9347
9553
|
console.log();
|
|
9348
9554
|
});
|
|
9349
9555
|
program.addCommand(makeCompleteCommand(program));
|
|
9350
|
-
|
|
9556
|
+
try {
|
|
9557
|
+
await program.parseAsync();
|
|
9558
|
+
} catch (err) {
|
|
9559
|
+
const { LibrarySyncError } = await import('../library/index.js');
|
|
9560
|
+
if (!(err instanceof LibrarySyncError)) throw err;
|
|
9561
|
+
logErr(err.message);
|
|
9562
|
+
process.exit(1);
|
|
9563
|
+
}
|
|
9351
9564
|
//# sourceMappingURL=index.js.map
|
|
9352
9565
|
//# sourceMappingURL=index.js.map
|