@skaile/workspaces 5.2.0 → 5.3.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 +36 -0
- package/README.md +1 -1
- package/dist/{asset-feeds-WDIB3E6H.js → asset-feeds-VIZXYDAO.js} +12 -12
- package/dist/{asset-feeds-WDIB3E6H.js.map → asset-feeds-VIZXYDAO.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 +12 -3
- package/dist/asset-manager/src/index.d.ts.map +1 -1
- package/dist/asset-manager/src/installer.d.ts +2 -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-B4J4RGNY.js → chunk-3ZVSINEV.js} +28 -16
- package/dist/chunk-3ZVSINEV.js.map +1 -0
- package/dist/{chunk-IOUIC2ZD.js → chunk-4257Q2LH.js} +8 -8
- package/dist/{chunk-IOUIC2ZD.js.map → chunk-4257Q2LH.js.map} +1 -1
- package/dist/{chunk-PU5VY7KF.js → chunk-4SSKKFDF.js} +4 -4
- package/dist/{chunk-PU5VY7KF.js.map → chunk-4SSKKFDF.js.map} +1 -1
- package/dist/{chunk-BIMEKYOE.js → chunk-6GBQND2F.js} +15 -18
- package/dist/chunk-6GBQND2F.js.map +1 -0
- package/dist/{chunk-OFNXRI4L.js → chunk-7L4WFH3Y.js} +3 -3
- package/dist/{chunk-OFNXRI4L.js.map → chunk-7L4WFH3Y.js.map} +1 -1
- package/dist/{chunk-6ZCVROWW.js → chunk-A223FDDC.js} +6 -6
- package/dist/{chunk-6ZCVROWW.js.map → chunk-A223FDDC.js.map} +1 -1
- package/dist/{chunk-BWOLP6KQ.js → chunk-AWGQVAC5.js} +3 -3
- package/dist/{chunk-BWOLP6KQ.js.map → chunk-AWGQVAC5.js.map} +1 -1
- package/dist/{chunk-FJTC5YFO.js → chunk-BUZ3K2PT.js} +3 -3
- package/dist/{chunk-FJTC5YFO.js.map → chunk-BUZ3K2PT.js.map} +1 -1
- package/dist/{chunk-UDBN3LZU.js → chunk-CZ35I4RK.js} +4 -4
- package/dist/{chunk-UDBN3LZU.js.map → chunk-CZ35I4RK.js.map} +1 -1
- package/dist/{chunk-ZSFTCMZL.js → chunk-D63AJVBW.js} +19 -19
- package/dist/{chunk-ZSFTCMZL.js.map → chunk-D63AJVBW.js.map} +1 -1
- package/dist/{chunk-6OWIEFZ2.js → chunk-DECPI7DN.js} +5 -5
- package/dist/{chunk-6OWIEFZ2.js.map → chunk-DECPI7DN.js.map} +1 -1
- package/dist/{chunk-BUNBKRJZ.js → chunk-ERCSHLTF.js} +3 -3
- package/dist/{chunk-BUNBKRJZ.js.map → chunk-ERCSHLTF.js.map} +1 -1
- package/dist/{chunk-3E2TIPBZ.js → chunk-FTYM4VRZ.js} +2 -2
- package/dist/{chunk-3E2TIPBZ.js.map → chunk-FTYM4VRZ.js.map} +1 -1
- package/dist/{chunk-PHKFFJ4I.js → chunk-FXN4PLRO.js} +3 -3
- package/dist/{chunk-PHKFFJ4I.js.map → chunk-FXN4PLRO.js.map} +1 -1
- package/dist/{chunk-XIYXBHLN.js → chunk-FZGL7Z52.js} +2 -2
- package/dist/{chunk-XIYXBHLN.js.map → chunk-FZGL7Z52.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-ANWHAGM7.js → chunk-JAJG4G5E.js} +3 -3
- package/dist/{chunk-ANWHAGM7.js.map → chunk-JAJG4G5E.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-XOTJVCJB.js → chunk-JKWU6ULI.js} +3 -3
- package/dist/{chunk-XOTJVCJB.js.map → chunk-JKWU6ULI.js.map} +1 -1
- package/dist/{chunk-KGGT6MUM.js → chunk-K2JVODQD.js} +18 -6
- package/dist/chunk-K2JVODQD.js.map +1 -0
- package/dist/{chunk-P2EM6FNQ.js → chunk-KBAE7PU7.js} +18 -33
- package/dist/chunk-KBAE7PU7.js.map +1 -0
- 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-RXPC4KBW.js → chunk-LM5XEFNS.js} +3 -3
- package/dist/{chunk-RXPC4KBW.js.map → chunk-LM5XEFNS.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-WMEPS6S4.js → chunk-OMD4TAJX.js} +3 -3
- package/dist/{chunk-WMEPS6S4.js.map → chunk-OMD4TAJX.js.map} +1 -1
- package/dist/{chunk-MGHUSFYQ.js → chunk-OOKFZW6H.js} +8 -8
- package/dist/{chunk-MGHUSFYQ.js.map → chunk-OOKFZW6H.js.map} +1 -1
- package/dist/{chunk-2MEMXBLC.js → chunk-QHIMMBJO.js} +5 -5
- package/dist/{chunk-2MEMXBLC.js.map → chunk-QHIMMBJO.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-R3QW7CA5.js → chunk-TR7KFBIO.js} +7 -7
- package/dist/chunk-TR7KFBIO.js.map +1 -0
- package/dist/{chunk-JPR7EPIM.js → chunk-TVFSA5IQ.js} +4 -4
- package/dist/{chunk-JPR7EPIM.js.map → chunk-TVFSA5IQ.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-TVJBJLXR.js → chunk-VLEWVR44.js} +13 -13
- package/dist/{chunk-TVJBJLXR.js.map → chunk-VLEWVR44.js.map} +1 -1
- package/dist/{chunk-77GKEZ2R.js → chunk-WGN7Z36G.js} +3 -3
- package/dist/{chunk-77GKEZ2R.js.map → chunk-WGN7Z36G.js.map} +1 -1
- package/dist/{chunk-L257BENF.js → chunk-WGNFDLHT.js} +73 -21
- package/dist/chunk-WGNFDLHT.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-LZ5RH6LD.js → chunk-Y7UBRRKG.js} +89 -128
- package/dist/chunk-Y7UBRRKG.js.map +1 -0
- package/dist/{chunk-DD3OZLRD.js → chunk-YTJZQ4HY.js} +3 -3
- package/dist/{chunk-DD3OZLRD.js.map → chunk-YTJZQ4HY.js.map} +1 -1
- package/dist/{chunk-S6KNDUAU.js → chunk-YXNYBUQY.js} +5 -5
- package/dist/{chunk-S6KNDUAU.js.map → chunk-YXNYBUQY.js.map} +1 -1
- package/dist/chunk-ZCSFGGLG.js +15 -0
- package/dist/{chunk-BZXR6SW5.js.map → chunk-ZCSFGGLG.js.map} +1 -1
- package/dist/{chunk-EOGNW74K.js → chunk-ZDMGMWK6.js} +12 -11
- package/dist/chunk-ZDMGMWK6.js.map +1 -0
- package/dist/cli/index.js +555 -483
- 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.map +1 -1
- package/dist/cli/src/commands/library-cmd.d.ts.map +1 -1
- package/dist/cli/src/commands/library-index.d.ts +43 -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/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/validate.d.ts.map +1 -1
- package/dist/connectors/config.js +6 -6
- package/dist/connectors/index.js +15 -15
- package/dist/{connectors-GUN4MRWR.js → connectors-Z2FUGAJU.js} +18 -18
- package/dist/{connectors-GUN4MRWR.js.map → connectors-Z2FUGAJU.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/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-3IH5XHAP.js} +16 -16
- package/dist/{ensure-sources-VCPA762L.js.map → ensure-sources-3IH5XHAP.js.map} +1 -1
- 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/{flows-BOB5YA5R.js → flows-64OAOYLP.js} +13 -13
- package/dist/{flows-BOB5YA5R.js.map → flows-64OAOYLP.js.map} +1 -1
- package/dist/{helpers-ZGK4R5MZ.js → helpers-HV5Y57CY.js} +16 -16
- package/dist/{helpers-ZGK4R5MZ.js.map → helpers-HV5Y57CY.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/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-TVS3WQ4C.js} +26 -23
- package/dist/library-publish-TVS3WQ4C.js.map +1 -0
- package/dist/{open-library-4IJTBVTR.js → open-library-AT6RYQ5M.js} +19 -19
- package/dist/{open-library-4IJTBVTR.js.map → open-library-AT6RYQ5M.js.map} +1 -1
- package/dist/open-registry-F2Z4OLXJ.js +32 -0
- package/dist/{open-registry-G5DI4RPU.js.map → open-registry-F2Z4OLXJ.js.map} +1 -1
- package/dist/paths-P7ZXMDCX.js +22 -0
- package/dist/{paths-L5XLUC3D.js.map → paths-P7ZXMDCX.js.map} +1 -1
- package/dist/{plugin-store-QENDYZ63.js → plugin-store-27KGLW4S.js} +10 -10
- package/dist/{plugin-store-QENDYZ63.js.map → plugin-store-27KGLW4S.js.map} +1 -1
- package/dist/{project-4INCIIZI.js → project-J2EROMBW.js} +17 -17
- package/dist/{project-4INCIIZI.js.map → project-J2EROMBW.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-IFGA4NQA.js} +21 -21
- package/dist/{setup-RG4PJJUW.js.map → setup-IFGA4NQA.js.map} +1 -1
- package/dist/skills-3T55L4YT.js +26 -0
- package/dist/{skills-CL45F7AG.js.map → skills-3T55L4YT.js.map} +1 -1
- package/dist/{source-LJOI5AXU.js → source-HEAE43IL.js} +20 -20
- package/dist/{source-LJOI5AXU.js.map → source-HEAE43IL.js.map} +1 -1
- package/dist/{source-manifest-publish-QEJML4VS.js → source-manifest-publish-SCAHAYSQ.js} +22 -22
- package/dist/{source-manifest-publish-QEJML4VS.js.map → source-manifest-publish-SCAHAYSQ.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/skills-CL45F7AG.js +0 -26
package/dist/cli/index.js
CHANGED
|
@@ -1,22 +1,22 @@
|
|
|
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 { getStoreConfig, storeFetch, deviceLogin, loadStoreAuthConfig, logout, hasStoredAuth, isStoreAuthenticated, getStoreToken, getStoreIdentity,
|
|
6
|
-
import { makeInstallCommand, makeCheckCommand, makeCleanCommand, reportInstalledSoftDeps } from '../chunk-
|
|
7
|
-
import { openCatalogSource, openLibraryManager, openLibrary } from '../chunk-
|
|
8
|
-
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-
|
|
9
|
-
import { createFullRegistry } from '../chunk-
|
|
10
|
-
import { LocalSecretsProvider } from '../chunk-
|
|
11
|
-
import { runAgentChat, loadSessionById, loadSession, listSessions, setCurrentSession, deleteSession, clearSession, loadAgentManifest, compileComposition, MarkdownStreamer, resolveMixin } from '../chunk-
|
|
12
|
-
import { buildClaudePluginFiles } from '../chunk-
|
|
13
|
-
import '../chunk-
|
|
14
|
-
import '../chunk-
|
|
2
|
+
import { makeProvidersCommand, loadRegistryView, addProviderEntry, ProviderRegistryWriteError } from '../chunk-DECPI7DN.js';
|
|
3
|
+
import { makeSourceCommand, syncProjectSources } from '../chunk-VLEWVR44.js';
|
|
4
|
+
import { AI_RESOURCES } from '../chunk-TVFSA5IQ.js';
|
|
5
|
+
import { getStoreConfig, storeFetch, deviceLogin, loadStoreAuthConfig, logout, hasStoredAuth, isStoreAuthenticated, getStoreToken, getStoreIdentity, assetEntryRef, refFor } from '../chunk-YXNYBUQY.js';
|
|
6
|
+
import { makeInstallCommand, makeCheckCommand, makeCleanCommand, reportInstalledSoftDeps } from '../chunk-ZDMGMWK6.js';
|
|
7
|
+
import { openCatalogSource, openLibraryManager, openLibrary } from '../chunk-TR7KFBIO.js';
|
|
8
|
+
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-WGN7Z36G.js';
|
|
9
|
+
import { createFullRegistry } from '../chunk-ZCSFGGLG.js';
|
|
10
|
+
import { LocalSecretsProvider } from '../chunk-HTKZ4AOW.js';
|
|
11
|
+
import { runAgentChat, loadSessionById, loadSession, listSessions, setCurrentSession, deleteSession, clearSession, loadAgentManifest, compileComposition, MarkdownStreamer, resolveMixin } from '../chunk-D63AJVBW.js';
|
|
12
|
+
import { buildClaudePluginFiles } from '../chunk-FZGL7Z52.js';
|
|
13
|
+
import '../chunk-QHIMMBJO.js';
|
|
14
|
+
import '../chunk-BUZ3K2PT.js';
|
|
15
15
|
import '../chunk-R6O6YWU7.js';
|
|
16
|
-
import '../chunk-
|
|
17
|
-
import '../chunk-
|
|
16
|
+
import '../chunk-GCYD4EGY.js';
|
|
17
|
+
import '../chunk-JELTQ4H7.js';
|
|
18
18
|
import '../chunk-4ZTPYIBE.js';
|
|
19
|
-
import '../chunk-
|
|
19
|
+
import '../chunk-YTJZQ4HY.js';
|
|
20
20
|
import '../chunk-X5YPJV4N.js';
|
|
21
21
|
import '../chunk-O7SG5PC2.js';
|
|
22
22
|
import '../chunk-7QBNJTTQ.js';
|
|
@@ -25,53 +25,53 @@ import '../chunk-5LKOAX7I.js';
|
|
|
25
25
|
import '../chunk-32NA4TVC.js';
|
|
26
26
|
import '../chunk-W3UDISS2.js';
|
|
27
27
|
import '../chunk-HCYS7GFP.js';
|
|
28
|
-
import { runFlow, resumeFlow } from '../chunk-
|
|
28
|
+
import { runFlow, resumeFlow } from '../chunk-4257Q2LH.js';
|
|
29
29
|
import '../chunk-4R6DROGN.js';
|
|
30
|
-
import { validateFlowVersions, parseSkillFrontmatter } from '../chunk-
|
|
31
|
-
import '../chunk-
|
|
30
|
+
import { validateFlowVersions, parseSkillFrontmatter } from '../chunk-JAJG4G5E.js';
|
|
31
|
+
import '../chunk-JKWU6ULI.js';
|
|
32
32
|
import '../chunk-CT6NQSA4.js';
|
|
33
|
-
import '../chunk-
|
|
33
|
+
import '../chunk-OOKFZW6H.js';
|
|
34
34
|
import '../chunk-QMWMSZQ4.js';
|
|
35
|
-
import '../chunk-
|
|
36
|
-
import '../chunk-
|
|
37
|
-
import '../chunk-
|
|
35
|
+
import '../chunk-CZ35I4RK.js';
|
|
36
|
+
import '../chunk-7L4WFH3Y.js';
|
|
37
|
+
import '../chunk-LAI7X6I2.js';
|
|
38
38
|
import '../chunk-EINLFFP6.js';
|
|
39
39
|
import '../chunk-LOO5CB5M.js';
|
|
40
40
|
import '../chunk-BNUZEYC3.js';
|
|
41
|
-
import '../chunk-
|
|
41
|
+
import '../chunk-ERCSHLTF.js';
|
|
42
42
|
import '../chunk-XBSQ4KMC.js';
|
|
43
43
|
import '../chunk-YROR332M.js';
|
|
44
|
-
import { getProviderPreset, AI_PROVIDER_PRESETS } from '../chunk-
|
|
44
|
+
import { getProviderPreset, AI_PROVIDER_PRESETS } from '../chunk-FTYM4VRZ.js';
|
|
45
45
|
import '../chunk-6E6PKKAD.js';
|
|
46
46
|
import '../chunk-IFGTRL2I.js';
|
|
47
|
-
import { projectAiAssetsRoots, loadFlow, loadAllFlowEntries, findFlowFileInRoots } from '../chunk-
|
|
47
|
+
import { projectAiAssetsRoots, loadFlow, loadAllFlowEntries, findFlowFileInRoots } from '../chunk-LM5XEFNS.js';
|
|
48
48
|
import '../chunk-37FTLYFP.js';
|
|
49
49
|
import '../chunk-QZLWJETK.js';
|
|
50
50
|
import '../chunk-XUUYAS3Z.js';
|
|
51
51
|
import { nodeLabel, nodeSkillAsset, nodeIsInert, nodeIsOptional, nodeRunKind, flowSkillVersionPins } from '../chunk-NFGRW3L7.js';
|
|
52
52
|
import '../chunk-QCI6D7E4.js';
|
|
53
53
|
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-
|
|
54
|
+
import { AssetManager, NON_DEPLOYABLE_KINDS, MissingManifestError, parseRefTolerant, normalizeRepoUrl, FACTORY_SOURCE_URL } from '../chunk-WGNFDLHT.js';
|
|
55
|
+
import { cloneOrInitGitRepo, ensureGitRepo, setManifestPublisher, syncManifestWithDisk, isGitRepo, assertManifestEditable, installLibraryAsset, missingRootAssets, stampManifestPublisher, upsertManifestAsset, getStoreManifestsDir, getDefaultValue, isSecretPlaceholder } from '../chunk-3ZVSINEV.js';
|
|
56
|
+
import { parseManifestFile } from '../chunk-Y7UBRRKG.js';
|
|
57
|
+
import '../chunk-VKSA2CDJ.js';
|
|
58
58
|
import '../chunk-R7FOF242.js';
|
|
59
59
|
import '../chunk-ZDKJHQY2.js';
|
|
60
|
-
import '../chunk-
|
|
60
|
+
import '../chunk-K2JVODQD.js';
|
|
61
61
|
import '../chunk-CGYEHQOX.js';
|
|
62
|
-
import { resolveSettings, globalSettingsPath, projectSettingsPath, loadSettings, saveSettings, WorkspaceYamlEditor, resolveLibraryDir, checkAgentSkillConformance, readLock, workspaceProviderRegistryPath, userProviderRegistryPath, loadProviderRegistryFile, aiResourceRoots } from '../chunk-
|
|
62
|
+
import { resolveSettings, globalSettingsPath, projectSettingsPath, loadSettings, saveSettings, WorkspaceYamlEditor, resolveLibraryDir, checkAgentSkillConformance, globalInstallDir, GLOBAL_INSTALL_DIR_NAME, readLock, workspaceProviderRegistryPath, userProviderRegistryPath, loadProviderRegistryFile, aiResourceRoots } from '../chunk-6GBQND2F.js';
|
|
63
63
|
import '../chunk-4GY63JU6.js';
|
|
64
|
-
import { factoryAssetRoots } from '../chunk-
|
|
65
|
-
import '../chunk-
|
|
64
|
+
import { factoryAssetRoots } from '../chunk-4SSKKFDF.js';
|
|
65
|
+
import '../chunk-XGIS325V.js';
|
|
66
66
|
import { DEFAULT_DRIVER_ID, DRIVER_DEFAULTS } from '../chunk-5BEFNLOR.js';
|
|
67
67
|
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-
|
|
68
|
+
import { sourceCacheKey, getGlobalCacheDir, resolveAgentDir, AgentRefResolutionError, matchPin, coerceVersion, loadSkWorkspaceConfig, resolveSkWorkspaceConfig, storeManifestSlug, isWorkspaceConfigFilename } from '../chunk-KBAE7PU7.js';
|
|
69
|
+
import { globalCacheRoot, globalSkaileDir, userConfigPath } from '../chunk-MFHKHXDE.js';
|
|
70
70
|
import { SUPPORTED_DRIVER_TARGETS } from '../chunk-TOSHZX4C.js';
|
|
71
|
-
import { loadSkPublishManifest, SKAILE_MANIFEST_FILENAME, decodeSkaileManifest } from '../chunk-
|
|
71
|
+
import { loadSkPublishManifest, SKAILE_MANIFEST_FILENAME, decodeSkaileManifest } from '../chunk-SR4RFKHM.js';
|
|
72
72
|
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-
|
|
73
|
+
import { parseFrontmatter, scanDirectory } from '../chunk-LFMX2UEF.js';
|
|
74
|
+
import { parseAssetRef, ASSET_KINDS, isValidAssetName, slugifyAssetName, ASSET_NAME_HINT, assetRefToStr } from '../chunk-WX74MVNA.js';
|
|
75
75
|
import { portableSpawn, portableSpawnSync } from '../chunk-ICSCSM5D.js';
|
|
76
76
|
import { openSqlite } from '../chunk-JMKB7IB4.js';
|
|
77
77
|
import { parseModelRef, resolveEntryBaseUrl } from '../chunk-MJHSLODD.js';
|
|
@@ -82,20 +82,20 @@ import '../chunk-UQ6LFBPZ.js';
|
|
|
82
82
|
import '../chunk-TNWXGHLD.js';
|
|
83
83
|
import { validatePreset, SKILL_BODY_PLACEHOLDER } from '../chunk-5CYEWBPB.js';
|
|
84
84
|
import '../chunk-NSBPE2FW.js';
|
|
85
|
-
import * as
|
|
86
|
-
import
|
|
87
|
-
import * as
|
|
88
|
-
import
|
|
85
|
+
import * as fs12 from 'fs';
|
|
86
|
+
import fs12__default, { readFileSync, existsSync, mkdirSync, writeFileSync, lstatSync, rmSync, readdirSync, statSync } from 'fs';
|
|
87
|
+
import * as path36 from 'path';
|
|
88
|
+
import path36__default, { resolve, join } from 'path';
|
|
89
89
|
import { fileURLToPath } from 'url';
|
|
90
90
|
import { Help, Command, Option } from 'commander';
|
|
91
91
|
import { rcompare } from 'semver';
|
|
92
92
|
import * as p5 from '@clack/prompts';
|
|
93
93
|
import pc5 from 'picocolors';
|
|
94
|
-
import * as os from 'os';
|
|
95
94
|
import { parse, stringify, parseDocument } from 'yaml';
|
|
95
|
+
import * as os from 'os';
|
|
96
96
|
import * as readline from 'readline';
|
|
97
97
|
import { createInterface } from 'readline';
|
|
98
|
-
import
|
|
98
|
+
import fs6 from 'fs/promises';
|
|
99
99
|
import { parse as parse$1, stringify as stringify$1 } from 'smol-toml';
|
|
100
100
|
import { execSync, spawnSync } from 'child_process';
|
|
101
101
|
import * as readline2 from 'readline/promises';
|
|
@@ -135,7 +135,7 @@ async function runSearch(kind, query, opts) {
|
|
|
135
135
|
const showLocal = !opts.store;
|
|
136
136
|
const showStore = !opts.local;
|
|
137
137
|
const { resolveConfig } = await import('../library/index.js');
|
|
138
|
-
const airGapped = resolveConfig({ projectDir:
|
|
138
|
+
const airGapped = resolveConfig({ projectDir: path36__default.resolve(opts.projectDir) }).catalog.cache_ttl === 0;
|
|
139
139
|
if (showLocal) {
|
|
140
140
|
await searchLocal(query, kind, opts, showStore, airGapped);
|
|
141
141
|
}
|
|
@@ -144,7 +144,7 @@ async function runSearch(kind, query, opts) {
|
|
|
144
144
|
}
|
|
145
145
|
}
|
|
146
146
|
async function searchIndex(query, kind) {
|
|
147
|
-
const { openLibrary: openLibrary2 } = await import('../open-library-
|
|
147
|
+
const { openLibrary: openLibrary2 } = await import('../open-library-AT6RYQ5M.js');
|
|
148
148
|
const library = await openLibrary2();
|
|
149
149
|
try {
|
|
150
150
|
const defs = await library.listAssetDefs(kind ? { kind } : {});
|
|
@@ -176,7 +176,7 @@ async function searchIndex(query, kind) {
|
|
|
176
176
|
}
|
|
177
177
|
}
|
|
178
178
|
async function searchFactory(projectDir, query, kind) {
|
|
179
|
-
const prefixes = factoryAssetRoots().map((r) => r.endsWith(
|
|
179
|
+
const prefixes = factoryAssetRoots().map((r) => r.endsWith(path36__default.sep) ? r : r + path36__default.sep);
|
|
180
180
|
const isFactoryPath = (p7) => prefixes.some((fp) => p7 === fp.slice(0, -1) || p7.startsWith(fp));
|
|
181
181
|
try {
|
|
182
182
|
const entries = await new AssetManager({ projectDir }).search(query, kind);
|
|
@@ -193,11 +193,11 @@ function unionEntries(indexed, factory) {
|
|
|
193
193
|
return [...indexed, ...factory.filter((e) => !seen.has(entryDedupKey(e)))];
|
|
194
194
|
}
|
|
195
195
|
async function searchLocal(query, kind, opts, showStore, airGapped) {
|
|
196
|
-
const projectDir =
|
|
196
|
+
const projectDir = path36__default.resolve(opts.projectDir);
|
|
197
197
|
const factory = await searchFactory(projectDir, query, kind);
|
|
198
198
|
let entries = unionEntries(await searchIndex(query, kind), factory);
|
|
199
199
|
if (entries.length === 0 && !query && !kind && !airGapped) {
|
|
200
|
-
const { autoSyncForSearch } = await import('../source-
|
|
200
|
+
const { autoSyncForSearch } = await import('../source-HEAE43IL.js');
|
|
201
201
|
if (await autoSyncForSearch(projectDir)) {
|
|
202
202
|
entries = unionEntries(await searchIndex(query, kind), factory);
|
|
203
203
|
}
|
|
@@ -267,9 +267,9 @@ async function searchStore(query, kind, opts, airGapped) {
|
|
|
267
267
|
logInfo("air-gapped (cache_ttl: 0) \u2014 local sources only");
|
|
268
268
|
return;
|
|
269
269
|
}
|
|
270
|
-
const { openCatalogSource: openCatalogSource2, LocalCatalogDisabledError } = await import('../open-library-
|
|
270
|
+
const { openCatalogSource: openCatalogSource2, LocalCatalogDisabledError } = await import('../open-library-AT6RYQ5M.js');
|
|
271
271
|
try {
|
|
272
|
-
const remote = await openCatalogSource2({ projectDir:
|
|
272
|
+
const remote = await openCatalogSource2({ projectDir: path36__default.resolve(opts.projectDir) });
|
|
273
273
|
const assets = await remote.listAssets(kind ? { kind } : {});
|
|
274
274
|
const results = filterCatalogAssets(assets, query);
|
|
275
275
|
if (results.length > 0) {
|
|
@@ -385,7 +385,7 @@ function makeAddCommand() {
|
|
|
385
385
|
}
|
|
386
386
|
const harnesses = parseHarnessFilter(opts.harness);
|
|
387
387
|
const am2 = new AssetManager({
|
|
388
|
-
projectDir:
|
|
388
|
+
projectDir: path36__default.resolve(opts.projectDir),
|
|
389
389
|
global: opts.global || harnesses !== void 0,
|
|
390
390
|
harnesses,
|
|
391
391
|
driverTarget: opts.target
|
|
@@ -429,7 +429,7 @@ function makeRemoveCommand() {
|
|
|
429
429
|
).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
430
|
const harnesses = parseHarnessFilter(opts.harness);
|
|
431
431
|
const am2 = new AssetManager({
|
|
432
|
-
projectDir:
|
|
432
|
+
projectDir: path36__default.resolve(opts.projectDir),
|
|
433
433
|
global: opts.global || harnesses !== void 0,
|
|
434
434
|
harnesses,
|
|
435
435
|
driverTarget: opts.target
|
|
@@ -471,7 +471,7 @@ function makeListCommand() {
|
|
|
471
471
|
return;
|
|
472
472
|
}
|
|
473
473
|
const am2 = new AssetManager({
|
|
474
|
-
projectDir:
|
|
474
|
+
projectDir: path36__default.resolve(opts.projectDir),
|
|
475
475
|
driverTarget: opts.target
|
|
476
476
|
});
|
|
477
477
|
let declared;
|
|
@@ -518,7 +518,7 @@ function makeListCommand() {
|
|
|
518
518
|
}
|
|
519
519
|
function runGlobalList(kind, opts, harnesses) {
|
|
520
520
|
const am2 = new AssetManager({
|
|
521
|
-
projectDir:
|
|
521
|
+
projectDir: path36__default.resolve(opts.projectDir),
|
|
522
522
|
global: true,
|
|
523
523
|
harnesses
|
|
524
524
|
});
|
|
@@ -589,7 +589,7 @@ async function resolveInfoEntry(am2, ref, opts) {
|
|
|
589
589
|
return { entry: match ?? deployed };
|
|
590
590
|
}
|
|
591
591
|
const lookup = opts.storeLookup ?? (async (filter) => {
|
|
592
|
-
const { resolveCatalogSource } = await import('../open-library-
|
|
592
|
+
const { resolveCatalogSource } = await import('../open-library-AT6RYQ5M.js');
|
|
593
593
|
const { source, close } = await resolveCatalogSource({ projectDir: opts.projectDir });
|
|
594
594
|
try {
|
|
595
595
|
return await source.listAssets(filter);
|
|
@@ -605,7 +605,7 @@ async function resolveInfoEntry(am2, ref, opts) {
|
|
|
605
605
|
);
|
|
606
606
|
return { entry: hit ? catalogAssetToEntry(hit) : null };
|
|
607
607
|
} catch (err) {
|
|
608
|
-
const { LocalCatalogDisabledError } = await import('../open-library-
|
|
608
|
+
const { LocalCatalogDisabledError } = await import('../open-library-AT6RYQ5M.js');
|
|
609
609
|
const storeNote = err instanceof Error ? err.message : String(err);
|
|
610
610
|
const disabled = err instanceof LocalCatalogDisabledError || /catalog\.url/i.test(storeNote);
|
|
611
611
|
return { entry: null, storeNote, ...disabled ? { storeDisabled: true } : {} };
|
|
@@ -616,12 +616,12 @@ function infoNotFoundHint(ref, lookup) {
|
|
|
616
616
|
if (!lookup.storeNote)
|
|
617
617
|
return `'${ref}' not found in local sources, deployed assets, or the store. ${sync}, or ${S.cmd("skaile search --store")} to browse the store.`;
|
|
618
618
|
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
|
|
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 ${userConfigPath()} to query the store.`;
|
|
620
620
|
return `'${ref}' not found locally and the store could not be queried (${lookup.storeNote}). ${sync}, or retry when the store is reachable.`;
|
|
621
621
|
}
|
|
622
622
|
function makeInfoCommand() {
|
|
623
623
|
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 =
|
|
624
|
+
const projectDir = path36__default.resolve(opts.projectDir);
|
|
625
625
|
const am2 = new AssetManager({ projectDir });
|
|
626
626
|
const lookup = await resolveInfoEntry(am2, ref, { projectDir });
|
|
627
627
|
const entry = lookup.entry;
|
|
@@ -657,7 +657,7 @@ function makeCreateCommand() {
|
|
|
657
657
|
new Option("-k, --kind <kind>", "Asset kind").default("skill").choices([...ASSET_KINDS])
|
|
658
658
|
).option("-d, --dir <dir>", "Target directory (default: cwd)").action((name, opts) => {
|
|
659
659
|
const am2 = new AssetManager({ projectDir: process.cwd() });
|
|
660
|
-
const destDir = opts.dir ?
|
|
660
|
+
const destDir = opts.dir ? path36__default.resolve(opts.dir) : process.cwd();
|
|
661
661
|
const result = am2.create(name, opts.kind, destDir);
|
|
662
662
|
if (result.ok) logOk(`Created ${kindColor(opts.kind)}: ${pc5.dim(result.path)}`);
|
|
663
663
|
else {
|
|
@@ -668,7 +668,7 @@ function makeCreateCommand() {
|
|
|
668
668
|
}
|
|
669
669
|
function makeDoctorCommand() {
|
|
670
670
|
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:
|
|
671
|
+
const am2 = new AssetManager({ projectDir: path36__default.resolve(opts.projectDir) });
|
|
672
672
|
const issues = await am2.doctor();
|
|
673
673
|
if (issues.length === 0) {
|
|
674
674
|
logOk("No missing dependencies.");
|
|
@@ -690,27 +690,112 @@ function makeDoctorCommand() {
|
|
|
690
690
|
console.log();
|
|
691
691
|
});
|
|
692
692
|
}
|
|
693
|
+
async function indexLibrary(lib, index) {
|
|
694
|
+
const { LocalCatalogSource } = await import('../library/index.js');
|
|
695
|
+
const own = index ?? await openLibrary();
|
|
696
|
+
try {
|
|
697
|
+
const source = new LocalCatalogSource(own, lib.id, lib.path, createFullRegistry());
|
|
698
|
+
const res = await source.sync();
|
|
699
|
+
return {
|
|
700
|
+
assetsFound: res.assetsFound,
|
|
701
|
+
assetsUpdated: res.assetsUpdated,
|
|
702
|
+
errors: res.errors
|
|
703
|
+
};
|
|
704
|
+
} finally {
|
|
705
|
+
if (!index) own.close();
|
|
706
|
+
}
|
|
707
|
+
}
|
|
708
|
+
function resolveLibraryPublisherDetailed(lib, opts, storeIdentity) {
|
|
709
|
+
const bare = (p7) => p7.startsWith("@") ? p7.slice(1) : p7;
|
|
710
|
+
if (opts.publisher?.trim()) return { publisher: bare(opts.publisher.trim()), source: "flag" };
|
|
711
|
+
const declared = loadSkPublishManifest(lib.path)?.publisher?.trim();
|
|
712
|
+
if (declared) return { publisher: bare(declared), source: "manifest" };
|
|
713
|
+
const identity = (storeIdentity?.githubLogin ?? storeIdentity?.username)?.trim();
|
|
714
|
+
if (identity) return { publisher: identity, source: "identity" };
|
|
715
|
+
try {
|
|
716
|
+
return { publisher: slugifyAssetName(lib.name), source: "library-name" };
|
|
717
|
+
} catch {
|
|
718
|
+
return { publisher: "library", source: "library-name" };
|
|
719
|
+
}
|
|
720
|
+
}
|
|
721
|
+
function resolveLibraryPublisher(lib, opts, storeIdentity) {
|
|
722
|
+
return resolveLibraryPublisherDetailed(lib, opts, storeIdentity).publisher;
|
|
723
|
+
}
|
|
724
|
+
function stampAssetPublisher(assetDir, publisher) {
|
|
725
|
+
const markers = ["SKILL.md", "AGENT.md", "CONTRACT.md"];
|
|
726
|
+
let markerFile;
|
|
727
|
+
for (const m of markers) {
|
|
728
|
+
if (fs12.existsSync(path36.join(assetDir, m))) {
|
|
729
|
+
markerFile = path36.join(assetDir, m);
|
|
730
|
+
break;
|
|
731
|
+
}
|
|
732
|
+
}
|
|
733
|
+
if (!markerFile) {
|
|
734
|
+
const promptMd = fs12.readdirSync(assetDir).find((f) => f.endsWith(".prompt.md"));
|
|
735
|
+
if (promptMd) markerFile = path36.join(assetDir, promptMd);
|
|
736
|
+
}
|
|
737
|
+
if (!markerFile) return;
|
|
738
|
+
try {
|
|
739
|
+
const { data, body } = parseFrontmatter(fs12.readFileSync(markerFile, "utf8"));
|
|
740
|
+
const meta = data.metadata && typeof data.metadata === "object" && !Array.isArray(data.metadata) ? { ...data.metadata } : {};
|
|
741
|
+
if (meta.publisher != null) return;
|
|
742
|
+
meta.publisher = publisher;
|
|
743
|
+
data.metadata = meta;
|
|
744
|
+
const fm = stringify(data).trimEnd();
|
|
745
|
+
fs12.writeFileSync(markerFile, `---
|
|
746
|
+
${fm}
|
|
747
|
+
---
|
|
748
|
+
|
|
749
|
+
${body}
|
|
750
|
+
`, "utf8");
|
|
751
|
+
} catch {
|
|
752
|
+
}
|
|
753
|
+
}
|
|
754
|
+
async function registerLibraryAsset(lib, index, input) {
|
|
755
|
+
const { publisher, source } = resolveLibraryPublisherDetailed(
|
|
756
|
+
lib,
|
|
757
|
+
{ publisher: input.publisher },
|
|
758
|
+
getStoreIdentity()
|
|
759
|
+
);
|
|
760
|
+
if (source === "library-name") {
|
|
761
|
+
logWarn(
|
|
762
|
+
`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>\`.`
|
|
763
|
+
);
|
|
764
|
+
}
|
|
765
|
+
stampAssetPublisher(input.assetDir, publisher);
|
|
766
|
+
stampManifestPublisher(lib.path, publisher);
|
|
767
|
+
upsertManifestAsset(lib.path, {
|
|
768
|
+
kind: input.kind,
|
|
769
|
+
name: input.name,
|
|
770
|
+
root: path36.relative(lib.path, input.assetDir) || input.name,
|
|
771
|
+
version: input.version,
|
|
772
|
+
publisher
|
|
773
|
+
});
|
|
774
|
+
const idx = await indexLibrary(lib, index);
|
|
775
|
+
for (const e of idx.errors) logWarn(e);
|
|
776
|
+
return { publisher, ref: refFor(input.kind, publisher, input.name, input.version) };
|
|
777
|
+
}
|
|
693
778
|
var DEFAULT_IMPORT_VERSION = "0.1.0";
|
|
694
779
|
var DEFAULT_IMPORT_STAGE = "alpha";
|
|
695
780
|
function claudeSkillRoots() {
|
|
696
781
|
const roots = [];
|
|
697
782
|
const override = process.env.SKAILE_CLAUDE_SKILLS_DIR;
|
|
698
783
|
if (override) roots.push(override);
|
|
699
|
-
roots.push(
|
|
784
|
+
roots.push(path36.join(os.homedir(), ".claude", "skills"));
|
|
700
785
|
return roots;
|
|
701
786
|
}
|
|
702
787
|
function resolveImportSource(nameOrPath) {
|
|
703
|
-
const asPath =
|
|
704
|
-
if (
|
|
705
|
-
const dir =
|
|
706
|
-
const skillFile =
|
|
707
|
-
if (
|
|
788
|
+
const asPath = path36.resolve(nameOrPath);
|
|
789
|
+
if (fs12.existsSync(asPath)) {
|
|
790
|
+
const dir = fs12.statSync(asPath).isDirectory() ? asPath : path36.dirname(asPath);
|
|
791
|
+
const skillFile = path36.join(dir, "SKILL.md");
|
|
792
|
+
if (fs12.existsSync(skillFile)) return { dir, skillFile, via: "path" };
|
|
708
793
|
}
|
|
709
|
-
if (!nameOrPath.includes(
|
|
794
|
+
if (!nameOrPath.includes(path36.sep) && !nameOrPath.startsWith(".")) {
|
|
710
795
|
for (const root of claudeSkillRoots()) {
|
|
711
|
-
const dir =
|
|
712
|
-
const skillFile =
|
|
713
|
-
if (
|
|
796
|
+
const dir = path36.join(root, nameOrPath);
|
|
797
|
+
const skillFile = path36.join(dir, "SKILL.md");
|
|
798
|
+
if (fs12.existsSync(skillFile)) return { dir, skillFile, via: "claude-skills" };
|
|
714
799
|
}
|
|
715
800
|
}
|
|
716
801
|
return null;
|
|
@@ -740,9 +825,9 @@ function normalizeSkillContent(raw, opts = {}) {
|
|
|
740
825
|
notes.push(`stamped metadata.stage: ${existingMeta.stage}`);
|
|
741
826
|
}
|
|
742
827
|
if (existingMeta.tags == null) {
|
|
743
|
-
const keywords = Array.isArray(data.keywords) ? data.keywords : [];
|
|
744
|
-
|
|
745
|
-
|
|
828
|
+
const keywords = Array.isArray(data.keywords) ? data.keywords.filter((k) => typeof k === "string") : [];
|
|
829
|
+
if (keywords.length > 0) {
|
|
830
|
+
existingMeta.tags = keywords;
|
|
746
831
|
notes.push("promoted top-level keywords \u2192 metadata.tags");
|
|
747
832
|
}
|
|
748
833
|
}
|
|
@@ -789,7 +874,10 @@ function withCanonicalRef(def) {
|
|
|
789
874
|
}
|
|
790
875
|
function makeAssetCommand() {
|
|
791
876
|
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("--to <library>", "Target library (default: auto / personal)").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(
|
|
877
|
+
cmd.command("import <name-or-path>").description("Import + skailify an existing coding-agent skill into a library").option("--to <library>", "Target library (default: auto / personal)").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(
|
|
878
|
+
"--publisher <name>",
|
|
879
|
+
"Publisher for the imported skill (default: the library's, else your store login)"
|
|
880
|
+
).option("--commit", "Auto-commit in git-backed libraries", false).action(
|
|
793
881
|
async (nameOrPath, opts) => {
|
|
794
882
|
const src = resolveImportSource(nameOrPath);
|
|
795
883
|
if (!src) {
|
|
@@ -799,7 +887,7 @@ function makeAssetCommand() {
|
|
|
799
887
|
process.exit(1);
|
|
800
888
|
}
|
|
801
889
|
logInfo(`Source: ${S.dim(src.dir)} (${src.via})`);
|
|
802
|
-
const { manager, close } = await openLibraryManager();
|
|
890
|
+
const { manager, library, close } = await openLibraryManager();
|
|
803
891
|
try {
|
|
804
892
|
let target;
|
|
805
893
|
if (opts.to) {
|
|
@@ -819,40 +907,37 @@ function makeAssetCommand() {
|
|
|
819
907
|
logErr(err instanceof Error ? err.message : String(err));
|
|
820
908
|
process.exit(1);
|
|
821
909
|
}
|
|
822
|
-
const rawSkill =
|
|
910
|
+
const rawSkill = fs12.readFileSync(src.skillFile, "utf8");
|
|
823
911
|
const norm = opts.normalize ? normalizeSkillContent(rawSkill, {
|
|
824
|
-
fallbackName:
|
|
912
|
+
fallbackName: path36.basename(src.dir),
|
|
825
913
|
version: opts.version,
|
|
826
914
|
stage: opts.stage
|
|
827
|
-
}) : { content: rawSkill, name:
|
|
915
|
+
}) : { content: rawSkill, name: path36.basename(src.dir), changed: false, notes: [] };
|
|
828
916
|
if (!opts.normalize && !isValidAssetName(norm.name)) {
|
|
829
917
|
logWarn(
|
|
830
918
|
`Name "${norm.name}" is not canonical (kebab-case); \`skaile validate\` will reject this manifest entry. Drop --no-normalize to slugify it.`
|
|
831
919
|
);
|
|
832
920
|
}
|
|
833
|
-
const destDir =
|
|
834
|
-
if (
|
|
921
|
+
const destDir = path36.join(target.path, norm.name);
|
|
922
|
+
if (fs12.existsSync(destDir)) {
|
|
835
923
|
logErr(`Destination already exists: ${destDir}`);
|
|
836
924
|
process.exit(1);
|
|
837
925
|
}
|
|
838
|
-
|
|
839
|
-
|
|
926
|
+
fs12.cpSync(src.dir, destDir, { recursive: true });
|
|
927
|
+
fs12.writeFileSync(path36.join(destDir, "SKILL.md"), norm.content, "utf8");
|
|
840
928
|
for (const note of norm.notes) logInfo(` \u2022 ${note}`);
|
|
841
929
|
const fm = parseFrontmatter(norm.content).data;
|
|
842
|
-
const descRaw = fm.description;
|
|
843
|
-
const description = typeof descRaw === "string" ? descRaw.trim() : void 0;
|
|
844
930
|
for (const f of checkAgentSkillConformance(fm, { dirName: norm.name })) {
|
|
845
931
|
logWarn(`conformance: ${f.field} \u2014 ${f.message}`);
|
|
846
932
|
}
|
|
847
|
-
const
|
|
848
|
-
const
|
|
933
|
+
const fmVersion = fm.metadata?.version;
|
|
934
|
+
const { ref } = await registerLibraryAsset(target, library, {
|
|
849
935
|
kind: "skill",
|
|
850
936
|
name: norm.name,
|
|
851
|
-
|
|
852
|
-
version: opts.version,
|
|
853
|
-
|
|
937
|
+
assetDir: destDir,
|
|
938
|
+
version: fmVersion != null ? String(fmVersion) : opts.version ?? DEFAULT_IMPORT_VERSION,
|
|
939
|
+
publisher: opts.publisher
|
|
854
940
|
});
|
|
855
|
-
logOk(`${up.added ? "Added" : "Updated"} manifest entry skill:${norm.name}`);
|
|
856
941
|
if (target.backend === "git" && opts.commit) {
|
|
857
942
|
const { spawnSync: spawnSync2 } = await import('child_process');
|
|
858
943
|
spawnSync2("git", ["add", "--", destDir], { cwd: target.path, stdio: "inherit" });
|
|
@@ -864,7 +949,8 @@ function makeAssetCommand() {
|
|
|
864
949
|
logWarn("Nothing committed (working tree clean or commit aborted).");
|
|
865
950
|
}
|
|
866
951
|
}
|
|
867
|
-
logOk(`Imported ${S.cmd(
|
|
952
|
+
logOk(`Imported ${S.cmd(ref)} \u2192 ${target.name}`);
|
|
953
|
+
logInfo(`Indexed \u2014 add it with ${S.cmd(`skaile add ${ref}`)}`);
|
|
868
954
|
logInfo(`Verify: ${S.cmd(`skaile validate ${target.path}`)}`);
|
|
869
955
|
} finally {
|
|
870
956
|
close();
|
|
@@ -877,7 +963,7 @@ function makeAssetCommand() {
|
|
|
877
963
|
logErr(`Invalid --mode "${opts.mode}". Expected: copy | move | link.`);
|
|
878
964
|
process.exit(1);
|
|
879
965
|
}
|
|
880
|
-
if (!
|
|
966
|
+
if (!fs12.existsSync(srcPath)) {
|
|
881
967
|
logErr(`Source path does not exist: ${srcPath}`);
|
|
882
968
|
process.exit(1);
|
|
883
969
|
}
|
|
@@ -902,23 +988,23 @@ function makeAssetCommand() {
|
|
|
902
988
|
);
|
|
903
989
|
process.exit(1);
|
|
904
990
|
}
|
|
905
|
-
const basename2 =
|
|
991
|
+
const basename2 = path36.basename(srcPath);
|
|
906
992
|
const destDir = target.path;
|
|
907
|
-
|
|
908
|
-
const destPath =
|
|
909
|
-
if (
|
|
993
|
+
fs12.mkdirSync(destDir, { recursive: true });
|
|
994
|
+
const destPath = path36.join(destDir, basename2);
|
|
995
|
+
if (fs12.existsSync(destPath)) {
|
|
910
996
|
logErr(`Destination already exists: ${destPath}`);
|
|
911
997
|
process.exit(1);
|
|
912
998
|
}
|
|
913
999
|
switch (opts.mode) {
|
|
914
1000
|
case "copy":
|
|
915
|
-
|
|
1001
|
+
fs12.cpSync(srcPath, destPath, { recursive: true });
|
|
916
1002
|
break;
|
|
917
1003
|
case "move":
|
|
918
|
-
|
|
1004
|
+
fs12.renameSync(srcPath, destPath);
|
|
919
1005
|
break;
|
|
920
1006
|
case "link":
|
|
921
|
-
|
|
1007
|
+
fs12.symlinkSync(path36.resolve(srcPath), destPath);
|
|
922
1008
|
break;
|
|
923
1009
|
}
|
|
924
1010
|
if (target.backend === "git" && opts.commit) {
|
|
@@ -1048,14 +1134,14 @@ function makeAuthCommand() {
|
|
|
1048
1134
|
}
|
|
1049
1135
|
function collectCacheTargets(scope) {
|
|
1050
1136
|
const out = [];
|
|
1051
|
-
out.push(
|
|
1052
|
-
out.push(
|
|
1053
|
-
out.push(
|
|
1137
|
+
out.push(path36__default.join(scope.projectDir, ".skaile", "cache"));
|
|
1138
|
+
out.push(path36__default.join(scope.projectDir, ".skaile", "store-cache"));
|
|
1139
|
+
out.push(path36__default.join(scope.projectDir, ".skaile", "repos"));
|
|
1054
1140
|
if (scope.global) {
|
|
1055
1141
|
out.push(globalCacheRoot());
|
|
1056
1142
|
const home = globalSkaileDir();
|
|
1057
|
-
out.push(
|
|
1058
|
-
out.push(
|
|
1143
|
+
out.push(path36__default.join(home, "repos"));
|
|
1144
|
+
out.push(path36__default.join(home, "catalog-cache"));
|
|
1059
1145
|
}
|
|
1060
1146
|
return out;
|
|
1061
1147
|
}
|
|
@@ -1069,7 +1155,7 @@ function dirSize(target) {
|
|
|
1069
1155
|
function dirSizeOfDir(dir) {
|
|
1070
1156
|
let total = 0;
|
|
1071
1157
|
for (const ent of readdirSync(dir, { withFileTypes: true })) {
|
|
1072
|
-
const child =
|
|
1158
|
+
const child = path36__default.join(dir, ent.name);
|
|
1073
1159
|
if (ent.isSymbolicLink()) continue;
|
|
1074
1160
|
if (ent.isDirectory()) total += dirSizeOfDir(child);
|
|
1075
1161
|
else if (ent.isFile()) total += statSync(child).size;
|
|
@@ -1095,7 +1181,7 @@ function makeCacheCommand() {
|
|
|
1095
1181
|
const cmd = new Command("cache").description("Inspect and reclaim the re-derivable cache");
|
|
1096
1182
|
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
1183
|
const targets = collectCacheTargets({
|
|
1098
|
-
projectDir:
|
|
1184
|
+
projectDir: path36__default.resolve(opts.projectDir),
|
|
1099
1185
|
global: opts.global
|
|
1100
1186
|
}).filter((t) => existsSync(t));
|
|
1101
1187
|
if (targets.length === 0) {
|
|
@@ -1125,12 +1211,12 @@ function makeCacheCommand() {
|
|
|
1125
1211
|
for (const r of removed) logOk(`Removed ${r}`);
|
|
1126
1212
|
});
|
|
1127
1213
|
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(
|
|
1214
|
+
console.log(path36__default.join(path36__default.resolve(opts.projectDir), ".skaile", "cache"));
|
|
1129
1215
|
if (opts.global) console.log(globalCacheRoot());
|
|
1130
1216
|
});
|
|
1131
1217
|
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
1218
|
const targets = collectCacheTargets({
|
|
1133
|
-
projectDir:
|
|
1219
|
+
projectDir: path36__default.resolve(opts.projectDir),
|
|
1134
1220
|
global: opts.global
|
|
1135
1221
|
});
|
|
1136
1222
|
console.log();
|
|
@@ -1146,7 +1232,7 @@ function makeCatalogCommand() {
|
|
|
1146
1232
|
const catalog = new Command("catalog").description("Catalog source health and configuration");
|
|
1147
1233
|
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
1234
|
const { resolveConfig, isLocalCatalogUrl, trpcGetUrl } = await import('../library/index.js');
|
|
1149
|
-
const projectDir = opts.projectDir ?
|
|
1235
|
+
const projectDir = opts.projectDir ? path36__default.resolve(opts.projectDir) : void 0;
|
|
1150
1236
|
const cfg = resolveConfig({ projectDir });
|
|
1151
1237
|
const baseUrl = opts.url ?? cfg.catalog.url;
|
|
1152
1238
|
if (isLocalCatalogUrl(baseUrl)) {
|
|
@@ -1164,7 +1250,7 @@ function makeCatalogCommand() {
|
|
|
1164
1250
|
});
|
|
1165
1251
|
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
1252
|
const { resolveConfig } = await import('../library/index.js');
|
|
1167
|
-
const projectDir = opts.projectDir ?
|
|
1253
|
+
const projectDir = opts.projectDir ? path36__default.resolve(opts.projectDir) : void 0;
|
|
1168
1254
|
const cfg = resolveConfig({ projectDir });
|
|
1169
1255
|
console.log(`url: ${cfg.catalog.url}`);
|
|
1170
1256
|
console.log(`framing: ${cfg.catalog.framing}`);
|
|
@@ -1173,7 +1259,7 @@ function makeCatalogCommand() {
|
|
|
1173
1259
|
return catalog;
|
|
1174
1260
|
}
|
|
1175
1261
|
async function runLocalCatalogTest(projectDir) {
|
|
1176
|
-
const { resolveCatalogSource } = await import('../open-library-
|
|
1262
|
+
const { resolveCatalogSource } = await import('../open-library-AT6RYQ5M.js');
|
|
1177
1263
|
let resolved;
|
|
1178
1264
|
try {
|
|
1179
1265
|
resolved = await resolveCatalogSource({ projectDir });
|
|
@@ -1215,11 +1301,11 @@ async function runRemoteCatalogProbe(baseUrl, probeUrl) {
|
|
|
1215
1301
|
logErr(`${probeUrl} responded ${res.status} ${res.statusText} (${ms}ms)`);
|
|
1216
1302
|
if (res.status === 404) {
|
|
1217
1303
|
logInfo(
|
|
1218
|
-
|
|
1304
|
+
`Got 404 from catalog.listKinds. Check the URL prefix in ${userConfigPath()} \u2014 Skaile mirrors must expose \`/trpc/catalog.*\` at the configured baseUrl.`
|
|
1219
1305
|
);
|
|
1220
1306
|
} else {
|
|
1221
1307
|
logInfo(
|
|
1222
|
-
|
|
1308
|
+
`Verify the URL in ${userConfigPath()} and any auth requirements on private mirrors.`
|
|
1223
1309
|
);
|
|
1224
1310
|
}
|
|
1225
1311
|
process.exitCode = 1;
|
|
@@ -1243,7 +1329,7 @@ async function runRemoteCatalogProbe(baseUrl, probeUrl) {
|
|
|
1243
1329
|
} else {
|
|
1244
1330
|
logErr(`Could not reach ${probeUrl}: ${err instanceof Error ? err.message : String(err)}`);
|
|
1245
1331
|
}
|
|
1246
|
-
logInfo(
|
|
1332
|
+
logInfo(`Verify the URL in ${userConfigPath()} and that the catalog backend is deployed.`);
|
|
1247
1333
|
process.exitCode = 1;
|
|
1248
1334
|
} finally {
|
|
1249
1335
|
clearTimeout(timeout);
|
|
@@ -1317,8 +1403,8 @@ async function scanLibraryFlowEntries() {
|
|
|
1317
1403
|
const indexPath = resolveIndexPath();
|
|
1318
1404
|
if (!existsSync(indexPath)) return entries;
|
|
1319
1405
|
const [{ authoringLibraries }, { createFullRegistry: createFullRegistry2 }] = await Promise.all([
|
|
1320
|
-
import('../open-library-
|
|
1321
|
-
import('../open-registry-
|
|
1406
|
+
import('../open-library-AT6RYQ5M.js'),
|
|
1407
|
+
import('../open-registry-F2Z4OLXJ.js')
|
|
1322
1408
|
]);
|
|
1323
1409
|
const index = new LocalIndex({ indexPath });
|
|
1324
1410
|
try {
|
|
@@ -1375,11 +1461,11 @@ function findSkills() {
|
|
|
1375
1461
|
return deduped;
|
|
1376
1462
|
}
|
|
1377
1463
|
function walkSkills(dir, out) {
|
|
1378
|
-
for (const entry of
|
|
1379
|
-
const full =
|
|
1464
|
+
for (const entry of fs12__default.readdirSync(dir, { withFileTypes: true })) {
|
|
1465
|
+
const full = path36__default.join(dir, entry.name);
|
|
1380
1466
|
if (entry.isDirectory()) {
|
|
1381
|
-
const skillMd =
|
|
1382
|
-
if (
|
|
1467
|
+
const skillMd = path36__default.join(full, "SKILL.md");
|
|
1468
|
+
if (fs12__default.existsSync(skillMd)) {
|
|
1383
1469
|
out.push({ name: entry.name, path: full, skillPath: skillMd });
|
|
1384
1470
|
} else {
|
|
1385
1471
|
walkSkills(full, out);
|
|
@@ -1400,10 +1486,10 @@ function resolveFlowIds() {
|
|
|
1400
1486
|
}
|
|
1401
1487
|
}
|
|
1402
1488
|
function resolveSessionIds(projectDir) {
|
|
1403
|
-
const sessionsDir =
|
|
1404
|
-
if (!
|
|
1489
|
+
const sessionsDir = path36__default.join(projectDir, ".skaile", "sessions");
|
|
1490
|
+
if (!fs12__default.existsSync(sessionsDir)) return [];
|
|
1405
1491
|
try {
|
|
1406
|
-
return
|
|
1492
|
+
return fs12__default.readdirSync(sessionsDir).filter((f) => f.endsWith(".json")).map((f) => f.slice(0, -".json".length));
|
|
1407
1493
|
} catch {
|
|
1408
1494
|
return [];
|
|
1409
1495
|
}
|
|
@@ -1542,7 +1628,7 @@ function printResolvedPathsSection(config) {
|
|
|
1542
1628
|
console.log(` ${S.label("prompts:".padEnd(16))} ${config.promptsDir ?? paths.promptsDir}`);
|
|
1543
1629
|
}
|
|
1544
1630
|
async function showConfig(opts) {
|
|
1545
|
-
const projectDir = opts.projectDir ?
|
|
1631
|
+
const projectDir = opts.projectDir ? path36__default.resolve(opts.projectDir) : process.cwd();
|
|
1546
1632
|
let config;
|
|
1547
1633
|
let wsDefaults;
|
|
1548
1634
|
try {
|
|
@@ -1587,13 +1673,13 @@ function makeConfigCommand() {
|
|
|
1587
1673
|
const cmd = new Command("config").description("Manage personal config (.skaile/settings.json)");
|
|
1588
1674
|
cmd.command("show").description("Show effective config with sources").option("--project-dir <path>", "Project directory").action((opts) => showConfig(opts));
|
|
1589
1675
|
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 ?
|
|
1676
|
+
const projectDir = opts.projectDir ? path36__default.resolve(opts.projectDir) : process.cwd();
|
|
1591
1677
|
const config = await resolveSettings(projectDir);
|
|
1592
1678
|
const value = config[key];
|
|
1593
1679
|
console.log(value ?? S.dim("(not set)"));
|
|
1594
1680
|
});
|
|
1595
1681
|
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 ?
|
|
1682
|
+
const projectDir = opts.projectDir ? path36__default.resolve(opts.projectDir) : process.cwd();
|
|
1597
1683
|
if (key === "provider" || key === "cloud" || key === "cloudConfig") {
|
|
1598
1684
|
logErr(
|
|
1599
1685
|
`'${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 +2019,8 @@ function makeConnectorCommand() {
|
|
|
1933
2019
|
async (driver, opts) => {
|
|
1934
2020
|
const { installNpmPackages } = await import('../connectors/index.js');
|
|
1935
2021
|
const { scanDirectory: scanDirectory2, factoryAssetRoots: factoryAssetRoots2, WorkspaceYamlEditor: WorkspaceYamlEditor2 } = await import('../core/index.js');
|
|
1936
|
-
const projectDir =
|
|
1937
|
-
const yamlPath =
|
|
2022
|
+
const projectDir = path36__default.resolve(opts.projectDir);
|
|
2023
|
+
const yamlPath = path36__default.join(projectDir, "skaile.yaml");
|
|
1938
2024
|
if (!existsSync(yamlPath)) {
|
|
1939
2025
|
logErr("No skaile.yaml found in current directory. Run 'skaile init' first.");
|
|
1940
2026
|
process.exit(1);
|
|
@@ -1994,8 +2080,8 @@ ${installResult.output}`);
|
|
|
1994
2080
|
);
|
|
1995
2081
|
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
2082
|
const { WorkspaceYamlEditor: WorkspaceYamlEditor2 } = await import('../core/index.js');
|
|
1997
|
-
const projectDir =
|
|
1998
|
-
const yamlPath =
|
|
2083
|
+
const projectDir = path36__default.resolve(opts.projectDir);
|
|
2084
|
+
const yamlPath = path36__default.join(projectDir, "skaile.yaml");
|
|
1999
2085
|
if (!existsSync(yamlPath)) {
|
|
2000
2086
|
logErr("No skaile.yaml found in current directory.");
|
|
2001
2087
|
process.exit(1);
|
|
@@ -2012,7 +2098,7 @@ ${installResult.output}`);
|
|
|
2012
2098
|
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
2099
|
const res = await import('../connectors/index.js');
|
|
2014
2100
|
res.registerBuiltinConnectors();
|
|
2015
|
-
const projectDir =
|
|
2101
|
+
const projectDir = path36__default.resolve(opts.projectDir);
|
|
2016
2102
|
const declarations = res.loadConnectorDeclarations(projectDir);
|
|
2017
2103
|
if (declarations.length === 0) {
|
|
2018
2104
|
console.log("No connectors configured in skaile.yaml.");
|
|
@@ -2036,7 +2122,7 @@ ${installResult.output}`);
|
|
|
2036
2122
|
await manager.disconnectAll();
|
|
2037
2123
|
});
|
|
2038
2124
|
cmd.command("list").description("List all configured connectors").option("--project-dir <path>", "Workspace directory", process.cwd()).action(async (opts) => {
|
|
2039
|
-
const projectDir =
|
|
2125
|
+
const projectDir = path36__default.resolve(opts.projectDir);
|
|
2040
2126
|
const manager = await connectConnectors(projectDir);
|
|
2041
2127
|
try {
|
|
2042
2128
|
console.log(JSON.stringify(manager.listConnectors(), null, 2));
|
|
@@ -2045,7 +2131,7 @@ ${installResult.output}`);
|
|
|
2045
2131
|
}
|
|
2046
2132
|
});
|
|
2047
2133
|
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 =
|
|
2134
|
+
const projectDir = path36__default.resolve(opts.projectDir);
|
|
2049
2135
|
const manager = await connectConnectors(projectDir);
|
|
2050
2136
|
try {
|
|
2051
2137
|
if (opts.all) {
|
|
@@ -2069,7 +2155,7 @@ ${installResult.output}`);
|
|
|
2069
2155
|
}
|
|
2070
2156
|
});
|
|
2071
2157
|
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 =
|
|
2158
|
+
const projectDir = path36__default.resolve(opts.projectDir);
|
|
2073
2159
|
const manager = await connectConnectors(projectDir);
|
|
2074
2160
|
try {
|
|
2075
2161
|
if (!manager.has(id)) {
|
|
@@ -2084,7 +2170,7 @@ ${installResult.output}`);
|
|
|
2084
2170
|
}
|
|
2085
2171
|
});
|
|
2086
2172
|
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 =
|
|
2173
|
+
const projectDir = path36__default.resolve(opts.projectDir);
|
|
2088
2174
|
const manager = await connectConnectors(projectDir);
|
|
2089
2175
|
try {
|
|
2090
2176
|
const content = await manager.read(id, resourcePath);
|
|
@@ -2094,7 +2180,7 @@ ${installResult.output}`);
|
|
|
2094
2180
|
}
|
|
2095
2181
|
});
|
|
2096
2182
|
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 =
|
|
2183
|
+
const projectDir = path36__default.resolve(opts.projectDir);
|
|
2098
2184
|
const manager = await connectConnectors(projectDir);
|
|
2099
2185
|
try {
|
|
2100
2186
|
await manager.write(id, resourcePath, { data: content });
|
|
@@ -2104,7 +2190,7 @@ ${installResult.output}`);
|
|
|
2104
2190
|
}
|
|
2105
2191
|
});
|
|
2106
2192
|
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 =
|
|
2193
|
+
const projectDir = path36__default.resolve(opts.projectDir);
|
|
2108
2194
|
const manager = await connectConnectors(projectDir);
|
|
2109
2195
|
try {
|
|
2110
2196
|
const entries = await manager.list(id, resourcePath, {
|
|
@@ -2117,7 +2203,7 @@ ${installResult.output}`);
|
|
|
2117
2203
|
}
|
|
2118
2204
|
});
|
|
2119
2205
|
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 =
|
|
2206
|
+
const projectDir = path36__default.resolve(opts.projectDir);
|
|
2121
2207
|
const manager = await connectConnectors(projectDir);
|
|
2122
2208
|
try {
|
|
2123
2209
|
const results = await manager.search(id, query);
|
|
@@ -2127,7 +2213,7 @@ ${installResult.output}`);
|
|
|
2127
2213
|
}
|
|
2128
2214
|
});
|
|
2129
2215
|
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 =
|
|
2216
|
+
const projectDir = path36__default.resolve(opts.projectDir);
|
|
2131
2217
|
const manager = await connectConnectors(projectDir);
|
|
2132
2218
|
try {
|
|
2133
2219
|
const ok = await manager.delete(id, resourcePath);
|
|
@@ -2137,7 +2223,7 @@ ${installResult.output}`);
|
|
|
2137
2223
|
}
|
|
2138
2224
|
});
|
|
2139
2225
|
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 =
|
|
2226
|
+
const projectDir = path36__default.resolve(opts.projectDir);
|
|
2141
2227
|
const manager = await connectConnectors(projectDir);
|
|
2142
2228
|
try {
|
|
2143
2229
|
if (!manager.has(id)) {
|
|
@@ -2246,7 +2332,7 @@ function envRecord() {
|
|
|
2246
2332
|
async function buildDeployContext(projectDir) {
|
|
2247
2333
|
const { resolveSkWorkspaceConfig: resolveSkWorkspaceConfig2 } = await import('../core/index.js');
|
|
2248
2334
|
const config = resolveSkWorkspaceConfig2(projectDir);
|
|
2249
|
-
const workspaceId = config.name ??
|
|
2335
|
+
const workspaceId = config.name ?? path36__default.basename(projectDir);
|
|
2250
2336
|
let log;
|
|
2251
2337
|
try {
|
|
2252
2338
|
const { createLogger } = await import('../core/logging.js');
|
|
@@ -2278,13 +2364,13 @@ async function ensureTargetsRegistered(projectDir) {
|
|
|
2278
2364
|
const { resolveSkWorkspaceConfig: resolveSkWorkspaceConfig2 } = await import('../core/index.js');
|
|
2279
2365
|
const config = resolveSkWorkspaceConfig2(projectDir);
|
|
2280
2366
|
if (config.plugins && config.plugins.length > 0) {
|
|
2281
|
-
const { ensurePluginsLoaded } = await import('../plugin-store-
|
|
2367
|
+
const { ensurePluginsLoaded } = await import('../plugin-store-27KGLW4S.js');
|
|
2282
2368
|
const result = await ensurePluginsLoaded(projectDir, config.plugins, pluginRegistry);
|
|
2283
2369
|
for (const f of result.failed) logWarn(f.error);
|
|
2284
2370
|
}
|
|
2285
2371
|
}
|
|
2286
2372
|
async function runUp(opts) {
|
|
2287
|
-
const projectDir =
|
|
2373
|
+
const projectDir = path36__default.resolve(opts.projectDir);
|
|
2288
2374
|
await ensureTargetsRegistered(projectDir);
|
|
2289
2375
|
const { resolveSkWorkspaceConfig: resolveSkWorkspaceConfig2 } = await import('../core/index.js');
|
|
2290
2376
|
const { resolveDeployTarget, pluginRegistry } = await import('../plugin-registry/index.js');
|
|
@@ -2352,7 +2438,7 @@ async function restoreFromHandle(projectDir) {
|
|
|
2352
2438
|
return { target, handle, ctx };
|
|
2353
2439
|
}
|
|
2354
2440
|
async function runDown(opts) {
|
|
2355
|
-
const projectDir =
|
|
2441
|
+
const projectDir = path36__default.resolve(opts.projectDir);
|
|
2356
2442
|
const restored = await restoreFromHandle(projectDir);
|
|
2357
2443
|
if (!restored) return;
|
|
2358
2444
|
await restored.handle.stop();
|
|
@@ -2361,7 +2447,7 @@ async function runDown(opts) {
|
|
|
2361
2447
|
logOk(`Stopped ${S.cmd(restored.target.id)} and cleared the handle.`);
|
|
2362
2448
|
}
|
|
2363
2449
|
async function runStatus(opts) {
|
|
2364
|
-
const projectDir =
|
|
2450
|
+
const projectDir = path36__default.resolve(opts.projectDir);
|
|
2365
2451
|
const restored = await restoreFromHandle(projectDir);
|
|
2366
2452
|
if (!restored) return;
|
|
2367
2453
|
const health = await restored.handle.health();
|
|
@@ -2375,7 +2461,7 @@ async function runStatus(opts) {
|
|
|
2375
2461
|
console.log();
|
|
2376
2462
|
}
|
|
2377
2463
|
async function runLogs(opts) {
|
|
2378
|
-
const projectDir =
|
|
2464
|
+
const projectDir = path36__default.resolve(opts.projectDir);
|
|
2379
2465
|
const restored = await restoreFromHandle(projectDir);
|
|
2380
2466
|
if (!restored) return;
|
|
2381
2467
|
if (!restored.handle.logs) {
|
|
@@ -2399,7 +2485,7 @@ function makeDeployCommand() {
|
|
|
2399
2485
|
}
|
|
2400
2486
|
function makeDiffCommand() {
|
|
2401
2487
|
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:
|
|
2488
|
+
const am2 = new AssetManager({ projectDir: path36__default.resolve(opts.projectDir) });
|
|
2403
2489
|
const result = await am2.diff(ref);
|
|
2404
2490
|
switch (result.status) {
|
|
2405
2491
|
case "not-found":
|
|
@@ -2421,7 +2507,7 @@ function makeDiffCommand() {
|
|
|
2421
2507
|
function makeFlowCommand() {
|
|
2422
2508
|
const cmd = new Command("flow").description("Manage flows");
|
|
2423
2509
|
cmd.command("list").description("List available flows").option("--project-dir <path>", "Project directory", process.cwd()).action(async (opts) => {
|
|
2424
|
-
const flows = await discoverFlowsWithLibraries(
|
|
2510
|
+
const flows = await discoverFlowsWithLibraries(path36__default.resolve(opts.projectDir));
|
|
2425
2511
|
if (flows.length === 0) {
|
|
2426
2512
|
logInfo("No flows found.");
|
|
2427
2513
|
return;
|
|
@@ -2436,7 +2522,7 @@ function makeFlowCommand() {
|
|
|
2436
2522
|
console.log();
|
|
2437
2523
|
});
|
|
2438
2524
|
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(
|
|
2525
|
+
const flows = await discoverFlowsWithLibraries(path36__default.resolve(opts.projectDir));
|
|
2440
2526
|
const flow = flows.find((f) => f.id === id);
|
|
2441
2527
|
if (!flow) {
|
|
2442
2528
|
logErr(`Flow not found: ${id}`);
|
|
@@ -2468,7 +2554,7 @@ function makeFlowCommand() {
|
|
|
2468
2554
|
function makeHistoryCommand() {
|
|
2469
2555
|
const cmd = new Command("history").description("Show recent add/remove/update actions");
|
|
2470
2556
|
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:
|
|
2557
|
+
const am2 = new AssetManager({ projectDir: path36__default.resolve(opts.projectDir) });
|
|
2472
2558
|
const limit = parseInt(limitStr, 10) || 20;
|
|
2473
2559
|
const entries = am2.history(limit);
|
|
2474
2560
|
if (entries.length === 0) {
|
|
@@ -2488,7 +2574,7 @@ function makeHistoryCommand() {
|
|
|
2488
2574
|
console.log();
|
|
2489
2575
|
});
|
|
2490
2576
|
cmd.command("clear").description("Clear action history").option("--project-dir <path>", "Project directory", process.cwd()).action((opts) => {
|
|
2491
|
-
const am2 = new AssetManager({ projectDir:
|
|
2577
|
+
const am2 = new AssetManager({ projectDir: path36__default.resolve(opts.projectDir) });
|
|
2492
2578
|
am2.clearHistory();
|
|
2493
2579
|
logOk("History cleared.");
|
|
2494
2580
|
});
|
|
@@ -2501,12 +2587,12 @@ var MCP_SERVER_ENTRY = {
|
|
|
2501
2587
|
env: {}
|
|
2502
2588
|
};
|
|
2503
2589
|
function pluginDir(projectDir) {
|
|
2504
|
-
return
|
|
2590
|
+
return path36__default.join(projectDir, ".claude", "plugins", "skaile");
|
|
2505
2591
|
}
|
|
2506
2592
|
async function readJsonStrict(p7) {
|
|
2507
2593
|
let raw;
|
|
2508
2594
|
try {
|
|
2509
|
-
raw = await
|
|
2595
|
+
raw = await fs6.readFile(p7, "utf-8");
|
|
2510
2596
|
} catch {
|
|
2511
2597
|
return null;
|
|
2512
2598
|
}
|
|
@@ -2519,32 +2605,32 @@ async function readJsonStrict(p7) {
|
|
|
2519
2605
|
}
|
|
2520
2606
|
}
|
|
2521
2607
|
async function writeJson(p7, value) {
|
|
2522
|
-
await
|
|
2523
|
-
await
|
|
2608
|
+
await fs6.mkdir(path36__default.dirname(p7), { recursive: true });
|
|
2609
|
+
await fs6.writeFile(p7, `${JSON.stringify(value, null, 2)}
|
|
2524
2610
|
`);
|
|
2525
2611
|
}
|
|
2526
2612
|
async function copyDir(src, dest) {
|
|
2527
|
-
await
|
|
2528
|
-
const entries = await
|
|
2613
|
+
await fs6.mkdir(dest, { recursive: true });
|
|
2614
|
+
const entries = await fs6.readdir(src, { withFileTypes: true });
|
|
2529
2615
|
for (const entry of entries) {
|
|
2530
|
-
const srcPath =
|
|
2531
|
-
const destPath =
|
|
2616
|
+
const srcPath = path36__default.join(src, entry.name);
|
|
2617
|
+
const destPath = path36__default.join(dest, entry.name);
|
|
2532
2618
|
if (entry.isDirectory()) await copyDir(srcPath, destPath);
|
|
2533
|
-
else await
|
|
2619
|
+
else await fs6.copyFile(srcPath, destPath);
|
|
2534
2620
|
}
|
|
2535
2621
|
}
|
|
2536
2622
|
async function install(projectDir, opts) {
|
|
2537
2623
|
return opts?.full ? installFullPlugin(projectDir) : installMcp(projectDir);
|
|
2538
2624
|
}
|
|
2539
2625
|
async function installMcp(projectDir) {
|
|
2540
|
-
const mcpPath =
|
|
2626
|
+
const mcpPath = path36__default.join(projectDir, ".claude", "mcp.json");
|
|
2541
2627
|
const existing = await readJsonStrict(mcpPath) ?? {};
|
|
2542
2628
|
const mcpServers = { ...existing.mcpServers ?? {} };
|
|
2543
2629
|
const previous = mcpServers[SKAILE_MCP_NAME];
|
|
2544
2630
|
const matches = previous && JSON.stringify(previous) === JSON.stringify(MCP_SERVER_ENTRY);
|
|
2545
2631
|
let warning;
|
|
2546
2632
|
if (previous && !matches) {
|
|
2547
|
-
warning = `overwrote existing ${SKAILE_MCP_NAME} entry in ${
|
|
2633
|
+
warning = `overwrote existing ${SKAILE_MCP_NAME} entry in ${path36__default.relative(projectDir, mcpPath)}`;
|
|
2548
2634
|
}
|
|
2549
2635
|
mcpServers[SKAILE_MCP_NAME] = MCP_SERVER_ENTRY;
|
|
2550
2636
|
await writeJson(mcpPath, { ...existing, mcpServers });
|
|
@@ -2553,15 +2639,15 @@ async function installMcp(projectDir) {
|
|
|
2553
2639
|
async function installFullPlugin(projectDir) {
|
|
2554
2640
|
const dir = pluginDir(projectDir);
|
|
2555
2641
|
for (const [rel, content] of Object.entries(buildClaudePluginFiles())) {
|
|
2556
|
-
const dest =
|
|
2557
|
-
await
|
|
2558
|
-
await
|
|
2642
|
+
const dest = path36__default.join(dir, rel);
|
|
2643
|
+
await fs6.mkdir(path36__default.dirname(dest), { recursive: true });
|
|
2644
|
+
await fs6.writeFile(dest, content);
|
|
2559
2645
|
}
|
|
2560
|
-
const projectSkillsDir =
|
|
2646
|
+
const projectSkillsDir = path36__default.join(projectDir, ".skaile", "skills");
|
|
2561
2647
|
if (existsSync(projectSkillsDir)) {
|
|
2562
|
-
await copyDir(projectSkillsDir,
|
|
2648
|
+
await copyDir(projectSkillsDir, path36__default.join(dir, "skills"));
|
|
2563
2649
|
}
|
|
2564
|
-
const settingsPath =
|
|
2650
|
+
const settingsPath = path36__default.join(projectDir, ".claude", "settings.json");
|
|
2565
2651
|
const settings = await readJsonStrict(settingsPath) ?? {};
|
|
2566
2652
|
const plugins = settings.plugins ?? [];
|
|
2567
2653
|
if (!plugins.includes(dir)) plugins.push(dir);
|
|
@@ -2569,8 +2655,8 @@ async function installFullPlugin(projectDir) {
|
|
|
2569
2655
|
return { changed: true, method: "plugin" };
|
|
2570
2656
|
}
|
|
2571
2657
|
async function uninstall(projectDir) {
|
|
2572
|
-
const settingsPath =
|
|
2573
|
-
const mcpPath =
|
|
2658
|
+
const settingsPath = path36__default.join(projectDir, ".claude", "settings.json");
|
|
2659
|
+
const mcpPath = path36__default.join(projectDir, ".claude", "mcp.json");
|
|
2574
2660
|
const dir = pluginDir(projectDir);
|
|
2575
2661
|
let changed = false;
|
|
2576
2662
|
const settings = await readJsonStrict(settingsPath);
|
|
@@ -2584,7 +2670,7 @@ async function uninstall(projectDir) {
|
|
|
2584
2670
|
}
|
|
2585
2671
|
}
|
|
2586
2672
|
if (existsSync(dir)) {
|
|
2587
|
-
await
|
|
2673
|
+
await fs6.rm(dir, { recursive: true, force: true });
|
|
2588
2674
|
changed = true;
|
|
2589
2675
|
}
|
|
2590
2676
|
const mcp = await readJsonStrict(mcpPath);
|
|
@@ -2594,7 +2680,7 @@ async function uninstall(projectDir) {
|
|
|
2594
2680
|
const updated = { ...mcp, mcpServers: rest };
|
|
2595
2681
|
if (Object.keys(rest).length === 0) delete updated.mcpServers;
|
|
2596
2682
|
if (Object.keys(updated).length === 0) {
|
|
2597
|
-
await
|
|
2683
|
+
await fs6.unlink(mcpPath);
|
|
2598
2684
|
} else {
|
|
2599
2685
|
await writeJson(mcpPath, updated);
|
|
2600
2686
|
}
|
|
@@ -2604,12 +2690,12 @@ async function uninstall(projectDir) {
|
|
|
2604
2690
|
async function detectInstall(projectDir) {
|
|
2605
2691
|
const dir = pluginDir(projectDir);
|
|
2606
2692
|
const settings = await readJsonStrict(
|
|
2607
|
-
|
|
2693
|
+
path36__default.join(projectDir, ".claude", "settings.json")
|
|
2608
2694
|
);
|
|
2609
|
-
if (existsSync(
|
|
2695
|
+
if (existsSync(path36__default.join(dir, ".claude-plugin", "plugin.json")) && settings?.plugins?.includes(dir)) {
|
|
2610
2696
|
return { method: "plugin", pluginPath: dir };
|
|
2611
2697
|
}
|
|
2612
|
-
const mcp = await readJsonStrict(
|
|
2698
|
+
const mcp = await readJsonStrict(path36__default.join(projectDir, ".claude", "mcp.json"));
|
|
2613
2699
|
if (mcp?.mcpServers && SKAILE_MCP_NAME in mcp.mcpServers) {
|
|
2614
2700
|
return { method: "mcp" };
|
|
2615
2701
|
}
|
|
@@ -2618,7 +2704,7 @@ async function detectInstall(projectDir) {
|
|
|
2618
2704
|
async function enable(projectDir) {
|
|
2619
2705
|
const detected = await detectInstall(projectDir);
|
|
2620
2706
|
if (!detected) throw new Error("plugin not installed for claude-code");
|
|
2621
|
-
const settingsPath =
|
|
2707
|
+
const settingsPath = path36__default.join(projectDir, ".claude", "settings.json");
|
|
2622
2708
|
const settings = await readJsonStrict(settingsPath) ?? {};
|
|
2623
2709
|
if (detected.method === "plugin") {
|
|
2624
2710
|
const disabled2 = settings.disabledPlugins ?? [];
|
|
@@ -2640,7 +2726,7 @@ async function enable(projectDir) {
|
|
|
2640
2726
|
async function disable(projectDir) {
|
|
2641
2727
|
const detected = await detectInstall(projectDir);
|
|
2642
2728
|
if (!detected) throw new Error("plugin not installed for claude-code");
|
|
2643
|
-
const settingsPath =
|
|
2729
|
+
const settingsPath = path36__default.join(projectDir, ".claude", "settings.json");
|
|
2644
2730
|
const settings = await readJsonStrict(settingsPath) ?? {};
|
|
2645
2731
|
if (detected.method === "plugin") {
|
|
2646
2732
|
const list2 = settings.disabledPlugins ?? [];
|
|
@@ -2660,12 +2746,12 @@ async function disable(projectDir) {
|
|
|
2660
2746
|
return { changed: true };
|
|
2661
2747
|
}
|
|
2662
2748
|
async function status(projectDir) {
|
|
2663
|
-
const settingsPath =
|
|
2664
|
-
const mcpPath =
|
|
2749
|
+
const settingsPath = path36__default.join(projectDir, ".claude", "settings.json");
|
|
2750
|
+
const mcpPath = path36__default.join(projectDir, ".claude", "mcp.json");
|
|
2665
2751
|
const dir = pluginDir(projectDir);
|
|
2666
2752
|
const settings = await readJsonStrict(settingsPath);
|
|
2667
2753
|
const mcp = await readJsonStrict(mcpPath);
|
|
2668
|
-
const pluginInstalled = !!(existsSync(
|
|
2754
|
+
const pluginInstalled = !!(existsSync(path36__default.join(dir, ".claude-plugin", "plugin.json")) && settings?.plugins?.includes(dir));
|
|
2669
2755
|
const mcpInstalled = !!(mcp?.mcpServers && SKAILE_MCP_NAME in mcp.mcpServers);
|
|
2670
2756
|
if (!pluginInstalled && !mcpInstalled) {
|
|
2671
2757
|
return {
|
|
@@ -2683,7 +2769,7 @@ async function status(projectDir) {
|
|
|
2683
2769
|
installed: "yes",
|
|
2684
2770
|
enabled: disabled2 ? "no" : "yes",
|
|
2685
2771
|
method: "plugin",
|
|
2686
|
-
location:
|
|
2772
|
+
location: path36__default.relative(projectDir, dir)
|
|
2687
2773
|
};
|
|
2688
2774
|
}
|
|
2689
2775
|
const disabled = settings?.disabledMcpjsonServers?.includes(SKAILE_MCP_NAME) ?? false;
|
|
@@ -2692,7 +2778,7 @@ async function status(projectDir) {
|
|
|
2692
2778
|
installed: "yes",
|
|
2693
2779
|
enabled: disabled ? "no" : "yes",
|
|
2694
2780
|
method: "mcp",
|
|
2695
|
-
location:
|
|
2781
|
+
location: path36__default.relative(projectDir, mcpPath)
|
|
2696
2782
|
};
|
|
2697
2783
|
}
|
|
2698
2784
|
var SKAILE_MCP_NAME2 = "skaile-workspace";
|
|
@@ -2706,7 +2792,7 @@ function buildEntry(projectDir) {
|
|
|
2706
2792
|
async function readConfig(p7) {
|
|
2707
2793
|
let raw;
|
|
2708
2794
|
try {
|
|
2709
|
-
raw = await
|
|
2795
|
+
raw = await fs6.readFile(p7, "utf-8");
|
|
2710
2796
|
} catch {
|
|
2711
2797
|
return null;
|
|
2712
2798
|
}
|
|
@@ -2719,16 +2805,16 @@ async function readConfig(p7) {
|
|
|
2719
2805
|
}
|
|
2720
2806
|
}
|
|
2721
2807
|
async function writeConfig(p7, value) {
|
|
2722
|
-
await
|
|
2808
|
+
await fs6.mkdir(path36__default.dirname(p7), { recursive: true });
|
|
2723
2809
|
const cleaned = {};
|
|
2724
2810
|
for (const [k, v] of Object.entries(value)) {
|
|
2725
2811
|
if (v === void 0) continue;
|
|
2726
2812
|
cleaned[k] = v;
|
|
2727
2813
|
}
|
|
2728
|
-
await
|
|
2814
|
+
await fs6.writeFile(p7, stringify$1(cleaned));
|
|
2729
2815
|
}
|
|
2730
2816
|
function configPath(projectDir) {
|
|
2731
|
-
return
|
|
2817
|
+
return path36__default.join(projectDir, ".codex", "config.toml");
|
|
2732
2818
|
}
|
|
2733
2819
|
async function install2(projectDir) {
|
|
2734
2820
|
const p7 = configPath(projectDir);
|
|
@@ -2739,7 +2825,7 @@ async function install2(projectDir) {
|
|
|
2739
2825
|
const matches = previous && JSON.stringify(previous) === JSON.stringify(next);
|
|
2740
2826
|
let warning;
|
|
2741
2827
|
if (previous && !matches) {
|
|
2742
|
-
warning = `overwrote existing ${SKAILE_MCP_NAME2} entry in ${
|
|
2828
|
+
warning = `overwrote existing ${SKAILE_MCP_NAME2} entry in ${path36__default.relative(projectDir, p7)}`;
|
|
2743
2829
|
}
|
|
2744
2830
|
if (matches) return { changed: false, method: "toml" };
|
|
2745
2831
|
servers[SKAILE_MCP_NAME2] = next;
|
|
@@ -2756,7 +2842,7 @@ async function uninstall2(projectDir) {
|
|
|
2756
2842
|
const updated = { ...cfg, mcp_servers: rest };
|
|
2757
2843
|
if (Object.keys(rest).length === 0) delete updated.mcp_servers;
|
|
2758
2844
|
if (Object.keys(updated).length === 0) {
|
|
2759
|
-
await
|
|
2845
|
+
await fs6.unlink(p7);
|
|
2760
2846
|
} else {
|
|
2761
2847
|
await writeConfig(p7, updated);
|
|
2762
2848
|
}
|
|
@@ -2780,43 +2866,43 @@ async function status2(projectDir) {
|
|
|
2780
2866
|
installed: "yes",
|
|
2781
2867
|
enabled: "n/a",
|
|
2782
2868
|
method: "mcp",
|
|
2783
|
-
location:
|
|
2869
|
+
location: path36__default.relative(projectDir, p7)
|
|
2784
2870
|
};
|
|
2785
2871
|
}
|
|
2786
2872
|
async function install3(projectDir) {
|
|
2787
|
-
const extDir =
|
|
2788
|
-
const extPath =
|
|
2789
|
-
await
|
|
2873
|
+
const extDir = path36__default.join(projectDir, ".omp", "extensions");
|
|
2874
|
+
const extPath = path36__default.join(extDir, "skaile.ts");
|
|
2875
|
+
await fs6.mkdir(extDir, { recursive: true });
|
|
2790
2876
|
const { WorkspacePlugin } = await import('../workspace-plugin/index.js');
|
|
2791
2877
|
const plugin = new WorkspacePlugin({ projectDir });
|
|
2792
2878
|
const nextSrc = await plugin.buildOmpExtensionSource();
|
|
2793
2879
|
let prevSrc = null;
|
|
2794
2880
|
try {
|
|
2795
|
-
prevSrc = await
|
|
2881
|
+
prevSrc = await fs6.readFile(extPath, "utf-8");
|
|
2796
2882
|
} catch {
|
|
2797
2883
|
}
|
|
2798
2884
|
if (prevSrc === nextSrc) return { changed: false, method: "generated" };
|
|
2799
|
-
await
|
|
2885
|
+
await fs6.writeFile(extPath, nextSrc);
|
|
2800
2886
|
return { changed: true, method: "generated" };
|
|
2801
2887
|
}
|
|
2802
2888
|
async function uninstall3(projectDir) {
|
|
2803
|
-
const extPath =
|
|
2889
|
+
const extPath = path36__default.join(projectDir, ".omp", "extensions", "skaile.ts");
|
|
2804
2890
|
try {
|
|
2805
|
-
await
|
|
2891
|
+
await fs6.unlink(extPath);
|
|
2806
2892
|
return { changed: true };
|
|
2807
2893
|
} catch {
|
|
2808
2894
|
return { changed: false };
|
|
2809
2895
|
}
|
|
2810
2896
|
}
|
|
2811
2897
|
async function status3(projectDir) {
|
|
2812
|
-
const extPath =
|
|
2898
|
+
const extPath = path36__default.join(projectDir, ".omp", "extensions", "skaile.ts");
|
|
2813
2899
|
if (existsSync(extPath)) {
|
|
2814
2900
|
return {
|
|
2815
2901
|
harness: "omp",
|
|
2816
2902
|
installed: "yes",
|
|
2817
2903
|
enabled: "n/a",
|
|
2818
2904
|
method: "extension",
|
|
2819
|
-
location:
|
|
2905
|
+
location: path36__default.relative(projectDir, extPath)
|
|
2820
2906
|
};
|
|
2821
2907
|
}
|
|
2822
2908
|
return {
|
|
@@ -2879,7 +2965,7 @@ async function installCodex(projectDir) {
|
|
|
2879
2965
|
console.log(` ${S.dim("\u2192")} Restart Codex CLI to pick up the change.`);
|
|
2880
2966
|
}
|
|
2881
2967
|
async function runInstall(opts) {
|
|
2882
|
-
const projectDir =
|
|
2968
|
+
const projectDir = path36__default.resolve(opts.projectDir);
|
|
2883
2969
|
const targets = resolveDriver(opts.driver);
|
|
2884
2970
|
let exitCode = 0;
|
|
2885
2971
|
if (targets.includes("claude-code")) {
|
|
@@ -2913,7 +2999,7 @@ async function uninstallCodex(projectDir) {
|
|
|
2913
2999
|
else logInfo(`codex: not installed`);
|
|
2914
3000
|
}
|
|
2915
3001
|
async function runUninstall(opts) {
|
|
2916
|
-
const projectDir =
|
|
3002
|
+
const projectDir = path36__default.resolve(opts.projectDir);
|
|
2917
3003
|
const targets = resolveDriver(opts.driver);
|
|
2918
3004
|
let exitCode = 0;
|
|
2919
3005
|
if (targets.includes("claude-code")) {
|
|
@@ -2956,7 +3042,7 @@ async function toggleTarget(t, projectDir, action3) {
|
|
|
2956
3042
|
});
|
|
2957
3043
|
}
|
|
2958
3044
|
async function runToggle(opts, action3) {
|
|
2959
|
-
const projectDir =
|
|
3045
|
+
const projectDir = path36__default.resolve(opts.projectDir);
|
|
2960
3046
|
const requestedAll = opts.driver === "all";
|
|
2961
3047
|
const targets = resolveDriver(opts.driver);
|
|
2962
3048
|
const usageError = checkToggleSupported(targets, requestedAll, action3);
|
|
@@ -2968,7 +3054,7 @@ async function runToggle(opts, action3) {
|
|
|
2968
3054
|
return exitCode;
|
|
2969
3055
|
}
|
|
2970
3056
|
async function runStatus2(opts) {
|
|
2971
|
-
const projectDir =
|
|
3057
|
+
const projectDir = path36__default.resolve(opts.projectDir);
|
|
2972
3058
|
const targets = resolveDriver(opts.driver);
|
|
2973
3059
|
const rows = [];
|
|
2974
3060
|
let exitCode = 0;
|
|
@@ -3039,7 +3125,7 @@ async function runHook(event) {
|
|
|
3039
3125
|
await plugin.shutdown();
|
|
3040
3126
|
return;
|
|
3041
3127
|
}
|
|
3042
|
-
const store = new PluginStore(
|
|
3128
|
+
const store = new PluginStore(path36__default.join(projectDir, ".skaile", "plugin-state.json"));
|
|
3043
3129
|
await store.load();
|
|
3044
3130
|
const status4 = store.get("connector:status");
|
|
3045
3131
|
if (status4 && typeof status4 === "object" && Object.keys(status4).length > 0) {
|
|
@@ -3099,37 +3185,6 @@ function makeIntegrationCommand() {
|
|
|
3099
3185
|
cmd.action(() => cmd.help());
|
|
3100
3186
|
return cmd;
|
|
3101
3187
|
}
|
|
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
3188
|
function exitOnSyncError(err) {
|
|
3134
3189
|
logErr(err instanceof Error ? err.message : String(err));
|
|
3135
3190
|
process.exit(1);
|
|
@@ -3143,10 +3198,25 @@ function assertManifestEditableOrExit(libraryPath) {
|
|
|
3143
3198
|
}
|
|
3144
3199
|
async function assertLibraryPathFree(manager, dir, exceptId) {
|
|
3145
3200
|
const clash = (await manager.listLibraries()).find(
|
|
3146
|
-
(l) => l.id !== exceptId &&
|
|
3201
|
+
(l) => l.id !== exceptId && path36.resolve(l.path) === dir
|
|
3147
3202
|
);
|
|
3148
3203
|
if (clash) throw new Error(`${dir} is already registered as library "${clash.name}".`);
|
|
3149
3204
|
}
|
|
3205
|
+
function canonicalDir(dir) {
|
|
3206
|
+
const abs = path36.resolve(dir);
|
|
3207
|
+
return fs12.existsSync(abs) ? fs12.realpathSync(abs) : abs;
|
|
3208
|
+
}
|
|
3209
|
+
function refuseGlobalInstallFolder(name, dir) {
|
|
3210
|
+
const reserved = globalInstallDir();
|
|
3211
|
+
const rel = path36.relative(canonicalDir(reserved), canonicalDir(dir));
|
|
3212
|
+
const inside = rel === "" || !rel.startsWith("..") && !path36.isAbsolute(rel);
|
|
3213
|
+
if (name === GLOBAL_INSTALL_DIR_NAME || inside) {
|
|
3214
|
+
logErr(
|
|
3215
|
+
`"${GLOBAL_INSTALL_DIR_NAME}" is reserved: ${reserved} holds assets from \`skaile install\`, not a library you author.`
|
|
3216
|
+
);
|
|
3217
|
+
process.exit(1);
|
|
3218
|
+
}
|
|
3219
|
+
}
|
|
3150
3220
|
function scaffoldLibraryFiles(dir, name) {
|
|
3151
3221
|
const readme = `# ${name}
|
|
3152
3222
|
|
|
@@ -3176,9 +3246,9 @@ by the same ref.
|
|
|
3176
3246
|
];
|
|
3177
3247
|
const written = [];
|
|
3178
3248
|
for (const [file, content] of files) {
|
|
3179
|
-
const target =
|
|
3180
|
-
if (
|
|
3181
|
-
|
|
3249
|
+
const target = path36.join(dir, file);
|
|
3250
|
+
if (fs12.existsSync(target)) continue;
|
|
3251
|
+
fs12.writeFileSync(target, content, "utf8");
|
|
3182
3252
|
written.push(file);
|
|
3183
3253
|
}
|
|
3184
3254
|
return written;
|
|
@@ -3253,8 +3323,9 @@ function makeLibraryCommand() {
|
|
|
3253
3323
|
);
|
|
3254
3324
|
process.exit(1);
|
|
3255
3325
|
}
|
|
3256
|
-
const libPath = opts.path ?
|
|
3257
|
-
|
|
3326
|
+
const libPath = opts.path ? path36.resolve(opts.path) : path36.join(resolveLibraryDir(), name);
|
|
3327
|
+
refuseGlobalInstallFolder(name, libPath);
|
|
3328
|
+
if (fs12.existsSync(libPath) && !fs12.statSync(libPath).isDirectory()) {
|
|
3258
3329
|
logErr(`${libPath} exists and is not a directory.`);
|
|
3259
3330
|
process.exit(1);
|
|
3260
3331
|
}
|
|
@@ -3278,9 +3349,9 @@ function makeLibraryCommand() {
|
|
|
3278
3349
|
backend = "git";
|
|
3279
3350
|
backendConfig = { url: opts.git, branch, authHint: "ssh" };
|
|
3280
3351
|
} else {
|
|
3281
|
-
|
|
3352
|
+
fs12.mkdirSync(libPath, { recursive: true });
|
|
3282
3353
|
}
|
|
3283
|
-
const blank =
|
|
3354
|
+
const blank = fs12.readdirSync(libPath).every((entry) => entry === ".git");
|
|
3284
3355
|
const isDefault = !hasDefault && ownership !== "reader";
|
|
3285
3356
|
await manager.addLibrary({
|
|
3286
3357
|
name,
|
|
@@ -3326,7 +3397,7 @@ function makeLibraryCommand() {
|
|
|
3326
3397
|
});
|
|
3327
3398
|
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
3399
|
"--description <text>",
|
|
3329
|
-
"Description for the
|
|
3400
|
+
"Description for the asset's frontmatter \u2014 say what it does and when to use it (default: a TODO placeholder `skaile validate` rejects)"
|
|
3330
3401
|
).action(
|
|
3331
3402
|
async (kind, name, opts) => {
|
|
3332
3403
|
if (!ASSET_KINDS.includes(kind)) {
|
|
@@ -3346,7 +3417,7 @@ function makeLibraryCommand() {
|
|
|
3346
3417
|
assertManifestEditableOrExit(target.path);
|
|
3347
3418
|
const effectiveKind = opts.kind ?? kind;
|
|
3348
3419
|
const am2 = new AssetManager({ projectDir: process.cwd() });
|
|
3349
|
-
const destDir = opts.dir ?
|
|
3420
|
+
const destDir = opts.dir ? path36.join(target.path, opts.dir) : target.path;
|
|
3350
3421
|
const res = am2.create(name, effectiveKind, destDir, { description: opts.description });
|
|
3351
3422
|
if (!res.ok) {
|
|
3352
3423
|
logErr(res.path);
|
|
@@ -3358,21 +3429,14 @@ function makeLibraryCommand() {
|
|
|
3358
3429
|
"Description is a TODO placeholder \u2014 edit it (what the skill does and when to use it) or `skaile validate` will fail."
|
|
3359
3430
|
);
|
|
3360
3431
|
}
|
|
3361
|
-
const
|
|
3362
|
-
stampAssetPublisher(res.path, publisher);
|
|
3363
|
-
stampManifestPublisher(target.path, publisher);
|
|
3364
|
-
upsertManifestAsset(target.path, {
|
|
3432
|
+
const { ref } = await registerLibraryAsset(target, library, {
|
|
3365
3433
|
kind: effectiveKind,
|
|
3366
3434
|
name,
|
|
3367
|
-
|
|
3435
|
+
assetDir: res.path,
|
|
3368
3436
|
version: "0.1.0",
|
|
3369
|
-
publisher
|
|
3437
|
+
publisher: opts.publisher
|
|
3370
3438
|
});
|
|
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
|
-
);
|
|
3439
|
+
logOk(`Indexed \u2014 add it with \`skaile add ${ref}\``);
|
|
3376
3440
|
} finally {
|
|
3377
3441
|
close();
|
|
3378
3442
|
}
|
|
@@ -3402,34 +3466,59 @@ function makeLibraryCommand() {
|
|
|
3402
3466
|
const { manager, close } = await openLibraryManager();
|
|
3403
3467
|
try {
|
|
3404
3468
|
const lib = await manager.requireLibrary(oldName);
|
|
3405
|
-
const parent =
|
|
3406
|
-
const newPath =
|
|
3407
|
-
|
|
3469
|
+
const parent = path36.dirname(lib.path);
|
|
3470
|
+
const newPath = path36.join(parent, newName);
|
|
3471
|
+
refuseGlobalInstallFolder(newName, newPath);
|
|
3472
|
+
if (fs12.existsSync(newPath)) {
|
|
3408
3473
|
logErr(`Target directory already exists: ${newPath}`);
|
|
3409
3474
|
process.exit(1);
|
|
3410
3475
|
}
|
|
3411
|
-
|
|
3476
|
+
fs12.renameSync(lib.path, newPath);
|
|
3412
3477
|
await manager.updateLibrary(lib.id, { name: newName, path: newPath });
|
|
3413
3478
|
logOk(`Renamed ${oldName} \u2192 ${newName}`);
|
|
3414
3479
|
} finally {
|
|
3415
3480
|
close();
|
|
3416
3481
|
}
|
|
3417
3482
|
});
|
|
3418
|
-
cmd.command("set <name> <field=value>").description(
|
|
3483
|
+
cmd.command("set <name> <field=value>").description(
|
|
3484
|
+
"Update a single library field (ownership, isDefault, path, publisher, backendConfig.<key>)"
|
|
3485
|
+
).action(async (name, expr) => {
|
|
3419
3486
|
const [field, ...rest] = expr.split("=");
|
|
3420
3487
|
const value = rest.join("=");
|
|
3421
|
-
const { manager, close } = await openLibraryManager();
|
|
3488
|
+
const { manager, library, close } = await openLibraryManager();
|
|
3422
3489
|
try {
|
|
3423
3490
|
const lib = await manager.requireLibrary(name);
|
|
3491
|
+
if (field === "publisher") {
|
|
3492
|
+
const publisher = value.trim().replace(/^@/, "");
|
|
3493
|
+
if (!/^[^\s/#@]+$/.test(publisher)) {
|
|
3494
|
+
logErr(
|
|
3495
|
+
`Invalid publisher "${value}": expected a bare name like "acme" (no @, /, # or spaces).`
|
|
3496
|
+
);
|
|
3497
|
+
process.exit(1);
|
|
3498
|
+
}
|
|
3499
|
+
if (lib.ownership === "reader") {
|
|
3500
|
+
logErr(
|
|
3501
|
+
`Library "${lib.name}" is read-only (ownership=reader); its publisher is not yours to set.`
|
|
3502
|
+
);
|
|
3503
|
+
process.exit(1);
|
|
3504
|
+
}
|
|
3505
|
+
assertManifestEditableOrExit(lib.path);
|
|
3506
|
+
setManifestPublisher(lib.path, publisher);
|
|
3507
|
+
const res = await indexLibrary(lib, library);
|
|
3508
|
+
for (const e of res.errors) logWarn(e);
|
|
3509
|
+
logOk(`Updated ${name}.publisher \u2192 ${publisher}`);
|
|
3510
|
+
return;
|
|
3511
|
+
}
|
|
3424
3512
|
const patch = {};
|
|
3425
3513
|
if (field === "ownership") patch.ownership = value;
|
|
3426
3514
|
else if (field === "isDefault") patch.isDefault = value === "true";
|
|
3427
3515
|
else if (field === "path") {
|
|
3428
|
-
const dir =
|
|
3429
|
-
if (!
|
|
3516
|
+
const dir = path36.resolve(value);
|
|
3517
|
+
if (!fs12.existsSync(dir) || !fs12.statSync(dir).isDirectory()) {
|
|
3430
3518
|
logErr(`Directory does not exist: ${dir}. \`library set path=\` does not move files.`);
|
|
3431
3519
|
process.exit(1);
|
|
3432
3520
|
}
|
|
3521
|
+
refuseGlobalInstallFolder(null, dir);
|
|
3433
3522
|
await assertLibraryPathFree(manager, dir, lib.id);
|
|
3434
3523
|
patch.path = dir;
|
|
3435
3524
|
} else if (field.startsWith("backendConfig.")) {
|
|
@@ -3507,8 +3596,13 @@ function makeLibraryCommand() {
|
|
|
3507
3596
|
logInfo(`Removed manifest entry ${ref} (root ${a.root} is gone)`);
|
|
3508
3597
|
}
|
|
3509
3598
|
const res = await indexLibrary(lib, library);
|
|
3510
|
-
|
|
3599
|
+
const unparsable = res.errors.filter((e) => e.includes("ManifestSchemaError:"));
|
|
3600
|
+
for (const e of res.errors) (unparsable.includes(e) ? logErr : logWarn)(e);
|
|
3511
3601
|
logOk(`Indexed ${res.assetsUpdated} asset(s) from ${name}.`);
|
|
3602
|
+
if (unparsable.length > 0) {
|
|
3603
|
+
logErr(`${unparsable.length} asset(s) skipped: manifest could not be parsed.`);
|
|
3604
|
+
process.exitCode = 1;
|
|
3605
|
+
}
|
|
3512
3606
|
} finally {
|
|
3513
3607
|
close();
|
|
3514
3608
|
}
|
|
@@ -3617,16 +3711,16 @@ function makeLibraryCommand() {
|
|
|
3617
3711
|
"With --create-repo: create the repo private (the store only accepts public repos)"
|
|
3618
3712
|
).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
3713
|
async (lib, opts) => {
|
|
3620
|
-
const { runLibraryPublish } = await import('../library-publish-
|
|
3714
|
+
const { runLibraryPublish } = await import('../library-publish-TVS3WQ4C.js');
|
|
3621
3715
|
await withStoreErrorHandling(() => runLibraryPublish(lib, opts));
|
|
3622
3716
|
}
|
|
3623
3717
|
);
|
|
3624
3718
|
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-
|
|
3719
|
+
const { runLibraryRegister } = await import('../library-publish-TVS3WQ4C.js');
|
|
3626
3720
|
await withStoreErrorHandling(() => runLibraryRegister(lib, opts));
|
|
3627
3721
|
});
|
|
3628
3722
|
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-
|
|
3723
|
+
const { runLibraryYank } = await import('../library-publish-TVS3WQ4C.js');
|
|
3630
3724
|
await withStoreErrorHandling(() => runLibraryYank(lib, opts));
|
|
3631
3725
|
});
|
|
3632
3726
|
return cmd;
|
|
@@ -3639,36 +3733,6 @@ async function withStoreErrorHandling(fn) {
|
|
|
3639
3733
|
process.exit(1);
|
|
3640
3734
|
}
|
|
3641
3735
|
}
|
|
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
3736
|
async function printPerLibraryStatus(name, asJson) {
|
|
3673
3737
|
const { manager, close } = await openLibraryManager();
|
|
3674
3738
|
try {
|
|
@@ -3707,9 +3771,9 @@ async function printOverallStatus(projectDir, asJson) {
|
|
|
3707
3771
|
} catch {
|
|
3708
3772
|
secretsStrategy = "unavailable";
|
|
3709
3773
|
}
|
|
3710
|
-
const resolvedProjectDir =
|
|
3711
|
-
const hasWorkspaceConfig = existsSync(
|
|
3712
|
-
const hasLockFile = existsSync(
|
|
3774
|
+
const resolvedProjectDir = path36.resolve(projectDir);
|
|
3775
|
+
const hasWorkspaceConfig = existsSync(path36.join(resolvedProjectDir, "skaile.yaml"));
|
|
3776
|
+
const hasLockFile = existsSync(path36.join(resolvedProjectDir, "skaile.lock.yaml"));
|
|
3713
3777
|
let assignments = [];
|
|
3714
3778
|
if (hasWorkspaceConfig) {
|
|
3715
3779
|
try {
|
|
@@ -4316,7 +4380,7 @@ function scheduleSoftDepPreview() {
|
|
|
4316
4380
|
}
|
|
4317
4381
|
async function loadAssets() {
|
|
4318
4382
|
softDepPreviewCache.clear();
|
|
4319
|
-
const { gatherAssetFeeds } = await import('../asset-feeds-
|
|
4383
|
+
const { gatherAssetFeeds } = await import('../asset-feeds-VIZXYDAO.js');
|
|
4320
4384
|
const { entries, notes } = await gatherAssetFeeds(am, am.projectDir);
|
|
4321
4385
|
if (notes.length > 0) {
|
|
4322
4386
|
state.message = notes.map((n) => `[${n.feed}] ${n.message}`).join(" \u2022 ");
|
|
@@ -4336,7 +4400,7 @@ function rebuildSourceTree() {
|
|
|
4336
4400
|
rebuildVisibleSources();
|
|
4337
4401
|
}
|
|
4338
4402
|
function sourceOrgRepo(s) {
|
|
4339
|
-
const parts = s.path.split(
|
|
4403
|
+
const parts = s.path.split(path36__default.sep).filter(Boolean);
|
|
4340
4404
|
if (parts.length < 2) return null;
|
|
4341
4405
|
return { org: parts[parts.length - 2], repo: parts[parts.length - 1] };
|
|
4342
4406
|
}
|
|
@@ -4483,13 +4547,13 @@ function reconcileCollapsedSets(rows) {
|
|
|
4483
4547
|
async function loadSourcesAndLibraries() {
|
|
4484
4548
|
try {
|
|
4485
4549
|
const [{ openLibraryManager: openLibraryManager2 }, { getGlobalCacheDir: getGlobalCacheDir2, globalSkaileDir: globalSkaileDir2 }] = await Promise.all([
|
|
4486
|
-
import('../open-library-
|
|
4550
|
+
import('../open-library-AT6RYQ5M.js'),
|
|
4487
4551
|
import('../core/index.js')
|
|
4488
4552
|
]);
|
|
4489
4553
|
const { manager, library, close } = await openLibraryManager2();
|
|
4490
4554
|
try {
|
|
4491
4555
|
const newRoot = getGlobalCacheDir2();
|
|
4492
|
-
const legacyRoot =
|
|
4556
|
+
const legacyRoot = path36__default.join(globalSkaileDir2(), "sources");
|
|
4493
4557
|
const isSourceRow = (l) => l.path.startsWith(newRoot) || l.path.startsWith(legacyRoot);
|
|
4494
4558
|
const libs = await manager.listLibraries();
|
|
4495
4559
|
const defs = await library.listAssetDefs();
|
|
@@ -5425,13 +5489,13 @@ async function run(projectDir) {
|
|
|
5425
5489
|
}
|
|
5426
5490
|
function makeManageCommand() {
|
|
5427
5491
|
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(
|
|
5492
|
+
await run(path36__default.resolve(opts.projectDir));
|
|
5429
5493
|
});
|
|
5430
5494
|
}
|
|
5431
5495
|
function makeMcpServerCommand() {
|
|
5432
5496
|
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 =
|
|
5497
|
+
const path39 = await import('path');
|
|
5498
|
+
const projectDir = path39.default.resolve(opts.projectDir);
|
|
5435
5499
|
const { LogStore, StdoutSink, registerLogStore } = await import('../core/logging.js');
|
|
5436
5500
|
registerLogStore(
|
|
5437
5501
|
new LogStore({
|
|
@@ -5601,7 +5665,7 @@ function workspaceConfigFiles(dir) {
|
|
|
5601
5665
|
} catch {
|
|
5602
5666
|
return [];
|
|
5603
5667
|
}
|
|
5604
|
-
return names.filter((name) => isWorkspaceConfigFilename(name)).sort().map((name) =>
|
|
5668
|
+
return names.filter((name) => isWorkspaceConfigFilename(name)).sort().map((name) => path36__default.join(dir, name));
|
|
5605
5669
|
}
|
|
5606
5670
|
function readAgentConfigBlock(raw) {
|
|
5607
5671
|
const key = AGENT_CONFIG_KEYS.find((candidate) => raw[candidate] !== void 0);
|
|
@@ -5613,7 +5677,7 @@ function readAgentConfigBlock(raw) {
|
|
|
5613
5677
|
return flat ? { key, profiles: { default: profiles }, flat } : { key, profiles, flat };
|
|
5614
5678
|
}
|
|
5615
5679
|
function planProviderMigration(options) {
|
|
5616
|
-
const projectDir =
|
|
5680
|
+
const projectDir = path36__default.resolve(options.projectDir);
|
|
5617
5681
|
const registryPath = options.workspace ? workspaceProviderRegistryPath(projectDir) : userProviderRegistryPath();
|
|
5618
5682
|
const plan = {
|
|
5619
5683
|
registryPath,
|
|
@@ -5629,7 +5693,7 @@ function planProviderMigration(options) {
|
|
|
5629
5693
|
raw = parseDocument(readFileSync(file, "utf-8")).toJS() ?? {};
|
|
5630
5694
|
} catch (error) {
|
|
5631
5695
|
plan.warnings.push(
|
|
5632
|
-
`${
|
|
5696
|
+
`${path36__default.basename(file)}: not valid YAML (${error instanceof Error ? error.message : String(error)}) \u2014 skipped`
|
|
5633
5697
|
);
|
|
5634
5698
|
continue;
|
|
5635
5699
|
}
|
|
@@ -5678,7 +5742,7 @@ function planProviderMigration(options) {
|
|
|
5678
5742
|
});
|
|
5679
5743
|
if (!model) {
|
|
5680
5744
|
plan.warnings.push(
|
|
5681
|
-
`${
|
|
5745
|
+
`${path36__default.basename(file)}: profile '${profile}' had no model: \u2014 it now resolves against registry order. Pin it with 'model: ${providerId}/<modelId>'.`
|
|
5682
5746
|
);
|
|
5683
5747
|
}
|
|
5684
5748
|
touched = true;
|
|
@@ -5745,7 +5809,7 @@ function printPlan(plan) {
|
|
|
5745
5809
|
for (const entry of plan.entries) {
|
|
5746
5810
|
const base = entry.entry.base_url ?? S.dim("(transport-derived)");
|
|
5747
5811
|
console.log(
|
|
5748
|
-
` ${S.label(`${
|
|
5812
|
+
` ${S.label(`${path36__default.basename(entry.file)} ${entry.profile}`)} provider: ${entry.legacy.provider}, cloud: ${entry.legacy.cloud}`
|
|
5749
5813
|
);
|
|
5750
5814
|
console.log(` \u2192 providers.yml ${S.bold(entry.providerId)} ${base}`);
|
|
5751
5815
|
console.log(
|
|
@@ -5761,7 +5825,7 @@ function printPlan(plan) {
|
|
|
5761
5825
|
console.log();
|
|
5762
5826
|
}
|
|
5763
5827
|
async function runMigrateProviders(opts) {
|
|
5764
|
-
const projectDir = opts.projectDir ?
|
|
5828
|
+
const projectDir = opts.projectDir ? path36__default.resolve(opts.projectDir) : process.cwd();
|
|
5765
5829
|
const plan = planProviderMigration({ projectDir, workspace: opts.workspace });
|
|
5766
5830
|
for (const warning of plan.warnings) logWarn(warning);
|
|
5767
5831
|
if (plan.entries.length === 0 && Object.keys(plan.providers).length === 0) {
|
|
@@ -5821,8 +5885,8 @@ function makeNpxCommand() {
|
|
|
5821
5885
|
skills.command("add <url>").description(
|
|
5822
5886
|
"Clone a repo, register it in the project's skaile.yaml sources[], and install a skill from it"
|
|
5823
5887
|
).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 =
|
|
5888
|
+
const projectDir = path36__default.resolve(opts.projectDir);
|
|
5889
|
+
const projYaml = path36__default.join(projectDir, "skaile.yaml");
|
|
5826
5890
|
if (!existsSync(projYaml)) {
|
|
5827
5891
|
logErr(`No skaile.yaml in ${projectDir} \u2014 run \`skaile init\` first.`);
|
|
5828
5892
|
process.exit(1);
|
|
@@ -5835,11 +5899,11 @@ function makeNpxCommand() {
|
|
|
5835
5899
|
}
|
|
5836
5900
|
const spinner4 = p5.spinner();
|
|
5837
5901
|
const key = sourceCacheKey(url);
|
|
5838
|
-
const clonePath =
|
|
5902
|
+
const clonePath = path36__default.join(getGlobalCacheDir(), key);
|
|
5839
5903
|
spinner4.start(`Cloning ${url}`);
|
|
5840
5904
|
try {
|
|
5841
5905
|
if (!existsSync(clonePath)) {
|
|
5842
|
-
mkdirSync(
|
|
5906
|
+
mkdirSync(path36__default.dirname(clonePath), { recursive: true });
|
|
5843
5907
|
execSync(`git clone ${url} ${clonePath}`, { stdio: "ignore" });
|
|
5844
5908
|
}
|
|
5845
5909
|
spinner4.stop(`Cloned to ${key}`);
|
|
@@ -5885,7 +5949,7 @@ function makeNpxCommand() {
|
|
|
5885
5949
|
return npx;
|
|
5886
5950
|
}
|
|
5887
5951
|
function resolvePublisher(clonePath, url) {
|
|
5888
|
-
const manifestPath =
|
|
5952
|
+
const manifestPath = path36__default.join(clonePath, SKAILE_MANIFEST_FILENAME);
|
|
5889
5953
|
if (existsSync(manifestPath)) {
|
|
5890
5954
|
try {
|
|
5891
5955
|
const { manifest } = decodeSkaileManifest(readFileSync(manifestPath, "utf8"));
|
|
@@ -5898,12 +5962,12 @@ function resolvePublisher(clonePath, url) {
|
|
|
5898
5962
|
return url.match(/github\.com[/:]([^/]+)\/[^/]+/)?.[1];
|
|
5899
5963
|
}
|
|
5900
5964
|
function resolveSkillName(clonePath, requested) {
|
|
5901
|
-
const skillsDir =
|
|
5902
|
-
if (existsSync(
|
|
5965
|
+
const skillsDir = path36__default.join(clonePath, "skills");
|
|
5966
|
+
if (existsSync(path36__default.join(skillsDir, requested, "SKILL.md"))) return requested;
|
|
5903
5967
|
if (!existsSync(skillsDir)) return requested;
|
|
5904
5968
|
for (const entry of readdirSync(skillsDir, { withFileTypes: true })) {
|
|
5905
5969
|
if (!entry.isDirectory()) continue;
|
|
5906
|
-
const md =
|
|
5970
|
+
const md = path36__default.join(skillsDir, entry.name, "SKILL.md");
|
|
5907
5971
|
if (!existsSync(md)) continue;
|
|
5908
5972
|
try {
|
|
5909
5973
|
const { data } = parseFrontmatter(readFileSync(md, "utf8"));
|
|
@@ -5933,7 +5997,7 @@ function makeOutdatedCommand() {
|
|
|
5933
5997
|
)
|
|
5934
5998
|
).action(async (filter, opts) => {
|
|
5935
5999
|
const am2 = new AssetManager({
|
|
5936
|
-
projectDir:
|
|
6000
|
+
projectDir: path36__default.resolve(opts.projectDir),
|
|
5937
6001
|
driverTarget: opts.target
|
|
5938
6002
|
});
|
|
5939
6003
|
const entries = await am2.outdated();
|
|
@@ -5951,19 +6015,24 @@ function makeOutdatedCommand() {
|
|
|
5951
6015
|
console.log(S.heading(" Outdated Assets"));
|
|
5952
6016
|
console.log(` ${S.rule(refW + 34)}`);
|
|
5953
6017
|
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`;
|
|
6018
|
+
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
6019
|
console.log(
|
|
5956
|
-
` ${colorRef(outdatedRef(e))}${" ".repeat(refW - outdatedRef(e).length)} ${pc5.yellow(status4)}`
|
|
6020
|
+
` ${colorRef(outdatedRef(e))}${" ".repeat(refW - outdatedRef(e).length)} ${e.problem !== void 0 ? pc5.red(status4) : pc5.yellow(status4)}`
|
|
5957
6021
|
);
|
|
5958
6022
|
}
|
|
5959
6023
|
console.log();
|
|
5960
|
-
|
|
6024
|
+
if (filtered.some((e) => e.problem === void 0)) {
|
|
6025
|
+
logWarn(`Run ${S.cmd("skaile update")} to re-deploy.`);
|
|
6026
|
+
}
|
|
6027
|
+
if (filtered.some((e) => e.problem !== void 0)) {
|
|
6028
|
+
logWarn(`Run ${S.cmd("skaile install")} to restore or re-lock the broken assets.`);
|
|
6029
|
+
}
|
|
5961
6030
|
});
|
|
5962
6031
|
}
|
|
5963
6032
|
function makePatchCommand() {
|
|
5964
6033
|
const cmd = new Command("patch").description("Patch workflow for skill improvement");
|
|
5965
6034
|
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:
|
|
6035
|
+
const am2 = new AssetManager({ projectDir: path36__default.resolve(opts.projectDir) });
|
|
5967
6036
|
try {
|
|
5968
6037
|
const dest = await am2.patch(ref);
|
|
5969
6038
|
logOk(`Extracted to ${S.dim(dest)}`);
|
|
@@ -5974,7 +6043,7 @@ function makePatchCommand() {
|
|
|
5974
6043
|
}
|
|
5975
6044
|
});
|
|
5976
6045
|
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:
|
|
6046
|
+
const am2 = new AssetManager({ projectDir: path36__default.resolve(opts.projectDir) });
|
|
5978
6047
|
try {
|
|
5979
6048
|
const patchFile = await am2.patchCommit(ref);
|
|
5980
6049
|
logOk(`Patch saved to ${S.dim(patchFile)}`);
|
|
@@ -5985,7 +6054,7 @@ function makePatchCommand() {
|
|
|
5985
6054
|
}
|
|
5986
6055
|
});
|
|
5987
6056
|
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:
|
|
6057
|
+
const am2 = new AssetManager({ projectDir: path36__default.resolve(opts.projectDir) });
|
|
5989
6058
|
try {
|
|
5990
6059
|
await am2.patchSubmit(ref);
|
|
5991
6060
|
logOk("Patch applied to repo clone and committed.");
|
|
@@ -5998,7 +6067,7 @@ function makePatchCommand() {
|
|
|
5998
6067
|
}
|
|
5999
6068
|
});
|
|
6000
6069
|
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:
|
|
6070
|
+
const am2 = new AssetManager({ projectDir: path36__default.resolve(opts.projectDir) });
|
|
6002
6071
|
am2.patchRemove(ref);
|
|
6003
6072
|
logOk(`Patch removed for ${ref}`);
|
|
6004
6073
|
});
|
|
@@ -6016,7 +6085,7 @@ function action2(fn) {
|
|
|
6016
6085
|
};
|
|
6017
6086
|
}
|
|
6018
6087
|
async function reconcileAndReport(projectDir, plugins) {
|
|
6019
|
-
const { reconcilePlugins } = await import('../plugin-store-
|
|
6088
|
+
const { reconcilePlugins } = await import('../plugin-store-27KGLW4S.js');
|
|
6020
6089
|
if (plugins.length === 0) {
|
|
6021
6090
|
logInfo("No plugins declared \u2014 nothing to reconcile.");
|
|
6022
6091
|
return;
|
|
@@ -6030,10 +6099,10 @@ async function reconcileAndReport(projectDir, plugins) {
|
|
|
6030
6099
|
}
|
|
6031
6100
|
}
|
|
6032
6101
|
async function runInstall2(spec, opts) {
|
|
6033
|
-
const projectDir =
|
|
6102
|
+
const projectDir = path36__default.resolve(opts.projectDir);
|
|
6034
6103
|
const { WorkspaceYamlEditor: WorkspaceYamlEditor2 } = await import('../core/index.js');
|
|
6035
|
-
const { specName } = await import('../plugin-store-
|
|
6036
|
-
const yamlPath =
|
|
6104
|
+
const { specName } = await import('../plugin-store-27KGLW4S.js');
|
|
6105
|
+
const yamlPath = path36__default.join(projectDir, "skaile.yaml");
|
|
6037
6106
|
const editor = WorkspaceYamlEditor2.load(yamlPath);
|
|
6038
6107
|
const replaced = editor.addPlugin(spec, specName);
|
|
6039
6108
|
editor.save();
|
|
@@ -6042,10 +6111,10 @@ async function runInstall2(spec, opts) {
|
|
|
6042
6111
|
await reconcileAndReport(projectDir, editor.getPlugins());
|
|
6043
6112
|
}
|
|
6044
6113
|
async function runRemove(name, opts) {
|
|
6045
|
-
const projectDir =
|
|
6114
|
+
const projectDir = path36__default.resolve(opts.projectDir);
|
|
6046
6115
|
const { WorkspaceYamlEditor: WorkspaceYamlEditor2 } = await import('../core/index.js');
|
|
6047
|
-
const { specName } = await import('../plugin-store-
|
|
6048
|
-
const yamlPath =
|
|
6116
|
+
const { specName } = await import('../plugin-store-27KGLW4S.js');
|
|
6117
|
+
const yamlPath = path36__default.join(projectDir, "skaile.yaml");
|
|
6049
6118
|
const editor = WorkspaceYamlEditor2.load(yamlPath);
|
|
6050
6119
|
const removed = editor.removePlugin(name, specName);
|
|
6051
6120
|
if (!removed) {
|
|
@@ -6057,7 +6126,7 @@ async function runRemove(name, opts) {
|
|
|
6057
6126
|
await reconcileAndReport(projectDir, editor.getPlugins());
|
|
6058
6127
|
}
|
|
6059
6128
|
async function runList(opts) {
|
|
6060
|
-
const projectDir =
|
|
6129
|
+
const projectDir = path36__default.resolve(opts.projectDir);
|
|
6061
6130
|
const { resolveSkWorkspaceConfig: resolveSkWorkspaceConfig2 } = await import('../core/index.js');
|
|
6062
6131
|
const config = resolveSkWorkspaceConfig2(projectDir);
|
|
6063
6132
|
const declared = config.plugins ?? [];
|
|
@@ -6072,7 +6141,7 @@ async function runList(opts) {
|
|
|
6072
6141
|
const registry = createPluginRegistry();
|
|
6073
6142
|
if (declared.length > 0) {
|
|
6074
6143
|
try {
|
|
6075
|
-
const { loadPlugins } = await import('../plugin-store-
|
|
6144
|
+
const { loadPlugins } = await import('../plugin-store-27KGLW4S.js');
|
|
6076
6145
|
const result = await loadPlugins(projectDir, declared, registry);
|
|
6077
6146
|
for (const f of result.failed) logWarn(f.error);
|
|
6078
6147
|
} catch (err) {
|
|
@@ -6247,7 +6316,7 @@ function neededSources(config, lock) {
|
|
|
6247
6316
|
}
|
|
6248
6317
|
function sourcesWithSidecar(sources) {
|
|
6249
6318
|
const dir = getStoreManifestsDir();
|
|
6250
|
-
return sources.filter((s) => existsSync(
|
|
6319
|
+
return sources.filter((s) => existsSync(path36.join(dir, `${storeManifestSlug(s.url)}.yaml`))).map((s) => s.url);
|
|
6251
6320
|
}
|
|
6252
6321
|
function compact(obj) {
|
|
6253
6322
|
const out = {};
|
|
@@ -6339,8 +6408,8 @@ function redactSecrets(preset, findings) {
|
|
|
6339
6408
|
}
|
|
6340
6409
|
return { preset: next, keys };
|
|
6341
6410
|
}
|
|
6342
|
-
function placeholderKey(itemId,
|
|
6343
|
-
return `${itemId}_${
|
|
6411
|
+
function placeholderKey(itemId, path39) {
|
|
6412
|
+
return `${itemId}_${path39}`.replace(/[^a-zA-Z0-9]+/g, "_").replace(/^_+|_+$/g, "").toUpperCase();
|
|
6344
6413
|
}
|
|
6345
6414
|
function setAtPath(root, segments, value) {
|
|
6346
6415
|
let node = root;
|
|
@@ -6363,7 +6432,7 @@ function makePresetCommand() {
|
|
|
6363
6432
|
cmd.command("init [name]").description("Scaffold a new .preset.yaml file").option("--dir <path>", "Output directory", process.cwd()).action(async (name, opts) => {
|
|
6364
6433
|
const presetName = name ?? "my-preset";
|
|
6365
6434
|
const filename = `${presetName}.preset.yaml`;
|
|
6366
|
-
const outPath =
|
|
6435
|
+
const outPath = path36__default.join(path36__default.resolve(opts.dir), filename);
|
|
6367
6436
|
if (existsSync(outPath)) {
|
|
6368
6437
|
logErr(`File already exists: ${outPath}`);
|
|
6369
6438
|
logInfo("Choose a different name or remove the existing file.");
|
|
@@ -6396,7 +6465,7 @@ function makePresetCommand() {
|
|
|
6396
6465
|
return cmd;
|
|
6397
6466
|
}
|
|
6398
6467
|
async function runPresetExport(name, opts) {
|
|
6399
|
-
const projectDir =
|
|
6468
|
+
const projectDir = path36__default.resolve(opts.projectDir);
|
|
6400
6469
|
const file = loadSkWorkspaceConfig(projectDir);
|
|
6401
6470
|
if (!file) {
|
|
6402
6471
|
logErr(`No skaile.yaml found in ${projectDir}`);
|
|
@@ -6406,7 +6475,7 @@ async function runPresetExport(name, opts) {
|
|
|
6406
6475
|
const presetName = name ?? file.config.name ?? "my-preset";
|
|
6407
6476
|
let lock = null;
|
|
6408
6477
|
try {
|
|
6409
|
-
lock = readLock(
|
|
6478
|
+
lock = readLock(path36__default.join(projectDir, "skaile.lock.yaml"));
|
|
6410
6479
|
} catch {
|
|
6411
6480
|
lock = null;
|
|
6412
6481
|
}
|
|
@@ -6447,7 +6516,7 @@ async function runPresetExport(name, opts) {
|
|
|
6447
6516
|
const contents = header ? `${header}
|
|
6448
6517
|
${body}` : body;
|
|
6449
6518
|
if (opts.out && opts.dir !== process.cwd()) logWarn("--dir is ignored when --out is set.");
|
|
6450
|
-
const outPath = opts.out ?
|
|
6519
|
+
const outPath = opts.out ? path36__default.resolve(opts.out) : path36__default.join(path36__default.resolve(opts.dir), `${presetName}.preset.yaml`);
|
|
6451
6520
|
if (existsSync(outPath) && !opts.force) {
|
|
6452
6521
|
logErr(`File already exists: ${outPath}`);
|
|
6453
6522
|
logInfo("Pass --force to overwrite, or choose a different --out/--dir.");
|
|
@@ -6459,7 +6528,7 @@ ${body}` : body;
|
|
|
6459
6528
|
logErr(`Failed to write ${outPath}: ${e.message}`);
|
|
6460
6529
|
process.exit(1);
|
|
6461
6530
|
}
|
|
6462
|
-
logOk(`Exported ${S.brand(
|
|
6531
|
+
logOk(`Exported ${S.brand(path36__default.basename(outPath))}`);
|
|
6463
6532
|
logInfo(`Path: ${outPath}`);
|
|
6464
6533
|
if (unresolved.length > 0) {
|
|
6465
6534
|
console.error(S.err("This file is NOT safe to share."));
|
|
@@ -6500,13 +6569,13 @@ function collectInput(value, acc) {
|
|
|
6500
6569
|
return acc;
|
|
6501
6570
|
}
|
|
6502
6571
|
async function runPresetApply(filePath, opts) {
|
|
6503
|
-
const projectDir =
|
|
6572
|
+
const projectDir = path36__default.resolve(opts.projectDir);
|
|
6504
6573
|
const file = loadSkWorkspaceConfig(projectDir);
|
|
6505
6574
|
if (!file) {
|
|
6506
6575
|
logErr("No skaile.yaml \u2014 run `skaile init` first");
|
|
6507
6576
|
process.exit(1);
|
|
6508
6577
|
}
|
|
6509
|
-
const resolved =
|
|
6578
|
+
const resolved = path36__default.resolve(filePath);
|
|
6510
6579
|
if (!existsSync(resolved)) {
|
|
6511
6580
|
logErr(`File not found: ${resolved}`);
|
|
6512
6581
|
process.exit(1);
|
|
@@ -6722,7 +6791,7 @@ async function reportNestedPresetRefs(preset) {
|
|
|
6722
6791
|
}
|
|
6723
6792
|
async function checkPresetCycles(preset, resolved) {
|
|
6724
6793
|
const { detectCycles } = await import('../discovery/index.js');
|
|
6725
|
-
const presetRef =
|
|
6794
|
+
const presetRef = path36__default.basename(resolved, ".preset.yaml");
|
|
6726
6795
|
const edges = [];
|
|
6727
6796
|
for (const item of preset.items) {
|
|
6728
6797
|
if (item.ref) {
|
|
@@ -6774,7 +6843,7 @@ function printPresetSummary(preset, placeholderCount, hasWarnings) {
|
|
|
6774
6843
|
}
|
|
6775
6844
|
}
|
|
6776
6845
|
async function runPresetValidate(filePath) {
|
|
6777
|
-
const resolved =
|
|
6846
|
+
const resolved = path36__default.resolve(filePath);
|
|
6778
6847
|
const preset = await loadPresetForValidation(resolved);
|
|
6779
6848
|
await reportNestedPresetRefs(preset);
|
|
6780
6849
|
await checkPresetCycles(preset, resolved);
|
|
@@ -6824,11 +6893,11 @@ items:
|
|
|
6824
6893
|
}
|
|
6825
6894
|
function makeRebuildCommand() {
|
|
6826
6895
|
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 =
|
|
6896
|
+
const projectDir = path36__default.resolve(opts.projectDir);
|
|
6828
6897
|
let agentDir;
|
|
6829
6898
|
if (agentArg) {
|
|
6830
6899
|
if (agentArg.includes("/") || agentArg.includes("\\")) {
|
|
6831
|
-
agentDir =
|
|
6900
|
+
agentDir = path36__default.resolve(projectDir, agentArg);
|
|
6832
6901
|
} else {
|
|
6833
6902
|
let resolved;
|
|
6834
6903
|
try {
|
|
@@ -6837,7 +6906,7 @@ function makeRebuildCommand() {
|
|
|
6837
6906
|
if (!(err instanceof AgentRefResolutionError)) throw err;
|
|
6838
6907
|
logWarn(`${err.message} \u2014 using "${agentArg}"`);
|
|
6839
6908
|
}
|
|
6840
|
-
agentDir = resolved ??
|
|
6909
|
+
agentDir = resolved ?? path36__default.resolve(projectDir, agentArg);
|
|
6841
6910
|
}
|
|
6842
6911
|
} else {
|
|
6843
6912
|
let resolved;
|
|
@@ -6938,7 +7007,7 @@ function makeFlowEventHandler() {
|
|
|
6938
7007
|
}
|
|
6939
7008
|
function makeRunCommand() {
|
|
6940
7009
|
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 =
|
|
7010
|
+
const projectDir = path36__default.resolve(opts.projectDir);
|
|
6942
7011
|
const cliDriver = opts.driver;
|
|
6943
7012
|
const dryRun = opts.dryRun ?? false;
|
|
6944
7013
|
let flowId = positional[0];
|
|
@@ -7039,7 +7108,7 @@ function makeRunCommand() {
|
|
|
7039
7108
|
}
|
|
7040
7109
|
function makeResumeCommand() {
|
|
7041
7110
|
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 =
|
|
7111
|
+
const projectDir = path36__default.resolve(opts.projectDir);
|
|
7043
7112
|
const sessionId = opts.session;
|
|
7044
7113
|
const dryRun = opts.dryRun ?? false;
|
|
7045
7114
|
const session = sessionId ? await loadSessionById(projectDir, sessionId) : await loadSession(projectDir);
|
|
@@ -7066,7 +7135,7 @@ function makeResumeCommand() {
|
|
|
7066
7135
|
}
|
|
7067
7136
|
function makeStatusCommand() {
|
|
7068
7137
|
return new Command("status").description("Show current session state").option("--project-dir <path>", "Project directory", process.cwd()).action(async (opts) => {
|
|
7069
|
-
const projectDir =
|
|
7138
|
+
const projectDir = path36__default.resolve(opts.projectDir);
|
|
7070
7139
|
const session = await loadSession(projectDir);
|
|
7071
7140
|
if (!session) {
|
|
7072
7141
|
logInfo("No active session.");
|
|
@@ -7091,7 +7160,7 @@ function makeStatusCommand() {
|
|
|
7091
7160
|
}
|
|
7092
7161
|
function makeClearCommand() {
|
|
7093
7162
|
return new Command("clear").description("Unset current session pointer").option("--project-dir <path>", "Project directory", process.cwd()).action(async (opts) => {
|
|
7094
|
-
const projectDir =
|
|
7163
|
+
const projectDir = path36__default.resolve(opts.projectDir);
|
|
7095
7164
|
await clearSession(projectDir);
|
|
7096
7165
|
logOk("Session cleared.");
|
|
7097
7166
|
});
|
|
@@ -7101,7 +7170,7 @@ function makeReplCommand() {
|
|
|
7101
7170
|
const { findWorkspaceRoot } = await import('../core/index.js');
|
|
7102
7171
|
const { startRepl } = await import('../tui/index.js');
|
|
7103
7172
|
const os2 = await import('os');
|
|
7104
|
-
const userCwd =
|
|
7173
|
+
const userCwd = path36__default.resolve(opts.projectDir ?? process.cwd());
|
|
7105
7174
|
const workspaceRoot = findWorkspaceRoot(userCwd);
|
|
7106
7175
|
let projectDir;
|
|
7107
7176
|
let agentCwd;
|
|
@@ -7123,13 +7192,13 @@ function makeReplCommand() {
|
|
|
7123
7192
|
p5.cancel("Cancelled.");
|
|
7124
7193
|
process.exit(0);
|
|
7125
7194
|
}
|
|
7126
|
-
const tmpDir =
|
|
7195
|
+
const tmpDir = fs12__default.mkdtempSync(path36__default.join(os2.tmpdir(), "skaile-repl-"));
|
|
7127
7196
|
projectDir = tmpDir;
|
|
7128
7197
|
agentCwd = userCwd;
|
|
7129
7198
|
logOk(`Temporary workspace: ${S.cmd(tmpDir)}`);
|
|
7130
7199
|
if (!driverOverride) {
|
|
7131
|
-
const claudeDir =
|
|
7132
|
-
if (
|
|
7200
|
+
const claudeDir = path36__default.join(os2.homedir(), ".claude");
|
|
7201
|
+
if (fs12__default.existsSync(claudeDir)) {
|
|
7133
7202
|
driverOverride = "claude-sdk";
|
|
7134
7203
|
logInfo(`Detected ${S.cmd("~/.claude")} \u2192 using ${S.cmd("claude-sdk")} harness`);
|
|
7135
7204
|
} else {
|
|
@@ -7201,12 +7270,12 @@ function makeServeCommand() {
|
|
|
7201
7270
|
);
|
|
7202
7271
|
}
|
|
7203
7272
|
async function ensurePluginsLoadedForServe(projectDir) {
|
|
7204
|
-
const { logInfo: logInfo2, logWarn: logWarn2 } = await import('../helpers-
|
|
7273
|
+
const { logInfo: logInfo2, logWarn: logWarn2 } = await import('../helpers-HV5Y57CY.js');
|
|
7205
7274
|
try {
|
|
7206
7275
|
const { resolveSkWorkspaceConfig: resolveSkWorkspaceConfig2 } = await import('../core/index.js');
|
|
7207
7276
|
const config = resolveSkWorkspaceConfig2(projectDir);
|
|
7208
7277
|
if (!config.plugins || config.plugins.length === 0) return;
|
|
7209
|
-
const { ensurePluginsLoaded } = await import('../plugin-store-
|
|
7278
|
+
const { ensurePluginsLoaded } = await import('../plugin-store-27KGLW4S.js');
|
|
7210
7279
|
const { pluginRegistry } = await import('../plugin-registry/index.js');
|
|
7211
7280
|
const result = await ensurePluginsLoaded(projectDir, config.plugins, pluginRegistry);
|
|
7212
7281
|
if (result.loaded.length > 0) {
|
|
@@ -7220,21 +7289,21 @@ async function ensurePluginsLoadedForServe(projectDir) {
|
|
|
7220
7289
|
}
|
|
7221
7290
|
}
|
|
7222
7291
|
async function runCompileTest(opts) {
|
|
7223
|
-
const { logOk: logOk2, logErr: logErr2, logInfo: logInfo2, S: S2 } = await import('../helpers-
|
|
7292
|
+
const { logOk: logOk2, logErr: logErr2, logInfo: logInfo2, S: S2 } = await import('../helpers-HV5Y57CY.js');
|
|
7224
7293
|
const { tmpdir } = await import('os');
|
|
7225
|
-
const { dirname: dirname3, join:
|
|
7294
|
+
const { dirname: dirname3, join: join7, resolve: resolve5 } = await import('path');
|
|
7226
7295
|
const { fileURLToPath: fileURLToPath2 } = await import('url');
|
|
7227
|
-
const { unlinkSync, existsSync:
|
|
7296
|
+
const { unlinkSync, existsSync: existsSync16 } = await import('fs');
|
|
7228
7297
|
const { spawn } = await import('child_process');
|
|
7229
7298
|
const { portableSpawnSync: portableSpawnSync2 } = await import('../core/index.js');
|
|
7230
|
-
const { MONOREPO_ROOT } = await import('../paths-
|
|
7299
|
+
const { MONOREPO_ROOT } = await import('../paths-P7ZXMDCX.js');
|
|
7231
7300
|
if (MONOREPO_ROOT === null) {
|
|
7232
7301
|
logErr2("--compile-test is only available inside the skaile-dev workspace.");
|
|
7233
7302
|
logInfo2("Run it from a checkout of skaile-ai/skaile-dev (the monorepo shell).");
|
|
7234
7303
|
process.exitCode = 2;
|
|
7235
7304
|
return;
|
|
7236
7305
|
}
|
|
7237
|
-
const outfile =
|
|
7306
|
+
const outfile = join7(tmpdir(), `skaile-compile-test-${Date.now()}`);
|
|
7238
7307
|
const __thisFile = fileURLToPath2(import.meta.url);
|
|
7239
7308
|
const entryPoint = resolve5(dirname3(__thisFile), "..", "index.ts");
|
|
7240
7309
|
logInfo2(`Building compiled binary...`);
|
|
@@ -7289,7 +7358,7 @@ async function runCompileTest(opts) {
|
|
|
7289
7358
|
} catch {
|
|
7290
7359
|
}
|
|
7291
7360
|
try {
|
|
7292
|
-
if (
|
|
7361
|
+
if (existsSync16(outfile)) unlinkSync(outfile);
|
|
7293
7362
|
} catch {
|
|
7294
7363
|
}
|
|
7295
7364
|
}
|
|
@@ -7710,7 +7779,7 @@ function resolveMode(opts) {
|
|
|
7710
7779
|
if (opts.forceLocal && opts.forceRemote) {
|
|
7711
7780
|
throw new Error("Cannot use both --local and --remote");
|
|
7712
7781
|
}
|
|
7713
|
-
const startDir =
|
|
7782
|
+
const startDir = path36__default.resolve(opts.projectDir ?? process.cwd());
|
|
7714
7783
|
const localDb = findLogsDb(startDir);
|
|
7715
7784
|
if (opts.forceLocal) {
|
|
7716
7785
|
if (!localDb) {
|
|
@@ -7743,14 +7812,14 @@ function resolveMode(opts) {
|
|
|
7743
7812
|
function findLogsDb(startDir) {
|
|
7744
7813
|
let dir = startDir;
|
|
7745
7814
|
for (let i = 0; i < MAX_WALK_LEVELS; i++) {
|
|
7746
|
-
const candidate =
|
|
7815
|
+
const candidate = path36__default.join(dir, ".skaile", "logs.db");
|
|
7747
7816
|
if (existsSync(candidate)) {
|
|
7748
7817
|
try {
|
|
7749
7818
|
if (statSync(candidate).isFile()) return candidate;
|
|
7750
7819
|
} catch {
|
|
7751
7820
|
}
|
|
7752
7821
|
}
|
|
7753
|
-
const parent =
|
|
7822
|
+
const parent = path36__default.dirname(dir);
|
|
7754
7823
|
if (parent === dir) return void 0;
|
|
7755
7824
|
dir = parent;
|
|
7756
7825
|
}
|
|
@@ -7925,7 +7994,7 @@ function parsePositiveInt(value, flag) {
|
|
|
7925
7994
|
function makeSessionCommand() {
|
|
7926
7995
|
const cmd = new Command("session").description("Manage sessions");
|
|
7927
7996
|
cmd.command("list").description("List all sessions for a project").option("--project-dir <path>", "Project directory", process.cwd()).action(async (opts) => {
|
|
7928
|
-
const projectDir =
|
|
7997
|
+
const projectDir = path36__default.resolve(opts.projectDir);
|
|
7929
7998
|
const sessions = await listSessions(projectDir);
|
|
7930
7999
|
const current = await loadSession(projectDir);
|
|
7931
8000
|
if (sessions.length === 0) {
|
|
@@ -7953,7 +8022,7 @@ function makeSessionCommand() {
|
|
|
7953
8022
|
console.log();
|
|
7954
8023
|
});
|
|
7955
8024
|
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 =
|
|
8025
|
+
const projectDir = path36__default.resolve(opts.projectDir);
|
|
7957
8026
|
const session = await loadSessionById(projectDir, runId);
|
|
7958
8027
|
if (!session) {
|
|
7959
8028
|
logErr(`Session not found: ${runId}`);
|
|
@@ -7962,12 +8031,12 @@ function makeSessionCommand() {
|
|
|
7962
8031
|
console.log(JSON.stringify(session, null, 2));
|
|
7963
8032
|
});
|
|
7964
8033
|
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 =
|
|
8034
|
+
const projectDir = path36__default.resolve(opts.projectDir);
|
|
7966
8035
|
await setCurrentSession(projectDir, runId);
|
|
7967
8036
|
logOk(`Switched to session: ${S.dim(runId.slice(0, 8))}`);
|
|
7968
8037
|
});
|
|
7969
8038
|
cmd.command("delete <run-id>").description("Delete a session").option("--project-dir <path>", "Project directory", process.cwd()).action(async (runId, opts) => {
|
|
7970
|
-
const projectDir =
|
|
8039
|
+
const projectDir = path36__default.resolve(opts.projectDir);
|
|
7971
8040
|
await deleteSession(projectDir, runId);
|
|
7972
8041
|
logOk(`Deleted session: ${S.dim(runId.slice(0, 8))}`);
|
|
7973
8042
|
});
|
|
@@ -8021,12 +8090,12 @@ function showOverview(am2) {
|
|
|
8021
8090
|
}
|
|
8022
8091
|
async function showAsset(am2, kind, name) {
|
|
8023
8092
|
const entry = await am2.info(`${kind}:${name}`);
|
|
8024
|
-
if (entry?.source &&
|
|
8093
|
+
if (entry?.source && fs12__default.existsSync(entry.source)) {
|
|
8025
8094
|
console.log();
|
|
8026
8095
|
console.log(` ${kindColor(entry.kind)} ${S.heading(entry.name)}`);
|
|
8027
8096
|
console.log(` ${S.rule(40)}`);
|
|
8028
8097
|
console.log();
|
|
8029
|
-
console.log(
|
|
8098
|
+
console.log(fs12__default.readFileSync(entry.source, "utf-8"));
|
|
8030
8099
|
return;
|
|
8031
8100
|
}
|
|
8032
8101
|
logErr(`Asset not found: ${kind}:${name}`);
|
|
@@ -8035,7 +8104,7 @@ async function showAsset(am2, kind, name) {
|
|
|
8035
8104
|
function makeShowCommand() {
|
|
8036
8105
|
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
8106
|
const am2 = new AssetManager({
|
|
8038
|
-
projectDir:
|
|
8107
|
+
projectDir: path36__default.resolve(opts.projectDir),
|
|
8039
8108
|
driverTarget: opts.target
|
|
8040
8109
|
});
|
|
8041
8110
|
if (!kind) {
|
|
@@ -8098,14 +8167,14 @@ function makeStoreCommand() {
|
|
|
8098
8167
|
});
|
|
8099
8168
|
store.command("mode <auto|local|remote>").description("Set the catalog resolution mode (not yet wired)").action((_mode) => {
|
|
8100
8169
|
logErr(
|
|
8101
|
-
|
|
8170
|
+
`\`skaile store mode\` is scaffolded but not yet wired. Store config lives at ${path36__default.join(globalSkaileDir(), "store", "config.yaml")}.`
|
|
8102
8171
|
);
|
|
8103
8172
|
process.exit(2);
|
|
8104
8173
|
});
|
|
8105
8174
|
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-
|
|
8175
|
+
const { openCatalogSource: openCatalogSource2, LocalCatalogDisabledError } = await import('../open-library-AT6RYQ5M.js');
|
|
8107
8176
|
try {
|
|
8108
|
-
const remote = await openCatalogSource2({ projectDir:
|
|
8177
|
+
const remote = await openCatalogSource2({ projectDir: path36__default.resolve(opts.projectDir) });
|
|
8109
8178
|
const assets = await remote.listAssets(opts.kind ? { kind: opts.kind } : {});
|
|
8110
8179
|
const results = filterCatalogAssets(assets, query);
|
|
8111
8180
|
if (results.length === 0) {
|
|
@@ -8122,7 +8191,7 @@ function makeStoreCommand() {
|
|
|
8122
8191
|
} catch (e) {
|
|
8123
8192
|
if (e instanceof LocalCatalogDisabledError) {
|
|
8124
8193
|
logErr(
|
|
8125
|
-
|
|
8194
|
+
`Remote catalog disabled (catalog.url: local). Set \`catalog.url: https://skaile.store\` in ${userConfigPath()}.`
|
|
8126
8195
|
);
|
|
8127
8196
|
} else {
|
|
8128
8197
|
logErr(`Store search failed: ${e.message}`);
|
|
@@ -8131,10 +8200,10 @@ function makeStoreCommand() {
|
|
|
8131
8200
|
}
|
|
8132
8201
|
});
|
|
8133
8202
|
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-
|
|
8203
|
+
const { openCatalogSource: openCatalogSource2, LocalCatalogDisabledError } = await import('../open-library-AT6RYQ5M.js');
|
|
8204
|
+
const { supportsInstallManifest } = await import('../project-J2EROMBW.js');
|
|
8136
8205
|
try {
|
|
8137
|
-
const remote = await openCatalogSource2({ projectDir:
|
|
8206
|
+
const remote = await openCatalogSource2({ projectDir: path36__default.resolve(opts.projectDir) });
|
|
8138
8207
|
const asset = await remote.resolve(ref);
|
|
8139
8208
|
if (!asset) {
|
|
8140
8209
|
logErr(`Not found in store: ${ref} (try a full ref, e.g. skill:@publisher/name#version)`);
|
|
@@ -8184,7 +8253,7 @@ function makeStoreCommand() {
|
|
|
8184
8253
|
} catch (e) {
|
|
8185
8254
|
if (e instanceof LocalCatalogDisabledError) {
|
|
8186
8255
|
logErr(
|
|
8187
|
-
|
|
8256
|
+
`Remote catalog disabled (catalog.url: local). Set \`catalog.url: https://skaile.store\` in ${userConfigPath()}.`
|
|
8188
8257
|
);
|
|
8189
8258
|
} else {
|
|
8190
8259
|
logErr(`Store show failed: ${e.message}`);
|
|
@@ -8256,7 +8325,7 @@ function printTree(node, prefix = "", isLast = true) {
|
|
|
8256
8325
|
}
|
|
8257
8326
|
function makeTreeCommand() {
|
|
8258
8327
|
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:
|
|
8328
|
+
const am2 = new AssetManager({ projectDir: path36__default.resolve(opts.projectDir) });
|
|
8260
8329
|
const root = am2.tree();
|
|
8261
8330
|
if (root.children.length === 0) {
|
|
8262
8331
|
logInfo("No dependencies in lock file. Run `skaile install` first.");
|
|
@@ -8282,7 +8351,7 @@ function makeUpdateCommand() {
|
|
|
8282
8351
|
const catalogSpinner = p5.spinner();
|
|
8283
8352
|
catalogSpinner.start("Refreshing catalog cache");
|
|
8284
8353
|
try {
|
|
8285
|
-
const remote = await openCatalogSource({ projectDir:
|
|
8354
|
+
const remote = await openCatalogSource({ projectDir: path36__default.resolve(opts.projectDir) });
|
|
8286
8355
|
const result2 = await remote.refresh();
|
|
8287
8356
|
catalogSpinner.stop(
|
|
8288
8357
|
`Catalog refreshed: ${S.heading(String(result2.assetsCached))} assets cached`
|
|
@@ -8295,7 +8364,7 @@ function makeUpdateCommand() {
|
|
|
8295
8364
|
}
|
|
8296
8365
|
}
|
|
8297
8366
|
if (opts.catalogOnly) return;
|
|
8298
|
-
const projectDir =
|
|
8367
|
+
const projectDir = path36__default.resolve(opts.projectDir);
|
|
8299
8368
|
if (await shouldSyncSources(opts)) {
|
|
8300
8369
|
const syncSpinner = p5.spinner();
|
|
8301
8370
|
syncSpinner.start("Syncing sources");
|
|
@@ -8351,12 +8420,12 @@ function findManifestCandidates(rootPath) {
|
|
|
8351
8420
|
function walk(dir) {
|
|
8352
8421
|
let entries;
|
|
8353
8422
|
try {
|
|
8354
|
-
entries =
|
|
8423
|
+
entries = fs12__default.readdirSync(dir, { withFileTypes: true });
|
|
8355
8424
|
} catch {
|
|
8356
8425
|
return;
|
|
8357
8426
|
}
|
|
8358
8427
|
for (const entry of entries) {
|
|
8359
|
-
const fullPath =
|
|
8428
|
+
const fullPath = path36__default.join(dir, entry.name);
|
|
8360
8429
|
if (entry.isDirectory()) {
|
|
8361
8430
|
if (!SKIP_DIRS.has(entry.name)) walk(fullPath);
|
|
8362
8431
|
} else if (entry.isFile()) {
|
|
@@ -8372,11 +8441,6 @@ function findManifestCandidates(rootPath) {
|
|
|
8372
8441
|
walk(rootPath);
|
|
8373
8442
|
return candidates;
|
|
8374
8443
|
}
|
|
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
8444
|
function checkManifestIdentity(kind, parsed) {
|
|
8381
8445
|
if (parsed === null || typeof parsed !== "object") return null;
|
|
8382
8446
|
const obj = parsed;
|
|
@@ -8397,25 +8461,20 @@ function checkManifestIdentity(kind, parsed) {
|
|
|
8397
8461
|
return null;
|
|
8398
8462
|
}
|
|
8399
8463
|
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)}`);
|
|
8464
|
+
const content = fs12__default.readFileSync(c.filePath, "utf-8");
|
|
8465
|
+
const res = parseManifestFile(c.filePath, content);
|
|
8466
|
+
if (!res.ok) {
|
|
8467
|
+
logErr(`${path36__default.relative(absRoot, c.filePath)} [${c.kind}] \u2014 parse error: ${res.reason}`);
|
|
8414
8468
|
return { kind: "error" };
|
|
8415
8469
|
}
|
|
8470
|
+
return {
|
|
8471
|
+
kind: "value",
|
|
8472
|
+
parsed: res.data,
|
|
8473
|
+
body: c.filePath.endsWith(".md") ? parseFrontmatter(content).body : void 0
|
|
8474
|
+
};
|
|
8416
8475
|
}
|
|
8417
8476
|
function validateManifestCandidate(c, parsed, body, absRoot, registry, strictConformance) {
|
|
8418
|
-
const relPath =
|
|
8477
|
+
const relPath = path36__default.relative(absRoot, c.filePath);
|
|
8419
8478
|
let errors = 0;
|
|
8420
8479
|
let warnings = 0;
|
|
8421
8480
|
const identityError = checkManifestIdentity(c.kind, parsed);
|
|
@@ -8424,7 +8483,7 @@ function validateManifestCandidate(c, parsed, body, absRoot, registry, strictCon
|
|
|
8424
8483
|
errors++;
|
|
8425
8484
|
}
|
|
8426
8485
|
if (c.kind === "skill" && parsed && typeof parsed === "object") {
|
|
8427
|
-
const dirName =
|
|
8486
|
+
const dirName = path36__default.basename(path36__default.dirname(c.filePath));
|
|
8428
8487
|
const findings = checkAgentSkillConformance(parsed, { dirName });
|
|
8429
8488
|
for (const f of findings) {
|
|
8430
8489
|
const line = `${relPath} [skill conformance] \u2014 ${f.field}: ${f.message}`;
|
|
@@ -8456,8 +8515,8 @@ function validateManifestCandidate(c, parsed, body, absRoot, registry, strictCon
|
|
|
8456
8515
|
return { errors, warnings };
|
|
8457
8516
|
}
|
|
8458
8517
|
function validateManifests(rootPath, strictConformance) {
|
|
8459
|
-
const absRoot =
|
|
8460
|
-
if (!
|
|
8518
|
+
const absRoot = path36__default.resolve(rootPath);
|
|
8519
|
+
if (!fs12__default.existsSync(absRoot)) {
|
|
8461
8520
|
logErr(`Path does not exist: ${absRoot}`);
|
|
8462
8521
|
return { total: 0, errors: 1, warnings: 0 };
|
|
8463
8522
|
}
|
|
@@ -8467,7 +8526,6 @@ function validateManifests(rootPath, strictConformance) {
|
|
|
8467
8526
|
let warnings = 0;
|
|
8468
8527
|
for (const c of candidates) {
|
|
8469
8528
|
const parseResult = parseManifestCandidate(c, absRoot);
|
|
8470
|
-
if (parseResult.kind === "skip") continue;
|
|
8471
8529
|
if (parseResult.kind === "error") {
|
|
8472
8530
|
errors++;
|
|
8473
8531
|
continue;
|
|
@@ -8490,12 +8548,12 @@ function findWorkspaceManifests(rootPath) {
|
|
|
8490
8548
|
function walk(dir) {
|
|
8491
8549
|
let entries;
|
|
8492
8550
|
try {
|
|
8493
|
-
entries =
|
|
8551
|
+
entries = fs12__default.readdirSync(dir, { withFileTypes: true });
|
|
8494
8552
|
} catch {
|
|
8495
8553
|
return;
|
|
8496
8554
|
}
|
|
8497
8555
|
for (const entry of entries) {
|
|
8498
|
-
const full =
|
|
8556
|
+
const full = path36__default.join(dir, entry.name);
|
|
8499
8557
|
if (entry.isDirectory()) {
|
|
8500
8558
|
if (!SKIP_DIRS.has(entry.name)) walk(full);
|
|
8501
8559
|
} else if (entry.isFile() && /(^|\.)skaile\.yaml$/.test(entry.name)) {
|
|
@@ -8558,14 +8616,14 @@ function validateWorkspaceAssets(parsed, relPath) {
|
|
|
8558
8616
|
return errors;
|
|
8559
8617
|
}
|
|
8560
8618
|
function validateWorkspaceManifests(rootPath) {
|
|
8561
|
-
const absRoot =
|
|
8619
|
+
const absRoot = path36__default.resolve(rootPath);
|
|
8562
8620
|
const files = findWorkspaceManifests(absRoot);
|
|
8563
8621
|
let errors = 0;
|
|
8564
8622
|
for (const file of files) {
|
|
8565
|
-
const relPath =
|
|
8623
|
+
const relPath = path36__default.relative(absRoot, file);
|
|
8566
8624
|
let parsed;
|
|
8567
8625
|
try {
|
|
8568
|
-
parsed = parse(
|
|
8626
|
+
parsed = parse(fs12__default.readFileSync(file, "utf-8")) ?? {};
|
|
8569
8627
|
} catch (e) {
|
|
8570
8628
|
logErr(`${relPath} \u2014 parse error: ${e instanceof Error ? e.message : String(e)}`);
|
|
8571
8629
|
errors++;
|
|
@@ -8577,7 +8635,7 @@ function validateWorkspaceManifests(rootPath) {
|
|
|
8577
8635
|
return { total: files.length, errors };
|
|
8578
8636
|
}
|
|
8579
8637
|
function validatePublishManifestRoots(rootPath) {
|
|
8580
|
-
const absRoot =
|
|
8638
|
+
const absRoot = path36__default.resolve(rootPath);
|
|
8581
8639
|
const manifest = loadSkPublishManifest(absRoot);
|
|
8582
8640
|
if (!manifest) return 0;
|
|
8583
8641
|
const missing = missingRootAssets(absRoot, manifest);
|
|
@@ -8590,7 +8648,7 @@ function validatePublishManifestRoots(rootPath) {
|
|
|
8590
8648
|
}
|
|
8591
8649
|
var EXCLUDED_PATHS = ["skaileup-shared/", "external/", "docs/"];
|
|
8592
8650
|
function toPosix(p7) {
|
|
8593
|
-
return p7.split(
|
|
8651
|
+
return p7.split(path36__default.sep).join("/");
|
|
8594
8652
|
}
|
|
8595
8653
|
function isExcludedPath(relPath) {
|
|
8596
8654
|
const rel = toPosix(relPath);
|
|
@@ -8598,9 +8656,9 @@ function isExcludedPath(relPath) {
|
|
|
8598
8656
|
}
|
|
8599
8657
|
function collectAssetVersions() {
|
|
8600
8658
|
const assets = [];
|
|
8601
|
-
if (!
|
|
8659
|
+
if (!fs12__default.existsSync(AI_RESOURCES)) return assets;
|
|
8602
8660
|
const kindDirs = (kindDirName) => findKindDirs(AI_RESOURCES, kindDirName).filter(
|
|
8603
|
-
(dir) => !isExcludedPath(
|
|
8661
|
+
(dir) => !isExcludedPath(path36__default.relative(AI_RESOURCES, dir))
|
|
8604
8662
|
);
|
|
8605
8663
|
for (const dir of kindDirs("skills")) collectSkillVersions(dir, assets);
|
|
8606
8664
|
for (const dir of kindDirs("agents")) collectAgentVersions(dir, assets);
|
|
@@ -8610,10 +8668,10 @@ function collectAssetVersions() {
|
|
|
8610
8668
|
return assets.filter((a) => !seen.has(a.filePath) && seen.add(a.filePath));
|
|
8611
8669
|
}
|
|
8612
8670
|
function collectFlowVersions(dir, out) {
|
|
8613
|
-
for (const f of
|
|
8671
|
+
for (const f of fs12__default.readdirSync(dir)) {
|
|
8614
8672
|
if (!f.endsWith(".flow.yaml")) continue;
|
|
8615
|
-
const fp =
|
|
8616
|
-
const content =
|
|
8673
|
+
const fp = path36__default.join(dir, f);
|
|
8674
|
+
const content = fs12__default.readFileSync(fp, "utf-8");
|
|
8617
8675
|
const parsed = parse(content);
|
|
8618
8676
|
out.push({
|
|
8619
8677
|
kind: "flow",
|
|
@@ -8624,10 +8682,10 @@ function collectFlowVersions(dir, out) {
|
|
|
8624
8682
|
}
|
|
8625
8683
|
}
|
|
8626
8684
|
function collectPromptVersions(dir, out) {
|
|
8627
|
-
for (const f of
|
|
8685
|
+
for (const f of fs12__default.readdirSync(dir)) {
|
|
8628
8686
|
if (!f.endsWith(".prompt.md")) continue;
|
|
8629
|
-
const fp =
|
|
8630
|
-
const content =
|
|
8687
|
+
const fp = path36__default.join(dir, f);
|
|
8688
|
+
const content = fs12__default.readFileSync(fp, "utf-8");
|
|
8631
8689
|
const fm = parseSkillFrontmatter(content);
|
|
8632
8690
|
out.push({
|
|
8633
8691
|
kind: "prompt",
|
|
@@ -8638,12 +8696,12 @@ function collectPromptVersions(dir, out) {
|
|
|
8638
8696
|
}
|
|
8639
8697
|
}
|
|
8640
8698
|
function collectSkillVersions(dir, out) {
|
|
8641
|
-
for (const entry of
|
|
8699
|
+
for (const entry of fs12__default.readdirSync(dir, { withFileTypes: true })) {
|
|
8642
8700
|
if (!entry.isDirectory()) continue;
|
|
8643
|
-
const full =
|
|
8644
|
-
const skillMd =
|
|
8645
|
-
if (
|
|
8646
|
-
const content =
|
|
8701
|
+
const full = path36__default.join(dir, entry.name);
|
|
8702
|
+
const skillMd = path36__default.join(full, "SKILL.md");
|
|
8703
|
+
if (fs12__default.existsSync(skillMd)) {
|
|
8704
|
+
const content = fs12__default.readFileSync(skillMd, "utf-8");
|
|
8647
8705
|
const fm = parseSkillFrontmatter(content);
|
|
8648
8706
|
out.push({
|
|
8649
8707
|
kind: "skill",
|
|
@@ -8657,11 +8715,11 @@ function collectSkillVersions(dir, out) {
|
|
|
8657
8715
|
}
|
|
8658
8716
|
}
|
|
8659
8717
|
function collectAgentVersions(dir, out) {
|
|
8660
|
-
for (const entry of
|
|
8718
|
+
for (const entry of fs12__default.readdirSync(dir, { withFileTypes: true })) {
|
|
8661
8719
|
if (!entry.isDirectory()) continue;
|
|
8662
|
-
const agentYaml =
|
|
8663
|
-
if (!
|
|
8664
|
-
const content =
|
|
8720
|
+
const agentYaml = path36__default.join(dir, entry.name, "agent.yaml");
|
|
8721
|
+
if (!fs12__default.existsSync(agentYaml)) continue;
|
|
8722
|
+
const content = fs12__default.readFileSync(agentYaml, "utf-8");
|
|
8665
8723
|
const parsed = parse(content);
|
|
8666
8724
|
out.push({
|
|
8667
8725
|
kind: "agent",
|
|
@@ -8672,15 +8730,15 @@ function collectAgentVersions(dir, out) {
|
|
|
8672
8730
|
}
|
|
8673
8731
|
}
|
|
8674
8732
|
function assetLocation(a) {
|
|
8675
|
-
return toPosix(
|
|
8733
|
+
return toPosix(path36__default.relative(AI_RESOURCES, a.filePath));
|
|
8676
8734
|
}
|
|
8677
8735
|
function findChangelogUnit(assetRelPath, root) {
|
|
8678
|
-
let dir =
|
|
8736
|
+
let dir = path36__default.posix.dirname(toPosix(assetRelPath));
|
|
8679
8737
|
for (; ; ) {
|
|
8680
8738
|
const candidate = dir === "." ? "CHANGELOG.md" : `${dir}/CHANGELOG.md`;
|
|
8681
|
-
if (
|
|
8739
|
+
if (fs12__default.existsSync(path36__default.join(root, candidate))) return candidate;
|
|
8682
8740
|
if (dir === ".") return null;
|
|
8683
|
-
dir =
|
|
8741
|
+
dir = path36__default.posix.dirname(dir);
|
|
8684
8742
|
}
|
|
8685
8743
|
}
|
|
8686
8744
|
function checkChangelogUnits(modifiedFiles, root) {
|
|
@@ -8718,7 +8776,7 @@ function filterToChangedAssets(assets) {
|
|
|
8718
8776
|
encoding: "utf-8"
|
|
8719
8777
|
});
|
|
8720
8778
|
const changedFiles = new Set(
|
|
8721
|
-
diffOutput.trim().split("\n").filter(Boolean).map((f) =>
|
|
8779
|
+
diffOutput.trim().split("\n").filter(Boolean).map((f) => path36__default.resolve(AI_RESOURCES, f))
|
|
8722
8780
|
);
|
|
8723
8781
|
return assets.filter((a) => changedFiles.has(a.filePath));
|
|
8724
8782
|
} catch {
|
|
@@ -8746,7 +8804,7 @@ function checkVersionBumps(assets) {
|
|
|
8746
8804
|
let warnings = 0;
|
|
8747
8805
|
for (const a of assets) {
|
|
8748
8806
|
if (!a.version) continue;
|
|
8749
|
-
const relPath =
|
|
8807
|
+
const relPath = path36__default.relative(AI_RESOURCES, a.filePath);
|
|
8750
8808
|
try {
|
|
8751
8809
|
const headContent = execSync(`git show HEAD:${relPath}`, {
|
|
8752
8810
|
cwd: AI_RESOURCES,
|
|
@@ -8778,7 +8836,7 @@ function checkFlowVersionPins(assets) {
|
|
|
8778
8836
|
pins = flowSkillVersionPins(loadFlow(f.filePath));
|
|
8779
8837
|
} catch (err) {
|
|
8780
8838
|
logWarn(
|
|
8781
|
-
`flow:${f.name} (${
|
|
8839
|
+
`flow:${f.name} (${path36__default.relative(AI_RESOURCES, f.filePath)}) \u2014 could not be read: ${err instanceof Error ? err.message : err}`
|
|
8782
8840
|
);
|
|
8783
8841
|
warnings++;
|
|
8784
8842
|
continue;
|
|
@@ -8828,7 +8886,7 @@ function makeValidateCommand() {
|
|
|
8828
8886
|
"--strict-conformance",
|
|
8829
8887
|
"Treat Agent Skills (agentskills.io) standard findings as errors"
|
|
8830
8888
|
).action((targetPath, opts) => {
|
|
8831
|
-
const absPath =
|
|
8889
|
+
const absPath = path36__default.resolve(targetPath);
|
|
8832
8890
|
logInfo(`Validating manifests in ${absPath}`);
|
|
8833
8891
|
const { total, errors, warnings } = validateManifests(
|
|
8834
8892
|
absPath,
|
|
@@ -8970,7 +9028,7 @@ function whyEmptyMessage(ref, declared) {
|
|
|
8970
9028
|
}
|
|
8971
9029
|
function makeWhyCommand() {
|
|
8972
9030
|
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:
|
|
9031
|
+
const am2 = new AssetManager({ projectDir: path36__default.resolve(opts.projectDir) });
|
|
8974
9032
|
const chain = am2.why(ref);
|
|
8975
9033
|
if (chain.length === 0) {
|
|
8976
9034
|
let declared;
|
|
@@ -9004,7 +9062,7 @@ function makeWhyCommand() {
|
|
|
9004
9062
|
var _defaultFormatHelp = Help.prototype.formatHelp;
|
|
9005
9063
|
var pkg = JSON.parse(
|
|
9006
9064
|
readFileSync(
|
|
9007
|
-
|
|
9065
|
+
path36__default.resolve(path36__default.dirname(fileURLToPath(import.meta.url)), "../../package.json"),
|
|
9008
9066
|
"utf-8"
|
|
9009
9067
|
)
|
|
9010
9068
|
);
|
|
@@ -9126,7 +9184,7 @@ program.command("init [project-dir]").description("Initialize a project director
|
|
|
9126
9184
|
(projectDir, opts) => runInit(projectDir, opts)
|
|
9127
9185
|
);
|
|
9128
9186
|
async function runInit(projectDir, opts) {
|
|
9129
|
-
const { mkdirSync: mkdirSync4, writeFileSync:
|
|
9187
|
+
const { mkdirSync: mkdirSync4, writeFileSync: writeFileSync6 } = await import('fs');
|
|
9130
9188
|
const { stringify: stringify2 } = await import('yaml');
|
|
9131
9189
|
const { DRIVER_TARGETS, SUPPORTED_DRIVER_TARGETS: SUPPORTED_DRIVER_TARGETS2 } = await import('../core/index.js');
|
|
9132
9190
|
const harness = opts.harness;
|
|
@@ -9135,32 +9193,32 @@ async function runInit(projectDir, opts) {
|
|
|
9135
9193
|
process.exitCode = 1;
|
|
9136
9194
|
return;
|
|
9137
9195
|
}
|
|
9138
|
-
const resolved =
|
|
9139
|
-
const projectName =
|
|
9196
|
+
const resolved = path36__default.resolve(projectDir ?? ".");
|
|
9197
|
+
const projectName = path36__default.basename(resolved);
|
|
9140
9198
|
const created = [];
|
|
9141
|
-
const { existsSync:
|
|
9142
|
-
if (!
|
|
9199
|
+
const { existsSync: existsSync16 } = await import('fs');
|
|
9200
|
+
if (!existsSync16(resolved)) {
|
|
9143
9201
|
mkdirSync4(resolved, { recursive: true });
|
|
9144
9202
|
created.push(".");
|
|
9145
9203
|
}
|
|
9146
|
-
const skaileDir =
|
|
9147
|
-
if (!
|
|
9148
|
-
mkdirSync4(
|
|
9204
|
+
const skaileDir = path36__default.join(resolved, ".skaile");
|
|
9205
|
+
if (!existsSync16(skaileDir)) {
|
|
9206
|
+
mkdirSync4(path36__default.join(skaileDir, "sessions"), { recursive: true });
|
|
9149
9207
|
created.push(".skaile/");
|
|
9150
9208
|
}
|
|
9151
|
-
const settingsPath =
|
|
9152
|
-
if (!
|
|
9153
|
-
|
|
9209
|
+
const settingsPath = path36__default.join(skaileDir, "settings.json");
|
|
9210
|
+
if (!existsSync16(settingsPath)) {
|
|
9211
|
+
writeFileSync6(settingsPath, "{}\n");
|
|
9154
9212
|
created.push(".skaile/settings.json");
|
|
9155
9213
|
}
|
|
9156
|
-
const wsConfigPath =
|
|
9157
|
-
if (!
|
|
9158
|
-
|
|
9214
|
+
const wsConfigPath = path36__default.join(resolved, "skaile.yaml");
|
|
9215
|
+
if (!existsSync16(wsConfigPath)) {
|
|
9216
|
+
writeFileSync6(wsConfigPath, stringify2(buildInitWorkspaceConfig(projectName, harness)));
|
|
9159
9217
|
created.push("skaile.yaml");
|
|
9160
9218
|
}
|
|
9161
9219
|
for (const dir of new Set(Object.values(DRIVER_TARGETS[harness].local))) {
|
|
9162
|
-
const full =
|
|
9163
|
-
if (!
|
|
9220
|
+
const full = path36__default.join(resolved, dir);
|
|
9221
|
+
if (!existsSync16(full)) {
|
|
9164
9222
|
mkdirSync4(full, { recursive: true });
|
|
9165
9223
|
created.push(`${dir}/`);
|
|
9166
9224
|
}
|
|
@@ -9190,8 +9248,8 @@ function buildInitWorkspaceConfig(projectName, harness) {
|
|
|
9190
9248
|
}
|
|
9191
9249
|
async function initGitScaffold(resolved, created) {
|
|
9192
9250
|
const { execSync: execSync3 } = await import('child_process');
|
|
9193
|
-
const { existsSync:
|
|
9194
|
-
const gitignorePath =
|
|
9251
|
+
const { existsSync: existsSync16, readFileSync: readFileSync9, writeFileSync: writeFileSync6 } = await import('fs');
|
|
9252
|
+
const gitignorePath = path36__default.join(resolved, ".gitignore");
|
|
9195
9253
|
const entries = [
|
|
9196
9254
|
"node_modules/",
|
|
9197
9255
|
".skaile/sessions/",
|
|
@@ -9208,16 +9266,16 @@ async function initGitScaffold(resolved, created) {
|
|
|
9208
9266
|
".env",
|
|
9209
9267
|
".env.local"
|
|
9210
9268
|
];
|
|
9211
|
-
const existing =
|
|
9269
|
+
const existing = existsSync16(gitignorePath) ? readFileSync9(gitignorePath, "utf-8") : "";
|
|
9212
9270
|
const have = new Set(existing.split("\n").map((l) => l.trim()));
|
|
9213
9271
|
const append = entries.filter((e) => !have.has(e));
|
|
9214
9272
|
if (append.length > 0) {
|
|
9215
9273
|
const prefix = existing && !existing.endsWith("\n") ? "\n" : "";
|
|
9216
|
-
|
|
9274
|
+
writeFileSync6(gitignorePath, `${existing + prefix}${append.join("\n")}
|
|
9217
9275
|
`);
|
|
9218
9276
|
if (!existing) created.push(".gitignore");
|
|
9219
9277
|
}
|
|
9220
|
-
if (!
|
|
9278
|
+
if (!existsSync16(path36__default.join(resolved, ".git"))) {
|
|
9221
9279
|
try {
|
|
9222
9280
|
execSync3("git init", { cwd: resolved, stdio: "pipe" });
|
|
9223
9281
|
created.push(".git/");
|
|
@@ -9229,10 +9287,10 @@ async function initGitScaffold(resolved, created) {
|
|
|
9229
9287
|
}
|
|
9230
9288
|
async function bootstrapUserConfig() {
|
|
9231
9289
|
try {
|
|
9232
|
-
const
|
|
9233
|
-
const { userConfigPath, saveConfig, getConfigDefaults } = await import('../library/index.js');
|
|
9234
|
-
const userCfgPath =
|
|
9235
|
-
if (!
|
|
9290
|
+
const fs13 = await import('fs');
|
|
9291
|
+
const { userConfigPath: userConfigPath2, saveConfig, getConfigDefaults } = await import('../library/index.js');
|
|
9292
|
+
const userCfgPath = userConfigPath2();
|
|
9293
|
+
if (!fs13.existsSync(userCfgPath)) {
|
|
9236
9294
|
const defaults = getConfigDefaults();
|
|
9237
9295
|
saveConfig(userCfgPath, {
|
|
9238
9296
|
catalog: { url: defaults.catalog.url, cache_ttl: defaults.catalog.cache_ttl }
|
|
@@ -9247,7 +9305,7 @@ async function bootstrapUserConfig() {
|
|
|
9247
9305
|
}
|
|
9248
9306
|
async function hydrateInitSources(resolved, created) {
|
|
9249
9307
|
try {
|
|
9250
|
-
const { ensureSourcesCloned } = await import('../ensure-sources-
|
|
9308
|
+
const { ensureSourcesCloned } = await import('../ensure-sources-3IH5XHAP.js');
|
|
9251
9309
|
const hydrate = ensureSourcesCloned(resolved, { quiet: true });
|
|
9252
9310
|
for (const n of hydrate.cloned) created.push(`~/.skaile/cache/sources/${n}/`);
|
|
9253
9311
|
if (hydrate.failed.length > 0) {
|
|
@@ -9263,7 +9321,7 @@ function printInitSummary(resolved, projectDir, created) {
|
|
|
9263
9321
|
logOk(`Initialized project at ${S.heading(resolved)}`);
|
|
9264
9322
|
console.log();
|
|
9265
9323
|
console.log(S.heading(" Next steps:"));
|
|
9266
|
-
const isCurrentDir = resolved ===
|
|
9324
|
+
const isCurrentDir = resolved === path36__default.resolve(".");
|
|
9267
9325
|
let step = 1;
|
|
9268
9326
|
if (!isCurrentDir) {
|
|
9269
9327
|
console.log(` ${S.dim(`${step}.`)} ${S.cmd(`cd ${projectDir}`)}`);
|
|
@@ -9287,7 +9345,7 @@ function printInitSummary(resolved, projectDir, created) {
|
|
|
9287
9345
|
console.log();
|
|
9288
9346
|
}
|
|
9289
9347
|
program.command("setup").description("Interactive provider setup wizard").action(async () => {
|
|
9290
|
-
const { cmdSetup } = await import('../setup-
|
|
9348
|
+
const { cmdSetup } = await import('../setup-IFGA4NQA.js');
|
|
9291
9349
|
await cmdSetup([], { projectDir: process.cwd() });
|
|
9292
9350
|
});
|
|
9293
9351
|
program.addCommand(makeInstallCommand());
|
|
@@ -9340,10 +9398,24 @@ program.addCommand(makeSourceCommand());
|
|
|
9340
9398
|
program.addCommand(makeLibraryCommand());
|
|
9341
9399
|
program.addCommand(makeAssetCommand());
|
|
9342
9400
|
program.addCommand(makePresetCommand());
|
|
9343
|
-
program.command("path").description("Show resolved paths").action(() => {
|
|
9401
|
+
program.command("path").description("Show resolved paths (honours SKAILE_HOME and the per-path overrides)").action(async () => {
|
|
9402
|
+
const { globalCacheRoot: globalCacheRoot2, globalSkaileDir: globalSkaileDir2, resolveLibraryDir: resolveLibraryDir2, userConfigPath: userConfigPath2 } = await import('../core/index.js');
|
|
9403
|
+
const { getStoreRoot, resolveIndexPath } = await import('../library/index.js');
|
|
9404
|
+
const rows = [
|
|
9405
|
+
["skaile-home", globalSkaileDir2()],
|
|
9406
|
+
["config", userConfigPath2()],
|
|
9407
|
+
["index", resolveIndexPath()],
|
|
9408
|
+
["libraries", resolveLibraryDir2()],
|
|
9409
|
+
["store", getStoreRoot()],
|
|
9410
|
+
["cache", globalCacheRoot2()],
|
|
9411
|
+
["ai-assets", AI_RESOURCES],
|
|
9412
|
+
["patches-dir", ".skaile/patches/"]
|
|
9413
|
+
];
|
|
9414
|
+
const width = Math.max(...rows.map(([label]) => label.length));
|
|
9344
9415
|
console.log();
|
|
9345
|
-
|
|
9346
|
-
|
|
9416
|
+
for (const [label, value] of rows) {
|
|
9417
|
+
console.log(` ${S.dim(label.padEnd(width))} ${S.heading(value)}`);
|
|
9418
|
+
}
|
|
9347
9419
|
console.log();
|
|
9348
9420
|
});
|
|
9349
9421
|
program.addCommand(makeCompleteCommand(program));
|