@songsid/agend 2.3.4-beta.7 → 2.3.5-alpha.3

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 (457) hide show
  1. package/README.md +2 -0
  2. package/README.zh-TW.md +2 -0
  3. package/THIRD_PARTY_NOTICES.md +53 -0
  4. package/dist/agent-endpoint.d.ts +5 -1
  5. package/dist/agent-endpoint.js +12 -2
  6. package/dist/agent-endpoint.js.map +1 -1
  7. package/dist/auth-api.d.ts +21 -0
  8. package/dist/auth-api.js +89 -2
  9. package/dist/auth-api.js.map +1 -1
  10. package/dist/authority/web-authority.d.ts +12 -2
  11. package/dist/authority/web-authority.js +25 -4
  12. package/dist/authority/web-authority.js.map +1 -1
  13. package/dist/backend/claude-code.d.ts +15 -12
  14. package/dist/backend/claude-code.js +152 -133
  15. package/dist/backend/claude-code.js.map +1 -1
  16. package/dist/backend/codex-package.d.ts +5 -2
  17. package/dist/backend/codex-package.js +1 -5
  18. package/dist/backend/codex-package.js.map +1 -1
  19. package/dist/backend/codex.d.ts +136 -113
  20. package/dist/backend/codex.js +1281 -1219
  21. package/dist/backend/codex.js.map +1 -1
  22. package/dist/backend/grok-model-cache.d.ts +7 -0
  23. package/dist/backend/grok-model-cache.js +65 -0
  24. package/dist/backend/grok-model-cache.js.map +1 -0
  25. package/dist/backend/grok.d.ts +2 -0
  26. package/dist/backend/grok.js +22 -0
  27. package/dist/backend/grok.js.map +1 -1
  28. package/dist/backend/native-pane.d.ts +9 -0
  29. package/dist/backend/native-pane.js +59 -0
  30. package/dist/backend/native-pane.js.map +1 -0
  31. package/dist/backend/types.d.ts +7 -0
  32. package/dist/backend/types.js.map +1 -1
  33. package/dist/channel/ipc-bridge.d.ts +2 -0
  34. package/dist/channel/mcp-tools.js +1 -1
  35. package/dist/channel/mcp-tools.js.map +1 -1
  36. package/dist/cli.js +3 -0
  37. package/dist/cli.js.map +1 -1
  38. package/dist/config-validator.js +71 -1
  39. package/dist/config-validator.js.map +1 -1
  40. package/dist/config.js +16 -0
  41. package/dist/config.js.map +1 -1
  42. package/dist/daemon.d.ts +67 -5
  43. package/dist/daemon.js +823 -266
  44. package/dist/daemon.js.map +1 -1
  45. package/dist/delivery-consumed-watch.d.ts +15 -3
  46. package/dist/delivery-consumed-watch.js +23 -1
  47. package/dist/delivery-consumed-watch.js.map +1 -1
  48. package/dist/delivery-outbox.d.ts +5 -0
  49. package/dist/delivery-outbox.js +32 -4
  50. package/dist/delivery-outbox.js.map +1 -1
  51. package/dist/delivery-reconciliation.d.ts +2 -35
  52. package/dist/delivery-reconciliation.js +2 -156
  53. package/dist/delivery-reconciliation.js.map +1 -1
  54. package/dist/fleet-context.d.ts +2 -2
  55. package/dist/fleet-level-config.d.ts +1 -1
  56. package/dist/fleet-level-config.js +2 -0
  57. package/dist/fleet-level-config.js.map +1 -1
  58. package/dist/fleet-manager.d.ts +238 -3
  59. package/dist/fleet-manager.js +1826 -104
  60. package/dist/fleet-manager.js.map +1 -1
  61. package/dist/fleet-windows-runtime.d.ts +92 -0
  62. package/dist/fleet-windows-runtime.js +380 -0
  63. package/dist/fleet-windows-runtime.js.map +1 -0
  64. package/dist/general-binding.d.ts +85 -0
  65. package/dist/general-binding.js +298 -0
  66. package/dist/general-binding.js.map +1 -0
  67. package/dist/general-host-owner.d.ts +8 -0
  68. package/dist/general-host-owner.js +26 -0
  69. package/dist/general-host-owner.js.map +1 -0
  70. package/dist/general-instance.d.ts +7 -0
  71. package/dist/general-instance.js +20 -3
  72. package/dist/general-instance.js.map +1 -1
  73. package/dist/general-role.d.ts +5 -0
  74. package/dist/general-role.js +26 -0
  75. package/dist/general-role.js.map +1 -0
  76. package/dist/instance-config-impact.js +4 -0
  77. package/dist/instance-config-impact.js.map +1 -1
  78. package/dist/instance-lifecycle.d.ts +21 -3
  79. package/dist/instance-lifecycle.js +378 -162
  80. package/dist/instance-lifecycle.js.map +1 -1
  81. package/dist/instructions.d.ts +2 -0
  82. package/dist/instructions.js +6 -0
  83. package/dist/instructions.js.map +1 -1
  84. package/dist/local-pane-endpoint.d.ts +46 -0
  85. package/dist/local-pane-endpoint.js +189 -0
  86. package/dist/local-pane-endpoint.js.map +1 -0
  87. package/dist/local-pane-launcher.d.ts +2 -0
  88. package/dist/local-pane-launcher.js +38 -0
  89. package/dist/local-pane-launcher.js.map +1 -0
  90. package/dist/local-pane-stage.ps1 +101 -0
  91. package/dist/locale.js +85 -0
  92. package/dist/locale.js.map +1 -1
  93. package/dist/model-catalog-defaults.d.ts +14 -0
  94. package/dist/model-catalog-defaults.js +20 -0
  95. package/dist/model-catalog-defaults.js.map +1 -0
  96. package/dist/native-agent-admission.d.ts +7 -0
  97. package/dist/native-agent-admission.js +26 -0
  98. package/dist/native-agent-admission.js.map +1 -0
  99. package/dist/native-daemon-client.d.ts +13 -0
  100. package/dist/native-daemon-client.js +28 -0
  101. package/dist/native-daemon-client.js.map +1 -0
  102. package/dist/native-instance-api.d.ts +14 -0
  103. package/dist/native-instance-api.js +205 -0
  104. package/dist/native-instance-api.js.map +1 -0
  105. package/dist/native-instance-input.d.ts +84 -0
  106. package/dist/native-instance-input.js +54 -0
  107. package/dist/native-instance-input.js.map +1 -0
  108. package/dist/native-instance-registry.d.ts +32 -0
  109. package/dist/native-instance-registry.js +105 -0
  110. package/dist/native-instance-registry.js.map +1 -0
  111. package/dist/native-mcp.d.ts +40 -0
  112. package/dist/native-mcp.js +278 -0
  113. package/dist/native-mcp.js.map +1 -0
  114. package/dist/native-model-catalog.d.ts +5 -0
  115. package/dist/native-model-catalog.js +76 -0
  116. package/dist/native-model-catalog.js.map +1 -0
  117. package/dist/native-pane-crash-budget.d.ts +20 -0
  118. package/dist/native-pane-crash-budget.js +60 -0
  119. package/dist/native-pane-crash-budget.js.map +1 -0
  120. package/dist/native-pane-create.d.ts +26 -0
  121. package/dist/native-pane-create.js +53 -0
  122. package/dist/native-pane-create.js.map +1 -0
  123. package/dist/native-pane-lifecycle.d.ts +65 -0
  124. package/dist/native-pane-lifecycle.js +230 -0
  125. package/dist/native-pane-lifecycle.js.map +1 -0
  126. package/dist/native-pane-manager.d.ts +59 -0
  127. package/dist/native-pane-manager.js +584 -0
  128. package/dist/native-pane-manager.js.map +1 -0
  129. package/dist/native-pane-output-log.d.ts +15 -0
  130. package/dist/native-pane-output-log.js +108 -0
  131. package/dist/native-pane-output-log.js.map +1 -0
  132. package/dist/native-pane-reconciliation.d.ts +4 -0
  133. package/dist/native-pane-reconciliation.js +40 -0
  134. package/dist/native-pane-reconciliation.js.map +1 -0
  135. package/dist/native-pane-recovery.d.ts +12 -0
  136. package/dist/native-pane-recovery.js +10 -0
  137. package/dist/native-pane-recovery.js.map +1 -0
  138. package/dist/native-pane-tools.d.ts +2 -0
  139. package/dist/native-pane-tools.js +14 -0
  140. package/dist/native-pane-tools.js.map +1 -0
  141. package/dist/needs-you-hub.d.ts +2 -0
  142. package/dist/needs-you-hub.js +2 -1
  143. package/dist/needs-you-hub.js.map +1 -1
  144. package/dist/needs-you.d.ts +19 -1
  145. package/dist/needs-you.js +12 -2
  146. package/dist/needs-you.js.map +1 -1
  147. package/dist/outbound-handlers.d.ts +16 -2
  148. package/dist/outbound-handlers.js +67 -3
  149. package/dist/outbound-handlers.js.map +1 -1
  150. package/dist/outbound-schemas.d.ts +38 -0
  151. package/dist/outbound-schemas.js +12 -0
  152. package/dist/outbound-schemas.js.map +1 -1
  153. package/dist/pane-port.d.ts +118 -0
  154. package/dist/pane-port.js +2 -0
  155. package/dist/pane-port.js.map +1 -0
  156. package/dist/public-web-gateway.js +9 -0
  157. package/dist/public-web-gateway.js.map +1 -1
  158. package/dist/public-web-link.d.ts +5 -0
  159. package/dist/public-web-link.js +4 -0
  160. package/dist/public-web-link.js.map +1 -1
  161. package/dist/quickstart-api.js +9 -5
  162. package/dist/quickstart-api.js.map +1 -1
  163. package/dist/quickstart.d.ts +1 -0
  164. package/dist/quickstart.js +4 -1
  165. package/dist/quickstart.js.map +1 -1
  166. package/dist/runtime-api.d.ts +8 -0
  167. package/dist/runtime-api.js +96 -0
  168. package/dist/runtime-api.js.map +1 -0
  169. package/dist/runtime-assets/@xterm/addon-serialize/LICENSE +21 -0
  170. package/dist/runtime-assets/@xterm/addon-serialize/lib/addon-serialize.js +2 -0
  171. package/dist/runtime-assets/@xterm/addon-serialize/lib/addon-serialize.mjs +19 -0
  172. package/dist/runtime-assets/@xterm/addon-serialize/package.json +29 -0
  173. package/dist/runtime-assets/@xterm/headless/LICENSE +21 -0
  174. package/dist/runtime-assets/@xterm/headless/lib-headless/xterm-headless.js +2 -0
  175. package/dist/runtime-assets/@xterm/headless/lib-headless/xterm-headless.mjs +46 -0
  176. package/dist/runtime-assets/@xterm/headless/package.json +29 -0
  177. package/dist/runtime-assets/node-pty/CONPTY-LICENSE +21 -0
  178. package/dist/runtime-assets/node-pty/CONPTY-NOTICE.md +503 -0
  179. package/dist/runtime-assets/node-pty/LICENSE +69 -0
  180. package/dist/runtime-assets/node-pty/lib/conpty_console_list_agent.js +16 -0
  181. package/dist/runtime-assets/node-pty/lib/eventEmitter2.js +47 -0
  182. package/dist/runtime-assets/node-pty/lib/index.js +52 -0
  183. package/dist/runtime-assets/node-pty/lib/interfaces.js +7 -0
  184. package/dist/runtime-assets/node-pty/lib/shared/conout.js +11 -0
  185. package/dist/runtime-assets/node-pty/lib/terminal.js +190 -0
  186. package/dist/runtime-assets/node-pty/lib/types.js +7 -0
  187. package/dist/runtime-assets/node-pty/lib/unixTerminal.js +346 -0
  188. package/dist/runtime-assets/node-pty/lib/utils.js +39 -0
  189. package/dist/runtime-assets/node-pty/lib/windowsConoutConnection.js +125 -0
  190. package/dist/runtime-assets/node-pty/lib/windowsPtyAgent.js +320 -0
  191. package/dist/runtime-assets/node-pty/lib/windowsTerminal.js +199 -0
  192. package/dist/runtime-assets/node-pty/lib/worker/conoutSocketWorker.js +22 -0
  193. package/dist/runtime-assets/node-pty/package.json +64 -0
  194. package/dist/runtime-assets/node-pty/prebuilds/win32-arm64/conpty/OpenConsole.exe +0 -0
  195. package/dist/runtime-assets/node-pty/prebuilds/win32-arm64/conpty/conpty.dll +0 -0
  196. package/dist/runtime-assets/node-pty/prebuilds/win32-arm64/conpty.node +0 -0
  197. package/dist/runtime-assets/node-pty/prebuilds/win32-arm64/conpty_console_list.node +0 -0
  198. package/dist/runtime-assets/node-pty/prebuilds/win32-x64/conpty/OpenConsole.exe +0 -0
  199. package/dist/runtime-assets/node-pty/prebuilds/win32-x64/conpty/conpty.dll +0 -0
  200. package/dist/runtime-assets/node-pty/prebuilds/win32-x64/conpty.node +0 -0
  201. package/dist/runtime-assets/node-pty/prebuilds/win32-x64/conpty_console_list.node +0 -0
  202. package/dist/runtime-bundle.d.ts +17 -0
  203. package/dist/runtime-bundle.js +150 -0
  204. package/dist/runtime-bundle.js.map +1 -0
  205. package/dist/runtime-cli.d.ts +2 -0
  206. package/dist/runtime-cli.js +117 -0
  207. package/dist/runtime-cli.js.map +1 -0
  208. package/dist/runtime-client-store.d.ts +49 -0
  209. package/dist/runtime-client-store.js +292 -0
  210. package/dist/runtime-client-store.js.map +1 -0
  211. package/dist/runtime-client.d.ts +100 -0
  212. package/dist/runtime-client.js +700 -0
  213. package/dist/runtime-client.js.map +1 -0
  214. package/dist/runtime-coordinator.d.ts +82 -0
  215. package/dist/runtime-coordinator.js +864 -0
  216. package/dist/runtime-coordinator.js.map +1 -0
  217. package/dist/runtime-general-protocol.d.ts +22 -0
  218. package/dist/runtime-general-protocol.js +57 -0
  219. package/dist/runtime-general-protocol.js.map +1 -0
  220. package/dist/runtime-general-workspace.d.ts +17 -0
  221. package/dist/runtime-general-workspace.js +213 -0
  222. package/dist/runtime-general-workspace.js.map +1 -0
  223. package/dist/runtime-pane-assets.d.ts +17 -0
  224. package/dist/runtime-pane-assets.js +23 -0
  225. package/dist/runtime-pane-assets.js.map +1 -0
  226. package/dist/runtime-pane-boot.d.ts +2 -0
  227. package/dist/runtime-pane-boot.js +24 -0
  228. package/dist/runtime-pane-boot.js.map +1 -0
  229. package/dist/runtime-pane-codex-index.d.ts +1 -0
  230. package/dist/runtime-pane-codex-index.js +47 -0
  231. package/dist/runtime-pane-codex-index.js.map +1 -0
  232. package/dist/runtime-pane-config.d.ts +16 -0
  233. package/dist/runtime-pane-config.js +54 -0
  234. package/dist/runtime-pane-config.js.map +1 -0
  235. package/dist/runtime-pane-host.d.ts +44 -0
  236. package/dist/runtime-pane-host.js +424 -0
  237. package/dist/runtime-pane-host.js.map +1 -0
  238. package/dist/runtime-pane-job-owner.d.ts +1 -0
  239. package/dist/runtime-pane-job-owner.js +29 -0
  240. package/dist/runtime-pane-job-owner.js.map +1 -0
  241. package/dist/runtime-pane-job.ps1 +116 -0
  242. package/dist/runtime-pane-link.d.ts +40 -0
  243. package/dist/runtime-pane-link.js +246 -0
  244. package/dist/runtime-pane-link.js.map +1 -0
  245. package/dist/runtime-pane-mcp-protocol.d.ts +32 -0
  246. package/dist/runtime-pane-mcp-protocol.js +39 -0
  247. package/dist/runtime-pane-mcp-protocol.js.map +1 -0
  248. package/dist/runtime-pane-mcp-relay.d.ts +17 -0
  249. package/dist/runtime-pane-mcp-relay.js +70 -0
  250. package/dist/runtime-pane-mcp-relay.js.map +1 -0
  251. package/dist/runtime-pane-mcp.d.ts +51 -0
  252. package/dist/runtime-pane-mcp.js +150 -0
  253. package/dist/runtime-pane-mcp.js.map +1 -0
  254. package/dist/runtime-pane-native.d.ts +45 -0
  255. package/dist/runtime-pane-native.js +65 -0
  256. package/dist/runtime-pane-native.js.map +1 -0
  257. package/dist/runtime-pane-output.d.ts +19 -0
  258. package/dist/runtime-pane-output.js +53 -0
  259. package/dist/runtime-pane-output.js.map +1 -0
  260. package/dist/runtime-pane-port.d.ts +139 -0
  261. package/dist/runtime-pane-port.js +558 -0
  262. package/dist/runtime-pane-port.js.map +1 -0
  263. package/dist/runtime-pane-private.d.ts +14 -0
  264. package/dist/runtime-pane-private.js +51 -0
  265. package/dist/runtime-pane-private.js.map +1 -0
  266. package/dist/runtime-pane-private.ps1 +14 -0
  267. package/dist/runtime-pane-process.d.ts +4 -0
  268. package/dist/runtime-pane-process.js +108 -0
  269. package/dist/runtime-pane-process.js.map +1 -0
  270. package/dist/runtime-pane-protocol.d.ts +172 -0
  271. package/dist/runtime-pane-protocol.js +195 -0
  272. package/dist/runtime-pane-protocol.js.map +1 -0
  273. package/dist/runtime-pane-screen.d.ts +19 -0
  274. package/dist/runtime-pane-screen.js +76 -0
  275. package/dist/runtime-pane-screen.js.map +1 -0
  276. package/dist/runtime-pane-service.d.ts +11 -0
  277. package/dist/runtime-pane-service.js +221 -0
  278. package/dist/runtime-pane-service.js.map +1 -0
  279. package/dist/runtime-pane-stdio-protocol.d.ts +54 -0
  280. package/dist/runtime-pane-stdio-protocol.js +94 -0
  281. package/dist/runtime-pane-stdio-protocol.js.map +1 -0
  282. package/dist/runtime-pane-stdio.d.ts +3 -0
  283. package/dist/runtime-pane-stdio.js +123 -0
  284. package/dist/runtime-pane-stdio.js.map +1 -0
  285. package/dist/runtime-pane-store.d.ts +33 -0
  286. package/dist/runtime-pane-store.js +164 -0
  287. package/dist/runtime-pane-store.js.map +1 -0
  288. package/dist/runtime-pane-transcript-protocol.d.ts +43 -0
  289. package/dist/runtime-pane-transcript-protocol.js +58 -0
  290. package/dist/runtime-pane-transcript-protocol.js.map +1 -0
  291. package/dist/runtime-pane-transcript.d.ts +45 -0
  292. package/dist/runtime-pane-transcript.js +605 -0
  293. package/dist/runtime-pane-transcript.js.map +1 -0
  294. package/dist/runtime-pane-worker.d.ts +1 -0
  295. package/dist/runtime-pane-worker.js +154 -0
  296. package/dist/runtime-pane-worker.js.map +1 -0
  297. package/dist/runtime-protocol.d.ts +149 -0
  298. package/dist/runtime-protocol.js +19 -0
  299. package/dist/runtime-protocol.js.map +1 -0
  300. package/dist/runtime-switches.d.ts +79 -0
  301. package/dist/runtime-switches.js +90 -0
  302. package/dist/runtime-switches.js.map +1 -0
  303. package/dist/runtime-transcript-delta-reader.d.ts +23 -0
  304. package/dist/runtime-transcript-delta-reader.js +74 -0
  305. package/dist/runtime-transcript-delta-reader.js.map +1 -0
  306. package/dist/runtime-transcript-source.d.ts +36 -0
  307. package/dist/runtime-transcript-source.js +189 -0
  308. package/dist/runtime-transcript-source.js.map +1 -0
  309. package/dist/runtime-windows-bridge.d.ts +41 -0
  310. package/dist/runtime-windows-bridge.js +157 -0
  311. package/dist/runtime-windows-bridge.js.map +1 -0
  312. package/dist/settings-api.d.ts +5 -0
  313. package/dist/settings-api.js +95 -1
  314. package/dist/settings-api.js.map +1 -1
  315. package/dist/settings-baseline.d.ts +1 -0
  316. package/dist/settings-baseline.js +1 -1
  317. package/dist/settings-baseline.js.map +1 -1
  318. package/dist/settings-change.js +28 -0
  319. package/dist/settings-change.js.map +1 -1
  320. package/dist/settings-confirmation.d.ts +16 -1
  321. package/dist/settings-confirmation.js +47 -9
  322. package/dist/settings-confirmation.js.map +1 -1
  323. package/dist/settings-effect.d.ts +4 -0
  324. package/dist/settings-effect.js +58 -1
  325. package/dist/settings-effect.js.map +1 -1
  326. package/dist/settings-http-confirmation.d.ts +1 -0
  327. package/dist/settings-http-confirmation.js +15 -2
  328. package/dist/settings-http-confirmation.js.map +1 -1
  329. package/dist/settings-request-capability.d.ts +2 -0
  330. package/dist/settings-request-capability.js +4 -0
  331. package/dist/settings-request-capability.js.map +1 -1
  332. package/dist/settings-route-lifetime.d.ts +14 -0
  333. package/dist/settings-route-lifetime.js +48 -0
  334. package/dist/settings-route-lifetime.js.map +1 -0
  335. package/dist/settings-transaction.d.ts +4 -0
  336. package/dist/settings-transaction.js +9 -0
  337. package/dist/settings-transaction.js.map +1 -1
  338. package/dist/setup-form.js +6 -3
  339. package/dist/setup-form.js.map +1 -1
  340. package/dist/setup-i18n.js +3 -0
  341. package/dist/setup-i18n.js.map +1 -1
  342. package/dist/tmux-control.d.ts +2 -1
  343. package/dist/tmux-control.js.map +1 -1
  344. package/dist/tmux-manager.d.ts +2 -1
  345. package/dist/tmux-manager.js.map +1 -1
  346. package/dist/tmux-pane-host.d.ts +26 -0
  347. package/dist/tmux-pane-host.js +25 -0
  348. package/dist/tmux-pane-host.js.map +1 -0
  349. package/dist/tool-permissions.js +2 -1
  350. package/dist/tool-permissions.js.map +1 -1
  351. package/dist/topic-commands.js +3 -0
  352. package/dist/topic-commands.js.map +1 -1
  353. package/dist/transcript-delta-reader.d.ts +1 -1
  354. package/dist/transcript-delta-reader.js +1 -1
  355. package/dist/transcript-delta-reader.js.map +1 -1
  356. package/dist/transcript-monitor.d.ts +3 -0
  357. package/dist/transcript-monitor.js +22 -46
  358. package/dist/transcript-monitor.js.map +1 -1
  359. package/dist/transcript-needles.d.ts +35 -0
  360. package/dist/transcript-needles.js +158 -0
  361. package/dist/transcript-needles.js.map +1 -0
  362. package/dist/transcript-records.d.ts +21 -0
  363. package/dist/transcript-records.js +140 -0
  364. package/dist/transcript-records.js.map +1 -0
  365. package/dist/transcript-sources.d.ts +5 -0
  366. package/dist/transcript-sources.js +8 -79
  367. package/dist/transcript-sources.js.map +1 -1
  368. package/dist/types.d.ts +23 -0
  369. package/dist/ui/agent-proposals.js +90 -0
  370. package/dist/ui/agent-runtime.js +106 -0
  371. package/dist/ui/chat-store.js +13 -2
  372. package/dist/ui/chat-strings.js +48 -0
  373. package/dist/ui/cli-picker.js +42 -0
  374. package/dist/ui/general-location.js +71 -0
  375. package/dist/ui/native-instance-settings.js +47 -0
  376. package/dist/ui/native-pane-recovery.js +45 -0
  377. package/dist/ui/panel-chat.js +63 -32
  378. package/dist/ui/panel-details.js +2 -1
  379. package/dist/ui/panel-fleet.js +99 -18
  380. package/dist/ui/panel-needs.js +154 -3
  381. package/dist/ui/panel-runtimes.js +231 -0
  382. package/dist/ui/panel-settings.js +19 -9
  383. package/dist/ui/panel-windows-agent.js +86 -0
  384. package/dist/ui/panel-windows-cli.js +143 -0
  385. package/dist/ui/provider-marks.js +83 -0
  386. package/dist/ui/runtime-catalog.js +55 -0
  387. package/dist/ui/settings-catalog.js +37 -10
  388. package/dist/ui/settings-confirm.js +3 -1
  389. package/dist/ui/settings-dialogs.js +22 -7
  390. package/dist/ui/settings-model.js +2 -1
  391. package/dist/ui/settings-outside.js +176 -0
  392. package/dist/ui/settings-registry.js +6 -0
  393. package/dist/ui/settings-strings.js +16 -0
  394. package/dist/ui/shared/app-i18n.js +2 -2
  395. package/dist/ui/shared/app-route.js +6 -2
  396. package/dist/ui/shared/app-shell.js +3 -2
  397. package/dist/ui/shared/app-store.js +1 -0
  398. package/dist/ui/shared/app-stream.js +3 -1
  399. package/dist/ui/shared/app.css +301 -0
  400. package/dist/ui/shared/app.js +4 -0
  401. package/dist/ui/shared/header-tools.js +6 -4
  402. package/dist/ui/shared/instance-nav.js +33 -7
  403. package/dist/ui/shared/instance-switch.js +4 -3
  404. package/dist/ui/shared/qrcode.module.js +2237 -0
  405. package/dist/ui/shared/signin.js +39 -5
  406. package/dist/ui/shared/ui-menu.js +28 -8
  407. package/dist/ui/shared/vendor/qrcode-generator.LICENSE +27 -0
  408. package/dist/ui/shared/vendor/vendor.json +19 -2
  409. package/dist/ui/shared/view-strings.js +8 -0
  410. package/dist/ui/windows-agents-nav.js +2 -0
  411. package/dist/ui/windows-cli-catalog.js +79 -0
  412. package/dist/web-api.d.ts +37 -0
  413. package/dist/web-api.js +248 -6
  414. package/dist/web-api.js.map +1 -1
  415. package/dist/web-chat-history.d.ts +19 -2
  416. package/dist/web-chat-history.js +72 -3
  417. package/dist/web-chat-history.js.map +1 -1
  418. package/dist/web-only-fleet.d.ts +20 -0
  419. package/dist/web-only-fleet.js +21 -0
  420. package/dist/web-only-fleet.js.map +1 -1
  421. package/dist/web-remote-access.d.ts +152 -0
  422. package/dist/web-remote-access.js +368 -0
  423. package/dist/web-remote-access.js.map +1 -0
  424. package/dist/web-session.d.ts +7 -0
  425. package/dist/web-session.js +2 -0
  426. package/dist/web-session.js.map +1 -1
  427. package/dist/web-shell-routes.d.ts +4 -1
  428. package/dist/web-shell-routes.js +7 -2
  429. package/dist/web-shell-routes.js.map +1 -1
  430. package/dist/windows-agents.d.ts +124 -0
  431. package/dist/windows-agents.js +487 -0
  432. package/dist/windows-agents.js.map +1 -0
  433. package/dist/windows-cli-api.d.ts +23 -0
  434. package/dist/windows-cli-api.js +158 -0
  435. package/dist/windows-cli-api.js.map +1 -0
  436. package/dist/windows-cli-providers.d.ts +115 -0
  437. package/dist/windows-cli-providers.js +429 -0
  438. package/dist/windows-cli-providers.js.map +1 -0
  439. package/dist/windows-cli-worker.d.ts +58 -0
  440. package/dist/windows-cli-worker.js +479 -0
  441. package/dist/windows-cli-worker.js.map +1 -0
  442. package/dist/windows-cli.d.ts +115 -0
  443. package/dist/windows-cli.js +402 -0
  444. package/dist/windows-cli.js.map +1 -0
  445. package/dist/windows-native-mcp.d.ts +19 -0
  446. package/dist/windows-native-mcp.js +143 -0
  447. package/dist/windows-native-mcp.js.map +1 -0
  448. package/dist/windows-pane-mcp.d.ts +26 -0
  449. package/dist/windows-pane-mcp.js +187 -0
  450. package/dist/windows-pane-mcp.js.map +1 -0
  451. package/package.json +9 -3
  452. package/templates/runtime-assets/conpty-LICENSE +21 -0
  453. package/templates/runtime-assets/conpty-NOTICE.md +503 -0
  454. package/templates/runtime-assets/local-pane-stage.ps1 +101 -0
  455. package/templates/runtime-assets/runtime-pane-job.ps1 +116 -0
  456. package/templates/runtime-assets/runtime-pane-private.ps1 +14 -0
  457. package/templates/runtime-assets/xterm-LICENSE +21 -0
package/dist/web-api.js CHANGED
@@ -1,4 +1,5 @@
1
1
  import { CANVAS_WORKER_EXPERIMENTAL_MESSAGE } from "./web-experimental.js";
2
+ import { MachineSlotLimitError } from "./windows-agents.js";
2
3
  import { daemonTopicMode } from "./web-only-fleet.js";
3
4
  import { webHumanOrigin } from "./human-delivery-receipts.js";
4
5
  import { classifyWebPeer, confirmAfterBody, noAuthority } from "./authority/web-authority.js";
@@ -32,6 +33,7 @@ import { shellRoute } from "./web-shell-routes.js";
32
33
  import { createReadStream, createWriteStream, readFileSync } from "node:fs";
33
34
  import { join, dirname } from "node:path";
34
35
  import { fileURLToPath } from "node:url";
36
+ import { createHash, randomUUID } from "node:crypto";
35
37
  import { CreateInstanceArgs, CreateScheduleArgs, UpdateScheduleArgs, validateArgs } from "./outbound-schemas.js";
36
38
  import { scheduleView } from "./web-schedules.js";
37
39
  import { DEFAULT_SCHEDULER_CONFIG } from "./scheduler/index.js";
@@ -54,6 +56,12 @@ import { resolveTz } from "./tz-utils.js";
54
56
  import { QUERY_MAX_CHARS, RESULT_MAX, SEARCH_SOURCES } from "./search/search-store.js";
55
57
  import { xmsgShown } from "./search/search-docs.js";
56
58
  import { WebSendDedupe } from "./web-send-dedupe.js";
59
+ import { handleWindowsCliRequest, nativeCliAuthorization } from "./windows-cli-api.js";
60
+ import { createNativeInstance, handleNativeInstanceRequest } from "./native-instance-api.js";
61
+ import { isWindowsInstance, isNativePaneInstance, isNativeExecInstance } from "./native-instance-registry.js";
62
+ import { handleNativeModelCatalog } from "./native-model-catalog.js";
63
+ import { claudeDocumentedModels } from "./model-catalog-defaults.js";
64
+ import { handleRuntimeRequest } from "./runtime-api.js";
57
65
  // ── Strict public-facing schemas ────────────────────────────────────────────
58
66
  // web-api endpoints must reject unknown fields so the dashboard cannot inject
59
67
  // internal-only flags that would reach handleCreate/scheduler/config writers.
@@ -1871,6 +1879,27 @@ export function handleWebRequest(req, res, url, ctx) {
1871
1879
  return false;
1872
1880
  }
1873
1881
  // ── Static files ───────────────────────────────────────
1882
+ // Native local tools retain their administrator boundary on the shared chat/read/action routes.
1883
+ const nativePath = /^\/ui\/(?:chat|instance|cancel|stop|start|restart)\/([^/]+)$/.exec(path);
1884
+ let nativeTarget = url.searchParams.get("instance") ?? "";
1885
+ if (nativePath) {
1886
+ try {
1887
+ nativeTarget = decodeURIComponent(nativePath[1]);
1888
+ }
1889
+ catch {
1890
+ nativeTarget = "";
1891
+ }
1892
+ }
1893
+ if (isWindowsInstance(ctx.fleetConfig?.instances?.[nativeTarget]) && !nativeCliAuthorization(req, url, ctx)) {
1894
+ json(res, 403, { error: "Windows runtime requires an administrator on the local dashboard" });
1895
+ return true;
1896
+ }
1897
+ if (handleNativeInstanceRequest(req, res, url, ctx))
1898
+ return true;
1899
+ if (handleWindowsCliRequest(req, res, url, ctx))
1900
+ return true;
1901
+ if (handleRuntimeRequest(req, res, url, ctx))
1902
+ return true;
1874
1903
  // #1408: the app shell, for exactly the paths the classifier names (src/web-shell-routes.ts). One page for every
1875
1904
  // route; the client router mounts the panel. A malformed instance name is a 400, an unknown one is the shell (the
1876
1905
  // panel says "not found"), so the response never tells which names exist.
@@ -1926,7 +1955,45 @@ export function handleWebRequest(req, res, url, ctx) {
1926
1955
  json(res, 400, { error: "backend (and optional instance) required" });
1927
1956
  return true;
1928
1957
  }
1929
- json(res, 200, { backend, models: ctx.modelCatalogFor?.(backend, instance) ?? [] });
1958
+ const runtime = url.searchParams.get("runtime"), refresh = url.searchParams.get("refresh");
1959
+ const machineId = url.searchParams.get("machineId");
1960
+ if (machineId !== null && (!/^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}$/i.test(machineId) || runtime === "wsl")) {
1961
+ json(res, 400, { error: "Invalid model runtime machine" });
1962
+ return true;
1963
+ }
1964
+ if ((runtime !== null && runtime !== "wsl" && runtime !== "windows") || (refresh !== null && refresh !== "1")) {
1965
+ json(res, 400, { error: "Invalid model catalog options" });
1966
+ return true;
1967
+ }
1968
+ if (handleNativeModelCatalog(req, res, url, ctx))
1969
+ return true;
1970
+ const models = ctx.modelCatalogFor?.(backend, instance) ?? [];
1971
+ const answerCatalog = () => {
1972
+ if (backend === "claude-code" && !models.length) {
1973
+ const version = ctx.backendAvailabilityRows?.().find(row => row.backend === backend)?.version;
1974
+ json(res, 200, { backend, models: claudeDocumentedModels(version), source: "official-catalog" });
1975
+ }
1976
+ else
1977
+ json(res, 200, { backend, models });
1978
+ };
1979
+ // The existing catalog belongs to this instance/account and always wins.
1980
+ if (models.length || !ctx.cliModelCatalogFor) {
1981
+ answerCatalog();
1982
+ return true;
1983
+ }
1984
+ const canAnswer = () => !res.headersSent && !res.destroyed && !res.writableEnded && stillAuthorized(req, res, url, ctx);
1985
+ void (async () => {
1986
+ const cliModels = await ctx.cliModelCatalogFor?.(backend, instance) ?? [];
1987
+ if (!canAnswer())
1988
+ return;
1989
+ if (cliModels.length)
1990
+ json(res, 200, { backend, models: cliModels, source: "cli-cache" });
1991
+ else
1992
+ answerCatalog();
1993
+ })().catch(() => {
1994
+ if (canAnswer())
1995
+ json(res, 503, { error: "CLI model cache unavailable" });
1996
+ });
1930
1997
  return true;
1931
1998
  }
1932
1999
  if (method === "GET" && path === "/ui/backends") {
@@ -2925,6 +2992,116 @@ export function handleWebRequest(req, res, url, ctx) {
2925
2992
  });
2926
2993
  return true;
2927
2994
  }
2995
+ // ── #3008: connections from outside (a web-only fleet) ──
2996
+ // GET /ui/outside: the state (any admin; over the outside link too, read-only). Everything that changes it is this
2997
+ // computer's admin's, on this computer (the fleet asks the live session each time; the public link refuses these
2998
+ // routes outright): POST /ui/outside/enroll (a new secret, shown once), POST /ui/outside/enroll/confirm {code},
2999
+ // POST /ui/outside/remove, POST /ui/outside/switch {on}. Never a guest (not in GUEST_ROUTES).
3000
+ if (method === "GET" && path === "/ui/outside") {
3001
+ res.setHeader("Cache-Control", "no-store");
3002
+ json(res, 200, ctx.webOutsideStatus?.(req) ?? { webOnly: false, here: false, enrolled: false, enrolledAt: null, outside: false, pausedForMs: 0, link: null });
3003
+ return true;
3004
+ }
3005
+ if (method === "POST" && (path === "/ui/outside/enroll" || path === "/ui/outside/enroll/confirm" || path === "/ui/outside/remove" || path === "/ui/outside/switch")) {
3006
+ if (gatewayRequestContext(req)) {
3007
+ json(res, 403, { error: "outside_not_here" });
3008
+ return true;
3009
+ }
3010
+ (async () => {
3011
+ let body;
3012
+ try {
3013
+ body = await parseBody(req);
3014
+ }
3015
+ catch {
3016
+ json(res, 400, { error: "Invalid JSON" });
3017
+ return;
3018
+ }
3019
+ if (!permitWebContinuation(req, res, ctx))
3020
+ return;
3021
+ res.setHeader("Cache-Control", "no-store");
3022
+ if (path === "/ui/outside/enroll") {
3023
+ const r = ctx.webOutsideBeginEnrollment?.(req) ?? null;
3024
+ if (!r) {
3025
+ json(res, 403, { error: "outside_not_here" });
3026
+ return;
3027
+ }
3028
+ json(res, 200, r);
3029
+ return;
3030
+ }
3031
+ if (path === "/ui/outside/enroll/confirm") {
3032
+ const code = body && typeof body === "object" ? body.code : undefined;
3033
+ if (typeof code !== "string" || code.length > 32) {
3034
+ json(res, 400, { error: "code required" });
3035
+ return;
3036
+ }
3037
+ const r = ctx.webOutsideConfirmEnrollment?.(req, code) ?? "not_here";
3038
+ json(res, r === "ok" ? 200 : r === "not_here" ? 403 : r === "unsaved" ? 503 : 400, r === "ok" ? { ok: true } : { error: r === "not_here" ? "outside_not_here" : r });
3039
+ return;
3040
+ }
3041
+ if (path === "/ui/outside/remove") {
3042
+ const r = ctx.webOutsideRemove?.(req) ?? "not_here";
3043
+ json(res, r === "ok" ? 200 : r === "unsaved" ? 503 : 403, r === "ok" ? { ok: true } : { error: r === "unsaved" ? "unsaved" : "outside_not_here" });
3044
+ return;
3045
+ }
3046
+ const on = body && typeof body === "object" ? body.on : undefined;
3047
+ if (typeof on !== "boolean") {
3048
+ json(res, 400, { error: "on must be true or false" });
3049
+ return;
3050
+ }
3051
+ const r = ctx.webOutsideSwitch?.(req, on) ?? "not_here";
3052
+ json(res, r === "ok" ? 200 : r === "not_here" ? 403 : r === "unsaved" ? 503 : 409, r === "ok" ? { ok: true } : { error: r === "not_here" ? "outside_not_here" : r });
3053
+ })().catch(err => {
3054
+ ctx.logger.error({ err: err.message }, "Outside connections change failed");
3055
+ try {
3056
+ json(res, 500, { error: "outside_failed" });
3057
+ }
3058
+ catch { /* already answered */ }
3059
+ });
3060
+ return true;
3061
+ }
3062
+ // ── alpha.2 (M-2300): an agent's Windows request, decided by a web-only fleet's owner in Needs you ──
3063
+ // The list is the owner's only: anyone else (a guest, a LAN or public-link session, a chat fleet's admin) reads an
3064
+ // empty one, so nothing actionable ever reaches them. The stream's `agent_proposals` event carries nothing.
3065
+ if (method === "GET" && path === "/ui/agent-proposals") {
3066
+ const list = ctx.webAgentProposals?.(req) ?? null;
3067
+ json(res, 200, { owner: list !== null, proposals: list ?? [] });
3068
+ return true;
3069
+ }
3070
+ const proposalMatch = method === "POST" ? /^\/ui\/agent-proposals\/([0-9a-f]{32})$/.exec(path) : null;
3071
+ if (proposalMatch) {
3072
+ if (!ctx.webDecideAgentProposal) {
3073
+ json(res, 404, { error: "not_found" });
3074
+ return true;
3075
+ }
3076
+ const decide = ctx.webDecideAgentProposal.bind(ctx), id = proposalMatch[1];
3077
+ (async () => {
3078
+ let body;
3079
+ try {
3080
+ body = await parseBody(req);
3081
+ }
3082
+ catch {
3083
+ json(res, 400, { error: "Invalid JSON" });
3084
+ return;
3085
+ }
3086
+ if (!permitWebContinuation(req, res, ctx))
3087
+ return;
3088
+ const decision = body && typeof body === "object" ? body.decision : undefined;
3089
+ if (decision !== "confirm" && decision !== "reject") {
3090
+ json(res, 400, { error: "decision must be confirm or reject" });
3091
+ return;
3092
+ }
3093
+ const r = await decide(req, id, decision);
3094
+ if (!res.headersSent && !res.destroyed)
3095
+ json(res, r.status, r.body);
3096
+ })().catch(err => {
3097
+ ctx.logger.error({ err: err.message }, "Agent request decision failed");
3098
+ try {
3099
+ json(res, 500, { error: "decide_failed" });
3100
+ }
3101
+ catch { /* already answered */ }
3102
+ });
3103
+ return true;
3104
+ }
2928
3105
  if (method === "POST" && path === "/ui/needs/ack") {
2929
3106
  if (!ctx.acknowledgeNeedsItem) {
2930
3107
  json(res, 404, { error: "Nothing to acknowledge here" });
@@ -3050,6 +3227,20 @@ export function handleWebRequest(req, res, url, ctx) {
3050
3227
  json(res, 400, { error: "instance and command required" });
3051
3228
  return;
3052
3229
  }
3230
+ if (isNativeExecInstance(ctx.fleetConfig?.instances[instance])) {
3231
+ json(res, 400, { error: "This runtime does not support CLI control commands; use Agent settings or Cancel" });
3232
+ return;
3233
+ }
3234
+ if (isNativePaneInstance(ctx.fleetConfig?.instances[instance])) {
3235
+ if (!nativeCliAuthorization(req, url, ctx)) {
3236
+ json(res, 403, { error: "Windows runtime requires an administrator on the local dashboard" });
3237
+ return;
3238
+ }
3239
+ if (command !== "model") {
3240
+ json(res, 400, { error: "This persistent Windows runtime supports the model command; use its shared controls for other actions" });
3241
+ return;
3242
+ }
3243
+ }
3053
3244
  if (body.args !== undefined && str(body.args, MAX_COMMAND_ARGS) === undefined) {
3054
3245
  json(res, 400, { error: "args too long" });
3055
3246
  return;
@@ -3313,6 +3504,10 @@ export function handleWebRequest(req, res, url, ctx) {
3313
3504
  const body = await parseBody(req);
3314
3505
  if (!permitWebContinuation(req, res, ctx))
3315
3506
  return;
3507
+ if (body?.runtime === "windows") {
3508
+ await createNativeInstance(req, res, url, ctx, body);
3509
+ return;
3510
+ }
3316
3511
  const v = validateArgs(CreateInstanceArgs, body, "create_instance");
3317
3512
  if (!v.ok) {
3318
3513
  json(res, 400, { error: v.error });
@@ -4074,6 +4269,9 @@ function uploadRecipient(ctx, name) {
4074
4269
  /** Closed, path-free explanations; arbitrary launch errors stay in the host log. */
4075
4270
  function webDeliveryFailure(err) {
4076
4271
  const message = err instanceof Error ? err.message : "";
4272
+ // M-2297: the per-PC agent limit — say so, with the agents holding its slots (names only: no path, no id).
4273
+ if (err instanceof MachineSlotLimitError)
4274
+ return { reason: "machine_limit", error: message, limit: err.limit, holders: err.holders.map(h => ({ name: h.name, unknown: h.unknown })) };
4077
4275
  if (/No warm slot is free/.test(message))
4078
4276
  return { reason: "wake_capacity", error: "No slot is free to wake this instance. Retry when another instance is idle." };
4079
4277
  if (/login|log in|sign in|\bauth(?:entication|orization)?\b|credential|api.?key/i.test(message))
@@ -4121,6 +4319,15 @@ function handleSendMessage(req, res, ctx) {
4121
4319
  return;
4122
4320
  }
4123
4321
  const { instance, message: typed, attachments = [], replyTo, clientId } = parsed.data;
4322
+ const native = isWindowsInstance(ctx.fleetConfig?.instances[instance]);
4323
+ if (native && !nativeCliAuthorization(req, new URL(req.url ?? "/", "http://localhost"), ctx)) {
4324
+ json(res, 403, { error: "Windows runtime requires an administrator on the local dashboard" });
4325
+ return;
4326
+ }
4327
+ if (native && attachments.length) {
4328
+ json(res, 400, { error: "Attachments are not supported by this runtime yet" });
4329
+ return;
4330
+ }
4124
4331
  // #1920 step 2b: a guest writes only to an in-scope instance, while guests may chat, and never a command.
4125
4332
  const guest = guestRequestOf(req);
4126
4333
  const refused = guestChatRefusal(guest, instance);
@@ -4174,6 +4381,16 @@ function handleSendMessage(req, res, ctx) {
4174
4381
  break;
4175
4382
  }
4176
4383
  }
4384
+ const locationHold = ctx.generalLocationDeliveryHold?.(instance);
4385
+ if (locationHold) {
4386
+ const messageId = newWebMessageId(), ts = new Date().toISOString();
4387
+ // Settle this client ID as answered. A Retry after reconnect must never queue its old input.
4388
+ acceptedId = messageId;
4389
+ ctx.emitSseEvent("message", { instance, sender: person.name, role: "user", text: typed, ts, messageId, ...(person.bound ? { from: person.voterKey } : {}), ...(clientId ? { clientId } : {}) });
4390
+ ctx.emitSseEvent("message", { instance, role: "status", sender: "AgEnD", text: locationHold, ts, messageId: newWebMessageId() });
4391
+ json(res, 200, { sent: true, messageId, serviceResponse: true });
4392
+ return;
4393
+ }
4177
4394
  let files = [];
4178
4395
  if (attachments.length > 0) {
4179
4396
  const taken = ctx.webFiles?.takeForMessage(instance, attachments);
@@ -4196,15 +4413,39 @@ function handleSendMessage(req, res, ctx) {
4196
4413
  // Recheck the same admission all the way through a wake, before the facade's actual IPC handoff.
4197
4414
  const requestUrl = new URL(req.url ?? "/", "http://localhost");
4198
4415
  const admission = admissionOf(req, requestUrl, ctx);
4199
- const stillCurrent = () => !res.destroyed && admission !== null && admissionOf(req, requestUrl, ctx) === admission
4416
+ // The sender's authority, without the request's own lifetime: the same admission, the same guest still allowed, the
4417
+ // instance still registered (a Windows one still Windows). A Windows turn is journaled before /ui/send answers and its
4418
+ // process starts after, so the bridge rechecks this one (a revoke in between still stops it); never res, which a
4419
+ // finished response marks destroyed (S-30: every web-chat turn to a Windows agent was refused).
4420
+ const authorityCurrent = () => admission !== null && admissionOf(req, requestUrl, ctx) === admission
4200
4421
  && (!guest || (guest.current() && !guestChatRefusal(guest, instance)))
4201
- && (registered ? registeredChatInstance(ctx, instance) : ctx.instanceIpcClients.has(instance));
4422
+ && (native ? isWindowsInstance(ctx.fleetConfig?.instances[instance]) && nativeCliAuthorization(req, requestUrl, ctx)
4423
+ : registered ? registeredChatInstance(ctx, instance) : ctx.instanceIpcClients.has(instance));
4424
+ const stillCurrent = () => !res.destroyed && authorityCurrent();
4202
4425
  const message = typed;
4203
4426
  // #1939 S1: what the receipt records about who authorized it (observe only: agents still read web as recognition).
4204
4427
  const { authority } = confirmAfterBody(arrival, webAuthorityOf(req, new URL(req.url ?? "/", "http://localhost"), ctx, instance));
4205
4428
  const ts = new Date().toISOString();
4206
4429
  // The id the agent is given, and the one its delivery reports come back under: the page's ticks.
4207
- const messageId = newWebMessageId();
4430
+ const nativeRequestId = isNativeExecInstance(ctx.fleetConfig?.instances[instance]) ? (() => {
4431
+ if (!clientId)
4432
+ return randomUUID();
4433
+ const hash = createHash("sha256").update(`agend-native-web\0${WebSendDedupe.key(person.key, instance, clientId)}`).digest("hex");
4434
+ return `${hash.slice(0, 8)}-${hash.slice(8, 12)}-4${hash.slice(13, 16)}-8${hash.slice(17, 20)}-${hash.slice(20, 32)}`;
4435
+ })() : undefined;
4436
+ const messageId = nativeRequestId ? `native:${nativeRequestId}:user` : newWebMessageId();
4437
+ if (nativeRequestId && ctx.nativeInstanceRuntime) {
4438
+ const previous = ctx.nativeInstanceRuntime().get(instance)?.turns.find(turn => turn.id === nativeRequestId);
4439
+ if (previous) {
4440
+ if (previous.prompt !== delivery.text) {
4441
+ json(res, 409, { error: "clientId belongs to a different message" });
4442
+ return;
4443
+ }
4444
+ acceptedId = messageId;
4445
+ json(res, 200, { sent: true, messageId, repeated: true });
4446
+ return;
4447
+ }
4448
+ }
4208
4449
  // Use real Telegram context so daemon's lastChatId/lastThreadId are set,
4209
4450
  // enabling reply tool even when first message comes from Web UI.
4210
4451
  // Pure Web UI mode (no channel config) leaves these empty; the agent's reply then comes back to the
@@ -4250,11 +4491,12 @@ function handleSendMessage(req, res, ctx) {
4250
4491
  let delivered;
4251
4492
  try {
4252
4493
  const deliver = (name, payload) => ctx.deliverHumanToInstance
4253
- ? ctx.deliverHumanToInstance(name, payload, webHumanOrigin(false, authority), typed, { stillCurrent })
4254
- : ctx.deliverToInstance(name, payload, { stillCurrent });
4494
+ ? ctx.deliverHumanToInstance(name, payload, webHumanOrigin(false, authority), typed, { stillCurrent, ...(native ? { authorityCurrent } : {}) })
4495
+ : ctx.deliverToInstance(name, payload, { stillCurrent, ...(native ? { authorityCurrent } : {}) });
4255
4496
  delivered = await deliver(instance, {
4256
4497
  type: "fleet_inbound",
4257
4498
  content: delivery.text,
4499
+ ...(nativeRequestId ? { requestId: nativeRequestId } : {}),
4258
4500
  targetSession: instance,
4259
4501
  meta: {
4260
4502
  chat_id: groupId ? String(groupId) : "",