@skaile/workspaces 6.7.0 → 6.8.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 (175) hide show
  1. package/CHANGELOG.md +6 -0
  2. package/dist/app-sdk/index.js +1 -1
  3. package/dist/{asset-feeds-4A7PJ4OB.js → asset-feeds-NU5UOO5F.js} +6 -6
  4. package/dist/{asset-feeds-4A7PJ4OB.js.map → asset-feeds-NU5UOO5F.js.map} +1 -1
  5. package/dist/asset-manager/index.js +1 -1
  6. package/dist/bridge/harnesses/claude-sdk.js +18 -10
  7. package/dist/bridge/harnesses/claude-sdk.js.map +1 -1
  8. package/dist/bridge/harnesses/codex.js +3 -3
  9. package/dist/bridge/harnesses/continue.js +4 -4
  10. package/dist/bridge/harnesses/echo.js +4 -4
  11. package/dist/bridge/harnesses/gemini.js +5 -5
  12. package/dist/bridge/harnesses/goose.js +4 -4
  13. package/dist/bridge/harnesses/omp.js +6 -6
  14. package/dist/bridge/harnesses/opencode.js +4 -4
  15. package/dist/bridge/harnesses/qwen.js +5 -5
  16. package/dist/bridge/index.js +9 -9
  17. package/dist/bridge/src/harnesses/claude-sdk.d.ts.map +1 -1
  18. package/dist/bridge/src/harnesses/claude-self-turns.d.ts.map +1 -1
  19. package/dist/bridge/src/types.d.ts +11 -0
  20. package/dist/bridge/src/types.d.ts.map +1 -1
  21. package/dist/{chunk-ZM4SDVUV.js → chunk-2I5HNM7K.js} +8 -8
  22. package/dist/{chunk-ZM4SDVUV.js.map → chunk-2I5HNM7K.js.map} +1 -1
  23. package/dist/{chunk-L3JQJ6D5.js → chunk-3NJFPGEB.js} +4 -4
  24. package/dist/{chunk-L3JQJ6D5.js.map → chunk-3NJFPGEB.js.map} +1 -1
  25. package/dist/{chunk-3W6XZQ2Y.js → chunk-3QX2X77G.js} +3 -3
  26. package/dist/{chunk-3W6XZQ2Y.js.map → chunk-3QX2X77G.js.map} +1 -1
  27. package/dist/{chunk-L7QOZG5V.js → chunk-5TLMHB2U.js} +3 -3
  28. package/dist/{chunk-L7QOZG5V.js.map → chunk-5TLMHB2U.js.map} +1 -1
  29. package/dist/{chunk-KORDNXKA.js → chunk-6PVRP3LW.js} +36 -5
  30. package/dist/chunk-6PVRP3LW.js.map +1 -0
  31. package/dist/{chunk-HPXONAI2.js → chunk-6ZM5X2XW.js} +3 -3
  32. package/dist/{chunk-HPXONAI2.js.map → chunk-6ZM5X2XW.js.map} +1 -1
  33. package/dist/{chunk-ZDTDS62B.js → chunk-757G6TTZ.js} +2 -2
  34. package/dist/{chunk-ZDTDS62B.js.map → chunk-757G6TTZ.js.map} +1 -1
  35. package/dist/{chunk-ASBZOTEO.js → chunk-7NN3P6VF.js} +22 -5
  36. package/dist/chunk-7NN3P6VF.js.map +1 -0
  37. package/dist/{chunk-OGTQUEAO.js → chunk-7YOHUX2M.js} +5 -5
  38. package/dist/{chunk-OGTQUEAO.js.map → chunk-7YOHUX2M.js.map} +1 -1
  39. package/dist/{chunk-NURTGAWM.js → chunk-BRPEW3UL.js} +3 -3
  40. package/dist/{chunk-NURTGAWM.js.map → chunk-BRPEW3UL.js.map} +1 -1
  41. package/dist/{chunk-WKENHNDM.js → chunk-DRHJRTAS.js} +3 -3
  42. package/dist/{chunk-WKENHNDM.js.map → chunk-DRHJRTAS.js.map} +1 -1
  43. package/dist/{chunk-72TLO2AG.js → chunk-E3KABQS3.js} +3 -3
  44. package/dist/{chunk-72TLO2AG.js.map → chunk-E3KABQS3.js.map} +1 -1
  45. package/dist/{chunk-WIYVR24B.js → chunk-HKRME377.js} +3 -3
  46. package/dist/{chunk-WIYVR24B.js.map → chunk-HKRME377.js.map} +1 -1
  47. package/dist/{chunk-4C2E5QUP.js → chunk-I6XH46Q6.js} +3 -3
  48. package/dist/{chunk-4C2E5QUP.js.map → chunk-I6XH46Q6.js.map} +1 -1
  49. package/dist/{chunk-Q2NYTMT6.js → chunk-K6HCOTOZ.js} +5 -5
  50. package/dist/{chunk-Q2NYTMT6.js.map → chunk-K6HCOTOZ.js.map} +1 -1
  51. package/dist/{chunk-6RPS7JEH.js → chunk-K7ZGY2BY.js} +273 -26
  52. package/dist/chunk-K7ZGY2BY.js.map +1 -0
  53. package/dist/{chunk-37X4A6VZ.js → chunk-KHWGUXSF.js} +4 -4
  54. package/dist/{chunk-37X4A6VZ.js.map → chunk-KHWGUXSF.js.map} +1 -1
  55. package/dist/{chunk-LX4TTTRR.js → chunk-LJ6PLEDU.js} +6 -6
  56. package/dist/{chunk-LX4TTTRR.js.map → chunk-LJ6PLEDU.js.map} +1 -1
  57. package/dist/{chunk-GAIMSCZ7.js → chunk-LL5GMUQG.js} +6 -6
  58. package/dist/{chunk-GAIMSCZ7.js.map → chunk-LL5GMUQG.js.map} +1 -1
  59. package/dist/{chunk-UCB7FK25.js → chunk-NW7Y5SNK.js} +4 -4
  60. package/dist/{chunk-UCB7FK25.js.map → chunk-NW7Y5SNK.js.map} +1 -1
  61. package/dist/{chunk-PLLZSKOO.js → chunk-ORXV3UB6.js} +3 -3
  62. package/dist/{chunk-PLLZSKOO.js.map → chunk-ORXV3UB6.js.map} +1 -1
  63. package/dist/{chunk-CTRTFMCX.js → chunk-PMZMG3HC.js} +3 -3
  64. package/dist/{chunk-CTRTFMCX.js.map → chunk-PMZMG3HC.js.map} +1 -1
  65. package/dist/{chunk-J7VEQORJ.js → chunk-Q6FKWPRO.js} +5 -5
  66. package/dist/{chunk-J7VEQORJ.js.map → chunk-Q6FKWPRO.js.map} +1 -1
  67. package/dist/{chunk-AO57IFME.js → chunk-QGA2OBUJ.js} +3 -3
  68. package/dist/{chunk-AO57IFME.js.map → chunk-QGA2OBUJ.js.map} +1 -1
  69. package/dist/{chunk-RAHAZ7LP.js → chunk-RDIGVPXX.js} +2 -2
  70. package/dist/{chunk-RAHAZ7LP.js.map → chunk-RDIGVPXX.js.map} +1 -1
  71. package/dist/{chunk-U52FYGK5.js → chunk-REAF7ZFA.js} +4 -4
  72. package/dist/{chunk-U52FYGK5.js.map → chunk-REAF7ZFA.js.map} +1 -1
  73. package/dist/{chunk-XON6ODIC.js → chunk-SILFO5RY.js} +2 -2
  74. package/dist/{chunk-XON6ODIC.js.map → chunk-SILFO5RY.js.map} +1 -1
  75. package/dist/{chunk-BKLDBUQA.js → chunk-XCGDRLMH.js} +3 -3
  76. package/dist/{chunk-BKLDBUQA.js.map → chunk-XCGDRLMH.js.map} +1 -1
  77. package/dist/{chunk-HMVAGPYR.js → chunk-XIIIGLSL.js} +9 -9
  78. package/dist/{chunk-HMVAGPYR.js.map → chunk-XIIIGLSL.js.map} +1 -1
  79. package/dist/{chunk-N6ZGB5ES.js → chunk-Y6LC5PEZ.js} +3 -3
  80. package/dist/{chunk-N6ZGB5ES.js.map → chunk-Y6LC5PEZ.js.map} +1 -1
  81. package/dist/{chunk-LZPJOF7Y.js → chunk-YEOG7CWQ.js} +3 -3
  82. package/dist/{chunk-LZPJOF7Y.js.map → chunk-YEOG7CWQ.js.map} +1 -1
  83. package/dist/{chunk-IRK3LNG3.js → chunk-YGP6XEPA.js} +3 -3
  84. package/dist/{chunk-IRK3LNG3.js.map → chunk-YGP6XEPA.js.map} +1 -1
  85. package/dist/{chunk-37AYPPOO.js → chunk-YHNPWSSH.js} +8 -8
  86. package/dist/{chunk-37AYPPOO.js.map → chunk-YHNPWSSH.js.map} +1 -1
  87. package/dist/{chunk-TXX3OUYI.js → chunk-YZD7DUEF.js} +3 -3
  88. package/dist/{chunk-TXX3OUYI.js.map → chunk-YZD7DUEF.js.map} +1 -1
  89. package/dist/{claude-code-BLFRZU2X.js → claude-code-AESK7XO4.js} +4 -4
  90. package/dist/{claude-code-BLFRZU2X.js.map → claude-code-AESK7XO4.js.map} +1 -1
  91. package/dist/cli/index.js +55 -55
  92. package/dist/connectors/index.js +11 -11
  93. package/dist/{connectors-OJJU4LSN.js → connectors-5ZZRVAPD.js} +14 -14
  94. package/dist/{connectors-OJJU4LSN.js.map → connectors-5ZZRVAPD.js.map} +1 -1
  95. package/dist/connectors-shared/index.js +2 -2
  96. package/dist/{ensure-sources-F6VQDCWY.js → ensure-sources-VLJ7AUUK.js} +13 -13
  97. package/dist/{ensure-sources-F6VQDCWY.js.map → ensure-sources-VLJ7AUUK.js.map} +1 -1
  98. package/dist/factory-assets/connectors/box.js +11 -11
  99. package/dist/factory-assets/connectors/deploy.js +11 -11
  100. package/dist/factory-assets/connectors/devserver.js +11 -11
  101. package/dist/factory-assets/connectors/flow/adapter.js +11 -11
  102. package/dist/factory-assets/connectors/flow/contract/schema.d.ts +3 -3
  103. package/dist/factory-assets/connectors/flow/run-flow.js +12 -12
  104. package/dist/factory-assets/connectors/flow.js +11 -11
  105. package/dist/factory-assets/connectors/git.js +11 -11
  106. package/dist/factory-assets/connectors/gmail.js +11 -11
  107. package/dist/factory-assets/connectors/googledrive.js +11 -11
  108. package/dist/factory-assets/connectors/local.js +11 -11
  109. package/dist/factory-assets/connectors/mattermost.js +11 -11
  110. package/dist/factory-assets/connectors/memory.js +11 -11
  111. package/dist/factory-assets/connectors/minio.js +11 -11
  112. package/dist/factory-assets/connectors/postgres.js +11 -11
  113. package/dist/factory-assets/connectors/s3.js +11 -11
  114. package/dist/factory-assets/connectors/sharepoint.js +11 -11
  115. package/dist/factory-assets/connectors/sqlite.js +11 -11
  116. package/dist/factory-assets/connectors/static-server.js +11 -11
  117. package/dist/factory-assets/connectors/tunnel.js +11 -11
  118. package/dist/factory-assets/connectors/webdav.js +11 -11
  119. package/dist/factory-assets/connectors/xstate-store.js +11 -11
  120. package/dist/factory-assets/connectors/xstate.js +11 -11
  121. package/dist/{helpers-PJNUTZXZ.js → helpers-APXGTZ5A.js} +13 -13
  122. package/dist/{helpers-PJNUTZXZ.js.map → helpers-APXGTZ5A.js.map} +1 -1
  123. package/dist/{library-publish-FNNDWVBO.js → library-publish-B5HL4OBE.js} +27 -27
  124. package/dist/{library-publish-FNNDWVBO.js.map → library-publish-B5HL4OBE.js.map} +1 -1
  125. package/dist/model-endpoint/index.js +3 -3
  126. package/dist/{open-library-R5EZROFN.js → open-library-F56D46K7.js} +14 -14
  127. package/dist/{open-library-R5EZROFN.js.map → open-library-F56D46K7.js.map} +1 -1
  128. package/dist/{project-S2FT3LLR.js → project-GLTP6VFV.js} +23 -23
  129. package/dist/{project-S2FT3LLR.js.map → project-GLTP6VFV.js.map} +1 -1
  130. package/dist/runner/index.js +17 -17
  131. package/dist/runner/src/capability-roundtrip.d.ts +2 -1
  132. package/dist/runner/src/capability-roundtrip.d.ts.map +1 -1
  133. package/dist/runner/src/serve.d.ts.map +1 -1
  134. package/dist/runner/src/turn-scheduler.d.ts +8 -0
  135. package/dist/runner/src/turn-scheduler.d.ts.map +1 -1
  136. package/dist/runner/src/turn-visibility.d.ts +97 -0
  137. package/dist/runner/src/turn-visibility.d.ts.map +1 -0
  138. package/dist/sdk/asset-manager.js +1 -1
  139. package/dist/sdk/bridge.js +9 -9
  140. package/dist/sdk/index.js +17 -17
  141. package/dist/sdk/runner.js +17 -17
  142. package/dist/sdk/session.js +2 -2
  143. package/dist/sdk/types.js +1 -1
  144. package/dist/{serve-preflight-AADSOUO2.js → serve-preflight-EHLBSNUE.js} +15 -15
  145. package/dist/{serve-preflight-AADSOUO2.js.map → serve-preflight-EHLBSNUE.js.map} +1 -1
  146. package/dist/session/index.js +2 -2
  147. package/dist/session/src/dispatcher.d.ts.map +1 -1
  148. package/dist/{setup-HOAJHUFQ.js → setup-PMZLMFCD.js} +14 -14
  149. package/dist/{setup-HOAJHUFQ.js.map → setup-PMZLMFCD.js.map} +1 -1
  150. package/dist/{source-FOELFCY6.js → source-QNSGAM3S.js} +24 -24
  151. package/dist/{source-FOELFCY6.js.map → source-QNSGAM3S.js.map} +1 -1
  152. package/dist/{source-manifest-publish-Q7P5AEVU.js → source-manifest-publish-AI725AVE.js} +26 -26
  153. package/dist/{source-manifest-publish-Q7P5AEVU.js.map → source-manifest-publish-AI725AVE.js.map} +1 -1
  154. package/dist/tui/index.js +17 -17
  155. package/dist/types/index.js +1 -1
  156. package/dist/types/src/capabilities.d.ts +3 -2
  157. package/dist/types/src/capabilities.d.ts.map +1 -1
  158. package/dist/types/src/events.d.ts +11 -10
  159. package/dist/types/src/events.d.ts.map +1 -1
  160. package/dist/types/src/index.d.ts +2 -0
  161. package/dist/types/src/index.d.ts.map +1 -1
  162. package/dist/types/src/manifests/preset.d.ts +5 -5
  163. package/dist/types/src/protocol.d.ts +3 -0
  164. package/dist/types/src/protocol.d.ts.map +1 -1
  165. package/dist/types/src/turn-visibility.d.ts +50 -0
  166. package/dist/types/src/turn-visibility.d.ts.map +1 -0
  167. package/dist/types/src/version.d.ts +14 -1
  168. package/dist/types/src/version.d.ts.map +1 -1
  169. package/dist/workspace-plugin/adapters/mcp.js +13 -13
  170. package/dist/workspace-plugin/adapters/omp.js +7 -7
  171. package/dist/workspace-plugin/index.js +1 -1
  172. package/package.json +1 -1
  173. package/dist/chunk-6RPS7JEH.js.map +0 -1
  174. package/dist/chunk-ASBZOTEO.js.map +0 -1
  175. package/dist/chunk-KORDNXKA.js.map +0 -1
package/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # Changelog
2
2
 
3
+ ## 6.8.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [#1124](https://github.com/skaile-ai/workspaces/pull/1124) [`32f138b`](https://github.com/skaile-ai/workspaces/commit/32f138b22f66c9d16af5dd1b799b01a33b51012f) Thanks [@peteralbert](https://github.com/peteralbert)! - A private `@agent_` prompt's answer now stays private (protocol 5.1.0). The `prompt` command gains optional `visibilityMode` and `privateRecipientIds`: `SessionDispatcher.sendCommand` sets them for a private prompt the agent receives (the sender plus the prompt's human recipients, never the `__agent__` sentinel alone), and the runner stamps both on every content event of that turn (`TURN_VISIBILITY_EVENT_TYPES`: text, tool calls and results, questions, errors, `finished`, …), from dispatch to `finished`. Work the turn starts keeps its readers after the turn ends: a background subagent's tool calls and results (by `parentToolUseId`) and a self-started turn that reads a task the private turn launched. A capability call carries no parent id, so while background tasks run, its events (`capability_invoked`, `render_invoked`, `custom_message`, a render's fallback text; a `question` is credited to the tool use it comes from instead) go only to the readers the running turn and every running task's launching turn share; when they share none, the events are withheld and the call is refused to the agent. Once a private turn has run, output whose readers cannot be established is withheld (dropped, or for `finished` / `error` sent content-free), never sent Public or to another turn's readers. The dispatcher persists a stamped event with that visibility on its `Message` envelope. Status, file-change and session events, public turns and turns no prompt started are unchanged. The runner lists `turnVisibility.v1` in `protocol_info.runtimeFeatures`, refuses a private prompt while a flow takes chat (a flow turn cannot keep one prompt's readers), and refuses a private prompt that names no human reader.
8
+
3
9
  ## 6.7.0
4
10
 
5
11
  ### Minor Changes
@@ -1,4 +1,4 @@
1
- import { PROTOCOL_VERSION_STRING } from '../chunk-ASBZOTEO.js';
1
+ import { PROTOCOL_VERSION_STRING } from '../chunk-7NN3P6VF.js';
2
2
  import '../chunk-NSBPE2FW.js';
3
3
  import * as z from 'zod';
4
4
 
@@ -1,8 +1,8 @@
1
- import { storeNotInstallableReason } from './chunk-TXX3OUYI.js';
1
+ import { storeNotInstallableReason } from './chunk-YZD7DUEF.js';
2
2
  import { getKnownKinds } from './chunk-QCR5AE5E.js';
3
3
  import './chunk-WFK4MUBL.js';
4
4
  import './chunk-7RGTAEG6.js';
5
- import './chunk-ZDTDS62B.js';
5
+ import './chunk-757G6TTZ.js';
6
6
  import './chunk-G44FFUMA.js';
7
7
  import './chunk-O5Y7VMVQ.js';
8
8
  import './chunk-OSABUEWA.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-R5EZROFN.js');
63
+ const { openLibraryManager } = await import('./open-library-F56D46K7.js');
64
64
  const { getKindRegistry } = await import('./open-registry-RZW2AFD6.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-R5EZROFN.js');
97
+ const { resolveCatalogSource } = await import('./open-library-F56D46K7.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-4A7PJ4OB.js.map
179
- //# sourceMappingURL=asset-feeds-4A7PJ4OB.js.map
178
+ //# sourceMappingURL=asset-feeds-NU5UOO5F.js.map
179
+ //# sourceMappingURL=asset-feeds-NU5UOO5F.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,GAA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MACN,SAAS,GAAA,YAAe,KAAA,GAAQ,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-4A7PJ4OB.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,WA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AA,IAC3F;AACA,IAAA,OAAO,EAAE,SAAS,KAAA,EAAM;AAAA,EAC1B,SAAS,GAAA,EAAK;AACZ,IAAA,KAAA,CAAM,IAAA,CAAK;AAAA,MACT,IAAA,EAAM,SAAA;AAAA,MACN,SAAS,GAAA,YAAe,KAAA,GAAQ,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-NU5UOO5F.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, installAgentInstances, labelDiffHeaders, mcpNotRunnableReason, normalizeRepoUrl, parseCanonicalLockKey, parseRefTolerant, renderMcpServerConfig, setLibraryAssetCheck, setRenamedEntryLookup, softDepName } from '../chunk-ZDTDS62B.js';
1
+ export { AssetManager, LibraryEntryError, MissingManifestError, installAgentInstances, labelDiffHeaders, mcpNotRunnableReason, normalizeRepoUrl, parseCanonicalLockKey, parseRefTolerant, renderMcpServerConfig, setLibraryAssetCheck, setRenamedEntryLookup, softDepName } from '../chunk-757G6TTZ.js';
2
2
  import '../chunk-G44FFUMA.js';
3
3
  import '../chunk-O5Y7VMVQ.js';
4
4
  import '../chunk-OSABUEWA.js';
@@ -1,16 +1,16 @@
1
1
  import { formatDroppedToolsNotice, filterInProcessMcpServerTools, checkToolPropertyKeys, TOOL_PROPERTY_KEY_PATTERN } from '../../chunk-3X7VTCPG.js';
2
2
  import { freshBudget, isFirstAttempt, spend, isSpent, decide, isAvailable } from '../../chunk-7EKQDY2T.js';
3
3
  import { AskSlots } from '../../chunk-3TG2NV2F.js';
4
- import { scrubPoisonedTranscript, transcriptStoreForRuntime, resolveClaudeConfigDir, unsupportedSurfaceNotice, claudeEndpointMode, buildClaudeEndpointEnv, APPROVE_ONCE, DENY } from '../../chunk-HPXONAI2.js';
5
- import { dispatchCapability } from '../../chunk-LZPJOF7Y.js';
4
+ import { scrubPoisonedTranscript, transcriptStoreForRuntime, resolveClaudeConfigDir, unsupportedSurfaceNotice, claudeEndpointMode, buildClaudeEndpointEnv, APPROVE_ONCE, DENY } from '../../chunk-6ZM5X2XW.js';
5
+ import { dispatchCapability } from '../../chunk-YEOG7CWQ.js';
6
6
  import { fetchProviderModels } from '../../chunk-SBNUXJ6E.js';
7
7
  import { ReconfigureLedger, AuthError, stripRunnerPrivateEnv, classifyClaudeSdkError, reclassifyAuthAsAccountUnavailable, AccountUnavailableError, isLongContextEntitlementRejection, LONG_CONTEXT_CREDITS_API_ERROR } from '../../chunk-5DE3DGVR.js';
8
8
  import { agentExecRequested, wrapAgentCommand, resolveAgentExec } from '../../chunk-7DN6JKP2.js';
9
- import { AgentHarness, getBridgeLogger, registryHarnessConfig } from '../../chunk-PLLZSKOO.js';
10
- import { BUILTIN_HARNESS_CATALOG, entryCredentialValue } from '../../chunk-XON6ODIC.js';
9
+ import { AgentHarness, getBridgeLogger, registryHarnessConfig } from '../../chunk-ORXV3UB6.js';
10
+ import { BUILTIN_HARNESS_CATALOG, entryCredentialValue } from '../../chunk-SILFO5RY.js';
11
11
  import '../../chunk-G5SUWZEU.js';
12
12
  import '../../chunk-6UP2EDFN.js';
13
- import { withActivityLabelShape } from '../../chunk-ASBZOTEO.js';
13
+ import { withActivityLabelShape } from '../../chunk-7NN3P6VF.js';
14
14
  import '../../chunk-VT6G5AJV.js';
15
15
  import { loadHarnessSdk } from '../../chunk-TMJBEGS4.js';
16
16
  import '../../chunk-4GY63JU6.js';
@@ -261,6 +261,7 @@ var SelfTurnTracker = class {
261
261
  this.settled.clear();
262
262
  this.foreground.clear();
263
263
  this.reported.clear();
264
+ this.emit({ type: "background_tasks_reset" });
264
265
  }
265
266
  observeConsumedPrompts(msg) {
266
267
  const uuids = msg.user_message_uuids ?? (msg.user_message_uuid ? [msg.user_message_uuid] : []);
@@ -296,6 +297,7 @@ var SelfTurnTracker = class {
296
297
  }
297
298
  if (msg.subtype === "task_notification") {
298
299
  this.foreground.delete(taskId);
300
+ if (!ambient) this.emit({ type: "background_task_settled", taskId });
299
301
  if (!ambient && this.reported.has(taskId)) remember(this.settled, taskId);
300
302
  }
301
303
  }
@@ -2170,7 +2172,12 @@ var ClaudeSdkHarness = class extends AgentHarness {
2170
2172
  if (denial) return Promise.resolve({ behavior: "deny", message: denial });
2171
2173
  if (toolName !== "AskUserQuestion") {
2172
2174
  if (this.config.permissionMode === "interactive") {
2173
- return this.askToolApproval(toolName, input, opts.signal);
2175
+ return this.askToolApproval(
2176
+ toolName,
2177
+ input,
2178
+ opts.signal,
2179
+ opts.agentID ? opts.toolUseID : void 0
2180
+ );
2174
2181
  }
2175
2182
  return Promise.resolve({ behavior: "allow", updatedInput: input });
2176
2183
  }
@@ -2203,7 +2210,7 @@ var ClaudeSdkHarness = class extends AgentHarness {
2203
2210
  * did not auto-allow. The reply goes through {@link answerQuestion} like an `AskUserQuestion`
2204
2211
  * answer; anything but an approval denies. A session nobody can answer refuses the call.
2205
2212
  */
2206
- askToolApproval(toolName, input, signal) {
2213
+ askToolApproval(toolName, input, signal, parentToolUseId) {
2207
2214
  if (this.config.unattended) {
2208
2215
  return Promise.resolve({
2209
2216
  behavior: "deny",
@@ -2211,7 +2218,7 @@ var ClaudeSdkHarness = class extends AgentHarness {
2211
2218
  });
2212
2219
  }
2213
2220
  return new Promise((resolve) => {
2214
- const entry = { toolName, input, resolve };
2221
+ const entry = { toolName, input, resolve, parentToolUseId };
2215
2222
  signal.addEventListener(
2216
2223
  "abort",
2217
2224
  () => {
@@ -2235,7 +2242,7 @@ var ClaudeSdkHarness = class extends AgentHarness {
2235
2242
  }
2236
2243
  /** Show the approval card of one tool call and make it the pending question. */
2237
2244
  presentApproval(entry) {
2238
- const { toolName, input, resolve } = entry;
2245
+ const { toolName, input, resolve, parentToolUseId } = entry;
2239
2246
  const { kind, details } = describeToolApproval(toolName, input);
2240
2247
  const question = `Allow ${toolName}?`;
2241
2248
  this.pendingQuestion = {
@@ -2256,7 +2263,8 @@ var ClaudeSdkHarness = class extends AgentHarness {
2256
2263
  type: "message_start",
2257
2264
  message: {
2258
2265
  role: "assistant",
2259
- content: [{ type: "tool_use", name: "AskUserQuestion", id: callId, input: cardInput }]
2266
+ content: [{ type: "tool_use", name: "AskUserQuestion", id: callId, input: cardInput }],
2267
+ ...parentToolUseId ? { parentToolUseId } : {}
2260
2268
  }
2261
2269
  });
2262
2270
  this.emit("agent-event", {