@skaile/workspaces 0.43.0 → 0.44.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.
Files changed (160) hide show
  1. package/CHANGELOG.md +37 -0
  2. package/dist/{asset-feeds-3PSV57NT.js → asset-feeds-EGSG4FUB.js} +15 -11
  3. package/dist/asset-feeds-EGSG4FUB.js.map +1 -0
  4. package/dist/asset-manager/index.js +5 -5
  5. package/dist/asset-manager/installer.js +4 -4
  6. package/dist/asset-manager/src/index.d.ts +102 -4
  7. package/dist/asset-manager/src/index.d.ts.map +1 -1
  8. package/dist/{chunk-XMKBIVG3.js → chunk-5LHPKVGR.js} +9 -9
  9. package/dist/{chunk-XMKBIVG3.js.map → chunk-5LHPKVGR.js.map} +1 -1
  10. package/dist/{chunk-4UTJNFUS.js → chunk-7NQXVBCQ.js} +5 -5
  11. package/dist/{chunk-4UTJNFUS.js.map → chunk-7NQXVBCQ.js.map} +1 -1
  12. package/dist/{chunk-KYQNWFJV.js → chunk-BLGHFVXE.js} +3 -3
  13. package/dist/{chunk-KYQNWFJV.js.map → chunk-BLGHFVXE.js.map} +1 -1
  14. package/dist/{chunk-R4H6EJW5.js → chunk-CBZEIFU4.js} +3 -3
  15. package/dist/{chunk-R4H6EJW5.js.map → chunk-CBZEIFU4.js.map} +1 -1
  16. package/dist/{chunk-GJI6FZ56.js → chunk-COSTF7QW.js} +60 -8
  17. package/dist/chunk-COSTF7QW.js.map +1 -0
  18. package/dist/{chunk-NYMRKIOR.js → chunk-CVWA4RIK.js} +4 -4
  19. package/dist/{chunk-NYMRKIOR.js.map → chunk-CVWA4RIK.js.map} +1 -1
  20. package/dist/{chunk-BXYMGZCI.js → chunk-ETDXTGDF.js} +3 -3
  21. package/dist/{chunk-BXYMGZCI.js.map → chunk-ETDXTGDF.js.map} +1 -1
  22. package/dist/{chunk-TDSRLMDB.js → chunk-EVZKWY5J.js} +2 -2
  23. package/dist/chunk-EVZKWY5J.js.map +1 -0
  24. package/dist/{chunk-3HUUP3JC.js → chunk-FYLIR4AV.js} +107 -7
  25. package/dist/chunk-FYLIR4AV.js.map +1 -0
  26. package/dist/{chunk-G6FJZG4C.js → chunk-GM3BV6JK.js} +2 -2
  27. package/dist/{chunk-G6FJZG4C.js.map → chunk-GM3BV6JK.js.map} +1 -1
  28. package/dist/{chunk-R2SKIYU2.js → chunk-JUZLVRI4.js} +265 -38
  29. package/dist/chunk-JUZLVRI4.js.map +1 -0
  30. package/dist/{chunk-F5Q2RMH4.js → chunk-LMRO2QNF.js} +177 -135
  31. package/dist/chunk-LMRO2QNF.js.map +1 -0
  32. package/dist/{chunk-JZQFZ55W.js → chunk-NHLXS2CH.js} +2 -2
  33. package/dist/{chunk-JZQFZ55W.js.map → chunk-NHLXS2CH.js.map} +1 -1
  34. package/dist/{chunk-CIEKKLMG.js → chunk-PCXU2CVW.js} +3 -3
  35. package/dist/{chunk-CIEKKLMG.js.map → chunk-PCXU2CVW.js.map} +1 -1
  36. package/dist/{chunk-HVCZLD5Z.js → chunk-VPXV2Z5E.js} +5 -7
  37. package/dist/chunk-VPXV2Z5E.js.map +1 -0
  38. package/dist/{chunk-2BEDUMTA.js → chunk-XF2BBX6P.js} +3 -3
  39. package/dist/{chunk-2BEDUMTA.js.map → chunk-XF2BBX6P.js.map} +1 -1
  40. package/dist/{chunk-3K2CYDBT.js → chunk-Z5Z3MYDL.js} +8 -4
  41. package/dist/chunk-Z5Z3MYDL.js.map +1 -0
  42. package/dist/{chunk-M54RYUXY.js → chunk-ZAEJ33Y6.js} +19 -7
  43. package/dist/chunk-ZAEJ33Y6.js.map +1 -0
  44. package/dist/cli/index.js +395 -286
  45. package/dist/cli/index.js.map +1 -1
  46. package/dist/cli/src/asset-feeds.d.ts.map +1 -1
  47. package/dist/cli/src/commands/cache.d.ts +27 -0
  48. package/dist/cli/src/commands/cache.d.ts.map +1 -0
  49. package/dist/cli/src/commands/catalog.d.ts.map +1 -1
  50. package/dist/cli/src/commands/manage.d.ts.map +1 -1
  51. package/dist/cli/src/commands/npx.d.ts +1 -1
  52. package/dist/cli/src/commands/source.d.ts +3 -1
  53. package/dist/cli/src/commands/source.d.ts.map +1 -1
  54. package/dist/cli/src/commands/update.d.ts +1 -1
  55. package/dist/cli/src/ensure-sources.d.ts +2 -2
  56. package/dist/cli/src/ensure-sources.d.ts.map +1 -1
  57. package/dist/connectors/config.js +4 -4
  58. package/dist/connectors/index.js +6 -6
  59. package/dist/connectors/rclone.js +1 -1
  60. package/dist/connectors/src/connector-manager.d.ts +21 -4
  61. package/dist/connectors/src/connector-manager.d.ts.map +1 -1
  62. package/dist/connectors/src/fleet-health-gate.d.ts +2 -0
  63. package/dist/connectors/src/fleet-health-gate.d.ts.map +1 -1
  64. package/dist/connectors/src/fleet-utils.d.ts +10 -0
  65. package/dist/connectors/src/fleet-utils.d.ts.map +1 -1
  66. package/dist/connectors/src/mount-placeholder.d.ts +11 -0
  67. package/dist/connectors/src/mount-placeholder.d.ts.map +1 -1
  68. package/dist/connectors/src/rclone-process-manager.d.ts +57 -2
  69. package/dist/connectors/src/rclone-process-manager.d.ts.map +1 -1
  70. package/dist/core/index.js +3 -3
  71. package/dist/core/runtime-assets.js +2 -2
  72. package/dist/core/src/cache-paths.d.ts +25 -0
  73. package/dist/core/src/cache-paths.d.ts.map +1 -0
  74. package/dist/core/src/index.d.ts +1 -0
  75. package/dist/core/src/index.d.ts.map +1 -1
  76. package/dist/core/src/repo-manager.d.ts +11 -8
  77. package/dist/core/src/repo-manager.d.ts.map +1 -1
  78. package/dist/core/src/runtime-assets.d.ts.map +1 -1
  79. package/dist/core/src/workspace-config.d.ts +2 -2
  80. package/dist/core/src/workspace-config.d.ts.map +1 -1
  81. package/dist/core/workspace-config.js +1 -1
  82. package/dist/deploy/index.js +3 -3
  83. package/dist/{ensure-sources-VQDZB7NT.js → ensure-sources-NSDMTAWN.js} +6 -12
  84. package/dist/ensure-sources-NSDMTAWN.js.map +1 -0
  85. package/dist/factory-assets/connectors/deploy.js +6 -6
  86. package/dist/factory-assets/connectors/devserver.js +6 -6
  87. package/dist/factory-assets/connectors/flow/adapter.js +6 -6
  88. package/dist/factory-assets/connectors/flow/engine.js +3 -3
  89. package/dist/factory-assets/connectors/flow/run-flow.js +7 -7
  90. package/dist/factory-assets/connectors/flow.js +6 -6
  91. package/dist/factory-assets/connectors/git.js +6 -6
  92. package/dist/factory-assets/connectors/gmail.js +6 -6
  93. package/dist/factory-assets/connectors/googledrive.js +6 -6
  94. package/dist/factory-assets/connectors/local.js +6 -6
  95. package/dist/factory-assets/connectors/mattermost.js +6 -6
  96. package/dist/factory-assets/connectors/memory.js +6 -6
  97. package/dist/factory-assets/connectors/minio.js +6 -6
  98. package/dist/factory-assets/connectors/postgres.js +6 -6
  99. package/dist/factory-assets/connectors/s3.js +6 -6
  100. package/dist/factory-assets/connectors/sharepoint.js +6 -6
  101. package/dist/factory-assets/connectors/sqlite.js +6 -6
  102. package/dist/factory-assets/connectors/static-server.js +6 -6
  103. package/dist/factory-assets/connectors/tunnel.js +6 -6
  104. package/dist/factory-assets/connectors/webdav.js +6 -6
  105. package/dist/factory-assets/connectors/xstate-store.js +6 -6
  106. package/dist/factory-assets/connectors/xstate.js +6 -6
  107. package/dist/{flows-KTBCZ5GQ.js → flows-WELXQ7IG.js} +3 -3
  108. package/dist/{flows-KTBCZ5GQ.js.map → flows-WELXQ7IG.js.map} +1 -1
  109. package/dist/library/index.js +4 -4
  110. package/dist/library/install.js +3 -3
  111. package/dist/library/src/local/local-catalog-source.d.ts +1 -1
  112. package/dist/library/src/local/sidecar-git.d.ts +2 -2
  113. package/dist/library/src/local/sidecar-paths.d.ts +12 -10
  114. package/dist/library/src/local/sidecar-paths.d.ts.map +1 -1
  115. package/dist/library/src/local/store-paths.d.ts +2 -2
  116. package/dist/library/src/remote/cache.d.ts +8 -2
  117. package/dist/library/src/remote/cache.d.ts.map +1 -1
  118. package/dist/library/src/remote/remote-catalog-source.d.ts +1 -1
  119. package/dist/library/src/remote/rest-catalog-source.d.ts +1 -1
  120. package/dist/{open-library-FHUXOCN7.js → open-library-362BZ6OW.js} +7 -7
  121. package/dist/{open-library-FHUXOCN7.js.map → open-library-362BZ6OW.js.map} +1 -1
  122. package/dist/{paths-7H5CSBLQ.js → paths-4SSFMX5Z.js} +6 -6
  123. package/dist/{paths-7H5CSBLQ.js.map → paths-4SSFMX5Z.js.map} +1 -1
  124. package/dist/{plugin-store-LGLN2QUX.js → plugin-store-RBCDBO7K.js} +5 -5
  125. package/dist/{plugin-store-LGLN2QUX.js.map → plugin-store-RBCDBO7K.js.map} +1 -1
  126. package/dist/runner/index.js +9 -9
  127. package/dist/sdk/asset-manager.js +5 -5
  128. package/dist/sdk/core.js +3 -3
  129. package/dist/sdk/flow.js +3 -3
  130. package/dist/sdk/index.js +9 -9
  131. package/dist/sdk/runner.js +9 -9
  132. package/dist/sdk/session.js +2 -2
  133. package/dist/sdk/types.js +1 -1
  134. package/dist/session/index.js +2 -2
  135. package/dist/session/src/index.d.ts +1 -1
  136. package/dist/session/src/index.d.ts.map +1 -1
  137. package/dist/session/src/mentions.d.ts +11 -0
  138. package/dist/session/src/mentions.d.ts.map +1 -1
  139. package/dist/{setup-EVNPECSY.js → setup-VGZTFQ32.js} +5 -5
  140. package/dist/{setup-EVNPECSY.js.map → setup-VGZTFQ32.js.map} +1 -1
  141. package/dist/{store-client-4XN7IB3R.js → store-client-XFZFKY3W.js} +6 -6
  142. package/dist/{store-client-4XN7IB3R.js.map → store-client-XFZFKY3W.js.map} +1 -1
  143. package/dist/tui/index.js +9 -9
  144. package/dist/types/index.js +1 -1
  145. package/dist/types/src/mentions.d.ts +12 -0
  146. package/dist/types/src/mentions.d.ts.map +1 -1
  147. package/dist/workspace-plugin/adapters/mcp.js +1 -1
  148. package/dist/workspace-plugin/adapters/omp.js +3 -3
  149. package/dist/workspace-plugin/index.js +1 -1
  150. package/package.json +1 -1
  151. package/dist/asset-feeds-3PSV57NT.js.map +0 -1
  152. package/dist/chunk-3HUUP3JC.js.map +0 -1
  153. package/dist/chunk-3K2CYDBT.js.map +0 -1
  154. package/dist/chunk-F5Q2RMH4.js.map +0 -1
  155. package/dist/chunk-GJI6FZ56.js.map +0 -1
  156. package/dist/chunk-HVCZLD5Z.js.map +0 -1
  157. package/dist/chunk-M54RYUXY.js.map +0 -1
  158. package/dist/chunk-R2SKIYU2.js.map +0 -1
  159. package/dist/chunk-TDSRLMDB.js.map +0 -1
  160. package/dist/ensure-sources-VQDZB7NT.js.map +0 -1
package/dist/cli/index.js CHANGED
@@ -1,19 +1,19 @@
1
1
  #!/usr/bin/env node
2
- import { openCatalogSource, openLibraryManager, createFullRegistry, openLibrary } from '../chunk-CIEKKLMG.js';
2
+ import { openCatalogSource, openLibraryManager, createFullRegistry, openLibrary } from '../chunk-PCXU2CVW.js';
3
3
  import { logErr, S, logOk, logInfo, colorRef, logWarn, kindColorPad, kindColor, formatRelativeTime, fitWidth } from '../chunk-GYPA2Q7F.js';
4
- import { getStoreConfig, storeFetch, saveStoreTokens, clearStoreTokens, isStoreAuthenticated } from '../chunk-2BEDUMTA.js';
5
- import { AI_RESOURCES, aiResourceRoots } from '../chunk-BXYMGZCI.js';
4
+ import { getStoreConfig, storeFetch, saveStoreTokens, clearStoreTokens, isStoreAuthenticated } from '../chunk-XF2BBX6P.js';
5
+ import { AI_RESOURCES, aiResourceRoots } from '../chunk-ETDXTGDF.js';
6
6
  import { LocalSecretsProvider } from '../chunk-6BEGKO2Q.js';
7
- import { resolveLibraryDir, LocalCatalogSource, skaileHomeDir } from '../chunk-M54RYUXY.js';
7
+ import { resolveLibraryDir, LocalCatalogSource } from '../chunk-ZAEJ33Y6.js';
8
8
  import '../chunk-5FVJXQDP.js';
9
9
  import '../chunk-JXT46QFC.js';
10
10
  import '../chunk-UKJMQZV6.js';
11
11
  import '../chunk-R7FOF242.js';
12
- import { runFlow, resumeFlow } from '../chunk-4UTJNFUS.js';
12
+ import { runFlow, resumeFlow } from '../chunk-7NQXVBCQ.js';
13
13
  import '../chunk-4R6DROGN.js';
14
14
  import { validateFlowVersions, parseSkillFrontmatter } from '../chunk-GXC3TYMQ.js';
15
- import { runAgentChat, loadSessionById, loadSession, listSessions, setCurrentSession, deleteSession, clearSession, loadAgentManifest, compileComposition, MarkdownStreamer, resolveMixin } from '../chunk-XMKBIVG3.js';
16
- import { buildClaudePluginFiles } from '../chunk-JZQFZ55W.js';
15
+ import { runAgentChat, loadSessionById, loadSession, listSessions, setCurrentSession, deleteSession, clearSession, loadAgentManifest, compileComposition, MarkdownStreamer, resolveMixin } from '../chunk-5LHPKVGR.js';
16
+ import { buildClaudePluginFiles } from '../chunk-NHLXS2CH.js';
17
17
  import '../chunk-X5YPJV4N.js';
18
18
  import '../chunk-O7SG5PC2.js';
19
19
  import '../chunk-7QBNJTTQ.js';
@@ -21,30 +21,30 @@ import '../chunk-GTS2FODO.js';
21
21
  import '../chunk-WQ7DE5UC.js';
22
22
  import '../chunk-32NA4TVC.js';
23
23
  import '../chunk-W3UDISS2.js';
24
- import '../chunk-TDSRLMDB.js';
24
+ import '../chunk-EVZKWY5J.js';
25
25
  import '../chunk-5C3QJSOD.js';
26
26
  import '../chunk-RRVQAE5D.js';
27
27
  import '../chunk-BMQKMOQY.js';
28
28
  import '../chunk-GAH4YRCI.js';
29
29
  import '../chunk-OCAQH66V.js';
30
30
  import '../chunk-LV2HPH3C.js';
31
- import '../chunk-F5Q2RMH4.js';
31
+ import '../chunk-LMRO2QNF.js';
32
32
  import '../chunk-OVRSNIKJ.js';
33
- import '../chunk-R4H6EJW5.js';
34
- import '../chunk-3HUUP3JC.js';
33
+ import '../chunk-CBZEIFU4.js';
34
+ import '../chunk-FYLIR4AV.js';
35
35
  import '../chunk-6E6PKKAD.js';
36
36
  import { loadFlow, loadAllFlows } from '../chunk-X46FY45B.js';
37
37
  import '../chunk-DEYYRFQU.js';
38
38
  import '../chunk-IFGTRL2I.js';
39
- import { AssetManager } from '../chunk-R2SKIYU2.js';
40
- import '../chunk-NYMRKIOR.js';
41
- import { readLock, resolveSettings, globalSettingsPath, projectSettingsPath, loadSettings, saveSettings, portableSpawn, portableSpawnSync, WorkspaceYamlEditor } from '../chunk-KYQNWFJV.js';
39
+ import { AssetManager, NON_DEPLOYABLE_KINDS } from '../chunk-JUZLVRI4.js';
40
+ import '../chunk-CVWA4RIK.js';
41
+ import { readLock, resolveSettings, globalSettingsPath, projectSettingsPath, loadSettings, saveSettings, portableSpawn, portableSpawnSync, WorkspaceYamlEditor } from '../chunk-BLGHFVXE.js';
42
42
  import { assetSearchDirs, detectDomains } from '../chunk-ZAP2BDHG.js';
43
- import '../chunk-HVCZLD5Z.js';
44
- import { resolveAgentDir, findWorkspaceRoot, workspaceConfigFilename, resolveSkWorkspaceConfig } from '../chunk-GJI6FZ56.js';
43
+ import '../chunk-VPXV2Z5E.js';
44
+ import { globalCacheRoot, getGlobalCacheDir, resolveAgentDir, findWorkspaceRoot, workspaceConfigFilename, resolveSkWorkspaceConfig } from '../chunk-COSTF7QW.js';
45
45
  import { SKAILE_MANIFEST_FILENAME, decodeSkaileManifest } from '../chunk-DZCK7GRW.js';
46
46
  import { parseFrontmatter } from '../chunk-6IDBWPK2.js';
47
- import { ASSET_KINDS, parseAssetRef, isValidAssetName, ASSET_NAME_HINT, assetRefToStr } from '../chunk-GEEW6SY2.js';
47
+ import { parseAssetRef, ASSET_KINDS, isValidAssetName, ASSET_NAME_HINT, assetRefToStr } from '../chunk-GEEW6SY2.js';
48
48
  import '../chunk-XGCXFX7X.js';
49
49
  import { SUPPORTED_DRIVER_TARGETS } from '../chunk-O4JH3KUE.js';
50
50
  import { DRIVER_DEFAULTS } from '../chunk-K5GBV4SA.js';
@@ -56,19 +56,19 @@ import '../chunk-RGPBEGP2.js';
56
56
  import '../chunk-CGYEHQOX.js';
57
57
  import '../chunk-NSBPE2FW.js';
58
58
  import * as fs11 from 'fs';
59
- import fs11__default, { readFileSync, existsSync, writeFileSync, readdirSync, rmSync, statSync } from 'fs';
60
- import * as path12 from 'path';
61
- import path12__default, { resolve, join } from 'path';
59
+ import fs11__default, { readFileSync, existsSync, writeFileSync, lstatSync, rmSync, readdirSync, statSync } from 'fs';
60
+ import * as path13 from 'path';
61
+ import path13__default, { resolve, join } from 'path';
62
62
  import { fileURLToPath } from 'url';
63
63
  import { Help, Command, Option } from 'commander';
64
- import * as p5 from '@clack/prompts';
64
+ import { homedir } from 'os';
65
+ import * as p6 from '@clack/prompts';
65
66
  import pc5 from 'picocolors';
66
67
  import * as readline from 'readline';
67
68
  import { createInterface } from 'readline';
68
69
  import fs5 from 'fs/promises';
69
70
  import { parse as parse$1, stringify } from 'smol-toml';
70
71
  import { execSync, spawnSync } from 'child_process';
71
- import { homedir } from 'os';
72
72
  import { createTRPCUntypedClient, httpLink, httpSubscriptionLink } from '@trpc/client';
73
73
  import { parse } from 'yaml';
74
74
 
@@ -107,10 +107,10 @@ function makeAssetCommand() {
107
107
  );
108
108
  process.exit(1);
109
109
  }
110
- const basename2 = path12.basename(srcPath);
111
- const destDir = target.structure === "domain" && opts.domain ? path12.join(target.path, opts.domain) : target.path;
110
+ const basename2 = path13.basename(srcPath);
111
+ const destDir = target.structure === "domain" && opts.domain ? path13.join(target.path, opts.domain) : target.path;
112
112
  fs11.mkdirSync(destDir, { recursive: true });
113
- const destPath = path12.join(destDir, basename2);
113
+ const destPath = path13.join(destDir, basename2);
114
114
  if (fs11.existsSync(destPath)) {
115
115
  logErr(`Destination already exists: ${destPath}`);
116
116
  process.exit(1);
@@ -123,7 +123,7 @@ function makeAssetCommand() {
123
123
  fs11.renameSync(srcPath, destPath);
124
124
  break;
125
125
  case "link":
126
- fs11.symlinkSync(path12.resolve(srcPath), destPath);
126
+ fs11.symlinkSync(path13.resolve(srcPath), destPath);
127
127
  break;
128
128
  }
129
129
  if (target.backend === "git" && opts.commit) {
@@ -171,17 +171,17 @@ function makeAssetCommand() {
171
171
  }
172
172
  const manifestPath = def.manifest.path;
173
173
  const candidateSubpath = typeof manifestPath === "string" && manifestPath.length > 0 ? manifestPath : def.name;
174
- const srcPath = path12.join(lib.path, candidateSubpath);
174
+ const srcPath = path13.join(lib.path, candidateSubpath);
175
175
  if (!fs11.existsSync(srcPath)) {
176
176
  logErr(`Asset path not found: ${srcPath}`);
177
177
  process.exit(1);
178
178
  }
179
- const destPath = path12.join(target, candidateSubpath);
180
- fs11.mkdirSync(path12.dirname(destPath), { recursive: true });
179
+ const destPath = path13.join(target, candidateSubpath);
180
+ fs11.mkdirSync(path13.dirname(destPath), { recursive: true });
181
181
  if (opts.mode === "copy") {
182
182
  fs11.cpSync(srcPath, destPath, { recursive: true });
183
183
  } else {
184
- fs11.symlinkSync(path12.resolve(srcPath), destPath);
184
+ fs11.symlinkSync(path13.resolve(srcPath), destPath);
185
185
  }
186
186
  logOk(`Installed ${ref} \u2192 ${destPath} (${opts.mode})`);
187
187
  } finally {
@@ -266,6 +266,102 @@ function makeAuthCommand() {
266
266
  });
267
267
  return cmd;
268
268
  }
269
+ function collectCacheTargets(scope) {
270
+ const out = [];
271
+ out.push(path13__default.join(scope.projectDir, ".skaile", "cache"));
272
+ out.push(path13__default.join(scope.projectDir, ".skaile", "store-cache"));
273
+ out.push(path13__default.join(scope.projectDir, ".skaile", "repos"));
274
+ if (scope.global) {
275
+ out.push(globalCacheRoot());
276
+ const home = process.env.SKAILE_HOME ?? path13__default.join(homedir(), ".skaile");
277
+ out.push(path13__default.join(home, "repos"));
278
+ out.push(path13__default.join(home, "catalog-cache"));
279
+ }
280
+ return out;
281
+ }
282
+ function dirSize(target) {
283
+ if (!existsSync(target)) return 0;
284
+ const st = lstatSync(target);
285
+ if (st.isSymbolicLink()) return 0;
286
+ if (!st.isDirectory()) return st.size;
287
+ return dirSizeOfDir(target);
288
+ }
289
+ function dirSizeOfDir(dir) {
290
+ let total = 0;
291
+ for (const ent of readdirSync(dir, { withFileTypes: true })) {
292
+ const child = path13__default.join(dir, ent.name);
293
+ if (ent.isSymbolicLink()) continue;
294
+ if (ent.isDirectory()) total += dirSizeOfDir(child);
295
+ else if (ent.isFile()) total += statSync(child).size;
296
+ }
297
+ return total;
298
+ }
299
+ function removeCacheTargets(targets, opts) {
300
+ const present = targets.filter((t) => existsSync(t));
301
+ for (const t of present) rmSync(t, { recursive: true, force: true });
302
+ return present;
303
+ }
304
+ function fmtBytes(n) {
305
+ const u = ["B", "KB", "MB", "GB"];
306
+ let i = 0;
307
+ let v = n;
308
+ while (v >= 1024 && i < u.length - 1) {
309
+ v /= 1024;
310
+ i++;
311
+ }
312
+ return `${v.toFixed(i === 0 ? 0 : 1)} ${u[i]}`;
313
+ }
314
+ function makeCacheCommand() {
315
+ const cmd = new Command("cache").description("Inspect and reclaim the re-derivable cache");
316
+ cmd.command("clean").description("Remove the project cache (.skaile/cache); --global also clears ~/.skaile/cache").option("--global", "Also clear the global cache (sources + catalog) and legacy dirs").option("--dry-run", "Show what would be removed without doing it").option("-y, --yes", "Skip confirmation prompt").option("--project-dir <path>", "Project directory", process.cwd()).action(async (opts) => {
317
+ const targets = collectCacheTargets({
318
+ projectDir: path13__default.resolve(opts.projectDir),
319
+ global: opts.global
320
+ }).filter((t) => existsSync(t));
321
+ if (targets.length === 0) {
322
+ logInfo("Cache is already empty.");
323
+ return;
324
+ }
325
+ console.log();
326
+ console.log(` ${S.heading("Will remove:")}`);
327
+ for (const t of targets)
328
+ console.log(` ${S.dim(t)} ${S.dim(`(${fmtBytes(dirSize(t))})`)}`);
329
+ if (opts.dryRun) {
330
+ console.log();
331
+ logInfo("Dry run \u2014 no changes made.");
332
+ return;
333
+ }
334
+ if (!opts.yes) {
335
+ const ok = await p6.confirm({
336
+ message: opts.global ? "Clear project AND global cache?" : "Clear project cache?"
337
+ });
338
+ if (p6.isCancel(ok) || !ok) {
339
+ logInfo("Cancelled.");
340
+ return;
341
+ }
342
+ }
343
+ const removed = removeCacheTargets(targets);
344
+ console.log();
345
+ for (const r of removed) logOk(`Removed ${r}`);
346
+ });
347
+ cmd.command("dir").description("Print the resolved cache roots").option("--global", "Include the global cache root").option("--project-dir <path>", "Project directory", process.cwd()).action((opts) => {
348
+ console.log(path13__default.join(path13__default.resolve(opts.projectDir), ".skaile", "cache"));
349
+ if (opts.global) console.log(globalCacheRoot());
350
+ });
351
+ cmd.command("size").description("Show cache disk usage per directory").option("--global", "Include the global cache").option("--project-dir <path>", "Project directory", process.cwd()).action((opts) => {
352
+ const targets = collectCacheTargets({
353
+ projectDir: path13__default.resolve(opts.projectDir),
354
+ global: opts.global
355
+ });
356
+ console.log();
357
+ for (const t of targets) {
358
+ if (!existsSync(t)) continue;
359
+ console.log(` ${S.dim(fmtBytes(dirSize(t)).padStart(9))} ${t}`);
360
+ }
361
+ console.log();
362
+ });
363
+ return cmd;
364
+ }
269
365
  async function runSearch(kind, query, opts) {
270
366
  if (kind?.includes(":")) {
271
367
  query = kind;
@@ -281,7 +377,7 @@ async function runSearch(kind, query, opts) {
281
377
  }
282
378
  }
283
379
  function searchLocal(query, kind, opts, showStore) {
284
- const am2 = new AssetManager({ projectDir: path12__default.resolve(opts.projectDir) });
380
+ const am2 = new AssetManager({ projectDir: path13__default.resolve(opts.projectDir) });
285
381
  const entries = am2.search(query, kind);
286
382
  if (entries.length === 0) {
287
383
  if (!showStore) {
@@ -321,7 +417,7 @@ function printLocalEntries(entries) {
321
417
  }
322
418
  async function searchStore(query, kind, opts) {
323
419
  try {
324
- const { getStoreConfig: getStoreConfig2, storeFetch: storeFetch2 } = await import('../store-client-4XN7IB3R.js');
420
+ const { getStoreConfig: getStoreConfig2, storeFetch: storeFetch2 } = await import('../store-client-XFZFKY3W.js');
325
421
  const config = getStoreConfig2();
326
422
  const params = {};
327
423
  if (query) params.q = query;
@@ -353,17 +449,23 @@ function makeSearchCommand() {
353
449
  function makeAddCommand() {
354
450
  return new Command("add").description("Add to skaile.yaml + deploy").argument("<ref>", "Asset reference (kind:name[@repo])").option("--project-dir <path>", "Project directory", process.cwd()).option("--global", "Deploy to global dir (~/.claude)").option("--target <agent>", "Driver target", "claude-code").action(async (ref, opts) => {
355
451
  const am2 = new AssetManager({
356
- projectDir: path12__default.resolve(opts.projectDir),
452
+ projectDir: path13__default.resolve(opts.projectDir),
357
453
  global: opts.global,
358
454
  driverTarget: opts.target
359
455
  });
360
- const spinner5 = p5.spinner();
456
+ const spinner5 = p6.spinner();
361
457
  spinner5.start(`Adding ${ref}`);
362
458
  try {
363
459
  const added = await am2.add(ref);
364
460
  spinner5.stop("Done");
365
- if (added.length === 0) logInfo("Nothing added (already up to date or not found).");
366
- else for (const a of added) logOk(a);
461
+ if (added.length === 0) {
462
+ const kind = parseAssetRef(ref).kind;
463
+ if (NON_DEPLOYABLE_KINDS.has(kind))
464
+ logInfo(
465
+ `Recorded in skaile.yaml. ${kind} assets are not deployed into the driver target \u2014 they are wired when skaile runs the agent.`
466
+ );
467
+ else logInfo("Nothing to deploy (already up to date).");
468
+ } else for (const a of added) logOk(a);
367
469
  } catch (err) {
368
470
  spinner5.stop("Failed");
369
471
  logErr(String(err));
@@ -374,7 +476,7 @@ function makeAddCommand() {
374
476
  function makeRemoveCommand() {
375
477
  return new Command("remove").description("Remove from skaile.yaml + undeploy").argument("<ref>", "Asset reference (kind:name)").option("--project-dir <path>", "Project directory", process.cwd()).option("--global", "Remove from global dir").option("--target <agent>", "Driver target", "claude-code").action((ref, opts) => {
376
478
  const am2 = new AssetManager({
377
- projectDir: path12__default.resolve(opts.projectDir),
479
+ projectDir: path13__default.resolve(opts.projectDir),
378
480
  global: opts.global,
379
481
  driverTarget: opts.target
380
482
  });
@@ -388,7 +490,7 @@ function makeListCommand() {
388
490
  new Option("--target <agent>", "Driver target").default("claude-code").choices(SUPPORTED_DRIVER_TARGETS)
389
491
  ).action((kind, opts) => {
390
492
  const am2 = new AssetManager({
391
- projectDir: path12__default.resolve(opts.projectDir),
493
+ projectDir: path13__default.resolve(opts.projectDir),
392
494
  global: opts.global,
393
495
  driverTarget: opts.target
394
496
  });
@@ -412,7 +514,7 @@ function makeListCommand() {
412
514
  }
413
515
  function makeInfoCommand() {
414
516
  return new Command("info").description("Show asset metadata, deps, deploy status").argument("<ref>", "Asset reference (kind:name)").option("--project-dir <path>", "Project directory", process.cwd()).action((ref, opts) => {
415
- const am2 = new AssetManager({ projectDir: path12__default.resolve(opts.projectDir) });
517
+ const am2 = new AssetManager({ projectDir: path13__default.resolve(opts.projectDir) });
416
518
  const entry = am2.info(ref);
417
519
  if (!entry) {
418
520
  logErr(
@@ -445,7 +547,7 @@ function makeCreateCommand() {
445
547
  new Option("-k, --kind <kind>", "Asset kind").default("skill").choices([...ASSET_KINDS])
446
548
  ).option("-d, --dir <dir>", "Target directory (default: cwd)").action((name, opts) => {
447
549
  const am2 = new AssetManager({ projectDir: process.cwd() });
448
- const destDir = opts.dir ? path12__default.resolve(opts.dir) : process.cwd();
550
+ const destDir = opts.dir ? path13__default.resolve(opts.dir) : process.cwd();
449
551
  const result = am2.create(name, opts.kind, destDir);
450
552
  if (result.ok) logOk(`Created ${kindColor(opts.kind)}: ${pc5.dim(result.path)}`);
451
553
  else {
@@ -456,7 +558,7 @@ function makeCreateCommand() {
456
558
  }
457
559
  function makeDoctorCommand() {
458
560
  return new Command("doctor").description("Scan for missing dependency chains").argument("[name]", "Check a specific asset (kind:name)").option("--project-dir <path>", "Project directory", process.cwd()).action((name, opts) => {
459
- const am2 = new AssetManager({ projectDir: path12__default.resolve(opts.projectDir) });
561
+ const am2 = new AssetManager({ projectDir: path13__default.resolve(opts.projectDir) });
460
562
  const issues = am2.doctor();
461
563
  if (issues.length === 0) {
462
564
  logOk("No missing dependencies.");
@@ -482,7 +584,7 @@ function makeCatalogCommand() {
482
584
  const catalog = new Command("catalog").description("Catalog source health and configuration");
483
585
  catalog.command("test").description("Probe the configured catalog source and report status").option("--project-dir <path>", "Project directory (for project-level config overlay)").option("--url <url>", "Override the catalog URL for this probe").option("--force", "Probe the network even in air-gapped mode (cache_ttl: 0)").action(async (opts) => {
484
586
  const { resolveConfig, isLocalCatalogUrl, trpcGetUrl } = await import('../library/index.js');
485
- const projectDir = opts.projectDir ? path12__default.resolve(opts.projectDir) : void 0;
587
+ const projectDir = opts.projectDir ? path13__default.resolve(opts.projectDir) : void 0;
486
588
  const cfg = resolveConfig({ projectDir });
487
589
  const baseUrl = opts.url ?? cfg.catalog.url;
488
590
  if (isLocalCatalogUrl(baseUrl)) {
@@ -500,7 +602,7 @@ function makeCatalogCommand() {
500
602
  });
501
603
  catalog.command("info").description("Print the resolved catalog configuration (url, framing, cacheTtlMs)").option("--project-dir <path>", "Project directory (for project-level config overlay)").action(async (opts) => {
502
604
  const { resolveConfig } = await import('../library/index.js');
503
- const projectDir = opts.projectDir ? path12__default.resolve(opts.projectDir) : void 0;
605
+ const projectDir = opts.projectDir ? path13__default.resolve(opts.projectDir) : void 0;
504
606
  const cfg = resolveConfig({ projectDir });
505
607
  console.log(`url: ${cfg.catalog.url}`);
506
608
  console.log(`framing: ${cfg.catalog.framing}`);
@@ -509,7 +611,7 @@ function makeCatalogCommand() {
509
611
  return catalog;
510
612
  }
511
613
  async function runLocalCatalogTest(projectDir) {
512
- const { resolveCatalogSource } = await import('../open-library-FHUXOCN7.js');
614
+ const { resolveCatalogSource } = await import('../open-library-362BZ6OW.js');
513
615
  let resolved;
514
616
  try {
515
617
  resolved = await resolveCatalogSource({ projectDir });
@@ -642,7 +744,7 @@ function findFlowFile(flowId, priorityRoots = []) {
642
744
  for (const root of [...priorityRoots, ...aiResourceRoots()]) {
643
745
  for (const { dir } of assetSearchDirs(root, "flows")) {
644
746
  for (const ext of [".flow.yaml", ".flow.json", ".json"]) {
645
- const candidate = path12__default.join(dir, `${flowId}${ext}`);
747
+ const candidate = path13__default.join(dir, `${flowId}${ext}`);
646
748
  if (fs11__default.existsSync(candidate)) return candidate;
647
749
  }
648
750
  }
@@ -667,9 +769,9 @@ function findSkills(domain) {
667
769
  }
668
770
  function walkSkills(dir, domain, out) {
669
771
  for (const entry of fs11__default.readdirSync(dir, { withFileTypes: true })) {
670
- const full = path12__default.join(dir, entry.name);
772
+ const full = path13__default.join(dir, entry.name);
671
773
  if (entry.isDirectory()) {
672
- const skillMd = path12__default.join(full, "SKILL.md");
774
+ const skillMd = path13__default.join(full, "SKILL.md");
673
775
  if (fs11__default.existsSync(skillMd)) {
674
776
  out.push({ name: entry.name, path: full, skillPath: skillMd, domain });
675
777
  } else {
@@ -698,7 +800,7 @@ function resolveFlowIds() {
698
800
  }
699
801
  }
700
802
  function resolveSessionIds(projectDir) {
701
- const sessionsDir = path12__default.join(projectDir, ".skaile", "sessions");
803
+ const sessionsDir = path13__default.join(projectDir, ".skaile", "sessions");
702
804
  if (!fs11__default.existsSync(sessionsDir)) return [];
703
805
  try {
704
806
  return fs11__default.readdirSync(sessionsDir).filter((f) => f.endsWith(".json")).map((f) => f.slice(0, -".json".length));
@@ -760,13 +862,13 @@ function collectWorkspaceDefaults(projectDir) {
760
862
  const wsDefaults = {};
761
863
  try {
762
864
  const ws = resolveSkWorkspaceConfig(projectDir);
763
- const p8 = ws.agent_config?.default ?? {};
764
- if (p8.driver) wsDefaults.driver = p8.driver;
765
- if (p8.provider) wsDefaults.provider = p8.provider;
766
- if (p8.model) wsDefaults.model = p8.model;
767
- if (p8.skills_dir) wsDefaults.skills_dir = p8.skills_dir;
768
- if (p8.agents_dir) wsDefaults.agents_dir = p8.agents_dir;
769
- if (p8.prompts_dir) wsDefaults.prompts_dir = p8.prompts_dir;
865
+ const p9 = ws.agent_config?.default ?? {};
866
+ if (p9.driver) wsDefaults.driver = p9.driver;
867
+ if (p9.provider) wsDefaults.provider = p9.provider;
868
+ if (p9.model) wsDefaults.model = p9.model;
869
+ if (p9.skills_dir) wsDefaults.skills_dir = p9.skills_dir;
870
+ if (p9.agents_dir) wsDefaults.agents_dir = p9.agents_dir;
871
+ if (p9.prompts_dir) wsDefaults.prompts_dir = p9.prompts_dir;
770
872
  } catch {
771
873
  }
772
874
  return wsDefaults;
@@ -817,7 +919,7 @@ function printResolvedPathsSection(config) {
817
919
  console.log(` ${S.label("prompts:".padEnd(16))} ${config.promptsDir ?? paths.promptsDir}`);
818
920
  }
819
921
  async function showConfig(opts) {
820
- const projectDir = opts.projectDir ? path12__default.resolve(opts.projectDir) : process.cwd();
922
+ const projectDir = opts.projectDir ? path13__default.resolve(opts.projectDir) : process.cwd();
821
923
  const config = await resolveSettings(projectDir);
822
924
  const wsDefaults = collectWorkspaceDefaults(projectDir);
823
925
  printEffectiveSection(config);
@@ -830,13 +932,13 @@ function makeConfigCommand() {
830
932
  const cmd = new Command("config").description("Manage personal config (.skaile/settings.json)");
831
933
  cmd.command("show").description("Show effective config with sources").option("--project-dir <path>", "Project directory").action((opts) => showConfig(opts));
832
934
  cmd.command("get <key>").description("Get an effective config value").option("--project-dir <path>", "Project directory").action(async (key, opts) => {
833
- const projectDir = opts.projectDir ? path12__default.resolve(opts.projectDir) : process.cwd();
935
+ const projectDir = opts.projectDir ? path13__default.resolve(opts.projectDir) : process.cwd();
834
936
  const config = await resolveSettings(projectDir);
835
937
  const value = config[key];
836
938
  console.log(value ?? S.dim("(not set)"));
837
939
  });
838
940
  cmd.command("set <key> <value>").description("Set a personal config value (driver, model, provider, apiKey.<provider>)").option("--project-dir <path>", "Project directory").option("--global", "Write to ~/.skaile/settings.json instead of project-local").action(async (key, value, opts) => {
839
- const projectDir = opts.projectDir ? path12__default.resolve(opts.projectDir) : process.cwd();
941
+ const projectDir = opts.projectDir ? path13__default.resolve(opts.projectDir) : process.cwd();
840
942
  const isApiKey = key.startsWith(API_KEY_PREFIX);
841
943
  if (!PERSONAL_KEYS.has(key) && !isApiKey) {
842
944
  logErr(
@@ -1154,8 +1256,8 @@ function makeConnectorCommand() {
1154
1256
  async (driver, opts) => {
1155
1257
  const { installNpmPackages } = await import('../connectors/index.js');
1156
1258
  const { scanDirectory, factoryAssetRoots, WorkspaceYamlEditor: WorkspaceYamlEditor2 } = await import('../core/index.js');
1157
- const projectDir = path12__default.resolve(opts.projectDir);
1158
- const yamlPath = path12__default.join(projectDir, "skaile.yaml");
1259
+ const projectDir = path13__default.resolve(opts.projectDir);
1260
+ const yamlPath = path13__default.join(projectDir, "skaile.yaml");
1159
1261
  if (!existsSync(yamlPath)) {
1160
1262
  logErr("No skaile.yaml found in current directory. Run 'skaile init' first.");
1161
1263
  process.exit(1);
@@ -1215,8 +1317,8 @@ ${installResult.output}`);
1215
1317
  );
1216
1318
  cmd.command("remove <id>").option("--project-dir <path>", "Workspace directory", process.cwd()).description("Remove a connector from skaile.yaml by its instance ID").action(async (id, opts) => {
1217
1319
  const { WorkspaceYamlEditor: WorkspaceYamlEditor2 } = await import('../core/index.js');
1218
- const projectDir = path12__default.resolve(opts.projectDir);
1219
- const yamlPath = path12__default.join(projectDir, "skaile.yaml");
1320
+ const projectDir = path13__default.resolve(opts.projectDir);
1321
+ const yamlPath = path13__default.join(projectDir, "skaile.yaml");
1220
1322
  if (!existsSync(yamlPath)) {
1221
1323
  logErr("No skaile.yaml found in current directory.");
1222
1324
  process.exit(1);
@@ -1233,7 +1335,7 @@ ${installResult.output}`);
1233
1335
  cmd.command("status [id]").option("--project-dir <path>", "Workspace directory", process.cwd()).description("Connect and report health status for one or all connectors").action(async (id, opts) => {
1234
1336
  const res = await import('../connectors/index.js');
1235
1337
  res.registerBuiltinConnectors();
1236
- const projectDir = path12__default.resolve(opts.projectDir);
1338
+ const projectDir = path13__default.resolve(opts.projectDir);
1237
1339
  const declarations = res.loadConnectorDeclarations(projectDir);
1238
1340
  if (declarations.length === 0) {
1239
1341
  console.log("No connectors configured in skaile.yaml.");
@@ -1257,7 +1359,7 @@ ${installResult.output}`);
1257
1359
  await manager.disconnectAll();
1258
1360
  });
1259
1361
  cmd.command("list").description("List all configured connectors").option("--project-dir <path>", "Workspace directory", process.cwd()).action(async (opts) => {
1260
- const projectDir = path12__default.resolve(opts.projectDir);
1362
+ const projectDir = path13__default.resolve(opts.projectDir);
1261
1363
  const manager = await connectConnectors(projectDir);
1262
1364
  try {
1263
1365
  console.log(JSON.stringify(manager.listConnectors(), null, 2));
@@ -1266,7 +1368,7 @@ ${installResult.output}`);
1266
1368
  }
1267
1369
  });
1268
1370
  cmd.command("sync [id]").description("Re-sync a filesystem-face connector or all of them (git pull, S3 refresh, etc.)").option("--all", "Sync all connectors").option("--project-dir <path>", "Workspace directory", process.cwd()).action(async (id, opts) => {
1269
- const projectDir = path12__default.resolve(opts.projectDir);
1371
+ const projectDir = path13__default.resolve(opts.projectDir);
1270
1372
  const manager = await connectConnectors(projectDir);
1271
1373
  try {
1272
1374
  if (opts.all) {
@@ -1290,7 +1392,7 @@ ${installResult.output}`);
1290
1392
  }
1291
1393
  });
1292
1394
  cmd.command("ops <id>").description("List available operations for a connector").option("--project-dir <path>", "Workspace directory", process.cwd()).action(async (id, opts) => {
1293
- const projectDir = path12__default.resolve(opts.projectDir);
1395
+ const projectDir = path13__default.resolve(opts.projectDir);
1294
1396
  const manager = await connectConnectors(projectDir);
1295
1397
  try {
1296
1398
  if (!manager.has(id)) {
@@ -1305,7 +1407,7 @@ ${installResult.output}`);
1305
1407
  }
1306
1408
  });
1307
1409
  cmd.command("read <id> <resource-path>").description("Read content from a connector").option("--project-dir <path>", "Workspace directory", process.cwd()).action(async (id, resourcePath, opts) => {
1308
- const projectDir = path12__default.resolve(opts.projectDir);
1410
+ const projectDir = path13__default.resolve(opts.projectDir);
1309
1411
  const manager = await connectConnectors(projectDir);
1310
1412
  try {
1311
1413
  const content = await manager.read(id, resourcePath);
@@ -1315,7 +1417,7 @@ ${installResult.output}`);
1315
1417
  }
1316
1418
  });
1317
1419
  cmd.command("write <id> <resource-path> <content>").description("Write content to a connector at a path").option("--project-dir <path>", "Workspace directory", process.cwd()).action(async (id, resourcePath, content, opts) => {
1318
- const projectDir = path12__default.resolve(opts.projectDir);
1420
+ const projectDir = path13__default.resolve(opts.projectDir);
1319
1421
  const manager = await connectConnectors(projectDir);
1320
1422
  try {
1321
1423
  await manager.write(id, resourcePath, { data: content });
@@ -1325,7 +1427,7 @@ ${installResult.output}`);
1325
1427
  }
1326
1428
  });
1327
1429
  cmd.command("entries <id> [resource-path]").description("List entries in a connector (files, keys, rows, etc)").option("--project-dir <path>", "Workspace directory", process.cwd()).option("--recursive", "Include nested entries").option("--limit <n>", "Maximum entries to return", parsePositiveIntOption).action(async (id, resourcePath, opts) => {
1328
- const projectDir = path12__default.resolve(opts.projectDir);
1430
+ const projectDir = path13__default.resolve(opts.projectDir);
1329
1431
  const manager = await connectConnectors(projectDir);
1330
1432
  try {
1331
1433
  const entries = await manager.list(id, resourcePath, {
@@ -1338,7 +1440,7 @@ ${installResult.output}`);
1338
1440
  }
1339
1441
  });
1340
1442
  cmd.command("search <id> <query>").description("Search within a connector for matching content").option("--project-dir <path>", "Workspace directory", process.cwd()).action(async (id, query, opts) => {
1341
- const projectDir = path12__default.resolve(opts.projectDir);
1443
+ const projectDir = path13__default.resolve(opts.projectDir);
1342
1444
  const manager = await connectConnectors(projectDir);
1343
1445
  try {
1344
1446
  const results = await manager.search(id, query);
@@ -1348,7 +1450,7 @@ ${installResult.output}`);
1348
1450
  }
1349
1451
  });
1350
1452
  cmd.command("delete <id> <resource-path>").description("Delete an entry from a connector").option("--project-dir <path>", "Workspace directory", process.cwd()).action(async (id, resourcePath, opts) => {
1351
- const projectDir = path12__default.resolve(opts.projectDir);
1453
+ const projectDir = path13__default.resolve(opts.projectDir);
1352
1454
  const manager = await connectConnectors(projectDir);
1353
1455
  try {
1354
1456
  const ok = await manager.delete(id, resourcePath);
@@ -1358,7 +1460,7 @@ ${installResult.output}`);
1358
1460
  }
1359
1461
  });
1360
1462
  cmd.command("run <id> <op> [args...]").description("Run a custom adapter operation (e.g. git log, sqlite query)").option("--project-dir <path>", "Workspace directory", process.cwd()).allowUnknownOption().action(async (id, op, args, opts) => {
1361
- const projectDir = path12__default.resolve(opts.projectDir);
1463
+ const projectDir = path13__default.resolve(opts.projectDir);
1362
1464
  const manager = await connectConnectors(projectDir);
1363
1465
  try {
1364
1466
  if (!manager.has(id)) {
@@ -1467,7 +1569,7 @@ function envRecord() {
1467
1569
  async function buildDeployContext(projectDir) {
1468
1570
  const { resolveSkWorkspaceConfig: resolveSkWorkspaceConfig2 } = await import('../core/index.js');
1469
1571
  const config = resolveSkWorkspaceConfig2(projectDir);
1470
- const workspaceId = config.name ?? path12__default.basename(projectDir);
1572
+ const workspaceId = config.name ?? path13__default.basename(projectDir);
1471
1573
  let log;
1472
1574
  try {
1473
1575
  const { createLogger } = await import('../core/logging.js');
@@ -1499,13 +1601,13 @@ async function ensureTargetsRegistered(projectDir) {
1499
1601
  const { resolveSkWorkspaceConfig: resolveSkWorkspaceConfig2 } = await import('../core/index.js');
1500
1602
  const config = resolveSkWorkspaceConfig2(projectDir);
1501
1603
  if (config.plugins && config.plugins.length > 0) {
1502
- const { ensurePluginsLoaded } = await import('../plugin-store-LGLN2QUX.js');
1604
+ const { ensurePluginsLoaded } = await import('../plugin-store-RBCDBO7K.js');
1503
1605
  const result = await ensurePluginsLoaded(projectDir, config.plugins, pluginRegistry);
1504
1606
  for (const f of result.failed) logWarn(f.error);
1505
1607
  }
1506
1608
  }
1507
1609
  async function runUp(opts) {
1508
- const projectDir = path12__default.resolve(opts.projectDir);
1610
+ const projectDir = path13__default.resolve(opts.projectDir);
1509
1611
  await ensureTargetsRegistered(projectDir);
1510
1612
  const { resolveSkWorkspaceConfig: resolveSkWorkspaceConfig2 } = await import('../core/index.js');
1511
1613
  const { resolveDeployTarget, pluginRegistry } = await import('../plugin-registry/index.js');
@@ -1573,7 +1675,7 @@ async function restoreFromHandle(projectDir) {
1573
1675
  return { target, handle, ctx };
1574
1676
  }
1575
1677
  async function runDown(opts) {
1576
- const projectDir = path12__default.resolve(opts.projectDir);
1678
+ const projectDir = path13__default.resolve(opts.projectDir);
1577
1679
  const restored = await restoreFromHandle(projectDir);
1578
1680
  if (!restored) return;
1579
1681
  await restored.handle.stop();
@@ -1582,7 +1684,7 @@ async function runDown(opts) {
1582
1684
  logOk(`Stopped ${S.cmd(restored.target.id)} and cleared the handle.`);
1583
1685
  }
1584
1686
  async function runStatus(opts) {
1585
- const projectDir = path12__default.resolve(opts.projectDir);
1687
+ const projectDir = path13__default.resolve(opts.projectDir);
1586
1688
  const restored = await restoreFromHandle(projectDir);
1587
1689
  if (!restored) return;
1588
1690
  const health = await restored.handle.health();
@@ -1596,7 +1698,7 @@ async function runStatus(opts) {
1596
1698
  console.log();
1597
1699
  }
1598
1700
  async function runLogs(opts) {
1599
- const projectDir = path12__default.resolve(opts.projectDir);
1701
+ const projectDir = path13__default.resolve(opts.projectDir);
1600
1702
  const restored = await restoreFromHandle(projectDir);
1601
1703
  if (!restored) return;
1602
1704
  if (!restored.handle.logs) {
@@ -1620,7 +1722,7 @@ function makeDeployCommand() {
1620
1722
  }
1621
1723
  function makeDiffCommand() {
1622
1724
  return new Command("diff").description("Show changes between deployed and source versions").argument("<ref>", "Asset reference (kind:name)").option("--project-dir <path>", "Project directory", process.cwd()).action((ref, opts) => {
1623
- const am2 = new AssetManager({ projectDir: path12__default.resolve(opts.projectDir) });
1725
+ const am2 = new AssetManager({ projectDir: path13__default.resolve(opts.projectDir) });
1624
1726
  const result = am2.diff(ref);
1625
1727
  if (result === null) {
1626
1728
  logInfo("No differences (or asset not found).");
@@ -1673,7 +1775,7 @@ function makeFlowCommand() {
1673
1775
  function makeHistoryCommand() {
1674
1776
  const cmd = new Command("history").description("Show recent add/remove/update actions");
1675
1777
  cmd.argument("[limit]", "Number of entries to show", "20").option("--project-dir <path>", "Project directory", process.cwd()).action((limitStr, opts) => {
1676
- const am2 = new AssetManager({ projectDir: path12__default.resolve(opts.projectDir) });
1778
+ const am2 = new AssetManager({ projectDir: path13__default.resolve(opts.projectDir) });
1677
1779
  const limit = parseInt(limitStr, 10) || 20;
1678
1780
  const entries = am2.history(limit);
1679
1781
  if (entries.length === 0) {
@@ -1693,7 +1795,7 @@ function makeHistoryCommand() {
1693
1795
  console.log();
1694
1796
  });
1695
1797
  cmd.command("clear").description("Clear action history").option("--project-dir <path>", "Project directory", process.cwd()).action((opts) => {
1696
- const am2 = new AssetManager({ projectDir: path12__default.resolve(opts.projectDir) });
1798
+ const am2 = new AssetManager({ projectDir: path13__default.resolve(opts.projectDir) });
1697
1799
  am2.clearHistory();
1698
1800
  logOk("History cleared.");
1699
1801
  });
@@ -1706,12 +1808,12 @@ var MCP_SERVER_ENTRY = {
1706
1808
  env: {}
1707
1809
  };
1708
1810
  function pluginDir(projectDir) {
1709
- return path12__default.join(projectDir, ".claude", "plugins", "skaile");
1811
+ return path13__default.join(projectDir, ".claude", "plugins", "skaile");
1710
1812
  }
1711
- async function readJsonStrict(p8) {
1813
+ async function readJsonStrict(p9) {
1712
1814
  let raw;
1713
1815
  try {
1714
- raw = await fs5.readFile(p8, "utf-8");
1816
+ raw = await fs5.readFile(p9, "utf-8");
1715
1817
  } catch {
1716
1818
  return null;
1717
1819
  }
@@ -1719,21 +1821,21 @@ async function readJsonStrict(p8) {
1719
1821
  return JSON.parse(raw);
1720
1822
  } catch (e) {
1721
1823
  throw new Error(
1722
- `cannot parse ${p8}: ${e instanceof Error ? e.message : String(e)}; please fix or remove`
1824
+ `cannot parse ${p9}: ${e instanceof Error ? e.message : String(e)}; please fix or remove`
1723
1825
  );
1724
1826
  }
1725
1827
  }
1726
- async function writeJson(p8, value) {
1727
- await fs5.mkdir(path12__default.dirname(p8), { recursive: true });
1728
- await fs5.writeFile(p8, `${JSON.stringify(value, null, 2)}
1828
+ async function writeJson(p9, value) {
1829
+ await fs5.mkdir(path13__default.dirname(p9), { recursive: true });
1830
+ await fs5.writeFile(p9, `${JSON.stringify(value, null, 2)}
1729
1831
  `);
1730
1832
  }
1731
1833
  async function copyDir(src, dest) {
1732
1834
  await fs5.mkdir(dest, { recursive: true });
1733
1835
  const entries = await fs5.readdir(src, { withFileTypes: true });
1734
1836
  for (const entry of entries) {
1735
- const srcPath = path12__default.join(src, entry.name);
1736
- const destPath = path12__default.join(dest, entry.name);
1837
+ const srcPath = path13__default.join(src, entry.name);
1838
+ const destPath = path13__default.join(dest, entry.name);
1737
1839
  if (entry.isDirectory()) await copyDir(srcPath, destPath);
1738
1840
  else await fs5.copyFile(srcPath, destPath);
1739
1841
  }
@@ -1742,14 +1844,14 @@ async function install(projectDir, opts) {
1742
1844
  return opts?.full ? installFullPlugin(projectDir) : installMcp(projectDir);
1743
1845
  }
1744
1846
  async function installMcp(projectDir) {
1745
- const mcpPath = path12__default.join(projectDir, ".claude", "mcp.json");
1847
+ const mcpPath = path13__default.join(projectDir, ".claude", "mcp.json");
1746
1848
  const existing = await readJsonStrict(mcpPath) ?? {};
1747
1849
  const mcpServers = { ...existing.mcpServers ?? {} };
1748
1850
  const previous = mcpServers[SKAILE_MCP_NAME];
1749
1851
  const matches = previous && JSON.stringify(previous) === JSON.stringify(MCP_SERVER_ENTRY);
1750
1852
  let warning;
1751
1853
  if (previous && !matches) {
1752
- warning = `overwrote existing ${SKAILE_MCP_NAME} entry in ${path12__default.relative(projectDir, mcpPath)}`;
1854
+ warning = `overwrote existing ${SKAILE_MCP_NAME} entry in ${path13__default.relative(projectDir, mcpPath)}`;
1753
1855
  }
1754
1856
  mcpServers[SKAILE_MCP_NAME] = MCP_SERVER_ENTRY;
1755
1857
  await writeJson(mcpPath, { ...existing, mcpServers });
@@ -1758,15 +1860,15 @@ async function installMcp(projectDir) {
1758
1860
  async function installFullPlugin(projectDir) {
1759
1861
  const dir = pluginDir(projectDir);
1760
1862
  for (const [rel, content] of Object.entries(buildClaudePluginFiles())) {
1761
- const dest = path12__default.join(dir, rel);
1762
- await fs5.mkdir(path12__default.dirname(dest), { recursive: true });
1863
+ const dest = path13__default.join(dir, rel);
1864
+ await fs5.mkdir(path13__default.dirname(dest), { recursive: true });
1763
1865
  await fs5.writeFile(dest, content);
1764
1866
  }
1765
- const projectSkillsDir = path12__default.join(projectDir, ".skaile", "skills");
1867
+ const projectSkillsDir = path13__default.join(projectDir, ".skaile", "skills");
1766
1868
  if (existsSync(projectSkillsDir)) {
1767
- await copyDir(projectSkillsDir, path12__default.join(dir, "skills"));
1869
+ await copyDir(projectSkillsDir, path13__default.join(dir, "skills"));
1768
1870
  }
1769
- const settingsPath = path12__default.join(projectDir, ".claude", "settings.json");
1871
+ const settingsPath = path13__default.join(projectDir, ".claude", "settings.json");
1770
1872
  const settings = await readJsonStrict(settingsPath) ?? {};
1771
1873
  const plugins = settings.plugins ?? [];
1772
1874
  if (!plugins.includes(dir)) plugins.push(dir);
@@ -1774,13 +1876,13 @@ async function installFullPlugin(projectDir) {
1774
1876
  return { changed: true, method: "plugin" };
1775
1877
  }
1776
1878
  async function uninstall(projectDir) {
1777
- const settingsPath = path12__default.join(projectDir, ".claude", "settings.json");
1778
- const mcpPath = path12__default.join(projectDir, ".claude", "mcp.json");
1879
+ const settingsPath = path13__default.join(projectDir, ".claude", "settings.json");
1880
+ const mcpPath = path13__default.join(projectDir, ".claude", "mcp.json");
1779
1881
  const dir = pluginDir(projectDir);
1780
1882
  let changed = false;
1781
1883
  const settings = await readJsonStrict(settingsPath);
1782
1884
  if (settings && Array.isArray(settings.plugins)) {
1783
- const next = settings.plugins.filter((p8) => p8 !== dir);
1885
+ const next = settings.plugins.filter((p9) => p9 !== dir);
1784
1886
  if (next.length !== settings.plugins.length) {
1785
1887
  changed = true;
1786
1888
  const updated = { ...settings, plugins: next };
@@ -1809,12 +1911,12 @@ async function uninstall(projectDir) {
1809
1911
  async function detectInstall(projectDir) {
1810
1912
  const dir = pluginDir(projectDir);
1811
1913
  const settings = await readJsonStrict(
1812
- path12__default.join(projectDir, ".claude", "settings.json")
1914
+ path13__default.join(projectDir, ".claude", "settings.json")
1813
1915
  );
1814
- if (existsSync(path12__default.join(dir, ".claude-plugin", "plugin.json")) && settings?.plugins?.includes(dir)) {
1916
+ if (existsSync(path13__default.join(dir, ".claude-plugin", "plugin.json")) && settings?.plugins?.includes(dir)) {
1815
1917
  return { method: "plugin", pluginPath: dir };
1816
1918
  }
1817
- const mcp = await readJsonStrict(path12__default.join(projectDir, ".claude", "mcp.json"));
1919
+ const mcp = await readJsonStrict(path13__default.join(projectDir, ".claude", "mcp.json"));
1818
1920
  if (mcp?.mcpServers && SKAILE_MCP_NAME in mcp.mcpServers) {
1819
1921
  return { method: "mcp" };
1820
1922
  }
@@ -1823,11 +1925,11 @@ async function detectInstall(projectDir) {
1823
1925
  async function enable(projectDir) {
1824
1926
  const detected = await detectInstall(projectDir);
1825
1927
  if (!detected) throw new Error("plugin not installed for claude-code");
1826
- const settingsPath = path12__default.join(projectDir, ".claude", "settings.json");
1928
+ const settingsPath = path13__default.join(projectDir, ".claude", "settings.json");
1827
1929
  const settings = await readJsonStrict(settingsPath) ?? {};
1828
1930
  if (detected.method === "plugin") {
1829
1931
  const disabled2 = settings.disabledPlugins ?? [];
1830
- const next2 = disabled2.filter((p8) => p8 !== detected.pluginPath);
1932
+ const next2 = disabled2.filter((p9) => p9 !== detected.pluginPath);
1831
1933
  if (next2.length === disabled2.length) return { changed: false };
1832
1934
  const updated2 = { ...settings, disabledPlugins: next2 };
1833
1935
  if (next2.length === 0) delete updated2.disabledPlugins;
@@ -1845,7 +1947,7 @@ async function enable(projectDir) {
1845
1947
  async function disable(projectDir) {
1846
1948
  const detected = await detectInstall(projectDir);
1847
1949
  if (!detected) throw new Error("plugin not installed for claude-code");
1848
- const settingsPath = path12__default.join(projectDir, ".claude", "settings.json");
1950
+ const settingsPath = path13__default.join(projectDir, ".claude", "settings.json");
1849
1951
  const settings = await readJsonStrict(settingsPath) ?? {};
1850
1952
  if (detected.method === "plugin") {
1851
1953
  const list2 = settings.disabledPlugins ?? [];
@@ -1865,12 +1967,12 @@ async function disable(projectDir) {
1865
1967
  return { changed: true };
1866
1968
  }
1867
1969
  async function status(projectDir) {
1868
- const settingsPath = path12__default.join(projectDir, ".claude", "settings.json");
1869
- const mcpPath = path12__default.join(projectDir, ".claude", "mcp.json");
1970
+ const settingsPath = path13__default.join(projectDir, ".claude", "settings.json");
1971
+ const mcpPath = path13__default.join(projectDir, ".claude", "mcp.json");
1870
1972
  const dir = pluginDir(projectDir);
1871
1973
  const settings = await readJsonStrict(settingsPath);
1872
1974
  const mcp = await readJsonStrict(mcpPath);
1873
- const pluginInstalled = !!(existsSync(path12__default.join(dir, ".claude-plugin", "plugin.json")) && settings?.plugins?.includes(dir));
1975
+ const pluginInstalled = !!(existsSync(path13__default.join(dir, ".claude-plugin", "plugin.json")) && settings?.plugins?.includes(dir));
1874
1976
  const mcpInstalled = !!(mcp?.mcpServers && SKAILE_MCP_NAME in mcp.mcpServers);
1875
1977
  if (!pluginInstalled && !mcpInstalled) {
1876
1978
  return {
@@ -1888,7 +1990,7 @@ async function status(projectDir) {
1888
1990
  installed: "yes",
1889
1991
  enabled: disabled2 ? "no" : "yes",
1890
1992
  method: "plugin",
1891
- location: path12__default.relative(projectDir, dir)
1993
+ location: path13__default.relative(projectDir, dir)
1892
1994
  };
1893
1995
  }
1894
1996
  const disabled = settings?.disabledMcpjsonServers?.includes(SKAILE_MCP_NAME) ?? false;
@@ -1897,7 +1999,7 @@ async function status(projectDir) {
1897
1999
  installed: "yes",
1898
2000
  enabled: disabled ? "no" : "yes",
1899
2001
  method: "mcp",
1900
- location: path12__default.relative(projectDir, mcpPath)
2002
+ location: path13__default.relative(projectDir, mcpPath)
1901
2003
  };
1902
2004
  }
1903
2005
  var SKAILE_MCP_NAME2 = "skaile-workspace";
@@ -1908,10 +2010,10 @@ function buildEntry(projectDir) {
1908
2010
  env: { SKAILE_PROJECT_DIR: projectDir }
1909
2011
  };
1910
2012
  }
1911
- async function readConfig(p8) {
2013
+ async function readConfig(p9) {
1912
2014
  let raw;
1913
2015
  try {
1914
- raw = await fs5.readFile(p8, "utf-8");
2016
+ raw = await fs5.readFile(p9, "utf-8");
1915
2017
  } catch {
1916
2018
  return null;
1917
2019
  }
@@ -1919,41 +2021,41 @@ async function readConfig(p8) {
1919
2021
  return parse$1(raw);
1920
2022
  } catch (e) {
1921
2023
  throw new Error(
1922
- `cannot parse ${p8}: ${e instanceof Error ? e.message : String(e)}; please fix or remove`
2024
+ `cannot parse ${p9}: ${e instanceof Error ? e.message : String(e)}; please fix or remove`
1923
2025
  );
1924
2026
  }
1925
2027
  }
1926
- async function writeConfig(p8, value) {
1927
- await fs5.mkdir(path12__default.dirname(p8), { recursive: true });
2028
+ async function writeConfig(p9, value) {
2029
+ await fs5.mkdir(path13__default.dirname(p9), { recursive: true });
1928
2030
  const cleaned = {};
1929
2031
  for (const [k, v] of Object.entries(value)) {
1930
2032
  if (v === void 0) continue;
1931
2033
  cleaned[k] = v;
1932
2034
  }
1933
- await fs5.writeFile(p8, stringify(cleaned));
2035
+ await fs5.writeFile(p9, stringify(cleaned));
1934
2036
  }
1935
2037
  function configPath(projectDir) {
1936
- return path12__default.join(projectDir, ".codex", "config.toml");
2038
+ return path13__default.join(projectDir, ".codex", "config.toml");
1937
2039
  }
1938
2040
  async function install2(projectDir) {
1939
- const p8 = configPath(projectDir);
1940
- const cfg = await readConfig(p8) ?? {};
2041
+ const p9 = configPath(projectDir);
2042
+ const cfg = await readConfig(p9) ?? {};
1941
2043
  const next = buildEntry(projectDir);
1942
2044
  const servers = { ...cfg.mcp_servers ?? {} };
1943
2045
  const previous = servers[SKAILE_MCP_NAME2];
1944
2046
  const matches = previous && JSON.stringify(previous) === JSON.stringify(next);
1945
2047
  let warning;
1946
2048
  if (previous && !matches) {
1947
- warning = `overwrote existing ${SKAILE_MCP_NAME2} entry in ${path12__default.relative(projectDir, p8)}`;
2049
+ warning = `overwrote existing ${SKAILE_MCP_NAME2} entry in ${path13__default.relative(projectDir, p9)}`;
1948
2050
  }
1949
2051
  if (matches) return { changed: false, method: "toml" };
1950
2052
  servers[SKAILE_MCP_NAME2] = next;
1951
- await writeConfig(p8, { ...cfg, mcp_servers: servers });
2053
+ await writeConfig(p9, { ...cfg, mcp_servers: servers });
1952
2054
  return { changed: true, method: "toml", warning };
1953
2055
  }
1954
2056
  async function uninstall2(projectDir) {
1955
- const p8 = configPath(projectDir);
1956
- const cfg = await readConfig(p8);
2057
+ const p9 = configPath(projectDir);
2058
+ const cfg = await readConfig(p9);
1957
2059
  if (!cfg?.mcp_servers || !(SKAILE_MCP_NAME2 in cfg.mcp_servers)) {
1958
2060
  return { changed: false };
1959
2061
  }
@@ -1961,15 +2063,15 @@ async function uninstall2(projectDir) {
1961
2063
  const updated = { ...cfg, mcp_servers: rest };
1962
2064
  if (Object.keys(rest).length === 0) delete updated.mcp_servers;
1963
2065
  if (Object.keys(updated).length === 0) {
1964
- await fs5.unlink(p8);
2066
+ await fs5.unlink(p9);
1965
2067
  } else {
1966
- await writeConfig(p8, updated);
2068
+ await writeConfig(p9, updated);
1967
2069
  }
1968
2070
  return { changed: true };
1969
2071
  }
1970
2072
  async function status2(projectDir) {
1971
- const p8 = configPath(projectDir);
1972
- const cfg = await readConfig(p8);
2073
+ const p9 = configPath(projectDir);
2074
+ const cfg = await readConfig(p9);
1973
2075
  const installed = !!(cfg?.mcp_servers && SKAILE_MCP_NAME2 in cfg.mcp_servers);
1974
2076
  if (!installed) {
1975
2077
  return {
@@ -1985,12 +2087,12 @@ async function status2(projectDir) {
1985
2087
  installed: "yes",
1986
2088
  enabled: "n/a",
1987
2089
  method: "mcp",
1988
- location: path12__default.relative(projectDir, p8)
2090
+ location: path13__default.relative(projectDir, p9)
1989
2091
  };
1990
2092
  }
1991
2093
  async function install3(projectDir) {
1992
- const extDir = path12__default.join(projectDir, ".omp", "extensions");
1993
- const extPath = path12__default.join(extDir, "skaile.ts");
2094
+ const extDir = path13__default.join(projectDir, ".omp", "extensions");
2095
+ const extPath = path13__default.join(extDir, "skaile.ts");
1994
2096
  await fs5.mkdir(extDir, { recursive: true });
1995
2097
  const { WorkspacePlugin } = await import('../workspace-plugin/index.js');
1996
2098
  const plugin = new WorkspacePlugin({ projectDir });
@@ -2005,7 +2107,7 @@ async function install3(projectDir) {
2005
2107
  return { changed: true, method: "generated" };
2006
2108
  }
2007
2109
  async function uninstall3(projectDir) {
2008
- const extPath = path12__default.join(projectDir, ".omp", "extensions", "skaile.ts");
2110
+ const extPath = path13__default.join(projectDir, ".omp", "extensions", "skaile.ts");
2009
2111
  try {
2010
2112
  await fs5.unlink(extPath);
2011
2113
  return { changed: true };
@@ -2014,14 +2116,14 @@ async function uninstall3(projectDir) {
2014
2116
  }
2015
2117
  }
2016
2118
  async function status3(projectDir) {
2017
- const extPath = path12__default.join(projectDir, ".omp", "extensions", "skaile.ts");
2119
+ const extPath = path13__default.join(projectDir, ".omp", "extensions", "skaile.ts");
2018
2120
  if (existsSync(extPath)) {
2019
2121
  return {
2020
2122
  backend: "omp",
2021
2123
  installed: "yes",
2022
2124
  enabled: "n/a",
2023
2125
  method: "extension",
2024
- location: path12__default.relative(projectDir, extPath)
2126
+ location: path13__default.relative(projectDir, extPath)
2025
2127
  };
2026
2128
  }
2027
2129
  return {
@@ -2084,7 +2186,7 @@ async function installCodex(projectDir) {
2084
2186
  console.log(` ${S.dim("\u2192")} Restart Codex CLI to pick up the change.`);
2085
2187
  }
2086
2188
  async function runInstall(opts) {
2087
- const projectDir = path12__default.resolve(opts.projectDir);
2189
+ const projectDir = path13__default.resolve(opts.projectDir);
2088
2190
  const targets = resolveDriver(opts.driver);
2089
2191
  let exitCode = 0;
2090
2192
  if (targets.includes("claude-code")) {
@@ -2118,7 +2220,7 @@ async function uninstallCodex(projectDir) {
2118
2220
  else logInfo(`codex: not installed`);
2119
2221
  }
2120
2222
  async function runUninstall(opts) {
2121
- const projectDir = path12__default.resolve(opts.projectDir);
2223
+ const projectDir = path13__default.resolve(opts.projectDir);
2122
2224
  const targets = resolveDriver(opts.driver);
2123
2225
  let exitCode = 0;
2124
2226
  if (targets.includes("claude-code")) {
@@ -2161,7 +2263,7 @@ async function toggleTarget(t, projectDir, action3) {
2161
2263
  });
2162
2264
  }
2163
2265
  async function runToggle(opts, action3) {
2164
- const projectDir = path12__default.resolve(opts.projectDir);
2266
+ const projectDir = path13__default.resolve(opts.projectDir);
2165
2267
  const requestedAll = opts.driver === "all";
2166
2268
  const targets = resolveDriver(opts.driver);
2167
2269
  const usageError = checkToggleSupported(targets, requestedAll, action3);
@@ -2173,7 +2275,7 @@ async function runToggle(opts, action3) {
2173
2275
  return exitCode;
2174
2276
  }
2175
2277
  async function runStatus2(opts) {
2176
- const projectDir = path12__default.resolve(opts.projectDir);
2278
+ const projectDir = path13__default.resolve(opts.projectDir);
2177
2279
  const targets = resolveDriver(opts.driver);
2178
2280
  const rows = [];
2179
2281
  let exitCode = 0;
@@ -2202,7 +2304,7 @@ function printStatusTable(rows) {
2202
2304
  const widths = cols.map(
2203
2305
  (c) => Math.max(c.header.length, ...rows.map((r) => String(r[c.key] ?? "").length))
2204
2306
  );
2205
- const fmtRow = (parts) => parts.map((p8, i) => p8.padEnd(widths[i] ?? p8.length)).join(" ");
2307
+ const fmtRow = (parts) => parts.map((p9, i) => p9.padEnd(widths[i] ?? p9.length)).join(" ");
2206
2308
  console.log();
2207
2309
  console.log(` ${S.heading(fmtRow(cols.map((c) => c.header)))}`);
2208
2310
  for (const r of rows) {
@@ -2244,7 +2346,7 @@ async function runHook(event) {
2244
2346
  await plugin.shutdown();
2245
2347
  return;
2246
2348
  }
2247
- const store = new PluginStore(path12__default.join(projectDir, ".skaile", "plugin-state.json"));
2349
+ const store = new PluginStore(path13__default.join(projectDir, ".skaile", "plugin-state.json"));
2248
2350
  await store.load();
2249
2351
  const status4 = store.get("connector:status");
2250
2352
  if (status4 && typeof status4 === "object" && Object.keys(status4).length > 0) {
@@ -2366,7 +2468,7 @@ function makeLibraryCommand() {
2366
2468
  cmd.command("init <name>").description("Create a new local library at ~/.skaile/libraries/<name>").option("--git <url>", "Initialize as a git library tracking <url>").option("--owner", "Mark as owner (default for local)").option("--contributor", "Mark as contributor").option("--reader", "Mark as reader").action(
2367
2469
  async (name, opts) => {
2368
2470
  const libDir = resolveLibraryDir();
2369
- const libPath = path12.join(libDir, name);
2471
+ const libPath = path13.join(libDir, name);
2370
2472
  const ownership = opts.contributor ? "contributor" : opts.reader ? "reader" : "owner";
2371
2473
  const { manager, close } = await openLibraryManager();
2372
2474
  try {
@@ -2437,7 +2539,7 @@ function makeLibraryCommand() {
2437
2539
  target = def;
2438
2540
  }
2439
2541
  const am2 = new AssetManager({ projectDir: process.cwd() });
2440
- const destDir = opts.dir ? path12.join(target.path, opts.dir) : target.path;
2542
+ const destDir = opts.dir ? path13.join(target.path, opts.dir) : target.path;
2441
2543
  const res = am2.create(name, opts.kind ?? kind, destDir);
2442
2544
  if (res.ok) {
2443
2545
  logOk(`Created ${opts.kind ?? kind}: ${pc5.dim(res.path)}`);
@@ -2463,8 +2565,8 @@ function makeLibraryCommand() {
2463
2565
  const { manager, close } = await openLibraryManager();
2464
2566
  try {
2465
2567
  const lib = await manager.requireLibrary(oldName);
2466
- const parent = path12.dirname(lib.path);
2467
- const newPath = path12.join(parent, newName);
2568
+ const parent = path13.dirname(lib.path);
2569
+ const newPath = path13.join(parent, newName);
2468
2570
  if (fs11.existsSync(newPath)) {
2469
2571
  logErr(`Target directory already exists: ${newPath}`);
2470
2572
  process.exit(1);
@@ -2503,11 +2605,11 @@ function makeLibraryCommand() {
2503
2605
  const { manager, close } = await openLibraryManager();
2504
2606
  try {
2505
2607
  if (!opts.yes) {
2506
- const confirmed = await p5.confirm({
2608
+ const confirmed = await p6.confirm({
2507
2609
  message: `Remove library "${name}"${opts.purge ? " AND delete its directory" : ""}?`,
2508
2610
  initialValue: false
2509
2611
  });
2510
- if (!confirmed || p5.isCancel(confirmed)) {
2612
+ if (!confirmed || p6.isCancel(confirmed)) {
2511
2613
  logInfo("Cancelled.");
2512
2614
  return;
2513
2615
  }
@@ -2653,9 +2755,9 @@ async function printOverallStatus(projectDir, asJson) {
2653
2755
  } catch {
2654
2756
  secretsStrategy = "unavailable";
2655
2757
  }
2656
- const resolvedProjectDir = path12.resolve(projectDir);
2657
- const hasWorkspaceConfig = existsSync(path12.join(resolvedProjectDir, "skaile.yaml"));
2658
- const hasLockFile = existsSync(path12.join(resolvedProjectDir, "skaile.lock.yaml"));
2758
+ const resolvedProjectDir = path13.resolve(projectDir);
2759
+ const hasWorkspaceConfig = existsSync(path13.join(resolvedProjectDir, "skaile.yaml"));
2760
+ const hasLockFile = existsSync(path13.join(resolvedProjectDir, "skaile.lock.yaml"));
2659
2761
  let assignments = [];
2660
2762
  if (hasWorkspaceConfig) {
2661
2763
  try {
@@ -3011,7 +3113,7 @@ function actOnHeader(row, action3) {
3011
3113
  return row.type === "domain-header" || row.type === "domain-info";
3012
3114
  }
3013
3115
  async function loadAssets() {
3014
- const { gatherAssetFeeds } = await import('../asset-feeds-3PSV57NT.js');
3116
+ const { gatherAssetFeeds } = await import('../asset-feeds-EGSG4FUB.js');
3015
3117
  const { entries, domains, notes } = await gatherAssetFeeds(am, am.projectDir);
3016
3118
  if (notes.length > 0) {
3017
3119
  state.message = notes.map((n) => `[${n.feed}] ${n.message}`).join(" \u2022 ");
@@ -3108,14 +3210,16 @@ function reconcileCollapsedSets(rows) {
3108
3210
  }
3109
3211
  async function loadSourcesAndLibraries() {
3110
3212
  try {
3111
- const [{ openLibraryManager: openLibraryManager2 }, { skaileHomeDir: skaileHomeDir2 }] = await Promise.all([
3112
- import('../open-library-FHUXOCN7.js'),
3113
- import('../library/index.js')
3213
+ const [{ openLibraryManager: openLibraryManager2 }, { skaileHomeDir }, { getGlobalCacheDir: getGlobalCacheDir2 }] = await Promise.all([
3214
+ import('../open-library-362BZ6OW.js'),
3215
+ import('../library/index.js'),
3216
+ import('../core/index.js')
3114
3217
  ]);
3115
3218
  const { manager, library, close } = await openLibraryManager2();
3116
3219
  try {
3117
- const sourcesDir2 = path12__default.join(skaileHomeDir2(), "sources");
3118
- const isSourceRow = (l) => l.path.startsWith(sourcesDir2);
3220
+ const newRoot = getGlobalCacheDir2();
3221
+ const legacyRoot = path13__default.join(skaileHomeDir(), "sources");
3222
+ const isSourceRow = (l) => l.path.startsWith(newRoot) || l.path.startsWith(legacyRoot);
3119
3223
  const libs = await manager.listLibraries();
3120
3224
  const defs = await library.listAssetDefs();
3121
3225
  const counts = /* @__PURE__ */ new Map();
@@ -3750,13 +3854,13 @@ async function run(projectDir) {
3750
3854
  }
3751
3855
  function makeManageCommand() {
3752
3856
  return new Command("manage").description("Interactive TUI for managing assets, sources, and libraries").option("--project-dir <path>", "Project directory", process.cwd()).action(async (opts) => {
3753
- await run(path12__default.resolve(opts.projectDir));
3857
+ await run(path13__default.resolve(opts.projectDir));
3754
3858
  });
3755
3859
  }
3756
3860
  function makeMcpServerCommand() {
3757
3861
  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) => {
3758
- const path35 = await import('path');
3759
- const projectDir = path35.default.resolve(opts.projectDir);
3862
+ const path36 = await import('path');
3863
+ const projectDir = path36.default.resolve(opts.projectDir);
3760
3864
  const { LogStore, StdoutSink, registerLogStore } = await import('../core/logging.js');
3761
3865
  registerLogStore(
3762
3866
  new LogStore({
@@ -3793,8 +3897,8 @@ function makeNpxCommand() {
3793
3897
  skills.command("add <url>").description(
3794
3898
  "Clone a repo, register it in the project's skaile.yaml sources[], and install a skill from it"
3795
3899
  ).requiredOption("--skill <name>", "Skill name to install from the repo").option("--project-dir <path>", "Project directory", process.cwd()).option("--target <agent>", "Agent framework", "claude-code").option("--global", "Deploy globally").action(async (url, opts) => {
3796
- const projectDir = path12__default.resolve(opts.projectDir);
3797
- const projYaml = path12__default.join(projectDir, "skaile.yaml");
3900
+ const projectDir = path13__default.resolve(opts.projectDir);
3901
+ const projYaml = path13__default.join(projectDir, "skaile.yaml");
3798
3902
  if (!existsSync(projYaml)) {
3799
3903
  logErr(`No skaile.yaml in ${projectDir} \u2014 run \`skaile init\` first.`);
3800
3904
  process.exit(1);
@@ -3805,9 +3909,9 @@ function makeNpxCommand() {
3805
3909
  );
3806
3910
  process.exit(1);
3807
3911
  }
3808
- const spinner5 = p5.spinner();
3912
+ const spinner5 = p6.spinner();
3809
3913
  const slug = sourceSlug(url);
3810
- const clonePath = path12__default.join(homedir(), ".skaile", "sources", slug);
3914
+ const clonePath = path13__default.join(getGlobalCacheDir(), slug);
3811
3915
  spinner5.start(`Cloning ${url}`);
3812
3916
  try {
3813
3917
  if (!existsSync(clonePath)) {
@@ -3856,7 +3960,7 @@ function makeNpxCommand() {
3856
3960
  return npx;
3857
3961
  }
3858
3962
  function resolvePublisher(clonePath, url) {
3859
- const manifestPath = path12__default.join(clonePath, SKAILE_MANIFEST_FILENAME);
3963
+ const manifestPath = path13__default.join(clonePath, SKAILE_MANIFEST_FILENAME);
3860
3964
  if (existsSync(manifestPath)) {
3861
3965
  try {
3862
3966
  const { manifest } = decodeSkaileManifest(readFileSync(manifestPath, "utf8"));
@@ -3869,12 +3973,12 @@ function resolvePublisher(clonePath, url) {
3869
3973
  return url.match(/github\.com[/:]([^/]+)\/[^/]+/)?.[1];
3870
3974
  }
3871
3975
  function resolveSkillName(clonePath, requested) {
3872
- const skillsDir = path12__default.join(clonePath, "skills");
3873
- if (existsSync(path12__default.join(skillsDir, requested, "SKILL.md"))) return requested;
3976
+ const skillsDir = path13__default.join(clonePath, "skills");
3977
+ if (existsSync(path13__default.join(skillsDir, requested, "SKILL.md"))) return requested;
3874
3978
  if (!existsSync(skillsDir)) return requested;
3875
3979
  for (const entry of readdirSync(skillsDir, { withFileTypes: true })) {
3876
3980
  if (!entry.isDirectory()) continue;
3877
- const md = path12__default.join(skillsDir, entry.name, "SKILL.md");
3981
+ const md = path13__default.join(skillsDir, entry.name, "SKILL.md");
3878
3982
  if (!existsSync(md)) continue;
3879
3983
  try {
3880
3984
  const { data } = parseFrontmatter(readFileSync(md, "utf8"));
@@ -3892,7 +3996,7 @@ function makeOutdatedCommand() {
3892
3996
  new Option("--target <agent>", "Driver target").default("claude-code").choices(SUPPORTED_DRIVER_TARGETS)
3893
3997
  ).action((name, opts) => {
3894
3998
  const am2 = new AssetManager({
3895
- projectDir: path12__default.resolve(opts.projectDir),
3999
+ projectDir: path13__default.resolve(opts.projectDir),
3896
4000
  driverTarget: opts.target
3897
4001
  });
3898
4002
  const entries = am2.outdated();
@@ -3921,7 +4025,7 @@ function makeOutdatedCommand() {
3921
4025
  function makePatchCommand() {
3922
4026
  const cmd = new Command("patch").description("Patch workflow for skill improvement");
3923
4027
  cmd.command("extract <ref>").alias("start").description("Extract asset for local editing").option("--project-dir <path>", "Project directory", process.cwd()).action((ref, opts) => {
3924
- const am2 = new AssetManager({ projectDir: path12__default.resolve(opts.projectDir) });
4028
+ const am2 = new AssetManager({ projectDir: path13__default.resolve(opts.projectDir) });
3925
4029
  try {
3926
4030
  const dest = am2.patch(ref);
3927
4031
  logOk(`Extracted to ${S.dim(dest)}`);
@@ -3932,7 +4036,7 @@ function makePatchCommand() {
3932
4036
  }
3933
4037
  });
3934
4038
  cmd.command("commit <ref>").description("Generate .patch file from edits").option("--project-dir <path>", "Project directory", process.cwd()).action((ref, opts) => {
3935
- const am2 = new AssetManager({ projectDir: path12__default.resolve(opts.projectDir) });
4039
+ const am2 = new AssetManager({ projectDir: path13__default.resolve(opts.projectDir) });
3936
4040
  try {
3937
4041
  const patchFile = am2.patchCommit(ref);
3938
4042
  logOk(`Patch saved to ${S.dim(patchFile)}`);
@@ -3943,7 +4047,7 @@ function makePatchCommand() {
3943
4047
  }
3944
4048
  });
3945
4049
  cmd.command("submit <ref>").description("Apply patch to repo clone and prepare for PR").option("--project-dir <path>", "Project directory", process.cwd()).action((ref, opts) => {
3946
- const am2 = new AssetManager({ projectDir: path12__default.resolve(opts.projectDir) });
4050
+ const am2 = new AssetManager({ projectDir: path13__default.resolve(opts.projectDir) });
3947
4051
  try {
3948
4052
  am2.patchSubmit(ref);
3949
4053
  logOk("Patch applied to repo clone and committed.");
@@ -3956,7 +4060,7 @@ function makePatchCommand() {
3956
4060
  }
3957
4061
  });
3958
4062
  cmd.command("remove <ref>").description("Remove local patch after upstream merge").option("--project-dir <path>", "Project directory", process.cwd()).action((ref, opts) => {
3959
- const am2 = new AssetManager({ projectDir: path12__default.resolve(opts.projectDir) });
4063
+ const am2 = new AssetManager({ projectDir: path13__default.resolve(opts.projectDir) });
3960
4064
  am2.patchRemove(ref);
3961
4065
  logOk(`Patch removed for ${ref}`);
3962
4066
  });
@@ -3974,7 +4078,7 @@ function action2(fn) {
3974
4078
  };
3975
4079
  }
3976
4080
  async function reconcileAndReport(projectDir, plugins) {
3977
- const { reconcilePlugins } = await import('../plugin-store-LGLN2QUX.js');
4081
+ const { reconcilePlugins } = await import('../plugin-store-RBCDBO7K.js');
3978
4082
  if (plugins.length === 0) {
3979
4083
  logInfo("No plugins declared \u2014 nothing to reconcile.");
3980
4084
  return;
@@ -3988,10 +4092,10 @@ async function reconcileAndReport(projectDir, plugins) {
3988
4092
  }
3989
4093
  }
3990
4094
  async function runInstall2(spec, opts) {
3991
- const projectDir = path12__default.resolve(opts.projectDir);
4095
+ const projectDir = path13__default.resolve(opts.projectDir);
3992
4096
  const { WorkspaceYamlEditor: WorkspaceYamlEditor2 } = await import('../core/index.js');
3993
- const { specName } = await import('../plugin-store-LGLN2QUX.js');
3994
- const yamlPath = path12__default.join(projectDir, "skaile.yaml");
4097
+ const { specName } = await import('../plugin-store-RBCDBO7K.js');
4098
+ const yamlPath = path13__default.join(projectDir, "skaile.yaml");
3995
4099
  const editor = WorkspaceYamlEditor2.load(yamlPath);
3996
4100
  const replaced = editor.addPlugin(spec, specName);
3997
4101
  editor.save();
@@ -4000,10 +4104,10 @@ async function runInstall2(spec, opts) {
4000
4104
  await reconcileAndReport(projectDir, editor.getPlugins());
4001
4105
  }
4002
4106
  async function runRemove(name, opts) {
4003
- const projectDir = path12__default.resolve(opts.projectDir);
4107
+ const projectDir = path13__default.resolve(opts.projectDir);
4004
4108
  const { WorkspaceYamlEditor: WorkspaceYamlEditor2 } = await import('../core/index.js');
4005
- const { specName } = await import('../plugin-store-LGLN2QUX.js');
4006
- const yamlPath = path12__default.join(projectDir, "skaile.yaml");
4109
+ const { specName } = await import('../plugin-store-RBCDBO7K.js');
4110
+ const yamlPath = path13__default.join(projectDir, "skaile.yaml");
4007
4111
  const editor = WorkspaceYamlEditor2.load(yamlPath);
4008
4112
  const removed = editor.removePlugin(name, specName);
4009
4113
  if (!removed) {
@@ -4015,7 +4119,7 @@ async function runRemove(name, opts) {
4015
4119
  await reconcileAndReport(projectDir, editor.getPlugins());
4016
4120
  }
4017
4121
  async function runList(opts) {
4018
- const projectDir = path12__default.resolve(opts.projectDir);
4122
+ const projectDir = path13__default.resolve(opts.projectDir);
4019
4123
  const { resolveSkWorkspaceConfig: resolveSkWorkspaceConfig2 } = await import('../core/index.js');
4020
4124
  const config = resolveSkWorkspaceConfig2(projectDir);
4021
4125
  const declared = config.plugins ?? [];
@@ -4030,7 +4134,7 @@ async function runList(opts) {
4030
4134
  const registry = createPluginRegistry();
4031
4135
  if (declared.length > 0) {
4032
4136
  try {
4033
- const { loadPlugins } = await import('../plugin-store-LGLN2QUX.js');
4137
+ const { loadPlugins } = await import('../plugin-store-RBCDBO7K.js');
4034
4138
  const result = await loadPlugins(projectDir, declared, registry);
4035
4139
  for (const f of result.failed) logWarn(f.error);
4036
4140
  } catch (err) {
@@ -4069,7 +4173,7 @@ function makePresetCommand() {
4069
4173
  cmd.command("init [name]").description("Scaffold a new .preset.yaml file").option("--dir <path>", "Output directory", process.cwd()).action(async (name, opts) => {
4070
4174
  const presetName = name ?? "my-preset";
4071
4175
  const filename = `${presetName}.preset.yaml`;
4072
- const outPath = path12__default.join(path12__default.resolve(opts.dir), filename);
4176
+ const outPath = path13__default.join(path13__default.resolve(opts.dir), filename);
4073
4177
  if (existsSync(outPath)) {
4074
4178
  logErr(`File already exists: ${outPath}`);
4075
4179
  logInfo("Choose a different name or remove the existing file.");
@@ -4117,7 +4221,7 @@ async function reportNestedPresetRefs(preset) {
4117
4221
  }
4118
4222
  async function checkPresetCycles(preset, resolved) {
4119
4223
  const { detectCycles } = await import('../discovery/index.js');
4120
- const presetRef = path12__default.basename(resolved, ".preset.yaml");
4224
+ const presetRef = path13__default.basename(resolved, ".preset.yaml");
4121
4225
  const edges = [];
4122
4226
  for (const item of preset.items) {
4123
4227
  if (item.ref) {
@@ -4168,7 +4272,7 @@ function printPresetSummary(preset, placeholderCount, hasWarnings) {
4168
4272
  }
4169
4273
  }
4170
4274
  async function runPresetValidate(filePath) {
4171
- const resolved = path12__default.resolve(filePath);
4275
+ const resolved = path13__default.resolve(filePath);
4172
4276
  const preset = await loadPresetForValidation(resolved);
4173
4277
  await reportNestedPresetRefs(preset);
4174
4278
  await checkPresetCycles(preset, resolved);
@@ -4259,11 +4363,11 @@ async function runRefInstall(ref, opts) {
4259
4363
  logErr(`malformed asset ref '${ref}' \u2014 expected ${REF_HINT}`);
4260
4364
  process.exit(1);
4261
4365
  }
4262
- const spinner5 = p5.spinner();
4366
+ const spinner5 = p6.spinner();
4263
4367
  spinner5.start(`Installing ${ref}`);
4264
4368
  try {
4265
- const { openCatalogSource: openCatalogSource2, openLibrary: openLibrary2 } = await import('../open-library-FHUXOCN7.js');
4266
- const catalog = await openCatalogSource2({ projectDir: path12__default.resolve(opts.projectDir) });
4369
+ const { openCatalogSource: openCatalogSource2, openLibrary: openLibrary2 } = await import('../open-library-362BZ6OW.js');
4370
+ const catalog = await openCatalogSource2({ projectDir: path13__default.resolve(opts.projectDir) });
4267
4371
  if (!supportsInstallManifest(catalog)) {
4268
4372
  throw new Error(
4269
4373
  "pointer-only install (skaile install <ref>) requires a tRPC-framed Catalog. The configured catalog uses REST framing, which does not serve install manifests. Set catalog.url to https://skaile.store, or catalog.framing: trpc, in ~/.skaile/config.yaml."
@@ -4292,9 +4396,9 @@ async function runRefInstall(ref, opts) {
4292
4396
  }
4293
4397
  }
4294
4398
  async function runYamlInstall(opts) {
4295
- const projectDir = path12__default.resolve(opts.projectDir);
4399
+ const projectDir = path13__default.resolve(opts.projectDir);
4296
4400
  try {
4297
- const { ensureSourcesCloned } = await import('../ensure-sources-VQDZB7NT.js');
4401
+ const { ensureSourcesCloned } = await import('../ensure-sources-NSDMTAWN.js');
4298
4402
  const hydrate = ensureSourcesCloned(projectDir, { quiet: true });
4299
4403
  if (hydrate.cloned.length > 0) {
4300
4404
  logOk(`Cloned source(s): ${hydrate.cloned.join(", ")}`);
@@ -4309,7 +4413,7 @@ async function runYamlInstall(opts) {
4309
4413
  projectDir,
4310
4414
  driverTarget: opts.target
4311
4415
  });
4312
- const spinner5 = p5.spinner();
4416
+ const spinner5 = p6.spinner();
4313
4417
  spinner5.start(opts.locked ? "Installing from lock file" : "Installing dependencies");
4314
4418
  try {
4315
4419
  const result = await am2.install({ locked: opts.locked });
@@ -4337,7 +4441,7 @@ async function runYamlInstall(opts) {
4337
4441
  }
4338
4442
  function makeCheckCommand() {
4339
4443
  return new Command("check").description("Check for unmet requirements").option("--project-dir <path>", "Project directory", process.cwd()).action((opts) => {
4340
- const am2 = new AssetManager({ projectDir: path12__default.resolve(opts.projectDir) });
4444
+ const am2 = new AssetManager({ projectDir: path13__default.resolve(opts.projectDir) });
4341
4445
  const issues = am2.doctor();
4342
4446
  if (issues.length === 0) {
4343
4447
  logOk("All dependencies satisfied.");
@@ -4354,10 +4458,10 @@ function makeCheckCommand() {
4354
4458
  function makeCleanCommand() {
4355
4459
  return new Command("clean").description("Remove all skaile-managed assets from the workspace").option("--all", "Full reset: also remove history, patches, repos, and lock file").option("--dry-run", "Show what would be removed without doing it").option("-y, --yes", "Skip confirmation prompt").option("--project-dir <path>", "Project directory", process.cwd()).option("--target <agent>", "Agent framework", "claude-code").action(async (opts) => {
4356
4460
  const am2 = new AssetManager({
4357
- projectDir: path12__default.resolve(opts.projectDir),
4461
+ projectDir: path13__default.resolve(opts.projectDir),
4358
4462
  driverTarget: opts.target
4359
4463
  });
4360
- const lock = readLock(path12__default.resolve(opts.projectDir, "skaile.lock.yaml"));
4464
+ const lock = readLock(path13__default.resolve(opts.projectDir, "skaile.lock.yaml"));
4361
4465
  if (!lock || Object.keys(lock.assets).length === 0) {
4362
4466
  logInfo("Nothing to clean (no skaile-managed assets found).");
4363
4467
  return;
@@ -4381,8 +4485,8 @@ function makeCleanCommand() {
4381
4485
  return;
4382
4486
  }
4383
4487
  if (!opts.yes) {
4384
- const confirm4 = await p5.confirm({ message: "Proceed?" });
4385
- if (p5.isCancel(confirm4) || !confirm4) {
4488
+ const confirm5 = await p6.confirm({ message: "Proceed?" });
4489
+ if (p6.isCancel(confirm5) || !confirm5) {
4386
4490
  logInfo("Cancelled.");
4387
4491
  return;
4388
4492
  }
@@ -4410,14 +4514,14 @@ function makeCleanCommand() {
4410
4514
  }
4411
4515
  function makeRebuildCommand() {
4412
4516
  return new Command("rebuild").description("Re-snapshot inline-snapshot composition items and bump prompt version").argument("[agent]", "Agent name or path (defaults to current project agent)").option("--project-dir <dir>", "Project directory", process.cwd()).action(async (agentArg, opts) => {
4413
- const projectDir = path12__default.resolve(opts.projectDir);
4517
+ const projectDir = path13__default.resolve(opts.projectDir);
4414
4518
  let agentDir;
4415
4519
  if (agentArg) {
4416
4520
  if (agentArg.includes("/") || agentArg.includes("\\")) {
4417
- agentDir = path12__default.resolve(projectDir, agentArg);
4521
+ agentDir = path13__default.resolve(projectDir, agentArg);
4418
4522
  } else {
4419
4523
  const resolved = resolveAgentDir(projectDir);
4420
- agentDir = resolved ?? path12__default.resolve(projectDir, agentArg);
4524
+ agentDir = resolved ?? path13__default.resolve(projectDir, agentArg);
4421
4525
  }
4422
4526
  } else {
4423
4527
  const resolved = resolveAgentDir(projectDir);
@@ -4495,7 +4599,7 @@ function makeFlowEventHandler() {
4495
4599
  }
4496
4600
  function makeRunCommand() {
4497
4601
  const cmd = new Command("run").description("Start a flow or run a single-shot text prompt").argument("[flow-id-or-text...]", "Flow ID or text prompt").option("--project-dir <path>", "Project directory", process.cwd()).option("--driver <name>", "Driver backend (claude-sdk, codex, omp)").option("--provider <name>", "LLM provider").option("--model <name>", "Model override").option("--label <label>", "Human-readable session label").option("--dry-run", "Print plan without executing").option("--skill <name>", "Skill name (for single-shot mode)").action(async (positional, opts) => {
4498
- const projectDir = path12__default.resolve(opts.projectDir);
4602
+ const projectDir = path13__default.resolve(opts.projectDir);
4499
4603
  const cliDriver = opts.driver;
4500
4604
  const dryRun = opts.dryRun ?? false;
4501
4605
  let flowId = positional[0];
@@ -4505,7 +4609,7 @@ function makeRunCommand() {
4505
4609
  logErr("No flows available.");
4506
4610
  process.exit(1);
4507
4611
  }
4508
- const selected = await p5.select({
4612
+ const selected = await p6.select({
4509
4613
  message: "Select a flow to run",
4510
4614
  options: flows.map((f) => ({
4511
4615
  value: f.id,
@@ -4513,8 +4617,8 @@ function makeRunCommand() {
4513
4617
  hint: f.description
4514
4618
  }))
4515
4619
  });
4516
- if (p5.isCancel(selected)) {
4517
- p5.cancel("Cancelled.");
4620
+ if (p6.isCancel(selected)) {
4621
+ p6.cancel("Cancelled.");
4518
4622
  process.exit(0);
4519
4623
  }
4520
4624
  flowId = selected;
@@ -4530,12 +4634,12 @@ function makeRunCommand() {
4530
4634
  const priorityRoots = [];
4531
4635
  let dir = projectDir;
4532
4636
  for (let i = 0; i < 6; i++) {
4533
- const candidate = path12__default.join(dir, "ai-assets");
4637
+ const candidate = path13__default.join(dir, "ai-assets");
4534
4638
  if (fs11__default.existsSync(candidate)) {
4535
4639
  priorityRoots.push(candidate);
4536
4640
  break;
4537
4641
  }
4538
- dir = path12__default.dirname(dir);
4642
+ dir = path13__default.dirname(dir);
4539
4643
  }
4540
4644
  const flowPath = findFlowFile(flowId, priorityRoots);
4541
4645
  if (!flowPath) {
@@ -4590,7 +4694,7 @@ function makeRunCommand() {
4590
4694
  }
4591
4695
  function makeResumeCommand() {
4592
4696
  const cmd = new Command("resume").description("Resume current session").option("--project-dir <path>", "Project directory", process.cwd()).option("--session <run-id>", "Target session by runId").option("--dry-run", "Print plan without executing").action(async (opts) => {
4593
- const projectDir = path12__default.resolve(opts.projectDir);
4697
+ const projectDir = path13__default.resolve(opts.projectDir);
4594
4698
  const sessionId = opts.session;
4595
4699
  const dryRun = opts.dryRun ?? false;
4596
4700
  const session = sessionId ? await loadSessionById(projectDir, sessionId) : await loadSession(projectDir);
@@ -4617,7 +4721,7 @@ function makeResumeCommand() {
4617
4721
  }
4618
4722
  function makeStatusCommand() {
4619
4723
  return new Command("status").description("Show current session state").option("--project-dir <path>", "Project directory", process.cwd()).action(async (opts) => {
4620
- const projectDir = path12__default.resolve(opts.projectDir);
4724
+ const projectDir = path13__default.resolve(opts.projectDir);
4621
4725
  const session = await loadSession(projectDir);
4622
4726
  if (!session) {
4623
4727
  logInfo("No active session.");
@@ -4642,7 +4746,7 @@ function makeStatusCommand() {
4642
4746
  }
4643
4747
  function makeClearCommand() {
4644
4748
  return new Command("clear").description("Unset current session pointer").option("--project-dir <path>", "Project directory", process.cwd()).action(async (opts) => {
4645
- const projectDir = path12__default.resolve(opts.projectDir);
4749
+ const projectDir = path13__default.resolve(opts.projectDir);
4646
4750
  await clearSession(projectDir);
4647
4751
  logOk("Session cleared.");
4648
4752
  });
@@ -4652,7 +4756,7 @@ function makeReplCommand() {
4652
4756
  const { findWorkspaceRoot: findWorkspaceRoot2 } = await import('../core/index.js');
4653
4757
  const { startRepl } = await import('../tui/index.js');
4654
4758
  const os = await import('os');
4655
- const userCwd = path12__default.resolve(opts.projectDir ?? process.cwd());
4759
+ const userCwd = path13__default.resolve(opts.projectDir ?? process.cwd());
4656
4760
  const workspaceRoot = findWorkspaceRoot2(userCwd);
4657
4761
  let projectDir;
4658
4762
  let agentCwd;
@@ -4667,19 +4771,19 @@ function makeReplCommand() {
4667
4771
  console.log();
4668
4772
  logWarn(`No skaile.yaml found in ${S.cmd(userCwd)} or any parent directory.`);
4669
4773
  console.log();
4670
- const shouldCreate = await p5.confirm({
4774
+ const shouldCreate = await p6.confirm({
4671
4775
  message: "Create a temporary workspace? (session state in /tmp/)"
4672
4776
  });
4673
- if (p5.isCancel(shouldCreate) || !shouldCreate) {
4674
- p5.cancel("Cancelled.");
4777
+ if (p6.isCancel(shouldCreate) || !shouldCreate) {
4778
+ p6.cancel("Cancelled.");
4675
4779
  process.exit(0);
4676
4780
  }
4677
- const tmpDir = fs11__default.mkdtempSync(path12__default.join(os.tmpdir(), "skaile-repl-"));
4781
+ const tmpDir = fs11__default.mkdtempSync(path13__default.join(os.tmpdir(), "skaile-repl-"));
4678
4782
  projectDir = tmpDir;
4679
4783
  agentCwd = userCwd;
4680
4784
  logOk(`Temporary workspace: ${S.cmd(tmpDir)}`);
4681
4785
  if (!driverOverride) {
4682
- const claudeDir = path12__default.join(os.homedir(), ".claude");
4786
+ const claudeDir = path13__default.join(os.homedir(), ".claude");
4683
4787
  if (fs11__default.existsSync(claudeDir)) {
4684
4788
  driverOverride = "claude-sdk";
4685
4789
  logInfo(`Detected ${S.cmd("~/.claude")} \u2192 using ${S.cmd("claude-sdk")} backend`);
@@ -4731,7 +4835,7 @@ async function ensurePluginsLoadedForServe(projectDir) {
4731
4835
  const { resolveSkWorkspaceConfig: resolveSkWorkspaceConfig2 } = await import('../core/index.js');
4732
4836
  const config = resolveSkWorkspaceConfig2(projectDir);
4733
4837
  if (!config.plugins || config.plugins.length === 0) return;
4734
- const { ensurePluginsLoaded } = await import('../plugin-store-LGLN2QUX.js');
4838
+ const { ensurePluginsLoaded } = await import('../plugin-store-RBCDBO7K.js');
4735
4839
  const { pluginRegistry } = await import('../plugin-registry/index.js');
4736
4840
  const result = await ensurePluginsLoaded(projectDir, config.plugins, pluginRegistry);
4737
4841
  if (result.loaded.length > 0) {
@@ -4749,10 +4853,10 @@ async function runCompileTest(opts) {
4749
4853
  const { tmpdir } = await import('os');
4750
4854
  const { dirname: dirname3, join: join5, resolve: resolve4 } = await import('path');
4751
4855
  const { fileURLToPath: fileURLToPath2 } = await import('url');
4752
- const { unlinkSync, existsSync: existsSync12 } = await import('fs');
4856
+ const { unlinkSync, existsSync: existsSync13 } = await import('fs');
4753
4857
  const { spawn } = await import('child_process');
4754
4858
  const { portableSpawnSync: portableSpawnSync2 } = await import('../core/index.js');
4755
- const { MONOREPO_ROOT } = await import('../paths-7H5CSBLQ.js');
4859
+ const { MONOREPO_ROOT } = await import('../paths-4SSFMX5Z.js');
4756
4860
  if (MONOREPO_ROOT === null) {
4757
4861
  logErr2("--compile-test is only available inside the skaile-dev workspace.");
4758
4862
  logInfo2("Run it from a checkout of skaile-ai/skaile-dev (the monorepo shell).");
@@ -4811,7 +4915,7 @@ async function runCompileTest(opts) {
4811
4915
  } catch {
4812
4916
  }
4813
4917
  try {
4814
- if (existsSync12(outfile)) unlinkSync(outfile);
4918
+ if (existsSync13(outfile)) unlinkSync(outfile);
4815
4919
  } catch {
4816
4920
  }
4817
4921
  }
@@ -5222,7 +5326,7 @@ function resolveMode(opts) {
5222
5326
  if (opts.forceLocal && opts.forceRemote) {
5223
5327
  throw new Error("Cannot use both --local and --remote");
5224
5328
  }
5225
- const startDir = path12__default.resolve(opts.projectDir ?? process.cwd());
5329
+ const startDir = path13__default.resolve(opts.projectDir ?? process.cwd());
5226
5330
  const localDb = findLogsDb(startDir);
5227
5331
  if (opts.forceLocal) {
5228
5332
  if (!localDb) {
@@ -5255,14 +5359,14 @@ function resolveMode(opts) {
5255
5359
  function findLogsDb(startDir) {
5256
5360
  let dir = startDir;
5257
5361
  for (let i = 0; i < MAX_WALK_LEVELS; i++) {
5258
- const candidate = path12__default.join(dir, ".skaile", "logs.db");
5362
+ const candidate = path13__default.join(dir, ".skaile", "logs.db");
5259
5363
  if (existsSync(candidate)) {
5260
5364
  try {
5261
5365
  if (statSync(candidate).isFile()) return candidate;
5262
5366
  } catch {
5263
5367
  }
5264
5368
  }
5265
- const parent = path12__default.dirname(dir);
5369
+ const parent = path13__default.dirname(dir);
5266
5370
  if (parent === dir) return void 0;
5267
5371
  dir = parent;
5268
5372
  }
@@ -5288,7 +5392,7 @@ function readApiToken() {
5288
5392
  }
5289
5393
  function readGlobalSettings() {
5290
5394
  try {
5291
- const settingsPath = path12__default.join(homedir(), ".skaile", "settings.json");
5395
+ const settingsPath = path13__default.join(homedir(), ".skaile", "settings.json");
5292
5396
  if (!existsSync(settingsPath)) return {};
5293
5397
  return JSON.parse(readFileSync(settingsPath, "utf8"));
5294
5398
  } catch {
@@ -5437,7 +5541,7 @@ function parsePositiveInt(value, flag) {
5437
5541
  function makeSessionCommand() {
5438
5542
  const cmd = new Command("session").description("Manage sessions");
5439
5543
  cmd.command("list").description("List all sessions for a project").option("--project-dir <path>", "Project directory", process.cwd()).action(async (opts) => {
5440
- const projectDir = path12__default.resolve(opts.projectDir);
5544
+ const projectDir = path13__default.resolve(opts.projectDir);
5441
5545
  const sessions = await listSessions(projectDir);
5442
5546
  const current = await loadSession(projectDir);
5443
5547
  if (sessions.length === 0) {
@@ -5465,7 +5569,7 @@ function makeSessionCommand() {
5465
5569
  console.log();
5466
5570
  });
5467
5571
  cmd.command("show <run-id>").description("Show a specific session").option("--project-dir <path>", "Project directory", process.cwd()).action(async (runId, opts) => {
5468
- const projectDir = path12__default.resolve(opts.projectDir);
5572
+ const projectDir = path13__default.resolve(opts.projectDir);
5469
5573
  const session = await loadSessionById(projectDir, runId);
5470
5574
  if (!session) {
5471
5575
  logErr(`Session not found: ${runId}`);
@@ -5474,12 +5578,12 @@ function makeSessionCommand() {
5474
5578
  console.log(JSON.stringify(session, null, 2));
5475
5579
  });
5476
5580
  cmd.command("switch <run-id>").description("Switch the current session").option("--project-dir <path>", "Project directory", process.cwd()).action(async (runId, opts) => {
5477
- const projectDir = path12__default.resolve(opts.projectDir);
5581
+ const projectDir = path13__default.resolve(opts.projectDir);
5478
5582
  await setCurrentSession(projectDir, runId);
5479
5583
  logOk(`Switched to session: ${S.dim(runId.slice(0, 8))}`);
5480
5584
  });
5481
5585
  cmd.command("delete <run-id>").description("Delete a session").option("--project-dir <path>", "Project directory", process.cwd()).action(async (runId, opts) => {
5482
- const projectDir = path12__default.resolve(opts.projectDir);
5586
+ const projectDir = path13__default.resolve(opts.projectDir);
5483
5587
  await deleteSession(projectDir, runId);
5484
5588
  logOk(`Deleted session: ${S.dim(runId.slice(0, 8))}`);
5485
5589
  });
@@ -5547,7 +5651,7 @@ function showAsset(am2, kind, name) {
5547
5651
  function makeShowCommand() {
5548
5652
  return new Command("show").description("Show deployed assets overview, or print asset content").argument("[kind]", "Asset kind (skill, agent, prompt, flow, bundle, contract)").argument("[name]", "Asset name").option("--project-dir <path>", "Project directory", process.cwd()).option("--target <agent>", "Agent framework", "claude-code").action((kind, name, opts) => {
5549
5653
  const am2 = new AssetManager({
5550
- projectDir: path12__default.resolve(opts.projectDir),
5654
+ projectDir: path13__default.resolve(opts.projectDir),
5551
5655
  driverTarget: opts.target
5552
5656
  });
5553
5657
  if (!kind) {
@@ -5584,11 +5688,8 @@ function addSourceManifestCommands(src) {
5584
5688
  }
5585
5689
 
5586
5690
  // cli/src/commands/source.ts
5587
- function sourcesDir() {
5588
- return path12.join(skaileHomeDir(), "sources");
5589
- }
5590
5691
  function sourceClonePath(name) {
5591
- return path12.join(sourcesDir(), name);
5692
+ return path13.join(getGlobalCacheDir(), name);
5592
5693
  }
5593
5694
  function deriveSlug(url) {
5594
5695
  return url.replace(/\.git$/, "").split(/[/:]/).pop() ?? "source";
@@ -5613,7 +5714,7 @@ function requireProjectYamlPath() {
5613
5714
  );
5614
5715
  process.exit(1);
5615
5716
  }
5616
- return path12.join(root, workspaceConfigFilename());
5717
+ return path13.join(root, workspaceConfigFilename());
5617
5718
  }
5618
5719
  function readProjectSources(yamlPath) {
5619
5720
  if (!existsSync(yamlPath)) return [];
@@ -5711,7 +5812,7 @@ function makeSourceCommand() {
5711
5812
  const result = await refreshManifestCache(entry, opts.dev);
5712
5813
  logOk(`Indexed ${result.assetsUpdated} of ${result.assetsFound} asset(s) from "${slug}".`);
5713
5814
  for (const err of result.errors) logWarn(err);
5714
- logOk(`Source "${slug}" registered in ${path12.relative(process.cwd(), yamlPath)}.`);
5815
+ logOk(`Source "${slug}" registered in ${path13.relative(process.cwd(), yamlPath)}.`);
5715
5816
  }
5716
5817
  );
5717
5818
  cmd.command("list").description("List sources registered in this project's skaile.yaml").option("--json", "Output as JSON").action(async (opts) => {
@@ -5754,7 +5855,7 @@ function makeSourceCommand() {
5754
5855
  )
5755
5856
  );
5756
5857
  });
5757
- cmd.command("remove <name-or-url>").description("Remove a source from this project's skaile.yaml (matched by URL or slug)").option("--purge", "Also delete the cached clone from ~/.skaile/sources/", false).action(async (key, opts) => {
5858
+ cmd.command("remove <name-or-url>").description("Remove a source from this project's skaile.yaml (matched by URL or slug)").option("--purge", "Also delete the cached clone from ~/.skaile/cache/sources/", false).action(async (key, opts) => {
5758
5859
  const yamlPath = requireProjectYamlPath();
5759
5860
  const editor = WorkspaceYamlEditor.load(yamlPath);
5760
5861
  const match = editor.getSources().find((s) => sourceMatchesKey(s, key));
@@ -5767,7 +5868,7 @@ function makeSourceCommand() {
5767
5868
  editor.save();
5768
5869
  await dropManifestCache(slug, opts.purge);
5769
5870
  logOk(
5770
- opts.purge ? `Removed source "${slug}" and purged its clone.` : `Removed source "${slug}" from skaile.yaml (clone left in ~/.skaile/sources/).`
5871
+ opts.purge ? `Removed source "${slug}" and purged its clone.` : `Removed source "${slug}" from skaile.yaml (clone left in ~/.skaile/cache/sources/).`
5771
5872
  );
5772
5873
  });
5773
5874
  cmd.command("sync [name]").description("Pull upstream changes and refresh the manifest cache").option("--dev", "Also index dev-only assets under each source's dev_paths", false).option("--all", "Sync every source without prompting", false).action(async (key, opts) => {
@@ -5787,13 +5888,13 @@ function makeSourceCommand() {
5787
5888
  } else if (opts.all || sources.length === 1 || !process.stdin.isTTY) {
5788
5889
  targets = sources;
5789
5890
  } else {
5790
- const selected = await p5.multiselect({
5891
+ const selected = await p6.multiselect({
5791
5892
  message: "Select sources to sync",
5792
5893
  options: sources.map((s) => ({ value: s.url, label: deriveSlug(s.url), hint: s.url })),
5793
5894
  required: true
5794
5895
  });
5795
- if (p5.isCancel(selected)) {
5796
- p5.cancel("Cancelled.");
5896
+ if (p6.isCancel(selected)) {
5897
+ p6.cancel("Cancelled.");
5797
5898
  return;
5798
5899
  }
5799
5900
  const picked = new Set(selected);
@@ -5997,7 +6098,7 @@ function printTree(node, prefix = "", isLast = true) {
5997
6098
  }
5998
6099
  function makeTreeCommand() {
5999
6100
  return new Command("tree").description("Show full dependency tree").option("--project-dir <path>", "Project directory", process.cwd()).action((opts) => {
6000
- const am2 = new AssetManager({ projectDir: path12__default.resolve(opts.projectDir) });
6101
+ const am2 = new AssetManager({ projectDir: path13__default.resolve(opts.projectDir) });
6001
6102
  const root = am2.tree();
6002
6103
  if (root.children.length === 0) {
6003
6104
  logInfo("No dependencies in lock file. Run `skaile install` first.");
@@ -6013,9 +6114,9 @@ function makeUpdateCommand() {
6013
6114
  async (_name, opts) => {
6014
6115
  if (opts.catalog !== false) {
6015
6116
  try {
6016
- const catalogSpinner = p5.spinner();
6117
+ const catalogSpinner = p6.spinner();
6017
6118
  catalogSpinner.start("Refreshing catalog cache");
6018
- const remote = await openCatalogSource({ projectDir: path12__default.resolve(opts.projectDir) });
6119
+ const remote = await openCatalogSource({ projectDir: path13__default.resolve(opts.projectDir) });
6019
6120
  const result2 = await remote.refresh();
6020
6121
  catalogSpinner.stop(
6021
6122
  `Catalog refreshed: ${S.heading(String(result2.assetsCached))} assets cached`
@@ -6027,8 +6128,8 @@ function makeUpdateCommand() {
6027
6128
  }
6028
6129
  }
6029
6130
  if (opts.catalogOnly) return;
6030
- const am2 = new AssetManager({ projectDir: path12__default.resolve(opts.projectDir) });
6031
- const spinner5 = p5.spinner();
6131
+ const am2 = new AssetManager({ projectDir: path13__default.resolve(opts.projectDir) });
6132
+ const spinner5 = p6.spinner();
6032
6133
  spinner5.start("Re-deploying assets");
6033
6134
  const result = await am2.install();
6034
6135
  spinner5.stop("Done");
@@ -6066,7 +6167,7 @@ function findManifestCandidates(rootPath) {
6066
6167
  return;
6067
6168
  }
6068
6169
  for (const entry of entries) {
6069
- const fullPath = path12__default.join(dir, entry.name);
6170
+ const fullPath = path13__default.join(dir, entry.name);
6070
6171
  if (entry.isDirectory()) {
6071
6172
  if (!SKIP_DIRS.has(entry.name)) walk(fullPath);
6072
6173
  } else if (entry.isFile()) {
@@ -6119,13 +6220,13 @@ function parseManifestCandidate(c, absRoot) {
6119
6220
  const parsed = c.filePath.endsWith(".json") ? JSON.parse(content) : parse(content);
6120
6221
  return { kind: "value", parsed };
6121
6222
  } catch (e) {
6122
- const relPath = path12__default.relative(absRoot, c.filePath);
6223
+ const relPath = path13__default.relative(absRoot, c.filePath);
6123
6224
  logErr(`${relPath} \u2014 parse error: ${e instanceof Error ? e.message : String(e)}`);
6124
6225
  return { kind: "error" };
6125
6226
  }
6126
6227
  }
6127
6228
  function validateManifestCandidate(c, parsed, absRoot, registry) {
6128
- const relPath = path12__default.relative(absRoot, c.filePath);
6229
+ const relPath = path13__default.relative(absRoot, c.filePath);
6129
6230
  let errors = 0;
6130
6231
  const identityError = checkManifestIdentity(c.kind, parsed);
6131
6232
  if (identityError) {
@@ -6147,7 +6248,7 @@ function validateManifestCandidate(c, parsed, absRoot, registry) {
6147
6248
  return { errors, warnings: 0 };
6148
6249
  }
6149
6250
  function validateManifests(rootPath) {
6150
- const absRoot = path12__default.resolve(rootPath);
6251
+ const absRoot = path13__default.resolve(rootPath);
6151
6252
  if (!fs11__default.existsSync(absRoot)) {
6152
6253
  logErr(`Path does not exist: ${absRoot}`);
6153
6254
  return { total: 0, errors: 1, warnings: 0 };
@@ -6179,7 +6280,7 @@ function findWorkspaceManifests(rootPath) {
6179
6280
  return;
6180
6281
  }
6181
6282
  for (const entry of entries) {
6182
- const full = path12__default.join(dir, entry.name);
6283
+ const full = path13__default.join(dir, entry.name);
6183
6284
  if (entry.isDirectory()) {
6184
6285
  if (!SKIP_DIRS.has(entry.name)) walk(full);
6185
6286
  } else if (entry.isFile() && /(^|\.)skaile\.yaml$/.test(entry.name)) {
@@ -6242,11 +6343,11 @@ function validateWorkspaceAssets(parsed, relPath) {
6242
6343
  return errors;
6243
6344
  }
6244
6345
  function validateWorkspaceManifests(rootPath) {
6245
- const absRoot = path12__default.resolve(rootPath);
6346
+ const absRoot = path13__default.resolve(rootPath);
6246
6347
  const files = findWorkspaceManifests(absRoot);
6247
6348
  let errors = 0;
6248
6349
  for (const file of files) {
6249
- const relPath = path12__default.relative(absRoot, file);
6350
+ const relPath = path13__default.relative(absRoot, file);
6250
6351
  let parsed;
6251
6352
  try {
6252
6353
  parsed = parse(fs11__default.readFileSync(file, "utf-8")) ?? {};
@@ -6266,20 +6367,20 @@ function collectAssetVersions() {
6266
6367
  if (!fs11__default.existsSync(AI_RESOURCES)) return assets;
6267
6368
  const domains = fs11__default.readdirSync(AI_RESOURCES, { withFileTypes: true }).filter((d) => d.isDirectory() && !EXCLUDED_DOMAINS.has(d.name));
6268
6369
  for (const d of domains) {
6269
- const domainDir = path12__default.join(AI_RESOURCES, d.name);
6270
- const skillsDir = path12__default.join(domainDir, "skills");
6370
+ const domainDir = path13__default.join(AI_RESOURCES, d.name);
6371
+ const skillsDir = path13__default.join(domainDir, "skills");
6271
6372
  if (fs11__default.existsSync(skillsDir)) {
6272
6373
  collectSkillVersions(skillsDir, d.name, assets);
6273
6374
  }
6274
- const agentsDir = path12__default.join(domainDir, "agents");
6375
+ const agentsDir = path13__default.join(domainDir, "agents");
6275
6376
  if (fs11__default.existsSync(agentsDir)) {
6276
6377
  collectAgentVersions(agentsDir, d.name, assets);
6277
6378
  }
6278
- const flowsDir = path12__default.join(domainDir, "flows");
6379
+ const flowsDir = path13__default.join(domainDir, "flows");
6279
6380
  if (fs11__default.existsSync(flowsDir)) {
6280
6381
  collectFlowVersions(flowsDir, d.name, assets);
6281
6382
  }
6282
- const promptsDir = path12__default.join(domainDir, "prompts");
6383
+ const promptsDir = path13__default.join(domainDir, "prompts");
6283
6384
  if (fs11__default.existsSync(promptsDir)) {
6284
6385
  collectPromptVersions(promptsDir, d.name, assets);
6285
6386
  }
@@ -6289,7 +6390,7 @@ function collectAssetVersions() {
6289
6390
  function collectFlowVersions(dir, domain, out) {
6290
6391
  for (const f of fs11__default.readdirSync(dir)) {
6291
6392
  if (!f.endsWith(".flow.yaml")) continue;
6292
- const fp = path12__default.join(dir, f);
6393
+ const fp = path13__default.join(dir, f);
6293
6394
  const content = fs11__default.readFileSync(fp, "utf-8");
6294
6395
  const parsed = parse(content);
6295
6396
  out.push({
@@ -6304,7 +6405,7 @@ function collectFlowVersions(dir, domain, out) {
6304
6405
  function collectPromptVersions(dir, domain, out) {
6305
6406
  for (const f of fs11__default.readdirSync(dir)) {
6306
6407
  if (!f.endsWith(".prompt.md")) continue;
6307
- const fp = path12__default.join(dir, f);
6408
+ const fp = path13__default.join(dir, f);
6308
6409
  const content = fs11__default.readFileSync(fp, "utf-8");
6309
6410
  const fm = parseSkillFrontmatter(content);
6310
6411
  out.push({
@@ -6319,8 +6420,8 @@ function collectPromptVersions(dir, domain, out) {
6319
6420
  function collectSkillVersions(dir, domain, out) {
6320
6421
  for (const entry of fs11__default.readdirSync(dir, { withFileTypes: true })) {
6321
6422
  if (!entry.isDirectory()) continue;
6322
- const full = path12__default.join(dir, entry.name);
6323
- const skillMd = path12__default.join(full, "SKILL.md");
6423
+ const full = path13__default.join(dir, entry.name);
6424
+ const skillMd = path13__default.join(full, "SKILL.md");
6324
6425
  if (fs11__default.existsSync(skillMd)) {
6325
6426
  const content = fs11__default.readFileSync(skillMd, "utf-8");
6326
6427
  const fm = parseSkillFrontmatter(content);
@@ -6339,7 +6440,7 @@ function collectSkillVersions(dir, domain, out) {
6339
6440
  function collectAgentVersions(dir, domain, out) {
6340
6441
  for (const entry of fs11__default.readdirSync(dir, { withFileTypes: true })) {
6341
6442
  if (!entry.isDirectory()) continue;
6342
- const agentYaml = path12__default.join(dir, entry.name, "agent.yaml");
6443
+ const agentYaml = path13__default.join(dir, entry.name, "agent.yaml");
6343
6444
  if (!fs11__default.existsSync(agentYaml)) continue;
6344
6445
  const content = fs11__default.readFileSync(agentYaml, "utf-8");
6345
6446
  const parsed = parse(content);
@@ -6372,7 +6473,7 @@ function filterToChangedAssets(assets) {
6372
6473
  encoding: "utf-8"
6373
6474
  });
6374
6475
  const changedFiles = new Set(
6375
- diffOutput.trim().split("\n").filter(Boolean).map((f) => path12__default.resolve(AI_RESOURCES, f))
6476
+ diffOutput.trim().split("\n").filter(Boolean).map((f) => path13__default.resolve(AI_RESOURCES, f))
6376
6477
  );
6377
6478
  return assets.filter((a) => changedFiles.has(a.filePath));
6378
6479
  } catch {
@@ -6398,7 +6499,7 @@ function checkVersionBumps(assets) {
6398
6499
  let warnings = 0;
6399
6500
  for (const a of assets) {
6400
6501
  if (!a.version) continue;
6401
- const relPath = path12__default.relative(AI_RESOURCES, a.filePath);
6502
+ const relPath = path13__default.relative(AI_RESOURCES, a.filePath);
6402
6503
  try {
6403
6504
  const headContent = execSync(`git show HEAD:${relPath}`, {
6404
6505
  cwd: AI_RESOURCES,
@@ -6471,7 +6572,7 @@ function makeValidateCommand() {
6471
6572
  "Validate asset manifests, versions, and changelogs"
6472
6573
  );
6473
6574
  cmd.argument("[path]", "Path to asset repo or directory to validate", ".").action((targetPath) => {
6474
- const absPath = path12__default.resolve(targetPath);
6575
+ const absPath = path13__default.resolve(targetPath);
6475
6576
  logInfo(`Validating manifests in ${absPath}`);
6476
6577
  const { total, errors } = validateManifests(absPath);
6477
6578
  const ws = validateWorkspaceManifests(absPath);
@@ -6517,7 +6618,7 @@ function makeValidateCommand() {
6517
6618
  let errors = 0;
6518
6619
  for (const domain of modifiedDomains) {
6519
6620
  const changelogModified = modifiedFiles.some(
6520
- (f) => f === `${domain}/CHANGELOG.md` || f === path12__default.join(domain, "CHANGELOG.md")
6621
+ (f) => f === `${domain}/CHANGELOG.md` || f === path13__default.join(domain, "CHANGELOG.md")
6521
6622
  );
6522
6623
  if (changelogModified) {
6523
6624
  logOk(`${domain}/CHANGELOG.md updated`);
@@ -6599,7 +6700,7 @@ function makeVerifyCommand() {
6599
6700
  }
6600
6701
  function makeWhyCommand() {
6601
6702
  return new Command("why").description("Show why an asset is installed (dependency chain)").argument("<ref>", "Asset reference (kind:name)").option("--project-dir <path>", "Project directory", process.cwd()).action((ref, opts) => {
6602
- const am2 = new AssetManager({ projectDir: path12__default.resolve(opts.projectDir) });
6703
+ const am2 = new AssetManager({ projectDir: path13__default.resolve(opts.projectDir) });
6603
6704
  const chain = am2.why(ref);
6604
6705
  if (chain.length === 0) {
6605
6706
  logErr(`${ref} not found in lock file. Run \`skaile install\` first.`);
@@ -6620,7 +6721,7 @@ function makeWhyCommand() {
6620
6721
  var _defaultFormatHelp = Help.prototype.formatHelp;
6621
6722
  var pkg = JSON.parse(
6622
6723
  readFileSync(
6623
- path12__default.resolve(path12__default.dirname(fileURLToPath(import.meta.url)), "../../package.json"),
6724
+ path13__default.resolve(path13__default.dirname(fileURLToPath(import.meta.url)), "../../package.json"),
6624
6725
  "utf-8"
6625
6726
  )
6626
6727
  );
@@ -6750,32 +6851,32 @@ async function runInit(projectDir, opts) {
6750
6851
  process.exitCode = 1;
6751
6852
  return;
6752
6853
  }
6753
- const resolved = path12__default.resolve(projectDir ?? ".");
6754
- const projectName = path12__default.basename(resolved);
6854
+ const resolved = path13__default.resolve(projectDir ?? ".");
6855
+ const projectName = path13__default.basename(resolved);
6755
6856
  const created = [];
6756
- const { existsSync: existsSync12 } = await import('fs');
6757
- if (!existsSync12(resolved)) {
6857
+ const { existsSync: existsSync13 } = await import('fs');
6858
+ if (!existsSync13(resolved)) {
6758
6859
  mkdirSync3(resolved, { recursive: true });
6759
6860
  created.push(".");
6760
6861
  }
6761
- const skaileDir = path12__default.join(resolved, ".skaile");
6762
- if (!existsSync12(skaileDir)) {
6763
- mkdirSync3(path12__default.join(skaileDir, "sessions"), { recursive: true });
6862
+ const skaileDir = path13__default.join(resolved, ".skaile");
6863
+ if (!existsSync13(skaileDir)) {
6864
+ mkdirSync3(path13__default.join(skaileDir, "sessions"), { recursive: true });
6764
6865
  created.push(".skaile/");
6765
6866
  }
6766
- const settingsPath = path12__default.join(skaileDir, "settings.json");
6767
- if (!existsSync12(settingsPath)) {
6867
+ const settingsPath = path13__default.join(skaileDir, "settings.json");
6868
+ if (!existsSync13(settingsPath)) {
6768
6869
  writeFileSync2(settingsPath, "{}\n");
6769
6870
  created.push(".skaile/settings.json");
6770
6871
  }
6771
- const wsConfigPath = path12__default.join(resolved, "skaile.yaml");
6772
- if (!existsSync12(wsConfigPath)) {
6872
+ const wsConfigPath = path13__default.join(resolved, "skaile.yaml");
6873
+ if (!existsSync13(wsConfigPath)) {
6773
6874
  writeFileSync2(wsConfigPath, stringify(buildInitWorkspaceConfig(projectName, backend)));
6774
6875
  created.push("skaile.yaml");
6775
6876
  }
6776
6877
  for (const dir of new Set(Object.values(DRIVER_TARGETS[backend].local))) {
6777
- const full = path12__default.join(resolved, dir);
6778
- if (!existsSync12(full)) {
6878
+ const full = path13__default.join(resolved, dir);
6879
+ if (!existsSync13(full)) {
6779
6880
  mkdirSync3(full, { recursive: true });
6780
6881
  created.push(`${dir}/`);
6781
6882
  }
@@ -6806,10 +6907,17 @@ function buildInitWorkspaceConfig(projectName, backend) {
6806
6907
  }
6807
6908
  async function initGitScaffold(resolved, created) {
6808
6909
  const { execSync: execSync3 } = await import('child_process');
6809
- const { existsSync: existsSync12, readFileSync: readFileSync6, writeFileSync: writeFileSync2 } = await import('fs');
6810
- const gitignorePath = path12__default.join(resolved, ".gitignore");
6811
- const entries = ["node_modules/", ".skaile/sessions/", "*.log", ".env", ".env.local"];
6812
- const existing = existsSync12(gitignorePath) ? readFileSync6(gitignorePath, "utf-8") : "";
6910
+ const { existsSync: existsSync13, readFileSync: readFileSync6, writeFileSync: writeFileSync2 } = await import('fs');
6911
+ const gitignorePath = path13__default.join(resolved, ".gitignore");
6912
+ const entries = [
6913
+ "node_modules/",
6914
+ ".skaile/sessions/",
6915
+ ".skaile/cache/",
6916
+ "*.log",
6917
+ ".env",
6918
+ ".env.local"
6919
+ ];
6920
+ const existing = existsSync13(gitignorePath) ? readFileSync6(gitignorePath, "utf-8") : "";
6813
6921
  const have = new Set(existing.split("\n").map((l) => l.trim()));
6814
6922
  const append = entries.filter((e) => !have.has(e));
6815
6923
  if (append.length > 0) {
@@ -6818,7 +6926,7 @@ async function initGitScaffold(resolved, created) {
6818
6926
  `);
6819
6927
  if (!existing) created.push(".gitignore");
6820
6928
  }
6821
- if (!existsSync12(path12__default.join(resolved, ".git"))) {
6929
+ if (!existsSync13(path13__default.join(resolved, ".git"))) {
6822
6930
  try {
6823
6931
  execSync3("git init", { cwd: resolved, stdio: "pipe" });
6824
6932
  created.push(".git/");
@@ -6848,9 +6956,9 @@ async function bootstrapUserConfig() {
6848
6956
  }
6849
6957
  async function hydrateInitSources(resolved, created) {
6850
6958
  try {
6851
- const { ensureSourcesCloned } = await import('../ensure-sources-VQDZB7NT.js');
6959
+ const { ensureSourcesCloned } = await import('../ensure-sources-NSDMTAWN.js');
6852
6960
  const hydrate = ensureSourcesCloned(resolved, { quiet: true });
6853
- for (const n of hydrate.cloned) created.push(`~/.skaile/sources/${n}/`);
6961
+ for (const n of hydrate.cloned) created.push(`~/.skaile/cache/sources/${n}/`);
6854
6962
  if (hydrate.failed.length > 0) {
6855
6963
  logErr(`Failed to clone source(s): ${hydrate.failed.join(", ")}`);
6856
6964
  }
@@ -6864,7 +6972,7 @@ function printInitSummary(resolved, projectDir, created) {
6864
6972
  logOk(`Initialized project at ${S.heading(resolved)}`);
6865
6973
  console.log();
6866
6974
  console.log(S.heading(" Next steps:"));
6867
- const isCurrentDir = resolved === path12__default.resolve(".");
6975
+ const isCurrentDir = resolved === path13__default.resolve(".");
6868
6976
  let step = 1;
6869
6977
  if (!isCurrentDir) {
6870
6978
  console.log(` ${S.dim(`${step}.`)} ${S.cmd(`cd ${projectDir}`)}`);
@@ -6876,12 +6984,13 @@ function printInitSummary(resolved, projectDir, created) {
6876
6984
  console.log();
6877
6985
  }
6878
6986
  program.command("setup").description("Interactive provider setup wizard").action(async () => {
6879
- const { cmdSetup } = await import('../setup-EVNPECSY.js');
6987
+ const { cmdSetup } = await import('../setup-VGZTFQ32.js');
6880
6988
  await cmdSetup([], { projectDir: process.cwd() });
6881
6989
  });
6882
6990
  program.addCommand(makeInstallCommand());
6883
6991
  program.addCommand(makeCheckCommand());
6884
6992
  program.addCommand(makeCleanCommand());
6993
+ program.addCommand(makeCacheCommand());
6885
6994
  program.addCommand(makeConfigCommand());
6886
6995
  program.addCommand(makeAddCommand());
6887
6996
  program.addCommand(makeRemoveCommand());