@skaile/workspaces 1.4.0 → 1.6.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 +326 -0
- package/dist/app-sdk/index.js +241 -55
- package/dist/app-sdk/index.js.map +1 -1
- package/dist/app-sdk/src/app.d.ts +55 -4
- package/dist/app-sdk/src/app.d.ts.map +1 -1
- package/dist/app-sdk/src/connection-params.d.ts +117 -0
- package/dist/app-sdk/src/connection-params.d.ts.map +1 -0
- package/dist/app-sdk/src/index.d.ts +3 -2
- package/dist/app-sdk/src/index.d.ts.map +1 -1
- package/dist/app-sdk/src/transport.d.ts +9 -0
- package/dist/app-sdk/src/transport.d.ts.map +1 -1
- package/dist/app-sdk/src/ws-transport.d.ts +18 -2
- package/dist/app-sdk/src/ws-transport.d.ts.map +1 -1
- package/dist/{asset-feeds-NG5TKB3V.js → asset-feeds-T35ELX2O.js} +9 -9
- package/dist/{asset-feeds-NG5TKB3V.js.map → asset-feeds-T35ELX2O.js.map} +1 -1
- package/dist/asset-manager/index.js +11 -6
- package/dist/asset-manager/installer.js +5 -5
- package/dist/asset-manager/src/index.d.ts.map +1 -1
- package/dist/{chunk-BE5KTS2L.js → chunk-2DWXGUZA.js} +2 -2
- package/dist/{chunk-BE5KTS2L.js.map → chunk-2DWXGUZA.js.map} +1 -1
- package/dist/{chunk-XBG2YDQQ.js → chunk-2ZMO4CFG.js} +3 -3
- package/dist/{chunk-XBG2YDQQ.js.map → chunk-2ZMO4CFG.js.map} +1 -1
- package/dist/{chunk-X57AMTAH.js → chunk-3CHARYD4.js} +16 -7
- package/dist/chunk-3CHARYD4.js.map +1 -0
- package/dist/{chunk-LCTRCWBK.js → chunk-6NR2BEIY.js} +4 -4
- package/dist/{chunk-LCTRCWBK.js.map → chunk-6NR2BEIY.js.map} +1 -1
- package/dist/{chunk-JZPEEMIM.js → chunk-BEO6KN7P.js} +5 -5
- package/dist/{chunk-JZPEEMIM.js.map → chunk-BEO6KN7P.js.map} +1 -1
- package/dist/{chunk-AAGD2J4H.js → chunk-CBA2XIBF.js} +33 -15
- package/dist/chunk-CBA2XIBF.js.map +1 -0
- package/dist/{chunk-GWDZW44L.js → chunk-DMG6NJH7.js} +4 -4
- package/dist/{chunk-GWDZW44L.js.map → chunk-DMG6NJH7.js.map} +1 -1
- package/dist/{chunk-HWTQ6HPO.js → chunk-FDE7XRQA.js} +56 -8
- package/dist/chunk-FDE7XRQA.js.map +1 -0
- package/dist/{chunk-26YCXWCU.js → chunk-HY33RMEA.js} +3 -3
- package/dist/{chunk-26YCXWCU.js.map → chunk-HY33RMEA.js.map} +1 -1
- package/dist/chunk-J5TI55E7.js +203 -0
- package/dist/chunk-J5TI55E7.js.map +1 -0
- package/dist/chunk-JIDKX7GC.js +122 -0
- package/dist/chunk-JIDKX7GC.js.map +1 -0
- package/dist/{chunk-BDUANIAR.js → chunk-KEQ4GLVM.js} +3 -3
- package/dist/{chunk-BDUANIAR.js.map → chunk-KEQ4GLVM.js.map} +1 -1
- package/dist/{chunk-DNFIKRO6.js → chunk-KMY7HVQ6.js} +3 -3
- package/dist/{chunk-DNFIKRO6.js.map → chunk-KMY7HVQ6.js.map} +1 -1
- package/dist/{chunk-B6SSXVF2.js → chunk-MZV6WCF3.js} +81 -49
- package/dist/chunk-MZV6WCF3.js.map +1 -0
- package/dist/{chunk-DZCK7GRW.js → chunk-P4VHQA4N.js} +22 -6
- package/dist/chunk-P4VHQA4N.js.map +1 -0
- package/dist/{chunk-OSCJRUKM.js → chunk-RDYOU6N6.js} +2 -2
- package/dist/{chunk-OSCJRUKM.js.map → chunk-RDYOU6N6.js.map} +1 -1
- package/dist/{chunk-77OXU44H.js → chunk-RSYV7XEN.js} +13 -7
- package/dist/chunk-RSYV7XEN.js.map +1 -0
- package/dist/{chunk-OUWNTFDG.js → chunk-UQKYT4V6.js} +38 -6
- package/dist/chunk-UQKYT4V6.js.map +1 -0
- package/dist/chunk-WYGXYGJH.js +688 -0
- package/dist/chunk-WYGXYGJH.js.map +1 -0
- package/dist/{chunk-TJRWGMD2.js → chunk-ZBZQC5R7.js} +3 -3
- package/dist/{chunk-TJRWGMD2.js.map → chunk-ZBZQC5R7.js.map} +1 -1
- package/dist/cli/index.js +259 -192
- package/dist/cli/index.js.map +1 -1
- package/dist/cli/src/commands/catalog.d.ts +18 -0
- package/dist/cli/src/commands/catalog.d.ts.map +1 -1
- package/dist/cli/src/commands/library-cmd.d.ts +2 -2
- package/dist/cli/src/commands/library-cmd.d.ts.map +1 -1
- package/dist/cli/src/commands/library-publish.d.ts +53 -0
- package/dist/cli/src/commands/library-publish.d.ts.map +1 -0
- package/dist/cli/src/commands/preset-cmd.d.ts +6 -0
- package/dist/cli/src/commands/preset-cmd.d.ts.map +1 -1
- package/dist/cli/src/commands/preset-export.d.ts +10 -1
- package/dist/cli/src/commands/preset-export.d.ts.map +1 -1
- package/dist/cli/src/commands/project.d.ts.map +1 -1
- package/dist/cli/src/commands/publish-core.d.ts +75 -0
- package/dist/cli/src/commands/publish-core.d.ts.map +1 -0
- package/dist/cli/src/commands/run.d.ts.map +1 -1
- package/dist/cli/src/commands/source-manifest-publish.d.ts +82 -0
- package/dist/cli/src/commands/source-manifest-publish.d.ts.map +1 -0
- package/dist/cli/src/commands/source-manifest.d.ts +65 -6
- package/dist/cli/src/commands/source-manifest.d.ts.map +1 -1
- package/dist/cli/src/commands/source.d.ts +13 -0
- package/dist/cli/src/commands/source.d.ts.map +1 -1
- package/dist/cli/src/commands/store.d.ts.map +1 -1
- package/dist/cli/src/driver-error.d.ts +12 -0
- package/dist/cli/src/driver-error.d.ts.map +1 -0
- package/dist/cli/src/open-library.d.ts +4 -0
- package/dist/cli/src/open-library.d.ts.map +1 -1
- package/dist/cli/src/store-auth.d.ts +42 -0
- package/dist/cli/src/store-auth.d.ts.map +1 -0
- package/dist/cli/src/store-client.d.ts +20 -22
- package/dist/cli/src/store-client.d.ts.map +1 -1
- package/dist/cli/src/store-publisher.d.ts +91 -0
- package/dist/cli/src/store-publisher.d.ts.map +1 -0
- package/dist/connectors/config.js +5 -5
- package/dist/connectors/index.js +6 -6
- package/dist/core/index.js +4 -4
- package/dist/core/publish-manifest.js +1 -1
- package/dist/core/runtime-assets.js +3 -3
- package/dist/core/src/cache-paths.d.ts +17 -0
- package/dist/core/src/cache-paths.d.ts.map +1 -1
- package/dist/core/src/index.d.ts +2 -2
- package/dist/core/src/index.d.ts.map +1 -1
- package/dist/core/src/publish-manifest.d.ts.map +1 -1
- package/dist/core/src/repo-manager.d.ts +13 -2
- package/dist/core/src/repo-manager.d.ts.map +1 -1
- package/dist/core/src/walker.d.ts +10 -0
- package/dist/core/src/walker.d.ts.map +1 -1
- package/dist/core/workspace-config.js +2 -2
- package/dist/deploy/index.js +4 -4
- package/dist/discovery/index.js +2 -2
- package/dist/discovery/src/discover-manifest.d.ts.map +1 -1
- package/dist/discovery/src/discover.d.ts +17 -4
- package/dist/discovery/src/discover.d.ts.map +1 -1
- package/dist/discovery/src/index.d.ts +1 -1
- package/dist/discovery/src/index.d.ts.map +1 -1
- package/dist/discovery/src/reference-lint.d.ts +7 -0
- package/dist/discovery/src/reference-lint.d.ts.map +1 -1
- package/dist/discovery/src/source-config.d.ts +28 -0
- package/dist/discovery/src/source-config.d.ts.map +1 -1
- package/dist/discovery/src/tree-entries.d.ts.map +1 -1
- package/dist/{ensure-sources-CHC7X7AJ.js → ensure-sources-QDVFUIUP.js} +14 -9
- package/dist/ensure-sources-QDVFUIUP.js.map +1 -0
- package/dist/factory-assets/connectors/box.js +6 -6
- package/dist/factory-assets/connectors/deploy.js +6 -6
- package/dist/factory-assets/connectors/devserver.js +6 -6
- package/dist/factory-assets/connectors/flow/adapter.js +6 -6
- package/dist/factory-assets/connectors/flow/engine.js +4 -4
- package/dist/factory-assets/connectors/flow/run-flow.js +7 -7
- package/dist/factory-assets/connectors/flow.js +6 -6
- package/dist/factory-assets/connectors/git.js +6 -6
- package/dist/factory-assets/connectors/gmail.js +6 -6
- package/dist/factory-assets/connectors/googledrive.js +6 -6
- package/dist/factory-assets/connectors/local.js +6 -6
- package/dist/factory-assets/connectors/mattermost.js +6 -6
- package/dist/factory-assets/connectors/memory.js +6 -6
- package/dist/factory-assets/connectors/minio.js +6 -6
- package/dist/factory-assets/connectors/postgres.js +6 -6
- package/dist/factory-assets/connectors/s3.js +6 -6
- package/dist/factory-assets/connectors/sharepoint.js +6 -6
- package/dist/factory-assets/connectors/sqlite.js +6 -6
- package/dist/factory-assets/connectors/static-server.js +6 -6
- package/dist/factory-assets/connectors/tunnel.js +6 -6
- package/dist/factory-assets/connectors/webdav.js +6 -6
- package/dist/factory-assets/connectors/xstate-store.js +6 -6
- package/dist/factory-assets/connectors/xstate.js +6 -6
- package/dist/{flows-CGOCUNO6.js → flows-MRVXTYWC.js} +3 -3
- package/dist/{flows-CGOCUNO6.js.map → flows-MRVXTYWC.js.map} +1 -1
- package/dist/{helpers-GWG4CYYC.js → helpers-TF7GCBRQ.js} +14 -9
- package/dist/{helpers-GWG4CYYC.js.map → helpers-TF7GCBRQ.js.map} +1 -1
- package/dist/library/index.js +6 -6
- package/dist/library/install.js +4 -4
- package/dist/library/src/index.d.ts +2 -2
- package/dist/library/src/index.d.ts.map +1 -1
- package/dist/library/src/local/local-catalog-source.d.ts +12 -1
- package/dist/library/src/local/local-catalog-source.d.ts.map +1 -1
- package/dist/library/src/sync/manifest-writeback.d.ts +36 -0
- package/dist/library/src/sync/manifest-writeback.d.ts.map +1 -1
- package/dist/library-publish-K5IBE44D.js +249 -0
- package/dist/library-publish-K5IBE44D.js.map +1 -0
- package/dist/{open-library-37PXN6MK.js → open-library-4HMIDK3N.js} +13 -13
- package/dist/{open-library-37PXN6MK.js.map → open-library-4HMIDK3N.js.map} +1 -1
- package/dist/{paths-UVOHWUPY.js → paths-P3DWFUPS.js} +7 -7
- package/dist/{paths-UVOHWUPY.js.map → paths-P3DWFUPS.js.map} +1 -1
- package/dist/{plugin-store-EIMVEH3O.js → plugin-store-S7OMGI7N.js} +6 -6
- package/dist/{plugin-store-EIMVEH3O.js.map → plugin-store-S7OMGI7N.js.map} +1 -1
- package/dist/runner/index.js +8 -8
- package/dist/runner/src/agent.d.ts.map +1 -1
- package/dist/runner/src/capability-registry.d.ts +21 -2
- package/dist/runner/src/capability-registry.d.ts.map +1 -1
- package/dist/sdk/asset-manager.js +11 -6
- package/dist/sdk/core.js +4 -4
- package/dist/sdk/flow.js +4 -4
- package/dist/sdk/index.js +8 -8
- package/dist/sdk/runner.js +8 -8
- package/dist/{setup-DINVR6ZQ.js → setup-2CCS63L6.js} +6 -6
- package/dist/{setup-DINVR6ZQ.js.map → setup-2CCS63L6.js.map} +1 -1
- package/dist/source-LOAM7IIQ.js +30 -0
- package/dist/{source-RXAHIGMD.js.map → source-LOAM7IIQ.js.map} +1 -1
- package/dist/source-manifest-publish-TGVZ6KMC.js +228 -0
- package/dist/source-manifest-publish-TGVZ6KMC.js.map +1 -0
- package/dist/tui/index.js +8 -8
- package/dist/workspace-plugin/adapters/mcp.js +1 -1
- package/dist/workspace-plugin/adapters/omp.js +3 -3
- package/dist/workspace-plugin/index.js +1 -1
- package/package.json +1 -1
- package/dist/chunk-77OXU44H.js.map +0 -1
- package/dist/chunk-AAGD2J4H.js.map +0 -1
- package/dist/chunk-B6SSXVF2.js.map +0 -1
- package/dist/chunk-BJHZHNKR.js +0 -93
- package/dist/chunk-BJHZHNKR.js.map +0 -1
- package/dist/chunk-DZCK7GRW.js.map +0 -1
- package/dist/chunk-HWTQ6HPO.js.map +0 -1
- package/dist/chunk-OUWNTFDG.js.map +0 -1
- package/dist/chunk-QM2TT2PJ.js +0 -385
- package/dist/chunk-QM2TT2PJ.js.map +0 -1
- package/dist/chunk-X57AMTAH.js.map +0 -1
- package/dist/ensure-sources-CHC7X7AJ.js.map +0 -1
- package/dist/source-RXAHIGMD.js +0 -30
- package/dist/store-client-T3F663YG.js +0 -15
- package/dist/store-client-T3F663YG.js.map +0 -1
package/dist/cli/index.js
CHANGED
|
@@ -1,20 +1,15 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import { AI_RESOURCES, aiResourceRoots } from '../chunk-
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
2
|
+
import { AI_RESOURCES, aiResourceRoots } from '../chunk-2ZMO4CFG.js';
|
|
3
|
+
import { getStoreConfig, storeFetch, deviceLogin, loadStoreAuthConfig, logout, hasStoredAuth, isStoreAuthenticated, getStoreToken } from '../chunk-J5TI55E7.js';
|
|
4
|
+
import { makeSourceCommand, syncProjectSources } from '../chunk-WYGXYGJH.js';
|
|
5
|
+
import { openCatalogSource, openLibraryManager, createFullRegistry, openLibrary } from '../chunk-RSYV7XEN.js';
|
|
6
|
+
import { logErr, S, logOk, logInfo, colorRef, logWarn, kindColorPad, kindColor, formatSoftDepSection, bareSoftDepName, formatSoftDepHint, formatRelativeTime, fitWidth, formatSoftDepRemovePreview, formatSoftDepAddPreview } from '../chunk-KMY7HVQ6.js';
|
|
7
7
|
import { LocalSecretsProvider } from '../chunk-6BEGKO2Q.js';
|
|
8
|
-
import {
|
|
9
|
-
import '../chunk-B6SSXVF2.js';
|
|
10
|
-
import '../chunk-JXT46QFC.js';
|
|
11
|
-
import '../chunk-UKJMQZV6.js';
|
|
12
|
-
import '../chunk-R7FOF242.js';
|
|
13
|
-
import { runFlow, resumeFlow } from '../chunk-JZPEEMIM.js';
|
|
8
|
+
import { runFlow, resumeFlow } from '../chunk-BEO6KN7P.js';
|
|
14
9
|
import '../chunk-4R6DROGN.js';
|
|
15
10
|
import { validateFlowVersions, parseSkillFrontmatter } from '../chunk-GXC3TYMQ.js';
|
|
16
|
-
import { runAgentChat, loadSessionById, loadSession, listSessions, setCurrentSession, deleteSession, clearSession, loadAgentManifest, compileComposition, MarkdownStreamer, resolveMixin } from '../chunk-
|
|
17
|
-
import { buildClaudePluginFiles } from '../chunk-
|
|
11
|
+
import { runAgentChat, loadSessionById, loadSession, listSessions, setCurrentSession, deleteSession, clearSession, loadAgentManifest, compileComposition, MarkdownStreamer, resolveMixin } from '../chunk-CBA2XIBF.js';
|
|
12
|
+
import { buildClaudePluginFiles } from '../chunk-RDYOU6N6.js';
|
|
18
13
|
import '../chunk-X5YPJV4N.js';
|
|
19
14
|
import '../chunk-O7SG5PC2.js';
|
|
20
15
|
import '../chunk-7QBNJTTQ.js';
|
|
@@ -29,21 +24,26 @@ import '../chunk-BMQKMOQY.js';
|
|
|
29
24
|
import '../chunk-GAH4YRCI.js';
|
|
30
25
|
import '../chunk-TNSCHS4I.js';
|
|
31
26
|
import '../chunk-LV2HPH3C.js';
|
|
32
|
-
import '../chunk-
|
|
33
|
-
import '../chunk-
|
|
27
|
+
import '../chunk-DMG6NJH7.js';
|
|
28
|
+
import '../chunk-KEQ4GLVM.js';
|
|
34
29
|
import '../chunk-6E6PKKAD.js';
|
|
35
30
|
import { loadFlow, loadAllFlows } from '../chunk-4N5XR5DQ.js';
|
|
36
31
|
import '../chunk-DEYYRFQU.js';
|
|
37
32
|
import '../chunk-IFGTRL2I.js';
|
|
38
33
|
import '../chunk-PK7Q7MC7.js';
|
|
39
|
-
import { AssetManager, NON_DEPLOYABLE_KINDS, MissingManifestError, normalizeRepoUrl, FACTORY_SOURCE_URL } from '../chunk-
|
|
40
|
-
import '../chunk-
|
|
34
|
+
import { AssetManager, NON_DEPLOYABLE_KINDS, MissingManifestError, normalizeRepoUrl, FACTORY_SOURCE_URL } from '../chunk-3CHARYD4.js';
|
|
35
|
+
import { resolveLibraryDir, getStoreManifestsDir, getDefaultValue, isSecretPlaceholder } from '../chunk-FDE7XRQA.js';
|
|
36
|
+
import '../chunk-MZV6WCF3.js';
|
|
37
|
+
import '../chunk-JXT46QFC.js';
|
|
38
|
+
import '../chunk-UKJMQZV6.js';
|
|
39
|
+
import '../chunk-R7FOF242.js';
|
|
40
|
+
import '../chunk-6NR2BEIY.js';
|
|
41
41
|
import '../chunk-CGYEHQOX.js';
|
|
42
|
-
import { readLock, resolveSettings, globalSettingsPath, projectSettingsPath, loadSettings, saveSettings, portableSpawn, portableSpawnSync, WorkspaceYamlEditor, checkAgentSkillConformance } from '../chunk-
|
|
42
|
+
import { readLock, resolveSettings, globalSettingsPath, projectSettingsPath, loadSettings, saveSettings, portableSpawn, portableSpawnSync, WorkspaceYamlEditor, checkAgentSkillConformance } from '../chunk-HY33RMEA.js';
|
|
43
43
|
import { assetSearchDirs, detectDomains } from '../chunk-ZAP2BDHG.js';
|
|
44
|
-
import '../chunk-
|
|
45
|
-
import { globalCacheRoot, sourceCacheKey, getGlobalCacheDir, resolveAgentDir, loadSkWorkspaceConfig, resolveSkWorkspaceConfig } from '../chunk-
|
|
46
|
-
import { SKAILE_MANIFEST_FILENAME, decodeSkaileManifest, loadSkPublishManifest, saveSkPublishManifest } from '../chunk-
|
|
44
|
+
import { factoryAssetRoots } from '../chunk-ZBZQC5R7.js';
|
|
45
|
+
import { globalCacheRoot, sourceCacheKey, getGlobalCacheDir, resolveAgentDir, loadSkWorkspaceConfig, resolveSkWorkspaceConfig, storeManifestSlug } from '../chunk-UQKYT4V6.js';
|
|
46
|
+
import { SKAILE_MANIFEST_FILENAME, decodeSkaileManifest, loadSkPublishManifest, saveSkPublishManifest } from '../chunk-P4VHQA4N.js';
|
|
47
47
|
import { parseFrontmatter } from '../chunk-BQCGFPHW.js';
|
|
48
48
|
import { parseAssetRef, ASSET_KINDS, isValidAssetName, slugifyAssetName, ASSET_NAME_HINT, assetRefToStr } from '../chunk-GEEW6SY2.js';
|
|
49
49
|
import '../chunk-F3HNW354.js';
|
|
@@ -74,6 +74,19 @@ import { execSync } from 'child_process';
|
|
|
74
74
|
import * as readline2 from 'readline/promises';
|
|
75
75
|
import { createTRPCUntypedClient, httpLink, httpSubscriptionLink } from '@trpc/client';
|
|
76
76
|
|
|
77
|
+
function catalogAssetRef(a) {
|
|
78
|
+
return `${a.kind}:@${a.publisher}/${a.name}#${a.version}`;
|
|
79
|
+
}
|
|
80
|
+
function localEntryRef(e) {
|
|
81
|
+
return e.publisher ? `${e.kind}:@${e.publisher}/${e.name}` : e.name;
|
|
82
|
+
}
|
|
83
|
+
function filterCatalogAssets(assets, query) {
|
|
84
|
+
if (!query) return assets;
|
|
85
|
+
const q = query.toLowerCase();
|
|
86
|
+
return assets.filter(
|
|
87
|
+
(a) => a.name.toLowerCase().includes(q) || (a.description?.toLowerCase().includes(q) ?? false) || a.publisher.toLowerCase().includes(q)
|
|
88
|
+
);
|
|
89
|
+
}
|
|
77
90
|
async function runSearch(kind, query, opts) {
|
|
78
91
|
if (kind?.includes(":")) {
|
|
79
92
|
query = kind;
|
|
@@ -90,19 +103,68 @@ async function runSearch(kind, query, opts) {
|
|
|
90
103
|
await searchStore(query, kind, opts, airGapped);
|
|
91
104
|
}
|
|
92
105
|
}
|
|
106
|
+
async function searchIndex(query, kind) {
|
|
107
|
+
const { openLibrary: openLibrary2 } = await import('../open-library-4HMIDK3N.js');
|
|
108
|
+
const library = await openLibrary2();
|
|
109
|
+
try {
|
|
110
|
+
const defs = await library.listAssetDefs(kind ? { kind } : {});
|
|
111
|
+
let entries = defs.map(
|
|
112
|
+
(d) => ({
|
|
113
|
+
name: d.name,
|
|
114
|
+
kind: d.kind,
|
|
115
|
+
description: d.description ?? "",
|
|
116
|
+
source: d.id,
|
|
117
|
+
// Stored publishers may carry the `@` scope sigil (manifest-mode rows);
|
|
118
|
+
// `localEntryRef` re-adds it, so strip here to avoid `@@`.
|
|
119
|
+
publisher: d.publisher ? d.publisher.replace(/^@/, "") : void 0,
|
|
120
|
+
version: d.version,
|
|
121
|
+
requires: [],
|
|
122
|
+
dependencies: [],
|
|
123
|
+
license: d.license,
|
|
124
|
+
category: d.category
|
|
125
|
+
})
|
|
126
|
+
);
|
|
127
|
+
if (query) {
|
|
128
|
+
const q = query.toLowerCase();
|
|
129
|
+
entries = entries.filter(
|
|
130
|
+
(e) => e.name.toLowerCase().includes(q) || e.description.toLowerCase().includes(q)
|
|
131
|
+
);
|
|
132
|
+
}
|
|
133
|
+
return entries;
|
|
134
|
+
} finally {
|
|
135
|
+
library.close();
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
function searchFactory(projectDir, query, kind) {
|
|
139
|
+
const prefixes = factoryAssetRoots().map((r) => r.endsWith(path14__default.sep) ? r : r + path14__default.sep);
|
|
140
|
+
const isFactoryPath = (p8) => prefixes.some((fp) => p8 === fp.slice(0, -1) || p8.startsWith(fp));
|
|
141
|
+
try {
|
|
142
|
+
return new AssetManager({ projectDir }).search(query, kind).filter((e) => isFactoryPath(e.source));
|
|
143
|
+
} catch {
|
|
144
|
+
return [];
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
function entryDedupKey(e) {
|
|
148
|
+
return `${e.kind}:${e.publisher ? `@${e.publisher}/` : ""}${e.name}`;
|
|
149
|
+
}
|
|
150
|
+
function unionEntries(indexed, factory) {
|
|
151
|
+
const seen = new Set(indexed.map(entryDedupKey));
|
|
152
|
+
return [...indexed, ...factory.filter((e) => !seen.has(entryDedupKey(e)))];
|
|
153
|
+
}
|
|
93
154
|
async function searchLocal(query, kind, opts, showStore, airGapped) {
|
|
94
155
|
const projectDir = path14__default.resolve(opts.projectDir);
|
|
95
|
-
|
|
156
|
+
const factory = searchFactory(projectDir, query, kind);
|
|
157
|
+
let entries = unionEntries(await searchIndex(query, kind), factory);
|
|
96
158
|
if (entries.length === 0 && !query && !kind && !airGapped) {
|
|
97
|
-
const { autoSyncForSearch } = await import('../source-
|
|
159
|
+
const { autoSyncForSearch } = await import('../source-LOAM7IIQ.js');
|
|
98
160
|
if (await autoSyncForSearch(projectDir)) {
|
|
99
|
-
entries =
|
|
161
|
+
entries = unionEntries(await searchIndex(query, kind), factory);
|
|
100
162
|
}
|
|
101
163
|
}
|
|
102
164
|
if (entries.length === 0) {
|
|
103
165
|
if (!showStore) {
|
|
104
166
|
logInfo(
|
|
105
|
-
query ? `No entries matching "${query}".` : "No assets found. Run `skaile source sync` first."
|
|
167
|
+
query ? `No entries matching "${query}".` : kind ? `No "${kind}" assets found in this project's sources.` : "No assets found. Run `skaile source sync` first."
|
|
106
168
|
);
|
|
107
169
|
}
|
|
108
170
|
return;
|
|
@@ -120,7 +182,7 @@ function printLocalEntries(entries) {
|
|
|
120
182
|
byKind.get(e.kind).push(e);
|
|
121
183
|
}
|
|
122
184
|
for (const [k, items] of byKind) {
|
|
123
|
-
const nameW = Math.max(4, ...items.map((e) => e.
|
|
185
|
+
const nameW = Math.max(4, ...items.map((e) => localEntryRef(e).length));
|
|
124
186
|
console.log();
|
|
125
187
|
console.log(
|
|
126
188
|
` ${kindColor(k)} ${S.heading(`${k.toUpperCase()}S`)} ${S.dim(`(${items.length})`)}`
|
|
@@ -128,7 +190,9 @@ function printLocalEntries(entries) {
|
|
|
128
190
|
console.log(` ${S.rule(nameW + 62)}`);
|
|
129
191
|
for (const e of items) {
|
|
130
192
|
const ver = e.version ? S.dim(` v${e.version}`) : "";
|
|
131
|
-
console.log(
|
|
193
|
+
console.log(
|
|
194
|
+
` ${S.cmd(localEntryRef(e).padEnd(nameW))} ${e.description.slice(0, 60)}${ver}`
|
|
195
|
+
);
|
|
132
196
|
}
|
|
133
197
|
}
|
|
134
198
|
console.log(`
|
|
@@ -146,30 +210,33 @@ async function searchStore(query, kind, opts, airGapped) {
|
|
|
146
210
|
logInfo("air-gapped (cache_ttl: 0) \u2014 local sources only");
|
|
147
211
|
return;
|
|
148
212
|
}
|
|
213
|
+
const { openCatalogSource: openCatalogSource2, LocalCatalogDisabledError } = await import('../open-library-4HMIDK3N.js');
|
|
149
214
|
try {
|
|
150
|
-
const
|
|
151
|
-
const
|
|
152
|
-
const
|
|
153
|
-
if (
|
|
154
|
-
if (kind) params.kind = kind;
|
|
155
|
-
const storeRes = await storeFetch2(config, "/api/assets", { params });
|
|
156
|
-
if (storeRes.results.length > 0) {
|
|
215
|
+
const remote = await openCatalogSource2({ projectDir: path14__default.resolve(opts.projectDir) });
|
|
216
|
+
const assets = await remote.listAssets(kind ? { kind } : {});
|
|
217
|
+
const results = filterCatalogAssets(assets, query);
|
|
218
|
+
if (results.length > 0) {
|
|
157
219
|
console.log(`
|
|
158
220
|
${S.heading("Store:")}`);
|
|
159
|
-
for (const asset of
|
|
160
|
-
const ref =
|
|
221
|
+
for (const asset of results) {
|
|
222
|
+
const ref = catalogAssetRef(asset);
|
|
161
223
|
console.log(
|
|
162
|
-
` \u2B21 ${kindColorPad(asset.kind)} ${colorRef(ref).padEnd(
|
|
224
|
+
` \u2B21 ${kindColorPad(asset.kind)} ${colorRef(ref).padEnd(48)} ${S.dim(asset.description?.slice(0, 50) || "")}`
|
|
163
225
|
);
|
|
164
226
|
}
|
|
165
227
|
} else if (opts.store) {
|
|
166
228
|
logInfo("No results in store");
|
|
167
229
|
}
|
|
168
230
|
} catch (e) {
|
|
231
|
+
const local = e instanceof LocalCatalogDisabledError;
|
|
169
232
|
if (opts.store) {
|
|
170
|
-
logErr(
|
|
233
|
+
logErr(
|
|
234
|
+
local ? "remote catalog disabled (catalog.url: local) \u2014 set catalog.url: https://skaile.store to search the store" : `Store search failed: ${e.message}`
|
|
235
|
+
);
|
|
171
236
|
} else {
|
|
172
|
-
logInfo(
|
|
237
|
+
logInfo(
|
|
238
|
+
local ? "remote catalog disabled (catalog.url: local) \u2014 showing local results only" : "store unavailable \u2014 showing local results only (run with --store to see the error)"
|
|
239
|
+
);
|
|
173
240
|
}
|
|
174
241
|
}
|
|
175
242
|
}
|
|
@@ -1007,7 +1074,7 @@ function makeCatalogCommand() {
|
|
|
1007
1074
|
return catalog;
|
|
1008
1075
|
}
|
|
1009
1076
|
async function runLocalCatalogTest(projectDir) {
|
|
1010
|
-
const { resolveCatalogSource } = await import('../open-library-
|
|
1077
|
+
const { resolveCatalogSource } = await import('../open-library-4HMIDK3N.js');
|
|
1011
1078
|
let resolved;
|
|
1012
1079
|
try {
|
|
1013
1080
|
resolved = await resolveCatalogSource({ projectDir });
|
|
@@ -1626,8 +1693,8 @@ async function promptField(field) {
|
|
|
1626
1693
|
function makeConnectorCommand() {
|
|
1627
1694
|
const cmd = new Command("connector").description("Operate on connectors in a workspace");
|
|
1628
1695
|
cmd.command("catalog").description("List all available connector drivers and their dependencies").action(async () => {
|
|
1629
|
-
const { scanDirectory, factoryAssetRoots } = await import('../core/index.js');
|
|
1630
|
-
const entries = scanFactoryConnectors(scanDirectory,
|
|
1696
|
+
const { scanDirectory, factoryAssetRoots: factoryAssetRoots2 } = await import('../core/index.js');
|
|
1697
|
+
const entries = scanFactoryConnectors(scanDirectory, factoryAssetRoots2());
|
|
1631
1698
|
if (entries.length === 0) {
|
|
1632
1699
|
console.log("No connector descriptors found.");
|
|
1633
1700
|
return;
|
|
@@ -1651,14 +1718,14 @@ function makeConnectorCommand() {
|
|
|
1651
1718
|
cmd.command("add <driver>").option("--id <id>", "Connector instance ID (defaults to driver name)").option("--access <level>", "Access level: read-only | read-write", "read-only").option("--no-install", "Skip npm dependency installation").option("--project-dir <path>", "Workspace directory", process.cwd()).description("Add a connector to skaile.yaml and install its npm deps").action(
|
|
1652
1719
|
async (driver, opts) => {
|
|
1653
1720
|
const { installNpmPackages } = await import('../connectors/index.js');
|
|
1654
|
-
const { scanDirectory, factoryAssetRoots, WorkspaceYamlEditor: WorkspaceYamlEditor2 } = await import('../core/index.js');
|
|
1721
|
+
const { scanDirectory, factoryAssetRoots: factoryAssetRoots2, WorkspaceYamlEditor: WorkspaceYamlEditor2 } = await import('../core/index.js');
|
|
1655
1722
|
const projectDir = path14__default.resolve(opts.projectDir);
|
|
1656
1723
|
const yamlPath = path14__default.join(projectDir, "skaile.yaml");
|
|
1657
1724
|
if (!existsSync(yamlPath)) {
|
|
1658
1725
|
logErr("No skaile.yaml found in current directory. Run 'skaile init' first.");
|
|
1659
1726
|
process.exit(1);
|
|
1660
1727
|
}
|
|
1661
|
-
const entries = scanFactoryConnectors(scanDirectory,
|
|
1728
|
+
const entries = scanFactoryConnectors(scanDirectory, factoryAssetRoots2());
|
|
1662
1729
|
const entry = entries.find((e) => e.name === driver);
|
|
1663
1730
|
if (!entry) {
|
|
1664
1731
|
logErr(
|
|
@@ -1997,7 +2064,7 @@ async function ensureTargetsRegistered(projectDir) {
|
|
|
1997
2064
|
const { resolveSkWorkspaceConfig: resolveSkWorkspaceConfig2 } = await import('../core/index.js');
|
|
1998
2065
|
const config = resolveSkWorkspaceConfig2(projectDir);
|
|
1999
2066
|
if (config.plugins && config.plugins.length > 0) {
|
|
2000
|
-
const { ensurePluginsLoaded } = await import('../plugin-store-
|
|
2067
|
+
const { ensurePluginsLoaded } = await import('../plugin-store-S7OMGI7N.js');
|
|
2001
2068
|
const result = await ensurePluginsLoaded(projectDir, config.plugins, pluginRegistry);
|
|
2002
2069
|
for (const f of result.failed) logWarn(f.error);
|
|
2003
2070
|
}
|
|
@@ -2802,11 +2869,6 @@ function makeIntegrationCommand() {
|
|
|
2802
2869
|
cmd.action(() => cmd.help());
|
|
2803
2870
|
return cmd;
|
|
2804
2871
|
}
|
|
2805
|
-
var NOT_WIRED_MSG_PUBLISH = "`skaile library publish` is scaffolded but not yet wired. Server endpoint `POST /sources/<id>/manifest` lands in a follow-up PR.";
|
|
2806
|
-
function notWired(verb, msg) {
|
|
2807
|
-
logErr(`${msg} (verb: library ${verb})`);
|
|
2808
|
-
process.exit(2);
|
|
2809
|
-
}
|
|
2810
2872
|
function makeLibraryCommand() {
|
|
2811
2873
|
const cmd = new Command("library").description("Manage user authoring libraries (local / git)");
|
|
2812
2874
|
cmd.command("list").description("List all registered libraries").option("--json", "Output as JSON").action(async (opts) => {
|
|
@@ -3182,9 +3244,20 @@ function makeLibraryCommand() {
|
|
|
3182
3244
|
close();
|
|
3183
3245
|
}
|
|
3184
3246
|
});
|
|
3185
|
-
cmd.command("publish <
|
|
3186
|
-
|
|
3187
|
-
|
|
3247
|
+
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(
|
|
3248
|
+
async (lib, opts) => {
|
|
3249
|
+
const { runLibraryPublish } = await import('../library-publish-K5IBE44D.js');
|
|
3250
|
+
await runLibraryPublish(lib, opts);
|
|
3251
|
+
}
|
|
3252
|
+
);
|
|
3253
|
+
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) => {
|
|
3254
|
+
const { runLibraryRegister } = await import('../library-publish-K5IBE44D.js');
|
|
3255
|
+
await runLibraryRegister(lib, opts);
|
|
3256
|
+
});
|
|
3257
|
+
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) => {
|
|
3258
|
+
const { runLibraryYank } = await import('../library-publish-K5IBE44D.js');
|
|
3259
|
+
await runLibraryYank(lib, opts);
|
|
3260
|
+
});
|
|
3188
3261
|
return cmd;
|
|
3189
3262
|
}
|
|
3190
3263
|
async function printPerLibraryStatus(name, asJson) {
|
|
@@ -3713,7 +3786,7 @@ async function previewSoftDepsUnderCursor() {
|
|
|
3713
3786
|
}
|
|
3714
3787
|
async function loadAssets() {
|
|
3715
3788
|
softDepPreviewCache.clear();
|
|
3716
|
-
const { gatherAssetFeeds } = await import('../asset-feeds-
|
|
3789
|
+
const { gatherAssetFeeds } = await import('../asset-feeds-T35ELX2O.js');
|
|
3717
3790
|
const { entries, domains, notes } = await gatherAssetFeeds(am, am.projectDir);
|
|
3718
3791
|
if (notes.length > 0) {
|
|
3719
3792
|
state.message = notes.map((n) => `[${n.feed}] ${n.message}`).join(" \u2022 ");
|
|
@@ -3880,7 +3953,7 @@ function reconcileCollapsedSets(rows) {
|
|
|
3880
3953
|
async function loadSourcesAndLibraries() {
|
|
3881
3954
|
try {
|
|
3882
3955
|
const [{ openLibraryManager: openLibraryManager2 }, { skaileHomeDir }, { getGlobalCacheDir: getGlobalCacheDir2 }] = await Promise.all([
|
|
3883
|
-
import('../open-library-
|
|
3956
|
+
import('../open-library-4HMIDK3N.js'),
|
|
3884
3957
|
import('../library/index.js'),
|
|
3885
3958
|
import('../core/index.js')
|
|
3886
3959
|
]);
|
|
@@ -4749,8 +4822,8 @@ function makeManageCommand() {
|
|
|
4749
4822
|
}
|
|
4750
4823
|
function makeMcpServerCommand() {
|
|
4751
4824
|
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) => {
|
|
4752
|
-
const
|
|
4753
|
-
const projectDir =
|
|
4825
|
+
const path37 = await import('path');
|
|
4826
|
+
const projectDir = path37.default.resolve(opts.projectDir);
|
|
4754
4827
|
const { LogStore, StdoutSink, registerLogStore } = await import('../core/logging.js');
|
|
4755
4828
|
registerLogStore(
|
|
4756
4829
|
new LogStore({
|
|
@@ -4966,7 +5039,7 @@ function action2(fn) {
|
|
|
4966
5039
|
};
|
|
4967
5040
|
}
|
|
4968
5041
|
async function reconcileAndReport(projectDir, plugins) {
|
|
4969
|
-
const { reconcilePlugins } = await import('../plugin-store-
|
|
5042
|
+
const { reconcilePlugins } = await import('../plugin-store-S7OMGI7N.js');
|
|
4970
5043
|
if (plugins.length === 0) {
|
|
4971
5044
|
logInfo("No plugins declared \u2014 nothing to reconcile.");
|
|
4972
5045
|
return;
|
|
@@ -4982,7 +5055,7 @@ async function reconcileAndReport(projectDir, plugins) {
|
|
|
4982
5055
|
async function runInstall2(spec, opts) {
|
|
4983
5056
|
const projectDir = path14__default.resolve(opts.projectDir);
|
|
4984
5057
|
const { WorkspaceYamlEditor: WorkspaceYamlEditor2 } = await import('../core/index.js');
|
|
4985
|
-
const { specName } = await import('../plugin-store-
|
|
5058
|
+
const { specName } = await import('../plugin-store-S7OMGI7N.js');
|
|
4986
5059
|
const yamlPath = path14__default.join(projectDir, "skaile.yaml");
|
|
4987
5060
|
const editor = WorkspaceYamlEditor2.load(yamlPath);
|
|
4988
5061
|
const replaced = editor.addPlugin(spec, specName);
|
|
@@ -4994,7 +5067,7 @@ async function runInstall2(spec, opts) {
|
|
|
4994
5067
|
async function runRemove(name, opts) {
|
|
4995
5068
|
const projectDir = path14__default.resolve(opts.projectDir);
|
|
4996
5069
|
const { WorkspaceYamlEditor: WorkspaceYamlEditor2 } = await import('../core/index.js');
|
|
4997
|
-
const { specName } = await import('../plugin-store-
|
|
5070
|
+
const { specName } = await import('../plugin-store-S7OMGI7N.js');
|
|
4998
5071
|
const yamlPath = path14__default.join(projectDir, "skaile.yaml");
|
|
4999
5072
|
const editor = WorkspaceYamlEditor2.load(yamlPath);
|
|
5000
5073
|
const removed = editor.removePlugin(name, specName);
|
|
@@ -5022,7 +5095,7 @@ async function runList(opts) {
|
|
|
5022
5095
|
const registry = createPluginRegistry();
|
|
5023
5096
|
if (declared.length > 0) {
|
|
5024
5097
|
try {
|
|
5025
|
-
const { loadPlugins } = await import('../plugin-store-
|
|
5098
|
+
const { loadPlugins } = await import('../plugin-store-S7OMGI7N.js');
|
|
5026
5099
|
const result = await loadPlugins(projectDir, declared, registry);
|
|
5027
5100
|
for (const f of result.failed) logWarn(f.error);
|
|
5028
5101
|
} catch (err) {
|
|
@@ -5219,7 +5292,7 @@ async function runRefInstall(ref, opts) {
|
|
|
5219
5292
|
const spinner5 = p6.spinner();
|
|
5220
5293
|
spinner5.start(`Installing ${ref}`);
|
|
5221
5294
|
try {
|
|
5222
|
-
const { openCatalogSource: openCatalogSource2, openLibrary: openLibrary2 } = await import('../open-library-
|
|
5295
|
+
const { openCatalogSource: openCatalogSource2, openLibrary: openLibrary2 } = await import('../open-library-4HMIDK3N.js');
|
|
5223
5296
|
const catalog = await openCatalogSource2({ projectDir: path14__default.resolve(opts.projectDir) });
|
|
5224
5297
|
if (!supportsInstallManifest(catalog)) {
|
|
5225
5298
|
throw new Error(
|
|
@@ -5234,6 +5307,9 @@ async function runRefInstall(ref, opts) {
|
|
|
5234
5307
|
logInfo(`Path: ${S.dim(result.installPath)}`);
|
|
5235
5308
|
logInfo(`Commit: ${S.dim(result.commitSha)}`);
|
|
5236
5309
|
logInfo(`Files: ${S.dim(String(result.fileCount))}`);
|
|
5310
|
+
logInfo(
|
|
5311
|
+
S.dim(`Installed globally (see Path above) \u2014 use \`skaile add ${ref}\` to deploy into this project.`)
|
|
5312
|
+
);
|
|
5237
5313
|
} finally {
|
|
5238
5314
|
library.close();
|
|
5239
5315
|
}
|
|
@@ -5256,7 +5332,7 @@ async function runYamlInstall(opts) {
|
|
|
5256
5332
|
return;
|
|
5257
5333
|
}
|
|
5258
5334
|
try {
|
|
5259
|
-
const { ensureSourcesCloned } = await import('../ensure-sources-
|
|
5335
|
+
const { ensureSourcesCloned } = await import('../ensure-sources-QDVFUIUP.js');
|
|
5260
5336
|
const hydrate = ensureSourcesCloned(projectDir, { quiet: true });
|
|
5261
5337
|
if (hydrate.cloned.length > 0) {
|
|
5262
5338
|
logOk(`Cloned source(s): ${hydrate.cloned.join(", ")}`);
|
|
@@ -5412,8 +5488,6 @@ function makeCleanCommand() {
|
|
|
5412
5488
|
}
|
|
5413
5489
|
});
|
|
5414
5490
|
}
|
|
5415
|
-
|
|
5416
|
-
// cli/src/commands/preset-export.ts
|
|
5417
5491
|
function buildPresetFromWorkspace(config, name, sources = []) {
|
|
5418
5492
|
const items = [];
|
|
5419
5493
|
for (const ref of config.dependencies ?? []) {
|
|
@@ -5465,6 +5539,10 @@ function neededSources(config, lock) {
|
|
|
5465
5539
|
const inClosure = new Set(lock.sources.map((s) => normalizeRepoUrl(s.url)));
|
|
5466
5540
|
return nonFactory.filter((s) => inClosure.has(normalizeRepoUrl(s.url)));
|
|
5467
5541
|
}
|
|
5542
|
+
function sourcesWithSidecar(sources) {
|
|
5543
|
+
const dir = getStoreManifestsDir();
|
|
5544
|
+
return sources.filter((s) => existsSync(path14.join(dir, `${storeManifestSlug(s.url)}.yaml`))).map((s) => s.url);
|
|
5545
|
+
}
|
|
5468
5546
|
function compact(obj) {
|
|
5469
5547
|
const out = {};
|
|
5470
5548
|
for (const [k, v] of Object.entries(obj)) {
|
|
@@ -5555,8 +5633,8 @@ function redactSecrets(preset, findings) {
|
|
|
5555
5633
|
}
|
|
5556
5634
|
return { preset: next, keys };
|
|
5557
5635
|
}
|
|
5558
|
-
function placeholderKey(itemId,
|
|
5559
|
-
return `${itemId}_${
|
|
5636
|
+
function placeholderKey(itemId, path37) {
|
|
5637
|
+
return `${itemId}_${path37}`.replace(/[^a-zA-Z0-9]+/g, "_").replace(/^_+|_+$/g, "").toUpperCase();
|
|
5560
5638
|
}
|
|
5561
5639
|
function setAtPath(root, segments, value) {
|
|
5562
5640
|
let node = root;
|
|
@@ -5632,7 +5710,15 @@ async function runPresetExport(name, opts) {
|
|
|
5632
5710
|
}
|
|
5633
5711
|
const strippedCreds = sources.filter((s) => urlHasCredentials(s.url)).length;
|
|
5634
5712
|
if (strippedCreds > 0) {
|
|
5635
|
-
logWarn(
|
|
5713
|
+
logWarn(
|
|
5714
|
+
`Stripped credentials from ${strippedCreds} source URL(s) \u2014 resolved via git auth on apply.`
|
|
5715
|
+
);
|
|
5716
|
+
}
|
|
5717
|
+
const sidecarSources = sourcesWithSidecar(sources);
|
|
5718
|
+
if (sidecarSources.length > 0) {
|
|
5719
|
+
logWarn(
|
|
5720
|
+
`${sidecarSources.length} captured source(s) rely on a MACHINE-LOCAL sidecar overlay (\`~/.skaile/store/manifests/*\`) \u2014 assets may not resolve on other machines or when this preset is shared, until the sidecar manifest is published: ${sidecarSources.join(", ")}`
|
|
5721
|
+
);
|
|
5636
5722
|
}
|
|
5637
5723
|
let preset = buildPresetFromWorkspace(file.config, presetName, sources);
|
|
5638
5724
|
if (preset.items.length === 0) {
|
|
@@ -5877,9 +5963,13 @@ function printApplySummary(summary, envVarsToSet) {
|
|
|
5877
5963
|
];
|
|
5878
5964
|
for (const line of skipped) logWarn(`Skipped ${line}`);
|
|
5879
5965
|
const unchanged = summary.unchangedConnectors.length + summary.unchangedMcp.length + summary.unchangedSources.length;
|
|
5880
|
-
if (unchanged > 0)
|
|
5966
|
+
if (unchanged > 0)
|
|
5967
|
+
logInfo(`${unchanged} source/connector/mcp entry(ies) already matched \u2014 left as-is.`);
|
|
5881
5968
|
if (envVarsToSet.length > 0) {
|
|
5882
|
-
logWarn(
|
|
5969
|
+
logWarn(
|
|
5970
|
+
`This preset references secrets by env var \u2014 provide them before running: ${envVarsToSet.join(", ")}`
|
|
5971
|
+
);
|
|
5972
|
+
logInfo("Add them to .env (gitignored) or export in your shell, e.g. export <VAR>=\u2026");
|
|
5883
5973
|
}
|
|
5884
5974
|
}
|
|
5885
5975
|
async function runPresetInstall(projectDir) {
|
|
@@ -5948,6 +6038,7 @@ async function checkPresetPlaceholders(allPlaceholders) {
|
|
|
5948
6038
|
const { validatePlaceholder } = await import('../library/index.js');
|
|
5949
6039
|
const invalidEntries = [];
|
|
5950
6040
|
for (const ph of allPlaceholders) {
|
|
6041
|
+
if (ph.default === void 0) continue;
|
|
5951
6042
|
const result = validatePlaceholder(ph, ph.default);
|
|
5952
6043
|
if (!result.valid) {
|
|
5953
6044
|
invalidEntries.push({ key: ph.key, errors: result.errors });
|
|
@@ -6073,6 +6164,21 @@ function makeRebuildCommand() {
|
|
|
6073
6164
|
logInfo(`Written: ${result.manifestPath}`);
|
|
6074
6165
|
});
|
|
6075
6166
|
}
|
|
6167
|
+
|
|
6168
|
+
// cli/src/driver-error.ts
|
|
6169
|
+
function friendlyDriverError(err) {
|
|
6170
|
+
const e = err;
|
|
6171
|
+
if (!e) return null;
|
|
6172
|
+
const isSpawnEnoent = e.code === "ENOENT" && (e.syscall?.startsWith("spawn") === true || /^spawn .*ENOENT/.test(e.message ?? ""));
|
|
6173
|
+
const isConfig = e.category === "config" || e.detail?.category === "config";
|
|
6174
|
+
if (!isSpawnEnoent && !isConfig) return null;
|
|
6175
|
+
const hint = e.hint ?? e.detail?.hint;
|
|
6176
|
+
const base = hint ?? "The configured agent binary is not installed or not on your PATH.";
|
|
6177
|
+
return `${base}
|
|
6178
|
+
Try a different backend with \`--driver claude-sdk\`.`;
|
|
6179
|
+
}
|
|
6180
|
+
|
|
6181
|
+
// cli/src/commands/run.ts
|
|
6076
6182
|
function makeFlowEventHandler() {
|
|
6077
6183
|
const md = new MarkdownStreamer();
|
|
6078
6184
|
const displayed = /* @__PURE__ */ new Set();
|
|
@@ -6158,14 +6264,24 @@ function makeRunCommand() {
|
|
|
6158
6264
|
}
|
|
6159
6265
|
process.exit(1);
|
|
6160
6266
|
}
|
|
6161
|
-
|
|
6162
|
-
|
|
6163
|
-
|
|
6164
|
-
|
|
6165
|
-
|
|
6166
|
-
|
|
6167
|
-
|
|
6168
|
-
|
|
6267
|
+
try {
|
|
6268
|
+
await runAgentChat({
|
|
6269
|
+
projectDir,
|
|
6270
|
+
driver: config.driver,
|
|
6271
|
+
model: config.model,
|
|
6272
|
+
provider: config.provider,
|
|
6273
|
+
message: textPrompt,
|
|
6274
|
+
skill: opts.skill
|
|
6275
|
+
});
|
|
6276
|
+
} catch (err) {
|
|
6277
|
+
const friendly = friendlyDriverError(err);
|
|
6278
|
+
if (friendly) {
|
|
6279
|
+
logErr(friendly);
|
|
6280
|
+
} else {
|
|
6281
|
+
logErr(err instanceof Error ? err.message : String(err));
|
|
6282
|
+
}
|
|
6283
|
+
process.exit(1);
|
|
6284
|
+
}
|
|
6169
6285
|
return;
|
|
6170
6286
|
}
|
|
6171
6287
|
let flow;
|
|
@@ -6184,17 +6300,23 @@ function makeRunCommand() {
|
|
|
6184
6300
|
if (opts.label) console.log(` ${S.label("Label:")} ${opts.label}`);
|
|
6185
6301
|
if (dryRun) console.log(` ${S.warn("(dry run \u2014 no agent will be started)")}`);
|
|
6186
6302
|
console.log();
|
|
6187
|
-
|
|
6188
|
-
|
|
6189
|
-
|
|
6190
|
-
|
|
6191
|
-
|
|
6192
|
-
|
|
6193
|
-
|
|
6194
|
-
|
|
6195
|
-
|
|
6196
|
-
|
|
6197
|
-
|
|
6303
|
+
try {
|
|
6304
|
+
await runFlow({
|
|
6305
|
+
projectDir,
|
|
6306
|
+
flowPath,
|
|
6307
|
+
driver,
|
|
6308
|
+
model,
|
|
6309
|
+
provider,
|
|
6310
|
+
sessionLabel: opts.label,
|
|
6311
|
+
dryRun,
|
|
6312
|
+
onEvent: makeFlowEventHandler(),
|
|
6313
|
+
onLog: (line) => console.log(line)
|
|
6314
|
+
});
|
|
6315
|
+
} catch (err) {
|
|
6316
|
+
const friendly = friendlyDriverError(err);
|
|
6317
|
+
logErr(friendly ?? (err instanceof Error ? err.message : String(err)));
|
|
6318
|
+
process.exit(1);
|
|
6319
|
+
}
|
|
6198
6320
|
});
|
|
6199
6321
|
return cmd;
|
|
6200
6322
|
}
|
|
@@ -6336,12 +6458,12 @@ function makeServeCommand() {
|
|
|
6336
6458
|
);
|
|
6337
6459
|
}
|
|
6338
6460
|
async function ensurePluginsLoadedForServe(projectDir) {
|
|
6339
|
-
const { logInfo: logInfo2, logWarn: logWarn2 } = await import('../helpers-
|
|
6461
|
+
const { logInfo: logInfo2, logWarn: logWarn2 } = await import('../helpers-TF7GCBRQ.js');
|
|
6340
6462
|
try {
|
|
6341
6463
|
const { resolveSkWorkspaceConfig: resolveSkWorkspaceConfig2 } = await import('../core/index.js');
|
|
6342
6464
|
const config = resolveSkWorkspaceConfig2(projectDir);
|
|
6343
6465
|
if (!config.plugins || config.plugins.length === 0) return;
|
|
6344
|
-
const { ensurePluginsLoaded } = await import('../plugin-store-
|
|
6466
|
+
const { ensurePluginsLoaded } = await import('../plugin-store-S7OMGI7N.js');
|
|
6345
6467
|
const { pluginRegistry } = await import('../plugin-registry/index.js');
|
|
6346
6468
|
const result = await ensurePluginsLoaded(projectDir, config.plugins, pluginRegistry);
|
|
6347
6469
|
if (result.loaded.length > 0) {
|
|
@@ -6355,21 +6477,21 @@ async function ensurePluginsLoadedForServe(projectDir) {
|
|
|
6355
6477
|
}
|
|
6356
6478
|
}
|
|
6357
6479
|
async function runCompileTest(opts) {
|
|
6358
|
-
const { logOk: logOk2, logErr: logErr2, logInfo: logInfo2, S: S2 } = await import('../helpers-
|
|
6480
|
+
const { logOk: logOk2, logErr: logErr2, logInfo: logInfo2, S: S2 } = await import('../helpers-TF7GCBRQ.js');
|
|
6359
6481
|
const { tmpdir } = await import('os');
|
|
6360
|
-
const { dirname: dirname4, join:
|
|
6482
|
+
const { dirname: dirname4, join: join6, resolve: resolve5 } = await import('path');
|
|
6361
6483
|
const { fileURLToPath: fileURLToPath2 } = await import('url');
|
|
6362
|
-
const { unlinkSync, existsSync:
|
|
6484
|
+
const { unlinkSync, existsSync: existsSync14 } = await import('fs');
|
|
6363
6485
|
const { spawn } = await import('child_process');
|
|
6364
6486
|
const { portableSpawnSync: portableSpawnSync2 } = await import('../core/index.js');
|
|
6365
|
-
const { MONOREPO_ROOT } = await import('../paths-
|
|
6487
|
+
const { MONOREPO_ROOT } = await import('../paths-P3DWFUPS.js');
|
|
6366
6488
|
if (MONOREPO_ROOT === null) {
|
|
6367
6489
|
logErr2("--compile-test is only available inside the skaile-dev workspace.");
|
|
6368
6490
|
logInfo2("Run it from a checkout of skaile-ai/skaile-dev (the monorepo shell).");
|
|
6369
6491
|
process.exitCode = 2;
|
|
6370
6492
|
return;
|
|
6371
6493
|
}
|
|
6372
|
-
const outfile =
|
|
6494
|
+
const outfile = join6(tmpdir(), `skaile-compile-test-${Date.now()}`);
|
|
6373
6495
|
const __thisFile = fileURLToPath2(import.meta.url);
|
|
6374
6496
|
const entryPoint = resolve5(dirname4(__thisFile), "..", "index.ts");
|
|
6375
6497
|
logInfo2(`Building compiled binary...`);
|
|
@@ -6421,7 +6543,7 @@ async function runCompileTest(opts) {
|
|
|
6421
6543
|
} catch {
|
|
6422
6544
|
}
|
|
6423
6545
|
try {
|
|
6424
|
-
if (
|
|
6546
|
+
if (existsSync14(outfile)) unlinkSync(outfile);
|
|
6425
6547
|
} catch {
|
|
6426
6548
|
}
|
|
6427
6549
|
}
|
|
@@ -7175,96 +7297,37 @@ function makeShowCommand() {
|
|
|
7175
7297
|
}
|
|
7176
7298
|
});
|
|
7177
7299
|
}
|
|
7300
|
+
async function fetchIdentity() {
|
|
7301
|
+
const jwt = await getStoreToken();
|
|
7302
|
+
return storeFetch({ ...getStoreConfig(), jwt }, "/api/v1/me");
|
|
7303
|
+
}
|
|
7178
7304
|
function makeStoreCommand() {
|
|
7179
7305
|
const store = new Command("store").description("Manage the AI Asset Store");
|
|
7180
|
-
store.command("login").description("
|
|
7181
|
-
|
|
7182
|
-
|
|
7183
|
-
const
|
|
7184
|
-
|
|
7185
|
-
|
|
7186
|
-
|
|
7187
|
-
|
|
7188
|
-
resolve5(answer);
|
|
7189
|
-
});
|
|
7190
|
-
});
|
|
7191
|
-
try {
|
|
7192
|
-
const res = await storeFetch(
|
|
7193
|
-
config,
|
|
7194
|
-
"/api/auth/login",
|
|
7195
|
-
{ method: "POST", body: { email: opts.email, password } }
|
|
7196
|
-
);
|
|
7197
|
-
saveStoreTokens(res.jwt, res.refreshToken);
|
|
7198
|
-
logOk(`Logged in as ${S.brand(`@${res.publisher.slug}`)}`);
|
|
7199
|
-
} catch (e) {
|
|
7200
|
-
logErr(e.message);
|
|
7201
|
-
process.exit(1);
|
|
7202
|
-
}
|
|
7203
|
-
} else {
|
|
7204
|
-
const loginUrl = `${config.url}/api/auth/login/github`;
|
|
7205
|
-
console.log(`
|
|
7206
|
-
Opening browser to authenticate...
|
|
7207
|
-
${S.dim(loginUrl)}
|
|
7208
|
-
`);
|
|
7209
|
-
const http = await import('http');
|
|
7210
|
-
const { URL: URL2 } = await import('url');
|
|
7211
|
-
const server = http.createServer((req, res) => {
|
|
7212
|
-
const url = new URL2(req.url ?? "/", "http://localhost");
|
|
7213
|
-
const jwt = url.searchParams.get("token");
|
|
7214
|
-
const refresh = url.searchParams.get("refresh");
|
|
7215
|
-
if (jwt && refresh) {
|
|
7216
|
-
saveStoreTokens(jwt, refresh);
|
|
7217
|
-
res.writeHead(200, { "Content-Type": "text/html" });
|
|
7218
|
-
res.end("<h2>Authenticated! You can close this tab.</h2>");
|
|
7219
|
-
logOk("Authenticated with the store");
|
|
7220
|
-
server.close();
|
|
7221
|
-
} else {
|
|
7222
|
-
res.writeHead(400);
|
|
7223
|
-
res.end("Missing tokens");
|
|
7224
|
-
}
|
|
7225
|
-
});
|
|
7226
|
-
server.listen(0, () => {
|
|
7227
|
-
const port = server.address()?.port;
|
|
7228
|
-
const open = process.platform === "darwin" ? "open" : process.platform === "win32" ? "start" : "xdg-open";
|
|
7229
|
-
import('child_process').then(({ exec }) => {
|
|
7230
|
-
exec(`${open} "${loginUrl}"`);
|
|
7231
|
-
});
|
|
7232
|
-
console.log(` ${S.dim(`Listening on http://localhost:${port} for callback...`)}`);
|
|
7233
|
-
});
|
|
7234
|
-
setTimeout(() => {
|
|
7235
|
-
logErr("Login timed out");
|
|
7236
|
-
server.close();
|
|
7237
|
-
process.exit(1);
|
|
7238
|
-
}, 12e4);
|
|
7306
|
+
store.command("login").description("Sign in to the store (Keycloak device flow \u2014 approve in your browser)").action(async () => {
|
|
7307
|
+
try {
|
|
7308
|
+
await deviceLogin(loadStoreAuthConfig());
|
|
7309
|
+
const me = await fetchIdentity().catch(() => ({}));
|
|
7310
|
+
logOk(`Signed in${me.username ? ` as ${S.brand(`@${me.username}`)}` : "."}`);
|
|
7311
|
+
} catch (e) {
|
|
7312
|
+
logErr(e.message);
|
|
7313
|
+
process.exit(1);
|
|
7239
7314
|
}
|
|
7240
7315
|
});
|
|
7241
|
-
store.command("logout").description("Sign out of the store").action(
|
|
7242
|
-
|
|
7243
|
-
|
|
7244
|
-
try {
|
|
7245
|
-
await storeFetch(config, "/api/auth/logout", {
|
|
7246
|
-
method: "POST",
|
|
7247
|
-
body: { refreshToken: config.refreshToken }
|
|
7248
|
-
});
|
|
7249
|
-
} catch {
|
|
7250
|
-
}
|
|
7251
|
-
}
|
|
7252
|
-
clearStoreTokens();
|
|
7253
|
-
logOk("Logged out");
|
|
7316
|
+
store.command("logout").description("Sign out of the store").action(() => {
|
|
7317
|
+
logout(loadStoreAuthConfig());
|
|
7318
|
+
logOk("Signed out.");
|
|
7254
7319
|
});
|
|
7255
7320
|
store.command("whoami").description("Show current store identity").action(async () => {
|
|
7256
|
-
|
|
7257
|
-
|
|
7258
|
-
logErr("Not authenticated. Run: skaile store login");
|
|
7321
|
+
if (!hasStoredAuth(loadStoreAuthConfig())) {
|
|
7322
|
+
logErr("Not signed in. Run: skaile store login");
|
|
7259
7323
|
process.exit(1);
|
|
7260
7324
|
}
|
|
7261
7325
|
try {
|
|
7262
|
-
const me = await
|
|
7326
|
+
const me = await fetchIdentity();
|
|
7263
7327
|
console.log();
|
|
7264
|
-
console.log(` ${S.heading("Publisher")} ${S.brand(`@${me.
|
|
7265
|
-
console.log(` ${S.label("
|
|
7266
|
-
console.log(` ${S.label("
|
|
7267
|
-
console.log(` ${S.label("Verified")} ${me.verified ? S.ok("yes") : S.dim("no")}`);
|
|
7328
|
+
console.log(` ${S.heading("Publisher")} ${S.brand(`@${me.username ?? "?"}`)}`);
|
|
7329
|
+
if (me.githubLogin) console.log(` ${S.label("GitHub")} ${me.githubLogin}`);
|
|
7330
|
+
if (me.roles?.length) console.log(` ${S.label("Roles")} ${me.roles.join(", ")}`);
|
|
7268
7331
|
console.log();
|
|
7269
7332
|
} catch (e) {
|
|
7270
7333
|
logErr(e.message);
|
|
@@ -7302,9 +7365,8 @@ function makeStoreCommand() {
|
|
|
7302
7365
|
process.exit(2);
|
|
7303
7366
|
});
|
|
7304
7367
|
store.command("yank <version>").description("Yank (soft-delete) a published version").option("--asset <ref>", "Asset reference (@publisher/slug)").action(async (version, opts) => {
|
|
7305
|
-
|
|
7306
|
-
|
|
7307
|
-
logErr("Not authenticated. Run: skaile store login");
|
|
7368
|
+
if (!isStoreAuthenticated()) {
|
|
7369
|
+
logErr("Not signed in. Run: skaile store login");
|
|
7308
7370
|
process.exit(1);
|
|
7309
7371
|
}
|
|
7310
7372
|
if (!opts.asset) {
|
|
@@ -7318,7 +7380,8 @@ function makeStoreCommand() {
|
|
|
7318
7380
|
process.exit(1);
|
|
7319
7381
|
}
|
|
7320
7382
|
try {
|
|
7321
|
-
await
|
|
7383
|
+
const jwt = await getStoreToken();
|
|
7384
|
+
await storeFetch({ ...getStoreConfig(), jwt }, `/api/assets/${publisher}/${slug}/${version}/yank`, {
|
|
7322
7385
|
method: "PATCH"
|
|
7323
7386
|
});
|
|
7324
7387
|
logOk(`Yanked v${version} of @${publisher}/${slug}`);
|
|
@@ -8191,29 +8254,29 @@ async function runInit(projectDir, opts) {
|
|
|
8191
8254
|
const resolved = path14__default.resolve(projectDir ?? ".");
|
|
8192
8255
|
const projectName = path14__default.basename(resolved);
|
|
8193
8256
|
const created = [];
|
|
8194
|
-
const { existsSync:
|
|
8195
|
-
if (!
|
|
8257
|
+
const { existsSync: existsSync14 } = await import('fs');
|
|
8258
|
+
if (!existsSync14(resolved)) {
|
|
8196
8259
|
mkdirSync5(resolved, { recursive: true });
|
|
8197
8260
|
created.push(".");
|
|
8198
8261
|
}
|
|
8199
8262
|
const skaileDir = path14__default.join(resolved, ".skaile");
|
|
8200
|
-
if (!
|
|
8263
|
+
if (!existsSync14(skaileDir)) {
|
|
8201
8264
|
mkdirSync5(path14__default.join(skaileDir, "sessions"), { recursive: true });
|
|
8202
8265
|
created.push(".skaile/");
|
|
8203
8266
|
}
|
|
8204
8267
|
const settingsPath = path14__default.join(skaileDir, "settings.json");
|
|
8205
|
-
if (!
|
|
8268
|
+
if (!existsSync14(settingsPath)) {
|
|
8206
8269
|
writeFileSync4(settingsPath, "{}\n");
|
|
8207
8270
|
created.push(".skaile/settings.json");
|
|
8208
8271
|
}
|
|
8209
8272
|
const wsConfigPath = path14__default.join(resolved, "skaile.yaml");
|
|
8210
|
-
if (!
|
|
8273
|
+
if (!existsSync14(wsConfigPath)) {
|
|
8211
8274
|
writeFileSync4(wsConfigPath, stringify2(buildInitWorkspaceConfig(projectName, backend)));
|
|
8212
8275
|
created.push("skaile.yaml");
|
|
8213
8276
|
}
|
|
8214
8277
|
for (const dir of new Set(Object.values(DRIVER_TARGETS[backend].local))) {
|
|
8215
8278
|
const full = path14__default.join(resolved, dir);
|
|
8216
|
-
if (!
|
|
8279
|
+
if (!existsSync14(full)) {
|
|
8217
8280
|
mkdirSync5(full, { recursive: true });
|
|
8218
8281
|
created.push(`${dir}/`);
|
|
8219
8282
|
}
|
|
@@ -8244,7 +8307,7 @@ function buildInitWorkspaceConfig(projectName, backend) {
|
|
|
8244
8307
|
}
|
|
8245
8308
|
async function initGitScaffold(resolved, created) {
|
|
8246
8309
|
const { execSync: execSync3 } = await import('child_process');
|
|
8247
|
-
const { existsSync:
|
|
8310
|
+
const { existsSync: existsSync14, readFileSync: readFileSync8, writeFileSync: writeFileSync4 } = await import('fs');
|
|
8248
8311
|
const gitignorePath = path14__default.join(resolved, ".gitignore");
|
|
8249
8312
|
const entries = [
|
|
8250
8313
|
"node_modules/",
|
|
@@ -8260,7 +8323,7 @@ async function initGitScaffold(resolved, created) {
|
|
|
8260
8323
|
".env",
|
|
8261
8324
|
".env.local"
|
|
8262
8325
|
];
|
|
8263
|
-
const existing =
|
|
8326
|
+
const existing = existsSync14(gitignorePath) ? readFileSync8(gitignorePath, "utf-8") : "";
|
|
8264
8327
|
const have = new Set(existing.split("\n").map((l) => l.trim()));
|
|
8265
8328
|
const append = entries.filter((e) => !have.has(e));
|
|
8266
8329
|
if (append.length > 0) {
|
|
@@ -8269,7 +8332,7 @@ async function initGitScaffold(resolved, created) {
|
|
|
8269
8332
|
`);
|
|
8270
8333
|
if (!existing) created.push(".gitignore");
|
|
8271
8334
|
}
|
|
8272
|
-
if (!
|
|
8335
|
+
if (!existsSync14(path14__default.join(resolved, ".git"))) {
|
|
8273
8336
|
try {
|
|
8274
8337
|
execSync3("git init", { cwd: resolved, stdio: "pipe" });
|
|
8275
8338
|
created.push(".git/");
|
|
@@ -8299,7 +8362,7 @@ async function bootstrapUserConfig() {
|
|
|
8299
8362
|
}
|
|
8300
8363
|
async function hydrateInitSources(resolved, created) {
|
|
8301
8364
|
try {
|
|
8302
|
-
const { ensureSourcesCloned } = await import('../ensure-sources-
|
|
8365
|
+
const { ensureSourcesCloned } = await import('../ensure-sources-QDVFUIUP.js');
|
|
8303
8366
|
const hydrate = ensureSourcesCloned(resolved, { quiet: true });
|
|
8304
8367
|
for (const n of hydrate.cloned) created.push(`~/.skaile/cache/sources/${n}/`);
|
|
8305
8368
|
if (hydrate.failed.length > 0) {
|
|
@@ -8332,10 +8395,14 @@ function printInitSummary(resolved, projectDir, created) {
|
|
|
8332
8395
|
console.log(
|
|
8333
8396
|
` ${S.dim(`${step}.`)} ${S.cmd("skaile search <query>")} ${S.dim("\u2014 find assets to add")}`
|
|
8334
8397
|
);
|
|
8398
|
+
step++;
|
|
8399
|
+
console.log(
|
|
8400
|
+
` ${S.dim(`${step}.`)} ${S.cmd("skaile preset apply <file>")} ${S.dim("\u2014 apply a saved preset (assets + config) at once")}`
|
|
8401
|
+
);
|
|
8335
8402
|
console.log();
|
|
8336
8403
|
}
|
|
8337
8404
|
program.command("setup").description("Interactive provider setup wizard").action(async () => {
|
|
8338
|
-
const { cmdSetup } = await import('../setup-
|
|
8405
|
+
const { cmdSetup } = await import('../setup-2CCS63L6.js');
|
|
8339
8406
|
await cmdSetup([], { projectDir: process.cwd() });
|
|
8340
8407
|
});
|
|
8341
8408
|
program.addCommand(makeInstallCommand());
|