@skaile/workspaces 6.13.1 → 6.14.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 (170) hide show
  1. package/CHANGELOG.md +14 -0
  2. package/dist/{asset-feeds-HS4IUMUN.js → asset-feeds-DOG5FK7T.js} +6 -6
  3. package/dist/{asset-feeds-HS4IUMUN.js.map → asset-feeds-DOG5FK7T.js.map} +1 -1
  4. package/dist/asset-manager/index.js +1 -1
  5. package/dist/bridge/harnesses/claude-sdk.js +13 -15
  6. package/dist/bridge/harnesses/claude-sdk.js.map +1 -1
  7. package/dist/bridge/harnesses/codex.js +4 -4
  8. package/dist/bridge/harnesses/continue.js +5 -5
  9. package/dist/bridge/harnesses/echo.js +2 -2
  10. package/dist/bridge/harnesses/gemini.js +7 -7
  11. package/dist/bridge/harnesses/goose.js +5 -5
  12. package/dist/bridge/harnesses/omp.js +7 -6
  13. package/dist/bridge/harnesses/omp.js.map +1 -1
  14. package/dist/bridge/harnesses/opencode.js +7 -88
  15. package/dist/bridge/harnesses/opencode.js.map +1 -1
  16. package/dist/bridge/harnesses/qwen.js +7 -7
  17. package/dist/bridge/index.js +11 -9
  18. package/dist/bridge/src/harness-binaries.d.ts +52 -5
  19. package/dist/bridge/src/harness-binaries.d.ts.map +1 -1
  20. package/dist/bridge/src/harness-detect.d.ts +73 -0
  21. package/dist/bridge/src/harness-detect.d.ts.map +1 -0
  22. package/dist/bridge/src/harness-model-check.d.ts.map +1 -1
  23. package/dist/bridge/src/harness-model-discovery.d.ts +66 -0
  24. package/dist/bridge/src/harness-model-discovery.d.ts.map +1 -0
  25. package/dist/bridge/src/harnesses/_subprocess-cli.d.ts.map +1 -1
  26. package/dist/bridge/src/harnesses/claude-sdk.d.ts +4 -2
  27. package/dist/bridge/src/harnesses/claude-sdk.d.ts.map +1 -1
  28. package/dist/bridge/src/harnesses/omp.d.ts.map +1 -1
  29. package/dist/bridge/src/index.d.ts +3 -1
  30. package/dist/bridge/src/index.d.ts.map +1 -1
  31. package/dist/bridge/src/models.d.ts +9 -0
  32. package/dist/bridge/src/models.d.ts.map +1 -1
  33. package/dist/{chunk-YYQDSC7I.js → chunk-243Z3BNB.js} +3 -3
  34. package/dist/{chunk-YYQDSC7I.js.map → chunk-243Z3BNB.js.map} +1 -1
  35. package/dist/{chunk-R2P77YRM.js → chunk-2URJ7W5X.js} +3 -3
  36. package/dist/{chunk-R2P77YRM.js.map → chunk-2URJ7W5X.js.map} +1 -1
  37. package/dist/{chunk-MNED5ZCW.js → chunk-3BRBTQ6M.js} +2 -2
  38. package/dist/{chunk-MNED5ZCW.js.map → chunk-3BRBTQ6M.js.map} +1 -1
  39. package/dist/{chunk-UBN7HI4S.js → chunk-4SSTREBO.js} +3 -3
  40. package/dist/{chunk-UBN7HI4S.js.map → chunk-4SSTREBO.js.map} +1 -1
  41. package/dist/{chunk-Z56QSYGJ.js → chunk-5FO4U3OL.js} +4 -4
  42. package/dist/{chunk-Z56QSYGJ.js.map → chunk-5FO4U3OL.js.map} +1 -1
  43. package/dist/chunk-6ISJMEDX.js +88 -0
  44. package/dist/chunk-6ISJMEDX.js.map +1 -0
  45. package/dist/{chunk-HG2PDB3T.js → chunk-7UBCUKJO.js} +2 -2
  46. package/dist/{chunk-HG2PDB3T.js.map → chunk-7UBCUKJO.js.map} +1 -1
  47. package/dist/{chunk-GFBKUX3J.js → chunk-A7TM4PZZ.js} +7 -21
  48. package/dist/chunk-A7TM4PZZ.js.map +1 -0
  49. package/dist/{chunk-7MO23JPX.js → chunk-B6W5DCH5.js} +5 -5
  50. package/dist/{chunk-7MO23JPX.js.map → chunk-B6W5DCH5.js.map} +1 -1
  51. package/dist/{chunk-P6VNPRLD.js → chunk-CFRHYD4C.js} +8 -8
  52. package/dist/{chunk-P6VNPRLD.js.map → chunk-CFRHYD4C.js.map} +1 -1
  53. package/dist/{chunk-ZJMSX2T6.js → chunk-DYH3VSPU.js} +7 -7
  54. package/dist/{chunk-ZJMSX2T6.js.map → chunk-DYH3VSPU.js.map} +1 -1
  55. package/dist/{chunk-EISPUJ7D.js → chunk-F6LDWA2N.js} +3 -3
  56. package/dist/{chunk-EISPUJ7D.js.map → chunk-F6LDWA2N.js.map} +1 -1
  57. package/dist/{chunk-JXKT2QGT.js → chunk-F7WMHDTV.js} +10 -4
  58. package/dist/chunk-F7WMHDTV.js.map +1 -0
  59. package/dist/{chunk-HP62IELJ.js → chunk-J3FJTH3V.js} +3 -3
  60. package/dist/{chunk-HP62IELJ.js.map → chunk-J3FJTH3V.js.map} +1 -1
  61. package/dist/{chunk-GIMFNRNR.js → chunk-LMUNQYJQ.js} +418 -14
  62. package/dist/chunk-LMUNQYJQ.js.map +1 -0
  63. package/dist/{chunk-F6IEGYOI.js → chunk-LZCX2TCZ.js} +12 -12
  64. package/dist/{chunk-F6IEGYOI.js.map → chunk-LZCX2TCZ.js.map} +1 -1
  65. package/dist/{chunk-DUIZB6JM.js → chunk-NAAFRZTA.js} +3 -3
  66. package/dist/{chunk-DUIZB6JM.js.map → chunk-NAAFRZTA.js.map} +1 -1
  67. package/dist/{chunk-4OAUOH3A.js → chunk-OC3AIMZH.js} +5 -5
  68. package/dist/{chunk-4OAUOH3A.js.map → chunk-OC3AIMZH.js.map} +1 -1
  69. package/dist/{chunk-3NKXGAP4.js → chunk-OKPITFE3.js} +2 -2
  70. package/dist/{chunk-3NKXGAP4.js.map → chunk-OKPITFE3.js.map} +1 -1
  71. package/dist/{chunk-HTJPDSAC.js → chunk-QBLS7X3Z.js} +3 -3
  72. package/dist/{chunk-HTJPDSAC.js.map → chunk-QBLS7X3Z.js.map} +1 -1
  73. package/dist/{chunk-BALPY67W.js → chunk-QNHW26AT.js} +3 -3
  74. package/dist/{chunk-BALPY67W.js.map → chunk-QNHW26AT.js.map} +1 -1
  75. package/dist/{chunk-4KALKIWP.js → chunk-RLV3FF4I.js} +5 -5
  76. package/dist/{chunk-4KALKIWP.js.map → chunk-RLV3FF4I.js.map} +1 -1
  77. package/dist/{chunk-UZCAULGU.js → chunk-RRAXV5LE.js} +8 -8
  78. package/dist/{chunk-UZCAULGU.js.map → chunk-RRAXV5LE.js.map} +1 -1
  79. package/dist/{chunk-ESUF2ZYT.js → chunk-U7EZ2WSC.js} +2 -2
  80. package/dist/{chunk-ESUF2ZYT.js.map → chunk-U7EZ2WSC.js.map} +1 -1
  81. package/dist/{chunk-AONNQPPS.js → chunk-VKGNMXGZ.js} +3 -3
  82. package/dist/{chunk-AONNQPPS.js.map → chunk-VKGNMXGZ.js.map} +1 -1
  83. package/dist/{chunk-6EPNTAF3.js → chunk-WCUT3EQR.js} +3 -3
  84. package/dist/{chunk-6EPNTAF3.js.map → chunk-WCUT3EQR.js.map} +1 -1
  85. package/dist/{chunk-2O4QWC5S.js → chunk-X66KSHZF.js} +4 -4
  86. package/dist/{chunk-2O4QWC5S.js.map → chunk-X66KSHZF.js.map} +1 -1
  87. package/dist/{chunk-TBH6UXYN.js → chunk-XHLRMUMO.js} +3 -3
  88. package/dist/{chunk-TBH6UXYN.js.map → chunk-XHLRMUMO.js.map} +1 -1
  89. package/dist/{chunk-E6BXLB5Z.js → chunk-YJAKSCCN.js} +3 -3
  90. package/dist/{chunk-E6BXLB5Z.js.map → chunk-YJAKSCCN.js.map} +1 -1
  91. package/dist/chunk-YKD2MYLU.js +210 -0
  92. package/dist/chunk-YKD2MYLU.js.map +1 -0
  93. package/dist/{chunk-7YGOEJRD.js → chunk-YNQRVTXH.js} +4 -4
  94. package/dist/{chunk-7YGOEJRD.js.map → chunk-YNQRVTXH.js.map} +1 -1
  95. package/dist/{chunk-MECT5Z5D.js → chunk-ZQL6HGTW.js} +5 -5
  96. package/dist/{chunk-MECT5Z5D.js.map → chunk-ZQL6HGTW.js.map} +1 -1
  97. package/dist/{claude-code-G52B7TRB.js → claude-code-LFAOJ3UQ.js} +4 -4
  98. package/dist/{claude-code-G52B7TRB.js.map → claude-code-LFAOJ3UQ.js.map} +1 -1
  99. package/dist/cli/index.js +92 -54
  100. package/dist/cli/index.js.map +1 -1
  101. package/dist/cli/src/commands/harness-preflight.d.ts.map +1 -1
  102. package/dist/cli/src/commands/harness.d.ts +14 -0
  103. package/dist/cli/src/commands/harness.d.ts.map +1 -1
  104. package/dist/cli/src/commands/serve-preflight.d.ts +1 -6
  105. package/dist/cli/src/commands/serve-preflight.d.ts.map +1 -1
  106. package/dist/connectors/index.js +12 -10
  107. package/dist/{connectors-TT6HTFH6.js → connectors-KPF4UUDS.js} +15 -13
  108. package/dist/{connectors-TT6HTFH6.js.map → connectors-KPF4UUDS.js.map} +1 -1
  109. package/dist/{ensure-sources-XZ3MUJOM.js → ensure-sources-FOMEGCQ5.js} +15 -13
  110. package/dist/ensure-sources-FOMEGCQ5.js.map +1 -0
  111. package/dist/factory-assets/connectors/box.js +12 -10
  112. package/dist/factory-assets/connectors/deploy.js +12 -10
  113. package/dist/factory-assets/connectors/devserver.js +12 -10
  114. package/dist/factory-assets/connectors/flow/adapter.js +12 -10
  115. package/dist/factory-assets/connectors/flow/run-flow.js +13 -11
  116. package/dist/factory-assets/connectors/flow.js +12 -10
  117. package/dist/factory-assets/connectors/git.js +12 -10
  118. package/dist/factory-assets/connectors/gmail.js +12 -10
  119. package/dist/factory-assets/connectors/googledrive.js +12 -10
  120. package/dist/factory-assets/connectors/local.js +12 -10
  121. package/dist/factory-assets/connectors/mattermost.js +12 -10
  122. package/dist/factory-assets/connectors/memory.js +12 -10
  123. package/dist/factory-assets/connectors/minio.js +12 -10
  124. package/dist/factory-assets/connectors/postgres.js +12 -10
  125. package/dist/factory-assets/connectors/s3.js +12 -10
  126. package/dist/factory-assets/connectors/sharepoint.js +12 -10
  127. package/dist/factory-assets/connectors/sqlite.js +12 -10
  128. package/dist/factory-assets/connectors/static-server.js +12 -10
  129. package/dist/factory-assets/connectors/tunnel.js +12 -10
  130. package/dist/factory-assets/connectors/webdav.js +12 -10
  131. package/dist/factory-assets/connectors/xstate-store.js +12 -10
  132. package/dist/factory-assets/connectors/xstate.js +12 -10
  133. package/dist/{helpers-Q6LFWGYT.js → helpers-ZJ67FO3Z.js} +15 -13
  134. package/dist/{helpers-Q6LFWGYT.js.map → helpers-ZJ67FO3Z.js.map} +1 -1
  135. package/dist/{library-publish-OADODIMW.js → library-publish-RGVXGTY4.js} +27 -25
  136. package/dist/library-publish-RGVXGTY4.js.map +1 -0
  137. package/dist/model-endpoint/index.js +3 -3
  138. package/dist/{open-library-MNCHOTAF.js → open-library-I5JHL37T.js} +16 -14
  139. package/dist/{open-library-MNCHOTAF.js.map → open-library-I5JHL37T.js.map} +1 -1
  140. package/dist/{project-PHO6JOVL.js → project-K5JWPIJ6.js} +23 -21
  141. package/dist/{project-PHO6JOVL.js.map → project-K5JWPIJ6.js.map} +1 -1
  142. package/dist/runner/index.js +18 -16
  143. package/dist/sdk/asset-manager.js +1 -1
  144. package/dist/sdk/bridge.js +11 -9
  145. package/dist/sdk/index.js +18 -16
  146. package/dist/sdk/index.js.map +1 -1
  147. package/dist/sdk/runner.js +18 -16
  148. package/dist/{serve-preflight-GLE2LPGT.js → serve-preflight-L6VVCDM5.js} +17 -15
  149. package/dist/{serve-preflight-GLE2LPGT.js.map → serve-preflight-L6VVCDM5.js.map} +1 -1
  150. package/dist/{setup-EPNOIKDM.js → setup-RXTNGML5.js} +16 -14
  151. package/dist/setup-RXTNGML5.js.map +1 -0
  152. package/dist/{source-CUSCY3KR.js → source-2LP5W3ST.js} +25 -23
  153. package/dist/{source-CUSCY3KR.js.map → source-2LP5W3ST.js.map} +1 -1
  154. package/dist/{source-manifest-publish-AHLDG4XS.js → source-manifest-publish-EZNCTSQF.js} +27 -25
  155. package/dist/source-manifest-publish-EZNCTSQF.js.map +1 -0
  156. package/dist/tui/index.js +18 -16
  157. package/dist/tui/index.js.map +1 -1
  158. package/dist/workspace-plugin/adapters/mcp.js +14 -12
  159. package/dist/workspace-plugin/adapters/omp.js +7 -7
  160. package/dist/workspace-plugin/index.js +1 -1
  161. package/package.json +1 -1
  162. package/dist/chunk-GFBKUX3J.js.map +0 -1
  163. package/dist/chunk-GIMFNRNR.js.map +0 -1
  164. package/dist/chunk-JXKT2QGT.js.map +0 -1
  165. package/dist/chunk-WWSRIT3J.js +0 -59
  166. package/dist/chunk-WWSRIT3J.js.map +0 -1
  167. package/dist/ensure-sources-XZ3MUJOM.js.map +0 -1
  168. package/dist/library-publish-OADODIMW.js.map +0 -1
  169. package/dist/setup-EPNOIKDM.js.map +0 -1
  170. package/dist/source-manifest-publish-AHLDG4XS.js.map +0 -1
package/CHANGELOG.md CHANGED
@@ -1,5 +1,19 @@
1
1
  # Changelog
2
2
 
3
+ ## 6.14.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [#1159](https://github.com/skaile-ai/workspaces/pull/1159) [`db15e3c`](https://github.com/skaile-ai/workspaces/commit/db15e3ca326241a4774b5aa3c8abfcf9cf8464cd) Thanks [@mortegro](https://github.com/mortegro)! - `skaile harness status` reports, for every harness, whether it can start here: the program path, its version (Gemini CLI below 0.6.1 is `outdated`), whether the npm SDK loads for `claude-sdk` and `codex`, and the harness's own login (`claude auth status`, `codex login status`). `--json` prints the detections; the command always exits 0. The bridge exports `detectHarness`, `detectHarnesses` (15 s cache, `fresh: true` to skip it), `HARNESS_SDKS` and `sdkMissingProblem`; `skaile serve` preflight reuses the SDK table and its message.
8
+
9
+ - [#1159](https://github.com/skaile-ai/workspaces/pull/1159) [`db15e3c`](https://github.com/skaile-ai/workspaces/commit/db15e3ca326241a4774b5aa3c8abfcf9cf8464cd) Thanks [@mortegro](https://github.com/mortegro)! - The bridge exports `discoverHarnessModels(harnessId, registry, options?)`, which asks omp (`omp models --json`) and opencode (`opencode models`) which models they serve with the configuration a session would get: the registry is rendered to omp's `models.yml` / opencode's `opencode.json` with the credential env, the program runs with closed stdin and a timeout, and the rendered config is removed afterwards. The answer is `{ models, source: "harness" }`; any failure (program missing, timeout, no model list) and every other harness answer with the registry list, `source: "registry"`, and the reason in `error`. `ModelEntry` gains optional `providerId`, `providerModelId` and `source`. `listModelsForHarness` is unchanged and stays registry-only. opencode's plain output (one `provider/model` per line, checked against opencode 1.19.5) is parsed.
10
+
11
+ - [#1159](https://github.com/skaile-ai/workspaces/pull/1159) [`db15e3c`](https://github.com/skaile-ai/workspaces/commit/db15e3ca326241a4774b5aa3c8abfcf9cf8464cd) Thanks [@mortegro](https://github.com/mortegro)! - Harness CLIs are found in the install dirs of the user's toolchains, and every harness spawn uses the same lookup.
12
+
13
+ - `omp`, `gemini`, `qwen`, `opencode`, `goose`, `continue` and the Claude Code CLI are found when they sit in a toolchain dir (a custom npm prefix, `~/.local/bin`, bun, volta, asdf, pnpm, cargo, `~/.npm-global`, `~/.npm-packages`, deno, `~/go/bin`, pyenv, scoop on Windows, mise, nix, Homebrew and other system dirs on POSIX, and the per-version node dirs of mise, nvm and fnm), even when the process runs with a minimal `PATH`. `skaile run` preflight, the omp, subprocess-CLI and claude-sdk harnesses and the omp model check spawn the resolved absolute path, and the child `PATH` is extended with the same dirs. The `<PREFIX>_BRIDGE_BIN` override and `CLAUDE_CODE_PATH` still win; a missing override still ends in the install hint. `CLAUDE_CODE_PATH` may name a script without the exec bit (a `cli.js`), and a missing path falls back to `claude` on `PATH`. A project's `node_modules/.bin` is never searched.
14
+ - `@skaile/workspaces/bridge` exports `resolveHarnessBinary`, `harnessSearchDirs`, `harnessSpawnPath`, `toolchainBinDirs` and `SDK_CLI_BINARIES`. `findHarnessBinary` stays as a deprecated alias of `resolveHarnessBinary(row, env) !== undefined` (see `MIGRATION.md`). `HarnessBinary` gains `overrideEnv`, `minVersion` and `overrideMayBeScript`; the `gemini` row declares `0.6.1`.
15
+ - The omp model check closes omp's stdin.
16
+
3
17
  ## 6.13.1
4
18
 
5
19
  ### Patch Changes
@@ -1,8 +1,8 @@
1
- import { storeNotInstallableReason } from './chunk-HP62IELJ.js';
1
+ import { storeNotInstallableReason } from './chunk-J3FJTH3V.js';
2
2
  import { getKnownKinds } from './chunk-HPQ2WDYC.js';
3
3
  import './chunk-WDG5IVEA.js';
4
4
  import './chunk-7RGTAEG6.js';
5
- import './chunk-HG2PDB3T.js';
5
+ import './chunk-7UBCUKJO.js';
6
6
  import './chunk-7FXOOUOC.js';
7
7
  import './chunk-DRUAQ7IY.js';
8
8
  import './chunk-CVUMZTNO.js';
@@ -60,7 +60,7 @@ function libraryEntryOf(asset) {
60
60
  async function libraryAssets() {
61
61
  const notes = [];
62
62
  try {
63
- const { openLibraryManager } = await import('./open-library-MNCHOTAF.js');
63
+ const { openLibraryManager } = await import('./open-library-I5JHL37T.js');
64
64
  const { getKindRegistry } = await import('./open-registry-4HNCWOCN.js');
65
65
  const { scanAuthoringLibraries } = await import('./library/index.js');
66
66
  const { library: index, close } = await openLibraryManager();
@@ -94,7 +94,7 @@ async function libraryAssets() {
94
94
  async function storeAssets(projectDir) {
95
95
  const notes = [];
96
96
  try {
97
- const { resolveCatalogSource } = await import('./open-library-MNCHOTAF.js');
97
+ const { resolveCatalogSource } = await import('./open-library-I5JHL37T.js');
98
98
  const { source, close } = await resolveCatalogSource({ projectDir });
99
99
  try {
100
100
  const assets = (await source.listAssets()).filter(
@@ -175,5 +175,5 @@ async function gatherAssetFeeds(am, projectDir) {
175
175
  }
176
176
 
177
177
  export { gatherAssetFeeds };
178
- //# sourceMappingURL=asset-feeds-HS4IUMUN.js.map
179
- //# sourceMappingURL=asset-feeds-HS4IUMUN.js.map
178
+ //# sourceMappingURL=asset-feeds-DOG5FK7T.js.map
179
+ //# sourceMappingURL=asset-feeds-DOG5FK7T.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../cli/src/asset-feeds.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAwEA,SAAS,eAAe,KAAA,EAAsC;AAC5D,EAAA,MAAM,EAAE,UAAS,GAAI,KAAA;AACrB,EAAA,MAAM,MAAA,GAAU,SAAS,QAAA,EAAkD,QAAA;AAC3E,EAAA,MAAM,WAAA,GAAc,SAAS,QAAA,IAAY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,GAAA,CAAI,SAAA,EAAW,OAAA,CAAQ,OAAO,CAAA;AAAA,MACjC,GAAG,GAAA,CAAI,OAAA,EAAS,KAAA,CAAM,OAAO;AAAA,KAC/B;AAAA,IACA,KAAA,EAAO,CAAC,GAAG,IAAA,CAAK,KAAA,EAAO,GAAG,KAAA,CAAM,KAAA,EAAO,GAAG,OAAA,CAAQ,KAAK;AAAA,GACzD;AACF","file":"asset-feeds-HS4IUMUN.js","sourcesContent":["/**\n * asset-feeds.ts — gather installable assets from every feed the manage TUI\n * surfaces.\n *\n * Four feeds, normalized into `CatalogEntry`:\n * - **Project sources** — `skaile.yaml` `sources:` entries (scanned via\n * `AssetManager.search()`; the new `sources:` field is merged into the\n * legacy repositories map in `AssetManager.loadConfig`).\n * - **Local libraries** — user authoring places from `LocalIndex`, read through\n * `scanAuthoringLibraries` (`@skaile/workspaces/library`): the same scan\n * `library index` / `search --local` use, so publishers and refs match them\n * (per-asset `publisher_overrides` honoured), `dev_paths` assets are left out,\n * and a library that fails to scan becomes one note while the rest stay listed.\n * - **Factory assets** — the bundled first-party `factory-assets` tree\n * (`factoryAssetRoots()`), scanned from disk. Always present; no network.\n * - **Remote store** — the configured catalog source when `catalog.url` is\n * not `local`. Failures are non-fatal — they surface as notes.\n */\n\nimport * as path from \"node:path\";\nimport {\n type AssetKind,\n type CatalogEntry,\n factoryAssetRoots,\n parseRequires,\n scanRepo,\n} from \"@skaile/workspaces/core\";\nimport { getKnownKinds } from \"./open-registry.ts\";\nimport { storeNotInstallableReason } from \"./store-addable.ts\";\nimport type { DiscoveredAsset } from \"@skaile/workspaces/discovery\";\n\n/** One non-fatal note returned to the caller for surfacing in the UI. */\nexport interface FeedNote {\n feed: \"sources\" | \"libraries\" | \"store\" | \"factory\";\n message: string;\n}\n\n/**\n * Which feed an asset came from. This is the top-level grouping axis in the\n * manage TUI (\"where is this skill coming from?\") and is intentionally distinct\n * from `publisher` (asset-intrinsic identity): the same publisher can legitimately\n * appear under more than one origin (e.g. a github repo you added as a `source`\n * that is also listed in the remote `store`).\n */\nexport type AssetOrigin = \"source\" | \"library\" | \"factory\" | \"store\";\n\n/** A catalog entry tagged with the feed it was gathered from. */\nexport interface OriginEntry {\n origin: AssetOrigin;\n entry: CatalogEntry;\n /**\n * Second-level grouping label for the manage tree. Defaults (when unset) to the\n * entry's `publisher`; the source feed sets it to the source's short repo name\n * so the Sources band groups by source — \"which repo did this come from\" — not\n * by the asset-intrinsic publisher.\n */\n group?: string;\n}\n\nexport interface AssetFeedResult {\n entries: OriginEntry[];\n notes: FeedNote[];\n}\n\n/**\n * Map one discovered library asset to the `CatalogEntry` the manage rows read.\n * `publisher` is the bare per-asset publisher (what `search --local` prints),\n * `source` the manifest path. `repo` is left unset: it only feeds the Sources-tree\n * org grouping. `requires` / `dependencies` come from the manifest the way the\n * scanner fills them — string `requires:` refs parsed to `{kind, name}`, a bundle's\n * string `dependencies:` list verbatim.\n */\nfunction libraryEntryOf(asset: DiscoveredAsset): CatalogEntry {\n const { manifest } = asset;\n const nested = (manifest.metadata as Record<string, unknown> | undefined)?.requires;\n const rawRequires = manifest.requires ?? nested;\n const requireRefs =\n typeof rawRequires === \"string\"\n ? rawRequires\n : Array.isArray(rawRequires)\n ? rawRequires.filter((r): r is string => typeof r === \"string\")\n : undefined;\n const deps = manifest.dependencies;\n return {\n name: asset.name,\n kind: asset.kind as AssetKind,\n description: typeof manifest.description === \"string\" ? manifest.description : \"\",\n source: asset.manifestPath,\n publisher: asset.publisher,\n ...(asset.plugin ? { plugin: asset.plugin } : {}),\n version: asset.version,\n requires: requireRefs === undefined ? [] : parseRequires({ requires: requireRefs }),\n dependencies:\n asset.kind === \"bundle\" && Array.isArray(deps)\n ? deps.filter((d): d is string => typeof d === \"string\" && d.length > 0)\n : [],\n };\n}\n\n/**\n * Pull assets from local libraries (the authoring places under\n * `~/.skaile/libraries/<name>/`, not the `~/.skaile/cache/sources/` cache) through\n * `scanAuthoringLibraries`, grouped under the bare library name\n * (`group: <name>`) so the manage TUI shows a clean `<name>` band — no\n * `library:` prefix (mirrors the source feed). Plugin grouping (`entry.plugin`)\n * comes from `DiscoveredAsset.plugin`. A library whose scan fails becomes one\n * `FeedNote`; the outer `catch` covers only opening the index.\n */\nasync function libraryAssets(): Promise<{\n entries: OriginEntry[];\n notes: FeedNote[];\n}> {\n const notes: FeedNote[] = [];\n try {\n // Lazy: the library subpath pulls in SQLite, which the other feeds never need.\n const { openLibraryManager } = await import(\"./open-library.ts\");\n const { getKindRegistry } = await import(\"./open-registry.ts\");\n const { scanAuthoringLibraries } = await import(\"@skaile/workspaces/library\");\n const { library: index, close } = await openLibraryManager();\n try {\n const entries: OriginEntry[] = [];\n for (const scan of await scanAuthoringLibraries(index, getKindRegistry())) {\n if (scan.error !== undefined) {\n notes.push({ feed: \"libraries\", message: `${scan.library.name}: ${scan.error}` });\n continue;\n }\n for (const asset of scan.assets) {\n entries.push({\n origin: \"library\",\n entry: libraryEntryOf(asset),\n group: scan.library.name,\n });\n }\n }\n return { entries, notes };\n } finally {\n close();\n }\n } catch (err) {\n notes.push({\n feed: \"libraries\",\n message: err instanceof Error ? err.message : String(err),\n });\n return { entries: [], notes };\n }\n}\n\n/**\n * Pull a (best-effort) snapshot of the connected remote store catalog.\n *\n * - Returns no entries when the resolved catalog is local-only or the host\n * is unreachable (the failure becomes a note, not an exception).\n * - Maps `CatalogAsset` → `CatalogEntry`, carrying `publisher`, `repo`, and\n * `category` straight through and using `source = \"store://<id>\"`; per-file\n * `source` paths are not available for remote assets so the canonical ref is\n * a stable placeholder.\n */\nasync function storeAssets(projectDir: string): Promise<{\n entries: CatalogEntry[];\n notes: FeedNote[];\n}> {\n const notes: FeedNote[] = [];\n try {\n const { resolveCatalogSource } = await import(\"./open-library.ts\");\n const { source, close } = await resolveCatalogSource({ projectDir });\n try {\n // The store lists only what `skaile add` can install (see store-addable.ts).\n const assets = (await source.listAssets()).filter(\n (a) => storeNotInstallableReason(a) === undefined,\n );\n const entries: CatalogEntry[] = assets.map((a) => ({\n name: a.name,\n kind: (a.kind as AssetKind) ?? \"skill\",\n description: a.description ?? \"\",\n source: `store://${a.id}`,\n publisher: a.publisher,\n repo: a.repo,\n plugin: a.plugin,\n category: a.category,\n version: a.version,\n requires: [],\n dependencies: [],\n }));\n return { entries, notes };\n } finally {\n close();\n }\n } catch (err) {\n const msg = err instanceof Error ? err.message : String(err);\n // Local-only catalog throws a recognizable message — silence it; absence\n // is the user's choice, not an error.\n if (!/local/i.test(msg)) {\n notes.push({ feed: \"store\", message: msg });\n }\n return { entries: [], notes };\n }\n}\n\n/** The slice of `AssetManager` the source feed needs (kept narrow for tests). */\ninterface AssetManagerLike {\n search: () => Promise<CatalogEntry[]>;\n searchRepoRoots: () => { repoName: string; root: string }[];\n}\n\n/**\n * Project-source feed: leans on `AssetManager.search()`, which merges\n * `skaile.yaml`'s `sources:` field into the repositories map. Plugin grouping\n * (`entry.plugin`) is stamped by the scanner, so entries pass through as-is.\n */\nasync function sourceAssets(am: AssetManagerLike): Promise<OriginEntry[]> {\n // The bundled factory tree is injected into the repositories map as an implicit\n // source, so `am.search()` returns it too. It has its own `factory` origin band,\n // so drop it here — otherwise the same first-party skills list twice under Sources.\n const factoryPrefixes = factoryAssetRoots().map((r) => (r.endsWith(path.sep) ? r : r + path.sep));\n const isFactoryPath = (p: string) =>\n factoryPrefixes.some((fp) => p === fp.slice(0, -1) || p.startsWith(fp));\n\n const all = (await am.search()).filter((e) => !isFactoryPath(e.source));\n const entries: OriginEntry[] = [];\n // Group each source's entries under the source node (its short repo name), not\n // the publisher: under Sources the navigational question is \"which repo did\n // this come from\". Each entry's `source` (absolute manifest path) lives under\n // exactly one declared root, so group by prefix. The cache slug is\n // URL-keyed `github.com/<org>/<repo>` — take the trailing segment.\n for (const { repoName, root } of am.searchRepoRoots()) {\n if (isFactoryPath(root)) continue;\n const prefix = root.endsWith(path.sep) ? root : root + path.sep;\n const owned = all.filter((e) => e.source === root || e.source.startsWith(prefix));\n if (owned.length === 0) continue;\n const sourceName = repoName.split(\"/\").pop() || repoName;\n for (const entry of owned) entries.push({ origin: \"source\", entry, group: sourceName });\n }\n return entries;\n}\n\n/**\n * Factory-asset feed: scan the bundled first-party `factory-assets` tree(s)\n * resolved by `factoryAssetRoots()` (the `SKAILE_FACTORY_ASSETS_DIR` override\n * layer ahead of the bundled tree). Local disk only, no network — the entries are\n * the built-in skills / connectors / bundles that ship with `@skaile/workspaces`.\n * `factoryAssetRoots()` already dedupes, so the env override pointing at the\n * bundled dir collapses to one root.\n */\nasync function factoryAssets(): Promise<{\n entries: CatalogEntry[];\n notes: FeedNote[];\n}> {\n const notes: FeedNote[] = [];\n try {\n const entries: CatalogEntry[] = [];\n for (const root of factoryAssetRoots()) {\n entries.push(...(await scanRepo(root, \"skaile-factory\", { knownKinds: getKnownKinds() })));\n }\n return { entries, notes };\n } catch (err) {\n notes.push({\n feed: \"factory\",\n message: err instanceof Error ? err.message : String(err),\n });\n return { entries: [], notes };\n }\n}\n\n/** Tag a flat entry list with a single origin. */\nfunction tag(origin: AssetOrigin, entries: CatalogEntry[]): OriginEntry[] {\n return entries.map((entry) => ({ origin, entry }));\n}\n\n/**\n * Run all feeds and return a single normalized result.\n *\n * Feeds run in parallel where possible — the store fetch is the slow one\n * (one HTTP call) and is fired alongside the local library walk. The factory\n * scan is local disk only, so it runs inline.\n */\nexport async function gatherAssetFeeds(\n am: AssetManagerLike,\n projectDir: string,\n): Promise<AssetFeedResult> {\n const [libs, store] = await Promise.all([libraryAssets(), storeAssets(projectDir)]);\n const factory = await factoryAssets();\n const src = await sourceAssets(am);\n return {\n entries: [\n ...src,\n ...libs.entries,\n ...tag(\"factory\", factory.entries),\n ...tag(\"store\", store.entries),\n ],\n notes: [...libs.notes, ...store.notes, ...factory.notes],\n };\n}\n"]}
1
+ {"version":3,"sources":["../cli/src/asset-feeds.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAwEA,SAAS,eAAe,KAAA,E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A,GAAM,MAAM,YAAA,CAAa,EAAE,CAAA;AACjC,EAAA,OAAO;AAAA,IACL,OAAA,EAAS;AAAA,MACP,GAAG,GAAA;AAAA,MACH,GAAG,IAAA,CAAK,OAAA;AAAA,MACR,GAAG,GAAA,CAAI,SAAA,EAAW,OAAA,CAAQ,OAAO,CAAA;AAAA,MACjC,GAAG,GAAA,CAAI,OAAA,EAAS,KAAA,CAAM,OAAO;AAAA,KAC/B;AAAA,IACA,KAAA,EAAO,CAAC,GAAG,IAAA,CAAK,KAAA,EAAO,GAAG,KAAA,CAAM,KAAA,EAAO,GAAG,OAAA,CAAQ,KAAK;AAAA,GACzD;AACF","file":"asset-feeds-DOG5FK7T.js","sourcesContent":["/**\n * asset-feeds.ts — gather installable assets from every feed the manage TUI\n * surfaces.\n *\n * Four feeds, normalized into `CatalogEntry`:\n * - **Project sources** — `skaile.yaml` `sources:` entries (scanned via\n * `AssetManager.search()`; the new `sources:` field is merged into the\n * legacy repositories map in `AssetManager.loadConfig`).\n * - **Local libraries** — user authoring places from `LocalIndex`, read through\n * `scanAuthoringLibraries` (`@skaile/workspaces/library`): the same scan\n * `library index` / `search --local` use, so publishers and refs match them\n * (per-asset `publisher_overrides` honoured), `dev_paths` assets are left out,\n * and a library that fails to scan becomes one note while the rest stay listed.\n * - **Factory assets** — the bundled first-party `factory-assets` tree\n * (`factoryAssetRoots()`), scanned from disk. Always present; no network.\n * - **Remote store** — the configured catalog source when `catalog.url` is\n * not `local`. Failures are non-fatal — they surface as notes.\n */\n\nimport * as path from \"node:path\";\nimport {\n type AssetKind,\n type CatalogEntry,\n factoryAssetRoots,\n parseRequires,\n scanRepo,\n} from \"@skaile/workspaces/core\";\nimport { getKnownKinds } from \"./open-registry.ts\";\nimport { storeNotInstallableReason } from \"./store-addable.ts\";\nimport type { DiscoveredAsset } from \"@skaile/workspaces/discovery\";\n\n/** One non-fatal note returned to the caller for surfacing in the UI. */\nexport interface FeedNote {\n feed: \"sources\" | \"libraries\" | \"store\" | \"factory\";\n message: string;\n}\n\n/**\n * Which feed an asset came from. This is the top-level grouping axis in the\n * manage TUI (\"where is this skill coming from?\") and is intentionally distinct\n * from `publisher` (asset-intrinsic identity): the same publisher can legitimately\n * appear under more than one origin (e.g. a github repo you added as a `source`\n * that is also listed in the remote `store`).\n */\nexport type AssetOrigin = \"source\" | \"library\" | \"factory\" | \"store\";\n\n/** A catalog entry tagged with the feed it was gathered from. */\nexport interface OriginEntry {\n origin: AssetOrigin;\n entry: CatalogEntry;\n /**\n * Second-level grouping label for the manage tree. Defaults (when unset) to the\n * entry's `publisher`; the source feed sets it to the source's short repo name\n * so the Sources band groups by source — \"which repo did this come from\" — not\n * by the asset-intrinsic publisher.\n */\n group?: string;\n}\n\nexport interface AssetFeedResult {\n entries: OriginEntry[];\n notes: FeedNote[];\n}\n\n/**\n * Map one discovered library asset to the `CatalogEntry` the manage rows read.\n * `publisher` is the bare per-asset publisher (what `search --local` prints),\n * `source` the manifest path. `repo` is left unset: it only feeds the Sources-tree\n * org grouping. `requires` / `dependencies` come from the manifest the way the\n * scanner fills them — string `requires:` refs parsed to `{kind, name}`, a bundle's\n * string `dependencies:` list verbatim.\n */\nfunction libraryEntryOf(asset: DiscoveredAsset): CatalogEntry {\n const { manifest } = asset;\n const nested = (manifest.metadata as Record<string, unknown> | undefined)?.requires;\n const rawRequires = manifest.requires ?? nested;\n const requireRefs =\n typeof rawRequires === \"string\"\n ? rawRequires\n : Array.isArray(rawRequires)\n ? rawRequires.filter((r): r is string => typeof r === \"string\")\n : undefined;\n const deps = manifest.dependencies;\n return {\n name: asset.name,\n kind: asset.kind as AssetKind,\n description: typeof manifest.description === \"string\" ? manifest.description : \"\",\n source: asset.manifestPath,\n publisher: asset.publisher,\n ...(asset.plugin ? { plugin: asset.plugin } : {}),\n version: asset.version,\n requires: requireRefs === undefined ? [] : parseRequires({ requires: requireRefs }),\n dependencies:\n asset.kind === \"bundle\" && Array.isArray(deps)\n ? deps.filter((d): d is string => typeof d === \"string\" && d.length > 0)\n : [],\n };\n}\n\n/**\n * Pull assets from local libraries (the authoring places under\n * `~/.skaile/libraries/<name>/`, not the `~/.skaile/cache/sources/` cache) through\n * `scanAuthoringLibraries`, grouped under the bare library name\n * (`group: <name>`) so the manage TUI shows a clean `<name>` band — no\n * `library:` prefix (mirrors the source feed). Plugin grouping (`entry.plugin`)\n * comes from `DiscoveredAsset.plugin`. A library whose scan fails becomes one\n * `FeedNote`; the outer `catch` covers only opening the index.\n */\nasync function libraryAssets(): Promise<{\n entries: OriginEntry[];\n notes: FeedNote[];\n}> {\n const notes: FeedNote[] = [];\n try {\n // Lazy: the library subpath pulls in SQLite, which the other feeds never need.\n const { openLibraryManager } = await import(\"./open-library.ts\");\n const { getKindRegistry } = await import(\"./open-registry.ts\");\n const { scanAuthoringLibraries } = await import(\"@skaile/workspaces/library\");\n const { library: index, close } = await openLibraryManager();\n try {\n const entries: OriginEntry[] = [];\n for (const scan of await scanAuthoringLibraries(index, getKindRegistry())) {\n if (scan.error !== undefined) {\n notes.push({ feed: \"libraries\", message: `${scan.library.name}: ${scan.error}` });\n continue;\n }\n for (const asset of scan.assets) {\n entries.push({\n origin: \"library\",\n entry: libraryEntryOf(asset),\n group: scan.library.name,\n });\n }\n }\n return { entries, notes };\n } finally {\n close();\n }\n } catch (err) {\n notes.push({\n feed: \"libraries\",\n message: err instanceof Error ? err.message : String(err),\n });\n return { entries: [], notes };\n }\n}\n\n/**\n * Pull a (best-effort) snapshot of the connected remote store catalog.\n *\n * - Returns no entries when the resolved catalog is local-only or the host\n * is unreachable (the failure becomes a note, not an exception).\n * - Maps `CatalogAsset` → `CatalogEntry`, carrying `publisher`, `repo`, and\n * `category` straight through and using `source = \"store://<id>\"`; per-file\n * `source` paths are not available for remote assets so the canonical ref is\n * a stable placeholder.\n */\nasync function storeAssets(projectDir: string): Promise<{\n entries: CatalogEntry[];\n notes: FeedNote[];\n}> {\n const notes: FeedNote[] = [];\n try {\n const { resolveCatalogSource } = await import(\"./open-library.ts\");\n const { source, close } = await resolveCatalogSource({ projectDir });\n try {\n // The store lists only what `skaile add` can install (see store-addable.ts).\n const assets = (await source.listAssets()).filter(\n (a) => storeNotInstallableReason(a) === undefined,\n );\n const entries: CatalogEntry[] = assets.map((a) => ({\n name: a.name,\n kind: (a.kind as AssetKind) ?? \"skill\",\n description: a.description ?? \"\",\n source: `store://${a.id}`,\n publisher: a.publisher,\n repo: a.repo,\n plugin: a.plugin,\n category: a.category,\n version: a.version,\n requires: [],\n dependencies: [],\n }));\n return { entries, notes };\n } finally {\n close();\n }\n } catch (err) {\n const msg = err instanceof Error ? err.message : String(err);\n // Local-only catalog throws a recognizable message — silence it; absence\n // is the user's choice, not an error.\n if (!/local/i.test(msg)) {\n notes.push({ feed: \"store\", message: msg });\n }\n return { entries: [], notes };\n }\n}\n\n/** The slice of `AssetManager` the source feed needs (kept narrow for tests). */\ninterface AssetManagerLike {\n search: () => Promise<CatalogEntry[]>;\n searchRepoRoots: () => { repoName: string; root: string }[];\n}\n\n/**\n * Project-source feed: leans on `AssetManager.search()`, which merges\n * `skaile.yaml`'s `sources:` field into the repositories map. Plugin grouping\n * (`entry.plugin`) is stamped by the scanner, so entries pass through as-is.\n */\nasync function sourceAssets(am: AssetManagerLike): Promise<OriginEntry[]> {\n // The bundled factory tree is injected into the repositories map as an implicit\n // source, so `am.search()` returns it too. It has its own `factory` origin band,\n // so drop it here — otherwise the same first-party skills list twice under Sources.\n const factoryPrefixes = factoryAssetRoots().map((r) => (r.endsWith(path.sep) ? r : r + path.sep));\n const isFactoryPath = (p: string) =>\n factoryPrefixes.some((fp) => p === fp.slice(0, -1) || p.startsWith(fp));\n\n const all = (await am.search()).filter((e) => !isFactoryPath(e.source));\n const entries: OriginEntry[] = [];\n // Group each source's entries under the source node (its short repo name), not\n // the publisher: under Sources the navigational question is \"which repo did\n // this come from\". Each entry's `source` (absolute manifest path) lives under\n // exactly one declared root, so group by prefix. The cache slug is\n // URL-keyed `github.com/<org>/<repo>` — take the trailing segment.\n for (const { repoName, root } of am.searchRepoRoots()) {\n if (isFactoryPath(root)) continue;\n const prefix = root.endsWith(path.sep) ? root : root + path.sep;\n const owned = all.filter((e) => e.source === root || e.source.startsWith(prefix));\n if (owned.length === 0) continue;\n const sourceName = repoName.split(\"/\").pop() || repoName;\n for (const entry of owned) entries.push({ origin: \"source\", entry, group: sourceName });\n }\n return entries;\n}\n\n/**\n * Factory-asset feed: scan the bundled first-party `factory-assets` tree(s)\n * resolved by `factoryAssetRoots()` (the `SKAILE_FACTORY_ASSETS_DIR` override\n * layer ahead of the bundled tree). Local disk only, no network — the entries are\n * the built-in skills / connectors / bundles that ship with `@skaile/workspaces`.\n * `factoryAssetRoots()` already dedupes, so the env override pointing at the\n * bundled dir collapses to one root.\n */\nasync function factoryAssets(): Promise<{\n entries: CatalogEntry[];\n notes: FeedNote[];\n}> {\n const notes: FeedNote[] = [];\n try {\n const entries: CatalogEntry[] = [];\n for (const root of factoryAssetRoots()) {\n entries.push(...(await scanRepo(root, \"skaile-factory\", { knownKinds: getKnownKinds() })));\n }\n return { entries, notes };\n } catch (err) {\n notes.push({\n feed: \"factory\",\n message: err instanceof Error ? err.message : String(err),\n });\n return { entries: [], notes };\n }\n}\n\n/** Tag a flat entry list with a single origin. */\nfunction tag(origin: AssetOrigin, entries: CatalogEntry[]): OriginEntry[] {\n return entries.map((entry) => ({ origin, entry }));\n}\n\n/**\n * Run all feeds and return a single normalized result.\n *\n * Feeds run in parallel where possible — the store fetch is the slow one\n * (one HTTP call) and is fired alongside the local library walk. The factory\n * scan is local disk only, so it runs inline.\n */\nexport async function gatherAssetFeeds(\n am: AssetManagerLike,\n projectDir: string,\n): Promise<AssetFeedResult> {\n const [libs, store] = await Promise.all([libraryAssets(), storeAssets(projectDir)]);\n const factory = await factoryAssets();\n const src = await sourceAssets(am);\n return {\n entries: [\n ...src,\n ...libs.entries,\n ...tag(\"factory\", factory.entries),\n ...tag(\"store\", store.entries),\n ],\n notes: [...libs.notes, ...store.notes, ...factory.notes],\n };\n}\n"]}
@@ -1,4 +1,4 @@
1
- export { AssetManager, LibraryEntryError, MissingManifestError, harnessSwitchKeptKey, harnessSwitchStateFile, installAgentInstances, labelDiffHeaders, mcpNotRunnableReason, normalizeRepoUrl, parseCanonicalLockKey, parseRefTolerant, readHarnessSwitchState, renderMcpServerConfig, setLibraryAssetCheck, setRenamedEntryLookup, softDepName, writeHarnessSwitchState } from '../chunk-HG2PDB3T.js';
1
+ export { AssetManager, LibraryEntryError, MissingManifestError, harnessSwitchKeptKey, harnessSwitchStateFile, installAgentInstances, labelDiffHeaders, mcpNotRunnableReason, normalizeRepoUrl, parseCanonicalLockKey, parseRefTolerant, readHarnessSwitchState, renderMcpServerConfig, setLibraryAssetCheck, setRenamedEntryLookup, softDepName, writeHarnessSwitchState } from '../chunk-7UBCUKJO.js';
2
2
  import '../chunk-7FXOOUOC.js';
3
3
  import '../chunk-DRUAQ7IY.js';
4
4
  import '../chunk-CVUMZTNO.js';
@@ -1,13 +1,14 @@
1
1
  import { formatDroppedToolsNotice, filterInProcessMcpServerTools, checkToolPropertyKeys, TOOL_PROPERTY_KEY_PATTERN } from '../../chunk-3X7VTCPG.js';
2
2
  import { AskSlots } from '../../chunk-3TG2NV2F.js';
3
- import { scrubPoisonedTranscript, transcriptStoreForRuntime, resolveClaudeConfigDir, unsupportedSurfaceNotice, claudeEndpointMode, buildClaudeEndpointEnv, APPROVE_ONCE, DENY } from '../../chunk-BALPY67W.js';
3
+ import { scrubPoisonedTranscript, transcriptStoreForRuntime, resolveClaudeConfigDir, unsupportedSurfaceNotice, claudeEndpointMode, buildClaudeEndpointEnv, APPROVE_ONCE, DENY } from '../../chunk-QNHW26AT.js';
4
4
  import { freshBudget, isFirstAttempt, spend, isSpent, decide, isAvailable } from '../../chunk-7EKQDY2T.js';
5
5
  import { dispatchCapability } from '../../chunk-GJT2Q5XD.js';
6
- import { fetchProviderModels } from '../../chunk-ESUF2ZYT.js';
6
+ import { fetchProviderModels } from '../../chunk-U7EZ2WSC.js';
7
+ import { harnessSpawnPath, resolveHarnessBinary, SDK_CLI_BINARIES } from '../../chunk-YKD2MYLU.js';
7
8
  import { ReconfigureLedger, AuthError, stripRunnerPrivateEnv, classifyClaudeSdkError, reclassifyAuthAsAccountUnavailable, AccountUnavailableError, isLongContextEntitlementRejection, LONG_CONTEXT_CREDITS_API_ERROR } from '../../chunk-5DE3DGVR.js';
8
9
  import { agentExecRequested, wrapAgentCommand, resolveAgentExec } from '../../chunk-7DN6JKP2.js';
9
- import { AgentHarness, getBridgeLogger, registryHarnessConfig } from '../../chunk-TBH6UXYN.js';
10
- import { BUILTIN_HARNESS_CATALOG, entryCredentialValue } from '../../chunk-MNED5ZCW.js';
10
+ import { AgentHarness, getBridgeLogger, registryHarnessConfig } from '../../chunk-XHLRMUMO.js';
11
+ import { BUILTIN_HARNESS_CATALOG, entryCredentialValue } from '../../chunk-3BRBTQ6M.js';
11
12
  import '../../chunk-G5SUWZEU.js';
12
13
  import '../../chunk-6UP2EDFN.js';
13
14
  import { withActivityLabelShape } from '../../chunk-DWPQBMCY.js';
@@ -31,9 +32,9 @@ import '../../chunk-RZL4TOK3.js';
31
32
  import '../../chunk-C3CAXQMA.js';
32
33
  import { createLogger } from '../../chunk-BOFL7GIF.js';
33
34
  import '../../chunk-NSBPE2FW.js';
34
- import { spawnSync, spawn } from 'child_process';
35
+ import { spawn } from 'child_process';
35
36
  import { randomUUID } from 'crypto';
36
- import { readFileSync, existsSync } from 'fs';
37
+ import { readFileSync } from 'fs';
37
38
  import { createRequire } from 'module';
38
39
  import * as zNS from 'zod';
39
40
 
@@ -2139,6 +2140,7 @@ var ClaudeSdkHarness = class extends AgentHarness {
2139
2140
  childEnv.ENABLE_CLAUDEAI_MCP_SERVERS = "false";
2140
2141
  childEnv.CLAUDE_CODE_ENABLE_TODO_TOOLS ??= "1";
2141
2142
  if (agentExecRequested()) childEnv.CLAUDE_CONFIG_DIR = this.resolveClaudeConfigDir();
2143
+ childEnv.PATH = harnessSpawnPath(childEnv);
2142
2144
  options.env = stripRunnerPrivateEnv(childEnv);
2143
2145
  const { query } = this.sdk;
2144
2146
  this.inputStream = new PushableInputStream();
@@ -3624,20 +3626,16 @@ var ClaudeSdkHarness = class extends AgentHarness {
3624
3626
  * Resolution order:
3625
3627
  * 1. CLAUDE_CODE_PATH env var (set in Docker containers where cli.js is
3626
3628
  * extracted from the SDK during build — bun-compiled binaries can't
3627
- * access the SDK's bundled cli.js via $bunfs)
3628
- * 2. `which claude` on PATH (dev machines with claude installed globally)
3629
+ * access the SDK's bundled cli.js via $bunfs); it need not be executable
3630
+ * 2. `claude` on PATH or in a toolchain install dir (nvm, volta, bun, Homebrew, …;
3631
+ * dev machines with claude installed globally). The project's `node_modules/.bin`
3632
+ * is not searched: it is repo-controlled.
3629
3633
  * 3. undefined — let the SDK resolve its own bundled cli.js (works when
3630
3634
  * not running inside a bun-compiled binary)
3631
3635
  */
3632
3636
  findClaudeBinary() {
3633
3637
  if (claudeBinaryResolved) return claudeBinaryCache;
3634
- const envPath = process.env.CLAUDE_CODE_PATH;
3635
- if (envPath && existsSync(envPath)) {
3636
- claudeBinaryCache = envPath;
3637
- } else {
3638
- const result = spawnSync("which", ["claude"], { encoding: "utf-8" });
3639
- claudeBinaryCache = result.stdout?.trim() || void 0;
3640
- }
3638
+ claudeBinaryCache = resolveHarnessBinary(SDK_CLI_BINARIES["claude-sdk"], process.env);
3641
3639
  claudeBinaryResolved = true;
3642
3640
  return claudeBinaryCache;
3643
3641
  }