@skaile/workspaces 3.2.1 → 3.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +168 -0
- package/dist/{asset-feeds-SEYSNNEM.js → asset-feeds-CBY723RG.js} +11 -11
- package/dist/{asset-feeds-SEYSNNEM.js.map → asset-feeds-CBY723RG.js.map} +1 -1
- package/dist/asset-manager/catalog-deployer.js +7 -7
- package/dist/asset-manager/index.js +10 -10
- package/dist/asset-manager/installer.js +7 -7
- package/dist/bridge/drivers/claude-sdk.js +8 -8
- package/dist/bridge/drivers/codex.js +3 -3
- package/dist/bridge/drivers/continue.js +4 -4
- package/dist/bridge/drivers/echo.js +3 -3
- package/dist/bridge/drivers/gemini.js +5 -5
- package/dist/bridge/drivers/goose.js +4 -4
- package/dist/bridge/drivers/omp.js +3 -3
- package/dist/bridge/drivers/opencode.js +4 -4
- package/dist/bridge/drivers/qwen.js +5 -5
- package/dist/bridge/index.js +9 -9
- package/dist/{chunk-57RFYEVM.js → chunk-2Y2AWWWM.js} +4 -10
- package/dist/chunk-2Y2AWWWM.js.map +1 -0
- package/dist/{chunk-O6B3ZZ5S.js → chunk-3A3ETJFD.js} +4 -4
- package/dist/{chunk-O6B3ZZ5S.js.map → chunk-3A3ETJFD.js.map} +1 -1
- package/dist/{chunk-7GOCNYUV.js → chunk-3A5IKBHQ.js} +47 -47
- package/dist/{chunk-7GOCNYUV.js.map → chunk-3A5IKBHQ.js.map} +1 -1
- package/dist/{chunk-I7S6DFRU.js → chunk-3Q7JDLLH.js} +46 -6
- package/dist/chunk-3Q7JDLLH.js.map +1 -0
- package/dist/{chunk-PTAUN5CY.js → chunk-3UGP7I2Y.js} +3 -3
- package/dist/{chunk-PTAUN5CY.js.map → chunk-3UGP7I2Y.js.map} +1 -1
- package/dist/{chunk-CZZRDYT4.js → chunk-4VTBZ2MF.js} +4 -4
- package/dist/{chunk-CZZRDYT4.js.map → chunk-4VTBZ2MF.js.map} +1 -1
- package/dist/{chunk-U5POE4BA.js → chunk-5Q7HA4JP.js} +3 -3
- package/dist/{chunk-U5POE4BA.js.map → chunk-5Q7HA4JP.js.map} +1 -1
- package/dist/{chunk-P43HBWKK.js → chunk-6BV24JPZ.js} +36 -7
- package/dist/chunk-6BV24JPZ.js.map +1 -0
- package/dist/{chunk-AM5LFRXJ.js → chunk-A7XP4C7C.js} +3 -3
- package/dist/{chunk-AM5LFRXJ.js.map → chunk-A7XP4C7C.js.map} +1 -1
- package/dist/{chunk-ZNIHTT22.js → chunk-AXFOJ2UG.js} +5 -5
- package/dist/{chunk-ZNIHTT22.js.map → chunk-AXFOJ2UG.js.map} +1 -1
- package/dist/{chunk-PKEAYYEJ.js → chunk-BCXI27BH.js} +219 -4
- package/dist/chunk-BCXI27BH.js.map +1 -0
- package/dist/{chunk-3HVASHBF.js → chunk-BJ7QIUBM.js} +6 -15
- package/dist/chunk-BJ7QIUBM.js.map +1 -0
- package/dist/{chunk-CH3UTJBT.js → chunk-BYPQHEI4.js} +6 -6
- package/dist/{chunk-CH3UTJBT.js.map → chunk-BYPQHEI4.js.map} +1 -1
- package/dist/{chunk-NWFZUQPF.js → chunk-DFZ6QENJ.js} +18 -18
- package/dist/{chunk-NWFZUQPF.js.map → chunk-DFZ6QENJ.js.map} +1 -1
- package/dist/{chunk-F5VREBV2.js → chunk-ELPR5XBG.js} +40 -3
- package/dist/chunk-ELPR5XBG.js.map +1 -0
- package/dist/{chunk-MWFYXUFK.js → chunk-G2CXWUO5.js} +4 -4
- package/dist/{chunk-MWFYXUFK.js.map → chunk-G2CXWUO5.js.map} +1 -1
- package/dist/{chunk-BEAIJRVF.js → chunk-GHWJHOYX.js} +4 -4
- package/dist/{chunk-BEAIJRVF.js.map → chunk-GHWJHOYX.js.map} +1 -1
- package/dist/{chunk-FLBDLF3I.js → chunk-HGFKNJA5.js} +6 -4
- package/dist/chunk-HGFKNJA5.js.map +1 -0
- package/dist/{chunk-BK3WL3QK.js → chunk-JAHHMZWG.js} +3 -3
- package/dist/{chunk-BK3WL3QK.js.map → chunk-JAHHMZWG.js.map} +1 -1
- package/dist/{chunk-UFY2HFLO.js → chunk-KBXYT5HD.js} +4 -4
- package/dist/{chunk-UFY2HFLO.js.map → chunk-KBXYT5HD.js.map} +1 -1
- package/dist/{chunk-DNYE3SSL.js → chunk-MR3LQTGA.js} +4 -4
- package/dist/{chunk-DNYE3SSL.js.map → chunk-MR3LQTGA.js.map} +1 -1
- package/dist/{chunk-HCNVX34E.js → chunk-OI36ITDV.js} +8 -8
- package/dist/{chunk-HCNVX34E.js.map → chunk-OI36ITDV.js.map} +1 -1
- package/dist/{chunk-BEA7RXI3.js → chunk-P6V5GORE.js} +230 -41
- package/dist/chunk-P6V5GORE.js.map +1 -0
- package/dist/{chunk-2OCYS5EP.js → chunk-PEGIQ67F.js} +4 -4
- package/dist/{chunk-2OCYS5EP.js.map → chunk-PEGIQ67F.js.map} +1 -1
- package/dist/{chunk-I7MKEZ6J.js → chunk-PHJ2DU6D.js} +3 -3
- package/dist/{chunk-I7MKEZ6J.js.map → chunk-PHJ2DU6D.js.map} +1 -1
- package/dist/{chunk-NLZYBWVH.js → chunk-POYF2P7E.js} +10 -10
- package/dist/{chunk-NLZYBWVH.js.map → chunk-POYF2P7E.js.map} +1 -1
- package/dist/{chunk-NU4E7C5I.js → chunk-PW4SJE3X.js} +3 -3
- package/dist/{chunk-NU4E7C5I.js.map → chunk-PW4SJE3X.js.map} +1 -1
- package/dist/{chunk-Q26C5GLO.js → chunk-RD6MMBHQ.js} +3 -3
- package/dist/{chunk-Q26C5GLO.js.map → chunk-RD6MMBHQ.js.map} +1 -1
- package/dist/{chunk-46LE3GNY.js → chunk-RUFTB7QN.js} +3 -3
- package/dist/{chunk-46LE3GNY.js.map → chunk-RUFTB7QN.js.map} +1 -1
- package/dist/{chunk-BKUANJB7.js → chunk-S5N33NGZ.js} +50 -64
- package/dist/chunk-S5N33NGZ.js.map +1 -0
- package/dist/{chunk-IAIHZRG7.js → chunk-SJQ7544V.js} +7 -7
- package/dist/{chunk-IAIHZRG7.js.map → chunk-SJQ7544V.js.map} +1 -1
- package/dist/{chunk-VT6HDD2L.js → chunk-SUGDZOYZ.js} +3 -3
- package/dist/{chunk-VT6HDD2L.js.map → chunk-SUGDZOYZ.js.map} +1 -1
- package/dist/{chunk-XVIFPGYH.js → chunk-U2KIY532.js} +3 -3
- package/dist/{chunk-XVIFPGYH.js.map → chunk-U2KIY532.js.map} +1 -1
- package/dist/{chunk-HWEW3VII.js → chunk-VFL4STB7.js} +3 -3
- package/dist/{chunk-HWEW3VII.js.map → chunk-VFL4STB7.js.map} +1 -1
- package/dist/{chunk-DYMWJAL4.js → chunk-VQ4P7UYE.js} +3 -3
- package/dist/{chunk-DYMWJAL4.js.map → chunk-VQ4P7UYE.js.map} +1 -1
- package/dist/{chunk-KPZZI2KG.js → chunk-ZCIK44M7.js} +3 -3
- package/dist/{chunk-KPZZI2KG.js.map → chunk-ZCIK44M7.js.map} +1 -1
- package/dist/cli/index.js +396 -409
- package/dist/cli/index.js.map +1 -1
- package/dist/cli/src/commands/complete-resolvers.d.ts +4 -0
- package/dist/cli/src/commands/complete-resolvers.d.ts.map +1 -1
- package/dist/cli/src/commands/flow.d.ts +8 -4
- package/dist/cli/src/commands/flow.d.ts.map +1 -1
- package/dist/cli/src/commands/run.d.ts.map +1 -1
- package/dist/cli/src/commands/validate.d.ts.map +1 -1
- package/dist/cli/src/flow-discovery.d.ts +31 -15
- package/dist/cli/src/flow-discovery.d.ts.map +1 -1
- package/dist/cli/src/paths.d.ts +9 -19
- package/dist/cli/src/paths.d.ts.map +1 -1
- package/dist/connectors/config.js +7 -7
- package/dist/connectors/index.js +14 -14
- package/dist/core/index.js +6 -6
- package/dist/core/logging.js +2 -2
- package/dist/core/manifest.js +2 -2
- package/dist/core/runtime-assets.js +4 -4
- package/dist/core/src/asset-roots.d.ts +74 -0
- package/dist/core/src/asset-roots.d.ts.map +1 -0
- package/dist/core/src/index.d.ts +1 -0
- package/dist/core/src/index.d.ts.map +1 -1
- package/dist/core/workspace-config.js +3 -3
- package/dist/deploy/index.js +6 -6
- package/dist/discovery/index.js +3 -3
- package/dist/{ensure-sources-IM3JMW2L.js → ensure-sources-O6AWQXAY.js} +13 -13
- package/dist/{ensure-sources-IM3JMW2L.js.map → ensure-sources-O6AWQXAY.js.map} +1 -1
- package/dist/factory-assets/connectors/box.js +14 -14
- package/dist/factory-assets/connectors/deploy.js +14 -14
- package/dist/factory-assets/connectors/devserver.js +14 -14
- package/dist/factory-assets/connectors/flow/CONNECTOR.md +42 -9
- package/dist/factory-assets/connectors/flow/adapter.d.ts +1 -1
- package/dist/factory-assets/connectors/flow/adapter.d.ts.map +1 -1
- package/dist/factory-assets/connectors/flow/adapter.js +14 -14
- package/dist/factory-assets/connectors/flow/engine/index.d.ts +2 -0
- package/dist/factory-assets/connectors/flow/engine/index.d.ts.map +1 -1
- package/dist/factory-assets/connectors/flow/engine/locate.d.ts +75 -0
- package/dist/factory-assets/connectors/flow/engine/locate.d.ts.map +1 -0
- package/dist/factory-assets/connectors/flow/engine/node-shape.d.ts +56 -0
- package/dist/factory-assets/connectors/flow/engine/node-shape.d.ts.map +1 -1
- package/dist/factory-assets/connectors/flow/engine.js +8 -8
- package/dist/factory-assets/connectors/flow/index.d.ts +1 -1
- package/dist/factory-assets/connectors/flow/index.d.ts.map +1 -1
- package/dist/factory-assets/connectors/flow/node-executor.d.ts +23 -3
- package/dist/factory-assets/connectors/flow/node-executor.d.ts.map +1 -1
- package/dist/factory-assets/connectors/flow/prompt-fragments.d.ts +4 -0
- package/dist/factory-assets/connectors/flow/prompt-fragments.d.ts.map +1 -1
- package/dist/factory-assets/connectors/flow/prompt-fragments.js +2 -2
- package/dist/factory-assets/connectors/flow/run-flow.d.ts +9 -1
- package/dist/factory-assets/connectors/flow/run-flow.d.ts.map +1 -1
- package/dist/factory-assets/connectors/flow/run-flow.js +16 -16
- package/dist/factory-assets/connectors/flow.js +14 -14
- package/dist/factory-assets/connectors/git.js +14 -14
- package/dist/factory-assets/connectors/gmail.js +14 -14
- package/dist/factory-assets/connectors/googledrive.js +14 -14
- package/dist/factory-assets/connectors/local.js +14 -14
- package/dist/factory-assets/connectors/mattermost.js +14 -14
- package/dist/factory-assets/connectors/memory.js +14 -14
- package/dist/factory-assets/connectors/minio.js +14 -14
- package/dist/factory-assets/connectors/postgres.js +14 -14
- package/dist/factory-assets/connectors/s3.js +14 -14
- package/dist/factory-assets/connectors/sharepoint.js +14 -14
- package/dist/factory-assets/connectors/sqlite.js +14 -14
- package/dist/factory-assets/connectors/static-server.js +14 -14
- package/dist/factory-assets/connectors/tunnel.js +14 -14
- package/dist/factory-assets/connectors/webdav.js +14 -14
- package/dist/factory-assets/connectors/xstate-store.js +14 -14
- package/dist/factory-assets/connectors/xstate.js +14 -14
- package/dist/flows-66NOT5N6.js +20 -0
- package/dist/{flows-PBNW6BEH.js.map → flows-66NOT5N6.js.map} +1 -1
- package/dist/{helpers-LJFOH4RB.js → helpers-QUGRH2MW.js} +13 -13
- package/dist/{helpers-LJFOH4RB.js.map → helpers-QUGRH2MW.js.map} +1 -1
- package/dist/library/index.js +8 -8
- package/dist/library/install.js +6 -6
- package/dist/library/src/config.d.ts +6 -6
- package/dist/library/src/config.d.ts.map +1 -1
- package/dist/{library-publish-BEFA7OCS.js → library-publish-TCT652H4.js} +18 -18
- package/dist/{library-publish-BEFA7OCS.js.map → library-publish-TCT652H4.js.map} +1 -1
- package/dist/open-library-6OSZX2O6.js +32 -0
- package/dist/{open-library-WJ7P7B4N.js.map → open-library-6OSZX2O6.js.map} +1 -1
- package/dist/paths-ESJHWGBR.js +16 -0
- package/dist/{paths-2ZZMB7HU.js.map → paths-ESJHWGBR.js.map} +1 -1
- package/dist/{plugin-store-EOP3S7OU.js → plugin-store-3BYOBKYT.js} +8 -8
- package/dist/{plugin-store-EOP3S7OU.js.map → plugin-store-3BYOBKYT.js.map} +1 -1
- package/dist/{project-6RXDBSRV.js → project-5RGSHTZ7.js} +14 -14
- package/dist/{project-6RXDBSRV.js.map → project-5RGSHTZ7.js.map} +1 -1
- package/dist/resolver/index.js +7 -7
- package/dist/runner/index.js +19 -19
- package/dist/sdk/asset-manager.js +10 -10
- package/dist/sdk/bridge.js +9 -9
- package/dist/sdk/core.js +6 -6
- package/dist/sdk/flow.js +8 -8
- package/dist/sdk/index.js +19 -19
- package/dist/sdk/resolver.js +7 -7
- package/dist/sdk/runner.js +19 -19
- package/dist/sdk/session.js +1 -1
- package/dist/session/index.js +1 -1
- package/dist/session/src/dispatcher.d.ts +15 -0
- package/dist/session/src/dispatcher.d.ts.map +1 -1
- package/dist/session/src/workspace-change-digest.d.ts +34 -0
- package/dist/session/src/workspace-change-digest.d.ts.map +1 -0
- package/dist/{setup-XI7TCIGF.js → setup-X2T3NW7P.js} +11 -11
- package/dist/{setup-XI7TCIGF.js.map → setup-X2T3NW7P.js.map} +1 -1
- package/dist/skills-TYMTW4V4.js +20 -0
- package/dist/{skills-5PJ6YVM7.js.map → skills-TYMTW4V4.js.map} +1 -1
- package/dist/{source-TJ457ZRQ.js → source-JS3G5P6Z.js} +17 -17
- package/dist/{source-TJ457ZRQ.js.map → source-JS3G5P6Z.js.map} +1 -1
- package/dist/{source-manifest-publish-R3Q4MT5W.js → source-manifest-publish-Y7BOFFO4.js} +19 -19
- package/dist/{source-manifest-publish-R3Q4MT5W.js.map → source-manifest-publish-Y7BOFFO4.js.map} +1 -1
- package/dist/tui/index.js +19 -19
- package/dist/workspace-plugin/adapters/mcp.js +11 -11
- package/dist/workspace-plugin/adapters/omp.js +7 -7
- package/dist/workspace-plugin/index.js +3 -3
- package/package.json +1 -1
- package/dist/chunk-3HVASHBF.js.map +0 -1
- package/dist/chunk-57RFYEVM.js.map +0 -1
- package/dist/chunk-BEA7RXI3.js.map +0 -1
- package/dist/chunk-BKUANJB7.js.map +0 -1
- package/dist/chunk-F5VREBV2.js.map +0 -1
- package/dist/chunk-FLBDLF3I.js.map +0 -1
- package/dist/chunk-I7S6DFRU.js.map +0 -1
- package/dist/chunk-P43HBWKK.js.map +0 -1
- package/dist/chunk-PKEAYYEJ.js.map +0 -1
- package/dist/flows-PBNW6BEH.js +0 -20
- package/dist/open-library-WJ7P7B4N.js +0 -32
- package/dist/paths-2ZZMB7HU.js +0 -22
- package/dist/skills-5PJ6YVM7.js +0 -20
package/dist/cli/index.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import { makeInstallCommand, makeCheckCommand, makeCleanCommand, reportInstalledSoftDeps } from '../chunk-
|
|
3
|
-
import { makeSourceCommand, syncProjectSources } from '../chunk-
|
|
4
|
-
import { AI_RESOURCES
|
|
5
|
-
import { getStoreConfig, storeFetch, deviceLogin, loadStoreAuthConfig, logout, hasStoredAuth, isStoreAuthenticated, getStoreToken, getStoreIdentity } from '../chunk-
|
|
6
|
-
import { openCatalogSource, openLibraryManager, createFullRegistry, openLibrary } from '../chunk-
|
|
7
|
-
import { logErr, S, logOk, logInfo, kindColorPad, kindColor, colorRef, formatSoftDepSection, bareSoftDepName, logWarn, formatSoftDepHint, formatRelativeTime, formatSoftDepRemovePreview, formatSoftDepAddPreview, fitWidth } from '../chunk-
|
|
2
|
+
import { makeInstallCommand, makeCheckCommand, makeCleanCommand, reportInstalledSoftDeps } from '../chunk-SJQ7544V.js';
|
|
3
|
+
import { makeSourceCommand, syncProjectSources } from '../chunk-POYF2P7E.js';
|
|
4
|
+
import { AI_RESOURCES } from '../chunk-2Y2AWWWM.js';
|
|
5
|
+
import { getStoreConfig, storeFetch, deviceLogin, loadStoreAuthConfig, logout, hasStoredAuth, isStoreAuthenticated, getStoreToken, getStoreIdentity } from '../chunk-A7XP4C7C.js';
|
|
6
|
+
import { openCatalogSource, openLibraryManager, createFullRegistry, openLibrary } from '../chunk-BYPQHEI4.js';
|
|
7
|
+
import { logErr, S, logOk, logInfo, kindColorPad, kindColor, colorRef, formatSoftDepSection, bareSoftDepName, logWarn, formatSoftDepHint, formatRelativeTime, formatSoftDepRemovePreview, formatSoftDepAddPreview, fitWidth } from '../chunk-U2KIY532.js';
|
|
8
8
|
import { LocalSecretsProvider } from '../chunk-6BEGKO2Q.js';
|
|
9
|
-
import { runAgentChat, loadSessionById, loadSession, listSessions, setCurrentSession, deleteSession, clearSession, loadAgentManifest, compileComposition, MarkdownStreamer, resolveMixin } from '../chunk-
|
|
10
|
-
import { buildClaudePluginFiles } from '../chunk-
|
|
9
|
+
import { runAgentChat, loadSessionById, loadSession, listSessions, setCurrentSession, deleteSession, clearSession, loadAgentManifest, compileComposition, MarkdownStreamer, resolveMixin } from '../chunk-DFZ6QENJ.js';
|
|
10
|
+
import { buildClaudePluginFiles } from '../chunk-3UGP7I2Y.js';
|
|
11
11
|
import '../chunk-X5YPJV4N.js';
|
|
12
12
|
import '../chunk-W3UDISS2.js';
|
|
13
13
|
import '../chunk-O7SG5PC2.js';
|
|
@@ -15,55 +15,55 @@ import '../chunk-7QBNJTTQ.js';
|
|
|
15
15
|
import '../chunk-GTS2FODO.js';
|
|
16
16
|
import '../chunk-WQ7DE5UC.js';
|
|
17
17
|
import '../chunk-32NA4TVC.js';
|
|
18
|
-
import { runFlow, resumeFlow } from '../chunk-
|
|
18
|
+
import { runFlow, resumeFlow } from '../chunk-S5N33NGZ.js';
|
|
19
19
|
import '../chunk-4R6DROGN.js';
|
|
20
|
-
import { validateFlowVersions, parseSkillFrontmatter } from '../chunk-
|
|
21
|
-
import '../chunk-
|
|
20
|
+
import { validateFlowVersions, parseSkillFrontmatter } from '../chunk-4VTBZ2MF.js';
|
|
21
|
+
import '../chunk-GHWJHOYX.js';
|
|
22
22
|
import '../chunk-HNBWU5RA.js';
|
|
23
|
-
import '../chunk-
|
|
24
|
-
import '../chunk-
|
|
25
|
-
import '../chunk-
|
|
26
|
-
import '../chunk-
|
|
23
|
+
import '../chunk-P6V5GORE.js';
|
|
24
|
+
import '../chunk-AXFOJ2UG.js';
|
|
25
|
+
import '../chunk-ZCIK44M7.js';
|
|
26
|
+
import '../chunk-RUFTB7QN.js';
|
|
27
27
|
import '../chunk-RRVQAE5D.js';
|
|
28
28
|
import '../chunk-V34ZEXSE.js';
|
|
29
29
|
import '../chunk-GAH4YRCI.js';
|
|
30
|
-
import '../chunk-
|
|
30
|
+
import '../chunk-SUGDZOYZ.js';
|
|
31
31
|
import '../chunk-6E6PKKAD.js';
|
|
32
32
|
import '../chunk-IFGTRL2I.js';
|
|
33
|
-
import { loadFlow, loadAllFlowEntries,
|
|
33
|
+
import { projectAiAssetsRoots, loadFlow, loadAllFlowEntries, findFlowFileInRoots } from '../chunk-3Q7JDLLH.js';
|
|
34
34
|
import '../chunk-B4J6TV4G.js';
|
|
35
|
-
import '../chunk-
|
|
36
|
-
import '../chunk-
|
|
35
|
+
import '../chunk-HGFKNJA5.js';
|
|
36
|
+
import { nodeLabel, nodeSkillAsset, nodeIsInert, nodeIsOptional, nodeRunKind, flowSkillVersionPins } from '../chunk-ELPR5XBG.js';
|
|
37
37
|
import '../chunk-D4VHBAJC.js';
|
|
38
|
-
import { AssetManager, NON_DEPLOYABLE_KINDS, MissingManifestError, parseRefTolerant, normalizeRepoUrl, FACTORY_SOURCE_URL } from '../chunk-
|
|
39
|
-
import {
|
|
40
|
-
import '../chunk-
|
|
38
|
+
import { AssetManager, NON_DEPLOYABLE_KINDS, MissingManifestError, parseRefTolerant, normalizeRepoUrl, FACTORY_SOURCE_URL } from '../chunk-OI36ITDV.js';
|
|
39
|
+
import { getStoreManifestsDir, getDefaultValue, isSecretPlaceholder } from '../chunk-BJ7QIUBM.js';
|
|
40
|
+
import '../chunk-PW4SJE3X.js';
|
|
41
41
|
import '../chunk-UKJMQZV6.js';
|
|
42
42
|
import '../chunk-R7FOF242.js';
|
|
43
43
|
import '../chunk-JXT46QFC.js';
|
|
44
|
-
import '../chunk-
|
|
44
|
+
import '../chunk-PEGIQ67F.js';
|
|
45
45
|
import '../chunk-CGYEHQOX.js';
|
|
46
|
-
import { resolveSettings, globalSettingsPath, projectSettingsPath, loadSettings, saveSettings, portableSpawn, portableSpawnSync, WorkspaceYamlEditor, checkAgentSkillConformance, readLock } from '../chunk-
|
|
46
|
+
import { resolveSettings, globalSettingsPath, projectSettingsPath, loadSettings, saveSettings, portableSpawn, portableSpawnSync, WorkspaceYamlEditor, resolveLibraryDir, checkAgentSkillConformance, aiResourceRoots, readLock } from '../chunk-6BV24JPZ.js';
|
|
47
47
|
import '../chunk-F3HNW354.js';
|
|
48
48
|
import { DRIVER_DEFAULTS } from '../chunk-K5GBV4SA.js';
|
|
49
|
-
import {
|
|
50
|
-
import { factoryAssetRoots } from '../chunk-
|
|
51
|
-
import { globalCacheRoot, sourceCacheKey, getGlobalCacheDir, resolveAgentDir, matchPin, coerceVersion, loadSkWorkspaceConfig, resolveSkWorkspaceConfig, storeManifestSlug } from '../chunk-
|
|
49
|
+
import { detectDomains, assetSearchDirs } from '../chunk-QVZA2MDT.js';
|
|
50
|
+
import { factoryAssetRoots } from '../chunk-KBXYT5HD.js';
|
|
51
|
+
import { globalCacheRoot, sourceCacheKey, getGlobalCacheDir, resolveAgentDir, matchPin, coerceVersion, loadSkWorkspaceConfig, resolveSkWorkspaceConfig, storeManifestSlug } from '../chunk-RD6MMBHQ.js';
|
|
52
52
|
import { SUPPORTED_DRIVER_TARGETS } from '../chunk-MENCWIHW.js';
|
|
53
53
|
import { SKAILE_MANIFEST_FILENAME, decodeSkaileManifest, loadSkPublishManifest, saveSkPublishManifest } from '../chunk-P4VHQA4N.js';
|
|
54
|
-
import { parseFrontmatter, scanDirectory } from '../chunk-
|
|
54
|
+
import { parseFrontmatter, scanDirectory } from '../chunk-VQ4P7UYE.js';
|
|
55
55
|
import { parseAssetRef, ASSET_KINDS, isValidAssetName, slugifyAssetName, ASSET_NAME_HINT, assetRefToStr } from '../chunk-GEEW6SY2.js';
|
|
56
|
-
import { openSqlite } from '../chunk-
|
|
57
|
-
import '../chunk-
|
|
56
|
+
import { openSqlite } from '../chunk-5Q7HA4JP.js';
|
|
57
|
+
import '../chunk-3A5IKBHQ.js';
|
|
58
58
|
import '../chunk-KTBKW2FI.js';
|
|
59
59
|
import '../chunk-UQ6LFBPZ.js';
|
|
60
60
|
import '../chunk-IEX5YV4R.js';
|
|
61
61
|
import { validatePreset } from '../chunk-IRORTHGA.js';
|
|
62
62
|
import '../chunk-NSBPE2FW.js';
|
|
63
|
-
import * as
|
|
64
|
-
import
|
|
65
|
-
import * as
|
|
66
|
-
import
|
|
63
|
+
import * as fs12 from 'fs';
|
|
64
|
+
import fs12__default, { readFileSync, existsSync, mkdirSync, writeFileSync, lstatSync, rmSync, readdirSync, statSync } from 'fs';
|
|
65
|
+
import * as path35 from 'path';
|
|
66
|
+
import path35__default, { resolve, join } from 'path';
|
|
67
67
|
import { fileURLToPath } from 'url';
|
|
68
68
|
import { Help, Command, Option } from 'commander';
|
|
69
69
|
import { rcompare } from 'semver';
|
|
@@ -74,7 +74,7 @@ import { homedir } from 'os';
|
|
|
74
74
|
import { parse, stringify } from 'yaml';
|
|
75
75
|
import * as readline from 'readline';
|
|
76
76
|
import { createInterface } from 'readline';
|
|
77
|
-
import
|
|
77
|
+
import fs5 from 'fs/promises';
|
|
78
78
|
import { parse as parse$1, stringify as stringify$1 } from 'smol-toml';
|
|
79
79
|
import { execSync } from 'child_process';
|
|
80
80
|
import * as readline2 from 'readline/promises';
|
|
@@ -101,7 +101,7 @@ async function runSearch(kind, query, opts) {
|
|
|
101
101
|
const showLocal = !opts.store;
|
|
102
102
|
const showStore = !opts.local;
|
|
103
103
|
const { resolveConfig } = await import('../library/index.js');
|
|
104
|
-
const airGapped = resolveConfig({ projectDir:
|
|
104
|
+
const airGapped = resolveConfig({ projectDir: path35__default.resolve(opts.projectDir) }).catalog.cache_ttl === 0;
|
|
105
105
|
if (showLocal) {
|
|
106
106
|
await searchLocal(query, kind, opts, showStore, airGapped);
|
|
107
107
|
}
|
|
@@ -110,7 +110,7 @@ async function runSearch(kind, query, opts) {
|
|
|
110
110
|
}
|
|
111
111
|
}
|
|
112
112
|
async function searchIndex(query, kind) {
|
|
113
|
-
const { openLibrary: openLibrary2 } = await import('../open-library-
|
|
113
|
+
const { openLibrary: openLibrary2 } = await import('../open-library-6OSZX2O6.js');
|
|
114
114
|
const library = await openLibrary2();
|
|
115
115
|
try {
|
|
116
116
|
const defs = await library.listAssetDefs(kind ? { kind } : {});
|
|
@@ -142,7 +142,7 @@ async function searchIndex(query, kind) {
|
|
|
142
142
|
}
|
|
143
143
|
}
|
|
144
144
|
async function searchFactory(projectDir, query, kind) {
|
|
145
|
-
const prefixes = factoryAssetRoots().map((r) => r.endsWith(
|
|
145
|
+
const prefixes = factoryAssetRoots().map((r) => r.endsWith(path35__default.sep) ? r : r + path35__default.sep);
|
|
146
146
|
const isFactoryPath = (p7) => prefixes.some((fp) => p7 === fp.slice(0, -1) || p7.startsWith(fp));
|
|
147
147
|
try {
|
|
148
148
|
const entries = await new AssetManager({ projectDir }).search(query, kind);
|
|
@@ -159,11 +159,11 @@ function unionEntries(indexed, factory) {
|
|
|
159
159
|
return [...indexed, ...factory.filter((e) => !seen.has(entryDedupKey(e)))];
|
|
160
160
|
}
|
|
161
161
|
async function searchLocal(query, kind, opts, showStore, airGapped) {
|
|
162
|
-
const projectDir =
|
|
162
|
+
const projectDir = path35__default.resolve(opts.projectDir);
|
|
163
163
|
const factory = await searchFactory(projectDir, query, kind);
|
|
164
164
|
let entries = unionEntries(await searchIndex(query, kind), factory);
|
|
165
165
|
if (entries.length === 0 && !query && !kind && !airGapped) {
|
|
166
|
-
const { autoSyncForSearch } = await import('../source-
|
|
166
|
+
const { autoSyncForSearch } = await import('../source-JS3G5P6Z.js');
|
|
167
167
|
if (await autoSyncForSearch(projectDir)) {
|
|
168
168
|
entries = unionEntries(await searchIndex(query, kind), factory);
|
|
169
169
|
}
|
|
@@ -217,9 +217,9 @@ async function searchStore(query, kind, opts, airGapped) {
|
|
|
217
217
|
logInfo("air-gapped (cache_ttl: 0) \u2014 local sources only");
|
|
218
218
|
return;
|
|
219
219
|
}
|
|
220
|
-
const { openCatalogSource: openCatalogSource2, LocalCatalogDisabledError } = await import('../open-library-
|
|
220
|
+
const { openCatalogSource: openCatalogSource2, LocalCatalogDisabledError } = await import('../open-library-6OSZX2O6.js');
|
|
221
221
|
try {
|
|
222
|
-
const remote = await openCatalogSource2({ projectDir:
|
|
222
|
+
const remote = await openCatalogSource2({ projectDir: path35__default.resolve(opts.projectDir) });
|
|
223
223
|
const assets = await remote.listAssets(kind ? { kind } : {});
|
|
224
224
|
const results = filterCatalogAssets(assets, query);
|
|
225
225
|
if (results.length > 0) {
|
|
@@ -333,7 +333,7 @@ function makeAddCommand() {
|
|
|
333
333
|
}
|
|
334
334
|
const backends = parseBackendFilter(opts.backend);
|
|
335
335
|
const am2 = new AssetManager({
|
|
336
|
-
projectDir:
|
|
336
|
+
projectDir: path35__default.resolve(opts.projectDir),
|
|
337
337
|
global: opts.global || backends !== void 0,
|
|
338
338
|
backends,
|
|
339
339
|
driverTarget: opts.target
|
|
@@ -376,7 +376,7 @@ function makeRemoveCommand() {
|
|
|
376
376
|
).option("--target <agent>", "Driver target", "claude-code").option("--no-soft-deps", "skip the orphaned-soft-dep prompt (don't remove, don't report)").action(async (ref, opts) => {
|
|
377
377
|
const backends = parseBackendFilter(opts.backend);
|
|
378
378
|
const am2 = new AssetManager({
|
|
379
|
-
projectDir:
|
|
379
|
+
projectDir: path35__default.resolve(opts.projectDir),
|
|
380
380
|
global: opts.global || backends !== void 0,
|
|
381
381
|
backends,
|
|
382
382
|
driverTarget: opts.target
|
|
@@ -416,7 +416,7 @@ function makeListCommand() {
|
|
|
416
416
|
return;
|
|
417
417
|
}
|
|
418
418
|
const am2 = new AssetManager({
|
|
419
|
-
projectDir:
|
|
419
|
+
projectDir: path35__default.resolve(opts.projectDir),
|
|
420
420
|
driverTarget: opts.target
|
|
421
421
|
});
|
|
422
422
|
let declared;
|
|
@@ -461,7 +461,7 @@ function makeListCommand() {
|
|
|
461
461
|
}
|
|
462
462
|
function runGlobalList(kind, opts, backends) {
|
|
463
463
|
const am2 = new AssetManager({
|
|
464
|
-
projectDir:
|
|
464
|
+
projectDir: path35__default.resolve(opts.projectDir),
|
|
465
465
|
global: true,
|
|
466
466
|
backends
|
|
467
467
|
});
|
|
@@ -532,7 +532,7 @@ async function resolveInfoEntry(am2, ref, opts) {
|
|
|
532
532
|
return { entry: match ?? deployed };
|
|
533
533
|
}
|
|
534
534
|
const lookup = opts.storeLookup ?? (async (filter) => {
|
|
535
|
-
const { resolveCatalogSource } = await import('../open-library-
|
|
535
|
+
const { resolveCatalogSource } = await import('../open-library-6OSZX2O6.js');
|
|
536
536
|
const { source, close } = await resolveCatalogSource({ projectDir: opts.projectDir });
|
|
537
537
|
try {
|
|
538
538
|
return await source.listAssets(filter);
|
|
@@ -548,7 +548,7 @@ async function resolveInfoEntry(am2, ref, opts) {
|
|
|
548
548
|
);
|
|
549
549
|
return { entry: hit ? catalogAssetToEntry(hit) : null };
|
|
550
550
|
} catch (err) {
|
|
551
|
-
const { LocalCatalogDisabledError } = await import('../open-library-
|
|
551
|
+
const { LocalCatalogDisabledError } = await import('../open-library-6OSZX2O6.js');
|
|
552
552
|
const storeNote = err instanceof Error ? err.message : String(err);
|
|
553
553
|
const disabled = err instanceof LocalCatalogDisabledError || /catalog\.url/i.test(storeNote);
|
|
554
554
|
return { entry: null, storeNote, ...disabled ? { storeDisabled: true } : {} };
|
|
@@ -564,7 +564,7 @@ function infoNotFoundHint(ref, lookup) {
|
|
|
564
564
|
}
|
|
565
565
|
function makeInfoCommand() {
|
|
566
566
|
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) => {
|
|
567
|
-
const projectDir =
|
|
567
|
+
const projectDir = path35__default.resolve(opts.projectDir);
|
|
568
568
|
const am2 = new AssetManager({ projectDir });
|
|
569
569
|
const lookup = await resolveInfoEntry(am2, ref, { projectDir });
|
|
570
570
|
const entry = lookup.entry;
|
|
@@ -600,7 +600,7 @@ function makeCreateCommand() {
|
|
|
600
600
|
new Option("-k, --kind <kind>", "Asset kind").default("skill").choices([...ASSET_KINDS])
|
|
601
601
|
).option("-d, --dir <dir>", "Target directory (default: cwd)").action((name, opts) => {
|
|
602
602
|
const am2 = new AssetManager({ projectDir: process.cwd() });
|
|
603
|
-
const destDir = opts.dir ?
|
|
603
|
+
const destDir = opts.dir ? path35__default.resolve(opts.dir) : process.cwd();
|
|
604
604
|
const result = am2.create(name, opts.kind, destDir);
|
|
605
605
|
if (result.ok) logOk(`Created ${kindColor(opts.kind)}: ${pc5.dim(result.path)}`);
|
|
606
606
|
else {
|
|
@@ -611,7 +611,7 @@ function makeCreateCommand() {
|
|
|
611
611
|
}
|
|
612
612
|
function makeDoctorCommand() {
|
|
613
613
|
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) => {
|
|
614
|
-
const am2 = new AssetManager({ projectDir:
|
|
614
|
+
const am2 = new AssetManager({ projectDir: path35__default.resolve(opts.projectDir) });
|
|
615
615
|
const issues = await am2.doctor();
|
|
616
616
|
if (issues.length === 0) {
|
|
617
617
|
logOk("No missing dependencies.");
|
|
@@ -639,21 +639,21 @@ function claudeSkillRoots() {
|
|
|
639
639
|
const roots = [];
|
|
640
640
|
const override = process.env.SKAILE_CLAUDE_SKILLS_DIR;
|
|
641
641
|
if (override) roots.push(override);
|
|
642
|
-
roots.push(
|
|
642
|
+
roots.push(path35.join(os.homedir(), ".claude", "skills"));
|
|
643
643
|
return roots;
|
|
644
644
|
}
|
|
645
645
|
function resolveImportSource(nameOrPath) {
|
|
646
|
-
const asPath =
|
|
647
|
-
if (
|
|
648
|
-
const dir =
|
|
649
|
-
const skillFile =
|
|
650
|
-
if (
|
|
646
|
+
const asPath = path35.resolve(nameOrPath);
|
|
647
|
+
if (fs12.existsSync(asPath)) {
|
|
648
|
+
const dir = fs12.statSync(asPath).isDirectory() ? asPath : path35.dirname(asPath);
|
|
649
|
+
const skillFile = path35.join(dir, "SKILL.md");
|
|
650
|
+
if (fs12.existsSync(skillFile)) return { dir, skillFile, via: "path" };
|
|
651
651
|
}
|
|
652
|
-
if (!nameOrPath.includes(
|
|
652
|
+
if (!nameOrPath.includes(path35.sep) && !nameOrPath.startsWith(".")) {
|
|
653
653
|
for (const root of claudeSkillRoots()) {
|
|
654
|
-
const dir =
|
|
655
|
-
const skillFile =
|
|
656
|
-
if (
|
|
654
|
+
const dir = path35.join(root, nameOrPath);
|
|
655
|
+
const skillFile = path35.join(dir, "SKILL.md");
|
|
656
|
+
if (fs12.existsSync(skillFile)) return { dir, skillFile, via: "claude-skills" };
|
|
657
657
|
}
|
|
658
658
|
}
|
|
659
659
|
return null;
|
|
@@ -718,20 +718,20 @@ ${description}
|
|
|
718
718
|
`;
|
|
719
719
|
};
|
|
720
720
|
function ensureDomain(libraryPath, domain, opts = {}) {
|
|
721
|
-
const dir =
|
|
722
|
-
const domainFile =
|
|
721
|
+
const dir = path35.join(libraryPath, domain);
|
|
722
|
+
const domainFile = path35.join(dir, "DOMAIN.md");
|
|
723
723
|
const publisher = opts.publisher ?? slugifyAssetName(domain);
|
|
724
|
-
if (
|
|
724
|
+
if (fs12.existsSync(domainFile)) {
|
|
725
725
|
return { dir, publisher, created: false };
|
|
726
726
|
}
|
|
727
|
-
|
|
727
|
+
fs12.mkdirSync(dir, { recursive: true });
|
|
728
728
|
const description = opts.description ?? `The ${domain} domain.`;
|
|
729
|
-
|
|
729
|
+
fs12.writeFileSync(domainFile, DOMAIN_TEMPLATE(domain, publisher, description), "utf8");
|
|
730
730
|
return { dir, publisher, created: true };
|
|
731
731
|
}
|
|
732
732
|
function listDomains(libraryPath) {
|
|
733
|
-
if (!
|
|
734
|
-
return
|
|
733
|
+
if (!fs12.existsSync(libraryPath)) return [];
|
|
734
|
+
return fs12.readdirSync(libraryPath, { withFileTypes: true }).filter((e) => e.isDirectory() && fs12.existsSync(path35.join(libraryPath, e.name, "DOMAIN.md"))).map((e) => e.name).sort();
|
|
735
735
|
}
|
|
736
736
|
function upsertManifestAsset(libraryPath, input) {
|
|
737
737
|
const manifest = loadSkPublishManifest(libraryPath) ?? { assets: [] };
|
|
@@ -800,12 +800,12 @@ function makeAssetCommand() {
|
|
|
800
800
|
logErr(`Library "${target.name}" is read-only (ownership=reader). Choose --to.`);
|
|
801
801
|
process.exit(1);
|
|
802
802
|
}
|
|
803
|
-
const rawSkill =
|
|
803
|
+
const rawSkill = fs12.readFileSync(src.skillFile, "utf8");
|
|
804
804
|
const norm = opts.normalize ? normalizeSkillContent(rawSkill, {
|
|
805
|
-
fallbackName:
|
|
805
|
+
fallbackName: path35.basename(src.dir),
|
|
806
806
|
version: opts.version,
|
|
807
807
|
stage: opts.stage
|
|
808
|
-
}) : { content: rawSkill, name:
|
|
808
|
+
}) : { content: rawSkill, name: path35.basename(src.dir), changed: false, notes: [] };
|
|
809
809
|
if (!opts.normalize && !isValidAssetName(norm.name)) {
|
|
810
810
|
logWarn(
|
|
811
811
|
`Name "${norm.name}" is not canonical (kebab-case); \`skaile validate\` will reject this manifest entry. Drop --no-normalize to slugify it.`
|
|
@@ -816,17 +816,17 @@ function makeAssetCommand() {
|
|
|
816
816
|
if (opts.domain) {
|
|
817
817
|
const dom = ensureDomain(target.path, opts.domain);
|
|
818
818
|
if (dom.created) logOk(`Scaffolded domain ${S.cmd(opts.domain)} \u2192 ${dom.dir}`);
|
|
819
|
-
destParent =
|
|
819
|
+
destParent = path35.join(dom.dir, "skills");
|
|
820
820
|
publisher = dom.publisher;
|
|
821
821
|
}
|
|
822
|
-
|
|
823
|
-
const destDir =
|
|
824
|
-
if (
|
|
822
|
+
fs12.mkdirSync(destParent, { recursive: true });
|
|
823
|
+
const destDir = path35.join(destParent, norm.name);
|
|
824
|
+
if (fs12.existsSync(destDir)) {
|
|
825
825
|
logErr(`Destination already exists: ${destDir}`);
|
|
826
826
|
process.exit(1);
|
|
827
827
|
}
|
|
828
|
-
|
|
829
|
-
|
|
828
|
+
fs12.cpSync(src.dir, destDir, { recursive: true });
|
|
829
|
+
fs12.writeFileSync(path35.join(destDir, "SKILL.md"), norm.content, "utf8");
|
|
830
830
|
for (const note of norm.notes) logInfo(` \u2022 ${note}`);
|
|
831
831
|
const fm = parseFrontmatter(norm.content).data;
|
|
832
832
|
const descRaw = fm.description;
|
|
@@ -834,7 +834,7 @@ function makeAssetCommand() {
|
|
|
834
834
|
for (const f of checkAgentSkillConformance(fm, { dirName: norm.name })) {
|
|
835
835
|
logWarn(`conformance: ${f.field} \u2014 ${f.message}`);
|
|
836
836
|
}
|
|
837
|
-
const root =
|
|
837
|
+
const root = path35.relative(target.path, destDir);
|
|
838
838
|
const up = upsertManifestAsset(target.path, {
|
|
839
839
|
kind: "skill",
|
|
840
840
|
name: norm.name,
|
|
@@ -868,7 +868,7 @@ function makeAssetCommand() {
|
|
|
868
868
|
logErr(`Invalid --mode "${opts.mode}". Expected: copy | move | link.`);
|
|
869
869
|
process.exit(1);
|
|
870
870
|
}
|
|
871
|
-
if (!
|
|
871
|
+
if (!fs12.existsSync(srcPath)) {
|
|
872
872
|
logErr(`Source path does not exist: ${srcPath}`);
|
|
873
873
|
process.exit(1);
|
|
874
874
|
}
|
|
@@ -895,23 +895,23 @@ function makeAssetCommand() {
|
|
|
895
895
|
);
|
|
896
896
|
process.exit(1);
|
|
897
897
|
}
|
|
898
|
-
const basename2 =
|
|
899
|
-
const destDir = target.structure === "domain" && opts.domain ?
|
|
900
|
-
|
|
901
|
-
const destPath =
|
|
902
|
-
if (
|
|
898
|
+
const basename2 = path35.basename(srcPath);
|
|
899
|
+
const destDir = target.structure === "domain" && opts.domain ? path35.join(target.path, opts.domain) : target.path;
|
|
900
|
+
fs12.mkdirSync(destDir, { recursive: true });
|
|
901
|
+
const destPath = path35.join(destDir, basename2);
|
|
902
|
+
if (fs12.existsSync(destPath)) {
|
|
903
903
|
logErr(`Destination already exists: ${destPath}`);
|
|
904
904
|
process.exit(1);
|
|
905
905
|
}
|
|
906
906
|
switch (opts.mode) {
|
|
907
907
|
case "copy":
|
|
908
|
-
|
|
908
|
+
fs12.cpSync(srcPath, destPath, { recursive: true });
|
|
909
909
|
break;
|
|
910
910
|
case "move":
|
|
911
|
-
|
|
911
|
+
fs12.renameSync(srcPath, destPath);
|
|
912
912
|
break;
|
|
913
913
|
case "link":
|
|
914
|
-
|
|
914
|
+
fs12.symlinkSync(path35.resolve(srcPath), destPath);
|
|
915
915
|
break;
|
|
916
916
|
}
|
|
917
917
|
if (target.backend === "git" && opts.commit) {
|
|
@@ -968,17 +968,17 @@ function makeAssetCommand() {
|
|
|
968
968
|
}
|
|
969
969
|
const manifestPath = def.manifest.path;
|
|
970
970
|
const candidateSubpath = typeof manifestPath === "string" && manifestPath.length > 0 ? manifestPath : def.name;
|
|
971
|
-
const srcPath =
|
|
972
|
-
if (!
|
|
971
|
+
const srcPath = path35.join(lib.path, candidateSubpath);
|
|
972
|
+
if (!fs12.existsSync(srcPath)) {
|
|
973
973
|
logErr(`Asset path not found: ${srcPath}`);
|
|
974
974
|
process.exit(1);
|
|
975
975
|
}
|
|
976
|
-
const destPath =
|
|
977
|
-
|
|
976
|
+
const destPath = path35.join(target, candidateSubpath);
|
|
977
|
+
fs12.mkdirSync(path35.dirname(destPath), { recursive: true });
|
|
978
978
|
if (opts.mode === "copy") {
|
|
979
|
-
|
|
979
|
+
fs12.cpSync(srcPath, destPath, { recursive: true });
|
|
980
980
|
} else {
|
|
981
|
-
|
|
981
|
+
fs12.symlinkSync(path35.resolve(srcPath), destPath);
|
|
982
982
|
}
|
|
983
983
|
logOk(`Installed ${ref} \u2192 ${destPath} (${opts.mode})`);
|
|
984
984
|
} finally {
|
|
@@ -1043,14 +1043,14 @@ function makeAuthCommand() {
|
|
|
1043
1043
|
}
|
|
1044
1044
|
function collectCacheTargets(scope) {
|
|
1045
1045
|
const out = [];
|
|
1046
|
-
out.push(
|
|
1047
|
-
out.push(
|
|
1048
|
-
out.push(
|
|
1046
|
+
out.push(path35__default.join(scope.projectDir, ".skaile", "cache"));
|
|
1047
|
+
out.push(path35__default.join(scope.projectDir, ".skaile", "store-cache"));
|
|
1048
|
+
out.push(path35__default.join(scope.projectDir, ".skaile", "repos"));
|
|
1049
1049
|
if (scope.global) {
|
|
1050
1050
|
out.push(globalCacheRoot());
|
|
1051
|
-
const home = process.env.SKAILE_HOME ??
|
|
1052
|
-
out.push(
|
|
1053
|
-
out.push(
|
|
1051
|
+
const home = process.env.SKAILE_HOME ?? path35__default.join(homedir(), ".skaile");
|
|
1052
|
+
out.push(path35__default.join(home, "repos"));
|
|
1053
|
+
out.push(path35__default.join(home, "catalog-cache"));
|
|
1054
1054
|
}
|
|
1055
1055
|
return out;
|
|
1056
1056
|
}
|
|
@@ -1064,7 +1064,7 @@ function dirSize(target) {
|
|
|
1064
1064
|
function dirSizeOfDir(dir) {
|
|
1065
1065
|
let total = 0;
|
|
1066
1066
|
for (const ent of readdirSync(dir, { withFileTypes: true })) {
|
|
1067
|
-
const child =
|
|
1067
|
+
const child = path35__default.join(dir, ent.name);
|
|
1068
1068
|
if (ent.isSymbolicLink()) continue;
|
|
1069
1069
|
if (ent.isDirectory()) total += dirSizeOfDir(child);
|
|
1070
1070
|
else if (ent.isFile()) total += statSync(child).size;
|
|
@@ -1090,7 +1090,7 @@ function makeCacheCommand() {
|
|
|
1090
1090
|
const cmd = new Command("cache").description("Inspect and reclaim the re-derivable cache");
|
|
1091
1091
|
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) => {
|
|
1092
1092
|
const targets = collectCacheTargets({
|
|
1093
|
-
projectDir:
|
|
1093
|
+
projectDir: path35__default.resolve(opts.projectDir),
|
|
1094
1094
|
global: opts.global
|
|
1095
1095
|
}).filter((t) => existsSync(t));
|
|
1096
1096
|
if (targets.length === 0) {
|
|
@@ -1120,12 +1120,12 @@ function makeCacheCommand() {
|
|
|
1120
1120
|
for (const r of removed) logOk(`Removed ${r}`);
|
|
1121
1121
|
});
|
|
1122
1122
|
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) => {
|
|
1123
|
-
console.log(
|
|
1123
|
+
console.log(path35__default.join(path35__default.resolve(opts.projectDir), ".skaile", "cache"));
|
|
1124
1124
|
if (opts.global) console.log(globalCacheRoot());
|
|
1125
1125
|
});
|
|
1126
1126
|
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) => {
|
|
1127
1127
|
const targets = collectCacheTargets({
|
|
1128
|
-
projectDir:
|
|
1128
|
+
projectDir: path35__default.resolve(opts.projectDir),
|
|
1129
1129
|
global: opts.global
|
|
1130
1130
|
});
|
|
1131
1131
|
console.log();
|
|
@@ -1141,7 +1141,7 @@ function makeCatalogCommand() {
|
|
|
1141
1141
|
const catalog = new Command("catalog").description("Catalog source health and configuration");
|
|
1142
1142
|
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) => {
|
|
1143
1143
|
const { resolveConfig, isLocalCatalogUrl, trpcGetUrl } = await import('../library/index.js');
|
|
1144
|
-
const projectDir = opts.projectDir ?
|
|
1144
|
+
const projectDir = opts.projectDir ? path35__default.resolve(opts.projectDir) : void 0;
|
|
1145
1145
|
const cfg = resolveConfig({ projectDir });
|
|
1146
1146
|
const baseUrl = opts.url ?? cfg.catalog.url;
|
|
1147
1147
|
if (isLocalCatalogUrl(baseUrl)) {
|
|
@@ -1159,7 +1159,7 @@ function makeCatalogCommand() {
|
|
|
1159
1159
|
});
|
|
1160
1160
|
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) => {
|
|
1161
1161
|
const { resolveConfig } = await import('../library/index.js');
|
|
1162
|
-
const projectDir = opts.projectDir ?
|
|
1162
|
+
const projectDir = opts.projectDir ? path35__default.resolve(opts.projectDir) : void 0;
|
|
1163
1163
|
const cfg = resolveConfig({ projectDir });
|
|
1164
1164
|
console.log(`url: ${cfg.catalog.url}`);
|
|
1165
1165
|
console.log(`framing: ${cfg.catalog.framing}`);
|
|
@@ -1168,7 +1168,7 @@ function makeCatalogCommand() {
|
|
|
1168
1168
|
return catalog;
|
|
1169
1169
|
}
|
|
1170
1170
|
async function runLocalCatalogTest(projectDir) {
|
|
1171
|
-
const { resolveCatalogSource } = await import('../open-library-
|
|
1171
|
+
const { resolveCatalogSource } = await import('../open-library-6OSZX2O6.js');
|
|
1172
1172
|
let resolved;
|
|
1173
1173
|
try {
|
|
1174
1174
|
resolved = await resolveCatalogSource({ projectDir });
|
|
@@ -1288,40 +1288,25 @@ complete -F _${bin}_completion ${bin}`,
|
|
|
1288
1288
|
end
|
|
1289
1289
|
complete -c ${bin} -f -a '(__${bin}_complete)'`
|
|
1290
1290
|
};
|
|
1291
|
-
|
|
1291
|
+
|
|
1292
|
+
// cli/src/flow-discovery.ts
|
|
1293
|
+
function discoverFlows(projectDir) {
|
|
1292
1294
|
const byId = /* @__PURE__ */ new Map();
|
|
1293
|
-
for (const root of aiResourceRoots()) {
|
|
1295
|
+
for (const root of aiResourceRoots(projectDir)) {
|
|
1294
1296
|
for (const { flow } of loadAllFlowEntries(root)) {
|
|
1295
1297
|
if (!byId.has(flow.id)) byId.set(flow.id, flow);
|
|
1296
1298
|
}
|
|
1297
1299
|
}
|
|
1298
1300
|
return [...byId.values()];
|
|
1299
1301
|
}
|
|
1300
|
-
function
|
|
1301
|
-
|
|
1302
|
-
return loadFlow(filePath).id;
|
|
1303
|
-
} catch {
|
|
1304
|
-
return void 0;
|
|
1305
|
-
}
|
|
1306
|
-
}
|
|
1307
|
-
function findFlowFile(flowId, priorityRoots = []) {
|
|
1308
|
-
for (const root of [...priorityRoots, ...aiResourceRoots()]) {
|
|
1309
|
-
for (const { dir } of assetSearchDirs(root, "flows")) {
|
|
1310
|
-
for (const candidate of flowFileCandidates(dir, flowId)) {
|
|
1311
|
-
if (fs13__default.existsSync(candidate) && declaredFlowId(candidate) === flowId) return candidate;
|
|
1312
|
-
}
|
|
1313
|
-
}
|
|
1314
|
-
const entry = loadAllFlowEntries(root, { onWarn: () => {
|
|
1315
|
-
} }).find((e) => e.flow.id === flowId);
|
|
1316
|
-
if (entry) return entry.path;
|
|
1317
|
-
}
|
|
1318
|
-
return void 0;
|
|
1302
|
+
function findFlowFile(flowId, priorityRoots = [], projectDir) {
|
|
1303
|
+
return findFlowFileInRoots(flowId, [...priorityRoots, ...aiResourceRoots(projectDir)]);
|
|
1319
1304
|
}
|
|
1320
1305
|
function findSkills(domain) {
|
|
1321
1306
|
const found = [];
|
|
1322
1307
|
for (const root of aiResourceRoots()) {
|
|
1323
1308
|
for (const { dir, domain: dirDomain } of assetSearchDirs(root, "skills")) {
|
|
1324
|
-
if (
|
|
1309
|
+
if (fs12__default.existsSync(dir)) walkSkills(dir, dirDomain, found);
|
|
1325
1310
|
}
|
|
1326
1311
|
}
|
|
1327
1312
|
const seen = /* @__PURE__ */ new Set();
|
|
@@ -1334,11 +1319,11 @@ function findSkills(domain) {
|
|
|
1334
1319
|
return deduped;
|
|
1335
1320
|
}
|
|
1336
1321
|
function walkSkills(dir, domain, out) {
|
|
1337
|
-
for (const entry of
|
|
1338
|
-
const full =
|
|
1322
|
+
for (const entry of fs12__default.readdirSync(dir, { withFileTypes: true })) {
|
|
1323
|
+
const full = path35__default.join(dir, entry.name);
|
|
1339
1324
|
if (entry.isDirectory()) {
|
|
1340
|
-
const skillMd =
|
|
1341
|
-
if (
|
|
1325
|
+
const skillMd = path35__default.join(full, "SKILL.md");
|
|
1326
|
+
if (fs12__default.existsSync(skillMd)) {
|
|
1342
1327
|
out.push({ name: entry.name, path: full, skillPath: skillMd, domain });
|
|
1343
1328
|
} else {
|
|
1344
1329
|
walkSkills(full, domain, out);
|
|
@@ -1366,10 +1351,10 @@ function resolveFlowIds() {
|
|
|
1366
1351
|
}
|
|
1367
1352
|
}
|
|
1368
1353
|
function resolveSessionIds(projectDir) {
|
|
1369
|
-
const sessionsDir =
|
|
1370
|
-
if (!
|
|
1354
|
+
const sessionsDir = path35__default.join(projectDir, ".skaile", "sessions");
|
|
1355
|
+
if (!fs12__default.existsSync(sessionsDir)) return [];
|
|
1371
1356
|
try {
|
|
1372
|
-
return
|
|
1357
|
+
return fs12__default.readdirSync(sessionsDir).filter((f) => f.endsWith(".json")).map((f) => f.slice(0, -".json".length));
|
|
1373
1358
|
} catch {
|
|
1374
1359
|
return [];
|
|
1375
1360
|
}
|
|
@@ -1485,7 +1470,7 @@ function printResolvedPathsSection(config) {
|
|
|
1485
1470
|
console.log(` ${S.label("prompts:".padEnd(16))} ${config.promptsDir ?? paths.promptsDir}`);
|
|
1486
1471
|
}
|
|
1487
1472
|
async function showConfig(opts) {
|
|
1488
|
-
const projectDir = opts.projectDir ?
|
|
1473
|
+
const projectDir = opts.projectDir ? path35__default.resolve(opts.projectDir) : process.cwd();
|
|
1489
1474
|
const config = await resolveSettings(projectDir);
|
|
1490
1475
|
const wsDefaults = collectWorkspaceDefaults(projectDir);
|
|
1491
1476
|
printEffectiveSection(config);
|
|
@@ -1498,13 +1483,13 @@ function makeConfigCommand() {
|
|
|
1498
1483
|
const cmd = new Command("config").description("Manage personal config (.skaile/settings.json)");
|
|
1499
1484
|
cmd.command("show").description("Show effective config with sources").option("--project-dir <path>", "Project directory").action((opts) => showConfig(opts));
|
|
1500
1485
|
cmd.command("get <key>").description("Get an effective config value").option("--project-dir <path>", "Project directory").action(async (key, opts) => {
|
|
1501
|
-
const projectDir = opts.projectDir ?
|
|
1486
|
+
const projectDir = opts.projectDir ? path35__default.resolve(opts.projectDir) : process.cwd();
|
|
1502
1487
|
const config = await resolveSettings(projectDir);
|
|
1503
1488
|
const value = config[key];
|
|
1504
1489
|
console.log(value ?? S.dim("(not set)"));
|
|
1505
1490
|
});
|
|
1506
1491
|
cmd.command("set <key> <value>").description("Set a personal config value (driver, model, provider, apiKey.<provider>)").option("--project-dir <path>", "Project directory").option("--global", "Write to ~/.skaile/settings.json instead of project-local").action(async (key, value, opts) => {
|
|
1507
|
-
const projectDir = opts.projectDir ?
|
|
1492
|
+
const projectDir = opts.projectDir ? path35__default.resolve(opts.projectDir) : process.cwd();
|
|
1508
1493
|
const isApiKey = key.startsWith(API_KEY_PREFIX);
|
|
1509
1494
|
if (!PERSONAL_KEYS.has(key) && !isApiKey) {
|
|
1510
1495
|
logErr(
|
|
@@ -1822,8 +1807,8 @@ function makeConnectorCommand() {
|
|
|
1822
1807
|
async (driver, opts) => {
|
|
1823
1808
|
const { installNpmPackages } = await import('../connectors/index.js');
|
|
1824
1809
|
const { scanDirectory: scanDirectory2, factoryAssetRoots: factoryAssetRoots2, WorkspaceYamlEditor: WorkspaceYamlEditor2 } = await import('../core/index.js');
|
|
1825
|
-
const projectDir =
|
|
1826
|
-
const yamlPath =
|
|
1810
|
+
const projectDir = path35__default.resolve(opts.projectDir);
|
|
1811
|
+
const yamlPath = path35__default.join(projectDir, "skaile.yaml");
|
|
1827
1812
|
if (!existsSync(yamlPath)) {
|
|
1828
1813
|
logErr("No skaile.yaml found in current directory. Run 'skaile init' first.");
|
|
1829
1814
|
process.exit(1);
|
|
@@ -1883,8 +1868,8 @@ ${installResult.output}`);
|
|
|
1883
1868
|
);
|
|
1884
1869
|
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) => {
|
|
1885
1870
|
const { WorkspaceYamlEditor: WorkspaceYamlEditor2 } = await import('../core/index.js');
|
|
1886
|
-
const projectDir =
|
|
1887
|
-
const yamlPath =
|
|
1871
|
+
const projectDir = path35__default.resolve(opts.projectDir);
|
|
1872
|
+
const yamlPath = path35__default.join(projectDir, "skaile.yaml");
|
|
1888
1873
|
if (!existsSync(yamlPath)) {
|
|
1889
1874
|
logErr("No skaile.yaml found in current directory.");
|
|
1890
1875
|
process.exit(1);
|
|
@@ -1901,7 +1886,7 @@ ${installResult.output}`);
|
|
|
1901
1886
|
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) => {
|
|
1902
1887
|
const res = await import('../connectors/index.js');
|
|
1903
1888
|
res.registerBuiltinConnectors();
|
|
1904
|
-
const projectDir =
|
|
1889
|
+
const projectDir = path35__default.resolve(opts.projectDir);
|
|
1905
1890
|
const declarations = res.loadConnectorDeclarations(projectDir);
|
|
1906
1891
|
if (declarations.length === 0) {
|
|
1907
1892
|
console.log("No connectors configured in skaile.yaml.");
|
|
@@ -1925,7 +1910,7 @@ ${installResult.output}`);
|
|
|
1925
1910
|
await manager.disconnectAll();
|
|
1926
1911
|
});
|
|
1927
1912
|
cmd.command("list").description("List all configured connectors").option("--project-dir <path>", "Workspace directory", process.cwd()).action(async (opts) => {
|
|
1928
|
-
const projectDir =
|
|
1913
|
+
const projectDir = path35__default.resolve(opts.projectDir);
|
|
1929
1914
|
const manager = await connectConnectors(projectDir);
|
|
1930
1915
|
try {
|
|
1931
1916
|
console.log(JSON.stringify(manager.listConnectors(), null, 2));
|
|
@@ -1934,7 +1919,7 @@ ${installResult.output}`);
|
|
|
1934
1919
|
}
|
|
1935
1920
|
});
|
|
1936
1921
|
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) => {
|
|
1937
|
-
const projectDir =
|
|
1922
|
+
const projectDir = path35__default.resolve(opts.projectDir);
|
|
1938
1923
|
const manager = await connectConnectors(projectDir);
|
|
1939
1924
|
try {
|
|
1940
1925
|
if (opts.all) {
|
|
@@ -1958,7 +1943,7 @@ ${installResult.output}`);
|
|
|
1958
1943
|
}
|
|
1959
1944
|
});
|
|
1960
1945
|
cmd.command("ops <id>").description("List available operations for a connector").option("--project-dir <path>", "Workspace directory", process.cwd()).action(async (id, opts) => {
|
|
1961
|
-
const projectDir =
|
|
1946
|
+
const projectDir = path35__default.resolve(opts.projectDir);
|
|
1962
1947
|
const manager = await connectConnectors(projectDir);
|
|
1963
1948
|
try {
|
|
1964
1949
|
if (!manager.has(id)) {
|
|
@@ -1973,7 +1958,7 @@ ${installResult.output}`);
|
|
|
1973
1958
|
}
|
|
1974
1959
|
});
|
|
1975
1960
|
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) => {
|
|
1976
|
-
const projectDir =
|
|
1961
|
+
const projectDir = path35__default.resolve(opts.projectDir);
|
|
1977
1962
|
const manager = await connectConnectors(projectDir);
|
|
1978
1963
|
try {
|
|
1979
1964
|
const content = await manager.read(id, resourcePath);
|
|
@@ -1983,7 +1968,7 @@ ${installResult.output}`);
|
|
|
1983
1968
|
}
|
|
1984
1969
|
});
|
|
1985
1970
|
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) => {
|
|
1986
|
-
const projectDir =
|
|
1971
|
+
const projectDir = path35__default.resolve(opts.projectDir);
|
|
1987
1972
|
const manager = await connectConnectors(projectDir);
|
|
1988
1973
|
try {
|
|
1989
1974
|
await manager.write(id, resourcePath, { data: content });
|
|
@@ -1993,7 +1978,7 @@ ${installResult.output}`);
|
|
|
1993
1978
|
}
|
|
1994
1979
|
});
|
|
1995
1980
|
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) => {
|
|
1996
|
-
const projectDir =
|
|
1981
|
+
const projectDir = path35__default.resolve(opts.projectDir);
|
|
1997
1982
|
const manager = await connectConnectors(projectDir);
|
|
1998
1983
|
try {
|
|
1999
1984
|
const entries = await manager.list(id, resourcePath, {
|
|
@@ -2006,7 +1991,7 @@ ${installResult.output}`);
|
|
|
2006
1991
|
}
|
|
2007
1992
|
});
|
|
2008
1993
|
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) => {
|
|
2009
|
-
const projectDir =
|
|
1994
|
+
const projectDir = path35__default.resolve(opts.projectDir);
|
|
2010
1995
|
const manager = await connectConnectors(projectDir);
|
|
2011
1996
|
try {
|
|
2012
1997
|
const results = await manager.search(id, query);
|
|
@@ -2016,7 +2001,7 @@ ${installResult.output}`);
|
|
|
2016
2001
|
}
|
|
2017
2002
|
});
|
|
2018
2003
|
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) => {
|
|
2019
|
-
const projectDir =
|
|
2004
|
+
const projectDir = path35__default.resolve(opts.projectDir);
|
|
2020
2005
|
const manager = await connectConnectors(projectDir);
|
|
2021
2006
|
try {
|
|
2022
2007
|
const ok = await manager.delete(id, resourcePath);
|
|
@@ -2026,7 +2011,7 @@ ${installResult.output}`);
|
|
|
2026
2011
|
}
|
|
2027
2012
|
});
|
|
2028
2013
|
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) => {
|
|
2029
|
-
const projectDir =
|
|
2014
|
+
const projectDir = path35__default.resolve(opts.projectDir);
|
|
2030
2015
|
const manager = await connectConnectors(projectDir);
|
|
2031
2016
|
try {
|
|
2032
2017
|
if (!manager.has(id)) {
|
|
@@ -2135,7 +2120,7 @@ function envRecord() {
|
|
|
2135
2120
|
async function buildDeployContext(projectDir) {
|
|
2136
2121
|
const { resolveSkWorkspaceConfig: resolveSkWorkspaceConfig2 } = await import('../core/index.js');
|
|
2137
2122
|
const config = resolveSkWorkspaceConfig2(projectDir);
|
|
2138
|
-
const workspaceId = config.name ??
|
|
2123
|
+
const workspaceId = config.name ?? path35__default.basename(projectDir);
|
|
2139
2124
|
let log;
|
|
2140
2125
|
try {
|
|
2141
2126
|
const { createLogger } = await import('../core/logging.js');
|
|
@@ -2167,13 +2152,13 @@ async function ensureTargetsRegistered(projectDir) {
|
|
|
2167
2152
|
const { resolveSkWorkspaceConfig: resolveSkWorkspaceConfig2 } = await import('../core/index.js');
|
|
2168
2153
|
const config = resolveSkWorkspaceConfig2(projectDir);
|
|
2169
2154
|
if (config.plugins && config.plugins.length > 0) {
|
|
2170
|
-
const { ensurePluginsLoaded } = await import('../plugin-store-
|
|
2155
|
+
const { ensurePluginsLoaded } = await import('../plugin-store-3BYOBKYT.js');
|
|
2171
2156
|
const result = await ensurePluginsLoaded(projectDir, config.plugins, pluginRegistry);
|
|
2172
2157
|
for (const f of result.failed) logWarn(f.error);
|
|
2173
2158
|
}
|
|
2174
2159
|
}
|
|
2175
2160
|
async function runUp(opts) {
|
|
2176
|
-
const projectDir =
|
|
2161
|
+
const projectDir = path35__default.resolve(opts.projectDir);
|
|
2177
2162
|
await ensureTargetsRegistered(projectDir);
|
|
2178
2163
|
const { resolveSkWorkspaceConfig: resolveSkWorkspaceConfig2 } = await import('../core/index.js');
|
|
2179
2164
|
const { resolveDeployTarget, pluginRegistry } = await import('../plugin-registry/index.js');
|
|
@@ -2241,7 +2226,7 @@ async function restoreFromHandle(projectDir) {
|
|
|
2241
2226
|
return { target, handle, ctx };
|
|
2242
2227
|
}
|
|
2243
2228
|
async function runDown(opts) {
|
|
2244
|
-
const projectDir =
|
|
2229
|
+
const projectDir = path35__default.resolve(opts.projectDir);
|
|
2245
2230
|
const restored = await restoreFromHandle(projectDir);
|
|
2246
2231
|
if (!restored) return;
|
|
2247
2232
|
await restored.handle.stop();
|
|
@@ -2250,7 +2235,7 @@ async function runDown(opts) {
|
|
|
2250
2235
|
logOk(`Stopped ${S.cmd(restored.target.id)} and cleared the handle.`);
|
|
2251
2236
|
}
|
|
2252
2237
|
async function runStatus(opts) {
|
|
2253
|
-
const projectDir =
|
|
2238
|
+
const projectDir = path35__default.resolve(opts.projectDir);
|
|
2254
2239
|
const restored = await restoreFromHandle(projectDir);
|
|
2255
2240
|
if (!restored) return;
|
|
2256
2241
|
const health = await restored.handle.health();
|
|
@@ -2264,7 +2249,7 @@ async function runStatus(opts) {
|
|
|
2264
2249
|
console.log();
|
|
2265
2250
|
}
|
|
2266
2251
|
async function runLogs(opts) {
|
|
2267
|
-
const projectDir =
|
|
2252
|
+
const projectDir = path35__default.resolve(opts.projectDir);
|
|
2268
2253
|
const restored = await restoreFromHandle(projectDir);
|
|
2269
2254
|
if (!restored) return;
|
|
2270
2255
|
if (!restored.handle.logs) {
|
|
@@ -2288,7 +2273,7 @@ function makeDeployCommand() {
|
|
|
2288
2273
|
}
|
|
2289
2274
|
function makeDiffCommand() {
|
|
2290
2275
|
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) => {
|
|
2291
|
-
const am2 = new AssetManager({ projectDir:
|
|
2276
|
+
const am2 = new AssetManager({ projectDir: path35__default.resolve(opts.projectDir) });
|
|
2292
2277
|
const result = await am2.diff(ref);
|
|
2293
2278
|
if (result === null) {
|
|
2294
2279
|
logInfo("No differences (or asset not found).");
|
|
@@ -2299,8 +2284,8 @@ function makeDiffCommand() {
|
|
|
2299
2284
|
}
|
|
2300
2285
|
function makeFlowCommand() {
|
|
2301
2286
|
const cmd = new Command("flow").description("Manage flows");
|
|
2302
|
-
cmd.command("list").description("List available flows").action(async () => {
|
|
2303
|
-
const flows = discoverFlows();
|
|
2287
|
+
cmd.command("list").description("List available flows").option("--project-dir <path>", "Project directory", process.cwd()).action(async (opts) => {
|
|
2288
|
+
const flows = discoverFlows(path35__default.resolve(opts.projectDir));
|
|
2304
2289
|
if (flows.length === 0) {
|
|
2305
2290
|
logInfo("No flows found.");
|
|
2306
2291
|
return;
|
|
@@ -2314,8 +2299,8 @@ function makeFlowCommand() {
|
|
|
2314
2299
|
}
|
|
2315
2300
|
console.log();
|
|
2316
2301
|
});
|
|
2317
|
-
cmd.command("show <id>").description("Show flow details and node graph").action(async (id) => {
|
|
2318
|
-
const flows = discoverFlows();
|
|
2302
|
+
cmd.command("show <id>").description("Show flow details and node graph").option("--project-dir <path>", "Project directory", process.cwd()).action(async (id, opts) => {
|
|
2303
|
+
const flows = discoverFlows(path35__default.resolve(opts.projectDir));
|
|
2319
2304
|
const flow = flows.find((f) => f.id === id);
|
|
2320
2305
|
if (!flow) {
|
|
2321
2306
|
logErr(`Flow not found: ${id}`);
|
|
@@ -2324,14 +2309,20 @@ function makeFlowCommand() {
|
|
|
2324
2309
|
console.log();
|
|
2325
2310
|
console.log(` ${S.heading(flow.name)} ${S.dim(`(${flow.id} v${flow.version})`)}`);
|
|
2326
2311
|
if (flow.description) console.log(` ${S.dim(flow.description)}`);
|
|
2327
|
-
const skillNodes = flow.nodes.filter((n) => n.type === "skill");
|
|
2328
2312
|
console.log(`
|
|
2329
|
-
${S.heading("Nodes")} ${S.dim(`(${
|
|
2313
|
+
${S.heading("Nodes")} ${S.dim(`(${flow.nodes.length})`)}`);
|
|
2330
2314
|
console.log(` ${S.rule(50)}`);
|
|
2331
|
-
|
|
2332
|
-
|
|
2333
|
-
const
|
|
2334
|
-
|
|
2315
|
+
const labelWidth = Math.max(24, ...flow.nodes.map((n) => nodeLabel(n).length));
|
|
2316
|
+
for (const node of flow.nodes) {
|
|
2317
|
+
const skill = nodeSkillAsset(node);
|
|
2318
|
+
const asset = skill ? ` ${S.label("skill:")} ${S.cmd(skill.slice("skill:".length))}` : "";
|
|
2319
|
+
const inert = nodeIsInert(node);
|
|
2320
|
+
const opt = !inert && nodeIsOptional(node) ? S.dim(" [optional]") : "";
|
|
2321
|
+
const tail = `${asset}${opt}`;
|
|
2322
|
+
const kind = inert ? "inert" : nodeRunKind(node);
|
|
2323
|
+
console.log(
|
|
2324
|
+
` ${nodeLabel(node).padEnd(labelWidth)} ${S.dim(tail ? kind.padEnd(10) : kind)}${tail}`
|
|
2325
|
+
);
|
|
2335
2326
|
}
|
|
2336
2327
|
console.log();
|
|
2337
2328
|
});
|
|
@@ -2341,7 +2332,7 @@ function makeFlowCommand() {
|
|
|
2341
2332
|
function makeHistoryCommand() {
|
|
2342
2333
|
const cmd = new Command("history").description("Show recent add/remove/update actions");
|
|
2343
2334
|
cmd.argument("[limit]", "Number of entries to show", "20").option("--project-dir <path>", "Project directory", process.cwd()).action((limitStr, opts) => {
|
|
2344
|
-
const am2 = new AssetManager({ projectDir:
|
|
2335
|
+
const am2 = new AssetManager({ projectDir: path35__default.resolve(opts.projectDir) });
|
|
2345
2336
|
const limit = parseInt(limitStr, 10) || 20;
|
|
2346
2337
|
const entries = am2.history(limit);
|
|
2347
2338
|
if (entries.length === 0) {
|
|
@@ -2361,7 +2352,7 @@ function makeHistoryCommand() {
|
|
|
2361
2352
|
console.log();
|
|
2362
2353
|
});
|
|
2363
2354
|
cmd.command("clear").description("Clear action history").option("--project-dir <path>", "Project directory", process.cwd()).action((opts) => {
|
|
2364
|
-
const am2 = new AssetManager({ projectDir:
|
|
2355
|
+
const am2 = new AssetManager({ projectDir: path35__default.resolve(opts.projectDir) });
|
|
2365
2356
|
am2.clearHistory();
|
|
2366
2357
|
logOk("History cleared.");
|
|
2367
2358
|
});
|
|
@@ -2374,12 +2365,12 @@ var MCP_SERVER_ENTRY = {
|
|
|
2374
2365
|
env: {}
|
|
2375
2366
|
};
|
|
2376
2367
|
function pluginDir(projectDir) {
|
|
2377
|
-
return
|
|
2368
|
+
return path35__default.join(projectDir, ".claude", "plugins", "skaile");
|
|
2378
2369
|
}
|
|
2379
2370
|
async function readJsonStrict(p7) {
|
|
2380
2371
|
let raw;
|
|
2381
2372
|
try {
|
|
2382
|
-
raw = await
|
|
2373
|
+
raw = await fs5.readFile(p7, "utf-8");
|
|
2383
2374
|
} catch {
|
|
2384
2375
|
return null;
|
|
2385
2376
|
}
|
|
@@ -2392,32 +2383,32 @@ async function readJsonStrict(p7) {
|
|
|
2392
2383
|
}
|
|
2393
2384
|
}
|
|
2394
2385
|
async function writeJson(p7, value) {
|
|
2395
|
-
await
|
|
2396
|
-
await
|
|
2386
|
+
await fs5.mkdir(path35__default.dirname(p7), { recursive: true });
|
|
2387
|
+
await fs5.writeFile(p7, `${JSON.stringify(value, null, 2)}
|
|
2397
2388
|
`);
|
|
2398
2389
|
}
|
|
2399
2390
|
async function copyDir(src, dest) {
|
|
2400
|
-
await
|
|
2401
|
-
const entries = await
|
|
2391
|
+
await fs5.mkdir(dest, { recursive: true });
|
|
2392
|
+
const entries = await fs5.readdir(src, { withFileTypes: true });
|
|
2402
2393
|
for (const entry of entries) {
|
|
2403
|
-
const srcPath =
|
|
2404
|
-
const destPath =
|
|
2394
|
+
const srcPath = path35__default.join(src, entry.name);
|
|
2395
|
+
const destPath = path35__default.join(dest, entry.name);
|
|
2405
2396
|
if (entry.isDirectory()) await copyDir(srcPath, destPath);
|
|
2406
|
-
else await
|
|
2397
|
+
else await fs5.copyFile(srcPath, destPath);
|
|
2407
2398
|
}
|
|
2408
2399
|
}
|
|
2409
2400
|
async function install(projectDir, opts) {
|
|
2410
2401
|
return opts?.full ? installFullPlugin(projectDir) : installMcp(projectDir);
|
|
2411
2402
|
}
|
|
2412
2403
|
async function installMcp(projectDir) {
|
|
2413
|
-
const mcpPath =
|
|
2404
|
+
const mcpPath = path35__default.join(projectDir, ".claude", "mcp.json");
|
|
2414
2405
|
const existing = await readJsonStrict(mcpPath) ?? {};
|
|
2415
2406
|
const mcpServers = { ...existing.mcpServers ?? {} };
|
|
2416
2407
|
const previous = mcpServers[SKAILE_MCP_NAME];
|
|
2417
2408
|
const matches = previous && JSON.stringify(previous) === JSON.stringify(MCP_SERVER_ENTRY);
|
|
2418
2409
|
let warning;
|
|
2419
2410
|
if (previous && !matches) {
|
|
2420
|
-
warning = `overwrote existing ${SKAILE_MCP_NAME} entry in ${
|
|
2411
|
+
warning = `overwrote existing ${SKAILE_MCP_NAME} entry in ${path35__default.relative(projectDir, mcpPath)}`;
|
|
2421
2412
|
}
|
|
2422
2413
|
mcpServers[SKAILE_MCP_NAME] = MCP_SERVER_ENTRY;
|
|
2423
2414
|
await writeJson(mcpPath, { ...existing, mcpServers });
|
|
@@ -2426,15 +2417,15 @@ async function installMcp(projectDir) {
|
|
|
2426
2417
|
async function installFullPlugin(projectDir) {
|
|
2427
2418
|
const dir = pluginDir(projectDir);
|
|
2428
2419
|
for (const [rel, content] of Object.entries(buildClaudePluginFiles())) {
|
|
2429
|
-
const dest =
|
|
2430
|
-
await
|
|
2431
|
-
await
|
|
2420
|
+
const dest = path35__default.join(dir, rel);
|
|
2421
|
+
await fs5.mkdir(path35__default.dirname(dest), { recursive: true });
|
|
2422
|
+
await fs5.writeFile(dest, content);
|
|
2432
2423
|
}
|
|
2433
|
-
const projectSkillsDir =
|
|
2424
|
+
const projectSkillsDir = path35__default.join(projectDir, ".skaile", "skills");
|
|
2434
2425
|
if (existsSync(projectSkillsDir)) {
|
|
2435
|
-
await copyDir(projectSkillsDir,
|
|
2426
|
+
await copyDir(projectSkillsDir, path35__default.join(dir, "skills"));
|
|
2436
2427
|
}
|
|
2437
|
-
const settingsPath =
|
|
2428
|
+
const settingsPath = path35__default.join(projectDir, ".claude", "settings.json");
|
|
2438
2429
|
const settings = await readJsonStrict(settingsPath) ?? {};
|
|
2439
2430
|
const plugins = settings.plugins ?? [];
|
|
2440
2431
|
if (!plugins.includes(dir)) plugins.push(dir);
|
|
@@ -2442,8 +2433,8 @@ async function installFullPlugin(projectDir) {
|
|
|
2442
2433
|
return { changed: true, method: "plugin" };
|
|
2443
2434
|
}
|
|
2444
2435
|
async function uninstall(projectDir) {
|
|
2445
|
-
const settingsPath =
|
|
2446
|
-
const mcpPath =
|
|
2436
|
+
const settingsPath = path35__default.join(projectDir, ".claude", "settings.json");
|
|
2437
|
+
const mcpPath = path35__default.join(projectDir, ".claude", "mcp.json");
|
|
2447
2438
|
const dir = pluginDir(projectDir);
|
|
2448
2439
|
let changed = false;
|
|
2449
2440
|
const settings = await readJsonStrict(settingsPath);
|
|
@@ -2457,7 +2448,7 @@ async function uninstall(projectDir) {
|
|
|
2457
2448
|
}
|
|
2458
2449
|
}
|
|
2459
2450
|
if (existsSync(dir)) {
|
|
2460
|
-
await
|
|
2451
|
+
await fs5.rm(dir, { recursive: true, force: true });
|
|
2461
2452
|
changed = true;
|
|
2462
2453
|
}
|
|
2463
2454
|
const mcp = await readJsonStrict(mcpPath);
|
|
@@ -2467,7 +2458,7 @@ async function uninstall(projectDir) {
|
|
|
2467
2458
|
const updated = { ...mcp, mcpServers: rest };
|
|
2468
2459
|
if (Object.keys(rest).length === 0) delete updated.mcpServers;
|
|
2469
2460
|
if (Object.keys(updated).length === 0) {
|
|
2470
|
-
await
|
|
2461
|
+
await fs5.unlink(mcpPath);
|
|
2471
2462
|
} else {
|
|
2472
2463
|
await writeJson(mcpPath, updated);
|
|
2473
2464
|
}
|
|
@@ -2477,12 +2468,12 @@ async function uninstall(projectDir) {
|
|
|
2477
2468
|
async function detectInstall(projectDir) {
|
|
2478
2469
|
const dir = pluginDir(projectDir);
|
|
2479
2470
|
const settings = await readJsonStrict(
|
|
2480
|
-
|
|
2471
|
+
path35__default.join(projectDir, ".claude", "settings.json")
|
|
2481
2472
|
);
|
|
2482
|
-
if (existsSync(
|
|
2473
|
+
if (existsSync(path35__default.join(dir, ".claude-plugin", "plugin.json")) && settings?.plugins?.includes(dir)) {
|
|
2483
2474
|
return { method: "plugin", pluginPath: dir };
|
|
2484
2475
|
}
|
|
2485
|
-
const mcp = await readJsonStrict(
|
|
2476
|
+
const mcp = await readJsonStrict(path35__default.join(projectDir, ".claude", "mcp.json"));
|
|
2486
2477
|
if (mcp?.mcpServers && SKAILE_MCP_NAME in mcp.mcpServers) {
|
|
2487
2478
|
return { method: "mcp" };
|
|
2488
2479
|
}
|
|
@@ -2491,7 +2482,7 @@ async function detectInstall(projectDir) {
|
|
|
2491
2482
|
async function enable(projectDir) {
|
|
2492
2483
|
const detected = await detectInstall(projectDir);
|
|
2493
2484
|
if (!detected) throw new Error("plugin not installed for claude-code");
|
|
2494
|
-
const settingsPath =
|
|
2485
|
+
const settingsPath = path35__default.join(projectDir, ".claude", "settings.json");
|
|
2495
2486
|
const settings = await readJsonStrict(settingsPath) ?? {};
|
|
2496
2487
|
if (detected.method === "plugin") {
|
|
2497
2488
|
const disabled2 = settings.disabledPlugins ?? [];
|
|
@@ -2513,7 +2504,7 @@ async function enable(projectDir) {
|
|
|
2513
2504
|
async function disable(projectDir) {
|
|
2514
2505
|
const detected = await detectInstall(projectDir);
|
|
2515
2506
|
if (!detected) throw new Error("plugin not installed for claude-code");
|
|
2516
|
-
const settingsPath =
|
|
2507
|
+
const settingsPath = path35__default.join(projectDir, ".claude", "settings.json");
|
|
2517
2508
|
const settings = await readJsonStrict(settingsPath) ?? {};
|
|
2518
2509
|
if (detected.method === "plugin") {
|
|
2519
2510
|
const list2 = settings.disabledPlugins ?? [];
|
|
@@ -2533,12 +2524,12 @@ async function disable(projectDir) {
|
|
|
2533
2524
|
return { changed: true };
|
|
2534
2525
|
}
|
|
2535
2526
|
async function status(projectDir) {
|
|
2536
|
-
const settingsPath =
|
|
2537
|
-
const mcpPath =
|
|
2527
|
+
const settingsPath = path35__default.join(projectDir, ".claude", "settings.json");
|
|
2528
|
+
const mcpPath = path35__default.join(projectDir, ".claude", "mcp.json");
|
|
2538
2529
|
const dir = pluginDir(projectDir);
|
|
2539
2530
|
const settings = await readJsonStrict(settingsPath);
|
|
2540
2531
|
const mcp = await readJsonStrict(mcpPath);
|
|
2541
|
-
const pluginInstalled = !!(existsSync(
|
|
2532
|
+
const pluginInstalled = !!(existsSync(path35__default.join(dir, ".claude-plugin", "plugin.json")) && settings?.plugins?.includes(dir));
|
|
2542
2533
|
const mcpInstalled = !!(mcp?.mcpServers && SKAILE_MCP_NAME in mcp.mcpServers);
|
|
2543
2534
|
if (!pluginInstalled && !mcpInstalled) {
|
|
2544
2535
|
return {
|
|
@@ -2556,7 +2547,7 @@ async function status(projectDir) {
|
|
|
2556
2547
|
installed: "yes",
|
|
2557
2548
|
enabled: disabled2 ? "no" : "yes",
|
|
2558
2549
|
method: "plugin",
|
|
2559
|
-
location:
|
|
2550
|
+
location: path35__default.relative(projectDir, dir)
|
|
2560
2551
|
};
|
|
2561
2552
|
}
|
|
2562
2553
|
const disabled = settings?.disabledMcpjsonServers?.includes(SKAILE_MCP_NAME) ?? false;
|
|
@@ -2565,7 +2556,7 @@ async function status(projectDir) {
|
|
|
2565
2556
|
installed: "yes",
|
|
2566
2557
|
enabled: disabled ? "no" : "yes",
|
|
2567
2558
|
method: "mcp",
|
|
2568
|
-
location:
|
|
2559
|
+
location: path35__default.relative(projectDir, mcpPath)
|
|
2569
2560
|
};
|
|
2570
2561
|
}
|
|
2571
2562
|
var SKAILE_MCP_NAME2 = "skaile-workspace";
|
|
@@ -2579,7 +2570,7 @@ function buildEntry(projectDir) {
|
|
|
2579
2570
|
async function readConfig(p7) {
|
|
2580
2571
|
let raw;
|
|
2581
2572
|
try {
|
|
2582
|
-
raw = await
|
|
2573
|
+
raw = await fs5.readFile(p7, "utf-8");
|
|
2583
2574
|
} catch {
|
|
2584
2575
|
return null;
|
|
2585
2576
|
}
|
|
@@ -2592,16 +2583,16 @@ async function readConfig(p7) {
|
|
|
2592
2583
|
}
|
|
2593
2584
|
}
|
|
2594
2585
|
async function writeConfig(p7, value) {
|
|
2595
|
-
await
|
|
2586
|
+
await fs5.mkdir(path35__default.dirname(p7), { recursive: true });
|
|
2596
2587
|
const cleaned = {};
|
|
2597
2588
|
for (const [k, v] of Object.entries(value)) {
|
|
2598
2589
|
if (v === void 0) continue;
|
|
2599
2590
|
cleaned[k] = v;
|
|
2600
2591
|
}
|
|
2601
|
-
await
|
|
2592
|
+
await fs5.writeFile(p7, stringify$1(cleaned));
|
|
2602
2593
|
}
|
|
2603
2594
|
function configPath(projectDir) {
|
|
2604
|
-
return
|
|
2595
|
+
return path35__default.join(projectDir, ".codex", "config.toml");
|
|
2605
2596
|
}
|
|
2606
2597
|
async function install2(projectDir) {
|
|
2607
2598
|
const p7 = configPath(projectDir);
|
|
@@ -2612,7 +2603,7 @@ async function install2(projectDir) {
|
|
|
2612
2603
|
const matches = previous && JSON.stringify(previous) === JSON.stringify(next);
|
|
2613
2604
|
let warning;
|
|
2614
2605
|
if (previous && !matches) {
|
|
2615
|
-
warning = `overwrote existing ${SKAILE_MCP_NAME2} entry in ${
|
|
2606
|
+
warning = `overwrote existing ${SKAILE_MCP_NAME2} entry in ${path35__default.relative(projectDir, p7)}`;
|
|
2616
2607
|
}
|
|
2617
2608
|
if (matches) return { changed: false, method: "toml" };
|
|
2618
2609
|
servers[SKAILE_MCP_NAME2] = next;
|
|
@@ -2629,7 +2620,7 @@ async function uninstall2(projectDir) {
|
|
|
2629
2620
|
const updated = { ...cfg, mcp_servers: rest };
|
|
2630
2621
|
if (Object.keys(rest).length === 0) delete updated.mcp_servers;
|
|
2631
2622
|
if (Object.keys(updated).length === 0) {
|
|
2632
|
-
await
|
|
2623
|
+
await fs5.unlink(p7);
|
|
2633
2624
|
} else {
|
|
2634
2625
|
await writeConfig(p7, updated);
|
|
2635
2626
|
}
|
|
@@ -2653,43 +2644,43 @@ async function status2(projectDir) {
|
|
|
2653
2644
|
installed: "yes",
|
|
2654
2645
|
enabled: "n/a",
|
|
2655
2646
|
method: "mcp",
|
|
2656
|
-
location:
|
|
2647
|
+
location: path35__default.relative(projectDir, p7)
|
|
2657
2648
|
};
|
|
2658
2649
|
}
|
|
2659
2650
|
async function install3(projectDir) {
|
|
2660
|
-
const extDir =
|
|
2661
|
-
const extPath =
|
|
2662
|
-
await
|
|
2651
|
+
const extDir = path35__default.join(projectDir, ".omp", "extensions");
|
|
2652
|
+
const extPath = path35__default.join(extDir, "skaile.ts");
|
|
2653
|
+
await fs5.mkdir(extDir, { recursive: true });
|
|
2663
2654
|
const { WorkspacePlugin } = await import('../workspace-plugin/index.js');
|
|
2664
2655
|
const plugin = new WorkspacePlugin({ projectDir });
|
|
2665
2656
|
const nextSrc = await plugin.buildOmpExtensionSource();
|
|
2666
2657
|
let prevSrc = null;
|
|
2667
2658
|
try {
|
|
2668
|
-
prevSrc = await
|
|
2659
|
+
prevSrc = await fs5.readFile(extPath, "utf-8");
|
|
2669
2660
|
} catch {
|
|
2670
2661
|
}
|
|
2671
2662
|
if (prevSrc === nextSrc) return { changed: false, method: "generated" };
|
|
2672
|
-
await
|
|
2663
|
+
await fs5.writeFile(extPath, nextSrc);
|
|
2673
2664
|
return { changed: true, method: "generated" };
|
|
2674
2665
|
}
|
|
2675
2666
|
async function uninstall3(projectDir) {
|
|
2676
|
-
const extPath =
|
|
2667
|
+
const extPath = path35__default.join(projectDir, ".omp", "extensions", "skaile.ts");
|
|
2677
2668
|
try {
|
|
2678
|
-
await
|
|
2669
|
+
await fs5.unlink(extPath);
|
|
2679
2670
|
return { changed: true };
|
|
2680
2671
|
} catch {
|
|
2681
2672
|
return { changed: false };
|
|
2682
2673
|
}
|
|
2683
2674
|
}
|
|
2684
2675
|
async function status3(projectDir) {
|
|
2685
|
-
const extPath =
|
|
2676
|
+
const extPath = path35__default.join(projectDir, ".omp", "extensions", "skaile.ts");
|
|
2686
2677
|
if (existsSync(extPath)) {
|
|
2687
2678
|
return {
|
|
2688
2679
|
backend: "omp",
|
|
2689
2680
|
installed: "yes",
|
|
2690
2681
|
enabled: "n/a",
|
|
2691
2682
|
method: "extension",
|
|
2692
|
-
location:
|
|
2683
|
+
location: path35__default.relative(projectDir, extPath)
|
|
2693
2684
|
};
|
|
2694
2685
|
}
|
|
2695
2686
|
return {
|
|
@@ -2752,7 +2743,7 @@ async function installCodex(projectDir) {
|
|
|
2752
2743
|
console.log(` ${S.dim("\u2192")} Restart Codex CLI to pick up the change.`);
|
|
2753
2744
|
}
|
|
2754
2745
|
async function runInstall(opts) {
|
|
2755
|
-
const projectDir =
|
|
2746
|
+
const projectDir = path35__default.resolve(opts.projectDir);
|
|
2756
2747
|
const targets = resolveDriver(opts.driver);
|
|
2757
2748
|
let exitCode = 0;
|
|
2758
2749
|
if (targets.includes("claude-code")) {
|
|
@@ -2786,7 +2777,7 @@ async function uninstallCodex(projectDir) {
|
|
|
2786
2777
|
else logInfo(`codex: not installed`);
|
|
2787
2778
|
}
|
|
2788
2779
|
async function runUninstall(opts) {
|
|
2789
|
-
const projectDir =
|
|
2780
|
+
const projectDir = path35__default.resolve(opts.projectDir);
|
|
2790
2781
|
const targets = resolveDriver(opts.driver);
|
|
2791
2782
|
let exitCode = 0;
|
|
2792
2783
|
if (targets.includes("claude-code")) {
|
|
@@ -2829,7 +2820,7 @@ async function toggleTarget(t, projectDir, action3) {
|
|
|
2829
2820
|
});
|
|
2830
2821
|
}
|
|
2831
2822
|
async function runToggle(opts, action3) {
|
|
2832
|
-
const projectDir =
|
|
2823
|
+
const projectDir = path35__default.resolve(opts.projectDir);
|
|
2833
2824
|
const requestedAll = opts.driver === "all";
|
|
2834
2825
|
const targets = resolveDriver(opts.driver);
|
|
2835
2826
|
const usageError = checkToggleSupported(targets, requestedAll, action3);
|
|
@@ -2841,7 +2832,7 @@ async function runToggle(opts, action3) {
|
|
|
2841
2832
|
return exitCode;
|
|
2842
2833
|
}
|
|
2843
2834
|
async function runStatus2(opts) {
|
|
2844
|
-
const projectDir =
|
|
2835
|
+
const projectDir = path35__default.resolve(opts.projectDir);
|
|
2845
2836
|
const targets = resolveDriver(opts.driver);
|
|
2846
2837
|
const rows = [];
|
|
2847
2838
|
let exitCode = 0;
|
|
@@ -2912,7 +2903,7 @@ async function runHook(event) {
|
|
|
2912
2903
|
await plugin.shutdown();
|
|
2913
2904
|
return;
|
|
2914
2905
|
}
|
|
2915
|
-
const store = new PluginStore(
|
|
2906
|
+
const store = new PluginStore(path35__default.join(projectDir, ".skaile", "plugin-state.json"));
|
|
2916
2907
|
await store.load();
|
|
2917
2908
|
const status4 = store.get("connector:status");
|
|
2918
2909
|
if (status4 && typeof status4 === "object" && Object.keys(status4).length > 0) {
|
|
@@ -2988,10 +2979,10 @@ async function indexLibrary(lib, index) {
|
|
|
2988
2979
|
}
|
|
2989
2980
|
}
|
|
2990
2981
|
function domainPublisher(libraryPath, domain) {
|
|
2991
|
-
const domainFile =
|
|
2992
|
-
if (!
|
|
2982
|
+
const domainFile = path35.join(libraryPath, domain, "DOMAIN.md");
|
|
2983
|
+
if (!fs12.existsSync(domainFile)) return void 0;
|
|
2993
2984
|
try {
|
|
2994
|
-
const { data } = parseFrontmatter(
|
|
2985
|
+
const { data } = parseFrontmatter(fs12.readFileSync(domainFile, "utf8"));
|
|
2995
2986
|
const pub = data.publisher;
|
|
2996
2987
|
return typeof pub === "string" && pub.trim() ? pub.trim() : void 0;
|
|
2997
2988
|
} catch {
|
|
@@ -3071,12 +3062,12 @@ function makeLibraryCommand() {
|
|
|
3071
3062
|
cmd.command("init <name>").description("Create a new local library at ~/.skaile/libraries/<name>").option("--git <url>", "Initialize as a git library tracking <url>").option("--owner", "Mark as owner (default for local)").option("--contributor", "Mark as contributor").option("--reader", "Mark as reader").action(
|
|
3072
3063
|
async (name, opts) => {
|
|
3073
3064
|
const libDir = resolveLibraryDir();
|
|
3074
|
-
const libPath =
|
|
3065
|
+
const libPath = path35.join(libDir, name);
|
|
3075
3066
|
const ownership = opts.contributor ? "contributor" : opts.reader ? "reader" : "owner";
|
|
3076
3067
|
const { manager, close } = await openLibraryManager();
|
|
3077
3068
|
try {
|
|
3078
3069
|
if (opts.git) {
|
|
3079
|
-
|
|
3070
|
+
fs12.mkdirSync(libPath, { recursive: true });
|
|
3080
3071
|
await manager.addLibrary({
|
|
3081
3072
|
name,
|
|
3082
3073
|
path: libPath,
|
|
@@ -3085,7 +3076,7 @@ function makeLibraryCommand() {
|
|
|
3085
3076
|
ownership
|
|
3086
3077
|
});
|
|
3087
3078
|
} else {
|
|
3088
|
-
|
|
3079
|
+
fs12.mkdirSync(libPath, { recursive: true });
|
|
3089
3080
|
await manager.addLibrary({
|
|
3090
3081
|
name,
|
|
3091
3082
|
path: libPath,
|
|
@@ -3143,21 +3134,21 @@ function makeLibraryCommand() {
|
|
|
3143
3134
|
}
|
|
3144
3135
|
const effectiveKind = opts.kind ?? kind;
|
|
3145
3136
|
const am2 = new AssetManager({ projectDir: process.cwd() });
|
|
3146
|
-
const destDir = opts.dir ?
|
|
3137
|
+
const destDir = opts.dir ? path35.join(target.path, opts.dir) : target.path;
|
|
3147
3138
|
const res = am2.create(name, effectiveKind, destDir);
|
|
3148
3139
|
if (!res.ok) {
|
|
3149
3140
|
logErr(res.path);
|
|
3150
3141
|
process.exit(1);
|
|
3151
3142
|
}
|
|
3152
3143
|
logOk(`Created ${effectiveKind}: ${pc5.dim(res.path)}`);
|
|
3153
|
-
const domain2 = opts.dir ? opts.dir.split(
|
|
3144
|
+
const domain2 = opts.dir ? opts.dir.split(path35.sep)[0] : void 0;
|
|
3154
3145
|
const publisher = resolveLibraryPublisher(target, opts, domain2, getStoreIdentity());
|
|
3155
3146
|
stampAssetPublisher(res.path, publisher);
|
|
3156
3147
|
ensureManifestPublisher(target.path, publisher);
|
|
3157
3148
|
upsertManifestAsset(target.path, {
|
|
3158
3149
|
kind: effectiveKind,
|
|
3159
3150
|
name,
|
|
3160
|
-
root:
|
|
3151
|
+
root: path35.relative(target.path, res.path) || name,
|
|
3161
3152
|
version: "0.1.0"
|
|
3162
3153
|
});
|
|
3163
3154
|
const idx = await indexLibrary(target, library);
|
|
@@ -3232,12 +3223,12 @@ function makeLibraryCommand() {
|
|
|
3232
3223
|
const { manager, close } = await openLibraryManager();
|
|
3233
3224
|
try {
|
|
3234
3225
|
const target = await resolveTargetLibrary(manager, opts.library);
|
|
3235
|
-
const domainFile =
|
|
3226
|
+
const domainFile = path35.join(target.path, name, "DOMAIN.md");
|
|
3236
3227
|
if (!existsSync(domainFile)) {
|
|
3237
3228
|
logErr(`Domain "${name}" not found in "${target.name}" (no ${domainFile}).`);
|
|
3238
3229
|
process.exit(1);
|
|
3239
3230
|
}
|
|
3240
|
-
console.log(
|
|
3231
|
+
console.log(fs12.readFileSync(domainFile, "utf8"));
|
|
3241
3232
|
} finally {
|
|
3242
3233
|
close();
|
|
3243
3234
|
}
|
|
@@ -3255,13 +3246,13 @@ function makeLibraryCommand() {
|
|
|
3255
3246
|
const { manager, close } = await openLibraryManager();
|
|
3256
3247
|
try {
|
|
3257
3248
|
const lib = await manager.requireLibrary(oldName);
|
|
3258
|
-
const parent =
|
|
3259
|
-
const newPath =
|
|
3260
|
-
if (
|
|
3249
|
+
const parent = path35.dirname(lib.path);
|
|
3250
|
+
const newPath = path35.join(parent, newName);
|
|
3251
|
+
if (fs12.existsSync(newPath)) {
|
|
3261
3252
|
logErr(`Target directory already exists: ${newPath}`);
|
|
3262
3253
|
process.exit(1);
|
|
3263
3254
|
}
|
|
3264
|
-
|
|
3255
|
+
fs12.renameSync(lib.path, newPath);
|
|
3265
3256
|
await manager.updateLibrary(lib.id, { name: newName, path: newPath });
|
|
3266
3257
|
logOk(`Renamed ${oldName} \u2192 ${newName}`);
|
|
3267
3258
|
} finally {
|
|
@@ -3416,16 +3407,16 @@ function makeLibraryCommand() {
|
|
|
3416
3407
|
});
|
|
3417
3408
|
cmd.command("publish <lib>").description("Push + register the library's manifest atomically (needs git backend)").option("--asset <ref>", "Publish only the single asset matching this ref/name").option("--create-repo", "Provision + link a public github repo if the library has no remote").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(
|
|
3418
3409
|
async (lib, opts) => {
|
|
3419
|
-
const { runLibraryPublish } = await import('../library-publish-
|
|
3410
|
+
const { runLibraryPublish } = await import('../library-publish-TCT652H4.js');
|
|
3420
3411
|
await withStoreErrorHandling(() => runLibraryPublish(lib, opts));
|
|
3421
3412
|
}
|
|
3422
3413
|
);
|
|
3423
3414
|
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) => {
|
|
3424
|
-
const { runLibraryRegister } = await import('../library-publish-
|
|
3415
|
+
const { runLibraryRegister } = await import('../library-publish-TCT652H4.js');
|
|
3425
3416
|
await withStoreErrorHandling(() => runLibraryRegister(lib, opts));
|
|
3426
3417
|
});
|
|
3427
3418
|
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) => {
|
|
3428
|
-
const { runLibraryYank } = await import('../library-publish-
|
|
3419
|
+
const { runLibraryYank } = await import('../library-publish-TCT652H4.js');
|
|
3429
3420
|
await withStoreErrorHandling(() => runLibraryYank(lib, opts));
|
|
3430
3421
|
});
|
|
3431
3422
|
return cmd;
|
|
@@ -3442,24 +3433,24 @@ function stampAssetPublisher(assetDir, publisher) {
|
|
|
3442
3433
|
const markers = ["SKILL.md", "AGENT.md", "CONTRACT.md"];
|
|
3443
3434
|
let markerFile;
|
|
3444
3435
|
for (const m of markers) {
|
|
3445
|
-
if (
|
|
3446
|
-
markerFile =
|
|
3436
|
+
if (fs12.existsSync(path35.join(assetDir, m))) {
|
|
3437
|
+
markerFile = path35.join(assetDir, m);
|
|
3447
3438
|
break;
|
|
3448
3439
|
}
|
|
3449
3440
|
}
|
|
3450
3441
|
if (!markerFile) {
|
|
3451
|
-
const promptMd =
|
|
3452
|
-
if (promptMd) markerFile =
|
|
3442
|
+
const promptMd = fs12.readdirSync(assetDir).find((f) => f.endsWith(".prompt.md"));
|
|
3443
|
+
if (promptMd) markerFile = path35.join(assetDir, promptMd);
|
|
3453
3444
|
}
|
|
3454
3445
|
if (!markerFile) return;
|
|
3455
3446
|
try {
|
|
3456
|
-
const { data, body } = parseFrontmatter(
|
|
3447
|
+
const { data, body } = parseFrontmatter(fs12.readFileSync(markerFile, "utf8"));
|
|
3457
3448
|
const meta = data.metadata && typeof data.metadata === "object" && !Array.isArray(data.metadata) ? { ...data.metadata } : {};
|
|
3458
3449
|
if (meta.publisher != null) return;
|
|
3459
3450
|
meta.publisher = publisher;
|
|
3460
3451
|
data.metadata = meta;
|
|
3461
3452
|
const fm = stringify(data).trimEnd();
|
|
3462
|
-
|
|
3453
|
+
fs12.writeFileSync(markerFile, `---
|
|
3463
3454
|
${fm}
|
|
3464
3455
|
---
|
|
3465
3456
|
|
|
@@ -3476,7 +3467,7 @@ function ensureManifestPublisher(libraryPath, publisher) {
|
|
|
3476
3467
|
async function syncManifestWithDisk(libraryPath, libraryName) {
|
|
3477
3468
|
const publisher = loadSkPublishManifest(libraryPath)?.publisher ?? slugifyAssetName(libraryName);
|
|
3478
3469
|
for (const e of await scanDirectory(libraryPath, publisher)) {
|
|
3479
|
-
const root =
|
|
3470
|
+
const root = path35.relative(libraryPath, path35.dirname(e.source)) || e.name;
|
|
3480
3471
|
upsertManifestAsset(libraryPath, { kind: e.kind, name: e.name, root, version: e.version });
|
|
3481
3472
|
}
|
|
3482
3473
|
}
|
|
@@ -3518,9 +3509,9 @@ async function printOverallStatus(projectDir, asJson) {
|
|
|
3518
3509
|
} catch {
|
|
3519
3510
|
secretsStrategy = "unavailable";
|
|
3520
3511
|
}
|
|
3521
|
-
const resolvedProjectDir =
|
|
3522
|
-
const hasWorkspaceConfig = existsSync(
|
|
3523
|
-
const hasLockFile = existsSync(
|
|
3512
|
+
const resolvedProjectDir = path35.resolve(projectDir);
|
|
3513
|
+
const hasWorkspaceConfig = existsSync(path35.join(resolvedProjectDir, "skaile.yaml"));
|
|
3514
|
+
const hasLockFile = existsSync(path35.join(resolvedProjectDir, "skaile.lock.yaml"));
|
|
3524
3515
|
let assignments = [];
|
|
3525
3516
|
if (hasWorkspaceConfig) {
|
|
3526
3517
|
try {
|
|
@@ -4147,7 +4138,7 @@ function scheduleSoftDepPreview() {
|
|
|
4147
4138
|
}
|
|
4148
4139
|
async function loadAssets() {
|
|
4149
4140
|
softDepPreviewCache.clear();
|
|
4150
|
-
const { gatherAssetFeeds } = await import('../asset-feeds-
|
|
4141
|
+
const { gatherAssetFeeds } = await import('../asset-feeds-CBY723RG.js');
|
|
4151
4142
|
const { entries, domains, notes } = await gatherAssetFeeds(am, am.projectDir);
|
|
4152
4143
|
if (notes.length > 0) {
|
|
4153
4144
|
state.message = notes.map((n) => `[${n.feed}] ${n.message}`).join(" \u2022 ");
|
|
@@ -4169,7 +4160,7 @@ function rebuildSourceTree() {
|
|
|
4169
4160
|
rebuildVisibleSources();
|
|
4170
4161
|
}
|
|
4171
4162
|
function sourceOrgRepo(s) {
|
|
4172
|
-
const parts = s.path.split(
|
|
4163
|
+
const parts = s.path.split(path35__default.sep).filter(Boolean);
|
|
4173
4164
|
if (parts.length < 2) return null;
|
|
4174
4165
|
return { org: parts[parts.length - 2], repo: parts[parts.length - 1] };
|
|
4175
4166
|
}
|
|
@@ -4353,14 +4344,14 @@ function reconcileCollapsedSets(rows) {
|
|
|
4353
4344
|
async function loadSourcesAndLibraries() {
|
|
4354
4345
|
try {
|
|
4355
4346
|
const [{ openLibraryManager: openLibraryManager2 }, { skaileHomeDir }, { getGlobalCacheDir: getGlobalCacheDir2 }] = await Promise.all([
|
|
4356
|
-
import('../open-library-
|
|
4347
|
+
import('../open-library-6OSZX2O6.js'),
|
|
4357
4348
|
import('../library/index.js'),
|
|
4358
4349
|
import('../core/index.js')
|
|
4359
4350
|
]);
|
|
4360
4351
|
const { manager, library, close } = await openLibraryManager2();
|
|
4361
4352
|
try {
|
|
4362
4353
|
const newRoot = getGlobalCacheDir2();
|
|
4363
|
-
const legacyRoot =
|
|
4354
|
+
const legacyRoot = path35__default.join(skaileHomeDir(), "sources");
|
|
4364
4355
|
const isSourceRow = (l) => l.path.startsWith(newRoot) || l.path.startsWith(legacyRoot);
|
|
4365
4356
|
const libs = await manager.listLibraries();
|
|
4366
4357
|
const defs = await library.listAssetDefs();
|
|
@@ -5420,13 +5411,13 @@ async function run(projectDir) {
|
|
|
5420
5411
|
}
|
|
5421
5412
|
function makeManageCommand() {
|
|
5422
5413
|
return new Command("manage").description("Interactive TUI for managing assets, sources, and libraries").option("--project-dir <path>", "Project directory", process.cwd()).action(async (opts) => {
|
|
5423
|
-
await run(
|
|
5414
|
+
await run(path35__default.resolve(opts.projectDir));
|
|
5424
5415
|
});
|
|
5425
5416
|
}
|
|
5426
5417
|
function makeMcpServerCommand() {
|
|
5427
5418
|
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) => {
|
|
5428
|
-
const
|
|
5429
|
-
const projectDir =
|
|
5419
|
+
const path38 = await import('path');
|
|
5420
|
+
const projectDir = path38.default.resolve(opts.projectDir);
|
|
5430
5421
|
const { LogStore, StdoutSink, registerLogStore } = await import('../core/logging.js');
|
|
5431
5422
|
registerLogStore(
|
|
5432
5423
|
new LogStore({
|
|
@@ -5463,8 +5454,8 @@ function makeNpxCommand() {
|
|
|
5463
5454
|
skills.command("add <url>").description(
|
|
5464
5455
|
"Clone a repo, register it in the project's skaile.yaml sources[], and install a skill from it"
|
|
5465
5456
|
).requiredOption("--skill <name>", "Skill name to install from the repo").option("--project-dir <path>", "Project directory", process.cwd()).option("--target <agent>", "Agent framework", "claude-code").option("--global", "Deploy globally").action(async (url, opts) => {
|
|
5466
|
-
const projectDir =
|
|
5467
|
-
const projYaml =
|
|
5457
|
+
const projectDir = path35__default.resolve(opts.projectDir);
|
|
5458
|
+
const projYaml = path35__default.join(projectDir, "skaile.yaml");
|
|
5468
5459
|
if (!existsSync(projYaml)) {
|
|
5469
5460
|
logErr(`No skaile.yaml in ${projectDir} \u2014 run \`skaile init\` first.`);
|
|
5470
5461
|
process.exit(1);
|
|
@@ -5477,11 +5468,11 @@ function makeNpxCommand() {
|
|
|
5477
5468
|
}
|
|
5478
5469
|
const spinner4 = p5.spinner();
|
|
5479
5470
|
const key = sourceCacheKey(url);
|
|
5480
|
-
const clonePath =
|
|
5471
|
+
const clonePath = path35__default.join(getGlobalCacheDir(), key);
|
|
5481
5472
|
spinner4.start(`Cloning ${url}`);
|
|
5482
5473
|
try {
|
|
5483
5474
|
if (!existsSync(clonePath)) {
|
|
5484
|
-
mkdirSync(
|
|
5475
|
+
mkdirSync(path35__default.dirname(clonePath), { recursive: true });
|
|
5485
5476
|
execSync(`git clone ${url} ${clonePath}`, { stdio: "ignore" });
|
|
5486
5477
|
}
|
|
5487
5478
|
spinner4.stop(`Cloned to ${key}`);
|
|
@@ -5527,7 +5518,7 @@ function makeNpxCommand() {
|
|
|
5527
5518
|
return npx;
|
|
5528
5519
|
}
|
|
5529
5520
|
function resolvePublisher(clonePath, url) {
|
|
5530
|
-
const manifestPath =
|
|
5521
|
+
const manifestPath = path35__default.join(clonePath, SKAILE_MANIFEST_FILENAME);
|
|
5531
5522
|
if (existsSync(manifestPath)) {
|
|
5532
5523
|
try {
|
|
5533
5524
|
const { manifest } = decodeSkaileManifest(readFileSync(manifestPath, "utf8"));
|
|
@@ -5540,12 +5531,12 @@ function resolvePublisher(clonePath, url) {
|
|
|
5540
5531
|
return url.match(/github\.com[/:]([^/]+)\/[^/]+/)?.[1];
|
|
5541
5532
|
}
|
|
5542
5533
|
function resolveSkillName(clonePath, requested) {
|
|
5543
|
-
const skillsDir =
|
|
5544
|
-
if (existsSync(
|
|
5534
|
+
const skillsDir = path35__default.join(clonePath, "skills");
|
|
5535
|
+
if (existsSync(path35__default.join(skillsDir, requested, "SKILL.md"))) return requested;
|
|
5545
5536
|
if (!existsSync(skillsDir)) return requested;
|
|
5546
5537
|
for (const entry of readdirSync(skillsDir, { withFileTypes: true })) {
|
|
5547
5538
|
if (!entry.isDirectory()) continue;
|
|
5548
|
-
const md =
|
|
5539
|
+
const md = path35__default.join(skillsDir, entry.name, "SKILL.md");
|
|
5549
5540
|
if (!existsSync(md)) continue;
|
|
5550
5541
|
try {
|
|
5551
5542
|
const { data } = parseFrontmatter(readFileSync(md, "utf8"));
|
|
@@ -5560,7 +5551,7 @@ function makeOutdatedCommand() {
|
|
|
5560
5551
|
new Option("--target <agent>", "Driver target").default("claude-code").choices(SUPPORTED_DRIVER_TARGETS)
|
|
5561
5552
|
).action((name, opts) => {
|
|
5562
5553
|
const am2 = new AssetManager({
|
|
5563
|
-
projectDir:
|
|
5554
|
+
projectDir: path35__default.resolve(opts.projectDir),
|
|
5564
5555
|
driverTarget: opts.target
|
|
5565
5556
|
});
|
|
5566
5557
|
const entries = am2.outdated();
|
|
@@ -5589,7 +5580,7 @@ function makeOutdatedCommand() {
|
|
|
5589
5580
|
function makePatchCommand() {
|
|
5590
5581
|
const cmd = new Command("patch").description("Patch workflow for skill improvement");
|
|
5591
5582
|
cmd.command("extract <ref>").alias("start").description("Extract asset for local editing").option("--project-dir <path>", "Project directory", process.cwd()).action(async (ref, opts) => {
|
|
5592
|
-
const am2 = new AssetManager({ projectDir:
|
|
5583
|
+
const am2 = new AssetManager({ projectDir: path35__default.resolve(opts.projectDir) });
|
|
5593
5584
|
try {
|
|
5594
5585
|
const dest = await am2.patch(ref);
|
|
5595
5586
|
logOk(`Extracted to ${S.dim(dest)}`);
|
|
@@ -5600,7 +5591,7 @@ function makePatchCommand() {
|
|
|
5600
5591
|
}
|
|
5601
5592
|
});
|
|
5602
5593
|
cmd.command("commit <ref>").description("Generate .patch file from edits").option("--project-dir <path>", "Project directory", process.cwd()).action(async (ref, opts) => {
|
|
5603
|
-
const am2 = new AssetManager({ projectDir:
|
|
5594
|
+
const am2 = new AssetManager({ projectDir: path35__default.resolve(opts.projectDir) });
|
|
5604
5595
|
try {
|
|
5605
5596
|
const patchFile = await am2.patchCommit(ref);
|
|
5606
5597
|
logOk(`Patch saved to ${S.dim(patchFile)}`);
|
|
@@ -5611,7 +5602,7 @@ function makePatchCommand() {
|
|
|
5611
5602
|
}
|
|
5612
5603
|
});
|
|
5613
5604
|
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) => {
|
|
5614
|
-
const am2 = new AssetManager({ projectDir:
|
|
5605
|
+
const am2 = new AssetManager({ projectDir: path35__default.resolve(opts.projectDir) });
|
|
5615
5606
|
try {
|
|
5616
5607
|
await am2.patchSubmit(ref);
|
|
5617
5608
|
logOk("Patch applied to repo clone and committed.");
|
|
@@ -5624,7 +5615,7 @@ function makePatchCommand() {
|
|
|
5624
5615
|
}
|
|
5625
5616
|
});
|
|
5626
5617
|
cmd.command("remove <ref>").description("Remove local patch after upstream merge").option("--project-dir <path>", "Project directory", process.cwd()).action((ref, opts) => {
|
|
5627
|
-
const am2 = new AssetManager({ projectDir:
|
|
5618
|
+
const am2 = new AssetManager({ projectDir: path35__default.resolve(opts.projectDir) });
|
|
5628
5619
|
am2.patchRemove(ref);
|
|
5629
5620
|
logOk(`Patch removed for ${ref}`);
|
|
5630
5621
|
});
|
|
@@ -5642,7 +5633,7 @@ function action2(fn) {
|
|
|
5642
5633
|
};
|
|
5643
5634
|
}
|
|
5644
5635
|
async function reconcileAndReport(projectDir, plugins) {
|
|
5645
|
-
const { reconcilePlugins } = await import('../plugin-store-
|
|
5636
|
+
const { reconcilePlugins } = await import('../plugin-store-3BYOBKYT.js');
|
|
5646
5637
|
if (plugins.length === 0) {
|
|
5647
5638
|
logInfo("No plugins declared \u2014 nothing to reconcile.");
|
|
5648
5639
|
return;
|
|
@@ -5656,10 +5647,10 @@ async function reconcileAndReport(projectDir, plugins) {
|
|
|
5656
5647
|
}
|
|
5657
5648
|
}
|
|
5658
5649
|
async function runInstall2(spec, opts) {
|
|
5659
|
-
const projectDir =
|
|
5650
|
+
const projectDir = path35__default.resolve(opts.projectDir);
|
|
5660
5651
|
const { WorkspaceYamlEditor: WorkspaceYamlEditor2 } = await import('../core/index.js');
|
|
5661
|
-
const { specName } = await import('../plugin-store-
|
|
5662
|
-
const yamlPath =
|
|
5652
|
+
const { specName } = await import('../plugin-store-3BYOBKYT.js');
|
|
5653
|
+
const yamlPath = path35__default.join(projectDir, "skaile.yaml");
|
|
5663
5654
|
const editor = WorkspaceYamlEditor2.load(yamlPath);
|
|
5664
5655
|
const replaced = editor.addPlugin(spec, specName);
|
|
5665
5656
|
editor.save();
|
|
@@ -5668,10 +5659,10 @@ async function runInstall2(spec, opts) {
|
|
|
5668
5659
|
await reconcileAndReport(projectDir, editor.getPlugins());
|
|
5669
5660
|
}
|
|
5670
5661
|
async function runRemove(name, opts) {
|
|
5671
|
-
const projectDir =
|
|
5662
|
+
const projectDir = path35__default.resolve(opts.projectDir);
|
|
5672
5663
|
const { WorkspaceYamlEditor: WorkspaceYamlEditor2 } = await import('../core/index.js');
|
|
5673
|
-
const { specName } = await import('../plugin-store-
|
|
5674
|
-
const yamlPath =
|
|
5664
|
+
const { specName } = await import('../plugin-store-3BYOBKYT.js');
|
|
5665
|
+
const yamlPath = path35__default.join(projectDir, "skaile.yaml");
|
|
5675
5666
|
const editor = WorkspaceYamlEditor2.load(yamlPath);
|
|
5676
5667
|
const removed = editor.removePlugin(name, specName);
|
|
5677
5668
|
if (!removed) {
|
|
@@ -5683,7 +5674,7 @@ async function runRemove(name, opts) {
|
|
|
5683
5674
|
await reconcileAndReport(projectDir, editor.getPlugins());
|
|
5684
5675
|
}
|
|
5685
5676
|
async function runList(opts) {
|
|
5686
|
-
const projectDir =
|
|
5677
|
+
const projectDir = path35__default.resolve(opts.projectDir);
|
|
5687
5678
|
const { resolveSkWorkspaceConfig: resolveSkWorkspaceConfig2 } = await import('../core/index.js');
|
|
5688
5679
|
const config = resolveSkWorkspaceConfig2(projectDir);
|
|
5689
5680
|
const declared = config.plugins ?? [];
|
|
@@ -5698,7 +5689,7 @@ async function runList(opts) {
|
|
|
5698
5689
|
const registry = createPluginRegistry();
|
|
5699
5690
|
if (declared.length > 0) {
|
|
5700
5691
|
try {
|
|
5701
|
-
const { loadPlugins } = await import('../plugin-store-
|
|
5692
|
+
const { loadPlugins } = await import('../plugin-store-3BYOBKYT.js');
|
|
5702
5693
|
const result = await loadPlugins(projectDir, declared, registry);
|
|
5703
5694
|
for (const f of result.failed) logWarn(f.error);
|
|
5704
5695
|
} catch (err) {
|
|
@@ -5873,7 +5864,7 @@ function neededSources(config, lock) {
|
|
|
5873
5864
|
}
|
|
5874
5865
|
function sourcesWithSidecar(sources) {
|
|
5875
5866
|
const dir = getStoreManifestsDir();
|
|
5876
|
-
return sources.filter((s) => existsSync(
|
|
5867
|
+
return sources.filter((s) => existsSync(path35.join(dir, `${storeManifestSlug(s.url)}.yaml`))).map((s) => s.url);
|
|
5877
5868
|
}
|
|
5878
5869
|
function compact(obj) {
|
|
5879
5870
|
const out = {};
|
|
@@ -5965,8 +5956,8 @@ function redactSecrets(preset, findings) {
|
|
|
5965
5956
|
}
|
|
5966
5957
|
return { preset: next, keys };
|
|
5967
5958
|
}
|
|
5968
|
-
function placeholderKey(itemId,
|
|
5969
|
-
return `${itemId}_${
|
|
5959
|
+
function placeholderKey(itemId, path38) {
|
|
5960
|
+
return `${itemId}_${path38}`.replace(/[^a-zA-Z0-9]+/g, "_").replace(/^_+|_+$/g, "").toUpperCase();
|
|
5970
5961
|
}
|
|
5971
5962
|
function setAtPath(root, segments, value) {
|
|
5972
5963
|
let node = root;
|
|
@@ -5989,7 +5980,7 @@ function makePresetCommand() {
|
|
|
5989
5980
|
cmd.command("init [name]").description("Scaffold a new .preset.yaml file").option("--dir <path>", "Output directory", process.cwd()).action(async (name, opts) => {
|
|
5990
5981
|
const presetName = name ?? "my-preset";
|
|
5991
5982
|
const filename = `${presetName}.preset.yaml`;
|
|
5992
|
-
const outPath =
|
|
5983
|
+
const outPath = path35__default.join(path35__default.resolve(opts.dir), filename);
|
|
5993
5984
|
if (existsSync(outPath)) {
|
|
5994
5985
|
logErr(`File already exists: ${outPath}`);
|
|
5995
5986
|
logInfo("Choose a different name or remove the existing file.");
|
|
@@ -6022,7 +6013,7 @@ function makePresetCommand() {
|
|
|
6022
6013
|
return cmd;
|
|
6023
6014
|
}
|
|
6024
6015
|
async function runPresetExport(name, opts) {
|
|
6025
|
-
const projectDir =
|
|
6016
|
+
const projectDir = path35__default.resolve(opts.projectDir);
|
|
6026
6017
|
const file = loadSkWorkspaceConfig(projectDir);
|
|
6027
6018
|
if (!file) {
|
|
6028
6019
|
logErr(`No skaile.yaml found in ${projectDir}`);
|
|
@@ -6032,7 +6023,7 @@ async function runPresetExport(name, opts) {
|
|
|
6032
6023
|
const presetName = name ?? file.config.name ?? "my-preset";
|
|
6033
6024
|
let lock = null;
|
|
6034
6025
|
try {
|
|
6035
|
-
lock = readLock(
|
|
6026
|
+
lock = readLock(path35__default.join(projectDir, "skaile.lock.yaml"));
|
|
6036
6027
|
} catch {
|
|
6037
6028
|
lock = null;
|
|
6038
6029
|
}
|
|
@@ -6073,7 +6064,7 @@ async function runPresetExport(name, opts) {
|
|
|
6073
6064
|
const contents = header ? `${header}
|
|
6074
6065
|
${body}` : body;
|
|
6075
6066
|
if (opts.out && opts.dir !== process.cwd()) logWarn("--dir is ignored when --out is set.");
|
|
6076
|
-
const outPath = opts.out ?
|
|
6067
|
+
const outPath = opts.out ? path35__default.resolve(opts.out) : path35__default.join(path35__default.resolve(opts.dir), `${presetName}.preset.yaml`);
|
|
6077
6068
|
if (existsSync(outPath) && !opts.force) {
|
|
6078
6069
|
logErr(`File already exists: ${outPath}`);
|
|
6079
6070
|
logInfo("Pass --force to overwrite, or choose a different --out/--dir.");
|
|
@@ -6085,7 +6076,7 @@ ${body}` : body;
|
|
|
6085
6076
|
logErr(`Failed to write ${outPath}: ${e.message}`);
|
|
6086
6077
|
process.exit(1);
|
|
6087
6078
|
}
|
|
6088
|
-
logOk(`Exported ${S.brand(
|
|
6079
|
+
logOk(`Exported ${S.brand(path35__default.basename(outPath))}`);
|
|
6089
6080
|
logInfo(`Path: ${outPath}`);
|
|
6090
6081
|
if (unresolved.length > 0) {
|
|
6091
6082
|
console.error(S.err("This file is NOT safe to share."));
|
|
@@ -6126,13 +6117,13 @@ function collectInput(value, acc) {
|
|
|
6126
6117
|
return acc;
|
|
6127
6118
|
}
|
|
6128
6119
|
async function runPresetApply(filePath, opts) {
|
|
6129
|
-
const projectDir =
|
|
6120
|
+
const projectDir = path35__default.resolve(opts.projectDir);
|
|
6130
6121
|
const file = loadSkWorkspaceConfig(projectDir);
|
|
6131
6122
|
if (!file) {
|
|
6132
6123
|
logErr("No skaile.yaml \u2014 run `skaile init` first");
|
|
6133
6124
|
process.exit(1);
|
|
6134
6125
|
}
|
|
6135
|
-
const resolved =
|
|
6126
|
+
const resolved = path35__default.resolve(filePath);
|
|
6136
6127
|
if (!existsSync(resolved)) {
|
|
6137
6128
|
logErr(`File not found: ${resolved}`);
|
|
6138
6129
|
process.exit(1);
|
|
@@ -6348,7 +6339,7 @@ async function reportNestedPresetRefs(preset) {
|
|
|
6348
6339
|
}
|
|
6349
6340
|
async function checkPresetCycles(preset, resolved) {
|
|
6350
6341
|
const { detectCycles } = await import('../discovery/index.js');
|
|
6351
|
-
const presetRef =
|
|
6342
|
+
const presetRef = path35__default.basename(resolved, ".preset.yaml");
|
|
6352
6343
|
const edges = [];
|
|
6353
6344
|
for (const item of preset.items) {
|
|
6354
6345
|
if (item.ref) {
|
|
@@ -6400,7 +6391,7 @@ function printPresetSummary(preset, placeholderCount, hasWarnings) {
|
|
|
6400
6391
|
}
|
|
6401
6392
|
}
|
|
6402
6393
|
async function runPresetValidate(filePath) {
|
|
6403
|
-
const resolved =
|
|
6394
|
+
const resolved = path35__default.resolve(filePath);
|
|
6404
6395
|
const preset = await loadPresetForValidation(resolved);
|
|
6405
6396
|
await reportNestedPresetRefs(preset);
|
|
6406
6397
|
await checkPresetCycles(preset, resolved);
|
|
@@ -6450,14 +6441,14 @@ items:
|
|
|
6450
6441
|
}
|
|
6451
6442
|
function makeRebuildCommand() {
|
|
6452
6443
|
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) => {
|
|
6453
|
-
const projectDir =
|
|
6444
|
+
const projectDir = path35__default.resolve(opts.projectDir);
|
|
6454
6445
|
let agentDir;
|
|
6455
6446
|
if (agentArg) {
|
|
6456
6447
|
if (agentArg.includes("/") || agentArg.includes("\\")) {
|
|
6457
|
-
agentDir =
|
|
6448
|
+
agentDir = path35__default.resolve(projectDir, agentArg);
|
|
6458
6449
|
} else {
|
|
6459
6450
|
const resolved = resolveAgentDir(projectDir);
|
|
6460
|
-
agentDir = resolved ??
|
|
6451
|
+
agentDir = resolved ?? path35__default.resolve(projectDir, agentArg);
|
|
6461
6452
|
}
|
|
6462
6453
|
} else {
|
|
6463
6454
|
const resolved = resolveAgentDir(projectDir);
|
|
@@ -6550,12 +6541,12 @@ function makeFlowEventHandler() {
|
|
|
6550
6541
|
}
|
|
6551
6542
|
function makeRunCommand() {
|
|
6552
6543
|
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>", "Driver backend (claude-sdk, codex, omp)").option("--provider <name>", "LLM provider").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) => {
|
|
6553
|
-
const projectDir =
|
|
6544
|
+
const projectDir = path35__default.resolve(opts.projectDir);
|
|
6554
6545
|
const cliDriver = opts.driver;
|
|
6555
6546
|
const dryRun = opts.dryRun ?? false;
|
|
6556
6547
|
let flowId = positional[0];
|
|
6557
6548
|
if (!flowId) {
|
|
6558
|
-
const flows = discoverFlows();
|
|
6549
|
+
const flows = discoverFlows(projectDir);
|
|
6559
6550
|
if (flows.length === 0) {
|
|
6560
6551
|
logErr("No flows available.");
|
|
6561
6552
|
process.exit(1);
|
|
@@ -6582,22 +6573,12 @@ function makeRunCommand() {
|
|
|
6582
6573
|
const driver = config.driver ?? "omp";
|
|
6583
6574
|
const model = config.model;
|
|
6584
6575
|
const provider = config.provider;
|
|
6585
|
-
const
|
|
6586
|
-
let dir = projectDir;
|
|
6587
|
-
for (let i = 0; i < 6; i++) {
|
|
6588
|
-
const candidate = path13__default.join(dir, "ai-assets");
|
|
6589
|
-
if (fs13__default.existsSync(candidate)) {
|
|
6590
|
-
priorityRoots.push(candidate);
|
|
6591
|
-
break;
|
|
6592
|
-
}
|
|
6593
|
-
dir = path13__default.dirname(dir);
|
|
6594
|
-
}
|
|
6595
|
-
const flowPath = findFlowFile(flowId, priorityRoots);
|
|
6576
|
+
const flowPath = findFlowFile(flowId, projectAiAssetsRoots(projectDir), projectDir);
|
|
6596
6577
|
if (!flowPath) {
|
|
6597
6578
|
const textPrompt = positional.join(" ");
|
|
6598
6579
|
if (!textPrompt.trim()) {
|
|
6599
6580
|
logErr(`Flow not found: ${flowId}`);
|
|
6600
|
-
const available = discoverFlows().map((f) => f.id);
|
|
6581
|
+
const available = discoverFlows(projectDir).map((f) => f.id);
|
|
6601
6582
|
if (available.length > 0) {
|
|
6602
6583
|
console.log(` ${S.dim("Available:")} ${available.map((id) => S.cmd(id)).join(", ")}`);
|
|
6603
6584
|
}
|
|
@@ -6661,7 +6642,7 @@ function makeRunCommand() {
|
|
|
6661
6642
|
}
|
|
6662
6643
|
function makeResumeCommand() {
|
|
6663
6644
|
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) => {
|
|
6664
|
-
const projectDir =
|
|
6645
|
+
const projectDir = path35__default.resolve(opts.projectDir);
|
|
6665
6646
|
const sessionId = opts.session;
|
|
6666
6647
|
const dryRun = opts.dryRun ?? false;
|
|
6667
6648
|
const session = sessionId ? await loadSessionById(projectDir, sessionId) : await loadSession(projectDir);
|
|
@@ -6688,7 +6669,7 @@ function makeResumeCommand() {
|
|
|
6688
6669
|
}
|
|
6689
6670
|
function makeStatusCommand() {
|
|
6690
6671
|
return new Command("status").description("Show current session state").option("--project-dir <path>", "Project directory", process.cwd()).action(async (opts) => {
|
|
6691
|
-
const projectDir =
|
|
6672
|
+
const projectDir = path35__default.resolve(opts.projectDir);
|
|
6692
6673
|
const session = await loadSession(projectDir);
|
|
6693
6674
|
if (!session) {
|
|
6694
6675
|
logInfo("No active session.");
|
|
@@ -6713,7 +6694,7 @@ function makeStatusCommand() {
|
|
|
6713
6694
|
}
|
|
6714
6695
|
function makeClearCommand() {
|
|
6715
6696
|
return new Command("clear").description("Unset current session pointer").option("--project-dir <path>", "Project directory", process.cwd()).action(async (opts) => {
|
|
6716
|
-
const projectDir =
|
|
6697
|
+
const projectDir = path35__default.resolve(opts.projectDir);
|
|
6717
6698
|
await clearSession(projectDir);
|
|
6718
6699
|
logOk("Session cleared.");
|
|
6719
6700
|
});
|
|
@@ -6723,7 +6704,7 @@ function makeReplCommand() {
|
|
|
6723
6704
|
const { findWorkspaceRoot } = await import('../core/index.js');
|
|
6724
6705
|
const { startRepl } = await import('../tui/index.js');
|
|
6725
6706
|
const os2 = await import('os');
|
|
6726
|
-
const userCwd =
|
|
6707
|
+
const userCwd = path35__default.resolve(opts.projectDir ?? process.cwd());
|
|
6727
6708
|
const workspaceRoot = findWorkspaceRoot(userCwd);
|
|
6728
6709
|
let projectDir;
|
|
6729
6710
|
let agentCwd;
|
|
@@ -6745,13 +6726,13 @@ function makeReplCommand() {
|
|
|
6745
6726
|
p5.cancel("Cancelled.");
|
|
6746
6727
|
process.exit(0);
|
|
6747
6728
|
}
|
|
6748
|
-
const tmpDir =
|
|
6729
|
+
const tmpDir = fs12__default.mkdtempSync(path35__default.join(os2.tmpdir(), "skaile-repl-"));
|
|
6749
6730
|
projectDir = tmpDir;
|
|
6750
6731
|
agentCwd = userCwd;
|
|
6751
6732
|
logOk(`Temporary workspace: ${S.cmd(tmpDir)}`);
|
|
6752
6733
|
if (!driverOverride) {
|
|
6753
|
-
const claudeDir =
|
|
6754
|
-
if (
|
|
6734
|
+
const claudeDir = path35__default.join(os2.homedir(), ".claude");
|
|
6735
|
+
if (fs12__default.existsSync(claudeDir)) {
|
|
6755
6736
|
driverOverride = "claude-sdk";
|
|
6756
6737
|
logInfo(`Detected ${S.cmd("~/.claude")} \u2192 using ${S.cmd("claude-sdk")} backend`);
|
|
6757
6738
|
} else {
|
|
@@ -6797,12 +6778,12 @@ function makeServeCommand() {
|
|
|
6797
6778
|
);
|
|
6798
6779
|
}
|
|
6799
6780
|
async function ensurePluginsLoadedForServe(projectDir) {
|
|
6800
|
-
const { logInfo: logInfo2, logWarn: logWarn2 } = await import('../helpers-
|
|
6781
|
+
const { logInfo: logInfo2, logWarn: logWarn2 } = await import('../helpers-QUGRH2MW.js');
|
|
6801
6782
|
try {
|
|
6802
6783
|
const { resolveSkWorkspaceConfig: resolveSkWorkspaceConfig2 } = await import('../core/index.js');
|
|
6803
6784
|
const config = resolveSkWorkspaceConfig2(projectDir);
|
|
6804
6785
|
if (!config.plugins || config.plugins.length === 0) return;
|
|
6805
|
-
const { ensurePluginsLoaded } = await import('../plugin-store-
|
|
6786
|
+
const { ensurePluginsLoaded } = await import('../plugin-store-3BYOBKYT.js');
|
|
6806
6787
|
const { pluginRegistry } = await import('../plugin-registry/index.js');
|
|
6807
6788
|
const result = await ensurePluginsLoaded(projectDir, config.plugins, pluginRegistry);
|
|
6808
6789
|
if (result.loaded.length > 0) {
|
|
@@ -6816,14 +6797,14 @@ async function ensurePluginsLoadedForServe(projectDir) {
|
|
|
6816
6797
|
}
|
|
6817
6798
|
}
|
|
6818
6799
|
async function runCompileTest(opts) {
|
|
6819
|
-
const { logOk: logOk2, logErr: logErr2, logInfo: logInfo2, S: S2 } = await import('../helpers-
|
|
6800
|
+
const { logOk: logOk2, logErr: logErr2, logInfo: logInfo2, S: S2 } = await import('../helpers-QUGRH2MW.js');
|
|
6820
6801
|
const { tmpdir } = await import('os');
|
|
6821
6802
|
const { dirname: dirname4, join: join7, resolve: resolve5 } = await import('path');
|
|
6822
6803
|
const { fileURLToPath: fileURLToPath2 } = await import('url');
|
|
6823
6804
|
const { unlinkSync, existsSync: existsSync15 } = await import('fs');
|
|
6824
6805
|
const { spawn } = await import('child_process');
|
|
6825
6806
|
const { portableSpawnSync: portableSpawnSync2 } = await import('../core/index.js');
|
|
6826
|
-
const { MONOREPO_ROOT } = await import('../paths-
|
|
6807
|
+
const { MONOREPO_ROOT } = await import('../paths-ESJHWGBR.js');
|
|
6827
6808
|
if (MONOREPO_ROOT === null) {
|
|
6828
6809
|
logErr2("--compile-test is only available inside the skaile-dev workspace.");
|
|
6829
6810
|
logInfo2("Run it from a checkout of skaile-ai/skaile-dev (the monorepo shell).");
|
|
@@ -7305,7 +7286,7 @@ function resolveMode(opts) {
|
|
|
7305
7286
|
if (opts.forceLocal && opts.forceRemote) {
|
|
7306
7287
|
throw new Error("Cannot use both --local and --remote");
|
|
7307
7288
|
}
|
|
7308
|
-
const startDir =
|
|
7289
|
+
const startDir = path35__default.resolve(opts.projectDir ?? process.cwd());
|
|
7309
7290
|
const localDb = findLogsDb(startDir);
|
|
7310
7291
|
if (opts.forceLocal) {
|
|
7311
7292
|
if (!localDb) {
|
|
@@ -7338,14 +7319,14 @@ function resolveMode(opts) {
|
|
|
7338
7319
|
function findLogsDb(startDir) {
|
|
7339
7320
|
let dir = startDir;
|
|
7340
7321
|
for (let i = 0; i < MAX_WALK_LEVELS; i++) {
|
|
7341
|
-
const candidate =
|
|
7322
|
+
const candidate = path35__default.join(dir, ".skaile", "logs.db");
|
|
7342
7323
|
if (existsSync(candidate)) {
|
|
7343
7324
|
try {
|
|
7344
7325
|
if (statSync(candidate).isFile()) return candidate;
|
|
7345
7326
|
} catch {
|
|
7346
7327
|
}
|
|
7347
7328
|
}
|
|
7348
|
-
const parent =
|
|
7329
|
+
const parent = path35__default.dirname(dir);
|
|
7349
7330
|
if (parent === dir) return void 0;
|
|
7350
7331
|
dir = parent;
|
|
7351
7332
|
}
|
|
@@ -7371,7 +7352,7 @@ function readApiToken() {
|
|
|
7371
7352
|
}
|
|
7372
7353
|
function readGlobalSettings() {
|
|
7373
7354
|
try {
|
|
7374
|
-
const settingsPath =
|
|
7355
|
+
const settingsPath = path35__default.join(homedir(), ".skaile", "settings.json");
|
|
7375
7356
|
if (!existsSync(settingsPath)) return {};
|
|
7376
7357
|
return JSON.parse(readFileSync(settingsPath, "utf8"));
|
|
7377
7358
|
} catch {
|
|
@@ -7520,7 +7501,7 @@ function parsePositiveInt(value, flag) {
|
|
|
7520
7501
|
function makeSessionCommand() {
|
|
7521
7502
|
const cmd = new Command("session").description("Manage sessions");
|
|
7522
7503
|
cmd.command("list").description("List all sessions for a project").option("--project-dir <path>", "Project directory", process.cwd()).action(async (opts) => {
|
|
7523
|
-
const projectDir =
|
|
7504
|
+
const projectDir = path35__default.resolve(opts.projectDir);
|
|
7524
7505
|
const sessions = await listSessions(projectDir);
|
|
7525
7506
|
const current = await loadSession(projectDir);
|
|
7526
7507
|
if (sessions.length === 0) {
|
|
@@ -7548,7 +7529,7 @@ function makeSessionCommand() {
|
|
|
7548
7529
|
console.log();
|
|
7549
7530
|
});
|
|
7550
7531
|
cmd.command("show <run-id>").description("Show a specific session").option("--project-dir <path>", "Project directory", process.cwd()).action(async (runId, opts) => {
|
|
7551
|
-
const projectDir =
|
|
7532
|
+
const projectDir = path35__default.resolve(opts.projectDir);
|
|
7552
7533
|
const session = await loadSessionById(projectDir, runId);
|
|
7553
7534
|
if (!session) {
|
|
7554
7535
|
logErr(`Session not found: ${runId}`);
|
|
@@ -7557,12 +7538,12 @@ function makeSessionCommand() {
|
|
|
7557
7538
|
console.log(JSON.stringify(session, null, 2));
|
|
7558
7539
|
});
|
|
7559
7540
|
cmd.command("switch <run-id>").description("Switch the current session").option("--project-dir <path>", "Project directory", process.cwd()).action(async (runId, opts) => {
|
|
7560
|
-
const projectDir =
|
|
7541
|
+
const projectDir = path35__default.resolve(opts.projectDir);
|
|
7561
7542
|
await setCurrentSession(projectDir, runId);
|
|
7562
7543
|
logOk(`Switched to session: ${S.dim(runId.slice(0, 8))}`);
|
|
7563
7544
|
});
|
|
7564
7545
|
cmd.command("delete <run-id>").description("Delete a session").option("--project-dir <path>", "Project directory", process.cwd()).action(async (runId, opts) => {
|
|
7565
|
-
const projectDir =
|
|
7546
|
+
const projectDir = path35__default.resolve(opts.projectDir);
|
|
7566
7547
|
await deleteSession(projectDir, runId);
|
|
7567
7548
|
logOk(`Deleted session: ${S.dim(runId.slice(0, 8))}`);
|
|
7568
7549
|
});
|
|
@@ -7616,12 +7597,12 @@ function showOverview(am2) {
|
|
|
7616
7597
|
}
|
|
7617
7598
|
async function showAsset(am2, kind, name) {
|
|
7618
7599
|
const entry = await am2.info(`${kind}:${name}`);
|
|
7619
|
-
if (entry?.source &&
|
|
7600
|
+
if (entry?.source && fs12__default.existsSync(entry.source)) {
|
|
7620
7601
|
console.log();
|
|
7621
7602
|
console.log(` ${kindColor(entry.kind)} ${S.heading(entry.name)}`);
|
|
7622
7603
|
console.log(` ${S.rule(40)}`);
|
|
7623
7604
|
console.log();
|
|
7624
|
-
console.log(
|
|
7605
|
+
console.log(fs12__default.readFileSync(entry.source, "utf-8"));
|
|
7625
7606
|
return;
|
|
7626
7607
|
}
|
|
7627
7608
|
logErr(`Asset not found: ${kind}:${name}`);
|
|
@@ -7630,7 +7611,7 @@ async function showAsset(am2, kind, name) {
|
|
|
7630
7611
|
function makeShowCommand() {
|
|
7631
7612
|
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", "claude-code").action(async (kind, name, opts) => {
|
|
7632
7613
|
const am2 = new AssetManager({
|
|
7633
|
-
projectDir:
|
|
7614
|
+
projectDir: path35__default.resolve(opts.projectDir),
|
|
7634
7615
|
driverTarget: opts.target
|
|
7635
7616
|
});
|
|
7636
7617
|
if (!kind) {
|
|
@@ -7698,9 +7679,9 @@ function makeStoreCommand() {
|
|
|
7698
7679
|
process.exit(2);
|
|
7699
7680
|
});
|
|
7700
7681
|
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) => {
|
|
7701
|
-
const { openCatalogSource: openCatalogSource2, LocalCatalogDisabledError } = await import('../open-library-
|
|
7682
|
+
const { openCatalogSource: openCatalogSource2, LocalCatalogDisabledError } = await import('../open-library-6OSZX2O6.js');
|
|
7702
7683
|
try {
|
|
7703
|
-
const remote = await openCatalogSource2({ projectDir:
|
|
7684
|
+
const remote = await openCatalogSource2({ projectDir: path35__default.resolve(opts.projectDir) });
|
|
7704
7685
|
const assets = await remote.listAssets(opts.kind ? { kind: opts.kind } : {});
|
|
7705
7686
|
const results = filterCatalogAssets(assets, query);
|
|
7706
7687
|
if (results.length === 0) {
|
|
@@ -7731,10 +7712,10 @@ function makeStoreCommand() {
|
|
|
7731
7712
|
}
|
|
7732
7713
|
});
|
|
7733
7714
|
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) => {
|
|
7734
|
-
const { openCatalogSource: openCatalogSource2, LocalCatalogDisabledError } = await import('../open-library-
|
|
7735
|
-
const { supportsInstallManifest } = await import('../project-
|
|
7715
|
+
const { openCatalogSource: openCatalogSource2, LocalCatalogDisabledError } = await import('../open-library-6OSZX2O6.js');
|
|
7716
|
+
const { supportsInstallManifest } = await import('../project-5RGSHTZ7.js');
|
|
7736
7717
|
try {
|
|
7737
|
-
const remote = await openCatalogSource2({ projectDir:
|
|
7718
|
+
const remote = await openCatalogSource2({ projectDir: path35__default.resolve(opts.projectDir) });
|
|
7738
7719
|
const asset = await remote.resolve(ref);
|
|
7739
7720
|
if (!asset) {
|
|
7740
7721
|
logErr(`Not found in store: ${ref} (try a full ref, e.g. skill:@publisher/name#version)`);
|
|
@@ -7853,7 +7834,7 @@ function printTree(node, prefix = "", isLast = true) {
|
|
|
7853
7834
|
}
|
|
7854
7835
|
function makeTreeCommand() {
|
|
7855
7836
|
return new Command("tree").description("Show full dependency tree").option("--project-dir <path>", "Project directory", process.cwd()).action(async (opts) => {
|
|
7856
|
-
const am2 = new AssetManager({ projectDir:
|
|
7837
|
+
const am2 = new AssetManager({ projectDir: path35__default.resolve(opts.projectDir) });
|
|
7857
7838
|
const root = am2.tree();
|
|
7858
7839
|
if (root.children.length === 0) {
|
|
7859
7840
|
logInfo("No dependencies in lock file. Run `skaile install` first.");
|
|
@@ -7879,7 +7860,7 @@ function makeUpdateCommand() {
|
|
|
7879
7860
|
try {
|
|
7880
7861
|
const catalogSpinner = p5.spinner();
|
|
7881
7862
|
catalogSpinner.start("Refreshing catalog cache");
|
|
7882
|
-
const remote = await openCatalogSource({ projectDir:
|
|
7863
|
+
const remote = await openCatalogSource({ projectDir: path35__default.resolve(opts.projectDir) });
|
|
7883
7864
|
const result2 = await remote.refresh();
|
|
7884
7865
|
catalogSpinner.stop(
|
|
7885
7866
|
`Catalog refreshed: ${S.heading(String(result2.assetsCached))} assets cached`
|
|
@@ -7891,7 +7872,7 @@ function makeUpdateCommand() {
|
|
|
7891
7872
|
}
|
|
7892
7873
|
}
|
|
7893
7874
|
if (opts.catalogOnly) return;
|
|
7894
|
-
const projectDir =
|
|
7875
|
+
const projectDir = path35__default.resolve(opts.projectDir);
|
|
7895
7876
|
if (await shouldSyncSources(opts)) {
|
|
7896
7877
|
const syncSpinner = p5.spinner();
|
|
7897
7878
|
syncSpinner.start("Syncing sources");
|
|
@@ -7947,12 +7928,12 @@ function findManifestCandidates(rootPath) {
|
|
|
7947
7928
|
function walk(dir) {
|
|
7948
7929
|
let entries;
|
|
7949
7930
|
try {
|
|
7950
|
-
entries =
|
|
7931
|
+
entries = fs12__default.readdirSync(dir, { withFileTypes: true });
|
|
7951
7932
|
} catch {
|
|
7952
7933
|
return;
|
|
7953
7934
|
}
|
|
7954
7935
|
for (const entry of entries) {
|
|
7955
|
-
const fullPath =
|
|
7936
|
+
const fullPath = path35__default.join(dir, entry.name);
|
|
7956
7937
|
if (entry.isDirectory()) {
|
|
7957
7938
|
if (!SKIP_DIRS.has(entry.name)) walk(fullPath);
|
|
7958
7939
|
} else if (entry.isFile()) {
|
|
@@ -7993,7 +7974,7 @@ function checkManifestIdentity(kind, parsed) {
|
|
|
7993
7974
|
return null;
|
|
7994
7975
|
}
|
|
7995
7976
|
function parseManifestCandidate(c, absRoot) {
|
|
7996
|
-
const content =
|
|
7977
|
+
const content = fs12__default.readFileSync(c.filePath, "utf-8");
|
|
7997
7978
|
if (c.filePath.endsWith(".md")) {
|
|
7998
7979
|
const parsed = parseMdFrontmatter(content);
|
|
7999
7980
|
if (parsed === null) {
|
|
@@ -8005,13 +7986,13 @@ function parseManifestCandidate(c, absRoot) {
|
|
|
8005
7986
|
const parsed = c.filePath.endsWith(".json") ? JSON.parse(content) : parse(content);
|
|
8006
7987
|
return { kind: "value", parsed };
|
|
8007
7988
|
} catch (e) {
|
|
8008
|
-
const relPath =
|
|
7989
|
+
const relPath = path35__default.relative(absRoot, c.filePath);
|
|
8009
7990
|
logErr(`${relPath} \u2014 parse error: ${e instanceof Error ? e.message : String(e)}`);
|
|
8010
7991
|
return { kind: "error" };
|
|
8011
7992
|
}
|
|
8012
7993
|
}
|
|
8013
7994
|
function validateManifestCandidate(c, parsed, absRoot, registry, strictConformance) {
|
|
8014
|
-
const relPath =
|
|
7995
|
+
const relPath = path35__default.relative(absRoot, c.filePath);
|
|
8015
7996
|
let errors = 0;
|
|
8016
7997
|
let warnings = 0;
|
|
8017
7998
|
const identityError = checkManifestIdentity(c.kind, parsed);
|
|
@@ -8020,7 +8001,7 @@ function validateManifestCandidate(c, parsed, absRoot, registry, strictConforman
|
|
|
8020
8001
|
errors++;
|
|
8021
8002
|
}
|
|
8022
8003
|
if (c.kind === "skill" && parsed && typeof parsed === "object") {
|
|
8023
|
-
const dirName =
|
|
8004
|
+
const dirName = path35__default.basename(path35__default.dirname(c.filePath));
|
|
8024
8005
|
const findings = checkAgentSkillConformance(parsed, { dirName });
|
|
8025
8006
|
for (const f of findings) {
|
|
8026
8007
|
const line = `${relPath} [skill conformance] \u2014 ${f.field}: ${f.message}`;
|
|
@@ -8048,8 +8029,8 @@ function validateManifestCandidate(c, parsed, absRoot, registry, strictConforman
|
|
|
8048
8029
|
return { errors, warnings };
|
|
8049
8030
|
}
|
|
8050
8031
|
function validateManifests(rootPath, strictConformance) {
|
|
8051
|
-
const absRoot =
|
|
8052
|
-
if (!
|
|
8032
|
+
const absRoot = path35__default.resolve(rootPath);
|
|
8033
|
+
if (!fs12__default.existsSync(absRoot)) {
|
|
8053
8034
|
logErr(`Path does not exist: ${absRoot}`);
|
|
8054
8035
|
return { total: 0, errors: 1, warnings: 0 };
|
|
8055
8036
|
}
|
|
@@ -8081,12 +8062,12 @@ function findWorkspaceManifests(rootPath) {
|
|
|
8081
8062
|
function walk(dir) {
|
|
8082
8063
|
let entries;
|
|
8083
8064
|
try {
|
|
8084
|
-
entries =
|
|
8065
|
+
entries = fs12__default.readdirSync(dir, { withFileTypes: true });
|
|
8085
8066
|
} catch {
|
|
8086
8067
|
return;
|
|
8087
8068
|
}
|
|
8088
8069
|
for (const entry of entries) {
|
|
8089
|
-
const full =
|
|
8070
|
+
const full = path35__default.join(dir, entry.name);
|
|
8090
8071
|
if (entry.isDirectory()) {
|
|
8091
8072
|
if (!SKIP_DIRS.has(entry.name)) walk(full);
|
|
8092
8073
|
} else if (entry.isFile() && /(^|\.)skaile\.yaml$/.test(entry.name)) {
|
|
@@ -8149,14 +8130,14 @@ function validateWorkspaceAssets(parsed, relPath) {
|
|
|
8149
8130
|
return errors;
|
|
8150
8131
|
}
|
|
8151
8132
|
function validateWorkspaceManifests(rootPath) {
|
|
8152
|
-
const absRoot =
|
|
8133
|
+
const absRoot = path35__default.resolve(rootPath);
|
|
8153
8134
|
const files = findWorkspaceManifests(absRoot);
|
|
8154
8135
|
let errors = 0;
|
|
8155
8136
|
for (const file of files) {
|
|
8156
|
-
const relPath =
|
|
8137
|
+
const relPath = path35__default.relative(absRoot, file);
|
|
8157
8138
|
let parsed;
|
|
8158
8139
|
try {
|
|
8159
|
-
parsed = parse(
|
|
8140
|
+
parsed = parse(fs12__default.readFileSync(file, "utf-8")) ?? {};
|
|
8160
8141
|
} catch (e) {
|
|
8161
8142
|
logErr(`${relPath} \u2014 parse error: ${e instanceof Error ? e.message : String(e)}`);
|
|
8162
8143
|
errors++;
|
|
@@ -8170,34 +8151,34 @@ function validateWorkspaceManifests(rootPath) {
|
|
|
8170
8151
|
var EXCLUDED_DOMAINS = /* @__PURE__ */ new Set(["skaileup-shared", "external", "docs"]);
|
|
8171
8152
|
function collectAssetVersions() {
|
|
8172
8153
|
const assets = [];
|
|
8173
|
-
if (!
|
|
8174
|
-
const domains =
|
|
8154
|
+
if (!fs12__default.existsSync(AI_RESOURCES)) return assets;
|
|
8155
|
+
const domains = fs12__default.readdirSync(AI_RESOURCES, { withFileTypes: true }).filter((d) => d.isDirectory() && !EXCLUDED_DOMAINS.has(d.name));
|
|
8175
8156
|
for (const d of domains) {
|
|
8176
|
-
const domainDir =
|
|
8177
|
-
const skillsDir =
|
|
8178
|
-
if (
|
|
8157
|
+
const domainDir = path35__default.join(AI_RESOURCES, d.name);
|
|
8158
|
+
const skillsDir = path35__default.join(domainDir, "skills");
|
|
8159
|
+
if (fs12__default.existsSync(skillsDir)) {
|
|
8179
8160
|
collectSkillVersions(skillsDir, d.name, assets);
|
|
8180
8161
|
}
|
|
8181
|
-
const agentsDir =
|
|
8182
|
-
if (
|
|
8162
|
+
const agentsDir = path35__default.join(domainDir, "agents");
|
|
8163
|
+
if (fs12__default.existsSync(agentsDir)) {
|
|
8183
8164
|
collectAgentVersions(agentsDir, d.name, assets);
|
|
8184
8165
|
}
|
|
8185
|
-
const flowsDir =
|
|
8186
|
-
if (
|
|
8166
|
+
const flowsDir = path35__default.join(domainDir, "flows");
|
|
8167
|
+
if (fs12__default.existsSync(flowsDir)) {
|
|
8187
8168
|
collectFlowVersions(flowsDir, d.name, assets);
|
|
8188
8169
|
}
|
|
8189
|
-
const promptsDir =
|
|
8190
|
-
if (
|
|
8170
|
+
const promptsDir = path35__default.join(domainDir, "prompts");
|
|
8171
|
+
if (fs12__default.existsSync(promptsDir)) {
|
|
8191
8172
|
collectPromptVersions(promptsDir, d.name, assets);
|
|
8192
8173
|
}
|
|
8193
8174
|
}
|
|
8194
8175
|
return assets;
|
|
8195
8176
|
}
|
|
8196
8177
|
function collectFlowVersions(dir, domain, out) {
|
|
8197
|
-
for (const f of
|
|
8178
|
+
for (const f of fs12__default.readdirSync(dir)) {
|
|
8198
8179
|
if (!f.endsWith(".flow.yaml")) continue;
|
|
8199
|
-
const fp =
|
|
8200
|
-
const content =
|
|
8180
|
+
const fp = path35__default.join(dir, f);
|
|
8181
|
+
const content = fs12__default.readFileSync(fp, "utf-8");
|
|
8201
8182
|
const parsed = parse(content);
|
|
8202
8183
|
out.push({
|
|
8203
8184
|
kind: "flow",
|
|
@@ -8209,10 +8190,10 @@ function collectFlowVersions(dir, domain, out) {
|
|
|
8209
8190
|
}
|
|
8210
8191
|
}
|
|
8211
8192
|
function collectPromptVersions(dir, domain, out) {
|
|
8212
|
-
for (const f of
|
|
8193
|
+
for (const f of fs12__default.readdirSync(dir)) {
|
|
8213
8194
|
if (!f.endsWith(".prompt.md")) continue;
|
|
8214
|
-
const fp =
|
|
8215
|
-
const content =
|
|
8195
|
+
const fp = path35__default.join(dir, f);
|
|
8196
|
+
const content = fs12__default.readFileSync(fp, "utf-8");
|
|
8216
8197
|
const fm = parseSkillFrontmatter(content);
|
|
8217
8198
|
out.push({
|
|
8218
8199
|
kind: "prompt",
|
|
@@ -8224,12 +8205,12 @@ function collectPromptVersions(dir, domain, out) {
|
|
|
8224
8205
|
}
|
|
8225
8206
|
}
|
|
8226
8207
|
function collectSkillVersions(dir, domain, out) {
|
|
8227
|
-
for (const entry of
|
|
8208
|
+
for (const entry of fs12__default.readdirSync(dir, { withFileTypes: true })) {
|
|
8228
8209
|
if (!entry.isDirectory()) continue;
|
|
8229
|
-
const full =
|
|
8230
|
-
const skillMd =
|
|
8231
|
-
if (
|
|
8232
|
-
const content =
|
|
8210
|
+
const full = path35__default.join(dir, entry.name);
|
|
8211
|
+
const skillMd = path35__default.join(full, "SKILL.md");
|
|
8212
|
+
if (fs12__default.existsSync(skillMd)) {
|
|
8213
|
+
const content = fs12__default.readFileSync(skillMd, "utf-8");
|
|
8233
8214
|
const fm = parseSkillFrontmatter(content);
|
|
8234
8215
|
out.push({
|
|
8235
8216
|
kind: "skill",
|
|
@@ -8244,11 +8225,11 @@ function collectSkillVersions(dir, domain, out) {
|
|
|
8244
8225
|
}
|
|
8245
8226
|
}
|
|
8246
8227
|
function collectAgentVersions(dir, domain, out) {
|
|
8247
|
-
for (const entry of
|
|
8228
|
+
for (const entry of fs12__default.readdirSync(dir, { withFileTypes: true })) {
|
|
8248
8229
|
if (!entry.isDirectory()) continue;
|
|
8249
|
-
const agentYaml =
|
|
8250
|
-
if (!
|
|
8251
|
-
const content =
|
|
8230
|
+
const agentYaml = path35__default.join(dir, entry.name, "agent.yaml");
|
|
8231
|
+
if (!fs12__default.existsSync(agentYaml)) continue;
|
|
8232
|
+
const content = fs12__default.readFileSync(agentYaml, "utf-8");
|
|
8252
8233
|
const parsed = parse(content);
|
|
8253
8234
|
out.push({
|
|
8254
8235
|
kind: "agent",
|
|
@@ -8279,7 +8260,7 @@ function filterToChangedAssets(assets) {
|
|
|
8279
8260
|
encoding: "utf-8"
|
|
8280
8261
|
});
|
|
8281
8262
|
const changedFiles = new Set(
|
|
8282
|
-
diffOutput.trim().split("\n").filter(Boolean).map((f) =>
|
|
8263
|
+
diffOutput.trim().split("\n").filter(Boolean).map((f) => path35__default.resolve(AI_RESOURCES, f))
|
|
8283
8264
|
);
|
|
8284
8265
|
return assets.filter((a) => changedFiles.has(a.filePath));
|
|
8285
8266
|
} catch {
|
|
@@ -8305,7 +8286,7 @@ function checkVersionBumps(assets) {
|
|
|
8305
8286
|
let warnings = 0;
|
|
8306
8287
|
for (const a of assets) {
|
|
8307
8288
|
if (!a.version) continue;
|
|
8308
|
-
const relPath =
|
|
8289
|
+
const relPath = path35__default.relative(AI_RESOURCES, a.filePath);
|
|
8309
8290
|
try {
|
|
8310
8291
|
const headContent = execSync(`git show HEAD:${relPath}`, {
|
|
8311
8292
|
cwd: AI_RESOURCES,
|
|
@@ -8330,16 +8311,20 @@ function checkFlowVersionPins(assets) {
|
|
|
8330
8311
|
skillVersionMap.set(a.name, a.version);
|
|
8331
8312
|
}
|
|
8332
8313
|
let errors = 0;
|
|
8314
|
+
let warnings = 0;
|
|
8333
8315
|
for (const f of flows) {
|
|
8334
|
-
|
|
8335
|
-
|
|
8336
|
-
|
|
8337
|
-
|
|
8338
|
-
|
|
8339
|
-
|
|
8340
|
-
|
|
8341
|
-
|
|
8342
|
-
|
|
8316
|
+
let pins;
|
|
8317
|
+
try {
|
|
8318
|
+
pins = flowSkillVersionPins(loadFlow(f.filePath));
|
|
8319
|
+
} catch (err) {
|
|
8320
|
+
logWarn(
|
|
8321
|
+
`flow:${f.name} (${path35__default.relative(AI_RESOURCES, f.filePath)}) \u2014 could not be read: ${err instanceof Error ? err.message : err}`
|
|
8322
|
+
);
|
|
8323
|
+
warnings++;
|
|
8324
|
+
continue;
|
|
8325
|
+
}
|
|
8326
|
+
if (pins.length === 0) continue;
|
|
8327
|
+
const checks = validateFlowVersions(pins, skillVersionMap);
|
|
8343
8328
|
for (const c of checks.filter((c2) => !c2.satisfied)) {
|
|
8344
8329
|
logErr(
|
|
8345
8330
|
`flow:${f.name} node ${c.nodeId} \u2014 wants ${c.requested}, found ${c.actual || "(none)"}`
|
|
@@ -8347,7 +8332,7 @@ function checkFlowVersionPins(assets) {
|
|
|
8347
8332
|
errors++;
|
|
8348
8333
|
}
|
|
8349
8334
|
}
|
|
8350
|
-
return errors;
|
|
8335
|
+
return { errors, warnings };
|
|
8351
8336
|
}
|
|
8352
8337
|
function runVersionsCheck(opts) {
|
|
8353
8338
|
let assets = collectAssetVersions().filter((a) => !opts.domain || a.domain === opts.domain);
|
|
@@ -8360,7 +8345,9 @@ function runVersionsCheck(opts) {
|
|
|
8360
8345
|
if (opts.changedOnly) {
|
|
8361
8346
|
warnings += checkVersionBumps(assets);
|
|
8362
8347
|
}
|
|
8363
|
-
|
|
8348
|
+
const pinCheck = checkFlowVersionPins(assets);
|
|
8349
|
+
errors += pinCheck.errors;
|
|
8350
|
+
warnings += pinCheck.warnings;
|
|
8364
8351
|
console.log();
|
|
8365
8352
|
logInfo(`Checked ${assets.length} assets`);
|
|
8366
8353
|
if (errors === 0 && warnings === 0) {
|
|
@@ -8381,7 +8368,7 @@ function makeValidateCommand() {
|
|
|
8381
8368
|
"--strict-conformance",
|
|
8382
8369
|
"Treat Agent Skills (agentskills.io) standard findings as errors"
|
|
8383
8370
|
).action((targetPath, opts) => {
|
|
8384
|
-
const absPath =
|
|
8371
|
+
const absPath = path35__default.resolve(targetPath);
|
|
8385
8372
|
logInfo(`Validating manifests in ${absPath}`);
|
|
8386
8373
|
const { total, errors, warnings } = validateManifests(
|
|
8387
8374
|
absPath,
|
|
@@ -8431,7 +8418,7 @@ function makeValidateCommand() {
|
|
|
8431
8418
|
let errors = 0;
|
|
8432
8419
|
for (const domain of modifiedDomains) {
|
|
8433
8420
|
const changelogModified = modifiedFiles.some(
|
|
8434
|
-
(f) => f === `${domain}/CHANGELOG.md` || f ===
|
|
8421
|
+
(f) => f === `${domain}/CHANGELOG.md` || f === path35__default.join(domain, "CHANGELOG.md")
|
|
8435
8422
|
);
|
|
8436
8423
|
if (changelogModified) {
|
|
8437
8424
|
logOk(`${domain}/CHANGELOG.md updated`);
|
|
@@ -8537,7 +8524,7 @@ function whyEmptyMessage(ref, declared) {
|
|
|
8537
8524
|
}
|
|
8538
8525
|
function makeWhyCommand() {
|
|
8539
8526
|
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) => {
|
|
8540
|
-
const am2 = new AssetManager({ projectDir:
|
|
8527
|
+
const am2 = new AssetManager({ projectDir: path35__default.resolve(opts.projectDir) });
|
|
8541
8528
|
const chain = am2.why(ref);
|
|
8542
8529
|
if (chain.length === 0) {
|
|
8543
8530
|
let declared;
|
|
@@ -8571,7 +8558,7 @@ function makeWhyCommand() {
|
|
|
8571
8558
|
var _defaultFormatHelp = Help.prototype.formatHelp;
|
|
8572
8559
|
var pkg = JSON.parse(
|
|
8573
8560
|
readFileSync(
|
|
8574
|
-
|
|
8561
|
+
path35__default.resolve(path35__default.dirname(fileURLToPath(import.meta.url)), "../../package.json"),
|
|
8575
8562
|
"utf-8"
|
|
8576
8563
|
)
|
|
8577
8564
|
);
|
|
@@ -8701,31 +8688,31 @@ async function runInit(projectDir, opts) {
|
|
|
8701
8688
|
process.exitCode = 1;
|
|
8702
8689
|
return;
|
|
8703
8690
|
}
|
|
8704
|
-
const resolved =
|
|
8705
|
-
const projectName =
|
|
8691
|
+
const resolved = path35__default.resolve(projectDir ?? ".");
|
|
8692
|
+
const projectName = path35__default.basename(resolved);
|
|
8706
8693
|
const created = [];
|
|
8707
8694
|
const { existsSync: existsSync15 } = await import('fs');
|
|
8708
8695
|
if (!existsSync15(resolved)) {
|
|
8709
8696
|
mkdirSync5(resolved, { recursive: true });
|
|
8710
8697
|
created.push(".");
|
|
8711
8698
|
}
|
|
8712
|
-
const skaileDir =
|
|
8699
|
+
const skaileDir = path35__default.join(resolved, ".skaile");
|
|
8713
8700
|
if (!existsSync15(skaileDir)) {
|
|
8714
|
-
mkdirSync5(
|
|
8701
|
+
mkdirSync5(path35__default.join(skaileDir, "sessions"), { recursive: true });
|
|
8715
8702
|
created.push(".skaile/");
|
|
8716
8703
|
}
|
|
8717
|
-
const settingsPath =
|
|
8704
|
+
const settingsPath = path35__default.join(skaileDir, "settings.json");
|
|
8718
8705
|
if (!existsSync15(settingsPath)) {
|
|
8719
8706
|
writeFileSync5(settingsPath, "{}\n");
|
|
8720
8707
|
created.push(".skaile/settings.json");
|
|
8721
8708
|
}
|
|
8722
|
-
const wsConfigPath =
|
|
8709
|
+
const wsConfigPath = path35__default.join(resolved, "skaile.yaml");
|
|
8723
8710
|
if (!existsSync15(wsConfigPath)) {
|
|
8724
8711
|
writeFileSync5(wsConfigPath, stringify2(buildInitWorkspaceConfig(projectName, backend)));
|
|
8725
8712
|
created.push("skaile.yaml");
|
|
8726
8713
|
}
|
|
8727
8714
|
for (const dir of new Set(Object.values(DRIVER_TARGETS[backend].local))) {
|
|
8728
|
-
const full =
|
|
8715
|
+
const full = path35__default.join(resolved, dir);
|
|
8729
8716
|
if (!existsSync15(full)) {
|
|
8730
8717
|
mkdirSync5(full, { recursive: true });
|
|
8731
8718
|
created.push(`${dir}/`);
|
|
@@ -8758,7 +8745,7 @@ function buildInitWorkspaceConfig(projectName, backend) {
|
|
|
8758
8745
|
async function initGitScaffold(resolved, created) {
|
|
8759
8746
|
const { execSync: execSync3 } = await import('child_process');
|
|
8760
8747
|
const { existsSync: existsSync15, readFileSync: readFileSync9, writeFileSync: writeFileSync5 } = await import('fs');
|
|
8761
|
-
const gitignorePath =
|
|
8748
|
+
const gitignorePath = path35__default.join(resolved, ".gitignore");
|
|
8762
8749
|
const entries = [
|
|
8763
8750
|
"node_modules/",
|
|
8764
8751
|
".skaile/sessions/",
|
|
@@ -8782,7 +8769,7 @@ async function initGitScaffold(resolved, created) {
|
|
|
8782
8769
|
`);
|
|
8783
8770
|
if (!existing) created.push(".gitignore");
|
|
8784
8771
|
}
|
|
8785
|
-
if (!existsSync15(
|
|
8772
|
+
if (!existsSync15(path35__default.join(resolved, ".git"))) {
|
|
8786
8773
|
try {
|
|
8787
8774
|
execSync3("git init", { cwd: resolved, stdio: "pipe" });
|
|
8788
8775
|
created.push(".git/");
|
|
@@ -8794,10 +8781,10 @@ async function initGitScaffold(resolved, created) {
|
|
|
8794
8781
|
}
|
|
8795
8782
|
async function bootstrapUserConfig() {
|
|
8796
8783
|
try {
|
|
8797
|
-
const
|
|
8784
|
+
const fs13 = await import('fs');
|
|
8798
8785
|
const { userConfigPath, saveConfig, getConfigDefaults } = await import('../library/index.js');
|
|
8799
8786
|
const userCfgPath = userConfigPath();
|
|
8800
|
-
if (!
|
|
8787
|
+
if (!fs13.existsSync(userCfgPath)) {
|
|
8801
8788
|
const defaults = getConfigDefaults();
|
|
8802
8789
|
saveConfig(userCfgPath, {
|
|
8803
8790
|
catalog: { url: defaults.catalog.url, cache_ttl: defaults.catalog.cache_ttl }
|
|
@@ -8812,7 +8799,7 @@ async function bootstrapUserConfig() {
|
|
|
8812
8799
|
}
|
|
8813
8800
|
async function hydrateInitSources(resolved, created) {
|
|
8814
8801
|
try {
|
|
8815
|
-
const { ensureSourcesCloned } = await import('../ensure-sources-
|
|
8802
|
+
const { ensureSourcesCloned } = await import('../ensure-sources-O6AWQXAY.js');
|
|
8816
8803
|
const hydrate = ensureSourcesCloned(resolved, { quiet: true });
|
|
8817
8804
|
for (const n of hydrate.cloned) created.push(`~/.skaile/cache/sources/${n}/`);
|
|
8818
8805
|
if (hydrate.failed.length > 0) {
|
|
@@ -8828,7 +8815,7 @@ function printInitSummary(resolved, projectDir, created) {
|
|
|
8828
8815
|
logOk(`Initialized project at ${S.heading(resolved)}`);
|
|
8829
8816
|
console.log();
|
|
8830
8817
|
console.log(S.heading(" Next steps:"));
|
|
8831
|
-
const isCurrentDir = resolved ===
|
|
8818
|
+
const isCurrentDir = resolved === path35__default.resolve(".");
|
|
8832
8819
|
let step = 1;
|
|
8833
8820
|
if (!isCurrentDir) {
|
|
8834
8821
|
console.log(` ${S.dim(`${step}.`)} ${S.cmd(`cd ${projectDir}`)}`);
|
|
@@ -8852,7 +8839,7 @@ function printInitSummary(resolved, projectDir, created) {
|
|
|
8852
8839
|
console.log();
|
|
8853
8840
|
}
|
|
8854
8841
|
program.command("setup").description("Interactive provider setup wizard").action(async () => {
|
|
8855
|
-
const { cmdSetup } = await import('../setup-
|
|
8842
|
+
const { cmdSetup } = await import('../setup-X2T3NW7P.js');
|
|
8856
8843
|
await cmdSetup([], { projectDir: process.cwd() });
|
|
8857
8844
|
});
|
|
8858
8845
|
program.addCommand(makeInstallCommand());
|