@jingyi0605/codingns4dsh 0.2.1-beta.8 → 0.2.1-rc.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (938) hide show
  1. package/README.en.md +8 -6
  2. package/README.md +14 -7
  3. package/assets/provider-icons/magpie.png +0 -0
  4. package/data/build/dist/bootstrap/dsh-connection-adapter.d.ts +1 -1
  5. package/data/build/dist/bootstrap/dsh-connection-adapter.d.ts.map +1 -1
  6. package/data/build/dist/bootstrap/dsh-peer-host-preboot-shim.d.ts.map +1 -1
  7. package/data/build/dist/bootstrap/dsh-peer-host-preboot-shim.js +26 -1
  8. package/data/build/dist/bootstrap/dsh-peer-host-preboot-shim.js.map +1 -1
  9. package/data/build/dist/bootstrap/index.d.ts +1 -1
  10. package/data/build/dist/bootstrap/index.d.ts.map +1 -1
  11. package/data/build/dist/client/account-bar.d.ts.map +1 -1
  12. package/data/build/dist/client/account-bar.js +57 -91
  13. package/data/build/dist/client/account-bar.js.map +1 -1
  14. package/data/build/dist/client/adapter-catalog-watch.d.ts +10 -2
  15. package/data/build/dist/client/adapter-catalog-watch.d.ts.map +1 -1
  16. package/data/build/dist/client/adapter-catalog-watch.js +16 -4
  17. package/data/build/dist/client/adapter-catalog-watch.js.map +1 -1
  18. package/data/build/dist/client/avatar/desktop-bridge.js +1 -1
  19. package/data/build/dist/client/avatar/desktop-bridge.js.map +1 -1
  20. package/data/build/dist/client/avatar/desktop-view.d.ts +3 -1
  21. package/data/build/dist/client/avatar/desktop-view.d.ts.map +1 -1
  22. package/data/build/dist/client/avatar/desktop-view.js +31 -12
  23. package/data/build/dist/client/avatar/desktop-view.js.map +1 -1
  24. package/data/build/dist/client/avatar/notification-bubble.d.ts +7 -1
  25. package/data/build/dist/client/avatar/notification-bubble.d.ts.map +1 -1
  26. package/data/build/dist/client/avatar/notification-bubble.js +68 -33
  27. package/data/build/dist/client/avatar/notification-bubble.js.map +1 -1
  28. package/data/build/dist/client/bundle.js +54814 -34268
  29. package/data/build/dist/client/bundle.js.map +1 -1
  30. package/data/build/dist/client/cli-management-dialog.d.ts +21 -0
  31. package/data/build/dist/client/cli-management-dialog.d.ts.map +1 -0
  32. package/data/build/dist/client/cli-management-dialog.js +215 -0
  33. package/data/build/dist/client/cli-management-dialog.js.map +1 -0
  34. package/data/build/dist/client/cli-management-terminal.d.ts +9 -0
  35. package/data/build/dist/client/cli-management-terminal.d.ts.map +1 -0
  36. package/data/build/dist/client/cli-management-terminal.js +30 -0
  37. package/data/build/dist/client/cli-management-terminal.js.map +1 -0
  38. package/data/build/dist/client/cli-settings-dialog.d.ts +9 -0
  39. package/data/build/dist/client/cli-settings-dialog.d.ts.map +1 -0
  40. package/data/build/dist/client/cli-settings-dialog.js +45 -0
  41. package/data/build/dist/client/cli-settings-dialog.js.map +1 -0
  42. package/data/build/dist/client/cli-settings-rpc.js +1 -1
  43. package/data/build/dist/client/cli-settings-rpc.js.map +1 -1
  44. package/data/build/dist/client/cli-slots.d.ts +17 -3
  45. package/data/build/dist/client/cli-slots.d.ts.map +1 -1
  46. package/data/build/dist/client/cli-slots.js +321 -38
  47. package/data/build/dist/client/cli-slots.js.map +1 -1
  48. package/data/build/dist/client/client.assistant-configuration-view.js +4 -3
  49. package/data/build/dist/client/client.assistant-configuration-view.js.map +1 -1
  50. package/data/build/dist/client/client.assistant-notifications.js.map +1 -1
  51. package/data/build/dist/client/client.delegate-command.js +50 -32
  52. package/data/build/dist/client/client.delegate-command.js.map +1 -1
  53. package/data/build/dist/client/client.editor-engine.js +4 -1
  54. package/data/build/dist/client/client.editor-engine.js.map +1 -1
  55. package/data/build/dist/client/{client.model-catalog-cache.js → client.magpie-model-tag.js} +241 -12
  56. package/data/build/dist/client/client.magpie-model-tag.js.map +1 -0
  57. package/data/build/dist/client/client.moss-voice-output.js +415 -0
  58. package/data/build/dist/client/client.moss-voice-output.js.map +1 -0
  59. package/data/build/dist/client/client.native-workspace-store.js +103 -17
  60. package/data/build/dist/client/client.native-workspace-store.js.map +1 -1
  61. package/data/build/dist/client/client.primitives-adapter.js +128 -0
  62. package/data/build/dist/client/client.primitives-adapter.js.map +1 -1
  63. package/data/build/dist/client/client.react-dom.js +0 -404
  64. package/data/build/dist/client/client.react-dom.js.map +1 -1
  65. package/data/build/dist/client/client.session-translation.js +173 -0
  66. package/data/build/dist/client/client.session-translation.js.map +1 -0
  67. package/data/build/dist/client/client.transport.js +813 -48
  68. package/data/build/dist/client/client.transport.js.map +1 -1
  69. package/data/build/dist/client/conversation-translation-settings.d.ts +11 -0
  70. package/data/build/dist/client/conversation-translation-settings.d.ts.map +1 -0
  71. package/data/build/dist/client/conversation-translation-settings.js +54 -0
  72. package/data/build/dist/client/conversation-translation-settings.js.map +1 -0
  73. package/data/build/dist/client/delegate-command.d.ts.map +1 -1
  74. package/data/build/dist/client/delegate-command.js +36 -7
  75. package/data/build/dist/client/delegate-command.js.map +1 -1
  76. package/data/build/dist/client/desktop-assistant.js +1408 -544
  77. package/data/build/dist/client/editor-engine.d.ts +1 -1
  78. package/data/build/dist/client/editor-engine.d.ts.map +1 -1
  79. package/data/build/dist/client/editor-engine.js +4 -1
  80. package/data/build/dist/client/editor-engine.js.map +1 -1
  81. package/data/build/dist/client/features/assistant-notification-store.d.ts +1 -1
  82. package/data/build/dist/client/features/assistant-notification-store.d.ts.map +1 -1
  83. package/data/build/dist/client/features/assistant-notification-store.js +1 -1
  84. package/data/build/dist/client/features/assistant-notification-store.js.map +1 -1
  85. package/data/build/dist/client/features/cli-adapters.d.ts +3 -1
  86. package/data/build/dist/client/features/cli-adapters.d.ts.map +1 -1
  87. package/data/build/dist/client/features/cli-adapters.js +207 -112
  88. package/data/build/dist/client/features/cli-adapters.js.map +1 -1
  89. package/data/build/dist/client/features/file-management.d.ts.map +1 -1
  90. package/data/build/dist/client/features/file-management.js +18 -0
  91. package/data/build/dist/client/features/file-management.js.map +1 -1
  92. package/data/build/dist/client/features/global-voice-assistant.d.ts.map +1 -1
  93. package/data/build/dist/client/features/global-voice-assistant.js +12 -6
  94. package/data/build/dist/client/features/global-voice-assistant.js.map +1 -1
  95. package/data/build/dist/client/features/index.d.ts +1 -0
  96. package/data/build/dist/client/features/index.d.ts.map +1 -1
  97. package/data/build/dist/client/features/index.js +5 -0
  98. package/data/build/dist/client/features/index.js.map +1 -1
  99. package/data/build/dist/client/features/lan-access-panel.d.ts.map +1 -1
  100. package/data/build/dist/client/features/lan-access-panel.js +1 -0
  101. package/data/build/dist/client/features/lan-access-panel.js.map +1 -1
  102. package/data/build/dist/client/features/mobile-access.d.ts.map +1 -1
  103. package/data/build/dist/client/features/mobile-access.js +7 -0
  104. package/data/build/dist/client/features/mobile-access.js.map +1 -1
  105. package/data/build/dist/client/features/peer-host.d.ts.map +1 -1
  106. package/data/build/dist/client/features/peer-host.js +105 -17
  107. package/data/build/dist/client/features/peer-host.js.map +1 -1
  108. package/data/build/dist/client/features/quick-apps.d.ts +3 -0
  109. package/data/build/dist/client/features/quick-apps.d.ts.map +1 -0
  110. package/data/build/dist/client/features/quick-apps.js +14 -0
  111. package/data/build/dist/client/features/quick-apps.js.map +1 -0
  112. package/data/build/dist/client/features/session-translation.d.ts +3 -0
  113. package/data/build/dist/client/features/session-translation.d.ts.map +1 -0
  114. package/data/build/dist/client/features/session-translation.js +117 -0
  115. package/data/build/dist/client/features/session-translation.js.map +1 -0
  116. package/data/build/dist/client/features/workspace-session-enhancement.d.ts.map +1 -1
  117. package/data/build/dist/client/features/workspace-session-enhancement.js +6 -0
  118. package/data/build/dist/client/features/workspace-session-enhancement.js.map +1 -1
  119. package/data/build/dist/client/file-management-dom.d.ts +20 -1
  120. package/data/build/dist/client/file-management-dom.d.ts.map +1 -1
  121. package/data/build/dist/client/file-management-dom.js +94 -18
  122. package/data/build/dist/client/file-management-dom.js.map +1 -1
  123. package/data/build/dist/client/file-viewer-copy-path-menu.d.ts +27 -0
  124. package/data/build/dist/client/file-viewer-copy-path-menu.d.ts.map +1 -0
  125. package/data/build/dist/client/file-viewer-copy-path-menu.js +101 -0
  126. package/data/build/dist/client/file-viewer-copy-path-menu.js.map +1 -0
  127. package/data/build/dist/client/git-management-settings.d.ts +4 -0
  128. package/data/build/dist/client/git-management-settings.d.ts.map +1 -0
  129. package/data/build/dist/client/git-management-settings.js +73 -0
  130. package/data/build/dist/client/git-management-settings.js.map +1 -0
  131. package/data/build/dist/client/git-management.d.ts +2 -1
  132. package/data/build/dist/client/git-management.d.ts.map +1 -1
  133. package/data/build/dist/client/git-management.js +55 -34
  134. package/data/build/dist/client/git-management.js.map +1 -1
  135. package/data/build/dist/client/git-panel-styles.d.ts +4 -0
  136. package/data/build/dist/client/git-panel-styles.d.ts.map +1 -1
  137. package/data/build/dist/client/git-panel-styles.js +14 -0
  138. package/data/build/dist/client/git-panel-styles.js.map +1 -1
  139. package/data/build/dist/client/html-workspace-files.d.ts +4 -0
  140. package/data/build/dist/client/html-workspace-files.d.ts.map +1 -0
  141. package/data/build/dist/client/html-workspace-files.js +114 -0
  142. package/data/build/dist/client/html-workspace-files.js.map +1 -0
  143. package/data/build/dist/client/index.d.ts.map +1 -1
  144. package/data/build/dist/client/index.js +6 -1
  145. package/data/build/dist/client/index.js.map +1 -1
  146. package/data/build/dist/client/locale.d.ts.map +1 -1
  147. package/data/build/dist/client/locale.js +22 -2
  148. package/data/build/dist/client/locale.js.map +1 -1
  149. package/data/build/dist/client/locales/cliManagement.d.ts +3 -0
  150. package/data/build/dist/client/locales/cliManagement.d.ts.map +1 -0
  151. package/data/build/dist/client/locales/cliManagement.js +155 -0
  152. package/data/build/dist/client/locales/cliManagement.js.map +1 -0
  153. package/data/build/dist/client/locales/fileWorkspace.d.ts.map +1 -1
  154. package/data/build/dist/client/locales/fileWorkspace.js +8 -0
  155. package/data/build/dist/client/locales/fileWorkspace.js.map +1 -1
  156. package/data/build/dist/client/locales/git.d.ts.map +1 -1
  157. package/data/build/dist/client/locales/git.js +30 -2
  158. package/data/build/dist/client/locales/git.js.map +1 -1
  159. package/data/build/dist/client/locales/panels.d.ts.map +1 -1
  160. package/data/build/dist/client/locales/panels.js +154 -0
  161. package/data/build/dist/client/locales/panels.js.map +1 -1
  162. package/data/build/dist/client/locales/peerHost.d.ts.map +1 -1
  163. package/data/build/dist/client/locales/peerHost.js +2 -0
  164. package/data/build/dist/client/locales/peerHost.js.map +1 -1
  165. package/data/build/dist/client/locales/quickApps.d.ts +136 -0
  166. package/data/build/dist/client/locales/quickApps.d.ts.map +1 -0
  167. package/data/build/dist/client/locales/quickApps.js +162 -0
  168. package/data/build/dist/client/locales/quickApps.js.map +1 -0
  169. package/data/build/dist/client/locales/usage.d.ts.map +1 -1
  170. package/data/build/dist/client/locales/usage.js +98 -0
  171. package/data/build/dist/client/locales/usage.js.map +1 -1
  172. package/data/build/dist/client/magpie-model-tag.d.ts +8 -0
  173. package/data/build/dist/client/magpie-model-tag.d.ts.map +1 -0
  174. package/data/build/dist/client/magpie-model-tag.js +50 -0
  175. package/data/build/dist/client/magpie-model-tag.js.map +1 -0
  176. package/data/build/dist/client/mobile-team-panel-dom.d.ts +14 -0
  177. package/data/build/dist/client/mobile-team-panel-dom.d.ts.map +1 -0
  178. package/data/build/dist/client/mobile-team-panel-dom.js +164 -0
  179. package/data/build/dist/client/mobile-team-panel-dom.js.map +1 -0
  180. package/data/build/dist/client/model-catalog-cache.d.ts.map +1 -1
  181. package/data/build/dist/client/model-catalog-cache.js +66 -12
  182. package/data/build/dist/client/model-catalog-cache.js.map +1 -1
  183. package/data/build/dist/client/model-priority-pool.d.ts +23 -0
  184. package/data/build/dist/client/model-priority-pool.d.ts.map +1 -0
  185. package/data/build/dist/client/model-priority-pool.js +245 -0
  186. package/data/build/dist/client/model-priority-pool.js.map +1 -0
  187. package/data/build/dist/client/native-model-translation-menu.d.ts +13 -0
  188. package/data/build/dist/client/native-model-translation-menu.d.ts.map +1 -0
  189. package/data/build/dist/client/native-model-translation-menu.js +159 -0
  190. package/data/build/dist/client/native-model-translation-menu.js.map +1 -0
  191. package/data/build/dist/client/native-translation-default.d.ts +6 -0
  192. package/data/build/dist/client/native-translation-default.d.ts.map +1 -0
  193. package/data/build/dist/client/native-translation-default.js +30 -0
  194. package/data/build/dist/client/native-translation-default.js.map +1 -0
  195. package/data/build/dist/client/provider-icons.d.ts.map +1 -1
  196. package/data/build/dist/client/provider-icons.js +3 -1
  197. package/data/build/dist/client/provider-icons.js.map +1 -1
  198. package/data/build/dist/client/quick-apps/browser-storage.d.ts +24 -0
  199. package/data/build/dist/client/quick-apps/browser-storage.d.ts.map +1 -0
  200. package/data/build/dist/client/quick-apps/browser-storage.js +114 -0
  201. package/data/build/dist/client/quick-apps/browser-storage.js.map +1 -0
  202. package/data/build/dist/client/quick-apps/client.d.ts +31 -0
  203. package/data/build/dist/client/quick-apps/client.d.ts.map +1 -0
  204. package/data/build/dist/client/quick-apps/client.js +68 -0
  205. package/data/build/dist/client/quick-apps/client.js.map +1 -0
  206. package/data/build/dist/client/quick-apps/document.d.ts +26 -0
  207. package/data/build/dist/client/quick-apps/document.d.ts.map +1 -0
  208. package/data/build/dist/client/quick-apps/document.js +110 -0
  209. package/data/build/dist/client/quick-apps/document.js.map +1 -0
  210. package/data/build/dist/client/quick-apps/file-picker.d.ts +14 -0
  211. package/data/build/dist/client/quick-apps/file-picker.d.ts.map +1 -0
  212. package/data/build/dist/client/quick-apps/file-picker.js +51 -0
  213. package/data/build/dist/client/quick-apps/file-picker.js.map +1 -0
  214. package/data/build/dist/client/quick-apps/launcher.d.ts +7 -0
  215. package/data/build/dist/client/quick-apps/launcher.d.ts.map +1 -0
  216. package/data/build/dist/client/quick-apps/launcher.js +267 -0
  217. package/data/build/dist/client/quick-apps/launcher.js.map +1 -0
  218. package/data/build/dist/client/quick-apps/presentation.d.ts +16 -0
  219. package/data/build/dist/client/quick-apps/presentation.d.ts.map +1 -0
  220. package/data/build/dist/client/quick-apps/presentation.js +47 -0
  221. package/data/build/dist/client/quick-apps/presentation.js.map +1 -0
  222. package/data/build/dist/client/quick-apps/rail-preference.d.ts +5 -0
  223. package/data/build/dist/client/quick-apps/rail-preference.d.ts.map +1 -0
  224. package/data/build/dist/client/quick-apps/rail-preference.js +19 -0
  225. package/data/build/dist/client/quick-apps/rail-preference.js.map +1 -0
  226. package/data/build/dist/client/quick-apps/reorder-animation.d.ts +6 -0
  227. package/data/build/dist/client/quick-apps/reorder-animation.d.ts.map +1 -0
  228. package/data/build/dist/client/quick-apps/reorder-animation.js +50 -0
  229. package/data/build/dist/client/quick-apps/reorder-animation.js.map +1 -0
  230. package/data/build/dist/client/quick-apps/reorder.d.ts +26 -0
  231. package/data/build/dist/client/quick-apps/reorder.d.ts.map +1 -0
  232. package/data/build/dist/client/quick-apps/reorder.js +128 -0
  233. package/data/build/dist/client/quick-apps/reorder.js.map +1 -0
  234. package/data/build/dist/client/quick-apps/styles.d.ts +3 -0
  235. package/data/build/dist/client/quick-apps/styles.d.ts.map +1 -0
  236. package/data/build/dist/client/quick-apps/styles.js +153 -0
  237. package/data/build/dist/client/quick-apps/styles.js.map +1 -0
  238. package/data/build/dist/client/quick-apps/ui.d.ts +20 -0
  239. package/data/build/dist/client/quick-apps/ui.d.ts.map +1 -0
  240. package/data/build/dist/client/quick-apps/ui.js +21 -0
  241. package/data/build/dist/client/quick-apps/ui.js.map +1 -0
  242. package/data/build/dist/client/quick-apps/viewer.d.ts +16 -0
  243. package/data/build/dist/client/quick-apps/viewer.d.ts.map +1 -0
  244. package/data/build/dist/client/quick-apps/viewer.js +165 -0
  245. package/data/build/dist/client/quick-apps/viewer.js.map +1 -0
  246. package/data/build/dist/client/quick-apps/workspace-picker.d.ts +19 -0
  247. package/data/build/dist/client/quick-apps/workspace-picker.d.ts.map +1 -0
  248. package/data/build/dist/client/quick-apps/workspace-picker.js +30 -0
  249. package/data/build/dist/client/quick-apps/workspace-picker.js.map +1 -0
  250. package/data/build/dist/client/session-file-links.d.ts +11 -0
  251. package/data/build/dist/client/session-file-links.d.ts.map +1 -0
  252. package/data/build/dist/client/{peer-host-file-links.js → session-file-links.js} +13 -3
  253. package/data/build/dist/client/session-file-links.js.map +1 -0
  254. package/data/build/dist/client/session-translation-chat.d.ts +72 -0
  255. package/data/build/dist/client/session-translation-chat.d.ts.map +1 -0
  256. package/data/build/dist/client/session-translation-chat.js +874 -0
  257. package/data/build/dist/client/session-translation-chat.js.map +1 -0
  258. package/data/build/dist/client/session-translation-interactions.d.ts +31 -0
  259. package/data/build/dist/client/session-translation-interactions.d.ts.map +1 -0
  260. package/data/build/dist/client/session-translation-interactions.js +158 -0
  261. package/data/build/dist/client/session-translation-interactions.js.map +1 -0
  262. package/data/build/dist/client/session-translation-pending-dom.d.ts +8 -0
  263. package/data/build/dist/client/session-translation-pending-dom.d.ts.map +1 -0
  264. package/data/build/dist/client/session-translation-pending-dom.js +58 -0
  265. package/data/build/dist/client/session-translation-pending-dom.js.map +1 -0
  266. package/data/build/dist/client/session-translation-retry.d.ts +16 -0
  267. package/data/build/dist/client/session-translation-retry.d.ts.map +1 -0
  268. package/data/build/dist/client/session-translation-retry.js +66 -0
  269. package/data/build/dist/client/session-translation-retry.js.map +1 -0
  270. package/data/build/dist/client/session-translation-rules.d.ts +13 -0
  271. package/data/build/dist/client/session-translation-rules.d.ts.map +1 -0
  272. package/data/build/dist/client/session-translation-rules.js +58 -0
  273. package/data/build/dist/client/session-translation-rules.js.map +1 -0
  274. package/data/build/dist/client/sidebar-footer-style.d.ts +13 -0
  275. package/data/build/dist/client/sidebar-footer-style.d.ts.map +1 -0
  276. package/data/build/dist/client/sidebar-footer-style.js +54 -0
  277. package/data/build/dist/client/sidebar-footer-style.js.map +1 -0
  278. package/data/build/dist/client/style.css +276 -276
  279. package/data/build/dist/client/subscription-slot.d.ts +6 -2
  280. package/data/build/dist/client/subscription-slot.d.ts.map +1 -1
  281. package/data/build/dist/client/subscription-slot.js +373 -21
  282. package/data/build/dist/client/subscription-slot.js.map +1 -1
  283. package/data/build/dist/client/terminal/model.d.ts.map +1 -1
  284. package/data/build/dist/client/terminal/model.js +2 -1
  285. package/data/build/dist/client/terminal/model.js.map +1 -1
  286. package/data/build/dist/client/workspace-session-archive-dom.d.ts +1 -0
  287. package/data/build/dist/client/workspace-session-archive-dom.d.ts.map +1 -1
  288. package/data/build/dist/client/workspace-session-archive-dom.js +68 -8
  289. package/data/build/dist/client/workspace-session-archive-dom.js.map +1 -1
  290. package/data/build/dist/client/workspace-session-rightbar-dom.d.ts.map +1 -1
  291. package/data/build/dist/client/workspace-session-rightbar-dom.js +12 -21
  292. package/data/build/dist/client/workspace-session-rightbar-dom.js.map +1 -1
  293. package/data/build/dist/client/workspace-session-visibility-dom.d.ts +3 -0
  294. package/data/build/dist/client/workspace-session-visibility-dom.d.ts.map +1 -1
  295. package/data/build/dist/client/workspace-session-visibility-dom.js +66 -17
  296. package/data/build/dist/client/workspace-session-visibility-dom.js.map +1 -1
  297. package/data/build/dist/dsh-capabilities/client/assistant-session-navigation-adapter.d.ts +1 -1
  298. package/data/build/dist/dsh-capabilities/client/assistant-session-navigation-adapter.d.ts.map +1 -1
  299. package/data/build/dist/dsh-capabilities/client/assistant-session-navigation-adapter.js +28 -2
  300. package/data/build/dist/dsh-capabilities/client/assistant-session-navigation-adapter.js.map +1 -1
  301. package/data/build/dist/dsh-capabilities/client/composer-presentation-adapter.d.ts +8 -0
  302. package/data/build/dist/dsh-capabilities/client/composer-presentation-adapter.d.ts.map +1 -0
  303. package/data/build/dist/dsh-capabilities/client/composer-presentation-adapter.js +71 -0
  304. package/data/build/dist/dsh-capabilities/client/composer-presentation-adapter.js.map +1 -0
  305. package/data/build/dist/dsh-capabilities/client/composer-slot-selectors.d.ts +4 -0
  306. package/data/build/dist/dsh-capabilities/client/composer-slot-selectors.d.ts.map +1 -0
  307. package/data/build/dist/dsh-capabilities/client/composer-slot-selectors.js +8 -0
  308. package/data/build/dist/dsh-capabilities/client/composer-slot-selectors.js.map +1 -0
  309. package/data/build/dist/dsh-capabilities/client/interaction-presentation-adapter.d.ts +30 -0
  310. package/data/build/dist/dsh-capabilities/client/interaction-presentation-adapter.d.ts.map +1 -0
  311. package/data/build/dist/dsh-capabilities/client/interaction-presentation-adapter.js +93 -0
  312. package/data/build/dist/dsh-capabilities/client/interaction-presentation-adapter.js.map +1 -0
  313. package/data/build/dist/dsh-capabilities/client/interaction-text-dom.d.ts +12 -0
  314. package/data/build/dist/dsh-capabilities/client/interaction-text-dom.d.ts.map +1 -0
  315. package/data/build/dist/dsh-capabilities/client/interaction-text-dom.js +181 -0
  316. package/data/build/dist/dsh-capabilities/client/interaction-text-dom.js.map +1 -0
  317. package/data/build/dist/dsh-capabilities/client/message-presentation-adapter.d.ts +19 -0
  318. package/data/build/dist/dsh-capabilities/client/message-presentation-adapter.d.ts.map +1 -0
  319. package/data/build/dist/dsh-capabilities/client/message-presentation-adapter.js +39 -0
  320. package/data/build/dist/dsh-capabilities/client/message-presentation-adapter.js.map +1 -0
  321. package/data/build/dist/dsh-capabilities/client/peer-host-attachment-adapter.d.ts +3 -0
  322. package/data/build/dist/dsh-capabilities/client/peer-host-attachment-adapter.d.ts.map +1 -0
  323. package/data/build/dist/dsh-capabilities/client/peer-host-attachment-adapter.js +27 -0
  324. package/data/build/dist/dsh-capabilities/client/peer-host-attachment-adapter.js.map +1 -0
  325. package/data/build/dist/dsh-capabilities/client/primitives-adapter.d.ts +36 -0
  326. package/data/build/dist/dsh-capabilities/client/primitives-adapter.d.ts.map +1 -1
  327. package/data/build/dist/dsh-capabilities/client/primitives-adapter.js +88 -0
  328. package/data/build/dist/dsh-capabilities/client/primitives-adapter.js.map +1 -1
  329. package/data/build/dist/dsh-capabilities/client/question-history-adapter.d.ts +20 -0
  330. package/data/build/dist/dsh-capabilities/client/question-history-adapter.d.ts.map +1 -0
  331. package/data/build/dist/dsh-capabilities/client/question-history-adapter.js +65 -0
  332. package/data/build/dist/dsh-capabilities/client/question-history-adapter.js.map +1 -0
  333. package/data/build/dist/dsh-capabilities/client/quick-app-footer-adapter.d.ts +18 -0
  334. package/data/build/dist/dsh-capabilities/client/quick-app-footer-adapter.d.ts.map +1 -0
  335. package/data/build/dist/dsh-capabilities/client/quick-app-footer-adapter.js +11 -0
  336. package/data/build/dist/dsh-capabilities/client/quick-app-footer-adapter.js.map +1 -0
  337. package/data/build/dist/dsh-capabilities/client/session-performance-adapter.d.ts +9 -0
  338. package/data/build/dist/dsh-capabilities/client/session-performance-adapter.d.ts.map +1 -0
  339. package/data/build/dist/dsh-capabilities/client/session-performance-adapter.js +75 -0
  340. package/data/build/dist/dsh-capabilities/client/session-performance-adapter.js.map +1 -0
  341. package/data/build/dist/dsh-capabilities/client/sidebar-footer-icon-adapter.d.ts +3 -0
  342. package/data/build/dist/dsh-capabilities/client/sidebar-footer-icon-adapter.d.ts.map +1 -0
  343. package/data/build/dist/dsh-capabilities/client/sidebar-footer-icon-adapter.js +22 -0
  344. package/data/build/dist/dsh-capabilities/client/sidebar-footer-icon-adapter.js.map +1 -0
  345. package/data/build/dist/dsh-capabilities/client/slot-presentation-mirror.d.ts +32 -0
  346. package/data/build/dist/dsh-capabilities/client/slot-presentation-mirror.d.ts.map +1 -0
  347. package/data/build/dist/dsh-capabilities/client/slot-presentation-mirror.js +90 -0
  348. package/data/build/dist/dsh-capabilities/client/slot-presentation-mirror.js.map +1 -0
  349. package/data/build/dist/dsh-capabilities/host/agent-team-adapter.d.ts +52 -0
  350. package/data/build/dist/dsh-capabilities/host/agent-team-adapter.d.ts.map +1 -0
  351. package/data/build/dist/dsh-capabilities/host/agent-team-adapter.js +109 -0
  352. package/data/build/dist/dsh-capabilities/host/agent-team-adapter.js.map +1 -0
  353. package/data/build/dist/dsh-capabilities/host/connection-peer-adapter.d.ts +10 -0
  354. package/data/build/dist/dsh-capabilities/host/connection-peer-adapter.d.ts.map +1 -0
  355. package/data/build/dist/dsh-capabilities/host/connection-peer-adapter.js +34 -0
  356. package/data/build/dist/dsh-capabilities/host/connection-peer-adapter.js.map +1 -0
  357. package/data/build/dist/dsh-capabilities/host/native-dispatch-adapter.d.ts +21 -0
  358. package/data/build/dist/dsh-capabilities/host/native-dispatch-adapter.d.ts.map +1 -0
  359. package/data/build/dist/dsh-capabilities/host/native-dispatch-adapter.js +11 -0
  360. package/data/build/dist/dsh-capabilities/host/native-dispatch-adapter.js.map +1 -0
  361. package/data/build/dist/dsh-capabilities/host/quick-app-credentials.d.ts +11 -0
  362. package/data/build/dist/dsh-capabilities/host/quick-app-credentials.d.ts.map +1 -0
  363. package/data/build/dist/dsh-capabilities/host/quick-app-credentials.js +97 -0
  364. package/data/build/dist/dsh-capabilities/host/quick-app-credentials.js.map +1 -0
  365. package/data/build/dist/dsh-capabilities/host/quick-app-https-provider.d.ts +36 -0
  366. package/data/build/dist/dsh-capabilities/host/quick-app-https-provider.d.ts.map +1 -0
  367. package/data/build/dist/dsh-capabilities/host/quick-app-https-provider.js +164 -0
  368. package/data/build/dist/dsh-capabilities/host/quick-app-https-provider.js.map +1 -0
  369. package/data/build/dist/dsh-capabilities/host/quick-app-lan-ports.d.ts +44 -0
  370. package/data/build/dist/dsh-capabilities/host/quick-app-lan-ports.d.ts.map +1 -0
  371. package/data/build/dist/dsh-capabilities/host/quick-app-lan-ports.js +240 -0
  372. package/data/build/dist/dsh-capabilities/host/quick-app-lan-ports.js.map +1 -0
  373. package/data/build/dist/dsh-capabilities/host/quick-app-origin-adapter.d.ts +37 -0
  374. package/data/build/dist/dsh-capabilities/host/quick-app-origin-adapter.d.ts.map +1 -0
  375. package/data/build/dist/dsh-capabilities/host/quick-app-origin-adapter.js +35 -0
  376. package/data/build/dist/dsh-capabilities/host/quick-app-origin-adapter.js.map +1 -0
  377. package/data/build/dist/dsh-capabilities/host/quick-app-proxy-adapter.d.ts +13 -0
  378. package/data/build/dist/dsh-capabilities/host/quick-app-proxy-adapter.d.ts.map +1 -0
  379. package/data/build/dist/dsh-capabilities/host/quick-app-proxy-adapter.js +30 -0
  380. package/data/build/dist/dsh-capabilities/host/quick-app-proxy-adapter.js.map +1 -0
  381. package/data/build/dist/dsh-capabilities/host/quick-app-proxy-provider.d.ts +21 -0
  382. package/data/build/dist/dsh-capabilities/host/quick-app-proxy-provider.d.ts.map +1 -0
  383. package/data/build/dist/dsh-capabilities/host/quick-app-proxy-provider.js +132 -0
  384. package/data/build/dist/dsh-capabilities/host/quick-app-proxy-provider.js.map +1 -0
  385. package/data/build/dist/dsh-capabilities/host/quick-app-transport.d.ts +10 -0
  386. package/data/build/dist/dsh-capabilities/host/quick-app-transport.d.ts.map +1 -0
  387. package/data/build/dist/dsh-capabilities/host/quick-app-transport.js +33 -0
  388. package/data/build/dist/dsh-capabilities/host/quick-app-transport.js.map +1 -0
  389. package/data/build/dist/dsh-capabilities/host/session-activation-adapter.d.ts +17 -0
  390. package/data/build/dist/dsh-capabilities/host/session-activation-adapter.d.ts.map +1 -0
  391. package/data/build/dist/dsh-capabilities/host/session-activation-adapter.js +37 -0
  392. package/data/build/dist/dsh-capabilities/host/session-activation-adapter.js.map +1 -0
  393. package/data/build/dist/dsh-capabilities/host/session-model-selection-adapter.d.ts +17 -0
  394. package/data/build/dist/dsh-capabilities/host/session-model-selection-adapter.d.ts.map +1 -0
  395. package/data/build/dist/dsh-capabilities/host/session-model-selection-adapter.js +45 -0
  396. package/data/build/dist/dsh-capabilities/host/session-model-selection-adapter.js.map +1 -0
  397. package/data/build/dist/dsh-capabilities/host/session-performance-adapter.d.ts +7 -0
  398. package/data/build/dist/dsh-capabilities/host/session-performance-adapter.d.ts.map +1 -0
  399. package/data/build/dist/dsh-capabilities/host/session-performance-adapter.js +18 -0
  400. package/data/build/dist/dsh-capabilities/host/session-performance-adapter.js.map +1 -0
  401. package/data/build/dist/dsh-capabilities/host/session-prompt-adapter.d.ts +28 -0
  402. package/data/build/dist/dsh-capabilities/host/session-prompt-adapter.d.ts.map +1 -0
  403. package/data/build/dist/dsh-capabilities/host/session-prompt-adapter.js +31 -0
  404. package/data/build/dist/dsh-capabilities/host/session-prompt-adapter.js.map +1 -0
  405. package/data/build/dist/dsh-capabilities/host/workspace-directory-adapter.d.ts +13 -0
  406. package/data/build/dist/dsh-capabilities/host/workspace-directory-adapter.d.ts.map +1 -0
  407. package/data/build/dist/dsh-capabilities/host/workspace-directory-adapter.js +24 -0
  408. package/data/build/dist/dsh-capabilities/host/workspace-directory-adapter.js.map +1 -0
  409. package/data/build/dist/dsh-capabilities/matrix.d.ts.map +1 -1
  410. package/data/build/dist/dsh-capabilities/matrix.js +22 -5
  411. package/data/build/dist/dsh-capabilities/matrix.js.map +1 -1
  412. package/data/build/dist/dsh-capabilities/routes.d.ts +1 -0
  413. package/data/build/dist/dsh-capabilities/routes.d.ts.map +1 -1
  414. package/data/build/dist/dsh-capabilities/routes.js +47 -3
  415. package/data/build/dist/dsh-capabilities/routes.js.map +1 -1
  416. package/data/build/dist/dsh-capabilities/types.d.ts +1 -1
  417. package/data/build/dist/dsh-capabilities/types.d.ts.map +1 -1
  418. package/data/build/dist/dsh-capabilities/types.js.map +1 -1
  419. package/data/build/dist/host/cli-adapters/acp-cli-driver.d.ts +21 -0
  420. package/data/build/dist/host/cli-adapters/acp-cli-driver.d.ts.map +1 -1
  421. package/data/build/dist/host/cli-adapters/acp-cli-driver.js +106 -6
  422. package/data/build/dist/host/cli-adapters/acp-cli-driver.js.map +1 -1
  423. package/data/build/dist/host/cli-adapters/antigravity-driver.js +1 -1
  424. package/data/build/dist/host/cli-adapters/antigravity-driver.js.map +1 -1
  425. package/data/build/dist/host/cli-adapters/attachment-utils.d.ts +4 -3
  426. package/data/build/dist/host/cli-adapters/attachment-utils.d.ts.map +1 -1
  427. package/data/build/dist/host/cli-adapters/attachment-utils.js +9 -8
  428. package/data/build/dist/host/cli-adapters/attachment-utils.js.map +1 -1
  429. package/data/build/dist/host/cli-adapters/binary-detection.d.ts.map +1 -1
  430. package/data/build/dist/host/cli-adapters/binary-detection.js +7 -3
  431. package/data/build/dist/host/cli-adapters/binary-detection.js.map +1 -1
  432. package/data/build/dist/host/cli-adapters/claude-driver.d.ts +1 -0
  433. package/data/build/dist/host/cli-adapters/claude-driver.d.ts.map +1 -1
  434. package/data/build/dist/host/cli-adapters/claude-driver.js +184 -21
  435. package/data/build/dist/host/cli-adapters/claude-driver.js.map +1 -1
  436. package/data/build/dist/host/cli-adapters/codex-driver.d.ts +28 -1
  437. package/data/build/dist/host/cli-adapters/codex-driver.d.ts.map +1 -1
  438. package/data/build/dist/host/cli-adapters/codex-driver.js +198 -34
  439. package/data/build/dist/host/cli-adapters/codex-driver.js.map +1 -1
  440. package/data/build/dist/host/cli-adapters/codex-performance-projection.d.ts +91 -0
  441. package/data/build/dist/host/cli-adapters/codex-performance-projection.d.ts.map +1 -0
  442. package/data/build/dist/host/cli-adapters/codex-performance-projection.js +8 -0
  443. package/data/build/dist/host/cli-adapters/codex-performance-projection.js.map +1 -0
  444. package/data/build/dist/host/cli-adapters/codex-performance.d.ts +16 -0
  445. package/data/build/dist/host/cli-adapters/codex-performance.d.ts.map +1 -0
  446. package/data/build/dist/host/cli-adapters/codex-performance.js +81 -0
  447. package/data/build/dist/host/cli-adapters/codex-performance.js.map +1 -0
  448. package/data/build/dist/host/cli-adapters/command-code-acp-loader.d.ts +12 -2
  449. package/data/build/dist/host/cli-adapters/command-code-acp-loader.d.ts.map +1 -1
  450. package/data/build/dist/host/cli-adapters/command-code-acp-loader.js +158 -3
  451. package/data/build/dist/host/cli-adapters/command-code-acp-loader.js.map +1 -1
  452. package/data/build/dist/host/cli-adapters/command-code-driver.d.ts +8 -2
  453. package/data/build/dist/host/cli-adapters/command-code-driver.d.ts.map +1 -1
  454. package/data/build/dist/host/cli-adapters/command-code-driver.js +39 -7
  455. package/data/build/dist/host/cli-adapters/command-code-driver.js.map +1 -1
  456. package/data/build/dist/host/cli-adapters/command-code-history.d.ts +27 -0
  457. package/data/build/dist/host/cli-adapters/command-code-history.d.ts.map +1 -1
  458. package/data/build/dist/host/cli-adapters/command-code-history.js +131 -1
  459. package/data/build/dist/host/cli-adapters/command-code-history.js.map +1 -1
  460. package/data/build/dist/host/cli-adapters/delegation-mention-rewrite.js +9 -9
  461. package/data/build/dist/host/cli-adapters/delegation-mention-rewrite.js.map +1 -1
  462. package/data/build/dist/host/cli-adapters/desktop-app-runtime.d.ts +3 -1
  463. package/data/build/dist/host/cli-adapters/desktop-app-runtime.d.ts.map +1 -1
  464. package/data/build/dist/host/cli-adapters/desktop-app-runtime.js +41 -4
  465. package/data/build/dist/host/cli-adapters/desktop-app-runtime.js.map +1 -1
  466. package/data/build/dist/host/cli-adapters/driver.d.ts +2 -0
  467. package/data/build/dist/host/cli-adapters/driver.d.ts.map +1 -1
  468. package/data/build/dist/host/cli-adapters/dsh-message-projector.d.ts +16 -1
  469. package/data/build/dist/host/cli-adapters/dsh-message-projector.d.ts.map +1 -1
  470. package/data/build/dist/host/cli-adapters/dsh-message-projector.js +120 -13
  471. package/data/build/dist/host/cli-adapters/dsh-message-projector.js.map +1 -1
  472. package/data/build/dist/host/cli-adapters/dsh-tool-history.js +3 -2
  473. package/data/build/dist/host/cli-adapters/dsh-tool-history.js.map +1 -1
  474. package/data/build/dist/host/cli-adapters/dsh-virtual-providers.d.ts.map +1 -1
  475. package/data/build/dist/host/cli-adapters/dsh-virtual-providers.js +3 -2
  476. package/data/build/dist/host/cli-adapters/dsh-virtual-providers.js.map +1 -1
  477. package/data/build/dist/host/cli-adapters/feature.d.ts +4 -0
  478. package/data/build/dist/host/cli-adapters/feature.d.ts.map +1 -1
  479. package/data/build/dist/host/cli-adapters/feature.js +806 -53
  480. package/data/build/dist/host/cli-adapters/feature.js.map +1 -1
  481. package/data/build/dist/host/cli-adapters/gemini-driver.d.ts.map +1 -1
  482. package/data/build/dist/host/cli-adapters/gemini-driver.js +5 -3
  483. package/data/build/dist/host/cli-adapters/gemini-driver.js.map +1 -1
  484. package/data/build/dist/host/cli-adapters/grok-driver.d.ts +7 -0
  485. package/data/build/dist/host/cli-adapters/grok-driver.d.ts.map +1 -1
  486. package/data/build/dist/host/cli-adapters/grok-driver.js +558 -98
  487. package/data/build/dist/host/cli-adapters/grok-driver.js.map +1 -1
  488. package/data/build/dist/host/cli-adapters/grok-performance-projection.d.ts +123 -0
  489. package/data/build/dist/host/cli-adapters/grok-performance-projection.d.ts.map +1 -0
  490. package/data/build/dist/host/cli-adapters/grok-performance-projection.js +48 -0
  491. package/data/build/dist/host/cli-adapters/grok-performance-projection.js.map +1 -0
  492. package/data/build/dist/host/cli-adapters/grok-usage.d.ts +45 -0
  493. package/data/build/dist/host/cli-adapters/grok-usage.d.ts.map +1 -0
  494. package/data/build/dist/host/cli-adapters/grok-usage.js +197 -0
  495. package/data/build/dist/host/cli-adapters/grok-usage.js.map +1 -0
  496. package/data/build/dist/host/cli-adapters/kimi-driver.js +2 -2
  497. package/data/build/dist/host/cli-adapters/kimi-driver.js.map +1 -1
  498. package/data/build/dist/host/cli-adapters/legacy-session-adapter.d.ts.map +1 -1
  499. package/data/build/dist/host/cli-adapters/legacy-session-adapter.js +20 -3
  500. package/data/build/dist/host/cli-adapters/legacy-session-adapter.js.map +1 -1
  501. package/data/build/dist/host/cli-adapters/legacy-session-settings.d.ts.map +1 -1
  502. package/data/build/dist/host/cli-adapters/legacy-session-settings.js +7 -2
  503. package/data/build/dist/host/cli-adapters/legacy-session-settings.js.map +1 -1
  504. package/data/build/dist/host/cli-adapters/magpie-session-routing.d.ts +9 -0
  505. package/data/build/dist/host/cli-adapters/magpie-session-routing.d.ts.map +1 -0
  506. package/data/build/dist/host/cli-adapters/magpie-session-routing.js +90 -0
  507. package/data/build/dist/host/cli-adapters/magpie-session-routing.js.map +1 -0
  508. package/data/build/dist/host/cli-adapters/magpie-usage.d.ts +90 -0
  509. package/data/build/dist/host/cli-adapters/magpie-usage.d.ts.map +1 -0
  510. package/data/build/dist/host/cli-adapters/magpie-usage.js +986 -0
  511. package/data/build/dist/host/cli-adapters/magpie-usage.js.map +1 -0
  512. package/data/build/dist/host/cli-adapters/management-installation.d.ts +5 -0
  513. package/data/build/dist/host/cli-adapters/management-installation.d.ts.map +1 -0
  514. package/data/build/dist/host/cli-adapters/management-installation.js +131 -0
  515. package/data/build/dist/host/cli-adapters/management-installation.js.map +1 -0
  516. package/data/build/dist/host/cli-adapters/management-methods.d.ts +37 -0
  517. package/data/build/dist/host/cli-adapters/management-methods.d.ts.map +1 -0
  518. package/data/build/dist/host/cli-adapters/management-methods.js +144 -0
  519. package/data/build/dist/host/cli-adapters/management-methods.js.map +1 -0
  520. package/data/build/dist/host/cli-adapters/management-process.d.ts +7 -0
  521. package/data/build/dist/host/cli-adapters/management-process.d.ts.map +1 -0
  522. package/data/build/dist/host/cli-adapters/management-process.js +62 -0
  523. package/data/build/dist/host/cli-adapters/management-process.js.map +1 -0
  524. package/data/build/dist/host/cli-adapters/management.d.ts +32 -0
  525. package/data/build/dist/host/cli-adapters/management.d.ts.map +1 -0
  526. package/data/build/dist/host/cli-adapters/management.js +177 -0
  527. package/data/build/dist/host/cli-adapters/management.js.map +1 -0
  528. package/data/build/dist/host/cli-adapters/mcode-driver.d.ts.map +1 -1
  529. package/data/build/dist/host/cli-adapters/mcode-driver.js +12 -5
  530. package/data/build/dist/host/cli-adapters/mcode-driver.js.map +1 -1
  531. package/data/build/dist/host/cli-adapters/model-catalog.d.ts +1 -0
  532. package/data/build/dist/host/cli-adapters/model-catalog.d.ts.map +1 -1
  533. package/data/build/dist/host/cli-adapters/model-catalog.js +70 -7
  534. package/data/build/dist/host/cli-adapters/model-catalog.js.map +1 -1
  535. package/data/build/dist/host/cli-adapters/native-subagent-dispatch.d.ts +1 -1
  536. package/data/build/dist/host/cli-adapters/native-subagent-dispatch.d.ts.map +1 -1
  537. package/data/build/dist/host/cli-adapters/native-subagent-dispatch.js +13 -5
  538. package/data/build/dist/host/cli-adapters/native-subagent-dispatch.js.map +1 -1
  539. package/data/build/dist/host/cli-adapters/native-team-subagent.d.ts +7 -1
  540. package/data/build/dist/host/cli-adapters/native-team-subagent.d.ts.map +1 -1
  541. package/data/build/dist/host/cli-adapters/native-team-subagent.js +6 -3
  542. package/data/build/dist/host/cli-adapters/native-team-subagent.js.map +1 -1
  543. package/data/build/dist/host/cli-adapters/opencode-driver.d.ts +26 -2
  544. package/data/build/dist/host/cli-adapters/opencode-driver.d.ts.map +1 -1
  545. package/data/build/dist/host/cli-adapters/opencode-driver.js +183 -48
  546. package/data/build/dist/host/cli-adapters/opencode-driver.js.map +1 -1
  547. package/data/build/dist/host/cli-adapters/opencode-v2-protocol.d.ts +1 -1
  548. package/data/build/dist/host/cli-adapters/opencode-v2-protocol.d.ts.map +1 -1
  549. package/data/build/dist/host/cli-adapters/opencode-v2-protocol.js +67 -7
  550. package/data/build/dist/host/cli-adapters/opencode-v2-protocol.js.map +1 -1
  551. package/data/build/dist/host/cli-adapters/pi-driver.d.ts.map +1 -1
  552. package/data/build/dist/host/cli-adapters/pi-driver.js +45 -11
  553. package/data/build/dist/host/cli-adapters/pi-driver.js.map +1 -1
  554. package/data/build/dist/host/cli-adapters/process-utils.d.ts +2 -0
  555. package/data/build/dist/host/cli-adapters/process-utils.d.ts.map +1 -1
  556. package/data/build/dist/host/cli-adapters/process-utils.js +16 -11
  557. package/data/build/dist/host/cli-adapters/process-utils.js.map +1 -1
  558. package/data/build/dist/host/cli-adapters/provider-subscription.d.ts +5 -1
  559. package/data/build/dist/host/cli-adapters/provider-subscription.d.ts.map +1 -1
  560. package/data/build/dist/host/cli-adapters/provider-subscription.js +90 -25
  561. package/data/build/dist/host/cli-adapters/provider-subscription.js.map +1 -1
  562. package/data/build/dist/host/cli-adapters/registry.d.ts +7 -1
  563. package/data/build/dist/host/cli-adapters/registry.d.ts.map +1 -1
  564. package/data/build/dist/host/cli-adapters/registry.js +163 -56
  565. package/data/build/dist/host/cli-adapters/registry.js.map +1 -1
  566. package/data/build/dist/host/cli-adapters/session-performance-projection.d.ts +74 -0
  567. package/data/build/dist/host/cli-adapters/session-performance-projection.d.ts.map +1 -0
  568. package/data/build/dist/host/cli-adapters/session-performance-projection.js +83 -0
  569. package/data/build/dist/host/cli-adapters/session-performance-projection.js.map +1 -0
  570. package/data/build/dist/host/cli-adapters/session-store.d.ts +1 -0
  571. package/data/build/dist/host/cli-adapters/session-store.d.ts.map +1 -1
  572. package/data/build/dist/host/cli-adapters/session-store.js +3 -0
  573. package/data/build/dist/host/cli-adapters/session-store.js.map +1 -1
  574. package/data/build/dist/host/cli-adapters/standard-stream-driver.d.ts.map +1 -1
  575. package/data/build/dist/host/cli-adapters/standard-stream-driver.js +4 -0
  576. package/data/build/dist/host/cli-adapters/standard-stream-driver.js.map +1 -1
  577. package/data/build/dist/host/cli-adapters/stream-normalizer.d.ts +3 -1
  578. package/data/build/dist/host/cli-adapters/stream-normalizer.d.ts.map +1 -1
  579. package/data/build/dist/host/cli-adapters/stream-normalizer.js +2 -0
  580. package/data/build/dist/host/cli-adapters/stream-normalizer.js.map +1 -1
  581. package/data/build/dist/host/cli-adapters/subagent-tool-descriptions.d.ts +26 -0
  582. package/data/build/dist/host/cli-adapters/subagent-tool-descriptions.d.ts.map +1 -0
  583. package/data/build/dist/host/cli-adapters/subagent-tool-descriptions.js +30 -0
  584. package/data/build/dist/host/cli-adapters/subagent-tool-descriptions.js.map +1 -0
  585. package/data/build/dist/host/cli-adapters/subagent-tool.d.ts.map +1 -1
  586. package/data/build/dist/host/cli-adapters/subagent-tool.js +7 -6
  587. package/data/build/dist/host/cli-adapters/subagent-tool.js.map +1 -1
  588. package/data/build/dist/host/cli-adapters/team-input.d.ts +17 -0
  589. package/data/build/dist/host/cli-adapters/team-input.d.ts.map +1 -0
  590. package/data/build/dist/host/cli-adapters/team-input.js +67 -0
  591. package/data/build/dist/host/cli-adapters/team-input.js.map +1 -0
  592. package/data/build/dist/host/cli-adapters/update-check.d.ts +34 -0
  593. package/data/build/dist/host/cli-adapters/update-check.d.ts.map +1 -0
  594. package/data/build/dist/host/cli-adapters/update-check.js +263 -0
  595. package/data/build/dist/host/cli-adapters/update-check.js.map +1 -0
  596. package/data/build/dist/host/cli-adapters/zcode-driver.d.ts.map +1 -1
  597. package/data/build/dist/host/cli-adapters/zcode-driver.js +7 -2
  598. package/data/build/dist/host/cli-adapters/zcode-driver.js.map +1 -1
  599. package/data/build/dist/host/cli-adapters/zcode-update.d.ts +8 -0
  600. package/data/build/dist/host/cli-adapters/zcode-update.d.ts.map +1 -0
  601. package/data/build/dist/host/cli-adapters/zcode-update.js +149 -0
  602. package/data/build/dist/host/cli-adapters/zcode-update.js.map +1 -0
  603. package/data/build/dist/host/cli-bridge/bridge-holder.d.ts +14 -0
  604. package/data/build/dist/host/cli-bridge/bridge-holder.d.ts.map +1 -1
  605. package/data/build/dist/host/cli-bridge/bridge-holder.js +53 -6
  606. package/data/build/dist/host/cli-bridge/bridge-holder.js.map +1 -1
  607. package/data/build/dist/host/cli-bridge/bridge-server.d.ts +8 -0
  608. package/data/build/dist/host/cli-bridge/bridge-server.d.ts.map +1 -1
  609. package/data/build/dist/host/cli-bridge/bridge-server.js +65 -8
  610. package/data/build/dist/host/cli-bridge/bridge-server.js.map +1 -1
  611. package/data/build/dist/host/cli-bridge/command-code-mod.d.ts.map +1 -1
  612. package/data/build/dist/host/cli-bridge/command-code-mod.js +149 -21
  613. package/data/build/dist/host/cli-bridge/command-code-mod.js.map +1 -1
  614. package/data/build/dist/host/cli-bridge/dispatch.js +20 -20
  615. package/data/build/dist/host/cli-bridge/dispatch.js.map +1 -1
  616. package/data/build/dist/host/cli-bridge/fetch-dispatch.d.ts +23 -0
  617. package/data/build/dist/host/cli-bridge/fetch-dispatch.d.ts.map +1 -0
  618. package/data/build/dist/host/cli-bridge/fetch-dispatch.js +73 -0
  619. package/data/build/dist/host/cli-bridge/fetch-dispatch.js.map +1 -0
  620. package/data/build/dist/host/cli-bridge/injections.d.ts +46 -0
  621. package/data/build/dist/host/cli-bridge/injections.d.ts.map +1 -1
  622. package/data/build/dist/host/cli-bridge/injections.js +205 -7
  623. package/data/build/dist/host/cli-bridge/injections.js.map +1 -1
  624. package/data/build/dist/host/cli-bridge/mcp-stdio-entry.d.ts +1 -1
  625. package/data/build/dist/host/cli-bridge/mcp-stdio-entry.js +122 -27
  626. package/data/build/dist/host/cli-bridge/mcp-stdio-entry.js.map +1 -1
  627. package/data/build/dist/host/cli-bridge/pi-extension-entry.d.ts +3 -0
  628. package/data/build/dist/host/cli-bridge/pi-extension-entry.d.ts.map +1 -0
  629. package/data/build/dist/host/cli-bridge/pi-extension-entry.js +9 -0
  630. package/data/build/dist/host/cli-bridge/pi-extension-entry.js.map +1 -0
  631. package/data/build/dist/host/cli-bridge/pi-extension.d.ts +52 -0
  632. package/data/build/dist/host/cli-bridge/pi-extension.d.ts.map +1 -0
  633. package/data/build/dist/host/cli-bridge/pi-extension.js +311 -0
  634. package/data/build/dist/host/cli-bridge/pi-extension.js.map +1 -0
  635. package/data/build/dist/host/cli-bridge/search-dispatch.d.ts +20 -0
  636. package/data/build/dist/host/cli-bridge/search-dispatch.d.ts.map +1 -0
  637. package/data/build/dist/host/cli-bridge/search-dispatch.js +61 -0
  638. package/data/build/dist/host/cli-bridge/search-dispatch.js.map +1 -0
  639. package/data/build/dist/host/cli-bridge/team-adapters.d.ts +11 -0
  640. package/data/build/dist/host/cli-bridge/team-adapters.d.ts.map +1 -0
  641. package/data/build/dist/host/cli-bridge/team-adapters.js +23 -0
  642. package/data/build/dist/host/cli-bridge/team-adapters.js.map +1 -0
  643. package/data/build/dist/host/cli-bridge/team-dispatch.d.ts +28 -0
  644. package/data/build/dist/host/cli-bridge/team-dispatch.d.ts.map +1 -0
  645. package/data/build/dist/host/cli-bridge/team-dispatch.js +208 -0
  646. package/data/build/dist/host/cli-bridge/team-dispatch.js.map +1 -0
  647. package/data/build/dist/host/cli-bridge/team-tool.d.ts +3 -0
  648. package/data/build/dist/host/cli-bridge/team-tool.d.ts.map +1 -0
  649. package/data/build/dist/host/cli-bridge/team-tool.js +18 -0
  650. package/data/build/dist/host/cli-bridge/team-tool.js.map +1 -0
  651. package/data/build/dist/host/desktop-assistant/controller.d.ts +1 -0
  652. package/data/build/dist/host/desktop-assistant/controller.d.ts.map +1 -1
  653. package/data/build/dist/host/desktop-assistant/controller.js +21 -3
  654. package/data/build/dist/host/desktop-assistant/controller.js.map +1 -1
  655. package/data/build/dist/host/desktop-assistant/mac-agent.d.ts.map +1 -1
  656. package/data/build/dist/host/desktop-assistant/mac-agent.js +15 -3
  657. package/data/build/dist/host/desktop-assistant/mac-agent.js.map +1 -1
  658. package/data/build/dist/host/desktop-assistant/win-agent.d.ts.map +1 -1
  659. package/data/build/dist/host/desktop-assistant/win-agent.js +21 -3
  660. package/data/build/dist/host/desktop-assistant/win-agent.js.map +1 -1
  661. package/data/build/dist/host/features/assistant-notifications.d.ts.map +1 -1
  662. package/data/build/dist/host/features/assistant-notifications.js +12 -4
  663. package/data/build/dist/host/features/assistant-notifications.js.map +1 -1
  664. package/data/build/dist/host/features/file-management.d.ts.map +1 -1
  665. package/data/build/dist/host/features/file-management.js +10 -1
  666. package/data/build/dist/host/features/file-management.js.map +1 -1
  667. package/data/build/dist/host/features/git-commit-message.d.ts +5 -0
  668. package/data/build/dist/host/features/git-commit-message.d.ts.map +1 -0
  669. package/data/build/dist/host/features/git-commit-message.js +66 -0
  670. package/data/build/dist/host/features/git-commit-message.js.map +1 -0
  671. package/data/build/dist/host/features/git-management.d.ts +11 -2
  672. package/data/build/dist/host/features/git-management.d.ts.map +1 -1
  673. package/data/build/dist/host/features/git-management.js +61 -7
  674. package/data/build/dist/host/features/git-management.js.map +1 -1
  675. package/data/build/dist/host/features/global-voice-rpc.d.ts.map +1 -1
  676. package/data/build/dist/host/features/global-voice-rpc.js +2 -3
  677. package/data/build/dist/host/features/global-voice-rpc.js.map +1 -1
  678. package/data/build/dist/host/features/index.d.ts +1 -0
  679. package/data/build/dist/host/features/index.d.ts.map +1 -1
  680. package/data/build/dist/host/features/index.js +5 -0
  681. package/data/build/dist/host/features/index.js.map +1 -1
  682. package/data/build/dist/host/features/interaction-translation.d.ts +10 -0
  683. package/data/build/dist/host/features/interaction-translation.d.ts.map +1 -0
  684. package/data/build/dist/host/features/interaction-translation.js +219 -0
  685. package/data/build/dist/host/features/interaction-translation.js.map +1 -0
  686. package/data/build/dist/host/features/lan-access-dsh.d.ts.map +1 -1
  687. package/data/build/dist/host/features/lan-access-dsh.js +3 -3
  688. package/data/build/dist/host/features/lan-access-dsh.js.map +1 -1
  689. package/data/build/dist/host/features/peer-host.d.ts.map +1 -1
  690. package/data/build/dist/host/features/peer-host.js +24 -10
  691. package/data/build/dist/host/features/peer-host.js.map +1 -1
  692. package/data/build/dist/host/features/quick-apps.d.ts +4 -0
  693. package/data/build/dist/host/features/quick-apps.d.ts.map +1 -0
  694. package/data/build/dist/host/features/quick-apps.js +158 -0
  695. package/data/build/dist/host/features/quick-apps.js.map +1 -0
  696. package/data/build/dist/host/features/session-prompt-translation.d.ts +10 -0
  697. package/data/build/dist/host/features/session-prompt-translation.d.ts.map +1 -0
  698. package/data/build/dist/host/features/session-prompt-translation.js +227 -0
  699. package/data/build/dist/host/features/session-prompt-translation.js.map +1 -0
  700. package/data/build/dist/host/features/session-translation-protection.d.ts +22 -0
  701. package/data/build/dist/host/features/session-translation-protection.d.ts.map +1 -0
  702. package/data/build/dist/host/features/session-translation-protection.js +204 -0
  703. package/data/build/dist/host/features/session-translation-protection.js.map +1 -0
  704. package/data/build/dist/host/features/session-translation-recovery.d.ts +21 -0
  705. package/data/build/dist/host/features/session-translation-recovery.d.ts.map +1 -0
  706. package/data/build/dist/host/features/session-translation-recovery.js +125 -0
  707. package/data/build/dist/host/features/session-translation-recovery.js.map +1 -0
  708. package/data/build/dist/host/features/session-translation-runtime.d.ts +16 -0
  709. package/data/build/dist/host/features/session-translation-runtime.d.ts.map +1 -0
  710. package/data/build/dist/host/features/session-translation-runtime.js +85 -0
  711. package/data/build/dist/host/features/session-translation-runtime.js.map +1 -0
  712. package/data/build/dist/host/features/session-translation-service.d.ts +46 -0
  713. package/data/build/dist/host/features/session-translation-service.d.ts.map +1 -0
  714. package/data/build/dist/host/features/session-translation-service.js +490 -0
  715. package/data/build/dist/host/features/session-translation-service.js.map +1 -0
  716. package/data/build/dist/host/features/session-translation.d.ts +5 -0
  717. package/data/build/dist/host/features/session-translation.d.ts.map +1 -0
  718. package/data/build/dist/host/features/session-translation.js +40 -0
  719. package/data/build/dist/host/features/session-translation.js.map +1 -0
  720. package/data/build/dist/host/features/types.d.ts +13 -0
  721. package/data/build/dist/host/features/types.d.ts.map +1 -1
  722. package/data/build/dist/host/html-workspace-files.d.ts +3 -0
  723. package/data/build/dist/host/html-workspace-files.d.ts.map +1 -0
  724. package/data/build/dist/host/html-workspace-files.js +135 -0
  725. package/data/build/dist/host/html-workspace-files.js.map +1 -0
  726. package/data/build/dist/host/image-artifact-store.d.ts +21 -0
  727. package/data/build/dist/host/image-artifact-store.d.ts.map +1 -0
  728. package/data/build/dist/host/image-artifact-store.js +136 -0
  729. package/data/build/dist/host/image-artifact-store.js.map +1 -0
  730. package/data/build/dist/host/index.d.ts.map +1 -1
  731. package/data/build/dist/host/index.js +35 -39
  732. package/data/build/dist/host/index.js.map +1 -1
  733. package/data/build/dist/host/lan-access-dsh.d.ts +14 -2
  734. package/data/build/dist/host/lan-access-dsh.d.ts.map +1 -1
  735. package/data/build/dist/host/lan-access-dsh.js +81 -13
  736. package/data/build/dist/host/lan-access-dsh.js.map +1 -1
  737. package/data/build/dist/host/modules/peer-host/peer-host-native-dispatch.d.ts +2 -2
  738. package/data/build/dist/host/modules/peer-host/peer-host-native-dispatch.d.ts.map +1 -1
  739. package/data/build/dist/host/modules/peer-host/peer-host-native-dispatch.js +10 -9
  740. package/data/build/dist/host/modules/peer-host/peer-host-native-dispatch.js.map +1 -1
  741. package/data/build/dist/host/modules/peer-host/peer-host-native-protocol.d.ts +1 -1
  742. package/data/build/dist/host/modules/peer-host/peer-host-native-protocol.d.ts.map +1 -1
  743. package/data/build/dist/host/modules/peer-host/peer-host-native-protocol.js +2 -0
  744. package/data/build/dist/host/modules/peer-host/peer-host-native-protocol.js.map +1 -1
  745. package/data/build/dist/host/modules/peer-host/peer-host-native-streams.d.ts +3 -3
  746. package/data/build/dist/host/modules/peer-host/peer-host-native-streams.d.ts.map +1 -1
  747. package/data/build/dist/host/modules/peer-host/peer-host-native-streams.js +26 -14
  748. package/data/build/dist/host/modules/peer-host/peer-host-native-streams.js.map +1 -1
  749. package/data/build/dist/host/modules/peer-host/quick-app-gateway.d.ts +5 -0
  750. package/data/build/dist/host/modules/peer-host/quick-app-gateway.d.ts.map +1 -0
  751. package/data/build/dist/host/modules/peer-host/quick-app-gateway.js +27 -0
  752. package/data/build/dist/host/modules/peer-host/quick-app-gateway.js.map +1 -0
  753. package/data/build/dist/host/modules/quick-apps/browse.d.ts +5 -0
  754. package/data/build/dist/host/modules/quick-apps/browse.d.ts.map +1 -0
  755. package/data/build/dist/host/modules/quick-apps/browse.js +37 -0
  756. package/data/build/dist/host/modules/quick-apps/browse.js.map +1 -0
  757. package/data/build/dist/host/modules/quick-apps/code-revision.d.ts +4 -0
  758. package/data/build/dist/host/modules/quick-apps/code-revision.d.ts.map +1 -0
  759. package/data/build/dist/host/modules/quick-apps/code-revision.js +39 -0
  760. package/data/build/dist/host/modules/quick-apps/code-revision.js.map +1 -0
  761. package/data/build/dist/host/modules/quick-apps/documents.d.ts +14 -0
  762. package/data/build/dist/host/modules/quick-apps/documents.d.ts.map +1 -0
  763. package/data/build/dist/host/modules/quick-apps/documents.js +87 -0
  764. package/data/build/dist/host/modules/quick-apps/documents.js.map +1 -0
  765. package/data/build/dist/host/modules/quick-apps/egress.d.ts +35 -0
  766. package/data/build/dist/host/modules/quick-apps/egress.d.ts.map +1 -0
  767. package/data/build/dist/host/modules/quick-apps/egress.js +244 -0
  768. package/data/build/dist/host/modules/quick-apps/egress.js.map +1 -0
  769. package/data/build/dist/host/modules/quick-apps/errors.d.ts +8 -0
  770. package/data/build/dist/host/modules/quick-apps/errors.d.ts.map +1 -0
  771. package/data/build/dist/host/modules/quick-apps/errors.js +15 -0
  772. package/data/build/dist/host/modules/quick-apps/errors.js.map +1 -0
  773. package/data/build/dist/host/modules/quick-apps/file-api.d.ts +30 -0
  774. package/data/build/dist/host/modules/quick-apps/file-api.d.ts.map +1 -0
  775. package/data/build/dist/host/modules/quick-apps/file-api.js +149 -0
  776. package/data/build/dist/host/modules/quick-apps/file-api.js.map +1 -0
  777. package/data/build/dist/host/modules/quick-apps/launches.d.ts +35 -0
  778. package/data/build/dist/host/modules/quick-apps/launches.d.ts.map +1 -0
  779. package/data/build/dist/host/modules/quick-apps/launches.js +80 -0
  780. package/data/build/dist/host/modules/quick-apps/launches.js.map +1 -0
  781. package/data/build/dist/host/modules/quick-apps/paths.d.ts +14 -0
  782. package/data/build/dist/host/modules/quick-apps/paths.d.ts.map +1 -0
  783. package/data/build/dist/host/modules/quick-apps/paths.js +72 -0
  784. package/data/build/dist/host/modules/quick-apps/paths.js.map +1 -0
  785. package/data/build/dist/host/modules/quick-apps/registry.d.ts +30 -0
  786. package/data/build/dist/host/modules/quick-apps/registry.d.ts.map +1 -0
  787. package/data/build/dist/host/modules/quick-apps/registry.js +195 -0
  788. package/data/build/dist/host/modules/quick-apps/registry.js.map +1 -0
  789. package/data/build/dist/host/modules/quick-apps/remote.d.ts +38 -0
  790. package/data/build/dist/host/modules/quick-apps/remote.d.ts.map +1 -0
  791. package/data/build/dist/host/modules/quick-apps/remote.js +238 -0
  792. package/data/build/dist/host/modules/quick-apps/remote.js.map +1 -0
  793. package/data/build/dist/host/modules/quick-apps/service.d.ts +27 -0
  794. package/data/build/dist/host/modules/quick-apps/service.d.ts.map +1 -0
  795. package/data/build/dist/host/modules/quick-apps/service.js +174 -0
  796. package/data/build/dist/host/modules/quick-apps/service.js.map +1 -0
  797. package/data/build/dist/host/modules/quick-apps/static-handler.d.ts +8 -0
  798. package/data/build/dist/host/modules/quick-apps/static-handler.d.ts.map +1 -0
  799. package/data/build/dist/host/modules/quick-apps/static-handler.js +213 -0
  800. package/data/build/dist/host/modules/quick-apps/static-handler.js.map +1 -0
  801. package/data/build/dist/host/native-session-bridge.d.ts +23 -2
  802. package/data/build/dist/host/native-session-bridge.d.ts.map +1 -1
  803. package/data/build/dist/host/native-session-bridge.js +57 -15
  804. package/data/build/dist/host/native-session-bridge.js.map +1 -1
  805. package/data/build/dist/host/rpc.d.ts.map +1 -1
  806. package/data/build/dist/host/rpc.js +24 -13
  807. package/data/build/dist/host/rpc.js.map +1 -1
  808. package/data/build/dist/host/session-changes.d.ts.map +1 -1
  809. package/data/build/dist/host/session-changes.js +201 -14
  810. package/data/build/dist/host/session-changes.js.map +1 -1
  811. package/data/build/dist/host/session-migration-repair.js +48 -35
  812. package/data/build/dist/host/session-migration-repair.js.map +1 -1
  813. package/data/build/dist/host/settings.d.ts.map +1 -1
  814. package/data/build/dist/host/settings.js +37 -0
  815. package/data/build/dist/host/settings.js.map +1 -1
  816. package/data/build/dist/host/workspace-file-mutations.d.ts +2 -0
  817. package/data/build/dist/host/workspace-file-mutations.d.ts.map +1 -0
  818. package/data/build/dist/host/workspace-file-mutations.js +15 -0
  819. package/data/build/dist/host/workspace-file-mutations.js.map +1 -0
  820. package/data/build/dist/host/workspace-root.d.ts +14 -0
  821. package/data/build/dist/host/workspace-root.d.ts.map +1 -0
  822. package/data/build/dist/host/workspace-root.js +99 -0
  823. package/data/build/dist/host/workspace-root.js.map +1 -0
  824. package/data/build/dist/shared/assistant-notifications.d.ts +2 -2
  825. package/data/build/dist/shared/assistant-notifications.d.ts.map +1 -1
  826. package/data/build/dist/shared/attachment-prompts.d.ts +11 -0
  827. package/data/build/dist/shared/attachment-prompts.d.ts.map +1 -0
  828. package/data/build/dist/shared/attachment-prompts.js +17 -0
  829. package/data/build/dist/shared/attachment-prompts.js.map +1 -0
  830. package/data/build/dist/shared/cli-provider-route.d.ts +7 -0
  831. package/data/build/dist/shared/cli-provider-route.d.ts.map +1 -0
  832. package/data/build/dist/shared/cli-provider-route.js +13 -0
  833. package/data/build/dist/shared/cli-provider-route.js.map +1 -0
  834. package/data/build/dist/shared/codex-performance.d.ts +3 -0
  835. package/data/build/dist/shared/codex-performance.d.ts.map +1 -0
  836. package/data/build/dist/shared/codex-performance.js +2 -0
  837. package/data/build/dist/shared/codex-performance.js.map +1 -0
  838. package/data/build/dist/shared/contracts/agent-team.d.ts +14 -0
  839. package/data/build/dist/shared/contracts/agent-team.d.ts.map +1 -0
  840. package/data/build/dist/shared/contracts/agent-team.js +48 -0
  841. package/data/build/dist/shared/contracts/agent-team.js.map +1 -0
  842. package/data/build/dist/shared/contracts/cli-adapter.d.ts +86 -2
  843. package/data/build/dist/shared/contracts/cli-adapter.d.ts.map +1 -1
  844. package/data/build/dist/shared/contracts/cli-management.d.ts +29 -0
  845. package/data/build/dist/shared/contracts/cli-management.d.ts.map +1 -0
  846. package/data/build/dist/shared/contracts/cli-management.js +2 -0
  847. package/data/build/dist/shared/contracts/cli-management.js.map +1 -0
  848. package/data/build/dist/shared/contracts/config.d.ts +13 -1
  849. package/data/build/dist/shared/contracts/config.d.ts.map +1 -1
  850. package/data/build/dist/shared/contracts/config.js +6 -0
  851. package/data/build/dist/shared/contracts/config.js.map +1 -1
  852. package/data/build/dist/shared/contracts/errors.d.ts +2 -2
  853. package/data/build/dist/shared/contracts/errors.d.ts.map +1 -1
  854. package/data/build/dist/shared/contracts/git.d.ts +17 -0
  855. package/data/build/dist/shared/contracts/git.d.ts.map +1 -1
  856. package/data/build/dist/shared/contracts/git.js +27 -1
  857. package/data/build/dist/shared/contracts/git.js.map +1 -1
  858. package/data/build/dist/shared/contracts/interaction-presentation.d.ts +32 -0
  859. package/data/build/dist/shared/contracts/interaction-presentation.d.ts.map +1 -0
  860. package/data/build/dist/shared/contracts/interaction-presentation.js +2 -0
  861. package/data/build/dist/shared/contracts/interaction-presentation.js.map +1 -0
  862. package/data/build/dist/shared/contracts/interaction-translation.d.ts +53 -0
  863. package/data/build/dist/shared/contracts/interaction-translation.d.ts.map +1 -0
  864. package/data/build/dist/shared/contracts/interaction-translation.js +44 -0
  865. package/data/build/dist/shared/contracts/interaction-translation.js.map +1 -0
  866. package/data/build/dist/shared/contracts/quick-apps.d.ts +70 -0
  867. package/data/build/dist/shared/contracts/quick-apps.d.ts.map +1 -0
  868. package/data/build/dist/shared/contracts/quick-apps.js +4 -0
  869. package/data/build/dist/shared/contracts/quick-apps.js.map +1 -0
  870. package/data/build/dist/shared/contracts/session-translation.d.ts +131 -0
  871. package/data/build/dist/shared/contracts/session-translation.d.ts.map +1 -0
  872. package/data/build/dist/shared/contracts/session-translation.js +167 -0
  873. package/data/build/dist/shared/contracts/session-translation.js.map +1 -0
  874. package/data/build/dist/shared/contracts/subscription.d.ts +87 -0
  875. package/data/build/dist/shared/contracts/subscription.d.ts.map +1 -1
  876. package/data/build/dist/shared/contracts/subscription.js.map +1 -1
  877. package/data/build/dist/shared/contracts/version.d.ts +9 -15
  878. package/data/build/dist/shared/contracts/version.d.ts.map +1 -1
  879. package/data/build/dist/shared/contracts/version.js +8 -14
  880. package/data/build/dist/shared/contracts/version.js.map +1 -1
  881. package/data/build/dist/shared/delegation-carrier.js +6 -6
  882. package/data/build/dist/shared/delegation-carrier.js.map +1 -1
  883. package/data/build/dist/shared/desktop-assistant.d.ts +10 -4
  884. package/data/build/dist/shared/desktop-assistant.d.ts.map +1 -1
  885. package/data/build/dist/shared/desktop-assistant.js +28 -8
  886. package/data/build/dist/shared/desktop-assistant.js.map +1 -1
  887. package/data/build/dist/shared/index.d.ts +3 -1
  888. package/data/build/dist/shared/index.d.ts.map +1 -1
  889. package/data/build/dist/shared/index.js +3 -1
  890. package/data/build/dist/shared/index.js.map +1 -1
  891. package/data/build/dist/shared/peer-host-http-routes.d.ts +4 -0
  892. package/data/build/dist/shared/peer-host-http-routes.d.ts.map +1 -1
  893. package/data/build/dist/shared/peer-host-http-routes.js +4 -0
  894. package/data/build/dist/shared/peer-host-http-routes.js.map +1 -1
  895. package/data/build/dist/shared/provider-icon-resources.d.ts.map +1 -1
  896. package/data/build/dist/shared/provider-icon-resources.js +1 -0
  897. package/data/build/dist/shared/provider-icon-resources.js.map +1 -1
  898. package/data/build/dist/shared/quick-app-browser-storage.d.ts +33 -0
  899. package/data/build/dist/shared/quick-app-browser-storage.d.ts.map +1 -0
  900. package/data/build/dist/shared/quick-app-browser-storage.js +33 -0
  901. package/data/build/dist/shared/quick-app-browser-storage.js.map +1 -0
  902. package/data/build/dist/shared/quick-app-network-allow.d.ts +8 -0
  903. package/data/build/dist/shared/quick-app-network-allow.d.ts.map +1 -0
  904. package/data/build/dist/shared/quick-app-network-allow.js +192 -0
  905. package/data/build/dist/shared/quick-app-network-allow.js.map +1 -0
  906. package/data/build/dist/shared/quick-app-network-bootstrap.d.ts +9 -0
  907. package/data/build/dist/shared/quick-app-network-bootstrap.d.ts.map +1 -0
  908. package/data/build/dist/shared/quick-app-network-bootstrap.js +134 -0
  909. package/data/build/dist/shared/quick-app-network-bootstrap.js.map +1 -0
  910. package/data/build/dist/shared/quick-app-proxy-path.d.ts +6 -0
  911. package/data/build/dist/shared/quick-app-proxy-path.d.ts.map +1 -0
  912. package/data/build/dist/shared/quick-app-proxy-path.js +18 -0
  913. package/data/build/dist/shared/quick-app-proxy-path.js.map +1 -0
  914. package/data/build/dist/shared/quick-app-storage-bootstrap.d.ts +9 -0
  915. package/data/build/dist/shared/quick-app-storage-bootstrap.d.ts.map +1 -0
  916. package/data/build/dist/shared/quick-app-storage-bootstrap.js +189 -0
  917. package/data/build/dist/shared/quick-app-storage-bootstrap.js.map +1 -0
  918. package/data/build/dist/shared/quick-apps-bootstrap-locale.d.ts +7 -0
  919. package/data/build/dist/shared/quick-apps-bootstrap-locale.d.ts.map +1 -0
  920. package/data/build/dist/shared/quick-apps-bootstrap-locale.js +10 -0
  921. package/data/build/dist/shared/quick-apps-bootstrap-locale.js.map +1 -0
  922. package/data/build/dist/shared/request-performance.d.ts +15 -0
  923. package/data/build/dist/shared/request-performance.d.ts.map +1 -0
  924. package/data/build/dist/shared/request-performance.js +3 -0
  925. package/data/build/dist/shared/request-performance.js.map +1 -0
  926. package/data/build/dist/shared/translation-indicator.d.ts +26 -0
  927. package/data/build/dist/shared/translation-indicator.d.ts.map +1 -0
  928. package/data/build/dist/shared/translation-indicator.js +29 -0
  929. package/data/build/dist/shared/translation-indicator.js.map +1 -0
  930. package/package.json +36 -35
  931. package/profile/README.md +2 -2
  932. package/profile/package.json +3 -3
  933. package/profile/version.json +3 -3
  934. package/version.json +3 -3
  935. package/data/build/dist/client/client.model-catalog-cache.js.map +0 -1
  936. package/data/build/dist/client/peer-host-file-links.d.ts +0 -8
  937. package/data/build/dist/client/peer-host-file-links.d.ts.map +0 -1
  938. package/data/build/dist/client/peer-host-file-links.js.map +0 -1
@@ -1,25 +1,34 @@
1
1
  import { runAsyncCommand } from './process-utils.js';
2
2
  import { spawn, spawnSync } from 'node:child_process';
3
+ import { lstatSync, readFileSync, realpathSync } from 'node:fs';
4
+ import { randomUUID } from 'node:crypto';
3
5
  import { homedir } from 'node:os';
4
- import { basename, join } from 'node:path';
6
+ import { basename, dirname, isAbsolute, join, relative, resolve, sep } from 'node:path';
5
7
  import { JsonRpcProcess } from './json-rpc-process.js';
6
8
  import { detectBinary, emptyCatalog, isRecord, textValue, usageChunk } from './rpc-driver-utils.js';
7
9
  import { GROK_CATALOG, isProviderDefaultModel } from './model-catalog.js';
8
10
  import { isRegularFile, probeStoredSession, resolveSessionDirectory } from './session-probe.js';
9
11
  import { firstToolText, isToolRecord, normalizeToolStatus, serializeToolValue } from './tool-observation.js';
10
12
  import { buildAcpPromptBlocks } from './attachment-utils.js';
11
- import { acpBridgeMcpServers } from '../cli-bridge/injections.js';
13
+ import { acpBridgeMcpServers, bridgeSessionGuidance, subagentBridgeActive, teamBridgeToken } from '../cli-bridge/injections.js';
14
+ import { getSubagentBridge } from '../cli-bridge/bridge-holder.js';
12
15
  import { reasoningText } from './reasoning-content.js';
13
16
  import { ACP_FORM_CLIENT_CAPABILITIES, acpElicitationResponse, readAcpElicitationRequest } from './acp-elicitation.js';
14
17
  import { readAgentQuestions } from './interaction-events.js';
15
18
  import { commandEnvironment, WINDOWS } from './process-utils.js';
19
+ import { imageArtifactPathsFromValue, stripImageMarkdown } from '../image-artifact-store.js';
20
+ import { advanceCodingNsSegment, createCodingNsSegmentState, decorateCodingNsSegmentEvent } from './stream-normalizer.js';
21
+ import { GrokContextUsage, GrokPromptUsage } from './grok-usage.js';
16
22
  /** Grok Build 的 ACP stdio 驱动。ACP 会话和权限细节只在 Host 进程内处理。 */
17
23
  export class GrokBuildDriver {
18
24
  descriptor = { id: 'grok', name: 'Grok Build', protocol: 'acp', capabilities: ['models', 'skills', 'stream', 'tool-events', 'reasoning', 'usage', 'permission', 'questions'] };
25
+ supportsStreamStepSplitting = true;
19
26
  binaries;
20
27
  runSpawnSync;
21
28
  runSpawn;
22
29
  sessionRoots;
30
+ modelCachePath;
31
+ now;
23
32
  cachedBinary = null;
24
33
  processes = new Set();
25
34
  sessions = new Map();
@@ -27,7 +36,9 @@ export class GrokBuildDriver {
27
36
  this.binaries = options.binaries ?? ['grok', 'grok-build'];
28
37
  this.runSpawnSync = options.spawnSync ?? spawnSync;
29
38
  this.runSpawn = options.spawn ?? spawn;
39
+ this.now = options.now ?? Date.now;
30
40
  this.sessionRoots = options.sessionRoots ?? [join(process.env.GROK_HOME ?? join(homedir(), '.grok'), 'sessions')];
41
+ this.modelCachePath = options.modelCachePath ?? join(process.env.GROK_HOME ?? join(homedir(), '.grok'), 'models_cache.json');
31
42
  }
32
43
  async detect() {
33
44
  const result = await detectBinary({ binaries: this.binaries, spawnSync: this.runSpawnSync });
@@ -39,7 +50,9 @@ export class GrokBuildDriver {
39
50
  const command = this.cachedBinary ?? (await this.detect()).command;
40
51
  if (command === null)
41
52
  return emptyCatalog();
42
- const rpc = new JsonRpcProcess({ command, args: ['agent', '--no-leader', 'stdio'], spawn: this.runSpawn });
53
+ const native = this.nativeModels(command);
54
+ let catalog = GROK_CATALOG;
55
+ const rpc = new JsonRpcProcess({ command, args: ['agent', '--no-leader', 'stdio'], env: grokRuntimeEnvironment(), spawn: this.runSpawn });
43
56
  try {
44
57
  await rpc.request('initialize', {
45
58
  protocolVersion: 1,
@@ -51,19 +64,53 @@ export class GrokBuildDriver {
51
64
  rpc.notify('initialized', {});
52
65
  const session = await rpc.request('session/new', { cwd: process.cwd(), mcpServers: [] });
53
66
  const parsed = parseGrokCatalog(session);
54
- return parsed.groups.length > 0 ? parsed : GROK_CATALOG;
67
+ if (parsed.groups.length > 0)
68
+ catalog = parsed;
55
69
  }
56
70
  catch {
57
- return GROK_CATALOG;
71
+ // Retain the compatibility catalog when ACP discovery is unavailable.
58
72
  }
59
73
  finally {
60
74
  rpc.dispose();
61
75
  }
76
+ const listed = await native;
77
+ if (!listed)
78
+ return catalog;
79
+ const existing = new Map(catalog.groups.flatMap(group => group.models).map(model => [model.id, model]));
80
+ const cached = readGrokModelMetadata(this.modelCachePath);
81
+ const models = listed.ids.map(id => {
82
+ const metadata = cached.get(id);
83
+ return { id, name: existing.get(id)?.name ?? metadata?.name ?? id,
84
+ efforts: metadata?.efforts ?? existing.get(id)?.efforts ?? [] };
85
+ });
86
+ const providerDefault = GROK_CATALOG.groups.flatMap(group => group.models).find(model => model.id === 'provider-default');
87
+ return { groups: [{ id: 'grok', name: 'Grok', models: [providerDefault, ...models] }], currentModel: listed.current, currentEffort: null };
88
+ }
89
+ /** The models command waits for the fetched catalog; session/new may return its bootstrap snapshot. */
90
+ async nativeModels(command) {
91
+ try {
92
+ const result = await runAsyncCommand(this.runSpawnSync, command, ['models'], {
93
+ cwd: process.cwd(), encoding: 'utf8', timeout: 10_000, maxBuffer: 1024 * 1024,
94
+ windowsHide: true, shell: WINDOWS, env: grokRuntimeEnvironment(command),
95
+ });
96
+ if (result.status !== 0)
97
+ return undefined;
98
+ const text = String(result.stdout).replace(/\u001b\[[0-9;]*m/gu, '');
99
+ const section = text.split('Available models:')[1];
100
+ if (!section)
101
+ return undefined;
102
+ const ids = [...new Set([...section.matchAll(/^\s*[-*]\s+([A-Za-z0-9][A-Za-z0-9._:/-]*)(?:\s+\(default\))?\s*$/gmu)].map(match => match[1]))];
103
+ const current = text.match(/^Default model:\s*(\S+)\s*$/mu)?.[1] ?? null;
104
+ return ids.length ? { ids, current: current && ids.includes(current) ? current : null } : undefined;
105
+ }
106
+ catch {
107
+ return undefined;
108
+ }
62
109
  }
63
110
  /** Grok 的原生目录同时应用信任、禁用、兼容来源和插件命名规则。 */
64
111
  async listSkills(input) {
65
112
  if (input.signal?.aborted)
66
- throw new Error('Skill 目录读取已取消');
113
+ throw new Error('Skill catalog loading was canceled');
67
114
  const cwd = input.cwd?.trim() || process.cwd();
68
115
  const command = this.cachedBinary ?? (await this.detect()).command;
69
116
  if (command !== null) {
@@ -75,7 +122,7 @@ export class GrokBuildDriver {
75
122
  maxBuffer: 8 * 1024 * 1024,
76
123
  windowsHide: true,
77
124
  shell: WINDOWS,
78
- env: commandEnvironment(command),
125
+ env: grokRuntimeEnvironment(command),
79
126
  });
80
127
  if (result.status === 0) {
81
128
  const catalog = parseGrokSkillCatalog(`${result.stdout ?? ''}`);
@@ -100,31 +147,58 @@ export class GrokBuildDriver {
100
147
  async *executeTurn(input) {
101
148
  const command = this.cachedBinary ?? (await this.detect()).command;
102
149
  if (command === null)
103
- throw new Error('Grok Build 未安装');
150
+ throw new Error('Grok Build is not installed');
104
151
  const state = await this.getSession(input, command);
105
152
  const rpc = state.rpc;
106
153
  let providerSessionId = state.providerSessionId;
107
154
  let stream;
155
+ let reusable = false;
156
+ const promptId = randomUUID();
157
+ const segmentState = createCodingNsSegmentState();
158
+ let stepPhase;
159
+ let stepStreamId;
160
+ const activeTools = new Map();
161
+ const streamedToolInputs = new Map();
162
+ const permissionTools = new Map();
108
163
  try {
109
164
  if (providerSessionId === '') {
110
165
  const session = await rpc.request('session/new', {
111
166
  cwd: input.cwd ?? process.cwd(),
112
167
  mcpServers: acpBridgeMcpServers(input.sessionId, this.descriptor.id),
113
- ...(!isProviderDefaultModel(input.modelId) ? { model: input.modelId } : {}),
114
168
  }, { signal: input.signal });
115
169
  providerSessionId = readSessionId(session) ?? input.sessionId;
170
+ state.contextUsage.observe(session);
116
171
  state.providerSessionId = providerSessionId;
117
172
  this.sessions.set(input.sessionId, state);
118
173
  this.sessions.set(providerSessionId, state);
119
174
  }
120
175
  yield { type: 'session-binding', providerSessionId };
176
+ // Grok 1.0.52 ignores the model field on session/new. Apply explicit
177
+ // selections after both creation and restoration, including reused sessions.
178
+ if (input.modelId && !isProviderDefaultModel(input.modelId)) {
179
+ const selected = await rpc.request('session/set_model', { sessionId: providerSessionId, modelId: input.modelId }, { signal: input.signal });
180
+ state.contextUsage.modelId = input.modelId;
181
+ state.contextUsage.observe(selected);
182
+ }
183
+ if (input.effortId) {
184
+ await rpc.request('session/set_config_option', { sessionId: providerSessionId, configId: 'reasoning_effort', value: input.effortId }, { signal: input.signal });
185
+ }
121
186
  // Skill 斜杠命令由 Grok 在用户输入开头解析,不能把普通提示插到命令前。
122
187
  const nativeCommand = /^\s*\/[A-Za-z0-9][A-Za-z0-9._:-]*(?:\s|$)/u.test(input.prompt);
123
188
  const prompt = [
124
189
  ...(nativeCommand ? [] : [{ type: 'text', text: GROK_QUESTION_GUIDANCE }]),
190
+ ...(nativeCommand || !subagentBridgeActive(input.sessionId) ? [] : [{ type: 'text', text: bridgeSessionGuidance(input.sessionId, 'codingns__agent_subagent') }]),
125
191
  ...await buildAcpPromptBlocks(input.prompt, input.attachments ?? []),
126
192
  ];
127
- stream = streamGrokPrompt(rpc, providerSessionId, prompt, input.signal, (notification) => {
193
+ const usage = new GrokPromptUsage(promptId, state.contextUsage, this.now);
194
+ stream = streamGrokPrompt(rpc, providerSessionId, promptId, prompt, input.signal, (notification) => {
195
+ usage.observe(notification);
196
+ const params = isRecord(notification.params) ? notification.params : {};
197
+ const update = isRecord(params.update) ? params.update : {};
198
+ const callId = firstToolText(update.toolCallId, update.tool_call_id);
199
+ if (callId && update.sessionUpdate === 'tool_call') {
200
+ permissionTools.set(callId, { name: firstToolText(update.name, update.title) ?? '', input: update.rawInput });
201
+ }
128
202
  const elicitation = readAcpElicitationRequest(notification);
129
203
  if (elicitation !== null)
130
204
  state.questions.set(elicitation.requestId, elicitation);
@@ -135,8 +209,12 @@ export class GrokBuildDriver {
135
209
  // 已回答的问题被重新登记。tool_call 可以先显示问题卡并暂存用户答案。
136
210
  const requestId = interactionRequestId(notification);
137
211
  if (requestId !== null && notification.id !== undefined && notification.id !== null)
138
- state.requests.set(requestId, { rpcId: notification.id, ...permissionOptions(notification) });
139
- });
212
+ state.requests.set(requestId, {
213
+ rpcId: notification.id, callId: permissionCallId(notification), ...permissionOptions(notification),
214
+ autoApproved: isAdmittedGrokPermission(notification, input, state, permissionTools),
215
+ });
216
+ return usage.takeObservation();
217
+ }, response => { usage.observeResponse(response); return usage.takeObservation(); });
140
218
  let finishResult;
141
219
  while (true) {
142
220
  const item = await stream.next();
@@ -144,26 +222,86 @@ export class GrokBuildDriver {
144
222
  finishResult = item.value;
145
223
  break;
146
224
  }
147
- const chunk = acpMessageToChunk(item.value);
148
- if (chunk === null)
149
- continue;
150
- if (chunk.type === 'question-request' && state.grokQuestionCallIds.has(chunk.requestId)) {
151
- if (state.grokQuestionEventIds.has(chunk.requestId))
225
+ if (item.value.codingnsGrokObservation !== undefined)
226
+ yield item.value.codingnsGrokObservation;
227
+ const streamId = grokStreamId(item.value);
228
+ for (const rawChunk of grokToolInputChunks(item.value, streamedToolInputs) ?? acpMessageToChunks(item.value)) {
229
+ if (rawChunk.type === 'permission-request' && state.requests.get(rawChunk.requestId)?.autoApproved)
152
230
  continue;
153
- state.grokQuestionEventIds.add(chunk.requestId);
231
+ // Settle native turn accounting once, after the terminal drain. Per-call
232
+ // usage is retained by the RPC observer solely for timing and fallback.
233
+ if (rawChunk.type === 'usage')
234
+ continue;
235
+ let resolved = rawChunk.type === 'image-artifact'
236
+ ? await resolveGrokImageArtifact(rawChunk, state, this.sessionRoots)
237
+ : rawChunk;
238
+ if (resolved === null)
239
+ continue;
240
+ if (resolved.type === 'tool-event' && resolved.status === 'failed' && resolved.callId) {
241
+ const denial = state.permissionDenials.get(resolved.callId);
242
+ if (denial !== undefined)
243
+ resolved = { ...resolved, error: denial, output: denial, outputMode: 'snapshot' };
244
+ }
245
+ const chunk = decorateCodingNsSegmentEvent(resolved, input, segmentState, this.descriptor.id);
246
+ if (chunk.type === 'question-request' && state.grokQuestionCallIds.has(chunk.requestId)) {
247
+ if (state.grokQuestionEventIds.has(chunk.requestId))
248
+ continue;
249
+ state.grokQuestionEventIds.add(chunk.requestId);
250
+ }
251
+ // 问题的 tool_call_update 只是同一次交互的生命周期回声,不能再生成普通
252
+ // 工具记录,否则历史里会重新出现空参数或重复的问题调用。
253
+ if (chunk.type === 'tool-event' && chunk.callId !== undefined && state.grokQuestionCallIds.has(chunk.callId))
254
+ continue;
255
+ const phase = grokStepPhase(chunk);
256
+ if (phase !== undefined) {
257
+ // DSH persists assistant content only at step settlement. End the content
258
+ // step before native tools are appended, and keep unfinished parallel calls
259
+ // together so their results cannot be finalized by an intermediate step.
260
+ if (input.splitToolSteps && stepPhase !== undefined && activeTools.size === 0
261
+ && (phase !== stepPhase || (streamId !== undefined && stepStreamId !== undefined && streamId !== stepStreamId))) {
262
+ yield { type: 'step-boundary' };
263
+ }
264
+ stepPhase = phase;
265
+ if (streamId !== undefined)
266
+ stepStreamId = streamId;
267
+ }
268
+ if (chunk.type === 'tool-event') {
269
+ const callId = chunk.callId ?? chunk.toolName;
270
+ if (chunk.status === 'completed' || chunk.status === 'failed')
271
+ activeTools.delete(callId);
272
+ else
273
+ activeTools.set(callId, chunk.toolName === 'tool' ? activeTools.get(callId) ?? chunk.toolName : chunk.toolName);
274
+ }
275
+ yield chunk;
276
+ advanceCodingNsSegment(chunk, segmentState);
277
+ if (chunk.type === 'question-request')
278
+ segmentState.segment += 1;
154
279
  }
155
- // 问题的 tool_call_update 只是同一次交互的生命周期回声,不能再生成普通
156
- // 工具记录,否则历史里会重新出现空参数或重复的问题调用。
157
- if (chunk.type === 'tool-event' && chunk.callId !== undefined && state.grokQuestionCallIds.has(chunk.callId))
158
- continue;
159
- yield chunk;
160
280
  }
161
- if (finishResult.reason === 'cancel') {
162
- try {
163
- await rpc.request('session/cancel', { sessionId: providerSessionId }, { killOnAbort: false });
281
+ const settledUsage = usage.finish();
282
+ if (settledUsage !== undefined) {
283
+ const { requestPerformance: _observed, ...accounting } = settledUsage;
284
+ yield accounting;
285
+ }
286
+ if (finishResult.failure?.code === 'PERMISSION_DENIED') {
287
+ const denial = [...state.permissionDenials.values()].at(-1);
288
+ if (denial !== undefined)
289
+ finishResult = { ...finishResult, failure: { message: denial, code: 'PERMISSION_DENIED' } };
290
+ }
291
+ // A normal prompt stop does not confirm pending tool execution. Keep the
292
+ // observed arguments and make the unknown outcome explicit without retrying.
293
+ if (activeTools.size > 0) {
294
+ for (const [callId, toolName] of activeTools) {
295
+ const error = 'Grok ended the turn without reporting a final result for this tool; its outcome is unconfirmed.';
296
+ yield decorateCodingNsSegmentEvent({ type: 'tool-event', callId, toolName, status: 'failed', error, output: error, outputMode: 'snapshot' }, input, segmentState, this.descriptor.id);
164
297
  }
165
- catch { /* 不同 ACP 版本的取消方法可能不同,请求级取消已经先行发出。 */ }
298
+ if (finishResult.reason === 'stop')
299
+ finishResult = {
300
+ reason: 'error',
301
+ failure: { message: 'Grok ended the turn before all tool results were confirmed.', code: 'INCOMPLETE_TOOL_RESULT' },
302
+ };
166
303
  }
304
+ reusable = finishResult.reason === 'stop' && !input.signal?.aborted;
167
305
  yield { type: 'finish', reason: finishResult.reason, ...(finishResult.failure === undefined ? {} : { failure: finishResult.failure }) };
168
306
  }
169
307
  finally {
@@ -177,19 +315,30 @@ export class GrokBuildDriver {
177
315
  state.grokQuestions.clear();
178
316
  state.grokQuestionCallIds.clear();
179
317
  state.grokQuestionEventIds.clear();
180
- // ACP 进程和会话跨轮复用,统一由 dispose() 回收。
318
+ state.questions.clear();
319
+ state.requests.clear();
320
+ state.permissionDenials.clear();
321
+ if (!reusable) {
322
+ // An abandoned prompt can keep producing updates without prompt metadata.
323
+ // Reload its persisted session on a fresh transport before accepting new input.
324
+ await rpc.disposeAndWait();
325
+ this.processes.delete(rpc);
326
+ }
181
327
  }
182
328
  }
183
329
  respondPermission(sessionId, response) {
184
330
  const state = this.sessions.get(sessionId);
185
331
  if (state === undefined)
186
- throw new Error('Grok 权限请求已结束');
332
+ throw new Error('The Grok permission request has ended');
187
333
  const pending = state.requests.get(response.requestId);
188
334
  if (pending === undefined)
189
- throw new Error('Grok 权限请求不存在');
335
+ throw new Error('The Grok permission request does not exist');
190
336
  state.requests.delete(response.requestId);
191
337
  const optionId = response.approved ? pending.allowOptionId : pending.rejectOptionId;
192
- state.rpc.respond(pending.rpcId, { outcome: { outcome: 'selected', optionId } });
338
+ if (!response.approved || optionId === undefined) {
339
+ state.permissionDenials.set(pending.callId ?? response.requestId, response.reason ?? (response.approved ? 'Grok did not offer a one-time approval option.' : 'Grok tool execution was denied.'));
340
+ }
341
+ state.rpc.respond(pending.rpcId, { outcome: optionId === undefined ? { outcome: 'cancelled' } : { outcome: 'selected', optionId } });
193
342
  }
194
343
  respondQuestion(sessionId, response) {
195
344
  const state = this.sessions.get(sessionId);
@@ -204,36 +353,60 @@ export class GrokBuildDriver {
204
353
  }
205
354
  const elicitation = state?.questions.get(response.requestId);
206
355
  if (state === undefined || elicitation === undefined)
207
- throw new Error('Grok 问题请求不存在');
356
+ throw new Error('The Grok question request does not exist');
208
357
  state.questions.delete(response.requestId);
209
358
  state.rpc.respond(elicitation.rpcId, acpElicitationResponse(elicitation, response));
210
359
  }
211
360
  dispose() { for (const process of this.processes)
212
361
  process.dispose(); this.processes.clear(); this.sessions.clear(); this.cachedBinary = null; }
213
362
  async getSession(input, command) {
363
+ const alwaysApprove = input.permission?.sandboxMode === 'danger-full-access' && input.permission.approvalPolicy === 'never';
214
364
  const previous = this.sessions.get(input.sessionId);
215
- if (previous !== undefined && previous.cwd === input.cwd)
365
+ const teamToken = teamBridgeToken(input.sessionId);
366
+ const bridgeToken = getSubagentBridge()?.token;
367
+ if (previous !== undefined && previous.cwd === input.cwd && previous.alwaysApprove === alwaysApprove && previous.teamToken === teamToken && previous.bridgeToken === bridgeToken && !previous.rpc.isClosed)
216
368
  return previous;
217
- previous?.rpc.dispose();
218
- const rpc = new JsonRpcProcess({ command, args: ['agent', '--no-leader', 'stdio'], cwd: input.cwd, spawn: this.runSpawn });
369
+ if (previous !== undefined) {
370
+ await previous.rpc.disposeAndWait();
371
+ this.processes.delete(previous.rpc);
372
+ }
373
+ const resumeId = input.providerSessionId ?? (previous?.cwd === input.cwd ? previous?.providerSessionId : undefined);
374
+ const rpc = new JsonRpcProcess({ command, args: ['agent', '--no-leader', ...(alwaysApprove ? ['--always-approve'] : []), 'stdio'], cwd: input.cwd, env: grokRuntimeEnvironment(), spawn: this.runSpawn });
219
375
  this.processes.add(rpc);
220
- const state = { rpc, cwd: input.cwd, providerSessionId: '', requests: new Map(), questions: new Map(), grokQuestions: new Map(), grokQuestionCallIds: new Set(), grokQuestionEventIds: new Set() };
221
- await rpc.request('initialize', {
376
+ const state = { teamToken, bridgeToken, rpc, contextUsage: new GrokContextUsage(), cwd: input.cwd, rawStoreRef: input.rawStoreRef, alwaysApprove, providerSessionId: '', requests: new Map(), permissionDenials: new Map(), questions: new Map(), grokQuestions: new Map(), grokQuestionCallIds: new Set(), grokQuestionEventIds: new Set() };
377
+ rpc.addNotificationListener(message => {
378
+ const params = isRecord(message.params) ? message.params : {};
379
+ const owner = state.providerSessionId || resumeId;
380
+ if (owner && typeof params.sessionId === 'string' && params.sessionId !== owner)
381
+ return;
382
+ state.contextUsage.observe(message);
383
+ });
384
+ const initialized = await rpc.request('initialize', {
222
385
  protocolVersion: 1,
223
386
  clientInfo: { name: 'codingns4dsh', version: '0.1.1' },
224
387
  // 旧版 Grok 读取 capabilities;标准 ACP 读取 clientCapabilities。
225
388
  capabilities: ACP_FORM_CLIENT_CAPABILITIES,
226
389
  clientCapabilities: ACP_FORM_CLIENT_CAPABILITIES,
227
390
  });
391
+ state.contextUsage.observe(initialized);
228
392
  rpc.notify('initialized', {});
229
- if (input.providerSessionId) {
393
+ if (resumeId) {
230
394
  try {
231
- const loaded = await rpc.request('session/load', { sessionId: input.providerSessionId, cwd: input.cwd ?? process.cwd(), mcpServers: acpBridgeMcpServers(input.sessionId, this.descriptor.id) });
232
- state.providerSessionId = readSessionId(loaded) ?? input.providerSessionId;
395
+ const loaded = await rpc.request('session/load', { sessionId: resumeId, cwd: input.cwd ?? process.cwd(), mcpServers: acpBridgeMcpServers(input.sessionId, this.descriptor.id) });
396
+ state.contextUsage.observe(loaded);
397
+ state.providerSessionId = readSessionId(loaded) ?? resumeId;
398
+ }
399
+ catch (error) {
400
+ if (teamToken) {
401
+ rpc.dispose();
402
+ this.processes.delete(rpc);
403
+ throw error;
404
+ }
405
+ // Ordinary legacy ACP sessions keep their existing new-session fallback.
233
406
  }
234
- catch { /* 旧版 ACP 没有 load,下一轮在同一进程创建新会话 */ }
235
407
  }
236
- // ACP 权限是 Grok 发起的 server request,先挂起响应,待标准权限入口明确回复原始 id。
408
+ // Admitted file/bridge requests retain existing authority. Other requests
409
+ // wait for native approval using the original RPC id.
237
410
  rpc.setServerRequestHandler((message) => {
238
411
  const elicitation = readAcpElicitationRequest(message);
239
412
  if (elicitation !== null) {
@@ -258,7 +431,11 @@ export class GrokBuildDriver {
258
431
  const requestId = interactionRequestId(message);
259
432
  if (requestId === null || message.id === undefined || message.id === null)
260
433
  return { outcome: { outcome: 'cancelled' } };
261
- state.requests.set(requestId, { rpcId: message.id, ...permissionOptions(message) });
434
+ const pending = state.requests.get(requestId);
435
+ if (pending?.autoApproved && pending.allowOptionId !== undefined) {
436
+ return { outcome: { outcome: 'selected', optionId: pending.allowOptionId } };
437
+ }
438
+ state.requests.set(requestId, { rpcId: message.id, callId: permissionCallId(message), ...permissionOptions(message) });
262
439
  return new Promise(() => undefined);
263
440
  });
264
441
  this.sessions.set(input.sessionId, state);
@@ -268,25 +445,35 @@ export class GrokBuildDriver {
268
445
  }
269
446
  }
270
447
  const GROK_DRAIN_WAIT_MS = 250;
448
+ /**
449
+ * Grok 会默认兼容加载 `~/.claude/Claude.md`。CodingNS 已经有自己的会话规则,
450
+ * 外部 Agent 不应继承 Claude 的全局语言偏好或其他宿主专属指令。
451
+ */
452
+ function grokRuntimeEnvironment(command) {
453
+ const base = command === undefined ? process.env : commandEnvironment(command);
454
+ return { ...base, GROK_CLAUDE_AGENTS_ENABLED: '0' };
455
+ }
271
456
  /** 内建提问与 MCP 的连接状态无关,宿主能力说明必须随每轮请求一起传递。 */
272
457
  const GROK_QUESTION_GUIDANCE = [
273
458
  '<codingns_host_capabilities>',
274
- 'DSH 宿主支持 Grok Build 内建 ask_user_question 工具,会显示原生问题卡并回传用户的结构化回答。',
275
- 'ask_user_question 属于 grok_build 内建工具,不依赖 MCP 服务器;MCP 正在连接的提示只影响提示中列出的 MCP 服务器。',
276
- '当用户明确要求使用提问组件,或需要通过问题卡收集用户选择时,请直接调用 ask_user_question 并等待用户回答,再继续验证或处理答案。',
459
+ 'The DSH host provides Grok Build\'s built-in ask_user_question tool. It displays a native question card and returns the user\'s structured answer.',
460
+ 'ask_user_question is a grok_build built-in tool and does not depend on an MCP server. MCP connection notices only describe the MCP servers listed in the prompt.',
461
+ 'Use the built-in read/read_file tool to inspect files. Shell commands may require approval even when workspace file writes are already allowed; do not replace a file read with a shell command.',
462
+ 'When the user explicitly asks to use a question component, or when a question card is needed to collect a choice, call ask_user_question directly, wait for the user\'s answer, and then continue.',
277
463
  '</codingns_host_capabilities>',
278
464
  ].join('\n');
279
465
  /**
280
466
  * Grok 可能先返回 prompt 响应,再补发最后一批 session/update。
281
467
  * 响应或终态任一先到都会启动固定排空窗口,窗口内的文本和错误仍会被消费。
282
468
  */
283
- async function* streamGrokPrompt(rpc, sessionId, prompt, signal, onNotification) {
469
+ async function* streamGrokPrompt(rpc, sessionId, promptId, prompt, signal, onNotification, onResponse) {
284
470
  const queue = [];
285
471
  const requestController = new AbortController();
286
472
  let wake;
287
473
  let drainDeadline = null;
288
474
  let terminalReason = null;
289
475
  let failure;
476
+ let completed = false;
290
477
  const notify = () => { wake?.(); wake = undefined; };
291
478
  const beginDrain = () => {
292
479
  if (drainDeadline === null)
@@ -294,8 +481,10 @@ async function* streamGrokPrompt(rpc, sessionId, prompt, signal, onNotification)
294
481
  notify();
295
482
  };
296
483
  const listener = (message) => {
297
- queue.push(message);
298
- onNotification(message);
484
+ if (!isGrokPromptMessage(message, sessionId, promptId))
485
+ return;
486
+ const observation = onNotification(message);
487
+ queue.push(observation === undefined ? message : { ...message, codingnsGrokObservation: observation });
299
488
  const notificationReason = grokNotificationReason(message);
300
489
  if (notificationReason === null) {
301
490
  notify();
@@ -307,8 +496,6 @@ async function* streamGrokPrompt(rpc, sessionId, prompt, signal, onNotification)
307
496
  if (detail !== undefined)
308
497
  failure = detail;
309
498
  }
310
- // 部分 Grok 版本只发终态通知而不回复 prompt,主动取消可清理待处理请求。
311
- requestController.abort();
312
499
  beginDrain();
313
500
  };
314
501
  const removeListener = rpc.addNotificationListener(listener);
@@ -323,19 +510,29 @@ async function* streamGrokPrompt(rpc, sessionId, prompt, signal, onNotification)
323
510
  onAbort();
324
511
  else
325
512
  signal?.addEventListener('abort', onAbort, { once: true });
326
- void rpc.request('session/prompt', {
327
- sessionId,
328
- prompt,
329
- }, { signal: requestController.signal, killOnAbort: false }).then((response) => {
330
- const responseReason = grokPromptReason(response);
331
- if (responseReason !== null)
332
- terminalReason = mergeGrokReason(terminalReason, responseReason);
333
- beginDrain();
334
- }, () => {
335
- if (terminalReason === null)
336
- terminalReason = signal?.aborted ? 'cancel' : 'error';
337
- beginDrain();
338
- });
513
+ if (!signal?.aborted)
514
+ void rpc.request('session/prompt', {
515
+ sessionId,
516
+ prompt,
517
+ _meta: { promptId },
518
+ }, { signal: requestController.signal, killOnAbort: false }).then((response) => {
519
+ if (signal?.aborted)
520
+ return;
521
+ const observation = onResponse(response);
522
+ if (observation !== undefined)
523
+ queue.push({ method: 'codingns/grok-observation', codingnsGrokObservation: observation });
524
+ const responseReason = grokPromptReason(response);
525
+ if (responseReason !== null)
526
+ terminalReason = mergeGrokReason(terminalReason, responseReason);
527
+ failure ??= grokPermissionFailure(response);
528
+ beginDrain();
529
+ }, () => {
530
+ if (requestController.signal.aborted)
531
+ return;
532
+ if (terminalReason === null)
533
+ terminalReason = signal?.aborted ? 'cancel' : 'error';
534
+ beginDrain();
535
+ });
339
536
  try {
340
537
  while (true) {
341
538
  if (queue.length > 0) {
@@ -355,18 +552,81 @@ async function* streamGrokPrompt(rpc, sessionId, prompt, signal, onNotification)
355
552
  ]);
356
553
  wake = undefined;
357
554
  }
555
+ completed = true;
358
556
  return { reason: terminalReason ?? 'stop', ...(failure === undefined ? {} : { failure }) };
359
557
  }
360
558
  finally {
361
559
  signal?.removeEventListener('abort', onAbort);
362
560
  removeListener();
561
+ if (!completed || signal?.aborted) {
562
+ // ACP cancellation is a notification; waiting for an RPC response can hang.
563
+ try {
564
+ rpc.notify('session/cancel', { sessionId });
565
+ }
566
+ catch { /* The process may already have exited. */ }
567
+ }
568
+ // Terminal-only providers and consumers that close the iterator both need cleanup.
569
+ requestController.abort();
363
570
  }
364
571
  }
572
+ function isGrokPromptMessage(message, sessionId, promptId) {
573
+ const params = isRecord(message.params) ? message.params : message;
574
+ if (typeof params.sessionId === 'string' && params.sessionId !== sessionId)
575
+ return false;
576
+ const update = isRecord(params.update) ? params.update : params;
577
+ const meta = isRecord(params._meta) ? params._meta : {};
578
+ if (meta.isReplay === true)
579
+ return false;
580
+ const owner = firstToolText(update.prompt_id, update.promptId, meta.promptId);
581
+ return owner === undefined || owner === promptId;
582
+ }
583
+ function grokToolInputChunks(message, inputs) {
584
+ const params = isRecord(message.params) ? message.params : message;
585
+ const update = isRecord(params.update) ? params.update : params;
586
+ if (update.sessionUpdate !== 'tool_call_delta_chunk' || !Number.isInteger(update.tool_index))
587
+ return null;
588
+ const index = update.tool_index;
589
+ const callId = firstToolText(update.tool_call_id, update.toolCallId);
590
+ // Argument fragments omit the call id; a new id resets a reused model-call index.
591
+ let pending = inputs.get(index);
592
+ const started = callId !== undefined && pending?.callId !== callId;
593
+ if (started) {
594
+ pending = { callId, toolName: firstToolText(update.name, update.title) ?? 'tool', arguments: '' };
595
+ inputs.set(index, pending);
596
+ }
597
+ if (pending === undefined)
598
+ return [];
599
+ if (typeof update.arguments_delta === 'string')
600
+ pending.arguments += update.arguments_delta;
601
+ let input;
602
+ try {
603
+ const parsed = JSON.parse(pending.arguments);
604
+ if (isRecord(parsed))
605
+ input = JSON.stringify(parsed);
606
+ }
607
+ catch { /* Do not persist incomplete JSON as a tool's final arguments. */ }
608
+ if (!started && input === undefined)
609
+ return [];
610
+ return [{
611
+ type: 'tool-event', callId: pending.callId, toolName: pending.toolName, status: 'running',
612
+ ...(input === undefined ? {} : { input }),
613
+ }];
614
+ }
365
615
  function grokPromptReason(value) {
366
- if (!isRecord(value) || typeof value.stopReason !== 'string')
616
+ if (!isRecord(value))
617
+ return null;
618
+ const reason = firstToolText(value.stopReason, value.stop_reason)?.toLowerCase();
619
+ if (reason === undefined)
367
620
  return null;
368
- const reason = value.stopReason.toLowerCase();
369
- return reason === 'cancelled' || reason === 'error' || reason === 'failed' ? 'error' : 'stop';
621
+ if (reason === 'cancelled' || reason === 'canceled')
622
+ return grokPermissionFailure(value) === undefined ? 'cancel' : 'error';
623
+ return reason === 'error' || reason === 'failed' ? 'error' : 'stop';
624
+ }
625
+ function grokPermissionFailure(value) {
626
+ if (!isRecord(value) || !isRecord(value._meta) || value._meta.cancellationCategory !== 'PermissionRejected')
627
+ return undefined;
628
+ const context = isRecord(value._meta.cancellationContext) ? value._meta.cancellationContext : {};
629
+ return { message: firstToolText(context.reason) ?? 'Grok tool execution was denied.', code: 'PERMISSION_DENIED' };
370
630
  }
371
631
  function mergeGrokReason(current, next) {
372
632
  if (current === 'error' || next === 'error')
@@ -383,15 +643,20 @@ function grokNotificationReason(message) {
383
643
  : typeof update.type === 'string'
384
644
  ? update.type.toLowerCase()
385
645
  : '';
386
- if (type.includes('error') || type.includes('failed'))
646
+ if (['turn_error', 'turn_failed', 'error', 'failed'].includes(type))
387
647
  return 'error';
388
- if (type.includes('turn_completed') || type.includes('turn_complete') || type === 'completed' || type === 'done')
389
- return 'stop';
648
+ if (['turn_completed', 'turn_complete', 'prompt_complete', 'completed', 'done'].includes(type)) {
649
+ const reason = grokPromptReason(update) ?? 'stop';
650
+ return reason === 'cancel' && grokPermissionFailure(params) !== undefined ? 'error' : reason;
651
+ }
390
652
  return null;
391
653
  }
392
654
  function grokFailure(message) {
393
655
  const params = isRecord(message.params) ? message.params : message;
394
656
  const update = isRecord(params.update) ? params.update : params;
657
+ const permissionFailure = grokPermissionFailure(update) ?? grokPermissionFailure(params);
658
+ if (permissionFailure !== undefined)
659
+ return permissionFailure;
395
660
  const error = isRecord(update.error) ? update.error : update;
396
661
  const detail = firstToolText(error.message, error.errorMessage, error.error_message, error.detail, error.reason);
397
662
  if (detail === undefined)
@@ -468,63 +733,244 @@ function grokQuestionResponse(pending, response) {
468
733
  ...(Object.keys(annotations).length === 0 ? {} : { annotations }),
469
734
  };
470
735
  }
471
- function acpMessageToChunk(message) {
736
+ function grokStreamId(message) {
737
+ const params = isRecord(message.params) ? message.params : message;
738
+ const meta = isRecord(params._meta) ? params._meta : {};
739
+ return typeof meta.streamStartMs === 'number' && Number.isFinite(meta.streamStartMs)
740
+ ? `grok-stream-${meta.streamStartMs}` : undefined;
741
+ }
742
+ function grokStepPhase(event) {
743
+ switch (event.type) {
744
+ case 'text-delta':
745
+ case 'reasoning-delta': return event.text.length > 0 ? 'message' : undefined;
746
+ case 'image-artifact': return 'message';
747
+ case 'tool-event':
748
+ case 'question-request':
749
+ case 'permission-request': return 'tools';
750
+ default: return undefined;
751
+ }
752
+ }
753
+ function acpMessageToChunks(message) {
472
754
  const params = isRecord(message.params) ? message.params : message;
473
755
  const update = isRecord(params.update) ? params.update : params;
474
756
  const type = (typeof update.sessionUpdate === 'string' ? update.sessionUpdate : typeof update.type === 'string' ? update.type : typeof message.method === 'string' ? message.method : '').toLowerCase();
475
757
  const elicitation = readAcpElicitationRequest(message);
476
758
  if (elicitation !== null)
477
- return { type: 'question-request', requestId: elicitation.requestId, questions: elicitation.questions };
759
+ return [{ type: 'question-request', requestId: elicitation.requestId, questions: elicitation.questions }];
478
760
  const grokQuestion = readGrokQuestionTool(message) ?? readGrokQuestionRequest(message);
479
761
  if (grokQuestion !== null)
480
- return { type: 'question-request', requestId: grokQuestion.callId, callId: grokQuestion.callId, questions: grokQuestion.questions };
762
+ return [{ type: 'question-request', requestId: grokQuestion.callId, callId: grokQuestion.callId, questions: grokQuestion.questions }];
763
+ const text = textValue(update.delta ?? update.text ?? update.content ?? update.message ?? update.detail);
764
+ const artifactPaths = [
765
+ update.rawOutput,
766
+ update.raw_output,
767
+ update.output,
768
+ update.result,
769
+ update.image,
770
+ update.images,
771
+ update.content,
772
+ update.file,
773
+ update.files,
774
+ ].flatMap((value) => imageArtifactPathsFromValue(value));
775
+ const markdownPaths = imageArtifactPathsFromValue(text ?? '');
776
+ const imagePaths = [...new Set([...artifactPaths, ...markdownPaths])];
777
+ const imageEvents = imagePaths.map((path) => ({ type: 'image-artifact', path }));
778
+ // Grok identifies each model call independently of the enclosing user prompt.
779
+ const messageId = grokStreamId(message);
780
+ const identity = messageId === undefined ? {} : { messageId };
481
781
  const reasoning = reasoningText(update);
482
782
  if (reasoning !== null)
483
- return { type: 'reasoning-delta', text: reasoning };
484
- const text = textValue(update.delta ?? update.text ?? update.content ?? update.message ?? update.detail);
783
+ return [...imageEvents, { type: 'reasoning-delta', text: reasoning, ...identity }];
485
784
  if (type.includes('permission')) {
486
785
  const requestId = permissionRequestId(message) ?? (typeof update.requestId === 'string' ? update.requestId : typeof update.id === 'string' ? update.id : null);
487
786
  if (requestId !== null) {
488
787
  const tool = isToolRecord(update.toolCall) ? update.toolCall : isToolRecord(update.tool_call) ? update.tool_call : update;
489
788
  const toolName = firstToolText(tool.title, tool.name, tool.toolName, tool.tool_name, update.toolName);
490
789
  const callId = firstToolText(tool.toolCallId, tool.tool_call_id, tool.callId, tool.call_id, update.callId, update.call_id);
491
- return { type: 'permission-request', requestId, kind: typeof update.kind === 'string' ? update.kind : toolName ?? 'unknown', ...(toolName ? { toolName } : {}), ...(callId ? { callId } : {}), ...(text ? { detail: text } : {}) };
790
+ return [{ type: 'permission-request', requestId, kind: typeof update.kind === 'string' ? update.kind : toolName ?? 'unknown', ...(toolName ? { toolName } : {}), ...(callId ? { callId } : {}), ...(text ? { detail: text } : {}) }];
492
791
  }
493
792
  }
494
- if (type.includes('agent_message') || type.includes('text') || type === 'message')
495
- return text ? { type: 'text-delta', text } : null;
793
+ if (type.includes('agent_message') || type.includes('text') || type === 'message') {
794
+ const visible = text === null ? '' : stripImageMarkdown(text, markdownPaths);
795
+ const textEvent = visible === '' ? undefined : { type: 'text-delta', text: visible, ...identity };
796
+ return [...imageEvents, ...(textEvent === undefined ? [] : [textEvent])];
797
+ }
798
+ if (type.includes('image') || type.includes('artifact') || type.includes('generated'))
799
+ return imageEvents;
496
800
  if (type.includes('thought') || type.includes('reason'))
497
- return text ? { type: 'reasoning-delta', text } : null;
801
+ return text ? [{ type: 'reasoning-delta', text, ...identity }] : [];
498
802
  if (type.includes('tool') || type.includes('command')) {
499
803
  const tool = isToolRecord(update.toolCall) ? update.toolCall : isToolRecord(update.tool_call) ? update.tool_call : update;
500
- const name = firstToolText(tool.name, tool.toolName, tool.tool_name, tool.title, update.name, update.toolName, update.title);
804
+ const meta = isToolRecord(tool._meta) ? tool._meta : isToolRecord(update._meta) ? update._meta : {};
805
+ const xaiTool = isToolRecord(meta['x.ai/tool']) ? meta['x.ai/tool'] : undefined;
806
+ // Grok changes title to a display label such as Edit `path` while the call
807
+ // is running. Its structured name must survive until native persistence.
808
+ const name = firstToolText(tool.name, tool.toolName, tool.tool_name, xaiTool?.name, update.name, update.toolName, tool.title, update.title);
501
809
  const callId = firstToolText(tool.callId, tool.call_id, tool.toolCallId, tool.tool_call_id, tool.id, update.toolCallId, update.tool_call_id, update.id);
502
810
  if (!name && !callId)
503
- return null;
811
+ return [];
504
812
  const input = serializeToolValue(tool.rawInput ?? tool.input ?? tool.arguments ?? tool.args ?? update.rawInput);
505
- const output = serializeToolValue(tool.rawOutput ?? tool.output ?? tool.result ?? update.rawOutput);
813
+ // ACP tool results can contain nested text blocks without a rawOutput field.
814
+ const content = tool.content ?? update.content;
815
+ const contentText = Array.isArray(content)
816
+ ? content.flatMap((block) => isRecord(block) ? textValue(block.content ?? block) ?? [] : []).join('\n') || undefined
817
+ : undefined;
818
+ const rawOutput = serializeToolValue(tool.rawOutput ?? tool.output ?? tool.result ?? update.rawOutput);
819
+ const output = rawOutput ?? contentText;
506
820
  const error = serializeToolValue(tool.error ?? update.error);
507
821
  const agentId = firstToolText(tool.agentId, tool.agent_id, update.agentId, update.agent_id);
508
822
  const detail = serializeToolValue(tool.detail ?? update.detail ?? update.content);
509
823
  const fallback = error !== undefined || type.includes('error') || type.includes('fail')
510
824
  ? 'failed'
511
- : output !== undefined || type.includes('result') || type.includes('complete')
825
+ : rawOutput !== undefined || type.includes('result') || type.includes('complete')
512
826
  ? 'completed'
513
827
  : 'running';
514
- return {
515
- type: 'tool-event',
516
- toolName: name ?? 'tool',
517
- status: normalizeToolStatus(tool.status ?? tool.state ?? update.status, fallback),
518
- ...(callId ? { callId } : {}),
519
- ...(input !== undefined ? { input } : {}),
520
- ...(output !== undefined ? { output } : {}),
521
- ...(output !== undefined ? { outputMode: type.toLowerCase().includes('delta') ? 'delta' : 'snapshot' } : {}),
522
- ...(error !== undefined ? { error } : {}),
523
- ...(agentId ? { agentId } : {}),
524
- ...(detail !== undefined ? { detail } : {}),
525
- };
828
+ return [...imageEvents, {
829
+ type: 'tool-event',
830
+ toolName: name ?? 'tool',
831
+ status: normalizeToolStatus(tool.status ?? tool.state ?? update.status, fallback),
832
+ ...(callId ? { callId } : {}),
833
+ ...(input !== undefined ? { input } : {}),
834
+ ...(output !== undefined ? { output } : {}),
835
+ ...(output !== undefined ? { outputMode: type.toLowerCase().includes('delta') ? 'delta' : 'snapshot' } : {}),
836
+ ...(error !== undefined ? { error } : {}),
837
+ ...(agentId ? { agentId } : {}),
838
+ ...(detail !== undefined ? { detail } : {}),
839
+ }];
840
+ }
841
+ const usage = usageChunk(update);
842
+ return usage === null ? imageEvents : [...imageEvents, usage];
843
+ }
844
+ async function resolveGrokImageArtifact(artifact, state, roots) {
845
+ const raw = artifact.path?.trim();
846
+ if (raw === undefined || raw === '')
847
+ return artifact.data === undefined ? null : artifact;
848
+ const candidates = isAbsolute(raw)
849
+ ? [raw]
850
+ : [
851
+ ...(state.rawStoreRef === undefined ? [] : containedPath(state.rawStoreRef, raw)),
852
+ ...(state.rawStoreRef === undefined ? [] : containedPath(dirname(state.rawStoreRef), raw)),
853
+ ...roots.flatMap((root) => containedPath(root, join(state.providerSessionId, raw))),
854
+ ...roots.flatMap((root) => containedPath(root, raw)),
855
+ ...(state.cwd === undefined ? [] : containedPath(state.cwd, raw)),
856
+ ];
857
+ for (const candidate of candidates) {
858
+ try {
859
+ if (await isRegularFile(candidate))
860
+ return { ...artifact, path: candidate };
861
+ }
862
+ catch { /* Provider 可能只在另一处保存产物,继续尝试受控候选。 */ }
863
+ }
864
+ return null;
865
+ }
866
+ function containedPath(root, child) {
867
+ const base = resolve(root);
868
+ const candidate = resolve(base, child);
869
+ const outside = relative(base, candidate);
870
+ return outside === '' || outside === '..' || outside.startsWith(`..${sep}`) || isAbsolute(outside) ? [] : [candidate];
871
+ }
872
+ function isAdmittedGrokFileMutation(name) {
873
+ const key = name.trim().toLowerCase().replace(/[\s-]+/gu, '_');
874
+ return ['write', 'edit', 'search_replace', 'str_replace', 'string_replace'].includes(key);
875
+ }
876
+ /** Admit existing file/bridge authority; shells and unknown requests retain native approval. */
877
+ function isAdmittedGrokPermission(message, input, state, tools) {
878
+ if (message.method !== 'session/request_permission' || input.plan === true)
879
+ return false;
880
+ const mode = input.permission?.sandboxMode;
881
+ if (mode !== 'workspace-write' && mode !== 'danger-full-access')
882
+ return false;
883
+ const params = isRecord(message.params) ? message.params : {};
884
+ const tool = isToolRecord(params.toolCall) ? params.toolCall : {};
885
+ const metadata = isRecord(params._meta) ? params._meta : {};
886
+ if (metadata.risk !== undefined || tool.risk !== undefined)
887
+ return false;
888
+ // Never substitute a persistent grant or invent an option absent from the request.
889
+ if (!Array.isArray(params.options) || !params.options.some(option => isRecord(option)
890
+ && firstToolText(option.kind, option.type)?.toLowerCase() === 'allow_once'
891
+ && firstToolText(option.optionId, option.option_id, option.id) !== undefined))
892
+ return false;
893
+ const observed = tools.get(permissionCallId(message) ?? '');
894
+ // Titles become human-readable labels such as "Write `/path`". Keep the
895
+ // canonical identity from the matching call, while MCP wrappers name their
896
+ // inner bridge tool in the permission request itself.
897
+ const title = firstToolText(tool.title);
898
+ const bridgeTitle = title === 'codingns__agent_team' || title === 'codingns__agent_subagent'
899
+ || title === 'codingns__web_search' || title === 'codingns__web_fetch' ? title : undefined;
900
+ const name = firstToolText(tool.name, tool.toolName, tool.tool_name) ?? bridgeTitle ?? observed?.name ?? title;
901
+ if (name === 'codingns__agent_team')
902
+ return Boolean(state.teamToken && teamBridgeToken(input.sessionId) === state.teamToken);
903
+ if (name === 'codingns__agent_subagent')
904
+ return Boolean(!state.teamToken && state.bridgeToken && getSubagentBridge()?.token === state.bridgeToken);
905
+ if (name === 'codingns__web_search' || name === 'codingns__web_fetch') {
906
+ if (state.teamToken)
907
+ return teamBridgeToken(input.sessionId) === state.teamToken;
908
+ return Boolean(state.bridgeToken && getSubagentBridge()?.token === state.bridgeToken);
526
909
  }
527
- return usageChunk(update);
910
+ if (!name || !isAdmittedGrokFileMutation(name))
911
+ return false;
912
+ if (observed && observed.name !== name)
913
+ return false;
914
+ const raw = tool.rawInput ?? observed?.input;
915
+ if (!isRecord(raw))
916
+ return false;
917
+ const paths = ['file_path', 'target_file', 'path'].flatMap(key => raw[key] === undefined ? [] : [raw[key]]);
918
+ if (!paths.length || paths.some(path => typeof path !== 'string' || !path.trim() || path.includes('\0')))
919
+ return false;
920
+ if (!input.cwd || !isAbsolute(input.cwd))
921
+ return false;
922
+ const root = canonicalGrokPath(input.cwd);
923
+ if (!root)
924
+ return false;
925
+ return paths.every(path => {
926
+ // Keep dot segments until realpath resolves existing symlink ancestors.
927
+ const target = canonicalGrokPath(isAbsolute(path) ? path : `${input.cwd}${sep}${path}`);
928
+ if (!target)
929
+ return false;
930
+ const outside = relative(root, target);
931
+ return mode === 'danger-full-access' || outside !== '' && outside !== '..' && !outside.startsWith(`..${sep}`) && !isAbsolute(outside);
932
+ });
933
+ }
934
+ /** Resolve existing ancestors, rejecting broken links and non-missing filesystem errors. */
935
+ function canonicalGrokPath(path) {
936
+ const suffix = [];
937
+ let current = path;
938
+ for (;;) {
939
+ try {
940
+ lstatSync(current);
941
+ }
942
+ catch (error) {
943
+ if (error.code !== 'ENOENT' || dirname(current) === current)
944
+ return undefined;
945
+ suffix.unshift(basename(current));
946
+ current = dirname(current);
947
+ continue;
948
+ }
949
+ try {
950
+ return resolve(realpathSync.native(current), ...suffix);
951
+ }
952
+ catch {
953
+ return undefined;
954
+ }
955
+ }
956
+ }
957
+ /** Cache metadata enriches only IDs admitted by the native CLI's filtered list. */
958
+ function readGrokModelMetadata(path) {
959
+ const result = new Map();
960
+ try {
961
+ const value = JSON.parse(readFileSync(path, 'utf8'));
962
+ if (!isRecord(value) || !isRecord(value.models))
963
+ return result;
964
+ for (const entry of Object.values(value.models)) {
965
+ if (!isRecord(entry) || !isRecord(entry.info) || typeof entry.info.id !== 'string')
966
+ continue;
967
+ const info = entry.info;
968
+ const efforts = Array.isArray(info.reasoning_efforts) ? info.reasoning_efforts.flatMap(effort => typeof effort === 'string' ? [effort] : isRecord(effort) && typeof effort.id === 'string' ? [effort.id] : []) : [];
969
+ result.set(info.id, { name: typeof info.name === 'string' ? info.name : info.id, efforts });
970
+ }
971
+ }
972
+ catch { /* Metadata is optional and never adds selectable model IDs. */ }
973
+ return result;
528
974
  }
529
975
  function permissionRequestId(message) {
530
976
  const params = isRecord(message.params) ? message.params : message;
@@ -538,6 +984,12 @@ function permissionRequestId(message) {
538
984
  function interactionRequestId(message) {
539
985
  return permissionRequestId(message);
540
986
  }
987
+ function permissionCallId(message) {
988
+ const params = isRecord(message.params) ? message.params : message;
989
+ const update = isRecord(params.update) ? params.update : params;
990
+ const tool = isRecord(update.toolCall) ? update.toolCall : isRecord(update.tool_call) ? update.tool_call : update;
991
+ return firstToolText(tool.toolCallId, tool.tool_call_id, tool.callId, tool.call_id);
992
+ }
541
993
  function permissionOptions(message) {
542
994
  const params = isRecord(message.params) ? message.params : {};
543
995
  const options = Array.isArray(params.options) ? params.options : [];
@@ -549,9 +1001,17 @@ function permissionOptions(message) {
549
1001
  return [];
550
1002
  return [{ id, kind: firstToolText(option.kind, option.type)?.toLowerCase() ?? '' }];
551
1003
  });
1004
+ if (ids.length === 0)
1005
+ return { allowOptionId: 'allow-once', rejectOptionId: 'reject-once' };
1006
+ // Grok lists allow_always before allow_once. A DSH one-time approval must
1007
+ // never become a persistent grant merely because of provider option order.
552
1008
  return {
553
- allowOptionId: ids.find((option) => /allow|approve|accept/u.test(option.kind))?.id ?? ids[0]?.id ?? 'allow-once',
554
- rejectOptionId: ids.find((option) => /reject|deny|decline|cancel/u.test(option.kind))?.id ?? ids[1]?.id ?? 'reject-once',
1009
+ allowOptionId: ids.find((option) => option.kind === 'allow_once')?.id
1010
+ ?? ids.find((option) => /^(allow|approve|accept)$/u.test(option.kind))?.id
1011
+ ?? (ids[0]?.kind === '' ? ids[0].id : undefined),
1012
+ rejectOptionId: ids.find((option) => option.kind === 'reject_once')?.id
1013
+ ?? ids.find((option) => /^(reject|deny|decline|cancel)$/u.test(option.kind))?.id
1014
+ ?? (ids[1]?.kind === '' ? ids[1].id : undefined),
555
1015
  };
556
1016
  }
557
1017
  function readSessionId(value) {