@skaile/workspaces 5.16.0 → 5.17.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 (162) hide show
  1. package/CHANGELOG.md +26 -0
  2. package/dist/app-sdk/index.js +1 -1
  3. package/dist/{asset-feeds-BELBSJEE.js → asset-feeds-MALYFZUM.js} +4 -4
  4. package/dist/{asset-feeds-BELBSJEE.js.map → asset-feeds-MALYFZUM.js.map} +1 -1
  5. package/dist/asset-manager/index.js +1 -1
  6. package/dist/bridge/drivers/claude-sdk.js +279 -96
  7. package/dist/bridge/drivers/claude-sdk.js.map +1 -1
  8. package/dist/bridge/drivers/codex.js +4 -4
  9. package/dist/bridge/drivers/continue.js +4 -4
  10. package/dist/bridge/drivers/echo.js +4 -4
  11. package/dist/bridge/drivers/gemini.js +6 -6
  12. package/dist/bridge/drivers/goose.js +4 -4
  13. package/dist/bridge/drivers/omp.js +6 -6
  14. package/dist/bridge/drivers/opencode.js +4 -4
  15. package/dist/bridge/drivers/qwen.js +6 -6
  16. package/dist/bridge/index.js +8 -8
  17. package/dist/bridge/src/drivers/claude-sdk.d.ts +74 -20
  18. package/dist/bridge/src/drivers/claude-sdk.d.ts.map +1 -1
  19. package/dist/bridge/src/drivers/claude-self-turns.d.ts +25 -6
  20. package/dist/bridge/src/drivers/claude-self-turns.d.ts.map +1 -1
  21. package/dist/bridge/src/drivers/sanitize-assistant-text.d.ts +10 -0
  22. package/dist/bridge/src/drivers/sanitize-assistant-text.d.ts.map +1 -1
  23. package/dist/bridge/src/drivers/scrub-transcript.d.ts +20 -0
  24. package/dist/bridge/src/drivers/scrub-transcript.d.ts.map +1 -1
  25. package/dist/{chunk-NSNM2ZXF.js → chunk-3OYOBTY4.js} +44 -4
  26. package/dist/chunk-3OYOBTY4.js.map +1 -0
  27. package/dist/{chunk-6RTEUWXX.js → chunk-5SWED2LW.js} +3 -3
  28. package/dist/{chunk-6RTEUWXX.js.map → chunk-5SWED2LW.js.map} +1 -1
  29. package/dist/{chunk-PW3TYWOI.js → chunk-AJ7EGIFR.js} +3 -3
  30. package/dist/{chunk-PW3TYWOI.js.map → chunk-AJ7EGIFR.js.map} +1 -1
  31. package/dist/{chunk-E634MBP6.js → chunk-BBRMS4IC.js} +3 -3
  32. package/dist/{chunk-E634MBP6.js.map → chunk-BBRMS4IC.js.map} +1 -1
  33. package/dist/{chunk-SMUIYYCH.js → chunk-BVXXBZWA.js} +7 -7
  34. package/dist/{chunk-SMUIYYCH.js.map → chunk-BVXXBZWA.js.map} +1 -1
  35. package/dist/{chunk-ISSYT5AZ.js → chunk-CWAWYXD5.js} +3 -3
  36. package/dist/{chunk-ISSYT5AZ.js.map → chunk-CWAWYXD5.js.map} +1 -1
  37. package/dist/{chunk-OHNNCXMB.js → chunk-DR5ZOEYI.js} +7 -7
  38. package/dist/{chunk-OHNNCXMB.js.map → chunk-DR5ZOEYI.js.map} +1 -1
  39. package/dist/{chunk-YIDZJHY6.js → chunk-EFLKSMCO.js} +3 -3
  40. package/dist/{chunk-YIDZJHY6.js.map → chunk-EFLKSMCO.js.map} +1 -1
  41. package/dist/{chunk-CQFVKN6S.js → chunk-EOKWTN4N.js} +207 -66
  42. package/dist/chunk-EOKWTN4N.js.map +1 -0
  43. package/dist/{chunk-Y25V2MW2.js → chunk-EYDRONKO.js} +3 -3
  44. package/dist/{chunk-Y25V2MW2.js.map → chunk-EYDRONKO.js.map} +1 -1
  45. package/dist/{chunk-DQOAPR4M.js → chunk-FACRITOL.js} +2 -2
  46. package/dist/{chunk-DQOAPR4M.js.map → chunk-FACRITOL.js.map} +1 -1
  47. package/dist/{chunk-TXGVG7VH.js → chunk-GYZJKZPJ.js} +3 -3
  48. package/dist/{chunk-TXGVG7VH.js.map → chunk-GYZJKZPJ.js.map} +1 -1
  49. package/dist/{chunk-TADJCATD.js → chunk-HLETG3CX.js} +3 -3
  50. package/dist/{chunk-TADJCATD.js.map → chunk-HLETG3CX.js.map} +1 -1
  51. package/dist/{chunk-FWAJUWXQ.js → chunk-KZWZRNIY.js} +4 -4
  52. package/dist/{chunk-FWAJUWXQ.js.map → chunk-KZWZRNIY.js.map} +1 -1
  53. package/dist/{chunk-X5O56UO4.js → chunk-L2AMXONH.js} +3 -3
  54. package/dist/chunk-L2AMXONH.js.map +1 -0
  55. package/dist/{chunk-6Q7NKTDG.js → chunk-LQT2IKYY.js} +2 -2
  56. package/dist/{chunk-6Q7NKTDG.js.map → chunk-LQT2IKYY.js.map} +1 -1
  57. package/dist/{chunk-A7AZ3RL5.js → chunk-MMARPEV7.js} +4 -4
  58. package/dist/{chunk-A7AZ3RL5.js.map → chunk-MMARPEV7.js.map} +1 -1
  59. package/dist/{chunk-J4RRH2NP.js → chunk-OQN7PCI4.js} +3 -3
  60. package/dist/{chunk-J4RRH2NP.js.map → chunk-OQN7PCI4.js.map} +1 -1
  61. package/dist/{chunk-5CE6J4DB.js → chunk-OXUCYHL5.js} +5 -5
  62. package/dist/{chunk-5CE6J4DB.js.map → chunk-OXUCYHL5.js.map} +1 -1
  63. package/dist/{chunk-A26MUUN7.js → chunk-QBY74UBH.js} +7 -7
  64. package/dist/{chunk-A26MUUN7.js.map → chunk-QBY74UBH.js.map} +1 -1
  65. package/dist/{chunk-VJ2DZLDM.js → chunk-QEX75L77.js} +3 -3
  66. package/dist/{chunk-VJ2DZLDM.js.map → chunk-QEX75L77.js.map} +1 -1
  67. package/dist/{chunk-HG52NGAV.js → chunk-QSLXB44M.js} +3 -3
  68. package/dist/{chunk-HG52NGAV.js.map → chunk-QSLXB44M.js.map} +1 -1
  69. package/dist/{chunk-TKI7YDWE.js → chunk-QW534EZB.js} +6 -6
  70. package/dist/{chunk-TKI7YDWE.js.map → chunk-QW534EZB.js.map} +1 -1
  71. package/dist/{chunk-XGR7IDTY.js → chunk-QXA2W6UB.js} +3 -3
  72. package/dist/{chunk-XGR7IDTY.js.map → chunk-QXA2W6UB.js.map} +1 -1
  73. package/dist/{chunk-OJHPG6HK.js → chunk-V5CDPKDA.js} +7 -7
  74. package/dist/{chunk-OJHPG6HK.js.map → chunk-V5CDPKDA.js.map} +1 -1
  75. package/dist/{chunk-DADAZLFW.js → chunk-W44KA24A.js} +2 -2
  76. package/dist/{chunk-DADAZLFW.js.map → chunk-W44KA24A.js.map} +1 -1
  77. package/dist/{chunk-SAGBVBY2.js → chunk-WY22FMZF.js} +4 -4
  78. package/dist/{chunk-SAGBVBY2.js.map → chunk-WY22FMZF.js.map} +1 -1
  79. package/dist/{chunk-D5WTOVLG.js → chunk-Y56YIT6J.js} +2 -2
  80. package/dist/chunk-Y56YIT6J.js.map +1 -0
  81. package/dist/{chunk-ZIW34FGO.js → chunk-YIF2IJUA.js} +3 -3
  82. package/dist/{chunk-ZIW34FGO.js.map → chunk-YIF2IJUA.js.map} +1 -1
  83. package/dist/{chunk-RTNWU2UD.js → chunk-ZPCABSSW.js} +3 -3
  84. package/dist/{chunk-RTNWU2UD.js.map → chunk-ZPCABSSW.js.map} +1 -1
  85. package/dist/{chunk-72KZJE3G.js → chunk-ZWUJ22RF.js} +4 -4
  86. package/dist/{chunk-72KZJE3G.js.map → chunk-ZWUJ22RF.js.map} +1 -1
  87. package/dist/cli/index.js +47 -47
  88. package/dist/connectors/index.js +10 -10
  89. package/dist/{connectors-44RE2QEM.js → connectors-CIEIMJY2.js} +13 -13
  90. package/dist/{connectors-44RE2QEM.js.map → connectors-CIEIMJY2.js.map} +1 -1
  91. package/dist/connectors-shared/index.js +2 -2
  92. package/dist/{ensure-sources-R6AHZ7RV.js → ensure-sources-I62QMZZP.js} +4 -4
  93. package/dist/{ensure-sources-R6AHZ7RV.js.map → ensure-sources-I62QMZZP.js.map} +1 -1
  94. package/dist/factory-assets/connectors/box.js +10 -10
  95. package/dist/factory-assets/connectors/deploy.js +10 -10
  96. package/dist/factory-assets/connectors/devserver.js +10 -10
  97. package/dist/factory-assets/connectors/flow/adapter.js +10 -10
  98. package/dist/factory-assets/connectors/flow/run-flow.js +11 -11
  99. package/dist/factory-assets/connectors/flow.js +10 -10
  100. package/dist/factory-assets/connectors/git.js +10 -10
  101. package/dist/factory-assets/connectors/gmail.js +10 -10
  102. package/dist/factory-assets/connectors/googledrive.js +10 -10
  103. package/dist/factory-assets/connectors/local.js +10 -10
  104. package/dist/factory-assets/connectors/mattermost.js +10 -10
  105. package/dist/factory-assets/connectors/memory.js +10 -10
  106. package/dist/factory-assets/connectors/minio.js +10 -10
  107. package/dist/factory-assets/connectors/postgres.js +10 -10
  108. package/dist/factory-assets/connectors/s3.js +10 -10
  109. package/dist/factory-assets/connectors/sharepoint.js +10 -10
  110. package/dist/factory-assets/connectors/sqlite.js +10 -10
  111. package/dist/factory-assets/connectors/static-server.js +10 -10
  112. package/dist/factory-assets/connectors/tunnel.js +10 -10
  113. package/dist/factory-assets/connectors/webdav.js +10 -10
  114. package/dist/factory-assets/connectors/xstate-store.js +10 -10
  115. package/dist/factory-assets/connectors/xstate.js +10 -10
  116. package/dist/{helpers-FNQL5PI7.js → helpers-3FOM37BO.js} +4 -4
  117. package/dist/{helpers-FNQL5PI7.js.map → helpers-3FOM37BO.js.map} +1 -1
  118. package/dist/{library-publish-GHPVY42Y.js → library-publish-EFKITCGE.js} +26 -26
  119. package/dist/{library-publish-GHPVY42Y.js.map → library-publish-EFKITCGE.js.map} +1 -1
  120. package/dist/model-endpoint/index.js +3 -3
  121. package/dist/{open-library-YSUGNP36.js → open-library-NZUI4XGF.js} +5 -5
  122. package/dist/{open-library-YSUGNP36.js.map → open-library-NZUI4XGF.js.map} +1 -1
  123. package/dist/{project-NDSLXERO.js → project-2BNFZ2CR.js} +22 -22
  124. package/dist/{project-NDSLXERO.js.map → project-2BNFZ2CR.js.map} +1 -1
  125. package/dist/runner/index.js +17 -17
  126. package/dist/runner/src/coalesced-restart.d.ts +41 -0
  127. package/dist/runner/src/coalesced-restart.d.ts.map +1 -0
  128. package/dist/runner/src/compaction/prompt.d.ts.map +1 -1
  129. package/dist/runner/src/mcp-runtime-handlers.d.ts +27 -0
  130. package/dist/runner/src/mcp-runtime-handlers.d.ts.map +1 -1
  131. package/dist/runner/src/runner-capabilities.d.ts +7 -0
  132. package/dist/runner/src/runner-capabilities.d.ts.map +1 -1
  133. package/dist/runner/src/serve.d.ts.map +1 -1
  134. package/dist/runner/src/session-capability-wiring.d.ts +2 -0
  135. package/dist/runner/src/session-capability-wiring.d.ts.map +1 -1
  136. package/dist/sdk/asset-manager.js +1 -1
  137. package/dist/sdk/bridge.js +8 -8
  138. package/dist/sdk/index.js +17 -17
  139. package/dist/sdk/runner.js +17 -17
  140. package/dist/sdk/session.js +2 -2
  141. package/dist/sdk/types.js +1 -1
  142. package/dist/{serve-preflight-ON2LS3SD.js → serve-preflight-V5GM33T3.js} +2 -2
  143. package/dist/{serve-preflight-ON2LS3SD.js.map → serve-preflight-V5GM33T3.js.map} +1 -1
  144. package/dist/session/index.js +2 -2
  145. package/dist/{setup-MFPEQS2I.js → setup-ZMAPTKJW.js} +13 -13
  146. package/dist/{setup-MFPEQS2I.js.map → setup-ZMAPTKJW.js.map} +1 -1
  147. package/dist/{source-4QVRD5NV.js → source-6BZA34F5.js} +24 -24
  148. package/dist/{source-4QVRD5NV.js.map → source-6BZA34F5.js.map} +1 -1
  149. package/dist/{source-manifest-publish-ZIO24GUM.js → source-manifest-publish-MJXCSUKT.js} +26 -26
  150. package/dist/{source-manifest-publish-ZIO24GUM.js.map → source-manifest-publish-MJXCSUKT.js.map} +1 -1
  151. package/dist/tui/index.js +17 -17
  152. package/dist/types/index.js +1 -1
  153. package/dist/types/src/events.d.ts +7 -4
  154. package/dist/types/src/events.d.ts.map +1 -1
  155. package/dist/workspace-plugin/adapters/mcp.js +12 -12
  156. package/dist/workspace-plugin/adapters/omp.js +7 -7
  157. package/dist/workspace-plugin/index.js +1 -1
  158. package/package.json +1 -1
  159. package/dist/chunk-CQFVKN6S.js.map +0 -1
  160. package/dist/chunk-D5WTOVLG.js.map +0 -1
  161. package/dist/chunk-NSNM2ZXF.js.map +0 -1
  162. package/dist/chunk-X5O56UO4.js.map +0 -1
package/CHANGELOG.md CHANGED
@@ -1,5 +1,31 @@
1
1
  # Changelog
2
2
 
3
+ ## 5.17.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [#1087](https://github.com/skaile-ai/workspaces/pull/1087) [`204fd67`](https://github.com/skaile-ai/workspaces/commit/204fd6723a9a36fd1784fc12b6cfa8b63ca6cdcf) Thanks [@Frozen666](https://github.com/Frozen666)! - `runner.detach_instance` now takes `kind: "mcp-server"`. It removes the server's tools from the live session, drops its `mcp:<name>` credential, deletes its materialized asset under `.skaile/assets/mcp-server/<name>/`, and forgets it so a later session rebuild does not bring it back, then emits `resources_available`. The reply is `{ ok: true, id, removed, live }`: `removed: false` means no server of that name was connected, and `live: false` means the driver bakes its tools and a restart was queued. Tool-change driver restarts are now coalesced: a burst of detaches (or attaches), one call per server, restarts the driver once ([#1069](https://github.com/skaile-ai/workspaces/issues/1069)).
8
+
9
+ ### Patch Changes
10
+
11
+ - [#1090](https://github.com/skaile-ai/workspaces/pull/1090) [`b1dce19`](https://github.com/skaile-ai/workspaces/commit/b1dce1949d47593afa24e72f6c508756d6cb366a) Thanks [@peteralbert](https://github.com/peteralbert)! - Claude SDK driver: the capability MCP server now advertises the properties and descriptions of array items and nested objects, instead of `items: {}` and an opaque record. Agents can see the field names a capability expects inside a list (for example the node and edge fields of `platform.kg_write`, skaile-ai/platform#8715). Nested objects pass unknown keys through, so the registry's own validation still sees and refuses them; a nested key the Claude API would reject keeps that subtree opaque.
12
+
13
+ - [#1091](https://github.com/skaile-ai/workspaces/pull/1091) [`b03ddba`](https://github.com/skaile-ai/workspaces/commit/b03ddba92a3aa044d03319b8c2f0eef4b89c99ce) Thanks [@Frozen666](https://github.com/Frozen666)! - claude-sdk driver: a reply with an unclosed `[` is no longer cut off at that `[` ([#1039](https://github.com/skaile-ai/workspaces/issues/1039)).
14
+
15
+ The streaming sanitizer treated any `[` with no later `]` as the start of a leaked marker and held back everything after it, and nothing sent the held-back part when the message ended, so the stored and displayed reply stopped just before the `[` (for example a LogsQL range `_time:[2026-10-13T20:30:00Z, now)` or a half-open interval `[0, 1)`). The driver now sends any held-back tail as a final text delta before `message_start`, and the sanitizer holds back only what can still become a marker (a bare `[`, a tag-name prefix, a namespace being written, or a `[User]` label waiting for its colon), so an ordinary `[` streams live.
16
+
17
+ - [#1086](https://github.com/skaile-ai/workspaces/pull/1086) [`b14e6ea`](https://github.com/skaile-ai/workspaces/commit/b14e6ea772f8551f9eabf2dfbaa7024a643b1e75) Thanks [@Frozen666](https://github.com/Frozen666)! - runner: the compaction summary is written in the conversation's language and records that language ([#1070](https://github.com/skaile-ai/workspaces/issues/1070)).
18
+
19
+ The default compaction prompt had no rule about language, so the summary that a resumed session starts from came out in English even when the user wrote German, and agents then drifted into English after a resume (skaile-ai/platform#7804). The prompt now asks for the summary in the language the user writes in, also when merging an English previous summary forward, keeps paths, code and quotes untranslated, and adds an always-present "Conversation Language" section to the summary. Agent-supplied compaction prompts are unchanged.
20
+
21
+ - [#1083](https://github.com/skaile-ai/workspaces/pull/1083) [`2dd0486`](https://github.com/skaile-ai/workspaces/commit/2dd0486410798807cc3c9163bcea761a98204f3b) Thanks [@Frozen666](https://github.com/Frozen666)! - claude-sdk driver: the first result after a `--resume` respawn books only its own cost and per-model usage ([#1044](https://github.com/skaile-ai/workspaces/issues/1044)).
22
+
23
+ On `--resume` the Claude Code CLI restores the session's run-cumulative `total_cost_usd` and `modelUsage` from the transcript's last `cost-state` entry, so the first `result` of a resumed spawn restated everything booked before. The driver diffed it against zero and emitted the restored totals again as the turn's `costUsd` and `modelUsage`, which inflated usage ledgers after every max-turns recycle and every wake with native resume. The restored totals are now the baseline: a respawn that resumes the same session in the same driver keeps the last booked totals, and a new driver that resumes a session (a wake) reads the `cost-state` entry during the preventive transcript scrub. If the respawned CLI restored an older stamp than was booked (the CLI writes `cost-state` only at exit), the first result is diffed against that stamp instead. Rows written before this fix are not corrected.
24
+
25
+ - [#1088](https://github.com/skaile-ai/workspaces/pull/1088) [`53d960b`](https://github.com/skaile-ai/workspaces/commit/53d960b301bab45ffbb8090cab1fc1280fa88864) Thanks [@peteralbert](https://github.com/peteralbert)! - claude-sdk driver: a self-started turn no longer reads "origin unknown" on the platform in two cases ([#1085](https://github.com/skaile-ai/workspaces/issues/1085)).
26
+
27
+ A wake's `self_turn_started.taskIds` now lists only tasks the runner announced with `background_task_started`. Before, a background subagent's own foreground tool calls (and any shell it backgrounded between turns) were listed too; the host never saw those start, so it could not vouch for the wake. And a prompt pushed while a self-started turn runs now joins that turn only once the CLI stamps the prompt's uuid on the turn's output. If the wake ends without taking it, the wake's `finished` carries `selfStarted: true` and the prompted turn ends on the result of the turn that answers it, instead of the answering turn being announced as a wake with no tasks. Prompts now carry a uuid; a CLI that does not stamp consumed prompts keeps the old behaviour.
28
+
3
29
  ## 5.16.0
4
30
 
5
31
  ### Minor Changes
@@ -1,4 +1,4 @@
1
- import { PROTOCOL_VERSION_STRING } from '../chunk-D5WTOVLG.js';
1
+ import { PROTOCOL_VERSION_STRING } from '../chunk-Y56YIT6J.js';
2
2
  import '../chunk-NSBPE2FW.js';
3
3
  import * as z from 'zod';
4
4
 
@@ -52,7 +52,7 @@ function libraryEntryOf(asset) {
52
52
  async function libraryAssets() {
53
53
  const notes = [];
54
54
  try {
55
- const { openLibraryManager } = await import('./open-library-YSUGNP36.js');
55
+ const { openLibraryManager } = await import('./open-library-NZUI4XGF.js');
56
56
  const { getKindRegistry } = await import('./open-registry-YPRQDUMK.js');
57
57
  const { scanAuthoringLibraries } = await import('./library/index.js');
58
58
  const { library: index, close } = await openLibraryManager();
@@ -86,7 +86,7 @@ async function libraryAssets() {
86
86
  async function storeAssets(projectDir) {
87
87
  const notes = [];
88
88
  try {
89
- const { resolveCatalogSource } = await import('./open-library-YSUGNP36.js');
89
+ const { resolveCatalogSource } = await import('./open-library-NZUI4XGF.js');
90
90
  const { source, close } = await resolveCatalogSource({ projectDir });
91
91
  try {
92
92
  const assets = (await source.listAssets()).filter(
@@ -167,5 +167,5 @@ async function gatherAssetFeeds(am, projectDir) {
167
167
  }
168
168
 
169
169
  export { gatherAssetFeeds };
170
- //# sourceMappingURL=asset-feeds-BELBSJEE.js.map
171
- //# sourceMappingURL=asset-feeds-BELBSJEE.js.map
170
+ //# sourceMappingURL=asset-feeds-MALYFZUM.js.map
171
+ //# sourceMappingURL=asset-feeds-MALYFZUM.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,MAAA;AACzC,EAAA,MAAM,cACJ,OAAO,WAAA,KAAgB,QAAA,GACnB,WAAA,GACA,MAAM,OAAA,CAAQ,WAAW,CAAA,GACvB,WAAA,CAAY,OAAO,CAAC,CAAA,KAAmB,OAAO,CAAA,KAAM,QAAQ,CAAA,GAC5D,MAAA;AACR,EAAA,MAAM,OAAO,QAAA,CAAS,YAAA;AACtB,EAAA,OAAO;AAAA,IACL,MAAM,KAAA,CAAM,IAAA;AAAA,IACZ,MAAM,KAAA,CAAM,IAAA;AAAA,IACZ,aAAa,OAAO,QAAA,CAAS,WAAA,KAAgB,QAAA,GAAW,SAAS,WAAA,GAAc,EAAA;AAAA,IAC/E,QAAQ,KAAA,CAAM,YAAA;AAAA,IACd,WAAW,KAAA,CAAM,SAAA;AAAA,IACjB,GAAI,MAAM,MAAA,GAAS,EAAE,QAAQ,KAAA,CAAM,MAAA,KAAW,EAAC;AAAA,IAC/C,SAAS,KAAA,CAAM,OAAA;AAAA,IACf,QAAA,EAAU,gBAAgB,MAAA,GAAY,KAAK,aAAA,CAAc,EAAE,QAAA,EAAU,WAAA,EAAa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SAAS,GAAA,CAAI,QAAqB,OAAA,EAAwC;AACxE,EAAA,OAAO,QAAQ,GAAA,CAAI,CAAC,WAAW,EAAE,MAAA,EAAQ,OAAM,CAAE,CAAA;AACnD;AASA,eAAsB,gBAAA,CACpB,IACA,UAAA,EAC0B;AAC1B,EAAA,MAAM,CAAC,IAAA,EAAM,KAAK,CAAA,GAAI,MAAM,OAAA,CAAQ,GAAA,CAAI,CAAC,aAAA,EAAc,EAAG,WAAA,CAAY,UAAU,CAAC,CAAC,CAAA;AAClF,EAAA,MAAM,OAAA,GAAU,MAAM,aAAA,EAAc;AACpC,EAAA,MAAM,GAAA,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-BELBSJEE.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,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,MAAA;AACzC,EAAA,MAAM,cACJ,OAAO,WAAA,KAAgB,QAAA,GACnB,WAAA,GACA,MAAM,OAAA,CAAQ,WAAW,CAAA,GACvB,WAAA,CAAY,OAAO,CAAC,CAAA,KAAmB,OAAO,CAAA,KAAM,QAAQ,CAAA,GAC5D,MAAA;AACR,EAAA,MAAM,OAAO,QAAA,CAAS,YAAA;AACtB,EAAA,OAAO;AAAA,IACL,MAAM,KAAA,CAAM,IAAA;AAAA,IACZ,MAAM,KAAA,CAAM,IAAA;AAAA,IACZ,aAAa,OAAO,QAAA,CAAS,WAAA,KAAgB,QAAA,GAAW,SAAS,WAAA,GAAc,EAAA;AAAA,IAC/E,QAAQ,KAAA,CAAM,YAAA;AAAA,IACd,WAAW,KAAA,CAAM,SAAA;AAAA,IACjB,GAAI,MAAM,MAAA,GAAS,EAAE,QAAQ,KAAA,CAAM,MAA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AQ,GAAA,CAAI,OAAA,GAAU,OAAO,GAAG;AAAA,KACzD,CAAA;AACD,IAAA,OAAO,EAAE,OAAA,EAAS,EAAC,EAAG,KAAA,EAAM;AAAA,EAC9B;AACF;AAGA,SAAS,GAAA,CAAI,QAAqB,OAAA,EAAwC;AACxE,EAAA,OAAO,QAAQ,GAAA,CAAI,CAAC,WAAW,EAAE,MAAA,EAAQ,OAAM,CAAE,CAAA;AACnD;AASA,eAAsB,gBAAA,CACpB,IACA,UAAA,EAC0B;AAC1B,EAAA,MAAM,CAAC,IAAA,EAAM,KAAK,CAAA,GAAI,MAAM,OAAA,CAAQ,GAAA,CAAI,CAAC,aAAA,EAAc,EAAG,WAAA,CAAY,UAAU,CAAC,CAAC,CAAA;AAClF,EAAA,MAAM,OAAA,GAAU,MAAM,aAAA,EAAc;AACpC,EAAA,MAAM,GAAA,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-MALYFZUM.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, FACTORY_SOURCE_URL, MissingManifestError, installAgentInstances, normalizeRepoUrl, parseCanonicalLockKey, parseRefTolerant, renderMcpServerConfig, softDepName } from '../chunk-DADAZLFW.js';
1
+ export { AssetManager, FACTORY_SOURCE_URL, MissingManifestError, installAgentInstances, normalizeRepoUrl, parseCanonicalLockKey, parseRefTolerant, renderMcpServerConfig, softDepName } from '../chunk-W44KA24A.js';
2
2
  import '../chunk-D3PU3C6F.js';
3
3
  import '../chunk-ES6ARJPQ.js';
4
4
  import '../chunk-SXWGLW23.js';