@skaile/workspaces 1.6.1 → 1.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +76 -0
- package/dist/{asset-feeds-PTZBWJEL.js → asset-feeds-Y66NCOQZ.js} +4 -4
- package/dist/{asset-feeds-PTZBWJEL.js.map → asset-feeds-Y66NCOQZ.js.map} +1 -1
- package/dist/asset-manager/index.js +1 -1
- package/dist/asset-manager/src/index.d.ts.map +1 -1
- package/dist/chunk-34U5UC6G.js +284 -0
- package/dist/chunk-34U5UC6G.js.map +1 -0
- package/dist/{chunk-EA73UA42.js → chunk-35OWUKOD.js} +2 -2
- package/dist/{chunk-EA73UA42.js.map → chunk-35OWUKOD.js.map} +1 -1
- package/dist/{chunk-4OVPB7SI.js → chunk-6K6T2RBP.js} +6 -2
- package/dist/chunk-6K6T2RBP.js.map +1 -0
- package/dist/{chunk-M4UKIJ5K.js → chunk-M3Y5KM6F.js} +28 -13
- package/dist/chunk-M3Y5KM6F.js.map +1 -0
- package/dist/{chunk-Y5B5272E.js → chunk-MB6563TL.js} +16 -3
- package/dist/chunk-MB6563TL.js.map +1 -0
- package/dist/{chunk-SH55Z5QA.js → chunk-O3D4KYFG.js} +3 -3
- package/dist/{chunk-SH55Z5QA.js.map → chunk-O3D4KYFG.js.map} +1 -1
- package/dist/{chunk-SNN6O7ON.js → chunk-PP2LOT4W.js} +43 -7
- package/dist/chunk-PP2LOT4W.js.map +1 -0
- package/dist/{chunk-HIATVS2E.js → chunk-S74G7AZL.js} +3 -3
- package/dist/{chunk-HIATVS2E.js.map → chunk-S74G7AZL.js.map} +1 -1
- package/dist/{chunk-NTYCGPZ3.js → chunk-THJZ3JZE.js} +6 -6
- package/dist/{chunk-NTYCGPZ3.js.map → chunk-THJZ3JZE.js.map} +1 -1
- package/dist/{chunk-X7G2CCW4.js → chunk-TITPPC54.js} +3 -3
- package/dist/{chunk-X7G2CCW4.js.map → chunk-TITPPC54.js.map} +1 -1
- package/dist/{chunk-NRWDQBZ7.js → chunk-VBRXFLIP.js} +3 -3
- package/dist/{chunk-NRWDQBZ7.js.map → chunk-VBRXFLIP.js.map} +1 -1
- package/dist/{chunk-MY7TSVO7.js → chunk-Y3UCU4ZK.js} +6 -2
- package/dist/chunk-Y3UCU4ZK.js.map +1 -0
- package/dist/{chunk-OJ7G56I7.js → chunk-Y6FV73IH.js} +57 -3
- package/dist/chunk-Y6FV73IH.js.map +1 -0
- package/dist/cli/index.js +239 -387
- package/dist/cli/index.js.map +1 -1
- package/dist/cli/src/commands/library-cmd.d.ts.map +1 -1
- package/dist/cli/src/commands/library-index.d.ts +12 -2
- package/dist/cli/src/commands/library-index.d.ts.map +1 -1
- package/dist/cli/src/commands/library-publish.d.ts.map +1 -1
- package/dist/cli/src/commands/manage.d.ts.map +1 -1
- package/dist/cli/src/commands/publish-core.d.ts +24 -0
- package/dist/cli/src/commands/publish-core.d.ts.map +1 -1
- package/dist/cli/src/commands/session-logs/remote-query.d.ts.map +1 -1
- package/dist/cli/src/commands/session-logs/remote-tail.d.ts.map +1 -1
- package/dist/cli/src/commands/session-logs/superjson-transformer.d.ts +12 -0
- package/dist/cli/src/commands/session-logs/superjson-transformer.d.ts.map +1 -0
- package/dist/cli/src/commands/source-manifest-publish.d.ts.map +1 -1
- package/dist/cli/src/commands/store.d.ts.map +1 -1
- package/dist/cli/src/store-auth.d.ts +11 -0
- package/dist/cli/src/store-auth.d.ts.map +1 -1
- package/dist/cli/src/store-publisher.d.ts +24 -1
- package/dist/cli/src/store-publisher.d.ts.map +1 -1
- package/dist/connectors/config.js +1 -1
- package/dist/connectors/index.js +2 -2
- package/dist/connectors/src/config.d.ts +21 -0
- package/dist/connectors/src/config.d.ts.map +1 -1
- package/dist/connectors/src/index.d.ts +1 -1
- package/dist/connectors/src/index.d.ts.map +1 -1
- package/dist/{ensure-sources-ORACQA4I.js → ensure-sources-NXBYK5GP.js} +4 -4
- package/dist/{ensure-sources-ORACQA4I.js.map → ensure-sources-NXBYK5GP.js.map} +1 -1
- package/dist/factory-assets/connectors/box.js +2 -2
- package/dist/factory-assets/connectors/deploy.js +2 -2
- package/dist/factory-assets/connectors/devserver.js +2 -2
- package/dist/factory-assets/connectors/flow/adapter.js +2 -2
- package/dist/factory-assets/connectors/flow/run-flow.js +3 -3
- package/dist/factory-assets/connectors/flow.js +2 -2
- package/dist/factory-assets/connectors/git.js +2 -2
- package/dist/factory-assets/connectors/gmail.js +2 -2
- package/dist/factory-assets/connectors/googledrive.js +2 -2
- package/dist/factory-assets/connectors/local.js +2 -2
- package/dist/factory-assets/connectors/mattermost.js +2 -2
- package/dist/factory-assets/connectors/memory.js +2 -2
- package/dist/factory-assets/connectors/minio.js +2 -2
- package/dist/factory-assets/connectors/postgres.js +2 -2
- package/dist/factory-assets/connectors/s3.js +2 -2
- package/dist/factory-assets/connectors/sharepoint.js +2 -2
- package/dist/factory-assets/connectors/sqlite.js +2 -2
- package/dist/factory-assets/connectors/static-server.js +2 -2
- package/dist/factory-assets/connectors/tunnel.js +2 -2
- package/dist/factory-assets/connectors/webdav.js +2 -2
- package/dist/factory-assets/connectors/xstate-store.js +2 -2
- package/dist/factory-assets/connectors/xstate.js +2 -2
- package/dist/{helpers-SXGIHFCF.js → helpers-DN4MWOHB.js} +4 -4
- package/dist/{helpers-SXGIHFCF.js.map → helpers-DN4MWOHB.js.map} +1 -1
- package/dist/{library-publish-NQQFPOUY.js → library-publish-TPWFSO3Q.js} +24 -8
- package/dist/library-publish-TPWFSO3Q.js.map +1 -0
- package/dist/{open-library-ODW2PJ2J.js → open-library-ST2VFQTK.js} +5 -5
- package/dist/{open-library-ODW2PJ2J.js.map → open-library-ST2VFQTK.js.map} +1 -1
- package/dist/project-4M6QXHCH.js +28 -0
- package/dist/project-4M6QXHCH.js.map +1 -0
- package/dist/run-group-engine/index.d.ts +2 -0
- package/dist/run-group-engine/index.js +68 -0
- package/dist/run-group-engine/index.js.map +1 -0
- package/dist/run-group-engine/src/admit.d.ts +13 -0
- package/dist/run-group-engine/src/admit.d.ts.map +1 -0
- package/dist/run-group-engine/src/derive-instance-status.d.ts +9 -0
- package/dist/run-group-engine/src/derive-instance-status.d.ts.map +1 -0
- package/dist/run-group-engine/src/index.d.ts +5 -0
- package/dist/run-group-engine/src/index.d.ts.map +1 -0
- package/dist/run-group-engine/src/plan-retry.d.ts +11 -0
- package/dist/run-group-engine/src/plan-retry.d.ts.map +1 -0
- package/dist/run-group-engine/src/rollup.d.ts +16 -0
- package/dist/run-group-engine/src/rollup.d.ts.map +1 -0
- package/dist/runner/index.js +4 -4
- package/dist/runner/src/resources.d.ts +8 -2
- package/dist/runner/src/resources.d.ts.map +1 -1
- package/dist/runner/src/serve.d.ts.map +1 -1
- package/dist/runner/src/session-builder.d.ts +10 -0
- package/dist/runner/src/session-builder.d.ts.map +1 -1
- package/dist/sdk/asset-manager.js +1 -1
- package/dist/sdk/index.js +4 -4
- package/dist/sdk/runner.js +4 -4
- package/dist/sdk/store.js +1 -1
- package/dist/{source-KPH66TXY.js → source-KUWAEJOO.js} +6 -6
- package/dist/{source-KPH66TXY.js.map → source-KUWAEJOO.js.map} +1 -1
- package/dist/{source-manifest-publish-HJ5G4CTH.js → source-manifest-publish-FTSKRYPI.js} +12 -10
- package/dist/source-manifest-publish-FTSKRYPI.js.map +1 -0
- package/dist/store/index.js +1 -1
- package/dist/store/src/store.d.ts.map +1 -1
- package/dist/tui/index.js +4 -4
- package/dist/types/src/index.d.ts +1 -0
- package/dist/types/src/index.d.ts.map +1 -1
- package/dist/types/src/run-group.d.ts +148 -0
- package/dist/types/src/run-group.d.ts.map +1 -0
- package/dist/workspace-plugin/adapters/mcp.js +1 -1
- package/dist/workspace-plugin/index.js +1 -1
- package/package.json +7 -1
- package/dist/chunk-4OVPB7SI.js.map +0 -1
- package/dist/chunk-M4UKIJ5K.js.map +0 -1
- package/dist/chunk-MY7TSVO7.js.map +0 -1
- package/dist/chunk-OJ7G56I7.js.map +0 -1
- package/dist/chunk-SNN6O7ON.js.map +0 -1
- package/dist/chunk-Y5B5272E.js.map +0 -1
- package/dist/library-publish-NQQFPOUY.js.map +0 -1
- package/dist/source-manifest-publish-HJ5G4CTH.js.map +0 -1
package/dist/cli/index.js
CHANGED
|
@@ -1,15 +1,16 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { AI_RESOURCES, aiResourceRoots } from '../chunk-VK24PIAB.js';
|
|
3
|
-
import {
|
|
4
|
-
import { makeSourceCommand, syncProjectSources } from '../chunk-
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
3
|
+
import { makeInstallCommand, makeCheckCommand, makeCleanCommand, reportInstalledSoftDeps } from '../chunk-34U5UC6G.js';
|
|
4
|
+
import { makeSourceCommand, syncProjectSources } from '../chunk-THJZ3JZE.js';
|
|
5
|
+
import { getStoreConfig, storeFetch, deviceLogin, loadStoreAuthConfig, logout, hasStoredAuth, isStoreAuthenticated, getStoreToken, getStoreIdentity } from '../chunk-MB6563TL.js';
|
|
6
|
+
import { openCatalogSource, openLibraryManager, createFullRegistry, openLibrary } from '../chunk-TITPPC54.js';
|
|
7
|
+
import { logErr, S, logOk, logInfo, kindColorPad, kindColor, colorRef, formatSoftDepSection, bareSoftDepName, logWarn, formatSoftDepHint, formatRelativeTime, formatSoftDepRemovePreview, formatSoftDepAddPreview, fitWidth } from '../chunk-O3D4KYFG.js';
|
|
7
8
|
import { LocalSecretsProvider } from '../chunk-6BEGKO2Q.js';
|
|
8
|
-
import { runFlow, resumeFlow } from '../chunk-
|
|
9
|
+
import { runFlow, resumeFlow } from '../chunk-S74G7AZL.js';
|
|
9
10
|
import '../chunk-4R6DROGN.js';
|
|
10
11
|
import { validateFlowVersions, parseSkillFrontmatter } from '../chunk-GXC3TYMQ.js';
|
|
11
|
-
import { runAgentChat, loadSessionById, loadSession, listSessions, setCurrentSession, deleteSession, clearSession, loadAgentManifest, compileComposition, MarkdownStreamer, resolveMixin } from '../chunk-
|
|
12
|
-
import { buildClaudePluginFiles } from '../chunk-
|
|
12
|
+
import { runAgentChat, loadSessionById, loadSession, listSessions, setCurrentSession, deleteSession, clearSession, loadAgentManifest, compileComposition, MarkdownStreamer, resolveMixin } from '../chunk-M3Y5KM6F.js';
|
|
13
|
+
import { buildClaudePluginFiles } from '../chunk-35OWUKOD.js';
|
|
13
14
|
import '../chunk-X5YPJV4N.js';
|
|
14
15
|
import '../chunk-O7SG5PC2.js';
|
|
15
16
|
import '../chunk-7QBNJTTQ.js';
|
|
@@ -24,14 +25,14 @@ import '../chunk-BMQKMOQY.js';
|
|
|
24
25
|
import '../chunk-GAH4YRCI.js';
|
|
25
26
|
import '../chunk-TNSCHS4I.js';
|
|
26
27
|
import '../chunk-LV2HPH3C.js';
|
|
27
|
-
import '../chunk-
|
|
28
|
-
import '../chunk-
|
|
28
|
+
import '../chunk-VBRXFLIP.js';
|
|
29
|
+
import '../chunk-Y6FV73IH.js';
|
|
29
30
|
import '../chunk-6E6PKKAD.js';
|
|
30
31
|
import { loadFlow, loadAllFlows } from '../chunk-4N5XR5DQ.js';
|
|
31
32
|
import '../chunk-DEYYRFQU.js';
|
|
32
33
|
import '../chunk-IFGTRL2I.js';
|
|
33
34
|
import '../chunk-PK7Q7MC7.js';
|
|
34
|
-
import { AssetManager, NON_DEPLOYABLE_KINDS, MissingManifestError, normalizeRepoUrl, FACTORY_SOURCE_URL } from '../chunk-
|
|
35
|
+
import { AssetManager, NON_DEPLOYABLE_KINDS, MissingManifestError, normalizeRepoUrl, FACTORY_SOURCE_URL } from '../chunk-Y3UCU4ZK.js';
|
|
35
36
|
import { resolveLibraryDir, getStoreManifestsDir, getDefaultValue, isSecretPlaceholder } from '../chunk-MWE7DEGC.js';
|
|
36
37
|
import '../chunk-MZV6WCF3.js';
|
|
37
38
|
import '../chunk-JXT46QFC.js';
|
|
@@ -39,7 +40,7 @@ import '../chunk-UKJMQZV6.js';
|
|
|
39
40
|
import '../chunk-R7FOF242.js';
|
|
40
41
|
import '../chunk-STQOPWPS.js';
|
|
41
42
|
import '../chunk-CGYEHQOX.js';
|
|
42
|
-
import {
|
|
43
|
+
import { resolveSettings, globalSettingsPath, projectSettingsPath, loadSettings, saveSettings, portableSpawn, portableSpawnSync, WorkspaceYamlEditor, checkAgentSkillConformance, readLock } from '../chunk-5NZ56R63.js';
|
|
43
44
|
import { assetSearchDirs, detectDomains } from '../chunk-ZAP2BDHG.js';
|
|
44
45
|
import { factoryAssetRoots } from '../chunk-7J7LQP6T.js';
|
|
45
46
|
import { globalCacheRoot, sourceCacheKey, getGlobalCacheDir, resolveAgentDir, matchPin, coerceVersion, loadSkWorkspaceConfig, resolveSkWorkspaceConfig, storeManifestSlug } from '../chunk-ISA7R7PK.js';
|
|
@@ -62,7 +63,7 @@ import path14__default, { resolve, join } from 'path';
|
|
|
62
63
|
import { fileURLToPath } from 'url';
|
|
63
64
|
import { Help, Command, Option } from 'commander';
|
|
64
65
|
import { rcompare } from 'semver';
|
|
65
|
-
import * as
|
|
66
|
+
import * as p5 from '@clack/prompts';
|
|
66
67
|
import pc5 from 'picocolors';
|
|
67
68
|
import * as os from 'os';
|
|
68
69
|
import { homedir } from 'os';
|
|
@@ -105,7 +106,7 @@ async function runSearch(kind, query, opts) {
|
|
|
105
106
|
}
|
|
106
107
|
}
|
|
107
108
|
async function searchIndex(query, kind) {
|
|
108
|
-
const { openLibrary: openLibrary2 } = await import('../open-library-
|
|
109
|
+
const { openLibrary: openLibrary2 } = await import('../open-library-ST2VFQTK.js');
|
|
109
110
|
const library = await openLibrary2();
|
|
110
111
|
try {
|
|
111
112
|
const defs = await library.listAssetDefs(kind ? { kind } : {});
|
|
@@ -138,7 +139,7 @@ async function searchIndex(query, kind) {
|
|
|
138
139
|
}
|
|
139
140
|
function searchFactory(projectDir, query, kind) {
|
|
140
141
|
const prefixes = factoryAssetRoots().map((r) => r.endsWith(path14__default.sep) ? r : r + path14__default.sep);
|
|
141
|
-
const isFactoryPath = (
|
|
142
|
+
const isFactoryPath = (p7) => prefixes.some((fp) => p7 === fp.slice(0, -1) || p7.startsWith(fp));
|
|
142
143
|
try {
|
|
143
144
|
return new AssetManager({ projectDir }).search(query, kind).filter((e) => isFactoryPath(e.source));
|
|
144
145
|
} catch {
|
|
@@ -157,7 +158,7 @@ async function searchLocal(query, kind, opts, showStore, airGapped) {
|
|
|
157
158
|
const factory = searchFactory(projectDir, query, kind);
|
|
158
159
|
let entries = unionEntries(await searchIndex(query, kind), factory);
|
|
159
160
|
if (entries.length === 0 && !query && !kind && !airGapped) {
|
|
160
|
-
const { autoSyncForSearch } = await import('../source-
|
|
161
|
+
const { autoSyncForSearch } = await import('../source-KUWAEJOO.js');
|
|
161
162
|
if (await autoSyncForSearch(projectDir)) {
|
|
162
163
|
entries = unionEntries(await searchIndex(query, kind), factory);
|
|
163
164
|
}
|
|
@@ -211,7 +212,7 @@ async function searchStore(query, kind, opts, airGapped) {
|
|
|
211
212
|
logInfo("air-gapped (cache_ttl: 0) \u2014 local sources only");
|
|
212
213
|
return;
|
|
213
214
|
}
|
|
214
|
-
const { openCatalogSource: openCatalogSource2, LocalCatalogDisabledError } = await import('../open-library-
|
|
215
|
+
const { openCatalogSource: openCatalogSource2, LocalCatalogDisabledError } = await import('../open-library-ST2VFQTK.js');
|
|
215
216
|
try {
|
|
216
217
|
const remote = await openCatalogSource2({ projectDir: path14__default.resolve(opts.projectDir) });
|
|
217
218
|
const assets = await remote.listAssets(kind ? { kind } : {});
|
|
@@ -332,18 +333,18 @@ function makeAddCommand() {
|
|
|
332
333
|
backends,
|
|
333
334
|
driverTarget: opts.target
|
|
334
335
|
});
|
|
335
|
-
const
|
|
336
|
-
|
|
336
|
+
const spinner4 = p5.spinner();
|
|
337
|
+
spinner4.start(`Adding ${ref}`);
|
|
337
338
|
try {
|
|
338
339
|
const added = await am2.add(ref, { link: opts.link });
|
|
339
|
-
|
|
340
|
+
spinner4.stop("Done");
|
|
340
341
|
await promptSoftDepAdds(am2, ref, {
|
|
341
342
|
isTTY: !!process.stdin.isTTY,
|
|
342
343
|
link: opts.link,
|
|
343
344
|
withSoftDeps: opts.withSoftDeps,
|
|
344
345
|
noSoftDeps: opts.softDeps === false,
|
|
345
|
-
confirm: (message) =>
|
|
346
|
-
isCancel:
|
|
346
|
+
confirm: (message) => p5.confirm({ message, initialValue: false }),
|
|
347
|
+
isCancel: p5.isCancel,
|
|
347
348
|
onAdded: logOk,
|
|
348
349
|
onError: logErr,
|
|
349
350
|
onHint: (line) => logInfo(S.dim(line))
|
|
@@ -357,7 +358,7 @@ function makeAddCommand() {
|
|
|
357
358
|
else logInfo("Nothing to deploy (already up to date).");
|
|
358
359
|
} else for (const a of added) logOk(a);
|
|
359
360
|
} catch (err) {
|
|
360
|
-
|
|
361
|
+
spinner4.stop("Failed");
|
|
361
362
|
logErr(String(err));
|
|
362
363
|
process.exit(1);
|
|
363
364
|
}
|
|
@@ -384,8 +385,8 @@ function makeRemoveCommand() {
|
|
|
384
385
|
await promptSoftDepRemovals(am2, ref, {
|
|
385
386
|
isTTY: !!process.stdin.isTTY,
|
|
386
387
|
noSoftDeps: opts.softDeps === false,
|
|
387
|
-
confirm: (message) =>
|
|
388
|
-
isCancel:
|
|
388
|
+
confirm: (message) => p5.confirm({ message, initialValue: false }),
|
|
389
|
+
isCancel: p5.isCancel,
|
|
389
390
|
onRemoved: logOk,
|
|
390
391
|
onHint: (line) => logInfo(S.dim(line))
|
|
391
392
|
});
|
|
@@ -1039,10 +1040,10 @@ function makeCacheCommand() {
|
|
|
1039
1040
|
return;
|
|
1040
1041
|
}
|
|
1041
1042
|
if (!opts.yes) {
|
|
1042
|
-
const ok = await
|
|
1043
|
+
const ok = await p5.confirm({
|
|
1043
1044
|
message: opts.global ? "Clear project AND global cache?" : "Clear project cache?"
|
|
1044
1045
|
});
|
|
1045
|
-
if (
|
|
1046
|
+
if (p5.isCancel(ok) || !ok) {
|
|
1046
1047
|
logInfo("Cancelled.");
|
|
1047
1048
|
return;
|
|
1048
1049
|
}
|
|
@@ -1100,7 +1101,7 @@ function makeCatalogCommand() {
|
|
|
1100
1101
|
return catalog;
|
|
1101
1102
|
}
|
|
1102
1103
|
async function runLocalCatalogTest(projectDir) {
|
|
1103
|
-
const { resolveCatalogSource } = await import('../open-library-
|
|
1104
|
+
const { resolveCatalogSource } = await import('../open-library-ST2VFQTK.js');
|
|
1104
1105
|
let resolved;
|
|
1105
1106
|
try {
|
|
1106
1107
|
resolved = await resolveCatalogSource({ projectDir });
|
|
@@ -1351,13 +1352,13 @@ function collectWorkspaceDefaults(projectDir) {
|
|
|
1351
1352
|
const wsDefaults = {};
|
|
1352
1353
|
try {
|
|
1353
1354
|
const ws = resolveSkWorkspaceConfig(projectDir);
|
|
1354
|
-
const
|
|
1355
|
-
if (
|
|
1356
|
-
if (
|
|
1357
|
-
if (
|
|
1358
|
-
if (
|
|
1359
|
-
if (
|
|
1360
|
-
if (
|
|
1355
|
+
const p7 = ws.agent_config?.default ?? {};
|
|
1356
|
+
if (p7.driver) wsDefaults.driver = p7.driver;
|
|
1357
|
+
if (p7.provider) wsDefaults.provider = p7.provider;
|
|
1358
|
+
if (p7.model) wsDefaults.model = p7.model;
|
|
1359
|
+
if (p7.skills_dir) wsDefaults.skills_dir = p7.skills_dir;
|
|
1360
|
+
if (p7.agents_dir) wsDefaults.agents_dir = p7.agents_dir;
|
|
1361
|
+
if (p7.prompts_dir) wsDefaults.prompts_dir = p7.prompts_dir;
|
|
1361
1362
|
} catch {
|
|
1362
1363
|
}
|
|
1363
1364
|
return wsDefaults;
|
|
@@ -2299,10 +2300,10 @@ var MCP_SERVER_ENTRY = {
|
|
|
2299
2300
|
function pluginDir(projectDir) {
|
|
2300
2301
|
return path14__default.join(projectDir, ".claude", "plugins", "skaile");
|
|
2301
2302
|
}
|
|
2302
|
-
async function readJsonStrict(
|
|
2303
|
+
async function readJsonStrict(p7) {
|
|
2303
2304
|
let raw;
|
|
2304
2305
|
try {
|
|
2305
|
-
raw = await fs6.readFile(
|
|
2306
|
+
raw = await fs6.readFile(p7, "utf-8");
|
|
2306
2307
|
} catch {
|
|
2307
2308
|
return null;
|
|
2308
2309
|
}
|
|
@@ -2310,13 +2311,13 @@ async function readJsonStrict(p8) {
|
|
|
2310
2311
|
return JSON.parse(raw);
|
|
2311
2312
|
} catch (e) {
|
|
2312
2313
|
throw new Error(
|
|
2313
|
-
`cannot parse ${
|
|
2314
|
+
`cannot parse ${p7}: ${e instanceof Error ? e.message : String(e)}; please fix or remove`
|
|
2314
2315
|
);
|
|
2315
2316
|
}
|
|
2316
2317
|
}
|
|
2317
|
-
async function writeJson(
|
|
2318
|
-
await fs6.mkdir(path14__default.dirname(
|
|
2319
|
-
await fs6.writeFile(
|
|
2318
|
+
async function writeJson(p7, value) {
|
|
2319
|
+
await fs6.mkdir(path14__default.dirname(p7), { recursive: true });
|
|
2320
|
+
await fs6.writeFile(p7, `${JSON.stringify(value, null, 2)}
|
|
2320
2321
|
`);
|
|
2321
2322
|
}
|
|
2322
2323
|
async function copyDir(src, dest) {
|
|
@@ -2371,7 +2372,7 @@ async function uninstall(projectDir) {
|
|
|
2371
2372
|
let changed = false;
|
|
2372
2373
|
const settings = await readJsonStrict(settingsPath);
|
|
2373
2374
|
if (settings && Array.isArray(settings.plugins)) {
|
|
2374
|
-
const next = settings.plugins.filter((
|
|
2375
|
+
const next = settings.plugins.filter((p7) => p7 !== dir);
|
|
2375
2376
|
if (next.length !== settings.plugins.length) {
|
|
2376
2377
|
changed = true;
|
|
2377
2378
|
const updated = { ...settings, plugins: next };
|
|
@@ -2418,7 +2419,7 @@ async function enable(projectDir) {
|
|
|
2418
2419
|
const settings = await readJsonStrict(settingsPath) ?? {};
|
|
2419
2420
|
if (detected.method === "plugin") {
|
|
2420
2421
|
const disabled2 = settings.disabledPlugins ?? [];
|
|
2421
|
-
const next2 = disabled2.filter((
|
|
2422
|
+
const next2 = disabled2.filter((p7) => p7 !== detected.pluginPath);
|
|
2422
2423
|
if (next2.length === disabled2.length) return { changed: false };
|
|
2423
2424
|
const updated2 = { ...settings, disabledPlugins: next2 };
|
|
2424
2425
|
if (next2.length === 0) delete updated2.disabledPlugins;
|
|
@@ -2499,10 +2500,10 @@ function buildEntry(projectDir) {
|
|
|
2499
2500
|
env: { SKAILE_PROJECT_DIR: projectDir }
|
|
2500
2501
|
};
|
|
2501
2502
|
}
|
|
2502
|
-
async function readConfig(
|
|
2503
|
+
async function readConfig(p7) {
|
|
2503
2504
|
let raw;
|
|
2504
2505
|
try {
|
|
2505
|
-
raw = await fs6.readFile(
|
|
2506
|
+
raw = await fs6.readFile(p7, "utf-8");
|
|
2506
2507
|
} catch {
|
|
2507
2508
|
return null;
|
|
2508
2509
|
}
|
|
@@ -2510,41 +2511,41 @@ async function readConfig(p8) {
|
|
|
2510
2511
|
return parse$1(raw);
|
|
2511
2512
|
} catch (e) {
|
|
2512
2513
|
throw new Error(
|
|
2513
|
-
`cannot parse ${
|
|
2514
|
+
`cannot parse ${p7}: ${e instanceof Error ? e.message : String(e)}; please fix or remove`
|
|
2514
2515
|
);
|
|
2515
2516
|
}
|
|
2516
2517
|
}
|
|
2517
|
-
async function writeConfig(
|
|
2518
|
-
await fs6.mkdir(path14__default.dirname(
|
|
2518
|
+
async function writeConfig(p7, value) {
|
|
2519
|
+
await fs6.mkdir(path14__default.dirname(p7), { recursive: true });
|
|
2519
2520
|
const cleaned = {};
|
|
2520
2521
|
for (const [k, v] of Object.entries(value)) {
|
|
2521
2522
|
if (v === void 0) continue;
|
|
2522
2523
|
cleaned[k] = v;
|
|
2523
2524
|
}
|
|
2524
|
-
await fs6.writeFile(
|
|
2525
|
+
await fs6.writeFile(p7, stringify$1(cleaned));
|
|
2525
2526
|
}
|
|
2526
2527
|
function configPath(projectDir) {
|
|
2527
2528
|
return path14__default.join(projectDir, ".codex", "config.toml");
|
|
2528
2529
|
}
|
|
2529
2530
|
async function install2(projectDir) {
|
|
2530
|
-
const
|
|
2531
|
-
const cfg = await readConfig(
|
|
2531
|
+
const p7 = configPath(projectDir);
|
|
2532
|
+
const cfg = await readConfig(p7) ?? {};
|
|
2532
2533
|
const next = buildEntry(projectDir);
|
|
2533
2534
|
const servers = { ...cfg.mcp_servers ?? {} };
|
|
2534
2535
|
const previous = servers[SKAILE_MCP_NAME2];
|
|
2535
2536
|
const matches = previous && JSON.stringify(previous) === JSON.stringify(next);
|
|
2536
2537
|
let warning;
|
|
2537
2538
|
if (previous && !matches) {
|
|
2538
|
-
warning = `overwrote existing ${SKAILE_MCP_NAME2} entry in ${path14__default.relative(projectDir,
|
|
2539
|
+
warning = `overwrote existing ${SKAILE_MCP_NAME2} entry in ${path14__default.relative(projectDir, p7)}`;
|
|
2539
2540
|
}
|
|
2540
2541
|
if (matches) return { changed: false, method: "toml" };
|
|
2541
2542
|
servers[SKAILE_MCP_NAME2] = next;
|
|
2542
|
-
await writeConfig(
|
|
2543
|
+
await writeConfig(p7, { ...cfg, mcp_servers: servers });
|
|
2543
2544
|
return { changed: true, method: "toml", warning };
|
|
2544
2545
|
}
|
|
2545
2546
|
async function uninstall2(projectDir) {
|
|
2546
|
-
const
|
|
2547
|
-
const cfg = await readConfig(
|
|
2547
|
+
const p7 = configPath(projectDir);
|
|
2548
|
+
const cfg = await readConfig(p7);
|
|
2548
2549
|
if (!cfg?.mcp_servers || !(SKAILE_MCP_NAME2 in cfg.mcp_servers)) {
|
|
2549
2550
|
return { changed: false };
|
|
2550
2551
|
}
|
|
@@ -2552,15 +2553,15 @@ async function uninstall2(projectDir) {
|
|
|
2552
2553
|
const updated = { ...cfg, mcp_servers: rest };
|
|
2553
2554
|
if (Object.keys(rest).length === 0) delete updated.mcp_servers;
|
|
2554
2555
|
if (Object.keys(updated).length === 0) {
|
|
2555
|
-
await fs6.unlink(
|
|
2556
|
+
await fs6.unlink(p7);
|
|
2556
2557
|
} else {
|
|
2557
|
-
await writeConfig(
|
|
2558
|
+
await writeConfig(p7, updated);
|
|
2558
2559
|
}
|
|
2559
2560
|
return { changed: true };
|
|
2560
2561
|
}
|
|
2561
2562
|
async function status2(projectDir) {
|
|
2562
|
-
const
|
|
2563
|
-
const cfg = await readConfig(
|
|
2563
|
+
const p7 = configPath(projectDir);
|
|
2564
|
+
const cfg = await readConfig(p7);
|
|
2564
2565
|
const installed = !!(cfg?.mcp_servers && SKAILE_MCP_NAME2 in cfg.mcp_servers);
|
|
2565
2566
|
if (!installed) {
|
|
2566
2567
|
return {
|
|
@@ -2576,7 +2577,7 @@ async function status2(projectDir) {
|
|
|
2576
2577
|
installed: "yes",
|
|
2577
2578
|
enabled: "n/a",
|
|
2578
2579
|
method: "mcp",
|
|
2579
|
-
location: path14__default.relative(projectDir,
|
|
2580
|
+
location: path14__default.relative(projectDir, p7)
|
|
2580
2581
|
};
|
|
2581
2582
|
}
|
|
2582
2583
|
async function install3(projectDir) {
|
|
@@ -2793,7 +2794,7 @@ function printStatusTable(rows) {
|
|
|
2793
2794
|
const widths = cols.map(
|
|
2794
2795
|
(c) => Math.max(c.header.length, ...rows.map((r) => String(r[c.key] ?? "").length))
|
|
2795
2796
|
);
|
|
2796
|
-
const fmtRow = (parts) => parts.map((
|
|
2797
|
+
const fmtRow = (parts) => parts.map((p7, i) => p7.padEnd(widths[i] ?? p7.length)).join(" ");
|
|
2797
2798
|
console.log();
|
|
2798
2799
|
console.log(` ${S.heading(fmtRow(cols.map((c) => c.header)))}`);
|
|
2799
2800
|
for (const r of rows) {
|
|
@@ -2921,12 +2922,14 @@ function domainPublisher(libraryPath, domain) {
|
|
|
2921
2922
|
return void 0;
|
|
2922
2923
|
}
|
|
2923
2924
|
}
|
|
2924
|
-
function resolveLibraryPublisher(lib, opts, domain) {
|
|
2925
|
+
function resolveLibraryPublisher(lib, opts, domain, storeIdentity) {
|
|
2925
2926
|
if (opts.publisher?.trim()) return opts.publisher.trim();
|
|
2926
2927
|
if (domain) {
|
|
2927
2928
|
const fromDomain = domainPublisher(lib.path, domain);
|
|
2928
2929
|
if (fromDomain) return fromDomain;
|
|
2929
2930
|
}
|
|
2931
|
+
const identity = (storeIdentity?.githubLogin ?? storeIdentity?.username)?.trim();
|
|
2932
|
+
if (identity) return identity;
|
|
2930
2933
|
try {
|
|
2931
2934
|
return slugifyAssetName(lib.name);
|
|
2932
2935
|
} catch {
|
|
@@ -3072,7 +3075,7 @@ function makeLibraryCommand() {
|
|
|
3072
3075
|
}
|
|
3073
3076
|
logOk(`Created ${effectiveKind}: ${pc5.dim(res.path)}`);
|
|
3074
3077
|
const domain2 = opts.dir ? opts.dir.split(path14.sep)[0] : void 0;
|
|
3075
|
-
const publisher = resolveLibraryPublisher(target, opts, domain2);
|
|
3078
|
+
const publisher = resolveLibraryPublisher(target, opts, domain2, getStoreIdentity());
|
|
3076
3079
|
stampAssetPublisher(res.path, publisher);
|
|
3077
3080
|
ensureManifestPublisher(target.path, publisher);
|
|
3078
3081
|
upsertManifestAsset(target.path, {
|
|
@@ -3216,11 +3219,11 @@ function makeLibraryCommand() {
|
|
|
3216
3219
|
const { manager, close } = await openLibraryManager();
|
|
3217
3220
|
try {
|
|
3218
3221
|
if (!opts.yes) {
|
|
3219
|
-
const confirmed = await
|
|
3222
|
+
const confirmed = await p5.confirm({
|
|
3220
3223
|
message: `Remove library "${name}"${opts.purge ? " AND delete its directory" : ""}?`,
|
|
3221
3224
|
initialValue: false
|
|
3222
3225
|
});
|
|
3223
|
-
if (!confirmed ||
|
|
3226
|
+
if (!confirmed || p5.isCancel(confirmed)) {
|
|
3224
3227
|
logInfo("Cancelled.");
|
|
3225
3228
|
return;
|
|
3226
3229
|
}
|
|
@@ -3337,16 +3340,16 @@ function makeLibraryCommand() {
|
|
|
3337
3340
|
});
|
|
3338
3341
|
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(
|
|
3339
3342
|
async (lib, opts) => {
|
|
3340
|
-
const { runLibraryPublish } = await import('../library-publish-
|
|
3343
|
+
const { runLibraryPublish } = await import('../library-publish-TPWFSO3Q.js');
|
|
3341
3344
|
await withStoreErrorHandling(() => runLibraryPublish(lib, opts));
|
|
3342
3345
|
}
|
|
3343
3346
|
);
|
|
3344
3347
|
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) => {
|
|
3345
|
-
const { runLibraryRegister } = await import('../library-publish-
|
|
3348
|
+
const { runLibraryRegister } = await import('../library-publish-TPWFSO3Q.js');
|
|
3346
3349
|
await withStoreErrorHandling(() => runLibraryRegister(lib, opts));
|
|
3347
3350
|
});
|
|
3348
3351
|
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) => {
|
|
3349
|
-
const { runLibraryYank } = await import('../library-publish-
|
|
3352
|
+
const { runLibraryYank } = await import('../library-publish-TPWFSO3Q.js');
|
|
3350
3353
|
await withStoreErrorHandling(() => runLibraryYank(lib, opts));
|
|
3351
3354
|
});
|
|
3352
3355
|
return cmd;
|
|
@@ -3987,7 +3990,7 @@ async function previewSoftDepsUnderCursor() {
|
|
|
3987
3990
|
}
|
|
3988
3991
|
async function loadAssets() {
|
|
3989
3992
|
softDepPreviewCache.clear();
|
|
3990
|
-
const { gatherAssetFeeds } = await import('../asset-feeds-
|
|
3993
|
+
const { gatherAssetFeeds } = await import('../asset-feeds-Y66NCOQZ.js');
|
|
3991
3994
|
const { entries, domains, notes } = await gatherAssetFeeds(am, am.projectDir);
|
|
3992
3995
|
if (notes.length > 0) {
|
|
3993
3996
|
state.message = notes.map((n) => `[${n.feed}] ${n.message}`).join(" \u2022 ");
|
|
@@ -4193,7 +4196,7 @@ function reconcileCollapsedSets(rows) {
|
|
|
4193
4196
|
async function loadSourcesAndLibraries() {
|
|
4194
4197
|
try {
|
|
4195
4198
|
const [{ openLibraryManager: openLibraryManager2 }, { skaileHomeDir }, { getGlobalCacheDir: getGlobalCacheDir2 }] = await Promise.all([
|
|
4196
|
-
import('../open-library-
|
|
4199
|
+
import('../open-library-ST2VFQTK.js'),
|
|
4197
4200
|
import('../library/index.js'),
|
|
4198
4201
|
import('../core/index.js')
|
|
4199
4202
|
]);
|
|
@@ -5162,6 +5165,10 @@ async function handleExitConfirm(key) {
|
|
|
5162
5165
|
return "skip-render";
|
|
5163
5166
|
}
|
|
5164
5167
|
async function run(projectDir) {
|
|
5168
|
+
if (!process.stdin.isTTY || typeof process.stdin.setRawMode !== "function") {
|
|
5169
|
+
console.error("skaile manage requires an interactive terminal (TTY). Run it directly in your shell.");
|
|
5170
|
+
process.exit(1);
|
|
5171
|
+
}
|
|
5165
5172
|
am = new AssetManager({ projectDir });
|
|
5166
5173
|
await loadAssets();
|
|
5167
5174
|
await loadSourcesAndLibraries();
|
|
@@ -5238,18 +5245,18 @@ function makeNpxCommand() {
|
|
|
5238
5245
|
);
|
|
5239
5246
|
process.exit(1);
|
|
5240
5247
|
}
|
|
5241
|
-
const
|
|
5248
|
+
const spinner4 = p5.spinner();
|
|
5242
5249
|
const key = sourceCacheKey(url);
|
|
5243
5250
|
const clonePath = path14__default.join(getGlobalCacheDir(), key);
|
|
5244
|
-
|
|
5251
|
+
spinner4.start(`Cloning ${url}`);
|
|
5245
5252
|
try {
|
|
5246
5253
|
if (!existsSync(clonePath)) {
|
|
5247
5254
|
mkdirSync(path14__default.dirname(clonePath), { recursive: true });
|
|
5248
5255
|
execSync(`git clone ${url} ${clonePath}`, { stdio: "ignore" });
|
|
5249
5256
|
}
|
|
5250
|
-
|
|
5257
|
+
spinner4.stop(`Cloned to ${key}`);
|
|
5251
5258
|
} catch (err) {
|
|
5252
|
-
|
|
5259
|
+
spinner4.stop("Clone failed");
|
|
5253
5260
|
logErr(err instanceof Error ? err.message : String(err));
|
|
5254
5261
|
process.exit(1);
|
|
5255
5262
|
}
|
|
@@ -5269,10 +5276,10 @@ function makeNpxCommand() {
|
|
|
5269
5276
|
}
|
|
5270
5277
|
const skillRef = `skill:@${publisher}/${skillName}`;
|
|
5271
5278
|
const am2 = new AssetManager({ projectDir, global: opts.global, driverTarget: opts.target });
|
|
5272
|
-
|
|
5279
|
+
spinner4.start(`Installing ${skillRef}`);
|
|
5273
5280
|
try {
|
|
5274
5281
|
const added = await am2.add(skillRef);
|
|
5275
|
-
|
|
5282
|
+
spinner4.stop("Done");
|
|
5276
5283
|
if (added.length === 0) {
|
|
5277
5284
|
logInfo(`${opts.skill} already deployed or not found in source.`);
|
|
5278
5285
|
} else {
|
|
@@ -5280,7 +5287,7 @@ function makeNpxCommand() {
|
|
|
5280
5287
|
}
|
|
5281
5288
|
logInfo(`Source registered in skaile.yaml \u2014 manage via ${S.cmd("skaile source")}.`);
|
|
5282
5289
|
} catch (err) {
|
|
5283
|
-
|
|
5290
|
+
spinner4.stop("Failed");
|
|
5284
5291
|
logErr(err.message);
|
|
5285
5292
|
process.exit(1);
|
|
5286
5293
|
}
|
|
@@ -5583,277 +5590,6 @@ function substituteString(value, resolve5, envVarsToSet) {
|
|
|
5583
5590
|
return "envRef" in resolved ? resolved.envRef : resolved.value;
|
|
5584
5591
|
});
|
|
5585
5592
|
}
|
|
5586
|
-
var REF_HINT = "kind:@<publisher>/<name>#<version> (e.g. skill:@skaile/use-exa#1.0.0)";
|
|
5587
|
-
function isValidAssetRef(ref) {
|
|
5588
|
-
try {
|
|
5589
|
-
parseAssetRef(ref);
|
|
5590
|
-
return true;
|
|
5591
|
-
} catch {
|
|
5592
|
-
return false;
|
|
5593
|
-
}
|
|
5594
|
-
}
|
|
5595
|
-
function supportsInstallManifest(source) {
|
|
5596
|
-
return typeof source?.getInstallManifest === "function";
|
|
5597
|
-
}
|
|
5598
|
-
async function runPointerOnlyInstall(ref, deps) {
|
|
5599
|
-
let requested;
|
|
5600
|
-
try {
|
|
5601
|
-
requested = parseAssetRef(ref);
|
|
5602
|
-
} catch (e) {
|
|
5603
|
-
throw new Error(
|
|
5604
|
-
`malformed asset ref '${ref}' \u2014 expected ${REF_HINT}: ${e instanceof Error ? e.message : String(e)}`
|
|
5605
|
-
);
|
|
5606
|
-
}
|
|
5607
|
-
const manifest = await deps.catalog.getInstallManifest(ref);
|
|
5608
|
-
const got = parseAssetRef(manifest.ref);
|
|
5609
|
-
if (got.kind !== requested.kind || got.publisher !== requested.publisher || got.name !== requested.name || got.pin !== requested.pin) {
|
|
5610
|
-
throw new Error(
|
|
5611
|
-
`catalog identity mismatch: requested '${ref}' but the catalog returned a manifest for '${manifest.ref}'`
|
|
5612
|
-
);
|
|
5613
|
-
}
|
|
5614
|
-
const { installPath } = await deps.library.install(manifest);
|
|
5615
|
-
return {
|
|
5616
|
-
installPath,
|
|
5617
|
-
commitSha: manifest.source.commitSha,
|
|
5618
|
-
fileCount: manifest.files.length
|
|
5619
|
-
};
|
|
5620
|
-
}
|
|
5621
|
-
function makeInstallCommand() {
|
|
5622
|
-
return new Command("install").description(`Install dependencies from skaile.yaml, or a single asset by ref (${REF_HINT})`).argument("[ref]", `Asset ref to install from the Catalog (${REF_HINT})`).option("--locked", "Install from lock file (CI mode \u2014 fails on drift)").option("--project-dir <path>", "Project directory", process.cwd()).option("--target <agent>", "Agent framework", "claude-code").option(
|
|
5623
|
-
"--global",
|
|
5624
|
-
"Install the global SSOT (~/.skaile/skaile.yaml), fanning out to every global backend"
|
|
5625
|
-
).option(
|
|
5626
|
-
"--backend <ids>",
|
|
5627
|
-
"Comma-separated global backends to install into (default: all resolved); implies --global"
|
|
5628
|
-
).option(
|
|
5629
|
-
"--link",
|
|
5630
|
-
"symlink local-path assets instead of copying (dev loop; machine-local, not for committing)"
|
|
5631
|
-
).action(runInstallCommand);
|
|
5632
|
-
}
|
|
5633
|
-
function parseBackendFilter2(raw) {
|
|
5634
|
-
if (!raw) return void 0;
|
|
5635
|
-
const ids = raw.split(",").map((s) => s.trim()).filter(Boolean);
|
|
5636
|
-
const out = [];
|
|
5637
|
-
for (const id of ids) {
|
|
5638
|
-
if (!SUPPORTED_DRIVER_TARGETS.includes(id)) {
|
|
5639
|
-
logErr(`unknown backend '${id}' \u2014 expected one of: ${SUPPORTED_DRIVER_TARGETS.join(", ")}`);
|
|
5640
|
-
process.exit(1);
|
|
5641
|
-
}
|
|
5642
|
-
out.push(id);
|
|
5643
|
-
}
|
|
5644
|
-
return out.length > 0 ? out : void 0;
|
|
5645
|
-
}
|
|
5646
|
-
async function runInstallCommand(ref, opts) {
|
|
5647
|
-
if (ref !== void 0) {
|
|
5648
|
-
await runRefInstall(ref, opts);
|
|
5649
|
-
return;
|
|
5650
|
-
}
|
|
5651
|
-
await runYamlInstall(opts);
|
|
5652
|
-
}
|
|
5653
|
-
async function runRefInstall(ref, opts) {
|
|
5654
|
-
if (!isValidAssetRef(ref)) {
|
|
5655
|
-
logErr(`malformed asset ref '${ref}' \u2014 expected ${REF_HINT}`);
|
|
5656
|
-
process.exit(1);
|
|
5657
|
-
}
|
|
5658
|
-
const spinner5 = p6.spinner();
|
|
5659
|
-
spinner5.start(`Installing ${ref}`);
|
|
5660
|
-
try {
|
|
5661
|
-
const { openCatalogSource: openCatalogSource2, openLibrary: openLibrary2 } = await import('../open-library-ODW2PJ2J.js');
|
|
5662
|
-
const catalog = await openCatalogSource2({ projectDir: path14__default.resolve(opts.projectDir) });
|
|
5663
|
-
if (!supportsInstallManifest(catalog)) {
|
|
5664
|
-
throw new Error(
|
|
5665
|
-
"pointer-only install (skaile install <ref>) requires a tRPC-framed Catalog. The configured catalog uses REST framing, which does not serve install manifests. Set catalog.url to https://skaile.store, or catalog.framing: trpc, in ~/.skaile/config.yaml."
|
|
5666
|
-
);
|
|
5667
|
-
}
|
|
5668
|
-
const library = await openLibrary2();
|
|
5669
|
-
try {
|
|
5670
|
-
const result = await runPointerOnlyInstall(ref, { catalog, library });
|
|
5671
|
-
spinner5.stop("Done");
|
|
5672
|
-
logOk(`Installed ${colorRef(ref)}`);
|
|
5673
|
-
logInfo(`Path: ${S.dim(result.installPath)}`);
|
|
5674
|
-
logInfo(`Commit: ${S.dim(result.commitSha)}`);
|
|
5675
|
-
logInfo(`Files: ${S.dim(String(result.fileCount))}`);
|
|
5676
|
-
logInfo(
|
|
5677
|
-
S.dim(`Installed globally (see Path above) \u2014 use \`skaile add ${ref}\` to deploy into this project.`)
|
|
5678
|
-
);
|
|
5679
|
-
} finally {
|
|
5680
|
-
library.close();
|
|
5681
|
-
}
|
|
5682
|
-
} catch (err) {
|
|
5683
|
-
spinner5.stop("Failed");
|
|
5684
|
-
const msg = err instanceof Error ? err.message : String(err);
|
|
5685
|
-
if (/unreachable/i.test(msg)) {
|
|
5686
|
-
logErr(`asset uninstallable \u2014 source commit no longer available (${msg})`);
|
|
5687
|
-
} else {
|
|
5688
|
-
logErr(msg);
|
|
5689
|
-
}
|
|
5690
|
-
process.exit(1);
|
|
5691
|
-
}
|
|
5692
|
-
}
|
|
5693
|
-
async function runYamlInstall(opts) {
|
|
5694
|
-
const projectDir = path14__default.resolve(opts.projectDir);
|
|
5695
|
-
const backends = parseBackendFilter2(opts.backend);
|
|
5696
|
-
if (opts.global || backends) {
|
|
5697
|
-
await runGlobalInstall(opts, backends);
|
|
5698
|
-
return;
|
|
5699
|
-
}
|
|
5700
|
-
try {
|
|
5701
|
-
const { ensureSourcesCloned } = await import('../ensure-sources-ORACQA4I.js');
|
|
5702
|
-
const hydrate = ensureSourcesCloned(projectDir, { quiet: true });
|
|
5703
|
-
if (hydrate.cloned.length > 0) {
|
|
5704
|
-
logOk(`Cloned source(s): ${hydrate.cloned.join(", ")}`);
|
|
5705
|
-
}
|
|
5706
|
-
if (hydrate.failed.length > 0) {
|
|
5707
|
-
logErr(`Failed to clone source(s): ${hydrate.failed.join(", ")}`);
|
|
5708
|
-
}
|
|
5709
|
-
} catch (err) {
|
|
5710
|
-
logWarn(`source hydration skipped: ${err instanceof Error ? err.message : String(err)}`);
|
|
5711
|
-
}
|
|
5712
|
-
const am2 = new AssetManager({
|
|
5713
|
-
projectDir,
|
|
5714
|
-
driverTarget: opts.target
|
|
5715
|
-
});
|
|
5716
|
-
const spinner5 = p6.spinner();
|
|
5717
|
-
spinner5.start(opts.locked ? "Installing from lock file" : "Installing dependencies");
|
|
5718
|
-
try {
|
|
5719
|
-
const result = await am2.install({ locked: opts.locked, link: opts.link });
|
|
5720
|
-
spinner5.stop("Done");
|
|
5721
|
-
if (result.deployed.length > 0) {
|
|
5722
|
-
for (const d of result.deployed) logOk(d);
|
|
5723
|
-
}
|
|
5724
|
-
if (result.removed.length > 0) {
|
|
5725
|
-
for (const r of result.removed) logWarn(`Removed: ${r}`);
|
|
5726
|
-
}
|
|
5727
|
-
if (result.deployed.length === 0 && result.removed.length === 0) {
|
|
5728
|
-
logInfo("Nothing to install (already up to date).");
|
|
5729
|
-
}
|
|
5730
|
-
if (result.missing.length > 0) {
|
|
5731
|
-
for (const m of result.missing) logErr(`Missing: ${m}`);
|
|
5732
|
-
process.exitCode = 1;
|
|
5733
|
-
}
|
|
5734
|
-
if (result.lockWritten) {
|
|
5735
|
-
logInfo(`Lock file written: ${S.dim("skaile.lock.yaml")}`);
|
|
5736
|
-
}
|
|
5737
|
-
if (!opts.locked) await reportInstalledSoftDeps(am2);
|
|
5738
|
-
} catch (err) {
|
|
5739
|
-
spinner5.stop("Failed");
|
|
5740
|
-
logErr(String(err));
|
|
5741
|
-
process.exit(1);
|
|
5742
|
-
}
|
|
5743
|
-
}
|
|
5744
|
-
async function reportInstalledSoftDeps(am2, onHint = (l) => logInfo(S.dim(l))) {
|
|
5745
|
-
try {
|
|
5746
|
-
const declared = am2.listDeclared().map((d) => d.ref);
|
|
5747
|
-
if (declared.length === 0) return;
|
|
5748
|
-
const edges = await am2.reportSoftDeps(declared);
|
|
5749
|
-
for (const edge of edges) onHint(formatSoftDepHint(edge));
|
|
5750
|
-
} catch {
|
|
5751
|
-
}
|
|
5752
|
-
}
|
|
5753
|
-
async function runGlobalInstall(opts, backends) {
|
|
5754
|
-
const am2 = new AssetManager({
|
|
5755
|
-
projectDir: path14__default.resolve(opts.projectDir),
|
|
5756
|
-
global: true,
|
|
5757
|
-
backends
|
|
5758
|
-
});
|
|
5759
|
-
const spinner5 = p6.spinner();
|
|
5760
|
-
spinner5.start("Installing global dependencies");
|
|
5761
|
-
try {
|
|
5762
|
-
const result = await am2.install({ locked: opts.locked, link: opts.link });
|
|
5763
|
-
spinner5.stop("Done");
|
|
5764
|
-
if (result.deployed.length > 0) for (const d of result.deployed) logOk(d);
|
|
5765
|
-
if (result.removed.length > 0) for (const r of result.removed) logWarn(`Removed: ${r}`);
|
|
5766
|
-
if (result.deployed.length === 0 && result.removed.length === 0)
|
|
5767
|
-
logInfo("Nothing to install (already up to date).");
|
|
5768
|
-
if (result.missing.length > 0) {
|
|
5769
|
-
for (const m of result.missing) logErr(`Missing: ${m}`);
|
|
5770
|
-
process.exitCode = 1;
|
|
5771
|
-
}
|
|
5772
|
-
if (result.lockWritten) logInfo(`Global lock written: ${S.dim("~/.skaile/skaile.lock.yaml")}`);
|
|
5773
|
-
const state2 = am2.globalState({});
|
|
5774
|
-
const byBackend = /* @__PURE__ */ new Map();
|
|
5775
|
-
for (const s of state2)
|
|
5776
|
-
if (s.state === "installed") byBackend.set(s.backend, (byBackend.get(s.backend) ?? 0) + 1);
|
|
5777
|
-
for (const [backend, n] of byBackend) logInfo(`${backend}: ${n} installed`);
|
|
5778
|
-
} catch (err) {
|
|
5779
|
-
spinner5.stop("Failed");
|
|
5780
|
-
logErr(String(err));
|
|
5781
|
-
process.exit(1);
|
|
5782
|
-
}
|
|
5783
|
-
}
|
|
5784
|
-
function makeCheckCommand() {
|
|
5785
|
-
return new Command("check").description("Check for unmet requirements").option("--project-dir <path>", "Project directory", process.cwd()).action((opts) => {
|
|
5786
|
-
const am2 = new AssetManager({ projectDir: path14__default.resolve(opts.projectDir) });
|
|
5787
|
-
const issues = am2.doctor();
|
|
5788
|
-
if (issues.length === 0) {
|
|
5789
|
-
logOk("All dependencies satisfied.");
|
|
5790
|
-
} else {
|
|
5791
|
-
for (const i of issues) {
|
|
5792
|
-
logErr(
|
|
5793
|
-
`${i.assetKind}:${i.assetName} requires ${i.depKind}:${i.depName} (${i.inRepos ? "fixable" : "not found"})`
|
|
5794
|
-
);
|
|
5795
|
-
}
|
|
5796
|
-
process.exit(1);
|
|
5797
|
-
}
|
|
5798
|
-
});
|
|
5799
|
-
}
|
|
5800
|
-
function makeCleanCommand() {
|
|
5801
|
-
return new Command("clean").description("Remove all skaile-managed assets from the workspace").option("--all", "Full reset: also remove history, patches, repos, and lock file").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()).option("--target <agent>", "Agent framework", "claude-code").action(async (opts) => {
|
|
5802
|
-
const am2 = new AssetManager({
|
|
5803
|
-
projectDir: path14__default.resolve(opts.projectDir),
|
|
5804
|
-
driverTarget: opts.target
|
|
5805
|
-
});
|
|
5806
|
-
const lock = readLock(path14__default.resolve(opts.projectDir, "skaile.lock.yaml"));
|
|
5807
|
-
if (!lock || Object.keys(lock.assets).length === 0) {
|
|
5808
|
-
logInfo("Nothing to clean (no skaile-managed assets found).");
|
|
5809
|
-
return;
|
|
5810
|
-
}
|
|
5811
|
-
const assetRefs = Object.keys(lock.assets);
|
|
5812
|
-
console.log();
|
|
5813
|
-
console.log(` ${S.heading("Assets to remove:")} ${S.dim(`(${assetRefs.length})`)}`);
|
|
5814
|
-
for (const ref of assetRefs) {
|
|
5815
|
-
console.log(` ${colorRef(ref)}`);
|
|
5816
|
-
}
|
|
5817
|
-
if (opts.all) {
|
|
5818
|
-
console.log();
|
|
5819
|
-
console.log(` ${S.heading("Also removing:")}`);
|
|
5820
|
-
console.log(` ${S.dim(".skaile/history.yaml")}`);
|
|
5821
|
-
console.log(` ${S.dim(".skaile/patches/")}`);
|
|
5822
|
-
console.log(` ${S.dim("skaile.lock.yaml")}`);
|
|
5823
|
-
}
|
|
5824
|
-
if (opts.dryRun) {
|
|
5825
|
-
console.log();
|
|
5826
|
-
logInfo("Dry run \u2014 no changes made.");
|
|
5827
|
-
return;
|
|
5828
|
-
}
|
|
5829
|
-
if (!opts.yes) {
|
|
5830
|
-
const confirm7 = await p6.confirm({ message: "Proceed?" });
|
|
5831
|
-
if (p6.isCancel(confirm7) || !confirm7) {
|
|
5832
|
-
logInfo("Cancelled.");
|
|
5833
|
-
return;
|
|
5834
|
-
}
|
|
5835
|
-
}
|
|
5836
|
-
const result = am2.clean({ all: opts.all });
|
|
5837
|
-
console.log();
|
|
5838
|
-
for (const r of result.removed) {
|
|
5839
|
-
logOk(`Removed ${r}`);
|
|
5840
|
-
}
|
|
5841
|
-
for (const s of result.skipped) {
|
|
5842
|
-
logWarn(`Skipped ${s.ref}: ${s.reason}`);
|
|
5843
|
-
}
|
|
5844
|
-
if (result.unmanaged.length > 0) {
|
|
5845
|
-
console.log();
|
|
5846
|
-
logInfo(`Kept ${result.unmanaged.length} unmanaged asset(s):`);
|
|
5847
|
-
for (const u of result.unmanaged) {
|
|
5848
|
-
console.log(` ${S.dim(u)}`);
|
|
5849
|
-
}
|
|
5850
|
-
}
|
|
5851
|
-
if (opts.all) {
|
|
5852
|
-
console.log();
|
|
5853
|
-
logOk("Full reset complete.");
|
|
5854
|
-
}
|
|
5855
|
-
});
|
|
5856
|
-
}
|
|
5857
5593
|
function buildPresetFromWorkspace(config, name, sources = []) {
|
|
5858
5594
|
const items = [];
|
|
5859
5595
|
for (const ref of config.dependencies ?? []) {
|
|
@@ -6451,16 +6187,6 @@ name: "${name}"
|
|
|
6451
6187
|
version: "1.0.0"
|
|
6452
6188
|
description: "TODO: describe what this preset configures"
|
|
6453
6189
|
|
|
6454
|
-
# Placeholders \u2014 values the user provides at apply-time.
|
|
6455
|
-
# Types: text, multiline, secret, number, boolean, enum, oauth, instance-picker
|
|
6456
|
-
placeholders:
|
|
6457
|
-
- key: EXAMPLE_KEY
|
|
6458
|
-
type: text
|
|
6459
|
-
label: "Example placeholder"
|
|
6460
|
-
required: true
|
|
6461
|
-
# default: "some-value"
|
|
6462
|
-
# hint: "Help text shown to the user"
|
|
6463
|
-
|
|
6464
6190
|
# Items \u2014 each becomes a Library Instance when the preset is applied.
|
|
6465
6191
|
# Ref types:
|
|
6466
6192
|
# - Asset ref (kind:publisher/name@pin) \u2192 creates new Instance
|
|
@@ -6469,10 +6195,27 @@ placeholders:
|
|
|
6469
6195
|
items:
|
|
6470
6196
|
- id: example-item
|
|
6471
6197
|
ref: "skill:@skaile/example-skill@^1.0"
|
|
6198
|
+
# Placeholders \u2014 values the user provides at apply-time, declared on the item
|
|
6199
|
+
# that uses them. Types: text, multiline, secret, number, boolean, enum, oauth,
|
|
6200
|
+
# instance-picker
|
|
6201
|
+
placeholders:
|
|
6202
|
+
- key: EXAMPLE_KEY
|
|
6203
|
+
type: text
|
|
6204
|
+
label: "Example placeholder"
|
|
6205
|
+
required: true
|
|
6206
|
+
# default: "some-value"
|
|
6207
|
+
# hint: "Help text shown to the user"
|
|
6472
6208
|
config:
|
|
6473
6209
|
# Use \${INPUT:EXAMPLE_KEY} for placeholder interpolation
|
|
6474
6210
|
setting: "\${INPUT:EXAMPLE_KEY}"
|
|
6475
6211
|
# credential_ref: "\${SECRET:EXAMPLE_KEY}" # for secret placeholders
|
|
6212
|
+
|
|
6213
|
+
# Preset-level inputs shared across items (rare) \u2014 top-level \`inputs:\`, not
|
|
6214
|
+
# \`placeholders:\` (that key lives on items). Same shape as a placeholder:
|
|
6215
|
+
# inputs:
|
|
6216
|
+
# - key: SHARED_KEY
|
|
6217
|
+
# type: text
|
|
6218
|
+
# label: "Shared across all items"
|
|
6476
6219
|
`;
|
|
6477
6220
|
}
|
|
6478
6221
|
function makeRebuildCommand() {
|
|
@@ -6587,7 +6330,7 @@ function makeRunCommand() {
|
|
|
6587
6330
|
logErr("No flows available.");
|
|
6588
6331
|
process.exit(1);
|
|
6589
6332
|
}
|
|
6590
|
-
const selected = await
|
|
6333
|
+
const selected = await p5.select({
|
|
6591
6334
|
message: "Select a flow to run",
|
|
6592
6335
|
options: flows.map((f) => ({
|
|
6593
6336
|
value: f.id,
|
|
@@ -6595,8 +6338,8 @@ function makeRunCommand() {
|
|
|
6595
6338
|
hint: f.description
|
|
6596
6339
|
}))
|
|
6597
6340
|
});
|
|
6598
|
-
if (
|
|
6599
|
-
|
|
6341
|
+
if (p5.isCancel(selected)) {
|
|
6342
|
+
p5.cancel("Cancelled.");
|
|
6600
6343
|
process.exit(0);
|
|
6601
6344
|
}
|
|
6602
6345
|
flowId = selected;
|
|
@@ -6765,11 +6508,11 @@ function makeReplCommand() {
|
|
|
6765
6508
|
console.log();
|
|
6766
6509
|
logWarn(`No skaile.yaml found in ${S.cmd(userCwd)} or any parent directory.`);
|
|
6767
6510
|
console.log();
|
|
6768
|
-
const shouldCreate = await
|
|
6511
|
+
const shouldCreate = await p5.confirm({
|
|
6769
6512
|
message: "Create a temporary workspace? (session state in /tmp/)"
|
|
6770
6513
|
});
|
|
6771
|
-
if (
|
|
6772
|
-
|
|
6514
|
+
if (p5.isCancel(shouldCreate) || !shouldCreate) {
|
|
6515
|
+
p5.cancel("Cancelled.");
|
|
6773
6516
|
process.exit(0);
|
|
6774
6517
|
}
|
|
6775
6518
|
const tmpDir = fs13__default.mkdtempSync(path14__default.join(os2.tmpdir(), "skaile-repl-"));
|
|
@@ -6824,7 +6567,7 @@ function makeServeCommand() {
|
|
|
6824
6567
|
);
|
|
6825
6568
|
}
|
|
6826
6569
|
async function ensurePluginsLoadedForServe(projectDir) {
|
|
6827
|
-
const { logInfo: logInfo2, logWarn: logWarn2 } = await import('../helpers-
|
|
6570
|
+
const { logInfo: logInfo2, logWarn: logWarn2 } = await import('../helpers-DN4MWOHB.js');
|
|
6828
6571
|
try {
|
|
6829
6572
|
const { resolveSkWorkspaceConfig: resolveSkWorkspaceConfig2 } = await import('../core/index.js');
|
|
6830
6573
|
const config = resolveSkWorkspaceConfig2(projectDir);
|
|
@@ -6843,7 +6586,7 @@ async function ensurePluginsLoadedForServe(projectDir) {
|
|
|
6843
6586
|
}
|
|
6844
6587
|
}
|
|
6845
6588
|
async function runCompileTest(opts) {
|
|
6846
|
-
const { logOk: logOk2, logErr: logErr2, logInfo: logInfo2, S: S2 } = await import('../helpers-
|
|
6589
|
+
const { logOk: logOk2, logErr: logErr2, logInfo: logInfo2, S: S2 } = await import('../helpers-DN4MWOHB.js');
|
|
6847
6590
|
const { tmpdir } = await import('os');
|
|
6848
6591
|
const { dirname: dirname4, join: join7, resolve: resolve5 } = await import('path');
|
|
6849
6592
|
const { fileURLToPath: fileURLToPath2 } = await import('url');
|
|
@@ -7215,12 +6958,21 @@ function unitMs(unit) {
|
|
|
7215
6958
|
throw new Error(`Unknown time unit: ${unit}`);
|
|
7216
6959
|
}
|
|
7217
6960
|
}
|
|
6961
|
+
|
|
6962
|
+
// cli/src/commands/session-logs/superjson-transformer.ts
|
|
6963
|
+
var superjsonLite = {
|
|
6964
|
+
serialize: (object) => ({ json: object }),
|
|
6965
|
+
deserialize: (payload) => payload && typeof payload === "object" && "json" in payload ? payload.json : payload
|
|
6966
|
+
};
|
|
6967
|
+
|
|
6968
|
+
// cli/src/commands/session-logs/remote-query.ts
|
|
7218
6969
|
async function remoteQuery(args) {
|
|
7219
6970
|
const trpcUrl = normalizeTrpcUrl(args.url);
|
|
7220
6971
|
const client = createTRPCUntypedClient({
|
|
7221
6972
|
links: [
|
|
7222
6973
|
httpLink({
|
|
7223
6974
|
url: trpcUrl,
|
|
6975
|
+
transformer: superjsonLite,
|
|
7224
6976
|
headers: () => args.token ? { authorization: `Bearer ${args.token}` } : {}
|
|
7225
6977
|
})
|
|
7226
6978
|
]
|
|
@@ -7243,6 +6995,7 @@ async function remoteTail(opts) {
|
|
|
7243
6995
|
links: [
|
|
7244
6996
|
httpSubscriptionLink({
|
|
7245
6997
|
url: trpcUrl,
|
|
6998
|
+
transformer: superjsonLite,
|
|
7246
6999
|
eventSourceOptions: () => ({
|
|
7247
7000
|
// EventSource init dict; Bun ignores unknown fields.
|
|
7248
7001
|
...opts.token ? { headers: { authorization: `Bearer ${opts.token}` } } : {}
|
|
@@ -7672,8 +7425,12 @@ function makeStoreCommand() {
|
|
|
7672
7425
|
store.command("login").description("Sign in to the store (Keycloak device flow \u2014 approve in your browser)").action(async () => {
|
|
7673
7426
|
try {
|
|
7674
7427
|
await deviceLogin(loadStoreAuthConfig());
|
|
7675
|
-
const me = await fetchIdentity().catch(
|
|
7676
|
-
|
|
7428
|
+
const me = await fetchIdentity().catch(
|
|
7429
|
+
() => ({})
|
|
7430
|
+
);
|
|
7431
|
+
logOk(
|
|
7432
|
+
`Signed in${me.username ? ` as ${S.brand(me.username)}${me.githubLogin ? ` \u2014 publishing as ${S.brand(`@${me.githubLogin}`)}` : ""}` : "."}`
|
|
7433
|
+
);
|
|
7677
7434
|
} catch (e) {
|
|
7678
7435
|
logErr(e.message);
|
|
7679
7436
|
process.exit(1);
|
|
@@ -7691,8 +7448,10 @@ function makeStoreCommand() {
|
|
|
7691
7448
|
try {
|
|
7692
7449
|
const me = await fetchIdentity();
|
|
7693
7450
|
console.log();
|
|
7694
|
-
console.log(` ${S.
|
|
7695
|
-
|
|
7451
|
+
console.log(` ${S.label("Login")} ${S.brand(me.username ?? "?")}`);
|
|
7452
|
+
console.log(
|
|
7453
|
+
` ${S.label("Publisher")} ${me.githubLogin ? S.brand(`@${me.githubLogin}`) : S.dim("\u2014 connect GitHub in the store to publish")}`
|
|
7454
|
+
);
|
|
7696
7455
|
if (me.roles?.length) console.log(` ${S.label("Roles")} ${me.roles.join(", ")}`);
|
|
7697
7456
|
console.log();
|
|
7698
7457
|
} catch (e) {
|
|
@@ -7706,13 +7465,102 @@ function makeStoreCommand() {
|
|
|
7706
7465
|
);
|
|
7707
7466
|
process.exit(2);
|
|
7708
7467
|
});
|
|
7709
|
-
store.command("search <query>").description("Search the
|
|
7710
|
-
|
|
7711
|
-
|
|
7468
|
+
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) => {
|
|
7469
|
+
const { openCatalogSource: openCatalogSource2, LocalCatalogDisabledError } = await import('../open-library-ST2VFQTK.js');
|
|
7470
|
+
try {
|
|
7471
|
+
const remote = await openCatalogSource2({ projectDir: path14__default.resolve(opts.projectDir) });
|
|
7472
|
+
const assets = await remote.listAssets(opts.kind ? { kind: opts.kind } : {});
|
|
7473
|
+
const results = filterCatalogAssets(assets, query);
|
|
7474
|
+
if (results.length === 0) {
|
|
7475
|
+
logInfo(`No store results for "${query}".`);
|
|
7476
|
+
return;
|
|
7477
|
+
}
|
|
7478
|
+
console.log();
|
|
7479
|
+
for (const a of results) {
|
|
7480
|
+
const ref = catalogAssetRef(a);
|
|
7481
|
+
console.log(
|
|
7482
|
+
` \u2B21 ${kindColorPad(a.kind)} ${colorRef(ref).padEnd(48)} ${S.dim((a.description ?? "").slice(0, 60))}`
|
|
7483
|
+
);
|
|
7484
|
+
}
|
|
7485
|
+
console.log(
|
|
7486
|
+
`
|
|
7487
|
+
${S.dim(`${results.length} result(s) \xB7 \`skaile store show <ref>\` for details`)}
|
|
7488
|
+
`
|
|
7489
|
+
);
|
|
7490
|
+
} catch (e) {
|
|
7491
|
+
if (e instanceof LocalCatalogDisabledError) {
|
|
7492
|
+
logErr(
|
|
7493
|
+
"Remote catalog disabled (catalog.url: local). Set `catalog.url: https://skaile.store` in ~/.skaile/config.yaml."
|
|
7494
|
+
);
|
|
7495
|
+
} else {
|
|
7496
|
+
logErr(`Store search failed: ${e.message}`);
|
|
7497
|
+
}
|
|
7498
|
+
process.exit(1);
|
|
7499
|
+
}
|
|
7712
7500
|
});
|
|
7713
|
-
store.command("show <ref>").description("Show details + provenance
|
|
7714
|
-
|
|
7715
|
-
|
|
7501
|
+
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) => {
|
|
7502
|
+
const { openCatalogSource: openCatalogSource2, LocalCatalogDisabledError } = await import('../open-library-ST2VFQTK.js');
|
|
7503
|
+
const { supportsInstallManifest } = await import('../project-4M6QXHCH.js');
|
|
7504
|
+
try {
|
|
7505
|
+
const remote = await openCatalogSource2({ projectDir: path14__default.resolve(opts.projectDir) });
|
|
7506
|
+
const asset = await remote.resolve(ref);
|
|
7507
|
+
if (!asset) {
|
|
7508
|
+
logErr(`Not found in store: ${ref} (try a full ref, e.g. skill:@publisher/name#version)`);
|
|
7509
|
+
process.exit(1);
|
|
7510
|
+
}
|
|
7511
|
+
const canonical = catalogAssetRef(asset);
|
|
7512
|
+
let manifest = null;
|
|
7513
|
+
if (supportsInstallManifest(remote)) {
|
|
7514
|
+
manifest = await remote.getInstallManifest(canonical).catch(() => null);
|
|
7515
|
+
}
|
|
7516
|
+
const field = (label, value) => ` ${S.label(label.padEnd(11))}${value}`;
|
|
7517
|
+
console.log();
|
|
7518
|
+
console.log(
|
|
7519
|
+
` ${kindColorPad(asset.kind)} ${S.heading(`@${asset.publisher}/${asset.name}`)} ${S.dim(`v${asset.version}`)}`
|
|
7520
|
+
);
|
|
7521
|
+
console.log(` ${S.rule(52)}`);
|
|
7522
|
+
if (asset.description) {
|
|
7523
|
+
console.log();
|
|
7524
|
+
console.log(` ${asset.description}`);
|
|
7525
|
+
}
|
|
7526
|
+
console.log();
|
|
7527
|
+
if (manifest) console.log(field("Tier", manifest.tier));
|
|
7528
|
+
if (asset.category) console.log(field("Category", asset.category));
|
|
7529
|
+
if (asset.license) console.log(field("License", asset.license));
|
|
7530
|
+
if (manifest) {
|
|
7531
|
+
console.log();
|
|
7532
|
+
console.log(` ${S.heading("Source")}`);
|
|
7533
|
+
console.log(field("Repo", manifest.source.url));
|
|
7534
|
+
console.log(field("Commit", manifest.source.commitSha));
|
|
7535
|
+
console.log();
|
|
7536
|
+
console.log(` ${S.heading(`Files (${manifest.files.length})`)}`);
|
|
7537
|
+
for (const f of manifest.files) {
|
|
7538
|
+
console.log(` ${S.dim(f.sha256.slice(0, 12))} ${f.path}`);
|
|
7539
|
+
}
|
|
7540
|
+
console.log();
|
|
7541
|
+
console.log(field("Integrity", manifest.sha256));
|
|
7542
|
+
} else if (asset.repo) {
|
|
7543
|
+
console.log(field("Repo", asset.repo));
|
|
7544
|
+
if (asset.sha256) console.log(field("Integrity", asset.sha256));
|
|
7545
|
+
}
|
|
7546
|
+
if (asset.softDeps?.length) {
|
|
7547
|
+
console.log();
|
|
7548
|
+
console.log(` ${S.heading("Soft dependencies")}`);
|
|
7549
|
+
for (const dep of asset.softDeps) console.log(` ${S.dim("\u2192")} ${dep}`);
|
|
7550
|
+
}
|
|
7551
|
+
console.log();
|
|
7552
|
+
console.log(` ${S.dim(`Install: skaile add ${canonical}`)}`);
|
|
7553
|
+
console.log();
|
|
7554
|
+
} catch (e) {
|
|
7555
|
+
if (e instanceof LocalCatalogDisabledError) {
|
|
7556
|
+
logErr(
|
|
7557
|
+
"Remote catalog disabled (catalog.url: local). Set `catalog.url: https://skaile.store` in ~/.skaile/config.yaml."
|
|
7558
|
+
);
|
|
7559
|
+
} else {
|
|
7560
|
+
logErr(`Store show failed: ${e.message}`);
|
|
7561
|
+
}
|
|
7562
|
+
process.exit(1);
|
|
7563
|
+
}
|
|
7716
7564
|
});
|
|
7717
7565
|
store.command("favourite <ref>").description("Pin a ref to your favourites (not yet wired)").action((_ref) => {
|
|
7718
7566
|
logErr("`skaile store favourite` is scaffolded but not yet wired.");
|
|
@@ -7747,9 +7595,13 @@ function makeStoreCommand() {
|
|
|
7747
7595
|
}
|
|
7748
7596
|
try {
|
|
7749
7597
|
const jwt = await getStoreToken();
|
|
7750
|
-
await storeFetch(
|
|
7751
|
-
|
|
7752
|
-
|
|
7598
|
+
await storeFetch(
|
|
7599
|
+
{ ...getStoreConfig(), jwt },
|
|
7600
|
+
`/api/assets/${publisher}/${slug}/${version}/yank`,
|
|
7601
|
+
{
|
|
7602
|
+
method: "PATCH"
|
|
7603
|
+
}
|
|
7604
|
+
);
|
|
7753
7605
|
logOk(`Yanked v${version} of @${publisher}/${slug}`);
|
|
7754
7606
|
} catch (e) {
|
|
7755
7607
|
logErr(e.message);
|
|
@@ -7793,7 +7645,7 @@ function makeUpdateCommand() {
|
|
|
7793
7645
|
async (_name, opts) => {
|
|
7794
7646
|
if (opts.catalog !== false) {
|
|
7795
7647
|
try {
|
|
7796
|
-
const catalogSpinner =
|
|
7648
|
+
const catalogSpinner = p5.spinner();
|
|
7797
7649
|
catalogSpinner.start("Refreshing catalog cache");
|
|
7798
7650
|
const remote = await openCatalogSource({ projectDir: path14__default.resolve(opts.projectDir) });
|
|
7799
7651
|
const result2 = await remote.refresh();
|
|
@@ -7809,7 +7661,7 @@ function makeUpdateCommand() {
|
|
|
7809
7661
|
if (opts.catalogOnly) return;
|
|
7810
7662
|
const projectDir = path14__default.resolve(opts.projectDir);
|
|
7811
7663
|
if (await shouldSyncSources(opts)) {
|
|
7812
|
-
const syncSpinner =
|
|
7664
|
+
const syncSpinner = p5.spinner();
|
|
7813
7665
|
syncSpinner.start("Syncing sources");
|
|
7814
7666
|
const { total, synced, failed } = await syncProjectSources(projectDir);
|
|
7815
7667
|
syncSpinner.stop(
|
|
@@ -7817,10 +7669,10 @@ function makeUpdateCommand() {
|
|
|
7817
7669
|
);
|
|
7818
7670
|
}
|
|
7819
7671
|
const am2 = new AssetManager({ projectDir });
|
|
7820
|
-
const
|
|
7821
|
-
|
|
7672
|
+
const spinner4 = p5.spinner();
|
|
7673
|
+
spinner4.start("Re-deploying assets");
|
|
7822
7674
|
const result = await am2.install();
|
|
7823
|
-
|
|
7675
|
+
spinner4.stop("Done");
|
|
7824
7676
|
if (result.deployed.length > 0) {
|
|
7825
7677
|
for (const d of result.deployed) logOk(`Updated ${d}`);
|
|
7826
7678
|
} else {
|
|
@@ -7832,12 +7684,12 @@ function makeUpdateCommand() {
|
|
|
7832
7684
|
async function shouldSyncSources(opts) {
|
|
7833
7685
|
if (opts.sync === false) return false;
|
|
7834
7686
|
if (opts.yes || !process.stdin.isTTY) return true;
|
|
7835
|
-
const answer = await
|
|
7687
|
+
const answer = await p5.confirm({
|
|
7836
7688
|
message: "Sync sources from upstream before re-deploying?",
|
|
7837
7689
|
initialValue: true
|
|
7838
7690
|
});
|
|
7839
|
-
if (
|
|
7840
|
-
|
|
7691
|
+
if (p5.isCancel(answer)) {
|
|
7692
|
+
p5.cancel("Cancelled.");
|
|
7841
7693
|
process.exit(130);
|
|
7842
7694
|
}
|
|
7843
7695
|
return answer;
|
|
@@ -8728,7 +8580,7 @@ async function bootstrapUserConfig() {
|
|
|
8728
8580
|
}
|
|
8729
8581
|
async function hydrateInitSources(resolved, created) {
|
|
8730
8582
|
try {
|
|
8731
|
-
const { ensureSourcesCloned } = await import('../ensure-sources-
|
|
8583
|
+
const { ensureSourcesCloned } = await import('../ensure-sources-NXBYK5GP.js');
|
|
8732
8584
|
const hydrate = ensureSourcesCloned(resolved, { quiet: true });
|
|
8733
8585
|
for (const n of hydrate.cloned) created.push(`~/.skaile/cache/sources/${n}/`);
|
|
8734
8586
|
if (hydrate.failed.length > 0) {
|