@tulex-cli/tulex-code 0.1.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 (3094) hide show
  1. package/README.md +54 -0
  2. package/dist/.last_build +0 -0
  3. package/dist/index.d.ts +7 -0
  4. package/dist/index.js +98 -0
  5. package/dist/index.js.map +1 -0
  6. package/dist/package.json +121 -0
  7. package/dist/src/acp-integration/acpAgent.d.ts +59 -0
  8. package/dist/src/acp-integration/acpAgent.js +3646 -0
  9. package/dist/src/acp-integration/acpAgent.js.map +1 -0
  10. package/dist/src/acp-integration/acpAgent.test.d.ts +6 -0
  11. package/dist/src/acp-integration/acpAgent.test.js +3690 -0
  12. package/dist/src/acp-integration/acpAgent.test.js.map +1 -0
  13. package/dist/src/acp-integration/acpAgent.worktree.test.d.ts +16 -0
  14. package/dist/src/acp-integration/acpAgent.worktree.test.js +354 -0
  15. package/dist/src/acp-integration/acpAgent.worktree.test.js.map +1 -0
  16. package/dist/src/acp-integration/authMethods.d.ts +9 -0
  17. package/dist/src/acp-integration/authMethods.js +28 -0
  18. package/dist/src/acp-integration/authMethods.js.map +1 -0
  19. package/dist/src/acp-integration/authMethods.test.d.ts +6 -0
  20. package/dist/src/acp-integration/authMethods.test.js +23 -0
  21. package/dist/src/acp-integration/authMethods.test.js.map +1 -0
  22. package/dist/src/acp-integration/authPreflight.test.d.ts +6 -0
  23. package/dist/src/acp-integration/authPreflight.test.js +54 -0
  24. package/dist/src/acp-integration/authPreflight.test.js.map +1 -0
  25. package/dist/src/acp-integration/errorCodes.d.ts +15 -0
  26. package/dist/src/acp-integration/errorCodes.js +22 -0
  27. package/dist/src/acp-integration/errorCodes.js.map +1 -0
  28. package/dist/src/acp-integration/runtimeOutputDirContext.d.ts +2 -0
  29. package/dist/src/acp-integration/runtimeOutputDirContext.js +5 -0
  30. package/dist/src/acp-integration/runtimeOutputDirContext.js.map +1 -0
  31. package/dist/src/acp-integration/runtimeOutputDirContext.test.d.ts +1 -0
  32. package/dist/src/acp-integration/runtimeOutputDirContext.test.js +29 -0
  33. package/dist/src/acp-integration/runtimeOutputDirContext.test.js.map +1 -0
  34. package/dist/src/acp-integration/service/filesystem.d.ts +17 -0
  35. package/dist/src/acp-integration/service/filesystem.js +73 -0
  36. package/dist/src/acp-integration/service/filesystem.js.map +1 -0
  37. package/dist/src/acp-integration/service/filesystem.test.d.ts +6 -0
  38. package/dist/src/acp-integration/service/filesystem.test.js +85 -0
  39. package/dist/src/acp-integration/service/filesystem.test.js.map +1 -0
  40. package/dist/src/acp-integration/session/HistoryReplayer.d.ts +63 -0
  41. package/dist/src/acp-integration/session/HistoryReplayer.js +222 -0
  42. package/dist/src/acp-integration/session/HistoryReplayer.js.map +1 -0
  43. package/dist/src/acp-integration/session/HistoryReplayer.test.d.ts +6 -0
  44. package/dist/src/acp-integration/session/HistoryReplayer.test.js +405 -0
  45. package/dist/src/acp-integration/session/HistoryReplayer.test.js.map +1 -0
  46. package/dist/src/acp-integration/session/Session.d.ts +150 -0
  47. package/dist/src/acp-integration/session/Session.js +2381 -0
  48. package/dist/src/acp-integration/session/Session.js.map +1 -0
  49. package/dist/src/acp-integration/session/Session.test.d.ts +6 -0
  50. package/dist/src/acp-integration/session/Session.test.js +3845 -0
  51. package/dist/src/acp-integration/session/Session.test.js.map +1 -0
  52. package/dist/src/acp-integration/session/Session.worktree.test.d.ts +18 -0
  53. package/dist/src/acp-integration/session/Session.worktree.test.js +195 -0
  54. package/dist/src/acp-integration/session/Session.worktree.test.js.map +1 -0
  55. package/dist/src/acp-integration/session/SubAgentTracker.d.ts +58 -0
  56. package/dist/src/acp-integration/session/SubAgentTracker.js +208 -0
  57. package/dist/src/acp-integration/session/SubAgentTracker.js.map +1 -0
  58. package/dist/src/acp-integration/session/SubAgentTracker.test.d.ts +6 -0
  59. package/dist/src/acp-integration/session/SubAgentTracker.test.js +612 -0
  60. package/dist/src/acp-integration/session/SubAgentTracker.test.js.map +1 -0
  61. package/dist/src/acp-integration/session/emitters/BaseEmitter.d.ts +34 -0
  62. package/dist/src/acp-integration/session/emitters/BaseEmitter.js +53 -0
  63. package/dist/src/acp-integration/session/emitters/BaseEmitter.js.map +1 -0
  64. package/dist/src/acp-integration/session/emitters/MessageEmitter.d.ts +61 -0
  65. package/dist/src/acp-integration/session/emitters/MessageEmitter.js +124 -0
  66. package/dist/src/acp-integration/session/emitters/MessageEmitter.js.map +1 -0
  67. package/dist/src/acp-integration/session/emitters/MessageEmitter.test.d.ts +6 -0
  68. package/dist/src/acp-integration/session/emitters/MessageEmitter.test.js +202 -0
  69. package/dist/src/acp-integration/session/emitters/MessageEmitter.test.js.map +1 -0
  70. package/dist/src/acp-integration/session/emitters/PlanEmitter.d.ts +39 -0
  71. package/dist/src/acp-integration/session/emitters/PlanEmitter.js +83 -0
  72. package/dist/src/acp-integration/session/emitters/PlanEmitter.js.map +1 -0
  73. package/dist/src/acp-integration/session/emitters/PlanEmitter.test.d.ts +6 -0
  74. package/dist/src/acp-integration/session/emitters/PlanEmitter.test.js +176 -0
  75. package/dist/src/acp-integration/session/emitters/PlanEmitter.test.js.map +1 -0
  76. package/dist/src/acp-integration/session/emitters/ToolCallEmitter.d.ts +82 -0
  77. package/dist/src/acp-integration/session/emitters/ToolCallEmitter.js +284 -0
  78. package/dist/src/acp-integration/session/emitters/ToolCallEmitter.js.map +1 -0
  79. package/dist/src/acp-integration/session/emitters/ToolCallEmitter.test.d.ts +6 -0
  80. package/dist/src/acp-integration/session/emitters/ToolCallEmitter.test.js +607 -0
  81. package/dist/src/acp-integration/session/emitters/ToolCallEmitter.test.js.map +1 -0
  82. package/dist/src/acp-integration/session/emitters/index.d.ts +9 -0
  83. package/dist/src/acp-integration/session/emitters/index.js +10 -0
  84. package/dist/src/acp-integration/session/emitters/index.js.map +1 -0
  85. package/dist/src/acp-integration/session/index.d.ts +24 -0
  86. package/dist/src/acp-integration/session/index.js +16 -0
  87. package/dist/src/acp-integration/session/index.js.map +1 -0
  88. package/dist/src/acp-integration/session/permissionUtils.d.ts +9 -0
  89. package/dist/src/acp-integration/session/permissionUtils.js +165 -0
  90. package/dist/src/acp-integration/session/permissionUtils.js.map +1 -0
  91. package/dist/src/acp-integration/session/permissionUtils.test.d.ts +6 -0
  92. package/dist/src/acp-integration/session/permissionUtils.test.js +83 -0
  93. package/dist/src/acp-integration/session/permissionUtils.test.js.map +1 -0
  94. package/dist/src/acp-integration/session/rewrite/LlmRewriter.d.ts +26 -0
  95. package/dist/src/acp-integration/session/rewrite/LlmRewriter.js +131 -0
  96. package/dist/src/acp-integration/session/rewrite/LlmRewriter.js.map +1 -0
  97. package/dist/src/acp-integration/session/rewrite/LlmRewriter.test.d.ts +6 -0
  98. package/dist/src/acp-integration/session/rewrite/LlmRewriter.test.js +188 -0
  99. package/dist/src/acp-integration/session/rewrite/LlmRewriter.test.js.map +1 -0
  100. package/dist/src/acp-integration/session/rewrite/MessageRewriteMiddleware.d.ts +42 -0
  101. package/dist/src/acp-integration/session/rewrite/MessageRewriteMiddleware.js +159 -0
  102. package/dist/src/acp-integration/session/rewrite/MessageRewriteMiddleware.js.map +1 -0
  103. package/dist/src/acp-integration/session/rewrite/MessageRewriteMiddleware.test.d.ts +6 -0
  104. package/dist/src/acp-integration/session/rewrite/MessageRewriteMiddleware.test.js +255 -0
  105. package/dist/src/acp-integration/session/rewrite/MessageRewriteMiddleware.test.js.map +1 -0
  106. package/dist/src/acp-integration/session/rewrite/README.md +35 -0
  107. package/dist/src/acp-integration/session/rewrite/TurnBuffer.d.ts +25 -0
  108. package/dist/src/acp-integration/session/rewrite/TurnBuffer.js +53 -0
  109. package/dist/src/acp-integration/session/rewrite/TurnBuffer.js.map +1 -0
  110. package/dist/src/acp-integration/session/rewrite/TurnBuffer.test.d.ts +6 -0
  111. package/dist/src/acp-integration/session/rewrite/TurnBuffer.test.js +95 -0
  112. package/dist/src/acp-integration/session/rewrite/TurnBuffer.test.js.map +1 -0
  113. package/dist/src/acp-integration/session/rewrite/config.d.ts +13 -0
  114. package/dist/src/acp-integration/session/rewrite/config.js +19 -0
  115. package/dist/src/acp-integration/session/rewrite/config.js.map +1 -0
  116. package/dist/src/acp-integration/session/rewrite/config.test.d.ts +6 -0
  117. package/dist/src/acp-integration/session/rewrite/config.test.js +72 -0
  118. package/dist/src/acp-integration/session/rewrite/config.test.js.map +1 -0
  119. package/dist/src/acp-integration/session/rewrite/index.d.ts +8 -0
  120. package/dist/src/acp-integration/session/rewrite/index.js +8 -0
  121. package/dist/src/acp-integration/session/rewrite/index.js.map +1 -0
  122. package/dist/src/acp-integration/session/rewrite/types.d.ts +36 -0
  123. package/dist/src/acp-integration/session/rewrite/types.js +7 -0
  124. package/dist/src/acp-integration/session/rewrite/types.js.map +1 -0
  125. package/dist/src/acp-integration/session/types.d.ts +93 -0
  126. package/dist/src/acp-integration/session/types.js +7 -0
  127. package/dist/src/acp-integration/session/types.js.map +1 -0
  128. package/dist/src/commands/auth.d.ts +9 -0
  129. package/dist/src/commands/auth.js +55 -0
  130. package/dist/src/commands/auth.js.map +1 -0
  131. package/dist/src/commands/auth.test.d.ts +6 -0
  132. package/dist/src/commands/auth.test.js +84 -0
  133. package/dist/src/commands/auth.test.js.map +1 -0
  134. package/dist/src/commands/channel/channel-registry.d.ts +4 -0
  135. package/dist/src/commands/channel/channel-registry.js +33 -0
  136. package/dist/src/commands/channel/channel-registry.js.map +1 -0
  137. package/dist/src/commands/channel/config-utils.d.ts +4 -0
  138. package/dist/src/commands/channel/config-utils.js +66 -0
  139. package/dist/src/commands/channel/config-utils.js.map +1 -0
  140. package/dist/src/commands/channel/config-utils.test.d.ts +1 -0
  141. package/dist/src/commands/channel/config-utils.test.js +142 -0
  142. package/dist/src/commands/channel/config-utils.test.js.map +1 -0
  143. package/dist/src/commands/channel/configure.d.ts +4 -0
  144. package/dist/src/commands/channel/configure.js +65 -0
  145. package/dist/src/commands/channel/configure.js.map +1 -0
  146. package/dist/src/commands/channel/pairing.d.ts +8 -0
  147. package/dist/src/commands/channel/pairing.js +49 -0
  148. package/dist/src/commands/channel/pairing.js.map +1 -0
  149. package/dist/src/commands/channel/pidfile.d.ts +25 -0
  150. package/dist/src/commands/channel/pidfile.js +104 -0
  151. package/dist/src/commands/channel/pidfile.js.map +1 -0
  152. package/dist/src/commands/channel/pidfile.test.d.ts +1 -0
  153. package/dist/src/commands/channel/pidfile.test.js +143 -0
  154. package/dist/src/commands/channel/pidfile.test.js.map +1 -0
  155. package/dist/src/commands/channel/start.d.ts +16 -0
  156. package/dist/src/commands/channel/start.js +352 -0
  157. package/dist/src/commands/channel/start.js.map +1 -0
  158. package/dist/src/commands/channel/start.test.d.ts +1 -0
  159. package/dist/src/commands/channel/start.test.js +156 -0
  160. package/dist/src/commands/channel/start.test.js.map +1 -0
  161. package/dist/src/commands/channel/status.d.ts +2 -0
  162. package/dist/src/commands/channel/status.js +58 -0
  163. package/dist/src/commands/channel/status.js.map +1 -0
  164. package/dist/src/commands/channel/stop.d.ts +2 -0
  165. package/dist/src/commands/channel/stop.js +34 -0
  166. package/dist/src/commands/channel/stop.js.map +1 -0
  167. package/dist/src/commands/channel.d.ts +2 -0
  168. package/dist/src/commands/channel.js +29 -0
  169. package/dist/src/commands/channel.js.map +1 -0
  170. package/dist/src/commands/extensions/consent.d.ts +47 -0
  171. package/dist/src/commands/extensions/consent.js +182 -0
  172. package/dist/src/commands/extensions/consent.js.map +1 -0
  173. package/dist/src/commands/extensions/consent.test.d.ts +6 -0
  174. package/dist/src/commands/extensions/consent.test.js +277 -0
  175. package/dist/src/commands/extensions/consent.test.js.map +1 -0
  176. package/dist/src/commands/extensions/disable.d.ts +13 -0
  177. package/dist/src/commands/extensions/disable.js +65 -0
  178. package/dist/src/commands/extensions/disable.js.map +1 -0
  179. package/dist/src/commands/extensions/disable.test.d.ts +6 -0
  180. package/dist/src/commands/extensions/disable.test.js +101 -0
  181. package/dist/src/commands/extensions/disable.test.js.map +1 -0
  182. package/dist/src/commands/extensions/enable.d.ts +13 -0
  183. package/dist/src/commands/extensions/enable.js +70 -0
  184. package/dist/src/commands/extensions/enable.js.map +1 -0
  185. package/dist/src/commands/extensions/enable.test.d.ts +6 -0
  186. package/dist/src/commands/extensions/enable.test.js +93 -0
  187. package/dist/src/commands/extensions/enable.test.js.map +1 -0
  188. package/dist/src/commands/extensions/examples/agent/agents/diary.md +86 -0
  189. package/dist/src/commands/extensions/examples/agent/qwen-extension.json +5 -0
  190. package/dist/src/commands/extensions/examples/commands/commands/fs/grep-code.md +3 -0
  191. package/dist/src/commands/extensions/examples/commands/qwen-extension.json +5 -0
  192. package/dist/src/commands/extensions/examples/context/QWEN.md +8 -0
  193. package/dist/src/commands/extensions/examples/context/qwen-extension.json +5 -0
  194. package/dist/src/commands/extensions/examples/mcp-server/example.ts +60 -0
  195. package/dist/src/commands/extensions/examples/mcp-server/package.json +18 -0
  196. package/dist/src/commands/extensions/examples/mcp-server/qwen-extension.json +12 -0
  197. package/dist/src/commands/extensions/examples/mcp-server/tsconfig.json +13 -0
  198. package/dist/src/commands/extensions/examples/skills/qwen-extension.json +5 -0
  199. package/dist/src/commands/extensions/examples/skills/skills/synonyms/SKILL.md +48 -0
  200. package/dist/src/commands/extensions/install.d.ts +17 -0
  201. package/dist/src/commands/extensions/install.js +105 -0
  202. package/dist/src/commands/extensions/install.js.map +1 -0
  203. package/dist/src/commands/extensions/install.test.d.ts +6 -0
  204. package/dist/src/commands/extensions/install.test.js +164 -0
  205. package/dist/src/commands/extensions/install.test.js.map +1 -0
  206. package/dist/src/commands/extensions/link.d.ts +12 -0
  207. package/dist/src/commands/extensions/link.js +48 -0
  208. package/dist/src/commands/extensions/link.js.map +1 -0
  209. package/dist/src/commands/extensions/link.test.d.ts +6 -0
  210. package/dist/src/commands/extensions/link.test.js +74 -0
  211. package/dist/src/commands/extensions/link.test.js.map +1 -0
  212. package/dist/src/commands/extensions/list.d.ts +8 -0
  213. package/dist/src/commands/extensions/list.js +35 -0
  214. package/dist/src/commands/extensions/list.js.map +1 -0
  215. package/dist/src/commands/extensions/list.test.d.ts +6 -0
  216. package/dist/src/commands/extensions/list.test.js +76 -0
  217. package/dist/src/commands/extensions/list.test.js.map +1 -0
  218. package/dist/src/commands/extensions/new.d.ts +7 -0
  219. package/dist/src/commands/extensions/new.js +95 -0
  220. package/dist/src/commands/extensions/new.js.map +1 -0
  221. package/dist/src/commands/extensions/new.test.d.ts +6 -0
  222. package/dist/src/commands/extensions/new.test.js +59 -0
  223. package/dist/src/commands/extensions/new.test.js.map +1 -0
  224. package/dist/src/commands/extensions/settings.d.ts +7 -0
  225. package/dist/src/commands/extensions/settings.js +115 -0
  226. package/dist/src/commands/extensions/settings.js.map +1 -0
  227. package/dist/src/commands/extensions/settings.test.d.ts +6 -0
  228. package/dist/src/commands/extensions/settings.test.js +251 -0
  229. package/dist/src/commands/extensions/settings.test.js.map +1 -0
  230. package/dist/src/commands/extensions/uninstall.d.ts +12 -0
  231. package/dist/src/commands/extensions/uninstall.js +50 -0
  232. package/dist/src/commands/extensions/uninstall.js.map +1 -0
  233. package/dist/src/commands/extensions/uninstall.test.d.ts +6 -0
  234. package/dist/src/commands/extensions/uninstall.test.js +18 -0
  235. package/dist/src/commands/extensions/uninstall.test.js.map +1 -0
  236. package/dist/src/commands/extensions/update.d.ts +13 -0
  237. package/dist/src/commands/extensions/update.js +102 -0
  238. package/dist/src/commands/extensions/update.js.map +1 -0
  239. package/dist/src/commands/extensions/update.test.d.ts +6 -0
  240. package/dist/src/commands/extensions/update.test.js +185 -0
  241. package/dist/src/commands/extensions/update.test.js.map +1 -0
  242. package/dist/src/commands/extensions/utils.d.ts +8 -0
  243. package/dist/src/commands/extensions/utils.js +79 -0
  244. package/dist/src/commands/extensions/utils.js.map +1 -0
  245. package/dist/src/commands/extensions/utils.test.d.ts +6 -0
  246. package/dist/src/commands/extensions/utils.test.js +147 -0
  247. package/dist/src/commands/extensions/utils.test.js.map +1 -0
  248. package/dist/src/commands/extensions.d.ts +7 -0
  249. package/dist/src/commands/extensions.js +35 -0
  250. package/dist/src/commands/extensions.js.map +1 -0
  251. package/dist/src/commands/extensions.test.d.ts +6 -0
  252. package/dist/src/commands/extensions.test.js +72 -0
  253. package/dist/src/commands/extensions.test.js.map +1 -0
  254. package/dist/src/commands/hooks.d.ts +7 -0
  255. package/dist/src/commands/hooks.js +20 -0
  256. package/dist/src/commands/hooks.js.map +1 -0
  257. package/dist/src/commands/mcp/add.d.ts +7 -0
  258. package/dist/src/commands/mcp/add.js +247 -0
  259. package/dist/src/commands/mcp/add.js.map +1 -0
  260. package/dist/src/commands/mcp/list.d.ts +8 -0
  261. package/dist/src/commands/mcp/list.js +118 -0
  262. package/dist/src/commands/mcp/list.js.map +1 -0
  263. package/dist/src/commands/mcp/reconnect.d.ts +7 -0
  264. package/dist/src/commands/mcp/reconnect.js +154 -0
  265. package/dist/src/commands/mcp/reconnect.js.map +1 -0
  266. package/dist/src/commands/mcp/remove.d.ts +7 -0
  267. package/dist/src/commands/mcp/remove.js +54 -0
  268. package/dist/src/commands/mcp/remove.js.map +1 -0
  269. package/dist/src/commands/mcp.d.ts +7 -0
  270. package/dist/src/commands/mcp.js +25 -0
  271. package/dist/src/commands/mcp.js.map +1 -0
  272. package/dist/src/commands/review/cleanup.d.ts +7 -0
  273. package/dist/src/commands/review/cleanup.js +81 -0
  274. package/dist/src/commands/review/cleanup.js.map +1 -0
  275. package/dist/src/commands/review/deterministic.d.ts +7 -0
  276. package/dist/src/commands/review/deterministic.js +474 -0
  277. package/dist/src/commands/review/deterministic.js.map +1 -0
  278. package/dist/src/commands/review/fetch-pr.d.ts +7 -0
  279. package/dist/src/commands/review/fetch-pr.js +124 -0
  280. package/dist/src/commands/review/fetch-pr.js.map +1 -0
  281. package/dist/src/commands/review/lib/gh.d.ts +34 -0
  282. package/dist/src/commands/review/lib/gh.js +64 -0
  283. package/dist/src/commands/review/lib/gh.js.map +1 -0
  284. package/dist/src/commands/review/lib/git.d.ts +18 -0
  285. package/dist/src/commands/review/lib/git.js +41 -0
  286. package/dist/src/commands/review/lib/git.js.map +1 -0
  287. package/dist/src/commands/review/lib/paths.d.ts +23 -0
  288. package/dist/src/commands/review/lib/paths.js +37 -0
  289. package/dist/src/commands/review/lib/paths.js.map +1 -0
  290. package/dist/src/commands/review/load-rules.d.ts +7 -0
  291. package/dist/src/commands/review/load-rules.js +112 -0
  292. package/dist/src/commands/review/load-rules.js.map +1 -0
  293. package/dist/src/commands/review/pr-context.d.ts +7 -0
  294. package/dist/src/commands/review/pr-context.js +214 -0
  295. package/dist/src/commands/review/pr-context.js.map +1 -0
  296. package/dist/src/commands/review/presubmit.d.ts +7 -0
  297. package/dist/src/commands/review/presubmit.js +190 -0
  298. package/dist/src/commands/review/presubmit.js.map +1 -0
  299. package/dist/src/commands/review.d.ts +7 -0
  300. package/dist/src/commands/review.js +28 -0
  301. package/dist/src/commands/review.js.map +1 -0
  302. package/dist/src/commands/serve.d.ts +21 -0
  303. package/dist/src/commands/serve.js +214 -0
  304. package/dist/src/commands/serve.js.map +1 -0
  305. package/dist/src/commands/sp.d.ts +7 -0
  306. package/dist/src/commands/sp.js +62 -0
  307. package/dist/src/commands/sp.js.map +1 -0
  308. package/dist/src/config/auth.d.ts +10 -0
  309. package/dist/src/config/auth.js +183 -0
  310. package/dist/src/config/auth.js.map +1 -0
  311. package/dist/src/config/auth.test.d.ts +6 -0
  312. package/dist/src/config/auth.test.js +292 -0
  313. package/dist/src/config/auth.test.js.map +1 -0
  314. package/dist/src/config/config.d.ts +144 -0
  315. package/dist/src/config/config.js +1618 -0
  316. package/dist/src/config/config.js.map +1 -0
  317. package/dist/src/config/jsonSchemaArg.test.d.ts +6 -0
  318. package/dist/src/config/jsonSchemaArg.test.js +305 -0
  319. package/dist/src/config/jsonSchemaArg.test.js.map +1 -0
  320. package/dist/src/config/keyBindings.d.ts +89 -0
  321. package/dist/src/config/keyBindings.js +188 -0
  322. package/dist/src/config/keyBindings.js.map +1 -0
  323. package/dist/src/config/keyBindings.test.d.ts +6 -0
  324. package/dist/src/config/keyBindings.test.js +51 -0
  325. package/dist/src/config/keyBindings.test.js.map +1 -0
  326. package/dist/src/config/loadedSettingsAdapter.d.ts +15 -0
  327. package/dist/src/config/loadedSettingsAdapter.js +80 -0
  328. package/dist/src/config/loadedSettingsAdapter.js.map +1 -0
  329. package/dist/src/config/loadedSettingsAdapter.test.d.ts +6 -0
  330. package/dist/src/config/loadedSettingsAdapter.test.js +127 -0
  331. package/dist/src/config/loadedSettingsAdapter.test.js.map +1 -0
  332. package/dist/src/config/migration/index.d.ts +59 -0
  333. package/dist/src/config/migration/index.js +94 -0
  334. package/dist/src/config/migration/index.js.map +1 -0
  335. package/dist/src/config/migration/index.test.d.ts +6 -0
  336. package/dist/src/config/migration/index.test.js +295 -0
  337. package/dist/src/config/migration/index.test.js.map +1 -0
  338. package/dist/src/config/migration/scheduler.d.ts +51 -0
  339. package/dist/src/config/migration/scheduler.js +95 -0
  340. package/dist/src/config/migration/scheduler.js.map +1 -0
  341. package/dist/src/config/migration/scheduler.test.d.ts +6 -0
  342. package/dist/src/config/migration/scheduler.test.js +129 -0
  343. package/dist/src/config/migration/scheduler.test.js.map +1 -0
  344. package/dist/src/config/migration/types.d.ts +53 -0
  345. package/dist/src/config/migration/types.js +7 -0
  346. package/dist/src/config/migration/types.js.map +1 -0
  347. package/dist/src/config/migration/versions/v1-to-v2-shared.d.ts +27 -0
  348. package/dist/src/config/migration/versions/v1-to-v2-shared.js +174 -0
  349. package/dist/src/config/migration/versions/v1-to-v2-shared.js.map +1 -0
  350. package/dist/src/config/migration/versions/v1-to-v2.d.ts +81 -0
  351. package/dist/src/config/migration/versions/v1-to-v2.js +222 -0
  352. package/dist/src/config/migration/versions/v1-to-v2.js.map +1 -0
  353. package/dist/src/config/migration/versions/v1-to-v2.test.d.ts +6 -0
  354. package/dist/src/config/migration/versions/v1-to-v2.test.js +189 -0
  355. package/dist/src/config/migration/versions/v1-to-v2.test.js.map +1 -0
  356. package/dist/src/config/migration/versions/v2-to-v3.d.ts +61 -0
  357. package/dist/src/config/migration/versions/v2-to-v3.js +185 -0
  358. package/dist/src/config/migration/versions/v2-to-v3.js.map +1 -0
  359. package/dist/src/config/migration/versions/v2-to-v3.test.d.ts +6 -0
  360. package/dist/src/config/migration/versions/v2-to-v3.test.js +337 -0
  361. package/dist/src/config/migration/versions/v2-to-v3.test.js.map +1 -0
  362. package/dist/src/config/migration/versions/v3-to-v4.d.ts +34 -0
  363. package/dist/src/config/migration/versions/v3-to-v4.js +126 -0
  364. package/dist/src/config/migration/versions/v3-to-v4.js.map +1 -0
  365. package/dist/src/config/migration/versions/v3-to-v4.test.d.ts +6 -0
  366. package/dist/src/config/migration/versions/v3-to-v4.test.js +164 -0
  367. package/dist/src/config/migration/versions/v3-to-v4.test.js.map +1 -0
  368. package/dist/src/config/modelProvidersScope.d.ts +20 -0
  369. package/dist/src/config/modelProvidersScope.js +39 -0
  370. package/dist/src/config/modelProvidersScope.js.map +1 -0
  371. package/dist/src/config/modelProvidersScope.test.d.ts +6 -0
  372. package/dist/src/config/modelProvidersScope.test.js +66 -0
  373. package/dist/src/config/modelProvidersScope.test.js.map +1 -0
  374. package/dist/src/config/path-freshness.test.d.ts +6 -0
  375. package/dist/src/config/path-freshness.test.js +52 -0
  376. package/dist/src/config/path-freshness.test.js.map +1 -0
  377. package/dist/src/config/sandboxConfig.d.ts +13 -0
  378. package/dist/src/config/sandboxConfig.js +74 -0
  379. package/dist/src/config/sandboxConfig.js.map +1 -0
  380. package/dist/src/config/settings.d.ts +119 -0
  381. package/dist/src/config/settings.js +1015 -0
  382. package/dist/src/config/settings.js.map +1 -0
  383. package/dist/src/config/settingsSchema.d.ts +2207 -0
  384. package/dist/src/config/settingsSchema.js +2246 -0
  385. package/dist/src/config/settingsSchema.js.map +1 -0
  386. package/dist/src/config/settingsSchema.test.d.ts +6 -0
  387. package/dist/src/config/settingsSchema.test.js +232 -0
  388. package/dist/src/config/settingsSchema.test.js.map +1 -0
  389. package/dist/src/config/trustedFolders.d.ts +54 -0
  390. package/dist/src/config/trustedFolders.js +176 -0
  391. package/dist/src/config/trustedFolders.js.map +1 -0
  392. package/dist/src/config/trustedFolders.test.d.ts +6 -0
  393. package/dist/src/config/trustedFolders.test.js +354 -0
  394. package/dist/src/config/trustedFolders.test.js.map +1 -0
  395. package/dist/src/core/auth.d.ts +13 -0
  396. package/dist/src/core/auth.js +34 -0
  397. package/dist/src/core/auth.js.map +1 -0
  398. package/dist/src/core/auth.test.d.ts +6 -0
  399. package/dist/src/core/auth.test.js +47 -0
  400. package/dist/src/core/auth.test.js.map +1 -0
  401. package/dist/src/core/initializer.d.ts +21 -0
  402. package/dist/src/core/initializer.js +42 -0
  403. package/dist/src/core/initializer.js.map +1 -0
  404. package/dist/src/core/initializer.test.d.ts +6 -0
  405. package/dist/src/core/initializer.test.js +123 -0
  406. package/dist/src/core/initializer.test.js.map +1 -0
  407. package/dist/src/core/theme.d.ts +12 -0
  408. package/dist/src/core/theme.js +25 -0
  409. package/dist/src/core/theme.js.map +1 -0
  410. package/dist/src/core/theme.test.d.ts +6 -0
  411. package/dist/src/core/theme.test.js +57 -0
  412. package/dist/src/core/theme.test.js.map +1 -0
  413. package/dist/src/dualOutput/DualOutputBridge.d.ts +84 -0
  414. package/dist/src/dualOutput/DualOutputBridge.js +293 -0
  415. package/dist/src/dualOutput/DualOutputBridge.js.map +1 -0
  416. package/dist/src/dualOutput/DualOutputBridge.test.d.ts +6 -0
  417. package/dist/src/dualOutput/DualOutputBridge.test.js +157 -0
  418. package/dist/src/dualOutput/DualOutputBridge.test.js.map +1 -0
  419. package/dist/src/dualOutput/DualOutputContext.d.ts +19 -0
  420. package/dist/src/dualOutput/DualOutputContext.js +22 -0
  421. package/dist/src/dualOutput/DualOutputContext.js.map +1 -0
  422. package/dist/src/dualOutput/index.d.ts +7 -0
  423. package/dist/src/dualOutput/index.js +8 -0
  424. package/dist/src/dualOutput/index.js.map +1 -0
  425. package/dist/src/export/index.d.ts +6 -0
  426. package/dist/src/export/index.js +7 -0
  427. package/dist/src/export/index.js.map +1 -0
  428. package/dist/src/gemini.d.ts +13 -0
  429. package/dist/src/gemini.js +908 -0
  430. package/dist/src/gemini.js.map +1 -0
  431. package/dist/src/gemini.test.d.ts +6 -0
  432. package/dist/src/gemini.test.js +975 -0
  433. package/dist/src/gemini.test.js.map +1 -0
  434. package/dist/src/generated/git-commit.d.ts +7 -0
  435. package/dist/src/generated/git-commit.js +10 -0
  436. package/dist/src/generated/git-commit.js.map +1 -0
  437. package/dist/src/i18n/index.d.ts +27 -0
  438. package/dist/src/i18n/index.js +213 -0
  439. package/dist/src/i18n/index.js.map +1 -0
  440. package/dist/src/i18n/index.test.d.ts +6 -0
  441. package/dist/src/i18n/index.test.js +103 -0
  442. package/dist/src/i18n/index.test.js.map +1 -0
  443. package/dist/src/i18n/languages.d.ts +43 -0
  444. package/dist/src/i18n/languages.js +138 -0
  445. package/dist/src/i18n/languages.js.map +1 -0
  446. package/dist/src/i18n/locales/ca.js +3951 -0
  447. package/dist/src/i18n/locales/de.js +2018 -0
  448. package/dist/src/i18n/locales/en.js +2161 -0
  449. package/dist/src/i18n/locales/fr.js +2013 -0
  450. package/dist/src/i18n/locales/ja.js +1780 -0
  451. package/dist/src/i18n/locales/pt.js +2005 -0
  452. package/dist/src/i18n/locales/ru.js +1993 -0
  453. package/dist/src/i18n/locales/zh-TW.js +1729 -0
  454. package/dist/src/i18n/locales/zh.js +1929 -0
  455. package/dist/src/i18n/mustTranslateKeys.d.ts +12 -0
  456. package/dist/src/i18n/mustTranslateKeys.js +111 -0
  457. package/dist/src/i18n/mustTranslateKeys.js.map +1 -0
  458. package/dist/src/i18n/mustTranslateKeys.test.d.ts +6 -0
  459. package/dist/src/i18n/mustTranslateKeys.test.js +103 -0
  460. package/dist/src/i18n/mustTranslateKeys.test.js.map +1 -0
  461. package/dist/src/i18n/translationDict.d.ts +9 -0
  462. package/dist/src/i18n/translationDict.js +17 -0
  463. package/dist/src/i18n/translationDict.js.map +1 -0
  464. package/dist/src/nonInteractive/control/ControlContext.d.ts +71 -0
  465. package/dist/src/nonInteractive/control/ControlContext.js +36 -0
  466. package/dist/src/nonInteractive/control/ControlContext.js.map +1 -0
  467. package/dist/src/nonInteractive/control/ControlDispatcher.d.ts +116 -0
  468. package/dist/src/nonInteractive/control/ControlDispatcher.js +290 -0
  469. package/dist/src/nonInteractive/control/ControlDispatcher.js.map +1 -0
  470. package/dist/src/nonInteractive/control/ControlDispatcher.test.d.ts +6 -0
  471. package/dist/src/nonInteractive/control/ControlDispatcher.test.js +614 -0
  472. package/dist/src/nonInteractive/control/ControlDispatcher.test.js.map +1 -0
  473. package/dist/src/nonInteractive/control/ControlService.d.ts +79 -0
  474. package/dist/src/nonInteractive/control/ControlService.js +139 -0
  475. package/dist/src/nonInteractive/control/ControlService.js.map +1 -0
  476. package/dist/src/nonInteractive/control/controllers/baseController.d.ts +53 -0
  477. package/dist/src/nonInteractive/control/controllers/baseController.js +136 -0
  478. package/dist/src/nonInteractive/control/controllers/baseController.js.map +1 -0
  479. package/dist/src/nonInteractive/control/controllers/hookController.d.ts +25 -0
  480. package/dist/src/nonInteractive/control/controllers/hookController.js +40 -0
  481. package/dist/src/nonInteractive/control/controllers/hookController.js.map +1 -0
  482. package/dist/src/nonInteractive/control/controllers/permissionController.d.ts +57 -0
  483. package/dist/src/nonInteractive/control/controllers/permissionController.js +361 -0
  484. package/dist/src/nonInteractive/control/controllers/permissionController.js.map +1 -0
  485. package/dist/src/nonInteractive/control/controllers/permissionController.test.d.ts +6 -0
  486. package/dist/src/nonInteractive/control/controllers/permissionController.test.js +140 -0
  487. package/dist/src/nonInteractive/control/controllers/permissionController.test.js.map +1 -0
  488. package/dist/src/nonInteractive/control/controllers/sdkMcpController.d.ts +54 -0
  489. package/dist/src/nonInteractive/control/controllers/sdkMcpController.js +80 -0
  490. package/dist/src/nonInteractive/control/controllers/sdkMcpController.js.map +1 -0
  491. package/dist/src/nonInteractive/control/controllers/systemController.d.ts +67 -0
  492. package/dist/src/nonInteractive/control/controllers/systemController.js +326 -0
  493. package/dist/src/nonInteractive/control/controllers/systemController.js.map +1 -0
  494. package/dist/src/nonInteractive/control/controllers/systemController.test.d.ts +6 -0
  495. package/dist/src/nonInteractive/control/controllers/systemController.test.js +121 -0
  496. package/dist/src/nonInteractive/control/controllers/systemController.test.js.map +1 -0
  497. package/dist/src/nonInteractive/control/types/serviceAPIs.d.ts +105 -0
  498. package/dist/src/nonInteractive/control/types/serviceAPIs.js +7 -0
  499. package/dist/src/nonInteractive/control/types/serviceAPIs.js.map +1 -0
  500. package/dist/src/nonInteractive/io/BaseJsonOutputAdapter.d.ts +505 -0
  501. package/dist/src/nonInteractive/io/BaseJsonOutputAdapter.js +1041 -0
  502. package/dist/src/nonInteractive/io/BaseJsonOutputAdapter.js.map +1 -0
  503. package/dist/src/nonInteractive/io/BaseJsonOutputAdapter.test.d.ts +6 -0
  504. package/dist/src/nonInteractive/io/BaseJsonOutputAdapter.test.js +1304 -0
  505. package/dist/src/nonInteractive/io/BaseJsonOutputAdapter.test.js.map +1 -0
  506. package/dist/src/nonInteractive/io/JsonOutputAdapter.d.ts +29 -0
  507. package/dist/src/nonInteractive/io/JsonOutputAdapter.js +64 -0
  508. package/dist/src/nonInteractive/io/JsonOutputAdapter.js.map +1 -0
  509. package/dist/src/nonInteractive/io/JsonOutputAdapter.test.d.ts +6 -0
  510. package/dist/src/nonInteractive/io/JsonOutputAdapter.test.js +684 -0
  511. package/dist/src/nonInteractive/io/JsonOutputAdapter.test.js.map +1 -0
  512. package/dist/src/nonInteractive/io/StreamJsonInputReader.d.ts +16 -0
  513. package/dist/src/nonInteractive/io/StreamJsonInputReader.js +54 -0
  514. package/dist/src/nonInteractive/io/StreamJsonInputReader.js.map +1 -0
  515. package/dist/src/nonInteractive/io/StreamJsonInputReader.test.d.ts +6 -0
  516. package/dist/src/nonInteractive/io/StreamJsonInputReader.test.js +178 -0
  517. package/dist/src/nonInteractive/io/StreamJsonInputReader.test.js.map +1 -0
  518. package/dist/src/nonInteractive/io/StreamJsonOutputAdapter.d.ts +84 -0
  519. package/dist/src/nonInteractive/io/StreamJsonOutputAdapter.dualOutput.test.d.ts +6 -0
  520. package/dist/src/nonInteractive/io/StreamJsonOutputAdapter.dualOutput.test.js +118 -0
  521. package/dist/src/nonInteractive/io/StreamJsonOutputAdapter.dualOutput.test.js.map +1 -0
  522. package/dist/src/nonInteractive/io/StreamJsonOutputAdapter.js +227 -0
  523. package/dist/src/nonInteractive/io/StreamJsonOutputAdapter.js.map +1 -0
  524. package/dist/src/nonInteractive/io/StreamJsonOutputAdapter.test.d.ts +6 -0
  525. package/dist/src/nonInteractive/io/StreamJsonOutputAdapter.test.js +1046 -0
  526. package/dist/src/nonInteractive/io/StreamJsonOutputAdapter.test.js.map +1 -0
  527. package/dist/src/nonInteractive/io/index.d.ts +6 -0
  528. package/dist/src/nonInteractive/io/index.js +7 -0
  529. package/dist/src/nonInteractive/io/index.js.map +1 -0
  530. package/dist/src/nonInteractive/session.d.ts +8 -0
  531. package/dist/src/nonInteractive/session.js +664 -0
  532. package/dist/src/nonInteractive/session.js.map +1 -0
  533. package/dist/src/nonInteractive/session.test.d.ts +6 -0
  534. package/dist/src/nonInteractive/session.test.js +680 -0
  535. package/dist/src/nonInteractive/session.test.js.map +1 -0
  536. package/dist/src/nonInteractive/types.d.ts +415 -0
  537. package/dist/src/nonInteractive/types.js +77 -0
  538. package/dist/src/nonInteractive/types.js.map +1 -0
  539. package/dist/src/nonInteractiveCli.d.ts +33 -0
  540. package/dist/src/nonInteractiveCli.js +1058 -0
  541. package/dist/src/nonInteractiveCli.js.map +1 -0
  542. package/dist/src/nonInteractiveCliCommands.d.ts +59 -0
  543. package/dist/src/nonInteractiveCliCommands.js +326 -0
  544. package/dist/src/nonInteractiveCliCommands.js.map +1 -0
  545. package/dist/src/nonInteractiveCliCommands.test.d.ts +6 -0
  546. package/dist/src/nonInteractiveCliCommands.test.js +484 -0
  547. package/dist/src/nonInteractiveCliCommands.test.js.map +1 -0
  548. package/dist/src/patches/is-in-ci.d.ts +7 -0
  549. package/dist/src/patches/is-in-ci.js +15 -0
  550. package/dist/src/patches/is-in-ci.js.map +1 -0
  551. package/dist/src/remoteInput/RemoteInputContext.d.ts +8 -0
  552. package/dist/src/remoteInput/RemoteInputContext.js +9 -0
  553. package/dist/src/remoteInput/RemoteInputContext.js.map +1 -0
  554. package/dist/src/remoteInput/RemoteInputWatcher.d.ts +83 -0
  555. package/dist/src/remoteInput/RemoteInputWatcher.js +201 -0
  556. package/dist/src/remoteInput/RemoteInputWatcher.js.map +1 -0
  557. package/dist/src/remoteInput/RemoteInputWatcher.test.d.ts +6 -0
  558. package/dist/src/remoteInput/RemoteInputWatcher.test.js +100 -0
  559. package/dist/src/remoteInput/RemoteInputWatcher.test.js.map +1 -0
  560. package/dist/src/remoteInput/index.d.ts +7 -0
  561. package/dist/src/remoteInput/index.js +8 -0
  562. package/dist/src/remoteInput/index.js.map +1 -0
  563. package/dist/src/serve/auth/deviceFlow.d.ts +595 -0
  564. package/dist/src/serve/auth/deviceFlow.js +1243 -0
  565. package/dist/src/serve/auth/deviceFlow.js.map +1 -0
  566. package/dist/src/serve/auth/deviceFlow.test.d.ts +6 -0
  567. package/dist/src/serve/auth/deviceFlow.test.js +1314 -0
  568. package/dist/src/serve/auth/deviceFlow.test.js.map +1 -0
  569. package/dist/src/serve/auth/qwenDeviceFlowProvider.d.ts +30 -0
  570. package/dist/src/serve/auth/qwenDeviceFlowProvider.js +331 -0
  571. package/dist/src/serve/auth/qwenDeviceFlowProvider.js.map +1 -0
  572. package/dist/src/serve/auth/qwenDeviceFlowProvider.test.d.ts +6 -0
  573. package/dist/src/serve/auth/qwenDeviceFlowProvider.test.js +301 -0
  574. package/dist/src/serve/auth/qwenDeviceFlowProvider.test.js.map +1 -0
  575. package/dist/src/serve/auth.d.ts +101 -0
  576. package/dist/src/serve/auth.js +216 -0
  577. package/dist/src/serve/auth.js.map +1 -0
  578. package/dist/src/serve/capabilities.d.ts +196 -0
  579. package/dist/src/serve/capabilities.js +227 -0
  580. package/dist/src/serve/capabilities.js.map +1 -0
  581. package/dist/src/serve/daemonStatusProvider.d.ts +14 -0
  582. package/dist/src/serve/daemonStatusProvider.js +252 -0
  583. package/dist/src/serve/daemonStatusProvider.js.map +1 -0
  584. package/dist/src/serve/debugMode.d.ts +27 -0
  585. package/dist/src/serve/debugMode.js +33 -0
  586. package/dist/src/serve/debugMode.js.map +1 -0
  587. package/dist/src/serve/demo.d.ts +11 -0
  588. package/dist/src/serve/demo.js +640 -0
  589. package/dist/src/serve/demo.js.map +1 -0
  590. package/dist/src/serve/envSnapshot.d.ts +28 -0
  591. package/dist/src/serve/envSnapshot.js +199 -0
  592. package/dist/src/serve/envSnapshot.js.map +1 -0
  593. package/dist/src/serve/envSnapshot.test.d.ts +6 -0
  594. package/dist/src/serve/envSnapshot.test.js +181 -0
  595. package/dist/src/serve/envSnapshot.test.js.map +1 -0
  596. package/dist/src/serve/eventBus.d.ts +6 -0
  597. package/dist/src/serve/eventBus.js +15 -0
  598. package/dist/src/serve/eventBus.js.map +1 -0
  599. package/dist/src/serve/fs/audit.d.ts +144 -0
  600. package/dist/src/serve/fs/audit.js +193 -0
  601. package/dist/src/serve/fs/audit.js.map +1 -0
  602. package/dist/src/serve/fs/audit.test.d.ts +6 -0
  603. package/dist/src/serve/fs/audit.test.js +246 -0
  604. package/dist/src/serve/fs/audit.test.js.map +1 -0
  605. package/dist/src/serve/fs/contract.test.d.ts +6 -0
  606. package/dist/src/serve/fs/contract.test.js +211 -0
  607. package/dist/src/serve/fs/contract.test.js.map +1 -0
  608. package/dist/src/serve/fs/errors.d.ts +87 -0
  609. package/dist/src/serve/fs/errors.js +128 -0
  610. package/dist/src/serve/fs/errors.js.map +1 -0
  611. package/dist/src/serve/fs/errors.test.d.ts +6 -0
  612. package/dist/src/serve/fs/errors.test.js +152 -0
  613. package/dist/src/serve/fs/errors.test.js.map +1 -0
  614. package/dist/src/serve/fs/index.d.ts +10 -0
  615. package/dist/src/serve/fs/index.js +11 -0
  616. package/dist/src/serve/fs/index.js.map +1 -0
  617. package/dist/src/serve/fs/paths.d.ts +103 -0
  618. package/dist/src/serve/fs/paths.js +433 -0
  619. package/dist/src/serve/fs/paths.js.map +1 -0
  620. package/dist/src/serve/fs/paths.test.d.ts +6 -0
  621. package/dist/src/serve/fs/paths.test.js +309 -0
  622. package/dist/src/serve/fs/paths.test.js.map +1 -0
  623. package/dist/src/serve/fs/policy.d.ts +142 -0
  624. package/dist/src/serve/fs/policy.js +189 -0
  625. package/dist/src/serve/fs/policy.js.map +1 -0
  626. package/dist/src/serve/fs/policy.test.d.ts +6 -0
  627. package/dist/src/serve/fs/policy.test.js +193 -0
  628. package/dist/src/serve/fs/policy.test.js.map +1 -0
  629. package/dist/src/serve/fs/workspaceFileSystem.d.ts +157 -0
  630. package/dist/src/serve/fs/workspaceFileSystem.js +1377 -0
  631. package/dist/src/serve/fs/workspaceFileSystem.js.map +1 -0
  632. package/dist/src/serve/fs/workspaceFileSystem.test.d.ts +6 -0
  633. package/dist/src/serve/fs/workspaceFileSystem.test.js +880 -0
  634. package/dist/src/serve/fs/workspaceFileSystem.test.js.map +1 -0
  635. package/dist/src/serve/httpAcpBridge.d.ts +80 -0
  636. package/dist/src/serve/httpAcpBridge.js +3559 -0
  637. package/dist/src/serve/httpAcpBridge.js.map +1 -0
  638. package/dist/src/serve/httpAcpBridge.test.d.ts +6 -0
  639. package/dist/src/serve/httpAcpBridge.test.js +4987 -0
  640. package/dist/src/serve/httpAcpBridge.test.js.map +1 -0
  641. package/dist/src/serve/inMemoryChannel.d.ts +6 -0
  642. package/dist/src/serve/inMemoryChannel.js +14 -0
  643. package/dist/src/serve/inMemoryChannel.js.map +1 -0
  644. package/dist/src/serve/index.d.ts +15 -0
  645. package/dist/src/serve/index.js +16 -0
  646. package/dist/src/serve/index.js.map +1 -0
  647. package/dist/src/serve/loopbackBinds.d.ts +18 -0
  648. package/dist/src/serve/loopbackBinds.js +33 -0
  649. package/dist/src/serve/loopbackBinds.js.map +1 -0
  650. package/dist/src/serve/routes/workspaceFileRead.d.ts +90 -0
  651. package/dist/src/serve/routes/workspaceFileRead.js +458 -0
  652. package/dist/src/serve/routes/workspaceFileRead.js.map +1 -0
  653. package/dist/src/serve/routes/workspaceFileRead.test.d.ts +6 -0
  654. package/dist/src/serve/routes/workspaceFileRead.test.js +453 -0
  655. package/dist/src/serve/routes/workspaceFileRead.test.js.map +1 -0
  656. package/dist/src/serve/routes/workspaceFileWrite.d.ts +17 -0
  657. package/dist/src/serve/routes/workspaceFileWrite.js +224 -0
  658. package/dist/src/serve/routes/workspaceFileWrite.js.map +1 -0
  659. package/dist/src/serve/routes/workspaceFileWrite.test.d.ts +6 -0
  660. package/dist/src/serve/routes/workspaceFileWrite.test.js +223 -0
  661. package/dist/src/serve/routes/workspaceFileWrite.test.js.map +1 -0
  662. package/dist/src/serve/runQwenServe.d.ts +67 -0
  663. package/dist/src/serve/runQwenServe.js +616 -0
  664. package/dist/src/serve/runQwenServe.js.map +1 -0
  665. package/dist/src/serve/server.d.ts +125 -0
  666. package/dist/src/serve/server.js +2297 -0
  667. package/dist/src/serve/server.js.map +1 -0
  668. package/dist/src/serve/status.d.ts +6 -0
  669. package/dist/src/serve/status.js +13 -0
  670. package/dist/src/serve/status.js.map +1 -0
  671. package/dist/src/serve/types.d.ts +175 -0
  672. package/dist/src/serve/types.js +10 -0
  673. package/dist/src/serve/types.js.map +1 -0
  674. package/dist/src/serve/workspaceAgents.d.ts +47 -0
  675. package/dist/src/serve/workspaceAgents.js +1171 -0
  676. package/dist/src/serve/workspaceAgents.js.map +1 -0
  677. package/dist/src/serve/workspaceAgents.test.d.ts +6 -0
  678. package/dist/src/serve/workspaceAgents.test.js +823 -0
  679. package/dist/src/serve/workspaceAgents.test.js.map +1 -0
  680. package/dist/src/serve/workspaceMemory.d.ts +60 -0
  681. package/dist/src/serve/workspaceMemory.js +323 -0
  682. package/dist/src/serve/workspaceMemory.js.map +1 -0
  683. package/dist/src/serve/workspaceMemory.test.d.ts +6 -0
  684. package/dist/src/serve/workspaceMemory.test.js +418 -0
  685. package/dist/src/serve/workspaceMemory.test.js.map +1 -0
  686. package/dist/src/services/BuiltinCommandLoader.d.ts +24 -0
  687. package/dist/src/services/BuiltinCommandLoader.js +159 -0
  688. package/dist/src/services/BuiltinCommandLoader.js.map +1 -0
  689. package/dist/src/services/BuiltinCommandLoader.test.d.ts +6 -0
  690. package/dist/src/services/BuiltinCommandLoader.test.js +234 -0
  691. package/dist/src/services/BuiltinCommandLoader.test.js.map +1 -0
  692. package/dist/src/services/BundledSkillLoader.d.ts +17 -0
  693. package/dist/src/services/BundledSkillLoader.js +97 -0
  694. package/dist/src/services/BundledSkillLoader.js.map +1 -0
  695. package/dist/src/services/BundledSkillLoader.test.d.ts +6 -0
  696. package/dist/src/services/BundledSkillLoader.test.js +301 -0
  697. package/dist/src/services/BundledSkillLoader.test.js.map +1 -0
  698. package/dist/src/services/CommandService.d.ts +69 -0
  699. package/dist/src/services/CommandService.js +128 -0
  700. package/dist/src/services/CommandService.js.map +1 -0
  701. package/dist/src/services/CommandService.test.d.ts +6 -0
  702. package/dist/src/services/CommandService.test.js +263 -0
  703. package/dist/src/services/CommandService.test.js.map +1 -0
  704. package/dist/src/services/FileCommandLoader-extension.test.d.ts +6 -0
  705. package/dist/src/services/FileCommandLoader-extension.test.js +279 -0
  706. package/dist/src/services/FileCommandLoader-extension.test.js.map +1 -0
  707. package/dist/src/services/FileCommandLoader-markdown.test.d.ts +6 -0
  708. package/dist/src/services/FileCommandLoader-markdown.test.js +111 -0
  709. package/dist/src/services/FileCommandLoader-markdown.test.js.map +1 -0
  710. package/dist/src/services/FileCommandLoader.d.ts +64 -0
  711. package/dist/src/services/FileCommandLoader.js +259 -0
  712. package/dist/src/services/FileCommandLoader.js.map +1 -0
  713. package/dist/src/services/McpPromptLoader.d.ts +35 -0
  714. package/dist/src/services/McpPromptLoader.js +261 -0
  715. package/dist/src/services/McpPromptLoader.js.map +1 -0
  716. package/dist/src/services/McpPromptLoader.test.d.ts +6 -0
  717. package/dist/src/services/McpPromptLoader.test.js +341 -0
  718. package/dist/src/services/McpPromptLoader.test.js.map +1 -0
  719. package/dist/src/services/SkillCommandLoader.d.ts +23 -0
  720. package/dist/src/services/SkillCommandLoader.js +110 -0
  721. package/dist/src/services/SkillCommandLoader.js.map +1 -0
  722. package/dist/src/services/SkillCommandLoader.test.d.ts +6 -0
  723. package/dist/src/services/SkillCommandLoader.test.js +307 -0
  724. package/dist/src/services/SkillCommandLoader.test.js.map +1 -0
  725. package/dist/src/services/command-factory.d.ts +25 -0
  726. package/dist/src/services/command-factory.js +122 -0
  727. package/dist/src/services/command-factory.js.map +1 -0
  728. package/dist/src/services/command-factory.test.d.ts +6 -0
  729. package/dist/src/services/command-factory.test.js +31 -0
  730. package/dist/src/services/command-factory.test.js.map +1 -0
  731. package/dist/src/services/command-migration-tool.d.ts +39 -0
  732. package/dist/src/services/command-migration-tool.js +135 -0
  733. package/dist/src/services/command-migration-tool.js.map +1 -0
  734. package/dist/src/services/command-migration-tool.test.d.ts +6 -0
  735. package/dist/src/services/command-migration-tool.test.js +175 -0
  736. package/dist/src/services/command-migration-tool.test.js.map +1 -0
  737. package/dist/src/services/commandMetadata.d.ts +21 -0
  738. package/dist/src/services/commandMetadata.js +106 -0
  739. package/dist/src/services/commandMetadata.js.map +1 -0
  740. package/dist/src/services/commandMetadata.test.d.ts +6 -0
  741. package/dist/src/services/commandMetadata.test.js +216 -0
  742. package/dist/src/services/commandMetadata.test.js.map +1 -0
  743. package/dist/src/services/commandUtils.d.ts +36 -0
  744. package/dist/src/services/commandUtils.js +57 -0
  745. package/dist/src/services/commandUtils.js.map +1 -0
  746. package/dist/src/services/commandUtils.test.d.ts +6 -0
  747. package/dist/src/services/commandUtils.test.js +159 -0
  748. package/dist/src/services/commandUtils.test.js.map +1 -0
  749. package/dist/src/services/insight/generators/DataProcessor.d.ts +23 -0
  750. package/dist/src/services/insight/generators/DataProcessor.js +1001 -0
  751. package/dist/src/services/insight/generators/DataProcessor.js.map +1 -0
  752. package/dist/src/services/insight/generators/DataProcessor.test.d.ts +6 -0
  753. package/dist/src/services/insight/generators/DataProcessor.test.js +1210 -0
  754. package/dist/src/services/insight/generators/DataProcessor.test.js.map +1 -0
  755. package/dist/src/services/insight/generators/StaticInsightGenerator.d.ts +16 -0
  756. package/dist/src/services/insight/generators/StaticInsightGenerator.js +63 -0
  757. package/dist/src/services/insight/generators/StaticInsightGenerator.js.map +1 -0
  758. package/dist/src/services/insight/generators/StaticInsightGenerator.test.d.ts +6 -0
  759. package/dist/src/services/insight/generators/StaticInsightGenerator.test.js +60 -0
  760. package/dist/src/services/insight/generators/StaticInsightGenerator.test.js.map +1 -0
  761. package/dist/src/services/insight/generators/TemplateRenderer.d.ts +9 -0
  762. package/dist/src/services/insight/generators/TemplateRenderer.js +49 -0
  763. package/dist/src/services/insight/generators/TemplateRenderer.js.map +1 -0
  764. package/dist/src/services/insight/types/QualitativeInsightTypes.d.ts +74 -0
  765. package/dist/src/services/insight/types/QualitativeInsightTypes.js +2 -0
  766. package/dist/src/services/insight/types/QualitativeInsightTypes.js.map +1 -0
  767. package/dist/src/services/insight/types/StaticInsightTypes.d.ts +59 -0
  768. package/dist/src/services/insight/types/StaticInsightTypes.js +7 -0
  769. package/dist/src/services/insight/types/StaticInsightTypes.js.map +1 -0
  770. package/dist/src/services/markdown-command-parser.d.ts +52 -0
  771. package/dist/src/services/markdown-command-parser.js +60 -0
  772. package/dist/src/services/markdown-command-parser.js.map +1 -0
  773. package/dist/src/services/markdown-command-parser.test.d.ts +6 -0
  774. package/dist/src/services/markdown-command-parser.test.js +146 -0
  775. package/dist/src/services/markdown-command-parser.test.js.map +1 -0
  776. package/dist/src/services/notificationService.d.ts +19 -0
  777. package/dist/src/services/notificationService.js +64 -0
  778. package/dist/src/services/notificationService.js.map +1 -0
  779. package/dist/src/services/notificationService.test.d.ts +6 -0
  780. package/dist/src/services/notificationService.test.js +114 -0
  781. package/dist/src/services/notificationService.test.js.map +1 -0
  782. package/dist/src/services/prompt-processors/argumentProcessor.d.ts +16 -0
  783. package/dist/src/services/prompt-processors/argumentProcessor.js +21 -0
  784. package/dist/src/services/prompt-processors/argumentProcessor.js.map +1 -0
  785. package/dist/src/services/prompt-processors/atFileProcessor.d.ts +12 -0
  786. package/dist/src/services/prompt-processors/atFileProcessor.js +63 -0
  787. package/dist/src/services/prompt-processors/atFileProcessor.js.map +1 -0
  788. package/dist/src/services/prompt-processors/atFileProcessor.test.d.ts +6 -0
  789. package/dist/src/services/prompt-processors/atFileProcessor.test.js +174 -0
  790. package/dist/src/services/prompt-processors/atFileProcessor.test.js.map +1 -0
  791. package/dist/src/services/prompt-processors/injectionParser.d.ts +29 -0
  792. package/dist/src/services/prompt-processors/injectionParser.js +60 -0
  793. package/dist/src/services/prompt-processors/injectionParser.js.map +1 -0
  794. package/dist/src/services/prompt-processors/injectionParser.test.d.ts +6 -0
  795. package/dist/src/services/prompt-processors/injectionParser.test.js +189 -0
  796. package/dist/src/services/prompt-processors/injectionParser.test.js.map +1 -0
  797. package/dist/src/services/prompt-processors/shellProcessor.d.ts +27 -0
  798. package/dist/src/services/prompt-processors/shellProcessor.js +146 -0
  799. package/dist/src/services/prompt-processors/shellProcessor.js.map +1 -0
  800. package/dist/src/services/prompt-processors/types.d.ts +45 -0
  801. package/dist/src/services/prompt-processors/types.js +20 -0
  802. package/dist/src/services/prompt-processors/types.js.map +1 -0
  803. package/dist/src/services/test-commands/example.md +5 -0
  804. package/dist/src/services/tips/index.d.ts +10 -0
  805. package/dist/src/services/tips/index.js +21 -0
  806. package/dist/src/services/tips/index.js.map +1 -0
  807. package/dist/src/services/tips/tipHistory.d.ts +49 -0
  808. package/dist/src/services/tips/tipHistory.js +138 -0
  809. package/dist/src/services/tips/tipHistory.js.map +1 -0
  810. package/dist/src/services/tips/tipHistory.test.d.ts +6 -0
  811. package/dist/src/services/tips/tipHistory.test.js +102 -0
  812. package/dist/src/services/tips/tipHistory.test.js.map +1 -0
  813. package/dist/src/services/tips/tipRegistry.d.ts +32 -0
  814. package/dist/src/services/tips/tipRegistry.js +148 -0
  815. package/dist/src/services/tips/tipRegistry.js.map +1 -0
  816. package/dist/src/services/tips/tipRegistry.test.d.ts +6 -0
  817. package/dist/src/services/tips/tipRegistry.test.js +65 -0
  818. package/dist/src/services/tips/tipRegistry.test.js.map +1 -0
  819. package/dist/src/services/tips/tipScheduler.d.ts +21 -0
  820. package/dist/src/services/tips/tipScheduler.js +38 -0
  821. package/dist/src/services/tips/tipScheduler.js.map +1 -0
  822. package/dist/src/services/tips/tipScheduler.test.d.ts +6 -0
  823. package/dist/src/services/tips/tipScheduler.test.js +126 -0
  824. package/dist/src/services/tips/tipScheduler.test.js.map +1 -0
  825. package/dist/src/services/types.d.ts +22 -0
  826. package/dist/src/services/types.js +7 -0
  827. package/dist/src/services/types.js.map +1 -0
  828. package/dist/src/startup/worktreeStartup.d.ts +112 -0
  829. package/dist/src/startup/worktreeStartup.js +350 -0
  830. package/dist/src/startup/worktreeStartup.js.map +1 -0
  831. package/dist/src/startup/worktreeStartup.test.d.ts +6 -0
  832. package/dist/src/startup/worktreeStartup.test.js +332 -0
  833. package/dist/src/startup/worktreeStartup.test.js.map +1 -0
  834. package/dist/src/test-utils/customMatchers.d.ts +14 -0
  835. package/dist/src/test-utils/customMatchers.js +40 -0
  836. package/dist/src/test-utils/customMatchers.js.map +1 -0
  837. package/dist/src/test-utils/mockCommandContext.d.ts +18 -0
  838. package/dist/src/test-utils/mockCommandContext.js +107 -0
  839. package/dist/src/test-utils/mockCommandContext.js.map +1 -0
  840. package/dist/src/test-utils/mockCommandContext.test.d.ts +6 -0
  841. package/dist/src/test-utils/mockCommandContext.test.js +51 -0
  842. package/dist/src/test-utils/mockCommandContext.test.js.map +1 -0
  843. package/dist/src/test-utils/render.d.ts +14 -0
  844. package/dist/src/test-utils/render.js +15 -0
  845. package/dist/src/test-utils/render.js.map +1 -0
  846. package/dist/src/ui/App.d.ts +6 -0
  847. package/dist/src/ui/App.js +65 -0
  848. package/dist/src/ui/App.js.map +1 -0
  849. package/dist/src/ui/AppContainer.d.ts +24 -0
  850. package/dist/src/ui/AppContainer.js +2853 -0
  851. package/dist/src/ui/AppContainer.js.map +1 -0
  852. package/dist/src/ui/AppContainer.test.d.ts +6 -0
  853. package/dist/src/ui/AppContainer.test.js +2368 -0
  854. package/dist/src/ui/AppContainer.test.js.map +1 -0
  855. package/dist/src/ui/CommandFormatMigrationNudge.d.ts +14 -0
  856. package/dist/src/ui/CommandFormatMigrationNudge.js +44 -0
  857. package/dist/src/ui/CommandFormatMigrationNudge.js.map +1 -0
  858. package/dist/src/ui/FeedbackDialog.d.ts +9 -0
  859. package/dist/src/ui/FeedbackDialog.js +44 -0
  860. package/dist/src/ui/FeedbackDialog.js.map +1 -0
  861. package/dist/src/ui/IdeIntegrationNudge.d.ts +16 -0
  862. package/dist/src/ui/IdeIntegrationNudge.js +53 -0
  863. package/dist/src/ui/IdeIntegrationNudge.js.map +1 -0
  864. package/dist/src/ui/auth/AuthDialog.d.ts +7 -0
  865. package/dist/src/ui/auth/AuthDialog.js +214 -0
  866. package/dist/src/ui/auth/AuthDialog.js.map +1 -0
  867. package/dist/src/ui/auth/AuthDialog.test.d.ts +6 -0
  868. package/dist/src/ui/auth/AuthDialog.test.js +1029 -0
  869. package/dist/src/ui/auth/AuthDialog.test.js.map +1 -0
  870. package/dist/src/ui/auth/AuthInProgress.d.ts +11 -0
  871. package/dist/src/ui/auth/AuthInProgress.js +24 -0
  872. package/dist/src/ui/auth/AuthInProgress.js.map +1 -0
  873. package/dist/src/ui/auth/ProviderSetupSteps.d.ts +11 -0
  874. package/dist/src/ui/auth/ProviderSetupSteps.js +320 -0
  875. package/dist/src/ui/auth/ProviderSetupSteps.js.map +1 -0
  876. package/dist/src/ui/auth/ProviderSetupSteps.test.d.ts +6 -0
  877. package/dist/src/ui/auth/ProviderSetupSteps.test.js +322 -0
  878. package/dist/src/ui/auth/ProviderSetupSteps.test.js.map +1 -0
  879. package/dist/src/ui/auth/useAuth.d.ts +76 -0
  880. package/dist/src/ui/auth/useAuth.js +192 -0
  881. package/dist/src/ui/auth/useAuth.js.map +1 -0
  882. package/dist/src/ui/auth/useAuth.test.d.ts +6 -0
  883. package/dist/src/ui/auth/useAuth.test.js +267 -0
  884. package/dist/src/ui/auth/useAuth.test.js.map +1 -0
  885. package/dist/src/ui/auth/useProviderSetupFlow.d.ts +54 -0
  886. package/dist/src/ui/auth/useProviderSetupFlow.js +380 -0
  887. package/dist/src/ui/auth/useProviderSetupFlow.js.map +1 -0
  888. package/dist/src/ui/colors.d.ts +7 -0
  889. package/dist/src/ui/colors.js +60 -0
  890. package/dist/src/ui/colors.js.map +1 -0
  891. package/dist/src/ui/commands/aboutCommand.d.ts +7 -0
  892. package/dist/src/ui/commands/aboutCommand.js +69 -0
  893. package/dist/src/ui/commands/aboutCommand.js.map +1 -0
  894. package/dist/src/ui/commands/agentsCommand.d.ts +7 -0
  895. package/dist/src/ui/commands/agentsCommand.js +42 -0
  896. package/dist/src/ui/commands/agentsCommand.js.map +1 -0
  897. package/dist/src/ui/commands/approvalModeCommand.d.ts +7 -0
  898. package/dist/src/ui/commands/approvalModeCommand.js +89 -0
  899. package/dist/src/ui/commands/approvalModeCommand.js.map +1 -0
  900. package/dist/src/ui/commands/approvalModeCommand.test.d.ts +6 -0
  901. package/dist/src/ui/commands/approvalModeCommand.test.js +112 -0
  902. package/dist/src/ui/commands/approvalModeCommand.test.js.map +1 -0
  903. package/dist/src/ui/commands/arenaCommand.agentComplete.test.d.ts +6 -0
  904. package/dist/src/ui/commands/arenaCommand.agentComplete.test.js +118 -0
  905. package/dist/src/ui/commands/arenaCommand.agentComplete.test.js.map +1 -0
  906. package/dist/src/ui/commands/arenaCommand.d.ts +7 -0
  907. package/dist/src/ui/commands/arenaCommand.js +519 -0
  908. package/dist/src/ui/commands/arenaCommand.js.map +1 -0
  909. package/dist/src/ui/commands/arenaCommand.test.d.ts +6 -0
  910. package/dist/src/ui/commands/arenaCommand.test.js +352 -0
  911. package/dist/src/ui/commands/arenaCommand.test.js.map +1 -0
  912. package/dist/src/ui/commands/authCommand.d.ts +7 -0
  913. package/dist/src/ui/commands/authCommand.js +31 -0
  914. package/dist/src/ui/commands/authCommand.js.map +1 -0
  915. package/dist/src/ui/commands/branchCommand.d.ts +7 -0
  916. package/dist/src/ui/commands/branchCommand.js +49 -0
  917. package/dist/src/ui/commands/branchCommand.js.map +1 -0
  918. package/dist/src/ui/commands/branchCommand.test.d.ts +6 -0
  919. package/dist/src/ui/commands/branchCommand.test.js +57 -0
  920. package/dist/src/ui/commands/branchCommand.test.js.map +1 -0
  921. package/dist/src/ui/commands/btwCommand.d.ts +7 -0
  922. package/dist/src/ui/commands/btwCommand.js +164 -0
  923. package/dist/src/ui/commands/btwCommand.js.map +1 -0
  924. package/dist/src/ui/commands/btwCommand.test.d.ts +6 -0
  925. package/dist/src/ui/commands/btwCommand.test.js +338 -0
  926. package/dist/src/ui/commands/btwCommand.test.js.map +1 -0
  927. package/dist/src/ui/commands/bugCommand.d.ts +7 -0
  928. package/dist/src/ui/commands/bugCommand.js +54 -0
  929. package/dist/src/ui/commands/bugCommand.js.map +1 -0
  930. package/dist/src/ui/commands/clearCommand.d.ts +7 -0
  931. package/dist/src/ui/commands/clearCommand.js +122 -0
  932. package/dist/src/ui/commands/clearCommand.js.map +1 -0
  933. package/dist/src/ui/commands/compressCommand.d.ts +7 -0
  934. package/dist/src/ui/commands/compressCommand.js +178 -0
  935. package/dist/src/ui/commands/compressCommand.js.map +1 -0
  936. package/dist/src/ui/commands/contextCommand.d.ts +14 -0
  937. package/dist/src/ui/commands/contextCommand.js +443 -0
  938. package/dist/src/ui/commands/contextCommand.js.map +1 -0
  939. package/dist/src/ui/commands/contextCommand.test.d.ts +6 -0
  940. package/dist/src/ui/commands/contextCommand.test.js +184 -0
  941. package/dist/src/ui/commands/contextCommand.test.js.map +1 -0
  942. package/dist/src/ui/commands/copyCommand.d.ts +7 -0
  943. package/dist/src/ui/commands/copyCommand.js +374 -0
  944. package/dist/src/ui/commands/copyCommand.js.map +1 -0
  945. package/dist/src/ui/commands/deleteCommand.d.ts +7 -0
  946. package/dist/src/ui/commands/deleteCommand.js +19 -0
  947. package/dist/src/ui/commands/deleteCommand.js.map +1 -0
  948. package/dist/src/ui/commands/deleteCommand.test.d.ts +6 -0
  949. package/dist/src/ui/commands/deleteCommand.test.js +27 -0
  950. package/dist/src/ui/commands/deleteCommand.test.js.map +1 -0
  951. package/dist/src/ui/commands/diffCommand.d.ts +42 -0
  952. package/dist/src/ui/commands/diffCommand.js +206 -0
  953. package/dist/src/ui/commands/diffCommand.js.map +1 -0
  954. package/dist/src/ui/commands/diffCommand.test.d.ts +6 -0
  955. package/dist/src/ui/commands/diffCommand.test.js +482 -0
  956. package/dist/src/ui/commands/diffCommand.test.js.map +1 -0
  957. package/dist/src/ui/commands/directoryCommand.d.ts +13 -0
  958. package/dist/src/ui/commands/directoryCommand.js +252 -0
  959. package/dist/src/ui/commands/directoryCommand.js.map +1 -0
  960. package/dist/src/ui/commands/docsCommand.d.ts +7 -0
  961. package/dist/src/ui/commands/docsCommand.js +49 -0
  962. package/dist/src/ui/commands/docsCommand.js.map +1 -0
  963. package/dist/src/ui/commands/doctorCommand.d.ts +7 -0
  964. package/dist/src/ui/commands/doctorCommand.js +530 -0
  965. package/dist/src/ui/commands/doctorCommand.js.map +1 -0
  966. package/dist/src/ui/commands/doctorCommand.test.d.ts +6 -0
  967. package/dist/src/ui/commands/doctorCommand.test.js +804 -0
  968. package/dist/src/ui/commands/doctorCommand.test.js.map +1 -0
  969. package/dist/src/ui/commands/dreamCommand.d.ts +7 -0
  970. package/dist/src/ui/commands/dreamCommand.js +42 -0
  971. package/dist/src/ui/commands/dreamCommand.js.map +1 -0
  972. package/dist/src/ui/commands/dreamCommand.test.d.ts +6 -0
  973. package/dist/src/ui/commands/dreamCommand.test.js +39 -0
  974. package/dist/src/ui/commands/dreamCommand.test.js.map +1 -0
  975. package/dist/src/ui/commands/editorCommand.d.ts +7 -0
  976. package/dist/src/ui/commands/editorCommand.js +20 -0
  977. package/dist/src/ui/commands/editorCommand.js.map +1 -0
  978. package/dist/src/ui/commands/exportCommand.d.ts +10 -0
  979. package/dist/src/ui/commands/exportCommand.js +373 -0
  980. package/dist/src/ui/commands/exportCommand.js.map +1 -0
  981. package/dist/src/ui/commands/exportCommand.test.d.ts +6 -0
  982. package/dist/src/ui/commands/exportCommand.test.js +905 -0
  983. package/dist/src/ui/commands/exportCommand.test.js.map +1 -0
  984. package/dist/src/ui/commands/extensionsCommand.d.ts +10 -0
  985. package/dist/src/ui/commands/extensionsCommand.js +185 -0
  986. package/dist/src/ui/commands/extensionsCommand.js.map +1 -0
  987. package/dist/src/ui/commands/forgetCommand.d.ts +7 -0
  988. package/dist/src/ui/commands/forgetCommand.js +45 -0
  989. package/dist/src/ui/commands/forgetCommand.js.map +1 -0
  990. package/dist/src/ui/commands/forkCommand.d.ts +7 -0
  991. package/dist/src/ui/commands/forkCommand.js +163 -0
  992. package/dist/src/ui/commands/forkCommand.js.map +1 -0
  993. package/dist/src/ui/commands/forkCommand.test.d.ts +6 -0
  994. package/dist/src/ui/commands/forkCommand.test.js +229 -0
  995. package/dist/src/ui/commands/forkCommand.test.js.map +1 -0
  996. package/dist/src/ui/commands/goalCommand.d.ts +7 -0
  997. package/dist/src/ui/commands/goalCommand.js +181 -0
  998. package/dist/src/ui/commands/goalCommand.js.map +1 -0
  999. package/dist/src/ui/commands/goalCommand.test.d.ts +6 -0
  1000. package/dist/src/ui/commands/goalCommand.test.js +328 -0
  1001. package/dist/src/ui/commands/goalCommand.test.js.map +1 -0
  1002. package/dist/src/ui/commands/helpCommand.d.ts +7 -0
  1003. package/dist/src/ui/commands/helpCommand.js +21 -0
  1004. package/dist/src/ui/commands/helpCommand.js.map +1 -0
  1005. package/dist/src/ui/commands/hooksCommand.d.ts +7 -0
  1006. package/dist/src/ui/commands/hooksCommand.js +153 -0
  1007. package/dist/src/ui/commands/hooksCommand.js.map +1 -0
  1008. package/dist/src/ui/commands/hooksCommand.test.d.ts +6 -0
  1009. package/dist/src/ui/commands/hooksCommand.test.js +189 -0
  1010. package/dist/src/ui/commands/hooksCommand.test.js.map +1 -0
  1011. package/dist/src/ui/commands/ideCommand.d.ts +7 -0
  1012. package/dist/src/ui/commands/ideCommand.js +256 -0
  1013. package/dist/src/ui/commands/ideCommand.js.map +1 -0
  1014. package/dist/src/ui/commands/initCommand.d.ts +7 -0
  1015. package/dist/src/ui/commands/initCommand.js +119 -0
  1016. package/dist/src/ui/commands/initCommand.js.map +1 -0
  1017. package/dist/src/ui/commands/insightCommand.d.ts +7 -0
  1018. package/dist/src/ui/commands/insightCommand.js +195 -0
  1019. package/dist/src/ui/commands/insightCommand.js.map +1 -0
  1020. package/dist/src/ui/commands/insightCommand.test.d.ts +6 -0
  1021. package/dist/src/ui/commands/insightCommand.test.js +173 -0
  1022. package/dist/src/ui/commands/insightCommand.test.js.map +1 -0
  1023. package/dist/src/ui/commands/languageCommand.d.ts +7 -0
  1024. package/dist/src/ui/commands/languageCommand.js +291 -0
  1025. package/dist/src/ui/commands/languageCommand.js.map +1 -0
  1026. package/dist/src/ui/commands/languageCommand.test.d.ts +6 -0
  1027. package/dist/src/ui/commands/languageCommand.test.js +664 -0
  1028. package/dist/src/ui/commands/languageCommand.test.js.map +1 -0
  1029. package/dist/src/ui/commands/lspCommand.d.ts +7 -0
  1030. package/dist/src/ui/commands/lspCommand.js +62 -0
  1031. package/dist/src/ui/commands/lspCommand.js.map +1 -0
  1032. package/dist/src/ui/commands/lspCommand.test.d.ts +6 -0
  1033. package/dist/src/ui/commands/lspCommand.test.js +175 -0
  1034. package/dist/src/ui/commands/lspCommand.test.js.map +1 -0
  1035. package/dist/src/ui/commands/mcpCommand.d.ts +7 -0
  1036. package/dist/src/ui/commands/mcpCommand.js +21 -0
  1037. package/dist/src/ui/commands/mcpCommand.js.map +1 -0
  1038. package/dist/src/ui/commands/memoryCommand.d.ts +7 -0
  1039. package/dist/src/ui/commands/memoryCommand.js +21 -0
  1040. package/dist/src/ui/commands/memoryCommand.js.map +1 -0
  1041. package/dist/src/ui/commands/modelCommand.d.ts +7 -0
  1042. package/dist/src/ui/commands/modelCommand.js +226 -0
  1043. package/dist/src/ui/commands/modelCommand.js.map +1 -0
  1044. package/dist/src/ui/commands/modelCommand.test.d.ts +6 -0
  1045. package/dist/src/ui/commands/modelCommand.test.js +503 -0
  1046. package/dist/src/ui/commands/modelCommand.test.js.map +1 -0
  1047. package/dist/src/ui/commands/permissionsCommand.d.ts +7 -0
  1048. package/dist/src/ui/commands/permissionsCommand.js +20 -0
  1049. package/dist/src/ui/commands/permissionsCommand.js.map +1 -0
  1050. package/dist/src/ui/commands/permissionsCommand.test.d.ts +6 -0
  1051. package/dist/src/ui/commands/permissionsCommand.test.js +30 -0
  1052. package/dist/src/ui/commands/permissionsCommand.test.js.map +1 -0
  1053. package/dist/src/ui/commands/planCommand.d.ts +7 -0
  1054. package/dist/src/ui/commands/planCommand.js +88 -0
  1055. package/dist/src/ui/commands/planCommand.js.map +1 -0
  1056. package/dist/src/ui/commands/planCommand.test.d.ts +6 -0
  1057. package/dist/src/ui/commands/planCommand.test.js +113 -0
  1058. package/dist/src/ui/commands/planCommand.test.js.map +1 -0
  1059. package/dist/src/ui/commands/quitCommand.d.ts +7 -0
  1060. package/dist/src/ui/commands/quitCommand.js +38 -0
  1061. package/dist/src/ui/commands/quitCommand.js.map +1 -0
  1062. package/dist/src/ui/commands/recapCommand.d.ts +7 -0
  1063. package/dist/src/ui/commands/recapCommand.js +56 -0
  1064. package/dist/src/ui/commands/recapCommand.js.map +1 -0
  1065. package/dist/src/ui/commands/rememberCommand.d.ts +7 -0
  1066. package/dist/src/ui/commands/rememberCommand.js +54 -0
  1067. package/dist/src/ui/commands/rememberCommand.js.map +1 -0
  1068. package/dist/src/ui/commands/renameCommand.d.ts +7 -0
  1069. package/dist/src/ui/commands/renameCommand.js +208 -0
  1070. package/dist/src/ui/commands/renameCommand.js.map +1 -0
  1071. package/dist/src/ui/commands/renameCommand.test.d.ts +6 -0
  1072. package/dist/src/ui/commands/renameCommand.test.js +414 -0
  1073. package/dist/src/ui/commands/renameCommand.test.js.map +1 -0
  1074. package/dist/src/ui/commands/restoreCommand.d.ts +8 -0
  1075. package/dist/src/ui/commands/restoreCommand.js +159 -0
  1076. package/dist/src/ui/commands/restoreCommand.js.map +1 -0
  1077. package/dist/src/ui/commands/resumeCommand.d.ts +7 -0
  1078. package/dist/src/ui/commands/resumeCommand.js +65 -0
  1079. package/dist/src/ui/commands/resumeCommand.js.map +1 -0
  1080. package/dist/src/ui/commands/resumeCommand.test.d.ts +6 -0
  1081. package/dist/src/ui/commands/resumeCommand.test.js +135 -0
  1082. package/dist/src/ui/commands/resumeCommand.test.js.map +1 -0
  1083. package/dist/src/ui/commands/rewindCommand.d.ts +7 -0
  1084. package/dist/src/ui/commands/rewindCommand.js +20 -0
  1085. package/dist/src/ui/commands/rewindCommand.js.map +1 -0
  1086. package/dist/src/ui/commands/settingsCommand.d.ts +7 -0
  1087. package/dist/src/ui/commands/settingsCommand.js +20 -0
  1088. package/dist/src/ui/commands/settingsCommand.js.map +1 -0
  1089. package/dist/src/ui/commands/setupGithubCommand.d.ts +9 -0
  1090. package/dist/src/ui/commands/setupGithubCommand.js +165 -0
  1091. package/dist/src/ui/commands/setupGithubCommand.js.map +1 -0
  1092. package/dist/src/ui/commands/setupGithubCommand.test.d.ts +6 -0
  1093. package/dist/src/ui/commands/setupGithubCommand.test.js +164 -0
  1094. package/dist/src/ui/commands/setupGithubCommand.test.js.map +1 -0
  1095. package/dist/src/ui/commands/skillsCommand.d.ts +7 -0
  1096. package/dist/src/ui/commands/skillsCommand.js +63 -0
  1097. package/dist/src/ui/commands/skillsCommand.js.map +1 -0
  1098. package/dist/src/ui/commands/skillsCommand.test.d.ts +6 -0
  1099. package/dist/src/ui/commands/skillsCommand.test.js +136 -0
  1100. package/dist/src/ui/commands/skillsCommand.test.js.map +1 -0
  1101. package/dist/src/ui/commands/statsCommand.d.ts +7 -0
  1102. package/dist/src/ui/commands/statsCommand.js +130 -0
  1103. package/dist/src/ui/commands/statsCommand.js.map +1 -0
  1104. package/dist/src/ui/commands/statuslineCommand.d.ts +7 -0
  1105. package/dist/src/ui/commands/statuslineCommand.js +33 -0
  1106. package/dist/src/ui/commands/statuslineCommand.js.map +1 -0
  1107. package/dist/src/ui/commands/statuslineCommand.test.d.ts +6 -0
  1108. package/dist/src/ui/commands/statuslineCommand.test.js +54 -0
  1109. package/dist/src/ui/commands/statuslineCommand.test.js.map +1 -0
  1110. package/dist/src/ui/commands/summaryCommand.d.ts +7 -0
  1111. package/dist/src/ui/commands/summaryCommand.js +261 -0
  1112. package/dist/src/ui/commands/summaryCommand.js.map +1 -0
  1113. package/dist/src/ui/commands/tasksCommand.d.ts +7 -0
  1114. package/dist/src/ui/commands/tasksCommand.js +222 -0
  1115. package/dist/src/ui/commands/tasksCommand.js.map +1 -0
  1116. package/dist/src/ui/commands/tasksCommand.test.d.ts +6 -0
  1117. package/dist/src/ui/commands/tasksCommand.test.js +365 -0
  1118. package/dist/src/ui/commands/tasksCommand.test.js.map +1 -0
  1119. package/dist/src/ui/commands/terminalSetupCommand.d.ts +13 -0
  1120. package/dist/src/ui/commands/terminalSetupCommand.js +48 -0
  1121. package/dist/src/ui/commands/terminalSetupCommand.js.map +1 -0
  1122. package/dist/src/ui/commands/themeCommand.d.ts +7 -0
  1123. package/dist/src/ui/commands/themeCommand.js +20 -0
  1124. package/dist/src/ui/commands/themeCommand.js.map +1 -0
  1125. package/dist/src/ui/commands/toolsCommand.d.ts +7 -0
  1126. package/dist/src/ui/commands/toolsCommand.js +45 -0
  1127. package/dist/src/ui/commands/toolsCommand.js.map +1 -0
  1128. package/dist/src/ui/commands/trustCommand.d.ts +7 -0
  1129. package/dist/src/ui/commands/trustCommand.js +20 -0
  1130. package/dist/src/ui/commands/trustCommand.js.map +1 -0
  1131. package/dist/src/ui/commands/trustCommand.test.d.ts +6 -0
  1132. package/dist/src/ui/commands/trustCommand.test.js +30 -0
  1133. package/dist/src/ui/commands/trustCommand.test.js.map +1 -0
  1134. package/dist/src/ui/commands/types.d.ts +298 -0
  1135. package/dist/src/ui/commands/types.js +13 -0
  1136. package/dist/src/ui/commands/types.js.map +1 -0
  1137. package/dist/src/ui/commands/vimCommand.d.ts +7 -0
  1138. package/dist/src/ui/commands/vimCommand.js +27 -0
  1139. package/dist/src/ui/commands/vimCommand.js.map +1 -0
  1140. package/dist/src/ui/components/AboutBox.d.ts +12 -0
  1141. package/dist/src/ui/components/AboutBox.js +10 -0
  1142. package/dist/src/ui/components/AboutBox.js.map +1 -0
  1143. package/dist/src/ui/components/AnsiOutput.d.ts +20 -0
  1144. package/dist/src/ui/components/AnsiOutput.js +27 -0
  1145. package/dist/src/ui/components/AnsiOutput.js.map +1 -0
  1146. package/dist/src/ui/components/AnsiOutput.test.d.ts +6 -0
  1147. package/dist/src/ui/components/AnsiOutput.test.js +134 -0
  1148. package/dist/src/ui/components/AnsiOutput.test.js.map +1 -0
  1149. package/dist/src/ui/components/ApiKeyInput.d.ts +22 -0
  1150. package/dist/src/ui/components/ApiKeyInput.js +35 -0
  1151. package/dist/src/ui/components/ApiKeyInput.js.map +1 -0
  1152. package/dist/src/ui/components/AppHeader.d.ts +10 -0
  1153. package/dist/src/ui/components/AppHeader.js +49 -0
  1154. package/dist/src/ui/components/AppHeader.js.map +1 -0
  1155. package/dist/src/ui/components/AppHeader.test.d.ts +6 -0
  1156. package/dist/src/ui/components/AppHeader.test.js +109 -0
  1157. package/dist/src/ui/components/AppHeader.test.js.map +1 -0
  1158. package/dist/src/ui/components/ApprovalModeDialog.d.ts +21 -0
  1159. package/dist/src/ui/components/ApprovalModeDialog.js +109 -0
  1160. package/dist/src/ui/components/ApprovalModeDialog.js.map +1 -0
  1161. package/dist/src/ui/components/ApprovalModeDialog.test.d.ts +6 -0
  1162. package/dist/src/ui/components/ApprovalModeDialog.test.js +63 -0
  1163. package/dist/src/ui/components/ApprovalModeDialog.test.js.map +1 -0
  1164. package/dist/src/ui/components/AsciiArt.d.ts +1 -0
  1165. package/dist/src/ui/components/AsciiArt.js +54 -0
  1166. package/dist/src/ui/components/AsciiArt.js.map +1 -0
  1167. package/dist/src/ui/components/AutoAcceptIndicator.d.ts +12 -0
  1168. package/dist/src/ui/components/AutoAcceptIndicator.js +37 -0
  1169. package/dist/src/ui/components/AutoAcceptIndicator.js.map +1 -0
  1170. package/dist/src/ui/components/BaseTextInput.d.ts +74 -0
  1171. package/dist/src/ui/components/BaseTextInput.js +144 -0
  1172. package/dist/src/ui/components/BaseTextInput.js.map +1 -0
  1173. package/dist/src/ui/components/BaseTextInput.test.d.ts +6 -0
  1174. package/dist/src/ui/components/BaseTextInput.test.js +78 -0
  1175. package/dist/src/ui/components/BaseTextInput.test.js.map +1 -0
  1176. package/dist/src/ui/components/Composer.d.ts +6 -0
  1177. package/dist/src/ui/components/Composer.js +92 -0
  1178. package/dist/src/ui/components/Composer.js.map +1 -0
  1179. package/dist/src/ui/components/Composer.test.d.ts +6 -0
  1180. package/dist/src/ui/components/Composer.test.js +344 -0
  1181. package/dist/src/ui/components/Composer.test.js.map +1 -0
  1182. package/dist/src/ui/components/ConsentPrompt.d.ts +14 -0
  1183. package/dist/src/ui/components/ConsentPrompt.js +35 -0
  1184. package/dist/src/ui/components/ConsentPrompt.js.map +1 -0
  1185. package/dist/src/ui/components/ConsentPrompt.test.d.ts +6 -0
  1186. package/dist/src/ui/components/ConsentPrompt.test.js +110 -0
  1187. package/dist/src/ui/components/ConsentPrompt.test.js.map +1 -0
  1188. package/dist/src/ui/components/ContextSummaryDisplay.d.ts +20 -0
  1189. package/dist/src/ui/components/ContextSummaryDisplay.js +90 -0
  1190. package/dist/src/ui/components/ContextSummaryDisplay.js.map +1 -0
  1191. package/dist/src/ui/components/ContextUsageDisplay.d.ts +10 -0
  1192. package/dist/src/ui/components/ContextUsageDisplay.js +33 -0
  1193. package/dist/src/ui/components/ContextUsageDisplay.js.map +1 -0
  1194. package/dist/src/ui/components/DebugModeNotification.d.ts +9 -0
  1195. package/dist/src/ui/components/DebugModeNotification.js +23 -0
  1196. package/dist/src/ui/components/DebugModeNotification.js.map +1 -0
  1197. package/dist/src/ui/components/DebugProfiler.d.ts +6 -0
  1198. package/dist/src/ui/components/DebugProfiler.js +27 -0
  1199. package/dist/src/ui/components/DebugProfiler.js.map +1 -0
  1200. package/dist/src/ui/components/DialogManager.d.ts +12 -0
  1201. package/dist/src/ui/components/DialogManager.js +247 -0
  1202. package/dist/src/ui/components/DialogManager.js.map +1 -0
  1203. package/dist/src/ui/components/DiffDialog.d.ts +15 -0
  1204. package/dist/src/ui/components/DiffDialog.js +412 -0
  1205. package/dist/src/ui/components/DiffDialog.js.map +1 -0
  1206. package/dist/src/ui/components/EditorSettingsDialog.d.ts +16 -0
  1207. package/dist/src/ui/components/EditorSettingsDialog.js +76 -0
  1208. package/dist/src/ui/components/EditorSettingsDialog.js.map +1 -0
  1209. package/dist/src/ui/components/ExitWarning.d.ts +7 -0
  1210. package/dist/src/ui/components/ExitWarning.js +9 -0
  1211. package/dist/src/ui/components/ExitWarning.js.map +1 -0
  1212. package/dist/src/ui/components/ExternalAuthProgress.d.ts +14 -0
  1213. package/dist/src/ui/components/ExternalAuthProgress.js +14 -0
  1214. package/dist/src/ui/components/ExternalAuthProgress.js.map +1 -0
  1215. package/dist/src/ui/components/ExternalAuthProgress.test.d.ts +6 -0
  1216. package/dist/src/ui/components/ExternalAuthProgress.test.js +20 -0
  1217. package/dist/src/ui/components/ExternalAuthProgress.test.js.map +1 -0
  1218. package/dist/src/ui/components/FolderTrustDialog.d.ts +17 -0
  1219. package/dist/src/ui/components/FolderTrustDialog.js +58 -0
  1220. package/dist/src/ui/components/FolderTrustDialog.js.map +1 -0
  1221. package/dist/src/ui/components/FolderTrustDialog.test.d.ts +6 -0
  1222. package/dist/src/ui/components/FolderTrustDialog.test.js +88 -0
  1223. package/dist/src/ui/components/FolderTrustDialog.test.js.map +1 -0
  1224. package/dist/src/ui/components/Footer.d.ts +7 -0
  1225. package/dist/src/ui/components/Footer.js +104 -0
  1226. package/dist/src/ui/components/Footer.js.map +1 -0
  1227. package/dist/src/ui/components/GeminiRespondingSpinner.d.ts +22 -0
  1228. package/dist/src/ui/components/GeminiRespondingSpinner.js +47 -0
  1229. package/dist/src/ui/components/GeminiRespondingSpinner.js.map +1 -0
  1230. package/dist/src/ui/components/GeminiRespondingSpinner.test.d.ts +6 -0
  1231. package/dist/src/ui/components/GeminiRespondingSpinner.test.js +29 -0
  1232. package/dist/src/ui/components/GeminiRespondingSpinner.test.js.map +1 -0
  1233. package/dist/src/ui/components/GoalPill.d.ts +25 -0
  1234. package/dist/src/ui/components/GoalPill.js +77 -0
  1235. package/dist/src/ui/components/GoalPill.js.map +1 -0
  1236. package/dist/src/ui/components/GoalPill.test.d.ts +6 -0
  1237. package/dist/src/ui/components/GoalPill.test.js +56 -0
  1238. package/dist/src/ui/components/GoalPill.test.js.map +1 -0
  1239. package/dist/src/ui/components/Header.d.ts +62 -0
  1240. package/dist/src/ui/components/Header.js +155 -0
  1241. package/dist/src/ui/components/Header.js.map +1 -0
  1242. package/dist/src/ui/components/Header.test.d.ts +6 -0
  1243. package/dist/src/ui/components/Header.test.js +142 -0
  1244. package/dist/src/ui/components/Header.test.js.map +1 -0
  1245. package/dist/src/ui/components/Help.d.ts +18 -0
  1246. package/dist/src/ui/components/Help.js +236 -0
  1247. package/dist/src/ui/components/Help.js.map +1 -0
  1248. package/dist/src/ui/components/Help.test.d.ts +6 -0
  1249. package/dist/src/ui/components/Help.test.js +243 -0
  1250. package/dist/src/ui/components/Help.test.js.map +1 -0
  1251. package/dist/src/ui/components/HistoryItemDisplay.d.ts +39 -0
  1252. package/dist/src/ui/components/HistoryItemDisplay.js +51 -0
  1253. package/dist/src/ui/components/HistoryItemDisplay.js.map +1 -0
  1254. package/dist/src/ui/components/HistoryItemDisplay.test.d.ts +6 -0
  1255. package/dist/src/ui/components/HistoryItemDisplay.test.js +197 -0
  1256. package/dist/src/ui/components/HistoryItemDisplay.test.js.map +1 -0
  1257. package/dist/src/ui/components/IdeTrustChangeDialog.d.ts +11 -0
  1258. package/dist/src/ui/components/IdeTrustChangeDialog.js +34 -0
  1259. package/dist/src/ui/components/IdeTrustChangeDialog.js.map +1 -0
  1260. package/dist/src/ui/components/IdeTrustChangeDialog.test.d.ts +6 -0
  1261. package/dist/src/ui/components/IdeTrustChangeDialog.test.js +53 -0
  1262. package/dist/src/ui/components/IdeTrustChangeDialog.test.js.map +1 -0
  1263. package/dist/src/ui/components/InputPrompt.d.ts +63 -0
  1264. package/dist/src/ui/components/InputPrompt.js +1220 -0
  1265. package/dist/src/ui/components/InputPrompt.js.map +1 -0
  1266. package/dist/src/ui/components/KeyboardShortcuts.d.ts +7 -0
  1267. package/dist/src/ui/components/KeyboardShortcuts.js +78 -0
  1268. package/dist/src/ui/components/KeyboardShortcuts.js.map +1 -0
  1269. package/dist/src/ui/components/LoadingIndicator.d.ts +31 -0
  1270. package/dist/src/ui/components/LoadingIndicator.js +46 -0
  1271. package/dist/src/ui/components/LoadingIndicator.js.map +1 -0
  1272. package/dist/src/ui/components/LoadingIndicator.test.d.ts +6 -0
  1273. package/dist/src/ui/components/LoadingIndicator.test.js +246 -0
  1274. package/dist/src/ui/components/LoadingIndicator.test.js.map +1 -0
  1275. package/dist/src/ui/components/LoopDetectionConfirmation.d.ts +13 -0
  1276. package/dist/src/ui/components/LoopDetectionConfirmation.js +37 -0
  1277. package/dist/src/ui/components/LoopDetectionConfirmation.js.map +1 -0
  1278. package/dist/src/ui/components/LoopDetectionConfirmation.test.d.ts +6 -0
  1279. package/dist/src/ui/components/LoopDetectionConfirmation.test.js +28 -0
  1280. package/dist/src/ui/components/LoopDetectionConfirmation.test.js.map +1 -0
  1281. package/dist/src/ui/components/MainContent.d.ts +6 -0
  1282. package/dist/src/ui/components/MainContent.js +437 -0
  1283. package/dist/src/ui/components/MainContent.js.map +1 -0
  1284. package/dist/src/ui/components/MainContent.test.d.ts +6 -0
  1285. package/dist/src/ui/components/MainContent.test.js +621 -0
  1286. package/dist/src/ui/components/MainContent.test.js.map +1 -0
  1287. package/dist/src/ui/components/MemoryDialog.d.ts +10 -0
  1288. package/dist/src/ui/components/MemoryDialog.js +288 -0
  1289. package/dist/src/ui/components/MemoryDialog.js.map +1 -0
  1290. package/dist/src/ui/components/MemoryDialog.test.d.ts +6 -0
  1291. package/dist/src/ui/components/MemoryDialog.test.js +165 -0
  1292. package/dist/src/ui/components/MemoryDialog.test.js.map +1 -0
  1293. package/dist/src/ui/components/MemoryUsageDisplay.d.ts +7 -0
  1294. package/dist/src/ui/components/MemoryUsageDisplay.js +24 -0
  1295. package/dist/src/ui/components/MemoryUsageDisplay.js.map +1 -0
  1296. package/dist/src/ui/components/ModelDialog.d.ts +12 -0
  1297. package/dist/src/ui/components/ModelDialog.js +390 -0
  1298. package/dist/src/ui/components/ModelDialog.js.map +1 -0
  1299. package/dist/src/ui/components/ModelDialog.test.d.ts +6 -0
  1300. package/dist/src/ui/components/ModelDialog.test.js +489 -0
  1301. package/dist/src/ui/components/ModelDialog.test.js.map +1 -0
  1302. package/dist/src/ui/components/ModelStatsDisplay.d.ts +11 -0
  1303. package/dist/src/ui/components/ModelStatsDisplay.js +61 -0
  1304. package/dist/src/ui/components/ModelStatsDisplay.js.map +1 -0
  1305. package/dist/src/ui/components/Notifications.d.ts +6 -0
  1306. package/dist/src/ui/components/Notifications.js +20 -0
  1307. package/dist/src/ui/components/Notifications.js.map +1 -0
  1308. package/dist/src/ui/components/PermissionsDialog.d.ts +11 -0
  1309. package/dist/src/ui/components/PermissionsDialog.js +547 -0
  1310. package/dist/src/ui/components/PermissionsDialog.js.map +1 -0
  1311. package/dist/src/ui/components/PlanSummaryDisplay.d.ts +14 -0
  1312. package/dist/src/ui/components/PlanSummaryDisplay.js +10 -0
  1313. package/dist/src/ui/components/PlanSummaryDisplay.js.map +1 -0
  1314. package/dist/src/ui/components/PluginChoicePrompt.d.ts +18 -0
  1315. package/dist/src/ui/components/PluginChoicePrompt.js +96 -0
  1316. package/dist/src/ui/components/PluginChoicePrompt.js.map +1 -0
  1317. package/dist/src/ui/components/PluginChoicePrompt.test.d.ts +6 -0
  1318. package/dist/src/ui/components/PluginChoicePrompt.test.js +136 -0
  1319. package/dist/src/ui/components/PluginChoicePrompt.test.js.map +1 -0
  1320. package/dist/src/ui/components/PrepareLabel.d.ts +15 -0
  1321. package/dist/src/ui/components/PrepareLabel.js +72 -0
  1322. package/dist/src/ui/components/PrepareLabel.js.map +1 -0
  1323. package/dist/src/ui/components/PrepareLabel.test.d.ts +6 -0
  1324. package/dist/src/ui/components/PrepareLabel.test.js +71 -0
  1325. package/dist/src/ui/components/PrepareLabel.test.js.map +1 -0
  1326. package/dist/src/ui/components/ProviderUpdatePrompt.d.ts +12 -0
  1327. package/dist/src/ui/components/ProviderUpdatePrompt.js +49 -0
  1328. package/dist/src/ui/components/ProviderUpdatePrompt.js.map +1 -0
  1329. package/dist/src/ui/components/QueuedMessageDisplay.d.ts +9 -0
  1330. package/dist/src/ui/components/QueuedMessageDisplay.js +35 -0
  1331. package/dist/src/ui/components/QueuedMessageDisplay.js.map +1 -0
  1332. package/dist/src/ui/components/QueuedMessageDisplay.test.d.ts +6 -0
  1333. package/dist/src/ui/components/QueuedMessageDisplay.test.js +76 -0
  1334. package/dist/src/ui/components/QueuedMessageDisplay.test.js.map +1 -0
  1335. package/dist/src/ui/components/QuittingDisplay.d.ts +6 -0
  1336. package/dist/src/ui/components/QuittingDisplay.js +21 -0
  1337. package/dist/src/ui/components/QuittingDisplay.js.map +1 -0
  1338. package/dist/src/ui/components/QwenOAuthProgress.d.ts +16 -0
  1339. package/dist/src/ui/components/QwenOAuthProgress.js +65 -0
  1340. package/dist/src/ui/components/QwenOAuthProgress.js.map +1 -0
  1341. package/dist/src/ui/components/QwenOAuthProgress.test.d.ts +6 -0
  1342. package/dist/src/ui/components/QwenOAuthProgress.test.js +287 -0
  1343. package/dist/src/ui/components/QwenOAuthProgress.test.js.map +1 -0
  1344. package/dist/src/ui/components/RewindSelector.d.ts +22 -0
  1345. package/dist/src/ui/components/RewindSelector.js +264 -0
  1346. package/dist/src/ui/components/RewindSelector.js.map +1 -0
  1347. package/dist/src/ui/components/RewindSelector.test.d.ts +6 -0
  1348. package/dist/src/ui/components/RewindSelector.test.js +146 -0
  1349. package/dist/src/ui/components/RewindSelector.test.js.map +1 -0
  1350. package/dist/src/ui/components/SessionPicker.d.ts +55 -0
  1351. package/dist/src/ui/components/SessionPicker.js +142 -0
  1352. package/dist/src/ui/components/SessionPicker.js.map +1 -0
  1353. package/dist/src/ui/components/SessionPreview.d.ts +20 -0
  1354. package/dist/src/ui/components/SessionPreview.js +97 -0
  1355. package/dist/src/ui/components/SessionPreview.js.map +1 -0
  1356. package/dist/src/ui/components/SessionPreview.test.d.ts +1 -0
  1357. package/dist/src/ui/components/SessionPreview.test.js +124 -0
  1358. package/dist/src/ui/components/SessionPreview.test.js.map +1 -0
  1359. package/dist/src/ui/components/SessionSummaryDisplay.d.ts +12 -0
  1360. package/dist/src/ui/components/SessionSummaryDisplay.js +17 -0
  1361. package/dist/src/ui/components/SessionSummaryDisplay.js.map +1 -0
  1362. package/dist/src/ui/components/SettingInputPrompt.d.ts +15 -0
  1363. package/dist/src/ui/components/SettingInputPrompt.js +63 -0
  1364. package/dist/src/ui/components/SettingInputPrompt.js.map +1 -0
  1365. package/dist/src/ui/components/SettingInputPrompt.test.d.ts +6 -0
  1366. package/dist/src/ui/components/SettingInputPrompt.test.js +60 -0
  1367. package/dist/src/ui/components/SettingInputPrompt.test.js.map +1 -0
  1368. package/dist/src/ui/components/SettingsCorruptedDialog.d.ts +14 -0
  1369. package/dist/src/ui/components/SettingsCorruptedDialog.js +44 -0
  1370. package/dist/src/ui/components/SettingsCorruptedDialog.js.map +1 -0
  1371. package/dist/src/ui/components/SettingsCorruptedDialog.test.d.ts +6 -0
  1372. package/dist/src/ui/components/SettingsCorruptedDialog.test.js +162 -0
  1373. package/dist/src/ui/components/SettingsCorruptedDialog.test.js.map +1 -0
  1374. package/dist/src/ui/components/SettingsDialog.d.ts +18 -0
  1375. package/dist/src/ui/components/SettingsDialog.js +658 -0
  1376. package/dist/src/ui/components/SettingsDialog.js.map +1 -0
  1377. package/dist/src/ui/components/SettingsDialog.test.d.ts +6 -0
  1378. package/dist/src/ui/components/SettingsDialog.test.js +1127 -0
  1379. package/dist/src/ui/components/SettingsDialog.test.js.map +1 -0
  1380. package/dist/src/ui/components/ShellConfirmationDialog.d.ts +17 -0
  1381. package/dist/src/ui/components/ShellConfirmationDialog.js +75 -0
  1382. package/dist/src/ui/components/ShellConfirmationDialog.js.map +1 -0
  1383. package/dist/src/ui/components/ShellConfirmationDialog.test.d.ts +6 -0
  1384. package/dist/src/ui/components/ShellConfirmationDialog.test.js +167 -0
  1385. package/dist/src/ui/components/ShellConfirmationDialog.test.js.map +1 -0
  1386. package/dist/src/ui/components/ShellInputPrompt.d.ts +11 -0
  1387. package/dist/src/ui/components/ShellInputPrompt.js +42 -0
  1388. package/dist/src/ui/components/ShellInputPrompt.js.map +1 -0
  1389. package/dist/src/ui/components/ShellModeIndicator.d.ts +7 -0
  1390. package/dist/src/ui/components/ShellModeIndicator.js +5 -0
  1391. package/dist/src/ui/components/ShellModeIndicator.js.map +1 -0
  1392. package/dist/src/ui/components/ShowMoreLines.d.ts +10 -0
  1393. package/dist/src/ui/components/ShowMoreLines.js +24 -0
  1394. package/dist/src/ui/components/ShowMoreLines.js.map +1 -0
  1395. package/dist/src/ui/components/StandaloneSessionPicker.d.ts +11 -0
  1396. package/dist/src/ui/components/StandaloneSessionPicker.js +105 -0
  1397. package/dist/src/ui/components/StandaloneSessionPicker.js.map +1 -0
  1398. package/dist/src/ui/components/StandaloneSessionPicker.test.d.ts +6 -0
  1399. package/dist/src/ui/components/StandaloneSessionPicker.test.js +667 -0
  1400. package/dist/src/ui/components/StandaloneSessionPicker.test.js.map +1 -0
  1401. package/dist/src/ui/components/StatsActivityTab.d.ts +14 -0
  1402. package/dist/src/ui/components/StatsActivityTab.js +85 -0
  1403. package/dist/src/ui/components/StatsActivityTab.js.map +1 -0
  1404. package/dist/src/ui/components/StatsDialog.d.ts +12 -0
  1405. package/dist/src/ui/components/StatsDialog.js +104 -0
  1406. package/dist/src/ui/components/StatsDialog.js.map +1 -0
  1407. package/dist/src/ui/components/StatsDisplay.d.ts +13 -0
  1408. package/dist/src/ui/components/StatsDisplay.js +52 -0
  1409. package/dist/src/ui/components/StatsDisplay.js.map +1 -0
  1410. package/dist/src/ui/components/StatsEfficiencyTab.d.ts +11 -0
  1411. package/dist/src/ui/components/StatsEfficiencyTab.js +99 -0
  1412. package/dist/src/ui/components/StatsEfficiencyTab.js.map +1 -0
  1413. package/dist/src/ui/components/StatsHeatmapView.d.ts +12 -0
  1414. package/dist/src/ui/components/StatsHeatmapView.js +40 -0
  1415. package/dist/src/ui/components/StatsHeatmapView.js.map +1 -0
  1416. package/dist/src/ui/components/StatsSessionTab.d.ts +7 -0
  1417. package/dist/src/ui/components/StatsSessionTab.js +40 -0
  1418. package/dist/src/ui/components/StatsSessionTab.js.map +1 -0
  1419. package/dist/src/ui/components/StatusLineDialog.d.ts +22 -0
  1420. package/dist/src/ui/components/StatusLineDialog.js +140 -0
  1421. package/dist/src/ui/components/StatusLineDialog.js.map +1 -0
  1422. package/dist/src/ui/components/StatusLineDialog.test.d.ts +6 -0
  1423. package/dist/src/ui/components/StatusLineDialog.test.js +180 -0
  1424. package/dist/src/ui/components/StatusLineDialog.test.js.map +1 -0
  1425. package/dist/src/ui/components/StickyTodoList.d.ts +14 -0
  1426. package/dist/src/ui/components/StickyTodoList.js +45 -0
  1427. package/dist/src/ui/components/StickyTodoList.js.map +1 -0
  1428. package/dist/src/ui/components/StickyTodoList.test.d.ts +6 -0
  1429. package/dist/src/ui/components/StickyTodoList.test.js +128 -0
  1430. package/dist/src/ui/components/StickyTodoList.test.js.map +1 -0
  1431. package/dist/src/ui/components/SuggestionsDisplay.d.ts +47 -0
  1432. package/dist/src/ui/components/SuggestionsDisplay.js +43 -0
  1433. package/dist/src/ui/components/SuggestionsDisplay.js.map +1 -0
  1434. package/dist/src/ui/components/SuggestionsDisplay.test.d.ts +6 -0
  1435. package/dist/src/ui/components/SuggestionsDisplay.test.js +39 -0
  1436. package/dist/src/ui/components/SuggestionsDisplay.test.js.map +1 -0
  1437. package/dist/src/ui/components/ThemeDialog.d.ts +20 -0
  1438. package/dist/src/ui/components/ThemeDialog.js +137 -0
  1439. package/dist/src/ui/components/ThemeDialog.js.map +1 -0
  1440. package/dist/src/ui/components/ThemeDialog.test.d.ts +6 -0
  1441. package/dist/src/ui/components/ThemeDialog.test.js +75 -0
  1442. package/dist/src/ui/components/ThemeDialog.test.js.map +1 -0
  1443. package/dist/src/ui/components/ThinkingDots.d.ts +11 -0
  1444. package/dist/src/ui/components/ThinkingDots.js +47 -0
  1445. package/dist/src/ui/components/ThinkingDots.js.map +1 -0
  1446. package/dist/src/ui/components/ThinkingIndicator.d.ts +7 -0
  1447. package/dist/src/ui/components/ThinkingIndicator.js +13 -0
  1448. package/dist/src/ui/components/ThinkingIndicator.js.map +1 -0
  1449. package/dist/src/ui/components/Tips.d.ts +6 -0
  1450. package/dist/src/ui/components/Tips.js +37 -0
  1451. package/dist/src/ui/components/Tips.js.map +1 -0
  1452. package/dist/src/ui/components/Tips.test.d.ts +6 -0
  1453. package/dist/src/ui/components/Tips.test.js +145 -0
  1454. package/dist/src/ui/components/Tips.test.js.map +1 -0
  1455. package/dist/src/ui/components/TodoDisplay.d.ts +16 -0
  1456. package/dist/src/ui/components/TodoDisplay.js +27 -0
  1457. package/dist/src/ui/components/TodoDisplay.js.map +1 -0
  1458. package/dist/src/ui/components/TodoDisplay.test.d.ts +6 -0
  1459. package/dist/src/ui/components/TodoDisplay.test.js +77 -0
  1460. package/dist/src/ui/components/TodoDisplay.test.js.map +1 -0
  1461. package/dist/src/ui/components/ToolStatsDisplay.d.ts +11 -0
  1462. package/dist/src/ui/components/ToolStatsDisplay.js +42 -0
  1463. package/dist/src/ui/components/ToolStatsDisplay.js.map +1 -0
  1464. package/dist/src/ui/components/TrustDialog.d.ts +13 -0
  1465. package/dist/src/ui/components/TrustDialog.js +48 -0
  1466. package/dist/src/ui/components/TrustDialog.js.map +1 -0
  1467. package/dist/src/ui/components/TrustDialog.test.d.ts +6 -0
  1468. package/dist/src/ui/components/TrustDialog.test.js +154 -0
  1469. package/dist/src/ui/components/TrustDialog.test.js.map +1 -0
  1470. package/dist/src/ui/components/UpdateNotification.d.ts +10 -0
  1471. package/dist/src/ui/components/UpdateNotification.js +10 -0
  1472. package/dist/src/ui/components/UpdateNotification.js.map +1 -0
  1473. package/dist/src/ui/components/WelcomeBackDialog.d.ts +13 -0
  1474. package/dist/src/ui/components/WelcomeBackDialog.js +43 -0
  1475. package/dist/src/ui/components/WelcomeBackDialog.js.map +1 -0
  1476. package/dist/src/ui/components/WorktreeExitDialog.d.ts +26 -0
  1477. package/dist/src/ui/components/WorktreeExitDialog.js +134 -0
  1478. package/dist/src/ui/components/WorktreeExitDialog.js.map +1 -0
  1479. package/dist/src/ui/components/WorktreeExitDialog.test.d.ts +6 -0
  1480. package/dist/src/ui/components/WorktreeExitDialog.test.js +41 -0
  1481. package/dist/src/ui/components/WorktreeExitDialog.test.js.map +1 -0
  1482. package/dist/src/ui/components/agent-view/AgentChatContent.d.ts +27 -0
  1483. package/dist/src/ui/components/agent-view/AgentChatContent.js +150 -0
  1484. package/dist/src/ui/components/agent-view/AgentChatContent.js.map +1 -0
  1485. package/dist/src/ui/components/agent-view/AgentChatView.d.ts +10 -0
  1486. package/dist/src/ui/components/agent-view/AgentChatView.js +24 -0
  1487. package/dist/src/ui/components/agent-view/AgentChatView.js.map +1 -0
  1488. package/dist/src/ui/components/agent-view/AgentComposer.d.ts +10 -0
  1489. package/dist/src/ui/components/agent-view/AgentComposer.js +183 -0
  1490. package/dist/src/ui/components/agent-view/AgentComposer.js.map +1 -0
  1491. package/dist/src/ui/components/agent-view/AgentFooter.d.ts +20 -0
  1492. package/dist/src/ui/components/agent-view/AgentFooter.js +15 -0
  1493. package/dist/src/ui/components/agent-view/AgentFooter.js.map +1 -0
  1494. package/dist/src/ui/components/agent-view/AgentHeader.d.ts +19 -0
  1495. package/dist/src/ui/components/agent-view/AgentHeader.js +13 -0
  1496. package/dist/src/ui/components/agent-view/AgentHeader.js.map +1 -0
  1497. package/dist/src/ui/components/agent-view/AgentTabBar.d.ts +6 -0
  1498. package/dist/src/ui/components/agent-view/AgentTabBar.js +110 -0
  1499. package/dist/src/ui/components/agent-view/AgentTabBar.js.map +1 -0
  1500. package/dist/src/ui/components/agent-view/AgentTabBar.test.d.ts +6 -0
  1501. package/dist/src/ui/components/agent-view/AgentTabBar.test.js +90 -0
  1502. package/dist/src/ui/components/agent-view/AgentTabBar.test.js.map +1 -0
  1503. package/dist/src/ui/components/agent-view/agentHistoryAdapter.d.ts +31 -0
  1504. package/dist/src/ui/components/agent-view/agentHistoryAdapter.js +148 -0
  1505. package/dist/src/ui/components/agent-view/agentHistoryAdapter.js.map +1 -0
  1506. package/dist/src/ui/components/agent-view/agentHistoryAdapter.test.d.ts +6 -0
  1507. package/dist/src/ui/components/agent-view/agentHistoryAdapter.test.js +318 -0
  1508. package/dist/src/ui/components/agent-view/agentHistoryAdapter.test.js.map +1 -0
  1509. package/dist/src/ui/components/agent-view/index.d.ts +11 -0
  1510. package/dist/src/ui/components/agent-view/index.js +12 -0
  1511. package/dist/src/ui/components/agent-view/index.js.map +1 -0
  1512. package/dist/src/ui/components/approvalModeVisuals.d.ts +11 -0
  1513. package/dist/src/ui/components/approvalModeVisuals.js +37 -0
  1514. package/dist/src/ui/components/approvalModeVisuals.js.map +1 -0
  1515. package/dist/src/ui/components/approvalModeVisuals.test.d.ts +6 -0
  1516. package/dist/src/ui/components/approvalModeVisuals.test.js +32 -0
  1517. package/dist/src/ui/components/approvalModeVisuals.test.js.map +1 -0
  1518. package/dist/src/ui/components/arena/ArenaCards.d.ts +21 -0
  1519. package/dist/src/ui/components/arena/ArenaCards.js +99 -0
  1520. package/dist/src/ui/components/arena/ArenaCards.js.map +1 -0
  1521. package/dist/src/ui/components/arena/ArenaCards.test.d.ts +6 -0
  1522. package/dist/src/ui/components/arena/ArenaCards.test.js +128 -0
  1523. package/dist/src/ui/components/arena/ArenaCards.test.js.map +1 -0
  1524. package/dist/src/ui/components/arena/ArenaSelectDialog.d.ts +16 -0
  1525. package/dist/src/ui/components/arena/ArenaSelectDialog.js +213 -0
  1526. package/dist/src/ui/components/arena/ArenaSelectDialog.js.map +1 -0
  1527. package/dist/src/ui/components/arena/ArenaSelectDialog.test.d.ts +6 -0
  1528. package/dist/src/ui/components/arena/ArenaSelectDialog.test.js +149 -0
  1529. package/dist/src/ui/components/arena/ArenaSelectDialog.test.js.map +1 -0
  1530. package/dist/src/ui/components/arena/ArenaStartDialog.d.ts +12 -0
  1531. package/dist/src/ui/components/arena/ArenaStartDialog.js +49 -0
  1532. package/dist/src/ui/components/arena/ArenaStartDialog.js.map +1 -0
  1533. package/dist/src/ui/components/arena/ArenaStatusDialog.d.ts +14 -0
  1534. package/dist/src/ui/components/arena/ArenaStatusDialog.js +111 -0
  1535. package/dist/src/ui/components/arena/ArenaStatusDialog.js.map +1 -0
  1536. package/dist/src/ui/components/arena/ArenaStopDialog.d.ts +15 -0
  1537. package/dist/src/ui/components/arena/ArenaStopDialog.js +113 -0
  1538. package/dist/src/ui/components/arena/ArenaStopDialog.js.map +1 -0
  1539. package/dist/src/ui/components/background-view/BackgroundTasksDialog.d.ts +17 -0
  1540. package/dist/src/ui/components/background-view/BackgroundTasksDialog.js +614 -0
  1541. package/dist/src/ui/components/background-view/BackgroundTasksDialog.js.map +1 -0
  1542. package/dist/src/ui/components/background-view/BackgroundTasksDialog.test.d.ts +6 -0
  1543. package/dist/src/ui/components/background-view/BackgroundTasksDialog.test.js +606 -0
  1544. package/dist/src/ui/components/background-view/BackgroundTasksDialog.test.js.map +1 -0
  1545. package/dist/src/ui/components/background-view/BackgroundTasksPill.d.ts +14 -0
  1546. package/dist/src/ui/components/background-view/BackgroundTasksPill.js +94 -0
  1547. package/dist/src/ui/components/background-view/BackgroundTasksPill.js.map +1 -0
  1548. package/dist/src/ui/components/background-view/BackgroundTasksPill.test.d.ts +6 -0
  1549. package/dist/src/ui/components/background-view/BackgroundTasksPill.test.js +158 -0
  1550. package/dist/src/ui/components/background-view/BackgroundTasksPill.test.js.map +1 -0
  1551. package/dist/src/ui/components/background-view/LiveAgentPanel.d.ts +43 -0
  1552. package/dist/src/ui/components/background-view/LiveAgentPanel.js +361 -0
  1553. package/dist/src/ui/components/background-view/LiveAgentPanel.js.map +1 -0
  1554. package/dist/src/ui/components/background-view/LiveAgentPanel.test.d.ts +6 -0
  1555. package/dist/src/ui/components/background-view/LiveAgentPanel.test.js +595 -0
  1556. package/dist/src/ui/components/background-view/LiveAgentPanel.test.js.map +1 -0
  1557. package/dist/src/ui/components/extensions/ExtensionsManagerDialog.d.ts +12 -0
  1558. package/dist/src/ui/components/extensions/ExtensionsManagerDialog.js +337 -0
  1559. package/dist/src/ui/components/extensions/ExtensionsManagerDialog.js.map +1 -0
  1560. package/dist/src/ui/components/extensions/ExtensionsManagerDialog.test.d.ts +6 -0
  1561. package/dist/src/ui/components/extensions/ExtensionsManagerDialog.test.js +90 -0
  1562. package/dist/src/ui/components/extensions/ExtensionsManagerDialog.test.js.map +1 -0
  1563. package/dist/src/ui/components/extensions/index.d.ts +8 -0
  1564. package/dist/src/ui/components/extensions/index.js +8 -0
  1565. package/dist/src/ui/components/extensions/index.js.map +1 -0
  1566. package/dist/src/ui/components/extensions/steps/ActionSelectionStep.d.ts +15 -0
  1567. package/dist/src/ui/components/extensions/steps/ActionSelectionStep.js +75 -0
  1568. package/dist/src/ui/components/extensions/steps/ActionSelectionStep.js.map +1 -0
  1569. package/dist/src/ui/components/extensions/steps/ActionSelectionStep.test.d.ts +6 -0
  1570. package/dist/src/ui/components/extensions/steps/ActionSelectionStep.test.js +56 -0
  1571. package/dist/src/ui/components/extensions/steps/ActionSelectionStep.test.js.map +1 -0
  1572. package/dist/src/ui/components/extensions/steps/ExtensionDetailStep.d.ts +11 -0
  1573. package/dist/src/ui/components/extensions/steps/ExtensionDetailStep.js +23 -0
  1574. package/dist/src/ui/components/extensions/steps/ExtensionDetailStep.js.map +1 -0
  1575. package/dist/src/ui/components/extensions/steps/ExtensionListStep.d.ts +13 -0
  1576. package/dist/src/ui/components/extensions/steps/ExtensionListStep.js +105 -0
  1577. package/dist/src/ui/components/extensions/steps/ExtensionListStep.js.map +1 -0
  1578. package/dist/src/ui/components/extensions/steps/ExtensionListStep.test.d.ts +6 -0
  1579. package/dist/src/ui/components/extensions/steps/ExtensionListStep.test.js +74 -0
  1580. package/dist/src/ui/components/extensions/steps/ExtensionListStep.test.js.map +1 -0
  1581. package/dist/src/ui/components/extensions/steps/ScopeSelectStep.d.ts +13 -0
  1582. package/dist/src/ui/components/extensions/steps/ScopeSelectStep.js +40 -0
  1583. package/dist/src/ui/components/extensions/steps/ScopeSelectStep.js.map +1 -0
  1584. package/dist/src/ui/components/extensions/steps/UninstallConfirmStep.d.ts +13 -0
  1585. package/dist/src/ui/components/extensions/steps/UninstallConfirmStep.js +38 -0
  1586. package/dist/src/ui/components/extensions/steps/UninstallConfirmStep.js.map +1 -0
  1587. package/dist/src/ui/components/extensions/steps/index.d.ts +10 -0
  1588. package/dist/src/ui/components/extensions/steps/index.js +11 -0
  1589. package/dist/src/ui/components/extensions/steps/index.js.map +1 -0
  1590. package/dist/src/ui/components/extensions/types.d.ts +73 -0
  1591. package/dist/src/ui/components/extensions/types.js +18 -0
  1592. package/dist/src/ui/components/extensions/types.js.map +1 -0
  1593. package/dist/src/ui/components/hooks/HandlerListBody.d.ts +12 -0
  1594. package/dist/src/ui/components/hooks/HandlerListBody.js +54 -0
  1595. package/dist/src/ui/components/hooks/HandlerListBody.js.map +1 -0
  1596. package/dist/src/ui/components/hooks/HandlerListBody.test.d.ts +6 -0
  1597. package/dist/src/ui/components/hooks/HandlerListBody.test.js +175 -0
  1598. package/dist/src/ui/components/hooks/HandlerListBody.test.js.map +1 -0
  1599. package/dist/src/ui/components/hooks/HookConfigDetailStep.d.ts +12 -0
  1600. package/dist/src/ui/components/hooks/HookConfigDetailStep.js +48 -0
  1601. package/dist/src/ui/components/hooks/HookConfigDetailStep.js.map +1 -0
  1602. package/dist/src/ui/components/hooks/HookConfigDetailStep.test.d.ts +6 -0
  1603. package/dist/src/ui/components/hooks/HookConfigDetailStep.test.js +236 -0
  1604. package/dist/src/ui/components/hooks/HookConfigDetailStep.test.js.map +1 -0
  1605. package/dist/src/ui/components/hooks/HookDetailStep.d.ts +12 -0
  1606. package/dist/src/ui/components/hooks/HookDetailStep.js +11 -0
  1607. package/dist/src/ui/components/hooks/HookDetailStep.js.map +1 -0
  1608. package/dist/src/ui/components/hooks/HookDetailStep.test.d.ts +6 -0
  1609. package/dist/src/ui/components/hooks/HookDetailStep.test.js +241 -0
  1610. package/dist/src/ui/components/hooks/HookDetailStep.test.js.map +1 -0
  1611. package/dist/src/ui/components/hooks/HookEventHandlerListStep.d.ts +12 -0
  1612. package/dist/src/ui/components/hooks/HookEventHandlerListStep.js +18 -0
  1613. package/dist/src/ui/components/hooks/HookEventHandlerListStep.js.map +1 -0
  1614. package/dist/src/ui/components/hooks/HookEventHeader.d.ts +13 -0
  1615. package/dist/src/ui/components/hooks/HookEventHeader.js +23 -0
  1616. package/dist/src/ui/components/hooks/HookEventHeader.js.map +1 -0
  1617. package/dist/src/ui/components/hooks/HookEventMatcherListStep.d.ts +12 -0
  1618. package/dist/src/ui/components/hooks/HookEventMatcherListStep.js +28 -0
  1619. package/dist/src/ui/components/hooks/HookEventMatcherListStep.js.map +1 -0
  1620. package/dist/src/ui/components/hooks/HookMatcherDetailStep.d.ts +13 -0
  1621. package/dist/src/ui/components/hooks/HookMatcherDetailStep.js +16 -0
  1622. package/dist/src/ui/components/hooks/HookMatcherDetailStep.js.map +1 -0
  1623. package/dist/src/ui/components/hooks/HookMatcherDetailStep.test.d.ts +6 -0
  1624. package/dist/src/ui/components/hooks/HookMatcherDetailStep.test.js +154 -0
  1625. package/dist/src/ui/components/hooks/HookMatcherDetailStep.test.js.map +1 -0
  1626. package/dist/src/ui/components/hooks/HooksDisabledStep.d.ts +10 -0
  1627. package/dist/src/ui/components/hooks/HooksDisabledStep.js +23 -0
  1628. package/dist/src/ui/components/hooks/HooksDisabledStep.js.map +1 -0
  1629. package/dist/src/ui/components/hooks/HooksDisabledStep.test.d.ts +6 -0
  1630. package/dist/src/ui/components/hooks/HooksDisabledStep.test.js +86 -0
  1631. package/dist/src/ui/components/hooks/HooksDisabledStep.test.js.map +1 -0
  1632. package/dist/src/ui/components/hooks/HooksListStep.d.ts +12 -0
  1633. package/dist/src/ui/components/hooks/HooksListStep.js +32 -0
  1634. package/dist/src/ui/components/hooks/HooksListStep.js.map +1 -0
  1635. package/dist/src/ui/components/hooks/HooksListStep.test.d.ts +6 -0
  1636. package/dist/src/ui/components/hooks/HooksListStep.test.js +144 -0
  1637. package/dist/src/ui/components/hooks/HooksListStep.test.js.map +1 -0
  1638. package/dist/src/ui/components/hooks/HooksManagementDialog.d.ts +7 -0
  1639. package/dist/src/ui/components/hooks/HooksManagementDialog.js +418 -0
  1640. package/dist/src/ui/components/hooks/HooksManagementDialog.js.map +1 -0
  1641. package/dist/src/ui/components/hooks/HooksManagementDialog.test.d.ts +6 -0
  1642. package/dist/src/ui/components/hooks/HooksManagementDialog.test.js +305 -0
  1643. package/dist/src/ui/components/hooks/HooksManagementDialog.test.js.map +1 -0
  1644. package/dist/src/ui/components/hooks/constants.d.ts +26 -0
  1645. package/dist/src/ui/components/hooks/constants.js +227 -0
  1646. package/dist/src/ui/components/hooks/constants.js.map +1 -0
  1647. package/dist/src/ui/components/hooks/constants.test.d.ts +6 -0
  1648. package/dist/src/ui/components/hooks/constants.test.js +317 -0
  1649. package/dist/src/ui/components/hooks/constants.test.js.map +1 -0
  1650. package/dist/src/ui/components/hooks/index.d.ts +12 -0
  1651. package/dist/src/ui/components/hooks/index.js +13 -0
  1652. package/dist/src/ui/components/hooks/index.js.map +1 -0
  1653. package/dist/src/ui/components/hooks/matcherGrouping.d.ts +9 -0
  1654. package/dist/src/ui/components/hooks/matcherGrouping.js +35 -0
  1655. package/dist/src/ui/components/hooks/matcherGrouping.js.map +1 -0
  1656. package/dist/src/ui/components/hooks/matcherGrouping.test.d.ts +6 -0
  1657. package/dist/src/ui/components/hooks/matcherGrouping.test.js +183 -0
  1658. package/dist/src/ui/components/hooks/matcherGrouping.test.js.map +1 -0
  1659. package/dist/src/ui/components/hooks/sourceLabels.d.ts +13 -0
  1660. package/dist/src/ui/components/hooks/sourceLabels.js +35 -0
  1661. package/dist/src/ui/components/hooks/sourceLabels.js.map +1 -0
  1662. package/dist/src/ui/components/hooks/sourceLabels.test.d.ts +6 -0
  1663. package/dist/src/ui/components/hooks/sourceLabels.test.js +81 -0
  1664. package/dist/src/ui/components/hooks/sourceLabels.test.js.map +1 -0
  1665. package/dist/src/ui/components/hooks/types.d.ts +42 -0
  1666. package/dist/src/ui/components/hooks/types.js +13 -0
  1667. package/dist/src/ui/components/hooks/types.js.map +1 -0
  1668. package/dist/src/ui/components/mcp/MCPHealthPill.d.ts +24 -0
  1669. package/dist/src/ui/components/mcp/MCPHealthPill.js +33 -0
  1670. package/dist/src/ui/components/mcp/MCPHealthPill.js.map +1 -0
  1671. package/dist/src/ui/components/mcp/MCPHealthPill.test.d.ts +6 -0
  1672. package/dist/src/ui/components/mcp/MCPHealthPill.test.js +42 -0
  1673. package/dist/src/ui/components/mcp/MCPHealthPill.test.js.map +1 -0
  1674. package/dist/src/ui/components/mcp/MCPManagementDialog.d.ts +7 -0
  1675. package/dist/src/ui/components/mcp/MCPManagementDialog.js +472 -0
  1676. package/dist/src/ui/components/mcp/MCPManagementDialog.js.map +1 -0
  1677. package/dist/src/ui/components/mcp/constants.d.ts +29 -0
  1678. package/dist/src/ui/components/mcp/constants.js +34 -0
  1679. package/dist/src/ui/components/mcp/constants.js.map +1 -0
  1680. package/dist/src/ui/components/mcp/index.d.ts +12 -0
  1681. package/dist/src/ui/components/mcp/index.js +15 -0
  1682. package/dist/src/ui/components/mcp/index.js.map +1 -0
  1683. package/dist/src/ui/components/mcp/steps/AuthenticateStep.d.ts +7 -0
  1684. package/dist/src/ui/components/mcp/steps/AuthenticateStep.js +187 -0
  1685. package/dist/src/ui/components/mcp/steps/AuthenticateStep.js.map +1 -0
  1686. package/dist/src/ui/components/mcp/steps/DisableScopeSelectStep.d.ts +7 -0
  1687. package/dist/src/ui/components/mcp/steps/DisableScopeSelectStep.js +44 -0
  1688. package/dist/src/ui/components/mcp/steps/DisableScopeSelectStep.js.map +1 -0
  1689. package/dist/src/ui/components/mcp/steps/ServerDetailStep.d.ts +7 -0
  1690. package/dist/src/ui/components/mcp/steps/ServerDetailStep.js +108 -0
  1691. package/dist/src/ui/components/mcp/steps/ServerDetailStep.js.map +1 -0
  1692. package/dist/src/ui/components/mcp/steps/ServerListStep.d.ts +7 -0
  1693. package/dist/src/ui/components/mcp/steps/ServerListStep.js +74 -0
  1694. package/dist/src/ui/components/mcp/steps/ServerListStep.js.map +1 -0
  1695. package/dist/src/ui/components/mcp/steps/ServerListStep.test.d.ts +6 -0
  1696. package/dist/src/ui/components/mcp/steps/ServerListStep.test.js +60 -0
  1697. package/dist/src/ui/components/mcp/steps/ServerListStep.test.js.map +1 -0
  1698. package/dist/src/ui/components/mcp/steps/ToolDetailStep.d.ts +7 -0
  1699. package/dist/src/ui/components/mcp/steps/ToolDetailStep.js +49 -0
  1700. package/dist/src/ui/components/mcp/steps/ToolDetailStep.js.map +1 -0
  1701. package/dist/src/ui/components/mcp/steps/ToolListStep.d.ts +7 -0
  1702. package/dist/src/ui/components/mcp/steps/ToolListStep.js +80 -0
  1703. package/dist/src/ui/components/mcp/steps/ToolListStep.js.map +1 -0
  1704. package/dist/src/ui/components/mcp/steps/ToolListStep.test.d.ts +6 -0
  1705. package/dist/src/ui/components/mcp/steps/ToolListStep.test.js +55 -0
  1706. package/dist/src/ui/components/mcp/steps/ToolListStep.test.js.map +1 -0
  1707. package/dist/src/ui/components/mcp/types.d.ts +177 -0
  1708. package/dist/src/ui/components/mcp/types.js +17 -0
  1709. package/dist/src/ui/components/mcp/types.js.map +1 -0
  1710. package/dist/src/ui/components/mcp/utils.d.ts +40 -0
  1711. package/dist/src/ui/components/mcp/utils.js +126 -0
  1712. package/dist/src/ui/components/mcp/utils.js.map +1 -0
  1713. package/dist/src/ui/components/mcp/utils.test.d.ts +6 -0
  1714. package/dist/src/ui/components/mcp/utils.test.js +130 -0
  1715. package/dist/src/ui/components/mcp/utils.test.js.map +1 -0
  1716. package/dist/src/ui/components/messages/AskUserQuestionDialog.d.ts +14 -0
  1717. package/dist/src/ui/components/messages/AskUserQuestionDialog.js +291 -0
  1718. package/dist/src/ui/components/messages/AskUserQuestionDialog.js.map +1 -0
  1719. package/dist/src/ui/components/messages/AskUserQuestionDialog.test.d.ts +6 -0
  1720. package/dist/src/ui/components/messages/AskUserQuestionDialog.test.js +281 -0
  1721. package/dist/src/ui/components/messages/AskUserQuestionDialog.test.js.map +1 -0
  1722. package/dist/src/ui/components/messages/BtwMessage.d.ts +14 -0
  1723. package/dist/src/ui/components/messages/BtwMessage.js +30 -0
  1724. package/dist/src/ui/components/messages/BtwMessage.js.map +1 -0
  1725. package/dist/src/ui/components/messages/BtwMessage.test.d.ts +6 -0
  1726. package/dist/src/ui/components/messages/BtwMessage.test.js +60 -0
  1727. package/dist/src/ui/components/messages/BtwMessage.test.js.map +1 -0
  1728. package/dist/src/ui/components/messages/CompactToolGroupDisplay.d.ts +20 -0
  1729. package/dist/src/ui/components/messages/CompactToolGroupDisplay.js +80 -0
  1730. package/dist/src/ui/components/messages/CompactToolGroupDisplay.js.map +1 -0
  1731. package/dist/src/ui/components/messages/CompactToolGroupDisplay.test.d.ts +6 -0
  1732. package/dist/src/ui/components/messages/CompactToolGroupDisplay.test.js +139 -0
  1733. package/dist/src/ui/components/messages/CompactToolGroupDisplay.test.js.map +1 -0
  1734. package/dist/src/ui/components/messages/CompressionMessage.d.ts +10 -0
  1735. package/dist/src/ui/components/messages/CompressionMessage.js +50 -0
  1736. package/dist/src/ui/components/messages/CompressionMessage.js.map +1 -0
  1737. package/dist/src/ui/components/messages/CompressionMessage.test.d.ts +6 -0
  1738. package/dist/src/ui/components/messages/CompressionMessage.test.js +160 -0
  1739. package/dist/src/ui/components/messages/CompressionMessage.test.js.map +1 -0
  1740. package/dist/src/ui/components/messages/ConversationMessages.d.ts +46 -0
  1741. package/dist/src/ui/components/messages/ConversationMessages.js +32 -0
  1742. package/dist/src/ui/components/messages/ConversationMessages.js.map +1 -0
  1743. package/dist/src/ui/components/messages/DiffRenderer.d.ts +19 -0
  1744. package/dist/src/ui/components/messages/DiffRenderer.js +219 -0
  1745. package/dist/src/ui/components/messages/DiffRenderer.js.map +1 -0
  1746. package/dist/src/ui/components/messages/DiffRenderer.test.d.ts +6 -0
  1747. package/dist/src/ui/components/messages/DiffRenderer.test.js +296 -0
  1748. package/dist/src/ui/components/messages/DiffRenderer.test.js.map +1 -0
  1749. package/dist/src/ui/components/messages/DiffStatsDisplay.d.ts +18 -0
  1750. package/dist/src/ui/components/messages/DiffStatsDisplay.js +50 -0
  1751. package/dist/src/ui/components/messages/DiffStatsDisplay.js.map +1 -0
  1752. package/dist/src/ui/components/messages/DiffStatsDisplay.test.d.ts +6 -0
  1753. package/dist/src/ui/components/messages/DiffStatsDisplay.test.js +165 -0
  1754. package/dist/src/ui/components/messages/DiffStatsDisplay.test.js.map +1 -0
  1755. package/dist/src/ui/components/messages/GoalStatusMessage.d.ts +16 -0
  1756. package/dist/src/ui/components/messages/GoalStatusMessage.js +76 -0
  1757. package/dist/src/ui/components/messages/GoalStatusMessage.js.map +1 -0
  1758. package/dist/src/ui/components/messages/GoalStatusMessage.test.d.ts +6 -0
  1759. package/dist/src/ui/components/messages/GoalStatusMessage.test.js +32 -0
  1760. package/dist/src/ui/components/messages/GoalStatusMessage.test.js.map +1 -0
  1761. package/dist/src/ui/components/messages/InlineParallelAgentsDisplay.d.ts +33 -0
  1762. package/dist/src/ui/components/messages/InlineParallelAgentsDisplay.js +196 -0
  1763. package/dist/src/ui/components/messages/InlineParallelAgentsDisplay.js.map +1 -0
  1764. package/dist/src/ui/components/messages/InlineParallelAgentsDisplay.test.d.ts +6 -0
  1765. package/dist/src/ui/components/messages/InlineParallelAgentsDisplay.test.js +219 -0
  1766. package/dist/src/ui/components/messages/InlineParallelAgentsDisplay.test.js.map +1 -0
  1767. package/dist/src/ui/components/messages/InsightProgressMessage.d.ts +12 -0
  1768. package/dist/src/ui/components/messages/InsightProgressMessage.js +20 -0
  1769. package/dist/src/ui/components/messages/InsightProgressMessage.js.map +1 -0
  1770. package/dist/src/ui/components/messages/MemorySavedMessage.d.ts +18 -0
  1771. package/dist/src/ui/components/messages/MemorySavedMessage.js +15 -0
  1772. package/dist/src/ui/components/messages/MemorySavedMessage.js.map +1 -0
  1773. package/dist/src/ui/components/messages/StatusMessages.d.ts +33 -0
  1774. package/dist/src/ui/components/messages/StatusMessages.js +28 -0
  1775. package/dist/src/ui/components/messages/StatusMessages.js.map +1 -0
  1776. package/dist/src/ui/components/messages/StatusMessages.test.d.ts +6 -0
  1777. package/dist/src/ui/components/messages/StatusMessages.test.js +21 -0
  1778. package/dist/src/ui/components/messages/StatusMessages.test.js.map +1 -0
  1779. package/dist/src/ui/components/messages/SummaryMessage.d.ts +11 -0
  1780. package/dist/src/ui/components/messages/SummaryMessage.js +38 -0
  1781. package/dist/src/ui/components/messages/SummaryMessage.js.map +1 -0
  1782. package/dist/src/ui/components/messages/ToolConfirmationMessage.d.ts +16 -0
  1783. package/dist/src/ui/components/messages/ToolConfirmationMessage.js +352 -0
  1784. package/dist/src/ui/components/messages/ToolConfirmationMessage.js.map +1 -0
  1785. package/dist/src/ui/components/messages/ToolConfirmationMessage.test.d.ts +6 -0
  1786. package/dist/src/ui/components/messages/ToolConfirmationMessage.test.js +312 -0
  1787. package/dist/src/ui/components/messages/ToolConfirmationMessage.test.js.map +1 -0
  1788. package/dist/src/ui/components/messages/ToolGroupMessage.d.ts +58 -0
  1789. package/dist/src/ui/components/messages/ToolGroupMessage.js +278 -0
  1790. package/dist/src/ui/components/messages/ToolGroupMessage.js.map +1 -0
  1791. package/dist/src/ui/components/messages/ToolGroupMessage.test.d.ts +6 -0
  1792. package/dist/src/ui/components/messages/ToolGroupMessage.test.js +619 -0
  1793. package/dist/src/ui/components/messages/ToolGroupMessage.test.js.map +1 -0
  1794. package/dist/src/ui/components/messages/ToolMessage.d.ts +39 -0
  1795. package/dist/src/ui/components/messages/ToolMessage.js +400 -0
  1796. package/dist/src/ui/components/messages/ToolMessage.js.map +1 -0
  1797. package/dist/src/ui/components/messages/ToolMessage.test.d.ts +6 -0
  1798. package/dist/src/ui/components/messages/ToolMessage.test.js +575 -0
  1799. package/dist/src/ui/components/messages/ToolMessage.test.js.map +1 -0
  1800. package/dist/src/ui/components/shared/BaseSelectionList.d.ts +40 -0
  1801. package/dist/src/ui/components/shared/BaseSelectionList.js +75 -0
  1802. package/dist/src/ui/components/shared/BaseSelectionList.js.map +1 -0
  1803. package/dist/src/ui/components/shared/BaseSelectionList.test.d.ts +6 -0
  1804. package/dist/src/ui/components/shared/BaseSelectionList.test.js +376 -0
  1805. package/dist/src/ui/components/shared/BaseSelectionList.test.js.map +1 -0
  1806. package/dist/src/ui/components/shared/DescriptiveRadioButtonSelect.d.ts +37 -0
  1807. package/dist/src/ui/components/shared/DescriptiveRadioButtonSelect.js +13 -0
  1808. package/dist/src/ui/components/shared/DescriptiveRadioButtonSelect.js.map +1 -0
  1809. package/dist/src/ui/components/shared/DescriptiveRadioButtonSelect.test.d.ts +6 -0
  1810. package/dist/src/ui/components/shared/DescriptiveRadioButtonSelect.test.js +79 -0
  1811. package/dist/src/ui/components/shared/DescriptiveRadioButtonSelect.test.js.map +1 -0
  1812. package/dist/src/ui/components/shared/EnumSelector.d.ts +18 -0
  1813. package/dist/src/ui/components/shared/EnumSelector.js +44 -0
  1814. package/dist/src/ui/components/shared/EnumSelector.js.map +1 -0
  1815. package/dist/src/ui/components/shared/EnumSelector.test.d.ts +6 -0
  1816. package/dist/src/ui/components/shared/EnumSelector.test.js +70 -0
  1817. package/dist/src/ui/components/shared/EnumSelector.test.js.map +1 -0
  1818. package/dist/src/ui/components/shared/MaxSizedBox.d.ts +61 -0
  1819. package/dist/src/ui/components/shared/MaxSizedBox.js +453 -0
  1820. package/dist/src/ui/components/shared/MaxSizedBox.js.map +1 -0
  1821. package/dist/src/ui/components/shared/MaxSizedBox.test.d.ts +6 -0
  1822. package/dist/src/ui/components/shared/MaxSizedBox.test.js +154 -0
  1823. package/dist/src/ui/components/shared/MaxSizedBox.test.js.map +1 -0
  1824. package/dist/src/ui/components/shared/MultiSelect.d.ts +30 -0
  1825. package/dist/src/ui/components/shared/MultiSelect.js +94 -0
  1826. package/dist/src/ui/components/shared/MultiSelect.js.map +1 -0
  1827. package/dist/src/ui/components/shared/RadioButtonSelect.d.ts +45 -0
  1828. package/dist/src/ui/components/shared/RadioButtonSelect.js +21 -0
  1829. package/dist/src/ui/components/shared/RadioButtonSelect.js.map +1 -0
  1830. package/dist/src/ui/components/shared/RadioButtonSelect.test.d.ts +6 -0
  1831. package/dist/src/ui/components/shared/RadioButtonSelect.test.js +134 -0
  1832. package/dist/src/ui/components/shared/RadioButtonSelect.test.js.map +1 -0
  1833. package/dist/src/ui/components/shared/ScopeSelector.d.ts +19 -0
  1834. package/dist/src/ui/components/shared/ScopeSelector.js +16 -0
  1835. package/dist/src/ui/components/shared/ScopeSelector.js.map +1 -0
  1836. package/dist/src/ui/components/shared/ScrollableList.d.ts +19 -0
  1837. package/dist/src/ui/components/shared/ScrollableList.js +97 -0
  1838. package/dist/src/ui/components/shared/ScrollableList.js.map +1 -0
  1839. package/dist/src/ui/components/shared/ScrollableList.test.d.ts +6 -0
  1840. package/dist/src/ui/components/shared/ScrollableList.test.js +158 -0
  1841. package/dist/src/ui/components/shared/ScrollableList.test.js.map +1 -0
  1842. package/dist/src/ui/components/shared/StaticRender.d.ts +25 -0
  1843. package/dist/src/ui/components/shared/StaticRender.js +25 -0
  1844. package/dist/src/ui/components/shared/StaticRender.js.map +1 -0
  1845. package/dist/src/ui/components/shared/TextInput.d.ts +25 -0
  1846. package/dist/src/ui/components/shared/TextInput.js +163 -0
  1847. package/dist/src/ui/components/shared/TextInput.js.map +1 -0
  1848. package/dist/src/ui/components/shared/TextInput.test.d.ts +6 -0
  1849. package/dist/src/ui/components/shared/TextInput.test.js +91 -0
  1850. package/dist/src/ui/components/shared/TextInput.test.js.map +1 -0
  1851. package/dist/src/ui/components/shared/ToolElapsedTime.d.ts +30 -0
  1852. package/dist/src/ui/components/shared/ToolElapsedTime.js +43 -0
  1853. package/dist/src/ui/components/shared/ToolElapsedTime.js.map +1 -0
  1854. package/dist/src/ui/components/shared/ToolElapsedTime.test.d.ts +6 -0
  1855. package/dist/src/ui/components/shared/ToolElapsedTime.test.js +63 -0
  1856. package/dist/src/ui/components/shared/ToolElapsedTime.test.js.map +1 -0
  1857. package/dist/src/ui/components/shared/ToolStatusIndicator.d.ts +14 -0
  1858. package/dist/src/ui/components/shared/ToolStatusIndicator.js +13 -0
  1859. package/dist/src/ui/components/shared/ToolStatusIndicator.js.map +1 -0
  1860. package/dist/src/ui/components/shared/VirtualizedList.d.ts +49 -0
  1861. package/dist/src/ui/components/shared/VirtualizedList.js +529 -0
  1862. package/dist/src/ui/components/shared/VirtualizedList.js.map +1 -0
  1863. package/dist/src/ui/components/shared/VirtualizedList.test.d.ts +6 -0
  1864. package/dist/src/ui/components/shared/VirtualizedList.test.js +371 -0
  1865. package/dist/src/ui/components/shared/VirtualizedList.test.js.map +1 -0
  1866. package/dist/src/ui/components/shared/text-buffer-external-editor.test.d.ts +6 -0
  1867. package/dist/src/ui/components/shared/text-buffer-external-editor.test.js +657 -0
  1868. package/dist/src/ui/components/shared/text-buffer-external-editor.test.js.map +1 -0
  1869. package/dist/src/ui/components/shared/text-buffer.d.ts +503 -0
  1870. package/dist/src/ui/components/shared/text-buffer.js +2181 -0
  1871. package/dist/src/ui/components/shared/text-buffer.js.map +1 -0
  1872. package/dist/src/ui/components/shared/vim-buffer-actions.d.ts +74 -0
  1873. package/dist/src/ui/components/shared/vim-buffer-actions.js +612 -0
  1874. package/dist/src/ui/components/shared/vim-buffer-actions.js.map +1 -0
  1875. package/dist/src/ui/components/skills/SkillsManagerDialog.d.ts +44 -0
  1876. package/dist/src/ui/components/skills/SkillsManagerDialog.js +423 -0
  1877. package/dist/src/ui/components/skills/SkillsManagerDialog.js.map +1 -0
  1878. package/dist/src/ui/components/stats-helpers.d.ts +30 -0
  1879. package/dist/src/ui/components/stats-helpers.js +79 -0
  1880. package/dist/src/ui/components/stats-helpers.js.map +1 -0
  1881. package/dist/src/ui/components/subagents/constants.d.ts +23 -0
  1882. package/dist/src/ui/components/subagents/constants.js +67 -0
  1883. package/dist/src/ui/components/subagents/constants.js.map +1 -0
  1884. package/dist/src/ui/components/subagents/create/AgentCreationWizard.d.ts +15 -0
  1885. package/dist/src/ui/components/subagents/create/AgentCreationWizard.js +173 -0
  1886. package/dist/src/ui/components/subagents/create/AgentCreationWizard.js.map +1 -0
  1887. package/dist/src/ui/components/subagents/create/ColorSelector.d.ts +15 -0
  1888. package/dist/src/ui/components/subagents/create/ColorSelector.js +43 -0
  1889. package/dist/src/ui/components/subagents/create/ColorSelector.js.map +1 -0
  1890. package/dist/src/ui/components/subagents/create/CreationSummary.d.ts +10 -0
  1891. package/dist/src/ui/components/subagents/create/CreationSummary.js +176 -0
  1892. package/dist/src/ui/components/subagents/create/CreationSummary.js.map +1 -0
  1893. package/dist/src/ui/components/subagents/create/DescriptionInput.d.ts +10 -0
  1894. package/dist/src/ui/components/subagents/create/DescriptionInput.js +107 -0
  1895. package/dist/src/ui/components/subagents/create/DescriptionInput.js.map +1 -0
  1896. package/dist/src/ui/components/subagents/create/GenerationMethodSelector.d.ts +10 -0
  1897. package/dist/src/ui/components/subagents/create/GenerationMethodSelector.js +39 -0
  1898. package/dist/src/ui/components/subagents/create/GenerationMethodSelector.js.map +1 -0
  1899. package/dist/src/ui/components/subagents/create/LocationSelector.d.ts +10 -0
  1900. package/dist/src/ui/components/subagents/create/LocationSelector.js +39 -0
  1901. package/dist/src/ui/components/subagents/create/LocationSelector.js.map +1 -0
  1902. package/dist/src/ui/components/subagents/create/TextEntryStep.d.ts +26 -0
  1903. package/dist/src/ui/components/subagents/create/TextEntryStep.js +28 -0
  1904. package/dist/src/ui/components/subagents/create/TextEntryStep.js.map +1 -0
  1905. package/dist/src/ui/components/subagents/create/ToolSelector.d.ts +16 -0
  1906. package/dist/src/ui/components/subagents/create/ToolSelector.js +145 -0
  1907. package/dist/src/ui/components/subagents/create/ToolSelector.js.map +1 -0
  1908. package/dist/src/ui/components/subagents/index.d.ts +7 -0
  1909. package/dist/src/ui/components/subagents/index.js +13 -0
  1910. package/dist/src/ui/components/subagents/index.js.map +1 -0
  1911. package/dist/src/ui/components/subagents/manage/ActionSelectionStep.d.ts +13 -0
  1912. package/dist/src/ui/components/subagents/manage/ActionSelectionStep.js +73 -0
  1913. package/dist/src/ui/components/subagents/manage/ActionSelectionStep.js.map +1 -0
  1914. package/dist/src/ui/components/subagents/manage/AgentDeleteStep.d.ts +13 -0
  1915. package/dist/src/ui/components/subagents/manage/AgentDeleteStep.js +38 -0
  1916. package/dist/src/ui/components/subagents/manage/AgentDeleteStep.js.map +1 -0
  1917. package/dist/src/ui/components/subagents/manage/AgentEditStep.d.ts +15 -0
  1918. package/dist/src/ui/components/subagents/manage/AgentEditStep.js +76 -0
  1919. package/dist/src/ui/components/subagents/manage/AgentEditStep.js.map +1 -0
  1920. package/dist/src/ui/components/subagents/manage/AgentSelectionStep.d.ts +12 -0
  1921. package/dist/src/ui/components/subagents/manage/AgentSelectionStep.js +342 -0
  1922. package/dist/src/ui/components/subagents/manage/AgentSelectionStep.js.map +1 -0
  1923. package/dist/src/ui/components/subagents/manage/AgentSelectionStep.test.d.ts +6 -0
  1924. package/dist/src/ui/components/subagents/manage/AgentSelectionStep.test.js +56 -0
  1925. package/dist/src/ui/components/subagents/manage/AgentSelectionStep.test.js.map +1 -0
  1926. package/dist/src/ui/components/subagents/manage/AgentViewerStep.d.ts +11 -0
  1927. package/dist/src/ui/components/subagents/manage/AgentViewerStep.js +20 -0
  1928. package/dist/src/ui/components/subagents/manage/AgentViewerStep.js.map +1 -0
  1929. package/dist/src/ui/components/subagents/manage/AgentsManagerDialog.d.ts +15 -0
  1930. package/dist/src/ui/components/subagents/manage/AgentsManagerDialog.js +214 -0
  1931. package/dist/src/ui/components/subagents/manage/AgentsManagerDialog.js.map +1 -0
  1932. package/dist/src/ui/components/subagents/reducers.d.ts +14 -0
  1933. package/dist/src/ui/components/subagents/reducers.js +162 -0
  1934. package/dist/src/ui/components/subagents/reducers.js.map +1 -0
  1935. package/dist/src/ui/components/subagents/types.d.ts +137 -0
  1936. package/dist/src/ui/components/subagents/types.js +15 -0
  1937. package/dist/src/ui/components/subagents/types.js.map +1 -0
  1938. package/dist/src/ui/components/subagents/utils.d.ts +15 -0
  1939. package/dist/src/ui/components/subagents/utils.js +79 -0
  1940. package/dist/src/ui/components/subagents/utils.js.map +1 -0
  1941. package/dist/src/ui/components/views/ContextUsage.d.ts +23 -0
  1942. package/dist/src/ui/components/views/ContextUsage.js +130 -0
  1943. package/dist/src/ui/components/views/ContextUsage.js.map +1 -0
  1944. package/dist/src/ui/components/views/ContextUsage.test.d.ts +6 -0
  1945. package/dist/src/ui/components/views/ContextUsage.test.js +76 -0
  1946. package/dist/src/ui/components/views/ContextUsage.test.js.map +1 -0
  1947. package/dist/src/ui/components/views/DoctorReport.d.ts +18 -0
  1948. package/dist/src/ui/components/views/DoctorReport.js +45 -0
  1949. package/dist/src/ui/components/views/DoctorReport.js.map +1 -0
  1950. package/dist/src/ui/components/views/ExtensionsList.d.ts +6 -0
  1951. package/dist/src/ui/components/views/ExtensionsList.js +49 -0
  1952. package/dist/src/ui/components/views/ExtensionsList.js.map +1 -0
  1953. package/dist/src/ui/components/views/ExtensionsList.test.d.ts +6 -0
  1954. package/dist/src/ui/components/views/ExtensionsList.test.js +88 -0
  1955. package/dist/src/ui/components/views/ExtensionsList.test.js.map +1 -0
  1956. package/dist/src/ui/components/views/McpStatus.d.ts +27 -0
  1957. package/dist/src/ui/components/views/McpStatus.js +90 -0
  1958. package/dist/src/ui/components/views/McpStatus.js.map +1 -0
  1959. package/dist/src/ui/components/views/McpStatus.test.d.ts +6 -0
  1960. package/dist/src/ui/components/views/McpStatus.test.js +117 -0
  1961. package/dist/src/ui/components/views/McpStatus.test.js.map +1 -0
  1962. package/dist/src/ui/components/views/SkillsList.d.ts +12 -0
  1963. package/dist/src/ui/components/views/SkillsList.js +7 -0
  1964. package/dist/src/ui/components/views/SkillsList.js.map +1 -0
  1965. package/dist/src/ui/components/views/ToolsList.d.ts +14 -0
  1966. package/dist/src/ui/components/views/ToolsList.js +8 -0
  1967. package/dist/src/ui/components/views/ToolsList.js.map +1 -0
  1968. package/dist/src/ui/components/views/ToolsList.test.d.ts +6 -0
  1969. package/dist/src/ui/components/views/ToolsList.test.js +45 -0
  1970. package/dist/src/ui/components/views/ToolsList.test.js.map +1 -0
  1971. package/dist/src/ui/constants.d.ts +18 -0
  1972. package/dist/src/ui/constants.js +23 -0
  1973. package/dist/src/ui/constants.js.map +1 -0
  1974. package/dist/src/ui/contexts/AgentViewContext.d.ts +49 -0
  1975. package/dist/src/ui/contexts/AgentViewContext.js +187 -0
  1976. package/dist/src/ui/contexts/AgentViewContext.js.map +1 -0
  1977. package/dist/src/ui/contexts/AppContext.d.ts +11 -0
  1978. package/dist/src/ui/contexts/AppContext.js +15 -0
  1979. package/dist/src/ui/contexts/AppContext.js.map +1 -0
  1980. package/dist/src/ui/contexts/BackgroundTaskViewContext.d.ts +60 -0
  1981. package/dist/src/ui/contexts/BackgroundTaskViewContext.js +238 -0
  1982. package/dist/src/ui/contexts/BackgroundTaskViewContext.js.map +1 -0
  1983. package/dist/src/ui/contexts/CompactModeContext.d.ts +13 -0
  1984. package/dist/src/ui/contexts/CompactModeContext.js +13 -0
  1985. package/dist/src/ui/contexts/CompactModeContext.js.map +1 -0
  1986. package/dist/src/ui/contexts/ConfigContext.d.ts +9 -0
  1987. package/dist/src/ui/contexts/ConfigContext.js +16 -0
  1988. package/dist/src/ui/contexts/ConfigContext.js.map +1 -0
  1989. package/dist/src/ui/contexts/KeypressContext.d.ts +40 -0
  1990. package/dist/src/ui/contexts/KeypressContext.js +959 -0
  1991. package/dist/src/ui/contexts/KeypressContext.js.map +1 -0
  1992. package/dist/src/ui/contexts/KeypressContext.test.d.ts +6 -0
  1993. package/dist/src/ui/contexts/KeypressContext.test.js +1360 -0
  1994. package/dist/src/ui/contexts/KeypressContext.test.js.map +1 -0
  1995. package/dist/src/ui/contexts/OverflowContext.d.ts +19 -0
  1996. package/dist/src/ui/contexts/OverflowContext.js +38 -0
  1997. package/dist/src/ui/contexts/OverflowContext.js.map +1 -0
  1998. package/dist/src/ui/contexts/RenderModeContext.d.ts +14 -0
  1999. package/dist/src/ui/contexts/RenderModeContext.js +15 -0
  2000. package/dist/src/ui/contexts/RenderModeContext.js.map +1 -0
  2001. package/dist/src/ui/contexts/SessionContext.d.ts +47 -0
  2002. package/dist/src/ui/contexts/SessionContext.js +180 -0
  2003. package/dist/src/ui/contexts/SessionContext.js.map +1 -0
  2004. package/dist/src/ui/contexts/SettingsContext.d.ts +9 -0
  2005. package/dist/src/ui/contexts/SettingsContext.js +15 -0
  2006. package/dist/src/ui/contexts/SettingsContext.js.map +1 -0
  2007. package/dist/src/ui/contexts/ShellFocusContext.d.ts +7 -0
  2008. package/dist/src/ui/contexts/ShellFocusContext.js +9 -0
  2009. package/dist/src/ui/contexts/ShellFocusContext.js.map +1 -0
  2010. package/dist/src/ui/contexts/StreamingContext.d.ts +9 -0
  2011. package/dist/src/ui/contexts/StreamingContext.js +15 -0
  2012. package/dist/src/ui/contexts/StreamingContext.js.map +1 -0
  2013. package/dist/src/ui/contexts/TerminalOutputContext.d.ts +12 -0
  2014. package/dist/src/ui/contexts/TerminalOutputContext.js +11 -0
  2015. package/dist/src/ui/contexts/TerminalOutputContext.js.map +1 -0
  2016. package/dist/src/ui/contexts/UIActionsContext.d.ts +91 -0
  2017. package/dist/src/ui/contexts/UIActionsContext.js +22 -0
  2018. package/dist/src/ui/contexts/UIActionsContext.js.map +1 -0
  2019. package/dist/src/ui/contexts/UIStateContext.d.ts +158 -0
  2020. package/dist/src/ui/contexts/UIStateContext.js +20 -0
  2021. package/dist/src/ui/contexts/UIStateContext.js.map +1 -0
  2022. package/dist/src/ui/contexts/VimModeContext.d.ts +31 -0
  2023. package/dist/src/ui/contexts/VimModeContext.js +60 -0
  2024. package/dist/src/ui/contexts/VimModeContext.js.map +1 -0
  2025. package/dist/src/ui/contexts/VimModeContext.test.d.ts +11 -0
  2026. package/dist/src/ui/contexts/VimModeContext.test.js +99 -0
  2027. package/dist/src/ui/contexts/VimModeContext.test.js.map +1 -0
  2028. package/dist/src/ui/daemon/DaemonTuiAdapter.d.ts +101 -0
  2029. package/dist/src/ui/daemon/DaemonTuiAdapter.js +695 -0
  2030. package/dist/src/ui/daemon/DaemonTuiAdapter.js.map +1 -0
  2031. package/dist/src/ui/daemon/DaemonTuiAdapter.test.d.ts +6 -0
  2032. package/dist/src/ui/daemon/DaemonTuiAdapter.test.js +784 -0
  2033. package/dist/src/ui/daemon/DaemonTuiAdapter.test.js.map +1 -0
  2034. package/dist/src/ui/editors/editorSettingsManager.d.ts +19 -0
  2035. package/dist/src/ui/editors/editorSettingsManager.js +48 -0
  2036. package/dist/src/ui/editors/editorSettingsManager.js.map +1 -0
  2037. package/dist/src/ui/hooks/atCommandProcessor.d.ts +33 -0
  2038. package/dist/src/ui/hooks/atCommandProcessor.js +344 -0
  2039. package/dist/src/ui/hooks/atCommandProcessor.js.map +1 -0
  2040. package/dist/src/ui/hooks/atCommandProcessor.test.d.ts +6 -0
  2041. package/dist/src/ui/hooks/atCommandProcessor.test.js +871 -0
  2042. package/dist/src/ui/hooks/atCommandProcessor.test.js.map +1 -0
  2043. package/dist/src/ui/hooks/keyToAnsi.d.ts +15 -0
  2044. package/dist/src/ui/hooks/keyToAnsi.js +67 -0
  2045. package/dist/src/ui/hooks/keyToAnsi.js.map +1 -0
  2046. package/dist/src/ui/hooks/shellCommandProcessor.d.ts +18 -0
  2047. package/dist/src/ui/hooks/shellCommandProcessor.js +287 -0
  2048. package/dist/src/ui/hooks/shellCommandProcessor.js.map +1 -0
  2049. package/dist/src/ui/hooks/shellCommandProcessor.test.d.ts +6 -0
  2050. package/dist/src/ui/hooks/shellCommandProcessor.test.js +509 -0
  2051. package/dist/src/ui/hooks/shellCommandProcessor.test.js.map +1 -0
  2052. package/dist/src/ui/hooks/slashCommandProcessor.d.ts +71 -0
  2053. package/dist/src/ui/hooks/slashCommandProcessor.js +837 -0
  2054. package/dist/src/ui/hooks/slashCommandProcessor.js.map +1 -0
  2055. package/dist/src/ui/hooks/useAgentStreamingState.d.ts +29 -0
  2056. package/dist/src/ui/hooks/useAgentStreamingState.js +109 -0
  2057. package/dist/src/ui/hooks/useAgentStreamingState.js.map +1 -0
  2058. package/dist/src/ui/hooks/useAgentsManagerDialog.d.ts +11 -0
  2059. package/dist/src/ui/hooks/useAgentsManagerDialog.js +21 -0
  2060. package/dist/src/ui/hooks/useAgentsManagerDialog.js.map +1 -0
  2061. package/dist/src/ui/hooks/useAnimatedScrollbar.d.ts +37 -0
  2062. package/dist/src/ui/hooks/useAnimatedScrollbar.js +44 -0
  2063. package/dist/src/ui/hooks/useAnimatedScrollbar.js.map +1 -0
  2064. package/dist/src/ui/hooks/useAnimatedScrollbar.test.d.ts +6 -0
  2065. package/dist/src/ui/hooks/useAnimatedScrollbar.test.js +74 -0
  2066. package/dist/src/ui/hooks/useAnimatedScrollbar.test.js.map +1 -0
  2067. package/dist/src/ui/hooks/useAnimationFrame.d.ts +25 -0
  2068. package/dist/src/ui/hooks/useAnimationFrame.js +86 -0
  2069. package/dist/src/ui/hooks/useAnimationFrame.js.map +1 -0
  2070. package/dist/src/ui/hooks/useApprovalModeCommand.d.ts +14 -0
  2071. package/dist/src/ui/hooks/useApprovalModeCommand.js +33 -0
  2072. package/dist/src/ui/hooks/useApprovalModeCommand.js.map +1 -0
  2073. package/dist/src/ui/hooks/useArenaCommand.d.ts +13 -0
  2074. package/dist/src/ui/hooks/useArenaCommand.js +21 -0
  2075. package/dist/src/ui/hooks/useArenaCommand.js.map +1 -0
  2076. package/dist/src/ui/hooks/useArenaInProcess.d.ts +14 -0
  2077. package/dist/src/ui/hooks/useArenaInProcess.js +136 -0
  2078. package/dist/src/ui/hooks/useArenaInProcess.js.map +1 -0
  2079. package/dist/src/ui/hooks/useAtCompletion.d.ts +23 -0
  2080. package/dist/src/ui/hooks/useAtCompletion.js +184 -0
  2081. package/dist/src/ui/hooks/useAtCompletion.js.map +1 -0
  2082. package/dist/src/ui/hooks/useAttentionNotifications.d.ts +22 -0
  2083. package/dist/src/ui/hooks/useAttentionNotifications.js +89 -0
  2084. package/dist/src/ui/hooks/useAttentionNotifications.js.map +1 -0
  2085. package/dist/src/ui/hooks/useAttentionNotifications.test.d.ts +6 -0
  2086. package/dist/src/ui/hooks/useAttentionNotifications.test.js +222 -0
  2087. package/dist/src/ui/hooks/useAttentionNotifications.test.js.map +1 -0
  2088. package/dist/src/ui/hooks/useAutoAcceptIndicator.d.ts +32 -0
  2089. package/dist/src/ui/hooks/useAutoAcceptIndicator.js +124 -0
  2090. package/dist/src/ui/hooks/useAutoAcceptIndicator.js.map +1 -0
  2091. package/dist/src/ui/hooks/useAutoAcceptIndicator.test.d.ts +6 -0
  2092. package/dist/src/ui/hooks/useAutoAcceptIndicator.test.js +379 -0
  2093. package/dist/src/ui/hooks/useAutoAcceptIndicator.test.js.map +1 -0
  2094. package/dist/src/ui/hooks/useAwaySummary.d.ts +35 -0
  2095. package/dist/src/ui/hooks/useAwaySummary.js +141 -0
  2096. package/dist/src/ui/hooks/useAwaySummary.js.map +1 -0
  2097. package/dist/src/ui/hooks/useAwaySummary.test.d.ts +6 -0
  2098. package/dist/src/ui/hooks/useAwaySummary.test.js +103 -0
  2099. package/dist/src/ui/hooks/useAwaySummary.test.js.map +1 -0
  2100. package/dist/src/ui/hooks/useBackgroundTaskView.d.ts +69 -0
  2101. package/dist/src/ui/hooks/useBackgroundTaskView.js +217 -0
  2102. package/dist/src/ui/hooks/useBackgroundTaskView.js.map +1 -0
  2103. package/dist/src/ui/hooks/useBackgroundTaskView.test.d.ts +6 -0
  2104. package/dist/src/ui/hooks/useBackgroundTaskView.test.js +455 -0
  2105. package/dist/src/ui/hooks/useBackgroundTaskView.test.js.map +1 -0
  2106. package/dist/src/ui/hooks/useBatchedScroll.d.ts +14 -0
  2107. package/dist/src/ui/hooks/useBatchedScroll.js +25 -0
  2108. package/dist/src/ui/hooks/useBatchedScroll.js.map +1 -0
  2109. package/dist/src/ui/hooks/useBatchedScroll.test.d.ts +6 -0
  2110. package/dist/src/ui/hooks/useBatchedScroll.test.js +42 -0
  2111. package/dist/src/ui/hooks/useBatchedScroll.test.js.map +1 -0
  2112. package/dist/src/ui/hooks/useBracketedPaste.d.ts +12 -0
  2113. package/dist/src/ui/hooks/useBracketedPaste.js +32 -0
  2114. package/dist/src/ui/hooks/useBracketedPaste.js.map +1 -0
  2115. package/dist/src/ui/hooks/useBranchCommand.d.ts +33 -0
  2116. package/dist/src/ui/hooks/useBranchCommand.js +230 -0
  2117. package/dist/src/ui/hooks/useBranchCommand.js.map +1 -0
  2118. package/dist/src/ui/hooks/useBranchCommand.test.d.ts +6 -0
  2119. package/dist/src/ui/hooks/useBranchCommand.test.js +386 -0
  2120. package/dist/src/ui/hooks/useBranchCommand.test.js.map +1 -0
  2121. package/dist/src/ui/hooks/useCommandCompletion.d.ts +37 -0
  2122. package/dist/src/ui/hooks/useCommandCompletion.js +227 -0
  2123. package/dist/src/ui/hooks/useCommandCompletion.js.map +1 -0
  2124. package/dist/src/ui/hooks/useCommandMigration.d.ts +16 -0
  2125. package/dist/src/ui/hooks/useCommandMigration.js +40 -0
  2126. package/dist/src/ui/hooks/useCommandMigration.js.map +1 -0
  2127. package/dist/src/ui/hooks/useCompletion.d.ts +24 -0
  2128. package/dist/src/ui/hooks/useCompletion.js +88 -0
  2129. package/dist/src/ui/hooks/useCompletion.js.map +1 -0
  2130. package/dist/src/ui/hooks/useConfigInitMessage.d.ts +6 -0
  2131. package/dist/src/ui/hooks/useConfigInitMessage.js +45 -0
  2132. package/dist/src/ui/hooks/useConfigInitMessage.js.map +1 -0
  2133. package/dist/src/ui/hooks/useConfigInitMessage.test.d.ts +6 -0
  2134. package/dist/src/ui/hooks/useConfigInitMessage.test.js +80 -0
  2135. package/dist/src/ui/hooks/useConfigInitMessage.test.js.map +1 -0
  2136. package/dist/src/ui/hooks/useContextualTips.d.ts +19 -0
  2137. package/dist/src/ui/hooks/useContextualTips.js +65 -0
  2138. package/dist/src/ui/hooks/useContextualTips.js.map +1 -0
  2139. package/dist/src/ui/hooks/useDeleteCommand.d.ts +19 -0
  2140. package/dist/src/ui/hooks/useDeleteCommand.js +167 -0
  2141. package/dist/src/ui/hooks/useDeleteCommand.js.map +1 -0
  2142. package/dist/src/ui/hooks/useDeleteCommand.test.d.ts +6 -0
  2143. package/dist/src/ui/hooks/useDeleteCommand.test.js +391 -0
  2144. package/dist/src/ui/hooks/useDeleteCommand.test.js.map +1 -0
  2145. package/dist/src/ui/hooks/useDialogClose.d.ts +48 -0
  2146. package/dist/src/ui/hooks/useDialogClose.js +102 -0
  2147. package/dist/src/ui/hooks/useDialogClose.js.map +1 -0
  2148. package/dist/src/ui/hooks/useDiffData.d.ts +32 -0
  2149. package/dist/src/ui/hooks/useDiffData.js +72 -0
  2150. package/dist/src/ui/hooks/useDiffData.js.map +1 -0
  2151. package/dist/src/ui/hooks/useDoublePress.d.ts +18 -0
  2152. package/dist/src/ui/hooks/useDoublePress.js +47 -0
  2153. package/dist/src/ui/hooks/useDoublePress.js.map +1 -0
  2154. package/dist/src/ui/hooks/useEditorSettings.d.ts +16 -0
  2155. package/dist/src/ui/hooks/useEditorSettings.js +43 -0
  2156. package/dist/src/ui/hooks/useEditorSettings.js.map +1 -0
  2157. package/dist/src/ui/hooks/useEditorSettings.test.d.ts +6 -0
  2158. package/dist/src/ui/hooks/useEditorSettings.test.js +164 -0
  2159. package/dist/src/ui/hooks/useEditorSettings.test.js.map +1 -0
  2160. package/dist/src/ui/hooks/useExportCompletion.d.ts +70 -0
  2161. package/dist/src/ui/hooks/useExportCompletion.js +208 -0
  2162. package/dist/src/ui/hooks/useExportCompletion.js.map +1 -0
  2163. package/dist/src/ui/hooks/useExportCompletion.test.d.ts +6 -0
  2164. package/dist/src/ui/hooks/useExportCompletion.test.js +190 -0
  2165. package/dist/src/ui/hooks/useExportCompletion.test.js.map +1 -0
  2166. package/dist/src/ui/hooks/useExtensionUpdates.d.ts +71 -0
  2167. package/dist/src/ui/hooks/useExtensionUpdates.js +229 -0
  2168. package/dist/src/ui/hooks/useExtensionUpdates.js.map +1 -0
  2169. package/dist/src/ui/hooks/useExtensionUpdates.test.d.ts +6 -0
  2170. package/dist/src/ui/hooks/useExtensionUpdates.test.js +455 -0
  2171. package/dist/src/ui/hooks/useExtensionUpdates.test.js.map +1 -0
  2172. package/dist/src/ui/hooks/useExtensionsManagerDialog.d.ts +12 -0
  2173. package/dist/src/ui/hooks/useExtensionsManagerDialog.js +21 -0
  2174. package/dist/src/ui/hooks/useExtensionsManagerDialog.js.map +1 -0
  2175. package/dist/src/ui/hooks/useFeedbackDialog.d.ts +18 -0
  2176. package/dist/src/ui/hooks/useFeedbackDialog.js +130 -0
  2177. package/dist/src/ui/hooks/useFeedbackDialog.js.map +1 -0
  2178. package/dist/src/ui/hooks/useFocus.d.ts +10 -0
  2179. package/dist/src/ui/hooks/useFocus.js +51 -0
  2180. package/dist/src/ui/hooks/useFocus.js.map +1 -0
  2181. package/dist/src/ui/hooks/useFolderTrust.d.ts +13 -0
  2182. package/dist/src/ui/hooks/useFolderTrust.js +60 -0
  2183. package/dist/src/ui/hooks/useFolderTrust.js.map +1 -0
  2184. package/dist/src/ui/hooks/useFollowupSuggestions.d.ts +53 -0
  2185. package/dist/src/ui/hooks/useFollowupSuggestions.js +89 -0
  2186. package/dist/src/ui/hooks/useFollowupSuggestions.js.map +1 -0
  2187. package/dist/src/ui/hooks/useGeminiStream.d.ts +76 -0
  2188. package/dist/src/ui/hooks/useGeminiStream.js +1899 -0
  2189. package/dist/src/ui/hooks/useGeminiStream.js.map +1 -0
  2190. package/dist/src/ui/hooks/useGitBranchName.d.ts +6 -0
  2191. package/dist/src/ui/hooks/useGitBranchName.js +61 -0
  2192. package/dist/src/ui/hooks/useGitBranchName.js.map +1 -0
  2193. package/dist/src/ui/hooks/useGitBranchName.test.d.ts +6 -0
  2194. package/dist/src/ui/hooks/useGitBranchName.test.js +192 -0
  2195. package/dist/src/ui/hooks/useGitBranchName.test.js.map +1 -0
  2196. package/dist/src/ui/hooks/useHistoryManager.d.ts +24 -0
  2197. package/dist/src/ui/hooks/useHistoryManager.js +183 -0
  2198. package/dist/src/ui/hooks/useHistoryManager.js.map +1 -0
  2199. package/dist/src/ui/hooks/useHistoryManager.test.d.ts +6 -0
  2200. package/dist/src/ui/hooks/useHistoryManager.test.js +495 -0
  2201. package/dist/src/ui/hooks/useHistoryManager.test.js.map +1 -0
  2202. package/dist/src/ui/hooks/useHooksDialog.d.ts +11 -0
  2203. package/dist/src/ui/hooks/useHooksDialog.js +21 -0
  2204. package/dist/src/ui/hooks/useHooksDialog.js.map +1 -0
  2205. package/dist/src/ui/hooks/useIdeTrustListener.d.ts +16 -0
  2206. package/dist/src/ui/hooks/useIdeTrustListener.js +65 -0
  2207. package/dist/src/ui/hooks/useIdeTrustListener.js.map +1 -0
  2208. package/dist/src/ui/hooks/useIdeTrustListener.test.d.ts +6 -0
  2209. package/dist/src/ui/hooks/useIdeTrustListener.test.js +183 -0
  2210. package/dist/src/ui/hooks/useIdeTrustListener.test.js.map +1 -0
  2211. package/dist/src/ui/hooks/useInitializationAuthError.d.ts +22 -0
  2212. package/dist/src/ui/hooks/useInitializationAuthError.js +40 -0
  2213. package/dist/src/ui/hooks/useInitializationAuthError.js.map +1 -0
  2214. package/dist/src/ui/hooks/useInputHistory.d.ts +20 -0
  2215. package/dist/src/ui/hooks/useInputHistory.js +85 -0
  2216. package/dist/src/ui/hooks/useInputHistory.js.map +1 -0
  2217. package/dist/src/ui/hooks/useInputHistory.test.d.ts +6 -0
  2218. package/dist/src/ui/hooks/useInputHistory.test.js +207 -0
  2219. package/dist/src/ui/hooks/useInputHistory.test.js.map +1 -0
  2220. package/dist/src/ui/hooks/useInputHistoryStore.d.ts +19 -0
  2221. package/dist/src/ui/hooks/useInputHistoryStore.js +83 -0
  2222. package/dist/src/ui/hooks/useInputHistoryStore.js.map +1 -0
  2223. package/dist/src/ui/hooks/useInputHistoryStore.test.d.ts +6 -0
  2224. package/dist/src/ui/hooks/useInputHistoryStore.test.js +231 -0
  2225. package/dist/src/ui/hooks/useInputHistoryStore.test.js.map +1 -0
  2226. package/dist/src/ui/hooks/useKeypress.d.ts +17 -0
  2227. package/dist/src/ui/hooks/useKeypress.js +27 -0
  2228. package/dist/src/ui/hooks/useKeypress.js.map +1 -0
  2229. package/dist/src/ui/hooks/useKittyKeyboardProtocol.d.ts +15 -0
  2230. package/dist/src/ui/hooks/useKittyKeyboardProtocol.js +20 -0
  2231. package/dist/src/ui/hooks/useKittyKeyboardProtocol.js.map +1 -0
  2232. package/dist/src/ui/hooks/useLaunchEditor.d.ts +5 -0
  2233. package/dist/src/ui/hooks/useLaunchEditor.js +75 -0
  2234. package/dist/src/ui/hooks/useLaunchEditor.js.map +1 -0
  2235. package/dist/src/ui/hooks/useLoadingIndicator.d.ts +11 -0
  2236. package/dist/src/ui/hooks/useLoadingIndicator.js +50 -0
  2237. package/dist/src/ui/hooks/useLoadingIndicator.js.map +1 -0
  2238. package/dist/src/ui/hooks/useLoadingIndicator.test.d.ts +6 -0
  2239. package/dist/src/ui/hooks/useLoadingIndicator.test.js +172 -0
  2240. package/dist/src/ui/hooks/useLoadingIndicator.test.js.map +1 -0
  2241. package/dist/src/ui/hooks/useLogger.d.ts +11 -0
  2242. package/dist/src/ui/hooks/useLogger.js +32 -0
  2243. package/dist/src/ui/hooks/useLogger.js.map +1 -0
  2244. package/dist/src/ui/hooks/useMCPHealth.d.ts +16 -0
  2245. package/dist/src/ui/hooks/useMCPHealth.js +56 -0
  2246. package/dist/src/ui/hooks/useMCPHealth.js.map +1 -0
  2247. package/dist/src/ui/hooks/useMcpDialog.d.ts +11 -0
  2248. package/dist/src/ui/hooks/useMcpDialog.js +21 -0
  2249. package/dist/src/ui/hooks/useMcpDialog.js.map +1 -0
  2250. package/dist/src/ui/hooks/useMemoryDialog.d.ts +11 -0
  2251. package/dist/src/ui/hooks/useMemoryDialog.js +21 -0
  2252. package/dist/src/ui/hooks/useMemoryDialog.js.map +1 -0
  2253. package/dist/src/ui/hooks/useMemoryMonitor.d.ts +17 -0
  2254. package/dist/src/ui/hooks/useMemoryMonitor.js +83 -0
  2255. package/dist/src/ui/hooks/useMemoryMonitor.js.map +1 -0
  2256. package/dist/src/ui/hooks/useMemoryMonitor.test.d.ts +6 -0
  2257. package/dist/src/ui/hooks/useMemoryMonitor.test.js +153 -0
  2258. package/dist/src/ui/hooks/useMemoryMonitor.test.js.map +1 -0
  2259. package/dist/src/ui/hooks/useMessageQueue.d.ts +18 -0
  2260. package/dist/src/ui/hooks/useMessageQueue.js +67 -0
  2261. package/dist/src/ui/hooks/useMessageQueue.js.map +1 -0
  2262. package/dist/src/ui/hooks/useMessageQueue.test.d.ts +6 -0
  2263. package/dist/src/ui/hooks/useMessageQueue.test.js +219 -0
  2264. package/dist/src/ui/hooks/useMessageQueue.test.js.map +1 -0
  2265. package/dist/src/ui/hooks/useModelCommand.d.ts +15 -0
  2266. package/dist/src/ui/hooks/useModelCommand.js +25 -0
  2267. package/dist/src/ui/hooks/useModelCommand.js.map +1 -0
  2268. package/dist/src/ui/hooks/useModelCommand.test.d.ts +6 -0
  2269. package/dist/src/ui/hooks/useModelCommand.test.js +35 -0
  2270. package/dist/src/ui/hooks/useModelCommand.test.js.map +1 -0
  2271. package/dist/src/ui/hooks/useMouseEvents.d.ts +44 -0
  2272. package/dist/src/ui/hooks/useMouseEvents.js +85 -0
  2273. package/dist/src/ui/hooks/useMouseEvents.js.map +1 -0
  2274. package/dist/src/ui/hooks/usePhraseCycler.d.ts +14 -0
  2275. package/dist/src/ui/hooks/usePhraseCycler.js +70 -0
  2276. package/dist/src/ui/hooks/usePhraseCycler.js.map +1 -0
  2277. package/dist/src/ui/hooks/usePreferredEditor.d.ts +7 -0
  2278. package/dist/src/ui/hooks/usePreferredEditor.js +25 -0
  2279. package/dist/src/ui/hooks/usePreferredEditor.js.map +1 -0
  2280. package/dist/src/ui/hooks/useProviderUpdates.d.ts +33 -0
  2281. package/dist/src/ui/hooks/useProviderUpdates.js +215 -0
  2282. package/dist/src/ui/hooks/useProviderUpdates.js.map +1 -0
  2283. package/dist/src/ui/hooks/useProviderUpdates.test.d.ts +6 -0
  2284. package/dist/src/ui/hooks/useProviderUpdates.test.js +293 -0
  2285. package/dist/src/ui/hooks/useProviderUpdates.test.js.map +1 -0
  2286. package/dist/src/ui/hooks/useQwenAuth.d.ts +20 -0
  2287. package/dist/src/ui/hooks/useQwenAuth.js +74 -0
  2288. package/dist/src/ui/hooks/useQwenAuth.js.map +1 -0
  2289. package/dist/src/ui/hooks/useQwenAuth.test.d.ts +6 -0
  2290. package/dist/src/ui/hooks/useQwenAuth.test.js +266 -0
  2291. package/dist/src/ui/hooks/useQwenAuth.test.js.map +1 -0
  2292. package/dist/src/ui/hooks/useReactToolScheduler.d.ts +33 -0
  2293. package/dist/src/ui/hooks/useReactToolScheduler.js +236 -0
  2294. package/dist/src/ui/hooks/useReactToolScheduler.js.map +1 -0
  2295. package/dist/src/ui/hooks/useRefreshMemoryCommand.d.ts +6 -0
  2296. package/dist/src/ui/hooks/useRefreshMemoryCommand.js +7 -0
  2297. package/dist/src/ui/hooks/useRefreshMemoryCommand.js.map +1 -0
  2298. package/dist/src/ui/hooks/useResumeCommand.d.ts +31 -0
  2299. package/dist/src/ui/hooks/useResumeCommand.js +114 -0
  2300. package/dist/src/ui/hooks/useResumeCommand.js.map +1 -0
  2301. package/dist/src/ui/hooks/useResumeCommand.test.d.ts +6 -0
  2302. package/dist/src/ui/hooks/useResumeCommand.test.js +349 -0
  2303. package/dist/src/ui/hooks/useResumeCommand.test.js.map +1 -0
  2304. package/dist/src/ui/hooks/useReverseSearchCompletion.d.ts +19 -0
  2305. package/dist/src/ui/hooks/useReverseSearchCompletion.js +103 -0
  2306. package/dist/src/ui/hooks/useReverseSearchCompletion.js.map +1 -0
  2307. package/dist/src/ui/hooks/useReverseSearchCompletion.test.d.ts +6 -0
  2308. package/dist/src/ui/hooks/useReverseSearchCompletion.test.js +163 -0
  2309. package/dist/src/ui/hooks/useReverseSearchCompletion.test.js.map +1 -0
  2310. package/dist/src/ui/hooks/useSelectionList.d.ts +41 -0
  2311. package/dist/src/ui/hooks/useSelectionList.js +276 -0
  2312. package/dist/src/ui/hooks/useSelectionList.js.map +1 -0
  2313. package/dist/src/ui/hooks/useSelectionList.test.d.ts +6 -0
  2314. package/dist/src/ui/hooks/useSelectionList.test.js +782 -0
  2315. package/dist/src/ui/hooks/useSelectionList.test.js.map +1 -0
  2316. package/dist/src/ui/hooks/useSessionPicker.d.ts +95 -0
  2317. package/dist/src/ui/hooks/useSessionPicker.js +383 -0
  2318. package/dist/src/ui/hooks/useSessionPicker.js.map +1 -0
  2319. package/dist/src/ui/hooks/useSessionPicker.test.d.ts +6 -0
  2320. package/dist/src/ui/hooks/useSessionPicker.test.js +94 -0
  2321. package/dist/src/ui/hooks/useSessionPicker.test.js.map +1 -0
  2322. package/dist/src/ui/hooks/useSessionSearchInput.d.ts +69 -0
  2323. package/dist/src/ui/hooks/useSessionSearchInput.js +124 -0
  2324. package/dist/src/ui/hooks/useSessionSearchInput.js.map +1 -0
  2325. package/dist/src/ui/hooks/useSessionSearchInput.test.d.ts +6 -0
  2326. package/dist/src/ui/hooks/useSessionSearchInput.test.js +342 -0
  2327. package/dist/src/ui/hooks/useSessionSearchInput.test.js.map +1 -0
  2328. package/dist/src/ui/hooks/useSettingsCommand.d.ts +10 -0
  2329. package/dist/src/ui/hooks/useSettingsCommand.js +21 -0
  2330. package/dist/src/ui/hooks/useSettingsCommand.js.map +1 -0
  2331. package/dist/src/ui/hooks/useShellHistory.d.ts +14 -0
  2332. package/dist/src/ui/hooks/useShellHistory.js +112 -0
  2333. package/dist/src/ui/hooks/useShellHistory.js.map +1 -0
  2334. package/dist/src/ui/hooks/useShellHistory.test.d.ts +6 -0
  2335. package/dist/src/ui/hooks/useShellHistory.test.js +193 -0
  2336. package/dist/src/ui/hooks/useShellHistory.test.js.map +1 -0
  2337. package/dist/src/ui/hooks/useShowMemoryCommand.d.ts +9 -0
  2338. package/dist/src/ui/hooks/useShowMemoryCommand.js +55 -0
  2339. package/dist/src/ui/hooks/useShowMemoryCommand.js.map +1 -0
  2340. package/dist/src/ui/hooks/useSkillsManagerDialog.d.ts +11 -0
  2341. package/dist/src/ui/hooks/useSkillsManagerDialog.js +21 -0
  2342. package/dist/src/ui/hooks/useSkillsManagerDialog.js.map +1 -0
  2343. package/dist/src/ui/hooks/useSlashCompletion.d.ts +27 -0
  2344. package/dist/src/ui/hooks/useSlashCompletion.integration.test.d.ts +6 -0
  2345. package/dist/src/ui/hooks/useSlashCompletion.integration.test.js +84 -0
  2346. package/dist/src/ui/hooks/useSlashCompletion.integration.test.js.map +1 -0
  2347. package/dist/src/ui/hooks/useSlashCompletion.js +490 -0
  2348. package/dist/src/ui/hooks/useSlashCompletion.js.map +1 -0
  2349. package/dist/src/ui/hooks/useSlashCompletion.test.d.ts +9 -0
  2350. package/dist/src/ui/hooks/useSlashCompletion.test.js +805 -0
  2351. package/dist/src/ui/hooks/useSlashCompletion.test.js.map +1 -0
  2352. package/dist/src/ui/hooks/useStateAndRef.d.ts +7 -0
  2353. package/dist/src/ui/hooks/useStateAndRef.js +26 -0
  2354. package/dist/src/ui/hooks/useStateAndRef.js.map +1 -0
  2355. package/dist/src/ui/hooks/useStatsDialog.d.ts +11 -0
  2356. package/dist/src/ui/hooks/useStatsDialog.js +13 -0
  2357. package/dist/src/ui/hooks/useStatsDialog.js.map +1 -0
  2358. package/dist/src/ui/hooks/useStatusLine.d.ts +84 -0
  2359. package/dist/src/ui/hooks/useStatusLine.js +528 -0
  2360. package/dist/src/ui/hooks/useStatusLine.js.map +1 -0
  2361. package/dist/src/ui/hooks/useStatusLine.test.d.ts +6 -0
  2362. package/dist/src/ui/hooks/useStatusLine.test.js +1039 -0
  2363. package/dist/src/ui/hooks/useStatusLine.test.js.map +1 -0
  2364. package/dist/src/ui/hooks/useSubagentCreateDialog.d.ts +10 -0
  2365. package/dist/src/ui/hooks/useSubagentCreateDialog.js +21 -0
  2366. package/dist/src/ui/hooks/useSubagentCreateDialog.js.map +1 -0
  2367. package/dist/src/ui/hooks/useTerminalNotification.d.ts +32 -0
  2368. package/dist/src/ui/hooks/useTerminalNotification.js +45 -0
  2369. package/dist/src/ui/hooks/useTerminalNotification.js.map +1 -0
  2370. package/dist/src/ui/hooks/useTerminalNotification.test.d.ts +6 -0
  2371. package/dist/src/ui/hooks/useTerminalNotification.test.js +69 -0
  2372. package/dist/src/ui/hooks/useTerminalNotification.test.js.map +1 -0
  2373. package/dist/src/ui/hooks/useTerminalProgress.d.ts +12 -0
  2374. package/dist/src/ui/hooks/useTerminalProgress.js +76 -0
  2375. package/dist/src/ui/hooks/useTerminalProgress.js.map +1 -0
  2376. package/dist/src/ui/hooks/useTerminalSize.d.ts +13 -0
  2377. package/dist/src/ui/hooks/useTerminalSize.js +30 -0
  2378. package/dist/src/ui/hooks/useTerminalSize.js.map +1 -0
  2379. package/dist/src/ui/hooks/useThemeCommand.d.ts +15 -0
  2380. package/dist/src/ui/hooks/useThemeCommand.js +85 -0
  2381. package/dist/src/ui/hooks/useThemeCommand.js.map +1 -0
  2382. package/dist/src/ui/hooks/useThemeCommand.test.d.ts +6 -0
  2383. package/dist/src/ui/hooks/useThemeCommand.test.js +42 -0
  2384. package/dist/src/ui/hooks/useThemeCommand.test.js.map +1 -0
  2385. package/dist/src/ui/hooks/useTimer.d.ts +12 -0
  2386. package/dist/src/ui/hooks/useTimer.js +58 -0
  2387. package/dist/src/ui/hooks/useTimer.js.map +1 -0
  2388. package/dist/src/ui/hooks/useTimer.test.d.ts +6 -0
  2389. package/dist/src/ui/hooks/useTimer.test.js +90 -0
  2390. package/dist/src/ui/hooks/useTimer.test.js.map +1 -0
  2391. package/dist/src/ui/hooks/useTomlMigration.d.ts +1 -0
  2392. package/dist/src/ui/hooks/useTomlMigration.js +2 -0
  2393. package/dist/src/ui/hooks/useTomlMigration.js.map +1 -0
  2394. package/dist/src/ui/hooks/useToolScheduler.test.d.ts +6 -0
  2395. package/dist/src/ui/hooks/useToolScheduler.test.js +624 -0
  2396. package/dist/src/ui/hooks/useToolScheduler.test.js.map +1 -0
  2397. package/dist/src/ui/hooks/useTrustModify.d.ts +17 -0
  2398. package/dist/src/ui/hooks/useTrustModify.js +78 -0
  2399. package/dist/src/ui/hooks/useTrustModify.js.map +1 -0
  2400. package/dist/src/ui/hooks/useTrustModify.test.d.ts +6 -0
  2401. package/dist/src/ui/hooks/useTrustModify.test.js +182 -0
  2402. package/dist/src/ui/hooks/useTrustModify.test.js.map +1 -0
  2403. package/dist/src/ui/hooks/useTurnDiffs.d.ts +34 -0
  2404. package/dist/src/ui/hooks/useTurnDiffs.js +130 -0
  2405. package/dist/src/ui/hooks/useTurnDiffs.js.map +1 -0
  2406. package/dist/src/ui/hooks/useTurnDiffs.test.d.ts +6 -0
  2407. package/dist/src/ui/hooks/useTurnDiffs.test.js +164 -0
  2408. package/dist/src/ui/hooks/useTurnDiffs.test.js.map +1 -0
  2409. package/dist/src/ui/hooks/useWelcomeBack.d.ts +23 -0
  2410. package/dist/src/ui/hooks/useWelcomeBack.js +99 -0
  2411. package/dist/src/ui/hooks/useWelcomeBack.js.map +1 -0
  2412. package/dist/src/ui/hooks/useWelcomeBack.test.d.ts +6 -0
  2413. package/dist/src/ui/hooks/useWelcomeBack.test.js +94 -0
  2414. package/dist/src/ui/hooks/useWelcomeBack.test.js.map +1 -0
  2415. package/dist/src/ui/hooks/useWorktreeSession.d.ts +26 -0
  2416. package/dist/src/ui/hooks/useWorktreeSession.js +92 -0
  2417. package/dist/src/ui/hooks/useWorktreeSession.js.map +1 -0
  2418. package/dist/src/ui/hooks/useWorktreeSession.test.d.ts +6 -0
  2419. package/dist/src/ui/hooks/useWorktreeSession.test.js +84 -0
  2420. package/dist/src/ui/hooks/useWorktreeSession.test.js.map +1 -0
  2421. package/dist/src/ui/hooks/vim.d.ts +13 -0
  2422. package/dist/src/ui/hooks/vim.js +1637 -0
  2423. package/dist/src/ui/hooks/vim.js.map +1 -0
  2424. package/dist/src/ui/hooks/vim.test.d.ts +6 -0
  2425. package/dist/src/ui/hooks/vim.test.js +1975 -0
  2426. package/dist/src/ui/hooks/vim.test.js.map +1 -0
  2427. package/dist/src/ui/keyMatchers.d.ts +27 -0
  2428. package/dist/src/ui/keyMatchers.js +71 -0
  2429. package/dist/src/ui/keyMatchers.js.map +1 -0
  2430. package/dist/src/ui/keyMatchers.test.d.ts +6 -0
  2431. package/dist/src/ui/keyMatchers.test.js +421 -0
  2432. package/dist/src/ui/keyMatchers.test.js.map +1 -0
  2433. package/dist/src/ui/layouts/DefaultAppLayout.d.ts +7 -0
  2434. package/dist/src/ui/layouts/DefaultAppLayout.js +49 -0
  2435. package/dist/src/ui/layouts/DefaultAppLayout.js.map +1 -0
  2436. package/dist/src/ui/layouts/DefaultAppLayout.test.d.ts +6 -0
  2437. package/dist/src/ui/layouts/DefaultAppLayout.test.js +185 -0
  2438. package/dist/src/ui/layouts/DefaultAppLayout.test.js.map +1 -0
  2439. package/dist/src/ui/layouts/ScreenReaderAppLayout.d.ts +7 -0
  2440. package/dist/src/ui/layouts/ScreenReaderAppLayout.js +27 -0
  2441. package/dist/src/ui/layouts/ScreenReaderAppLayout.js.map +1 -0
  2442. package/dist/src/ui/layouts/ScreenReaderAppLayout.test.d.ts +6 -0
  2443. package/dist/src/ui/layouts/ScreenReaderAppLayout.test.js +135 -0
  2444. package/dist/src/ui/layouts/ScreenReaderAppLayout.test.js.map +1 -0
  2445. package/dist/src/ui/models/availableModels.d.ts +30 -0
  2446. package/dist/src/ui/models/availableModels.js +103 -0
  2447. package/dist/src/ui/models/availableModels.js.map +1 -0
  2448. package/dist/src/ui/models/availableModels.test.d.ts +6 -0
  2449. package/dist/src/ui/models/availableModels.test.js +142 -0
  2450. package/dist/src/ui/models/availableModels.test.js.map +1 -0
  2451. package/dist/src/ui/noninteractive/nonInteractiveUi.d.ts +12 -0
  2452. package/dist/src/ui/noninteractive/nonInteractiveUi.js +33 -0
  2453. package/dist/src/ui/noninteractive/nonInteractiveUi.js.map +1 -0
  2454. package/dist/src/ui/semantic-colors.d.ts +7 -0
  2455. package/dist/src/ui/semantic-colors.js +24 -0
  2456. package/dist/src/ui/semantic-colors.js.map +1 -0
  2457. package/dist/src/ui/state/extensions.d.ts +43 -0
  2458. package/dist/src/ui/state/extensions.js +63 -0
  2459. package/dist/src/ui/state/extensions.js.map +1 -0
  2460. package/dist/src/ui/statusLinePresets.d.ts +79 -0
  2461. package/dist/src/ui/statusLinePresets.js +310 -0
  2462. package/dist/src/ui/statusLinePresets.js.map +1 -0
  2463. package/dist/src/ui/statusLinePresets.test.d.ts +6 -0
  2464. package/dist/src/ui/statusLinePresets.test.js +221 -0
  2465. package/dist/src/ui/statusLinePresets.test.js.map +1 -0
  2466. package/dist/src/ui/textConstants.d.ts +9 -0
  2467. package/dist/src/ui/textConstants.js +10 -0
  2468. package/dist/src/ui/textConstants.js.map +1 -0
  2469. package/dist/src/ui/themes/ansi-light.d.ts +7 -0
  2470. package/dist/src/ui/themes/ansi-light.js +144 -0
  2471. package/dist/src/ui/themes/ansi-light.js.map +1 -0
  2472. package/dist/src/ui/themes/ansi.d.ts +7 -0
  2473. package/dist/src/ui/themes/ansi.js +154 -0
  2474. package/dist/src/ui/themes/ansi.js.map +1 -0
  2475. package/dist/src/ui/themes/atom-one-dark.d.ts +7 -0
  2476. package/dist/src/ui/themes/atom-one-dark.js +140 -0
  2477. package/dist/src/ui/themes/atom-one-dark.js.map +1 -0
  2478. package/dist/src/ui/themes/ayu-light.d.ts +7 -0
  2479. package/dist/src/ui/themes/ayu-light.js +132 -0
  2480. package/dist/src/ui/themes/ayu-light.js.map +1 -0
  2481. package/dist/src/ui/themes/ayu.d.ts +7 -0
  2482. package/dist/src/ui/themes/ayu.js +106 -0
  2483. package/dist/src/ui/themes/ayu.js.map +1 -0
  2484. package/dist/src/ui/themes/color-utils.d.ts +21 -0
  2485. package/dist/src/ui/themes/color-utils.js +223 -0
  2486. package/dist/src/ui/themes/color-utils.js.map +1 -0
  2487. package/dist/src/ui/themes/color-utils.test.d.ts +6 -0
  2488. package/dist/src/ui/themes/color-utils.test.js +197 -0
  2489. package/dist/src/ui/themes/color-utils.test.js.map +1 -0
  2490. package/dist/src/ui/themes/default-light.d.ts +7 -0
  2491. package/dist/src/ui/themes/default-light.js +100 -0
  2492. package/dist/src/ui/themes/default-light.js.map +1 -0
  2493. package/dist/src/ui/themes/default.d.ts +7 -0
  2494. package/dist/src/ui/themes/default.js +143 -0
  2495. package/dist/src/ui/themes/default.js.map +1 -0
  2496. package/dist/src/ui/themes/detect-terminal-theme.d.ts +75 -0
  2497. package/dist/src/ui/themes/detect-terminal-theme.js +228 -0
  2498. package/dist/src/ui/themes/detect-terminal-theme.js.map +1 -0
  2499. package/dist/src/ui/themes/detect-terminal-theme.test.d.ts +6 -0
  2500. package/dist/src/ui/themes/detect-terminal-theme.test.js +269 -0
  2501. package/dist/src/ui/themes/detect-terminal-theme.test.js.map +1 -0
  2502. package/dist/src/ui/themes/dracula.d.ts +7 -0
  2503. package/dist/src/ui/themes/dracula.js +117 -0
  2504. package/dist/src/ui/themes/dracula.js.map +1 -0
  2505. package/dist/src/ui/themes/github-dark.d.ts +7 -0
  2506. package/dist/src/ui/themes/github-dark.js +140 -0
  2507. package/dist/src/ui/themes/github-dark.js.map +1 -0
  2508. package/dist/src/ui/themes/github-light.d.ts +7 -0
  2509. package/dist/src/ui/themes/github-light.js +142 -0
  2510. package/dist/src/ui/themes/github-light.js.map +1 -0
  2511. package/dist/src/ui/themes/googlecode.d.ts +7 -0
  2512. package/dist/src/ui/themes/googlecode.js +139 -0
  2513. package/dist/src/ui/themes/googlecode.js.map +1 -0
  2514. package/dist/src/ui/themes/no-color.d.ts +7 -0
  2515. package/dist/src/ui/themes/no-color.js +120 -0
  2516. package/dist/src/ui/themes/no-color.js.map +1 -0
  2517. package/dist/src/ui/themes/qwen-dark.d.ts +7 -0
  2518. package/dist/src/ui/themes/qwen-dark.js +107 -0
  2519. package/dist/src/ui/themes/qwen-dark.js.map +1 -0
  2520. package/dist/src/ui/themes/qwen-light.d.ts +7 -0
  2521. package/dist/src/ui/themes/qwen-light.js +133 -0
  2522. package/dist/src/ui/themes/qwen-light.js.map +1 -0
  2523. package/dist/src/ui/themes/semantic-tokens.d.ts +40 -0
  2524. package/dist/src/ui/themes/semantic-tokens.js +103 -0
  2525. package/dist/src/ui/themes/semantic-tokens.js.map +1 -0
  2526. package/dist/src/ui/themes/shades-of-purple.d.ts +11 -0
  2527. package/dist/src/ui/themes/shades-of-purple.js +306 -0
  2528. package/dist/src/ui/themes/shades-of-purple.js.map +1 -0
  2529. package/dist/src/ui/themes/theme-manager.d.ts +91 -0
  2530. package/dist/src/ui/themes/theme-manager.js +311 -0
  2531. package/dist/src/ui/themes/theme-manager.js.map +1 -0
  2532. package/dist/src/ui/themes/theme-manager.test.d.ts +6 -0
  2533. package/dist/src/ui/themes/theme-manager.test.js +188 -0
  2534. package/dist/src/ui/themes/theme-manager.test.js.map +1 -0
  2535. package/dist/src/ui/themes/theme.d.ts +137 -0
  2536. package/dist/src/ui/themes/theme.js +393 -0
  2537. package/dist/src/ui/themes/theme.js.map +1 -0
  2538. package/dist/src/ui/themes/xcode.d.ts +7 -0
  2539. package/dist/src/ui/themes/xcode.js +147 -0
  2540. package/dist/src/ui/themes/xcode.js.map +1 -0
  2541. package/dist/src/ui/types.d.ts +620 -0
  2542. package/dist/src/ui/types.js +77 -0
  2543. package/dist/src/ui/types.js.map +1 -0
  2544. package/dist/src/ui/utils/CodeColorizer.d.ts +18 -0
  2545. package/dist/src/ui/utils/CodeColorizer.js +155 -0
  2546. package/dist/src/ui/utils/CodeColorizer.js.map +1 -0
  2547. package/dist/src/ui/utils/InlineMarkdownRenderer.d.ts +18 -0
  2548. package/dist/src/ui/utils/InlineMarkdownRenderer.js +173 -0
  2549. package/dist/src/ui/utils/InlineMarkdownRenderer.js.map +1 -0
  2550. package/dist/src/ui/utils/InlineMarkdownRenderer.test.d.ts +6 -0
  2551. package/dist/src/ui/utils/InlineMarkdownRenderer.test.js +303 -0
  2552. package/dist/src/ui/utils/InlineMarkdownRenderer.test.js.map +1 -0
  2553. package/dist/src/ui/utils/MarkdownDisplay.d.ts +25 -0
  2554. package/dist/src/ui/utils/MarkdownDisplay.js +420 -0
  2555. package/dist/src/ui/utils/MarkdownDisplay.js.map +1 -0
  2556. package/dist/src/ui/utils/MarkdownDisplay.test.d.ts +6 -0
  2557. package/dist/src/ui/utils/MarkdownDisplay.test.js +702 -0
  2558. package/dist/src/ui/utils/MarkdownDisplay.test.js.map +1 -0
  2559. package/dist/src/ui/utils/MermaidDiagram.d.ts +15 -0
  2560. package/dist/src/ui/utils/MermaidDiagram.js +88 -0
  2561. package/dist/src/ui/utils/MermaidDiagram.js.map +1 -0
  2562. package/dist/src/ui/utils/MermaidDiagram.test.d.ts +6 -0
  2563. package/dist/src/ui/utils/MermaidDiagram.test.js +90 -0
  2564. package/dist/src/ui/utils/MermaidDiagram.test.js.map +1 -0
  2565. package/dist/src/ui/utils/TableRenderer.d.ts +30 -0
  2566. package/dist/src/ui/utils/TableRenderer.js +563 -0
  2567. package/dist/src/ui/utils/TableRenderer.js.map +1 -0
  2568. package/dist/src/ui/utils/TableRenderer.test.d.ts +6 -0
  2569. package/dist/src/ui/utils/TableRenderer.test.js +568 -0
  2570. package/dist/src/ui/utils/TableRenderer.test.js.map +1 -0
  2571. package/dist/src/ui/utils/approvalModeDisplay.d.ts +8 -0
  2572. package/dist/src/ui/utils/approvalModeDisplay.js +34 -0
  2573. package/dist/src/ui/utils/approvalModeDisplay.js.map +1 -0
  2574. package/dist/src/ui/utils/approvalModeDisplay.test.d.ts +6 -0
  2575. package/dist/src/ui/utils/approvalModeDisplay.test.js +35 -0
  2576. package/dist/src/ui/utils/approvalModeDisplay.test.js.map +1 -0
  2577. package/dist/src/ui/utils/asciiCharts.d.ts +44 -0
  2578. package/dist/src/ui/utils/asciiCharts.js +307 -0
  2579. package/dist/src/ui/utils/asciiCharts.js.map +1 -0
  2580. package/dist/src/ui/utils/asciiCharts.test.d.ts +6 -0
  2581. package/dist/src/ui/utils/asciiCharts.test.js +208 -0
  2582. package/dist/src/ui/utils/asciiCharts.test.js.map +1 -0
  2583. package/dist/src/ui/utils/backgroundWorkUtils.d.ts +8 -0
  2584. package/dist/src/ui/utils/backgroundWorkUtils.js +16 -0
  2585. package/dist/src/ui/utils/backgroundWorkUtils.js.map +1 -0
  2586. package/dist/src/ui/utils/backgroundWorkUtils.test.d.ts +6 -0
  2587. package/dist/src/ui/utils/backgroundWorkUtils.test.js +85 -0
  2588. package/dist/src/ui/utils/backgroundWorkUtils.test.js.map +1 -0
  2589. package/dist/src/ui/utils/clipboardUtils.d.ts +28 -0
  2590. package/dist/src/ui/utils/clipboardUtils.js +522 -0
  2591. package/dist/src/ui/utils/clipboardUtils.js.map +1 -0
  2592. package/dist/src/ui/utils/clipboardUtils.test.d.ts +6 -0
  2593. package/dist/src/ui/utils/clipboardUtils.test.js +465 -0
  2594. package/dist/src/ui/utils/clipboardUtils.test.js.map +1 -0
  2595. package/dist/src/ui/utils/commandUtils.d.ts +112 -0
  2596. package/dist/src/ui/utils/commandUtils.js +285 -0
  2597. package/dist/src/ui/utils/commandUtils.js.map +1 -0
  2598. package/dist/src/ui/utils/commandUtils.test.d.ts +6 -0
  2599. package/dist/src/ui/utils/commandUtils.test.js +560 -0
  2600. package/dist/src/ui/utils/commandUtils.test.js.map +1 -0
  2601. package/dist/src/ui/utils/computeStats.d.ts +10 -0
  2602. package/dist/src/ui/utils/computeStats.js +57 -0
  2603. package/dist/src/ui/utils/computeStats.js.map +1 -0
  2604. package/dist/src/ui/utils/customBanner.d.ts +35 -0
  2605. package/dist/src/ui/utils/customBanner.js +361 -0
  2606. package/dist/src/ui/utils/customBanner.js.map +1 -0
  2607. package/dist/src/ui/utils/customBanner.test.d.ts +6 -0
  2608. package/dist/src/ui/utils/customBanner.test.js +439 -0
  2609. package/dist/src/ui/utils/customBanner.test.js.map +1 -0
  2610. package/dist/src/ui/utils/displayUtils.d.ts +25 -0
  2611. package/dist/src/ui/utils/displayUtils.js +46 -0
  2612. package/dist/src/ui/utils/displayUtils.js.map +1 -0
  2613. package/dist/src/ui/utils/displayUtils.test.d.ts +6 -0
  2614. package/dist/src/ui/utils/displayUtils.test.js +61 -0
  2615. package/dist/src/ui/utils/displayUtils.test.js.map +1 -0
  2616. package/dist/src/ui/utils/export/collect.d.ts +16 -0
  2617. package/dist/src/ui/utils/export/collect.js +509 -0
  2618. package/dist/src/ui/utils/export/collect.js.map +1 -0
  2619. package/dist/src/ui/utils/export/collect.test.d.ts +6 -0
  2620. package/dist/src/ui/utils/export/collect.test.js +80 -0
  2621. package/dist/src/ui/utils/export/collect.test.js.map +1 -0
  2622. package/dist/src/ui/utils/export/formatters/html.d.ts +23 -0
  2623. package/dist/src/ui/utils/export/formatters/html.js +65 -0
  2624. package/dist/src/ui/utils/export/formatters/html.js.map +1 -0
  2625. package/dist/src/ui/utils/export/formatters/json.d.ts +11 -0
  2626. package/dist/src/ui/utils/export/formatters/json.js +13 -0
  2627. package/dist/src/ui/utils/export/formatters/json.js.map +1 -0
  2628. package/dist/src/ui/utils/export/formatters/jsonl.d.ts +11 -0
  2629. package/dist/src/ui/utils/export/formatters/jsonl.js +69 -0
  2630. package/dist/src/ui/utils/export/formatters/jsonl.js.map +1 -0
  2631. package/dist/src/ui/utils/export/formatters/markdown.d.ts +10 -0
  2632. package/dist/src/ui/utils/export/formatters/markdown.js +254 -0
  2633. package/dist/src/ui/utils/export/formatters/markdown.js.map +1 -0
  2634. package/dist/src/ui/utils/export/index.d.ts +13 -0
  2635. package/dist/src/ui/utils/export/index.js +13 -0
  2636. package/dist/src/ui/utils/export/index.js.map +1 -0
  2637. package/dist/src/ui/utils/export/normalize.d.ts +12 -0
  2638. package/dist/src/ui/utils/export/normalize.js +279 -0
  2639. package/dist/src/ui/utils/export/normalize.js.map +1 -0
  2640. package/dist/src/ui/utils/export/normalize.test.d.ts +6 -0
  2641. package/dist/src/ui/utils/export/normalize.test.js +62 -0
  2642. package/dist/src/ui/utils/export/normalize.test.js.map +1 -0
  2643. package/dist/src/ui/utils/export/types.d.ts +93 -0
  2644. package/dist/src/ui/utils/export/types.js +7 -0
  2645. package/dist/src/ui/utils/export/types.js.map +1 -0
  2646. package/dist/src/ui/utils/export/utils.d.ts +9 -0
  2647. package/dist/src/ui/utils/export/utils.js +13 -0
  2648. package/dist/src/ui/utils/export/utils.js.map +1 -0
  2649. package/dist/src/ui/utils/formatters.d.ts +28 -0
  2650. package/dist/src/ui/utils/formatters.js +100 -0
  2651. package/dist/src/ui/utils/formatters.js.map +1 -0
  2652. package/dist/src/ui/utils/formatters.test.d.ts +6 -0
  2653. package/dist/src/ui/utils/formatters.test.js +141 -0
  2654. package/dist/src/ui/utils/formatters.test.js.map +1 -0
  2655. package/dist/src/ui/utils/gradientUtils.d.ts +6 -0
  2656. package/dist/src/ui/utils/gradientUtils.js +11 -0
  2657. package/dist/src/ui/utils/gradientUtils.js.map +1 -0
  2658. package/dist/src/ui/utils/highlight.d.ts +12 -0
  2659. package/dist/src/ui/utils/highlight.js +90 -0
  2660. package/dist/src/ui/utils/highlight.js.map +1 -0
  2661. package/dist/src/ui/utils/highlight.test.d.ts +6 -0
  2662. package/dist/src/ui/utils/highlight.test.js +173 -0
  2663. package/dist/src/ui/utils/highlight.test.js.map +1 -0
  2664. package/dist/src/ui/utils/historyMapping.d.ts +44 -0
  2665. package/dist/src/ui/utils/historyMapping.js +110 -0
  2666. package/dist/src/ui/utils/historyMapping.js.map +1 -0
  2667. package/dist/src/ui/utils/historyMapping.test.d.ts +6 -0
  2668. package/dist/src/ui/utils/historyMapping.test.js +376 -0
  2669. package/dist/src/ui/utils/historyMapping.test.js.map +1 -0
  2670. package/dist/src/ui/utils/historyUtils.d.ts +34 -0
  2671. package/dist/src/ui/utils/historyUtils.js +117 -0
  2672. package/dist/src/ui/utils/historyUtils.js.map +1 -0
  2673. package/dist/src/ui/utils/historyUtils.test.d.ts +6 -0
  2674. package/dist/src/ui/utils/historyUtils.test.js +107 -0
  2675. package/dist/src/ui/utils/historyUtils.test.js.map +1 -0
  2676. package/dist/src/ui/utils/isNarrowWidth.d.ts +6 -0
  2677. package/dist/src/ui/utils/isNarrowWidth.js +9 -0
  2678. package/dist/src/ui/utils/isNarrowWidth.js.map +1 -0
  2679. package/dist/src/ui/utils/kittyProtocolDetector.d.ts +19 -0
  2680. package/dist/src/ui/utils/kittyProtocolDetector.js +115 -0
  2681. package/dist/src/ui/utils/kittyProtocolDetector.js.map +1 -0
  2682. package/dist/src/ui/utils/latexRenderer.d.ts +6 -0
  2683. package/dist/src/ui/utils/latexRenderer.js +187 -0
  2684. package/dist/src/ui/utils/latexRenderer.js.map +1 -0
  2685. package/dist/src/ui/utils/latexRenderer.test.d.ts +6 -0
  2686. package/dist/src/ui/utils/latexRenderer.test.js +27 -0
  2687. package/dist/src/ui/utils/latexRenderer.test.js.map +1 -0
  2688. package/dist/src/ui/utils/layoutUtils.d.ts +32 -0
  2689. package/dist/src/ui/utils/layoutUtils.js +46 -0
  2690. package/dist/src/ui/utils/layoutUtils.js.map +1 -0
  2691. package/dist/src/ui/utils/layoutUtils.test.d.ts +6 -0
  2692. package/dist/src/ui/utils/layoutUtils.test.js +30 -0
  2693. package/dist/src/ui/utils/layoutUtils.test.js.map +1 -0
  2694. package/dist/src/ui/utils/lowlightLoader.d.ts +43 -0
  2695. package/dist/src/ui/utils/lowlightLoader.js +88 -0
  2696. package/dist/src/ui/utils/lowlightLoader.js.map +1 -0
  2697. package/dist/src/ui/utils/lowlightLoader.test.d.ts +6 -0
  2698. package/dist/src/ui/utils/lowlightLoader.test.js +120 -0
  2699. package/dist/src/ui/utils/lowlightLoader.test.js.map +1 -0
  2700. package/dist/src/ui/utils/markdownUtilities.d.ts +6 -0
  2701. package/dist/src/ui/utils/markdownUtilities.js +110 -0
  2702. package/dist/src/ui/utils/markdownUtilities.js.map +1 -0
  2703. package/dist/src/ui/utils/markdownUtilities.test.d.ts +6 -0
  2704. package/dist/src/ui/utils/markdownUtilities.test.js +42 -0
  2705. package/dist/src/ui/utils/markdownUtilities.test.js.map +1 -0
  2706. package/dist/src/ui/utils/mergeCompactToolGroups.d.ts +62 -0
  2707. package/dist/src/ui/utils/mergeCompactToolGroups.js +212 -0
  2708. package/dist/src/ui/utils/mergeCompactToolGroups.js.map +1 -0
  2709. package/dist/src/ui/utils/mergeCompactToolGroups.test.d.ts +6 -0
  2710. package/dist/src/ui/utils/mergeCompactToolGroups.test.js +473 -0
  2711. package/dist/src/ui/utils/mergeCompactToolGroups.test.js.map +1 -0
  2712. package/dist/src/ui/utils/mermaidImageRenderer.d.ts +54 -0
  2713. package/dist/src/ui/utils/mermaidImageRenderer.js +955 -0
  2714. package/dist/src/ui/utils/mermaidImageRenderer.js.map +1 -0
  2715. package/dist/src/ui/utils/mermaidImageRenderer.test.d.ts +6 -0
  2716. package/dist/src/ui/utils/mermaidImageRenderer.test.js +528 -0
  2717. package/dist/src/ui/utils/mermaidImageRenderer.test.js.map +1 -0
  2718. package/dist/src/ui/utils/mermaidVisualRenderer.d.ts +12 -0
  2719. package/dist/src/ui/utils/mermaidVisualRenderer.js +1097 -0
  2720. package/dist/src/ui/utils/mermaidVisualRenderer.js.map +1 -0
  2721. package/dist/src/ui/utils/mermaidVisualRenderer.test.d.ts +6 -0
  2722. package/dist/src/ui/utils/mermaidVisualRenderer.test.js +69 -0
  2723. package/dist/src/ui/utils/mermaidVisualRenderer.test.js.map +1 -0
  2724. package/dist/src/ui/utils/modelsBySource.d.ts +47 -0
  2725. package/dist/src/ui/utils/modelsBySource.js +89 -0
  2726. package/dist/src/ui/utils/modelsBySource.js.map +1 -0
  2727. package/dist/src/ui/utils/modelsBySource.test.d.ts +6 -0
  2728. package/dist/src/ui/utils/modelsBySource.test.js +111 -0
  2729. package/dist/src/ui/utils/modelsBySource.test.js.map +1 -0
  2730. package/dist/src/ui/utils/mouse.d.ts +39 -0
  2731. package/dist/src/ui/utils/mouse.js +169 -0
  2732. package/dist/src/ui/utils/mouse.js.map +1 -0
  2733. package/dist/src/ui/utils/mouse.test.d.ts +6 -0
  2734. package/dist/src/ui/utils/mouse.test.js +117 -0
  2735. package/dist/src/ui/utils/mouse.test.js.map +1 -0
  2736. package/dist/src/ui/utils/osc8.d.ts +124 -0
  2737. package/dist/src/ui/utils/osc8.js +463 -0
  2738. package/dist/src/ui/utils/osc8.js.map +1 -0
  2739. package/dist/src/ui/utils/osc8.test.d.ts +6 -0
  2740. package/dist/src/ui/utils/osc8.test.js +494 -0
  2741. package/dist/src/ui/utils/osc8.test.js.map +1 -0
  2742. package/dist/src/ui/utils/platformConstants.d.ts +75 -0
  2743. package/dist/src/ui/utils/platformConstants.js +78 -0
  2744. package/dist/src/ui/utils/platformConstants.js.map +1 -0
  2745. package/dist/src/ui/utils/restoreGoal.d.ts +47 -0
  2746. package/dist/src/ui/utils/restoreGoal.js +124 -0
  2747. package/dist/src/ui/utils/restoreGoal.js.map +1 -0
  2748. package/dist/src/ui/utils/restoreGoal.test.d.ts +6 -0
  2749. package/dist/src/ui/utils/restoreGoal.test.js +220 -0
  2750. package/dist/src/ui/utils/restoreGoal.test.js.map +1 -0
  2751. package/dist/src/ui/utils/resumeHistoryUtils.d.ts +22 -0
  2752. package/dist/src/ui/utils/resumeHistoryUtils.js +410 -0
  2753. package/dist/src/ui/utils/resumeHistoryUtils.js.map +1 -0
  2754. package/dist/src/ui/utils/resumeHistoryUtils.test.d.ts +6 -0
  2755. package/dist/src/ui/utils/resumeHistoryUtils.test.js +378 -0
  2756. package/dist/src/ui/utils/resumeHistoryUtils.test.js.map +1 -0
  2757. package/dist/src/ui/utils/sessionPickerUtils.d.ts +35 -0
  2758. package/dist/src/ui/utils/sessionPickerUtils.js +69 -0
  2759. package/dist/src/ui/utils/sessionPickerUtils.js.map +1 -0
  2760. package/dist/src/ui/utils/sessionPickerUtils.test.d.ts +6 -0
  2761. package/dist/src/ui/utils/sessionPickerUtils.test.js +79 -0
  2762. package/dist/src/ui/utils/sessionPickerUtils.test.js.map +1 -0
  2763. package/dist/src/ui/utils/statsDataService.d.ts +49 -0
  2764. package/dist/src/ui/utils/statsDataService.js +221 -0
  2765. package/dist/src/ui/utils/statsDataService.js.map +1 -0
  2766. package/dist/src/ui/utils/statsDataService.test.d.ts +6 -0
  2767. package/dist/src/ui/utils/statsDataService.test.js +406 -0
  2768. package/dist/src/ui/utils/statsDataService.test.js.map +1 -0
  2769. package/dist/src/ui/utils/synchronizedOutput.d.ts +16 -0
  2770. package/dist/src/ui/utils/synchronizedOutput.js +88 -0
  2771. package/dist/src/ui/utils/synchronizedOutput.js.map +1 -0
  2772. package/dist/src/ui/utils/synchronizedOutput.test.d.ts +6 -0
  2773. package/dist/src/ui/utils/synchronizedOutput.test.js +154 -0
  2774. package/dist/src/ui/utils/synchronizedOutput.test.js.map +1 -0
  2775. package/dist/src/ui/utils/terminalRedrawOptimizer.d.ts +21 -0
  2776. package/dist/src/ui/utils/terminalRedrawOptimizer.js +108 -0
  2777. package/dist/src/ui/utils/terminalRedrawOptimizer.js.map +1 -0
  2778. package/dist/src/ui/utils/terminalRedrawOptimizer.test.d.ts +6 -0
  2779. package/dist/src/ui/utils/terminalRedrawOptimizer.test.js +85 -0
  2780. package/dist/src/ui/utils/terminalRedrawOptimizer.test.js.map +1 -0
  2781. package/dist/src/ui/utils/terminalSetup.d.ts +30 -0
  2782. package/dist/src/ui/utils/terminalSetup.js +310 -0
  2783. package/dist/src/ui/utils/terminalSetup.js.map +1 -0
  2784. package/dist/src/ui/utils/textUtils.d.ts +86 -0
  2785. package/dist/src/ui/utils/textUtils.js +360 -0
  2786. package/dist/src/ui/utils/textUtils.js.map +1 -0
  2787. package/dist/src/ui/utils/textUtils.test.d.ts +6 -0
  2788. package/dist/src/ui/utils/textUtils.test.js +269 -0
  2789. package/dist/src/ui/utils/textUtils.test.js.map +1 -0
  2790. package/dist/src/ui/utils/todoSnapshot.d.ts +13 -0
  2791. package/dist/src/ui/utils/todoSnapshot.js +133 -0
  2792. package/dist/src/ui/utils/todoSnapshot.js.map +1 -0
  2793. package/dist/src/ui/utils/todoSnapshot.test.d.ts +6 -0
  2794. package/dist/src/ui/utils/todoSnapshot.test.js +281 -0
  2795. package/dist/src/ui/utils/todoSnapshot.test.js.map +1 -0
  2796. package/dist/src/ui/utils/updateCheck.d.ts +12 -0
  2797. package/dist/src/ui/utils/updateCheck.js +80 -0
  2798. package/dist/src/ui/utils/updateCheck.js.map +1 -0
  2799. package/dist/src/ui/utils/updateCheck.test.d.ts +6 -0
  2800. package/dist/src/ui/utils/updateCheck.test.js +145 -0
  2801. package/dist/src/ui/utils/updateCheck.test.js.map +1 -0
  2802. package/dist/src/utils/acpModelUtils.d.ts +39 -0
  2803. package/dist/src/utils/acpModelUtils.js +61 -0
  2804. package/dist/src/utils/acpModelUtils.js.map +1 -0
  2805. package/dist/src/utils/acpModelUtils.test.d.ts +6 -0
  2806. package/dist/src/utils/acpModelUtils.test.js +31 -0
  2807. package/dist/src/utils/acpModelUtils.test.js.map +1 -0
  2808. package/dist/src/utils/apiPreconnect.d.ts +22 -0
  2809. package/dist/src/utils/apiPreconnect.js +188 -0
  2810. package/dist/src/utils/apiPreconnect.js.map +1 -0
  2811. package/dist/src/utils/apiPreconnect.test.d.ts +6 -0
  2812. package/dist/src/utils/apiPreconnect.test.js +252 -0
  2813. package/dist/src/utils/apiPreconnect.test.js.map +1 -0
  2814. package/dist/src/utils/checks.d.ts +19 -0
  2815. package/dist/src/utils/checks.js +24 -0
  2816. package/dist/src/utils/checks.js.map +1 -0
  2817. package/dist/src/utils/cleanup.d.ts +23 -0
  2818. package/dist/src/utils/cleanup.js +96 -0
  2819. package/dist/src/utils/cleanup.js.map +1 -0
  2820. package/dist/src/utils/commands.d.ts +20 -0
  2821. package/dist/src/utils/commands.js +53 -0
  2822. package/dist/src/utils/commands.js.map +1 -0
  2823. package/dist/src/utils/commands.test.d.ts +6 -0
  2824. package/dist/src/utils/commands.test.js +115 -0
  2825. package/dist/src/utils/commands.test.js.map +1 -0
  2826. package/dist/src/utils/commentJson.d.ts +25 -0
  2827. package/dist/src/utils/commentJson.js +113 -0
  2828. package/dist/src/utils/commentJson.js.map +1 -0
  2829. package/dist/src/utils/commentJson.test.d.ts +6 -0
  2830. package/dist/src/utils/commentJson.test.js +385 -0
  2831. package/dist/src/utils/commentJson.test.js.map +1 -0
  2832. package/dist/src/utils/costCalculator.d.ts +14 -0
  2833. package/dist/src/utils/costCalculator.js +19 -0
  2834. package/dist/src/utils/costCalculator.js.map +1 -0
  2835. package/dist/src/utils/costCalculator.test.d.ts +6 -0
  2836. package/dist/src/utils/costCalculator.test.js +177 -0
  2837. package/dist/src/utils/costCalculator.test.js.map +1 -0
  2838. package/dist/src/utils/cpuProfiler.d.ts +63 -0
  2839. package/dist/src/utils/cpuProfiler.js +341 -0
  2840. package/dist/src/utils/cpuProfiler.js.map +1 -0
  2841. package/dist/src/utils/cpuProfiler.test.d.ts +6 -0
  2842. package/dist/src/utils/cpuProfiler.test.js +293 -0
  2843. package/dist/src/utils/cpuProfiler.test.js.map +1 -0
  2844. package/dist/src/utils/deepMerge.d.ts +9 -0
  2845. package/dist/src/utils/deepMerge.js +58 -0
  2846. package/dist/src/utils/deepMerge.js.map +1 -0
  2847. package/dist/src/utils/deepMerge.test.d.ts +6 -0
  2848. package/dist/src/utils/deepMerge.test.js +143 -0
  2849. package/dist/src/utils/deepMerge.test.js.map +1 -0
  2850. package/dist/src/utils/dialogScopeUtils.d.ts +28 -0
  2851. package/dist/src/utils/dialogScopeUtils.js +51 -0
  2852. package/dist/src/utils/dialogScopeUtils.js.map +1 -0
  2853. package/dist/src/utils/doctorChecks.d.ts +11 -0
  2854. package/dist/src/utils/doctorChecks.js +351 -0
  2855. package/dist/src/utils/doctorChecks.js.map +1 -0
  2856. package/dist/src/utils/doctorChecks.test.d.ts +6 -0
  2857. package/dist/src/utils/doctorChecks.test.js +280 -0
  2858. package/dist/src/utils/doctorChecks.test.js.map +1 -0
  2859. package/dist/src/utils/earlyInputCapture.d.ts +33 -0
  2860. package/dist/src/utils/earlyInputCapture.js +311 -0
  2861. package/dist/src/utils/earlyInputCapture.js.map +1 -0
  2862. package/dist/src/utils/earlyInputCapture.test.d.ts +6 -0
  2863. package/dist/src/utils/earlyInputCapture.test.js +274 -0
  2864. package/dist/src/utils/earlyInputCapture.test.js.map +1 -0
  2865. package/dist/src/utils/envVarResolver.d.ts +39 -0
  2866. package/dist/src/utils/envVarResolver.js +100 -0
  2867. package/dist/src/utils/envVarResolver.js.map +1 -0
  2868. package/dist/src/utils/envVarResolver.test.d.ts +6 -0
  2869. package/dist/src/utils/envVarResolver.test.js +221 -0
  2870. package/dist/src/utils/envVarResolver.test.js.map +1 -0
  2871. package/dist/src/utils/errors.d.ts +76 -0
  2872. package/dist/src/utils/errors.js +237 -0
  2873. package/dist/src/utils/errors.js.map +1 -0
  2874. package/dist/src/utils/errors.test.d.ts +6 -0
  2875. package/dist/src/utils/errors.test.js +536 -0
  2876. package/dist/src/utils/errors.test.js.map +1 -0
  2877. package/dist/src/utils/events.d.ts +13 -0
  2878. package/dist/src/utils/events.js +15 -0
  2879. package/dist/src/utils/events.js.map +1 -0
  2880. package/dist/src/utils/gitUtils.d.ts +30 -0
  2881. package/dist/src/utils/gitUtils.js +108 -0
  2882. package/dist/src/utils/gitUtils.js.map +1 -0
  2883. package/dist/src/utils/gitUtils.test.d.ts +6 -0
  2884. package/dist/src/utils/gitUtils.test.js +172 -0
  2885. package/dist/src/utils/gitUtils.test.js.map +1 -0
  2886. package/dist/src/utils/handleAutoUpdate.d.ts +16 -0
  2887. package/dist/src/utils/handleAutoUpdate.js +144 -0
  2888. package/dist/src/utils/handleAutoUpdate.js.map +1 -0
  2889. package/dist/src/utils/headlessSafetyWarnings.d.ts +21 -0
  2890. package/dist/src/utils/headlessSafetyWarnings.js +45 -0
  2891. package/dist/src/utils/headlessSafetyWarnings.js.map +1 -0
  2892. package/dist/src/utils/headlessSafetyWarnings.test.d.ts +6 -0
  2893. package/dist/src/utils/headlessSafetyWarnings.test.js +66 -0
  2894. package/dist/src/utils/headlessSafetyWarnings.test.js.map +1 -0
  2895. package/dist/src/utils/housekeeping/cleanup.d.ts +15 -0
  2896. package/dist/src/utils/housekeeping/cleanup.js +69 -0
  2897. package/dist/src/utils/housekeeping/cleanup.js.map +1 -0
  2898. package/dist/src/utils/housekeeping/cleanup.test.d.ts +6 -0
  2899. package/dist/src/utils/housekeeping/cleanup.test.js +166 -0
  2900. package/dist/src/utils/housekeeping/cleanup.test.js.map +1 -0
  2901. package/dist/src/utils/housekeeping/lastInteractionAt.d.ts +9 -0
  2902. package/dist/src/utils/housekeeping/lastInteractionAt.js +22 -0
  2903. package/dist/src/utils/housekeeping/lastInteractionAt.js.map +1 -0
  2904. package/dist/src/utils/housekeeping/scheduler.d.ts +17 -0
  2905. package/dist/src/utils/housekeeping/scheduler.js +130 -0
  2906. package/dist/src/utils/housekeeping/scheduler.js.map +1 -0
  2907. package/dist/src/utils/housekeeping/scheduler.test.d.ts +6 -0
  2908. package/dist/src/utils/housekeeping/scheduler.test.js +190 -0
  2909. package/dist/src/utils/housekeeping/scheduler.test.js.map +1 -0
  2910. package/dist/src/utils/housekeeping/throttledOnce.d.ts +13 -0
  2911. package/dist/src/utils/housekeeping/throttledOnce.js +110 -0
  2912. package/dist/src/utils/housekeeping/throttledOnce.js.map +1 -0
  2913. package/dist/src/utils/housekeeping/throttledOnce.test.d.ts +6 -0
  2914. package/dist/src/utils/housekeeping/throttledOnce.test.js +94 -0
  2915. package/dist/src/utils/housekeeping/throttledOnce.test.js.map +1 -0
  2916. package/dist/src/utils/installationInfo.d.ts +26 -0
  2917. package/dist/src/utils/installationInfo.js +266 -0
  2918. package/dist/src/utils/installationInfo.js.map +1 -0
  2919. package/dist/src/utils/installationInfo.test.d.ts +6 -0
  2920. package/dist/src/utils/installationInfo.test.js +466 -0
  2921. package/dist/src/utils/installationInfo.test.js.map +1 -0
  2922. package/dist/src/utils/languageUtils.d.ts +40 -0
  2923. package/dist/src/utils/languageUtils.js +163 -0
  2924. package/dist/src/utils/languageUtils.js.map +1 -0
  2925. package/dist/src/utils/languageUtils.test.d.ts +6 -0
  2926. package/dist/src/utils/languageUtils.test.js +341 -0
  2927. package/dist/src/utils/languageUtils.test.js.map +1 -0
  2928. package/dist/src/utils/math.d.ts +13 -0
  2929. package/dist/src/utils/math.js +14 -0
  2930. package/dist/src/utils/math.js.map +1 -0
  2931. package/dist/src/utils/memoryDiagnostics.d.ts +65 -0
  2932. package/dist/src/utils/memoryDiagnostics.js +365 -0
  2933. package/dist/src/utils/memoryDiagnostics.js.map +1 -0
  2934. package/dist/src/utils/memoryDiagnostics.test.d.ts +6 -0
  2935. package/dist/src/utils/memoryDiagnostics.test.js +641 -0
  2936. package/dist/src/utils/memoryDiagnostics.test.js.map +1 -0
  2937. package/dist/src/utils/modelConfigUtils.d.ts +55 -0
  2938. package/dist/src/utils/modelConfigUtils.js +186 -0
  2939. package/dist/src/utils/modelConfigUtils.js.map +1 -0
  2940. package/dist/src/utils/modelConfigUtils.test.d.ts +6 -0
  2941. package/dist/src/utils/modelConfigUtils.test.js +1247 -0
  2942. package/dist/src/utils/modelConfigUtils.test.js.map +1 -0
  2943. package/dist/src/utils/nonInteractiveHelpers.d.ts +101 -0
  2944. package/dist/src/utils/nonInteractiveHelpers.js +479 -0
  2945. package/dist/src/utils/nonInteractiveHelpers.js.map +1 -0
  2946. package/dist/src/utils/nonInteractiveHelpers.test.d.ts +6 -0
  2947. package/dist/src/utils/nonInteractiveHelpers.test.js +1038 -0
  2948. package/dist/src/utils/nonInteractiveHelpers.test.js.map +1 -0
  2949. package/dist/src/utils/osc.d.ts +91 -0
  2950. package/dist/src/utils/osc.js +162 -0
  2951. package/dist/src/utils/osc.js.map +1 -0
  2952. package/dist/src/utils/osc.test.d.ts +6 -0
  2953. package/dist/src/utils/osc.test.js +217 -0
  2954. package/dist/src/utils/osc.test.js.map +1 -0
  2955. package/dist/src/utils/package.d.ts +12 -0
  2956. package/dist/src/utils/package.js +24 -0
  2957. package/dist/src/utils/package.js.map +1 -0
  2958. package/dist/src/utils/processUtils.d.ts +13 -0
  2959. package/dist/src/utils/processUtils.js +18 -0
  2960. package/dist/src/utils/processUtils.js.map +1 -0
  2961. package/dist/src/utils/processUtils.test.d.ts +6 -0
  2962. package/dist/src/utils/processUtils.test.js +20 -0
  2963. package/dist/src/utils/processUtils.test.js.map +1 -0
  2964. package/dist/src/utils/readStdin.d.ts +6 -0
  2965. package/dist/src/utils/readStdin.js +60 -0
  2966. package/dist/src/utils/readStdin.js.map +1 -0
  2967. package/dist/src/utils/readStdin.test.d.ts +6 -0
  2968. package/dist/src/utils/readStdin.test.js +88 -0
  2969. package/dist/src/utils/readStdin.test.js.map +1 -0
  2970. package/dist/src/utils/relaunch.d.ts +9 -0
  2971. package/dist/src/utils/relaunch.js +68 -0
  2972. package/dist/src/utils/relaunch.js.map +1 -0
  2973. package/dist/src/utils/relaunch.test.d.ts +6 -0
  2974. package/dist/src/utils/relaunch.test.js +291 -0
  2975. package/dist/src/utils/relaunch.test.js.map +1 -0
  2976. package/dist/src/utils/resolvePath.d.ts +6 -0
  2977. package/dist/src/utils/resolvePath.js +21 -0
  2978. package/dist/src/utils/resolvePath.js.map +1 -0
  2979. package/dist/src/utils/runBudget.d.ts +116 -0
  2980. package/dist/src/utils/runBudget.js +235 -0
  2981. package/dist/src/utils/runBudget.js.map +1 -0
  2982. package/dist/src/utils/runBudget.test.d.ts +6 -0
  2983. package/dist/src/utils/runBudget.test.js +187 -0
  2984. package/dist/src/utils/runBudget.test.js.map +1 -0
  2985. package/dist/src/utils/sandbox-macos-permissive-closed.sb +33 -0
  2986. package/dist/src/utils/sandbox-macos-permissive-open.sb +28 -0
  2987. package/dist/src/utils/sandbox-macos-permissive-proxied.sb +38 -0
  2988. package/dist/src/utils/sandbox-macos-restrictive-closed.sb +94 -0
  2989. package/dist/src/utils/sandbox-macos-restrictive-open.sb +97 -0
  2990. package/dist/src/utils/sandbox-macos-restrictive-proxied.sb +99 -0
  2991. package/dist/src/utils/sandbox.d.ts +7 -0
  2992. package/dist/src/utils/sandbox.js +788 -0
  2993. package/dist/src/utils/sandbox.js.map +1 -0
  2994. package/dist/src/utils/sessionPaths.d.ts +19 -0
  2995. package/dist/src/utils/sessionPaths.js +141 -0
  2996. package/dist/src/utils/sessionPaths.js.map +1 -0
  2997. package/dist/src/utils/sessionPaths.test.d.ts +6 -0
  2998. package/dist/src/utils/sessionPaths.test.js +249 -0
  2999. package/dist/src/utils/sessionPaths.test.js.map +1 -0
  3000. package/dist/src/utils/settingsUtils.d.ts +167 -0
  3001. package/dist/src/utils/settingsUtils.js +532 -0
  3002. package/dist/src/utils/settingsUtils.js.map +1 -0
  3003. package/dist/src/utils/settingsUtils.test.d.ts +6 -0
  3004. package/dist/src/utils/settingsUtils.test.js +849 -0
  3005. package/dist/src/utils/settingsUtils.test.js.map +1 -0
  3006. package/dist/src/utils/spawnWrapper.d.ts +7 -0
  3007. package/dist/src/utils/spawnWrapper.js +8 -0
  3008. package/dist/src/utils/spawnWrapper.js.map +1 -0
  3009. package/dist/src/utils/standalone-update-verify.d.ts +12 -0
  3010. package/dist/src/utils/standalone-update-verify.js +43 -0
  3011. package/dist/src/utils/standalone-update-verify.js.map +1 -0
  3012. package/dist/src/utils/standalone-update-verify.test.d.ts +6 -0
  3013. package/dist/src/utils/standalone-update-verify.test.js +27 -0
  3014. package/dist/src/utils/standalone-update-verify.test.js.map +1 -0
  3015. package/dist/src/utils/standalone-update.d.ts +27 -0
  3016. package/dist/src/utils/standalone-update.js +714 -0
  3017. package/dist/src/utils/standalone-update.js.map +1 -0
  3018. package/dist/src/utils/standalone-update.test.d.ts +6 -0
  3019. package/dist/src/utils/standalone-update.test.js +301 -0
  3020. package/dist/src/utils/standalone-update.test.js.map +1 -0
  3021. package/dist/src/utils/startupProfiler.d.ts +90 -0
  3022. package/dist/src/utils/startupProfiler.js +267 -0
  3023. package/dist/src/utils/startupProfiler.js.map +1 -0
  3024. package/dist/src/utils/startupProfiler.test.d.ts +1 -0
  3025. package/dist/src/utils/startupProfiler.test.js +293 -0
  3026. package/dist/src/utils/startupProfiler.test.js.map +1 -0
  3027. package/dist/src/utils/startupWarnings.d.ts +6 -0
  3028. package/dist/src/utils/startupWarnings.js +40 -0
  3029. package/dist/src/utils/startupWarnings.js.map +1 -0
  3030. package/dist/src/utils/stdioHelpers.d.ts +31 -0
  3031. package/dist/src/utils/stdioHelpers.js +38 -0
  3032. package/dist/src/utils/stdioHelpers.js.map +1 -0
  3033. package/dist/src/utils/systemInfo.d.ts +78 -0
  3034. package/dist/src/utils/systemInfo.js +208 -0
  3035. package/dist/src/utils/systemInfo.js.map +1 -0
  3036. package/dist/src/utils/systemInfo.test.d.ts +6 -0
  3037. package/dist/src/utils/systemInfo.test.js +380 -0
  3038. package/dist/src/utils/systemInfo.test.js.map +1 -0
  3039. package/dist/src/utils/systemInfoFields.d.ts +18 -0
  3040. package/dist/src/utils/systemInfoFields.js +102 -0
  3041. package/dist/src/utils/systemInfoFields.js.map +1 -0
  3042. package/dist/src/utils/systemInfoFields.test.d.ts +6 -0
  3043. package/dist/src/utils/systemInfoFields.test.js +74 -0
  3044. package/dist/src/utils/systemInfoFields.test.js.map +1 -0
  3045. package/dist/src/utils/terminalSequence.d.ts +21 -0
  3046. package/dist/src/utils/terminalSequence.js +124 -0
  3047. package/dist/src/utils/terminalSequence.js.map +1 -0
  3048. package/dist/src/utils/terminalSequence.test.d.ts +6 -0
  3049. package/dist/src/utils/terminalSequence.test.js +132 -0
  3050. package/dist/src/utils/terminalSequence.test.js.map +1 -0
  3051. package/dist/src/utils/truncatedDiffPreview.d.ts +6 -0
  3052. package/dist/src/utils/truncatedDiffPreview.js +18 -0
  3053. package/dist/src/utils/truncatedDiffPreview.js.map +1 -0
  3054. package/dist/src/utils/updateEventEmitter.d.ts +11 -0
  3055. package/dist/src/utils/updateEventEmitter.js +12 -0
  3056. package/dist/src/utils/updateEventEmitter.js.map +1 -0
  3057. package/dist/src/utils/userPromptExpansionHook.d.ts +9 -0
  3058. package/dist/src/utils/userPromptExpansionHook.js +30 -0
  3059. package/dist/src/utils/userPromptExpansionHook.js.map +1 -0
  3060. package/dist/src/utils/userPromptExpansionHook.test.d.ts +6 -0
  3061. package/dist/src/utils/userPromptExpansionHook.test.js +69 -0
  3062. package/dist/src/utils/userPromptExpansionHook.test.js.map +1 -0
  3063. package/dist/src/utils/userStartupWarnings.d.ts +12 -0
  3064. package/dist/src/utils/userStartupWarnings.js +74 -0
  3065. package/dist/src/utils/userStartupWarnings.js.map +1 -0
  3066. package/dist/src/utils/userStartupWarnings.test.d.ts +6 -0
  3067. package/dist/src/utils/userStartupWarnings.test.js +88 -0
  3068. package/dist/src/utils/userStartupWarnings.test.js.map +1 -0
  3069. package/dist/src/utils/version.d.ts +6 -0
  3070. package/dist/src/utils/version.js +11 -0
  3071. package/dist/src/utils/version.js.map +1 -0
  3072. package/dist/src/utils/warningHandler.d.ts +29 -0
  3073. package/dist/src/utils/warningHandler.js +100 -0
  3074. package/dist/src/utils/warningHandler.js.map +1 -0
  3075. package/dist/src/utils/warningHandler.test.d.ts +6 -0
  3076. package/dist/src/utils/warningHandler.test.js +185 -0
  3077. package/dist/src/utils/warningHandler.test.js.map +1 -0
  3078. package/dist/src/utils/windowTitle.d.ts +12 -0
  3079. package/dist/src/utils/windowTitle.js +19 -0
  3080. package/dist/src/utils/windowTitle.js.map +1 -0
  3081. package/dist/src/utils/windowTitle.test.d.ts +6 -0
  3082. package/dist/src/utils/windowTitle.test.js +49 -0
  3083. package/dist/src/utils/windowTitle.test.js.map +1 -0
  3084. package/dist/src/utils/writeWithBackup.d.ts +49 -0
  3085. package/dist/src/utils/writeWithBackup.js +136 -0
  3086. package/dist/src/utils/writeWithBackup.js.map +1 -0
  3087. package/dist/src/utils/writeWithBackup.test.d.ts +6 -0
  3088. package/dist/src/utils/writeWithBackup.test.js +177 -0
  3089. package/dist/src/utils/writeWithBackup.test.js.map +1 -0
  3090. package/dist/src/validateNonInterActiveAuth.d.ts +8 -0
  3091. package/dist/src/validateNonInterActiveAuth.js +66 -0
  3092. package/dist/src/validateNonInterActiveAuth.js.map +1 -0
  3093. package/dist/tsconfig.tsbuildinfo +1 -0
  3094. package/package.json +121 -0
@@ -0,0 +1,2297 @@
1
+ /**
2
+ * @license
3
+ * Copyright 2025 Qwen Team
4
+ * SPDX-License-Identifier: Apache-2.0
5
+ */
6
+ import * as path from 'node:path';
7
+ import express from 'express';
8
+ import { APPROVAL_MODES, TrustGateError } from '@tulex-cli/tulex-cli-core';
9
+ import { writeStderrLine } from '../utils/stdioHelpers.js';
10
+ import { bearerAuth, createMutationGate, denyBrowserOriginCors, hostAllowlist, } from './auth.js';
11
+ import { DeviceFlowRegistry, setDeviceFlowRegistry, TooManyActiveDeviceFlowsError, UnsupportedDeviceFlowProviderError, UpstreamDeviceFlowError, } from './auth/deviceFlow.js';
12
+ import { QwenOAuthDeviceFlowProvider } from './auth/qwenDeviceFlowProvider.js';
13
+ import { createDaemonStatusProvider } from './daemonStatusProvider.js';
14
+ import { isLoopbackBind } from './loopbackBinds.js';
15
+ import { canonicalizeWorkspace, createHttpAcpBridge, InvalidClientIdError, InvalidPermissionOptionError, InvalidSessionMetadataError, InvalidSessionScopeError, MAX_WORKSPACE_PATH_LENGTH, McpServerNotFoundError, McpServerRestartFailedError, RestoreInProgressError, SessionLimitExceededError, SessionNotFoundError, WorkspaceInitConflictError, WorkspaceMismatchError, } from './httpAcpBridge.js';
16
+ import { getAdvertisedServeFeatures, getServeProtocolVersions, } from './capabilities.js';
17
+ import { SubscriberLimitExceededError } from './eventBus.js';
18
+ import { CAPABILITIES_SCHEMA_VERSION, } from './types.js';
19
+ import { getDemoHtml } from './demo.js';
20
+ import { mountWorkspaceMemoryRoutes } from './workspaceMemory.js';
21
+ import { mountWorkspaceAgentsRoutes } from './workspaceAgents.js';
22
+ import { createWorkspaceFileSystemFactory, } from './fs/index.js';
23
+ import { registerWorkspaceFileReadRoutes } from './routes/workspaceFileRead.js';
24
+ import { registerWorkspaceFileWriteRoutes } from './routes/workspaceFileWrite.js';
25
+ /**
26
+ * Build a no-op fs-audit emitter that logs a warning every
27
+ * `WARN_EVERY` dropped events with as much context as the audit
28
+ * payload exposes. The default factory uses this so a regression
29
+ * that silently strips audit events shows up in operator logs
30
+ * instead of disappearing — the earlier one-shot warn was a
31
+ * permanent silent no-op after the first event, which made a PR
32
+ * 19/20 regression where `runQwenServe` forgets to inject the real
33
+ * factory completely invisible (every write 403s; nothing in
34
+ * audit; one stale stderr line easy to miss for background
35
+ * daemons). Periodic warning + dropped-event count + first-event
36
+ * `errorKind` + `pathHash` make the regression actionable.
37
+ *
38
+ * PR 19/20's `runQwenServe` injection replaces this with a real
39
+ * per-session emit, so legitimate production traffic never hits
40
+ * the warning.
41
+ */
42
+ export function createDefaultFsAuditEmit() {
43
+ const WARN_EVERY = 100;
44
+ let droppedCount = 0;
45
+ return (event) => {
46
+ droppedCount += 1;
47
+ if (droppedCount === 1 || droppedCount % WARN_EVERY === 0) {
48
+ const data = event.data;
49
+ const ctx = [];
50
+ if (data?.errorKind)
51
+ ctx.push(`errorKind=${data.errorKind}`);
52
+ if (data?.intent)
53
+ ctx.push(`intent=${data.intent}`);
54
+ if (data?.pathHash)
55
+ ctx.push(`pathHash=${data.pathHash}`);
56
+ const ctxStr = ctx.length > 0 ? ` (${ctx.join(' ')})` : '';
57
+ writeStderrLine(`qwen serve: fs audit emit is the default no-op — ${droppedCount} event(s) dropped so far. ` +
58
+ `Latest type=${event.type}${ctxStr}. ` +
59
+ `Inject deps.fsFactory in createServeApp to wire audit into the EventBus.`);
60
+ }
61
+ };
62
+ }
63
+ /**
64
+ * Build the Express app for `qwen serve`. Pure function — no side effects on
65
+ * the network or process; `runQwenServe` does the listen/signal handling.
66
+ *
67
+ * `getPort` is invoked lazily by the host-allowlist middleware so callers
68
+ * binding to port 0 (ephemeral) can supply the actual port after `listen()`
69
+ * resolves. Defaults to `opts.port` for callers (e.g. tests) that pin a port
70
+ * up front.
71
+ *
72
+ * Stage 1 routes shipped (matches §04 of issue #3803):
73
+ * - `GET /health`
74
+ * - `GET /capabilities`
75
+ * - `GET /workspace/mcp`
76
+ * - `GET /workspace/skills`
77
+ * - `GET /workspace/providers`
78
+ * - `GET /workspace/env`
79
+ * - `GET /workspace/preflight`
80
+ * - `POST /session`
81
+ * - `POST /session/:id/load`
82
+ * - `POST /session/:id/resume`
83
+ * - `GET /workspace/:id/sessions`
84
+ * - `GET /session/:id/context`
85
+ * - `GET /session/:id/supported-commands`
86
+ * - `POST /session/:id/prompt`
87
+ * - `POST /session/:id/cancel`
88
+ * - `POST /session/:id/heartbeat`
89
+ * - `POST /session/:id/model`
90
+ * - `GET /session/:id/events` (SSE)
91
+ * - `POST /session/:id/permission/:requestId`
92
+ * - `POST /permission/:requestId`
93
+ *
94
+ * **Workspace validation contract.** `createServeApp` itself does NOT
95
+ * verify that `opts.workspace` exists or is a directory — it
96
+ * canonicalizes via `canonicalizeWorkspace`, which falls back to
97
+ * `path.resolve` on ENOENT so the app boots even against a missing
98
+ * path. `runQwenServe` is the production entry point and DOES
99
+ * perform the `fs.statSync` + `isDirectory()` boot-loud check before
100
+ * calling this function. Tests inject synthetic paths (`/work/bound`
101
+ * etc.) on purpose: they want to exercise the route layer's
102
+ * canonicalization and `workspace_mismatch` translation without
103
+ * needing a real directory on disk. If a future entry point binds
104
+ * `createServeApp` directly to user input, it MUST replicate the
105
+ * `runQwenServe` validation (or call into a shared helper if one is
106
+ * extracted) — otherwise a non-existent `--workspace` would boot
107
+ * a "healthy"-looking daemon whose every spawn fails with cryptic
108
+ * child-process ENOENT.
109
+ */
110
+ export function createServeApp(opts, getPort = () => opts.port, deps = {}) {
111
+ const app = express();
112
+ // Forward `maxSessions` into the default-constructed bridge so
113
+ // direct callers of `createServeApp` (tests, embeds) get the same
114
+ // cap they configured via `ServeOptions`. Previously the default
115
+ // bridge silently fell back to `DEFAULT_MAX_SESSIONS` (20) and
116
+ // only the `runQwenServe` path piped the option through.
117
+ //
118
+ // Workspace binding mirrors `runQwenServe`: per #3803 §02 the
119
+ // daemon is bound to exactly one workspace (`opts.workspace` or
120
+ // `process.cwd()`). `POST /session` with a mismatched cwd is
121
+ // rejected with 400 `workspace_mismatch`.
122
+ //
123
+ // The value advertised on `/capabilities`, used for the `POST
124
+ // /session` cwd fallback, AND passed into the bridge must be the
125
+ // SAME canonical form — otherwise the bridge's
126
+ // `realpathSync.native` would diverge from what `/capabilities`
127
+ // shows on symlinks / case-insensitive filesystems, and clients
128
+ // echoing the advertised path back would see a response whose
129
+ // `workspaceCwd` differs from what they sent.
130
+ //
131
+ // `deps.boundWorkspace` is the pre-canonicalized fast-path —
132
+ // `runQwenServe` passes it after its own boot-time
133
+ // `canonicalizeWorkspace`, so we skip the redundant
134
+ // `realpathSync.native` here. When omitted (tests, direct embeds)
135
+ // we canonicalize ourselves.
136
+ const boundWorkspace = deps.boundWorkspace ??
137
+ canonicalizeWorkspace(opts.workspace ?? process.cwd());
138
+ const bridge = deps.bridge ??
139
+ createHttpAcpBridge({
140
+ maxSessions: opts.maxSessions,
141
+ // Symmetric with `runQwenServe.ts` — direct embeds / tests that
142
+ // call `createServeApp` without supplying their own bridge and
143
+ // pass `ServeOptions.eventRingSize` would otherwise silently
144
+ // get the default 8000 ring instead of their configured value.
145
+ ...(opts.eventRingSize !== undefined
146
+ ? { eventRingSize: opts.eventRingSize }
147
+ : {}),
148
+ boundWorkspace,
149
+ // PR 22b/2 (wenshao/gpt-5.5 review fold-in #4304): symmetric
150
+ // with `runQwenServe.ts` — direct embeds / tests that don't
151
+ // inject `deps.bridge` would otherwise silently lose the
152
+ // daemon env + preflight cells the default server app
153
+ // reported pre-injection. Wiring the production status provider
154
+ // here preserves byte-for-byte route output on the default
155
+ // bridge construction path.
156
+ statusProvider: createDaemonStatusProvider(),
157
+ });
158
+ // Allow same-origin requests from the demo page. Browsers send an
159
+ // `Origin` header on same-origin POST/fetch calls; `denyBrowserOriginCors`
160
+ // below would reject them. This middleware strips `Origin` when it
161
+ // matches the daemon's own address so the demo page's API calls pass
162
+ // through. Only loopback origins are matched — non-loopback deployments
163
+ // require the operator to front the daemon with a reverse proxy for
164
+ // browser access anyway (per the threat-model docs).
165
+ let cachedStripPort = -1;
166
+ let cachedSelfOrigins = new Set();
167
+ app.use((req, _res, next) => {
168
+ const origin = req.headers.origin;
169
+ if (origin) {
170
+ const port = getPort();
171
+ if (port !== cachedStripPort) {
172
+ cachedStripPort = port;
173
+ cachedSelfOrigins = new Set([
174
+ `http://127.0.0.1:${port}`,
175
+ `http://localhost:${port}`,
176
+ `http://[::1]:${port}`,
177
+ `http://host.docker.internal:${port}`,
178
+ ]);
179
+ }
180
+ if (cachedSelfOrigins.has(origin)) {
181
+ delete req.headers.origin;
182
+ }
183
+ }
184
+ next();
185
+ });
186
+ // Strict-default factory: `trusted: false` so an upstream refactor
187
+ // that forgets to inject `deps.fsFactory` never silently allows
188
+ // writes against an untrusted workspace. Read-shaped intents still
189
+ // succeed (so tests / direct embeds can exercise the read path
190
+ // without a config), but every mutating intent throws
191
+ // `untrusted_workspace`. The default `emit` is a no-op that warns
192
+ // once on first call so a future regression that silently swallows
193
+ // audit events surfaces in operator logs the first time it bites.
194
+ // Callers passing `deps.fsFactory` get full control of trust +
195
+ // audit destination — `runQwenServe` will inject one whose
196
+ // `trusted` mirrors `Config.isTrustedFolder()` and whose `emit`
197
+ // plumbs into the per-session EventBus once PR 19/20 lands.
198
+ const fsFactory = deps.fsFactory ??
199
+ createWorkspaceFileSystemFactory({
200
+ boundWorkspace,
201
+ trusted: false,
202
+ emit: createDefaultFsAuditEmit(),
203
+ });
204
+ // Park the factory on `app.locals` so PR 19/20 route handlers can
205
+ // pick it up via `req.app.locals.fsFactory` without re-threading
206
+ // the value through every handler signature, and so PR 18 tests
207
+ // can assert the factory is reachable. Express types `locals` as
208
+ // a generic record; we cast to keep a precise property name.
209
+ app.locals.fsFactory =
210
+ fsFactory;
211
+ // Surface the bound workspace on `app.locals` so the PR 19 read
212
+ // routes can compute workspace-relative response paths without
213
+ // re-resolving. Same canonical form `/capabilities` advertises
214
+ // and the bridge enforces — keeping every layer in agreement.
215
+ app.locals.boundWorkspace = boundWorkspace;
216
+ // Issue #4175 PR 21 — wire the device-flow registry. Default builds
217
+ // a single Qwen provider; tests inject `deps.deviceFlowRegistry`
218
+ // wholesale (with controlled clock/scheduler) or
219
+ // `deps.deviceFlowProviders` to stub the OAuth client only.
220
+ const deviceFlowProviderMap = new Map();
221
+ for (const provider of deps.deviceFlowProviders ?? []) {
222
+ deviceFlowProviderMap.set(provider.providerId, provider);
223
+ }
224
+ if (!deviceFlowProviderMap.has('qwen-oauth')) {
225
+ deviceFlowProviderMap.set('qwen-oauth', new QwenOAuthDeviceFlowProvider());
226
+ }
227
+ const deviceFlowEventSink = {
228
+ publish(emission, originatorClientId) {
229
+ // PR #4255 fold-in 9: PR 16 (#4249) landed
230
+ // `publishWorkspaceEvent` with the same fan-out semantics as
231
+ // PR 21's `broadcastWorkspaceEvent`. The closed-bus +
232
+ // all-failed-stderr operator-visibility features that PR 21
233
+ // added have been folded INTO `publishWorkspaceEvent`; PR 21
234
+ // now uses the canonical helper.
235
+ bridge.publishWorkspaceEvent({
236
+ type: `auth_device_flow_${emission.type}`,
237
+ data: emission.data,
238
+ ...(originatorClientId ? { originatorClientId } : {}),
239
+ });
240
+ },
241
+ };
242
+ const deviceFlowRegistry = deps.deviceFlowRegistry ??
243
+ new DeviceFlowRegistry({
244
+ events: deviceFlowEventSink,
245
+ audit: {
246
+ record(line) {
247
+ // Structured stderr breadcrumb; deviceFlowId truncated to first
248
+ // 8 chars (mirrors PR 16 audit-event-stamp shape) so log
249
+ // skimmers can follow a flow without retaining full uuids.
250
+ const id = line.deviceFlowId.slice(0, 8);
251
+ const parts = [
252
+ `[serve] auth.device-flow:`,
253
+ `provider=${line.providerId}`,
254
+ `deviceFlowId=${id}...`,
255
+ line.clientId ? `clientId=${line.clientId}` : 'clientId=-',
256
+ `status=${line.status}`,
257
+ ];
258
+ if (line.errorKind)
259
+ parts.push(`errorKind=${line.errorKind}`);
260
+ if (line.expiresInMs !== undefined) {
261
+ parts.push(`expiresInMs=${Math.max(0, line.expiresInMs)}`);
262
+ }
263
+ // PR #4255 round-12 #7 (gpt-5.5 review CzSpd): include
264
+ // `line.hint` in the production stderr line. The
265
+ // registry uses the hint slot for operator-only
266
+ // breadcrumbs that aren't surfaced over SSE: the static
267
+ // catch-all hint "provider.poll() threw (raw): ..."
268
+ // (round-8 #1), `lost_success_after_timeout` (round-8
269
+ // #7's split-brain detector), `persist_also_failed_past_expiry`
270
+ // (round-8 #13), `take-over` audit on per-provider
271
+ // singleton, and `deferred (persist in flight; ...)` on
272
+ // cancel-during-persist. Without echoing here, the
273
+ // documented troubleshooting trail is invisible in
274
+ // production. Bound at 1 KiB so a misbehaving caller
275
+ // can't spam stderr.
276
+ if (line.hint) {
277
+ const STDERR_HINT_MAX = 1_024;
278
+ const hint = line.hint.length > STDERR_HINT_MAX
279
+ ? `${line.hint.slice(0, STDERR_HINT_MAX)}…[+${line.hint.length - STDERR_HINT_MAX} bytes truncated]`
280
+ : line.hint;
281
+ // Quote the hint so multi-word values stay parseable.
282
+ parts.push(`hint=${JSON.stringify(hint)}`);
283
+ }
284
+ writeStderrLine(parts.join(' '));
285
+ },
286
+ },
287
+ resolveProvider: (providerId) => deviceFlowProviderMap.get(providerId),
288
+ });
289
+ // Park the registry on `app.locals` so request handlers can reach it
290
+ // without closure capture (and so future helper extracts can find it
291
+ // without threading it through their args). Typed accessor (fold-in 4
292
+ // review thread D) prevents a string-key typo from silently
293
+ // detaching `runQwenServe`'s shutdown dispose call.
294
+ setDeviceFlowRegistry(app, deviceFlowRegistry);
295
+ // Order matters: rejection guards (CORS / Host allowlist / bearer auth)
296
+ // run BEFORE the JSON body parser. Otherwise an unauthenticated POST
297
+ // gets a full 10MB `JSON.parse` before the 401 fires — a trivially
298
+ // amplified CPU/memory cost from any wrong-token client.
299
+ app.use(denyBrowserOriginCors);
300
+ app.use(hostAllowlist(opts.hostname, getPort));
301
+ // --- Demo page: mirrors the `/health` loopback-gating pattern.
302
+ // On loopback binds, registered BEFORE bearerAuth so browsers can
303
+ // reach the page via address-bar navigation (which cannot attach
304
+ // Authorization headers). On non-loopback binds, registered AFTER
305
+ // bearerAuth — an unauthenticated `/demo` on a public interface
306
+ // would leak the full API surface (route enumeration + interactive
307
+ // console), far more than `/health`'s `{"status":"ok"}`.
308
+ // X-Frame-Options: DENY + CSP frame-ancestors 'none' prevent
309
+ // clickjacking — a malicious site embedding the demo in an iframe
310
+ // could trick a user into performing daemon actions via transparent
311
+ // overlay (the iframe's same-origin fetches bypass CORS).
312
+ const demoHandler = (_req, res) => {
313
+ try {
314
+ res
315
+ .type('html')
316
+ .set('X-Frame-Options', 'DENY')
317
+ .set('Content-Security-Policy', "default-src 'none'; script-src 'unsafe-inline'; style-src 'unsafe-inline'; connect-src 'self'; frame-ancestors 'none'")
318
+ .send(getDemoHtml(getPort()));
319
+ }
320
+ catch (err) {
321
+ writeStderrLine(`qwen serve: /demo render failed: ${err instanceof Error ? err.message : String(err)}`);
322
+ res.status(500).json({ error: 'Failed to render demo page' });
323
+ }
324
+ };
325
+ // `/health` is exempted from `bearerAuth` ONLY on loopback binds —
326
+ // the canonical liveness-probe case (k8s/Compose probes don't
327
+ // carry the daemon's bearer; round-tripping a 401 just to know
328
+ // the listener is up is waste). On non-loopback binds the
329
+ // exemption becomes a low-severity info leak (attacker can probe
330
+ // arbitrary IP:port to confirm a `qwen serve` is listening), so
331
+ // we register `/health` AFTER `bearerAuth` and let it 401 like
332
+ // every other route. Operators using the loopback default get the
333
+ // probe-friendly behavior; operators exposing the daemon publicly
334
+ // gate `/health` behind their token alongside everything else.
335
+ // CORS deny + Host allowlist still apply to `/health` in both
336
+ // cases.
337
+ // Shared handler so loopback (pre-auth) and non-loopback (post-auth)
338
+ // routes return the same shape. `?deep=1` exposes bridge counters
339
+ // (`sessions`, `pendingPermissions`) for observability — it is
340
+ // INFORMATIONAL only, not a true liveness probe. Counter getters
341
+ // are size accessors that don't perform per-session/channel pings,
342
+ // so a wedged child (stuck on a request, leaked FD, etc.) won't
343
+ // change the response. We retain the try/catch + 503 as a
344
+ // defense-in-depth net for custom bridge impls whose getters MAY
345
+ // throw — but the real bridge's getters never do, so under normal
346
+ // operation the 503 path is unreachable. Per BQ-6F: the docs
347
+ // (`docs/users/qwen-serve.md` + `qwen-serve-protocol.md`) clarify
348
+ // that deep is for counters, not health verification. Default (no
349
+ // query) stays cheap so high-frequency liveness probes don't load
350
+ // the bridge.
351
+ const healthHandler = (req, res) => {
352
+ const deepQuery = req.query['deep'];
353
+ const deep = deepQuery === '1' || deepQuery === 'true' || deepQuery === '';
354
+ if (!deep) {
355
+ res.status(200).json({ status: 'ok' });
356
+ return;
357
+ }
358
+ try {
359
+ res.status(200).json({
360
+ status: 'ok',
361
+ sessions: bridge.sessionCount,
362
+ pendingPermissions: bridge.pendingPermissionCount,
363
+ });
364
+ }
365
+ catch (err) {
366
+ writeStderrLine(`qwen serve: /health deep probe failed: ${err instanceof Error ? err.message : String(err)}`);
367
+ res.status(503).json({ status: 'degraded' });
368
+ }
369
+ };
370
+ const loopback = isLoopbackBind(opts.hostname);
371
+ // Issue #4175 PR 15. `--require-auth` extends the non-loopback "gate
372
+ // /health behind bearer too" rule to loopback. Without this, an
373
+ // operator who set the flag specifically to harden the loopback
374
+ // default would still see `/health` answering 200 to unauthenticated
375
+ // probes — defeating the flag's purpose. The boot check in
376
+ // `runQwenServe` guarantees `token` is set whenever `requireAuth`
377
+ // is true, so the post-`bearerAuth` registration always has a token
378
+ // to compare against.
379
+ const exposeHealthPreAuth = loopback && !opts.requireAuth;
380
+ if (exposeHealthPreAuth) {
381
+ app.get('/health', healthHandler);
382
+ app.get('/demo', demoHandler);
383
+ }
384
+ app.use(bearerAuth(opts.token));
385
+ app.use(express.json({ limit: '10mb' }));
386
+ if (!exposeHealthPreAuth) {
387
+ // Non-loopback OR loopback with `--require-auth`: register
388
+ // `/health` and `/demo` AFTER `bearerAuth` so probes must carry
389
+ // the token. Otherwise unauthenticated callers can ping any
390
+ // reachable address:port to confirm a daemon exists (and `/demo`
391
+ // leaks the full API surface).
392
+ app.get('/health', healthHandler);
393
+ app.get('/demo', demoHandler);
394
+ }
395
+ // Issue #4175 PR 15. Mutation-route gate factory. Today's existing
396
+ // mutation routes (`POST /session*`, `/permission/:requestId`) opt
397
+ // into the default non-strict mode, which is a passthrough — so
398
+ // backward compatibility is bit-for-bit. Wave 4 PRs will pass
399
+ // `{ strict: true }` for routes (memory CRUD / file edit / tool
400
+ // enable / MCP restart / device-flow auth) that should require a
401
+ // token even when the daemon is on loopback no-token defaults.
402
+ const mutate = createMutationGate({
403
+ tokenConfigured: opts.token !== undefined,
404
+ requireAuth: opts.requireAuth === true,
405
+ });
406
+ app.get('/capabilities', (_req, res) => {
407
+ const envelope = {
408
+ v: CAPABILITIES_SCHEMA_VERSION,
409
+ protocolVersions: getServeProtocolVersions(),
410
+ mode: opts.mode,
411
+ // PR 15. Pass `requireAuth` so the `require_auth` tag appears
412
+ // ONLY when the operator opted in. Tag presence = behavior is
413
+ // on; older daemons without this PR omit the tag and SDKs that
414
+ // post-PR feature-detect on it stay backward compatible.
415
+ features: getAdvertisedServeFeatures(undefined, {
416
+ requireAuth: opts.requireAuth === true,
417
+ }),
418
+ modelServices: [],
419
+ // #3803 §02: surface the bound workspace so clients can detect
420
+ // mismatch pre-flight and omit `cwd` on `POST /session`.
421
+ workspaceCwd: boundWorkspace,
422
+ };
423
+ res.status(200).json(envelope);
424
+ });
425
+ app.get('/workspace/mcp', async (_req, res) => {
426
+ try {
427
+ res.status(200).json(await bridge.getWorkspaceMcpStatus());
428
+ }
429
+ catch (err) {
430
+ sendBridgeError(res, err, { route: 'GET /workspace/mcp' });
431
+ }
432
+ });
433
+ app.get('/workspace/skills', async (_req, res) => {
434
+ try {
435
+ res.status(200).json(await bridge.getWorkspaceSkillsStatus());
436
+ }
437
+ catch (err) {
438
+ sendBridgeError(res, err, { route: 'GET /workspace/skills' });
439
+ }
440
+ });
441
+ app.get('/workspace/providers', async (_req, res) => {
442
+ try {
443
+ res.status(200).json(await bridge.getWorkspaceProvidersStatus());
444
+ }
445
+ catch (err) {
446
+ sendBridgeError(res, err, { route: 'GET /workspace/providers' });
447
+ }
448
+ });
449
+ // Issue #4175 PR 16: workspace memory + agents CRUD. Routes mounted
450
+ // through factories so server.ts stays the composition root while
451
+ // the feature modules own their own validation, error mapping, and
452
+ // event fan-out. Both factories receive the shared `mutate` gate
453
+ // and the request-helpers `parseClientIdHeader` / `safeBody` so
454
+ // strict mutation gating and pollution-key scrubbing match the
455
+ // existing routes bit-for-bit.
456
+ mountWorkspaceMemoryRoutes(app, {
457
+ bridge,
458
+ boundWorkspace,
459
+ mutate,
460
+ parseClientId: parseClientIdHeader,
461
+ safeBody,
462
+ });
463
+ mountWorkspaceAgentsRoutes(app, {
464
+ bridge,
465
+ boundWorkspace,
466
+ mutate,
467
+ parseClientId: parseClientIdHeader,
468
+ safeBody,
469
+ });
470
+ // TODO(#4175 PR 24 — PermissionMediator audit log): emit an
471
+ // `audit.diagnostic_read` event from these two routes so a security
472
+ // operator can correlate "who read what when". Read-only diagnostic
473
+ // surfaces are reconnaissance vectors (env: secret-var presence;
474
+ // preflight: workspace path + CLI entry + Node version) and the absence
475
+ // of audit emission here is a deliberate scope deferral, not an
476
+ // oversight — the audit topic does not yet exist; PR 24 lands the
477
+ // shared `bridge.emitAudit` infrastructure that this and PR 18's
478
+ // `fs.access` events will both use.
479
+ app.get('/workspace/env', async (_req, res) => {
480
+ try {
481
+ res.status(200).json(await bridge.getWorkspaceEnvStatus());
482
+ }
483
+ catch (err) {
484
+ sendBridgeError(res, err, { route: 'GET /workspace/env' });
485
+ }
486
+ });
487
+ app.get('/workspace/preflight', async (_req, res) => {
488
+ try {
489
+ res.status(200).json(await bridge.getWorkspacePreflightStatus());
490
+ }
491
+ catch (err) {
492
+ sendBridgeError(res, err, { route: 'GET /workspace/preflight' });
493
+ }
494
+ });
495
+ // Issue #4175 PR 19 — read-only workspace file routes
496
+ // (`GET /file|/list|/glob|/stat`). Registered after the workspace
497
+ // diagnostics routes so the file surface sits next to its sibling
498
+ // workspace-scoped reads and shares the same auth posture (no
499
+ // `mutate()` gate; only the global `bearerAuth` middleware
500
+ // applies). Mutation file routes (`POST /file/write|/edit`) come
501
+ // in PR 20.
502
+ registerWorkspaceFileReadRoutes(app, {
503
+ parseClientId: parseClientIdHeader,
504
+ });
505
+ registerWorkspaceFileWriteRoutes(app, {
506
+ bridge,
507
+ mutate,
508
+ parseClientId: parseClientIdHeader,
509
+ safeBody,
510
+ });
511
+ // -- Issue #4175 PR 21 — auth device-flow routes ------------------------
512
+ app.post('/workspace/auth/device-flow', mutate({ strict: true }), async (req, res) => {
513
+ const body = safeBody(req);
514
+ const providerIdRaw = body['providerId'];
515
+ // PR #4255 review W2: split `invalid_request` (request shape is
516
+ // wrong — missing/non-string field) from `unsupported_provider`
517
+ // (the field is well-formed but its value isn't in the
518
+ // daemon's known set). Conflating the two surfaced misleading
519
+ // remediation hints to SDK consumers branching on `code`
520
+ // ("this provider isn't supported here" when the actual cause
521
+ // was a serializer dropping the field).
522
+ if (typeof providerIdRaw !== 'string' || providerIdRaw.length === 0) {
523
+ res.status(400).json({
524
+ error: '`providerId` must be a non-empty string',
525
+ code: 'invalid_request',
526
+ });
527
+ return;
528
+ }
529
+ // PR #4255 round-12 #3 (gpt-5.5 review CzSpe): validate
530
+ // against the runtime provider map, not the static
531
+ // `DEVICE_FLOW_SUPPORTED_PROVIDERS` tuple. The static tuple
532
+ // is the SDK-facing default; `deps.deviceFlowProviders` is
533
+ // the documented extension hook for tests / future
534
+ // providers. Hardcoding the static tuple here meant
535
+ // injected providers were rejected at the route while still
536
+ // being registered in `deviceFlowProviderMap` — easy to
537
+ // break when adding a second provider.
538
+ if (!deviceFlowProviderMap.has(providerIdRaw)) {
539
+ res.status(400).json({
540
+ error: `Unsupported device-flow provider: ${providerIdRaw}`,
541
+ code: 'unsupported_provider',
542
+ supportedProviders: Array.from(deviceFlowProviderMap.keys()),
543
+ });
544
+ return;
545
+ }
546
+ const providerId = providerIdRaw;
547
+ const clientId = parseClientIdHeader(req, res);
548
+ if (clientId === null)
549
+ return;
550
+ try {
551
+ const { view, attached } = await deviceFlowRegistry.start({
552
+ providerId,
553
+ ...(clientId !== undefined ? { initiatorClientId: clientId } : {}),
554
+ });
555
+ // Idempotent take-over → 200 with `attached: true`. Fresh start →
556
+ // 201 + `attached: false`. The registry is the source of truth on
557
+ // which branch fired (it's the one that decided not to call
558
+ // `provider.start()` again).
559
+ res
560
+ .status(attached ? 200 : 201)
561
+ .json(toDeviceFlowStartResponseBody(view, attached, clientId));
562
+ }
563
+ catch (err) {
564
+ if (err instanceof UnsupportedDeviceFlowProviderError) {
565
+ res
566
+ .status(400)
567
+ .json({ error: err.message, code: 'unsupported_provider' });
568
+ return;
569
+ }
570
+ if (err instanceof TooManyActiveDeviceFlowsError) {
571
+ res
572
+ .status(409)
573
+ .json({ error: err.message, code: 'too_many_active_flows' });
574
+ return;
575
+ }
576
+ if (err instanceof UpstreamDeviceFlowError) {
577
+ // IdP-side failure (network / parse / non-2xx). 502 distinguishes
578
+ // "the upstream we depend on misbehaved" from a daemon bug (5xx
579
+ // generic) so SDK clients can branch on retry strategy.
580
+ res.status(502).json({ error: err.message, code: 'upstream_error' });
581
+ return;
582
+ }
583
+ sendBridgeError(res, err, {
584
+ route: 'POST /workspace/auth/device-flow',
585
+ });
586
+ }
587
+ });
588
+ // PR #4255 fold-in 3: this GET surfaces `userCode` /
589
+ // `verificationUri` / `verificationUriComplete` for pending entries
590
+ // — material an attacker on the same loopback host could use to
591
+ // shoulder-surf the IdP approval flow. POST + DELETE are already
592
+ // strict; aligning GET to `mutate({ strict: true })` closes the
593
+ // information-disclosure asymmetry (the sibling
594
+ // `GET /workspace/auth/status` stays bearer-only because its
595
+ // pendingDeviceFlows entries intentionally omit `userCode`).
596
+ //
597
+ // PR #4291 follow-up review (qwen-latest, #4): GET now also runs
598
+ // `parseClientIdHeader` to drive the `callerIsInitiator` gate in
599
+ // `toDeviceFlowStateBody`. INTENTIONAL contract change: a malformed
600
+ // `X-Qwen-Client-Id` (>128 chars or invalid characters) returns
601
+ // `400 invalid_client_id` instead of the previous 200, matching the
602
+ // POST/DELETE behavior. SDK clients that send the header on POST
603
+ // should send a valid value on GET too. Anonymous callers (header
604
+ // absent) are unaffected and continue to work as pre-PR-4291 — the
605
+ // both-undefined branch in `callerIsInitiator` covers them.
606
+ app.get('/workspace/auth/device-flow/:id', mutate({ strict: true }), async (req, res) => {
607
+ const id = req.params['id'];
608
+ if (!id) {
609
+ res.status(404).json({
610
+ error: 'Device-flow id required',
611
+ code: 'device_flow_not_found',
612
+ });
613
+ return;
614
+ }
615
+ const view = deviceFlowRegistry.get(id);
616
+ if (!view) {
617
+ res.status(404).json({
618
+ error: `Device-flow ${id} not found`,
619
+ code: 'device_flow_not_found',
620
+ });
621
+ return;
622
+ }
623
+ const clientId = parseClientIdHeader(req, res);
624
+ if (clientId === null)
625
+ return;
626
+ // PR #4291 follow-up review (qwen-latest, N4): when the
627
+ // `callerIsInitiator` gate redacts the verification fields,
628
+ // operators triaging "SDK got HTTP 200 but no userCode" have
629
+ // zero signal in daemon stderr / audit. The redaction happens
630
+ // INSIDE the body shaper which doesn't have an audit sink, so
631
+ // the route handler is the right layer to record it. Use
632
+ // QWEN_SERVE_DEBUG-gated stderr (rather than unconditional
633
+ // audit) — multi-SDK setups sharing a bearer token will cause
634
+ // legitimate "different caller GETs same flow" traffic that
635
+ // would otherwise flood production logs. Operators who hit
636
+ // the symptom can flip QWEN_SERVE_DEBUG=1 and get the
637
+ // breadcrumb on the next reproduction.
638
+ const callerIsInitiator = (view.initiatorClientId === undefined && clientId === undefined) ||
639
+ (view.initiatorClientId !== undefined &&
640
+ clientId !== undefined &&
641
+ clientId === view.initiatorClientId);
642
+ if (!callerIsInitiator &&
643
+ process.env['QWEN_SERVE_DEBUG'] &&
644
+ !['0', 'false', 'off', 'no'].includes((process.env['QWEN_SERVE_DEBUG'] ?? '').trim().toLowerCase())) {
645
+ writeStderrLine(`qwen serve debug: GET /workspace/auth/device-flow/${id} redacted verification fields — caller-clientId mismatch (initiator=${view.initiatorClientId ?? 'anonymous'}, caller=${clientId ?? 'anonymous'})`);
646
+ }
647
+ res.status(200).json(toDeviceFlowStateBody(view, clientId));
648
+ });
649
+ app.delete('/workspace/auth/device-flow/:id', mutate({ strict: true }), (req, res) => {
650
+ const id = req.params['id'];
651
+ if (!id) {
652
+ res.status(404).json({
653
+ error: 'Device-flow id required',
654
+ code: 'device_flow_not_found',
655
+ });
656
+ return;
657
+ }
658
+ const clientId = parseClientIdHeader(req, res);
659
+ if (clientId === null)
660
+ return;
661
+ const result = deviceFlowRegistry.cancel(id, clientId);
662
+ if (result === undefined) {
663
+ res.status(404).json({
664
+ error: `Device-flow ${id} not found`,
665
+ code: 'device_flow_not_found',
666
+ });
667
+ return;
668
+ }
669
+ // Both freshly-cancelled and already-terminal are 204 (idempotent).
670
+ res.status(204).end();
671
+ });
672
+ app.get('/workspace/auth/status', (_req, res) => {
673
+ const pending = deviceFlowRegistry.listPending();
674
+ res.status(200).json({
675
+ v: 1,
676
+ workspaceCwd: boundWorkspace,
677
+ // GET /workspace/auth/status read-side intentionally minimal in
678
+ // this PR: a future PR can broaden the per-provider view (e.g.
679
+ // by reading SharedTokenManager.getCachedSnapshot for an `ok` /
680
+ // `expired` cell), but landing the additive route shape now
681
+ // unblocks SDK clients that need to know "is there a flow
682
+ // running?" without subscribing to SSE.
683
+ providers: [],
684
+ pendingDeviceFlows: pending.map((view) => ({
685
+ deviceFlowId: view.deviceFlowId,
686
+ providerId: view.providerId,
687
+ ...(view.expiresAt !== undefined ? { expiresAt: view.expiresAt } : {}),
688
+ })),
689
+ // PR #4255 round-12 #3: derive from runtime provider map so
690
+ // injected providers are surfaced. Single source of truth
691
+ // matches the POST validation above.
692
+ supportedDeviceFlowProviders: Array.from(deviceFlowProviderMap.keys()),
693
+ });
694
+ });
695
+ app.post('/session', mutate(), async (req, res) => {
696
+ const body = safeBody(req);
697
+ // #3803 §02: 1 daemon = 1 workspace. Three input shapes:
698
+ // - `cwd` ABSENT from body → fall back to the daemon's bound
699
+ // workspace (the §02 documented shape — clients pre-flight
700
+ // `caps.workspaceCwd` and may then omit `cwd`).
701
+ // - `cwd` PRESENT but not a string → 400 malformed. A
702
+ // client/orchestrator serialization bug (`cwd: null`,
703
+ // `cwd: 123`, `cwd: {}`) must not silently bind a session
704
+ // to the daemon's workspace; surface the bug instead.
705
+ // - `cwd` PRESENT as a string → fall through to the
706
+ // `path.isAbsolute` check (empty string and relative both
707
+ // fail there with "must be an absolute path when provided").
708
+ //
709
+ // `safeBody` returns an `Object.create(null)` map, so
710
+ // `'cwd' in body` reflects exactly "did the client send the
711
+ // key?" without prototype-chain confusion. The presence-check
712
+ // is safe as long as `PROTOTYPE_POLLUTION_KEYS` doesn't grow to
713
+ // include `cwd` — see the cross-reference in the const's JSDoc
714
+ // for what to do if that invariant ever has to break.
715
+ const hasCwd = 'cwd' in body;
716
+ if (hasCwd && typeof body['cwd'] !== 'string') {
717
+ res
718
+ .status(400)
719
+ .json({ error: '`cwd` must be a string absolute path when provided' });
720
+ return;
721
+ }
722
+ // Length cap BEFORE assignment so a multi-MB `cwd` body can't
723
+ // amplify through downstream interpolations
724
+ // (`WorkspaceMismatchError`'s `.message` echoes `requested` twice;
725
+ // `sendBridgeError` writes it to stderr; `res.json` echoes it
726
+ // again). On the loopback-default-no-token deployment shape this
727
+ // is pre-auth, so a 10 MB cwd body — right under
728
+ // `express.json({limit: '10mb'})` — would otherwise cost
729
+ // ~60 MB per request × `maxConnections` (default 256). The
730
+ // `MAX_WORKSPACE_PATH_LENGTH` constant matches Linux's PATH_MAX
731
+ // (4096); legitimate filesystem paths fit well under it. The
732
+ // `WorkspaceMismatchError` constructor also truncates as a
733
+ // belt-and-suspenders defense for non-route callers (tests,
734
+ // embeds, future entry points that throw the error directly).
735
+ if (hasCwd && body['cwd'].length > MAX_WORKSPACE_PATH_LENGTH) {
736
+ res.status(400).json({
737
+ error: `\`cwd\` exceeds the ${MAX_WORKSPACE_PATH_LENGTH}-character limit`,
738
+ });
739
+ return;
740
+ }
741
+ const cwd = hasCwd ? body['cwd'] : boundWorkspace;
742
+ if (!path.isAbsolute(cwd)) {
743
+ res
744
+ .status(400)
745
+ .json({ error: '`cwd` must be an absolute path when provided' });
746
+ return;
747
+ }
748
+ const modelServiceId = typeof body['modelServiceId'] === 'string'
749
+ ? body['modelServiceId']
750
+ : undefined;
751
+ // Per-request `sessionScope` override (#4175 PR 5). Validate at the
752
+ // route boundary so a 400 surfaces a clear `code: invalid_session_scope`
753
+ // before we touch the bridge — the bridge revalidates as a defense
754
+ // against direct callers, but a typed 4xx is the right shape for HTTP
755
+ // clients. The field is OPTIONAL: omitting it preserves pre-PR
756
+ // behavior bit-for-bit (the daemon-wide `BridgeOptions.sessionScope`
757
+ // takes effect). New clients can pre-flight `caps.features` for
758
+ // `session_scope_override` before sending — see
759
+ // `packages/cli/src/serve/capabilities.ts`.
760
+ const rawSessionScope = body['sessionScope'];
761
+ let sessionScope;
762
+ if (rawSessionScope !== undefined) {
763
+ if (rawSessionScope !== 'single' && rawSessionScope !== 'thread') {
764
+ res.status(400).json({
765
+ error: '`sessionScope` must be "single" or "thread" when provided',
766
+ code: 'invalid_session_scope',
767
+ });
768
+ return;
769
+ }
770
+ sessionScope = rawSessionScope;
771
+ }
772
+ const clientId = parseClientIdHeader(req, res);
773
+ if (clientId === null)
774
+ return;
775
+ try {
776
+ const session = await bridge.spawnOrAttach({
777
+ workspaceCwd: cwd,
778
+ modelServiceId,
779
+ ...(clientId !== undefined ? { clientId } : {}),
780
+ ...(sessionScope !== undefined ? { sessionScope } : {}),
781
+ });
782
+ // Client may have disconnected during the 1–3s spawn window. If
783
+ // so, the response can't be delivered. The session is otherwise
784
+ // orphaned (in `byId` / `defaultEntry` with no client knowing the
785
+ // id), and under churn this leaks one child per aborted request.
786
+ //
787
+ // Detect "can we still write the response?" via `res.writable`,
788
+ // which stays true until the SOCKET destination side closes
789
+ // (the right signal for our case). The legacy `req.aborted`
790
+ // only flips while the request body is still being received,
791
+ // so a client that completed the POST and then closed during
792
+ // the spawn would slip past it. `req.destroyed` is too eager
793
+ // — clients (incl. supertest) close their writable end after
794
+ // sending the body even though they're still listening for the
795
+ // response. `res.writable` is the documented signal for
796
+ // "ServerResponse can still send to client".
797
+ //
798
+ // Combined with `!session.attached` we only reap when WE spawned
799
+ // a fresh child for this request — if another client legitimately
800
+ // attached, killing it would tear out their work mid-flight.
801
+ // The disconnect-without-reap branch also needs to skip
802
+ // `res.json` — writing to a closed socket would throw EPIPE
803
+ // through Express's default error handler.
804
+ if (!res.writable) {
805
+ if (!session.attached) {
806
+ // `requireZeroAttaches: true` closes the BQ9tV race: if
807
+ // a second client called `spawnOrAttach` for the same
808
+ // workspace between our `await` resolving and this reap
809
+ // dispatching, the bridge will see `attachCount > 0` and
810
+ // skip the kill. Without the flag, that second client's
811
+ // session would die mid-prompt.
812
+ bridge
813
+ .killSession(session.sessionId, { requireZeroAttaches: true })
814
+ .catch(() => {
815
+ // Best-effort cleanup; channel.exited will eventually reap.
816
+ });
817
+ }
818
+ else {
819
+ // tanzhenxin issue 2: when an attaching client disconnects
820
+ // before its 200 response can be written, the
821
+ // `attachCount` bump we did inside `spawnOrAttach` is
822
+ // fictitious — there's no live attaching client. Roll the
823
+ // counter back and let the bridge decide whether to reap
824
+ // (it does if attachCount returns to 0 AND no live SSE
825
+ // subscribers). Without this, both-coalesced-callers-
826
+ // disconnect leaves an orphan agent child no client knows
827
+ // the id of.
828
+ bridge.detachClient(session.sessionId, session.clientId).catch(() => {
829
+ // Best-effort cleanup; channel.exited will eventually reap.
830
+ });
831
+ }
832
+ return;
833
+ }
834
+ res.status(200).json(session);
835
+ }
836
+ catch (err) {
837
+ sendBridgeError(res, err, { route: 'POST /session' });
838
+ }
839
+ });
840
+ const restoreSessionHandler = (action) => async (req, res) => {
841
+ const sessionId = req.params['id'];
842
+ if (!sessionId) {
843
+ res
844
+ .status(400)
845
+ .json({ error: '`sessionId` route parameter is required' });
846
+ return;
847
+ }
848
+ const body = safeBody(req);
849
+ const cwd = parseOptionalWorkspaceCwd(body, boundWorkspace, res);
850
+ if (cwd === undefined)
851
+ return;
852
+ const clientId = parseClientIdHeader(req, res);
853
+ if (clientId === null)
854
+ return;
855
+ try {
856
+ const session = action === 'load'
857
+ ? await bridge.loadSession({
858
+ sessionId,
859
+ workspaceCwd: cwd,
860
+ ...(clientId !== undefined ? { clientId } : {}),
861
+ })
862
+ : await bridge.resumeSession({
863
+ sessionId,
864
+ workspaceCwd: cwd,
865
+ ...(clientId !== undefined ? { clientId } : {}),
866
+ });
867
+ // Mirror the `POST /session` disconnect-cleanup path (see the
868
+ // long comment above the matching `if (!res.writable)` there
869
+ // for the rationale around `res.writable` vs `req.aborted` /
870
+ // `req.destroyed`, plus the BQ9tV `requireZeroAttaches` race
871
+ // and the tanzhenxin attach-rollback case). Restore needs the
872
+ // same cleanup because a client that disconnects during a
873
+ // multi-second `session/load` would otherwise leave a freshly
874
+ // restored session in `byId` with no client holding its id.
875
+ if (!res.writable) {
876
+ if (!session.attached) {
877
+ bridge
878
+ .killSession(session.sessionId, { requireZeroAttaches: true })
879
+ .catch(() => {
880
+ // Best-effort cleanup; channel.exited will eventually reap.
881
+ });
882
+ }
883
+ else {
884
+ bridge
885
+ .detachClient(session.sessionId, session.clientId)
886
+ .catch(() => {
887
+ // Best-effort cleanup; channel.exited will eventually reap.
888
+ });
889
+ }
890
+ return;
891
+ }
892
+ res.status(200).json(session);
893
+ }
894
+ catch (err) {
895
+ sendBridgeError(res, err, {
896
+ route: `POST /session/:id/${action}`,
897
+ sessionId,
898
+ });
899
+ }
900
+ };
901
+ app.post('/session/:id/load', mutate(), restoreSessionHandler('load'));
902
+ app.post('/session/:id/resume', mutate(), restoreSessionHandler('resume'));
903
+ app.get('/session/:id/context', async (req, res) => {
904
+ const sessionId = req.params['id'];
905
+ if (!sessionId) {
906
+ res
907
+ .status(400)
908
+ .json({ error: '`sessionId` route parameter is required' });
909
+ return;
910
+ }
911
+ try {
912
+ res.status(200).json(await bridge.getSessionContextStatus(sessionId));
913
+ }
914
+ catch (err) {
915
+ sendBridgeError(res, err, {
916
+ route: 'GET /session/:id/context',
917
+ sessionId,
918
+ });
919
+ }
920
+ });
921
+ app.get('/session/:id/supported-commands', async (req, res) => {
922
+ const sessionId = req.params['id'];
923
+ if (!sessionId) {
924
+ res
925
+ .status(400)
926
+ .json({ error: '`sessionId` route parameter is required' });
927
+ return;
928
+ }
929
+ try {
930
+ res
931
+ .status(200)
932
+ .json(await bridge.getSessionSupportedCommandsStatus(sessionId));
933
+ }
934
+ catch (err) {
935
+ sendBridgeError(res, err, {
936
+ route: 'GET /session/:id/supported-commands',
937
+ sessionId,
938
+ });
939
+ }
940
+ });
941
+ app.post('/session/:id/prompt', mutate(), async (req, res) => {
942
+ const sessionId = req.params['id'];
943
+ const body = safeBody(req);
944
+ const prompt = body['prompt'];
945
+ if (!Array.isArray(prompt) || prompt.length === 0) {
946
+ res.status(400).json({
947
+ error: '`prompt` is required and must be a non-empty array of content blocks',
948
+ });
949
+ return;
950
+ }
951
+ if (!prompt.every((item) =>
952
+ // `typeof item === 'object'` is true for arrays too, so an
953
+ // exclude-arrays check is needed to keep the contract
954
+ // ("ACP content block, like {type: 'text', text: '...'}")
955
+ // honest. Without `!Array.isArray(item)`, `prompt: [[]]`
956
+ // passes validation and a confusing 500 surfaces from the
957
+ // ACP SDK layer.
958
+ typeof item === 'object' && item !== null && !Array.isArray(item))) {
959
+ res.status(400).json({
960
+ error: 'each `prompt` element must be an object (content block)',
961
+ });
962
+ return;
963
+ }
964
+ // Propagate HTTP-client disconnect to an ACP cancel notification so
965
+ // the agent winds down promptly and the per-session FIFO doesn't
966
+ // stay blocked on a dead client. Detached after the prompt settles.
967
+ //
968
+ // Use `res.on('close')` (NOT `req.on('close')`) — `IncomingMessage`'s
969
+ // close event fires once the request body has been fully consumed
970
+ // even when the client is still listening for the response, which
971
+ // would cancel every ordinary prompt the moment its upload
972
+ // finished. `ServerResponse`'s close event only fires when the
973
+ // socket goes away. Guard with `!res.writableEnded` so a normal
974
+ // response flush (which also triggers `res.close`) doesn't fire
975
+ // the abort retroactively.
976
+ const abort = new AbortController();
977
+ const onResClose = () => {
978
+ if (!res.writableEnded)
979
+ abort.abort();
980
+ };
981
+ res.once('close', onResClose);
982
+ const clientId = parseClientIdHeader(req, res);
983
+ if (clientId === null) {
984
+ res.off('close', onResClose);
985
+ return;
986
+ }
987
+ try {
988
+ // SECURITY NOTE: this `...(body as object)` passthrough is
989
+ // intentional — the bridge / ACP SDK ignores fields it
990
+ // doesn't recognize (ACP-spec `_meta` etc are forwarded
991
+ // wholesale to the agent, which is the documented behavior).
992
+ // `sessionId` and `prompt` are forced to the route's view to
993
+ // prevent body-spoofing of the routing key. If a future
994
+ // bridge version starts trusting an additional field by name,
995
+ // that field becomes a client-controlled input surface — at
996
+ // that point switch this to an explicit pick. The same
997
+ // pattern repeats on cancel / model below; review them all
998
+ // together when adding new bridge-trusted fields.
999
+ const result = await bridge.sendPrompt(sessionId, {
1000
+ ...body,
1001
+ sessionId,
1002
+ prompt,
1003
+ }, abort.signal, clientId !== undefined ? { clientId } : undefined);
1004
+ res.status(200).json(result);
1005
+ }
1006
+ catch (err) {
1007
+ // The HTTP client disconnecting fires the abort path above and
1008
+ // the bridge re-throws as `AbortError`. That's a normal
1009
+ // wind-down, not an error worth a 500 + stderr stack trace.
1010
+ // Drop it silently — the socket is already closed so we can't
1011
+ // send a response anyway, and active clients (e.g. an IDE
1012
+ // plugin scrubbing a stuck prompt) would otherwise spam the
1013
+ // daemon log.
1014
+ //
1015
+ // BX9_k: narrow the swallow to ONLY the case where WE armed
1016
+ // the abort. The earlier blanket `err.name === 'AbortError'`
1017
+ // could also swallow an internal bridge abort (e.g. the child
1018
+ // process aborting a prompt mid-flight) — leaving the client
1019
+ // with no response and no log trace. If `abort.signal.aborted`
1020
+ // is false, the AbortError came from somewhere we didn't
1021
+ // expect → route it through `sendBridgeError` as a real
1022
+ // failure.
1023
+ if (err instanceof DOMException &&
1024
+ err.name === 'AbortError' &&
1025
+ abort.signal.aborted) {
1026
+ return;
1027
+ }
1028
+ sendBridgeError(res, err, {
1029
+ route: 'POST /session/:id/prompt',
1030
+ sessionId,
1031
+ });
1032
+ }
1033
+ finally {
1034
+ res.off('close', onResClose);
1035
+ }
1036
+ });
1037
+ app.post('/session/:id/heartbeat', mutate(), (req, res) => {
1038
+ // #4175 PR 9: clients ping the daemon to update last-seen
1039
+ // bookkeeping. Bridge throws `SessionNotFoundError` for unknown
1040
+ // ids and `InvalidClientIdError` when an `X-Qwen-Client-Id`
1041
+ // header is supplied but not registered for this session — both
1042
+ // are routed through `sendBridgeError` so they share the same
1043
+ // typed shape (`404` and `400 invalid_client_id`) the rest of
1044
+ // the routes use.
1045
+ const sessionId = req.params['id'];
1046
+ if (!sessionId) {
1047
+ res
1048
+ .status(400)
1049
+ .json({ error: '`sessionId` route parameter is required' });
1050
+ return;
1051
+ }
1052
+ const clientId = parseClientIdHeader(req, res);
1053
+ if (clientId === null)
1054
+ return;
1055
+ try {
1056
+ const result = bridge.recordHeartbeat(sessionId, clientId !== undefined ? { clientId } : undefined);
1057
+ res.status(200).json(result);
1058
+ }
1059
+ catch (err) {
1060
+ sendBridgeError(res, err, {
1061
+ route: 'POST /session/:id/heartbeat',
1062
+ sessionId,
1063
+ });
1064
+ }
1065
+ });
1066
+ app.post('/session/:id/cancel', mutate(), async (req, res) => {
1067
+ const sessionId = req.params['id'];
1068
+ const body = safeBody(req);
1069
+ const clientId = parseClientIdHeader(req, res);
1070
+ if (clientId === null)
1071
+ return;
1072
+ try {
1073
+ await bridge.cancelSession(sessionId, {
1074
+ ...body,
1075
+ sessionId,
1076
+ }, clientId !== undefined ? { clientId } : undefined);
1077
+ res.status(204).end();
1078
+ }
1079
+ catch (err) {
1080
+ sendBridgeError(res, err, {
1081
+ route: 'POST /session/:id/cancel',
1082
+ sessionId,
1083
+ });
1084
+ }
1085
+ });
1086
+ app.delete('/session/:id', async (req, res) => {
1087
+ const sessionId = req.params['id'];
1088
+ const clientId = parseClientIdHeader(req, res);
1089
+ if (clientId === null)
1090
+ return;
1091
+ try {
1092
+ await bridge.closeSession(sessionId, clientId !== undefined ? { clientId } : undefined);
1093
+ res.status(204).end();
1094
+ }
1095
+ catch (err) {
1096
+ sendBridgeError(res, err, {
1097
+ route: 'DELETE /session/:id',
1098
+ sessionId,
1099
+ });
1100
+ }
1101
+ });
1102
+ app.patch('/session/:id/metadata', (req, res) => {
1103
+ const sessionId = req.params['id'];
1104
+ const body = safeBody(req);
1105
+ const clientId = parseClientIdHeader(req, res);
1106
+ if (clientId === null)
1107
+ return;
1108
+ const displayName = body['displayName'];
1109
+ if (displayName !== undefined && typeof displayName !== 'string') {
1110
+ res.status(400).json({
1111
+ error: '`displayName` must be a string',
1112
+ code: 'invalid_metadata',
1113
+ field: 'displayName',
1114
+ });
1115
+ return;
1116
+ }
1117
+ try {
1118
+ const effective = bridge.updateSessionMetadata(sessionId, { displayName }, clientId !== undefined ? { clientId } : undefined);
1119
+ res.status(200).json({ sessionId, ...effective });
1120
+ }
1121
+ catch (err) {
1122
+ sendBridgeError(res, err, {
1123
+ route: 'PATCH /session/:id/metadata',
1124
+ sessionId,
1125
+ });
1126
+ }
1127
+ });
1128
+ app.get('/workspace/:id/sessions', (req, res) => {
1129
+ // Express decodes URL-encoded path params automatically; clients pass
1130
+ // the absolute workspace cwd encoded (e.g.
1131
+ // GET /workspace/%2Fwork%2Fa/sessions).
1132
+ const workspaceCwd = req.params['id'] ?? '';
1133
+ if (!path.isAbsolute(workspaceCwd)) {
1134
+ res
1135
+ .status(400)
1136
+ .json({ error: '`:id` must decode to an absolute workspace path' });
1137
+ return;
1138
+ }
1139
+ // #3803 §02: reject cross-workspace queries so orchestrators
1140
+ // don't mistake "no sessions here" for "workspace is idle".
1141
+ const key = canonicalizeWorkspace(workspaceCwd);
1142
+ if (key !== boundWorkspace) {
1143
+ res.status(400).json({
1144
+ error: `Workspace mismatch: daemon is bound to "${boundWorkspace}"`,
1145
+ code: 'workspace_mismatch',
1146
+ boundWorkspace,
1147
+ requestedWorkspace: key,
1148
+ });
1149
+ return;
1150
+ }
1151
+ const sessions = bridge.listWorkspaceSessions(workspaceCwd);
1152
+ res.status(200).json({ sessions });
1153
+ });
1154
+ app.post('/session/:id/model', mutate(), async (req, res) => {
1155
+ const sessionId = req.params['id'];
1156
+ const body = safeBody(req);
1157
+ const modelId = body['modelId'];
1158
+ if (typeof modelId !== 'string' || !modelId) {
1159
+ res.status(400).json({
1160
+ error: '`modelId` is required and must be a non-empty string',
1161
+ });
1162
+ return;
1163
+ }
1164
+ const clientId = parseClientIdHeader(req, res);
1165
+ if (clientId === null)
1166
+ return;
1167
+ try {
1168
+ const response = await bridge.setSessionModel(sessionId, {
1169
+ ...body,
1170
+ sessionId,
1171
+ modelId,
1172
+ }, clientId !== undefined ? { clientId } : undefined);
1173
+ res.status(200).json(response);
1174
+ }
1175
+ catch (err) {
1176
+ sendBridgeError(res, err, {
1177
+ route: 'POST /session/:id/model',
1178
+ sessionId,
1179
+ });
1180
+ }
1181
+ });
1182
+ app.post('/session/:id/approval-mode', mutate({ strict: true }), async (req, res) => {
1183
+ // #4175 Wave 4 PR 17 — first strict-gated session mutation
1184
+ // surface after PR 14 v1. Validates `mode` against the closed
1185
+ // `APPROVAL_MODES` enum and an optional `persist: boolean` flag.
1186
+ // The bridge applies the change inside the ACP child's per-session
1187
+ // `Config` and (when `persist: true`) writes `tools.approvalMode`
1188
+ // to workspace settings via the `persistApprovalMode` hook wired
1189
+ // in `runQwenServe.ts`.
1190
+ const sessionId = req.params['id'];
1191
+ const body = safeBody(req);
1192
+ const mode = body['mode'];
1193
+ const persist = body['persist'];
1194
+ if (typeof mode !== 'string' ||
1195
+ !APPROVAL_MODES.includes(mode)) {
1196
+ res.status(400).json({
1197
+ error: '`mode` is required and must be one of the allowed values',
1198
+ code: 'invalid_approval_mode',
1199
+ allowed: APPROVAL_MODES,
1200
+ });
1201
+ return;
1202
+ }
1203
+ if (persist !== undefined && typeof persist !== 'boolean') {
1204
+ res.status(400).json({
1205
+ error: '`persist` must be a boolean when provided',
1206
+ code: 'invalid_persist_flag',
1207
+ });
1208
+ return;
1209
+ }
1210
+ const clientId = parseClientIdHeader(req, res);
1211
+ if (clientId === null)
1212
+ return;
1213
+ try {
1214
+ const response = await bridge.setSessionApprovalMode(sessionId, mode, { persist: persist === true }, clientId !== undefined ? { clientId } : undefined);
1215
+ res.status(200).json(response);
1216
+ }
1217
+ catch (err) {
1218
+ sendBridgeError(res, err, {
1219
+ route: 'POST /session/:id/approval-mode',
1220
+ sessionId,
1221
+ });
1222
+ }
1223
+ });
1224
+ app.post('/workspace/mcp/:server/restart', mutate({ strict: true }), async (req, res) => {
1225
+ // #4175 Wave 4 PR 17. Forwards through the ACP child's
1226
+ // `McpClientManager.discoverMcpToolsForServer` after a budget
1227
+ // pre-check on PR 14 v1's accounting. Soft refusals are 200 OK
1228
+ // with `{restarted:false, skipped:true, reason}`; unknown server
1229
+ // names or no live ACP channel are hard errors mapped to 4xx/5xx
1230
+ // via sendBridgeError.
1231
+ const serverName = req.params['server'];
1232
+ if (!serverName || typeof serverName !== 'string') {
1233
+ res.status(400).json({
1234
+ error: 'Server name path parameter is required',
1235
+ code: 'invalid_server_name',
1236
+ });
1237
+ return;
1238
+ }
1239
+ // #4282 fold-in 4 (qwen-latest S1): match the
1240
+ // `MAX_TOOL_NAME_LENGTH` cap so the server name (which propagates
1241
+ // into SSE event bodies, ACP messages, and error responses) can't
1242
+ // be used to bloat any of those surfaces with an unbounded
1243
+ // path-parameter input.
1244
+ if (serverName.length > MAX_SERVER_NAME_LENGTH) {
1245
+ res.status(400).json({
1246
+ error: `Server name exceeds ${MAX_SERVER_NAME_LENGTH}-character limit`,
1247
+ code: 'invalid_server_name',
1248
+ });
1249
+ return;
1250
+ }
1251
+ // #4282 fold-in 1 (gpt-5.5 C2): validate `X-Qwen-Client-Id`
1252
+ // against `bridge.knownClientIds()` so the originator stamped
1253
+ // onto `mcp_server_restart*` events is grounded in a known
1254
+ // identity rather than a forged header.
1255
+ const clientId = parseAndValidateWorkspaceClientId(req, res, bridge);
1256
+ if (clientId === null)
1257
+ return;
1258
+ try {
1259
+ const result = await bridge.restartMcpServer(serverName, clientId);
1260
+ res.status(200).json(result);
1261
+ }
1262
+ catch (err) {
1263
+ sendBridgeError(res, err, {
1264
+ route: 'POST /workspace/mcp/:server/restart',
1265
+ });
1266
+ }
1267
+ });
1268
+ app.post('/workspace/init', mutate({ strict: true }), async (req, res) => {
1269
+ // #4175 Wave 4 PR 17. Scaffold-only init: the bridge writes an
1270
+ // empty QWEN.md without invoking the LLM. Default refuses
1271
+ // overwrite (409); body `{force: true}` overrides.
1272
+ const body = safeBody(req);
1273
+ const force = body['force'];
1274
+ if (force !== undefined && typeof force !== 'boolean') {
1275
+ res.status(400).json({
1276
+ error: '`force` must be a boolean when provided',
1277
+ code: 'invalid_force_flag',
1278
+ });
1279
+ return;
1280
+ }
1281
+ // #4282 fold-in 1 (gpt-5.5 C2): validate against known client ids.
1282
+ const clientId = parseAndValidateWorkspaceClientId(req, res, bridge);
1283
+ if (clientId === null)
1284
+ return;
1285
+ try {
1286
+ const result = await bridge.initWorkspace({ force: force === true }, clientId);
1287
+ res.status(200).json(result);
1288
+ }
1289
+ catch (err) {
1290
+ sendBridgeError(res, err, { route: 'POST /workspace/init' });
1291
+ }
1292
+ });
1293
+ app.post('/workspace/tools/:name/enable', mutate({ strict: true }), async (req, res) => {
1294
+ // #4175 Wave 4 PR 17. Toggles a tool name in the workspace
1295
+ // `tools.disabled` settings list. Strict-gated alongside other
1296
+ // Wave 4 mutation routes; bridge writes the file directly (no
1297
+ // ACP roundtrip) and fan-outs `tool_toggled` to every live
1298
+ // session SSE bus. Already-registered tools in live sessions
1299
+ // are NOT retroactively unregistered — toggling takes effect on
1300
+ // the next ACP child spawn or session refresh.
1301
+ const rawToolName = req.params['name'];
1302
+ if (!rawToolName || typeof rawToolName !== 'string') {
1303
+ res.status(400).json({
1304
+ error: 'Tool name path parameter is required',
1305
+ code: 'invalid_tool_name',
1306
+ });
1307
+ return;
1308
+ }
1309
+ // #4282 fold-in 4 (qwen-latest C3): trim before persistence so the
1310
+ // write path matches the read path. `loadCliConfig` applies
1311
+ // `.trim()` when consuming `tools.disabled` at child spawn, so a
1312
+ // leading/trailing space stored verbatim would never round-trip:
1313
+ // disable would persist `" Bash "`, the spawn would key on
1314
+ // `"Bash"`, and a re-enable for `"Bash"` would leave the original
1315
+ // entry permanently stuck.
1316
+ const toolName = rawToolName.trim();
1317
+ if (toolName.length === 0) {
1318
+ res.status(400).json({
1319
+ error: 'Tool name path parameter is required',
1320
+ code: 'invalid_tool_name',
1321
+ });
1322
+ return;
1323
+ }
1324
+ // #4282 fold-in 2 (deepseek SV1): cap the tool name length so
1325
+ // an extremely long path parameter can't bloat the workspace
1326
+ // settings file. Sized at 256 to comfortably accommodate the
1327
+ // longest legitimate MCP qualified names
1328
+ // (`mcp__<server>__<tool>`) while staying well under any
1329
+ // settings-file pathological-input concern. Mirrors the
1330
+ // explicit caps on `cwd` (`MAX_WORKSPACE_PATH_LENGTH`) and
1331
+ // `X-Qwen-Client-Id` (`MAX_CLIENT_ID_LENGTH`).
1332
+ if (toolName.length > MAX_TOOL_NAME_LENGTH) {
1333
+ res.status(400).json({
1334
+ error: `Tool name exceeds ${MAX_TOOL_NAME_LENGTH}-character limit`,
1335
+ code: 'invalid_tool_name',
1336
+ });
1337
+ return;
1338
+ }
1339
+ const body = safeBody(req);
1340
+ const enabled = body['enabled'];
1341
+ if (typeof enabled !== 'boolean') {
1342
+ res.status(400).json({
1343
+ error: '`enabled` is required and must be a boolean',
1344
+ code: 'invalid_enabled_flag',
1345
+ });
1346
+ return;
1347
+ }
1348
+ // #4282 fold-in 1 (gpt-5.5 C2): validate against known client ids.
1349
+ const clientId = parseAndValidateWorkspaceClientId(req, res, bridge);
1350
+ if (clientId === null)
1351
+ return;
1352
+ try {
1353
+ const result = await bridge.setWorkspaceToolEnabled(toolName, enabled, clientId);
1354
+ res.status(200).json(result);
1355
+ }
1356
+ catch (err) {
1357
+ sendBridgeError(res, err, {
1358
+ route: 'POST /workspace/tools/:name/enable',
1359
+ });
1360
+ }
1361
+ });
1362
+ app.post('/session/:id/permission/:requestId', mutate(), (req, res) => {
1363
+ const sessionId = req.params['id'];
1364
+ const requestId = req.params['requestId'];
1365
+ const response = parsePermissionVoteBody(req, res);
1366
+ if (response === undefined)
1367
+ return;
1368
+ const clientId = parseClientIdHeader(req, res);
1369
+ if (clientId === null)
1370
+ return;
1371
+ let accepted;
1372
+ try {
1373
+ accepted = bridge.respondToSessionPermission(sessionId, requestId, response, clientId !== undefined ? { clientId } : undefined);
1374
+ }
1375
+ catch (err) {
1376
+ sendPermissionVoteError(res, err, {
1377
+ route: 'POST /session/:id/permission/:requestId',
1378
+ sessionId,
1379
+ });
1380
+ return;
1381
+ }
1382
+ if (!accepted) {
1383
+ res.status(404).json({
1384
+ error: 'No pending permission request for session',
1385
+ sessionId,
1386
+ requestId,
1387
+ });
1388
+ return;
1389
+ }
1390
+ res.status(200).json({});
1391
+ });
1392
+ app.post('/permission/:requestId', mutate(), (req, res) => {
1393
+ const requestId = req.params['requestId'];
1394
+ const response = parsePermissionVoteBody(req, res);
1395
+ if (response === undefined)
1396
+ return;
1397
+ const clientId = parseClientIdHeader(req, res);
1398
+ if (clientId === null)
1399
+ return;
1400
+ let accepted;
1401
+ try {
1402
+ accepted = bridge.respondToPermission(requestId, response, clientId !== undefined ? { clientId } : undefined);
1403
+ }
1404
+ catch (err) {
1405
+ sendPermissionVoteError(res, err, {
1406
+ route: 'POST /permission/:requestId',
1407
+ });
1408
+ return;
1409
+ }
1410
+ if (!accepted) {
1411
+ // Either the requestId never existed or another client already won
1412
+ // the race. Stage 1 doesn't distinguish — both surface as 404.
1413
+ res
1414
+ .status(404)
1415
+ .json({ error: 'No pending permission request', requestId });
1416
+ return;
1417
+ }
1418
+ res.status(200).json({});
1419
+ });
1420
+ app.get('/session/:id/events', (req, res) => {
1421
+ const sessionId = req.params['id'];
1422
+ const lastEventId = parseLastEventId(req.headers['last-event-id']);
1423
+ const maxQueued = parseMaxQueuedQuery(req.query['maxQueued'], res);
1424
+ // `parseMaxQueuedQuery` sends its own 400 + JSON body on rejection
1425
+ // (returns `null`) so the SSE handshake doesn't get half-written.
1426
+ // `undefined` means "client didn't ask for an override; use bus
1427
+ // default 256" — proceed as before.
1428
+ if (maxQueued === null)
1429
+ return;
1430
+ let iter;
1431
+ const abort = new AbortController();
1432
+ try {
1433
+ const iterable = bridge.subscribeEvents(sessionId, {
1434
+ signal: abort.signal,
1435
+ lastEventId,
1436
+ ...(maxQueued !== undefined ? { maxQueued } : {}),
1437
+ });
1438
+ iter = iterable[Symbol.asyncIterator]();
1439
+ }
1440
+ catch (err) {
1441
+ // `EventBus` throws `SubscriberLimitExceededError` when the
1442
+ // per-session subscriber cap (default 64) is reached.
1443
+ //
1444
+ // Bd1zJ: surface as `429 Too Many Requests` + `Retry-After`
1445
+ // header rather than `200 + stream_error`. The previous
1446
+ // SSE-shaped response triggered `EventSource`'s
1447
+ // auto-reconnect (which honors the `retry:` directive AND
1448
+ // default-reconnects on any closed stream). The reconnect hit
1449
+ // the same cap, looped, amplifying the exact load the limit
1450
+ // exists to prevent.
1451
+ //
1452
+ // `429` is the standard "back off" signal — browsers'
1453
+ // `EventSource` treats `4xx` as terminal and does NOT
1454
+ // auto-reconnect on it, unlike `200 + close` which DOES
1455
+ // reconnect. Body shape mirrors the SSE frame's data field so
1456
+ // a raw-fetch client gets the same structured error.
1457
+ if (err instanceof SubscriberLimitExceededError) {
1458
+ writeStderrLine(`qwen serve: subscriber limit reached for session ${sessionId} (limit=${err.limit}); rejecting new SSE client with 429`);
1459
+ res.setHeader('Retry-After', '5');
1460
+ res.status(429).json({
1461
+ error: err.message,
1462
+ code: 'subscriber_limit_exceeded',
1463
+ limit: err.limit,
1464
+ });
1465
+ return;
1466
+ }
1467
+ sendBridgeError(res, err, {
1468
+ route: 'GET /session/:id/events',
1469
+ sessionId,
1470
+ });
1471
+ return;
1472
+ }
1473
+ res.status(200);
1474
+ res.setHeader('Content-Type', 'text/event-stream');
1475
+ res.setHeader('Cache-Control', 'no-cache, no-transform');
1476
+ res.setHeader('Connection', 'keep-alive');
1477
+ // Disable proxy buffering (nginx); event-stream content type alone
1478
+ // doesn't always reach the client through every proxy.
1479
+ res.setHeader('X-Accel-Buffering', 'no');
1480
+ // Always present on the supported Node versions (engines.node >=22).
1481
+ res.flushHeaders();
1482
+ // Backpressure helper: `res.write` returns false when the kernel send
1483
+ // buffer is full. Without awaiting `drain` Node accumulates the
1484
+ // payload in user-space memory unboundedly — a slow consumer on a
1485
+ // chatty session can balloon daemon RSS. Wait for `drain` (or
1486
+ // close/error) before scheduling the next write.
1487
+ //
1488
+ // Concurrency: serialize ALL writes through a per-connection chain
1489
+ // so the heartbeat (fire-and-forget interval, see below) can't
1490
+ // interleave with the main event-write loop. Without serialization,
1491
+ // the heartbeat firing while the main loop is mid-`drain` await
1492
+ // would issue a second `res.write()` that bypasses the
1493
+ // backpressure guard — and could even interleave bytes between two
1494
+ // SSE frames on the wire. The chain is single-flight: each call
1495
+ // waits for the previous write to settle before scheduling its own.
1496
+ let writeChain = Promise.resolve();
1497
+ const doWrite = (chunk) => new Promise((resolve, reject) => {
1498
+ if (res.writableEnded) {
1499
+ resolve();
1500
+ return;
1501
+ }
1502
+ // `res.write` can throw synchronously when the socket is
1503
+ // already destroyed (typical EPIPE shape). Wrap in try/catch
1504
+ // so that surfaces as a rejection on this promise instead of
1505
+ // escaping the executor and turning into an unhandled
1506
+ // exception. Async failures still arrive via the `'error'`
1507
+ // event handler below — Node's Writable.write callback isn't
1508
+ // documented to receive an error argument (errors come on
1509
+ // the event), so we don't rely on it.
1510
+ let ok;
1511
+ try {
1512
+ ok = res.write(chunk);
1513
+ }
1514
+ catch (err) {
1515
+ reject(err);
1516
+ return;
1517
+ }
1518
+ if (ok) {
1519
+ resolve();
1520
+ return;
1521
+ }
1522
+ const onDrain = () => {
1523
+ res.off('close', onClose);
1524
+ res.off('error', onError);
1525
+ resolve();
1526
+ };
1527
+ const onClose = () => {
1528
+ res.off('drain', onDrain);
1529
+ res.off('error', onError);
1530
+ resolve();
1531
+ };
1532
+ const onError = (err) => {
1533
+ res.off('drain', onDrain);
1534
+ res.off('close', onClose);
1535
+ reject(err);
1536
+ };
1537
+ res.once('drain', onDrain);
1538
+ res.once('close', onClose);
1539
+ res.once('error', onError);
1540
+ });
1541
+ const writeWithBackpressure = (chunk) => {
1542
+ const next = writeChain.then(() => doWrite(chunk));
1543
+ // Tail-swallow rejections on the chain itself so a single failed
1544
+ // write doesn't poison every subsequent call. The CALLER's
1545
+ // returned promise still rejects — chain-internal failures are
1546
+ // someone else's problem, not blockers for queueing.
1547
+ writeChain = next.catch(() => undefined);
1548
+ return next;
1549
+ };
1550
+ // Tell EventSource to retry after 3s on disconnect. Awaiting drain on
1551
+ // the very first write is overkill but cheap — `ok` is true the
1552
+ // overwhelming majority of the time. Always swallow rejection: a
1553
+ // socket that errors before the very first write would otherwise
1554
+ // surface as an unhandled promise rejection (the `res.on('error')`
1555
+ // hook below is what we actually rely on for cleanup).
1556
+ void writeWithBackpressure('retry: 3000\n\n').catch(() => { });
1557
+ // Heartbeat keeps NAT/proxy connections alive and lets the server
1558
+ // notice a dead client through write-back-pressure. Comment frame is
1559
+ // ignored by EventSource.
1560
+ //
1561
+ // KNOWN GAP: this only catches dead connections via write
1562
+ // back-pressure on heartbeat itself. A network partition without TCP
1563
+ // RST can leave the connection looking alive (no FIN received) for
1564
+ // however long Node's keepalive probes take to time out — usually
1565
+ // ~2 hours by default, configurable via `server.keepAliveTimeout`.
1566
+ // Stage 2 may add an explicit application-level idle timeout
1567
+ // (last-byte-written tracking + per-connection deadline).
1568
+ const heartbeatTimer = setInterval(() => {
1569
+ if (!res.writableEnded) {
1570
+ // Heartbeat writes are best-effort; failure swallowed via the
1571
+ // `res.on('error')` hook below.
1572
+ void writeWithBackpressure(': heartbeat\n\n').catch(() => { });
1573
+ }
1574
+ }, 15_000);
1575
+ heartbeatTimer.unref();
1576
+ const cleanup = () => {
1577
+ clearInterval(heartbeatTimer);
1578
+ abort.abort();
1579
+ };
1580
+ req.on('close', cleanup);
1581
+ // Swallow socket-level write errors. When the underlying TCP connection
1582
+ // dies (RST, mid-flight kill -9), the next `res.write` throws EPIPE.
1583
+ // Without an `error` listener Express forwards it to its default error
1584
+ // handler which logs noisily. The req.on('close') path above is what we
1585
+ // actually rely on to tear down the subscription; this listener just
1586
+ // suppresses the noise + ensures cleanup runs even if for some reason
1587
+ // the close event doesn't fire first.
1588
+ res.on('error', (err) => {
1589
+ // Without this log the daemon side is blind to SSE disconnects
1590
+ // (RST, mid-flight kill -9, network blip). Cleanup still runs —
1591
+ // the listener exists primarily so Node doesn't crash on EPIPE
1592
+ // — but operators get a breadcrumb when chasing flaky clients.
1593
+ writeStderrLine(`qwen serve: SSE socket error (session ${sessionId}): ${err.message}`);
1594
+ cleanup();
1595
+ });
1596
+ void (async () => {
1597
+ try {
1598
+ while (true) {
1599
+ const next = await iter.next();
1600
+ if (next.done)
1601
+ break;
1602
+ if (res.writableEnded)
1603
+ break;
1604
+ await writeWithBackpressure(formatSseFrame(next.value));
1605
+ }
1606
+ }
1607
+ catch (err) {
1608
+ if (!res.writableEnded) {
1609
+ // Don't burn an `id:` slot — `stream_error` is a terminal frame
1610
+ // emitted on the daemon side when the bridge iterator throws, so
1611
+ // it has no place in the per-session monotonic sequence and a
1612
+ // hard-coded `id: 0` would regress the client's `Last-Event-ID`
1613
+ // tracker. `formatSseFrame` omits the `id:` line when the input
1614
+ // event has no id.
1615
+ await writeWithBackpressure(formatSseFrame({
1616
+ v: 1,
1617
+ type: 'stream_error',
1618
+ data: { error: errorMessage(err) },
1619
+ })).catch(() => { });
1620
+ }
1621
+ }
1622
+ finally {
1623
+ cleanup();
1624
+ if (!res.writableEnded)
1625
+ res.end();
1626
+ }
1627
+ })();
1628
+ });
1629
+ // Final error handler. `express.json()` throws `SyntaxError` (with
1630
+ // `status: 400`) on malformed body — without this 4-arg middleware
1631
+ // Express renders an HTML error page, which trips SDK clients that
1632
+ // expect a JSON body on every response. Anything else bubbling out
1633
+ // is a programmer error; log it and return a JSON 500 (matches the
1634
+ // route-level `sendBridgeError` shape so clients have one error
1635
+ // contract to parse).
1636
+ app.use((err, _req, res, _next) => {
1637
+ if (err instanceof SyntaxError &&
1638
+ 'status' in err &&
1639
+ err.status === 400) {
1640
+ res.status(400).json({ error: 'Invalid JSON in request body' });
1641
+ return;
1642
+ }
1643
+ // body-parser raises a typed error with `status: 413` when a
1644
+ // request body exceeds the `express.json({ limit: '10mb' })`
1645
+ // ceiling. Without this branch it falls through to the 500 path
1646
+ // and clients see a misleading "Internal server error" instead
1647
+ // of a clear "payload too large" — which is the kind of error
1648
+ // they can actually act on (chunk the request, raise the limit).
1649
+ if (err &&
1650
+ typeof err === 'object' &&
1651
+ 'status' in err &&
1652
+ err.status === 413) {
1653
+ res.status(413).json({ error: 'Request body too large (max 10 MB)' });
1654
+ return;
1655
+ }
1656
+ writeStderrLine(`qwen serve: unhandled error: ${err instanceof Error ? (err.stack ?? err.message) : String(err)}`);
1657
+ if (!res.headersSent) {
1658
+ res.status(500).json({ error: 'Internal server error' });
1659
+ }
1660
+ });
1661
+ return app;
1662
+ }
1663
+ /**
1664
+ * Keys stripped by `safeBody` to defend against prototype-pollution
1665
+ * — see BZ9uv/va/vs/wD/Bd1zz. Routes downstream of `safeBody` spread
1666
+ * the filtered result into objects passed to the bridge / ACP SDK;
1667
+ * without this scrub a client could set
1668
+ * `{"__proto__": {"polluted": true}}` and pollute
1669
+ * `Object.prototype` via downstream spreads.
1670
+ *
1671
+ * **Cross-reference for route maintainers:** the POST `/session`
1672
+ * route distinguishes "absent" from "present" via `'cwd' in body`
1673
+ * against `safeBody`'s output. The semantics rely on this set NOT
1674
+ * overlapping with user-payload keys. If you ever add a key here
1675
+ * that a route's presence-check cares about (highly unlikely — this
1676
+ * set is the JS prototype-attack triple, plus a route would have
1677
+ * to deliberately name a property after one of these), the
1678
+ * presence-check needs to move to the pre-`safeBody` `req.body`
1679
+ * (with its own pollution guard) or `safeBody` needs to return a
1680
+ * separate "raw-keys" set alongside the filtered object.
1681
+ */
1682
+ const PROTOTYPE_POLLUTION_KEYS = new Set([
1683
+ '__proto__',
1684
+ 'constructor',
1685
+ 'prototype',
1686
+ ]);
1687
+ const CLIENT_ID_HEADER = 'x-qwen-client-id';
1688
+ const MAX_CLIENT_ID_LENGTH = 128;
1689
+ /** #4282 fold-in 2 (deepseek SV1) — see /workspace/tools/:name/enable. */
1690
+ const MAX_TOOL_NAME_LENGTH = 256;
1691
+ /** #4282 fold-in 4 (qwen-latest S1) — see /workspace/mcp/:server/restart. */
1692
+ const MAX_SERVER_NAME_LENGTH = 256;
1693
+ const CLIENT_ID_RE = /^[A-Za-z0-9._:-]+$/;
1694
+ const INVALID_PERMISSION_OUTCOME_ERROR = '`outcome` must be `{ outcome: "cancelled" }` or `{ outcome: "selected", optionId: string }`';
1695
+ /**
1696
+ * Coerce `req.body` into a safe `Record<string, unknown>` for route
1697
+ * handlers. Replaces the 5-site copy-pasted preamble
1698
+ * `typeof req.body === 'object' && req.body !== null ? ... : {}`
1699
+ * (Bd10m).
1700
+ *
1701
+ * Strips the `PROTOTYPE_POLLUTION_KEYS` set before returning. Uses an
1702
+ * `Object.create(null)` target so the returned object itself has no
1703
+ * prototype either, blocking second-order spread-into-default-
1704
+ * prototype attacks.
1705
+ */
1706
+ function safeBody(req) {
1707
+ const raw = req.body;
1708
+ if (typeof raw !== 'object' || raw === null || Array.isArray(raw)) {
1709
+ return Object.create(null);
1710
+ }
1711
+ const out = Object.create(null);
1712
+ for (const [key, value] of Object.entries(raw)) {
1713
+ if (PROTOTYPE_POLLUTION_KEYS.has(key))
1714
+ continue;
1715
+ out[key] = value;
1716
+ }
1717
+ return out;
1718
+ }
1719
+ function parseOptionalWorkspaceCwd(body, boundWorkspace, res) {
1720
+ const hasCwd = 'cwd' in body;
1721
+ if (hasCwd && typeof body['cwd'] !== 'string') {
1722
+ res
1723
+ .status(400)
1724
+ .json({ error: '`cwd` must be a string absolute path when provided' });
1725
+ return undefined;
1726
+ }
1727
+ if (hasCwd && body['cwd'].length > MAX_WORKSPACE_PATH_LENGTH) {
1728
+ res.status(400).json({
1729
+ error: `\`cwd\` exceeds the ${MAX_WORKSPACE_PATH_LENGTH}-character limit`,
1730
+ });
1731
+ return undefined;
1732
+ }
1733
+ const cwd = hasCwd ? body['cwd'] : boundWorkspace;
1734
+ if (!path.isAbsolute(cwd)) {
1735
+ res
1736
+ .status(400)
1737
+ .json({ error: '`cwd` must be an absolute path when provided' });
1738
+ return undefined;
1739
+ }
1740
+ return cwd;
1741
+ }
1742
+ /**
1743
+ * PR 21 — translate the registry's redacted `DeviceFlowPublicView` into
1744
+ * the wire shape declared by `DaemonDeviceFlowStartResult`. Splitting
1745
+ * "start response" from "state body" preserves the `attached` field
1746
+ * the start route needs without polluting the GET shape.
1747
+ */
1748
+ function toDeviceFlowStartResponseBody(view, attached, callerClientId) {
1749
+ const body = {
1750
+ deviceFlowId: view.deviceFlowId,
1751
+ providerId: view.providerId,
1752
+ status: view.status,
1753
+ expiresAt: view.expiresAt ?? 0,
1754
+ intervalMs: view.intervalMs ?? 0,
1755
+ attached,
1756
+ };
1757
+ // PR #4291 follow-up review (gpt-5.5, #3): policy consistency with
1758
+ // `toDeviceFlowStateBody` — only the original starter sees the
1759
+ // verification material. Earlier shape unconditionally returned
1760
+ // `userCode` / `verificationUri` / `verificationUriComplete` on
1761
+ // every POST, including the `attached: true` take-over case, so any
1762
+ // bearer-token holder that POSTed `providerId: <existing>` got the
1763
+ // verification code another client started. That bypassed the
1764
+ // closed-out GET redaction completely. Apply the same gate here.
1765
+ // Fresh starts naturally pass the gate because `view.initiatorClientId`
1766
+ // was set from the same `callerClientId` on this very request.
1767
+ // Take-over callers that don't match the initiator now see the
1768
+ // public envelope only. The both-undefined branch preserves the
1769
+ // anonymous-start → anonymous-reattach use case.
1770
+ const callerIsInitiator = (view.initiatorClientId === undefined && callerClientId === undefined) ||
1771
+ (view.initiatorClientId !== undefined &&
1772
+ callerClientId !== undefined &&
1773
+ callerClientId === view.initiatorClientId);
1774
+ if (callerIsInitiator) {
1775
+ body['userCode'] = view.userCode ?? '';
1776
+ body['verificationUri'] = view.verificationUri ?? '';
1777
+ if (view.verificationUriComplete) {
1778
+ body['verificationUriComplete'] = view.verificationUriComplete;
1779
+ }
1780
+ }
1781
+ // PR #4255 round-12 #6 (gpt-5.5 review CzHOK): minor info-leak
1782
+ // close-out — only echo `initiatorClientId` back to a take-over
1783
+ // POST when the caller is the same client that started the flow
1784
+ // (or when the take-over caller explicitly identified
1785
+ // themselves and matches the original starter). An anonymous
1786
+ // take-over caller (no `X-Qwen-Client-Id`) gets no echo of the
1787
+ // original starter's id; this preserves the symmetry "the
1788
+ // daemon respects the absence of `X-Qwen-Client-Id` as a
1789
+ // privacy signal." Bearer-gated already, so the blast radius
1790
+ // was small, but the asymmetry is now closed.
1791
+ if (view.initiatorClientId &&
1792
+ callerClientId !== undefined &&
1793
+ callerClientId === view.initiatorClientId) {
1794
+ body['initiatorClientId'] = view.initiatorClientId;
1795
+ }
1796
+ return body;
1797
+ }
1798
+ function toDeviceFlowStateBody(view, callerClientId) {
1799
+ const body = {
1800
+ deviceFlowId: view.deviceFlowId,
1801
+ providerId: view.providerId,
1802
+ status: view.status,
1803
+ createdAt: view.createdAt,
1804
+ };
1805
+ if (view.errorKind)
1806
+ body['errorKind'] = view.errorKind;
1807
+ if (view.hint)
1808
+ body['hint'] = view.hint;
1809
+ if (view.expiresAt !== undefined)
1810
+ body['expiresAt'] = view.expiresAt;
1811
+ if (view.intervalMs !== undefined)
1812
+ body['intervalMs'] = view.intervalMs;
1813
+ if (view.lastPolledAt !== undefined)
1814
+ body['lastPolledAt'] = view.lastPolledAt;
1815
+ // PR #4255 follow-up review thread (deepseek-v4-pro): symmetrize with
1816
+ // the POST take-over response shape — only echo `userCode` /
1817
+ // `verificationUri` / `verificationUriComplete` / `initiatorClientId`
1818
+ // back to the original starter (matched by `X-Qwen-Client-Id`). An
1819
+ // anonymous GET caller, or a caller identifying as a different client,
1820
+ // sees only the public envelope (`status` / `errorKind` / `hint` /
1821
+ // timestamps). Bearer-token gated already (the route uses
1822
+ // `mutate({ strict: true })`), so the blast radius was small, but
1823
+ // multi-client setups sharing a single daemon token could otherwise
1824
+ // enumerate other clients' verification codes.
1825
+ //
1826
+ // **Threat model (PR #4291 follow-up review by Copilot):** this gate
1827
+ // is BEST-EFFORT ATTRIBUTION, not authentication. `X-Qwen-Client-Id`
1828
+ // is a syntactic header, not bound to a server-validated identity —
1829
+ // anyone holding the bearer token can spoof it. The bearer token IS
1830
+ // the auth boundary; this gate exists to prevent ACCIDENTAL
1831
+ // cross-client reads in well-behaved multi-SDK setups (and to keep
1832
+ // GET symmetric with the POST take-over shape closed out in
1833
+ // round-12 #6 of #4255). A determined attacker who has compromised
1834
+ // the daemon bearer token already wins; locking down GET further
1835
+ // would require binding identity into bearer-token issuance, which
1836
+ // is a separate architectural change.
1837
+ // PR #4291 follow-up review (qwen-latest, #3): the gate must accept
1838
+ // the both-undefined case too, otherwise an anonymously-started flow
1839
+ // (POST without `X-Qwen-Client-Id` → `initiatorClientId === undefined`)
1840
+ // becomes silently unreadable: even the same anonymous caller GETting
1841
+ // the same id can no longer retrieve `userCode`/`verificationUri` —
1842
+ // the body switches from "what they got from POST" to a redacted
1843
+ // public envelope, with HTTP 200, no error. Pre-PR-4291 GET returned
1844
+ // these fields to anyone with the bearer; this gate's purpose is to
1845
+ // prevent CROSS-client reads, not to lock anonymous flows out of
1846
+ // their own data.
1847
+ const callerIsInitiator = (view.initiatorClientId === undefined && callerClientId === undefined) ||
1848
+ (view.initiatorClientId !== undefined &&
1849
+ callerClientId !== undefined &&
1850
+ callerClientId === view.initiatorClientId);
1851
+ if (callerIsInitiator) {
1852
+ if (view.userCode)
1853
+ body['userCode'] = view.userCode;
1854
+ if (view.verificationUri)
1855
+ body['verificationUri'] = view.verificationUri;
1856
+ if (view.verificationUriComplete) {
1857
+ body['verificationUriComplete'] = view.verificationUriComplete;
1858
+ }
1859
+ if (view.initiatorClientId) {
1860
+ body['initiatorClientId'] = view.initiatorClientId;
1861
+ }
1862
+ }
1863
+ return body;
1864
+ }
1865
+ function parseClientIdHeader(req, res) {
1866
+ const raw = req.get(CLIENT_ID_HEADER);
1867
+ if (raw === undefined || raw === '')
1868
+ return undefined;
1869
+ if (raw.length > MAX_CLIENT_ID_LENGTH || !CLIENT_ID_RE.test(raw)) {
1870
+ res.status(400).json({
1871
+ error: '`X-Qwen-Client-Id` must be a non-empty token of 128 characters or fewer',
1872
+ code: 'invalid_client_id',
1873
+ });
1874
+ return null;
1875
+ }
1876
+ return raw;
1877
+ }
1878
+ /**
1879
+ * #4282 fold-in 1 (gpt-5.5 C2). Workspace-level mutation routes validate
1880
+ * the parsed `X-Qwen-Client-Id` against `bridge.knownClientIds()` so the
1881
+ * `originatorClientId` stamped onto fan-out events is grounded in a
1882
+ * client identity the daemon previously issued. Without this check, any
1883
+ * authenticated caller could forge the originator on `tool_toggled`,
1884
+ * `workspace_initialized`, and `mcp_server_restart*` events.
1885
+ *
1886
+ * Mirrors the inline check pattern in `workspaceMemory.ts` /
1887
+ * `workspaceAgents.ts` from PR 16. Returns the validated client id
1888
+ * (or `undefined` when no header was supplied), `null` when a 400 has
1889
+ * already been emitted by `parseClientIdHeader` or this validator.
1890
+ */
1891
+ function parseAndValidateWorkspaceClientId(req, res, bridge) {
1892
+ const raw = parseClientIdHeader(req, res);
1893
+ if (raw === null || raw === undefined)
1894
+ return raw;
1895
+ if (!bridge.knownClientIds().has(raw)) {
1896
+ res.status(400).json({
1897
+ error: `Client id "${raw}" is not registered for this workspace`,
1898
+ code: 'invalid_client_id',
1899
+ clientId: raw,
1900
+ });
1901
+ return null;
1902
+ }
1903
+ return raw;
1904
+ }
1905
+ function parsePermissionVoteBody(req, res) {
1906
+ const body = safeBody(req);
1907
+ const outcome = body['outcome'];
1908
+ if (!isValidOutcome(outcome)) {
1909
+ res.status(400).json({ error: INVALID_PERMISSION_OUTCOME_ERROR });
1910
+ return undefined;
1911
+ }
1912
+ return {
1913
+ ...body,
1914
+ outcome,
1915
+ };
1916
+ }
1917
+ function isValidOutcome(raw) {
1918
+ if (typeof raw !== 'object' || raw === null)
1919
+ return false;
1920
+ const obj = raw;
1921
+ if (obj['outcome'] === 'cancelled')
1922
+ return true;
1923
+ // `optionId` must be a non-empty string. An empty string is technically a
1924
+ // string but isn't a meaningful selection — letting it through would
1925
+ // forward malformed votes to the bridge and the agent would reject the
1926
+ // unknown option opaquely.
1927
+ return (obj['outcome'] === 'selected' &&
1928
+ typeof obj['optionId'] === 'string' &&
1929
+ obj['optionId'].length > 0);
1930
+ }
1931
+ /** Range bounds for the `?maxQueued=N` query param on `/session/:id/events`. */
1932
+ const MIN_QUERY_MAX_QUEUED = 16;
1933
+ const MAX_QUERY_MAX_QUEUED = 2048;
1934
+ /**
1935
+ * Parse the optional `?maxQueued=N` query param on
1936
+ * `GET /session/:id/events`. Returns:
1937
+ * - `undefined` — param absent, EventBus uses its default cap (256).
1938
+ * - a positive integer in `[16, 2048]` — caller wants a custom cap.
1939
+ * - `null` — malformed value; the function ALREADY sent a 400 JSON
1940
+ * response and the route must short-circuit. (Pre-handshake 400
1941
+ * is safer than half-opening an SSE stream and emitting a
1942
+ * `stream_error` frame the client has to parse — `EventSource`
1943
+ * auto-reconnects on the latter.)
1944
+ *
1945
+ * Cap range rationale: lower bound 16 (smaller is useless for any
1946
+ * replay backlog); upper bound 2048 (so a single subscriber can't
1947
+ * pin ~1 MB of queue memory just by asking).
1948
+ */
1949
+ function parseMaxQueuedQuery(raw, res) {
1950
+ // Absent param → undefined (use bus default). Present-but-empty
1951
+ // (`?maxQueued=` typed explicitly) → fail-CLOSED 400 — the API
1952
+ // documents fail-closed for any malformed value before opening
1953
+ // SSE, and an empty string is unambiguously malformed (real values
1954
+ // are positive integers in [16, 2048]).
1955
+ if (raw === undefined)
1956
+ return undefined;
1957
+ if (typeof raw !== 'string' || !/^\d+$/.test(raw)) {
1958
+ // Sanitize via JSON.stringify so an attacker-controlled value
1959
+ // containing `\n` / `\r` / other control chars can't inject extra
1960
+ // log lines into stderr (line-based shipper like
1961
+ // journald/Loki/Splunk would otherwise treat the injected line as
1962
+ // a fresh entry). Matches the `workspace_mismatch` log style in
1963
+ // `sendBridgeError`.
1964
+ writeStderrLine(`qwen serve: rejected ?maxQueued ${safeLogValue(raw)} ` +
1965
+ `(not a decimal integer)`);
1966
+ res.status(400).json({
1967
+ error: '`maxQueued` must be a decimal integer',
1968
+ code: 'invalid_max_queued',
1969
+ });
1970
+ return null;
1971
+ }
1972
+ const n = Number.parseInt(raw, 10);
1973
+ if (!Number.isFinite(n) ||
1974
+ n < MIN_QUERY_MAX_QUEUED ||
1975
+ n > MAX_QUERY_MAX_QUEUED) {
1976
+ writeStderrLine(`qwen serve: rejected ?maxQueued ${safeLogValue(raw)} ` +
1977
+ `(outside [${MIN_QUERY_MAX_QUEUED}, ${MAX_QUERY_MAX_QUEUED}])`);
1978
+ res.status(400).json({
1979
+ error: `\`maxQueued\` must be in [${MIN_QUERY_MAX_QUEUED}, ${MAX_QUERY_MAX_QUEUED}]`,
1980
+ code: 'invalid_max_queued',
1981
+ });
1982
+ return null;
1983
+ }
1984
+ return n;
1985
+ }
1986
+ /**
1987
+ * Wrap an attacker-controllable string for safe interpolation into a
1988
+ * stderr log line. `JSON.stringify` escapes control characters
1989
+ * (`\n`, `\r`, etc.) and wraps the result in quotes — any injection
1990
+ * attempt surfaces as visible-as-quoted-noise rather than a
1991
+ * forged log line. Truncated AFTER stringify to keep the budget
1992
+ * predictable even for control-heavy inputs.
1993
+ */
1994
+ function safeLogValue(raw) {
1995
+ return JSON.stringify(String(raw)).slice(0, 82);
1996
+ }
1997
+ function parseLastEventId(raw) {
1998
+ // Stricter than Number.parseInt: only accept pure decimal digits to avoid
1999
+ // values like "1abc" or "1.5e10z" silently parsing to 1.
2000
+ if (typeof raw !== 'string' || !/^\d+$/.test(raw)) {
2001
+ // BX9_I: log a breadcrumb for the operator when a non-empty
2002
+ // header is rejected. The client resumed from event 0 instead
2003
+ // of where they meant to — without this line, the loss of
2004
+ // every event buffered during their disconnect was invisible.
2005
+ // Skip the log for missing / empty headers (the common case of
2006
+ // "first connect, no resume").
2007
+ if (typeof raw === 'string' && raw.length > 0) {
2008
+ writeStderrLine(`qwen serve: rejected Last-Event-ID ${safeLogValue(raw)} ` +
2009
+ `(not a decimal integer)`);
2010
+ }
2011
+ return undefined;
2012
+ }
2013
+ const n = Number.parseInt(raw, 10);
2014
+ // Reject values that lose precision as a JS `number`. The bus's monotonic
2015
+ // ids are bounded by `Number.MAX_SAFE_INTEGER` (2^53 - 1); a client that
2016
+ // tries to resume from beyond that is either malicious or broken.
2017
+ if (!Number.isFinite(n) || n > Number.MAX_SAFE_INTEGER) {
2018
+ writeStderrLine(`qwen serve: rejected Last-Event-ID ${safeLogValue(raw)} ` +
2019
+ `(exceeds Number.MAX_SAFE_INTEGER)`);
2020
+ return undefined;
2021
+ }
2022
+ return n;
2023
+ }
2024
+ function sendPermissionVoteError(res, err, ctx) {
2025
+ // BkwQI: voter's `optionId` wasn't in the option set the agent
2026
+ // originally offered (e.g. forging `ProceedAlways*` when the
2027
+ // prompt's `hideAlwaysAllow` policy suppressed it). 400, not
2028
+ // 404 — the requestId IS known, but the chosen option isn't.
2029
+ if (err instanceof InvalidPermissionOptionError) {
2030
+ res.status(400).json({
2031
+ error: err.message,
2032
+ code: 'invalid_option_id',
2033
+ requestId: err.requestId,
2034
+ optionId: err.optionId,
2035
+ });
2036
+ return;
2037
+ }
2038
+ sendBridgeError(res, err, ctx);
2039
+ }
2040
+ function formatSseFrame(event) {
2041
+ // SSE format: id (optional), event (optional), data, blank line.
2042
+ // The `id:` line is intentionally omitted when `event.id` is absent —
2043
+ // terminal/synthetic frames (e.g. daemon-side `stream_error`) must not
2044
+ // burn a slot in the per-session monotonic sequence the client uses for
2045
+ // `Last-Event-ID` reconnect tracking.
2046
+ //
2047
+ // We always emit the payload as a single `data:` line. The EventSource
2048
+ // spec also allows a frame to span multiple `data:` lines (which a
2049
+ // conformant parser joins with `\n`); we don't emit that form because
2050
+ // our payload is JSON without embedded newlines after `JSON.stringify`.
2051
+ // The SDK parser at `sdk-typescript/src/daemon/sse.ts` handles the
2052
+ // multi-line variant on the receive side — input/output asymmetry is
2053
+ // intentional.
2054
+ const dataJson = JSON.stringify(event);
2055
+ const idLine = 'id' in event && event.id !== undefined ? `id: ${event.id}\n` : '';
2056
+ return `${idLine}event: ${event.type}\ndata: ${dataJson}\n\n`;
2057
+ }
2058
+ /**
2059
+ * Map a thrown bridge error to an HTTP response.
2060
+ *
2061
+ * `ctx` is operator-facing: route + sessionId folded into the stderr
2062
+ * log line so a bare `ECONNRESET` / `ENOMEM` stack trace is
2063
+ * attributable to a specific session and request without having to
2064
+ * timestamp-correlate against client logs. Pass via the route handlers
2065
+ * — see how they call `sendBridgeError(res, err, { route: 'POST
2066
+ * /session/:id/prompt', sessionId })`. Optional so test/dev call
2067
+ * sites that don't care about the log can omit it.
2068
+ */
2069
+ function sendBridgeError(res, err, ctx) {
2070
+ if (err instanceof WorkspaceInitConflictError) {
2071
+ // #4175 Wave 4 PR 17. The target file already exists with non-
2072
+ // whitespace content and the caller did not pass `force: true`.
2073
+ // Body carries the resolved path + size so SDK clients can render
2074
+ // a "file already exists; pass force: true to overwrite" prompt
2075
+ // without re-stat'ing the workspace.
2076
+ res.status(409).json({
2077
+ error: err.message,
2078
+ code: 'workspace_init_conflict',
2079
+ path: err.path,
2080
+ existingSize: err.existingSize,
2081
+ });
2082
+ return;
2083
+ }
2084
+ if (err instanceof McpServerNotFoundError) {
2085
+ // #4282 fold-in 1 (gpt-5.5 C5). Stable 404 for "MCP server name
2086
+ // not in `mcpServers` config" so callers can distinguish a typo
2087
+ // from an internal daemon failure.
2088
+ res.status(404).json({
2089
+ error: err.message,
2090
+ code: 'mcp_server_not_found',
2091
+ serverName: err.serverName,
2092
+ });
2093
+ return;
2094
+ }
2095
+ if (err instanceof McpServerRestartFailedError) {
2096
+ // #4282 fold-in 1 (gpt-5.5 C4). 502 because the daemon understood
2097
+ // the request and the upstream (the MCP server / its child
2098
+ // process) failed to come back online. `errorKind: 'protocol_error'`
2099
+ // shares the closed PR-13 taxonomy.
2100
+ res.status(502).json({
2101
+ error: err.message,
2102
+ code: 'mcp_server_restart_failed',
2103
+ errorKind: 'protocol_error',
2104
+ serverName: err.serverName,
2105
+ mcpStatus: err.mcpStatus,
2106
+ });
2107
+ return;
2108
+ }
2109
+ if (err instanceof TrustGateError) {
2110
+ // #4175 Wave 4 PR 17: trust-folder rejection from
2111
+ // `Config.setApprovalMode`. 403 because the daemon understood the
2112
+ // request but the workspace's trust posture forbids the privileged
2113
+ // mode. `errorKind: 'auth_env_error'` shares the closed PR 13
2114
+ // taxonomy so SDK consumers branch on the same enum already used by
2115
+ // preflight / env diagnostics.
2116
+ res.status(403).json({
2117
+ error: err.message,
2118
+ code: 'trust_gate',
2119
+ errorKind: 'auth_env_error',
2120
+ });
2121
+ return;
2122
+ }
2123
+ if (err instanceof SessionNotFoundError) {
2124
+ res.status(404).json({ error: err.message, sessionId: err.sessionId });
2125
+ return;
2126
+ }
2127
+ if (err instanceof InvalidClientIdError) {
2128
+ res.status(400).json({
2129
+ error: err.message,
2130
+ code: 'invalid_client_id',
2131
+ sessionId: err.sessionId,
2132
+ clientId: err.clientId,
2133
+ });
2134
+ return;
2135
+ }
2136
+ if (err instanceof WorkspaceMismatchError) {
2137
+ // #3803 §02 single-workspace mode: the daemon binds to one
2138
+ // workspace at boot; cross-workspace POSTs are rejected here.
2139
+ // 400 (not 404 — the daemon is "fine", the client just picked
2140
+ // the wrong daemon for their workspace). Body includes both
2141
+ // paths so orchestrator-aware clients can route to the right
2142
+ // daemon / spawn a new one.
2143
+ //
2144
+ // Operator log line: unlike SessionNotFoundError (per-session
2145
+ // 404 with rich URL context), workspace_mismatch indicates an
2146
+ // orchestration / deployment drift (operator booted with the
2147
+ // wrong workspace, or client is routing to the wrong daemon).
2148
+ // Without a breadcrumb the daemon's log looks healthy while
2149
+ // every client request silently 400s. Limited to authenticated
2150
+ // requests by the upstream bearer-token gate, so probing-DoS
2151
+ // log noise stays bounded.
2152
+ // SECURITY: `err.requested` is derived from the request body
2153
+ // (`req.workspaceCwd` → `canonicalizeWorkspace` → here). `path.resolve`
2154
+ // + `realpathSync.native` both preserve control characters inside
2155
+ // path segments — they only normalize separators / `..` / `.` and
2156
+ // walk symlinks. A body like `{"cwd": "/legit/path\nqwen serve:
2157
+ // FAKE LOG LINE"}` would otherwise emit two valid-looking daemon
2158
+ // log lines, weaponizing line-based log shippers (Splunk / Loki /
2159
+ // journald → SIEM). `JSON.stringify` escapes control chars and
2160
+ // wraps in quotes so any injection attempt surfaces as
2161
+ // visible-as-quoted-noise rather than forged-line. `err.bound` is
2162
+ // safe (canonicalized at boot from operator-controlled
2163
+ // `--workspace` / `process.cwd()`) but quoted symmetrically for
2164
+ // readability.
2165
+ writeStderrLine(`qwen serve: workspace_mismatch (POST /session): ` +
2166
+ `daemon bound to ${JSON.stringify(err.bound)}, ` +
2167
+ `rejected ${JSON.stringify(err.requested)}`);
2168
+ res.status(400).json({
2169
+ error: err.message,
2170
+ code: 'workspace_mismatch',
2171
+ boundWorkspace: err.bound,
2172
+ requestedWorkspace: err.requested,
2173
+ });
2174
+ return;
2175
+ }
2176
+ if (err instanceof InvalidSessionScopeError) {
2177
+ // Same wire shape as the route-layer 400 (`server.ts` validates
2178
+ // body['sessionScope'] before calling the bridge). A direct embed
2179
+ // / test caller bypassing the route would otherwise see a generic
2180
+ // 500 — the typed translation keeps both layers in agreement so
2181
+ // SDK clients can branch on `code` regardless of which layer
2182
+ // surfaced the rejection.
2183
+ res.status(400).json({
2184
+ error: err.message,
2185
+ code: 'invalid_session_scope',
2186
+ });
2187
+ return;
2188
+ }
2189
+ if (err instanceof InvalidSessionMetadataError) {
2190
+ res.status(400).json({
2191
+ error: err.message,
2192
+ code: 'invalid_metadata',
2193
+ field: err.field,
2194
+ });
2195
+ return;
2196
+ }
2197
+ if (err instanceof SessionLimitExceededError) {
2198
+ // 503 Service Unavailable + `Retry-After` is the canonical
2199
+ // "we'd serve you, but we're full right now" shape. The hint
2200
+ // is intentionally conservative (5s) because a session that
2201
+ // finishes a prompt frees a slot quickly under normal load;
2202
+ // a client that backs off too aggressively wastes capacity.
2203
+ res.set('Retry-After', '5');
2204
+ res.status(503).json({
2205
+ error: err.message,
2206
+ code: 'session_limit_exceeded',
2207
+ limit: err.limit,
2208
+ });
2209
+ return;
2210
+ }
2211
+ if (err instanceof RestoreInProgressError) {
2212
+ // Match `SessionLimitExceededError`'s 5s hint (above) — the
2213
+ // underlying restore can take up to `initTimeoutMs` (default
2214
+ // 10s) on the agent side, so a 1s retry hint pushed clients
2215
+ // into tight loops that kept hitting the same 409.
2216
+ res.set('Retry-After', '5');
2217
+ res.status(409).json({
2218
+ error: err.message,
2219
+ code: 'restore_in_progress',
2220
+ sessionId: err.sessionId,
2221
+ activeAction: err.activeAction,
2222
+ requestedAction: err.requestedAction,
2223
+ });
2224
+ return;
2225
+ }
2226
+ // 5xx is the kind of error operators need to see in their daemon log
2227
+ // — bridge ENOMEM, agent stack trace, unexpected throw, etc. Without
2228
+ // logging here every 500 disappears once the caller consumes the
2229
+ // response body. This is a stop-gap until structured access/error
2230
+ // logging lands (tracked under §10 follow-ups). Use the stdio helper
2231
+ // (not `console.error`) to keep the no-console lint rule happy and
2232
+ // route through the same writer the rest of the daemon uses.
2233
+ const ctxParts = [
2234
+ ctx?.route,
2235
+ ctx?.sessionId ? `session=${ctx.sessionId}` : undefined,
2236
+ ].filter(Boolean);
2237
+ const ctxStr = ctxParts.length > 0 ? ` (${ctxParts.join(' ')})` : '';
2238
+ writeStderrLine(`qwen serve: bridge error${ctxStr}: ${err instanceof Error ? (err.stack ?? err.message) : String(err)}`);
2239
+ res.status(500).json(errorPayload(err));
2240
+ }
2241
+ /**
2242
+ * Coerce an arbitrary thrown value to a useful string. Plain `String(err)`
2243
+ * yields `[object Object]` for JSON-RPC-shaped errors (`{code, message,
2244
+ * data}`) which are exactly what the ACP SDK forwards from the agent. Try
2245
+ * the `message` field first, fall back to JSON-stringify, then `String`.
2246
+ */
2247
+ function errorMessage(err) {
2248
+ if (err instanceof Error)
2249
+ return err.message;
2250
+ if (err && typeof err === 'object') {
2251
+ const maybe = err.message;
2252
+ if (typeof maybe === 'string' && maybe.length > 0)
2253
+ return maybe;
2254
+ try {
2255
+ return JSON.stringify(err);
2256
+ }
2257
+ catch {
2258
+ /* fall through */
2259
+ }
2260
+ }
2261
+ return String(err);
2262
+ }
2263
+ /**
2264
+ * Build the JSON body for a 5xx response. The ACP SDK forwards
2265
+ * JSON-RPC-shaped errors like `{code: -32000, message: "Internal error",
2266
+ * data: {reason: "model quota exceeded"}}` — discarding `code`/`data`
2267
+ * collapses every distinct failure (quota / rate-limit / auth /
2268
+ * crash) to the same opaque `"Internal error"` string at the client.
2269
+ * Forward both fields so callers can triage from response body alone.
2270
+ * `error` stays as the human-readable string for backward compatibility
2271
+ * with clients that only consumed `error` in the original shape.
2272
+ *
2273
+ * BSA0G acknowledged: forwarding `data` verbatim leaks per-error
2274
+ * detail (file paths in upstream tool failures, partial API response
2275
+ * snippets, etc.) to every authenticated SSE subscriber that
2276
+ * observes 5xx responses. In Stage 1's single-user / small-team
2277
+ * trust model (every authenticated client is the same human or
2278
+ * collaborators they trust) this is acceptable — and the triage
2279
+ * value of the rich error is high. Stage 2 multi-tenant deployments
2280
+ * will need an opt-in `--redact-errors` flag (or per-deployment
2281
+ * policy hook) that strips `data` and replaces it with an
2282
+ * error-class identifier; tracked under #3803 follow-ups.
2283
+ */
2284
+ function errorPayload(err) {
2285
+ const out = {
2286
+ error: errorMessage(err),
2287
+ };
2288
+ if (err && typeof err === 'object') {
2289
+ const obj = err;
2290
+ if ('code' in obj)
2291
+ out.code = obj['code'];
2292
+ if ('data' in obj)
2293
+ out.data = obj['data'];
2294
+ }
2295
+ return out;
2296
+ }
2297
+ //# sourceMappingURL=server.js.map