@skaile/workspaces 3.2.0 → 3.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +109 -0
- package/dist/{asset-feeds-25DVAGVD.js → asset-feeds-AGAH5OHC.js} +5 -5
- package/dist/{asset-feeds-25DVAGVD.js.map → asset-feeds-AGAH5OHC.js.map} +1 -1
- package/dist/asset-manager/catalog-deployer.js +1 -1
- package/dist/asset-manager/index.js +2 -2
- package/dist/asset-manager/installer.js +1 -1
- package/dist/bridge/drivers/claude-sdk.js +2 -2
- package/dist/bridge/drivers/codex.js +1 -1
- package/dist/bridge/drivers/continue.js +2 -2
- package/dist/bridge/drivers/echo.js +1 -1
- package/dist/bridge/drivers/gemini.js +3 -3
- package/dist/bridge/drivers/goose.js +2 -2
- package/dist/bridge/drivers/omp.js +1 -1
- package/dist/bridge/drivers/opencode.js +2 -2
- package/dist/bridge/drivers/qwen.js +3 -3
- package/dist/bridge/index.js +3 -3
- package/dist/{chunk-F5YPDCN6.js → chunk-33GWB3RB.js} +2 -2
- package/dist/{chunk-F5YPDCN6.js.map → chunk-33GWB3RB.js.map} +1 -1
- package/dist/{chunk-3IGXVTOS.js → chunk-3KEJ2HJY.js} +3 -3
- package/dist/{chunk-3IGXVTOS.js.map → chunk-3KEJ2HJY.js.map} +1 -1
- package/dist/{chunk-ST4RC2JF.js → chunk-4GJLRYMB.js} +2 -2
- package/dist/{chunk-ST4RC2JF.js.map → chunk-4GJLRYMB.js.map} +1 -1
- package/dist/{chunk-EYBGQJNF.js → chunk-5FLEP4X6.js} +98 -28
- package/dist/chunk-5FLEP4X6.js.map +1 -0
- package/dist/{chunk-57RFYEVM.js → chunk-6OMKIPIE.js} +18 -5
- package/dist/chunk-6OMKIPIE.js.map +1 -0
- package/dist/{chunk-XL7ZDZ4O.js → chunk-BOH6AG6Q.js} +7 -31
- package/dist/chunk-BOH6AG6Q.js.map +1 -0
- package/dist/{chunk-RW4I42MW.js → chunk-E5S2WGTS.js} +132 -13
- package/dist/chunk-E5S2WGTS.js.map +1 -0
- package/dist/{chunk-F5VREBV2.js → chunk-ELPR5XBG.js} +40 -3
- package/dist/chunk-ELPR5XBG.js.map +1 -0
- package/dist/{chunk-IMA5H7AG.js → chunk-EP7VBFMN.js} +6 -6
- package/dist/{chunk-IMA5H7AG.js.map → chunk-EP7VBFMN.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-FP7DNGX6.js → chunk-I7MKEZ6J.js} +3 -3
- package/dist/{chunk-FP7DNGX6.js.map → chunk-I7MKEZ6J.js.map} +1 -1
- package/dist/{chunk-HA2H3FLE.js → chunk-KPZZI2KG.js} +3 -3
- package/dist/{chunk-HA2H3FLE.js.map → chunk-KPZZI2KG.js.map} +1 -1
- package/dist/{chunk-DPFSO4T2.js → chunk-MJ77WSJC.js} +4 -4
- package/dist/{chunk-DPFSO4T2.js.map → chunk-MJ77WSJC.js.map} +1 -1
- package/dist/{chunk-2U4ISGE2.js → chunk-O6B3ZZ5S.js} +4 -4
- package/dist/{chunk-2U4ISGE2.js.map → chunk-O6B3ZZ5S.js.map} +1 -1
- package/dist/{chunk-CO4DNTIL.js → chunk-OD3ABXUO.js} +2 -2
- package/dist/{chunk-CO4DNTIL.js.map → chunk-OD3ABXUO.js.map} +1 -1
- package/dist/{chunk-CTCCFKZV.js → chunk-PRKLFKNC.js} +3 -3
- package/dist/{chunk-CTCCFKZV.js.map → chunk-PRKLFKNC.js.map} +1 -1
- package/dist/{chunk-ZAP2BDHG.js → chunk-QVZA2MDT.js} +2 -2
- package/dist/chunk-QVZA2MDT.js.map +1 -0
- package/dist/{chunk-DEW2G3QZ.js → chunk-RRCNMURJ.js} +9 -9
- package/dist/{chunk-DEW2G3QZ.js.map → chunk-RRCNMURJ.js.map} +1 -1
- package/dist/{chunk-K5OKE4G2.js → chunk-S6GKHEMN.js} +6 -6
- package/dist/{chunk-K5OKE4G2.js.map → chunk-S6GKHEMN.js.map} +1 -1
- package/dist/{chunk-QFO4IYBZ.js → chunk-VT6HDD2L.js} +2 -2
- package/dist/{chunk-QFO4IYBZ.js.map → chunk-VT6HDD2L.js.map} +1 -1
- package/dist/cli/index.js +314 -293
- 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 +39 -13
- package/dist/cli/src/flow-discovery.d.ts.map +1 -1
- package/dist/cli/src/paths.d.ts +21 -7
- package/dist/cli/src/paths.d.ts.map +1 -1
- package/dist/connectors/config.js +1 -1
- package/dist/connectors/index.js +7 -7
- package/dist/core/discovery.js +1 -1
- package/dist/core/index.js +1 -1
- package/dist/core/src/discovery.d.ts +4 -1
- package/dist/core/src/discovery.d.ts.map +1 -1
- package/dist/deploy/index.js +1 -1
- package/dist/{ensure-sources-YOJ5HOCL.js → ensure-sources-L2276FYP.js} +5 -5
- package/dist/{ensure-sources-YOJ5HOCL.js.map → ensure-sources-L2276FYP.js.map} +1 -1
- package/dist/factory-assets/connectors/box.js +7 -7
- package/dist/factory-assets/connectors/deploy.js +7 -7
- package/dist/factory-assets/connectors/devserver.js +7 -7
- package/dist/factory-assets/connectors/flow/CONNECTOR.md +20 -7
- package/dist/factory-assets/connectors/flow/adapter.d.ts.map +1 -1
- package/dist/factory-assets/connectors/flow/adapter.js +7 -7
- package/dist/factory-assets/connectors/flow/engine/index.d.ts +1 -0
- package/dist/factory-assets/connectors/flow/engine/index.d.ts.map +1 -1
- package/dist/factory-assets/connectors/flow/engine/loader.d.ts +63 -9
- package/dist/factory-assets/connectors/flow/engine/loader.d.ts.map +1 -1
- 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 +3 -3
- 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.map +1 -1
- package/dist/factory-assets/connectors/flow/run-flow.js +8 -8
- package/dist/factory-assets/connectors/flow.js +7 -7
- package/dist/factory-assets/connectors/git.js +7 -7
- package/dist/factory-assets/connectors/gmail.js +7 -7
- package/dist/factory-assets/connectors/googledrive.js +7 -7
- package/dist/factory-assets/connectors/local.js +7 -7
- package/dist/factory-assets/connectors/mattermost.js +7 -7
- package/dist/factory-assets/connectors/memory.js +7 -7
- package/dist/factory-assets/connectors/minio.js +7 -7
- package/dist/factory-assets/connectors/postgres.js +7 -7
- package/dist/factory-assets/connectors/s3.js +7 -7
- package/dist/factory-assets/connectors/sharepoint.js +7 -7
- package/dist/factory-assets/connectors/sqlite.js +7 -7
- package/dist/factory-assets/connectors/static-server.js +7 -7
- package/dist/factory-assets/connectors/tunnel.js +7 -7
- package/dist/factory-assets/connectors/webdav.js +7 -7
- package/dist/factory-assets/connectors/xstate-store.js +7 -7
- package/dist/factory-assets/connectors/xstate.js +7 -7
- package/dist/{flows-7KUZGZ77.js → flows-7CZKSC64.js} +4 -4
- package/dist/{flows-7KUZGZ77.js.map → flows-7CZKSC64.js.map} +1 -1
- package/dist/{helpers-YNZ5SWNX.js → helpers-ZWHB5JHQ.js} +5 -5
- package/dist/{helpers-YNZ5SWNX.js.map → helpers-ZWHB5JHQ.js.map} +1 -1
- package/dist/library/index.js +1 -1
- package/dist/library/install.js +1 -1
- package/dist/{library-publish-JBZ2TEQI.js → library-publish-CVYFMVGR.js} +9 -9
- package/dist/{library-publish-JBZ2TEQI.js.map → library-publish-CVYFMVGR.js.map} +1 -1
- package/dist/{open-library-H2LAGVTM.js → open-library-XB65LU3M.js} +8 -8
- package/dist/{open-library-H2LAGVTM.js.map → open-library-XB65LU3M.js.map} +1 -1
- package/dist/{paths-ZLX4ITAQ.js → paths-B52KTS7N.js} +4 -4
- package/dist/{paths-ZLX4ITAQ.js.map → paths-B52KTS7N.js.map} +1 -1
- package/dist/{plugin-store-YIMNH2FH.js → plugin-store-EOP3S7OU.js} +3 -3
- package/dist/{plugin-store-YIMNH2FH.js.map → plugin-store-EOP3S7OU.js.map} +1 -1
- package/dist/{project-WBIYBTN3.js → project-E5LKCE7R.js} +6 -6
- package/dist/{project-WBIYBTN3.js.map → project-E5LKCE7R.js.map} +1 -1
- package/dist/resolver/index.js +1 -1
- package/dist/runner/index.js +10 -10
- package/dist/sdk/asset-manager.js +2 -2
- package/dist/sdk/bridge.js +3 -3
- package/dist/sdk/core.js +1 -1
- package/dist/sdk/flow.js +3 -3
- package/dist/sdk/index.js +10 -10
- package/dist/sdk/resolver.js +1 -1
- package/dist/sdk/runner.js +10 -10
- package/dist/{setup-I5SLLHRA.js → setup-XI7TCIGF.js} +5 -5
- package/dist/{setup-I5SLLHRA.js.map → setup-XI7TCIGF.js.map} +1 -1
- package/dist/{skills-HGVH6UTA.js → skills-5PJ6YVM7.js} +3 -3
- package/dist/{skills-HGVH6UTA.js.map → skills-5PJ6YVM7.js.map} +1 -1
- package/dist/{source-UCMNKSA2.js → source-7BNREKGK.js} +9 -9
- package/dist/{source-UCMNKSA2.js.map → source-7BNREKGK.js.map} +1 -1
- package/dist/{source-manifest-publish-BZ777MH5.js → source-manifest-publish-JGMHNADH.js} +10 -10
- package/dist/{source-manifest-publish-BZ777MH5.js.map → source-manifest-publish-JGMHNADH.js.map} +1 -1
- package/dist/tui/index.js +10 -10
- package/dist/workspace-plugin/adapters/mcp.js +2 -2
- package/dist/workspace-plugin/adapters/omp.js +7 -7
- package/dist/workspace-plugin/index.js +1 -1
- package/package.json +1 -1
- package/dist/chunk-57RFYEVM.js.map +0 -1
- package/dist/chunk-EYBGQJNF.js.map +0 -1
- package/dist/chunk-F5VREBV2.js.map +0 -1
- package/dist/chunk-FLBDLF3I.js.map +0 -1
- package/dist/chunk-RW4I42MW.js.map +0 -1
- package/dist/chunk-XL7ZDZ4O.js.map +0 -1
- package/dist/chunk-ZAP2BDHG.js.map +0 -1
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, aiResourceRoots } from '../chunk-
|
|
2
|
+
import { makeInstallCommand, makeCheckCommand, makeCleanCommand, reportInstalledSoftDeps } from '../chunk-EP7VBFMN.js';
|
|
3
|
+
import { makeSourceCommand, syncProjectSources } from '../chunk-S6GKHEMN.js';
|
|
4
|
+
import { AI_RESOURCES, aiResourceRoots } from '../chunk-6OMKIPIE.js';
|
|
5
5
|
import { getStoreConfig, storeFetch, deviceLogin, loadStoreAuthConfig, logout, hasStoredAuth, isStoreAuthenticated, getStoreToken, getStoreIdentity } from '../chunk-AM5LFRXJ.js';
|
|
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-
|
|
6
|
+
import { openCatalogSource, openLibraryManager, createFullRegistry, openLibrary } from '../chunk-MJ77WSJC.js';
|
|
7
|
+
import { logErr, S, logOk, logInfo, kindColorPad, kindColor, colorRef, formatSoftDepSection, bareSoftDepName, logWarn, formatSoftDepHint, formatRelativeTime, formatSoftDepRemovePreview, formatSoftDepAddPreview, fitWidth } from '../chunk-3KEJ2HJY.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-RRCNMURJ.js';
|
|
10
|
+
import { buildClaudePluginFiles } from '../chunk-33GWB3RB.js';
|
|
11
11
|
import '../chunk-X5YPJV4N.js';
|
|
12
12
|
import '../chunk-W3UDISS2.js';
|
|
13
13
|
import '../chunk-O7SG5PC2.js';
|
|
@@ -15,27 +15,27 @@ 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-BOH6AG6Q.js';
|
|
19
19
|
import '../chunk-4R6DROGN.js';
|
|
20
20
|
import { validateFlowVersions, parseSkillFrontmatter } from '../chunk-CZZRDYT4.js';
|
|
21
21
|
import '../chunk-BEAIJRVF.js';
|
|
22
22
|
import '../chunk-HNBWU5RA.js';
|
|
23
|
-
import '../chunk-
|
|
23
|
+
import '../chunk-E5S2WGTS.js';
|
|
24
24
|
import '../chunk-ZNIHTT22.js';
|
|
25
|
-
import '../chunk-
|
|
25
|
+
import '../chunk-KPZZI2KG.js';
|
|
26
26
|
import '../chunk-46LE3GNY.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-VT6HDD2L.js';
|
|
31
31
|
import '../chunk-6E6PKKAD.js';
|
|
32
32
|
import '../chunk-IFGTRL2I.js';
|
|
33
|
-
import { loadFlow,
|
|
33
|
+
import { loadFlow, loadAllFlowEntries, flowFileCandidates } from '../chunk-5FLEP4X6.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-
|
|
38
|
+
import { AssetManager, NON_DEPLOYABLE_KINDS, MissingManifestError, parseRefTolerant, normalizeRepoUrl, FACTORY_SOURCE_URL } from '../chunk-OD3ABXUO.js';
|
|
39
39
|
import { resolveLibraryDir, getStoreManifestsDir, getDefaultValue, isSecretPlaceholder } from '../chunk-3HVASHBF.js';
|
|
40
40
|
import '../chunk-NU4E7C5I.js';
|
|
41
41
|
import '../chunk-UKJMQZV6.js';
|
|
@@ -46,7 +46,7 @@ import '../chunk-CGYEHQOX.js';
|
|
|
46
46
|
import { resolveSettings, globalSettingsPath, projectSettingsPath, loadSettings, saveSettings, portableSpawn, portableSpawnSync, WorkspaceYamlEditor, checkAgentSkillConformance, readLock } from '../chunk-P43HBWKK.js';
|
|
47
47
|
import '../chunk-F3HNW354.js';
|
|
48
48
|
import { DRIVER_DEFAULTS } from '../chunk-K5GBV4SA.js';
|
|
49
|
-
import { assetSearchDirs, detectDomains } from '../chunk-
|
|
49
|
+
import { assetSearchDirs, detectDomains } from '../chunk-QVZA2MDT.js';
|
|
50
50
|
import { factoryAssetRoots } from '../chunk-UFY2HFLO.js';
|
|
51
51
|
import { globalCacheRoot, sourceCacheKey, getGlobalCacheDir, resolveAgentDir, matchPin, coerceVersion, loadSkWorkspaceConfig, resolveSkWorkspaceConfig, storeManifestSlug } from '../chunk-Q26C5GLO.js';
|
|
52
52
|
import { SUPPORTED_DRIVER_TARGETS } from '../chunk-MENCWIHW.js';
|
|
@@ -62,8 +62,8 @@ import { validatePreset } from '../chunk-IRORTHGA.js';
|
|
|
62
62
|
import '../chunk-NSBPE2FW.js';
|
|
63
63
|
import * as fs13 from 'fs';
|
|
64
64
|
import fs13__default, { readFileSync, existsSync, mkdirSync, writeFileSync, lstatSync, rmSync, readdirSync, statSync } from 'fs';
|
|
65
|
-
import * as
|
|
66
|
-
import
|
|
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';
|
|
@@ -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-XB65LU3M.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-7BNREKGK.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-XB65LU3M.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-XB65LU3M.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-XB65LU3M.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,20 +639,20 @@ 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 =
|
|
646
|
+
const asPath = path35.resolve(nameOrPath);
|
|
647
647
|
if (fs13.existsSync(asPath)) {
|
|
648
|
-
const dir = fs13.statSync(asPath).isDirectory() ? asPath :
|
|
649
|
-
const skillFile =
|
|
648
|
+
const dir = fs13.statSync(asPath).isDirectory() ? asPath : path35.dirname(asPath);
|
|
649
|
+
const skillFile = path35.join(dir, "SKILL.md");
|
|
650
650
|
if (fs13.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 =
|
|
654
|
+
const dir = path35.join(root, nameOrPath);
|
|
655
|
+
const skillFile = path35.join(dir, "SKILL.md");
|
|
656
656
|
if (fs13.existsSync(skillFile)) return { dir, skillFile, via: "claude-skills" };
|
|
657
657
|
}
|
|
658
658
|
}
|
|
@@ -718,8 +718,8 @@ ${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
724
|
if (fs13.existsSync(domainFile)) {
|
|
725
725
|
return { dir, publisher, created: false };
|
|
@@ -731,7 +731,7 @@ function ensureDomain(libraryPath, domain, opts = {}) {
|
|
|
731
731
|
}
|
|
732
732
|
function listDomains(libraryPath) {
|
|
733
733
|
if (!fs13.existsSync(libraryPath)) return [];
|
|
734
|
-
return fs13.readdirSync(libraryPath, { withFileTypes: true }).filter((e) => e.isDirectory() && fs13.existsSync(
|
|
734
|
+
return fs13.readdirSync(libraryPath, { withFileTypes: true }).filter((e) => e.isDirectory() && fs13.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: [] };
|
|
@@ -802,10 +802,10 @@ function makeAssetCommand() {
|
|
|
802
802
|
}
|
|
803
803
|
const rawSkill = fs13.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
822
|
fs13.mkdirSync(destParent, { recursive: true });
|
|
823
|
-
const destDir =
|
|
823
|
+
const destDir = path35.join(destParent, norm.name);
|
|
824
824
|
if (fs13.existsSync(destDir)) {
|
|
825
825
|
logErr(`Destination already exists: ${destDir}`);
|
|
826
826
|
process.exit(1);
|
|
827
827
|
}
|
|
828
828
|
fs13.cpSync(src.dir, destDir, { recursive: true });
|
|
829
|
-
fs13.writeFileSync(
|
|
829
|
+
fs13.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,
|
|
@@ -895,10 +895,10 @@ function makeAssetCommand() {
|
|
|
895
895
|
);
|
|
896
896
|
process.exit(1);
|
|
897
897
|
}
|
|
898
|
-
const basename2 =
|
|
899
|
-
const destDir = target.structure === "domain" && opts.domain ?
|
|
898
|
+
const basename2 = path35.basename(srcPath);
|
|
899
|
+
const destDir = target.structure === "domain" && opts.domain ? path35.join(target.path, opts.domain) : target.path;
|
|
900
900
|
fs13.mkdirSync(destDir, { recursive: true });
|
|
901
|
-
const destPath =
|
|
901
|
+
const destPath = path35.join(destDir, basename2);
|
|
902
902
|
if (fs13.existsSync(destPath)) {
|
|
903
903
|
logErr(`Destination already exists: ${destPath}`);
|
|
904
904
|
process.exit(1);
|
|
@@ -911,7 +911,7 @@ function makeAssetCommand() {
|
|
|
911
911
|
fs13.renameSync(srcPath, destPath);
|
|
912
912
|
break;
|
|
913
913
|
case "link":
|
|
914
|
-
fs13.symlinkSync(
|
|
914
|
+
fs13.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 =
|
|
971
|
+
const srcPath = path35.join(lib.path, candidateSubpath);
|
|
972
972
|
if (!fs13.existsSync(srcPath)) {
|
|
973
973
|
logErr(`Asset path not found: ${srcPath}`);
|
|
974
974
|
process.exit(1);
|
|
975
975
|
}
|
|
976
|
-
const destPath =
|
|
977
|
-
fs13.mkdirSync(
|
|
976
|
+
const destPath = path35.join(target, candidateSubpath);
|
|
977
|
+
fs13.mkdirSync(path35.dirname(destPath), { recursive: true });
|
|
978
978
|
if (opts.mode === "copy") {
|
|
979
979
|
fs13.cpSync(srcPath, destPath, { recursive: true });
|
|
980
980
|
} else {
|
|
981
|
-
fs13.symlinkSync(
|
|
981
|
+
fs13.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-XB65LU3M.js');
|
|
1172
1172
|
let resolved;
|
|
1173
1173
|
try {
|
|
1174
1174
|
resolved = await resolveCatalogSource({ projectDir });
|
|
@@ -1288,23 +1288,32 @@ complete -F _${bin}_completion ${bin}`,
|
|
|
1288
1288
|
end
|
|
1289
1289
|
complete -c ${bin} -f -a '(__${bin}_complete)'`
|
|
1290
1290
|
};
|
|
1291
|
-
function discoverFlows() {
|
|
1291
|
+
function discoverFlows(projectDir) {
|
|
1292
1292
|
const byId = /* @__PURE__ */ new Map();
|
|
1293
|
-
for (const root of aiResourceRoots()) {
|
|
1294
|
-
for (const flow of
|
|
1293
|
+
for (const root of aiResourceRoots(projectDir)) {
|
|
1294
|
+
for (const { flow } of loadAllFlowEntries(root)) {
|
|
1295
1295
|
if (!byId.has(flow.id)) byId.set(flow.id, flow);
|
|
1296
1296
|
}
|
|
1297
1297
|
}
|
|
1298
1298
|
return [...byId.values()];
|
|
1299
1299
|
}
|
|
1300
|
-
function
|
|
1301
|
-
|
|
1300
|
+
function declaredFlowId(filePath) {
|
|
1301
|
+
try {
|
|
1302
|
+
return loadFlow(filePath).id;
|
|
1303
|
+
} catch {
|
|
1304
|
+
return void 0;
|
|
1305
|
+
}
|
|
1306
|
+
}
|
|
1307
|
+
function findFlowFile(flowId, priorityRoots = [], projectDir) {
|
|
1308
|
+
for (const root of [...priorityRoots, ...aiResourceRoots(projectDir)]) {
|
|
1302
1309
|
for (const { dir } of assetSearchDirs(root, "flows")) {
|
|
1303
|
-
for (const
|
|
1304
|
-
|
|
1305
|
-
if (fs13__default.existsSync(candidate)) return candidate;
|
|
1310
|
+
for (const candidate of flowFileCandidates(dir, flowId)) {
|
|
1311
|
+
if (fs13__default.existsSync(candidate) && declaredFlowId(candidate) === flowId) return candidate;
|
|
1306
1312
|
}
|
|
1307
1313
|
}
|
|
1314
|
+
const entry = loadAllFlowEntries(root, { onWarn: () => {
|
|
1315
|
+
} }).find((e) => e.flow.id === flowId);
|
|
1316
|
+
if (entry) return entry.path;
|
|
1308
1317
|
}
|
|
1309
1318
|
return void 0;
|
|
1310
1319
|
}
|
|
@@ -1326,9 +1335,9 @@ function findSkills(domain) {
|
|
|
1326
1335
|
}
|
|
1327
1336
|
function walkSkills(dir, domain, out) {
|
|
1328
1337
|
for (const entry of fs13__default.readdirSync(dir, { withFileTypes: true })) {
|
|
1329
|
-
const full =
|
|
1338
|
+
const full = path35__default.join(dir, entry.name);
|
|
1330
1339
|
if (entry.isDirectory()) {
|
|
1331
|
-
const skillMd =
|
|
1340
|
+
const skillMd = path35__default.join(full, "SKILL.md");
|
|
1332
1341
|
if (fs13__default.existsSync(skillMd)) {
|
|
1333
1342
|
out.push({ name: entry.name, path: full, skillPath: skillMd, domain });
|
|
1334
1343
|
} else {
|
|
@@ -1357,7 +1366,7 @@ function resolveFlowIds() {
|
|
|
1357
1366
|
}
|
|
1358
1367
|
}
|
|
1359
1368
|
function resolveSessionIds(projectDir) {
|
|
1360
|
-
const sessionsDir =
|
|
1369
|
+
const sessionsDir = path35__default.join(projectDir, ".skaile", "sessions");
|
|
1361
1370
|
if (!fs13__default.existsSync(sessionsDir)) return [];
|
|
1362
1371
|
try {
|
|
1363
1372
|
return fs13__default.readdirSync(sessionsDir).filter((f) => f.endsWith(".json")).map((f) => f.slice(0, -".json".length));
|
|
@@ -1476,7 +1485,7 @@ function printResolvedPathsSection(config) {
|
|
|
1476
1485
|
console.log(` ${S.label("prompts:".padEnd(16))} ${config.promptsDir ?? paths.promptsDir}`);
|
|
1477
1486
|
}
|
|
1478
1487
|
async function showConfig(opts) {
|
|
1479
|
-
const projectDir = opts.projectDir ?
|
|
1488
|
+
const projectDir = opts.projectDir ? path35__default.resolve(opts.projectDir) : process.cwd();
|
|
1480
1489
|
const config = await resolveSettings(projectDir);
|
|
1481
1490
|
const wsDefaults = collectWorkspaceDefaults(projectDir);
|
|
1482
1491
|
printEffectiveSection(config);
|
|
@@ -1489,13 +1498,13 @@ function makeConfigCommand() {
|
|
|
1489
1498
|
const cmd = new Command("config").description("Manage personal config (.skaile/settings.json)");
|
|
1490
1499
|
cmd.command("show").description("Show effective config with sources").option("--project-dir <path>", "Project directory").action((opts) => showConfig(opts));
|
|
1491
1500
|
cmd.command("get <key>").description("Get an effective config value").option("--project-dir <path>", "Project directory").action(async (key, opts) => {
|
|
1492
|
-
const projectDir = opts.projectDir ?
|
|
1501
|
+
const projectDir = opts.projectDir ? path35__default.resolve(opts.projectDir) : process.cwd();
|
|
1493
1502
|
const config = await resolveSettings(projectDir);
|
|
1494
1503
|
const value = config[key];
|
|
1495
1504
|
console.log(value ?? S.dim("(not set)"));
|
|
1496
1505
|
});
|
|
1497
1506
|
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) => {
|
|
1498
|
-
const projectDir = opts.projectDir ?
|
|
1507
|
+
const projectDir = opts.projectDir ? path35__default.resolve(opts.projectDir) : process.cwd();
|
|
1499
1508
|
const isApiKey = key.startsWith(API_KEY_PREFIX);
|
|
1500
1509
|
if (!PERSONAL_KEYS.has(key) && !isApiKey) {
|
|
1501
1510
|
logErr(
|
|
@@ -1813,8 +1822,8 @@ function makeConnectorCommand() {
|
|
|
1813
1822
|
async (driver, opts) => {
|
|
1814
1823
|
const { installNpmPackages } = await import('../connectors/index.js');
|
|
1815
1824
|
const { scanDirectory: scanDirectory2, factoryAssetRoots: factoryAssetRoots2, WorkspaceYamlEditor: WorkspaceYamlEditor2 } = await import('../core/index.js');
|
|
1816
|
-
const projectDir =
|
|
1817
|
-
const yamlPath =
|
|
1825
|
+
const projectDir = path35__default.resolve(opts.projectDir);
|
|
1826
|
+
const yamlPath = path35__default.join(projectDir, "skaile.yaml");
|
|
1818
1827
|
if (!existsSync(yamlPath)) {
|
|
1819
1828
|
logErr("No skaile.yaml found in current directory. Run 'skaile init' first.");
|
|
1820
1829
|
process.exit(1);
|
|
@@ -1874,8 +1883,8 @@ ${installResult.output}`);
|
|
|
1874
1883
|
);
|
|
1875
1884
|
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) => {
|
|
1876
1885
|
const { WorkspaceYamlEditor: WorkspaceYamlEditor2 } = await import('../core/index.js');
|
|
1877
|
-
const projectDir =
|
|
1878
|
-
const yamlPath =
|
|
1886
|
+
const projectDir = path35__default.resolve(opts.projectDir);
|
|
1887
|
+
const yamlPath = path35__default.join(projectDir, "skaile.yaml");
|
|
1879
1888
|
if (!existsSync(yamlPath)) {
|
|
1880
1889
|
logErr("No skaile.yaml found in current directory.");
|
|
1881
1890
|
process.exit(1);
|
|
@@ -1892,7 +1901,7 @@ ${installResult.output}`);
|
|
|
1892
1901
|
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) => {
|
|
1893
1902
|
const res = await import('../connectors/index.js');
|
|
1894
1903
|
res.registerBuiltinConnectors();
|
|
1895
|
-
const projectDir =
|
|
1904
|
+
const projectDir = path35__default.resolve(opts.projectDir);
|
|
1896
1905
|
const declarations = res.loadConnectorDeclarations(projectDir);
|
|
1897
1906
|
if (declarations.length === 0) {
|
|
1898
1907
|
console.log("No connectors configured in skaile.yaml.");
|
|
@@ -1916,7 +1925,7 @@ ${installResult.output}`);
|
|
|
1916
1925
|
await manager.disconnectAll();
|
|
1917
1926
|
});
|
|
1918
1927
|
cmd.command("list").description("List all configured connectors").option("--project-dir <path>", "Workspace directory", process.cwd()).action(async (opts) => {
|
|
1919
|
-
const projectDir =
|
|
1928
|
+
const projectDir = path35__default.resolve(opts.projectDir);
|
|
1920
1929
|
const manager = await connectConnectors(projectDir);
|
|
1921
1930
|
try {
|
|
1922
1931
|
console.log(JSON.stringify(manager.listConnectors(), null, 2));
|
|
@@ -1925,7 +1934,7 @@ ${installResult.output}`);
|
|
|
1925
1934
|
}
|
|
1926
1935
|
});
|
|
1927
1936
|
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) => {
|
|
1928
|
-
const projectDir =
|
|
1937
|
+
const projectDir = path35__default.resolve(opts.projectDir);
|
|
1929
1938
|
const manager = await connectConnectors(projectDir);
|
|
1930
1939
|
try {
|
|
1931
1940
|
if (opts.all) {
|
|
@@ -1949,7 +1958,7 @@ ${installResult.output}`);
|
|
|
1949
1958
|
}
|
|
1950
1959
|
});
|
|
1951
1960
|
cmd.command("ops <id>").description("List available operations for a connector").option("--project-dir <path>", "Workspace directory", process.cwd()).action(async (id, opts) => {
|
|
1952
|
-
const projectDir =
|
|
1961
|
+
const projectDir = path35__default.resolve(opts.projectDir);
|
|
1953
1962
|
const manager = await connectConnectors(projectDir);
|
|
1954
1963
|
try {
|
|
1955
1964
|
if (!manager.has(id)) {
|
|
@@ -1964,7 +1973,7 @@ ${installResult.output}`);
|
|
|
1964
1973
|
}
|
|
1965
1974
|
});
|
|
1966
1975
|
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) => {
|
|
1967
|
-
const projectDir =
|
|
1976
|
+
const projectDir = path35__default.resolve(opts.projectDir);
|
|
1968
1977
|
const manager = await connectConnectors(projectDir);
|
|
1969
1978
|
try {
|
|
1970
1979
|
const content = await manager.read(id, resourcePath);
|
|
@@ -1974,7 +1983,7 @@ ${installResult.output}`);
|
|
|
1974
1983
|
}
|
|
1975
1984
|
});
|
|
1976
1985
|
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) => {
|
|
1977
|
-
const projectDir =
|
|
1986
|
+
const projectDir = path35__default.resolve(opts.projectDir);
|
|
1978
1987
|
const manager = await connectConnectors(projectDir);
|
|
1979
1988
|
try {
|
|
1980
1989
|
await manager.write(id, resourcePath, { data: content });
|
|
@@ -1984,7 +1993,7 @@ ${installResult.output}`);
|
|
|
1984
1993
|
}
|
|
1985
1994
|
});
|
|
1986
1995
|
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) => {
|
|
1987
|
-
const projectDir =
|
|
1996
|
+
const projectDir = path35__default.resolve(opts.projectDir);
|
|
1988
1997
|
const manager = await connectConnectors(projectDir);
|
|
1989
1998
|
try {
|
|
1990
1999
|
const entries = await manager.list(id, resourcePath, {
|
|
@@ -1997,7 +2006,7 @@ ${installResult.output}`);
|
|
|
1997
2006
|
}
|
|
1998
2007
|
});
|
|
1999
2008
|
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) => {
|
|
2000
|
-
const projectDir =
|
|
2009
|
+
const projectDir = path35__default.resolve(opts.projectDir);
|
|
2001
2010
|
const manager = await connectConnectors(projectDir);
|
|
2002
2011
|
try {
|
|
2003
2012
|
const results = await manager.search(id, query);
|
|
@@ -2007,7 +2016,7 @@ ${installResult.output}`);
|
|
|
2007
2016
|
}
|
|
2008
2017
|
});
|
|
2009
2018
|
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) => {
|
|
2010
|
-
const projectDir =
|
|
2019
|
+
const projectDir = path35__default.resolve(opts.projectDir);
|
|
2011
2020
|
const manager = await connectConnectors(projectDir);
|
|
2012
2021
|
try {
|
|
2013
2022
|
const ok = await manager.delete(id, resourcePath);
|
|
@@ -2017,7 +2026,7 @@ ${installResult.output}`);
|
|
|
2017
2026
|
}
|
|
2018
2027
|
});
|
|
2019
2028
|
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) => {
|
|
2020
|
-
const projectDir =
|
|
2029
|
+
const projectDir = path35__default.resolve(opts.projectDir);
|
|
2021
2030
|
const manager = await connectConnectors(projectDir);
|
|
2022
2031
|
try {
|
|
2023
2032
|
if (!manager.has(id)) {
|
|
@@ -2126,7 +2135,7 @@ function envRecord() {
|
|
|
2126
2135
|
async function buildDeployContext(projectDir) {
|
|
2127
2136
|
const { resolveSkWorkspaceConfig: resolveSkWorkspaceConfig2 } = await import('../core/index.js');
|
|
2128
2137
|
const config = resolveSkWorkspaceConfig2(projectDir);
|
|
2129
|
-
const workspaceId = config.name ??
|
|
2138
|
+
const workspaceId = config.name ?? path35__default.basename(projectDir);
|
|
2130
2139
|
let log;
|
|
2131
2140
|
try {
|
|
2132
2141
|
const { createLogger } = await import('../core/logging.js');
|
|
@@ -2158,13 +2167,13 @@ async function ensureTargetsRegistered(projectDir) {
|
|
|
2158
2167
|
const { resolveSkWorkspaceConfig: resolveSkWorkspaceConfig2 } = await import('../core/index.js');
|
|
2159
2168
|
const config = resolveSkWorkspaceConfig2(projectDir);
|
|
2160
2169
|
if (config.plugins && config.plugins.length > 0) {
|
|
2161
|
-
const { ensurePluginsLoaded } = await import('../plugin-store-
|
|
2170
|
+
const { ensurePluginsLoaded } = await import('../plugin-store-EOP3S7OU.js');
|
|
2162
2171
|
const result = await ensurePluginsLoaded(projectDir, config.plugins, pluginRegistry);
|
|
2163
2172
|
for (const f of result.failed) logWarn(f.error);
|
|
2164
2173
|
}
|
|
2165
2174
|
}
|
|
2166
2175
|
async function runUp(opts) {
|
|
2167
|
-
const projectDir =
|
|
2176
|
+
const projectDir = path35__default.resolve(opts.projectDir);
|
|
2168
2177
|
await ensureTargetsRegistered(projectDir);
|
|
2169
2178
|
const { resolveSkWorkspaceConfig: resolveSkWorkspaceConfig2 } = await import('../core/index.js');
|
|
2170
2179
|
const { resolveDeployTarget, pluginRegistry } = await import('../plugin-registry/index.js');
|
|
@@ -2232,7 +2241,7 @@ async function restoreFromHandle(projectDir) {
|
|
|
2232
2241
|
return { target, handle, ctx };
|
|
2233
2242
|
}
|
|
2234
2243
|
async function runDown(opts) {
|
|
2235
|
-
const projectDir =
|
|
2244
|
+
const projectDir = path35__default.resolve(opts.projectDir);
|
|
2236
2245
|
const restored = await restoreFromHandle(projectDir);
|
|
2237
2246
|
if (!restored) return;
|
|
2238
2247
|
await restored.handle.stop();
|
|
@@ -2241,7 +2250,7 @@ async function runDown(opts) {
|
|
|
2241
2250
|
logOk(`Stopped ${S.cmd(restored.target.id)} and cleared the handle.`);
|
|
2242
2251
|
}
|
|
2243
2252
|
async function runStatus(opts) {
|
|
2244
|
-
const projectDir =
|
|
2253
|
+
const projectDir = path35__default.resolve(opts.projectDir);
|
|
2245
2254
|
const restored = await restoreFromHandle(projectDir);
|
|
2246
2255
|
if (!restored) return;
|
|
2247
2256
|
const health = await restored.handle.health();
|
|
@@ -2255,7 +2264,7 @@ async function runStatus(opts) {
|
|
|
2255
2264
|
console.log();
|
|
2256
2265
|
}
|
|
2257
2266
|
async function runLogs(opts) {
|
|
2258
|
-
const projectDir =
|
|
2267
|
+
const projectDir = path35__default.resolve(opts.projectDir);
|
|
2259
2268
|
const restored = await restoreFromHandle(projectDir);
|
|
2260
2269
|
if (!restored) return;
|
|
2261
2270
|
if (!restored.handle.logs) {
|
|
@@ -2279,7 +2288,7 @@ function makeDeployCommand() {
|
|
|
2279
2288
|
}
|
|
2280
2289
|
function makeDiffCommand() {
|
|
2281
2290
|
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) => {
|
|
2282
|
-
const am2 = new AssetManager({ projectDir:
|
|
2291
|
+
const am2 = new AssetManager({ projectDir: path35__default.resolve(opts.projectDir) });
|
|
2283
2292
|
const result = await am2.diff(ref);
|
|
2284
2293
|
if (result === null) {
|
|
2285
2294
|
logInfo("No differences (or asset not found).");
|
|
@@ -2290,8 +2299,8 @@ function makeDiffCommand() {
|
|
|
2290
2299
|
}
|
|
2291
2300
|
function makeFlowCommand() {
|
|
2292
2301
|
const cmd = new Command("flow").description("Manage flows");
|
|
2293
|
-
cmd.command("list").description("List available flows").action(async () => {
|
|
2294
|
-
const flows = discoverFlows();
|
|
2302
|
+
cmd.command("list").description("List available flows").option("--project-dir <path>", "Project directory", process.cwd()).action(async (opts) => {
|
|
2303
|
+
const flows = discoverFlows(path35__default.resolve(opts.projectDir));
|
|
2295
2304
|
if (flows.length === 0) {
|
|
2296
2305
|
logInfo("No flows found.");
|
|
2297
2306
|
return;
|
|
@@ -2305,8 +2314,8 @@ function makeFlowCommand() {
|
|
|
2305
2314
|
}
|
|
2306
2315
|
console.log();
|
|
2307
2316
|
});
|
|
2308
|
-
cmd.command("show <id>").description("Show flow details and node graph").action(async (id) => {
|
|
2309
|
-
const flows = discoverFlows();
|
|
2317
|
+
cmd.command("show <id>").description("Show flow details and node graph").option("--project-dir <path>", "Project directory", process.cwd()).action(async (id, opts) => {
|
|
2318
|
+
const flows = discoverFlows(path35__default.resolve(opts.projectDir));
|
|
2310
2319
|
const flow = flows.find((f) => f.id === id);
|
|
2311
2320
|
if (!flow) {
|
|
2312
2321
|
logErr(`Flow not found: ${id}`);
|
|
@@ -2315,14 +2324,20 @@ function makeFlowCommand() {
|
|
|
2315
2324
|
console.log();
|
|
2316
2325
|
console.log(` ${S.heading(flow.name)} ${S.dim(`(${flow.id} v${flow.version})`)}`);
|
|
2317
2326
|
if (flow.description) console.log(` ${S.dim(flow.description)}`);
|
|
2318
|
-
const skillNodes = flow.nodes.filter((n) => n.type === "skill");
|
|
2319
2327
|
console.log(`
|
|
2320
|
-
${S.heading("Nodes")} ${S.dim(`(${
|
|
2328
|
+
${S.heading("Nodes")} ${S.dim(`(${flow.nodes.length})`)}`);
|
|
2321
2329
|
console.log(` ${S.rule(50)}`);
|
|
2322
|
-
|
|
2323
|
-
|
|
2324
|
-
const
|
|
2325
|
-
|
|
2330
|
+
const labelWidth = Math.max(24, ...flow.nodes.map((n) => nodeLabel(n).length));
|
|
2331
|
+
for (const node of flow.nodes) {
|
|
2332
|
+
const skill = nodeSkillAsset(node);
|
|
2333
|
+
const asset = skill ? ` ${S.label("skill:")} ${S.cmd(skill.slice("skill:".length))}` : "";
|
|
2334
|
+
const inert = nodeIsInert(node);
|
|
2335
|
+
const opt = !inert && nodeIsOptional(node) ? S.dim(" [optional]") : "";
|
|
2336
|
+
const tail = `${asset}${opt}`;
|
|
2337
|
+
const kind = inert ? "inert" : nodeRunKind(node);
|
|
2338
|
+
console.log(
|
|
2339
|
+
` ${nodeLabel(node).padEnd(labelWidth)} ${S.dim(tail ? kind.padEnd(10) : kind)}${tail}`
|
|
2340
|
+
);
|
|
2326
2341
|
}
|
|
2327
2342
|
console.log();
|
|
2328
2343
|
});
|
|
@@ -2332,7 +2347,7 @@ function makeFlowCommand() {
|
|
|
2332
2347
|
function makeHistoryCommand() {
|
|
2333
2348
|
const cmd = new Command("history").description("Show recent add/remove/update actions");
|
|
2334
2349
|
cmd.argument("[limit]", "Number of entries to show", "20").option("--project-dir <path>", "Project directory", process.cwd()).action((limitStr, opts) => {
|
|
2335
|
-
const am2 = new AssetManager({ projectDir:
|
|
2350
|
+
const am2 = new AssetManager({ projectDir: path35__default.resolve(opts.projectDir) });
|
|
2336
2351
|
const limit = parseInt(limitStr, 10) || 20;
|
|
2337
2352
|
const entries = am2.history(limit);
|
|
2338
2353
|
if (entries.length === 0) {
|
|
@@ -2352,7 +2367,7 @@ function makeHistoryCommand() {
|
|
|
2352
2367
|
console.log();
|
|
2353
2368
|
});
|
|
2354
2369
|
cmd.command("clear").description("Clear action history").option("--project-dir <path>", "Project directory", process.cwd()).action((opts) => {
|
|
2355
|
-
const am2 = new AssetManager({ projectDir:
|
|
2370
|
+
const am2 = new AssetManager({ projectDir: path35__default.resolve(opts.projectDir) });
|
|
2356
2371
|
am2.clearHistory();
|
|
2357
2372
|
logOk("History cleared.");
|
|
2358
2373
|
});
|
|
@@ -2365,7 +2380,7 @@ var MCP_SERVER_ENTRY = {
|
|
|
2365
2380
|
env: {}
|
|
2366
2381
|
};
|
|
2367
2382
|
function pluginDir(projectDir) {
|
|
2368
|
-
return
|
|
2383
|
+
return path35__default.join(projectDir, ".claude", "plugins", "skaile");
|
|
2369
2384
|
}
|
|
2370
2385
|
async function readJsonStrict(p7) {
|
|
2371
2386
|
let raw;
|
|
@@ -2383,7 +2398,7 @@ async function readJsonStrict(p7) {
|
|
|
2383
2398
|
}
|
|
2384
2399
|
}
|
|
2385
2400
|
async function writeJson(p7, value) {
|
|
2386
|
-
await fs6.mkdir(
|
|
2401
|
+
await fs6.mkdir(path35__default.dirname(p7), { recursive: true });
|
|
2387
2402
|
await fs6.writeFile(p7, `${JSON.stringify(value, null, 2)}
|
|
2388
2403
|
`);
|
|
2389
2404
|
}
|
|
@@ -2391,8 +2406,8 @@ async function copyDir(src, dest) {
|
|
|
2391
2406
|
await fs6.mkdir(dest, { recursive: true });
|
|
2392
2407
|
const entries = await fs6.readdir(src, { withFileTypes: true });
|
|
2393
2408
|
for (const entry of entries) {
|
|
2394
|
-
const srcPath =
|
|
2395
|
-
const destPath =
|
|
2409
|
+
const srcPath = path35__default.join(src, entry.name);
|
|
2410
|
+
const destPath = path35__default.join(dest, entry.name);
|
|
2396
2411
|
if (entry.isDirectory()) await copyDir(srcPath, destPath);
|
|
2397
2412
|
else await fs6.copyFile(srcPath, destPath);
|
|
2398
2413
|
}
|
|
@@ -2401,14 +2416,14 @@ async function install(projectDir, opts) {
|
|
|
2401
2416
|
return opts?.full ? installFullPlugin(projectDir) : installMcp(projectDir);
|
|
2402
2417
|
}
|
|
2403
2418
|
async function installMcp(projectDir) {
|
|
2404
|
-
const mcpPath =
|
|
2419
|
+
const mcpPath = path35__default.join(projectDir, ".claude", "mcp.json");
|
|
2405
2420
|
const existing = await readJsonStrict(mcpPath) ?? {};
|
|
2406
2421
|
const mcpServers = { ...existing.mcpServers ?? {} };
|
|
2407
2422
|
const previous = mcpServers[SKAILE_MCP_NAME];
|
|
2408
2423
|
const matches = previous && JSON.stringify(previous) === JSON.stringify(MCP_SERVER_ENTRY);
|
|
2409
2424
|
let warning;
|
|
2410
2425
|
if (previous && !matches) {
|
|
2411
|
-
warning = `overwrote existing ${SKAILE_MCP_NAME} entry in ${
|
|
2426
|
+
warning = `overwrote existing ${SKAILE_MCP_NAME} entry in ${path35__default.relative(projectDir, mcpPath)}`;
|
|
2412
2427
|
}
|
|
2413
2428
|
mcpServers[SKAILE_MCP_NAME] = MCP_SERVER_ENTRY;
|
|
2414
2429
|
await writeJson(mcpPath, { ...existing, mcpServers });
|
|
@@ -2417,15 +2432,15 @@ async function installMcp(projectDir) {
|
|
|
2417
2432
|
async function installFullPlugin(projectDir) {
|
|
2418
2433
|
const dir = pluginDir(projectDir);
|
|
2419
2434
|
for (const [rel, content] of Object.entries(buildClaudePluginFiles())) {
|
|
2420
|
-
const dest =
|
|
2421
|
-
await fs6.mkdir(
|
|
2435
|
+
const dest = path35__default.join(dir, rel);
|
|
2436
|
+
await fs6.mkdir(path35__default.dirname(dest), { recursive: true });
|
|
2422
2437
|
await fs6.writeFile(dest, content);
|
|
2423
2438
|
}
|
|
2424
|
-
const projectSkillsDir =
|
|
2439
|
+
const projectSkillsDir = path35__default.join(projectDir, ".skaile", "skills");
|
|
2425
2440
|
if (existsSync(projectSkillsDir)) {
|
|
2426
|
-
await copyDir(projectSkillsDir,
|
|
2441
|
+
await copyDir(projectSkillsDir, path35__default.join(dir, "skills"));
|
|
2427
2442
|
}
|
|
2428
|
-
const settingsPath =
|
|
2443
|
+
const settingsPath = path35__default.join(projectDir, ".claude", "settings.json");
|
|
2429
2444
|
const settings = await readJsonStrict(settingsPath) ?? {};
|
|
2430
2445
|
const plugins = settings.plugins ?? [];
|
|
2431
2446
|
if (!plugins.includes(dir)) plugins.push(dir);
|
|
@@ -2433,8 +2448,8 @@ async function installFullPlugin(projectDir) {
|
|
|
2433
2448
|
return { changed: true, method: "plugin" };
|
|
2434
2449
|
}
|
|
2435
2450
|
async function uninstall(projectDir) {
|
|
2436
|
-
const settingsPath =
|
|
2437
|
-
const mcpPath =
|
|
2451
|
+
const settingsPath = path35__default.join(projectDir, ".claude", "settings.json");
|
|
2452
|
+
const mcpPath = path35__default.join(projectDir, ".claude", "mcp.json");
|
|
2438
2453
|
const dir = pluginDir(projectDir);
|
|
2439
2454
|
let changed = false;
|
|
2440
2455
|
const settings = await readJsonStrict(settingsPath);
|
|
@@ -2468,12 +2483,12 @@ async function uninstall(projectDir) {
|
|
|
2468
2483
|
async function detectInstall(projectDir) {
|
|
2469
2484
|
const dir = pluginDir(projectDir);
|
|
2470
2485
|
const settings = await readJsonStrict(
|
|
2471
|
-
|
|
2486
|
+
path35__default.join(projectDir, ".claude", "settings.json")
|
|
2472
2487
|
);
|
|
2473
|
-
if (existsSync(
|
|
2488
|
+
if (existsSync(path35__default.join(dir, ".claude-plugin", "plugin.json")) && settings?.plugins?.includes(dir)) {
|
|
2474
2489
|
return { method: "plugin", pluginPath: dir };
|
|
2475
2490
|
}
|
|
2476
|
-
const mcp = await readJsonStrict(
|
|
2491
|
+
const mcp = await readJsonStrict(path35__default.join(projectDir, ".claude", "mcp.json"));
|
|
2477
2492
|
if (mcp?.mcpServers && SKAILE_MCP_NAME in mcp.mcpServers) {
|
|
2478
2493
|
return { method: "mcp" };
|
|
2479
2494
|
}
|
|
@@ -2482,7 +2497,7 @@ async function detectInstall(projectDir) {
|
|
|
2482
2497
|
async function enable(projectDir) {
|
|
2483
2498
|
const detected = await detectInstall(projectDir);
|
|
2484
2499
|
if (!detected) throw new Error("plugin not installed for claude-code");
|
|
2485
|
-
const settingsPath =
|
|
2500
|
+
const settingsPath = path35__default.join(projectDir, ".claude", "settings.json");
|
|
2486
2501
|
const settings = await readJsonStrict(settingsPath) ?? {};
|
|
2487
2502
|
if (detected.method === "plugin") {
|
|
2488
2503
|
const disabled2 = settings.disabledPlugins ?? [];
|
|
@@ -2504,7 +2519,7 @@ async function enable(projectDir) {
|
|
|
2504
2519
|
async function disable(projectDir) {
|
|
2505
2520
|
const detected = await detectInstall(projectDir);
|
|
2506
2521
|
if (!detected) throw new Error("plugin not installed for claude-code");
|
|
2507
|
-
const settingsPath =
|
|
2522
|
+
const settingsPath = path35__default.join(projectDir, ".claude", "settings.json");
|
|
2508
2523
|
const settings = await readJsonStrict(settingsPath) ?? {};
|
|
2509
2524
|
if (detected.method === "plugin") {
|
|
2510
2525
|
const list2 = settings.disabledPlugins ?? [];
|
|
@@ -2524,12 +2539,12 @@ async function disable(projectDir) {
|
|
|
2524
2539
|
return { changed: true };
|
|
2525
2540
|
}
|
|
2526
2541
|
async function status(projectDir) {
|
|
2527
|
-
const settingsPath =
|
|
2528
|
-
const mcpPath =
|
|
2542
|
+
const settingsPath = path35__default.join(projectDir, ".claude", "settings.json");
|
|
2543
|
+
const mcpPath = path35__default.join(projectDir, ".claude", "mcp.json");
|
|
2529
2544
|
const dir = pluginDir(projectDir);
|
|
2530
2545
|
const settings = await readJsonStrict(settingsPath);
|
|
2531
2546
|
const mcp = await readJsonStrict(mcpPath);
|
|
2532
|
-
const pluginInstalled = !!(existsSync(
|
|
2547
|
+
const pluginInstalled = !!(existsSync(path35__default.join(dir, ".claude-plugin", "plugin.json")) && settings?.plugins?.includes(dir));
|
|
2533
2548
|
const mcpInstalled = !!(mcp?.mcpServers && SKAILE_MCP_NAME in mcp.mcpServers);
|
|
2534
2549
|
if (!pluginInstalled && !mcpInstalled) {
|
|
2535
2550
|
return {
|
|
@@ -2547,7 +2562,7 @@ async function status(projectDir) {
|
|
|
2547
2562
|
installed: "yes",
|
|
2548
2563
|
enabled: disabled2 ? "no" : "yes",
|
|
2549
2564
|
method: "plugin",
|
|
2550
|
-
location:
|
|
2565
|
+
location: path35__default.relative(projectDir, dir)
|
|
2551
2566
|
};
|
|
2552
2567
|
}
|
|
2553
2568
|
const disabled = settings?.disabledMcpjsonServers?.includes(SKAILE_MCP_NAME) ?? false;
|
|
@@ -2556,7 +2571,7 @@ async function status(projectDir) {
|
|
|
2556
2571
|
installed: "yes",
|
|
2557
2572
|
enabled: disabled ? "no" : "yes",
|
|
2558
2573
|
method: "mcp",
|
|
2559
|
-
location:
|
|
2574
|
+
location: path35__default.relative(projectDir, mcpPath)
|
|
2560
2575
|
};
|
|
2561
2576
|
}
|
|
2562
2577
|
var SKAILE_MCP_NAME2 = "skaile-workspace";
|
|
@@ -2583,7 +2598,7 @@ async function readConfig(p7) {
|
|
|
2583
2598
|
}
|
|
2584
2599
|
}
|
|
2585
2600
|
async function writeConfig(p7, value) {
|
|
2586
|
-
await fs6.mkdir(
|
|
2601
|
+
await fs6.mkdir(path35__default.dirname(p7), { recursive: true });
|
|
2587
2602
|
const cleaned = {};
|
|
2588
2603
|
for (const [k, v] of Object.entries(value)) {
|
|
2589
2604
|
if (v === void 0) continue;
|
|
@@ -2592,7 +2607,7 @@ async function writeConfig(p7, value) {
|
|
|
2592
2607
|
await fs6.writeFile(p7, stringify$1(cleaned));
|
|
2593
2608
|
}
|
|
2594
2609
|
function configPath(projectDir) {
|
|
2595
|
-
return
|
|
2610
|
+
return path35__default.join(projectDir, ".codex", "config.toml");
|
|
2596
2611
|
}
|
|
2597
2612
|
async function install2(projectDir) {
|
|
2598
2613
|
const p7 = configPath(projectDir);
|
|
@@ -2603,7 +2618,7 @@ async function install2(projectDir) {
|
|
|
2603
2618
|
const matches = previous && JSON.stringify(previous) === JSON.stringify(next);
|
|
2604
2619
|
let warning;
|
|
2605
2620
|
if (previous && !matches) {
|
|
2606
|
-
warning = `overwrote existing ${SKAILE_MCP_NAME2} entry in ${
|
|
2621
|
+
warning = `overwrote existing ${SKAILE_MCP_NAME2} entry in ${path35__default.relative(projectDir, p7)}`;
|
|
2607
2622
|
}
|
|
2608
2623
|
if (matches) return { changed: false, method: "toml" };
|
|
2609
2624
|
servers[SKAILE_MCP_NAME2] = next;
|
|
@@ -2644,12 +2659,12 @@ async function status2(projectDir) {
|
|
|
2644
2659
|
installed: "yes",
|
|
2645
2660
|
enabled: "n/a",
|
|
2646
2661
|
method: "mcp",
|
|
2647
|
-
location:
|
|
2662
|
+
location: path35__default.relative(projectDir, p7)
|
|
2648
2663
|
};
|
|
2649
2664
|
}
|
|
2650
2665
|
async function install3(projectDir) {
|
|
2651
|
-
const extDir =
|
|
2652
|
-
const extPath =
|
|
2666
|
+
const extDir = path35__default.join(projectDir, ".omp", "extensions");
|
|
2667
|
+
const extPath = path35__default.join(extDir, "skaile.ts");
|
|
2653
2668
|
await fs6.mkdir(extDir, { recursive: true });
|
|
2654
2669
|
const { WorkspacePlugin } = await import('../workspace-plugin/index.js');
|
|
2655
2670
|
const plugin = new WorkspacePlugin({ projectDir });
|
|
@@ -2664,7 +2679,7 @@ async function install3(projectDir) {
|
|
|
2664
2679
|
return { changed: true, method: "generated" };
|
|
2665
2680
|
}
|
|
2666
2681
|
async function uninstall3(projectDir) {
|
|
2667
|
-
const extPath =
|
|
2682
|
+
const extPath = path35__default.join(projectDir, ".omp", "extensions", "skaile.ts");
|
|
2668
2683
|
try {
|
|
2669
2684
|
await fs6.unlink(extPath);
|
|
2670
2685
|
return { changed: true };
|
|
@@ -2673,14 +2688,14 @@ async function uninstall3(projectDir) {
|
|
|
2673
2688
|
}
|
|
2674
2689
|
}
|
|
2675
2690
|
async function status3(projectDir) {
|
|
2676
|
-
const extPath =
|
|
2691
|
+
const extPath = path35__default.join(projectDir, ".omp", "extensions", "skaile.ts");
|
|
2677
2692
|
if (existsSync(extPath)) {
|
|
2678
2693
|
return {
|
|
2679
2694
|
backend: "omp",
|
|
2680
2695
|
installed: "yes",
|
|
2681
2696
|
enabled: "n/a",
|
|
2682
2697
|
method: "extension",
|
|
2683
|
-
location:
|
|
2698
|
+
location: path35__default.relative(projectDir, extPath)
|
|
2684
2699
|
};
|
|
2685
2700
|
}
|
|
2686
2701
|
return {
|
|
@@ -2743,7 +2758,7 @@ async function installCodex(projectDir) {
|
|
|
2743
2758
|
console.log(` ${S.dim("\u2192")} Restart Codex CLI to pick up the change.`);
|
|
2744
2759
|
}
|
|
2745
2760
|
async function runInstall(opts) {
|
|
2746
|
-
const projectDir =
|
|
2761
|
+
const projectDir = path35__default.resolve(opts.projectDir);
|
|
2747
2762
|
const targets = resolveDriver(opts.driver);
|
|
2748
2763
|
let exitCode = 0;
|
|
2749
2764
|
if (targets.includes("claude-code")) {
|
|
@@ -2777,7 +2792,7 @@ async function uninstallCodex(projectDir) {
|
|
|
2777
2792
|
else logInfo(`codex: not installed`);
|
|
2778
2793
|
}
|
|
2779
2794
|
async function runUninstall(opts) {
|
|
2780
|
-
const projectDir =
|
|
2795
|
+
const projectDir = path35__default.resolve(opts.projectDir);
|
|
2781
2796
|
const targets = resolveDriver(opts.driver);
|
|
2782
2797
|
let exitCode = 0;
|
|
2783
2798
|
if (targets.includes("claude-code")) {
|
|
@@ -2820,7 +2835,7 @@ async function toggleTarget(t, projectDir, action3) {
|
|
|
2820
2835
|
});
|
|
2821
2836
|
}
|
|
2822
2837
|
async function runToggle(opts, action3) {
|
|
2823
|
-
const projectDir =
|
|
2838
|
+
const projectDir = path35__default.resolve(opts.projectDir);
|
|
2824
2839
|
const requestedAll = opts.driver === "all";
|
|
2825
2840
|
const targets = resolveDriver(opts.driver);
|
|
2826
2841
|
const usageError = checkToggleSupported(targets, requestedAll, action3);
|
|
@@ -2832,7 +2847,7 @@ async function runToggle(opts, action3) {
|
|
|
2832
2847
|
return exitCode;
|
|
2833
2848
|
}
|
|
2834
2849
|
async function runStatus2(opts) {
|
|
2835
|
-
const projectDir =
|
|
2850
|
+
const projectDir = path35__default.resolve(opts.projectDir);
|
|
2836
2851
|
const targets = resolveDriver(opts.driver);
|
|
2837
2852
|
const rows = [];
|
|
2838
2853
|
let exitCode = 0;
|
|
@@ -2903,7 +2918,7 @@ async function runHook(event) {
|
|
|
2903
2918
|
await plugin.shutdown();
|
|
2904
2919
|
return;
|
|
2905
2920
|
}
|
|
2906
|
-
const store = new PluginStore(
|
|
2921
|
+
const store = new PluginStore(path35__default.join(projectDir, ".skaile", "plugin-state.json"));
|
|
2907
2922
|
await store.load();
|
|
2908
2923
|
const status4 = store.get("connector:status");
|
|
2909
2924
|
if (status4 && typeof status4 === "object" && Object.keys(status4).length > 0) {
|
|
@@ -2979,7 +2994,7 @@ async function indexLibrary(lib, index) {
|
|
|
2979
2994
|
}
|
|
2980
2995
|
}
|
|
2981
2996
|
function domainPublisher(libraryPath, domain) {
|
|
2982
|
-
const domainFile =
|
|
2997
|
+
const domainFile = path35.join(libraryPath, domain, "DOMAIN.md");
|
|
2983
2998
|
if (!fs13.existsSync(domainFile)) return void 0;
|
|
2984
2999
|
try {
|
|
2985
3000
|
const { data } = parseFrontmatter(fs13.readFileSync(domainFile, "utf8"));
|
|
@@ -3062,7 +3077,7 @@ function makeLibraryCommand() {
|
|
|
3062
3077
|
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(
|
|
3063
3078
|
async (name, opts) => {
|
|
3064
3079
|
const libDir = resolveLibraryDir();
|
|
3065
|
-
const libPath =
|
|
3080
|
+
const libPath = path35.join(libDir, name);
|
|
3066
3081
|
const ownership = opts.contributor ? "contributor" : opts.reader ? "reader" : "owner";
|
|
3067
3082
|
const { manager, close } = await openLibraryManager();
|
|
3068
3083
|
try {
|
|
@@ -3134,21 +3149,21 @@ function makeLibraryCommand() {
|
|
|
3134
3149
|
}
|
|
3135
3150
|
const effectiveKind = opts.kind ?? kind;
|
|
3136
3151
|
const am2 = new AssetManager({ projectDir: process.cwd() });
|
|
3137
|
-
const destDir = opts.dir ?
|
|
3152
|
+
const destDir = opts.dir ? path35.join(target.path, opts.dir) : target.path;
|
|
3138
3153
|
const res = am2.create(name, effectiveKind, destDir);
|
|
3139
3154
|
if (!res.ok) {
|
|
3140
3155
|
logErr(res.path);
|
|
3141
3156
|
process.exit(1);
|
|
3142
3157
|
}
|
|
3143
3158
|
logOk(`Created ${effectiveKind}: ${pc5.dim(res.path)}`);
|
|
3144
|
-
const domain2 = opts.dir ? opts.dir.split(
|
|
3159
|
+
const domain2 = opts.dir ? opts.dir.split(path35.sep)[0] : void 0;
|
|
3145
3160
|
const publisher = resolveLibraryPublisher(target, opts, domain2, getStoreIdentity());
|
|
3146
3161
|
stampAssetPublisher(res.path, publisher);
|
|
3147
3162
|
ensureManifestPublisher(target.path, publisher);
|
|
3148
3163
|
upsertManifestAsset(target.path, {
|
|
3149
3164
|
kind: effectiveKind,
|
|
3150
3165
|
name,
|
|
3151
|
-
root:
|
|
3166
|
+
root: path35.relative(target.path, res.path) || name,
|
|
3152
3167
|
version: "0.1.0"
|
|
3153
3168
|
});
|
|
3154
3169
|
const idx = await indexLibrary(target, library);
|
|
@@ -3223,7 +3238,7 @@ function makeLibraryCommand() {
|
|
|
3223
3238
|
const { manager, close } = await openLibraryManager();
|
|
3224
3239
|
try {
|
|
3225
3240
|
const target = await resolveTargetLibrary(manager, opts.library);
|
|
3226
|
-
const domainFile =
|
|
3241
|
+
const domainFile = path35.join(target.path, name, "DOMAIN.md");
|
|
3227
3242
|
if (!existsSync(domainFile)) {
|
|
3228
3243
|
logErr(`Domain "${name}" not found in "${target.name}" (no ${domainFile}).`);
|
|
3229
3244
|
process.exit(1);
|
|
@@ -3246,8 +3261,8 @@ function makeLibraryCommand() {
|
|
|
3246
3261
|
const { manager, close } = await openLibraryManager();
|
|
3247
3262
|
try {
|
|
3248
3263
|
const lib = await manager.requireLibrary(oldName);
|
|
3249
|
-
const parent =
|
|
3250
|
-
const newPath =
|
|
3264
|
+
const parent = path35.dirname(lib.path);
|
|
3265
|
+
const newPath = path35.join(parent, newName);
|
|
3251
3266
|
if (fs13.existsSync(newPath)) {
|
|
3252
3267
|
logErr(`Target directory already exists: ${newPath}`);
|
|
3253
3268
|
process.exit(1);
|
|
@@ -3407,16 +3422,16 @@ function makeLibraryCommand() {
|
|
|
3407
3422
|
});
|
|
3408
3423
|
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(
|
|
3409
3424
|
async (lib, opts) => {
|
|
3410
|
-
const { runLibraryPublish } = await import('../library-publish-
|
|
3425
|
+
const { runLibraryPublish } = await import('../library-publish-CVYFMVGR.js');
|
|
3411
3426
|
await withStoreErrorHandling(() => runLibraryPublish(lib, opts));
|
|
3412
3427
|
}
|
|
3413
3428
|
);
|
|
3414
3429
|
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) => {
|
|
3415
|
-
const { runLibraryRegister } = await import('../library-publish-
|
|
3430
|
+
const { runLibraryRegister } = await import('../library-publish-CVYFMVGR.js');
|
|
3416
3431
|
await withStoreErrorHandling(() => runLibraryRegister(lib, opts));
|
|
3417
3432
|
});
|
|
3418
3433
|
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) => {
|
|
3419
|
-
const { runLibraryYank } = await import('../library-publish-
|
|
3434
|
+
const { runLibraryYank } = await import('../library-publish-CVYFMVGR.js');
|
|
3420
3435
|
await withStoreErrorHandling(() => runLibraryYank(lib, opts));
|
|
3421
3436
|
});
|
|
3422
3437
|
return cmd;
|
|
@@ -3433,14 +3448,14 @@ function stampAssetPublisher(assetDir, publisher) {
|
|
|
3433
3448
|
const markers = ["SKILL.md", "AGENT.md", "CONTRACT.md"];
|
|
3434
3449
|
let markerFile;
|
|
3435
3450
|
for (const m of markers) {
|
|
3436
|
-
if (fs13.existsSync(
|
|
3437
|
-
markerFile =
|
|
3451
|
+
if (fs13.existsSync(path35.join(assetDir, m))) {
|
|
3452
|
+
markerFile = path35.join(assetDir, m);
|
|
3438
3453
|
break;
|
|
3439
3454
|
}
|
|
3440
3455
|
}
|
|
3441
3456
|
if (!markerFile) {
|
|
3442
3457
|
const promptMd = fs13.readdirSync(assetDir).find((f) => f.endsWith(".prompt.md"));
|
|
3443
|
-
if (promptMd) markerFile =
|
|
3458
|
+
if (promptMd) markerFile = path35.join(assetDir, promptMd);
|
|
3444
3459
|
}
|
|
3445
3460
|
if (!markerFile) return;
|
|
3446
3461
|
try {
|
|
@@ -3467,7 +3482,7 @@ function ensureManifestPublisher(libraryPath, publisher) {
|
|
|
3467
3482
|
async function syncManifestWithDisk(libraryPath, libraryName) {
|
|
3468
3483
|
const publisher = loadSkPublishManifest(libraryPath)?.publisher ?? slugifyAssetName(libraryName);
|
|
3469
3484
|
for (const e of await scanDirectory(libraryPath, publisher)) {
|
|
3470
|
-
const root =
|
|
3485
|
+
const root = path35.relative(libraryPath, path35.dirname(e.source)) || e.name;
|
|
3471
3486
|
upsertManifestAsset(libraryPath, { kind: e.kind, name: e.name, root, version: e.version });
|
|
3472
3487
|
}
|
|
3473
3488
|
}
|
|
@@ -3509,9 +3524,9 @@ async function printOverallStatus(projectDir, asJson) {
|
|
|
3509
3524
|
} catch {
|
|
3510
3525
|
secretsStrategy = "unavailable";
|
|
3511
3526
|
}
|
|
3512
|
-
const resolvedProjectDir =
|
|
3513
|
-
const hasWorkspaceConfig = existsSync(
|
|
3514
|
-
const hasLockFile = existsSync(
|
|
3527
|
+
const resolvedProjectDir = path35.resolve(projectDir);
|
|
3528
|
+
const hasWorkspaceConfig = existsSync(path35.join(resolvedProjectDir, "skaile.yaml"));
|
|
3529
|
+
const hasLockFile = existsSync(path35.join(resolvedProjectDir, "skaile.lock.yaml"));
|
|
3515
3530
|
let assignments = [];
|
|
3516
3531
|
if (hasWorkspaceConfig) {
|
|
3517
3532
|
try {
|
|
@@ -4138,7 +4153,7 @@ function scheduleSoftDepPreview() {
|
|
|
4138
4153
|
}
|
|
4139
4154
|
async function loadAssets() {
|
|
4140
4155
|
softDepPreviewCache.clear();
|
|
4141
|
-
const { gatherAssetFeeds } = await import('../asset-feeds-
|
|
4156
|
+
const { gatherAssetFeeds } = await import('../asset-feeds-AGAH5OHC.js');
|
|
4142
4157
|
const { entries, domains, notes } = await gatherAssetFeeds(am, am.projectDir);
|
|
4143
4158
|
if (notes.length > 0) {
|
|
4144
4159
|
state.message = notes.map((n) => `[${n.feed}] ${n.message}`).join(" \u2022 ");
|
|
@@ -4160,7 +4175,7 @@ function rebuildSourceTree() {
|
|
|
4160
4175
|
rebuildVisibleSources();
|
|
4161
4176
|
}
|
|
4162
4177
|
function sourceOrgRepo(s) {
|
|
4163
|
-
const parts = s.path.split(
|
|
4178
|
+
const parts = s.path.split(path35__default.sep).filter(Boolean);
|
|
4164
4179
|
if (parts.length < 2) return null;
|
|
4165
4180
|
return { org: parts[parts.length - 2], repo: parts[parts.length - 1] };
|
|
4166
4181
|
}
|
|
@@ -4344,14 +4359,14 @@ function reconcileCollapsedSets(rows) {
|
|
|
4344
4359
|
async function loadSourcesAndLibraries() {
|
|
4345
4360
|
try {
|
|
4346
4361
|
const [{ openLibraryManager: openLibraryManager2 }, { skaileHomeDir }, { getGlobalCacheDir: getGlobalCacheDir2 }] = await Promise.all([
|
|
4347
|
-
import('../open-library-
|
|
4362
|
+
import('../open-library-XB65LU3M.js'),
|
|
4348
4363
|
import('../library/index.js'),
|
|
4349
4364
|
import('../core/index.js')
|
|
4350
4365
|
]);
|
|
4351
4366
|
const { manager, library, close } = await openLibraryManager2();
|
|
4352
4367
|
try {
|
|
4353
4368
|
const newRoot = getGlobalCacheDir2();
|
|
4354
|
-
const legacyRoot =
|
|
4369
|
+
const legacyRoot = path35__default.join(skaileHomeDir(), "sources");
|
|
4355
4370
|
const isSourceRow = (l) => l.path.startsWith(newRoot) || l.path.startsWith(legacyRoot);
|
|
4356
4371
|
const libs = await manager.listLibraries();
|
|
4357
4372
|
const defs = await library.listAssetDefs();
|
|
@@ -5411,7 +5426,7 @@ async function run(projectDir) {
|
|
|
5411
5426
|
}
|
|
5412
5427
|
function makeManageCommand() {
|
|
5413
5428
|
return new Command("manage").description("Interactive TUI for managing assets, sources, and libraries").option("--project-dir <path>", "Project directory", process.cwd()).action(async (opts) => {
|
|
5414
|
-
await run(
|
|
5429
|
+
await run(path35__default.resolve(opts.projectDir));
|
|
5415
5430
|
});
|
|
5416
5431
|
}
|
|
5417
5432
|
function makeMcpServerCommand() {
|
|
@@ -5454,8 +5469,8 @@ function makeNpxCommand() {
|
|
|
5454
5469
|
skills.command("add <url>").description(
|
|
5455
5470
|
"Clone a repo, register it in the project's skaile.yaml sources[], and install a skill from it"
|
|
5456
5471
|
).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) => {
|
|
5457
|
-
const projectDir =
|
|
5458
|
-
const projYaml =
|
|
5472
|
+
const projectDir = path35__default.resolve(opts.projectDir);
|
|
5473
|
+
const projYaml = path35__default.join(projectDir, "skaile.yaml");
|
|
5459
5474
|
if (!existsSync(projYaml)) {
|
|
5460
5475
|
logErr(`No skaile.yaml in ${projectDir} \u2014 run \`skaile init\` first.`);
|
|
5461
5476
|
process.exit(1);
|
|
@@ -5468,11 +5483,11 @@ function makeNpxCommand() {
|
|
|
5468
5483
|
}
|
|
5469
5484
|
const spinner4 = p5.spinner();
|
|
5470
5485
|
const key = sourceCacheKey(url);
|
|
5471
|
-
const clonePath =
|
|
5486
|
+
const clonePath = path35__default.join(getGlobalCacheDir(), key);
|
|
5472
5487
|
spinner4.start(`Cloning ${url}`);
|
|
5473
5488
|
try {
|
|
5474
5489
|
if (!existsSync(clonePath)) {
|
|
5475
|
-
mkdirSync(
|
|
5490
|
+
mkdirSync(path35__default.dirname(clonePath), { recursive: true });
|
|
5476
5491
|
execSync(`git clone ${url} ${clonePath}`, { stdio: "ignore" });
|
|
5477
5492
|
}
|
|
5478
5493
|
spinner4.stop(`Cloned to ${key}`);
|
|
@@ -5518,7 +5533,7 @@ function makeNpxCommand() {
|
|
|
5518
5533
|
return npx;
|
|
5519
5534
|
}
|
|
5520
5535
|
function resolvePublisher(clonePath, url) {
|
|
5521
|
-
const manifestPath =
|
|
5536
|
+
const manifestPath = path35__default.join(clonePath, SKAILE_MANIFEST_FILENAME);
|
|
5522
5537
|
if (existsSync(manifestPath)) {
|
|
5523
5538
|
try {
|
|
5524
5539
|
const { manifest } = decodeSkaileManifest(readFileSync(manifestPath, "utf8"));
|
|
@@ -5531,12 +5546,12 @@ function resolvePublisher(clonePath, url) {
|
|
|
5531
5546
|
return url.match(/github\.com[/:]([^/]+)\/[^/]+/)?.[1];
|
|
5532
5547
|
}
|
|
5533
5548
|
function resolveSkillName(clonePath, requested) {
|
|
5534
|
-
const skillsDir =
|
|
5535
|
-
if (existsSync(
|
|
5549
|
+
const skillsDir = path35__default.join(clonePath, "skills");
|
|
5550
|
+
if (existsSync(path35__default.join(skillsDir, requested, "SKILL.md"))) return requested;
|
|
5536
5551
|
if (!existsSync(skillsDir)) return requested;
|
|
5537
5552
|
for (const entry of readdirSync(skillsDir, { withFileTypes: true })) {
|
|
5538
5553
|
if (!entry.isDirectory()) continue;
|
|
5539
|
-
const md =
|
|
5554
|
+
const md = path35__default.join(skillsDir, entry.name, "SKILL.md");
|
|
5540
5555
|
if (!existsSync(md)) continue;
|
|
5541
5556
|
try {
|
|
5542
5557
|
const { data } = parseFrontmatter(readFileSync(md, "utf8"));
|
|
@@ -5551,7 +5566,7 @@ function makeOutdatedCommand() {
|
|
|
5551
5566
|
new Option("--target <agent>", "Driver target").default("claude-code").choices(SUPPORTED_DRIVER_TARGETS)
|
|
5552
5567
|
).action((name, opts) => {
|
|
5553
5568
|
const am2 = new AssetManager({
|
|
5554
|
-
projectDir:
|
|
5569
|
+
projectDir: path35__default.resolve(opts.projectDir),
|
|
5555
5570
|
driverTarget: opts.target
|
|
5556
5571
|
});
|
|
5557
5572
|
const entries = am2.outdated();
|
|
@@ -5580,7 +5595,7 @@ function makeOutdatedCommand() {
|
|
|
5580
5595
|
function makePatchCommand() {
|
|
5581
5596
|
const cmd = new Command("patch").description("Patch workflow for skill improvement");
|
|
5582
5597
|
cmd.command("extract <ref>").alias("start").description("Extract asset for local editing").option("--project-dir <path>", "Project directory", process.cwd()).action(async (ref, opts) => {
|
|
5583
|
-
const am2 = new AssetManager({ projectDir:
|
|
5598
|
+
const am2 = new AssetManager({ projectDir: path35__default.resolve(opts.projectDir) });
|
|
5584
5599
|
try {
|
|
5585
5600
|
const dest = await am2.patch(ref);
|
|
5586
5601
|
logOk(`Extracted to ${S.dim(dest)}`);
|
|
@@ -5591,7 +5606,7 @@ function makePatchCommand() {
|
|
|
5591
5606
|
}
|
|
5592
5607
|
});
|
|
5593
5608
|
cmd.command("commit <ref>").description("Generate .patch file from edits").option("--project-dir <path>", "Project directory", process.cwd()).action(async (ref, opts) => {
|
|
5594
|
-
const am2 = new AssetManager({ projectDir:
|
|
5609
|
+
const am2 = new AssetManager({ projectDir: path35__default.resolve(opts.projectDir) });
|
|
5595
5610
|
try {
|
|
5596
5611
|
const patchFile = await am2.patchCommit(ref);
|
|
5597
5612
|
logOk(`Patch saved to ${S.dim(patchFile)}`);
|
|
@@ -5602,7 +5617,7 @@ function makePatchCommand() {
|
|
|
5602
5617
|
}
|
|
5603
5618
|
});
|
|
5604
5619
|
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) => {
|
|
5605
|
-
const am2 = new AssetManager({ projectDir:
|
|
5620
|
+
const am2 = new AssetManager({ projectDir: path35__default.resolve(opts.projectDir) });
|
|
5606
5621
|
try {
|
|
5607
5622
|
await am2.patchSubmit(ref);
|
|
5608
5623
|
logOk("Patch applied to repo clone and committed.");
|
|
@@ -5615,7 +5630,7 @@ function makePatchCommand() {
|
|
|
5615
5630
|
}
|
|
5616
5631
|
});
|
|
5617
5632
|
cmd.command("remove <ref>").description("Remove local patch after upstream merge").option("--project-dir <path>", "Project directory", process.cwd()).action((ref, opts) => {
|
|
5618
|
-
const am2 = new AssetManager({ projectDir:
|
|
5633
|
+
const am2 = new AssetManager({ projectDir: path35__default.resolve(opts.projectDir) });
|
|
5619
5634
|
am2.patchRemove(ref);
|
|
5620
5635
|
logOk(`Patch removed for ${ref}`);
|
|
5621
5636
|
});
|
|
@@ -5633,7 +5648,7 @@ function action2(fn) {
|
|
|
5633
5648
|
};
|
|
5634
5649
|
}
|
|
5635
5650
|
async function reconcileAndReport(projectDir, plugins) {
|
|
5636
|
-
const { reconcilePlugins } = await import('../plugin-store-
|
|
5651
|
+
const { reconcilePlugins } = await import('../plugin-store-EOP3S7OU.js');
|
|
5637
5652
|
if (plugins.length === 0) {
|
|
5638
5653
|
logInfo("No plugins declared \u2014 nothing to reconcile.");
|
|
5639
5654
|
return;
|
|
@@ -5647,10 +5662,10 @@ async function reconcileAndReport(projectDir, plugins) {
|
|
|
5647
5662
|
}
|
|
5648
5663
|
}
|
|
5649
5664
|
async function runInstall2(spec, opts) {
|
|
5650
|
-
const projectDir =
|
|
5665
|
+
const projectDir = path35__default.resolve(opts.projectDir);
|
|
5651
5666
|
const { WorkspaceYamlEditor: WorkspaceYamlEditor2 } = await import('../core/index.js');
|
|
5652
|
-
const { specName } = await import('../plugin-store-
|
|
5653
|
-
const yamlPath =
|
|
5667
|
+
const { specName } = await import('../plugin-store-EOP3S7OU.js');
|
|
5668
|
+
const yamlPath = path35__default.join(projectDir, "skaile.yaml");
|
|
5654
5669
|
const editor = WorkspaceYamlEditor2.load(yamlPath);
|
|
5655
5670
|
const replaced = editor.addPlugin(spec, specName);
|
|
5656
5671
|
editor.save();
|
|
@@ -5659,10 +5674,10 @@ async function runInstall2(spec, opts) {
|
|
|
5659
5674
|
await reconcileAndReport(projectDir, editor.getPlugins());
|
|
5660
5675
|
}
|
|
5661
5676
|
async function runRemove(name, opts) {
|
|
5662
|
-
const projectDir =
|
|
5677
|
+
const projectDir = path35__default.resolve(opts.projectDir);
|
|
5663
5678
|
const { WorkspaceYamlEditor: WorkspaceYamlEditor2 } = await import('../core/index.js');
|
|
5664
|
-
const { specName } = await import('../plugin-store-
|
|
5665
|
-
const yamlPath =
|
|
5679
|
+
const { specName } = await import('../plugin-store-EOP3S7OU.js');
|
|
5680
|
+
const yamlPath = path35__default.join(projectDir, "skaile.yaml");
|
|
5666
5681
|
const editor = WorkspaceYamlEditor2.load(yamlPath);
|
|
5667
5682
|
const removed = editor.removePlugin(name, specName);
|
|
5668
5683
|
if (!removed) {
|
|
@@ -5674,7 +5689,7 @@ async function runRemove(name, opts) {
|
|
|
5674
5689
|
await reconcileAndReport(projectDir, editor.getPlugins());
|
|
5675
5690
|
}
|
|
5676
5691
|
async function runList(opts) {
|
|
5677
|
-
const projectDir =
|
|
5692
|
+
const projectDir = path35__default.resolve(opts.projectDir);
|
|
5678
5693
|
const { resolveSkWorkspaceConfig: resolveSkWorkspaceConfig2 } = await import('../core/index.js');
|
|
5679
5694
|
const config = resolveSkWorkspaceConfig2(projectDir);
|
|
5680
5695
|
const declared = config.plugins ?? [];
|
|
@@ -5689,7 +5704,7 @@ async function runList(opts) {
|
|
|
5689
5704
|
const registry = createPluginRegistry();
|
|
5690
5705
|
if (declared.length > 0) {
|
|
5691
5706
|
try {
|
|
5692
|
-
const { loadPlugins } = await import('../plugin-store-
|
|
5707
|
+
const { loadPlugins } = await import('../plugin-store-EOP3S7OU.js');
|
|
5693
5708
|
const result = await loadPlugins(projectDir, declared, registry);
|
|
5694
5709
|
for (const f of result.failed) logWarn(f.error);
|
|
5695
5710
|
} catch (err) {
|
|
@@ -5864,7 +5879,7 @@ function neededSources(config, lock) {
|
|
|
5864
5879
|
}
|
|
5865
5880
|
function sourcesWithSidecar(sources) {
|
|
5866
5881
|
const dir = getStoreManifestsDir();
|
|
5867
|
-
return sources.filter((s) => existsSync(
|
|
5882
|
+
return sources.filter((s) => existsSync(path35.join(dir, `${storeManifestSlug(s.url)}.yaml`))).map((s) => s.url);
|
|
5868
5883
|
}
|
|
5869
5884
|
function compact(obj) {
|
|
5870
5885
|
const out = {};
|
|
@@ -5980,7 +5995,7 @@ function makePresetCommand() {
|
|
|
5980
5995
|
cmd.command("init [name]").description("Scaffold a new .preset.yaml file").option("--dir <path>", "Output directory", process.cwd()).action(async (name, opts) => {
|
|
5981
5996
|
const presetName = name ?? "my-preset";
|
|
5982
5997
|
const filename = `${presetName}.preset.yaml`;
|
|
5983
|
-
const outPath =
|
|
5998
|
+
const outPath = path35__default.join(path35__default.resolve(opts.dir), filename);
|
|
5984
5999
|
if (existsSync(outPath)) {
|
|
5985
6000
|
logErr(`File already exists: ${outPath}`);
|
|
5986
6001
|
logInfo("Choose a different name or remove the existing file.");
|
|
@@ -6013,7 +6028,7 @@ function makePresetCommand() {
|
|
|
6013
6028
|
return cmd;
|
|
6014
6029
|
}
|
|
6015
6030
|
async function runPresetExport(name, opts) {
|
|
6016
|
-
const projectDir =
|
|
6031
|
+
const projectDir = path35__default.resolve(opts.projectDir);
|
|
6017
6032
|
const file = loadSkWorkspaceConfig(projectDir);
|
|
6018
6033
|
if (!file) {
|
|
6019
6034
|
logErr(`No skaile.yaml found in ${projectDir}`);
|
|
@@ -6023,7 +6038,7 @@ async function runPresetExport(name, opts) {
|
|
|
6023
6038
|
const presetName = name ?? file.config.name ?? "my-preset";
|
|
6024
6039
|
let lock = null;
|
|
6025
6040
|
try {
|
|
6026
|
-
lock = readLock(
|
|
6041
|
+
lock = readLock(path35__default.join(projectDir, "skaile.lock.yaml"));
|
|
6027
6042
|
} catch {
|
|
6028
6043
|
lock = null;
|
|
6029
6044
|
}
|
|
@@ -6064,7 +6079,7 @@ async function runPresetExport(name, opts) {
|
|
|
6064
6079
|
const contents = header ? `${header}
|
|
6065
6080
|
${body}` : body;
|
|
6066
6081
|
if (opts.out && opts.dir !== process.cwd()) logWarn("--dir is ignored when --out is set.");
|
|
6067
|
-
const outPath = opts.out ?
|
|
6082
|
+
const outPath = opts.out ? path35__default.resolve(opts.out) : path35__default.join(path35__default.resolve(opts.dir), `${presetName}.preset.yaml`);
|
|
6068
6083
|
if (existsSync(outPath) && !opts.force) {
|
|
6069
6084
|
logErr(`File already exists: ${outPath}`);
|
|
6070
6085
|
logInfo("Pass --force to overwrite, or choose a different --out/--dir.");
|
|
@@ -6076,7 +6091,7 @@ ${body}` : body;
|
|
|
6076
6091
|
logErr(`Failed to write ${outPath}: ${e.message}`);
|
|
6077
6092
|
process.exit(1);
|
|
6078
6093
|
}
|
|
6079
|
-
logOk(`Exported ${S.brand(
|
|
6094
|
+
logOk(`Exported ${S.brand(path35__default.basename(outPath))}`);
|
|
6080
6095
|
logInfo(`Path: ${outPath}`);
|
|
6081
6096
|
if (unresolved.length > 0) {
|
|
6082
6097
|
console.error(S.err("This file is NOT safe to share."));
|
|
@@ -6117,13 +6132,13 @@ function collectInput(value, acc) {
|
|
|
6117
6132
|
return acc;
|
|
6118
6133
|
}
|
|
6119
6134
|
async function runPresetApply(filePath, opts) {
|
|
6120
|
-
const projectDir =
|
|
6135
|
+
const projectDir = path35__default.resolve(opts.projectDir);
|
|
6121
6136
|
const file = loadSkWorkspaceConfig(projectDir);
|
|
6122
6137
|
if (!file) {
|
|
6123
6138
|
logErr("No skaile.yaml \u2014 run `skaile init` first");
|
|
6124
6139
|
process.exit(1);
|
|
6125
6140
|
}
|
|
6126
|
-
const resolved =
|
|
6141
|
+
const resolved = path35__default.resolve(filePath);
|
|
6127
6142
|
if (!existsSync(resolved)) {
|
|
6128
6143
|
logErr(`File not found: ${resolved}`);
|
|
6129
6144
|
process.exit(1);
|
|
@@ -6339,7 +6354,7 @@ async function reportNestedPresetRefs(preset) {
|
|
|
6339
6354
|
}
|
|
6340
6355
|
async function checkPresetCycles(preset, resolved) {
|
|
6341
6356
|
const { detectCycles } = await import('../discovery/index.js');
|
|
6342
|
-
const presetRef =
|
|
6357
|
+
const presetRef = path35__default.basename(resolved, ".preset.yaml");
|
|
6343
6358
|
const edges = [];
|
|
6344
6359
|
for (const item of preset.items) {
|
|
6345
6360
|
if (item.ref) {
|
|
@@ -6391,7 +6406,7 @@ function printPresetSummary(preset, placeholderCount, hasWarnings) {
|
|
|
6391
6406
|
}
|
|
6392
6407
|
}
|
|
6393
6408
|
async function runPresetValidate(filePath) {
|
|
6394
|
-
const resolved =
|
|
6409
|
+
const resolved = path35__default.resolve(filePath);
|
|
6395
6410
|
const preset = await loadPresetForValidation(resolved);
|
|
6396
6411
|
await reportNestedPresetRefs(preset);
|
|
6397
6412
|
await checkPresetCycles(preset, resolved);
|
|
@@ -6441,14 +6456,14 @@ items:
|
|
|
6441
6456
|
}
|
|
6442
6457
|
function makeRebuildCommand() {
|
|
6443
6458
|
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) => {
|
|
6444
|
-
const projectDir =
|
|
6459
|
+
const projectDir = path35__default.resolve(opts.projectDir);
|
|
6445
6460
|
let agentDir;
|
|
6446
6461
|
if (agentArg) {
|
|
6447
6462
|
if (agentArg.includes("/") || agentArg.includes("\\")) {
|
|
6448
|
-
agentDir =
|
|
6463
|
+
agentDir = path35__default.resolve(projectDir, agentArg);
|
|
6449
6464
|
} else {
|
|
6450
6465
|
const resolved = resolveAgentDir(projectDir);
|
|
6451
|
-
agentDir = resolved ??
|
|
6466
|
+
agentDir = resolved ?? path35__default.resolve(projectDir, agentArg);
|
|
6452
6467
|
}
|
|
6453
6468
|
} else {
|
|
6454
6469
|
const resolved = resolveAgentDir(projectDir);
|
|
@@ -6541,12 +6556,12 @@ function makeFlowEventHandler() {
|
|
|
6541
6556
|
}
|
|
6542
6557
|
function makeRunCommand() {
|
|
6543
6558
|
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) => {
|
|
6544
|
-
const projectDir =
|
|
6559
|
+
const projectDir = path35__default.resolve(opts.projectDir);
|
|
6545
6560
|
const cliDriver = opts.driver;
|
|
6546
6561
|
const dryRun = opts.dryRun ?? false;
|
|
6547
6562
|
let flowId = positional[0];
|
|
6548
6563
|
if (!flowId) {
|
|
6549
|
-
const flows = discoverFlows();
|
|
6564
|
+
const flows = discoverFlows(projectDir);
|
|
6550
6565
|
if (flows.length === 0) {
|
|
6551
6566
|
logErr("No flows available.");
|
|
6552
6567
|
process.exit(1);
|
|
@@ -6576,19 +6591,19 @@ function makeRunCommand() {
|
|
|
6576
6591
|
const priorityRoots = [];
|
|
6577
6592
|
let dir = projectDir;
|
|
6578
6593
|
for (let i = 0; i < 6; i++) {
|
|
6579
|
-
const candidate =
|
|
6594
|
+
const candidate = path35__default.join(dir, "ai-assets");
|
|
6580
6595
|
if (fs13__default.existsSync(candidate)) {
|
|
6581
6596
|
priorityRoots.push(candidate);
|
|
6582
6597
|
break;
|
|
6583
6598
|
}
|
|
6584
|
-
dir =
|
|
6599
|
+
dir = path35__default.dirname(dir);
|
|
6585
6600
|
}
|
|
6586
|
-
const flowPath = findFlowFile(flowId, priorityRoots);
|
|
6601
|
+
const flowPath = findFlowFile(flowId, priorityRoots, projectDir);
|
|
6587
6602
|
if (!flowPath) {
|
|
6588
6603
|
const textPrompt = positional.join(" ");
|
|
6589
6604
|
if (!textPrompt.trim()) {
|
|
6590
6605
|
logErr(`Flow not found: ${flowId}`);
|
|
6591
|
-
const available = discoverFlows().map((f) => f.id);
|
|
6606
|
+
const available = discoverFlows(projectDir).map((f) => f.id);
|
|
6592
6607
|
if (available.length > 0) {
|
|
6593
6608
|
console.log(` ${S.dim("Available:")} ${available.map((id) => S.cmd(id)).join(", ")}`);
|
|
6594
6609
|
}
|
|
@@ -6652,7 +6667,7 @@ function makeRunCommand() {
|
|
|
6652
6667
|
}
|
|
6653
6668
|
function makeResumeCommand() {
|
|
6654
6669
|
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) => {
|
|
6655
|
-
const projectDir =
|
|
6670
|
+
const projectDir = path35__default.resolve(opts.projectDir);
|
|
6656
6671
|
const sessionId = opts.session;
|
|
6657
6672
|
const dryRun = opts.dryRun ?? false;
|
|
6658
6673
|
const session = sessionId ? await loadSessionById(projectDir, sessionId) : await loadSession(projectDir);
|
|
@@ -6679,7 +6694,7 @@ function makeResumeCommand() {
|
|
|
6679
6694
|
}
|
|
6680
6695
|
function makeStatusCommand() {
|
|
6681
6696
|
return new Command("status").description("Show current session state").option("--project-dir <path>", "Project directory", process.cwd()).action(async (opts) => {
|
|
6682
|
-
const projectDir =
|
|
6697
|
+
const projectDir = path35__default.resolve(opts.projectDir);
|
|
6683
6698
|
const session = await loadSession(projectDir);
|
|
6684
6699
|
if (!session) {
|
|
6685
6700
|
logInfo("No active session.");
|
|
@@ -6704,7 +6719,7 @@ function makeStatusCommand() {
|
|
|
6704
6719
|
}
|
|
6705
6720
|
function makeClearCommand() {
|
|
6706
6721
|
return new Command("clear").description("Unset current session pointer").option("--project-dir <path>", "Project directory", process.cwd()).action(async (opts) => {
|
|
6707
|
-
const projectDir =
|
|
6722
|
+
const projectDir = path35__default.resolve(opts.projectDir);
|
|
6708
6723
|
await clearSession(projectDir);
|
|
6709
6724
|
logOk("Session cleared.");
|
|
6710
6725
|
});
|
|
@@ -6714,7 +6729,7 @@ function makeReplCommand() {
|
|
|
6714
6729
|
const { findWorkspaceRoot } = await import('../core/index.js');
|
|
6715
6730
|
const { startRepl } = await import('../tui/index.js');
|
|
6716
6731
|
const os2 = await import('os');
|
|
6717
|
-
const userCwd =
|
|
6732
|
+
const userCwd = path35__default.resolve(opts.projectDir ?? process.cwd());
|
|
6718
6733
|
const workspaceRoot = findWorkspaceRoot(userCwd);
|
|
6719
6734
|
let projectDir;
|
|
6720
6735
|
let agentCwd;
|
|
@@ -6736,12 +6751,12 @@ function makeReplCommand() {
|
|
|
6736
6751
|
p5.cancel("Cancelled.");
|
|
6737
6752
|
process.exit(0);
|
|
6738
6753
|
}
|
|
6739
|
-
const tmpDir = fs13__default.mkdtempSync(
|
|
6754
|
+
const tmpDir = fs13__default.mkdtempSync(path35__default.join(os2.tmpdir(), "skaile-repl-"));
|
|
6740
6755
|
projectDir = tmpDir;
|
|
6741
6756
|
agentCwd = userCwd;
|
|
6742
6757
|
logOk(`Temporary workspace: ${S.cmd(tmpDir)}`);
|
|
6743
6758
|
if (!driverOverride) {
|
|
6744
|
-
const claudeDir =
|
|
6759
|
+
const claudeDir = path35__default.join(os2.homedir(), ".claude");
|
|
6745
6760
|
if (fs13__default.existsSync(claudeDir)) {
|
|
6746
6761
|
driverOverride = "claude-sdk";
|
|
6747
6762
|
logInfo(`Detected ${S.cmd("~/.claude")} \u2192 using ${S.cmd("claude-sdk")} backend`);
|
|
@@ -6788,12 +6803,12 @@ function makeServeCommand() {
|
|
|
6788
6803
|
);
|
|
6789
6804
|
}
|
|
6790
6805
|
async function ensurePluginsLoadedForServe(projectDir) {
|
|
6791
|
-
const { logInfo: logInfo2, logWarn: logWarn2 } = await import('../helpers-
|
|
6806
|
+
const { logInfo: logInfo2, logWarn: logWarn2 } = await import('../helpers-ZWHB5JHQ.js');
|
|
6792
6807
|
try {
|
|
6793
6808
|
const { resolveSkWorkspaceConfig: resolveSkWorkspaceConfig2 } = await import('../core/index.js');
|
|
6794
6809
|
const config = resolveSkWorkspaceConfig2(projectDir);
|
|
6795
6810
|
if (!config.plugins || config.plugins.length === 0) return;
|
|
6796
|
-
const { ensurePluginsLoaded } = await import('../plugin-store-
|
|
6811
|
+
const { ensurePluginsLoaded } = await import('../plugin-store-EOP3S7OU.js');
|
|
6797
6812
|
const { pluginRegistry } = await import('../plugin-registry/index.js');
|
|
6798
6813
|
const result = await ensurePluginsLoaded(projectDir, config.plugins, pluginRegistry);
|
|
6799
6814
|
if (result.loaded.length > 0) {
|
|
@@ -6807,14 +6822,14 @@ async function ensurePluginsLoadedForServe(projectDir) {
|
|
|
6807
6822
|
}
|
|
6808
6823
|
}
|
|
6809
6824
|
async function runCompileTest(opts) {
|
|
6810
|
-
const { logOk: logOk2, logErr: logErr2, logInfo: logInfo2, S: S2 } = await import('../helpers-
|
|
6825
|
+
const { logOk: logOk2, logErr: logErr2, logInfo: logInfo2, S: S2 } = await import('../helpers-ZWHB5JHQ.js');
|
|
6811
6826
|
const { tmpdir } = await import('os');
|
|
6812
6827
|
const { dirname: dirname4, join: join7, resolve: resolve5 } = await import('path');
|
|
6813
6828
|
const { fileURLToPath: fileURLToPath2 } = await import('url');
|
|
6814
6829
|
const { unlinkSync, existsSync: existsSync15 } = await import('fs');
|
|
6815
6830
|
const { spawn } = await import('child_process');
|
|
6816
6831
|
const { portableSpawnSync: portableSpawnSync2 } = await import('../core/index.js');
|
|
6817
|
-
const { MONOREPO_ROOT } = await import('../paths-
|
|
6832
|
+
const { MONOREPO_ROOT } = await import('../paths-B52KTS7N.js');
|
|
6818
6833
|
if (MONOREPO_ROOT === null) {
|
|
6819
6834
|
logErr2("--compile-test is only available inside the skaile-dev workspace.");
|
|
6820
6835
|
logInfo2("Run it from a checkout of skaile-ai/skaile-dev (the monorepo shell).");
|
|
@@ -7296,7 +7311,7 @@ function resolveMode(opts) {
|
|
|
7296
7311
|
if (opts.forceLocal && opts.forceRemote) {
|
|
7297
7312
|
throw new Error("Cannot use both --local and --remote");
|
|
7298
7313
|
}
|
|
7299
|
-
const startDir =
|
|
7314
|
+
const startDir = path35__default.resolve(opts.projectDir ?? process.cwd());
|
|
7300
7315
|
const localDb = findLogsDb(startDir);
|
|
7301
7316
|
if (opts.forceLocal) {
|
|
7302
7317
|
if (!localDb) {
|
|
@@ -7329,14 +7344,14 @@ function resolveMode(opts) {
|
|
|
7329
7344
|
function findLogsDb(startDir) {
|
|
7330
7345
|
let dir = startDir;
|
|
7331
7346
|
for (let i = 0; i < MAX_WALK_LEVELS; i++) {
|
|
7332
|
-
const candidate =
|
|
7347
|
+
const candidate = path35__default.join(dir, ".skaile", "logs.db");
|
|
7333
7348
|
if (existsSync(candidate)) {
|
|
7334
7349
|
try {
|
|
7335
7350
|
if (statSync(candidate).isFile()) return candidate;
|
|
7336
7351
|
} catch {
|
|
7337
7352
|
}
|
|
7338
7353
|
}
|
|
7339
|
-
const parent =
|
|
7354
|
+
const parent = path35__default.dirname(dir);
|
|
7340
7355
|
if (parent === dir) return void 0;
|
|
7341
7356
|
dir = parent;
|
|
7342
7357
|
}
|
|
@@ -7362,7 +7377,7 @@ function readApiToken() {
|
|
|
7362
7377
|
}
|
|
7363
7378
|
function readGlobalSettings() {
|
|
7364
7379
|
try {
|
|
7365
|
-
const settingsPath =
|
|
7380
|
+
const settingsPath = path35__default.join(homedir(), ".skaile", "settings.json");
|
|
7366
7381
|
if (!existsSync(settingsPath)) return {};
|
|
7367
7382
|
return JSON.parse(readFileSync(settingsPath, "utf8"));
|
|
7368
7383
|
} catch {
|
|
@@ -7511,7 +7526,7 @@ function parsePositiveInt(value, flag) {
|
|
|
7511
7526
|
function makeSessionCommand() {
|
|
7512
7527
|
const cmd = new Command("session").description("Manage sessions");
|
|
7513
7528
|
cmd.command("list").description("List all sessions for a project").option("--project-dir <path>", "Project directory", process.cwd()).action(async (opts) => {
|
|
7514
|
-
const projectDir =
|
|
7529
|
+
const projectDir = path35__default.resolve(opts.projectDir);
|
|
7515
7530
|
const sessions = await listSessions(projectDir);
|
|
7516
7531
|
const current = await loadSession(projectDir);
|
|
7517
7532
|
if (sessions.length === 0) {
|
|
@@ -7539,7 +7554,7 @@ function makeSessionCommand() {
|
|
|
7539
7554
|
console.log();
|
|
7540
7555
|
});
|
|
7541
7556
|
cmd.command("show <run-id>").description("Show a specific session").option("--project-dir <path>", "Project directory", process.cwd()).action(async (runId, opts) => {
|
|
7542
|
-
const projectDir =
|
|
7557
|
+
const projectDir = path35__default.resolve(opts.projectDir);
|
|
7543
7558
|
const session = await loadSessionById(projectDir, runId);
|
|
7544
7559
|
if (!session) {
|
|
7545
7560
|
logErr(`Session not found: ${runId}`);
|
|
@@ -7548,12 +7563,12 @@ function makeSessionCommand() {
|
|
|
7548
7563
|
console.log(JSON.stringify(session, null, 2));
|
|
7549
7564
|
});
|
|
7550
7565
|
cmd.command("switch <run-id>").description("Switch the current session").option("--project-dir <path>", "Project directory", process.cwd()).action(async (runId, opts) => {
|
|
7551
|
-
const projectDir =
|
|
7566
|
+
const projectDir = path35__default.resolve(opts.projectDir);
|
|
7552
7567
|
await setCurrentSession(projectDir, runId);
|
|
7553
7568
|
logOk(`Switched to session: ${S.dim(runId.slice(0, 8))}`);
|
|
7554
7569
|
});
|
|
7555
7570
|
cmd.command("delete <run-id>").description("Delete a session").option("--project-dir <path>", "Project directory", process.cwd()).action(async (runId, opts) => {
|
|
7556
|
-
const projectDir =
|
|
7571
|
+
const projectDir = path35__default.resolve(opts.projectDir);
|
|
7557
7572
|
await deleteSession(projectDir, runId);
|
|
7558
7573
|
logOk(`Deleted session: ${S.dim(runId.slice(0, 8))}`);
|
|
7559
7574
|
});
|
|
@@ -7621,7 +7636,7 @@ async function showAsset(am2, kind, name) {
|
|
|
7621
7636
|
function makeShowCommand() {
|
|
7622
7637
|
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) => {
|
|
7623
7638
|
const am2 = new AssetManager({
|
|
7624
|
-
projectDir:
|
|
7639
|
+
projectDir: path35__default.resolve(opts.projectDir),
|
|
7625
7640
|
driverTarget: opts.target
|
|
7626
7641
|
});
|
|
7627
7642
|
if (!kind) {
|
|
@@ -7689,9 +7704,9 @@ function makeStoreCommand() {
|
|
|
7689
7704
|
process.exit(2);
|
|
7690
7705
|
});
|
|
7691
7706
|
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) => {
|
|
7692
|
-
const { openCatalogSource: openCatalogSource2, LocalCatalogDisabledError } = await import('../open-library-
|
|
7707
|
+
const { openCatalogSource: openCatalogSource2, LocalCatalogDisabledError } = await import('../open-library-XB65LU3M.js');
|
|
7693
7708
|
try {
|
|
7694
|
-
const remote = await openCatalogSource2({ projectDir:
|
|
7709
|
+
const remote = await openCatalogSource2({ projectDir: path35__default.resolve(opts.projectDir) });
|
|
7695
7710
|
const assets = await remote.listAssets(opts.kind ? { kind: opts.kind } : {});
|
|
7696
7711
|
const results = filterCatalogAssets(assets, query);
|
|
7697
7712
|
if (results.length === 0) {
|
|
@@ -7722,10 +7737,10 @@ function makeStoreCommand() {
|
|
|
7722
7737
|
}
|
|
7723
7738
|
});
|
|
7724
7739
|
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) => {
|
|
7725
|
-
const { openCatalogSource: openCatalogSource2, LocalCatalogDisabledError } = await import('../open-library-
|
|
7726
|
-
const { supportsInstallManifest } = await import('../project-
|
|
7740
|
+
const { openCatalogSource: openCatalogSource2, LocalCatalogDisabledError } = await import('../open-library-XB65LU3M.js');
|
|
7741
|
+
const { supportsInstallManifest } = await import('../project-E5LKCE7R.js');
|
|
7727
7742
|
try {
|
|
7728
|
-
const remote = await openCatalogSource2({ projectDir:
|
|
7743
|
+
const remote = await openCatalogSource2({ projectDir: path35__default.resolve(opts.projectDir) });
|
|
7729
7744
|
const asset = await remote.resolve(ref);
|
|
7730
7745
|
if (!asset) {
|
|
7731
7746
|
logErr(`Not found in store: ${ref} (try a full ref, e.g. skill:@publisher/name#version)`);
|
|
@@ -7844,7 +7859,7 @@ function printTree(node, prefix = "", isLast = true) {
|
|
|
7844
7859
|
}
|
|
7845
7860
|
function makeTreeCommand() {
|
|
7846
7861
|
return new Command("tree").description("Show full dependency tree").option("--project-dir <path>", "Project directory", process.cwd()).action(async (opts) => {
|
|
7847
|
-
const am2 = new AssetManager({ projectDir:
|
|
7862
|
+
const am2 = new AssetManager({ projectDir: path35__default.resolve(opts.projectDir) });
|
|
7848
7863
|
const root = am2.tree();
|
|
7849
7864
|
if (root.children.length === 0) {
|
|
7850
7865
|
logInfo("No dependencies in lock file. Run `skaile install` first.");
|
|
@@ -7870,7 +7885,7 @@ function makeUpdateCommand() {
|
|
|
7870
7885
|
try {
|
|
7871
7886
|
const catalogSpinner = p5.spinner();
|
|
7872
7887
|
catalogSpinner.start("Refreshing catalog cache");
|
|
7873
|
-
const remote = await openCatalogSource({ projectDir:
|
|
7888
|
+
const remote = await openCatalogSource({ projectDir: path35__default.resolve(opts.projectDir) });
|
|
7874
7889
|
const result2 = await remote.refresh();
|
|
7875
7890
|
catalogSpinner.stop(
|
|
7876
7891
|
`Catalog refreshed: ${S.heading(String(result2.assetsCached))} assets cached`
|
|
@@ -7882,7 +7897,7 @@ function makeUpdateCommand() {
|
|
|
7882
7897
|
}
|
|
7883
7898
|
}
|
|
7884
7899
|
if (opts.catalogOnly) return;
|
|
7885
|
-
const projectDir =
|
|
7900
|
+
const projectDir = path35__default.resolve(opts.projectDir);
|
|
7886
7901
|
if (await shouldSyncSources(opts)) {
|
|
7887
7902
|
const syncSpinner = p5.spinner();
|
|
7888
7903
|
syncSpinner.start("Syncing sources");
|
|
@@ -7943,7 +7958,7 @@ function findManifestCandidates(rootPath) {
|
|
|
7943
7958
|
return;
|
|
7944
7959
|
}
|
|
7945
7960
|
for (const entry of entries) {
|
|
7946
|
-
const fullPath =
|
|
7961
|
+
const fullPath = path35__default.join(dir, entry.name);
|
|
7947
7962
|
if (entry.isDirectory()) {
|
|
7948
7963
|
if (!SKIP_DIRS.has(entry.name)) walk(fullPath);
|
|
7949
7964
|
} else if (entry.isFile()) {
|
|
@@ -7996,13 +8011,13 @@ function parseManifestCandidate(c, absRoot) {
|
|
|
7996
8011
|
const parsed = c.filePath.endsWith(".json") ? JSON.parse(content) : parse(content);
|
|
7997
8012
|
return { kind: "value", parsed };
|
|
7998
8013
|
} catch (e) {
|
|
7999
|
-
const relPath =
|
|
8014
|
+
const relPath = path35__default.relative(absRoot, c.filePath);
|
|
8000
8015
|
logErr(`${relPath} \u2014 parse error: ${e instanceof Error ? e.message : String(e)}`);
|
|
8001
8016
|
return { kind: "error" };
|
|
8002
8017
|
}
|
|
8003
8018
|
}
|
|
8004
8019
|
function validateManifestCandidate(c, parsed, absRoot, registry, strictConformance) {
|
|
8005
|
-
const relPath =
|
|
8020
|
+
const relPath = path35__default.relative(absRoot, c.filePath);
|
|
8006
8021
|
let errors = 0;
|
|
8007
8022
|
let warnings = 0;
|
|
8008
8023
|
const identityError = checkManifestIdentity(c.kind, parsed);
|
|
@@ -8011,7 +8026,7 @@ function validateManifestCandidate(c, parsed, absRoot, registry, strictConforman
|
|
|
8011
8026
|
errors++;
|
|
8012
8027
|
}
|
|
8013
8028
|
if (c.kind === "skill" && parsed && typeof parsed === "object") {
|
|
8014
|
-
const dirName =
|
|
8029
|
+
const dirName = path35__default.basename(path35__default.dirname(c.filePath));
|
|
8015
8030
|
const findings = checkAgentSkillConformance(parsed, { dirName });
|
|
8016
8031
|
for (const f of findings) {
|
|
8017
8032
|
const line = `${relPath} [skill conformance] \u2014 ${f.field}: ${f.message}`;
|
|
@@ -8039,7 +8054,7 @@ function validateManifestCandidate(c, parsed, absRoot, registry, strictConforman
|
|
|
8039
8054
|
return { errors, warnings };
|
|
8040
8055
|
}
|
|
8041
8056
|
function validateManifests(rootPath, strictConformance) {
|
|
8042
|
-
const absRoot =
|
|
8057
|
+
const absRoot = path35__default.resolve(rootPath);
|
|
8043
8058
|
if (!fs13__default.existsSync(absRoot)) {
|
|
8044
8059
|
logErr(`Path does not exist: ${absRoot}`);
|
|
8045
8060
|
return { total: 0, errors: 1, warnings: 0 };
|
|
@@ -8077,7 +8092,7 @@ function findWorkspaceManifests(rootPath) {
|
|
|
8077
8092
|
return;
|
|
8078
8093
|
}
|
|
8079
8094
|
for (const entry of entries) {
|
|
8080
|
-
const full =
|
|
8095
|
+
const full = path35__default.join(dir, entry.name);
|
|
8081
8096
|
if (entry.isDirectory()) {
|
|
8082
8097
|
if (!SKIP_DIRS.has(entry.name)) walk(full);
|
|
8083
8098
|
} else if (entry.isFile() && /(^|\.)skaile\.yaml$/.test(entry.name)) {
|
|
@@ -8140,11 +8155,11 @@ function validateWorkspaceAssets(parsed, relPath) {
|
|
|
8140
8155
|
return errors;
|
|
8141
8156
|
}
|
|
8142
8157
|
function validateWorkspaceManifests(rootPath) {
|
|
8143
|
-
const absRoot =
|
|
8158
|
+
const absRoot = path35__default.resolve(rootPath);
|
|
8144
8159
|
const files = findWorkspaceManifests(absRoot);
|
|
8145
8160
|
let errors = 0;
|
|
8146
8161
|
for (const file of files) {
|
|
8147
|
-
const relPath =
|
|
8162
|
+
const relPath = path35__default.relative(absRoot, file);
|
|
8148
8163
|
let parsed;
|
|
8149
8164
|
try {
|
|
8150
8165
|
parsed = parse(fs13__default.readFileSync(file, "utf-8")) ?? {};
|
|
@@ -8164,20 +8179,20 @@ function collectAssetVersions() {
|
|
|
8164
8179
|
if (!fs13__default.existsSync(AI_RESOURCES)) return assets;
|
|
8165
8180
|
const domains = fs13__default.readdirSync(AI_RESOURCES, { withFileTypes: true }).filter((d) => d.isDirectory() && !EXCLUDED_DOMAINS.has(d.name));
|
|
8166
8181
|
for (const d of domains) {
|
|
8167
|
-
const domainDir =
|
|
8168
|
-
const skillsDir =
|
|
8182
|
+
const domainDir = path35__default.join(AI_RESOURCES, d.name);
|
|
8183
|
+
const skillsDir = path35__default.join(domainDir, "skills");
|
|
8169
8184
|
if (fs13__default.existsSync(skillsDir)) {
|
|
8170
8185
|
collectSkillVersions(skillsDir, d.name, assets);
|
|
8171
8186
|
}
|
|
8172
|
-
const agentsDir =
|
|
8187
|
+
const agentsDir = path35__default.join(domainDir, "agents");
|
|
8173
8188
|
if (fs13__default.existsSync(agentsDir)) {
|
|
8174
8189
|
collectAgentVersions(agentsDir, d.name, assets);
|
|
8175
8190
|
}
|
|
8176
|
-
const flowsDir =
|
|
8191
|
+
const flowsDir = path35__default.join(domainDir, "flows");
|
|
8177
8192
|
if (fs13__default.existsSync(flowsDir)) {
|
|
8178
8193
|
collectFlowVersions(flowsDir, d.name, assets);
|
|
8179
8194
|
}
|
|
8180
|
-
const promptsDir =
|
|
8195
|
+
const promptsDir = path35__default.join(domainDir, "prompts");
|
|
8181
8196
|
if (fs13__default.existsSync(promptsDir)) {
|
|
8182
8197
|
collectPromptVersions(promptsDir, d.name, assets);
|
|
8183
8198
|
}
|
|
@@ -8187,7 +8202,7 @@ function collectAssetVersions() {
|
|
|
8187
8202
|
function collectFlowVersions(dir, domain, out) {
|
|
8188
8203
|
for (const f of fs13__default.readdirSync(dir)) {
|
|
8189
8204
|
if (!f.endsWith(".flow.yaml")) continue;
|
|
8190
|
-
const fp =
|
|
8205
|
+
const fp = path35__default.join(dir, f);
|
|
8191
8206
|
const content = fs13__default.readFileSync(fp, "utf-8");
|
|
8192
8207
|
const parsed = parse(content);
|
|
8193
8208
|
out.push({
|
|
@@ -8202,7 +8217,7 @@ function collectFlowVersions(dir, domain, out) {
|
|
|
8202
8217
|
function collectPromptVersions(dir, domain, out) {
|
|
8203
8218
|
for (const f of fs13__default.readdirSync(dir)) {
|
|
8204
8219
|
if (!f.endsWith(".prompt.md")) continue;
|
|
8205
|
-
const fp =
|
|
8220
|
+
const fp = path35__default.join(dir, f);
|
|
8206
8221
|
const content = fs13__default.readFileSync(fp, "utf-8");
|
|
8207
8222
|
const fm = parseSkillFrontmatter(content);
|
|
8208
8223
|
out.push({
|
|
@@ -8217,8 +8232,8 @@ function collectPromptVersions(dir, domain, out) {
|
|
|
8217
8232
|
function collectSkillVersions(dir, domain, out) {
|
|
8218
8233
|
for (const entry of fs13__default.readdirSync(dir, { withFileTypes: true })) {
|
|
8219
8234
|
if (!entry.isDirectory()) continue;
|
|
8220
|
-
const full =
|
|
8221
|
-
const skillMd =
|
|
8235
|
+
const full = path35__default.join(dir, entry.name);
|
|
8236
|
+
const skillMd = path35__default.join(full, "SKILL.md");
|
|
8222
8237
|
if (fs13__default.existsSync(skillMd)) {
|
|
8223
8238
|
const content = fs13__default.readFileSync(skillMd, "utf-8");
|
|
8224
8239
|
const fm = parseSkillFrontmatter(content);
|
|
@@ -8237,7 +8252,7 @@ function collectSkillVersions(dir, domain, out) {
|
|
|
8237
8252
|
function collectAgentVersions(dir, domain, out) {
|
|
8238
8253
|
for (const entry of fs13__default.readdirSync(dir, { withFileTypes: true })) {
|
|
8239
8254
|
if (!entry.isDirectory()) continue;
|
|
8240
|
-
const agentYaml =
|
|
8255
|
+
const agentYaml = path35__default.join(dir, entry.name, "agent.yaml");
|
|
8241
8256
|
if (!fs13__default.existsSync(agentYaml)) continue;
|
|
8242
8257
|
const content = fs13__default.readFileSync(agentYaml, "utf-8");
|
|
8243
8258
|
const parsed = parse(content);
|
|
@@ -8270,7 +8285,7 @@ function filterToChangedAssets(assets) {
|
|
|
8270
8285
|
encoding: "utf-8"
|
|
8271
8286
|
});
|
|
8272
8287
|
const changedFiles = new Set(
|
|
8273
|
-
diffOutput.trim().split("\n").filter(Boolean).map((f) =>
|
|
8288
|
+
diffOutput.trim().split("\n").filter(Boolean).map((f) => path35__default.resolve(AI_RESOURCES, f))
|
|
8274
8289
|
);
|
|
8275
8290
|
return assets.filter((a) => changedFiles.has(a.filePath));
|
|
8276
8291
|
} catch {
|
|
@@ -8296,7 +8311,7 @@ function checkVersionBumps(assets) {
|
|
|
8296
8311
|
let warnings = 0;
|
|
8297
8312
|
for (const a of assets) {
|
|
8298
8313
|
if (!a.version) continue;
|
|
8299
|
-
const relPath =
|
|
8314
|
+
const relPath = path35__default.relative(AI_RESOURCES, a.filePath);
|
|
8300
8315
|
try {
|
|
8301
8316
|
const headContent = execSync(`git show HEAD:${relPath}`, {
|
|
8302
8317
|
cwd: AI_RESOURCES,
|
|
@@ -8321,16 +8336,20 @@ function checkFlowVersionPins(assets) {
|
|
|
8321
8336
|
skillVersionMap.set(a.name, a.version);
|
|
8322
8337
|
}
|
|
8323
8338
|
let errors = 0;
|
|
8339
|
+
let warnings = 0;
|
|
8324
8340
|
for (const f of flows) {
|
|
8325
|
-
|
|
8326
|
-
|
|
8327
|
-
|
|
8328
|
-
|
|
8329
|
-
|
|
8330
|
-
|
|
8331
|
-
|
|
8332
|
-
|
|
8333
|
-
|
|
8341
|
+
let pins;
|
|
8342
|
+
try {
|
|
8343
|
+
pins = flowSkillVersionPins(loadFlow(f.filePath));
|
|
8344
|
+
} catch (err) {
|
|
8345
|
+
logWarn(
|
|
8346
|
+
`flow:${f.name} (${path35__default.relative(AI_RESOURCES, f.filePath)}) \u2014 could not be read: ${err instanceof Error ? err.message : err}`
|
|
8347
|
+
);
|
|
8348
|
+
warnings++;
|
|
8349
|
+
continue;
|
|
8350
|
+
}
|
|
8351
|
+
if (pins.length === 0) continue;
|
|
8352
|
+
const checks = validateFlowVersions(pins, skillVersionMap);
|
|
8334
8353
|
for (const c of checks.filter((c2) => !c2.satisfied)) {
|
|
8335
8354
|
logErr(
|
|
8336
8355
|
`flow:${f.name} node ${c.nodeId} \u2014 wants ${c.requested}, found ${c.actual || "(none)"}`
|
|
@@ -8338,7 +8357,7 @@ function checkFlowVersionPins(assets) {
|
|
|
8338
8357
|
errors++;
|
|
8339
8358
|
}
|
|
8340
8359
|
}
|
|
8341
|
-
return errors;
|
|
8360
|
+
return { errors, warnings };
|
|
8342
8361
|
}
|
|
8343
8362
|
function runVersionsCheck(opts) {
|
|
8344
8363
|
let assets = collectAssetVersions().filter((a) => !opts.domain || a.domain === opts.domain);
|
|
@@ -8351,7 +8370,9 @@ function runVersionsCheck(opts) {
|
|
|
8351
8370
|
if (opts.changedOnly) {
|
|
8352
8371
|
warnings += checkVersionBumps(assets);
|
|
8353
8372
|
}
|
|
8354
|
-
|
|
8373
|
+
const pinCheck = checkFlowVersionPins(assets);
|
|
8374
|
+
errors += pinCheck.errors;
|
|
8375
|
+
warnings += pinCheck.warnings;
|
|
8355
8376
|
console.log();
|
|
8356
8377
|
logInfo(`Checked ${assets.length} assets`);
|
|
8357
8378
|
if (errors === 0 && warnings === 0) {
|
|
@@ -8372,7 +8393,7 @@ function makeValidateCommand() {
|
|
|
8372
8393
|
"--strict-conformance",
|
|
8373
8394
|
"Treat Agent Skills (agentskills.io) standard findings as errors"
|
|
8374
8395
|
).action((targetPath, opts) => {
|
|
8375
|
-
const absPath =
|
|
8396
|
+
const absPath = path35__default.resolve(targetPath);
|
|
8376
8397
|
logInfo(`Validating manifests in ${absPath}`);
|
|
8377
8398
|
const { total, errors, warnings } = validateManifests(
|
|
8378
8399
|
absPath,
|
|
@@ -8422,7 +8443,7 @@ function makeValidateCommand() {
|
|
|
8422
8443
|
let errors = 0;
|
|
8423
8444
|
for (const domain of modifiedDomains) {
|
|
8424
8445
|
const changelogModified = modifiedFiles.some(
|
|
8425
|
-
(f) => f === `${domain}/CHANGELOG.md` || f ===
|
|
8446
|
+
(f) => f === `${domain}/CHANGELOG.md` || f === path35__default.join(domain, "CHANGELOG.md")
|
|
8426
8447
|
);
|
|
8427
8448
|
if (changelogModified) {
|
|
8428
8449
|
logOk(`${domain}/CHANGELOG.md updated`);
|
|
@@ -8528,7 +8549,7 @@ function whyEmptyMessage(ref, declared) {
|
|
|
8528
8549
|
}
|
|
8529
8550
|
function makeWhyCommand() {
|
|
8530
8551
|
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) => {
|
|
8531
|
-
const am2 = new AssetManager({ projectDir:
|
|
8552
|
+
const am2 = new AssetManager({ projectDir: path35__default.resolve(opts.projectDir) });
|
|
8532
8553
|
const chain = am2.why(ref);
|
|
8533
8554
|
if (chain.length === 0) {
|
|
8534
8555
|
let declared;
|
|
@@ -8562,7 +8583,7 @@ function makeWhyCommand() {
|
|
|
8562
8583
|
var _defaultFormatHelp = Help.prototype.formatHelp;
|
|
8563
8584
|
var pkg = JSON.parse(
|
|
8564
8585
|
readFileSync(
|
|
8565
|
-
|
|
8586
|
+
path35__default.resolve(path35__default.dirname(fileURLToPath(import.meta.url)), "../../package.json"),
|
|
8566
8587
|
"utf-8"
|
|
8567
8588
|
)
|
|
8568
8589
|
);
|
|
@@ -8692,31 +8713,31 @@ async function runInit(projectDir, opts) {
|
|
|
8692
8713
|
process.exitCode = 1;
|
|
8693
8714
|
return;
|
|
8694
8715
|
}
|
|
8695
|
-
const resolved =
|
|
8696
|
-
const projectName =
|
|
8716
|
+
const resolved = path35__default.resolve(projectDir ?? ".");
|
|
8717
|
+
const projectName = path35__default.basename(resolved);
|
|
8697
8718
|
const created = [];
|
|
8698
8719
|
const { existsSync: existsSync15 } = await import('fs');
|
|
8699
8720
|
if (!existsSync15(resolved)) {
|
|
8700
8721
|
mkdirSync5(resolved, { recursive: true });
|
|
8701
8722
|
created.push(".");
|
|
8702
8723
|
}
|
|
8703
|
-
const skaileDir =
|
|
8724
|
+
const skaileDir = path35__default.join(resolved, ".skaile");
|
|
8704
8725
|
if (!existsSync15(skaileDir)) {
|
|
8705
|
-
mkdirSync5(
|
|
8726
|
+
mkdirSync5(path35__default.join(skaileDir, "sessions"), { recursive: true });
|
|
8706
8727
|
created.push(".skaile/");
|
|
8707
8728
|
}
|
|
8708
|
-
const settingsPath =
|
|
8729
|
+
const settingsPath = path35__default.join(skaileDir, "settings.json");
|
|
8709
8730
|
if (!existsSync15(settingsPath)) {
|
|
8710
8731
|
writeFileSync5(settingsPath, "{}\n");
|
|
8711
8732
|
created.push(".skaile/settings.json");
|
|
8712
8733
|
}
|
|
8713
|
-
const wsConfigPath =
|
|
8734
|
+
const wsConfigPath = path35__default.join(resolved, "skaile.yaml");
|
|
8714
8735
|
if (!existsSync15(wsConfigPath)) {
|
|
8715
8736
|
writeFileSync5(wsConfigPath, stringify2(buildInitWorkspaceConfig(projectName, backend)));
|
|
8716
8737
|
created.push("skaile.yaml");
|
|
8717
8738
|
}
|
|
8718
8739
|
for (const dir of new Set(Object.values(DRIVER_TARGETS[backend].local))) {
|
|
8719
|
-
const full =
|
|
8740
|
+
const full = path35__default.join(resolved, dir);
|
|
8720
8741
|
if (!existsSync15(full)) {
|
|
8721
8742
|
mkdirSync5(full, { recursive: true });
|
|
8722
8743
|
created.push(`${dir}/`);
|
|
@@ -8749,7 +8770,7 @@ function buildInitWorkspaceConfig(projectName, backend) {
|
|
|
8749
8770
|
async function initGitScaffold(resolved, created) {
|
|
8750
8771
|
const { execSync: execSync3 } = await import('child_process');
|
|
8751
8772
|
const { existsSync: existsSync15, readFileSync: readFileSync9, writeFileSync: writeFileSync5 } = await import('fs');
|
|
8752
|
-
const gitignorePath =
|
|
8773
|
+
const gitignorePath = path35__default.join(resolved, ".gitignore");
|
|
8753
8774
|
const entries = [
|
|
8754
8775
|
"node_modules/",
|
|
8755
8776
|
".skaile/sessions/",
|
|
@@ -8773,7 +8794,7 @@ async function initGitScaffold(resolved, created) {
|
|
|
8773
8794
|
`);
|
|
8774
8795
|
if (!existing) created.push(".gitignore");
|
|
8775
8796
|
}
|
|
8776
|
-
if (!existsSync15(
|
|
8797
|
+
if (!existsSync15(path35__default.join(resolved, ".git"))) {
|
|
8777
8798
|
try {
|
|
8778
8799
|
execSync3("git init", { cwd: resolved, stdio: "pipe" });
|
|
8779
8800
|
created.push(".git/");
|
|
@@ -8803,7 +8824,7 @@ async function bootstrapUserConfig() {
|
|
|
8803
8824
|
}
|
|
8804
8825
|
async function hydrateInitSources(resolved, created) {
|
|
8805
8826
|
try {
|
|
8806
|
-
const { ensureSourcesCloned } = await import('../ensure-sources-
|
|
8827
|
+
const { ensureSourcesCloned } = await import('../ensure-sources-L2276FYP.js');
|
|
8807
8828
|
const hydrate = ensureSourcesCloned(resolved, { quiet: true });
|
|
8808
8829
|
for (const n of hydrate.cloned) created.push(`~/.skaile/cache/sources/${n}/`);
|
|
8809
8830
|
if (hydrate.failed.length > 0) {
|
|
@@ -8819,7 +8840,7 @@ function printInitSummary(resolved, projectDir, created) {
|
|
|
8819
8840
|
logOk(`Initialized project at ${S.heading(resolved)}`);
|
|
8820
8841
|
console.log();
|
|
8821
8842
|
console.log(S.heading(" Next steps:"));
|
|
8822
|
-
const isCurrentDir = resolved ===
|
|
8843
|
+
const isCurrentDir = resolved === path35__default.resolve(".");
|
|
8823
8844
|
let step = 1;
|
|
8824
8845
|
if (!isCurrentDir) {
|
|
8825
8846
|
console.log(` ${S.dim(`${step}.`)} ${S.cmd(`cd ${projectDir}`)}`);
|
|
@@ -8843,7 +8864,7 @@ function printInitSummary(resolved, projectDir, created) {
|
|
|
8843
8864
|
console.log();
|
|
8844
8865
|
}
|
|
8845
8866
|
program.command("setup").description("Interactive provider setup wizard").action(async () => {
|
|
8846
|
-
const { cmdSetup } = await import('../setup-
|
|
8867
|
+
const { cmdSetup } = await import('../setup-XI7TCIGF.js');
|
|
8847
8868
|
await cmdSetup([], { projectDir: process.cwd() });
|
|
8848
8869
|
});
|
|
8849
8870
|
program.addCommand(makeInstallCommand());
|