@skaile/workspaces 3.2.0 → 3.2.1
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 +21 -0
- package/dist/{asset-feeds-25DVAGVD.js → asset-feeds-SEYSNNEM.js} +5 -5
- package/dist/{asset-feeds-25DVAGVD.js.map → asset-feeds-SEYSNNEM.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-RW4I42MW.js → chunk-BEA7RXI3.js} +5 -5
- package/dist/{chunk-RW4I42MW.js.map → chunk-BEA7RXI3.js.map} +1 -1
- package/dist/{chunk-XL7ZDZ4O.js → chunk-BKUANJB7.js} +4 -4
- package/dist/{chunk-XL7ZDZ4O.js.map → chunk-BKUANJB7.js.map} +1 -1
- package/dist/{chunk-DPFSO4T2.js → chunk-CH3UTJBT.js} +4 -4
- package/dist/{chunk-DPFSO4T2.js.map → chunk-CH3UTJBT.js.map} +1 -1
- package/dist/{chunk-CTCCFKZV.js → chunk-DNYE3SSL.js} +3 -3
- package/dist/{chunk-CTCCFKZV.js.map → chunk-DNYE3SSL.js.map} +1 -1
- package/dist/{chunk-CO4DNTIL.js → chunk-HCNVX34E.js} +2 -2
- package/dist/{chunk-CO4DNTIL.js.map → chunk-HCNVX34E.js.map} +1 -1
- package/dist/{chunk-ST4RC2JF.js → chunk-HWEW3VII.js} +2 -2
- package/dist/{chunk-ST4RC2JF.js.map → chunk-HWEW3VII.js.map} +1 -1
- 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-EYBGQJNF.js → chunk-I7S6DFRU.js} +97 -27
- package/dist/chunk-I7S6DFRU.js.map +1 -0
- package/dist/{chunk-IMA5H7AG.js → chunk-IAIHZRG7.js} +6 -6
- package/dist/{chunk-IMA5H7AG.js.map → chunk-IAIHZRG7.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-K5OKE4G2.js → chunk-NLZYBWVH.js} +6 -6
- package/dist/{chunk-K5OKE4G2.js.map → chunk-NLZYBWVH.js.map} +1 -1
- package/dist/{chunk-DEW2G3QZ.js → chunk-NWFZUQPF.js} +8 -8
- package/dist/{chunk-DEW2G3QZ.js.map → chunk-NWFZUQPF.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-F5YPDCN6.js → chunk-PTAUN5CY.js} +2 -2
- package/dist/{chunk-F5YPDCN6.js.map → chunk-PTAUN5CY.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-QFO4IYBZ.js → chunk-VT6HDD2L.js} +2 -2
- package/dist/{chunk-QFO4IYBZ.js.map → chunk-VT6HDD2L.js.map} +1 -1
- package/dist/{chunk-3IGXVTOS.js → chunk-XVIFPGYH.js} +3 -3
- package/dist/{chunk-3IGXVTOS.js.map → chunk-XVIFPGYH.js.map} +1 -1
- package/dist/cli/index.js +275 -266
- package/dist/cli/index.js.map +1 -1
- package/dist/cli/src/flow-discovery.d.ts +18 -8
- package/dist/cli/src/flow-discovery.d.ts.map +1 -1
- package/dist/connectors/config.js +1 -1
- package/dist/connectors/index.js +5 -5
- 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-IM3JMW2L.js} +5 -5
- package/dist/{ensure-sources-YOJ5HOCL.js.map → ensure-sources-IM3JMW2L.js.map} +1 -1
- package/dist/factory-assets/connectors/box.js +5 -5
- package/dist/factory-assets/connectors/deploy.js +5 -5
- package/dist/factory-assets/connectors/devserver.js +5 -5
- package/dist/factory-assets/connectors/flow/adapter.js +5 -5
- 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.js +2 -2
- package/dist/factory-assets/connectors/flow/run-flow.js +6 -6
- package/dist/factory-assets/connectors/flow.js +5 -5
- package/dist/factory-assets/connectors/git.js +5 -5
- package/dist/factory-assets/connectors/gmail.js +5 -5
- package/dist/factory-assets/connectors/googledrive.js +5 -5
- package/dist/factory-assets/connectors/local.js +5 -5
- package/dist/factory-assets/connectors/mattermost.js +5 -5
- package/dist/factory-assets/connectors/memory.js +5 -5
- package/dist/factory-assets/connectors/minio.js +5 -5
- package/dist/factory-assets/connectors/postgres.js +5 -5
- package/dist/factory-assets/connectors/s3.js +5 -5
- package/dist/factory-assets/connectors/sharepoint.js +5 -5
- package/dist/factory-assets/connectors/sqlite.js +5 -5
- package/dist/factory-assets/connectors/static-server.js +5 -5
- package/dist/factory-assets/connectors/tunnel.js +5 -5
- package/dist/factory-assets/connectors/webdav.js +5 -5
- package/dist/factory-assets/connectors/xstate-store.js +5 -5
- package/dist/factory-assets/connectors/xstate.js +5 -5
- package/dist/{flows-7KUZGZ77.js → flows-PBNW6BEH.js} +4 -4
- package/dist/{flows-7KUZGZ77.js.map → flows-PBNW6BEH.js.map} +1 -1
- package/dist/{helpers-YNZ5SWNX.js → helpers-LJFOH4RB.js} +5 -5
- package/dist/{helpers-YNZ5SWNX.js.map → helpers-LJFOH4RB.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-BEFA7OCS.js} +8 -8
- package/dist/{library-publish-JBZ2TEQI.js.map → library-publish-BEFA7OCS.js.map} +1 -1
- package/dist/{open-library-H2LAGVTM.js → open-library-WJ7P7B4N.js} +7 -7
- package/dist/{open-library-H2LAGVTM.js.map → open-library-WJ7P7B4N.js.map} +1 -1
- package/dist/{paths-ZLX4ITAQ.js → paths-2ZZMB7HU.js} +3 -3
- package/dist/{paths-ZLX4ITAQ.js.map → paths-2ZZMB7HU.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-6RXDBSRV.js} +6 -6
- package/dist/{project-WBIYBTN3.js.map → project-6RXDBSRV.js.map} +1 -1
- package/dist/resolver/index.js +1 -1
- package/dist/runner/index.js +8 -8
- 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 +2 -2
- package/dist/sdk/index.js +8 -8
- package/dist/sdk/resolver.js +1 -1
- package/dist/sdk/runner.js +8 -8
- 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-TJ457ZRQ.js} +8 -8
- package/dist/{source-UCMNKSA2.js.map → source-TJ457ZRQ.js.map} +1 -1
- package/dist/{source-manifest-publish-BZ777MH5.js → source-manifest-publish-R3Q4MT5W.js} +9 -9
- package/dist/{source-manifest-publish-BZ777MH5.js.map → source-manifest-publish-R3Q4MT5W.js.map} +1 -1
- package/dist/tui/index.js +8 -8
- 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-EYBGQJNF.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-
|
|
2
|
+
import { makeInstallCommand, makeCheckCommand, makeCleanCommand, reportInstalledSoftDeps } from '../chunk-IAIHZRG7.js';
|
|
3
|
+
import { makeSourceCommand, syncProjectSources } from '../chunk-NLZYBWVH.js';
|
|
4
4
|
import { AI_RESOURCES, aiResourceRoots } from '../chunk-57RFYEVM.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-CH3UTJBT.js';
|
|
7
|
+
import { logErr, S, logOk, logInfo, kindColorPad, kindColor, colorRef, formatSoftDepSection, bareSoftDepName, logWarn, formatSoftDepHint, formatRelativeTime, formatSoftDepRemovePreview, formatSoftDepAddPreview, fitWidth } from '../chunk-XVIFPGYH.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-NWFZUQPF.js';
|
|
10
|
+
import { buildClaudePluginFiles } from '../chunk-PTAUN5CY.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-BKUANJB7.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-BEA7RXI3.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-I7S6DFRU.js';
|
|
34
34
|
import '../chunk-B4J6TV4G.js';
|
|
35
35
|
import '../chunk-FLBDLF3I.js';
|
|
36
36
|
import '../chunk-F5VREBV2.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-HCNVX34E.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 path13 from 'path';
|
|
66
|
+
import path13__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: path13__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-WJ7P7B4N.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(path13__default.sep) ? r : r + path13__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 = path13__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-TJ457ZRQ.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-WJ7P7B4N.js');
|
|
221
221
|
try {
|
|
222
|
-
const remote = await openCatalogSource2({ projectDir:
|
|
222
|
+
const remote = await openCatalogSource2({ projectDir: path13__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: path13__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: path13__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: path13__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: path13__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-WJ7P7B4N.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-WJ7P7B4N.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 = path13__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 ? path13__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: path13__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(path13.join(os.homedir(), ".claude", "skills"));
|
|
643
643
|
return roots;
|
|
644
644
|
}
|
|
645
645
|
function resolveImportSource(nameOrPath) {
|
|
646
|
-
const asPath =
|
|
646
|
+
const asPath = path13.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 : path13.dirname(asPath);
|
|
649
|
+
const skillFile = path13.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(path13.sep) && !nameOrPath.startsWith(".")) {
|
|
653
653
|
for (const root of claudeSkillRoots()) {
|
|
654
|
-
const dir =
|
|
655
|
-
const skillFile =
|
|
654
|
+
const dir = path13.join(root, nameOrPath);
|
|
655
|
+
const skillFile = path13.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 = path13.join(libraryPath, domain);
|
|
722
|
+
const domainFile = path13.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(path13.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: path13.basename(src.dir),
|
|
806
806
|
version: opts.version,
|
|
807
807
|
stage: opts.stage
|
|
808
|
-
}) : { content: rawSkill, name:
|
|
808
|
+
}) : { content: rawSkill, name: path13.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 = path13.join(dom.dir, "skills");
|
|
820
820
|
publisher = dom.publisher;
|
|
821
821
|
}
|
|
822
822
|
fs13.mkdirSync(destParent, { recursive: true });
|
|
823
|
-
const destDir =
|
|
823
|
+
const destDir = path13.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(path13.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 = path13.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 = path13.basename(srcPath);
|
|
899
|
+
const destDir = target.structure === "domain" && opts.domain ? path13.join(target.path, opts.domain) : target.path;
|
|
900
900
|
fs13.mkdirSync(destDir, { recursive: true });
|
|
901
|
-
const destPath =
|
|
901
|
+
const destPath = path13.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(path13.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 = path13.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 = path13.join(target, candidateSubpath);
|
|
977
|
+
fs13.mkdirSync(path13.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(path13.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(path13__default.join(scope.projectDir, ".skaile", "cache"));
|
|
1047
|
+
out.push(path13__default.join(scope.projectDir, ".skaile", "store-cache"));
|
|
1048
|
+
out.push(path13__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 ?? path13__default.join(homedir(), ".skaile");
|
|
1052
|
+
out.push(path13__default.join(home, "repos"));
|
|
1053
|
+
out.push(path13__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 = path13__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: path13__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(path13__default.join(path13__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: path13__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 ? path13__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 ? path13__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-WJ7P7B4N.js');
|
|
1172
1172
|
let resolved;
|
|
1173
1173
|
try {
|
|
1174
1174
|
resolved = await resolveCatalogSource({ projectDir });
|
|
@@ -1291,20 +1291,29 @@ complete -c ${bin} -f -a '(__${bin}_complete)'`
|
|
|
1291
1291
|
function discoverFlows() {
|
|
1292
1292
|
const byId = /* @__PURE__ */ new Map();
|
|
1293
1293
|
for (const root of aiResourceRoots()) {
|
|
1294
|
-
for (const flow of
|
|
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 declaredFlowId(filePath) {
|
|
1301
|
+
try {
|
|
1302
|
+
return loadFlow(filePath).id;
|
|
1303
|
+
} catch {
|
|
1304
|
+
return void 0;
|
|
1305
|
+
}
|
|
1306
|
+
}
|
|
1300
1307
|
function findFlowFile(flowId, priorityRoots = []) {
|
|
1301
1308
|
for (const root of [...priorityRoots, ...aiResourceRoots()]) {
|
|
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 = path13__default.join(dir, entry.name);
|
|
1330
1339
|
if (entry.isDirectory()) {
|
|
1331
|
-
const skillMd =
|
|
1340
|
+
const skillMd = path13__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 = path13__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 ? path13__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 ? path13__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 ? path13__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 = path13__default.resolve(opts.projectDir);
|
|
1826
|
+
const yamlPath = path13__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 = path13__default.resolve(opts.projectDir);
|
|
1887
|
+
const yamlPath = path13__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 = path13__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 = path13__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 = path13__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 = path13__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 = path13__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 = path13__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 = path13__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 = path13__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 = path13__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 = path13__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 ?? path13__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 = path13__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 = path13__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 = path13__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 = path13__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: path13__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).");
|
|
@@ -2332,7 +2341,7 @@ function makeFlowCommand() {
|
|
|
2332
2341
|
function makeHistoryCommand() {
|
|
2333
2342
|
const cmd = new Command("history").description("Show recent add/remove/update actions");
|
|
2334
2343
|
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:
|
|
2344
|
+
const am2 = new AssetManager({ projectDir: path13__default.resolve(opts.projectDir) });
|
|
2336
2345
|
const limit = parseInt(limitStr, 10) || 20;
|
|
2337
2346
|
const entries = am2.history(limit);
|
|
2338
2347
|
if (entries.length === 0) {
|
|
@@ -2352,7 +2361,7 @@ function makeHistoryCommand() {
|
|
|
2352
2361
|
console.log();
|
|
2353
2362
|
});
|
|
2354
2363
|
cmd.command("clear").description("Clear action history").option("--project-dir <path>", "Project directory", process.cwd()).action((opts) => {
|
|
2355
|
-
const am2 = new AssetManager({ projectDir:
|
|
2364
|
+
const am2 = new AssetManager({ projectDir: path13__default.resolve(opts.projectDir) });
|
|
2356
2365
|
am2.clearHistory();
|
|
2357
2366
|
logOk("History cleared.");
|
|
2358
2367
|
});
|
|
@@ -2365,7 +2374,7 @@ var MCP_SERVER_ENTRY = {
|
|
|
2365
2374
|
env: {}
|
|
2366
2375
|
};
|
|
2367
2376
|
function pluginDir(projectDir) {
|
|
2368
|
-
return
|
|
2377
|
+
return path13__default.join(projectDir, ".claude", "plugins", "skaile");
|
|
2369
2378
|
}
|
|
2370
2379
|
async function readJsonStrict(p7) {
|
|
2371
2380
|
let raw;
|
|
@@ -2383,7 +2392,7 @@ async function readJsonStrict(p7) {
|
|
|
2383
2392
|
}
|
|
2384
2393
|
}
|
|
2385
2394
|
async function writeJson(p7, value) {
|
|
2386
|
-
await fs6.mkdir(
|
|
2395
|
+
await fs6.mkdir(path13__default.dirname(p7), { recursive: true });
|
|
2387
2396
|
await fs6.writeFile(p7, `${JSON.stringify(value, null, 2)}
|
|
2388
2397
|
`);
|
|
2389
2398
|
}
|
|
@@ -2391,8 +2400,8 @@ async function copyDir(src, dest) {
|
|
|
2391
2400
|
await fs6.mkdir(dest, { recursive: true });
|
|
2392
2401
|
const entries = await fs6.readdir(src, { withFileTypes: true });
|
|
2393
2402
|
for (const entry of entries) {
|
|
2394
|
-
const srcPath =
|
|
2395
|
-
const destPath =
|
|
2403
|
+
const srcPath = path13__default.join(src, entry.name);
|
|
2404
|
+
const destPath = path13__default.join(dest, entry.name);
|
|
2396
2405
|
if (entry.isDirectory()) await copyDir(srcPath, destPath);
|
|
2397
2406
|
else await fs6.copyFile(srcPath, destPath);
|
|
2398
2407
|
}
|
|
@@ -2401,14 +2410,14 @@ async function install(projectDir, opts) {
|
|
|
2401
2410
|
return opts?.full ? installFullPlugin(projectDir) : installMcp(projectDir);
|
|
2402
2411
|
}
|
|
2403
2412
|
async function installMcp(projectDir) {
|
|
2404
|
-
const mcpPath =
|
|
2413
|
+
const mcpPath = path13__default.join(projectDir, ".claude", "mcp.json");
|
|
2405
2414
|
const existing = await readJsonStrict(mcpPath) ?? {};
|
|
2406
2415
|
const mcpServers = { ...existing.mcpServers ?? {} };
|
|
2407
2416
|
const previous = mcpServers[SKAILE_MCP_NAME];
|
|
2408
2417
|
const matches = previous && JSON.stringify(previous) === JSON.stringify(MCP_SERVER_ENTRY);
|
|
2409
2418
|
let warning;
|
|
2410
2419
|
if (previous && !matches) {
|
|
2411
|
-
warning = `overwrote existing ${SKAILE_MCP_NAME} entry in ${
|
|
2420
|
+
warning = `overwrote existing ${SKAILE_MCP_NAME} entry in ${path13__default.relative(projectDir, mcpPath)}`;
|
|
2412
2421
|
}
|
|
2413
2422
|
mcpServers[SKAILE_MCP_NAME] = MCP_SERVER_ENTRY;
|
|
2414
2423
|
await writeJson(mcpPath, { ...existing, mcpServers });
|
|
@@ -2417,15 +2426,15 @@ async function installMcp(projectDir) {
|
|
|
2417
2426
|
async function installFullPlugin(projectDir) {
|
|
2418
2427
|
const dir = pluginDir(projectDir);
|
|
2419
2428
|
for (const [rel, content] of Object.entries(buildClaudePluginFiles())) {
|
|
2420
|
-
const dest =
|
|
2421
|
-
await fs6.mkdir(
|
|
2429
|
+
const dest = path13__default.join(dir, rel);
|
|
2430
|
+
await fs6.mkdir(path13__default.dirname(dest), { recursive: true });
|
|
2422
2431
|
await fs6.writeFile(dest, content);
|
|
2423
2432
|
}
|
|
2424
|
-
const projectSkillsDir =
|
|
2433
|
+
const projectSkillsDir = path13__default.join(projectDir, ".skaile", "skills");
|
|
2425
2434
|
if (existsSync(projectSkillsDir)) {
|
|
2426
|
-
await copyDir(projectSkillsDir,
|
|
2435
|
+
await copyDir(projectSkillsDir, path13__default.join(dir, "skills"));
|
|
2427
2436
|
}
|
|
2428
|
-
const settingsPath =
|
|
2437
|
+
const settingsPath = path13__default.join(projectDir, ".claude", "settings.json");
|
|
2429
2438
|
const settings = await readJsonStrict(settingsPath) ?? {};
|
|
2430
2439
|
const plugins = settings.plugins ?? [];
|
|
2431
2440
|
if (!plugins.includes(dir)) plugins.push(dir);
|
|
@@ -2433,8 +2442,8 @@ async function installFullPlugin(projectDir) {
|
|
|
2433
2442
|
return { changed: true, method: "plugin" };
|
|
2434
2443
|
}
|
|
2435
2444
|
async function uninstall(projectDir) {
|
|
2436
|
-
const settingsPath =
|
|
2437
|
-
const mcpPath =
|
|
2445
|
+
const settingsPath = path13__default.join(projectDir, ".claude", "settings.json");
|
|
2446
|
+
const mcpPath = path13__default.join(projectDir, ".claude", "mcp.json");
|
|
2438
2447
|
const dir = pluginDir(projectDir);
|
|
2439
2448
|
let changed = false;
|
|
2440
2449
|
const settings = await readJsonStrict(settingsPath);
|
|
@@ -2468,12 +2477,12 @@ async function uninstall(projectDir) {
|
|
|
2468
2477
|
async function detectInstall(projectDir) {
|
|
2469
2478
|
const dir = pluginDir(projectDir);
|
|
2470
2479
|
const settings = await readJsonStrict(
|
|
2471
|
-
|
|
2480
|
+
path13__default.join(projectDir, ".claude", "settings.json")
|
|
2472
2481
|
);
|
|
2473
|
-
if (existsSync(
|
|
2482
|
+
if (existsSync(path13__default.join(dir, ".claude-plugin", "plugin.json")) && settings?.plugins?.includes(dir)) {
|
|
2474
2483
|
return { method: "plugin", pluginPath: dir };
|
|
2475
2484
|
}
|
|
2476
|
-
const mcp = await readJsonStrict(
|
|
2485
|
+
const mcp = await readJsonStrict(path13__default.join(projectDir, ".claude", "mcp.json"));
|
|
2477
2486
|
if (mcp?.mcpServers && SKAILE_MCP_NAME in mcp.mcpServers) {
|
|
2478
2487
|
return { method: "mcp" };
|
|
2479
2488
|
}
|
|
@@ -2482,7 +2491,7 @@ async function detectInstall(projectDir) {
|
|
|
2482
2491
|
async function enable(projectDir) {
|
|
2483
2492
|
const detected = await detectInstall(projectDir);
|
|
2484
2493
|
if (!detected) throw new Error("plugin not installed for claude-code");
|
|
2485
|
-
const settingsPath =
|
|
2494
|
+
const settingsPath = path13__default.join(projectDir, ".claude", "settings.json");
|
|
2486
2495
|
const settings = await readJsonStrict(settingsPath) ?? {};
|
|
2487
2496
|
if (detected.method === "plugin") {
|
|
2488
2497
|
const disabled2 = settings.disabledPlugins ?? [];
|
|
@@ -2504,7 +2513,7 @@ async function enable(projectDir) {
|
|
|
2504
2513
|
async function disable(projectDir) {
|
|
2505
2514
|
const detected = await detectInstall(projectDir);
|
|
2506
2515
|
if (!detected) throw new Error("plugin not installed for claude-code");
|
|
2507
|
-
const settingsPath =
|
|
2516
|
+
const settingsPath = path13__default.join(projectDir, ".claude", "settings.json");
|
|
2508
2517
|
const settings = await readJsonStrict(settingsPath) ?? {};
|
|
2509
2518
|
if (detected.method === "plugin") {
|
|
2510
2519
|
const list2 = settings.disabledPlugins ?? [];
|
|
@@ -2524,12 +2533,12 @@ async function disable(projectDir) {
|
|
|
2524
2533
|
return { changed: true };
|
|
2525
2534
|
}
|
|
2526
2535
|
async function status(projectDir) {
|
|
2527
|
-
const settingsPath =
|
|
2528
|
-
const mcpPath =
|
|
2536
|
+
const settingsPath = path13__default.join(projectDir, ".claude", "settings.json");
|
|
2537
|
+
const mcpPath = path13__default.join(projectDir, ".claude", "mcp.json");
|
|
2529
2538
|
const dir = pluginDir(projectDir);
|
|
2530
2539
|
const settings = await readJsonStrict(settingsPath);
|
|
2531
2540
|
const mcp = await readJsonStrict(mcpPath);
|
|
2532
|
-
const pluginInstalled = !!(existsSync(
|
|
2541
|
+
const pluginInstalled = !!(existsSync(path13__default.join(dir, ".claude-plugin", "plugin.json")) && settings?.plugins?.includes(dir));
|
|
2533
2542
|
const mcpInstalled = !!(mcp?.mcpServers && SKAILE_MCP_NAME in mcp.mcpServers);
|
|
2534
2543
|
if (!pluginInstalled && !mcpInstalled) {
|
|
2535
2544
|
return {
|
|
@@ -2547,7 +2556,7 @@ async function status(projectDir) {
|
|
|
2547
2556
|
installed: "yes",
|
|
2548
2557
|
enabled: disabled2 ? "no" : "yes",
|
|
2549
2558
|
method: "plugin",
|
|
2550
|
-
location:
|
|
2559
|
+
location: path13__default.relative(projectDir, dir)
|
|
2551
2560
|
};
|
|
2552
2561
|
}
|
|
2553
2562
|
const disabled = settings?.disabledMcpjsonServers?.includes(SKAILE_MCP_NAME) ?? false;
|
|
@@ -2556,7 +2565,7 @@ async function status(projectDir) {
|
|
|
2556
2565
|
installed: "yes",
|
|
2557
2566
|
enabled: disabled ? "no" : "yes",
|
|
2558
2567
|
method: "mcp",
|
|
2559
|
-
location:
|
|
2568
|
+
location: path13__default.relative(projectDir, mcpPath)
|
|
2560
2569
|
};
|
|
2561
2570
|
}
|
|
2562
2571
|
var SKAILE_MCP_NAME2 = "skaile-workspace";
|
|
@@ -2583,7 +2592,7 @@ async function readConfig(p7) {
|
|
|
2583
2592
|
}
|
|
2584
2593
|
}
|
|
2585
2594
|
async function writeConfig(p7, value) {
|
|
2586
|
-
await fs6.mkdir(
|
|
2595
|
+
await fs6.mkdir(path13__default.dirname(p7), { recursive: true });
|
|
2587
2596
|
const cleaned = {};
|
|
2588
2597
|
for (const [k, v] of Object.entries(value)) {
|
|
2589
2598
|
if (v === void 0) continue;
|
|
@@ -2592,7 +2601,7 @@ async function writeConfig(p7, value) {
|
|
|
2592
2601
|
await fs6.writeFile(p7, stringify$1(cleaned));
|
|
2593
2602
|
}
|
|
2594
2603
|
function configPath(projectDir) {
|
|
2595
|
-
return
|
|
2604
|
+
return path13__default.join(projectDir, ".codex", "config.toml");
|
|
2596
2605
|
}
|
|
2597
2606
|
async function install2(projectDir) {
|
|
2598
2607
|
const p7 = configPath(projectDir);
|
|
@@ -2603,7 +2612,7 @@ async function install2(projectDir) {
|
|
|
2603
2612
|
const matches = previous && JSON.stringify(previous) === JSON.stringify(next);
|
|
2604
2613
|
let warning;
|
|
2605
2614
|
if (previous && !matches) {
|
|
2606
|
-
warning = `overwrote existing ${SKAILE_MCP_NAME2} entry in ${
|
|
2615
|
+
warning = `overwrote existing ${SKAILE_MCP_NAME2} entry in ${path13__default.relative(projectDir, p7)}`;
|
|
2607
2616
|
}
|
|
2608
2617
|
if (matches) return { changed: false, method: "toml" };
|
|
2609
2618
|
servers[SKAILE_MCP_NAME2] = next;
|
|
@@ -2644,12 +2653,12 @@ async function status2(projectDir) {
|
|
|
2644
2653
|
installed: "yes",
|
|
2645
2654
|
enabled: "n/a",
|
|
2646
2655
|
method: "mcp",
|
|
2647
|
-
location:
|
|
2656
|
+
location: path13__default.relative(projectDir, p7)
|
|
2648
2657
|
};
|
|
2649
2658
|
}
|
|
2650
2659
|
async function install3(projectDir) {
|
|
2651
|
-
const extDir =
|
|
2652
|
-
const extPath =
|
|
2660
|
+
const extDir = path13__default.join(projectDir, ".omp", "extensions");
|
|
2661
|
+
const extPath = path13__default.join(extDir, "skaile.ts");
|
|
2653
2662
|
await fs6.mkdir(extDir, { recursive: true });
|
|
2654
2663
|
const { WorkspacePlugin } = await import('../workspace-plugin/index.js');
|
|
2655
2664
|
const plugin = new WorkspacePlugin({ projectDir });
|
|
@@ -2664,7 +2673,7 @@ async function install3(projectDir) {
|
|
|
2664
2673
|
return { changed: true, method: "generated" };
|
|
2665
2674
|
}
|
|
2666
2675
|
async function uninstall3(projectDir) {
|
|
2667
|
-
const extPath =
|
|
2676
|
+
const extPath = path13__default.join(projectDir, ".omp", "extensions", "skaile.ts");
|
|
2668
2677
|
try {
|
|
2669
2678
|
await fs6.unlink(extPath);
|
|
2670
2679
|
return { changed: true };
|
|
@@ -2673,14 +2682,14 @@ async function uninstall3(projectDir) {
|
|
|
2673
2682
|
}
|
|
2674
2683
|
}
|
|
2675
2684
|
async function status3(projectDir) {
|
|
2676
|
-
const extPath =
|
|
2685
|
+
const extPath = path13__default.join(projectDir, ".omp", "extensions", "skaile.ts");
|
|
2677
2686
|
if (existsSync(extPath)) {
|
|
2678
2687
|
return {
|
|
2679
2688
|
backend: "omp",
|
|
2680
2689
|
installed: "yes",
|
|
2681
2690
|
enabled: "n/a",
|
|
2682
2691
|
method: "extension",
|
|
2683
|
-
location:
|
|
2692
|
+
location: path13__default.relative(projectDir, extPath)
|
|
2684
2693
|
};
|
|
2685
2694
|
}
|
|
2686
2695
|
return {
|
|
@@ -2743,7 +2752,7 @@ async function installCodex(projectDir) {
|
|
|
2743
2752
|
console.log(` ${S.dim("\u2192")} Restart Codex CLI to pick up the change.`);
|
|
2744
2753
|
}
|
|
2745
2754
|
async function runInstall(opts) {
|
|
2746
|
-
const projectDir =
|
|
2755
|
+
const projectDir = path13__default.resolve(opts.projectDir);
|
|
2747
2756
|
const targets = resolveDriver(opts.driver);
|
|
2748
2757
|
let exitCode = 0;
|
|
2749
2758
|
if (targets.includes("claude-code")) {
|
|
@@ -2777,7 +2786,7 @@ async function uninstallCodex(projectDir) {
|
|
|
2777
2786
|
else logInfo(`codex: not installed`);
|
|
2778
2787
|
}
|
|
2779
2788
|
async function runUninstall(opts) {
|
|
2780
|
-
const projectDir =
|
|
2789
|
+
const projectDir = path13__default.resolve(opts.projectDir);
|
|
2781
2790
|
const targets = resolveDriver(opts.driver);
|
|
2782
2791
|
let exitCode = 0;
|
|
2783
2792
|
if (targets.includes("claude-code")) {
|
|
@@ -2820,7 +2829,7 @@ async function toggleTarget(t, projectDir, action3) {
|
|
|
2820
2829
|
});
|
|
2821
2830
|
}
|
|
2822
2831
|
async function runToggle(opts, action3) {
|
|
2823
|
-
const projectDir =
|
|
2832
|
+
const projectDir = path13__default.resolve(opts.projectDir);
|
|
2824
2833
|
const requestedAll = opts.driver === "all";
|
|
2825
2834
|
const targets = resolveDriver(opts.driver);
|
|
2826
2835
|
const usageError = checkToggleSupported(targets, requestedAll, action3);
|
|
@@ -2832,7 +2841,7 @@ async function runToggle(opts, action3) {
|
|
|
2832
2841
|
return exitCode;
|
|
2833
2842
|
}
|
|
2834
2843
|
async function runStatus2(opts) {
|
|
2835
|
-
const projectDir =
|
|
2844
|
+
const projectDir = path13__default.resolve(opts.projectDir);
|
|
2836
2845
|
const targets = resolveDriver(opts.driver);
|
|
2837
2846
|
const rows = [];
|
|
2838
2847
|
let exitCode = 0;
|
|
@@ -2903,7 +2912,7 @@ async function runHook(event) {
|
|
|
2903
2912
|
await plugin.shutdown();
|
|
2904
2913
|
return;
|
|
2905
2914
|
}
|
|
2906
|
-
const store = new PluginStore(
|
|
2915
|
+
const store = new PluginStore(path13__default.join(projectDir, ".skaile", "plugin-state.json"));
|
|
2907
2916
|
await store.load();
|
|
2908
2917
|
const status4 = store.get("connector:status");
|
|
2909
2918
|
if (status4 && typeof status4 === "object" && Object.keys(status4).length > 0) {
|
|
@@ -2979,7 +2988,7 @@ async function indexLibrary(lib, index) {
|
|
|
2979
2988
|
}
|
|
2980
2989
|
}
|
|
2981
2990
|
function domainPublisher(libraryPath, domain) {
|
|
2982
|
-
const domainFile =
|
|
2991
|
+
const domainFile = path13.join(libraryPath, domain, "DOMAIN.md");
|
|
2983
2992
|
if (!fs13.existsSync(domainFile)) return void 0;
|
|
2984
2993
|
try {
|
|
2985
2994
|
const { data } = parseFrontmatter(fs13.readFileSync(domainFile, "utf8"));
|
|
@@ -3062,7 +3071,7 @@ function makeLibraryCommand() {
|
|
|
3062
3071
|
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
3072
|
async (name, opts) => {
|
|
3064
3073
|
const libDir = resolveLibraryDir();
|
|
3065
|
-
const libPath =
|
|
3074
|
+
const libPath = path13.join(libDir, name);
|
|
3066
3075
|
const ownership = opts.contributor ? "contributor" : opts.reader ? "reader" : "owner";
|
|
3067
3076
|
const { manager, close } = await openLibraryManager();
|
|
3068
3077
|
try {
|
|
@@ -3134,21 +3143,21 @@ function makeLibraryCommand() {
|
|
|
3134
3143
|
}
|
|
3135
3144
|
const effectiveKind = opts.kind ?? kind;
|
|
3136
3145
|
const am2 = new AssetManager({ projectDir: process.cwd() });
|
|
3137
|
-
const destDir = opts.dir ?
|
|
3146
|
+
const destDir = opts.dir ? path13.join(target.path, opts.dir) : target.path;
|
|
3138
3147
|
const res = am2.create(name, effectiveKind, destDir);
|
|
3139
3148
|
if (!res.ok) {
|
|
3140
3149
|
logErr(res.path);
|
|
3141
3150
|
process.exit(1);
|
|
3142
3151
|
}
|
|
3143
3152
|
logOk(`Created ${effectiveKind}: ${pc5.dim(res.path)}`);
|
|
3144
|
-
const domain2 = opts.dir ? opts.dir.split(
|
|
3153
|
+
const domain2 = opts.dir ? opts.dir.split(path13.sep)[0] : void 0;
|
|
3145
3154
|
const publisher = resolveLibraryPublisher(target, opts, domain2, getStoreIdentity());
|
|
3146
3155
|
stampAssetPublisher(res.path, publisher);
|
|
3147
3156
|
ensureManifestPublisher(target.path, publisher);
|
|
3148
3157
|
upsertManifestAsset(target.path, {
|
|
3149
3158
|
kind: effectiveKind,
|
|
3150
3159
|
name,
|
|
3151
|
-
root:
|
|
3160
|
+
root: path13.relative(target.path, res.path) || name,
|
|
3152
3161
|
version: "0.1.0"
|
|
3153
3162
|
});
|
|
3154
3163
|
const idx = await indexLibrary(target, library);
|
|
@@ -3223,7 +3232,7 @@ function makeLibraryCommand() {
|
|
|
3223
3232
|
const { manager, close } = await openLibraryManager();
|
|
3224
3233
|
try {
|
|
3225
3234
|
const target = await resolveTargetLibrary(manager, opts.library);
|
|
3226
|
-
const domainFile =
|
|
3235
|
+
const domainFile = path13.join(target.path, name, "DOMAIN.md");
|
|
3227
3236
|
if (!existsSync(domainFile)) {
|
|
3228
3237
|
logErr(`Domain "${name}" not found in "${target.name}" (no ${domainFile}).`);
|
|
3229
3238
|
process.exit(1);
|
|
@@ -3246,8 +3255,8 @@ function makeLibraryCommand() {
|
|
|
3246
3255
|
const { manager, close } = await openLibraryManager();
|
|
3247
3256
|
try {
|
|
3248
3257
|
const lib = await manager.requireLibrary(oldName);
|
|
3249
|
-
const parent =
|
|
3250
|
-
const newPath =
|
|
3258
|
+
const parent = path13.dirname(lib.path);
|
|
3259
|
+
const newPath = path13.join(parent, newName);
|
|
3251
3260
|
if (fs13.existsSync(newPath)) {
|
|
3252
3261
|
logErr(`Target directory already exists: ${newPath}`);
|
|
3253
3262
|
process.exit(1);
|
|
@@ -3407,16 +3416,16 @@ function makeLibraryCommand() {
|
|
|
3407
3416
|
});
|
|
3408
3417
|
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
3418
|
async (lib, opts) => {
|
|
3410
|
-
const { runLibraryPublish } = await import('../library-publish-
|
|
3419
|
+
const { runLibraryPublish } = await import('../library-publish-BEFA7OCS.js');
|
|
3411
3420
|
await withStoreErrorHandling(() => runLibraryPublish(lib, opts));
|
|
3412
3421
|
}
|
|
3413
3422
|
);
|
|
3414
3423
|
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-
|
|
3424
|
+
const { runLibraryRegister } = await import('../library-publish-BEFA7OCS.js');
|
|
3416
3425
|
await withStoreErrorHandling(() => runLibraryRegister(lib, opts));
|
|
3417
3426
|
});
|
|
3418
3427
|
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-
|
|
3428
|
+
const { runLibraryYank } = await import('../library-publish-BEFA7OCS.js');
|
|
3420
3429
|
await withStoreErrorHandling(() => runLibraryYank(lib, opts));
|
|
3421
3430
|
});
|
|
3422
3431
|
return cmd;
|
|
@@ -3433,14 +3442,14 @@ function stampAssetPublisher(assetDir, publisher) {
|
|
|
3433
3442
|
const markers = ["SKILL.md", "AGENT.md", "CONTRACT.md"];
|
|
3434
3443
|
let markerFile;
|
|
3435
3444
|
for (const m of markers) {
|
|
3436
|
-
if (fs13.existsSync(
|
|
3437
|
-
markerFile =
|
|
3445
|
+
if (fs13.existsSync(path13.join(assetDir, m))) {
|
|
3446
|
+
markerFile = path13.join(assetDir, m);
|
|
3438
3447
|
break;
|
|
3439
3448
|
}
|
|
3440
3449
|
}
|
|
3441
3450
|
if (!markerFile) {
|
|
3442
3451
|
const promptMd = fs13.readdirSync(assetDir).find((f) => f.endsWith(".prompt.md"));
|
|
3443
|
-
if (promptMd) markerFile =
|
|
3452
|
+
if (promptMd) markerFile = path13.join(assetDir, promptMd);
|
|
3444
3453
|
}
|
|
3445
3454
|
if (!markerFile) return;
|
|
3446
3455
|
try {
|
|
@@ -3467,7 +3476,7 @@ function ensureManifestPublisher(libraryPath, publisher) {
|
|
|
3467
3476
|
async function syncManifestWithDisk(libraryPath, libraryName) {
|
|
3468
3477
|
const publisher = loadSkPublishManifest(libraryPath)?.publisher ?? slugifyAssetName(libraryName);
|
|
3469
3478
|
for (const e of await scanDirectory(libraryPath, publisher)) {
|
|
3470
|
-
const root =
|
|
3479
|
+
const root = path13.relative(libraryPath, path13.dirname(e.source)) || e.name;
|
|
3471
3480
|
upsertManifestAsset(libraryPath, { kind: e.kind, name: e.name, root, version: e.version });
|
|
3472
3481
|
}
|
|
3473
3482
|
}
|
|
@@ -3509,9 +3518,9 @@ async function printOverallStatus(projectDir, asJson) {
|
|
|
3509
3518
|
} catch {
|
|
3510
3519
|
secretsStrategy = "unavailable";
|
|
3511
3520
|
}
|
|
3512
|
-
const resolvedProjectDir =
|
|
3513
|
-
const hasWorkspaceConfig = existsSync(
|
|
3514
|
-
const hasLockFile = existsSync(
|
|
3521
|
+
const resolvedProjectDir = path13.resolve(projectDir);
|
|
3522
|
+
const hasWorkspaceConfig = existsSync(path13.join(resolvedProjectDir, "skaile.yaml"));
|
|
3523
|
+
const hasLockFile = existsSync(path13.join(resolvedProjectDir, "skaile.lock.yaml"));
|
|
3515
3524
|
let assignments = [];
|
|
3516
3525
|
if (hasWorkspaceConfig) {
|
|
3517
3526
|
try {
|
|
@@ -4138,7 +4147,7 @@ function scheduleSoftDepPreview() {
|
|
|
4138
4147
|
}
|
|
4139
4148
|
async function loadAssets() {
|
|
4140
4149
|
softDepPreviewCache.clear();
|
|
4141
|
-
const { gatherAssetFeeds } = await import('../asset-feeds-
|
|
4150
|
+
const { gatherAssetFeeds } = await import('../asset-feeds-SEYSNNEM.js');
|
|
4142
4151
|
const { entries, domains, notes } = await gatherAssetFeeds(am, am.projectDir);
|
|
4143
4152
|
if (notes.length > 0) {
|
|
4144
4153
|
state.message = notes.map((n) => `[${n.feed}] ${n.message}`).join(" \u2022 ");
|
|
@@ -4160,7 +4169,7 @@ function rebuildSourceTree() {
|
|
|
4160
4169
|
rebuildVisibleSources();
|
|
4161
4170
|
}
|
|
4162
4171
|
function sourceOrgRepo(s) {
|
|
4163
|
-
const parts = s.path.split(
|
|
4172
|
+
const parts = s.path.split(path13__default.sep).filter(Boolean);
|
|
4164
4173
|
if (parts.length < 2) return null;
|
|
4165
4174
|
return { org: parts[parts.length - 2], repo: parts[parts.length - 1] };
|
|
4166
4175
|
}
|
|
@@ -4344,14 +4353,14 @@ function reconcileCollapsedSets(rows) {
|
|
|
4344
4353
|
async function loadSourcesAndLibraries() {
|
|
4345
4354
|
try {
|
|
4346
4355
|
const [{ openLibraryManager: openLibraryManager2 }, { skaileHomeDir }, { getGlobalCacheDir: getGlobalCacheDir2 }] = await Promise.all([
|
|
4347
|
-
import('../open-library-
|
|
4356
|
+
import('../open-library-WJ7P7B4N.js'),
|
|
4348
4357
|
import('../library/index.js'),
|
|
4349
4358
|
import('../core/index.js')
|
|
4350
4359
|
]);
|
|
4351
4360
|
const { manager, library, close } = await openLibraryManager2();
|
|
4352
4361
|
try {
|
|
4353
4362
|
const newRoot = getGlobalCacheDir2();
|
|
4354
|
-
const legacyRoot =
|
|
4363
|
+
const legacyRoot = path13__default.join(skaileHomeDir(), "sources");
|
|
4355
4364
|
const isSourceRow = (l) => l.path.startsWith(newRoot) || l.path.startsWith(legacyRoot);
|
|
4356
4365
|
const libs = await manager.listLibraries();
|
|
4357
4366
|
const defs = await library.listAssetDefs();
|
|
@@ -5411,13 +5420,13 @@ async function run(projectDir) {
|
|
|
5411
5420
|
}
|
|
5412
5421
|
function makeManageCommand() {
|
|
5413
5422
|
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(
|
|
5423
|
+
await run(path13__default.resolve(opts.projectDir));
|
|
5415
5424
|
});
|
|
5416
5425
|
}
|
|
5417
5426
|
function makeMcpServerCommand() {
|
|
5418
5427
|
return new Command("mcp-server").description("Start skaile workspace MCP server (stdio transport)").option("--project-dir <path>", "Project directory (default: cwd)", process.cwd()).action(async (opts) => {
|
|
5419
|
-
const
|
|
5420
|
-
const projectDir =
|
|
5428
|
+
const path37 = await import('path');
|
|
5429
|
+
const projectDir = path37.default.resolve(opts.projectDir);
|
|
5421
5430
|
const { LogStore, StdoutSink, registerLogStore } = await import('../core/logging.js');
|
|
5422
5431
|
registerLogStore(
|
|
5423
5432
|
new LogStore({
|
|
@@ -5454,8 +5463,8 @@ function makeNpxCommand() {
|
|
|
5454
5463
|
skills.command("add <url>").description(
|
|
5455
5464
|
"Clone a repo, register it in the project's skaile.yaml sources[], and install a skill from it"
|
|
5456
5465
|
).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 =
|
|
5466
|
+
const projectDir = path13__default.resolve(opts.projectDir);
|
|
5467
|
+
const projYaml = path13__default.join(projectDir, "skaile.yaml");
|
|
5459
5468
|
if (!existsSync(projYaml)) {
|
|
5460
5469
|
logErr(`No skaile.yaml in ${projectDir} \u2014 run \`skaile init\` first.`);
|
|
5461
5470
|
process.exit(1);
|
|
@@ -5468,11 +5477,11 @@ function makeNpxCommand() {
|
|
|
5468
5477
|
}
|
|
5469
5478
|
const spinner4 = p5.spinner();
|
|
5470
5479
|
const key = sourceCacheKey(url);
|
|
5471
|
-
const clonePath =
|
|
5480
|
+
const clonePath = path13__default.join(getGlobalCacheDir(), key);
|
|
5472
5481
|
spinner4.start(`Cloning ${url}`);
|
|
5473
5482
|
try {
|
|
5474
5483
|
if (!existsSync(clonePath)) {
|
|
5475
|
-
mkdirSync(
|
|
5484
|
+
mkdirSync(path13__default.dirname(clonePath), { recursive: true });
|
|
5476
5485
|
execSync(`git clone ${url} ${clonePath}`, { stdio: "ignore" });
|
|
5477
5486
|
}
|
|
5478
5487
|
spinner4.stop(`Cloned to ${key}`);
|
|
@@ -5518,7 +5527,7 @@ function makeNpxCommand() {
|
|
|
5518
5527
|
return npx;
|
|
5519
5528
|
}
|
|
5520
5529
|
function resolvePublisher(clonePath, url) {
|
|
5521
|
-
const manifestPath =
|
|
5530
|
+
const manifestPath = path13__default.join(clonePath, SKAILE_MANIFEST_FILENAME);
|
|
5522
5531
|
if (existsSync(manifestPath)) {
|
|
5523
5532
|
try {
|
|
5524
5533
|
const { manifest } = decodeSkaileManifest(readFileSync(manifestPath, "utf8"));
|
|
@@ -5531,12 +5540,12 @@ function resolvePublisher(clonePath, url) {
|
|
|
5531
5540
|
return url.match(/github\.com[/:]([^/]+)\/[^/]+/)?.[1];
|
|
5532
5541
|
}
|
|
5533
5542
|
function resolveSkillName(clonePath, requested) {
|
|
5534
|
-
const skillsDir =
|
|
5535
|
-
if (existsSync(
|
|
5543
|
+
const skillsDir = path13__default.join(clonePath, "skills");
|
|
5544
|
+
if (existsSync(path13__default.join(skillsDir, requested, "SKILL.md"))) return requested;
|
|
5536
5545
|
if (!existsSync(skillsDir)) return requested;
|
|
5537
5546
|
for (const entry of readdirSync(skillsDir, { withFileTypes: true })) {
|
|
5538
5547
|
if (!entry.isDirectory()) continue;
|
|
5539
|
-
const md =
|
|
5548
|
+
const md = path13__default.join(skillsDir, entry.name, "SKILL.md");
|
|
5540
5549
|
if (!existsSync(md)) continue;
|
|
5541
5550
|
try {
|
|
5542
5551
|
const { data } = parseFrontmatter(readFileSync(md, "utf8"));
|
|
@@ -5551,7 +5560,7 @@ function makeOutdatedCommand() {
|
|
|
5551
5560
|
new Option("--target <agent>", "Driver target").default("claude-code").choices(SUPPORTED_DRIVER_TARGETS)
|
|
5552
5561
|
).action((name, opts) => {
|
|
5553
5562
|
const am2 = new AssetManager({
|
|
5554
|
-
projectDir:
|
|
5563
|
+
projectDir: path13__default.resolve(opts.projectDir),
|
|
5555
5564
|
driverTarget: opts.target
|
|
5556
5565
|
});
|
|
5557
5566
|
const entries = am2.outdated();
|
|
@@ -5580,7 +5589,7 @@ function makeOutdatedCommand() {
|
|
|
5580
5589
|
function makePatchCommand() {
|
|
5581
5590
|
const cmd = new Command("patch").description("Patch workflow for skill improvement");
|
|
5582
5591
|
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:
|
|
5592
|
+
const am2 = new AssetManager({ projectDir: path13__default.resolve(opts.projectDir) });
|
|
5584
5593
|
try {
|
|
5585
5594
|
const dest = await am2.patch(ref);
|
|
5586
5595
|
logOk(`Extracted to ${S.dim(dest)}`);
|
|
@@ -5591,7 +5600,7 @@ function makePatchCommand() {
|
|
|
5591
5600
|
}
|
|
5592
5601
|
});
|
|
5593
5602
|
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:
|
|
5603
|
+
const am2 = new AssetManager({ projectDir: path13__default.resolve(opts.projectDir) });
|
|
5595
5604
|
try {
|
|
5596
5605
|
const patchFile = await am2.patchCommit(ref);
|
|
5597
5606
|
logOk(`Patch saved to ${S.dim(patchFile)}`);
|
|
@@ -5602,7 +5611,7 @@ function makePatchCommand() {
|
|
|
5602
5611
|
}
|
|
5603
5612
|
});
|
|
5604
5613
|
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:
|
|
5614
|
+
const am2 = new AssetManager({ projectDir: path13__default.resolve(opts.projectDir) });
|
|
5606
5615
|
try {
|
|
5607
5616
|
await am2.patchSubmit(ref);
|
|
5608
5617
|
logOk("Patch applied to repo clone and committed.");
|
|
@@ -5615,7 +5624,7 @@ function makePatchCommand() {
|
|
|
5615
5624
|
}
|
|
5616
5625
|
});
|
|
5617
5626
|
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:
|
|
5627
|
+
const am2 = new AssetManager({ projectDir: path13__default.resolve(opts.projectDir) });
|
|
5619
5628
|
am2.patchRemove(ref);
|
|
5620
5629
|
logOk(`Patch removed for ${ref}`);
|
|
5621
5630
|
});
|
|
@@ -5633,7 +5642,7 @@ function action2(fn) {
|
|
|
5633
5642
|
};
|
|
5634
5643
|
}
|
|
5635
5644
|
async function reconcileAndReport(projectDir, plugins) {
|
|
5636
|
-
const { reconcilePlugins } = await import('../plugin-store-
|
|
5645
|
+
const { reconcilePlugins } = await import('../plugin-store-EOP3S7OU.js');
|
|
5637
5646
|
if (plugins.length === 0) {
|
|
5638
5647
|
logInfo("No plugins declared \u2014 nothing to reconcile.");
|
|
5639
5648
|
return;
|
|
@@ -5647,10 +5656,10 @@ async function reconcileAndReport(projectDir, plugins) {
|
|
|
5647
5656
|
}
|
|
5648
5657
|
}
|
|
5649
5658
|
async function runInstall2(spec, opts) {
|
|
5650
|
-
const projectDir =
|
|
5659
|
+
const projectDir = path13__default.resolve(opts.projectDir);
|
|
5651
5660
|
const { WorkspaceYamlEditor: WorkspaceYamlEditor2 } = await import('../core/index.js');
|
|
5652
|
-
const { specName } = await import('../plugin-store-
|
|
5653
|
-
const yamlPath =
|
|
5661
|
+
const { specName } = await import('../plugin-store-EOP3S7OU.js');
|
|
5662
|
+
const yamlPath = path13__default.join(projectDir, "skaile.yaml");
|
|
5654
5663
|
const editor = WorkspaceYamlEditor2.load(yamlPath);
|
|
5655
5664
|
const replaced = editor.addPlugin(spec, specName);
|
|
5656
5665
|
editor.save();
|
|
@@ -5659,10 +5668,10 @@ async function runInstall2(spec, opts) {
|
|
|
5659
5668
|
await reconcileAndReport(projectDir, editor.getPlugins());
|
|
5660
5669
|
}
|
|
5661
5670
|
async function runRemove(name, opts) {
|
|
5662
|
-
const projectDir =
|
|
5671
|
+
const projectDir = path13__default.resolve(opts.projectDir);
|
|
5663
5672
|
const { WorkspaceYamlEditor: WorkspaceYamlEditor2 } = await import('../core/index.js');
|
|
5664
|
-
const { specName } = await import('../plugin-store-
|
|
5665
|
-
const yamlPath =
|
|
5673
|
+
const { specName } = await import('../plugin-store-EOP3S7OU.js');
|
|
5674
|
+
const yamlPath = path13__default.join(projectDir, "skaile.yaml");
|
|
5666
5675
|
const editor = WorkspaceYamlEditor2.load(yamlPath);
|
|
5667
5676
|
const removed = editor.removePlugin(name, specName);
|
|
5668
5677
|
if (!removed) {
|
|
@@ -5674,7 +5683,7 @@ async function runRemove(name, opts) {
|
|
|
5674
5683
|
await reconcileAndReport(projectDir, editor.getPlugins());
|
|
5675
5684
|
}
|
|
5676
5685
|
async function runList(opts) {
|
|
5677
|
-
const projectDir =
|
|
5686
|
+
const projectDir = path13__default.resolve(opts.projectDir);
|
|
5678
5687
|
const { resolveSkWorkspaceConfig: resolveSkWorkspaceConfig2 } = await import('../core/index.js');
|
|
5679
5688
|
const config = resolveSkWorkspaceConfig2(projectDir);
|
|
5680
5689
|
const declared = config.plugins ?? [];
|
|
@@ -5689,7 +5698,7 @@ async function runList(opts) {
|
|
|
5689
5698
|
const registry = createPluginRegistry();
|
|
5690
5699
|
if (declared.length > 0) {
|
|
5691
5700
|
try {
|
|
5692
|
-
const { loadPlugins } = await import('../plugin-store-
|
|
5701
|
+
const { loadPlugins } = await import('../plugin-store-EOP3S7OU.js');
|
|
5693
5702
|
const result = await loadPlugins(projectDir, declared, registry);
|
|
5694
5703
|
for (const f of result.failed) logWarn(f.error);
|
|
5695
5704
|
} catch (err) {
|
|
@@ -5864,7 +5873,7 @@ function neededSources(config, lock) {
|
|
|
5864
5873
|
}
|
|
5865
5874
|
function sourcesWithSidecar(sources) {
|
|
5866
5875
|
const dir = getStoreManifestsDir();
|
|
5867
|
-
return sources.filter((s) => existsSync(
|
|
5876
|
+
return sources.filter((s) => existsSync(path13.join(dir, `${storeManifestSlug(s.url)}.yaml`))).map((s) => s.url);
|
|
5868
5877
|
}
|
|
5869
5878
|
function compact(obj) {
|
|
5870
5879
|
const out = {};
|
|
@@ -5956,8 +5965,8 @@ function redactSecrets(preset, findings) {
|
|
|
5956
5965
|
}
|
|
5957
5966
|
return { preset: next, keys };
|
|
5958
5967
|
}
|
|
5959
|
-
function placeholderKey(itemId,
|
|
5960
|
-
return `${itemId}_${
|
|
5968
|
+
function placeholderKey(itemId, path37) {
|
|
5969
|
+
return `${itemId}_${path37}`.replace(/[^a-zA-Z0-9]+/g, "_").replace(/^_+|_+$/g, "").toUpperCase();
|
|
5961
5970
|
}
|
|
5962
5971
|
function setAtPath(root, segments, value) {
|
|
5963
5972
|
let node = root;
|
|
@@ -5980,7 +5989,7 @@ function makePresetCommand() {
|
|
|
5980
5989
|
cmd.command("init [name]").description("Scaffold a new .preset.yaml file").option("--dir <path>", "Output directory", process.cwd()).action(async (name, opts) => {
|
|
5981
5990
|
const presetName = name ?? "my-preset";
|
|
5982
5991
|
const filename = `${presetName}.preset.yaml`;
|
|
5983
|
-
const outPath =
|
|
5992
|
+
const outPath = path13__default.join(path13__default.resolve(opts.dir), filename);
|
|
5984
5993
|
if (existsSync(outPath)) {
|
|
5985
5994
|
logErr(`File already exists: ${outPath}`);
|
|
5986
5995
|
logInfo("Choose a different name or remove the existing file.");
|
|
@@ -6013,7 +6022,7 @@ function makePresetCommand() {
|
|
|
6013
6022
|
return cmd;
|
|
6014
6023
|
}
|
|
6015
6024
|
async function runPresetExport(name, opts) {
|
|
6016
|
-
const projectDir =
|
|
6025
|
+
const projectDir = path13__default.resolve(opts.projectDir);
|
|
6017
6026
|
const file = loadSkWorkspaceConfig(projectDir);
|
|
6018
6027
|
if (!file) {
|
|
6019
6028
|
logErr(`No skaile.yaml found in ${projectDir}`);
|
|
@@ -6023,7 +6032,7 @@ async function runPresetExport(name, opts) {
|
|
|
6023
6032
|
const presetName = name ?? file.config.name ?? "my-preset";
|
|
6024
6033
|
let lock = null;
|
|
6025
6034
|
try {
|
|
6026
|
-
lock = readLock(
|
|
6035
|
+
lock = readLock(path13__default.join(projectDir, "skaile.lock.yaml"));
|
|
6027
6036
|
} catch {
|
|
6028
6037
|
lock = null;
|
|
6029
6038
|
}
|
|
@@ -6064,7 +6073,7 @@ async function runPresetExport(name, opts) {
|
|
|
6064
6073
|
const contents = header ? `${header}
|
|
6065
6074
|
${body}` : body;
|
|
6066
6075
|
if (opts.out && opts.dir !== process.cwd()) logWarn("--dir is ignored when --out is set.");
|
|
6067
|
-
const outPath = opts.out ?
|
|
6076
|
+
const outPath = opts.out ? path13__default.resolve(opts.out) : path13__default.join(path13__default.resolve(opts.dir), `${presetName}.preset.yaml`);
|
|
6068
6077
|
if (existsSync(outPath) && !opts.force) {
|
|
6069
6078
|
logErr(`File already exists: ${outPath}`);
|
|
6070
6079
|
logInfo("Pass --force to overwrite, or choose a different --out/--dir.");
|
|
@@ -6076,7 +6085,7 @@ ${body}` : body;
|
|
|
6076
6085
|
logErr(`Failed to write ${outPath}: ${e.message}`);
|
|
6077
6086
|
process.exit(1);
|
|
6078
6087
|
}
|
|
6079
|
-
logOk(`Exported ${S.brand(
|
|
6088
|
+
logOk(`Exported ${S.brand(path13__default.basename(outPath))}`);
|
|
6080
6089
|
logInfo(`Path: ${outPath}`);
|
|
6081
6090
|
if (unresolved.length > 0) {
|
|
6082
6091
|
console.error(S.err("This file is NOT safe to share."));
|
|
@@ -6117,13 +6126,13 @@ function collectInput(value, acc) {
|
|
|
6117
6126
|
return acc;
|
|
6118
6127
|
}
|
|
6119
6128
|
async function runPresetApply(filePath, opts) {
|
|
6120
|
-
const projectDir =
|
|
6129
|
+
const projectDir = path13__default.resolve(opts.projectDir);
|
|
6121
6130
|
const file = loadSkWorkspaceConfig(projectDir);
|
|
6122
6131
|
if (!file) {
|
|
6123
6132
|
logErr("No skaile.yaml \u2014 run `skaile init` first");
|
|
6124
6133
|
process.exit(1);
|
|
6125
6134
|
}
|
|
6126
|
-
const resolved =
|
|
6135
|
+
const resolved = path13__default.resolve(filePath);
|
|
6127
6136
|
if (!existsSync(resolved)) {
|
|
6128
6137
|
logErr(`File not found: ${resolved}`);
|
|
6129
6138
|
process.exit(1);
|
|
@@ -6339,7 +6348,7 @@ async function reportNestedPresetRefs(preset) {
|
|
|
6339
6348
|
}
|
|
6340
6349
|
async function checkPresetCycles(preset, resolved) {
|
|
6341
6350
|
const { detectCycles } = await import('../discovery/index.js');
|
|
6342
|
-
const presetRef =
|
|
6351
|
+
const presetRef = path13__default.basename(resolved, ".preset.yaml");
|
|
6343
6352
|
const edges = [];
|
|
6344
6353
|
for (const item of preset.items) {
|
|
6345
6354
|
if (item.ref) {
|
|
@@ -6391,7 +6400,7 @@ function printPresetSummary(preset, placeholderCount, hasWarnings) {
|
|
|
6391
6400
|
}
|
|
6392
6401
|
}
|
|
6393
6402
|
async function runPresetValidate(filePath) {
|
|
6394
|
-
const resolved =
|
|
6403
|
+
const resolved = path13__default.resolve(filePath);
|
|
6395
6404
|
const preset = await loadPresetForValidation(resolved);
|
|
6396
6405
|
await reportNestedPresetRefs(preset);
|
|
6397
6406
|
await checkPresetCycles(preset, resolved);
|
|
@@ -6441,14 +6450,14 @@ items:
|
|
|
6441
6450
|
}
|
|
6442
6451
|
function makeRebuildCommand() {
|
|
6443
6452
|
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 =
|
|
6453
|
+
const projectDir = path13__default.resolve(opts.projectDir);
|
|
6445
6454
|
let agentDir;
|
|
6446
6455
|
if (agentArg) {
|
|
6447
6456
|
if (agentArg.includes("/") || agentArg.includes("\\")) {
|
|
6448
|
-
agentDir =
|
|
6457
|
+
agentDir = path13__default.resolve(projectDir, agentArg);
|
|
6449
6458
|
} else {
|
|
6450
6459
|
const resolved = resolveAgentDir(projectDir);
|
|
6451
|
-
agentDir = resolved ??
|
|
6460
|
+
agentDir = resolved ?? path13__default.resolve(projectDir, agentArg);
|
|
6452
6461
|
}
|
|
6453
6462
|
} else {
|
|
6454
6463
|
const resolved = resolveAgentDir(projectDir);
|
|
@@ -6541,7 +6550,7 @@ function makeFlowEventHandler() {
|
|
|
6541
6550
|
}
|
|
6542
6551
|
function makeRunCommand() {
|
|
6543
6552
|
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 =
|
|
6553
|
+
const projectDir = path13__default.resolve(opts.projectDir);
|
|
6545
6554
|
const cliDriver = opts.driver;
|
|
6546
6555
|
const dryRun = opts.dryRun ?? false;
|
|
6547
6556
|
let flowId = positional[0];
|
|
@@ -6576,12 +6585,12 @@ function makeRunCommand() {
|
|
|
6576
6585
|
const priorityRoots = [];
|
|
6577
6586
|
let dir = projectDir;
|
|
6578
6587
|
for (let i = 0; i < 6; i++) {
|
|
6579
|
-
const candidate =
|
|
6588
|
+
const candidate = path13__default.join(dir, "ai-assets");
|
|
6580
6589
|
if (fs13__default.existsSync(candidate)) {
|
|
6581
6590
|
priorityRoots.push(candidate);
|
|
6582
6591
|
break;
|
|
6583
6592
|
}
|
|
6584
|
-
dir =
|
|
6593
|
+
dir = path13__default.dirname(dir);
|
|
6585
6594
|
}
|
|
6586
6595
|
const flowPath = findFlowFile(flowId, priorityRoots);
|
|
6587
6596
|
if (!flowPath) {
|
|
@@ -6652,7 +6661,7 @@ function makeRunCommand() {
|
|
|
6652
6661
|
}
|
|
6653
6662
|
function makeResumeCommand() {
|
|
6654
6663
|
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 =
|
|
6664
|
+
const projectDir = path13__default.resolve(opts.projectDir);
|
|
6656
6665
|
const sessionId = opts.session;
|
|
6657
6666
|
const dryRun = opts.dryRun ?? false;
|
|
6658
6667
|
const session = sessionId ? await loadSessionById(projectDir, sessionId) : await loadSession(projectDir);
|
|
@@ -6679,7 +6688,7 @@ function makeResumeCommand() {
|
|
|
6679
6688
|
}
|
|
6680
6689
|
function makeStatusCommand() {
|
|
6681
6690
|
return new Command("status").description("Show current session state").option("--project-dir <path>", "Project directory", process.cwd()).action(async (opts) => {
|
|
6682
|
-
const projectDir =
|
|
6691
|
+
const projectDir = path13__default.resolve(opts.projectDir);
|
|
6683
6692
|
const session = await loadSession(projectDir);
|
|
6684
6693
|
if (!session) {
|
|
6685
6694
|
logInfo("No active session.");
|
|
@@ -6704,7 +6713,7 @@ function makeStatusCommand() {
|
|
|
6704
6713
|
}
|
|
6705
6714
|
function makeClearCommand() {
|
|
6706
6715
|
return new Command("clear").description("Unset current session pointer").option("--project-dir <path>", "Project directory", process.cwd()).action(async (opts) => {
|
|
6707
|
-
const projectDir =
|
|
6716
|
+
const projectDir = path13__default.resolve(opts.projectDir);
|
|
6708
6717
|
await clearSession(projectDir);
|
|
6709
6718
|
logOk("Session cleared.");
|
|
6710
6719
|
});
|
|
@@ -6714,7 +6723,7 @@ function makeReplCommand() {
|
|
|
6714
6723
|
const { findWorkspaceRoot } = await import('../core/index.js');
|
|
6715
6724
|
const { startRepl } = await import('../tui/index.js');
|
|
6716
6725
|
const os2 = await import('os');
|
|
6717
|
-
const userCwd =
|
|
6726
|
+
const userCwd = path13__default.resolve(opts.projectDir ?? process.cwd());
|
|
6718
6727
|
const workspaceRoot = findWorkspaceRoot(userCwd);
|
|
6719
6728
|
let projectDir;
|
|
6720
6729
|
let agentCwd;
|
|
@@ -6736,12 +6745,12 @@ function makeReplCommand() {
|
|
|
6736
6745
|
p5.cancel("Cancelled.");
|
|
6737
6746
|
process.exit(0);
|
|
6738
6747
|
}
|
|
6739
|
-
const tmpDir = fs13__default.mkdtempSync(
|
|
6748
|
+
const tmpDir = fs13__default.mkdtempSync(path13__default.join(os2.tmpdir(), "skaile-repl-"));
|
|
6740
6749
|
projectDir = tmpDir;
|
|
6741
6750
|
agentCwd = userCwd;
|
|
6742
6751
|
logOk(`Temporary workspace: ${S.cmd(tmpDir)}`);
|
|
6743
6752
|
if (!driverOverride) {
|
|
6744
|
-
const claudeDir =
|
|
6753
|
+
const claudeDir = path13__default.join(os2.homedir(), ".claude");
|
|
6745
6754
|
if (fs13__default.existsSync(claudeDir)) {
|
|
6746
6755
|
driverOverride = "claude-sdk";
|
|
6747
6756
|
logInfo(`Detected ${S.cmd("~/.claude")} \u2192 using ${S.cmd("claude-sdk")} backend`);
|
|
@@ -6788,12 +6797,12 @@ function makeServeCommand() {
|
|
|
6788
6797
|
);
|
|
6789
6798
|
}
|
|
6790
6799
|
async function ensurePluginsLoadedForServe(projectDir) {
|
|
6791
|
-
const { logInfo: logInfo2, logWarn: logWarn2 } = await import('../helpers-
|
|
6800
|
+
const { logInfo: logInfo2, logWarn: logWarn2 } = await import('../helpers-LJFOH4RB.js');
|
|
6792
6801
|
try {
|
|
6793
6802
|
const { resolveSkWorkspaceConfig: resolveSkWorkspaceConfig2 } = await import('../core/index.js');
|
|
6794
6803
|
const config = resolveSkWorkspaceConfig2(projectDir);
|
|
6795
6804
|
if (!config.plugins || config.plugins.length === 0) return;
|
|
6796
|
-
const { ensurePluginsLoaded } = await import('../plugin-store-
|
|
6805
|
+
const { ensurePluginsLoaded } = await import('../plugin-store-EOP3S7OU.js');
|
|
6797
6806
|
const { pluginRegistry } = await import('../plugin-registry/index.js');
|
|
6798
6807
|
const result = await ensurePluginsLoaded(projectDir, config.plugins, pluginRegistry);
|
|
6799
6808
|
if (result.loaded.length > 0) {
|
|
@@ -6807,14 +6816,14 @@ async function ensurePluginsLoadedForServe(projectDir) {
|
|
|
6807
6816
|
}
|
|
6808
6817
|
}
|
|
6809
6818
|
async function runCompileTest(opts) {
|
|
6810
|
-
const { logOk: logOk2, logErr: logErr2, logInfo: logInfo2, S: S2 } = await import('../helpers-
|
|
6819
|
+
const { logOk: logOk2, logErr: logErr2, logInfo: logInfo2, S: S2 } = await import('../helpers-LJFOH4RB.js');
|
|
6811
6820
|
const { tmpdir } = await import('os');
|
|
6812
6821
|
const { dirname: dirname4, join: join7, resolve: resolve5 } = await import('path');
|
|
6813
6822
|
const { fileURLToPath: fileURLToPath2 } = await import('url');
|
|
6814
6823
|
const { unlinkSync, existsSync: existsSync15 } = await import('fs');
|
|
6815
6824
|
const { spawn } = await import('child_process');
|
|
6816
6825
|
const { portableSpawnSync: portableSpawnSync2 } = await import('../core/index.js');
|
|
6817
|
-
const { MONOREPO_ROOT } = await import('../paths-
|
|
6826
|
+
const { MONOREPO_ROOT } = await import('../paths-2ZZMB7HU.js');
|
|
6818
6827
|
if (MONOREPO_ROOT === null) {
|
|
6819
6828
|
logErr2("--compile-test is only available inside the skaile-dev workspace.");
|
|
6820
6829
|
logInfo2("Run it from a checkout of skaile-ai/skaile-dev (the monorepo shell).");
|
|
@@ -7296,7 +7305,7 @@ function resolveMode(opts) {
|
|
|
7296
7305
|
if (opts.forceLocal && opts.forceRemote) {
|
|
7297
7306
|
throw new Error("Cannot use both --local and --remote");
|
|
7298
7307
|
}
|
|
7299
|
-
const startDir =
|
|
7308
|
+
const startDir = path13__default.resolve(opts.projectDir ?? process.cwd());
|
|
7300
7309
|
const localDb = findLogsDb(startDir);
|
|
7301
7310
|
if (opts.forceLocal) {
|
|
7302
7311
|
if (!localDb) {
|
|
@@ -7329,14 +7338,14 @@ function resolveMode(opts) {
|
|
|
7329
7338
|
function findLogsDb(startDir) {
|
|
7330
7339
|
let dir = startDir;
|
|
7331
7340
|
for (let i = 0; i < MAX_WALK_LEVELS; i++) {
|
|
7332
|
-
const candidate =
|
|
7341
|
+
const candidate = path13__default.join(dir, ".skaile", "logs.db");
|
|
7333
7342
|
if (existsSync(candidate)) {
|
|
7334
7343
|
try {
|
|
7335
7344
|
if (statSync(candidate).isFile()) return candidate;
|
|
7336
7345
|
} catch {
|
|
7337
7346
|
}
|
|
7338
7347
|
}
|
|
7339
|
-
const parent =
|
|
7348
|
+
const parent = path13__default.dirname(dir);
|
|
7340
7349
|
if (parent === dir) return void 0;
|
|
7341
7350
|
dir = parent;
|
|
7342
7351
|
}
|
|
@@ -7362,7 +7371,7 @@ function readApiToken() {
|
|
|
7362
7371
|
}
|
|
7363
7372
|
function readGlobalSettings() {
|
|
7364
7373
|
try {
|
|
7365
|
-
const settingsPath =
|
|
7374
|
+
const settingsPath = path13__default.join(homedir(), ".skaile", "settings.json");
|
|
7366
7375
|
if (!existsSync(settingsPath)) return {};
|
|
7367
7376
|
return JSON.parse(readFileSync(settingsPath, "utf8"));
|
|
7368
7377
|
} catch {
|
|
@@ -7511,7 +7520,7 @@ function parsePositiveInt(value, flag) {
|
|
|
7511
7520
|
function makeSessionCommand() {
|
|
7512
7521
|
const cmd = new Command("session").description("Manage sessions");
|
|
7513
7522
|
cmd.command("list").description("List all sessions for a project").option("--project-dir <path>", "Project directory", process.cwd()).action(async (opts) => {
|
|
7514
|
-
const projectDir =
|
|
7523
|
+
const projectDir = path13__default.resolve(opts.projectDir);
|
|
7515
7524
|
const sessions = await listSessions(projectDir);
|
|
7516
7525
|
const current = await loadSession(projectDir);
|
|
7517
7526
|
if (sessions.length === 0) {
|
|
@@ -7539,7 +7548,7 @@ function makeSessionCommand() {
|
|
|
7539
7548
|
console.log();
|
|
7540
7549
|
});
|
|
7541
7550
|
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 =
|
|
7551
|
+
const projectDir = path13__default.resolve(opts.projectDir);
|
|
7543
7552
|
const session = await loadSessionById(projectDir, runId);
|
|
7544
7553
|
if (!session) {
|
|
7545
7554
|
logErr(`Session not found: ${runId}`);
|
|
@@ -7548,12 +7557,12 @@ function makeSessionCommand() {
|
|
|
7548
7557
|
console.log(JSON.stringify(session, null, 2));
|
|
7549
7558
|
});
|
|
7550
7559
|
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 =
|
|
7560
|
+
const projectDir = path13__default.resolve(opts.projectDir);
|
|
7552
7561
|
await setCurrentSession(projectDir, runId);
|
|
7553
7562
|
logOk(`Switched to session: ${S.dim(runId.slice(0, 8))}`);
|
|
7554
7563
|
});
|
|
7555
7564
|
cmd.command("delete <run-id>").description("Delete a session").option("--project-dir <path>", "Project directory", process.cwd()).action(async (runId, opts) => {
|
|
7556
|
-
const projectDir =
|
|
7565
|
+
const projectDir = path13__default.resolve(opts.projectDir);
|
|
7557
7566
|
await deleteSession(projectDir, runId);
|
|
7558
7567
|
logOk(`Deleted session: ${S.dim(runId.slice(0, 8))}`);
|
|
7559
7568
|
});
|
|
@@ -7621,7 +7630,7 @@ async function showAsset(am2, kind, name) {
|
|
|
7621
7630
|
function makeShowCommand() {
|
|
7622
7631
|
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
7632
|
const am2 = new AssetManager({
|
|
7624
|
-
projectDir:
|
|
7633
|
+
projectDir: path13__default.resolve(opts.projectDir),
|
|
7625
7634
|
driverTarget: opts.target
|
|
7626
7635
|
});
|
|
7627
7636
|
if (!kind) {
|
|
@@ -7689,9 +7698,9 @@ function makeStoreCommand() {
|
|
|
7689
7698
|
process.exit(2);
|
|
7690
7699
|
});
|
|
7691
7700
|
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-
|
|
7701
|
+
const { openCatalogSource: openCatalogSource2, LocalCatalogDisabledError } = await import('../open-library-WJ7P7B4N.js');
|
|
7693
7702
|
try {
|
|
7694
|
-
const remote = await openCatalogSource2({ projectDir:
|
|
7703
|
+
const remote = await openCatalogSource2({ projectDir: path13__default.resolve(opts.projectDir) });
|
|
7695
7704
|
const assets = await remote.listAssets(opts.kind ? { kind: opts.kind } : {});
|
|
7696
7705
|
const results = filterCatalogAssets(assets, query);
|
|
7697
7706
|
if (results.length === 0) {
|
|
@@ -7722,10 +7731,10 @@ function makeStoreCommand() {
|
|
|
7722
7731
|
}
|
|
7723
7732
|
});
|
|
7724
7733
|
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-
|
|
7734
|
+
const { openCatalogSource: openCatalogSource2, LocalCatalogDisabledError } = await import('../open-library-WJ7P7B4N.js');
|
|
7735
|
+
const { supportsInstallManifest } = await import('../project-6RXDBSRV.js');
|
|
7727
7736
|
try {
|
|
7728
|
-
const remote = await openCatalogSource2({ projectDir:
|
|
7737
|
+
const remote = await openCatalogSource2({ projectDir: path13__default.resolve(opts.projectDir) });
|
|
7729
7738
|
const asset = await remote.resolve(ref);
|
|
7730
7739
|
if (!asset) {
|
|
7731
7740
|
logErr(`Not found in store: ${ref} (try a full ref, e.g. skill:@publisher/name#version)`);
|
|
@@ -7844,7 +7853,7 @@ function printTree(node, prefix = "", isLast = true) {
|
|
|
7844
7853
|
}
|
|
7845
7854
|
function makeTreeCommand() {
|
|
7846
7855
|
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:
|
|
7856
|
+
const am2 = new AssetManager({ projectDir: path13__default.resolve(opts.projectDir) });
|
|
7848
7857
|
const root = am2.tree();
|
|
7849
7858
|
if (root.children.length === 0) {
|
|
7850
7859
|
logInfo("No dependencies in lock file. Run `skaile install` first.");
|
|
@@ -7870,7 +7879,7 @@ function makeUpdateCommand() {
|
|
|
7870
7879
|
try {
|
|
7871
7880
|
const catalogSpinner = p5.spinner();
|
|
7872
7881
|
catalogSpinner.start("Refreshing catalog cache");
|
|
7873
|
-
const remote = await openCatalogSource({ projectDir:
|
|
7882
|
+
const remote = await openCatalogSource({ projectDir: path13__default.resolve(opts.projectDir) });
|
|
7874
7883
|
const result2 = await remote.refresh();
|
|
7875
7884
|
catalogSpinner.stop(
|
|
7876
7885
|
`Catalog refreshed: ${S.heading(String(result2.assetsCached))} assets cached`
|
|
@@ -7882,7 +7891,7 @@ function makeUpdateCommand() {
|
|
|
7882
7891
|
}
|
|
7883
7892
|
}
|
|
7884
7893
|
if (opts.catalogOnly) return;
|
|
7885
|
-
const projectDir =
|
|
7894
|
+
const projectDir = path13__default.resolve(opts.projectDir);
|
|
7886
7895
|
if (await shouldSyncSources(opts)) {
|
|
7887
7896
|
const syncSpinner = p5.spinner();
|
|
7888
7897
|
syncSpinner.start("Syncing sources");
|
|
@@ -7943,7 +7952,7 @@ function findManifestCandidates(rootPath) {
|
|
|
7943
7952
|
return;
|
|
7944
7953
|
}
|
|
7945
7954
|
for (const entry of entries) {
|
|
7946
|
-
const fullPath =
|
|
7955
|
+
const fullPath = path13__default.join(dir, entry.name);
|
|
7947
7956
|
if (entry.isDirectory()) {
|
|
7948
7957
|
if (!SKIP_DIRS.has(entry.name)) walk(fullPath);
|
|
7949
7958
|
} else if (entry.isFile()) {
|
|
@@ -7996,13 +8005,13 @@ function parseManifestCandidate(c, absRoot) {
|
|
|
7996
8005
|
const parsed = c.filePath.endsWith(".json") ? JSON.parse(content) : parse(content);
|
|
7997
8006
|
return { kind: "value", parsed };
|
|
7998
8007
|
} catch (e) {
|
|
7999
|
-
const relPath =
|
|
8008
|
+
const relPath = path13__default.relative(absRoot, c.filePath);
|
|
8000
8009
|
logErr(`${relPath} \u2014 parse error: ${e instanceof Error ? e.message : String(e)}`);
|
|
8001
8010
|
return { kind: "error" };
|
|
8002
8011
|
}
|
|
8003
8012
|
}
|
|
8004
8013
|
function validateManifestCandidate(c, parsed, absRoot, registry, strictConformance) {
|
|
8005
|
-
const relPath =
|
|
8014
|
+
const relPath = path13__default.relative(absRoot, c.filePath);
|
|
8006
8015
|
let errors = 0;
|
|
8007
8016
|
let warnings = 0;
|
|
8008
8017
|
const identityError = checkManifestIdentity(c.kind, parsed);
|
|
@@ -8011,7 +8020,7 @@ function validateManifestCandidate(c, parsed, absRoot, registry, strictConforman
|
|
|
8011
8020
|
errors++;
|
|
8012
8021
|
}
|
|
8013
8022
|
if (c.kind === "skill" && parsed && typeof parsed === "object") {
|
|
8014
|
-
const dirName =
|
|
8023
|
+
const dirName = path13__default.basename(path13__default.dirname(c.filePath));
|
|
8015
8024
|
const findings = checkAgentSkillConformance(parsed, { dirName });
|
|
8016
8025
|
for (const f of findings) {
|
|
8017
8026
|
const line = `${relPath} [skill conformance] \u2014 ${f.field}: ${f.message}`;
|
|
@@ -8039,7 +8048,7 @@ function validateManifestCandidate(c, parsed, absRoot, registry, strictConforman
|
|
|
8039
8048
|
return { errors, warnings };
|
|
8040
8049
|
}
|
|
8041
8050
|
function validateManifests(rootPath, strictConformance) {
|
|
8042
|
-
const absRoot =
|
|
8051
|
+
const absRoot = path13__default.resolve(rootPath);
|
|
8043
8052
|
if (!fs13__default.existsSync(absRoot)) {
|
|
8044
8053
|
logErr(`Path does not exist: ${absRoot}`);
|
|
8045
8054
|
return { total: 0, errors: 1, warnings: 0 };
|
|
@@ -8077,7 +8086,7 @@ function findWorkspaceManifests(rootPath) {
|
|
|
8077
8086
|
return;
|
|
8078
8087
|
}
|
|
8079
8088
|
for (const entry of entries) {
|
|
8080
|
-
const full =
|
|
8089
|
+
const full = path13__default.join(dir, entry.name);
|
|
8081
8090
|
if (entry.isDirectory()) {
|
|
8082
8091
|
if (!SKIP_DIRS.has(entry.name)) walk(full);
|
|
8083
8092
|
} else if (entry.isFile() && /(^|\.)skaile\.yaml$/.test(entry.name)) {
|
|
@@ -8140,11 +8149,11 @@ function validateWorkspaceAssets(parsed, relPath) {
|
|
|
8140
8149
|
return errors;
|
|
8141
8150
|
}
|
|
8142
8151
|
function validateWorkspaceManifests(rootPath) {
|
|
8143
|
-
const absRoot =
|
|
8152
|
+
const absRoot = path13__default.resolve(rootPath);
|
|
8144
8153
|
const files = findWorkspaceManifests(absRoot);
|
|
8145
8154
|
let errors = 0;
|
|
8146
8155
|
for (const file of files) {
|
|
8147
|
-
const relPath =
|
|
8156
|
+
const relPath = path13__default.relative(absRoot, file);
|
|
8148
8157
|
let parsed;
|
|
8149
8158
|
try {
|
|
8150
8159
|
parsed = parse(fs13__default.readFileSync(file, "utf-8")) ?? {};
|
|
@@ -8164,20 +8173,20 @@ function collectAssetVersions() {
|
|
|
8164
8173
|
if (!fs13__default.existsSync(AI_RESOURCES)) return assets;
|
|
8165
8174
|
const domains = fs13__default.readdirSync(AI_RESOURCES, { withFileTypes: true }).filter((d) => d.isDirectory() && !EXCLUDED_DOMAINS.has(d.name));
|
|
8166
8175
|
for (const d of domains) {
|
|
8167
|
-
const domainDir =
|
|
8168
|
-
const skillsDir =
|
|
8176
|
+
const domainDir = path13__default.join(AI_RESOURCES, d.name);
|
|
8177
|
+
const skillsDir = path13__default.join(domainDir, "skills");
|
|
8169
8178
|
if (fs13__default.existsSync(skillsDir)) {
|
|
8170
8179
|
collectSkillVersions(skillsDir, d.name, assets);
|
|
8171
8180
|
}
|
|
8172
|
-
const agentsDir =
|
|
8181
|
+
const agentsDir = path13__default.join(domainDir, "agents");
|
|
8173
8182
|
if (fs13__default.existsSync(agentsDir)) {
|
|
8174
8183
|
collectAgentVersions(agentsDir, d.name, assets);
|
|
8175
8184
|
}
|
|
8176
|
-
const flowsDir =
|
|
8185
|
+
const flowsDir = path13__default.join(domainDir, "flows");
|
|
8177
8186
|
if (fs13__default.existsSync(flowsDir)) {
|
|
8178
8187
|
collectFlowVersions(flowsDir, d.name, assets);
|
|
8179
8188
|
}
|
|
8180
|
-
const promptsDir =
|
|
8189
|
+
const promptsDir = path13__default.join(domainDir, "prompts");
|
|
8181
8190
|
if (fs13__default.existsSync(promptsDir)) {
|
|
8182
8191
|
collectPromptVersions(promptsDir, d.name, assets);
|
|
8183
8192
|
}
|
|
@@ -8187,7 +8196,7 @@ function collectAssetVersions() {
|
|
|
8187
8196
|
function collectFlowVersions(dir, domain, out) {
|
|
8188
8197
|
for (const f of fs13__default.readdirSync(dir)) {
|
|
8189
8198
|
if (!f.endsWith(".flow.yaml")) continue;
|
|
8190
|
-
const fp =
|
|
8199
|
+
const fp = path13__default.join(dir, f);
|
|
8191
8200
|
const content = fs13__default.readFileSync(fp, "utf-8");
|
|
8192
8201
|
const parsed = parse(content);
|
|
8193
8202
|
out.push({
|
|
@@ -8202,7 +8211,7 @@ function collectFlowVersions(dir, domain, out) {
|
|
|
8202
8211
|
function collectPromptVersions(dir, domain, out) {
|
|
8203
8212
|
for (const f of fs13__default.readdirSync(dir)) {
|
|
8204
8213
|
if (!f.endsWith(".prompt.md")) continue;
|
|
8205
|
-
const fp =
|
|
8214
|
+
const fp = path13__default.join(dir, f);
|
|
8206
8215
|
const content = fs13__default.readFileSync(fp, "utf-8");
|
|
8207
8216
|
const fm = parseSkillFrontmatter(content);
|
|
8208
8217
|
out.push({
|
|
@@ -8217,8 +8226,8 @@ function collectPromptVersions(dir, domain, out) {
|
|
|
8217
8226
|
function collectSkillVersions(dir, domain, out) {
|
|
8218
8227
|
for (const entry of fs13__default.readdirSync(dir, { withFileTypes: true })) {
|
|
8219
8228
|
if (!entry.isDirectory()) continue;
|
|
8220
|
-
const full =
|
|
8221
|
-
const skillMd =
|
|
8229
|
+
const full = path13__default.join(dir, entry.name);
|
|
8230
|
+
const skillMd = path13__default.join(full, "SKILL.md");
|
|
8222
8231
|
if (fs13__default.existsSync(skillMd)) {
|
|
8223
8232
|
const content = fs13__default.readFileSync(skillMd, "utf-8");
|
|
8224
8233
|
const fm = parseSkillFrontmatter(content);
|
|
@@ -8237,7 +8246,7 @@ function collectSkillVersions(dir, domain, out) {
|
|
|
8237
8246
|
function collectAgentVersions(dir, domain, out) {
|
|
8238
8247
|
for (const entry of fs13__default.readdirSync(dir, { withFileTypes: true })) {
|
|
8239
8248
|
if (!entry.isDirectory()) continue;
|
|
8240
|
-
const agentYaml =
|
|
8249
|
+
const agentYaml = path13__default.join(dir, entry.name, "agent.yaml");
|
|
8241
8250
|
if (!fs13__default.existsSync(agentYaml)) continue;
|
|
8242
8251
|
const content = fs13__default.readFileSync(agentYaml, "utf-8");
|
|
8243
8252
|
const parsed = parse(content);
|
|
@@ -8270,7 +8279,7 @@ function filterToChangedAssets(assets) {
|
|
|
8270
8279
|
encoding: "utf-8"
|
|
8271
8280
|
});
|
|
8272
8281
|
const changedFiles = new Set(
|
|
8273
|
-
diffOutput.trim().split("\n").filter(Boolean).map((f) =>
|
|
8282
|
+
diffOutput.trim().split("\n").filter(Boolean).map((f) => path13__default.resolve(AI_RESOURCES, f))
|
|
8274
8283
|
);
|
|
8275
8284
|
return assets.filter((a) => changedFiles.has(a.filePath));
|
|
8276
8285
|
} catch {
|
|
@@ -8296,7 +8305,7 @@ function checkVersionBumps(assets) {
|
|
|
8296
8305
|
let warnings = 0;
|
|
8297
8306
|
for (const a of assets) {
|
|
8298
8307
|
if (!a.version) continue;
|
|
8299
|
-
const relPath =
|
|
8308
|
+
const relPath = path13__default.relative(AI_RESOURCES, a.filePath);
|
|
8300
8309
|
try {
|
|
8301
8310
|
const headContent = execSync(`git show HEAD:${relPath}`, {
|
|
8302
8311
|
cwd: AI_RESOURCES,
|
|
@@ -8372,7 +8381,7 @@ function makeValidateCommand() {
|
|
|
8372
8381
|
"--strict-conformance",
|
|
8373
8382
|
"Treat Agent Skills (agentskills.io) standard findings as errors"
|
|
8374
8383
|
).action((targetPath, opts) => {
|
|
8375
|
-
const absPath =
|
|
8384
|
+
const absPath = path13__default.resolve(targetPath);
|
|
8376
8385
|
logInfo(`Validating manifests in ${absPath}`);
|
|
8377
8386
|
const { total, errors, warnings } = validateManifests(
|
|
8378
8387
|
absPath,
|
|
@@ -8422,7 +8431,7 @@ function makeValidateCommand() {
|
|
|
8422
8431
|
let errors = 0;
|
|
8423
8432
|
for (const domain of modifiedDomains) {
|
|
8424
8433
|
const changelogModified = modifiedFiles.some(
|
|
8425
|
-
(f) => f === `${domain}/CHANGELOG.md` || f ===
|
|
8434
|
+
(f) => f === `${domain}/CHANGELOG.md` || f === path13__default.join(domain, "CHANGELOG.md")
|
|
8426
8435
|
);
|
|
8427
8436
|
if (changelogModified) {
|
|
8428
8437
|
logOk(`${domain}/CHANGELOG.md updated`);
|
|
@@ -8528,7 +8537,7 @@ function whyEmptyMessage(ref, declared) {
|
|
|
8528
8537
|
}
|
|
8529
8538
|
function makeWhyCommand() {
|
|
8530
8539
|
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:
|
|
8540
|
+
const am2 = new AssetManager({ projectDir: path13__default.resolve(opts.projectDir) });
|
|
8532
8541
|
const chain = am2.why(ref);
|
|
8533
8542
|
if (chain.length === 0) {
|
|
8534
8543
|
let declared;
|
|
@@ -8562,7 +8571,7 @@ function makeWhyCommand() {
|
|
|
8562
8571
|
var _defaultFormatHelp = Help.prototype.formatHelp;
|
|
8563
8572
|
var pkg = JSON.parse(
|
|
8564
8573
|
readFileSync(
|
|
8565
|
-
|
|
8574
|
+
path13__default.resolve(path13__default.dirname(fileURLToPath(import.meta.url)), "../../package.json"),
|
|
8566
8575
|
"utf-8"
|
|
8567
8576
|
)
|
|
8568
8577
|
);
|
|
@@ -8692,31 +8701,31 @@ async function runInit(projectDir, opts) {
|
|
|
8692
8701
|
process.exitCode = 1;
|
|
8693
8702
|
return;
|
|
8694
8703
|
}
|
|
8695
|
-
const resolved =
|
|
8696
|
-
const projectName =
|
|
8704
|
+
const resolved = path13__default.resolve(projectDir ?? ".");
|
|
8705
|
+
const projectName = path13__default.basename(resolved);
|
|
8697
8706
|
const created = [];
|
|
8698
8707
|
const { existsSync: existsSync15 } = await import('fs');
|
|
8699
8708
|
if (!existsSync15(resolved)) {
|
|
8700
8709
|
mkdirSync5(resolved, { recursive: true });
|
|
8701
8710
|
created.push(".");
|
|
8702
8711
|
}
|
|
8703
|
-
const skaileDir =
|
|
8712
|
+
const skaileDir = path13__default.join(resolved, ".skaile");
|
|
8704
8713
|
if (!existsSync15(skaileDir)) {
|
|
8705
|
-
mkdirSync5(
|
|
8714
|
+
mkdirSync5(path13__default.join(skaileDir, "sessions"), { recursive: true });
|
|
8706
8715
|
created.push(".skaile/");
|
|
8707
8716
|
}
|
|
8708
|
-
const settingsPath =
|
|
8717
|
+
const settingsPath = path13__default.join(skaileDir, "settings.json");
|
|
8709
8718
|
if (!existsSync15(settingsPath)) {
|
|
8710
8719
|
writeFileSync5(settingsPath, "{}\n");
|
|
8711
8720
|
created.push(".skaile/settings.json");
|
|
8712
8721
|
}
|
|
8713
|
-
const wsConfigPath =
|
|
8722
|
+
const wsConfigPath = path13__default.join(resolved, "skaile.yaml");
|
|
8714
8723
|
if (!existsSync15(wsConfigPath)) {
|
|
8715
8724
|
writeFileSync5(wsConfigPath, stringify2(buildInitWorkspaceConfig(projectName, backend)));
|
|
8716
8725
|
created.push("skaile.yaml");
|
|
8717
8726
|
}
|
|
8718
8727
|
for (const dir of new Set(Object.values(DRIVER_TARGETS[backend].local))) {
|
|
8719
|
-
const full =
|
|
8728
|
+
const full = path13__default.join(resolved, dir);
|
|
8720
8729
|
if (!existsSync15(full)) {
|
|
8721
8730
|
mkdirSync5(full, { recursive: true });
|
|
8722
8731
|
created.push(`${dir}/`);
|
|
@@ -8749,7 +8758,7 @@ function buildInitWorkspaceConfig(projectName, backend) {
|
|
|
8749
8758
|
async function initGitScaffold(resolved, created) {
|
|
8750
8759
|
const { execSync: execSync3 } = await import('child_process');
|
|
8751
8760
|
const { existsSync: existsSync15, readFileSync: readFileSync9, writeFileSync: writeFileSync5 } = await import('fs');
|
|
8752
|
-
const gitignorePath =
|
|
8761
|
+
const gitignorePath = path13__default.join(resolved, ".gitignore");
|
|
8753
8762
|
const entries = [
|
|
8754
8763
|
"node_modules/",
|
|
8755
8764
|
".skaile/sessions/",
|
|
@@ -8773,7 +8782,7 @@ async function initGitScaffold(resolved, created) {
|
|
|
8773
8782
|
`);
|
|
8774
8783
|
if (!existing) created.push(".gitignore");
|
|
8775
8784
|
}
|
|
8776
|
-
if (!existsSync15(
|
|
8785
|
+
if (!existsSync15(path13__default.join(resolved, ".git"))) {
|
|
8777
8786
|
try {
|
|
8778
8787
|
execSync3("git init", { cwd: resolved, stdio: "pipe" });
|
|
8779
8788
|
created.push(".git/");
|
|
@@ -8803,7 +8812,7 @@ async function bootstrapUserConfig() {
|
|
|
8803
8812
|
}
|
|
8804
8813
|
async function hydrateInitSources(resolved, created) {
|
|
8805
8814
|
try {
|
|
8806
|
-
const { ensureSourcesCloned } = await import('../ensure-sources-
|
|
8815
|
+
const { ensureSourcesCloned } = await import('../ensure-sources-IM3JMW2L.js');
|
|
8807
8816
|
const hydrate = ensureSourcesCloned(resolved, { quiet: true });
|
|
8808
8817
|
for (const n of hydrate.cloned) created.push(`~/.skaile/cache/sources/${n}/`);
|
|
8809
8818
|
if (hydrate.failed.length > 0) {
|
|
@@ -8819,7 +8828,7 @@ function printInitSummary(resolved, projectDir, created) {
|
|
|
8819
8828
|
logOk(`Initialized project at ${S.heading(resolved)}`);
|
|
8820
8829
|
console.log();
|
|
8821
8830
|
console.log(S.heading(" Next steps:"));
|
|
8822
|
-
const isCurrentDir = resolved ===
|
|
8831
|
+
const isCurrentDir = resolved === path13__default.resolve(".");
|
|
8823
8832
|
let step = 1;
|
|
8824
8833
|
if (!isCurrentDir) {
|
|
8825
8834
|
console.log(` ${S.dim(`${step}.`)} ${S.cmd(`cd ${projectDir}`)}`);
|
|
@@ -8843,7 +8852,7 @@ function printInitSummary(resolved, projectDir, created) {
|
|
|
8843
8852
|
console.log();
|
|
8844
8853
|
}
|
|
8845
8854
|
program.command("setup").description("Interactive provider setup wizard").action(async () => {
|
|
8846
|
-
const { cmdSetup } = await import('../setup-
|
|
8855
|
+
const { cmdSetup } = await import('../setup-XI7TCIGF.js');
|
|
8847
8856
|
await cmdSetup([], { projectDir: process.cwd() });
|
|
8848
8857
|
});
|
|
8849
8858
|
program.addCommand(makeInstallCommand());
|