@songsid/agend 2.3.4-beta.6 → 2.3.5-alpha.2

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 (386) 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/backend/claude-code.d.ts +15 -12
  8. package/dist/backend/claude-code.js +137 -133
  9. package/dist/backend/claude-code.js.map +1 -1
  10. package/dist/backend/codex-package.d.ts +5 -2
  11. package/dist/backend/codex-package.js +1 -5
  12. package/dist/backend/codex-package.js.map +1 -1
  13. package/dist/backend/codex.d.ts +136 -113
  14. package/dist/backend/codex.js +1271 -1219
  15. package/dist/backend/codex.js.map +1 -1
  16. package/dist/backend/grok-model-cache.d.ts +7 -0
  17. package/dist/backend/grok-model-cache.js +65 -0
  18. package/dist/backend/grok-model-cache.js.map +1 -0
  19. package/dist/backend/grok.d.ts +2 -0
  20. package/dist/backend/grok.js +22 -0
  21. package/dist/backend/grok.js.map +1 -1
  22. package/dist/backend/native-pane.d.ts +9 -0
  23. package/dist/backend/native-pane.js +59 -0
  24. package/dist/backend/native-pane.js.map +1 -0
  25. package/dist/backend/types.d.ts +7 -0
  26. package/dist/backend/types.js.map +1 -1
  27. package/dist/channel/ipc-bridge.d.ts +2 -0
  28. package/dist/channel/mcp-tools.js +1 -1
  29. package/dist/channel/mcp-tools.js.map +1 -1
  30. package/dist/cli.js +6 -2
  31. package/dist/cli.js.map +1 -1
  32. package/dist/config-validator.js +59 -0
  33. package/dist/config-validator.js.map +1 -1
  34. package/dist/config.js +16 -0
  35. package/dist/config.js.map +1 -1
  36. package/dist/daemon.d.ts +62 -5
  37. package/dist/daemon.js +749 -267
  38. package/dist/daemon.js.map +1 -1
  39. package/dist/delivery-consumed-watch.d.ts +15 -3
  40. package/dist/delivery-consumed-watch.js +23 -1
  41. package/dist/delivery-consumed-watch.js.map +1 -1
  42. package/dist/delivery-outbox.d.ts +5 -0
  43. package/dist/delivery-outbox.js +32 -4
  44. package/dist/delivery-outbox.js.map +1 -1
  45. package/dist/delivery-reconciliation.d.ts +2 -35
  46. package/dist/delivery-reconciliation.js +2 -156
  47. package/dist/delivery-reconciliation.js.map +1 -1
  48. package/dist/fleet-context.d.ts +2 -2
  49. package/dist/fleet-level-config.d.ts +1 -1
  50. package/dist/fleet-level-config.js +2 -0
  51. package/dist/fleet-level-config.js.map +1 -1
  52. package/dist/fleet-manager.d.ts +125 -2
  53. package/dist/fleet-manager.js +1157 -27
  54. package/dist/fleet-manager.js.map +1 -1
  55. package/dist/fleet-windows-runtime.d.ts +92 -0
  56. package/dist/fleet-windows-runtime.js +373 -0
  57. package/dist/fleet-windows-runtime.js.map +1 -0
  58. package/dist/instance-config-impact.js +4 -0
  59. package/dist/instance-config-impact.js.map +1 -1
  60. package/dist/instance-lifecycle.d.ts +20 -3
  61. package/dist/instance-lifecycle.js +358 -156
  62. package/dist/instance-lifecycle.js.map +1 -1
  63. package/dist/local-pane-endpoint.d.ts +46 -0
  64. package/dist/local-pane-endpoint.js +189 -0
  65. package/dist/local-pane-endpoint.js.map +1 -0
  66. package/dist/local-pane-launcher.d.ts +2 -0
  67. package/dist/local-pane-launcher.js +38 -0
  68. package/dist/local-pane-launcher.js.map +1 -0
  69. package/dist/local-pane-stage.ps1 +101 -0
  70. package/dist/locale.js +34 -0
  71. package/dist/locale.js.map +1 -1
  72. package/dist/model-catalog-defaults.d.ts +14 -0
  73. package/dist/model-catalog-defaults.js +20 -0
  74. package/dist/model-catalog-defaults.js.map +1 -0
  75. package/dist/native-agent-admission.d.ts +7 -0
  76. package/dist/native-agent-admission.js +26 -0
  77. package/dist/native-agent-admission.js.map +1 -0
  78. package/dist/native-daemon-client.d.ts +13 -0
  79. package/dist/native-daemon-client.js +28 -0
  80. package/dist/native-daemon-client.js.map +1 -0
  81. package/dist/native-instance-api.d.ts +14 -0
  82. package/dist/native-instance-api.js +205 -0
  83. package/dist/native-instance-api.js.map +1 -0
  84. package/dist/native-instance-input.d.ts +84 -0
  85. package/dist/native-instance-input.js +54 -0
  86. package/dist/native-instance-input.js.map +1 -0
  87. package/dist/native-instance-registry.d.ts +32 -0
  88. package/dist/native-instance-registry.js +105 -0
  89. package/dist/native-instance-registry.js.map +1 -0
  90. package/dist/native-mcp.d.ts +40 -0
  91. package/dist/native-mcp.js +278 -0
  92. package/dist/native-mcp.js.map +1 -0
  93. package/dist/native-model-catalog.d.ts +5 -0
  94. package/dist/native-model-catalog.js +76 -0
  95. package/dist/native-model-catalog.js.map +1 -0
  96. package/dist/native-pane-crash-budget.d.ts +20 -0
  97. package/dist/native-pane-crash-budget.js +60 -0
  98. package/dist/native-pane-crash-budget.js.map +1 -0
  99. package/dist/native-pane-create.d.ts +26 -0
  100. package/dist/native-pane-create.js +53 -0
  101. package/dist/native-pane-create.js.map +1 -0
  102. package/dist/native-pane-lifecycle.d.ts +65 -0
  103. package/dist/native-pane-lifecycle.js +227 -0
  104. package/dist/native-pane-lifecycle.js.map +1 -0
  105. package/dist/native-pane-manager.d.ts +58 -0
  106. package/dist/native-pane-manager.js +563 -0
  107. package/dist/native-pane-manager.js.map +1 -0
  108. package/dist/native-pane-output-log.d.ts +15 -0
  109. package/dist/native-pane-output-log.js +108 -0
  110. package/dist/native-pane-output-log.js.map +1 -0
  111. package/dist/native-pane-reconciliation.d.ts +4 -0
  112. package/dist/native-pane-reconciliation.js +40 -0
  113. package/dist/native-pane-reconciliation.js.map +1 -0
  114. package/dist/native-pane-recovery.d.ts +12 -0
  115. package/dist/native-pane-recovery.js +10 -0
  116. package/dist/native-pane-recovery.js.map +1 -0
  117. package/dist/native-pane-tools.d.ts +2 -0
  118. package/dist/native-pane-tools.js +14 -0
  119. package/dist/native-pane-tools.js.map +1 -0
  120. package/dist/needs-you-hub.d.ts +2 -0
  121. package/dist/needs-you-hub.js +1 -0
  122. package/dist/needs-you-hub.js.map +1 -1
  123. package/dist/needs-you.d.ts +12 -1
  124. package/dist/needs-you.js +8 -1
  125. package/dist/needs-you.js.map +1 -1
  126. package/dist/outbound-handlers.d.ts +16 -2
  127. package/dist/outbound-handlers.js +67 -3
  128. package/dist/outbound-handlers.js.map +1 -1
  129. package/dist/outbound-schemas.d.ts +38 -0
  130. package/dist/outbound-schemas.js +12 -0
  131. package/dist/outbound-schemas.js.map +1 -1
  132. package/dist/pane-port.d.ts +107 -0
  133. package/dist/pane-port.js +2 -0
  134. package/dist/pane-port.js.map +1 -0
  135. package/dist/runtime-api.d.ts +8 -0
  136. package/dist/runtime-api.js +96 -0
  137. package/dist/runtime-api.js.map +1 -0
  138. package/dist/runtime-assets/@xterm/addon-serialize/LICENSE +21 -0
  139. package/dist/runtime-assets/@xterm/addon-serialize/lib/addon-serialize.js +2 -0
  140. package/dist/runtime-assets/@xterm/addon-serialize/lib/addon-serialize.mjs +19 -0
  141. package/dist/runtime-assets/@xterm/addon-serialize/package.json +29 -0
  142. package/dist/runtime-assets/@xterm/headless/LICENSE +21 -0
  143. package/dist/runtime-assets/@xterm/headless/lib-headless/xterm-headless.js +2 -0
  144. package/dist/runtime-assets/@xterm/headless/lib-headless/xterm-headless.mjs +46 -0
  145. package/dist/runtime-assets/@xterm/headless/package.json +29 -0
  146. package/dist/runtime-assets/node-pty/CONPTY-LICENSE +21 -0
  147. package/dist/runtime-assets/node-pty/CONPTY-NOTICE.md +503 -0
  148. package/dist/runtime-assets/node-pty/LICENSE +69 -0
  149. package/dist/runtime-assets/node-pty/lib/conpty_console_list_agent.js +16 -0
  150. package/dist/runtime-assets/node-pty/lib/eventEmitter2.js +47 -0
  151. package/dist/runtime-assets/node-pty/lib/index.js +52 -0
  152. package/dist/runtime-assets/node-pty/lib/interfaces.js +7 -0
  153. package/dist/runtime-assets/node-pty/lib/shared/conout.js +11 -0
  154. package/dist/runtime-assets/node-pty/lib/terminal.js +190 -0
  155. package/dist/runtime-assets/node-pty/lib/types.js +7 -0
  156. package/dist/runtime-assets/node-pty/lib/unixTerminal.js +346 -0
  157. package/dist/runtime-assets/node-pty/lib/utils.js +39 -0
  158. package/dist/runtime-assets/node-pty/lib/windowsConoutConnection.js +125 -0
  159. package/dist/runtime-assets/node-pty/lib/windowsPtyAgent.js +320 -0
  160. package/dist/runtime-assets/node-pty/lib/windowsTerminal.js +199 -0
  161. package/dist/runtime-assets/node-pty/lib/worker/conoutSocketWorker.js +22 -0
  162. package/dist/runtime-assets/node-pty/package.json +64 -0
  163. package/dist/runtime-assets/node-pty/prebuilds/win32-arm64/conpty/OpenConsole.exe +0 -0
  164. package/dist/runtime-assets/node-pty/prebuilds/win32-arm64/conpty/conpty.dll +0 -0
  165. package/dist/runtime-assets/node-pty/prebuilds/win32-arm64/conpty.node +0 -0
  166. package/dist/runtime-assets/node-pty/prebuilds/win32-arm64/conpty_console_list.node +0 -0
  167. package/dist/runtime-assets/node-pty/prebuilds/win32-x64/conpty/OpenConsole.exe +0 -0
  168. package/dist/runtime-assets/node-pty/prebuilds/win32-x64/conpty/conpty.dll +0 -0
  169. package/dist/runtime-assets/node-pty/prebuilds/win32-x64/conpty.node +0 -0
  170. package/dist/runtime-assets/node-pty/prebuilds/win32-x64/conpty_console_list.node +0 -0
  171. package/dist/runtime-bundle.d.ts +17 -0
  172. package/dist/runtime-bundle.js +147 -0
  173. package/dist/runtime-bundle.js.map +1 -0
  174. package/dist/runtime-cli.d.ts +2 -0
  175. package/dist/runtime-cli.js +117 -0
  176. package/dist/runtime-cli.js.map +1 -0
  177. package/dist/runtime-client-store.d.ts +49 -0
  178. package/dist/runtime-client-store.js +292 -0
  179. package/dist/runtime-client-store.js.map +1 -0
  180. package/dist/runtime-client.d.ts +100 -0
  181. package/dist/runtime-client.js +700 -0
  182. package/dist/runtime-client.js.map +1 -0
  183. package/dist/runtime-coordinator.d.ts +82 -0
  184. package/dist/runtime-coordinator.js +864 -0
  185. package/dist/runtime-coordinator.js.map +1 -0
  186. package/dist/runtime-pane-assets.d.ts +17 -0
  187. package/dist/runtime-pane-assets.js +23 -0
  188. package/dist/runtime-pane-assets.js.map +1 -0
  189. package/dist/runtime-pane-boot.d.ts +2 -0
  190. package/dist/runtime-pane-boot.js +24 -0
  191. package/dist/runtime-pane-boot.js.map +1 -0
  192. package/dist/runtime-pane-codex-index.d.ts +1 -0
  193. package/dist/runtime-pane-codex-index.js +47 -0
  194. package/dist/runtime-pane-codex-index.js.map +1 -0
  195. package/dist/runtime-pane-config.d.ts +16 -0
  196. package/dist/runtime-pane-config.js +54 -0
  197. package/dist/runtime-pane-config.js.map +1 -0
  198. package/dist/runtime-pane-host.d.ts +43 -0
  199. package/dist/runtime-pane-host.js +403 -0
  200. package/dist/runtime-pane-host.js.map +1 -0
  201. package/dist/runtime-pane-job-owner.d.ts +1 -0
  202. package/dist/runtime-pane-job-owner.js +29 -0
  203. package/dist/runtime-pane-job-owner.js.map +1 -0
  204. package/dist/runtime-pane-job.ps1 +116 -0
  205. package/dist/runtime-pane-link.d.ts +40 -0
  206. package/dist/runtime-pane-link.js +246 -0
  207. package/dist/runtime-pane-link.js.map +1 -0
  208. package/dist/runtime-pane-mcp-protocol.d.ts +32 -0
  209. package/dist/runtime-pane-mcp-protocol.js +39 -0
  210. package/dist/runtime-pane-mcp-protocol.js.map +1 -0
  211. package/dist/runtime-pane-mcp-relay.d.ts +17 -0
  212. package/dist/runtime-pane-mcp-relay.js +70 -0
  213. package/dist/runtime-pane-mcp-relay.js.map +1 -0
  214. package/dist/runtime-pane-mcp.d.ts +43 -0
  215. package/dist/runtime-pane-mcp.js +137 -0
  216. package/dist/runtime-pane-mcp.js.map +1 -0
  217. package/dist/runtime-pane-native.d.ts +45 -0
  218. package/dist/runtime-pane-native.js +65 -0
  219. package/dist/runtime-pane-native.js.map +1 -0
  220. package/dist/runtime-pane-output.d.ts +19 -0
  221. package/dist/runtime-pane-output.js +53 -0
  222. package/dist/runtime-pane-output.js.map +1 -0
  223. package/dist/runtime-pane-port.d.ts +134 -0
  224. package/dist/runtime-pane-port.js +537 -0
  225. package/dist/runtime-pane-port.js.map +1 -0
  226. package/dist/runtime-pane-private.d.ts +14 -0
  227. package/dist/runtime-pane-private.js +51 -0
  228. package/dist/runtime-pane-private.js.map +1 -0
  229. package/dist/runtime-pane-private.ps1 +14 -0
  230. package/dist/runtime-pane-process.d.ts +4 -0
  231. package/dist/runtime-pane-process.js +108 -0
  232. package/dist/runtime-pane-process.js.map +1 -0
  233. package/dist/runtime-pane-protocol.d.ts +169 -0
  234. package/dist/runtime-pane-protocol.js +189 -0
  235. package/dist/runtime-pane-protocol.js.map +1 -0
  236. package/dist/runtime-pane-screen.d.ts +19 -0
  237. package/dist/runtime-pane-screen.js +76 -0
  238. package/dist/runtime-pane-screen.js.map +1 -0
  239. package/dist/runtime-pane-service.d.ts +11 -0
  240. package/dist/runtime-pane-service.js +221 -0
  241. package/dist/runtime-pane-service.js.map +1 -0
  242. package/dist/runtime-pane-stdio-protocol.d.ts +54 -0
  243. package/dist/runtime-pane-stdio-protocol.js +94 -0
  244. package/dist/runtime-pane-stdio-protocol.js.map +1 -0
  245. package/dist/runtime-pane-stdio.d.ts +3 -0
  246. package/dist/runtime-pane-stdio.js +123 -0
  247. package/dist/runtime-pane-stdio.js.map +1 -0
  248. package/dist/runtime-pane-store.d.ts +33 -0
  249. package/dist/runtime-pane-store.js +164 -0
  250. package/dist/runtime-pane-store.js.map +1 -0
  251. package/dist/runtime-pane-transcript-protocol.d.ts +43 -0
  252. package/dist/runtime-pane-transcript-protocol.js +58 -0
  253. package/dist/runtime-pane-transcript-protocol.js.map +1 -0
  254. package/dist/runtime-pane-transcript.d.ts +45 -0
  255. package/dist/runtime-pane-transcript.js +605 -0
  256. package/dist/runtime-pane-transcript.js.map +1 -0
  257. package/dist/runtime-pane-worker.d.ts +1 -0
  258. package/dist/runtime-pane-worker.js +154 -0
  259. package/dist/runtime-pane-worker.js.map +1 -0
  260. package/dist/runtime-protocol.d.ts +149 -0
  261. package/dist/runtime-protocol.js +19 -0
  262. package/dist/runtime-protocol.js.map +1 -0
  263. package/dist/runtime-switches.d.ts +79 -0
  264. package/dist/runtime-switches.js +90 -0
  265. package/dist/runtime-switches.js.map +1 -0
  266. package/dist/runtime-transcript-delta-reader.d.ts +23 -0
  267. package/dist/runtime-transcript-delta-reader.js +74 -0
  268. package/dist/runtime-transcript-delta-reader.js.map +1 -0
  269. package/dist/runtime-transcript-source.d.ts +36 -0
  270. package/dist/runtime-transcript-source.js +189 -0
  271. package/dist/runtime-transcript-source.js.map +1 -0
  272. package/dist/runtime-windows-bridge.d.ts +41 -0
  273. package/dist/runtime-windows-bridge.js +157 -0
  274. package/dist/runtime-windows-bridge.js.map +1 -0
  275. package/dist/settings-api.js +58 -0
  276. package/dist/settings-api.js.map +1 -1
  277. package/dist/settings-change.js +28 -0
  278. package/dist/settings-change.js.map +1 -1
  279. package/dist/settings-confirmation.d.ts +15 -1
  280. package/dist/settings-confirmation.js +46 -9
  281. package/dist/settings-confirmation.js.map +1 -1
  282. package/dist/settings-effect.js +23 -1
  283. package/dist/settings-effect.js.map +1 -1
  284. package/dist/settings-http-confirmation.js +11 -2
  285. package/dist/settings-http-confirmation.js.map +1 -1
  286. package/dist/tmux-control.d.ts +2 -1
  287. package/dist/tmux-control.js.map +1 -1
  288. package/dist/tmux-manager.d.ts +2 -1
  289. package/dist/tmux-manager.js.map +1 -1
  290. package/dist/tmux-pane-host.d.ts +26 -0
  291. package/dist/tmux-pane-host.js +25 -0
  292. package/dist/tmux-pane-host.js.map +1 -0
  293. package/dist/topic-commands.js +3 -0
  294. package/dist/topic-commands.js.map +1 -1
  295. package/dist/transcript-delta-reader.d.ts +1 -1
  296. package/dist/transcript-delta-reader.js +1 -1
  297. package/dist/transcript-delta-reader.js.map +1 -1
  298. package/dist/transcript-monitor.d.ts +3 -0
  299. package/dist/transcript-monitor.js +22 -46
  300. package/dist/transcript-monitor.js.map +1 -1
  301. package/dist/transcript-needles.d.ts +35 -0
  302. package/dist/transcript-needles.js +158 -0
  303. package/dist/transcript-needles.js.map +1 -0
  304. package/dist/transcript-records.d.ts +21 -0
  305. package/dist/transcript-records.js +140 -0
  306. package/dist/transcript-records.js.map +1 -0
  307. package/dist/transcript-sources.d.ts +5 -0
  308. package/dist/transcript-sources.js +8 -79
  309. package/dist/transcript-sources.js.map +1 -1
  310. package/dist/types.d.ts +21 -0
  311. package/dist/ui/agent-proposals.js +90 -0
  312. package/dist/ui/agent-runtime.js +106 -0
  313. package/dist/ui/chat-store.js +13 -2
  314. package/dist/ui/chat-strings.js +48 -0
  315. package/dist/ui/cli-picker.js +42 -0
  316. package/dist/ui/native-instance-settings.js +47 -0
  317. package/dist/ui/native-pane-recovery.js +45 -0
  318. package/dist/ui/panel-chat.js +61 -32
  319. package/dist/ui/panel-details.js +2 -1
  320. package/dist/ui/panel-fleet.js +99 -18
  321. package/dist/ui/panel-needs.js +152 -3
  322. package/dist/ui/panel-runtimes.js +231 -0
  323. package/dist/ui/panel-settings.js +14 -8
  324. package/dist/ui/panel-windows-agent.js +86 -0
  325. package/dist/ui/panel-windows-cli.js +143 -0
  326. package/dist/ui/provider-marks.js +83 -0
  327. package/dist/ui/runtime-catalog.js +55 -0
  328. package/dist/ui/settings-catalog.js +37 -10
  329. package/dist/ui/settings-confirm.js +3 -1
  330. package/dist/ui/settings-dialogs.js +14 -5
  331. package/dist/ui/settings-registry.js +5 -0
  332. package/dist/ui/settings-strings.js +14 -0
  333. package/dist/ui/shared/app-i18n.js +2 -2
  334. package/dist/ui/shared/app-route.js +6 -2
  335. package/dist/ui/shared/app-shell.js +3 -2
  336. package/dist/ui/shared/app-store.js +1 -0
  337. package/dist/ui/shared/app-stream.js +3 -1
  338. package/dist/ui/shared/app.css +301 -0
  339. package/dist/ui/shared/app.js +4 -0
  340. package/dist/ui/shared/header-tools.js +6 -4
  341. package/dist/ui/shared/instance-nav.js +20 -4
  342. package/dist/ui/shared/instance-switch.js +4 -3
  343. package/dist/ui/shared/ui-menu.js +28 -8
  344. package/dist/ui/shared/view-strings.js +6 -0
  345. package/dist/ui/windows-agents-nav.js +2 -0
  346. package/dist/ui/windows-cli-catalog.js +79 -0
  347. package/dist/update-check.d.ts +8 -2
  348. package/dist/update-check.js +5 -2
  349. package/dist/update-check.js.map +1 -1
  350. package/dist/web-api.d.ts +25 -0
  351. package/dist/web-api.js +171 -6
  352. package/dist/web-api.js.map +1 -1
  353. package/dist/web-chat-history.d.ts +19 -2
  354. package/dist/web-chat-history.js +72 -3
  355. package/dist/web-chat-history.js.map +1 -1
  356. package/dist/web-shell-routes.d.ts +4 -1
  357. package/dist/web-shell-routes.js +7 -2
  358. package/dist/web-shell-routes.js.map +1 -1
  359. package/dist/windows-agents.d.ts +112 -0
  360. package/dist/windows-agents.js +463 -0
  361. package/dist/windows-agents.js.map +1 -0
  362. package/dist/windows-cli-api.d.ts +23 -0
  363. package/dist/windows-cli-api.js +158 -0
  364. package/dist/windows-cli-api.js.map +1 -0
  365. package/dist/windows-cli-providers.d.ts +115 -0
  366. package/dist/windows-cli-providers.js +429 -0
  367. package/dist/windows-cli-providers.js.map +1 -0
  368. package/dist/windows-cli-worker.d.ts +58 -0
  369. package/dist/windows-cli-worker.js +479 -0
  370. package/dist/windows-cli-worker.js.map +1 -0
  371. package/dist/windows-cli.d.ts +115 -0
  372. package/dist/windows-cli.js +402 -0
  373. package/dist/windows-cli.js.map +1 -0
  374. package/dist/windows-native-mcp.d.ts +19 -0
  375. package/dist/windows-native-mcp.js +143 -0
  376. package/dist/windows-native-mcp.js.map +1 -0
  377. package/dist/windows-pane-mcp.d.ts +26 -0
  378. package/dist/windows-pane-mcp.js +187 -0
  379. package/dist/windows-pane-mcp.js.map +1 -0
  380. package/package.json +9 -3
  381. package/templates/runtime-assets/conpty-LICENSE +21 -0
  382. package/templates/runtime-assets/conpty-NOTICE.md +503 -0
  383. package/templates/runtime-assets/local-pane-stage.ps1 +101 -0
  384. package/templates/runtime-assets/runtime-pane-job.ps1 +116 -0
  385. package/templates/runtime-assets/runtime-pane-private.ps1 +14 -0
  386. 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,49 @@ export function handleWebRequest(req, res, url, ctx) {
2925
2992
  });
2926
2993
  return true;
2927
2994
  }
2995
+ // ── alpha.2 (M-2300): an agent's Windows request, decided by a web-only fleet's owner in Needs you ──
2996
+ // The list is the owner's only: anyone else (a guest, a LAN or public-link session, a chat fleet's admin) reads an
2997
+ // empty one, so nothing actionable ever reaches them. The stream's `agent_proposals` event carries nothing.
2998
+ if (method === "GET" && path === "/ui/agent-proposals") {
2999
+ const list = ctx.webAgentProposals?.(req) ?? null;
3000
+ json(res, 200, { owner: list !== null, proposals: list ?? [] });
3001
+ return true;
3002
+ }
3003
+ const proposalMatch = method === "POST" ? /^\/ui\/agent-proposals\/([0-9a-f]{32})$/.exec(path) : null;
3004
+ if (proposalMatch) {
3005
+ if (!ctx.webDecideAgentProposal) {
3006
+ json(res, 404, { error: "not_found" });
3007
+ return true;
3008
+ }
3009
+ const decide = ctx.webDecideAgentProposal.bind(ctx), id = proposalMatch[1];
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
+ const decision = body && typeof body === "object" ? body.decision : undefined;
3022
+ if (decision !== "confirm" && decision !== "reject") {
3023
+ json(res, 400, { error: "decision must be confirm or reject" });
3024
+ return;
3025
+ }
3026
+ const r = await decide(req, id, decision);
3027
+ if (!res.headersSent && !res.destroyed)
3028
+ json(res, r.status, r.body);
3029
+ })().catch(err => {
3030
+ ctx.logger.error({ err: err.message }, "Agent request decision failed");
3031
+ try {
3032
+ json(res, 500, { error: "decide_failed" });
3033
+ }
3034
+ catch { /* already answered */ }
3035
+ });
3036
+ return true;
3037
+ }
2928
3038
  if (method === "POST" && path === "/ui/needs/ack") {
2929
3039
  if (!ctx.acknowledgeNeedsItem) {
2930
3040
  json(res, 404, { error: "Nothing to acknowledge here" });
@@ -3050,6 +3160,20 @@ export function handleWebRequest(req, res, url, ctx) {
3050
3160
  json(res, 400, { error: "instance and command required" });
3051
3161
  return;
3052
3162
  }
3163
+ if (isNativeExecInstance(ctx.fleetConfig?.instances[instance])) {
3164
+ json(res, 400, { error: "This runtime does not support CLI control commands; use Agent settings or Cancel" });
3165
+ return;
3166
+ }
3167
+ if (isNativePaneInstance(ctx.fleetConfig?.instances[instance])) {
3168
+ if (!nativeCliAuthorization(req, url, ctx)) {
3169
+ json(res, 403, { error: "Windows runtime requires an administrator on the local dashboard" });
3170
+ return;
3171
+ }
3172
+ if (command !== "model") {
3173
+ json(res, 400, { error: "This persistent Windows runtime supports the model command; use its shared controls for other actions" });
3174
+ return;
3175
+ }
3176
+ }
3053
3177
  if (body.args !== undefined && str(body.args, MAX_COMMAND_ARGS) === undefined) {
3054
3178
  json(res, 400, { error: "args too long" });
3055
3179
  return;
@@ -3313,6 +3437,10 @@ export function handleWebRequest(req, res, url, ctx) {
3313
3437
  const body = await parseBody(req);
3314
3438
  if (!permitWebContinuation(req, res, ctx))
3315
3439
  return;
3440
+ if (body?.runtime === "windows") {
3441
+ await createNativeInstance(req, res, url, ctx, body);
3442
+ return;
3443
+ }
3316
3444
  const v = validateArgs(CreateInstanceArgs, body, "create_instance");
3317
3445
  if (!v.ok) {
3318
3446
  json(res, 400, { error: v.error });
@@ -4074,6 +4202,9 @@ function uploadRecipient(ctx, name) {
4074
4202
  /** Closed, path-free explanations; arbitrary launch errors stay in the host log. */
4075
4203
  function webDeliveryFailure(err) {
4076
4204
  const message = err instanceof Error ? err.message : "";
4205
+ // M-2297: the per-PC agent limit — say so, with the agents holding its slots (names only: no path, no id).
4206
+ if (err instanceof MachineSlotLimitError)
4207
+ return { reason: "machine_limit", error: message, limit: err.limit, holders: err.holders.map(h => ({ name: h.name, unknown: h.unknown })) };
4077
4208
  if (/No warm slot is free/.test(message))
4078
4209
  return { reason: "wake_capacity", error: "No slot is free to wake this instance. Retry when another instance is idle." };
4079
4210
  if (/login|log in|sign in|\bauth(?:entication|orization)?\b|credential|api.?key/i.test(message))
@@ -4121,6 +4252,15 @@ function handleSendMessage(req, res, ctx) {
4121
4252
  return;
4122
4253
  }
4123
4254
  const { instance, message: typed, attachments = [], replyTo, clientId } = parsed.data;
4255
+ const native = isWindowsInstance(ctx.fleetConfig?.instances[instance]);
4256
+ if (native && !nativeCliAuthorization(req, new URL(req.url ?? "/", "http://localhost"), ctx)) {
4257
+ json(res, 403, { error: "Windows runtime requires an administrator on the local dashboard" });
4258
+ return;
4259
+ }
4260
+ if (native && attachments.length) {
4261
+ json(res, 400, { error: "Attachments are not supported by this runtime yet" });
4262
+ return;
4263
+ }
4124
4264
  // #1920 step 2b: a guest writes only to an in-scope instance, while guests may chat, and never a command.
4125
4265
  const guest = guestRequestOf(req);
4126
4266
  const refused = guestChatRefusal(guest, instance);
@@ -4196,15 +4336,39 @@ function handleSendMessage(req, res, ctx) {
4196
4336
  // Recheck the same admission all the way through a wake, before the facade's actual IPC handoff.
4197
4337
  const requestUrl = new URL(req.url ?? "/", "http://localhost");
4198
4338
  const admission = admissionOf(req, requestUrl, ctx);
4199
- const stillCurrent = () => !res.destroyed && admission !== null && admissionOf(req, requestUrl, ctx) === admission
4339
+ // The sender's authority, without the request's own lifetime: the same admission, the same guest still allowed, the
4340
+ // instance still registered (a Windows one still Windows). A Windows turn is journaled before /ui/send answers and its
4341
+ // process starts after, so the bridge rechecks this one (a revoke in between still stops it); never res, which a
4342
+ // finished response marks destroyed (S-30: every web-chat turn to a Windows agent was refused).
4343
+ const authorityCurrent = () => admission !== null && admissionOf(req, requestUrl, ctx) === admission
4200
4344
  && (!guest || (guest.current() && !guestChatRefusal(guest, instance)))
4201
- && (registered ? registeredChatInstance(ctx, instance) : ctx.instanceIpcClients.has(instance));
4345
+ && (native ? isWindowsInstance(ctx.fleetConfig?.instances[instance]) && nativeCliAuthorization(req, requestUrl, ctx)
4346
+ : registered ? registeredChatInstance(ctx, instance) : ctx.instanceIpcClients.has(instance));
4347
+ const stillCurrent = () => !res.destroyed && authorityCurrent();
4202
4348
  const message = typed;
4203
4349
  // #1939 S1: what the receipt records about who authorized it (observe only: agents still read web as recognition).
4204
4350
  const { authority } = confirmAfterBody(arrival, webAuthorityOf(req, new URL(req.url ?? "/", "http://localhost"), ctx, instance));
4205
4351
  const ts = new Date().toISOString();
4206
4352
  // The id the agent is given, and the one its delivery reports come back under: the page's ticks.
4207
- const messageId = newWebMessageId();
4353
+ const nativeRequestId = isNativeExecInstance(ctx.fleetConfig?.instances[instance]) ? (() => {
4354
+ if (!clientId)
4355
+ return randomUUID();
4356
+ const hash = createHash("sha256").update(`agend-native-web\0${WebSendDedupe.key(person.key, instance, clientId)}`).digest("hex");
4357
+ return `${hash.slice(0, 8)}-${hash.slice(8, 12)}-4${hash.slice(13, 16)}-8${hash.slice(17, 20)}-${hash.slice(20, 32)}`;
4358
+ })() : undefined;
4359
+ const messageId = nativeRequestId ? `native:${nativeRequestId}:user` : newWebMessageId();
4360
+ if (nativeRequestId && ctx.nativeInstanceRuntime) {
4361
+ const previous = ctx.nativeInstanceRuntime().get(instance)?.turns.find(turn => turn.id === nativeRequestId);
4362
+ if (previous) {
4363
+ if (previous.prompt !== delivery.text) {
4364
+ json(res, 409, { error: "clientId belongs to a different message" });
4365
+ return;
4366
+ }
4367
+ acceptedId = messageId;
4368
+ json(res, 200, { sent: true, messageId, repeated: true });
4369
+ return;
4370
+ }
4371
+ }
4208
4372
  // Use real Telegram context so daemon's lastChatId/lastThreadId are set,
4209
4373
  // enabling reply tool even when first message comes from Web UI.
4210
4374
  // Pure Web UI mode (no channel config) leaves these empty; the agent's reply then comes back to the
@@ -4250,11 +4414,12 @@ function handleSendMessage(req, res, ctx) {
4250
4414
  let delivered;
4251
4415
  try {
4252
4416
  const deliver = (name, payload) => ctx.deliverHumanToInstance
4253
- ? ctx.deliverHumanToInstance(name, payload, webHumanOrigin(false, authority), typed, { stillCurrent })
4254
- : ctx.deliverToInstance(name, payload, { stillCurrent });
4417
+ ? ctx.deliverHumanToInstance(name, payload, webHumanOrigin(false, authority), typed, { stillCurrent, ...(native ? { authorityCurrent } : {}) })
4418
+ : ctx.deliverToInstance(name, payload, { stillCurrent, ...(native ? { authorityCurrent } : {}) });
4255
4419
  delivered = await deliver(instance, {
4256
4420
  type: "fleet_inbound",
4257
4421
  content: delivery.text,
4422
+ ...(nativeRequestId ? { requestId: nativeRequestId } : {}),
4258
4423
  targetSession: instance,
4259
4424
  meta: {
4260
4425
  chat_id: groupId ? String(groupId) : "",