@ashx-j/lunr-dev 0.2.21-dev.12.1 → 0.2.25-dev.13.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (570) hide show
  1. package/CHANGELOG.md +25 -2
  2. package/dist/builtin-extensions/ashxj-tui.d.ts.map +1 -1
  3. package/dist/builtin-extensions/ashxj-tui.js +2 -2
  4. package/dist/builtin-extensions/ashxj-tui.js.map +1 -1
  5. package/dist/builtin-extensions/index.d.ts.map +1 -1
  6. package/dist/builtin-extensions/index.js +1 -0
  7. package/dist/builtin-extensions/index.js.map +1 -1
  8. package/dist/builtin-extensions/lunr-browser.d.ts +9 -0
  9. package/dist/builtin-extensions/lunr-browser.d.ts.map +1 -0
  10. package/dist/builtin-extensions/lunr-browser.js +169 -0
  11. package/dist/builtin-extensions/lunr-browser.js.map +1 -0
  12. package/dist/builtin-extensions/lunr-computer-use.d.ts.map +1 -1
  13. package/dist/builtin-extensions/lunr-computer-use.js +3 -3
  14. package/dist/builtin-extensions/lunr-computer-use.js.map +1 -1
  15. package/dist/builtin-extensions/lunr-plan-tools.d.ts +7 -7
  16. package/dist/builtin-extensions/lunr-plan-tools.d.ts.map +1 -1
  17. package/dist/builtin-extensions/lunr-plan-tools.js +12 -12
  18. package/dist/builtin-extensions/lunr-plan-tools.js.map +1 -1
  19. package/dist/builtin-extensions/lunr-todos.d.ts.map +1 -1
  20. package/dist/builtin-extensions/lunr-todos.js +15 -0
  21. package/dist/builtin-extensions/lunr-todos.js.map +1 -1
  22. package/dist/builtin-extensions/pi-intercom/index.d.ts.map +1 -1
  23. package/dist/builtin-extensions/pi-intercom/index.js +5 -0
  24. package/dist/builtin-extensions/pi-intercom/index.js.map +1 -1
  25. package/dist/builtin-extensions/pi-mcp-adapter/direct-tools.d.ts.map +1 -1
  26. package/dist/builtin-extensions/pi-mcp-adapter/direct-tools.js +1 -0
  27. package/dist/builtin-extensions/pi-mcp-adapter/direct-tools.js.map +1 -1
  28. package/dist/builtin-extensions/pi-mcp-adapter/index.d.ts.map +1 -1
  29. package/dist/builtin-extensions/pi-mcp-adapter/index.js +1 -1
  30. package/dist/builtin-extensions/pi-mcp-adapter/index.js.map +1 -1
  31. package/dist/builtin-extensions/pi-subagents/src/extension/control-notices.d.ts +1 -1
  32. package/dist/builtin-extensions/pi-subagents/src/extension/control-notices.d.ts.map +1 -1
  33. package/dist/builtin-extensions/pi-subagents/src/extension/control-notices.js +5 -1
  34. package/dist/builtin-extensions/pi-subagents/src/extension/control-notices.js.map +1 -1
  35. package/dist/builtin-extensions/pi-subagents/src/extension/index.d.ts +2 -2
  36. package/dist/builtin-extensions/pi-subagents/src/extension/index.d.ts.map +1 -1
  37. package/dist/builtin-extensions/pi-subagents/src/extension/index.js +18 -5
  38. package/dist/builtin-extensions/pi-subagents/src/extension/index.js.map +1 -1
  39. package/dist/builtin-extensions/pi-subagents/src/extension/schemas.d.ts.map +1 -1
  40. package/dist/builtin-extensions/pi-subagents/src/extension/schemas.js +1 -1
  41. package/dist/builtin-extensions/pi-subagents/src/extension/schemas.js.map +1 -1
  42. package/dist/builtin-extensions/pi-subagents/src/extension/tool-description.d.ts +4 -3
  43. package/dist/builtin-extensions/pi-subagents/src/extension/tool-description.d.ts.map +1 -1
  44. package/dist/builtin-extensions/pi-subagents/src/extension/tool-description.js +8 -3
  45. package/dist/builtin-extensions/pi-subagents/src/extension/tool-description.js.map +1 -1
  46. package/dist/builtin-extensions/pi-subagents/src/intercom/communication.d.ts +17 -0
  47. package/dist/builtin-extensions/pi-subagents/src/intercom/communication.d.ts.map +1 -0
  48. package/dist/builtin-extensions/pi-subagents/src/intercom/communication.js +45 -0
  49. package/dist/builtin-extensions/pi-subagents/src/intercom/communication.js.map +1 -0
  50. package/dist/builtin-extensions/pi-subagents/src/intercom/intercom-bridge.d.ts +2 -0
  51. package/dist/builtin-extensions/pi-subagents/src/intercom/intercom-bridge.d.ts.map +1 -1
  52. package/dist/builtin-extensions/pi-subagents/src/intercom/intercom-bridge.js +10 -14
  53. package/dist/builtin-extensions/pi-subagents/src/intercom/intercom-bridge.js.map +1 -1
  54. package/dist/builtin-extensions/pi-subagents/src/intercom/native-supervisor-channel.d.ts +4 -1
  55. package/dist/builtin-extensions/pi-subagents/src/intercom/native-supervisor-channel.d.ts.map +1 -1
  56. package/dist/builtin-extensions/pi-subagents/src/intercom/native-supervisor-channel.js +167 -53
  57. package/dist/builtin-extensions/pi-subagents/src/intercom/native-supervisor-channel.js.map +1 -1
  58. package/dist/builtin-extensions/pi-subagents/src/intercom/supervisor-ask.d.ts.map +1 -1
  59. package/dist/builtin-extensions/pi-subagents/src/intercom/supervisor-ask.js +5 -0
  60. package/dist/builtin-extensions/pi-subagents/src/intercom/supervisor-ask.js.map +1 -1
  61. package/dist/builtin-extensions/pi-subagents/src/intercom/supervisor-questions.d.ts +2 -0
  62. package/dist/builtin-extensions/pi-subagents/src/intercom/supervisor-questions.d.ts.map +1 -1
  63. package/dist/builtin-extensions/pi-subagents/src/intercom/supervisor-questions.js +3 -2
  64. package/dist/builtin-extensions/pi-subagents/src/intercom/supervisor-questions.js.map +1 -1
  65. package/dist/builtin-extensions/pi-subagents/src/runs/background/async-execution.d.ts +2 -0
  66. package/dist/builtin-extensions/pi-subagents/src/runs/background/async-execution.d.ts.map +1 -1
  67. package/dist/builtin-extensions/pi-subagents/src/runs/background/async-execution.js +4 -0
  68. package/dist/builtin-extensions/pi-subagents/src/runs/background/async-execution.js.map +1 -1
  69. package/dist/builtin-extensions/pi-subagents/src/runs/background/auto-drain.d.ts +1 -0
  70. package/dist/builtin-extensions/pi-subagents/src/runs/background/auto-drain.d.ts.map +1 -1
  71. package/dist/builtin-extensions/pi-subagents/src/runs/background/auto-drain.js +2 -1
  72. package/dist/builtin-extensions/pi-subagents/src/runs/background/auto-drain.js.map +1 -1
  73. package/dist/builtin-extensions/pi-subagents/src/runs/background/subagent-runner.d.ts.map +1 -1
  74. package/dist/builtin-extensions/pi-subagents/src/runs/background/subagent-runner.js +1 -1
  75. package/dist/builtin-extensions/pi-subagents/src/runs/background/subagent-runner.js.map +1 -1
  76. package/dist/builtin-extensions/pi-subagents/src/runs/background/subagent-wait.d.ts +3 -0
  77. package/dist/builtin-extensions/pi-subagents/src/runs/background/subagent-wait.d.ts.map +1 -1
  78. package/dist/builtin-extensions/pi-subagents/src/runs/background/subagent-wait.js +11 -0
  79. package/dist/builtin-extensions/pi-subagents/src/runs/background/subagent-wait.js.map +1 -1
  80. package/dist/builtin-extensions/pi-subagents/src/runs/background/wait-tool.d.ts.map +1 -1
  81. package/dist/builtin-extensions/pi-subagents/src/runs/background/wait-tool.js +41 -3
  82. package/dist/builtin-extensions/pi-subagents/src/runs/background/wait-tool.js.map +1 -1
  83. package/dist/builtin-extensions/pi-subagents/src/runs/foreground/chain-execution.d.ts +1 -0
  84. package/dist/builtin-extensions/pi-subagents/src/runs/foreground/chain-execution.d.ts.map +1 -1
  85. package/dist/builtin-extensions/pi-subagents/src/runs/foreground/chain-execution.js +5 -1
  86. package/dist/builtin-extensions/pi-subagents/src/runs/foreground/chain-execution.js.map +1 -1
  87. package/dist/builtin-extensions/pi-subagents/src/runs/foreground/execution.d.ts.map +1 -1
  88. package/dist/builtin-extensions/pi-subagents/src/runs/foreground/execution.js +3 -2
  89. package/dist/builtin-extensions/pi-subagents/src/runs/foreground/execution.js.map +1 -1
  90. package/dist/builtin-extensions/pi-subagents/src/runs/foreground/subagent-executor.d.ts.map +1 -1
  91. package/dist/builtin-extensions/pi-subagents/src/runs/foreground/subagent-executor.js +23 -0
  92. package/dist/builtin-extensions/pi-subagents/src/runs/foreground/subagent-executor.js.map +1 -1
  93. package/dist/builtin-extensions/pi-subagents/src/runs/shared/child-tools.d.ts +1 -1
  94. package/dist/builtin-extensions/pi-subagents/src/runs/shared/child-tools.d.ts.map +1 -1
  95. package/dist/builtin-extensions/pi-subagents/src/runs/shared/child-tools.js +1 -1
  96. package/dist/builtin-extensions/pi-subagents/src/runs/shared/child-tools.js.map +1 -1
  97. package/dist/builtin-extensions/pi-subagents/src/runs/shared/pi-args.d.ts +2 -0
  98. package/dist/builtin-extensions/pi-subagents/src/runs/shared/pi-args.d.ts.map +1 -1
  99. package/dist/builtin-extensions/pi-subagents/src/runs/shared/pi-args.js +20 -15
  100. package/dist/builtin-extensions/pi-subagents/src/runs/shared/pi-args.js.map +1 -1
  101. package/dist/builtin-extensions/pi-subagents/src/runs/shared/subagent-control.d.ts +1 -0
  102. package/dist/builtin-extensions/pi-subagents/src/runs/shared/subagent-control.d.ts.map +1 -1
  103. package/dist/builtin-extensions/pi-subagents/src/runs/shared/subagent-control.js +3 -0
  104. package/dist/builtin-extensions/pi-subagents/src/runs/shared/subagent-control.js.map +1 -1
  105. package/dist/builtin-extensions/pi-subagents/src/runs/shared/subagent-prompt-runtime.d.ts.map +1 -1
  106. package/dist/builtin-extensions/pi-subagents/src/runs/shared/subagent-prompt-runtime.js +4 -2
  107. package/dist/builtin-extensions/pi-subagents/src/runs/shared/subagent-prompt-runtime.js.map +1 -1
  108. package/dist/builtin-extensions/pi-subagents/src/shared/child-spec.d.ts.map +1 -1
  109. package/dist/builtin-extensions/pi-subagents/src/shared/child-spec.js +2 -2
  110. package/dist/builtin-extensions/pi-subagents/src/shared/child-spec.js.map +1 -1
  111. package/dist/builtin-extensions/pi-subagents/src/shared/types.d.ts +2 -0
  112. package/dist/builtin-extensions/pi-subagents/src/shared/types.d.ts.map +1 -1
  113. package/dist/builtin-extensions/pi-subagents/src/shared/types.js.map +1 -1
  114. package/dist/builtin-extensions/pi-subagents/src/tui/communication.d.ts +18 -0
  115. package/dist/builtin-extensions/pi-subagents/src/tui/communication.d.ts.map +1 -0
  116. package/dist/builtin-extensions/pi-subagents/src/tui/communication.js +48 -0
  117. package/dist/builtin-extensions/pi-subagents/src/tui/communication.js.map +1 -0
  118. package/dist/builtin-extensions/pi-web-access/index.d.ts.map +1 -1
  119. package/dist/builtin-extensions/pi-web-access/index.js +11 -7
  120. package/dist/builtin-extensions/pi-web-access/index.js.map +1 -1
  121. package/dist/cli/args.d.ts.map +1 -1
  122. package/dist/cli/args.js +2 -1
  123. package/dist/cli/args.js.map +1 -1
  124. package/dist/cli/install-cli.d.ts.map +1 -1
  125. package/dist/cli/install-cli.js +15 -45
  126. package/dist/cli/install-cli.js.map +1 -1
  127. package/dist/core/agent-session-runtime.d.ts +9 -0
  128. package/dist/core/agent-session-runtime.d.ts.map +1 -1
  129. package/dist/core/agent-session-runtime.js +126 -29
  130. package/dist/core/agent-session-runtime.js.map +1 -1
  131. package/dist/core/agent-session.d.ts +23 -1
  132. package/dist/core/agent-session.d.ts.map +1 -1
  133. package/dist/core/agent-session.js +255 -109
  134. package/dist/core/agent-session.js.map +1 -1
  135. package/dist/core/browser/network.d.ts +9 -0
  136. package/dist/core/browser/network.d.ts.map +1 -0
  137. package/dist/core/browser/network.js +146 -0
  138. package/dist/core/browser/network.js.map +1 -0
  139. package/dist/core/browser/runtime.d.ts +24 -0
  140. package/dist/core/browser/runtime.d.ts.map +1 -0
  141. package/dist/core/browser/runtime.js +289 -0
  142. package/dist/core/browser/runtime.js.map +1 -0
  143. package/dist/core/browser/schema.d.ts +16 -0
  144. package/dist/core/browser/schema.d.ts.map +1 -0
  145. package/dist/core/browser/schema.js +36 -0
  146. package/dist/core/browser/schema.js.map +1 -0
  147. package/dist/core/browser/settings.d.ts +8 -0
  148. package/dist/core/browser/settings.d.ts.map +1 -0
  149. package/dist/core/browser/settings.js +30 -0
  150. package/dist/core/browser/settings.js.map +1 -0
  151. package/dist/core/browser/setup.d.ts +2 -0
  152. package/dist/core/browser/setup.d.ts.map +1 -0
  153. package/dist/core/browser/setup.js +16 -0
  154. package/dist/core/browser/setup.js.map +1 -0
  155. package/dist/core/catalog-cache-scope.d.ts.map +1 -1
  156. package/dist/core/catalog-cache-scope.js +3 -1
  157. package/dist/core/catalog-cache-scope.js.map +1 -1
  158. package/dist/core/computer-use/image.d.ts +1 -0
  159. package/dist/core/computer-use/image.d.ts.map +1 -1
  160. package/dist/core/computer-use/image.js +8 -0
  161. package/dist/core/computer-use/image.js.map +1 -1
  162. package/dist/core/computer-use/schemas.d.ts +1 -0
  163. package/dist/core/computer-use/schemas.d.ts.map +1 -1
  164. package/dist/core/computer-use/schemas.js +2 -1
  165. package/dist/core/computer-use/schemas.js.map +1 -1
  166. package/dist/core/computer-use/workflow.d.ts.map +1 -1
  167. package/dist/core/computer-use/workflow.js +89 -23
  168. package/dist/core/computer-use/workflow.js.map +1 -1
  169. package/dist/core/customize.d.ts.map +1 -1
  170. package/dist/core/customize.js +15 -14
  171. package/dist/core/customize.js.map +1 -1
  172. package/dist/core/export-html/index.d.ts.map +1 -1
  173. package/dist/core/export-html/index.js +1 -1
  174. package/dist/core/export-html/index.js.map +1 -1
  175. package/dist/core/extensions/loader.d.ts.map +1 -1
  176. package/dist/core/extensions/loader.js +4 -0
  177. package/dist/core/extensions/loader.js.map +1 -1
  178. package/dist/core/extensions/runner.d.ts +1 -0
  179. package/dist/core/extensions/runner.d.ts.map +1 -1
  180. package/dist/core/extensions/runner.js +1 -1
  181. package/dist/core/extensions/runner.js.map +1 -1
  182. package/dist/core/extensions/types.d.ts +1 -1
  183. package/dist/core/extensions/types.d.ts.map +1 -1
  184. package/dist/core/extensions/types.js.map +1 -1
  185. package/dist/core/install-features.d.ts.map +1 -1
  186. package/dist/core/install-features.js +10 -8
  187. package/dist/core/install-features.js.map +1 -1
  188. package/dist/core/memory-cap.d.ts.map +1 -1
  189. package/dist/core/memory-cap.js +5 -3
  190. package/dist/core/memory-cap.js.map +1 -1
  191. package/dist/core/model-runtime.d.ts.map +1 -1
  192. package/dist/core/model-runtime.js +3 -2
  193. package/dist/core/model-runtime.js.map +1 -1
  194. package/dist/core/model-tiers.d.ts.map +1 -1
  195. package/dist/core/model-tiers.js +9 -6
  196. package/dist/core/model-tiers.js.map +1 -1
  197. package/dist/core/permissions.d.ts +16 -23
  198. package/dist/core/permissions.d.ts.map +1 -1
  199. package/dist/core/permissions.js +71 -142
  200. package/dist/core/permissions.js.map +1 -1
  201. package/dist/core/plan-mode.d.ts +10 -12
  202. package/dist/core/plan-mode.d.ts.map +1 -1
  203. package/dist/core/plan-mode.js +20 -19
  204. package/dist/core/plan-mode.js.map +1 -1
  205. package/dist/core/process-registry.d.ts.map +1 -1
  206. package/dist/core/process-registry.js +6 -4
  207. package/dist/core/process-registry.js.map +1 -1
  208. package/dist/core/runtime-bridges.d.ts.map +1 -1
  209. package/dist/core/runtime-bridges.js +2 -0
  210. package/dist/core/runtime-bridges.js.map +1 -1
  211. package/dist/core/runtime-scope.d.ts +11 -0
  212. package/dist/core/runtime-scope.d.ts.map +1 -0
  213. package/dist/core/runtime-scope.js +3 -0
  214. package/dist/core/runtime-scope.js.map +1 -0
  215. package/dist/core/sdk.d.ts.map +1 -1
  216. package/dist/core/sdk.js +26 -6
  217. package/dist/core/sdk.js.map +1 -1
  218. package/dist/core/session-handoff.d.ts +35 -0
  219. package/dist/core/session-handoff.d.ts.map +1 -0
  220. package/dist/core/session-handoff.js +214 -0
  221. package/dist/core/session-handoff.js.map +1 -0
  222. package/dist/core/session-manager.d.ts +20 -0
  223. package/dist/core/session-manager.d.ts.map +1 -1
  224. package/dist/core/session-manager.js +191 -22
  225. package/dist/core/session-manager.js.map +1 -1
  226. package/dist/core/session-ownership.d.ts +28 -0
  227. package/dist/core/session-ownership.d.ts.map +1 -0
  228. package/dist/core/session-ownership.js +138 -0
  229. package/dist/core/session-ownership.js.map +1 -0
  230. package/dist/core/session-retention.d.ts.map +1 -1
  231. package/dist/core/session-retention.js +11 -2
  232. package/dist/core/session-retention.js.map +1 -1
  233. package/dist/core/settings-manager.d.ts +20 -1
  234. package/dist/core/settings-manager.d.ts.map +1 -1
  235. package/dist/core/settings-manager.js +67 -1
  236. package/dist/core/settings-manager.js.map +1 -1
  237. package/dist/core/slash-commands.d.ts.map +1 -1
  238. package/dist/core/slash-commands.js +6 -4
  239. package/dist/core/slash-commands.js.map +1 -1
  240. package/dist/core/subagent-permission-inherit.d.ts +6 -10
  241. package/dist/core/subagent-permission-inherit.d.ts.map +1 -1
  242. package/dist/core/subagent-permission-inherit.js +14 -14
  243. package/dist/core/subagent-permission-inherit.js.map +1 -1
  244. package/dist/core/subagent-wait-interruption.d.ts +11 -0
  245. package/dist/core/subagent-wait-interruption.d.ts.map +1 -0
  246. package/dist/core/subagent-wait-interruption.js +19 -0
  247. package/dist/core/subagent-wait-interruption.js.map +1 -0
  248. package/dist/core/system-prompt.d.ts +2 -0
  249. package/dist/core/system-prompt.d.ts.map +1 -1
  250. package/dist/core/system-prompt.js +14 -4
  251. package/dist/core/system-prompt.js.map +1 -1
  252. package/dist/core/todo-settings.d.ts +5 -0
  253. package/dist/core/todo-settings.d.ts.map +1 -0
  254. package/dist/core/todo-settings.js +7 -0
  255. package/dist/core/todo-settings.js.map +1 -0
  256. package/dist/core/tools/bash.d.ts.map +1 -1
  257. package/dist/core/tools/bash.js +4 -4
  258. package/dist/core/tools/bash.js.map +1 -1
  259. package/dist/core/tools/edit.d.ts.map +1 -1
  260. package/dist/core/tools/edit.js +5 -3
  261. package/dist/core/tools/edit.js.map +1 -1
  262. package/dist/core/tools/find.d.ts.map +1 -1
  263. package/dist/core/tools/find.js +4 -4
  264. package/dist/core/tools/find.js.map +1 -1
  265. package/dist/core/tools/grep.d.ts.map +1 -1
  266. package/dist/core/tools/grep.js +4 -4
  267. package/dist/core/tools/grep.js.map +1 -1
  268. package/dist/core/tools/ls.d.ts.map +1 -1
  269. package/dist/core/tools/ls.js +4 -4
  270. package/dist/core/tools/ls.js.map +1 -1
  271. package/dist/core/tools/read.d.ts.map +1 -1
  272. package/dist/core/tools/read.js +4 -4
  273. package/dist/core/tools/read.js.map +1 -1
  274. package/dist/core/tools/render-utils.d.ts +14 -5
  275. package/dist/core/tools/render-utils.d.ts.map +1 -1
  276. package/dist/core/tools/render-utils.js +34 -7
  277. package/dist/core/tools/render-utils.js.map +1 -1
  278. package/dist/core/tools/write.d.ts.map +1 -1
  279. package/dist/core/tools/write.js +4 -4
  280. package/dist/core/tools/write.js.map +1 -1
  281. package/dist/core/usage-service.d.ts.map +1 -1
  282. package/dist/core/usage-service.js +5 -3
  283. package/dist/core/usage-service.js.map +1 -1
  284. package/dist/gateway/adapters/discord.d.ts +12 -1
  285. package/dist/gateway/adapters/discord.d.ts.map +1 -1
  286. package/dist/gateway/adapters/discord.js +114 -24
  287. package/dist/gateway/adapters/discord.js.map +1 -1
  288. package/dist/gateway/adapters/telegram.d.ts +4 -2
  289. package/dist/gateway/adapters/telegram.d.ts.map +1 -1
  290. package/dist/gateway/adapters/telegram.js +41 -11
  291. package/dist/gateway/adapters/telegram.js.map +1 -1
  292. package/dist/gateway/agent-bridge.d.ts +18 -4
  293. package/dist/gateway/agent-bridge.d.ts.map +1 -1
  294. package/dist/gateway/agent-bridge.js +305 -73
  295. package/dist/gateway/agent-bridge.js.map +1 -1
  296. package/dist/gateway/approval.d.ts +3 -6
  297. package/dist/gateway/approval.d.ts.map +1 -1
  298. package/dist/gateway/approval.js +62 -24
  299. package/dist/gateway/approval.js.map +1 -1
  300. package/dist/gateway/authz.d.ts +2 -0
  301. package/dist/gateway/authz.d.ts.map +1 -1
  302. package/dist/gateway/authz.js +13 -0
  303. package/dist/gateway/authz.js.map +1 -1
  304. package/dist/gateway/buttons.d.ts +3 -1
  305. package/dist/gateway/buttons.d.ts.map +1 -1
  306. package/dist/gateway/buttons.js +45 -20
  307. package/dist/gateway/buttons.js.map +1 -1
  308. package/dist/gateway/command.d.ts.map +1 -1
  309. package/dist/gateway/command.js +49 -4
  310. package/dist/gateway/command.js.map +1 -1
  311. package/dist/gateway/commands.d.ts +2 -0
  312. package/dist/gateway/commands.d.ts.map +1 -1
  313. package/dist/gateway/commands.js +52 -16
  314. package/dist/gateway/commands.js.map +1 -1
  315. package/dist/gateway/config.d.ts +6 -0
  316. package/dist/gateway/config.d.ts.map +1 -1
  317. package/dist/gateway/config.js +7 -0
  318. package/dist/gateway/config.js.map +1 -1
  319. package/dist/gateway/conversations.d.ts +14 -0
  320. package/dist/gateway/conversations.d.ts.map +1 -0
  321. package/dist/gateway/conversations.js +30 -0
  322. package/dist/gateway/conversations.js.map +1 -0
  323. package/dist/gateway/cron.d.ts +1 -1
  324. package/dist/gateway/cron.d.ts.map +1 -1
  325. package/dist/gateway/cron.js +2 -2
  326. package/dist/gateway/cron.js.map +1 -1
  327. package/dist/gateway/download.d.ts +2 -0
  328. package/dist/gateway/download.d.ts.map +1 -0
  329. package/dist/gateway/download.js +36 -0
  330. package/dist/gateway/download.js.map +1 -0
  331. package/dist/gateway/index.d.ts.map +1 -1
  332. package/dist/gateway/index.js +106 -47
  333. package/dist/gateway/index.js.map +1 -1
  334. package/dist/gateway/mobile-commands.d.ts +24 -0
  335. package/dist/gateway/mobile-commands.d.ts.map +1 -0
  336. package/dist/gateway/mobile-commands.js +423 -0
  337. package/dist/gateway/mobile-commands.js.map +1 -0
  338. package/dist/gateway/presenter.d.ts +27 -0
  339. package/dist/gateway/presenter.d.ts.map +1 -0
  340. package/dist/gateway/presenter.js +308 -0
  341. package/dist/gateway/presenter.js.map +1 -0
  342. package/dist/gateway/router.d.ts +6 -5
  343. package/dist/gateway/router.d.ts.map +1 -1
  344. package/dist/gateway/router.js +126 -43
  345. package/dist/gateway/router.js.map +1 -1
  346. package/dist/gateway/service.d.ts +46 -0
  347. package/dist/gateway/service.d.ts.map +1 -0
  348. package/dist/gateway/service.js +404 -0
  349. package/dist/gateway/service.js.map +1 -0
  350. package/dist/gateway/setup.d.ts +9 -0
  351. package/dist/gateway/setup.d.ts.map +1 -0
  352. package/dist/gateway/setup.js +202 -0
  353. package/dist/gateway/setup.js.map +1 -0
  354. package/dist/gateway/stream.d.ts +6 -5
  355. package/dist/gateway/stream.d.ts.map +1 -1
  356. package/dist/gateway/stream.js +24 -11
  357. package/dist/gateway/stream.js.map +1 -1
  358. package/dist/gateway/types.d.ts +4 -2
  359. package/dist/gateway/types.d.ts.map +1 -1
  360. package/dist/gateway/types.js.map +1 -1
  361. package/dist/index.d.ts +2 -0
  362. package/dist/index.d.ts.map +1 -1
  363. package/dist/index.js +2 -0
  364. package/dist/index.js.map +1 -1
  365. package/dist/main.d.ts.map +1 -1
  366. package/dist/main.js +3 -3
  367. package/dist/main.js.map +1 -1
  368. package/dist/modes/interactive/components/assistant-message.d.ts +19 -2
  369. package/dist/modes/interactive/components/assistant-message.d.ts.map +1 -1
  370. package/dist/modes/interactive/components/assistant-message.js +78 -17
  371. package/dist/modes/interactive/components/assistant-message.js.map +1 -1
  372. package/dist/modes/interactive/components/copyable-text.d.ts +27 -0
  373. package/dist/modes/interactive/components/copyable-text.d.ts.map +1 -0
  374. package/dist/modes/interactive/components/copyable-text.js +156 -0
  375. package/dist/modes/interactive/components/copyable-text.js.map +1 -0
  376. package/dist/modes/interactive/components/custom-entry.d.ts +1 -0
  377. package/dist/modes/interactive/components/custom-entry.d.ts.map +1 -1
  378. package/dist/modes/interactive/components/custom-entry.js +8 -0
  379. package/dist/modes/interactive/components/custom-entry.js.map +1 -1
  380. package/dist/modes/interactive/components/custom-message.d.ts +1 -0
  381. package/dist/modes/interactive/components/custom-message.d.ts.map +1 -1
  382. package/dist/modes/interactive/components/custom-message.js +8 -0
  383. package/dist/modes/interactive/components/custom-message.js.map +1 -1
  384. package/dist/modes/interactive/components/session-selector.d.ts.map +1 -1
  385. package/dist/modes/interactive/components/session-selector.js +16 -0
  386. package/dist/modes/interactive/components/session-selector.js.map +1 -1
  387. package/dist/modes/interactive/components/settings-selector.d.ts +12 -1
  388. package/dist/modes/interactive/components/settings-selector.d.ts.map +1 -1
  389. package/dist/modes/interactive/components/settings-selector.js +74 -3
  390. package/dist/modes/interactive/components/settings-selector.js.map +1 -1
  391. package/dist/modes/interactive/components/thinking-tail.d.ts +9 -2
  392. package/dist/modes/interactive/components/thinking-tail.d.ts.map +1 -1
  393. package/dist/modes/interactive/components/thinking-tail.js +43 -1
  394. package/dist/modes/interactive/components/thinking-tail.js.map +1 -1
  395. package/dist/modes/interactive/components/tool-execution.d.ts +5 -3
  396. package/dist/modes/interactive/components/tool-execution.d.ts.map +1 -1
  397. package/dist/modes/interactive/components/tool-execution.js +44 -45
  398. package/dist/modes/interactive/components/tool-execution.js.map +1 -1
  399. package/dist/modes/interactive/interactive-mode.d.ts +10 -2
  400. package/dist/modes/interactive/interactive-mode.d.ts.map +1 -1
  401. package/dist/modes/interactive/interactive-mode.js +342 -133
  402. package/dist/modes/interactive/interactive-mode.js.map +1 -1
  403. package/dist/modes/interactive/theme/theme.d.ts +1 -0
  404. package/dist/modes/interactive/theme/theme.d.ts.map +1 -1
  405. package/dist/modes/interactive/theme/theme.js +23 -0
  406. package/dist/modes/interactive/theme/theme.js.map +1 -1
  407. package/dist/node-runtime/agent-session-services-MQUPZSIN.js +51 -0
  408. package/dist/node-runtime/{builtin-extensions-SRCYQPZ6.js → builtin-extensions-4GNDR6U3.js} +7 -6
  409. package/dist/node-runtime/{chunk-LTXUQJI4.js → chunk-24C5IAJ4.js} +1 -6
  410. package/dist/node-runtime/chunk-2BLXLDJR.js +144 -0
  411. package/dist/node-runtime/{chunk-RQ5DNUNG.js → chunk-2CMV4L24.js} +21 -124
  412. package/dist/node-runtime/{chunk-LTYWTR3V.js → chunk-2MI5OPMN.js} +17 -2
  413. package/dist/node-runtime/{chunk-W3CVH5RX.js → chunk-2TKODGBZ.js} +11 -6
  414. package/dist/node-runtime/{chunk-GT5F3OKM.js → chunk-33SIKK3Y.js} +38 -164
  415. package/dist/node-runtime/{chunk-GZQHMEWL.js → chunk-3DKIWPKN.js} +19 -4
  416. package/dist/node-runtime/{chunk-3GHXVUAK.js → chunk-3VEY2IYY.js} +1 -1
  417. package/dist/node-runtime/chunk-4ER2ZV4Z.js +537 -0
  418. package/dist/node-runtime/chunk-4EULYYR4.js +62 -0
  419. package/dist/node-runtime/{chunk-LOYUC2ID.js → chunk-4SBQAI4T.js} +27 -27
  420. package/dist/node-runtime/{chunk-CZUBYPFP.js → chunk-53ARRUHA.js} +674 -257
  421. package/dist/node-runtime/{chunk-VTPM5V35.js → chunk-5Q4A37RB.js} +10 -4
  422. package/dist/node-runtime/{chunk-SWSN6HAB.js → chunk-5UZOPGE3.js} +1 -1
  423. package/dist/node-runtime/{chunk-XSRCAQK2.js → chunk-5Z5PCXGY.js} +263 -222
  424. package/dist/node-runtime/chunk-7JIYPIQU.js +356 -0
  425. package/dist/node-runtime/{chunk-D466UAID.js → chunk-AJ6R5VTV.js} +60 -88
  426. package/dist/node-runtime/chunk-ATIF3RX5.js +352 -0
  427. package/dist/node-runtime/{chunk-A3KMVBZV.js → chunk-BBUVIEZB.js} +1 -10
  428. package/dist/node-runtime/chunk-CCCN2UCX.js +14 -0
  429. package/dist/node-runtime/chunk-CJS4KQFI.js +3412 -0
  430. package/dist/node-runtime/chunk-DO6PALE2.js +205 -0
  431. package/dist/node-runtime/{chunk-N3PNL74S.js → chunk-DRJI7ZSC.js} +63 -163
  432. package/dist/node-runtime/{chunk-VTGEKB7R.js → chunk-E75WFZ33.js} +1 -1
  433. package/dist/node-runtime/{chunk-MJQDX3BA.js → chunk-EBB4BJW4.js} +3 -3
  434. package/dist/node-runtime/{chunk-VQ4UBWSA.js → chunk-EOEAQIJV.js} +63 -6
  435. package/dist/node-runtime/chunk-EOPL2HMM.js +117 -0
  436. package/dist/node-runtime/chunk-H4K3JDRB.js +47 -0
  437. package/dist/node-runtime/{chunk-HRS4HMDX.js → chunk-HT2XEJNP.js} +19 -3
  438. package/dist/node-runtime/chunk-IMLCWLPI.js +9 -0
  439. package/dist/node-runtime/{chunk-BJ6H7DPI.js → chunk-JJWZB7S3.js} +62 -50
  440. package/dist/node-runtime/chunk-KFFOQR4G.js +672 -0
  441. package/dist/node-runtime/chunk-L5LZUGT7.js +40 -0
  442. package/dist/node-runtime/chunk-LV6CEFW2.js +97 -0
  443. package/dist/node-runtime/{chunk-VSELYKWU.js → chunk-LWYIVUGV.js} +2 -1
  444. package/dist/node-runtime/{chunk-BYQ2MOFI.js → chunk-MFV2LOOX.js} +184 -2192
  445. package/dist/node-runtime/{chunk-5SQDLSZJ.js → chunk-MNRO3UCV.js} +2 -2
  446. package/dist/node-runtime/{chunk-JHYKXIMM.js → chunk-MPKSOJBT.js} +1 -1
  447. package/dist/node-runtime/{chunk-C4O2RSQQ.js → chunk-N4TUWAGA.js} +1 -1
  448. package/dist/node-runtime/{chunk-7NBZ5P7I.js → chunk-NAY6UUQZ.js} +1 -1
  449. package/dist/node-runtime/chunk-NKH2QBKF.js +773 -0
  450. package/dist/node-runtime/chunk-O2AT4MEU.js +124 -0
  451. package/dist/node-runtime/chunk-OAR4TYZE.js +146 -0
  452. package/dist/node-runtime/{chunk-DDGMHUOW.js → chunk-OGJN3OZV.js} +2 -1
  453. package/dist/node-runtime/{chunk-MX3GJNXJ.js → chunk-PLGA743X.js} +23 -0
  454. package/dist/node-runtime/chunk-Q3FEOEDA.js +1364 -0
  455. package/dist/node-runtime/{chunk-H2BI7G7T.js → chunk-QFADHUQV.js} +2 -1
  456. package/dist/node-runtime/{chunk-W3SILANP.js → chunk-RBZQU6TJ.js} +12 -9
  457. package/dist/node-runtime/{chunk-ZVSORYRM.js → chunk-RVOQBXTA.js} +10 -6
  458. package/dist/node-runtime/{chunk-HXJS2PJM.js → chunk-RW4PYFNE.js} +14 -94
  459. package/dist/node-runtime/chunk-TP7K7YWS.js +2830 -0
  460. package/dist/node-runtime/{chunk-ZOIIMEN6.js → chunk-TVLBDVTR.js} +32 -21
  461. package/dist/node-runtime/chunk-UAEOTO52.js +119 -0
  462. package/dist/node-runtime/{chunk-MGWCVY6Y.js → chunk-UDKX3PFN.js} +3 -3
  463. package/dist/node-runtime/{chunk-AY6CAJSL.js → chunk-UJOCPOMX.js} +6 -3
  464. package/dist/node-runtime/{chunk-WJVFOIB5.js → chunk-UQUCFAJ3.js} +1 -1
  465. package/dist/node-runtime/chunk-US544NN6.js +13 -0
  466. package/dist/node-runtime/{chunk-7AFOFSDY.js → chunk-V3HK3FE7.js} +1 -1
  467. package/dist/node-runtime/{chunk-6UB6NKA3.js → chunk-VIVYOI7C.js} +130 -27
  468. package/dist/node-runtime/{chunk-MW2XJZIK.js → chunk-XHIRAZ26.js} +1 -1
  469. package/dist/node-runtime/chunk-YPHAIRZT.js +10 -0
  470. package/dist/node-runtime/{chunk-3RCWXWAY.js → chunk-YRUY57IN.js} +1 -1
  471. package/dist/node-runtime/cli-runtime.js +2 -2
  472. package/dist/node-runtime/command-PYBNGLPP.js +45 -0
  473. package/dist/node-runtime/{commands-BZGSLIP7.js → commands-EMBQQVVT.js} +13 -13
  474. package/dist/node-runtime/commands-Y2OUC2T7.js +37 -0
  475. package/dist/node-runtime/config-7DYMNJUO.js +20 -0
  476. package/dist/node-runtime/{customize-LF5VST47.js → customize-VFJV3U6A.js} +2 -1
  477. package/dist/node-runtime/{direct-tool-executor-BSZDHIYR.js → direct-tool-executor-4D7UXYU4.js} +10 -10
  478. package/dist/node-runtime/{export-html-E4DT6ZJQ.js → export-html-ETFOKW3M.js} +4 -3
  479. package/dist/node-runtime/{extension-input-RV5N6APL.js → extension-input-7QODTFAS.js} +4 -4
  480. package/dist/node-runtime/{extension-selector-CPD5LWDD.js → extension-selector-T65JEDJ5.js} +4 -4
  481. package/dist/node-runtime/{extract-XLQSJN4V.js → extract-EQJE7FZZ.js} +2 -2
  482. package/dist/node-runtime/gateway-QENRQA5X.js +1476 -0
  483. package/dist/node-runtime/{gemini-search-U7SUMPQA.js → gemini-search-35OCRFLN.js} +1 -1
  484. package/dist/node-runtime/{gemini-url-context-PXWCBQHK.js → gemini-url-context-UQY3PHHW.js} +2 -2
  485. package/dist/node-runtime/index.js +113 -73
  486. package/dist/node-runtime/{init-DVJUAOUO.js → init-P5AUV77I.js} +5 -5
  487. package/dist/node-runtime/{install-cli-TH7IJJQQ.js → install-cli-KHAXYBOO.js} +21 -82
  488. package/dist/node-runtime/interactive-mode-IN77GQGX.js +74 -0
  489. package/dist/node-runtime/{interactive-view-N6F4KUIT.js → interactive-view-OMWDFGUQ.js} +10 -10
  490. package/dist/node-runtime/lunr-browser-VVPRWC3F.js +174 -0
  491. package/dist/node-runtime/{lunr-computer-use-TJNDAMWM.js → lunr-computer-use-IAUNXSXH.js} +11 -8
  492. package/dist/node-runtime/{lunr-cron-J64I72C6.js → lunr-cron-P6ZJGVEF.js} +21 -7
  493. package/dist/node-runtime/main.js +47 -34
  494. package/dist/node-runtime/{mcp-auth-flow-YL6RWPYG.js → mcp-auth-flow-QVLFVLEO.js} +2 -2
  495. package/dist/node-runtime/{memory-cap-3S4XRLNP.js → memory-cap-EL3KL4JJ.js} +2 -1
  496. package/dist/node-runtime/mobile-commands-WKFSFACZ.js +33 -0
  497. package/dist/node-runtime/model-runtime-YXGJS5OJ.js +16 -0
  498. package/dist/node-runtime/{model-tiers-NJLHUEGK.js → model-tiers-OU3U5CZG.js} +2 -1
  499. package/dist/node-runtime/{package-manager-cli-VMYX4Y2S.js → package-manager-cli-J337RKTI.js} +25 -17
  500. package/dist/node-runtime/{pi-intercom-NV2LW6X7.js → pi-intercom-QM53RLTS.js} +6 -1
  501. package/dist/node-runtime/{pi-mcp-adapter-JLB5YL2F.js → pi-mcp-adapter-3PHF4KZ4.js} +8 -7
  502. package/dist/node-runtime/{pi-subagents-WEHV3W7H.js → pi-subagents-RCHPB6UK.js} +255 -88
  503. package/dist/node-runtime/{pi-web-access-FN5YC5T6.js → pi-web-access-PNG35XW7.js} +15 -15
  504. package/dist/node-runtime/process-registry-PVJ44F7H.js +31 -0
  505. package/dist/node-runtime/{proxy-modes-OR7ISBXK.js → proxy-modes-5FAPSZEZ.js} +11 -11
  506. package/dist/node-runtime/rpc-entry.js +47 -34
  507. package/dist/node-runtime/{rpc-mode-SJNSOA4G.js → rpc-mode-SH7VB4RH.js} +2 -2
  508. package/dist/node-runtime/runtime-4VA6JKNF.js +373 -0
  509. package/dist/node-runtime/runtime-bridges-3CQHWVVY.js +21 -0
  510. package/dist/node-runtime/service-HGGU3STY.js +36 -0
  511. package/dist/node-runtime/session-handoff-IAFIK7QP.js +33 -0
  512. package/dist/node-runtime/{session-manager-QEMZBMTM.js → session-manager-TCEFDKBL.js} +2 -1
  513. package/dist/node-runtime/{session-selector-URVJLOTK.js → session-selector-HG5J4BDZ.js} +5 -4
  514. package/dist/node-runtime/{settings-manager-3CCU326G.js → settings-manager-HIBIUNBK.js} +12 -5
  515. package/dist/node-runtime/setup-JBKOLJ6F.js +18 -0
  516. package/dist/node-runtime/setup-YU5LKRL3.js +215 -0
  517. package/dist/node-runtime/{subagent-executor-CXKXQDHH.js → subagent-executor-2BH76MMS.js} +64 -23
  518. package/dist/node-runtime/theme-WTJWZSGD.js +68 -0
  519. package/dist/node-runtime/trust-manager-6ZQANSBX.js +17 -0
  520. package/dist/node-runtime/{update-cli-NM7B4CKL.js → update-cli-TVTPVUNM.js} +6 -3
  521. package/dist/node-runtime/usage-service-LFB2SWYV.js +37 -0
  522. package/dist/node-runtime/{video-extract-OYT5WKS5.js → video-extract-OOZHR7SU.js} +2 -2
  523. package/dist/node-runtime/{workflow-C26QCUTW.js → workflow-TVJNKKQP.js} +80 -39
  524. package/dist/node-runtime/{youtube-extract-TQYKGFGS.js → youtube-extract-FNPAUNHU.js} +6 -6
  525. package/dist/startup/interactive-view.d.ts.map +1 -1
  526. package/dist/startup/interactive-view.js +5 -1
  527. package/dist/startup/interactive-view.js.map +1 -1
  528. package/dist/utils/image-resize-core.d.ts +2 -0
  529. package/dist/utils/image-resize-core.d.ts.map +1 -1
  530. package/dist/utils/image-resize-core.js +10 -0
  531. package/dist/utils/image-resize-core.js.map +1 -1
  532. package/docs/browser.md +86 -0
  533. package/docs/computer-use.md +134 -48
  534. package/docs/extensions.md +2 -0
  535. package/docs/features.md +108 -27
  536. package/docs/index.md +1 -1
  537. package/docs/interactive-startup.md +2 -1
  538. package/docs/keybindings.md +1 -1
  539. package/docs/providers.md +6 -2
  540. package/docs/quickstart.md +2 -2
  541. package/docs/sessions.md +10 -0
  542. package/docs/settings.md +3 -1
  543. package/docs/tui.md +2 -0
  544. package/docs/usage.md +20 -4
  545. package/examples/extensions/custom-provider-anthropic/package-lock.json +2 -2
  546. package/examples/extensions/custom-provider-anthropic/package.json +1 -1
  547. package/examples/extensions/custom-provider-gitlab-duo/package.json +1 -1
  548. package/examples/extensions/gondolin/package-lock.json +2 -2
  549. package/examples/extensions/gondolin/package.json +1 -1
  550. package/examples/extensions/plan-mode/README.md +1 -1
  551. package/examples/extensions/sandbox/package-lock.json +2 -2
  552. package/examples/extensions/sandbox/package.json +1 -1
  553. package/examples/extensions/with-deps/package-lock.json +2 -2
  554. package/examples/extensions/with-deps/package.json +1 -1
  555. package/install-lock/package-lock.json +39 -25
  556. package/install-lock/package.json +2 -2
  557. package/npm-shrinkwrap.json +36 -22
  558. package/package.json +10 -7
  559. package/scripts/install-browser.mjs +20 -0
  560. package/dist/node-runtime/agent-session-services-QANFGM2V.js +0 -40
  561. package/dist/node-runtime/chunk-LISUTZS3.js +0 -19
  562. package/dist/node-runtime/chunk-VGYZ3APQ.js +0 -59
  563. package/dist/node-runtime/chunk-XAUQOKYK.js +0 -6011
  564. package/dist/node-runtime/command-ZURZJDXF.js +0 -13
  565. package/dist/node-runtime/gateway-FWHRIBK5.js +0 -2139
  566. package/dist/node-runtime/interactive-mode-BBASNWHN.js +0 -62
  567. package/dist/node-runtime/runtime-bridges-2VQTLPOZ.js +0 -12
  568. package/dist/node-runtime/{chunk-U6C7VTR5.js → chunk-7IQGBKBJ.js} +3 -3
  569. package/dist/node-runtime/{mcp-panel-IIGMXQGP.js → mcp-panel-KTTFXJZ4.js} +3 -3
  570. package/dist/node-runtime/{src-BPQFJR76.js → src-IVPNZ2BX.js} +9 -9
@@ -3,10 +3,16 @@ import { randomUUID } from "node:crypto";
3
3
  import * as fs from "node:fs";
4
4
  import * as path from "node:path";
5
5
  import { Type } from "typebox";
6
+ import { subagentCommunicationEnabled } from "../../../../core/settings-manager.js";
7
+ import { getAgentDir } from "../shared/utils.js";
6
8
  import { SUBAGENT_CHILD_AGENT_ENV, SUBAGENT_CHILD_INDEX_ENV, SUBAGENT_ORCHESTRATOR_SESSION_ID_ENV, SUBAGENT_ORCHESTRATOR_TARGET_ENV, SUBAGENT_RUN_ID_ENV, SUBAGENT_SUPERVISOR_CHANNEL_DIR_ENV, SUBAGENT_SUPERVISOR_SESSION_ID_ENV, } from "../runs/shared/pi-args.js";
7
- import { INTERCOM_DETACH_REQUEST_EVENT, POLL_INTERVAL_MS, SUBAGENT_CONTROL_EVENT } from "../shared/types.js";
9
+ import { ASYNC_DIR, INTERCOM_DETACH_REQUEST_EVENT, POLL_INTERVAL_MS, SUBAGENT_CONTROL_EVENT } from "../shared/types.js";
8
10
  import { writeAtomicJson } from "../shared/atomic-json.js";
9
11
  import { askRunningAsyncChild, reconcileAsyncQuestion } from "./supervisor-ask.js";
12
+ import { CHILD_DESCRIPTION_ENV, SUPERVISOR_PROGRESS_TYPE, SUPERVISOR_PROTOCOL_VERSION, SUPERVISOR_REQUEST_TYPE, legacySupervisorBody, readCommunication, resolveCommunicationPeer, supervisorProtocolAvailable } from "./communication.js";
13
+ import { renderCommunicationCall, renderCommunicationCard, renderCommunicationResult } from "../tui/communication.js";
14
+ import { stopRequestPath } from "../runs/background/control-channel.js";
15
+ import { readStatus } from "../shared/utils.js";
10
16
  import { answerSupervisorQuestion, cancelPendingSupervisorQuestionsForOwner, cancelSupervisorQuestion, claimQuestionNotification, formatSupervisorQuestionAnswer, hasOutstandingQuestionForChild, isQuestionWaitActive, listSupervisorChannelDirs, listSupervisorQuestions, markSupervisorQuestionDelivered, outstandingQuestionsForChild, pendingSupervisorQuestionsForDelivery, QUESTIONS_DIR, readSupervisorQuestion, resolveSupervisorChannelDir as resolveQuestionChannelDir, SUBAGENT_QUESTION_EVENT, SUBAGENT_SUPERVISOR_ANSWER_TYPE, SUPERVISOR_CHANNEL_ROOT, supervisorQuestionIsTerminal, supervisorQuestionPublicState, } from "./supervisor-questions.js";
11
17
  const REQUESTS_DIR = "requests";
12
18
  const REPLIES_DIR = "replies";
@@ -18,7 +24,7 @@ const CHANNEL_POLL_MS = Math.min(POLL_INTERVAL_MS, 500);
18
24
  const STALE_EMPTY_CHANNEL_AGE_MS = 60 * 1000;
19
25
  const STALE_EMPTY_CHANNEL_CLEANUP_INTERVAL_MS = 60 * 1000;
20
26
  const PARENT_ASK_DESCRIPTION = [
21
- "Ask a specific running async child, or reply to a child supervisor request.",
27
+ "Ask a specific running async child, or reply to a child supervisor request. Asking is unavailable when Subagent communication is off in /settings; final results still arrive normally.",
22
28
  "Ask only when the child owns missing context, the answer changes a concrete next decision, and waiting risks a block or rework.",
23
29
  "Use available results first, batch related questions, and keep working while awaiting the answer. Do not use ask for status checks, polling, duplicate queries, or step-by-step supervision. Follow up only when the answer leaves the original decision unresolved.",
24
30
  "Returns a question id immediately. The child's explicit answer is delivered separately from the final run result.",
@@ -27,12 +33,14 @@ const PARENT_ASK_DESCRIPTION = [
27
33
  'Reply: { action: "reply", replyTo: "<requestId>", message: "..." }',
28
34
  ].join(" ");
29
35
  const CHILD_CONTACT_DESCRIPTION = [
30
- "Contact the parent/supervisor session for a blocking decision, structured interview, progress update, or reply to a parent question.",
36
+ "Contact the supervisor for decisions outside your assigned authority, safety concerns, or blockers. Make reversible implementation choices within your scope yourself.",
37
+ "need_decision/interview_request wait for a reply: state the blocked decision, evidence, and recommended choice. Consolidate related questions; continue independent work before opening a blocking request.",
38
+ "Return one self-contained final report with outcomes, verification, blockers, and artifact paths; the runtime delivers it. Routine work already appears in activity indicators.",
31
39
  "For parent questions use action='reply' with replyTo set to the question id. Answer from current findings and uncertainty; do not start extra investigation just to reply. Continue the assigned task after replying.",
32
40
  "Do not open a blocking need_decision while a parent question is already outstanding for this child.",
33
41
  ].join(" ");
34
42
  const ContactSupervisorParamsSchema = Type.Object({
35
- reason: Type.Optional(Type.String({ enum: ["need_decision", "interview_request", "progress_update"] })),
43
+ reason: Type.Optional(Type.String({ enum: ["need_decision", "interview_request", "progress_update", "handoff"] })),
36
44
  message: Type.Optional(Type.String()),
37
45
  interview: Type.Optional(Type.Unsafe({ type: "object", additionalProperties: true })),
38
46
  action: Type.Optional(Type.String({ enum: ["reply"] })),
@@ -87,6 +95,7 @@ function readChildMetadata() {
87
95
  orchestratorSessionId,
88
96
  supervisorSessionId: readTextEnv(SUBAGENT_SUPERVISOR_SESSION_ID_ENV),
89
97
  childTarget: readTextEnv("PI_SUBAGENT_INTERCOM_SESSION_NAME"),
98
+ description: readTextEnv(CHILD_DESCRIPTION_ENV),
90
99
  };
91
100
  }
92
101
  function readChildQuestionOwner(metadata = readChildMetadata()) {
@@ -124,10 +133,13 @@ function answerParentQuestion(params) {
124
133
  replyTo: answered.id,
125
134
  state: supervisorQuestionPublicState(answered),
126
135
  answered: true,
136
+ communication: { direction: "to", peer: "Supervisor", kind: "reply", message },
127
137
  },
128
138
  };
129
139
  }
130
140
  function reasonHeading(reason) {
141
+ if (reason === "handoff")
142
+ return "Subagent dependency handoff.";
131
143
  if (reason === "interview_request")
132
144
  return "Subagent requests a structured supervisor interview.";
133
145
  if (reason === "progress_update")
@@ -153,6 +165,39 @@ function formatChildMessage(input) {
153
165
  }
154
166
  return lines.join("\n").trimEnd();
155
167
  }
168
+ function communicationKind(reason) {
169
+ return reason === "progress_update" ? "progress" : reason === "handoff" ? "handoff" : reason === "interview_request" ? "interview" : "request";
170
+ }
171
+ function communicationBody(message, interview, protocolVersion) {
172
+ const body = protocolVersion === SUPERVISOR_PROTOCOL_VERSION ? message : legacySupervisorBody(message);
173
+ return interview !== undefined && protocolVersion === SUPERVISOR_PROTOCOL_VERSION ? `${body}\n\n${JSON.stringify(interview, null, 2)}` : body;
174
+ }
175
+ function requestCommunication(request, state) {
176
+ return {
177
+ direction: "from",
178
+ peer: resolveCommunicationPeer(state, request.runId, request.childIndex, request.agent, request.description),
179
+ message: communicationBody(request.message, request.interview, request.protocolVersion),
180
+ kind: communicationKind(request.reason),
181
+ };
182
+ }
183
+ export function registerSupervisorRenderers(pi, state) {
184
+ for (const customType of [SUPERVISOR_REQUEST_TYPE, SUBAGENT_SUPERVISOR_ANSWER_TYPE]) {
185
+ pi.registerMessageRenderer(customType, (message, options, theme) => {
186
+ const details = message.details;
187
+ const communication = readCommunication(details?.communication) ?? {
188
+ direction: "from",
189
+ peer: details?.runId ? resolveCommunicationPeer(state, details.runId, details.childIndex ?? 0, details.childId ?? details.agent) : "Subagent",
190
+ message: legacySupervisorBody(typeof message.content === "string" ? message.content : message.content.filter((part) => part.type === "text").map((part) => part.text).join("\n")),
191
+ kind: customType === SUBAGENT_SUPERVISOR_ANSWER_TYPE ? "answer" : communicationKind(details?.reason),
192
+ };
193
+ return renderCommunicationCard(communication, options.expanded, theme);
194
+ });
195
+ }
196
+ pi.registerEntryRenderer(SUPERVISOR_PROGRESS_TYPE, (entry, options, theme) => {
197
+ const communication = readCommunication(entry.data?.communication);
198
+ return communication ? renderCommunicationCard(communication, options.expanded, theme) : undefined;
199
+ });
200
+ }
156
201
  function parseStructuredReply(message) {
157
202
  const trimmed = message.trim();
158
203
  const fenced = trimmed.match(/^```(?:json)?\s*([\s\S]*?)\s*```$/i)?.[1]?.trim();
@@ -214,21 +259,29 @@ async function sendSupervisorRequest(params, signal) {
214
259
  throw new Error("Native supervisor channel is not available for this subagent.");
215
260
  if (!params.reason)
216
261
  throw new Error("reason is required for supervisor contact.");
217
- if (params.reason !== "progress_update" && hasOutstandingQuestionForChild(metadata.channelDir, metadata.childIndex, metadata.agent)) {
262
+ if (signal?.aborted)
263
+ throw new Error("Supervisor request cancelled.");
264
+ const protocolVersion = supervisorProtocolAvailable() ? SUPERVISOR_PROTOCOL_VERSION : undefined;
265
+ if (params.reason === "handoff" && !protocolVersion)
266
+ throw new Error("This supervisor uses the legacy protocol. Send actionable findings with progress_update instead.");
267
+ const expectsReply = params.reason === "need_decision" || params.reason === "interview_request";
268
+ if (expectsReply && hasOutstandingQuestionForChild(metadata.channelDir, metadata.childIndex, metadata.agent)) {
218
269
  throw new Error("A parent question is already outstanding for this child. Answer it with action='reply' before opening a blocking supervisor request.");
219
270
  }
220
- if (params.reason !== "progress_update" && !params.message?.trim() && params.reason !== "interview_request") {
221
- throw new Error("message is required for supervisor decisions.");
271
+ if (!params.message?.trim() && params.reason !== "interview_request") {
272
+ throw new Error("message is required for supervisor contact.");
222
273
  }
223
274
  ensureSupervisorChannelDir(metadata.channelDir);
224
275
  const requestId = randomUUID();
225
- const expectsReply = params.reason !== "progress_update";
226
276
  const createdAt = Date.now();
227
277
  const replyDeadline = createdAt + askTimeoutMs();
228
278
  const expiresAt = expectsReply ? replyDeadline : undefined;
229
- const message = formatChildMessage({ ...metadata, reason: params.reason, message: params.message, interview: params.interview });
279
+ const message = protocolVersion ? params.message?.trim() || "Structured supervisor input requested." : formatChildMessage({ ...metadata, reason: params.reason, message: params.message, interview: params.interview });
280
+ const communication = { direction: "to", peer: "Supervisor", kind: communicationKind(params.reason), message: communicationBody(message, params.interview, protocolVersion) };
230
281
  const request = {
231
282
  type: "subagent.supervisor.request",
283
+ ...(protocolVersion ? { protocolVersion } : {}),
284
+ ...(metadata.description ? { description: metadata.description } : {}),
232
285
  id: requestId,
233
286
  createdAt,
234
287
  ...(expiresAt !== undefined ? { expiresAt } : {}),
@@ -255,13 +308,13 @@ async function sendSupervisorRequest(params, signal) {
255
308
  }
256
309
  if (!expectsReply) {
257
310
  return {
258
- content: [{ type: "text", text: "Supervisor progress update queued." }],
259
- details: { delivered: true, requestId, reason: params.reason },
311
+ content: [{ type: "text", text: params.reason === "handoff" ? "Dependency handoff queued. Continue independent work." : protocolVersion ? "Progress recorded for the UI only; the supervisor model will not receive it." : "Supervisor progress update queued." }],
312
+ details: { queued: true, requestId, reason: params.reason, communication },
260
313
  };
261
314
  }
262
315
  try {
263
316
  const reply = await waitForReply(metadata.channelDir, requestId, replyDeadline, signal);
264
- const details = { requestId, reason: params.reason };
317
+ const details = { requestId, reason: params.reason, communication, response: reply.message };
265
318
  if (params.reason === "interview_request") {
266
319
  const structured = parseStructuredReply(reply.message);
267
320
  if (structured.error)
@@ -288,15 +341,23 @@ function hasTool(pi, name) {
288
341
  }
289
342
  }
290
343
  export function registerNativeSupervisorClient(pi, options = {}) {
291
- if (!readChildMetadata())
344
+ if (process.env.PI_SUBAGENT_COMMUNICATION_ENABLED === "0" || !readChildMetadata())
292
345
  return;
293
346
  const includeIntercomFallback = options.includeIntercomFallback !== false;
294
347
  if (!hasTool(pi, "contact_supervisor")) {
295
348
  const tool = {
296
349
  name: "contact_supervisor",
297
350
  label: "Contact Supervisor",
298
- description: CHILD_CONTACT_DESCRIPTION,
299
- parameters: ContactSupervisorParamsSchema,
351
+ description: `${CHILD_CONTACT_DESCRIPTION} ${supervisorProtocolAvailable()
352
+ ? "handoff delivers actionable dependency findings or corrections without waiting: state what changes and consolidate evidence or reference one artifact. progress_update is UI-only and never reaches the supervisor model."
353
+ : "This legacy supervisor delivers progress_update to its model. Reserve it for actionable dependency findings or corrections."}`,
354
+ parameters: supervisorProtocolAvailable() ? ContactSupervisorParamsSchema : Type.Object({ ...ContactSupervisorParamsSchema.properties, reason: Type.Optional(Type.String({ enum: ["need_decision", "interview_request", "progress_update"] })) }, { additionalProperties: false }),
355
+ renderCall(args, theme, context) {
356
+ return renderCommunicationCall("contact_supervisor", args, theme, context, { direction: "to", peer: "Supervisor", kind: args.action === "reply" ? "reply" : communicationKind(args.reason), message: communicationBody(args.message ?? "", args.interview, SUPERVISOR_PROTOCOL_VERSION) });
357
+ },
358
+ renderResult(result, options, theme, context) {
359
+ return renderCommunicationResult(result.content, result.details, options.expanded, context.isError, theme);
360
+ },
300
361
  execute(_id, params, signal) {
301
362
  return sendSupervisorRequest(params, signal);
302
363
  },
@@ -307,8 +368,14 @@ export function registerNativeSupervisorClient(pi, options = {}) {
307
368
  const tool = {
308
369
  name: "intercom",
309
370
  label: "Intercom",
310
- description: "Native supervisor-channel intercom fallback for subagents. Prefer contact_supervisor when available.",
371
+ description: "Supervisor-only fallback; sibling discovery and sibling messaging are unavailable. Use contact_supervisor for decisions, replies, and dependency handoffs. list reports no sibling sessions; ask blocks for a supervisor decision; send is progress only.",
311
372
  parameters: IntercomParamsSchema,
373
+ renderCall(args, theme, context) {
374
+ return renderCommunicationCall("intercom", args, theme, context, args.message ? { direction: "to", peer: "Supervisor", kind: args.action === "ask" ? "request" : "progress", message: args.message } : undefined);
375
+ },
376
+ renderResult(result, options, theme, context) {
377
+ return renderCommunicationResult(result.content, result.details, options.expanded, context.isError, theme);
378
+ },
312
379
  async execute(_id, params, signal) {
313
380
  const action = params.action;
314
381
  if (action === "status")
@@ -334,7 +401,15 @@ function parseRequestFile(file, channelDir) {
334
401
  return undefined;
335
402
  if (typeof parsed.id !== "string" || !parsed.id)
336
403
  return undefined;
337
- if (parsed.reason !== "need_decision" && parsed.reason !== "interview_request" && parsed.reason !== "progress_update")
404
+ if (parsed.reason !== "need_decision" && parsed.reason !== "interview_request" && parsed.reason !== "progress_update" && parsed.reason !== "handoff")
405
+ return undefined;
406
+ if (parsed.protocolVersion !== undefined && parsed.protocolVersion !== SUPERVISOR_PROTOCOL_VERSION)
407
+ return undefined;
408
+ if (parsed.protocolVersion === SUPERVISOR_PROTOCOL_VERSION && parsed.expectsReply !== (parsed.reason === "need_decision" || parsed.reason === "interview_request"))
409
+ return undefined;
410
+ if (parsed.reason === "handoff" && parsed.protocolVersion !== SUPERVISOR_PROTOCOL_VERSION)
411
+ return undefined;
412
+ if (parsed.description !== undefined && typeof parsed.description !== "string")
338
413
  return undefined;
339
414
  if (typeof parsed.message !== "string" || !parsed.message)
340
415
  return undefined;
@@ -516,21 +591,24 @@ function requestExpiresAt(request, now) {
516
591
  return expiresAt;
517
592
  return Number.isFinite(request.createdAt) ? request.createdAt + askTimeoutMs() : now;
518
593
  }
519
- function requestRunInactive(request, state) {
594
+ function requestRunState(request, state) {
520
595
  if (state.foregroundControls.has(request.runId))
521
- return false;
596
+ return "active";
522
597
  const foregroundRun = state.foregroundRuns?.get(request.runId);
523
598
  const foregroundChild = foregroundRun?.children.find((child) => child.index === request.childIndex && child.agent === request.agent)
524
599
  ?? foregroundRun?.children[request.childIndex];
525
600
  if (foregroundChild)
526
- return foregroundChild.status !== "detached";
527
- const asyncJob = state.asyncJobs.get(request.runId);
528
- if (!asyncJob)
529
- return false;
530
- if (asyncJob.status === "complete" || asyncJob.status === "failed" || asyncJob.status === "paused")
531
- return true;
532
- const stepStatus = asyncJob.steps?.[request.childIndex]?.status;
533
- return stepStatus === "complete" || stepStatus === "completed" || stepStatus === "failed" || stepStatus === "paused";
601
+ return foregroundChild.status === "stopped" ? "stopped" : foregroundChild.status === "detached" ? "active" : "inactive";
602
+ const job = state.asyncJobs.get(request.runId) ?? state.fleetJobs?.get(request.runId);
603
+ const asyncDir = job?.asyncDir ?? path.join(ASYNC_DIR, safeSegment(request.runId));
604
+ const status = readStatus(asyncDir);
605
+ const runStatus = status?.state ?? job?.status;
606
+ const stepStatus = (status?.steps ?? job?.steps)?.[request.childIndex]?.status;
607
+ if (fs.existsSync(stopRequestPath(asyncDir)) || runStatus === "stopped" || job?.status === "stopped" || status?.stopped || stepStatus === "stopped")
608
+ return "stopped";
609
+ if (["complete", "failed", "paused"].includes(runStatus ?? "") || ["complete", "completed", "failed", "paused"].includes(stepStatus ?? ""))
610
+ return "inactive";
611
+ return "active";
534
612
  }
535
613
  function requestLifecycle(request, state, ctx, now) {
536
614
  if (ctx && !requestMatchesContext(request, state, ctx))
@@ -541,7 +619,8 @@ function requestLifecycle(request, state, ctx, now) {
541
619
  return "resolved";
542
620
  if (request.expectsReply && now > requestExpiresAt(request, now))
543
621
  return "expired";
544
- if (request.expectsReply && requestRunInactive(request, state))
622
+ const runState = requestRunState(request, state);
623
+ if (runState === "stopped" || (request.expectsReply && runState === "inactive"))
545
624
  return "inactive";
546
625
  return "pending";
547
626
  }
@@ -563,8 +642,10 @@ function formatPendingLine(request) {
563
642
  const replyHint = request.expectsReply ? ` Reply: ${NATIVE_SUPERVISOR_TOOL_NAME}({ action: "reply", replyTo: "${request.id}", message: "..." })` : "";
564
643
  return `- ${request.id}: ${request.agent} [${request.runId}#${request.childIndex}] ${request.reason}.${replyHint}`;
565
644
  }
566
- function requestVisibleText(request) {
567
- const lines = [request.message];
645
+ function requestVisibleText(request, communication) {
646
+ const lines = [`From: ${communication.peer}`, "", communication.message];
647
+ if (request.reason === "interview_request")
648
+ lines.push("", "Reply with JSON matching the requested interview shape.");
568
649
  if (request.expectsReply) {
569
650
  lines.push("", `Reply with: ${NATIVE_SUPERVISOR_TOOL_NAME}({ action: "reply", replyTo: "${request.id}", message: "..." })`);
570
651
  }
@@ -622,6 +703,14 @@ function buildParentIntercomTool(pending, state, name = "intercom") {
622
703
  label: name === "intercom" ? "Intercom" : "Subagent Supervisor",
623
704
  description: PARENT_ASK_DESCRIPTION,
624
705
  parameters: ParentSupervisorParamsSchema,
706
+ renderCall(args, theme, context) {
707
+ const request = args.action === "reply" ? pending.get(args.replyTo) : undefined;
708
+ const peer = request ? requestCommunication(request, state).peer : args.id ? resolveCommunicationPeer(state, args.id, args.index ?? 0, args.childId) : "Subagent";
709
+ return renderCommunicationCall(name, args, theme, context, args.message ? { direction: "to", peer, message: args.message, kind: args.action === "ask" ? "question" : "reply" } : undefined);
710
+ },
711
+ renderResult(result, options, theme, context) {
712
+ return renderCommunicationResult(result.content, result.details, options.expanded, context.isError, theme);
713
+ },
625
714
  async execute(_id, params) {
626
715
  refreshPendingRequests(pending, state, state.lastUiContext ?? undefined);
627
716
  const input = params;
@@ -636,9 +725,12 @@ function buildParentIntercomTool(pending, state, name = "intercom") {
636
725
  const request = resolvePendingRequest(pending, input);
637
726
  writeReply(request, input.message ?? "");
638
727
  pending.delete(request.id);
639
- return { content: [{ type: "text", text: `Replied to supervisor request ${request.id}.` }], details: { replyTo: request.id, runId: request.runId, agent: request.agent } };
728
+ return { content: [{ type: "text", text: `Replied to ${requestCommunication(request, state).peer}.` }], details: { replyTo: request.id, runId: request.runId, agent: request.agent, communication: { ...requestCommunication(request, state), direction: "to", kind: "reply", message: input.message } } };
640
729
  }
641
730
  if (input.action === "ask") {
731
+ if (!subagentCommunicationEnabled(process.cwd(), getAgentDir())) {
732
+ return { content: [{ type: "text", text: "Subagent communication is off in /settings. Wait for the child to complete instead of asking it." }], isError: true, details: { disabled: true } };
733
+ }
642
734
  return askRunningAsyncChild({
643
735
  params: {
644
736
  id: input.id,
@@ -666,7 +758,7 @@ function questionMatchesParentContext(question, state, ctx) {
666
758
  return false;
667
759
  return true;
668
760
  }
669
- function notifyQuestionTerminal(pi, question, channelDir) {
761
+ function notifyQuestionTerminal(pi, question, channelDir, state) {
670
762
  if (!supervisorQuestionIsTerminal(question) || question.notifiedAt)
671
763
  return;
672
764
  pi.events?.emit(SUBAGENT_QUESTION_EVENT, {
@@ -678,22 +770,24 @@ function notifyQuestionTerminal(pi, question, channelDir) {
678
770
  return;
679
771
  if (!claimQuestionNotification(channelDir, question.id))
680
772
  return;
681
- const state = supervisorQuestionPublicState(question);
773
+ const outcome = supervisorQuestionPublicState(question);
774
+ const communication = { direction: "from", peer: question.childDescription ?? resolveCommunicationPeer(state, question.runId, question.childIndex, question.childId), message: question.answer ?? question.cancelReason ?? outcome, kind: "answer" };
682
775
  pi.sendMessage({
683
776
  customType: SUBAGENT_SUPERVISOR_ANSWER_TYPE,
684
777
  content: formatSupervisorQuestionAnswer(question),
685
- display: state === "answered",
778
+ display: outcome === "answered",
686
779
  details: {
687
780
  questionId: question.id,
688
- state,
781
+ state: outcome,
782
+ communication,
689
783
  runId: question.runId,
690
784
  childIndex: question.childIndex,
691
785
  childId: question.childId,
692
786
  reason: question.reason,
693
- answered: state === "answered",
787
+ answered: outcome === "answered",
694
788
  delivered: Boolean(question.deliveredAt),
695
789
  },
696
- }, { triggerTurn: state === "answered" });
790
+ }, { triggerTurn: outcome === "answered" });
697
791
  }
698
792
  function pollSupervisorQuestions(pi, state, ctx) {
699
793
  for (const channelDir of listSupervisorChannelDirs()) {
@@ -701,13 +795,14 @@ function pollSupervisorQuestions(pi, state, ctx) {
701
795
  if (!questionMatchesParentContext(question, state, ctx))
702
796
  continue;
703
797
  const current = reconcileAsyncQuestion(channelDir, question, state);
704
- notifyQuestionTerminal(pi, current, channelDir);
798
+ notifyQuestionTerminal(pi, current, channelDir, state);
705
799
  }
706
800
  }
707
801
  }
708
802
  export function createNativeSupervisorChannel(pi, state) {
709
803
  const pending = new Map();
710
804
  const seenFiles = new Set();
805
+ const deliveredRequests = new Set();
711
806
  let poller;
712
807
  let lastStaleCleanupAt = 0;
713
808
  const registerParentTools = () => {
@@ -766,25 +861,37 @@ export function createNativeSupervisorChannel(pi, state) {
766
861
  cleanupRequestLifecycle(request, lifecycle);
767
862
  continue;
768
863
  }
769
- seenFiles.add(file);
770
864
  if (request.expectsReply)
771
865
  pending.set(request.id, request);
866
+ if (deliveredRequests.has(request.id)) {
867
+ seenFiles.add(file);
868
+ continue;
869
+ }
870
+ const communication = requestCommunication(request, state);
871
+ const details = {
872
+ id: request.id,
873
+ reason: request.reason,
874
+ expectsReply: request.expectsReply,
875
+ runId: request.runId,
876
+ agent: request.agent,
877
+ childIndex: request.childIndex,
878
+ communication,
879
+ };
880
+ if (request.reason === "progress_update" && request.protocolVersion === SUPERVISOR_PROTOCOL_VERSION) {
881
+ pi.appendEntry(SUPERVISOR_PROGRESS_TYPE, details);
882
+ }
772
883
  else {
773
- removeRequestFile(request.requestFile);
884
+ pi.sendMessage({
885
+ customType: SUPERVISOR_REQUEST_TYPE,
886
+ content: requestVisibleText(request, communication),
887
+ display: true,
888
+ details,
889
+ }, { triggerTurn: request.expectsReply || request.reason === "handoff" });
774
890
  }
775
- pi.sendMessage({
776
- customType: "subagent_supervisor_request",
777
- content: requestVisibleText(request),
778
- display: true,
779
- details: {
780
- id: request.id,
781
- reason: request.reason,
782
- expectsReply: request.expectsReply,
783
- runId: request.runId,
784
- agent: request.agent,
785
- childIndex: request.childIndex,
786
- },
787
- });
891
+ deliveredRequests.add(request.id);
892
+ seenFiles.add(file);
893
+ if (!request.expectsReply)
894
+ removeRequestFile(request.requestFile);
788
895
  if (request.expectsReply) {
789
896
  const job = state.asyncJobs.get(request.runId);
790
897
  if (job)
@@ -811,6 +918,12 @@ export function createNativeSupervisorChannel(pi, state) {
811
918
  if (poller)
812
919
  return;
813
920
  registerParentTools();
921
+ for (const entry of state.lastUiContext?.sessionManager.getBranch?.() ?? []) {
922
+ const data = entry.type === "custom_message" && entry.customType === SUPERVISOR_REQUEST_TYPE ? entry.details
923
+ : entry.type === "custom" && entry.customType === SUPERVISOR_PROGRESS_TYPE ? entry.data : undefined;
924
+ if (data && typeof data === "object" && "id" in data && typeof data.id === "string")
925
+ deliveredRequests.add(data.id);
926
+ }
814
927
  poll();
815
928
  poller = setInterval(poll, CHANNEL_POLL_MS);
816
929
  poller.unref?.();
@@ -822,6 +935,7 @@ export function createNativeSupervisorChannel(pi, state) {
822
935
  poller = undefined;
823
936
  pending.clear();
824
937
  seenFiles.clear();
938
+ deliveredRequests.clear();
825
939
  },
826
940
  pending,
827
941
  cancelOwnedQuestions,