@skaile/workspaces 1.5.0 → 1.6.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (135) hide show
  1. package/CHANGELOG.md +117 -0
  2. package/dist/app-sdk/index.js +22 -7
  3. package/dist/app-sdk/index.js.map +1 -1
  4. package/dist/app-sdk/src/connection-params.d.ts +7 -0
  5. package/dist/app-sdk/src/connection-params.d.ts.map +1 -1
  6. package/dist/{asset-feeds-T35ELX2O.js → asset-feeds-PTZBWJEL.js} +11 -11
  7. package/dist/asset-feeds-PTZBWJEL.js.map +1 -0
  8. package/dist/asset-manager/index.js +6 -6
  9. package/dist/asset-manager/installer.js +4 -4
  10. package/dist/asset-manager/src/index.d.ts +18 -0
  11. package/dist/asset-manager/src/index.d.ts.map +1 -1
  12. package/dist/{chunk-HY33RMEA.js → chunk-5NZ56R63.js} +3 -3
  13. package/dist/{chunk-HY33RMEA.js.map → chunk-5NZ56R63.js.map} +1 -1
  14. package/dist/{chunk-ZBZQC5R7.js → chunk-7J7LQP6T.js} +3 -3
  15. package/dist/{chunk-ZBZQC5R7.js.map → chunk-7J7LQP6T.js.map} +1 -1
  16. package/dist/{chunk-RDYOU6N6.js → chunk-EA73UA42.js} +2 -2
  17. package/dist/{chunk-RDYOU6N6.js.map → chunk-EA73UA42.js.map} +1 -1
  18. package/dist/{chunk-CNSNN7N6.js → chunk-HIATVS2E.js} +5 -5
  19. package/dist/{chunk-CNSNN7N6.js.map → chunk-HIATVS2E.js.map} +1 -1
  20. package/dist/{chunk-UQKYT4V6.js → chunk-ISA7R7PK.js} +3 -3
  21. package/dist/{chunk-UQKYT4V6.js.map → chunk-ISA7R7PK.js.map} +1 -1
  22. package/dist/{chunk-BGIC25VK.js → chunk-M4UKIJ5K.js} +30 -14
  23. package/dist/chunk-M4UKIJ5K.js.map +1 -0
  24. package/dist/{chunk-FDE7XRQA.js → chunk-MWE7DEGC.js} +3 -3
  25. package/dist/{chunk-FDE7XRQA.js.map → chunk-MWE7DEGC.js.map} +1 -1
  26. package/dist/{chunk-3CHARYD4.js → chunk-MY7TSVO7.js} +95 -28
  27. package/dist/chunk-MY7TSVO7.js.map +1 -0
  28. package/dist/{chunk-DMG6NJH7.js → chunk-NRWDQBZ7.js} +4 -4
  29. package/dist/{chunk-DMG6NJH7.js.map → chunk-NRWDQBZ7.js.map} +1 -1
  30. package/dist/{chunk-WYGXYGJH.js → chunk-NTYCGPZ3.js} +9 -9
  31. package/dist/{chunk-WYGXYGJH.js.map → chunk-NTYCGPZ3.js.map} +1 -1
  32. package/dist/{chunk-KEQ4GLVM.js → chunk-OJ7G56I7.js} +3 -3
  33. package/dist/{chunk-KEQ4GLVM.js.map → chunk-OJ7G56I7.js.map} +1 -1
  34. package/dist/{chunk-2DWXGUZA.js → chunk-QHU6TM7D.js} +2 -2
  35. package/dist/{chunk-2DWXGUZA.js.map → chunk-QHU6TM7D.js.map} +1 -1
  36. package/dist/{chunk-KMY7HVQ6.js → chunk-SH55Z5QA.js} +3 -3
  37. package/dist/{chunk-KMY7HVQ6.js.map → chunk-SH55Z5QA.js.map} +1 -1
  38. package/dist/{chunk-JIDKX7GC.js → chunk-SNN6O7ON.js} +4 -4
  39. package/dist/{chunk-JIDKX7GC.js.map → chunk-SNN6O7ON.js.map} +1 -1
  40. package/dist/{chunk-6NR2BEIY.js → chunk-STQOPWPS.js} +4 -4
  41. package/dist/{chunk-6NR2BEIY.js.map → chunk-STQOPWPS.js.map} +1 -1
  42. package/dist/{chunk-2ZMO4CFG.js → chunk-VK24PIAB.js} +5 -4
  43. package/dist/chunk-VK24PIAB.js.map +1 -0
  44. package/dist/{chunk-RSYV7XEN.js → chunk-X7G2CCW4.js} +4 -4
  45. package/dist/{chunk-RSYV7XEN.js.map → chunk-X7G2CCW4.js.map} +1 -1
  46. package/dist/{chunk-J5TI55E7.js → chunk-Y5B5272E.js} +23 -7
  47. package/dist/chunk-Y5B5272E.js.map +1 -0
  48. package/dist/cli/index.js +546 -180
  49. package/dist/cli/index.js.map +1 -1
  50. package/dist/cli/src/asset-feeds.d.ts.map +1 -1
  51. package/dist/cli/src/commands/asset-cmd.d.ts.map +1 -1
  52. package/dist/cli/src/commands/library-cmd.d.ts.map +1 -1
  53. package/dist/cli/src/commands/library-index.d.ts +49 -0
  54. package/dist/cli/src/commands/library-index.d.ts.map +1 -0
  55. package/dist/cli/src/commands/library-publish.d.ts.map +1 -1
  56. package/dist/cli/src/commands/manage.d.ts +22 -1
  57. package/dist/cli/src/commands/manage.d.ts.map +1 -1
  58. package/dist/cli/src/paths.d.ts.map +1 -1
  59. package/dist/cli/src/store-auth.d.ts.map +1 -1
  60. package/dist/cli/src/store-client.d.ts.map +1 -1
  61. package/dist/connectors/config.js +4 -4
  62. package/dist/connectors/index.js +5 -5
  63. package/dist/core/index.js +3 -3
  64. package/dist/core/runtime-assets.js +2 -2
  65. package/dist/core/src/index.d.ts +1 -1
  66. package/dist/core/src/index.d.ts.map +1 -1
  67. package/dist/core/src/repo-manager.d.ts +4 -0
  68. package/dist/core/src/repo-manager.d.ts.map +1 -1
  69. package/dist/core/workspace-config.js +1 -1
  70. package/dist/deploy/index.js +3 -3
  71. package/dist/{ensure-sources-QDVFUIUP.js → ensure-sources-ORACQA4I.js} +9 -9
  72. package/dist/{ensure-sources-QDVFUIUP.js.map → ensure-sources-ORACQA4I.js.map} +1 -1
  73. package/dist/factory-assets/connectors/box.js +5 -5
  74. package/dist/factory-assets/connectors/deploy.js +5 -5
  75. package/dist/factory-assets/connectors/devserver.js +5 -5
  76. package/dist/factory-assets/connectors/flow/adapter.js +5 -5
  77. package/dist/factory-assets/connectors/flow/engine.js +3 -3
  78. package/dist/factory-assets/connectors/flow/run-flow.js +6 -6
  79. package/dist/factory-assets/connectors/flow.js +5 -5
  80. package/dist/factory-assets/connectors/git.js +5 -5
  81. package/dist/factory-assets/connectors/gmail.js +5 -5
  82. package/dist/factory-assets/connectors/googledrive.js +5 -5
  83. package/dist/factory-assets/connectors/local.js +5 -5
  84. package/dist/factory-assets/connectors/mattermost.js +5 -5
  85. package/dist/factory-assets/connectors/memory.js +5 -5
  86. package/dist/factory-assets/connectors/minio.js +5 -5
  87. package/dist/factory-assets/connectors/postgres.js +5 -5
  88. package/dist/factory-assets/connectors/s3.js +5 -5
  89. package/dist/factory-assets/connectors/sharepoint.js +5 -5
  90. package/dist/factory-assets/connectors/sqlite.js +5 -5
  91. package/dist/factory-assets/connectors/static-server.js +5 -5
  92. package/dist/factory-assets/connectors/tunnel.js +5 -5
  93. package/dist/factory-assets/connectors/webdav.js +5 -5
  94. package/dist/factory-assets/connectors/xstate-store.js +5 -5
  95. package/dist/factory-assets/connectors/xstate.js +5 -5
  96. package/dist/{flows-MRVXTYWC.js → flows-RR6R3WBL.js} +3 -3
  97. package/dist/{flows-MRVXTYWC.js.map → flows-RR6R3WBL.js.map} +1 -1
  98. package/dist/{helpers-TF7GCBRQ.js → helpers-SXGIHFCF.js} +9 -9
  99. package/dist/{helpers-TF7GCBRQ.js.map → helpers-SXGIHFCF.js.map} +1 -1
  100. package/dist/library/index.js +4 -4
  101. package/dist/library/install.js +3 -3
  102. package/dist/{library-publish-K5IBE44D.js → library-publish-NQQFPOUY.js} +27 -19
  103. package/dist/library-publish-NQQFPOUY.js.map +1 -0
  104. package/dist/{open-library-4HMIDK3N.js → open-library-ODW2PJ2J.js} +10 -10
  105. package/dist/{open-library-4HMIDK3N.js.map → open-library-ODW2PJ2J.js.map} +1 -1
  106. package/dist/paths-KOKCMBL5.js +21 -0
  107. package/dist/{paths-P3DWFUPS.js.map → paths-KOKCMBL5.js.map} +1 -1
  108. package/dist/{plugin-store-S7OMGI7N.js → plugin-store-QMJ2B3VM.js} +5 -5
  109. package/dist/{plugin-store-S7OMGI7N.js.map → plugin-store-QMJ2B3VM.js.map} +1 -1
  110. package/dist/runner/index.js +7 -7
  111. package/dist/runner/src/capability-registry.d.ts +21 -2
  112. package/dist/runner/src/capability-registry.d.ts.map +1 -1
  113. package/dist/sdk/asset-manager.js +6 -6
  114. package/dist/sdk/core.js +3 -3
  115. package/dist/sdk/flow.js +3 -3
  116. package/dist/sdk/index.js +7 -7
  117. package/dist/sdk/runner.js +7 -7
  118. package/dist/{setup-2CCS63L6.js → setup-ETGRXSZG.js} +5 -5
  119. package/dist/{setup-2CCS63L6.js.map → setup-ETGRXSZG.js.map} +1 -1
  120. package/dist/{source-LOAM7IIQ.js → source-KPH66TXY.js} +11 -11
  121. package/dist/{source-LOAM7IIQ.js.map → source-KPH66TXY.js.map} +1 -1
  122. package/dist/{source-manifest-publish-TGVZ6KMC.js → source-manifest-publish-HJ5G4CTH.js} +13 -13
  123. package/dist/{source-manifest-publish-TGVZ6KMC.js.map → source-manifest-publish-HJ5G4CTH.js.map} +1 -1
  124. package/dist/tui/index.js +7 -7
  125. package/dist/workspace-plugin/adapters/mcp.js +1 -1
  126. package/dist/workspace-plugin/adapters/omp.js +3 -3
  127. package/dist/workspace-plugin/index.js +1 -1
  128. package/package.json +1 -1
  129. package/dist/asset-feeds-T35ELX2O.js.map +0 -1
  130. package/dist/chunk-2ZMO4CFG.js.map +0 -1
  131. package/dist/chunk-3CHARYD4.js.map +0 -1
  132. package/dist/chunk-BGIC25VK.js.map +0 -1
  133. package/dist/chunk-J5TI55E7.js.map +0 -1
  134. package/dist/library-publish-K5IBE44D.js.map +0 -1
  135. package/dist/paths-P3DWFUPS.js +0 -15
package/dist/cli/index.js CHANGED
@@ -1,15 +1,15 @@
1
1
  #!/usr/bin/env node
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';
2
+ import { AI_RESOURCES, aiResourceRoots } from '../chunk-VK24PIAB.js';
3
+ import { getStoreConfig, storeFetch, deviceLogin, loadStoreAuthConfig, logout, hasStoredAuth, isStoreAuthenticated, getStoreToken } from '../chunk-Y5B5272E.js';
4
+ import { makeSourceCommand, syncProjectSources } from '../chunk-NTYCGPZ3.js';
5
+ import { openCatalogSource, openLibraryManager, createFullRegistry, openLibrary } from '../chunk-X7G2CCW4.js';
6
+ import { logErr, S, logOk, logInfo, colorRef, logWarn, kindColorPad, kindColor, formatSoftDepSection, bareSoftDepName, formatSoftDepHint, formatRelativeTime, formatSoftDepRemovePreview, formatSoftDepAddPreview, fitWidth } from '../chunk-SH55Z5QA.js';
7
7
  import { LocalSecretsProvider } from '../chunk-6BEGKO2Q.js';
8
- import { runFlow, resumeFlow } from '../chunk-CNSNN7N6.js';
8
+ import { runFlow, resumeFlow } from '../chunk-HIATVS2E.js';
9
9
  import '../chunk-4R6DROGN.js';
10
10
  import { validateFlowVersions, parseSkillFrontmatter } from '../chunk-GXC3TYMQ.js';
11
- import { runAgentChat, loadSessionById, loadSession, listSessions, setCurrentSession, deleteSession, clearSession, loadAgentManifest, compileComposition, MarkdownStreamer, resolveMixin } from '../chunk-BGIC25VK.js';
12
- import { buildClaudePluginFiles } from '../chunk-RDYOU6N6.js';
11
+ import { runAgentChat, loadSessionById, loadSession, listSessions, setCurrentSession, deleteSession, clearSession, loadAgentManifest, compileComposition, MarkdownStreamer, resolveMixin } from '../chunk-M4UKIJ5K.js';
12
+ import { buildClaudePluginFiles } from '../chunk-EA73UA42.js';
13
13
  import '../chunk-X5YPJV4N.js';
14
14
  import '../chunk-O7SG5PC2.js';
15
15
  import '../chunk-7QBNJTTQ.js';
@@ -24,27 +24,27 @@ import '../chunk-BMQKMOQY.js';
24
24
  import '../chunk-GAH4YRCI.js';
25
25
  import '../chunk-TNSCHS4I.js';
26
26
  import '../chunk-LV2HPH3C.js';
27
- import '../chunk-DMG6NJH7.js';
28
- import '../chunk-KEQ4GLVM.js';
27
+ import '../chunk-NRWDQBZ7.js';
28
+ import '../chunk-OJ7G56I7.js';
29
29
  import '../chunk-6E6PKKAD.js';
30
30
  import { loadFlow, loadAllFlows } from '../chunk-4N5XR5DQ.js';
31
31
  import '../chunk-DEYYRFQU.js';
32
32
  import '../chunk-IFGTRL2I.js';
33
33
  import '../chunk-PK7Q7MC7.js';
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';
34
+ import { AssetManager, NON_DEPLOYABLE_KINDS, MissingManifestError, normalizeRepoUrl, FACTORY_SOURCE_URL } from '../chunk-MY7TSVO7.js';
35
+ import { resolveLibraryDir, getStoreManifestsDir, getDefaultValue, isSecretPlaceholder } from '../chunk-MWE7DEGC.js';
36
36
  import '../chunk-MZV6WCF3.js';
37
37
  import '../chunk-JXT46QFC.js';
38
38
  import '../chunk-UKJMQZV6.js';
39
39
  import '../chunk-R7FOF242.js';
40
- import '../chunk-6NR2BEIY.js';
40
+ import '../chunk-STQOPWPS.js';
41
41
  import '../chunk-CGYEHQOX.js';
42
- import { readLock, resolveSettings, globalSettingsPath, projectSettingsPath, loadSettings, saveSettings, portableSpawn, portableSpawnSync, WorkspaceYamlEditor, checkAgentSkillConformance } from '../chunk-HY33RMEA.js';
42
+ import { readLock, resolveSettings, globalSettingsPath, projectSettingsPath, loadSettings, saveSettings, portableSpawn, portableSpawnSync, WorkspaceYamlEditor, checkAgentSkillConformance } from '../chunk-5NZ56R63.js';
43
43
  import { assetSearchDirs, detectDomains } from '../chunk-ZAP2BDHG.js';
44
- import { factoryAssetRoots } from '../chunk-ZBZQC5R7.js';
45
- import { globalCacheRoot, sourceCacheKey, getGlobalCacheDir, resolveAgentDir, loadSkWorkspaceConfig, resolveSkWorkspaceConfig, storeManifestSlug } from '../chunk-UQKYT4V6.js';
44
+ import { factoryAssetRoots } from '../chunk-7J7LQP6T.js';
45
+ import { globalCacheRoot, sourceCacheKey, getGlobalCacheDir, resolveAgentDir, matchPin, coerceVersion, loadSkWorkspaceConfig, resolveSkWorkspaceConfig, storeManifestSlug } from '../chunk-ISA7R7PK.js';
46
46
  import { SKAILE_MANIFEST_FILENAME, decodeSkaileManifest, loadSkPublishManifest, saveSkPublishManifest } from '../chunk-P4VHQA4N.js';
47
- import { parseFrontmatter } from '../chunk-BQCGFPHW.js';
47
+ import { parseFrontmatter, scanDirectory } 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';
50
50
  import { SUPPORTED_DRIVER_TARGETS } from '../chunk-MENCWIHW.js';
@@ -55,12 +55,13 @@ import '../chunk-UQ6LFBPZ.js';
55
55
  import '../chunk-IEX5YV4R.js';
56
56
  import { validatePreset } from '../chunk-IRORTHGA.js';
57
57
  import '../chunk-NSBPE2FW.js';
58
- import * as fs12 from 'fs';
59
- import fs12__default, { readFileSync, existsSync, mkdirSync, writeFileSync, lstatSync, rmSync, readdirSync, statSync } from 'fs';
58
+ import * as fs13 from 'fs';
59
+ import fs13__default, { readFileSync, existsSync, mkdirSync, writeFileSync, lstatSync, rmSync, readdirSync, statSync } from 'fs';
60
60
  import * as path14 from 'path';
61
61
  import path14__default, { resolve, join } from 'path';
62
62
  import { fileURLToPath } from 'url';
63
63
  import { Help, Command, Option } from 'commander';
64
+ import { rcompare } from 'semver';
64
65
  import * as p6 from '@clack/prompts';
65
66
  import pc5 from 'picocolors';
66
67
  import * as os from 'os';
@@ -104,7 +105,7 @@ async function runSearch(kind, query, opts) {
104
105
  }
105
106
  }
106
107
  async function searchIndex(query, kind) {
107
- const { openLibrary: openLibrary2 } = await import('../open-library-4HMIDK3N.js');
108
+ const { openLibrary: openLibrary2 } = await import('../open-library-ODW2PJ2J.js');
108
109
  const library = await openLibrary2();
109
110
  try {
110
111
  const defs = await library.listAssetDefs(kind ? { kind } : {});
@@ -156,7 +157,7 @@ async function searchLocal(query, kind, opts, showStore, airGapped) {
156
157
  const factory = searchFactory(projectDir, query, kind);
157
158
  let entries = unionEntries(await searchIndex(query, kind), factory);
158
159
  if (entries.length === 0 && !query && !kind && !airGapped) {
159
- const { autoSyncForSearch } = await import('../source-LOAM7IIQ.js');
160
+ const { autoSyncForSearch } = await import('../source-KPH66TXY.js');
160
161
  if (await autoSyncForSearch(projectDir)) {
161
162
  entries = unionEntries(await searchIndex(query, kind), factory);
162
163
  }
@@ -210,7 +211,7 @@ async function searchStore(query, kind, opts, airGapped) {
210
211
  logInfo("air-gapped (cache_ttl: 0) \u2014 local sources only");
211
212
  return;
212
213
  }
213
- const { openCatalogSource: openCatalogSource2, LocalCatalogDisabledError } = await import('../open-library-4HMIDK3N.js');
214
+ const { openCatalogSource: openCatalogSource2, LocalCatalogDisabledError } = await import('../open-library-ODW2PJ2J.js');
214
215
  try {
215
216
  const remote = await openCatalogSource2({ projectDir: path14__default.resolve(opts.projectDir) });
216
217
  const assets = await remote.listAssets(kind ? { kind } : {});
@@ -575,16 +576,16 @@ function claudeSkillRoots() {
575
576
  }
576
577
  function resolveImportSource(nameOrPath) {
577
578
  const asPath = path14.resolve(nameOrPath);
578
- if (fs12.existsSync(asPath)) {
579
- const dir = fs12.statSync(asPath).isDirectory() ? asPath : path14.dirname(asPath);
579
+ if (fs13.existsSync(asPath)) {
580
+ const dir = fs13.statSync(asPath).isDirectory() ? asPath : path14.dirname(asPath);
580
581
  const skillFile = path14.join(dir, "SKILL.md");
581
- if (fs12.existsSync(skillFile)) return { dir, skillFile, via: "path" };
582
+ if (fs13.existsSync(skillFile)) return { dir, skillFile, via: "path" };
582
583
  }
583
584
  if (!nameOrPath.includes(path14.sep) && !nameOrPath.startsWith(".")) {
584
585
  for (const root of claudeSkillRoots()) {
585
586
  const dir = path14.join(root, nameOrPath);
586
587
  const skillFile = path14.join(dir, "SKILL.md");
587
- if (fs12.existsSync(skillFile)) return { dir, skillFile, via: "claude-skills" };
588
+ if (fs13.existsSync(skillFile)) return { dir, skillFile, via: "claude-skills" };
588
589
  }
589
590
  }
590
591
  return null;
@@ -652,17 +653,17 @@ function ensureDomain(libraryPath, domain, opts = {}) {
652
653
  const dir = path14.join(libraryPath, domain);
653
654
  const domainFile = path14.join(dir, "DOMAIN.md");
654
655
  const publisher = opts.publisher ?? slugifyAssetName(domain);
655
- if (fs12.existsSync(domainFile)) {
656
+ if (fs13.existsSync(domainFile)) {
656
657
  return { dir, publisher, created: false };
657
658
  }
658
- fs12.mkdirSync(dir, { recursive: true });
659
+ fs13.mkdirSync(dir, { recursive: true });
659
660
  const description = opts.description ?? `The ${domain} domain.`;
660
- fs12.writeFileSync(domainFile, DOMAIN_TEMPLATE(domain, publisher, description), "utf8");
661
+ fs13.writeFileSync(domainFile, DOMAIN_TEMPLATE(domain, publisher, description), "utf8");
661
662
  return { dir, publisher, created: true };
662
663
  }
663
664
  function listDomains(libraryPath) {
664
- if (!fs12.existsSync(libraryPath)) return [];
665
- return fs12.readdirSync(libraryPath, { withFileTypes: true }).filter((e) => e.isDirectory() && fs12.existsSync(path14.join(libraryPath, e.name, "DOMAIN.md"))).map((e) => e.name).sort();
665
+ if (!fs13.existsSync(libraryPath)) return [];
666
+ return fs13.readdirSync(libraryPath, { withFileTypes: true }).filter((e) => e.isDirectory() && fs13.existsSync(path14.join(libraryPath, e.name, "DOMAIN.md"))).map((e) => e.name).sort();
666
667
  }
667
668
  function upsertManifestAsset(libraryPath, input) {
668
669
  const manifest = loadSkPublishManifest(libraryPath) ?? { assets: [] };
@@ -684,6 +685,25 @@ function upsertManifestAsset(libraryPath, input) {
684
685
  }
685
686
 
686
687
  // cli/src/commands/asset-cmd.ts
688
+ async function resolveDefByRef(library, ref, opts) {
689
+ const inScope = (d) => !opts?.fromLibraryId || d.libraryId === opts.fromLibraryId;
690
+ const direct = await library.getAssetDef(ref);
691
+ if (direct && inScope(direct)) return direct;
692
+ let parsed;
693
+ try {
694
+ parsed = parseAssetRef(ref);
695
+ } catch {
696
+ return null;
697
+ }
698
+ const wantPublisher = parsed.publisher?.replace(/^@/, "");
699
+ const defs = await library.listAssetDefs({ kind: parsed.kind });
700
+ const matches = defs.filter(
701
+ (d) => d.name === parsed.name && inScope(d) && (wantPublisher === void 0 || d.publisher.replace(/^@/, "") === wantPublisher) && matchPin(parsed.pin, d.version)
702
+ );
703
+ if (matches.length === 0) return null;
704
+ matches.sort((a, b) => rcompare(coerceVersion(a.version), coerceVersion(b.version)));
705
+ return matches[0];
706
+ }
687
707
  function makeAssetCommand() {
688
708
  const cmd = new Command("asset").description("Author and install AI assets");
689
709
  cmd.command("import <name-or-path>").description("Import + skailify an existing coding-agent skill into a library").option("--to <library>", "Target library (default: auto / personal)").option("--domain <name>", "Place under this domain's skills/ (created if missing)").option("--version <semver>", "Version to stamp when the skill ships none").option("--stage <stage>", "Lifecycle stage to stamp (default: alpha)").option("--no-normalize", "Copy verbatim \u2014 skip frontmatter normalization").option("--commit", "Auto-commit in git-backed libraries", false).action(
@@ -712,7 +732,7 @@ function makeAssetCommand() {
712
732
  logErr(`Library "${target.name}" is read-only (ownership=reader). Choose --to.`);
713
733
  process.exit(1);
714
734
  }
715
- const rawSkill = fs12.readFileSync(src.skillFile, "utf8");
735
+ const rawSkill = fs13.readFileSync(src.skillFile, "utf8");
716
736
  const norm = opts.normalize ? normalizeSkillContent(rawSkill, {
717
737
  fallbackName: path14.basename(src.dir),
718
738
  version: opts.version,
@@ -731,14 +751,14 @@ function makeAssetCommand() {
731
751
  destParent = path14.join(dom.dir, "skills");
732
752
  publisher = dom.publisher;
733
753
  }
734
- fs12.mkdirSync(destParent, { recursive: true });
754
+ fs13.mkdirSync(destParent, { recursive: true });
735
755
  const destDir = path14.join(destParent, norm.name);
736
- if (fs12.existsSync(destDir)) {
756
+ if (fs13.existsSync(destDir)) {
737
757
  logErr(`Destination already exists: ${destDir}`);
738
758
  process.exit(1);
739
759
  }
740
- fs12.cpSync(src.dir, destDir, { recursive: true });
741
- fs12.writeFileSync(path14.join(destDir, "SKILL.md"), norm.content, "utf8");
760
+ fs13.cpSync(src.dir, destDir, { recursive: true });
761
+ fs13.writeFileSync(path14.join(destDir, "SKILL.md"), norm.content, "utf8");
742
762
  for (const note of norm.notes) logInfo(` \u2022 ${note}`);
743
763
  const fm = parseFrontmatter(norm.content).data;
744
764
  const descRaw = fm.description;
@@ -780,7 +800,7 @@ function makeAssetCommand() {
780
800
  logErr(`Invalid --mode "${opts.mode}". Expected: copy | move | link.`);
781
801
  process.exit(1);
782
802
  }
783
- if (!fs12.existsSync(srcPath)) {
803
+ if (!fs13.existsSync(srcPath)) {
784
804
  logErr(`Source path does not exist: ${srcPath}`);
785
805
  process.exit(1);
786
806
  }
@@ -809,21 +829,21 @@ function makeAssetCommand() {
809
829
  }
810
830
  const basename2 = path14.basename(srcPath);
811
831
  const destDir = target.structure === "domain" && opts.domain ? path14.join(target.path, opts.domain) : target.path;
812
- fs12.mkdirSync(destDir, { recursive: true });
832
+ fs13.mkdirSync(destDir, { recursive: true });
813
833
  const destPath = path14.join(destDir, basename2);
814
- if (fs12.existsSync(destPath)) {
834
+ if (fs13.existsSync(destPath)) {
815
835
  logErr(`Destination already exists: ${destPath}`);
816
836
  process.exit(1);
817
837
  }
818
838
  switch (opts.mode) {
819
839
  case "copy":
820
- fs12.cpSync(srcPath, destPath, { recursive: true });
840
+ fs13.cpSync(srcPath, destPath, { recursive: true });
821
841
  break;
822
842
  case "move":
823
- fs12.renameSync(srcPath, destPath);
843
+ fs13.renameSync(srcPath, destPath);
824
844
  break;
825
845
  case "link":
826
- fs12.symlinkSync(path14.resolve(srcPath), destPath);
846
+ fs13.symlinkSync(path14.resolve(srcPath), destPath);
827
847
  break;
828
848
  }
829
849
  if (target.backend === "git" && opts.commit) {
@@ -858,7 +878,16 @@ function makeAssetCommand() {
858
878
  }
859
879
  const { manager, library, close } = await openLibraryManager();
860
880
  try {
861
- const def = await library.getAssetDef(ref);
881
+ let fromLibraryId;
882
+ if (opts.from) {
883
+ const match = (await manager.listLibraries()).find((l) => l.name === opts.from);
884
+ if (!match) {
885
+ logErr(`Unknown library "${opts.from}". Run \`skaile library list\`.`);
886
+ process.exit(1);
887
+ }
888
+ fromLibraryId = match.id;
889
+ }
890
+ const def = await resolveDefByRef(library, ref, { fromLibraryId });
862
891
  if (!def) {
863
892
  logErr(`No asset found for ref "${ref}". Try \`skaile search\`.`);
864
893
  process.exit(1);
@@ -869,22 +898,19 @@ function makeAssetCommand() {
869
898
  logErr(`Asset has no associated library; install path unknown.`);
870
899
  process.exit(1);
871
900
  }
872
- if (opts.from && lib.name !== opts.from) {
873
- logWarn(`Asset belongs to "${lib.name}", but --from=${opts.from} was specified.`);
874
- }
875
901
  const manifestPath = def.manifest.path;
876
902
  const candidateSubpath = typeof manifestPath === "string" && manifestPath.length > 0 ? manifestPath : def.name;
877
903
  const srcPath = path14.join(lib.path, candidateSubpath);
878
- if (!fs12.existsSync(srcPath)) {
904
+ if (!fs13.existsSync(srcPath)) {
879
905
  logErr(`Asset path not found: ${srcPath}`);
880
906
  process.exit(1);
881
907
  }
882
908
  const destPath = path14.join(target, candidateSubpath);
883
- fs12.mkdirSync(path14.dirname(destPath), { recursive: true });
909
+ fs13.mkdirSync(path14.dirname(destPath), { recursive: true });
884
910
  if (opts.mode === "copy") {
885
- fs12.cpSync(srcPath, destPath, { recursive: true });
911
+ fs13.cpSync(srcPath, destPath, { recursive: true });
886
912
  } else {
887
- fs12.symlinkSync(path14.resolve(srcPath), destPath);
913
+ fs13.symlinkSync(path14.resolve(srcPath), destPath);
888
914
  }
889
915
  logOk(`Installed ${ref} \u2192 ${destPath} (${opts.mode})`);
890
916
  } finally {
@@ -896,7 +922,7 @@ function makeAssetCommand() {
896
922
  cmd.command("show <ref>").description("Show details for an asset by canonical ref").action(async (ref) => {
897
923
  const { library, close } = await openLibraryManager();
898
924
  try {
899
- const def = await library.getAssetDef(ref);
925
+ const def = await resolveDefByRef(library, ref);
900
926
  if (!def) {
901
927
  logErr(`Not found: ${ref}`);
902
928
  process.exit(1);
@@ -1074,7 +1100,7 @@ function makeCatalogCommand() {
1074
1100
  return catalog;
1075
1101
  }
1076
1102
  async function runLocalCatalogTest(projectDir) {
1077
- const { resolveCatalogSource } = await import('../open-library-4HMIDK3N.js');
1103
+ const { resolveCatalogSource } = await import('../open-library-ODW2PJ2J.js');
1078
1104
  let resolved;
1079
1105
  try {
1080
1106
  resolved = await resolveCatalogSource({ projectDir });
@@ -1208,7 +1234,7 @@ function findFlowFile(flowId, priorityRoots = []) {
1208
1234
  for (const { dir } of assetSearchDirs(root, "flows")) {
1209
1235
  for (const ext of [".flow.yaml", ".flow.json", ".json"]) {
1210
1236
  const candidate = path14__default.join(dir, `${flowId}${ext}`);
1211
- if (fs12__default.existsSync(candidate)) return candidate;
1237
+ if (fs13__default.existsSync(candidate)) return candidate;
1212
1238
  }
1213
1239
  }
1214
1240
  }
@@ -1218,7 +1244,7 @@ function findSkills(domain) {
1218
1244
  const found = [];
1219
1245
  for (const root of aiResourceRoots()) {
1220
1246
  for (const { dir, domain: dirDomain } of assetSearchDirs(root, "skills")) {
1221
- if (fs12__default.existsSync(dir)) walkSkills(dir, dirDomain, found);
1247
+ if (fs13__default.existsSync(dir)) walkSkills(dir, dirDomain, found);
1222
1248
  }
1223
1249
  }
1224
1250
  const seen = /* @__PURE__ */ new Set();
@@ -1231,11 +1257,11 @@ function findSkills(domain) {
1231
1257
  return deduped;
1232
1258
  }
1233
1259
  function walkSkills(dir, domain, out) {
1234
- for (const entry of fs12__default.readdirSync(dir, { withFileTypes: true })) {
1260
+ for (const entry of fs13__default.readdirSync(dir, { withFileTypes: true })) {
1235
1261
  const full = path14__default.join(dir, entry.name);
1236
1262
  if (entry.isDirectory()) {
1237
1263
  const skillMd = path14__default.join(full, "SKILL.md");
1238
- if (fs12__default.existsSync(skillMd)) {
1264
+ if (fs13__default.existsSync(skillMd)) {
1239
1265
  out.push({ name: entry.name, path: full, skillPath: skillMd, domain });
1240
1266
  } else {
1241
1267
  walkSkills(full, domain, out);
@@ -1264,9 +1290,9 @@ function resolveFlowIds() {
1264
1290
  }
1265
1291
  function resolveSessionIds(projectDir) {
1266
1292
  const sessionsDir = path14__default.join(projectDir, ".skaile", "sessions");
1267
- if (!fs12__default.existsSync(sessionsDir)) return [];
1293
+ if (!fs13__default.existsSync(sessionsDir)) return [];
1268
1294
  try {
1269
- return fs12__default.readdirSync(sessionsDir).filter((f) => f.endsWith(".json")).map((f) => f.slice(0, -".json".length));
1295
+ return fs13__default.readdirSync(sessionsDir).filter((f) => f.endsWith(".json")).map((f) => f.slice(0, -".json".length));
1270
1296
  } catch {
1271
1297
  return [];
1272
1298
  }
@@ -1582,10 +1608,10 @@ function parsePositiveIntOption(value) {
1582
1608
  }
1583
1609
  return n;
1584
1610
  }
1585
- function scanFactoryConnectors(scanDirectory, roots) {
1611
+ function scanFactoryConnectors(scanDirectory2, roots) {
1586
1612
  const byName = /* @__PURE__ */ new Map();
1587
1613
  for (const dir of roots) {
1588
- for (const e of scanDirectory(dir, "factory-assets")) {
1614
+ for (const e of scanDirectory2(dir, "factory-assets")) {
1589
1615
  if (e.kind === "connector" && !byName.has(e.name)) byName.set(e.name, e);
1590
1616
  }
1591
1617
  }
@@ -1693,8 +1719,8 @@ async function promptField(field) {
1693
1719
  function makeConnectorCommand() {
1694
1720
  const cmd = new Command("connector").description("Operate on connectors in a workspace");
1695
1721
  cmd.command("catalog").description("List all available connector drivers and their dependencies").action(async () => {
1696
- const { scanDirectory, factoryAssetRoots: factoryAssetRoots2 } = await import('../core/index.js');
1697
- const entries = scanFactoryConnectors(scanDirectory, factoryAssetRoots2());
1722
+ const { scanDirectory: scanDirectory2, factoryAssetRoots: factoryAssetRoots2 } = await import('../core/index.js');
1723
+ const entries = scanFactoryConnectors(scanDirectory2, factoryAssetRoots2());
1698
1724
  if (entries.length === 0) {
1699
1725
  console.log("No connector descriptors found.");
1700
1726
  return;
@@ -1718,14 +1744,14 @@ function makeConnectorCommand() {
1718
1744
  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(
1719
1745
  async (driver, opts) => {
1720
1746
  const { installNpmPackages } = await import('../connectors/index.js');
1721
- const { scanDirectory, factoryAssetRoots: factoryAssetRoots2, WorkspaceYamlEditor: WorkspaceYamlEditor2 } = await import('../core/index.js');
1747
+ const { scanDirectory: scanDirectory2, factoryAssetRoots: factoryAssetRoots2, WorkspaceYamlEditor: WorkspaceYamlEditor2 } = await import('../core/index.js');
1722
1748
  const projectDir = path14__default.resolve(opts.projectDir);
1723
1749
  const yamlPath = path14__default.join(projectDir, "skaile.yaml");
1724
1750
  if (!existsSync(yamlPath)) {
1725
1751
  logErr("No skaile.yaml found in current directory. Run 'skaile init' first.");
1726
1752
  process.exit(1);
1727
1753
  }
1728
- const entries = scanFactoryConnectors(scanDirectory, factoryAssetRoots2());
1754
+ const entries = scanFactoryConnectors(scanDirectory2, factoryAssetRoots2());
1729
1755
  const entry = entries.find((e) => e.name === driver);
1730
1756
  if (!entry) {
1731
1757
  logErr(
@@ -2064,7 +2090,7 @@ async function ensureTargetsRegistered(projectDir) {
2064
2090
  const { resolveSkWorkspaceConfig: resolveSkWorkspaceConfig2 } = await import('../core/index.js');
2065
2091
  const config = resolveSkWorkspaceConfig2(projectDir);
2066
2092
  if (config.plugins && config.plugins.length > 0) {
2067
- const { ensurePluginsLoaded } = await import('../plugin-store-S7OMGI7N.js');
2093
+ const { ensurePluginsLoaded } = await import('../plugin-store-QMJ2B3VM.js');
2068
2094
  const result = await ensurePluginsLoaded(projectDir, config.plugins, pluginRegistry);
2069
2095
  for (const f of result.failed) logWarn(f.error);
2070
2096
  }
@@ -2869,6 +2895,46 @@ function makeIntegrationCommand() {
2869
2895
  cmd.action(() => cmd.help());
2870
2896
  return cmd;
2871
2897
  }
2898
+ async function indexLibrary(lib, index) {
2899
+ const { LocalCatalogSource } = await import('../library/index.js');
2900
+ const own = index ?? await openLibrary();
2901
+ try {
2902
+ const source = new LocalCatalogSource(own, lib.id, lib.path, createFullRegistry());
2903
+ const res = await source.sync();
2904
+ return {
2905
+ assetsFound: res.assetsFound,
2906
+ assetsUpdated: res.assetsUpdated,
2907
+ errors: res.errors
2908
+ };
2909
+ } finally {
2910
+ if (!index) own.close();
2911
+ }
2912
+ }
2913
+ function domainPublisher(libraryPath, domain) {
2914
+ const domainFile = path14.join(libraryPath, domain, "DOMAIN.md");
2915
+ if (!fs13.existsSync(domainFile)) return void 0;
2916
+ try {
2917
+ const { data } = parseFrontmatter(fs13.readFileSync(domainFile, "utf8"));
2918
+ const pub = data.publisher;
2919
+ return typeof pub === "string" && pub.trim() ? pub.trim() : void 0;
2920
+ } catch {
2921
+ return void 0;
2922
+ }
2923
+ }
2924
+ function resolveLibraryPublisher(lib, opts, domain) {
2925
+ if (opts.publisher?.trim()) return opts.publisher.trim();
2926
+ if (domain) {
2927
+ const fromDomain = domainPublisher(lib.path, domain);
2928
+ if (fromDomain) return fromDomain;
2929
+ }
2930
+ try {
2931
+ return slugifyAssetName(lib.name);
2932
+ } catch {
2933
+ return "library";
2934
+ }
2935
+ }
2936
+
2937
+ // cli/src/commands/library-cmd.ts
2872
2938
  function makeLibraryCommand() {
2873
2939
  const cmd = new Command("library").description("Manage user authoring libraries (local / git)");
2874
2940
  cmd.command("list").description("List all registered libraries").option("--json", "Output as JSON").action(async (opts) => {
@@ -2931,7 +2997,7 @@ function makeLibraryCommand() {
2931
2997
  const { manager, close } = await openLibraryManager();
2932
2998
  try {
2933
2999
  if (opts.git) {
2934
- fs12.mkdirSync(libPath, { recursive: true });
3000
+ fs13.mkdirSync(libPath, { recursive: true });
2935
3001
  await manager.addLibrary({
2936
3002
  name,
2937
3003
  path: libPath,
@@ -2940,7 +3006,7 @@ function makeLibraryCommand() {
2940
3006
  ownership
2941
3007
  });
2942
3008
  } else {
2943
- fs12.mkdirSync(libPath, { recursive: true });
3009
+ fs13.mkdirSync(libPath, { recursive: true });
2944
3010
  await manager.addLibrary({
2945
3011
  name,
2946
3012
  path: libPath,
@@ -2974,13 +3040,13 @@ function makeLibraryCommand() {
2974
3040
  close();
2975
3041
  }
2976
3042
  });
2977
- cmd.command("create <kind> <name>").description("Scaffold a new asset inside the default (or named) library").addOption(new Option("--kind <kind>", "Asset kind override").choices([...ASSET_KINDS])).option("--library <name>", "Target library (default: the default-marked one)").option("--dir <dir>", "Target directory inside the library (default: library root)").action(
3043
+ cmd.command("create <kind> <name>").description("Scaffold a new asset inside the default (or named) library").addOption(new Option("--kind <kind>", "Asset kind override").choices([...ASSET_KINDS])).option("--library <name>", "Target library (default: the default-marked one)").option("--dir <dir>", "Target directory inside the library (default: library root)").option("--publisher <name>", "Publisher for the new asset (default: the library's default)").action(
2978
3044
  async (kind, name, opts) => {
2979
3045
  if (!ASSET_KINDS.includes(kind)) {
2980
3046
  logErr(`Unknown asset kind "${kind}". Expected: ${ASSET_KINDS.join(", ")}.`);
2981
3047
  process.exit(1);
2982
3048
  }
2983
- const { manager, close } = await openLibraryManager();
3049
+ const { manager, library, close } = await openLibraryManager();
2984
3050
  try {
2985
3051
  let target;
2986
3052
  if (opts.library) {
@@ -2996,15 +3062,28 @@ function makeLibraryCommand() {
2996
3062
  }
2997
3063
  target = def;
2998
3064
  }
3065
+ const effectiveKind = opts.kind ?? kind;
2999
3066
  const am2 = new AssetManager({ projectDir: process.cwd() });
3000
3067
  const destDir = opts.dir ? path14.join(target.path, opts.dir) : target.path;
3001
- const res = am2.create(name, opts.kind ?? kind, destDir);
3002
- if (res.ok) {
3003
- logOk(`Created ${opts.kind ?? kind}: ${pc5.dim(res.path)}`);
3004
- } else {
3068
+ const res = am2.create(name, effectiveKind, destDir);
3069
+ if (!res.ok) {
3005
3070
  logErr(res.path);
3006
3071
  process.exit(1);
3007
3072
  }
3073
+ logOk(`Created ${effectiveKind}: ${pc5.dim(res.path)}`);
3074
+ const domain2 = opts.dir ? opts.dir.split(path14.sep)[0] : void 0;
3075
+ const publisher = resolveLibraryPublisher(target, opts, domain2);
3076
+ stampAssetPublisher(res.path, publisher);
3077
+ ensureManifestPublisher(target.path, publisher);
3078
+ upsertManifestAsset(target.path, {
3079
+ kind: effectiveKind,
3080
+ name,
3081
+ root: path14.relative(target.path, res.path) || name,
3082
+ version: "0.1.0"
3083
+ });
3084
+ const idx = await indexLibrary(target, library);
3085
+ for (const e of idx.errors) logWarn(e);
3086
+ logOk(`Indexed \u2014 add it with \`skaile add ${effectiveKind}:@${publisher}/${name}\``);
3008
3087
  } finally {
3009
3088
  close();
3010
3089
  }
@@ -3079,7 +3158,7 @@ function makeLibraryCommand() {
3079
3158
  logErr(`Domain "${name}" not found in "${target.name}" (no ${domainFile}).`);
3080
3159
  process.exit(1);
3081
3160
  }
3082
- console.log(fs12.readFileSync(domainFile, "utf8"));
3161
+ console.log(fs13.readFileSync(domainFile, "utf8"));
3083
3162
  } finally {
3084
3163
  close();
3085
3164
  }
@@ -3099,11 +3178,11 @@ function makeLibraryCommand() {
3099
3178
  const lib = await manager.requireLibrary(oldName);
3100
3179
  const parent = path14.dirname(lib.path);
3101
3180
  const newPath = path14.join(parent, newName);
3102
- if (fs12.existsSync(newPath)) {
3181
+ if (fs13.existsSync(newPath)) {
3103
3182
  logErr(`Target directory already exists: ${newPath}`);
3104
3183
  process.exit(1);
3105
3184
  }
3106
- fs12.renameSync(lib.path, newPath);
3185
+ fs13.renameSync(lib.path, newPath);
3107
3186
  await manager.updateLibrary(lib.id, { name: newName, path: newPath });
3108
3187
  logOk(`Renamed ${oldName} \u2192 ${newName}`);
3109
3188
  } finally {
@@ -3169,6 +3248,18 @@ function makeLibraryCommand() {
3169
3248
  close();
3170
3249
  }
3171
3250
  });
3251
+ cmd.command("index <name>").description("(Re)index a library's assets into the local index").action(async (name) => {
3252
+ const { manager, library, close } = await openLibraryManager();
3253
+ try {
3254
+ const lib = await manager.requireLibrary(name);
3255
+ syncManifestWithDisk(lib.path, lib.name);
3256
+ const res = await indexLibrary(lib, library);
3257
+ for (const e of res.errors) logWarn(e);
3258
+ logOk(`Indexed ${res.assetsUpdated} asset(s) from ${name}.`);
3259
+ } finally {
3260
+ close();
3261
+ }
3262
+ });
3172
3263
  cmd.command("pull <name>").description("Pull from remote").action(async (name) => {
3173
3264
  const { manager, close } = await openLibraryManager();
3174
3265
  try {
@@ -3246,20 +3337,70 @@ function makeLibraryCommand() {
3246
3337
  });
3247
3338
  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
3339
  async (lib, opts) => {
3249
- const { runLibraryPublish } = await import('../library-publish-K5IBE44D.js');
3250
- await runLibraryPublish(lib, opts);
3340
+ const { runLibraryPublish } = await import('../library-publish-NQQFPOUY.js');
3341
+ await withStoreErrorHandling(() => runLibraryPublish(lib, opts));
3251
3342
  }
3252
3343
  );
3253
3344
  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);
3345
+ const { runLibraryRegister } = await import('../library-publish-NQQFPOUY.js');
3346
+ await withStoreErrorHandling(() => runLibraryRegister(lib, opts));
3256
3347
  });
3257
3348
  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);
3349
+ const { runLibraryYank } = await import('../library-publish-NQQFPOUY.js');
3350
+ await withStoreErrorHandling(() => runLibraryYank(lib, opts));
3260
3351
  });
3261
3352
  return cmd;
3262
3353
  }
3354
+ async function withStoreErrorHandling(fn) {
3355
+ try {
3356
+ await fn();
3357
+ } catch (err) {
3358
+ logErr(err instanceof Error ? err.message : String(err));
3359
+ process.exit(1);
3360
+ }
3361
+ }
3362
+ function stampAssetPublisher(assetDir, publisher) {
3363
+ const markers = ["SKILL.md", "AGENT.md", "CONTRACT.md"];
3364
+ let markerFile;
3365
+ for (const m of markers) {
3366
+ if (fs13.existsSync(path14.join(assetDir, m))) {
3367
+ markerFile = path14.join(assetDir, m);
3368
+ break;
3369
+ }
3370
+ }
3371
+ if (!markerFile) {
3372
+ const promptMd = fs13.readdirSync(assetDir).find((f) => f.endsWith(".prompt.md"));
3373
+ if (promptMd) markerFile = path14.join(assetDir, promptMd);
3374
+ }
3375
+ if (!markerFile) return;
3376
+ try {
3377
+ const { data, body } = parseFrontmatter(fs13.readFileSync(markerFile, "utf8"));
3378
+ const meta = data.metadata && typeof data.metadata === "object" && !Array.isArray(data.metadata) ? { ...data.metadata } : {};
3379
+ if (meta.publisher != null) return;
3380
+ meta.publisher = publisher;
3381
+ data.metadata = meta;
3382
+ const fm = stringify(data).trimEnd();
3383
+ fs13.writeFileSync(markerFile, `---
3384
+ ${fm}
3385
+ ---
3386
+
3387
+ ${body}
3388
+ `, "utf8");
3389
+ } catch {
3390
+ }
3391
+ }
3392
+ function ensureManifestPublisher(libraryPath, publisher) {
3393
+ const manifest = loadSkPublishManifest(libraryPath) ?? { assets: [] };
3394
+ if (manifest.publisher) return;
3395
+ saveSkPublishManifest(libraryPath, { ...manifest, publisher });
3396
+ }
3397
+ function syncManifestWithDisk(libraryPath, libraryName) {
3398
+ const publisher = loadSkPublishManifest(libraryPath)?.publisher ?? slugifyAssetName(libraryName);
3399
+ for (const e of scanDirectory(libraryPath, publisher)) {
3400
+ const root = path14.relative(libraryPath, path14.dirname(e.source)) || e.name;
3401
+ upsertManifestAsset(libraryPath, { kind: e.kind, name: e.name, root, version: e.version });
3402
+ }
3403
+ }
3263
3404
  async function printPerLibraryStatus(name, asJson) {
3264
3405
  const { manager, close } = await openLibraryManager();
3265
3406
  try {
@@ -3514,6 +3655,7 @@ var srcKey = (origin, publisher) => `${origin}:${publisher}`;
3514
3655
  var domainKey = (origin, publisher, slug) => `${origin}:${publisher}:dom:${slug}`;
3515
3656
  var repoKey = (org, repo) => `${org}/${repo}`;
3516
3657
  var srcDomainKey = (org, repo, slug) => `${org}/${repo}:dom:${slug}`;
3658
+ var libDomainKey = (group, slug) => `${group}:dom:${slug}`;
3517
3659
  var NO_DOMAIN = "";
3518
3660
  var domainRegistry = /* @__PURE__ */ new Map();
3519
3661
  function relationBadge(relation) {
@@ -3544,6 +3686,8 @@ var state = {
3544
3686
  visibleRows: [],
3545
3687
  sourceTreeRows: [],
3546
3688
  visibleSourceRows: [],
3689
+ libraryTreeRows: [],
3690
+ visibleLibraryRows: [],
3547
3691
  pendingAdds: /* @__PURE__ */ new Set(),
3548
3692
  pendingRemoves: /* @__PURE__ */ new Set(),
3549
3693
  collapsedOrigins: /* @__PURE__ */ new Set(),
@@ -3556,6 +3700,10 @@ var state = {
3556
3700
  collapsedSourceDomains: /* @__PURE__ */ new Set(),
3557
3701
  expandedSourceDomainInfo: /* @__PURE__ */ new Set(),
3558
3702
  seenSourceDomains: /* @__PURE__ */ new Set(),
3703
+ collapsedLibraryGroups: /* @__PURE__ */ new Set(),
3704
+ collapsedLibraryDomains: /* @__PURE__ */ new Set(),
3705
+ expandedLibraryDomainInfo: /* @__PURE__ */ new Set(),
3706
+ seenLibraryDomains: /* @__PURE__ */ new Set(),
3559
3707
  seenOrigins: /* @__PURE__ */ new Set(),
3560
3708
  originFilter: null,
3561
3709
  message: "",
@@ -3663,6 +3811,59 @@ function sourceDomainRefs(rows, org, repo, slug) {
3663
3811
  )
3664
3812
  );
3665
3813
  }
3814
+ function buildLibraryTreeRows(assetRows, registered = []) {
3815
+ const byGroup = /* @__PURE__ */ new Map();
3816
+ const ensure = (group) => {
3817
+ if (!byGroup.has(group)) byGroup.set(group, /* @__PURE__ */ new Map());
3818
+ return byGroup.get(group);
3819
+ };
3820
+ for (const r of assetRows) {
3821
+ if (!isAsset(r) || rowOrigin(r) !== "library") continue;
3822
+ const group = rowGroup(r);
3823
+ const slug = rowDomain(r);
3824
+ const byDomain = ensure(group);
3825
+ if (!byDomain.has(slug)) byDomain.set(slug, []);
3826
+ byDomain.get(slug).push(r);
3827
+ }
3828
+ for (const group of registered) ensure(group);
3829
+ if (byGroup.size === 0) return [];
3830
+ const rows = [{ type: "library-root" }];
3831
+ for (const group of [...byGroup.keys()].sort((a, b) => a.localeCompare(b))) {
3832
+ rows.push({ type: "library-header", origin: "library", source: group });
3833
+ const byDomain = byGroup.get(group);
3834
+ const loose = byDomain.get(NO_DOMAIN);
3835
+ if (loose) for (const a of loose) rows.push({ ...a });
3836
+ for (const slug of sortedDomainSlugs([...byDomain.keys()])) {
3837
+ const meta = domainRegistry.get(slug);
3838
+ rows.push({ type: "domain-header", origin: "library", source: group, domainSlug: slug });
3839
+ if (meta?.description) {
3840
+ rows.push({ type: "domain-info", origin: "library", source: group, domainSlug: slug });
3841
+ }
3842
+ for (const a of byDomain.get(slug)) rows.push({ ...a });
3843
+ }
3844
+ }
3845
+ return rows;
3846
+ }
3847
+ function buildVisibleLibraryRows(rows, collapsedGroups, collapsedDomains) {
3848
+ return rows.filter((row) => {
3849
+ if (row.type === "library-root" || row.type === "library-header") return true;
3850
+ const group = row.source ?? rowGroup(row);
3851
+ if (collapsedGroups.has(group)) return false;
3852
+ if (row.type === "domain-header") return true;
3853
+ if (row.type === "domain-info") {
3854
+ return !collapsedDomains.has(libDomainKey(group, row.domainSlug ?? NO_DOMAIN));
3855
+ }
3856
+ if (row.underDomain) {
3857
+ return !collapsedDomains.has(libDomainKey(rowGroup(row), rowDomain(row)));
3858
+ }
3859
+ return true;
3860
+ });
3861
+ }
3862
+ function libraryGroupRefs(rows, group) {
3863
+ return refsOf(
3864
+ rows.filter((r) => isAsset(r) && rowOrigin(r) === "library" && rowGroup(r) === group)
3865
+ );
3866
+ }
3666
3867
  function isAsset(r) {
3667
3868
  return r.type === "asset";
3668
3869
  }
@@ -3786,7 +3987,7 @@ async function previewSoftDepsUnderCursor() {
3786
3987
  }
3787
3988
  async function loadAssets() {
3788
3989
  softDepPreviewCache.clear();
3789
- const { gatherAssetFeeds } = await import('../asset-feeds-T35ELX2O.js');
3990
+ const { gatherAssetFeeds } = await import('../asset-feeds-PTZBWJEL.js');
3790
3991
  const { entries, domains, notes } = await gatherAssetFeeds(am, am.projectDir);
3791
3992
  if (notes.length > 0) {
3792
3993
  state.message = notes.map((n) => `[${n.feed}] ${n.message}`).join(" \u2022 ");
@@ -3799,6 +4000,7 @@ async function loadAssets() {
3799
4000
  reconcileCollapsedSets(rows);
3800
4001
  rebuildVisible();
3801
4002
  rebuildSourceTree();
4003
+ rebuildLibraryTree();
3802
4004
  }
3803
4005
  function rebuildSourceTree() {
3804
4006
  const registered = state.sourceRows.map((s) => sourceOrgRepo(s)).filter((x) => x !== null);
@@ -3848,6 +4050,44 @@ function rebuildVisibleSources() {
3848
4050
  );
3849
4051
  clampCursor();
3850
4052
  }
4053
+ function rebuildLibraryTree() {
4054
+ state.libraryTreeRows = buildLibraryTreeRows(
4055
+ state.assetRows,
4056
+ state.libraryRows.map((l) => l.name)
4057
+ );
4058
+ reconcileLibraryCollapsedSets(state.libraryTreeRows);
4059
+ rebuildVisibleLibraries();
4060
+ }
4061
+ function reconcileLibraryCollapsedSets(rows) {
4062
+ const groupKeys = new Set(rows.filter((r) => r.type === "library-header").map((r) => r.source));
4063
+ const domainKeys = new Set(
4064
+ rows.filter((r) => r.type === "domain-header").map((r) => libDomainKey(r.source, r.domainSlug ?? NO_DOMAIN))
4065
+ );
4066
+ for (const k of state.collapsedLibraryGroups)
4067
+ if (!groupKeys.has(k)) state.collapsedLibraryGroups.delete(k);
4068
+ for (const k of domainKeys) {
4069
+ if (!state.seenLibraryDomains.has(k)) {
4070
+ state.collapsedLibraryDomains.add(k);
4071
+ state.seenLibraryDomains.add(k);
4072
+ }
4073
+ }
4074
+ for (const k of state.collapsedLibraryDomains) {
4075
+ if (!domainKeys.has(k)) state.collapsedLibraryDomains.delete(k);
4076
+ }
4077
+ for (const k of state.expandedLibraryDomainInfo) {
4078
+ if (!domainKeys.has(k)) state.expandedLibraryDomainInfo.delete(k);
4079
+ }
4080
+ for (const k of state.seenLibraryDomains)
4081
+ if (!domainKeys.has(k)) state.seenLibraryDomains.delete(k);
4082
+ }
4083
+ function rebuildVisibleLibraries() {
4084
+ state.visibleLibraryRows = buildVisibleLibraryRows(
4085
+ state.libraryTreeRows,
4086
+ state.collapsedLibraryGroups,
4087
+ state.collapsedLibraryDomains
4088
+ );
4089
+ clampCursor();
4090
+ }
3851
4091
  function groupEntriesByOriginPublisherDomain(entries) {
3852
4092
  const byOrigin = /* @__PURE__ */ new Map();
3853
4093
  for (const { origin, entry, group } of entries) {
@@ -3917,7 +4157,7 @@ function reconcileCollapsedSets(rows) {
3917
4157
  const presentOrigins = new Set(rows.filter((r) => r.type === "origin-header").map(rowOrigin));
3918
4158
  for (const o of presentOrigins) {
3919
4159
  if (!state.seenOrigins.has(o)) {
3920
- if (o === "store") state.collapsedOrigins.add(o);
4160
+ if (o !== "factory") state.collapsedOrigins.add(o);
3921
4161
  state.seenOrigins.add(o);
3922
4162
  }
3923
4163
  }
@@ -3953,7 +4193,7 @@ function reconcileCollapsedSets(rows) {
3953
4193
  async function loadSourcesAndLibraries() {
3954
4194
  try {
3955
4195
  const [{ openLibraryManager: openLibraryManager2 }, { skaileHomeDir }, { getGlobalCacheDir: getGlobalCacheDir2 }] = await Promise.all([
3956
- import('../open-library-4HMIDK3N.js'),
4196
+ import('../open-library-ODW2PJ2J.js'),
3957
4197
  import('../library/index.js'),
3958
4198
  import('../core/index.js')
3959
4199
  ]);
@@ -3990,6 +4230,7 @@ async function loadSourcesAndLibraries() {
3990
4230
  state.libraryRows = [];
3991
4231
  }
3992
4232
  rebuildSourceTree();
4233
+ rebuildLibraryTree();
3993
4234
  }
3994
4235
  function rebuildVisible() {
3995
4236
  state.visibleRows = buildVisibleRows(
@@ -4033,11 +4274,11 @@ var TABS = {
4033
4274
  },
4034
4275
  libraries: {
4035
4276
  label: "Libraries",
4036
- rowCount: () => state.libraryRows.length,
4037
- selectableCount: () => state.libraryRows.length,
4277
+ rowCount: () => state.visibleLibraryRows.length,
4278
+ selectableCount: () => state.libraryTreeRows.filter(isAsset).length,
4038
4279
  emptyMsg: " No libraries registered. Run `skaile library init <name>` from the shell to author your own.",
4039
- renderRow: (i, sel) => renderLibraryRow(state.libraryRows[i], sel),
4040
- footer: " \u2191\u2193 navigate Tab switch q quit (use `skaile library \u2026` from the shell for CRUD)"
4280
+ renderRow: (i, sel) => renderLibraryTreeRow(state.visibleLibraryRows[i], sel),
4281
+ footer: " \u2191\u2193/jk nav \u2190/\u2192 collapse/expand [space/+/-] select [a/\u21B5] apply [d] domain info [i] info Tab [q] quit"
4041
4282
  },
4042
4283
  pending: {
4043
4284
  label: "Pending",
@@ -4246,6 +4487,57 @@ function renderSourceTreeRow(row, selected) {
4246
4487
  }
4247
4488
  return renderAssetLeaf(row, selected, 7);
4248
4489
  }
4490
+ function renderLibraryTreeRow(row, selected) {
4491
+ if (row.type === "library-root") {
4492
+ const total = state.libraryTreeRows.filter(isAsset).length;
4493
+ const meta = ORIGIN_META.library;
4494
+ const line = ` \u25BC ${meta.icon} ${pc5.bold(pc5.cyan(meta.label))} (${total} assets)`;
4495
+ return selected ? pc5.bgWhite(pc5.black(`${line} `.padEnd(state.cols))) : line;
4496
+ }
4497
+ if (row.type === "library-header") {
4498
+ const group = row.source;
4499
+ return renderHeaderLine({
4500
+ indent: " ".repeat(3),
4501
+ collapsed: state.collapsedLibraryGroups.has(group),
4502
+ match: (r) => isAsset(r) && rowOrigin(r) === "library" && rowGroup(r) === group,
4503
+ refs: libraryGroupRefs(state.libraryTreeRows, group),
4504
+ label: pc5.bold(pc5.cyan(group)),
4505
+ selected,
4506
+ rows: state.libraryTreeRows
4507
+ });
4508
+ }
4509
+ if (row.type === "domain-header") {
4510
+ const group = row.source;
4511
+ const slug = row.domainSlug ?? NO_DOMAIN;
4512
+ const meta = domainRegistry.get(slug);
4513
+ const title = meta?.title || slug || "(no domain)";
4514
+ const badge = relationBadge(meta?.relation);
4515
+ const label = `${pc5.magenta("\u25C8")} ${pc5.bold(title)}${badge ? ` ${badge}` : ""}`;
4516
+ return renderHeaderLine({
4517
+ indent: " ".repeat(5),
4518
+ collapsed: state.collapsedLibraryDomains.has(libDomainKey(group, slug)),
4519
+ match: (r) => isAsset(r) && inDomain(r, "library", group, slug),
4520
+ refs: domainAssetRefs(state.libraryTreeRows, "library", group, slug),
4521
+ label,
4522
+ selected,
4523
+ rows: state.libraryTreeRows
4524
+ });
4525
+ }
4526
+ if (row.type === "domain-info") {
4527
+ const group = row.source;
4528
+ const slug = row.domainSlug ?? NO_DOMAIN;
4529
+ const meta = domainRegistry.get(slug);
4530
+ const members = domainAssetRefs(state.libraryTreeRows, "library", group, slug).length;
4531
+ const key = libDomainKey(group, slug);
4532
+ const line = renderSourceDomainInfoLine(
4533
+ meta,
4534
+ members,
4535
+ state.expandedLibraryDomainInfo.has(key)
4536
+ );
4537
+ return selected ? pc5.inverse(line.padEnd(state.cols)) : line;
4538
+ }
4539
+ return renderAssetLeaf(row, selected, 5);
4540
+ }
4249
4541
  function renderSourceDomainInfoLine(meta, members, expanded) {
4250
4542
  const indent = " ".repeat(9);
4251
4543
  const desc = meta?.description ?? "";
@@ -4279,11 +4571,6 @@ function renderDomainInfoLine(meta, origin, publisher, slug, expanded) {
4279
4571
  const shown = full.length > budget ? `${full.slice(0, Math.max(0, budget - 1))}\u2026` : full;
4280
4572
  return pc5.dim(`${indent}\u24D8 ${shown}`);
4281
4573
  }
4282
- function renderLibraryRow(row, selected) {
4283
- const mark = row.isDefault ? pc5.green("\u25B8") : " ";
4284
- const line = `${mark} ${S.cmd(fitWidth(row.name, 16))} ${pc5.dim(row.backend.padEnd(7))} ${pc5.dim(row.ownership.padEnd(12))} ${pc5.dim(`${row.assetCount} assets`)}`;
4285
- return selected ? pc5.inverse(line.padEnd(state.cols)) : line;
4286
- }
4287
4574
  function computeMaxBodyRows() {
4288
4575
  const pendingLines = state.pendingAdds.size > 0 || state.pendingRemoves.size > 0 ? 1 + (state.pendingAdds.size > 0 ? 1 : 0) + (state.pendingRemoves.size > 0 ? 1 : 0) : 0;
4289
4576
  const msgLines = state.message ? 2 : 0;
@@ -4401,14 +4688,9 @@ async function syncAll() {
4401
4688
  "Sync is not yet driven from the manage TUI. Run `skaile source sync` (sources) or `skaile library sync <name>` (git-backed libraries) from the shell."
4402
4689
  );
4403
4690
  }
4404
- function libraryShellHint(action3) {
4405
- state.message = pc5.yellow(
4406
- `${action3} is a shell command. Run \`skaile library \u2026\` from the shell.`
4407
- );
4408
- }
4409
4691
  async function showInfo() {
4410
- const rows = state.tab === "sources" ? state.visibleSourceRows : state.visibleRows;
4411
- if (state.tab !== "assets" && state.tab !== "sources") return;
4692
+ const rows = state.tab === "sources" ? state.visibleSourceRows : state.tab === "libraries" ? state.visibleLibraryRows : state.visibleRows;
4693
+ if (state.tab !== "assets" && state.tab !== "sources" && state.tab !== "libraries") return;
4412
4694
  const row = rows[state.cursor];
4413
4695
  if (row?.type !== "asset") return;
4414
4696
  const e = row.entry;
@@ -4646,6 +4928,97 @@ function toggleSourceDomainInfoUnderCursor() {
4646
4928
  else state.expandedSourceDomainInfo.add(key);
4647
4929
  rebuildVisibleSources();
4648
4930
  }
4931
+ function actOnLibraryHeader(row, action3) {
4932
+ if (row.type === "library-header") {
4933
+ bulkSelection(libraryGroupRefs(state.libraryTreeRows, row.source), action3);
4934
+ return true;
4935
+ }
4936
+ return row.type === "library-root" || row.type === "domain-header" || row.type === "domain-info";
4937
+ }
4938
+ function selectLibraryUnderCursor(action3) {
4939
+ const row = state.visibleLibraryRows[state.cursor];
4940
+ if (!row) return;
4941
+ if (actOnLibraryHeader(row, action3)) return;
4942
+ const ref = assetRefOf(row);
4943
+ if (!ref) return;
4944
+ if (action3 === "toggle") {
4945
+ setSelection(ref, "toggle");
4946
+ } else if (action3 === "add") {
4947
+ setSelection(ref, state.pendingAdds.has(ref) ? "clear" : "add");
4948
+ } else {
4949
+ setSelection(ref, state.pendingRemoves.has(ref) ? "clear" : "remove");
4950
+ }
4951
+ }
4952
+ function expandLibraryUnderCursor() {
4953
+ const row = state.visibleLibraryRows[state.cursor];
4954
+ if (!row) return;
4955
+ if (row.type === "library-header" && state.collapsedLibraryGroups.has(row.source)) {
4956
+ state.collapsedLibraryGroups.delete(row.source);
4957
+ rebuildVisibleLibraries();
4958
+ } else if (row.type === "domain-header") {
4959
+ const k = libDomainKey(row.source, row.domainSlug ?? NO_DOMAIN);
4960
+ if (state.collapsedLibraryDomains.has(k)) {
4961
+ state.collapsedLibraryDomains.delete(k);
4962
+ rebuildVisibleLibraries();
4963
+ }
4964
+ }
4965
+ }
4966
+ function collapseOrJumpLibraryUnderCursor() {
4967
+ const row = state.visibleLibraryRows[state.cursor];
4968
+ if (!row) return;
4969
+ if (row.type === "library-header") {
4970
+ if (!state.collapsedLibraryGroups.has(row.source)) {
4971
+ state.collapsedLibraryGroups.add(row.source);
4972
+ rebuildVisibleLibraries();
4973
+ } else {
4974
+ const idx2 = findLastIndex(
4975
+ state.visibleLibraryRows,
4976
+ state.cursor,
4977
+ (r) => r.type === "library-root"
4978
+ );
4979
+ if (idx2 >= 0) state.cursor = idx2;
4980
+ }
4981
+ return;
4982
+ }
4983
+ if (row.type === "domain-header") {
4984
+ const k = libDomainKey(row.source, row.domainSlug ?? NO_DOMAIN);
4985
+ if (!state.collapsedLibraryDomains.has(k)) {
4986
+ state.collapsedLibraryDomains.add(k);
4987
+ rebuildVisibleLibraries();
4988
+ } else {
4989
+ const idx2 = findLastIndex(
4990
+ state.visibleLibraryRows,
4991
+ state.cursor,
4992
+ (r) => r.type === "library-header"
4993
+ );
4994
+ if (idx2 >= 0) state.cursor = idx2;
4995
+ }
4996
+ return;
4997
+ }
4998
+ const idx = findLastIndex(
4999
+ state.visibleLibraryRows,
5000
+ state.cursor,
5001
+ (r) => r.type === "domain-header" || r.type === "library-header"
5002
+ );
5003
+ if (idx >= 0) state.cursor = idx;
5004
+ }
5005
+ function toggleLibraryDomainInfoUnderCursor() {
5006
+ const row = state.visibleLibraryRows[state.cursor];
5007
+ if (!row) return;
5008
+ let key = null;
5009
+ if (row.type === "domain-header" || row.type === "domain-info") {
5010
+ key = libDomainKey(row.source, row.domainSlug ?? NO_DOMAIN);
5011
+ } else if (row.type === "asset" && row.underDomain) {
5012
+ key = libDomainKey(rowGroup(row), rowDomain(row));
5013
+ }
5014
+ if (!key) {
5015
+ state.message = pc5.dim("No domain here \u2014 [d] opens a domain's info region.");
5016
+ return;
5017
+ }
5018
+ if (state.expandedLibraryDomainInfo.has(key)) state.expandedLibraryDomainInfo.delete(key);
5019
+ else state.expandedLibraryDomainInfo.add(key);
5020
+ rebuildVisibleLibraries();
5021
+ }
4649
5022
  function findLastIndex(arr, endExclusive, pred) {
4650
5023
  for (let i = Math.min(endExclusive, arr.length) - 1; i >= 0; i--) {
4651
5024
  if (pred(arr[i])) return i;
@@ -4691,6 +5064,9 @@ var KEYMAP = [
4691
5064
  // Collapse / expand — sources tab
4692
5065
  { keys: ["\x1B[C"], when: TAB_SOURCES, run: expandSourceUnderCursor },
4693
5066
  { keys: ["\x1B[D"], when: TAB_SOURCES, run: collapseOrJumpSourceUnderCursor },
5067
+ // Collapse / expand — libraries tab
5068
+ { keys: ["\x1B[C"], when: TAB_LIBRARIES, run: expandLibraryUnderCursor },
5069
+ { keys: ["\x1B[D"], when: TAB_LIBRARIES, run: collapseOrJumpLibraryUnderCursor },
4694
5070
  // + : assets → bulk-add or single-add toggle
4695
5071
  {
4696
5072
  keys: ["+"],
@@ -4712,23 +5088,13 @@ var KEYMAP = [
4712
5088
  { keys: ["a", "\r", "\n"], when: TAB_SOURCES, run: applyChanges },
4713
5089
  { keys: ["i"], when: TAB_SOURCES, run: showInfo },
4714
5090
  { keys: ["d"], when: TAB_SOURCES, run: toggleSourceDomainInfoUnderCursor },
4715
- // Libraries tab: +/-/n/r/x/d/enter map to shell hints in the minimal scaffold.
4716
- {
4717
- keys: ["+", "n", "a"],
4718
- when: TAB_LIBRARIES,
4719
- run: () => libraryShellHint("Adding a library")
4720
- },
4721
- {
4722
- keys: ["-", "r", "x"],
4723
- when: TAB_LIBRARIES,
4724
- run: () => libraryShellHint("Removing a library")
4725
- },
4726
- {
4727
- keys: ["d"],
4728
- when: TAB_LIBRARIES,
4729
- run: () => libraryShellHint("Setting the default library")
4730
- },
4731
- { keys: ["\r", "\n"], when: TAB_LIBRARIES, run: () => libraryShellHint("Library actions") },
5091
+ // Libraries tab: + / - / space select (asset leaf or library bulk header).
5092
+ { keys: ["+"], when: TAB_LIBRARIES, run: () => selectLibraryUnderCursor("add") },
5093
+ { keys: ["-"], when: TAB_LIBRARIES, run: () => selectLibraryUnderCursor("remove") },
5094
+ { keys: [" "], when: TAB_LIBRARIES, run: () => selectLibraryUnderCursor("toggle") },
5095
+ { keys: ["a", "\r", "\n"], when: TAB_LIBRARIES, run: applyChanges },
5096
+ { keys: ["i"], when: TAB_LIBRARIES, run: showInfo },
5097
+ { keys: ["d"], when: TAB_LIBRARIES, run: toggleLibraryDomainInfoUnderCursor },
4732
5098
  // - : assets → bulk-remove or single-remove toggle
4733
5099
  {
4734
5100
  keys: ["-"],
@@ -4822,8 +5188,8 @@ function makeManageCommand() {
4822
5188
  }
4823
5189
  function makeMcpServerCommand() {
4824
5190
  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) => {
4825
- const path37 = await import('path');
4826
- const projectDir = path37.default.resolve(opts.projectDir);
5191
+ const path38 = await import('path');
5192
+ const projectDir = path38.default.resolve(opts.projectDir);
4827
5193
  const { LogStore, StdoutSink, registerLogStore } = await import('../core/logging.js');
4828
5194
  registerLogStore(
4829
5195
  new LogStore({
@@ -5039,7 +5405,7 @@ function action2(fn) {
5039
5405
  };
5040
5406
  }
5041
5407
  async function reconcileAndReport(projectDir, plugins) {
5042
- const { reconcilePlugins } = await import('../plugin-store-S7OMGI7N.js');
5408
+ const { reconcilePlugins } = await import('../plugin-store-QMJ2B3VM.js');
5043
5409
  if (plugins.length === 0) {
5044
5410
  logInfo("No plugins declared \u2014 nothing to reconcile.");
5045
5411
  return;
@@ -5055,7 +5421,7 @@ async function reconcileAndReport(projectDir, plugins) {
5055
5421
  async function runInstall2(spec, opts) {
5056
5422
  const projectDir = path14__default.resolve(opts.projectDir);
5057
5423
  const { WorkspaceYamlEditor: WorkspaceYamlEditor2 } = await import('../core/index.js');
5058
- const { specName } = await import('../plugin-store-S7OMGI7N.js');
5424
+ const { specName } = await import('../plugin-store-QMJ2B3VM.js');
5059
5425
  const yamlPath = path14__default.join(projectDir, "skaile.yaml");
5060
5426
  const editor = WorkspaceYamlEditor2.load(yamlPath);
5061
5427
  const replaced = editor.addPlugin(spec, specName);
@@ -5067,7 +5433,7 @@ async function runInstall2(spec, opts) {
5067
5433
  async function runRemove(name, opts) {
5068
5434
  const projectDir = path14__default.resolve(opts.projectDir);
5069
5435
  const { WorkspaceYamlEditor: WorkspaceYamlEditor2 } = await import('../core/index.js');
5070
- const { specName } = await import('../plugin-store-S7OMGI7N.js');
5436
+ const { specName } = await import('../plugin-store-QMJ2B3VM.js');
5071
5437
  const yamlPath = path14__default.join(projectDir, "skaile.yaml");
5072
5438
  const editor = WorkspaceYamlEditor2.load(yamlPath);
5073
5439
  const removed = editor.removePlugin(name, specName);
@@ -5095,7 +5461,7 @@ async function runList(opts) {
5095
5461
  const registry = createPluginRegistry();
5096
5462
  if (declared.length > 0) {
5097
5463
  try {
5098
- const { loadPlugins } = await import('../plugin-store-S7OMGI7N.js');
5464
+ const { loadPlugins } = await import('../plugin-store-QMJ2B3VM.js');
5099
5465
  const result = await loadPlugins(projectDir, declared, registry);
5100
5466
  for (const f of result.failed) logWarn(f.error);
5101
5467
  } catch (err) {
@@ -5292,7 +5658,7 @@ async function runRefInstall(ref, opts) {
5292
5658
  const spinner5 = p6.spinner();
5293
5659
  spinner5.start(`Installing ${ref}`);
5294
5660
  try {
5295
- const { openCatalogSource: openCatalogSource2, openLibrary: openLibrary2 } = await import('../open-library-4HMIDK3N.js');
5661
+ const { openCatalogSource: openCatalogSource2, openLibrary: openLibrary2 } = await import('../open-library-ODW2PJ2J.js');
5296
5662
  const catalog = await openCatalogSource2({ projectDir: path14__default.resolve(opts.projectDir) });
5297
5663
  if (!supportsInstallManifest(catalog)) {
5298
5664
  throw new Error(
@@ -5332,7 +5698,7 @@ async function runYamlInstall(opts) {
5332
5698
  return;
5333
5699
  }
5334
5700
  try {
5335
- const { ensureSourcesCloned } = await import('../ensure-sources-QDVFUIUP.js');
5701
+ const { ensureSourcesCloned } = await import('../ensure-sources-ORACQA4I.js');
5336
5702
  const hydrate = ensureSourcesCloned(projectDir, { quiet: true });
5337
5703
  if (hydrate.cloned.length > 0) {
5338
5704
  logOk(`Cloned source(s): ${hydrate.cloned.join(", ")}`);
@@ -5633,8 +5999,8 @@ function redactSecrets(preset, findings) {
5633
5999
  }
5634
6000
  return { preset: next, keys };
5635
6001
  }
5636
- function placeholderKey(itemId, path37) {
5637
- return `${itemId}_${path37}`.replace(/[^a-zA-Z0-9]+/g, "_").replace(/^_+|_+$/g, "").toUpperCase();
6002
+ function placeholderKey(itemId, path38) {
6003
+ return `${itemId}_${path38}`.replace(/[^a-zA-Z0-9]+/g, "_").replace(/^_+|_+$/g, "").toUpperCase();
5638
6004
  }
5639
6005
  function setAtPath(root, segments, value) {
5640
6006
  let node = root;
@@ -6247,7 +6613,7 @@ function makeRunCommand() {
6247
6613
  let dir = projectDir;
6248
6614
  for (let i = 0; i < 6; i++) {
6249
6615
  const candidate = path14__default.join(dir, "ai-assets");
6250
- if (fs12__default.existsSync(candidate)) {
6616
+ if (fs13__default.existsSync(candidate)) {
6251
6617
  priorityRoots.push(candidate);
6252
6618
  break;
6253
6619
  }
@@ -6406,13 +6772,13 @@ function makeReplCommand() {
6406
6772
  p6.cancel("Cancelled.");
6407
6773
  process.exit(0);
6408
6774
  }
6409
- const tmpDir = fs12__default.mkdtempSync(path14__default.join(os2.tmpdir(), "skaile-repl-"));
6775
+ const tmpDir = fs13__default.mkdtempSync(path14__default.join(os2.tmpdir(), "skaile-repl-"));
6410
6776
  projectDir = tmpDir;
6411
6777
  agentCwd = userCwd;
6412
6778
  logOk(`Temporary workspace: ${S.cmd(tmpDir)}`);
6413
6779
  if (!driverOverride) {
6414
6780
  const claudeDir = path14__default.join(os2.homedir(), ".claude");
6415
- if (fs12__default.existsSync(claudeDir)) {
6781
+ if (fs13__default.existsSync(claudeDir)) {
6416
6782
  driverOverride = "claude-sdk";
6417
6783
  logInfo(`Detected ${S.cmd("~/.claude")} \u2192 using ${S.cmd("claude-sdk")} backend`);
6418
6784
  } else {
@@ -6458,12 +6824,12 @@ function makeServeCommand() {
6458
6824
  );
6459
6825
  }
6460
6826
  async function ensurePluginsLoadedForServe(projectDir) {
6461
- const { logInfo: logInfo2, logWarn: logWarn2 } = await import('../helpers-TF7GCBRQ.js');
6827
+ const { logInfo: logInfo2, logWarn: logWarn2 } = await import('../helpers-SXGIHFCF.js');
6462
6828
  try {
6463
6829
  const { resolveSkWorkspaceConfig: resolveSkWorkspaceConfig2 } = await import('../core/index.js');
6464
6830
  const config = resolveSkWorkspaceConfig2(projectDir);
6465
6831
  if (!config.plugins || config.plugins.length === 0) return;
6466
- const { ensurePluginsLoaded } = await import('../plugin-store-S7OMGI7N.js');
6832
+ const { ensurePluginsLoaded } = await import('../plugin-store-QMJ2B3VM.js');
6467
6833
  const { pluginRegistry } = await import('../plugin-registry/index.js');
6468
6834
  const result = await ensurePluginsLoaded(projectDir, config.plugins, pluginRegistry);
6469
6835
  if (result.loaded.length > 0) {
@@ -6477,21 +6843,21 @@ async function ensurePluginsLoadedForServe(projectDir) {
6477
6843
  }
6478
6844
  }
6479
6845
  async function runCompileTest(opts) {
6480
- const { logOk: logOk2, logErr: logErr2, logInfo: logInfo2, S: S2 } = await import('../helpers-TF7GCBRQ.js');
6846
+ const { logOk: logOk2, logErr: logErr2, logInfo: logInfo2, S: S2 } = await import('../helpers-SXGIHFCF.js');
6481
6847
  const { tmpdir } = await import('os');
6482
- const { dirname: dirname4, join: join6, resolve: resolve5 } = await import('path');
6848
+ const { dirname: dirname4, join: join7, resolve: resolve5 } = await import('path');
6483
6849
  const { fileURLToPath: fileURLToPath2 } = await import('url');
6484
- const { unlinkSync, existsSync: existsSync14 } = await import('fs');
6850
+ const { unlinkSync, existsSync: existsSync15 } = await import('fs');
6485
6851
  const { spawn } = await import('child_process');
6486
6852
  const { portableSpawnSync: portableSpawnSync2 } = await import('../core/index.js');
6487
- const { MONOREPO_ROOT } = await import('../paths-P3DWFUPS.js');
6853
+ const { MONOREPO_ROOT } = await import('../paths-KOKCMBL5.js');
6488
6854
  if (MONOREPO_ROOT === null) {
6489
6855
  logErr2("--compile-test is only available inside the skaile-dev workspace.");
6490
6856
  logInfo2("Run it from a checkout of skaile-ai/skaile-dev (the monorepo shell).");
6491
6857
  process.exitCode = 2;
6492
6858
  return;
6493
6859
  }
6494
- const outfile = join6(tmpdir(), `skaile-compile-test-${Date.now()}`);
6860
+ const outfile = join7(tmpdir(), `skaile-compile-test-${Date.now()}`);
6495
6861
  const __thisFile = fileURLToPath2(import.meta.url);
6496
6862
  const entryPoint = resolve5(dirname4(__thisFile), "..", "index.ts");
6497
6863
  logInfo2(`Building compiled binary...`);
@@ -6543,7 +6909,7 @@ async function runCompileTest(opts) {
6543
6909
  } catch {
6544
6910
  }
6545
6911
  try {
6546
- if (existsSync14(outfile)) unlinkSync(outfile);
6912
+ if (existsSync15(outfile)) unlinkSync(outfile);
6547
6913
  } catch {
6548
6914
  }
6549
6915
  }
@@ -7265,12 +7631,12 @@ function showOverview(am2) {
7265
7631
  }
7266
7632
  function showAsset(am2, kind, name) {
7267
7633
  const entry = am2.info(`${kind}:${name}`);
7268
- if (entry?.source && fs12__default.existsSync(entry.source)) {
7634
+ if (entry?.source && fs13__default.existsSync(entry.source)) {
7269
7635
  console.log();
7270
7636
  console.log(` ${kindColor(entry.kind)} ${S.heading(entry.name)}`);
7271
7637
  console.log(` ${S.rule(40)}`);
7272
7638
  console.log();
7273
- console.log(fs12__default.readFileSync(entry.source, "utf-8"));
7639
+ console.log(fs13__default.readFileSync(entry.source, "utf-8"));
7274
7640
  return;
7275
7641
  }
7276
7642
  logErr(`Asset not found: ${kind}:${name}`);
@@ -7497,7 +7863,7 @@ function findManifestCandidates(rootPath) {
7497
7863
  function walk(dir) {
7498
7864
  let entries;
7499
7865
  try {
7500
- entries = fs12__default.readdirSync(dir, { withFileTypes: true });
7866
+ entries = fs13__default.readdirSync(dir, { withFileTypes: true });
7501
7867
  } catch {
7502
7868
  return;
7503
7869
  }
@@ -7543,7 +7909,7 @@ function checkManifestIdentity(kind, parsed) {
7543
7909
  return null;
7544
7910
  }
7545
7911
  function parseManifestCandidate(c, absRoot) {
7546
- const content = fs12__default.readFileSync(c.filePath, "utf-8");
7912
+ const content = fs13__default.readFileSync(c.filePath, "utf-8");
7547
7913
  if (c.filePath.endsWith(".md")) {
7548
7914
  const parsed = parseMdFrontmatter(content);
7549
7915
  if (parsed === null) {
@@ -7599,7 +7965,7 @@ function validateManifestCandidate(c, parsed, absRoot, registry, strictConforman
7599
7965
  }
7600
7966
  function validateManifests(rootPath, strictConformance) {
7601
7967
  const absRoot = path14__default.resolve(rootPath);
7602
- if (!fs12__default.existsSync(absRoot)) {
7968
+ if (!fs13__default.existsSync(absRoot)) {
7603
7969
  logErr(`Path does not exist: ${absRoot}`);
7604
7970
  return { total: 0, errors: 1, warnings: 0 };
7605
7971
  }
@@ -7631,7 +7997,7 @@ function findWorkspaceManifests(rootPath) {
7631
7997
  function walk(dir) {
7632
7998
  let entries;
7633
7999
  try {
7634
- entries = fs12__default.readdirSync(dir, { withFileTypes: true });
8000
+ entries = fs13__default.readdirSync(dir, { withFileTypes: true });
7635
8001
  } catch {
7636
8002
  return;
7637
8003
  }
@@ -7706,7 +8072,7 @@ function validateWorkspaceManifests(rootPath) {
7706
8072
  const relPath = path14__default.relative(absRoot, file);
7707
8073
  let parsed;
7708
8074
  try {
7709
- parsed = parse(fs12__default.readFileSync(file, "utf-8")) ?? {};
8075
+ parsed = parse(fs13__default.readFileSync(file, "utf-8")) ?? {};
7710
8076
  } catch (e) {
7711
8077
  logErr(`${relPath} \u2014 parse error: ${e instanceof Error ? e.message : String(e)}`);
7712
8078
  errors++;
@@ -7720,34 +8086,34 @@ function validateWorkspaceManifests(rootPath) {
7720
8086
  var EXCLUDED_DOMAINS = /* @__PURE__ */ new Set(["skaileup-shared", "external", "docs"]);
7721
8087
  function collectAssetVersions() {
7722
8088
  const assets = [];
7723
- if (!fs12__default.existsSync(AI_RESOURCES)) return assets;
7724
- const domains = fs12__default.readdirSync(AI_RESOURCES, { withFileTypes: true }).filter((d) => d.isDirectory() && !EXCLUDED_DOMAINS.has(d.name));
8089
+ if (!fs13__default.existsSync(AI_RESOURCES)) return assets;
8090
+ const domains = fs13__default.readdirSync(AI_RESOURCES, { withFileTypes: true }).filter((d) => d.isDirectory() && !EXCLUDED_DOMAINS.has(d.name));
7725
8091
  for (const d of domains) {
7726
8092
  const domainDir = path14__default.join(AI_RESOURCES, d.name);
7727
8093
  const skillsDir = path14__default.join(domainDir, "skills");
7728
- if (fs12__default.existsSync(skillsDir)) {
8094
+ if (fs13__default.existsSync(skillsDir)) {
7729
8095
  collectSkillVersions(skillsDir, d.name, assets);
7730
8096
  }
7731
8097
  const agentsDir = path14__default.join(domainDir, "agents");
7732
- if (fs12__default.existsSync(agentsDir)) {
8098
+ if (fs13__default.existsSync(agentsDir)) {
7733
8099
  collectAgentVersions(agentsDir, d.name, assets);
7734
8100
  }
7735
8101
  const flowsDir = path14__default.join(domainDir, "flows");
7736
- if (fs12__default.existsSync(flowsDir)) {
8102
+ if (fs13__default.existsSync(flowsDir)) {
7737
8103
  collectFlowVersions(flowsDir, d.name, assets);
7738
8104
  }
7739
8105
  const promptsDir = path14__default.join(domainDir, "prompts");
7740
- if (fs12__default.existsSync(promptsDir)) {
8106
+ if (fs13__default.existsSync(promptsDir)) {
7741
8107
  collectPromptVersions(promptsDir, d.name, assets);
7742
8108
  }
7743
8109
  }
7744
8110
  return assets;
7745
8111
  }
7746
8112
  function collectFlowVersions(dir, domain, out) {
7747
- for (const f of fs12__default.readdirSync(dir)) {
8113
+ for (const f of fs13__default.readdirSync(dir)) {
7748
8114
  if (!f.endsWith(".flow.yaml")) continue;
7749
8115
  const fp = path14__default.join(dir, f);
7750
- const content = fs12__default.readFileSync(fp, "utf-8");
8116
+ const content = fs13__default.readFileSync(fp, "utf-8");
7751
8117
  const parsed = parse(content);
7752
8118
  out.push({
7753
8119
  kind: "flow",
@@ -7759,10 +8125,10 @@ function collectFlowVersions(dir, domain, out) {
7759
8125
  }
7760
8126
  }
7761
8127
  function collectPromptVersions(dir, domain, out) {
7762
- for (const f of fs12__default.readdirSync(dir)) {
8128
+ for (const f of fs13__default.readdirSync(dir)) {
7763
8129
  if (!f.endsWith(".prompt.md")) continue;
7764
8130
  const fp = path14__default.join(dir, f);
7765
- const content = fs12__default.readFileSync(fp, "utf-8");
8131
+ const content = fs13__default.readFileSync(fp, "utf-8");
7766
8132
  const fm = parseSkillFrontmatter(content);
7767
8133
  out.push({
7768
8134
  kind: "prompt",
@@ -7774,12 +8140,12 @@ function collectPromptVersions(dir, domain, out) {
7774
8140
  }
7775
8141
  }
7776
8142
  function collectSkillVersions(dir, domain, out) {
7777
- for (const entry of fs12__default.readdirSync(dir, { withFileTypes: true })) {
8143
+ for (const entry of fs13__default.readdirSync(dir, { withFileTypes: true })) {
7778
8144
  if (!entry.isDirectory()) continue;
7779
8145
  const full = path14__default.join(dir, entry.name);
7780
8146
  const skillMd = path14__default.join(full, "SKILL.md");
7781
- if (fs12__default.existsSync(skillMd)) {
7782
- const content = fs12__default.readFileSync(skillMd, "utf-8");
8147
+ if (fs13__default.existsSync(skillMd)) {
8148
+ const content = fs13__default.readFileSync(skillMd, "utf-8");
7783
8149
  const fm = parseSkillFrontmatter(content);
7784
8150
  out.push({
7785
8151
  kind: "skill",
@@ -7794,11 +8160,11 @@ function collectSkillVersions(dir, domain, out) {
7794
8160
  }
7795
8161
  }
7796
8162
  function collectAgentVersions(dir, domain, out) {
7797
- for (const entry of fs12__default.readdirSync(dir, { withFileTypes: true })) {
8163
+ for (const entry of fs13__default.readdirSync(dir, { withFileTypes: true })) {
7798
8164
  if (!entry.isDirectory()) continue;
7799
8165
  const agentYaml = path14__default.join(dir, entry.name, "agent.yaml");
7800
- if (!fs12__default.existsSync(agentYaml)) continue;
7801
- const content = fs12__default.readFileSync(agentYaml, "utf-8");
8166
+ if (!fs13__default.existsSync(agentYaml)) continue;
8167
+ const content = fs13__default.readFileSync(agentYaml, "utf-8");
7802
8168
  const parsed = parse(content);
7803
8169
  out.push({
7804
8170
  kind: "agent",
@@ -7881,7 +8247,7 @@ function checkFlowVersionPins(assets) {
7881
8247
  }
7882
8248
  let errors = 0;
7883
8249
  for (const f of flows) {
7884
- const content = fs12__default.readFileSync(f.filePath, "utf-8");
8250
+ const content = fs13__default.readFileSync(f.filePath, "utf-8");
7885
8251
  const parsed = parse(content);
7886
8252
  const nodes = (parsed?.nodes ?? []).filter((n) => n.type === "skill" && n.data?.version).map((n) => ({
7887
8253
  nodeId: n.id,
@@ -8242,7 +8608,7 @@ program.command("init [project-dir]").description("Initialize a project director
8242
8608
  (projectDir, opts) => runInit(projectDir, opts)
8243
8609
  );
8244
8610
  async function runInit(projectDir, opts) {
8245
- const { mkdirSync: mkdirSync5, writeFileSync: writeFileSync4 } = await import('fs');
8611
+ const { mkdirSync: mkdirSync5, writeFileSync: writeFileSync5 } = await import('fs');
8246
8612
  const { stringify: stringify2 } = await import('yaml');
8247
8613
  const { DRIVER_TARGETS, SUPPORTED_DRIVER_TARGETS: SUPPORTED_DRIVER_TARGETS2 } = await import('../core/index.js');
8248
8614
  const backend = opts.backend;
@@ -8254,29 +8620,29 @@ async function runInit(projectDir, opts) {
8254
8620
  const resolved = path14__default.resolve(projectDir ?? ".");
8255
8621
  const projectName = path14__default.basename(resolved);
8256
8622
  const created = [];
8257
- const { existsSync: existsSync14 } = await import('fs');
8258
- if (!existsSync14(resolved)) {
8623
+ const { existsSync: existsSync15 } = await import('fs');
8624
+ if (!existsSync15(resolved)) {
8259
8625
  mkdirSync5(resolved, { recursive: true });
8260
8626
  created.push(".");
8261
8627
  }
8262
8628
  const skaileDir = path14__default.join(resolved, ".skaile");
8263
- if (!existsSync14(skaileDir)) {
8629
+ if (!existsSync15(skaileDir)) {
8264
8630
  mkdirSync5(path14__default.join(skaileDir, "sessions"), { recursive: true });
8265
8631
  created.push(".skaile/");
8266
8632
  }
8267
8633
  const settingsPath = path14__default.join(skaileDir, "settings.json");
8268
- if (!existsSync14(settingsPath)) {
8269
- writeFileSync4(settingsPath, "{}\n");
8634
+ if (!existsSync15(settingsPath)) {
8635
+ writeFileSync5(settingsPath, "{}\n");
8270
8636
  created.push(".skaile/settings.json");
8271
8637
  }
8272
8638
  const wsConfigPath = path14__default.join(resolved, "skaile.yaml");
8273
- if (!existsSync14(wsConfigPath)) {
8274
- writeFileSync4(wsConfigPath, stringify2(buildInitWorkspaceConfig(projectName, backend)));
8639
+ if (!existsSync15(wsConfigPath)) {
8640
+ writeFileSync5(wsConfigPath, stringify2(buildInitWorkspaceConfig(projectName, backend)));
8275
8641
  created.push("skaile.yaml");
8276
8642
  }
8277
8643
  for (const dir of new Set(Object.values(DRIVER_TARGETS[backend].local))) {
8278
8644
  const full = path14__default.join(resolved, dir);
8279
- if (!existsSync14(full)) {
8645
+ if (!existsSync15(full)) {
8280
8646
  mkdirSync5(full, { recursive: true });
8281
8647
  created.push(`${dir}/`);
8282
8648
  }
@@ -8307,7 +8673,7 @@ function buildInitWorkspaceConfig(projectName, backend) {
8307
8673
  }
8308
8674
  async function initGitScaffold(resolved, created) {
8309
8675
  const { execSync: execSync3 } = await import('child_process');
8310
- const { existsSync: existsSync14, readFileSync: readFileSync8, writeFileSync: writeFileSync4 } = await import('fs');
8676
+ const { existsSync: existsSync15, readFileSync: readFileSync9, writeFileSync: writeFileSync5 } = await import('fs');
8311
8677
  const gitignorePath = path14__default.join(resolved, ".gitignore");
8312
8678
  const entries = [
8313
8679
  "node_modules/",
@@ -8323,16 +8689,16 @@ async function initGitScaffold(resolved, created) {
8323
8689
  ".env",
8324
8690
  ".env.local"
8325
8691
  ];
8326
- const existing = existsSync14(gitignorePath) ? readFileSync8(gitignorePath, "utf-8") : "";
8692
+ const existing = existsSync15(gitignorePath) ? readFileSync9(gitignorePath, "utf-8") : "";
8327
8693
  const have = new Set(existing.split("\n").map((l) => l.trim()));
8328
8694
  const append = entries.filter((e) => !have.has(e));
8329
8695
  if (append.length > 0) {
8330
8696
  const prefix = existing && !existing.endsWith("\n") ? "\n" : "";
8331
- writeFileSync4(gitignorePath, `${existing + prefix}${append.join("\n")}
8697
+ writeFileSync5(gitignorePath, `${existing + prefix}${append.join("\n")}
8332
8698
  `);
8333
8699
  if (!existing) created.push(".gitignore");
8334
8700
  }
8335
- if (!existsSync14(path14__default.join(resolved, ".git"))) {
8701
+ if (!existsSync15(path14__default.join(resolved, ".git"))) {
8336
8702
  try {
8337
8703
  execSync3("git init", { cwd: resolved, stdio: "pipe" });
8338
8704
  created.push(".git/");
@@ -8344,10 +8710,10 @@ async function initGitScaffold(resolved, created) {
8344
8710
  }
8345
8711
  async function bootstrapUserConfig() {
8346
8712
  try {
8347
- const fs13 = await import('fs');
8713
+ const fs14 = await import('fs');
8348
8714
  const { userConfigPath, saveConfig, getConfigDefaults } = await import('../library/index.js');
8349
8715
  const userCfgPath = userConfigPath();
8350
- if (!fs13.existsSync(userCfgPath)) {
8716
+ if (!fs14.existsSync(userCfgPath)) {
8351
8717
  const defaults = getConfigDefaults();
8352
8718
  saveConfig(userCfgPath, {
8353
8719
  catalog: { url: defaults.catalog.url, cache_ttl: defaults.catalog.cache_ttl }
@@ -8362,7 +8728,7 @@ async function bootstrapUserConfig() {
8362
8728
  }
8363
8729
  async function hydrateInitSources(resolved, created) {
8364
8730
  try {
8365
- const { ensureSourcesCloned } = await import('../ensure-sources-QDVFUIUP.js');
8731
+ const { ensureSourcesCloned } = await import('../ensure-sources-ORACQA4I.js');
8366
8732
  const hydrate = ensureSourcesCloned(resolved, { quiet: true });
8367
8733
  for (const n of hydrate.cloned) created.push(`~/.skaile/cache/sources/${n}/`);
8368
8734
  if (hydrate.failed.length > 0) {
@@ -8402,7 +8768,7 @@ function printInitSummary(resolved, projectDir, created) {
8402
8768
  console.log();
8403
8769
  }
8404
8770
  program.command("setup").description("Interactive provider setup wizard").action(async () => {
8405
- const { cmdSetup } = await import('../setup-2CCS63L6.js');
8771
+ const { cmdSetup } = await import('../setup-ETGRXSZG.js');
8406
8772
  await cmdSetup([], { projectDir: process.cwd() });
8407
8773
  });
8408
8774
  program.addCommand(makeInstallCommand());