@jingyi0605/codingns4dsh 0.2.1-beta.9 → 0.2.1-rc.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (938) hide show
  1. package/README.en.md +10 -6
  2. package/README.md +12 -9
  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/index.d.ts +1 -1
  7. package/data/build/dist/bootstrap/index.d.ts.map +1 -1
  8. package/data/build/dist/client/account-bar.d.ts.map +1 -1
  9. package/data/build/dist/client/account-bar.js +24 -70
  10. package/data/build/dist/client/account-bar.js.map +1 -1
  11. package/data/build/dist/client/adapter-catalog-watch.d.ts +10 -2
  12. package/data/build/dist/client/adapter-catalog-watch.d.ts.map +1 -1
  13. package/data/build/dist/client/adapter-catalog-watch.js +16 -4
  14. package/data/build/dist/client/adapter-catalog-watch.js.map +1 -1
  15. package/data/build/dist/client/bundle.js +55627 -31591
  16. package/data/build/dist/client/bundle.js.map +1 -1
  17. package/data/build/dist/client/cli-management-dialog.d.ts +21 -0
  18. package/data/build/dist/client/cli-management-dialog.d.ts.map +1 -0
  19. package/data/build/dist/client/cli-management-dialog.js +215 -0
  20. package/data/build/dist/client/cli-management-dialog.js.map +1 -0
  21. package/data/build/dist/client/cli-management-terminal.d.ts +9 -0
  22. package/data/build/dist/client/cli-management-terminal.d.ts.map +1 -0
  23. package/data/build/dist/client/cli-management-terminal.js +30 -0
  24. package/data/build/dist/client/cli-management-terminal.js.map +1 -0
  25. package/data/build/dist/client/cli-settings-dialog.d.ts +9 -0
  26. package/data/build/dist/client/cli-settings-dialog.d.ts.map +1 -0
  27. package/data/build/dist/client/cli-settings-dialog.js +45 -0
  28. package/data/build/dist/client/cli-settings-dialog.js.map +1 -0
  29. package/data/build/dist/client/cli-settings-rpc.js +1 -1
  30. package/data/build/dist/client/cli-settings-rpc.js.map +1 -1
  31. package/data/build/dist/client/cli-slots.d.ts +17 -3
  32. package/data/build/dist/client/cli-slots.d.ts.map +1 -1
  33. package/data/build/dist/client/cli-slots.js +300 -41
  34. package/data/build/dist/client/cli-slots.js.map +1 -1
  35. package/data/build/dist/client/client.assistant-configuration-view.js +4 -3
  36. package/data/build/dist/client/client.assistant-configuration-view.js.map +1 -1
  37. package/data/build/dist/client/client.delegate-command.js +44 -26
  38. package/data/build/dist/client/client.delegate-command.js.map +1 -1
  39. package/data/build/dist/client/client.editor-engine.js +4 -1
  40. package/data/build/dist/client/client.editor-engine.js.map +1 -1
  41. package/data/build/dist/client/{client.model-catalog-cache.js → client.magpie-model-tag.js} +393 -14
  42. package/data/build/dist/client/client.magpie-model-tag.js.map +1 -0
  43. package/data/build/dist/client/client.moss-voice-output.js +415 -0
  44. package/data/build/dist/client/client.moss-voice-output.js.map +1 -0
  45. package/data/build/dist/client/client.native-workspace-store.js +91 -15
  46. package/data/build/dist/client/client.native-workspace-store.js.map +1 -1
  47. package/data/build/dist/client/client.primitives-adapter.js +128 -0
  48. package/data/build/dist/client/client.primitives-adapter.js.map +1 -1
  49. package/data/build/dist/client/client.react-dom.js +0 -404
  50. package/data/build/dist/client/client.react-dom.js.map +1 -1
  51. package/data/build/dist/client/client.session-translation.js +121 -2
  52. package/data/build/dist/client/client.session-translation.js.map +1 -1
  53. package/data/build/dist/client/client.transport.js +1415 -57
  54. package/data/build/dist/client/client.transport.js.map +1 -1
  55. package/data/build/dist/client/conversation-translation-settings.d.ts +11 -0
  56. package/data/build/dist/client/conversation-translation-settings.d.ts.map +1 -0
  57. package/data/build/dist/client/conversation-translation-settings.js +54 -0
  58. package/data/build/dist/client/conversation-translation-settings.js.map +1 -0
  59. package/data/build/dist/client/delegate-command.d.ts.map +1 -1
  60. package/data/build/dist/client/delegate-command.js +36 -7
  61. package/data/build/dist/client/delegate-command.js.map +1 -1
  62. package/data/build/dist/client/desktop-assistant.js +1948 -494
  63. package/data/build/dist/client/editor-engine.d.ts +1 -1
  64. package/data/build/dist/client/editor-engine.d.ts.map +1 -1
  65. package/data/build/dist/client/editor-engine.js +4 -1
  66. package/data/build/dist/client/editor-engine.js.map +1 -1
  67. package/data/build/dist/client/feature-requirement.d.ts +43 -0
  68. package/data/build/dist/client/feature-requirement.d.ts.map +1 -0
  69. package/data/build/dist/client/feature-requirement.js +105 -0
  70. package/data/build/dist/client/feature-requirement.js.map +1 -0
  71. package/data/build/dist/client/features/cli-adapters.d.ts +3 -1
  72. package/data/build/dist/client/features/cli-adapters.d.ts.map +1 -1
  73. package/data/build/dist/client/features/cli-adapters.js +207 -112
  74. package/data/build/dist/client/features/cli-adapters.js.map +1 -1
  75. package/data/build/dist/client/features/file-management.d.ts.map +1 -1
  76. package/data/build/dist/client/features/file-management.js +18 -0
  77. package/data/build/dist/client/features/file-management.js.map +1 -1
  78. package/data/build/dist/client/features/index.d.ts +1 -0
  79. package/data/build/dist/client/features/index.d.ts.map +1 -1
  80. package/data/build/dist/client/features/index.js +5 -0
  81. package/data/build/dist/client/features/index.js.map +1 -1
  82. package/data/build/dist/client/features/lan-access-panel.d.ts.map +1 -1
  83. package/data/build/dist/client/features/lan-access-panel.js +1 -0
  84. package/data/build/dist/client/features/lan-access-panel.js.map +1 -1
  85. package/data/build/dist/client/features/magpie-management-controls.d.ts +46 -0
  86. package/data/build/dist/client/features/magpie-management-controls.d.ts.map +1 -0
  87. package/data/build/dist/client/features/magpie-management-controls.js +759 -0
  88. package/data/build/dist/client/features/magpie-management-controls.js.map +1 -0
  89. package/data/build/dist/client/features/magpie-management-page.d.ts +124 -0
  90. package/data/build/dist/client/features/magpie-management-page.d.ts.map +1 -0
  91. package/data/build/dist/client/features/magpie-management-page.js +1256 -0
  92. package/data/build/dist/client/features/magpie-management-page.js.map +1 -0
  93. package/data/build/dist/client/features/magpie-management.d.ts +7 -0
  94. package/data/build/dist/client/features/magpie-management.d.ts.map +1 -0
  95. package/data/build/dist/client/features/magpie-management.js +154 -0
  96. package/data/build/dist/client/features/magpie-management.js.map +1 -0
  97. package/data/build/dist/client/features/magpie-mark.d.ts +10 -0
  98. package/data/build/dist/client/features/magpie-mark.d.ts.map +1 -0
  99. package/data/build/dist/client/features/magpie-mark.js +21 -0
  100. package/data/build/dist/client/features/magpie-mark.js.map +1 -0
  101. package/data/build/dist/client/features/magpie-provider-logo.d.ts +11 -0
  102. package/data/build/dist/client/features/magpie-provider-logo.d.ts.map +1 -0
  103. package/data/build/dist/client/features/magpie-provider-logo.js +35 -0
  104. package/data/build/dist/client/features/magpie-provider-logo.js.map +1 -0
  105. package/data/build/dist/client/features/mobile-access.d.ts.map +1 -1
  106. package/data/build/dist/client/features/mobile-access.js +7 -0
  107. package/data/build/dist/client/features/mobile-access.js.map +1 -1
  108. package/data/build/dist/client/features/peer-host.d.ts.map +1 -1
  109. package/data/build/dist/client/features/peer-host.js +6 -0
  110. package/data/build/dist/client/features/peer-host.js.map +1 -1
  111. package/data/build/dist/client/features/quick-apps.d.ts +3 -0
  112. package/data/build/dist/client/features/quick-apps.d.ts.map +1 -0
  113. package/data/build/dist/client/features/quick-apps.js +14 -0
  114. package/data/build/dist/client/features/quick-apps.js.map +1 -0
  115. package/data/build/dist/client/features/session-translation.d.ts.map +1 -1
  116. package/data/build/dist/client/features/session-translation.js +50 -49
  117. package/data/build/dist/client/features/session-translation.js.map +1 -1
  118. package/data/build/dist/client/features/subscription-quota-groups.d.ts +193 -0
  119. package/data/build/dist/client/features/subscription-quota-groups.d.ts.map +1 -0
  120. package/data/build/dist/client/features/subscription-quota-groups.js +548 -0
  121. package/data/build/dist/client/features/subscription-quota-groups.js.map +1 -0
  122. package/data/build/dist/client/features/workspace-session-enhancement.d.ts.map +1 -1
  123. package/data/build/dist/client/features/workspace-session-enhancement.js +6 -0
  124. package/data/build/dist/client/features/workspace-session-enhancement.js.map +1 -1
  125. package/data/build/dist/client/file-management-dom.d.ts +20 -1
  126. package/data/build/dist/client/file-management-dom.d.ts.map +1 -1
  127. package/data/build/dist/client/file-management-dom.js +94 -18
  128. package/data/build/dist/client/file-management-dom.js.map +1 -1
  129. package/data/build/dist/client/file-viewer-copy-path-menu.d.ts +27 -0
  130. package/data/build/dist/client/file-viewer-copy-path-menu.d.ts.map +1 -0
  131. package/data/build/dist/client/file-viewer-copy-path-menu.js +101 -0
  132. package/data/build/dist/client/file-viewer-copy-path-menu.js.map +1 -0
  133. package/data/build/dist/client/git-management-settings.d.ts +4 -0
  134. package/data/build/dist/client/git-management-settings.d.ts.map +1 -0
  135. package/data/build/dist/client/git-management-settings.js +73 -0
  136. package/data/build/dist/client/git-management-settings.js.map +1 -0
  137. package/data/build/dist/client/git-management.d.ts +2 -1
  138. package/data/build/dist/client/git-management.d.ts.map +1 -1
  139. package/data/build/dist/client/git-management.js +64 -41
  140. package/data/build/dist/client/git-management.js.map +1 -1
  141. package/data/build/dist/client/git-panel-styles.d.ts +4 -0
  142. package/data/build/dist/client/git-panel-styles.d.ts.map +1 -1
  143. package/data/build/dist/client/git-panel-styles.js +15 -0
  144. package/data/build/dist/client/git-panel-styles.js.map +1 -1
  145. package/data/build/dist/client/html-workspace-files.d.ts +4 -0
  146. package/data/build/dist/client/html-workspace-files.d.ts.map +1 -0
  147. package/data/build/dist/client/html-workspace-files.js +114 -0
  148. package/data/build/dist/client/html-workspace-files.js.map +1 -0
  149. package/data/build/dist/client/index.d.ts +1 -1
  150. package/data/build/dist/client/index.d.ts.map +1 -1
  151. package/data/build/dist/client/index.js +1 -1
  152. package/data/build/dist/client/index.js.map +1 -1
  153. package/data/build/dist/client/locale.d.ts.map +1 -1
  154. package/data/build/dist/client/locale.js +29 -2
  155. package/data/build/dist/client/locale.js.map +1 -1
  156. package/data/build/dist/client/locales/cliManagement.d.ts +3 -0
  157. package/data/build/dist/client/locales/cliManagement.d.ts.map +1 -0
  158. package/data/build/dist/client/locales/cliManagement.js +155 -0
  159. package/data/build/dist/client/locales/cliManagement.js.map +1 -0
  160. package/data/build/dist/client/locales/fileWorkspace.d.ts.map +1 -1
  161. package/data/build/dist/client/locales/fileWorkspace.js +8 -0
  162. package/data/build/dist/client/locales/fileWorkspace.js.map +1 -1
  163. package/data/build/dist/client/locales/git.d.ts.map +1 -1
  164. package/data/build/dist/client/locales/git.js +30 -2
  165. package/data/build/dist/client/locales/git.js.map +1 -1
  166. package/data/build/dist/client/locales/magpie.d.ts +4 -0
  167. package/data/build/dist/client/locales/magpie.d.ts.map +1 -0
  168. package/data/build/dist/client/locales/magpie.js +622 -0
  169. package/data/build/dist/client/locales/magpie.js.map +1 -0
  170. package/data/build/dist/client/locales/panels.d.ts.map +1 -1
  171. package/data/build/dist/client/locales/panels.js +103 -11
  172. package/data/build/dist/client/locales/panels.js.map +1 -1
  173. package/data/build/dist/client/locales/peerHost.d.ts.map +1 -1
  174. package/data/build/dist/client/locales/peerHost.js +2 -0
  175. package/data/build/dist/client/locales/peerHost.js.map +1 -1
  176. package/data/build/dist/client/locales/quickApps.d.ts +136 -0
  177. package/data/build/dist/client/locales/quickApps.d.ts.map +1 -0
  178. package/data/build/dist/client/locales/quickApps.js +162 -0
  179. package/data/build/dist/client/locales/quickApps.js.map +1 -0
  180. package/data/build/dist/client/locales/usage.d.ts.map +1 -1
  181. package/data/build/dist/client/locales/usage.js +150 -0
  182. package/data/build/dist/client/locales/usage.js.map +1 -1
  183. package/data/build/dist/client/magpie-model-tag.d.ts +16 -0
  184. package/data/build/dist/client/magpie-model-tag.d.ts.map +1 -0
  185. package/data/build/dist/client/magpie-model-tag.js +62 -0
  186. package/data/build/dist/client/magpie-model-tag.js.map +1 -0
  187. package/data/build/dist/client/mobile-team-panel-dom.d.ts +14 -0
  188. package/data/build/dist/client/mobile-team-panel-dom.d.ts.map +1 -0
  189. package/data/build/dist/client/mobile-team-panel-dom.js +164 -0
  190. package/data/build/dist/client/mobile-team-panel-dom.js.map +1 -0
  191. package/data/build/dist/client/model-catalog-cache.d.ts.map +1 -1
  192. package/data/build/dist/client/model-catalog-cache.js +66 -12
  193. package/data/build/dist/client/model-catalog-cache.js.map +1 -1
  194. package/data/build/dist/client/model-priority-pool.d.ts +23 -0
  195. package/data/build/dist/client/model-priority-pool.d.ts.map +1 -0
  196. package/data/build/dist/client/model-priority-pool.js +245 -0
  197. package/data/build/dist/client/model-priority-pool.js.map +1 -0
  198. package/data/build/dist/client/native-model-translation-menu.d.ts +13 -0
  199. package/data/build/dist/client/native-model-translation-menu.d.ts.map +1 -0
  200. package/data/build/dist/client/native-model-translation-menu.js +159 -0
  201. package/data/build/dist/client/native-model-translation-menu.js.map +1 -0
  202. package/data/build/dist/client/native-translation-default.d.ts +6 -0
  203. package/data/build/dist/client/native-translation-default.d.ts.map +1 -0
  204. package/data/build/dist/client/native-translation-default.js +30 -0
  205. package/data/build/dist/client/native-translation-default.js.map +1 -0
  206. package/data/build/dist/client/provider-icons.d.ts +8 -0
  207. package/data/build/dist/client/provider-icons.d.ts.map +1 -1
  208. package/data/build/dist/client/provider-icons.js +125 -3
  209. package/data/build/dist/client/provider-icons.js.map +1 -1
  210. package/data/build/dist/client/quick-apps/browser-storage.d.ts +24 -0
  211. package/data/build/dist/client/quick-apps/browser-storage.d.ts.map +1 -0
  212. package/data/build/dist/client/quick-apps/browser-storage.js +114 -0
  213. package/data/build/dist/client/quick-apps/browser-storage.js.map +1 -0
  214. package/data/build/dist/client/quick-apps/client.d.ts +31 -0
  215. package/data/build/dist/client/quick-apps/client.d.ts.map +1 -0
  216. package/data/build/dist/client/quick-apps/client.js +68 -0
  217. package/data/build/dist/client/quick-apps/client.js.map +1 -0
  218. package/data/build/dist/client/quick-apps/document.d.ts +26 -0
  219. package/data/build/dist/client/quick-apps/document.d.ts.map +1 -0
  220. package/data/build/dist/client/quick-apps/document.js +110 -0
  221. package/data/build/dist/client/quick-apps/document.js.map +1 -0
  222. package/data/build/dist/client/quick-apps/file-picker.d.ts +14 -0
  223. package/data/build/dist/client/quick-apps/file-picker.d.ts.map +1 -0
  224. package/data/build/dist/client/quick-apps/file-picker.js +51 -0
  225. package/data/build/dist/client/quick-apps/file-picker.js.map +1 -0
  226. package/data/build/dist/client/quick-apps/launcher.d.ts +7 -0
  227. package/data/build/dist/client/quick-apps/launcher.d.ts.map +1 -0
  228. package/data/build/dist/client/quick-apps/launcher.js +267 -0
  229. package/data/build/dist/client/quick-apps/launcher.js.map +1 -0
  230. package/data/build/dist/client/quick-apps/presentation.d.ts +16 -0
  231. package/data/build/dist/client/quick-apps/presentation.d.ts.map +1 -0
  232. package/data/build/dist/client/quick-apps/presentation.js +47 -0
  233. package/data/build/dist/client/quick-apps/presentation.js.map +1 -0
  234. package/data/build/dist/client/quick-apps/rail-preference.d.ts +5 -0
  235. package/data/build/dist/client/quick-apps/rail-preference.d.ts.map +1 -0
  236. package/data/build/dist/client/quick-apps/rail-preference.js +19 -0
  237. package/data/build/dist/client/quick-apps/rail-preference.js.map +1 -0
  238. package/data/build/dist/client/quick-apps/reorder-animation.d.ts +6 -0
  239. package/data/build/dist/client/quick-apps/reorder-animation.d.ts.map +1 -0
  240. package/data/build/dist/client/quick-apps/reorder-animation.js +50 -0
  241. package/data/build/dist/client/quick-apps/reorder-animation.js.map +1 -0
  242. package/data/build/dist/client/quick-apps/reorder.d.ts +26 -0
  243. package/data/build/dist/client/quick-apps/reorder.d.ts.map +1 -0
  244. package/data/build/dist/client/quick-apps/reorder.js +128 -0
  245. package/data/build/dist/client/quick-apps/reorder.js.map +1 -0
  246. package/data/build/dist/client/quick-apps/styles.d.ts +3 -0
  247. package/data/build/dist/client/quick-apps/styles.d.ts.map +1 -0
  248. package/data/build/dist/client/quick-apps/styles.js +153 -0
  249. package/data/build/dist/client/quick-apps/styles.js.map +1 -0
  250. package/data/build/dist/client/quick-apps/ui.d.ts +20 -0
  251. package/data/build/dist/client/quick-apps/ui.d.ts.map +1 -0
  252. package/data/build/dist/client/quick-apps/ui.js +21 -0
  253. package/data/build/dist/client/quick-apps/ui.js.map +1 -0
  254. package/data/build/dist/client/quick-apps/viewer.d.ts +16 -0
  255. package/data/build/dist/client/quick-apps/viewer.d.ts.map +1 -0
  256. package/data/build/dist/client/quick-apps/viewer.js +165 -0
  257. package/data/build/dist/client/quick-apps/viewer.js.map +1 -0
  258. package/data/build/dist/client/quick-apps/workspace-picker.d.ts +19 -0
  259. package/data/build/dist/client/quick-apps/workspace-picker.d.ts.map +1 -0
  260. package/data/build/dist/client/quick-apps/workspace-picker.js +30 -0
  261. package/data/build/dist/client/quick-apps/workspace-picker.js.map +1 -0
  262. package/data/build/dist/client/session-translation-chat.d.ts +68 -2
  263. package/data/build/dist/client/session-translation-chat.d.ts.map +1 -1
  264. package/data/build/dist/client/session-translation-chat.js +297 -109
  265. package/data/build/dist/client/session-translation-chat.js.map +1 -1
  266. package/data/build/dist/client/session-translation-interactions.d.ts +31 -0
  267. package/data/build/dist/client/session-translation-interactions.d.ts.map +1 -0
  268. package/data/build/dist/client/session-translation-interactions.js +158 -0
  269. package/data/build/dist/client/session-translation-interactions.js.map +1 -0
  270. package/data/build/dist/client/session-translation-pending-dom.d.ts +8 -0
  271. package/data/build/dist/client/session-translation-pending-dom.d.ts.map +1 -0
  272. package/data/build/dist/client/session-translation-pending-dom.js +58 -0
  273. package/data/build/dist/client/session-translation-pending-dom.js.map +1 -0
  274. package/data/build/dist/client/session-translation-retry.d.ts +16 -0
  275. package/data/build/dist/client/session-translation-retry.d.ts.map +1 -0
  276. package/data/build/dist/client/session-translation-retry.js +66 -0
  277. package/data/build/dist/client/session-translation-retry.js.map +1 -0
  278. package/data/build/dist/client/session-translation-rules.d.ts +13 -0
  279. package/data/build/dist/client/session-translation-rules.d.ts.map +1 -0
  280. package/data/build/dist/client/session-translation-rules.js +58 -0
  281. package/data/build/dist/client/session-translation-rules.js.map +1 -0
  282. package/data/build/dist/client/settings-bridge.d.ts +1 -0
  283. package/data/build/dist/client/settings-bridge.d.ts.map +1 -1
  284. package/data/build/dist/client/settings-bridge.js +29 -10
  285. package/data/build/dist/client/settings-bridge.js.map +1 -1
  286. package/data/build/dist/client/settings-section.d.ts.map +1 -1
  287. package/data/build/dist/client/settings-section.js +21 -3
  288. package/data/build/dist/client/settings-section.js.map +1 -1
  289. package/data/build/dist/client/sidebar-footer-style.d.ts +13 -0
  290. package/data/build/dist/client/sidebar-footer-style.d.ts.map +1 -0
  291. package/data/build/dist/client/sidebar-footer-style.js +54 -0
  292. package/data/build/dist/client/sidebar-footer-style.js.map +1 -0
  293. package/data/build/dist/client/style.css +279 -276
  294. package/data/build/dist/client/subscription-slot.d.ts +26 -2
  295. package/data/build/dist/client/subscription-slot.d.ts.map +1 -1
  296. package/data/build/dist/client/subscription-slot.js +679 -24
  297. package/data/build/dist/client/subscription-slot.js.map +1 -1
  298. package/data/build/dist/client/terminal/model.d.ts.map +1 -1
  299. package/data/build/dist/client/terminal/model.js +2 -1
  300. package/data/build/dist/client/terminal/model.js.map +1 -1
  301. package/data/build/dist/client/workspace-session-archive-dom.d.ts +1 -0
  302. package/data/build/dist/client/workspace-session-archive-dom.d.ts.map +1 -1
  303. package/data/build/dist/client/workspace-session-archive-dom.js +68 -8
  304. package/data/build/dist/client/workspace-session-archive-dom.js.map +1 -1
  305. package/data/build/dist/client/workspace-session-rightbar-dom.d.ts.map +1 -1
  306. package/data/build/dist/client/workspace-session-rightbar-dom.js +12 -21
  307. package/data/build/dist/client/workspace-session-rightbar-dom.js.map +1 -1
  308. package/data/build/dist/client/workspace-session-visibility-dom.d.ts +3 -0
  309. package/data/build/dist/client/workspace-session-visibility-dom.d.ts.map +1 -1
  310. package/data/build/dist/client/workspace-session-visibility-dom.js +43 -10
  311. package/data/build/dist/client/workspace-session-visibility-dom.js.map +1 -1
  312. package/data/build/dist/dsh-capabilities/client/composer-presentation-adapter.d.ts +8 -0
  313. package/data/build/dist/dsh-capabilities/client/composer-presentation-adapter.d.ts.map +1 -0
  314. package/data/build/dist/dsh-capabilities/client/composer-presentation-adapter.js +71 -0
  315. package/data/build/dist/dsh-capabilities/client/composer-presentation-adapter.js.map +1 -0
  316. package/data/build/dist/dsh-capabilities/client/composer-slot-selectors.d.ts +4 -0
  317. package/data/build/dist/dsh-capabilities/client/composer-slot-selectors.d.ts.map +1 -0
  318. package/data/build/dist/dsh-capabilities/client/composer-slot-selectors.js +8 -0
  319. package/data/build/dist/dsh-capabilities/client/composer-slot-selectors.js.map +1 -0
  320. package/data/build/dist/dsh-capabilities/client/global-panel-adapter.d.ts +27 -0
  321. package/data/build/dist/dsh-capabilities/client/global-panel-adapter.d.ts.map +1 -0
  322. package/data/build/dist/dsh-capabilities/client/global-panel-adapter.js +109 -0
  323. package/data/build/dist/dsh-capabilities/client/global-panel-adapter.js.map +1 -0
  324. package/data/build/dist/dsh-capabilities/client/interaction-presentation-adapter.d.ts +30 -0
  325. package/data/build/dist/dsh-capabilities/client/interaction-presentation-adapter.d.ts.map +1 -0
  326. package/data/build/dist/dsh-capabilities/client/interaction-presentation-adapter.js +93 -0
  327. package/data/build/dist/dsh-capabilities/client/interaction-presentation-adapter.js.map +1 -0
  328. package/data/build/dist/dsh-capabilities/client/interaction-text-dom.d.ts +12 -0
  329. package/data/build/dist/dsh-capabilities/client/interaction-text-dom.d.ts.map +1 -0
  330. package/data/build/dist/dsh-capabilities/client/interaction-text-dom.js +181 -0
  331. package/data/build/dist/dsh-capabilities/client/interaction-text-dom.js.map +1 -0
  332. package/data/build/dist/dsh-capabilities/client/message-presentation-adapter.d.ts +19 -0
  333. package/data/build/dist/dsh-capabilities/client/message-presentation-adapter.d.ts.map +1 -0
  334. package/data/build/dist/dsh-capabilities/client/message-presentation-adapter.js +39 -0
  335. package/data/build/dist/dsh-capabilities/client/message-presentation-adapter.js.map +1 -0
  336. package/data/build/dist/dsh-capabilities/client/peer-host-attachment-adapter.d.ts +3 -0
  337. package/data/build/dist/dsh-capabilities/client/peer-host-attachment-adapter.d.ts.map +1 -0
  338. package/data/build/dist/dsh-capabilities/client/peer-host-attachment-adapter.js +27 -0
  339. package/data/build/dist/dsh-capabilities/client/peer-host-attachment-adapter.js.map +1 -0
  340. package/data/build/dist/dsh-capabilities/client/primitives-adapter.d.ts +36 -0
  341. package/data/build/dist/dsh-capabilities/client/primitives-adapter.d.ts.map +1 -1
  342. package/data/build/dist/dsh-capabilities/client/primitives-adapter.js +88 -0
  343. package/data/build/dist/dsh-capabilities/client/primitives-adapter.js.map +1 -1
  344. package/data/build/dist/dsh-capabilities/client/question-history-adapter.d.ts +20 -0
  345. package/data/build/dist/dsh-capabilities/client/question-history-adapter.d.ts.map +1 -0
  346. package/data/build/dist/dsh-capabilities/client/question-history-adapter.js +65 -0
  347. package/data/build/dist/dsh-capabilities/client/question-history-adapter.js.map +1 -0
  348. package/data/build/dist/dsh-capabilities/client/quick-app-footer-adapter.d.ts +18 -0
  349. package/data/build/dist/dsh-capabilities/client/quick-app-footer-adapter.d.ts.map +1 -0
  350. package/data/build/dist/dsh-capabilities/client/quick-app-footer-adapter.js +11 -0
  351. package/data/build/dist/dsh-capabilities/client/quick-app-footer-adapter.js.map +1 -0
  352. package/data/build/dist/dsh-capabilities/client/session-performance-adapter.d.ts +9 -0
  353. package/data/build/dist/dsh-capabilities/client/session-performance-adapter.d.ts.map +1 -0
  354. package/data/build/dist/dsh-capabilities/client/session-performance-adapter.js +75 -0
  355. package/data/build/dist/dsh-capabilities/client/session-performance-adapter.js.map +1 -0
  356. package/data/build/dist/dsh-capabilities/client/sidebar-footer-icon-adapter.d.ts +3 -0
  357. package/data/build/dist/dsh-capabilities/client/sidebar-footer-icon-adapter.d.ts.map +1 -0
  358. package/data/build/dist/dsh-capabilities/client/sidebar-footer-icon-adapter.js +22 -0
  359. package/data/build/dist/dsh-capabilities/client/sidebar-footer-icon-adapter.js.map +1 -0
  360. package/data/build/dist/dsh-capabilities/client/slot-presentation-mirror.d.ts +32 -0
  361. package/data/build/dist/dsh-capabilities/client/slot-presentation-mirror.d.ts.map +1 -0
  362. package/data/build/dist/dsh-capabilities/client/slot-presentation-mirror.js +90 -0
  363. package/data/build/dist/dsh-capabilities/client/slot-presentation-mirror.js.map +1 -0
  364. package/data/build/dist/dsh-capabilities/host/agent-team-adapter.d.ts +52 -0
  365. package/data/build/dist/dsh-capabilities/host/agent-team-adapter.d.ts.map +1 -0
  366. package/data/build/dist/dsh-capabilities/host/agent-team-adapter.js +109 -0
  367. package/data/build/dist/dsh-capabilities/host/agent-team-adapter.js.map +1 -0
  368. package/data/build/dist/dsh-capabilities/host/connection-peer-adapter.d.ts +10 -0
  369. package/data/build/dist/dsh-capabilities/host/connection-peer-adapter.d.ts.map +1 -0
  370. package/data/build/dist/dsh-capabilities/host/connection-peer-adapter.js +34 -0
  371. package/data/build/dist/dsh-capabilities/host/connection-peer-adapter.js.map +1 -0
  372. package/data/build/dist/dsh-capabilities/host/native-dispatch-adapter.d.ts +21 -0
  373. package/data/build/dist/dsh-capabilities/host/native-dispatch-adapter.d.ts.map +1 -0
  374. package/data/build/dist/dsh-capabilities/host/native-dispatch-adapter.js +11 -0
  375. package/data/build/dist/dsh-capabilities/host/native-dispatch-adapter.js.map +1 -0
  376. package/data/build/dist/dsh-capabilities/host/quick-app-credentials.d.ts +11 -0
  377. package/data/build/dist/dsh-capabilities/host/quick-app-credentials.d.ts.map +1 -0
  378. package/data/build/dist/dsh-capabilities/host/quick-app-credentials.js +97 -0
  379. package/data/build/dist/dsh-capabilities/host/quick-app-credentials.js.map +1 -0
  380. package/data/build/dist/dsh-capabilities/host/quick-app-https-provider.d.ts +36 -0
  381. package/data/build/dist/dsh-capabilities/host/quick-app-https-provider.d.ts.map +1 -0
  382. package/data/build/dist/dsh-capabilities/host/quick-app-https-provider.js +164 -0
  383. package/data/build/dist/dsh-capabilities/host/quick-app-https-provider.js.map +1 -0
  384. package/data/build/dist/dsh-capabilities/host/quick-app-lan-ports.d.ts +44 -0
  385. package/data/build/dist/dsh-capabilities/host/quick-app-lan-ports.d.ts.map +1 -0
  386. package/data/build/dist/dsh-capabilities/host/quick-app-lan-ports.js +240 -0
  387. package/data/build/dist/dsh-capabilities/host/quick-app-lan-ports.js.map +1 -0
  388. package/data/build/dist/dsh-capabilities/host/quick-app-origin-adapter.d.ts +37 -0
  389. package/data/build/dist/dsh-capabilities/host/quick-app-origin-adapter.d.ts.map +1 -0
  390. package/data/build/dist/dsh-capabilities/host/quick-app-origin-adapter.js +35 -0
  391. package/data/build/dist/dsh-capabilities/host/quick-app-origin-adapter.js.map +1 -0
  392. package/data/build/dist/dsh-capabilities/host/quick-app-proxy-adapter.d.ts +13 -0
  393. package/data/build/dist/dsh-capabilities/host/quick-app-proxy-adapter.d.ts.map +1 -0
  394. package/data/build/dist/dsh-capabilities/host/quick-app-proxy-adapter.js +30 -0
  395. package/data/build/dist/dsh-capabilities/host/quick-app-proxy-adapter.js.map +1 -0
  396. package/data/build/dist/dsh-capabilities/host/quick-app-proxy-provider.d.ts +21 -0
  397. package/data/build/dist/dsh-capabilities/host/quick-app-proxy-provider.d.ts.map +1 -0
  398. package/data/build/dist/dsh-capabilities/host/quick-app-proxy-provider.js +132 -0
  399. package/data/build/dist/dsh-capabilities/host/quick-app-proxy-provider.js.map +1 -0
  400. package/data/build/dist/dsh-capabilities/host/quick-app-transport.d.ts +10 -0
  401. package/data/build/dist/dsh-capabilities/host/quick-app-transport.d.ts.map +1 -0
  402. package/data/build/dist/dsh-capabilities/host/quick-app-transport.js +33 -0
  403. package/data/build/dist/dsh-capabilities/host/quick-app-transport.js.map +1 -0
  404. package/data/build/dist/dsh-capabilities/host/session-activation-adapter.d.ts +17 -0
  405. package/data/build/dist/dsh-capabilities/host/session-activation-adapter.d.ts.map +1 -0
  406. package/data/build/dist/dsh-capabilities/host/session-activation-adapter.js +37 -0
  407. package/data/build/dist/dsh-capabilities/host/session-activation-adapter.js.map +1 -0
  408. package/data/build/dist/dsh-capabilities/host/session-model-selection-adapter.d.ts +17 -0
  409. package/data/build/dist/dsh-capabilities/host/session-model-selection-adapter.d.ts.map +1 -0
  410. package/data/build/dist/dsh-capabilities/host/session-model-selection-adapter.js +45 -0
  411. package/data/build/dist/dsh-capabilities/host/session-model-selection-adapter.js.map +1 -0
  412. package/data/build/dist/dsh-capabilities/host/session-performance-adapter.d.ts +7 -0
  413. package/data/build/dist/dsh-capabilities/host/session-performance-adapter.d.ts.map +1 -0
  414. package/data/build/dist/dsh-capabilities/host/session-performance-adapter.js +18 -0
  415. package/data/build/dist/dsh-capabilities/host/session-performance-adapter.js.map +1 -0
  416. package/data/build/dist/dsh-capabilities/host/session-prompt-adapter.d.ts +28 -0
  417. package/data/build/dist/dsh-capabilities/host/session-prompt-adapter.d.ts.map +1 -0
  418. package/data/build/dist/dsh-capabilities/host/session-prompt-adapter.js +31 -0
  419. package/data/build/dist/dsh-capabilities/host/session-prompt-adapter.js.map +1 -0
  420. package/data/build/dist/dsh-capabilities/host/session-title-adapter.d.ts +2 -1
  421. package/data/build/dist/dsh-capabilities/host/session-title-adapter.d.ts.map +1 -1
  422. package/data/build/dist/dsh-capabilities/host/session-title-adapter.js +32 -2
  423. package/data/build/dist/dsh-capabilities/host/session-title-adapter.js.map +1 -1
  424. package/data/build/dist/dsh-capabilities/host/workspace-directory-adapter.d.ts +13 -0
  425. package/data/build/dist/dsh-capabilities/host/workspace-directory-adapter.d.ts.map +1 -0
  426. package/data/build/dist/dsh-capabilities/host/workspace-directory-adapter.js +24 -0
  427. package/data/build/dist/dsh-capabilities/host/workspace-directory-adapter.js.map +1 -0
  428. package/data/build/dist/dsh-capabilities/matrix.d.ts.map +1 -1
  429. package/data/build/dist/dsh-capabilities/matrix.js +23 -5
  430. package/data/build/dist/dsh-capabilities/matrix.js.map +1 -1
  431. package/data/build/dist/dsh-capabilities/routes.d.ts +1 -0
  432. package/data/build/dist/dsh-capabilities/routes.d.ts.map +1 -1
  433. package/data/build/dist/dsh-capabilities/routes.js +50 -3
  434. package/data/build/dist/dsh-capabilities/routes.js.map +1 -1
  435. package/data/build/dist/dsh-capabilities/types.d.ts +1 -1
  436. package/data/build/dist/dsh-capabilities/types.d.ts.map +1 -1
  437. package/data/build/dist/dsh-capabilities/types.js.map +1 -1
  438. package/data/build/dist/host/cli-adapters/acp-cli-driver.d.ts +27 -0
  439. package/data/build/dist/host/cli-adapters/acp-cli-driver.d.ts.map +1 -1
  440. package/data/build/dist/host/cli-adapters/acp-cli-driver.js +94 -16
  441. package/data/build/dist/host/cli-adapters/acp-cli-driver.js.map +1 -1
  442. package/data/build/dist/host/cli-adapters/antigravity-driver.js +1 -1
  443. package/data/build/dist/host/cli-adapters/antigravity-driver.js.map +1 -1
  444. package/data/build/dist/host/cli-adapters/attachment-utils.d.ts +4 -3
  445. package/data/build/dist/host/cli-adapters/attachment-utils.d.ts.map +1 -1
  446. package/data/build/dist/host/cli-adapters/attachment-utils.js +9 -8
  447. package/data/build/dist/host/cli-adapters/attachment-utils.js.map +1 -1
  448. package/data/build/dist/host/cli-adapters/binary-detection.d.ts.map +1 -1
  449. package/data/build/dist/host/cli-adapters/binary-detection.js +7 -3
  450. package/data/build/dist/host/cli-adapters/binary-detection.js.map +1 -1
  451. package/data/build/dist/host/cli-adapters/claude-driver.d.ts +1 -0
  452. package/data/build/dist/host/cli-adapters/claude-driver.d.ts.map +1 -1
  453. package/data/build/dist/host/cli-adapters/claude-driver.js +184 -21
  454. package/data/build/dist/host/cli-adapters/claude-driver.js.map +1 -1
  455. package/data/build/dist/host/cli-adapters/codex-driver.d.ts +28 -0
  456. package/data/build/dist/host/cli-adapters/codex-driver.d.ts.map +1 -1
  457. package/data/build/dist/host/cli-adapters/codex-driver.js +158 -22
  458. package/data/build/dist/host/cli-adapters/codex-driver.js.map +1 -1
  459. package/data/build/dist/host/cli-adapters/codex-performance-projection.d.ts +91 -0
  460. package/data/build/dist/host/cli-adapters/codex-performance-projection.d.ts.map +1 -0
  461. package/data/build/dist/host/cli-adapters/codex-performance-projection.js +8 -0
  462. package/data/build/dist/host/cli-adapters/codex-performance-projection.js.map +1 -0
  463. package/data/build/dist/host/cli-adapters/codex-performance.d.ts +16 -0
  464. package/data/build/dist/host/cli-adapters/codex-performance.d.ts.map +1 -0
  465. package/data/build/dist/host/cli-adapters/codex-performance.js +81 -0
  466. package/data/build/dist/host/cli-adapters/codex-performance.js.map +1 -0
  467. package/data/build/dist/host/cli-adapters/command-code-acp-loader.d.ts +6 -2
  468. package/data/build/dist/host/cli-adapters/command-code-acp-loader.d.ts.map +1 -1
  469. package/data/build/dist/host/cli-adapters/command-code-acp-loader.js +198 -26
  470. package/data/build/dist/host/cli-adapters/command-code-acp-loader.js.map +1 -1
  471. package/data/build/dist/host/cli-adapters/command-code-driver.d.ts.map +1 -1
  472. package/data/build/dist/host/cli-adapters/command-code-driver.js +33 -5
  473. package/data/build/dist/host/cli-adapters/command-code-driver.js.map +1 -1
  474. package/data/build/dist/host/cli-adapters/desktop-app-runtime.d.ts +3 -1
  475. package/data/build/dist/host/cli-adapters/desktop-app-runtime.d.ts.map +1 -1
  476. package/data/build/dist/host/cli-adapters/desktop-app-runtime.js +41 -4
  477. package/data/build/dist/host/cli-adapters/desktop-app-runtime.js.map +1 -1
  478. package/data/build/dist/host/cli-adapters/driver.d.ts +2 -0
  479. package/data/build/dist/host/cli-adapters/driver.d.ts.map +1 -1
  480. package/data/build/dist/host/cli-adapters/dsh-message-projector.d.ts +5 -1
  481. package/data/build/dist/host/cli-adapters/dsh-message-projector.d.ts.map +1 -1
  482. package/data/build/dist/host/cli-adapters/dsh-message-projector.js +65 -17
  483. package/data/build/dist/host/cli-adapters/dsh-message-projector.js.map +1 -1
  484. package/data/build/dist/host/cli-adapters/dsh-tool-history.js +3 -2
  485. package/data/build/dist/host/cli-adapters/dsh-tool-history.js.map +1 -1
  486. package/data/build/dist/host/cli-adapters/dsh-virtual-providers.d.ts.map +1 -1
  487. package/data/build/dist/host/cli-adapters/dsh-virtual-providers.js +3 -2
  488. package/data/build/dist/host/cli-adapters/dsh-virtual-providers.js.map +1 -1
  489. package/data/build/dist/host/cli-adapters/feature.d.ts +17 -0
  490. package/data/build/dist/host/cli-adapters/feature.d.ts.map +1 -1
  491. package/data/build/dist/host/cli-adapters/feature.js +972 -102
  492. package/data/build/dist/host/cli-adapters/feature.js.map +1 -1
  493. package/data/build/dist/host/cli-adapters/gemini-driver.d.ts.map +1 -1
  494. package/data/build/dist/host/cli-adapters/gemini-driver.js +5 -3
  495. package/data/build/dist/host/cli-adapters/gemini-driver.js.map +1 -1
  496. package/data/build/dist/host/cli-adapters/grok-driver.d.ts +7 -0
  497. package/data/build/dist/host/cli-adapters/grok-driver.d.ts.map +1 -1
  498. package/data/build/dist/host/cli-adapters/grok-driver.js +463 -59
  499. package/data/build/dist/host/cli-adapters/grok-driver.js.map +1 -1
  500. package/data/build/dist/host/cli-adapters/grok-performance-projection.d.ts +123 -0
  501. package/data/build/dist/host/cli-adapters/grok-performance-projection.d.ts.map +1 -0
  502. package/data/build/dist/host/cli-adapters/grok-performance-projection.js +48 -0
  503. package/data/build/dist/host/cli-adapters/grok-performance-projection.js.map +1 -0
  504. package/data/build/dist/host/cli-adapters/grok-usage.d.ts +45 -0
  505. package/data/build/dist/host/cli-adapters/grok-usage.d.ts.map +1 -0
  506. package/data/build/dist/host/cli-adapters/grok-usage.js +197 -0
  507. package/data/build/dist/host/cli-adapters/grok-usage.js.map +1 -0
  508. package/data/build/dist/host/cli-adapters/kimi-driver.js +2 -2
  509. package/data/build/dist/host/cli-adapters/kimi-driver.js.map +1 -1
  510. package/data/build/dist/host/cli-adapters/legacy-session-adapter.d.ts.map +1 -1
  511. package/data/build/dist/host/cli-adapters/legacy-session-adapter.js +20 -3
  512. package/data/build/dist/host/cli-adapters/legacy-session-adapter.js.map +1 -1
  513. package/data/build/dist/host/cli-adapters/magpie-detection.d.ts +72 -0
  514. package/data/build/dist/host/cli-adapters/magpie-detection.d.ts.map +1 -0
  515. package/data/build/dist/host/cli-adapters/magpie-detection.js +298 -0
  516. package/data/build/dist/host/cli-adapters/magpie-detection.js.map +1 -0
  517. package/data/build/dist/host/cli-adapters/magpie-management.d.ts +50 -0
  518. package/data/build/dist/host/cli-adapters/magpie-management.d.ts.map +1 -0
  519. package/data/build/dist/host/cli-adapters/magpie-management.js +1268 -0
  520. package/data/build/dist/host/cli-adapters/magpie-management.js.map +1 -0
  521. package/data/build/dist/host/cli-adapters/magpie-session-routing.d.ts +9 -0
  522. package/data/build/dist/host/cli-adapters/magpie-session-routing.d.ts.map +1 -0
  523. package/data/build/dist/host/cli-adapters/magpie-session-routing.js +90 -0
  524. package/data/build/dist/host/cli-adapters/magpie-session-routing.js.map +1 -0
  525. package/data/build/dist/host/cli-adapters/magpie-update.d.ts +59 -0
  526. package/data/build/dist/host/cli-adapters/magpie-update.d.ts.map +1 -0
  527. package/data/build/dist/host/cli-adapters/magpie-update.js +249 -0
  528. package/data/build/dist/host/cli-adapters/magpie-update.js.map +1 -0
  529. package/data/build/dist/host/cli-adapters/magpie-usage.d.ts +148 -0
  530. package/data/build/dist/host/cli-adapters/magpie-usage.d.ts.map +1 -0
  531. package/data/build/dist/host/cli-adapters/magpie-usage.js +1710 -0
  532. package/data/build/dist/host/cli-adapters/magpie-usage.js.map +1 -0
  533. package/data/build/dist/host/cli-adapters/magpie-web.d.ts +54 -0
  534. package/data/build/dist/host/cli-adapters/magpie-web.d.ts.map +1 -0
  535. package/data/build/dist/host/cli-adapters/magpie-web.js +407 -0
  536. package/data/build/dist/host/cli-adapters/magpie-web.js.map +1 -0
  537. package/data/build/dist/host/cli-adapters/management-installation.d.ts +5 -0
  538. package/data/build/dist/host/cli-adapters/management-installation.d.ts.map +1 -0
  539. package/data/build/dist/host/cli-adapters/management-installation.js +131 -0
  540. package/data/build/dist/host/cli-adapters/management-installation.js.map +1 -0
  541. package/data/build/dist/host/cli-adapters/management-methods.d.ts +37 -0
  542. package/data/build/dist/host/cli-adapters/management-methods.d.ts.map +1 -0
  543. package/data/build/dist/host/cli-adapters/management-methods.js +144 -0
  544. package/data/build/dist/host/cli-adapters/management-methods.js.map +1 -0
  545. package/data/build/dist/host/cli-adapters/management-process.d.ts +7 -0
  546. package/data/build/dist/host/cli-adapters/management-process.d.ts.map +1 -0
  547. package/data/build/dist/host/cli-adapters/management-process.js +62 -0
  548. package/data/build/dist/host/cli-adapters/management-process.js.map +1 -0
  549. package/data/build/dist/host/cli-adapters/management.d.ts +32 -0
  550. package/data/build/dist/host/cli-adapters/management.d.ts.map +1 -0
  551. package/data/build/dist/host/cli-adapters/management.js +177 -0
  552. package/data/build/dist/host/cli-adapters/management.js.map +1 -0
  553. package/data/build/dist/host/cli-adapters/mcode-driver.d.ts.map +1 -1
  554. package/data/build/dist/host/cli-adapters/mcode-driver.js +12 -5
  555. package/data/build/dist/host/cli-adapters/mcode-driver.js.map +1 -1
  556. package/data/build/dist/host/cli-adapters/model-catalog.d.ts +1 -0
  557. package/data/build/dist/host/cli-adapters/model-catalog.d.ts.map +1 -1
  558. package/data/build/dist/host/cli-adapters/model-catalog.js +70 -7
  559. package/data/build/dist/host/cli-adapters/model-catalog.js.map +1 -1
  560. package/data/build/dist/host/cli-adapters/native-subagent-dispatch.d.ts +1 -1
  561. package/data/build/dist/host/cli-adapters/native-subagent-dispatch.d.ts.map +1 -1
  562. package/data/build/dist/host/cli-adapters/native-subagent-dispatch.js +13 -5
  563. package/data/build/dist/host/cli-adapters/native-subagent-dispatch.js.map +1 -1
  564. package/data/build/dist/host/cli-adapters/native-team-subagent.d.ts +7 -1
  565. package/data/build/dist/host/cli-adapters/native-team-subagent.d.ts.map +1 -1
  566. package/data/build/dist/host/cli-adapters/native-team-subagent.js +6 -3
  567. package/data/build/dist/host/cli-adapters/native-team-subagent.js.map +1 -1
  568. package/data/build/dist/host/cli-adapters/opencode-driver.d.ts +22 -0
  569. package/data/build/dist/host/cli-adapters/opencode-driver.d.ts.map +1 -1
  570. package/data/build/dist/host/cli-adapters/opencode-driver.js +105 -17
  571. package/data/build/dist/host/cli-adapters/opencode-driver.js.map +1 -1
  572. package/data/build/dist/host/cli-adapters/opencode-v2-protocol.js +4 -1
  573. package/data/build/dist/host/cli-adapters/opencode-v2-protocol.js.map +1 -1
  574. package/data/build/dist/host/cli-adapters/pi-driver.d.ts.map +1 -1
  575. package/data/build/dist/host/cli-adapters/pi-driver.js +45 -11
  576. package/data/build/dist/host/cli-adapters/pi-driver.js.map +1 -1
  577. package/data/build/dist/host/cli-adapters/process-utils.d.ts +4 -0
  578. package/data/build/dist/host/cli-adapters/process-utils.d.ts.map +1 -1
  579. package/data/build/dist/host/cli-adapters/process-utils.js +20 -11
  580. package/data/build/dist/host/cli-adapters/process-utils.js.map +1 -1
  581. package/data/build/dist/host/cli-adapters/registry.d.ts +7 -1
  582. package/data/build/dist/host/cli-adapters/registry.d.ts.map +1 -1
  583. package/data/build/dist/host/cli-adapters/registry.js +141 -51
  584. package/data/build/dist/host/cli-adapters/registry.js.map +1 -1
  585. package/data/build/dist/host/cli-adapters/session-performance-projection.d.ts +74 -0
  586. package/data/build/dist/host/cli-adapters/session-performance-projection.d.ts.map +1 -0
  587. package/data/build/dist/host/cli-adapters/session-performance-projection.js +83 -0
  588. package/data/build/dist/host/cli-adapters/session-performance-projection.js.map +1 -0
  589. package/data/build/dist/host/cli-adapters/standard-stream-driver.d.ts.map +1 -1
  590. package/data/build/dist/host/cli-adapters/standard-stream-driver.js +4 -0
  591. package/data/build/dist/host/cli-adapters/standard-stream-driver.js.map +1 -1
  592. package/data/build/dist/host/cli-adapters/stream-normalizer.d.ts +3 -1
  593. package/data/build/dist/host/cli-adapters/stream-normalizer.d.ts.map +1 -1
  594. package/data/build/dist/host/cli-adapters/stream-normalizer.js +2 -0
  595. package/data/build/dist/host/cli-adapters/stream-normalizer.js.map +1 -1
  596. package/data/build/dist/host/cli-adapters/subagent-tool-descriptions.d.ts +26 -0
  597. package/data/build/dist/host/cli-adapters/subagent-tool-descriptions.d.ts.map +1 -0
  598. package/data/build/dist/host/cli-adapters/subagent-tool-descriptions.js +30 -0
  599. package/data/build/dist/host/cli-adapters/subagent-tool-descriptions.js.map +1 -0
  600. package/data/build/dist/host/cli-adapters/subagent-tool.d.ts.map +1 -1
  601. package/data/build/dist/host/cli-adapters/subagent-tool.js +7 -6
  602. package/data/build/dist/host/cli-adapters/subagent-tool.js.map +1 -1
  603. package/data/build/dist/host/cli-adapters/team-input.d.ts +17 -0
  604. package/data/build/dist/host/cli-adapters/team-input.d.ts.map +1 -0
  605. package/data/build/dist/host/cli-adapters/team-input.js +67 -0
  606. package/data/build/dist/host/cli-adapters/team-input.js.map +1 -0
  607. package/data/build/dist/host/cli-adapters/update-check.d.ts +34 -0
  608. package/data/build/dist/host/cli-adapters/update-check.d.ts.map +1 -0
  609. package/data/build/dist/host/cli-adapters/update-check.js +263 -0
  610. package/data/build/dist/host/cli-adapters/update-check.js.map +1 -0
  611. package/data/build/dist/host/cli-adapters/zcode-driver.d.ts.map +1 -1
  612. package/data/build/dist/host/cli-adapters/zcode-driver.js +7 -2
  613. package/data/build/dist/host/cli-adapters/zcode-driver.js.map +1 -1
  614. package/data/build/dist/host/cli-adapters/zcode-update.d.ts +8 -0
  615. package/data/build/dist/host/cli-adapters/zcode-update.d.ts.map +1 -0
  616. package/data/build/dist/host/cli-adapters/zcode-update.js +149 -0
  617. package/data/build/dist/host/cli-adapters/zcode-update.js.map +1 -0
  618. package/data/build/dist/host/cli-bridge/bridge-holder.d.ts +14 -0
  619. package/data/build/dist/host/cli-bridge/bridge-holder.d.ts.map +1 -1
  620. package/data/build/dist/host/cli-bridge/bridge-holder.js +53 -6
  621. package/data/build/dist/host/cli-bridge/bridge-holder.js.map +1 -1
  622. package/data/build/dist/host/cli-bridge/bridge-server.d.ts +8 -0
  623. package/data/build/dist/host/cli-bridge/bridge-server.d.ts.map +1 -1
  624. package/data/build/dist/host/cli-bridge/bridge-server.js +63 -6
  625. package/data/build/dist/host/cli-bridge/bridge-server.js.map +1 -1
  626. package/data/build/dist/host/cli-bridge/command-code-mod.d.ts.map +1 -1
  627. package/data/build/dist/host/cli-bridge/command-code-mod.js +128 -0
  628. package/data/build/dist/host/cli-bridge/command-code-mod.js.map +1 -1
  629. package/data/build/dist/host/cli-bridge/dispatch.js +1 -1
  630. package/data/build/dist/host/cli-bridge/dispatch.js.map +1 -1
  631. package/data/build/dist/host/cli-bridge/fetch-dispatch.d.ts +23 -0
  632. package/data/build/dist/host/cli-bridge/fetch-dispatch.d.ts.map +1 -0
  633. package/data/build/dist/host/cli-bridge/fetch-dispatch.js +73 -0
  634. package/data/build/dist/host/cli-bridge/fetch-dispatch.js.map +1 -0
  635. package/data/build/dist/host/cli-bridge/injections.d.ts +14 -0
  636. package/data/build/dist/host/cli-bridge/injections.d.ts.map +1 -1
  637. package/data/build/dist/host/cli-bridge/injections.js +69 -7
  638. package/data/build/dist/host/cli-bridge/injections.js.map +1 -1
  639. package/data/build/dist/host/cli-bridge/mcp-stdio-entry.d.ts +1 -1
  640. package/data/build/dist/host/cli-bridge/mcp-stdio-entry.js +102 -7
  641. package/data/build/dist/host/cli-bridge/mcp-stdio-entry.js.map +1 -1
  642. package/data/build/dist/host/cli-bridge/pi-extension-entry.d.ts +3 -0
  643. package/data/build/dist/host/cli-bridge/pi-extension-entry.d.ts.map +1 -0
  644. package/data/build/dist/host/cli-bridge/pi-extension-entry.js +9 -0
  645. package/data/build/dist/host/cli-bridge/pi-extension-entry.js.map +1 -0
  646. package/data/build/dist/host/cli-bridge/pi-extension.d.ts +52 -0
  647. package/data/build/dist/host/cli-bridge/pi-extension.d.ts.map +1 -0
  648. package/data/build/dist/host/cli-bridge/pi-extension.js +311 -0
  649. package/data/build/dist/host/cli-bridge/pi-extension.js.map +1 -0
  650. package/data/build/dist/host/cli-bridge/search-dispatch.d.ts +20 -0
  651. package/data/build/dist/host/cli-bridge/search-dispatch.d.ts.map +1 -0
  652. package/data/build/dist/host/cli-bridge/search-dispatch.js +61 -0
  653. package/data/build/dist/host/cli-bridge/search-dispatch.js.map +1 -0
  654. package/data/build/dist/host/cli-bridge/team-adapters.d.ts +11 -0
  655. package/data/build/dist/host/cli-bridge/team-adapters.d.ts.map +1 -0
  656. package/data/build/dist/host/cli-bridge/team-adapters.js +23 -0
  657. package/data/build/dist/host/cli-bridge/team-adapters.js.map +1 -0
  658. package/data/build/dist/host/cli-bridge/team-dispatch.d.ts +28 -0
  659. package/data/build/dist/host/cli-bridge/team-dispatch.d.ts.map +1 -0
  660. package/data/build/dist/host/cli-bridge/team-dispatch.js +208 -0
  661. package/data/build/dist/host/cli-bridge/team-dispatch.js.map +1 -0
  662. package/data/build/dist/host/cli-bridge/team-tool.d.ts +3 -0
  663. package/data/build/dist/host/cli-bridge/team-tool.d.ts.map +1 -0
  664. package/data/build/dist/host/cli-bridge/team-tool.js +18 -0
  665. package/data/build/dist/host/cli-bridge/team-tool.js.map +1 -0
  666. package/data/build/dist/host/dsh-gateway-feature.d.ts.map +1 -1
  667. package/data/build/dist/host/dsh-gateway-feature.js +26 -3
  668. package/data/build/dist/host/dsh-gateway-feature.js.map +1 -1
  669. package/data/build/dist/host/features/file-management.d.ts.map +1 -1
  670. package/data/build/dist/host/features/file-management.js +10 -1
  671. package/data/build/dist/host/features/file-management.js.map +1 -1
  672. package/data/build/dist/host/features/git-commit-message.d.ts +5 -0
  673. package/data/build/dist/host/features/git-commit-message.d.ts.map +1 -0
  674. package/data/build/dist/host/features/git-commit-message.js +66 -0
  675. package/data/build/dist/host/features/git-commit-message.js.map +1 -0
  676. package/data/build/dist/host/features/git-management.d.ts +11 -2
  677. package/data/build/dist/host/features/git-management.d.ts.map +1 -1
  678. package/data/build/dist/host/features/git-management.js +61 -7
  679. package/data/build/dist/host/features/git-management.js.map +1 -1
  680. package/data/build/dist/host/features/global-voice-rpc.d.ts.map +1 -1
  681. package/data/build/dist/host/features/global-voice-rpc.js +2 -3
  682. package/data/build/dist/host/features/global-voice-rpc.js.map +1 -1
  683. package/data/build/dist/host/features/host-status.d.ts +25 -0
  684. package/data/build/dist/host/features/host-status.d.ts.map +1 -1
  685. package/data/build/dist/host/features/host-status.js +60 -6
  686. package/data/build/dist/host/features/host-status.js.map +1 -1
  687. package/data/build/dist/host/features/index.d.ts.map +1 -1
  688. package/data/build/dist/host/features/index.js +2 -0
  689. package/data/build/dist/host/features/index.js.map +1 -1
  690. package/data/build/dist/host/features/interaction-translation.d.ts +10 -0
  691. package/data/build/dist/host/features/interaction-translation.d.ts.map +1 -0
  692. package/data/build/dist/host/features/interaction-translation.js +219 -0
  693. package/data/build/dist/host/features/interaction-translation.js.map +1 -0
  694. package/data/build/dist/host/features/lan-access-dsh.d.ts.map +1 -1
  695. package/data/build/dist/host/features/lan-access-dsh.js +64 -13
  696. package/data/build/dist/host/features/lan-access-dsh.js.map +1 -1
  697. package/data/build/dist/host/features/peer-host.d.ts.map +1 -1
  698. package/data/build/dist/host/features/peer-host.js +13 -6
  699. package/data/build/dist/host/features/peer-host.js.map +1 -1
  700. package/data/build/dist/host/features/quick-apps.d.ts +4 -0
  701. package/data/build/dist/host/features/quick-apps.d.ts.map +1 -0
  702. package/data/build/dist/host/features/quick-apps.js +158 -0
  703. package/data/build/dist/host/features/quick-apps.js.map +1 -0
  704. package/data/build/dist/host/features/session-prompt-translation.d.ts +10 -0
  705. package/data/build/dist/host/features/session-prompt-translation.d.ts.map +1 -0
  706. package/data/build/dist/host/features/session-prompt-translation.js +227 -0
  707. package/data/build/dist/host/features/session-prompt-translation.js.map +1 -0
  708. package/data/build/dist/host/features/session-translation-protection.d.ts +22 -0
  709. package/data/build/dist/host/features/session-translation-protection.d.ts.map +1 -0
  710. package/data/build/dist/host/features/session-translation-protection.js +205 -0
  711. package/data/build/dist/host/features/session-translation-protection.js.map +1 -0
  712. package/data/build/dist/host/features/session-translation-recovery.d.ts +21 -0
  713. package/data/build/dist/host/features/session-translation-recovery.d.ts.map +1 -0
  714. package/data/build/dist/host/features/session-translation-recovery.js +125 -0
  715. package/data/build/dist/host/features/session-translation-recovery.js.map +1 -0
  716. package/data/build/dist/host/features/session-translation-runtime.d.ts +16 -0
  717. package/data/build/dist/host/features/session-translation-runtime.d.ts.map +1 -0
  718. package/data/build/dist/host/features/session-translation-runtime.js +85 -0
  719. package/data/build/dist/host/features/session-translation-runtime.js.map +1 -0
  720. package/data/build/dist/host/features/session-translation-service.d.ts +19 -4
  721. package/data/build/dist/host/features/session-translation-service.d.ts.map +1 -1
  722. package/data/build/dist/host/features/session-translation-service.js +249 -210
  723. package/data/build/dist/host/features/session-translation-service.js.map +1 -1
  724. package/data/build/dist/host/features/session-translation.d.ts.map +1 -1
  725. package/data/build/dist/host/features/session-translation.js +6 -3
  726. package/data/build/dist/host/features/session-translation.js.map +1 -1
  727. package/data/build/dist/host/features/types.d.ts +10 -0
  728. package/data/build/dist/host/features/types.d.ts.map +1 -1
  729. package/data/build/dist/host/html-workspace-files.d.ts +3 -0
  730. package/data/build/dist/host/html-workspace-files.d.ts.map +1 -0
  731. package/data/build/dist/host/html-workspace-files.js +135 -0
  732. package/data/build/dist/host/html-workspace-files.js.map +1 -0
  733. package/data/build/dist/host/index.d.ts.map +1 -1
  734. package/data/build/dist/host/index.js +32 -39
  735. package/data/build/dist/host/index.js.map +1 -1
  736. package/data/build/dist/host/lan-access-dsh.d.ts +14 -2
  737. package/data/build/dist/host/lan-access-dsh.d.ts.map +1 -1
  738. package/data/build/dist/host/lan-access-dsh.js +87 -15
  739. package/data/build/dist/host/lan-access-dsh.js.map +1 -1
  740. package/data/build/dist/host/modules/peer-host/peer-host-native-dispatch.d.ts +2 -2
  741. package/data/build/dist/host/modules/peer-host/peer-host-native-dispatch.d.ts.map +1 -1
  742. package/data/build/dist/host/modules/peer-host/peer-host-native-dispatch.js +10 -9
  743. package/data/build/dist/host/modules/peer-host/peer-host-native-dispatch.js.map +1 -1
  744. package/data/build/dist/host/modules/peer-host/peer-host-native-streams.d.ts +3 -3
  745. package/data/build/dist/host/modules/peer-host/peer-host-native-streams.d.ts.map +1 -1
  746. package/data/build/dist/host/modules/peer-host/peer-host-native-streams.js +26 -14
  747. package/data/build/dist/host/modules/peer-host/peer-host-native-streams.js.map +1 -1
  748. package/data/build/dist/host/modules/peer-host/quick-app-gateway.d.ts +5 -0
  749. package/data/build/dist/host/modules/peer-host/quick-app-gateway.d.ts.map +1 -0
  750. package/data/build/dist/host/modules/peer-host/quick-app-gateway.js +27 -0
  751. package/data/build/dist/host/modules/peer-host/quick-app-gateway.js.map +1 -0
  752. package/data/build/dist/host/modules/pwa/pwa-session-notifications.js +2 -1
  753. package/data/build/dist/host/modules/pwa/pwa-session-notifications.js.map +1 -1
  754. package/data/build/dist/host/modules/quick-apps/browse.d.ts +5 -0
  755. package/data/build/dist/host/modules/quick-apps/browse.d.ts.map +1 -0
  756. package/data/build/dist/host/modules/quick-apps/browse.js +37 -0
  757. package/data/build/dist/host/modules/quick-apps/browse.js.map +1 -0
  758. package/data/build/dist/host/modules/quick-apps/code-revision.d.ts +4 -0
  759. package/data/build/dist/host/modules/quick-apps/code-revision.d.ts.map +1 -0
  760. package/data/build/dist/host/modules/quick-apps/code-revision.js +39 -0
  761. package/data/build/dist/host/modules/quick-apps/code-revision.js.map +1 -0
  762. package/data/build/dist/host/modules/quick-apps/documents.d.ts +14 -0
  763. package/data/build/dist/host/modules/quick-apps/documents.d.ts.map +1 -0
  764. package/data/build/dist/host/modules/quick-apps/documents.js +87 -0
  765. package/data/build/dist/host/modules/quick-apps/documents.js.map +1 -0
  766. package/data/build/dist/host/modules/quick-apps/egress.d.ts +35 -0
  767. package/data/build/dist/host/modules/quick-apps/egress.d.ts.map +1 -0
  768. package/data/build/dist/host/modules/quick-apps/egress.js +244 -0
  769. package/data/build/dist/host/modules/quick-apps/egress.js.map +1 -0
  770. package/data/build/dist/host/modules/quick-apps/errors.d.ts +8 -0
  771. package/data/build/dist/host/modules/quick-apps/errors.d.ts.map +1 -0
  772. package/data/build/dist/host/modules/quick-apps/errors.js +15 -0
  773. package/data/build/dist/host/modules/quick-apps/errors.js.map +1 -0
  774. package/data/build/dist/host/modules/quick-apps/file-api.d.ts +30 -0
  775. package/data/build/dist/host/modules/quick-apps/file-api.d.ts.map +1 -0
  776. package/data/build/dist/host/modules/quick-apps/file-api.js +149 -0
  777. package/data/build/dist/host/modules/quick-apps/file-api.js.map +1 -0
  778. package/data/build/dist/host/modules/quick-apps/launches.d.ts +35 -0
  779. package/data/build/dist/host/modules/quick-apps/launches.d.ts.map +1 -0
  780. package/data/build/dist/host/modules/quick-apps/launches.js +80 -0
  781. package/data/build/dist/host/modules/quick-apps/launches.js.map +1 -0
  782. package/data/build/dist/host/modules/quick-apps/paths.d.ts +14 -0
  783. package/data/build/dist/host/modules/quick-apps/paths.d.ts.map +1 -0
  784. package/data/build/dist/host/modules/quick-apps/paths.js +72 -0
  785. package/data/build/dist/host/modules/quick-apps/paths.js.map +1 -0
  786. package/data/build/dist/host/modules/quick-apps/registry.d.ts +30 -0
  787. package/data/build/dist/host/modules/quick-apps/registry.d.ts.map +1 -0
  788. package/data/build/dist/host/modules/quick-apps/registry.js +195 -0
  789. package/data/build/dist/host/modules/quick-apps/registry.js.map +1 -0
  790. package/data/build/dist/host/modules/quick-apps/remote.d.ts +38 -0
  791. package/data/build/dist/host/modules/quick-apps/remote.d.ts.map +1 -0
  792. package/data/build/dist/host/modules/quick-apps/remote.js +238 -0
  793. package/data/build/dist/host/modules/quick-apps/remote.js.map +1 -0
  794. package/data/build/dist/host/modules/quick-apps/service.d.ts +27 -0
  795. package/data/build/dist/host/modules/quick-apps/service.d.ts.map +1 -0
  796. package/data/build/dist/host/modules/quick-apps/service.js +174 -0
  797. package/data/build/dist/host/modules/quick-apps/service.js.map +1 -0
  798. package/data/build/dist/host/modules/quick-apps/static-handler.d.ts +8 -0
  799. package/data/build/dist/host/modules/quick-apps/static-handler.d.ts.map +1 -0
  800. package/data/build/dist/host/modules/quick-apps/static-handler.js +213 -0
  801. package/data/build/dist/host/modules/quick-apps/static-handler.js.map +1 -0
  802. package/data/build/dist/host/native-session-bridge.d.ts +7 -1
  803. package/data/build/dist/host/native-session-bridge.d.ts.map +1 -1
  804. package/data/build/dist/host/native-session-bridge.js +10 -15
  805. package/data/build/dist/host/native-session-bridge.js.map +1 -1
  806. package/data/build/dist/host/rpc.d.ts +15 -2
  807. package/data/build/dist/host/rpc.d.ts.map +1 -1
  808. package/data/build/dist/host/rpc.js +67 -15
  809. package/data/build/dist/host/rpc.js.map +1 -1
  810. package/data/build/dist/host/session-changes.d.ts.map +1 -1
  811. package/data/build/dist/host/session-changes.js +6 -2
  812. package/data/build/dist/host/session-changes.js.map +1 -1
  813. package/data/build/dist/host/session-migration-repair.js +48 -35
  814. package/data/build/dist/host/session-migration-repair.js.map +1 -1
  815. package/data/build/dist/host/settings.d.ts.map +1 -1
  816. package/data/build/dist/host/settings.js +36 -2
  817. package/data/build/dist/host/settings.js.map +1 -1
  818. package/data/build/dist/host/workspace-file-mutations.d.ts +2 -0
  819. package/data/build/dist/host/workspace-file-mutations.d.ts.map +1 -0
  820. package/data/build/dist/host/workspace-file-mutations.js +15 -0
  821. package/data/build/dist/host/workspace-file-mutations.js.map +1 -0
  822. package/data/build/dist/host/workspace-root.d.ts +14 -0
  823. package/data/build/dist/host/workspace-root.d.ts.map +1 -0
  824. package/data/build/dist/host/workspace-root.js +99 -0
  825. package/data/build/dist/host/workspace-root.js.map +1 -0
  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 +62 -1
  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 +25 -1
  849. package/data/build/dist/shared/contracts/config.d.ts.map +1 -1
  850. package/data/build/dist/shared/contracts/config.js +11 -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/feature.d.ts +7 -0
  855. package/data/build/dist/shared/contracts/feature.d.ts.map +1 -1
  856. package/data/build/dist/shared/contracts/git.d.ts +17 -0
  857. package/data/build/dist/shared/contracts/git.d.ts.map +1 -1
  858. package/data/build/dist/shared/contracts/git.js +27 -1
  859. package/data/build/dist/shared/contracts/git.js.map +1 -1
  860. package/data/build/dist/shared/contracts/interaction-presentation.d.ts +32 -0
  861. package/data/build/dist/shared/contracts/interaction-presentation.d.ts.map +1 -0
  862. package/data/build/dist/shared/contracts/interaction-presentation.js +2 -0
  863. package/data/build/dist/shared/contracts/interaction-presentation.js.map +1 -0
  864. package/data/build/dist/shared/contracts/interaction-translation.d.ts +53 -0
  865. package/data/build/dist/shared/contracts/interaction-translation.d.ts.map +1 -0
  866. package/data/build/dist/shared/contracts/interaction-translation.js +44 -0
  867. package/data/build/dist/shared/contracts/interaction-translation.js.map +1 -0
  868. package/data/build/dist/shared/contracts/magpie-management.d.ts +395 -0
  869. package/data/build/dist/shared/contracts/magpie-management.d.ts.map +1 -0
  870. package/data/build/dist/shared/contracts/magpie-management.js +2 -0
  871. package/data/build/dist/shared/contracts/magpie-management.js.map +1 -0
  872. package/data/build/dist/shared/contracts/quick-apps.d.ts +70 -0
  873. package/data/build/dist/shared/contracts/quick-apps.d.ts.map +1 -0
  874. package/data/build/dist/shared/contracts/quick-apps.js +4 -0
  875. package/data/build/dist/shared/contracts/quick-apps.js.map +1 -0
  876. package/data/build/dist/shared/contracts/session-translation.d.ts +82 -9
  877. package/data/build/dist/shared/contracts/session-translation.d.ts.map +1 -1
  878. package/data/build/dist/shared/contracts/session-translation.js +146 -2
  879. package/data/build/dist/shared/contracts/session-translation.js.map +1 -1
  880. package/data/build/dist/shared/contracts/subscription.d.ts +161 -0
  881. package/data/build/dist/shared/contracts/subscription.d.ts.map +1 -1
  882. package/data/build/dist/shared/contracts/subscription.js.map +1 -1
  883. package/data/build/dist/shared/contracts/version.d.ts +9 -15
  884. package/data/build/dist/shared/contracts/version.d.ts.map +1 -1
  885. package/data/build/dist/shared/contracts/version.js +8 -14
  886. package/data/build/dist/shared/contracts/version.js.map +1 -1
  887. package/data/build/dist/shared/index.d.ts +4 -2
  888. package/data/build/dist/shared/index.d.ts.map +1 -1
  889. package/data/build/dist/shared/index.js +3 -2
  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/session-title.d.ts.map +1 -1
  927. package/data/build/dist/shared/session-title.js +10 -4
  928. package/data/build/dist/shared/session-title.js.map +1 -1
  929. package/data/build/dist/shared/translation-indicator.d.ts +26 -0
  930. package/data/build/dist/shared/translation-indicator.d.ts.map +1 -0
  931. package/data/build/dist/shared/translation-indicator.js +29 -0
  932. package/data/build/dist/shared/translation-indicator.js.map +1 -0
  933. package/package.json +35 -34
  934. package/profile/README.md +2 -2
  935. package/profile/package.json +3 -3
  936. package/profile/version.json +3 -3
  937. package/version.json +3 -3
  938. package/data/build/dist/client/client.model-catalog-cache.js.map +0 -1
@@ -0,0 +1,759 @@
1
+ import { createElement, useEffect, useMemo, useState } from 'react';
2
+ import { MagpieProviderLogo } from './magpie-provider-logo.js';
3
+ /** Magpie's own names for routing-group policies; a value it does not name stays as returned. */
4
+ const ROUTING_POLICY_LABELS = {
5
+ smart: 'magpie.management.routing.smart',
6
+ order: 'magpie.management.routing.order',
7
+ rotate: 'magpie.management.routing.rotate',
8
+ usage: 'magpie.management.routing.usage',
9
+ pace: 'magpie.management.routing.pace',
10
+ weight: 'magpie.management.routing.weight',
11
+ manual: 'magpie.management.routing.manual',
12
+ free: 'magpie.management.routing.free',
13
+ };
14
+ const STAYS_POLICY_LABELS = {
15
+ auto: 'magpie.management.stays.auto',
16
+ session: 'magpie.management.stays.session',
17
+ turn: 'magpie.management.stays.turn',
18
+ off: 'magpie.management.stays.off',
19
+ strict: 'magpie.management.stays.strict',
20
+ };
21
+ /**
22
+ * The policies a group save may write.
23
+ *
24
+ * `free` is read (a newer Magpie, or Magpie's own editor, can set it) and shown by its business
25
+ * name, but is not offered here: this Host's write allowlist has only verified the ones below.
26
+ */
27
+ const ROUTING_POLICY_VALUES = ['smart', 'order', 'rotate', 'usage', 'pace', 'weight', 'manual'];
28
+ const MANUAL_ROUTING = 'manual';
29
+ const STAYS_POLICY_VALUES = ['auto', 'session', 'turn', 'off', 'strict'];
30
+ /** Show a policy by Magpie's business name while the Host keeps the raw value for writes. */
31
+ export function magpiePolicyLabel(kind, value, t) {
32
+ const key = (kind === 'routing' ? ROUTING_POLICY_LABELS : STAYS_POLICY_LABELS)[value];
33
+ return key === undefined ? value : t(key);
34
+ }
35
+ function policyOptions(kind, values, current, t) {
36
+ const options = values.map(value => ({ value, label: magpiePolicyLabel(kind, value, t) }));
37
+ // Keep a policy this Host does not offer visible rather than blanking the select:
38
+ // a newer Magpie mode or a gateway plugin's routing must still read back.
39
+ return values.includes(current) ? options : [...options, { value: current, label: magpiePolicyLabel(kind, current, t) }];
40
+ }
41
+ export function MagpieProvidersPage({ snapshot, t, onUpdate, onAccountUpdate, writing }) {
42
+ const providers = snapshot?.providers ?? [];
43
+ const [selectedId, setSelectedId] = useState(providers[0]?.id ?? null);
44
+ const selected = providers.find(provider => provider.id === selectedId) ?? providers[0] ?? null;
45
+ const unlinkedAccounts = snapshot?.accountStatus === 'available'
46
+ ? snapshot.accounts.filter(account => !providers.some(provider => accountBelongsToProvider(account, provider)))
47
+ : [];
48
+ useEffect(() => {
49
+ if (selected !== null && selected.id !== selectedId)
50
+ setSelectedId(selected.id);
51
+ }, [selected, selectedId]);
52
+ return createElement('div', { className: 'codingns-magpie-view' }, snapshot?.providerStatus === 'unavailable'
53
+ ? createElement(PanelEmpty, { message: t('magpie.management.providersUnavailable') })
54
+ : providers.length === 0
55
+ ? createElement(PanelEmpty, { message: t('magpie.management.noProviders') })
56
+ : createElement('div', { className: 'codingns-magpie-management-grid' }, createElement('nav', { className: 'codingns-magpie-panel codingns-magpie-management-list', 'aria-label': t('magpie.management.providers') }, ...providers.map(provider => createElement('button', {
57
+ key: provider.id,
58
+ type: 'button',
59
+ className: `codingns-magpie-management-row${provider.id === selected?.id ? ' is-active' : ''}`,
60
+ 'aria-pressed': provider.id === selected?.id,
61
+ onClick: () => setSelectedId(provider.id),
62
+ }, createElement(MagpieProviderLogo, { identities: [provider.accountAgent, provider.id, provider.name], logoDataUrl: provider.logoDataUrl, size: 24, className: 'codingns-magpie-provider-logo codingns-magpie-provider-logo-compact' }), createElement('span', { className: 'codingns-magpie-management-row-main' }, createElement('strong', undefined, provider.name), createElement('small', undefined, provider.id)), createElement(StateBadge, { state: provider.state === 'on' ? 'on' : provider.state === 'off' ? 'off' : 'unknown', t })))), selected === null
63
+ ? createElement(PanelEmpty, { message: t('magpie.management.noProviders') })
64
+ : createElement(ProviderEditor, { provider: selected, snapshot, t, onUpdate, onAccountUpdate, writing })), unlinkedAccounts.length > 0 && createElement('section', { className: 'codingns-magpie-panel codingns-magpie-management-editor' }, createElement('div', { className: 'codingns-magpie-panel-head' }, createElement('div', undefined, createElement('h2', undefined, t('magpie.management.unlinkedAccounts')), createElement('p', undefined, t('magpie.management.unlinkedAccountsNote')))), createElement(AccountGrid, {
65
+ accounts: unlinkedAccounts,
66
+ allAccounts: snapshot?.accounts ?? [],
67
+ accountApiStatus: snapshot?.accountApiStatus ?? 'unavailable',
68
+ writing,
69
+ t,
70
+ onUpdate: onAccountUpdate,
71
+ })));
72
+ }
73
+ function ProviderEditor({ provider, snapshot, t, onUpdate, onAccountUpdate, writing }) {
74
+ const editableEndpoints = provider.endpoints.filter(endpoint => endpoint.editable);
75
+ const endpointKey = editableEndpoints.map(endpoint => `${endpoint.field}:${endpoint.url}`).join('|');
76
+ const modelsKey = provider.models.map(model => `${model.id}:${model.exposed ? 'on' : 'off'}`).join('|');
77
+ const [name, setName] = useState(provider.name);
78
+ const [endpointField, setEndpointField] = useState(editableEndpoints[0]?.field ?? '');
79
+ const [endpointUrl, setEndpointUrl] = useState(editableEndpoints[0]?.url ?? '');
80
+ const [enabledModelIds, setEnabledModelIds] = useState(() => provider.models.filter(model => model.exposed).map(model => model.id));
81
+ const [review, setReview] = useState(null);
82
+ const [saving, setSaving] = useState(false);
83
+ const [notice, setNotice] = useState('');
84
+ useEffect(() => {
85
+ setName(provider.name);
86
+ setEndpointField(editableEndpoints[0]?.field ?? '');
87
+ setEndpointUrl(editableEndpoints[0]?.url ?? '');
88
+ setEnabledModelIds(provider.models.filter(model => model.exposed).map(model => model.id));
89
+ setReview(null);
90
+ }, [provider.id, provider.name, endpointKey, modelsKey]);
91
+ const endpoint = editableEndpoints.find(item => item.field === endpointField);
92
+ const proposed = () => {
93
+ const models = provider.models.filter(model => enabledModelIds.includes(model.id)).map(model => model.id);
94
+ const currentModels = provider.models.filter(model => model.exposed).map(model => model.id);
95
+ const update = {
96
+ id: provider.id,
97
+ ...(name.trim() === provider.name ? {} : { name: name.trim() }),
98
+ ...(endpoint === undefined || endpointUrl.trim() === endpoint.url ? {} : { endpointField: endpoint.field, endpointUrl: endpointUrl.trim() }),
99
+ ...(provider.modelsEditable && models.join('\n') !== currentModels.join('\n') ? { models } : {}),
100
+ };
101
+ return Object.keys(update).length === 1 ? null : update;
102
+ };
103
+ const requestReview = () => {
104
+ setNotice('');
105
+ setReview(proposed());
106
+ };
107
+ const apply = async () => {
108
+ if (review === null)
109
+ return;
110
+ setSaving(true);
111
+ setNotice('');
112
+ try {
113
+ await onUpdate(review);
114
+ setReview(null);
115
+ setNotice(t('magpie.management.saved'));
116
+ }
117
+ catch {
118
+ setNotice(t('magpie.management.saveFailed'));
119
+ }
120
+ finally {
121
+ setSaving(false);
122
+ }
123
+ };
124
+ const modelControlsDisabled = !provider.modelsEditable || saving || writing;
125
+ const toggleModel = (id, enabled) => {
126
+ setEnabledModelIds(current => enabled
127
+ ? current.includes(id) ? current : [...current, id]
128
+ : current.filter(item => item !== id));
129
+ };
130
+ const setAllModels = (enabled) => {
131
+ setEnabledModelIds(enabled ? provider.models.map(model => model.id) : []);
132
+ };
133
+ return createElement('section', { className: 'codingns-magpie-panel codingns-magpie-management-editor' }, createElement('div', { className: 'codingns-magpie-panel-head' }, createElement('div', undefined, createElement('div', { className: 'codingns-magpie-provider-heading' }, createElement(MagpieProviderLogo, { identities: [provider.accountAgent, provider.id, provider.name], logoDataUrl: provider.logoDataUrl, size: 30, className: 'codingns-magpie-provider-logo' }), createElement('h2', undefined, provider.name)), createElement('p', undefined, provider.id))), createElement('div', { className: 'codingns-magpie-management-statusline' }, createElement(StateBadge, { state: provider.state === 'on' ? 'on' : provider.state === 'off' ? 'off' : 'unknown', t }), provider.state !== 'unknown' && createElement('button', {
134
+ type: 'button',
135
+ className: 'codingns-magpie-text-button',
136
+ disabled: saving || writing,
137
+ onClick: () => {
138
+ setNotice('');
139
+ setReview({ id: provider.id, on: provider.state === 'off' });
140
+ },
141
+ }, t(provider.state === 'on' ? 'magpie.management.turnProviderOff' : 'magpie.management.turnProviderOn')), provider.account !== null && createElement('span', undefined, t('magpie.management.providerAccount', { account: provider.account })), createElement('span', undefined, provider.modelCount === null ? t('magpie.management.modelCountUnknown') : t('magpie.management.modelCounts', { exposed: provider.exposedModelCount ?? provider.models.length, total: provider.modelCount }))), createElement(ProviderAccounts, { provider, snapshot, t, onUpdate: onAccountUpdate, writing }), createElement('label', { className: 'codingns-magpie-field' }, createElement('span', undefined, t('magpie.management.providerName')), createElement('input', { value: name, maxLength: 80, onChange: (event) => setName(event.currentTarget.value) })), editableEndpoints.length > 0 && createElement('div', { className: 'codingns-magpie-field-row' }, createElement('label', { className: 'codingns-magpie-field' }, createElement('span', undefined, t('magpie.management.endpointType')), createElement('select', {
142
+ value: endpointField,
143
+ onChange: (event) => {
144
+ const next = provider.endpoints.find(item => item.field === event.currentTarget.value);
145
+ if (next !== undefined) {
146
+ setEndpointField(next.field);
147
+ setEndpointUrl(next.url);
148
+ }
149
+ },
150
+ }, ...editableEndpoints.map(item => createElement('option', { key: item.field, value: item.field }, item.field)))), createElement('label', { className: 'codingns-magpie-field' }, createElement('span', undefined, t('magpie.management.endpointUrl')), createElement('input', { value: endpointUrl, maxLength: 2048, onChange: (event) => setEndpointUrl(event.currentTarget.value), spellCheck: false }))), createElement('div', { className: 'codingns-magpie-field' }, createElement('span', undefined, t('magpie.management.exposedModels')), createElement('small', undefined, t(provider.modelsEditable ? 'magpie.management.providerModelsHint' : 'magpie.management.providerModelsUnavailable')), provider.models.length === 0
151
+ ? createElement('div', { className: 'codingns-magpie-inline-empty' }, t('magpie.management.noProviderModels'))
152
+ : createElement('div', { className: 'codingns-magpie-model-editor', role: 'group', 'aria-label': t('magpie.management.exposedModels') }, createElement('div', { className: 'codingns-magpie-model-actions' }, createElement('button', { type: 'button', disabled: modelControlsDisabled, onClick: () => setAllModels(true) }, t('magpie.management.enableAllModels')), createElement('button', { type: 'button', disabled: modelControlsDisabled, onClick: () => setAllModels(false) }, t('magpie.management.disableAllModels'))), ...provider.models.map(model => createElement('label', { key: model.id, className: `codingns-magpie-model-option${model.exposed ? ' is-exposed' : ''}`, 'data-model-id': model.id }, createElement('input', {
153
+ type: 'checkbox',
154
+ checked: enabledModelIds.includes(model.id),
155
+ disabled: modelControlsDisabled,
156
+ 'aria-label': model.id,
157
+ onChange: (event) => toggleModel(model.id, event.currentTarget.checked),
158
+ }), createElement('span', { className: 'codingns-magpie-model-option-copy' }, createElement('strong', { className: 'codingns-magpie-model-name', title: model.name ?? model.id }, model.name ?? model.id), createElement('code', { className: 'codingns-magpie-model-id', title: model.id }, model.id)))))), review !== null && createElement('div', { className: 'codingns-magpie-confirm' }, createElement('strong', undefined, t('magpie.management.reviewProvider')), createElement('span', undefined, summarizeProviderUpdate(review, t)), createElement('div', { className: 'codingns-magpie-management-actions' }, createElement('button', { type: 'button', disabled: saving || writing, onClick: () => setReview(null) }, t('magpie.management.cancel')), createElement('button', { type: 'button', className: 'is-primary', disabled: saving || writing, onClick: () => void apply() }, saving || writing ? t('magpie.management.saving') : t('magpie.management.apply')))), notice !== '' && createElement('div', { className: 'codingns-magpie-management-message', role: 'status' }, notice), review === null && createElement('div', { className: 'codingns-magpie-management-actions' }, createElement('button', { type: 'button', disabled: writing, onClick: () => { setName(provider.name); setEndpointUrl(editableEndpoints.find(item => item.field === endpointField)?.url ?? ''); setEnabledModelIds(provider.models.filter(model => model.exposed).map(model => model.id)); setNotice(''); } }, t('magpie.management.reset')), createElement('button', { type: 'button', className: 'is-primary', disabled: writing || proposed() === null, onClick: requestReview }, t('magpie.management.reviewChanges'))));
159
+ }
160
+ function ProviderAccounts({ provider, snapshot, t, onUpdate, writing }) {
161
+ if (snapshot?.accountStatus !== 'available') {
162
+ return createElement(PanelEmpty, { message: t('magpie.management.accountsUnavailable') });
163
+ }
164
+ const accounts = snapshot.accounts.filter(account => accountBelongsToProvider(account, provider));
165
+ return createElement('section', undefined, createElement('div', { className: 'codingns-magpie-panel-head' }, createElement('div', undefined, createElement('h3', undefined, t('magpie.management.accounts')), createElement('p', undefined, t('magpie.management.accountRoleNote')))), accounts.length === 0
166
+ ? createElement('div', { className: 'codingns-magpie-inline-empty' }, t('magpie.management.noLinkedAccounts'))
167
+ : createElement(AccountGrid, {
168
+ accounts,
169
+ allAccounts: snapshot.accounts,
170
+ accountApiStatus: snapshot.accountApiStatus,
171
+ writing,
172
+ t,
173
+ onUpdate,
174
+ }));
175
+ }
176
+ function AccountGrid({ accounts, allAccounts, accountApiStatus, writing, t, onUpdate }) {
177
+ const sorted = [...accounts].sort((left, right) => Number(right.active === true) - Number(left.active === true));
178
+ return createElement('div', { className: 'codingns-magpie-management-account-grid' }, ...sorted.map(account => createElement(AccountCard, {
179
+ key: `${account.agent}:${account.user}`,
180
+ account,
181
+ siblingAccounts: allAccounts.filter(item => item.agent.toLocaleLowerCase() === account.agent.toLocaleLowerCase()),
182
+ accountApiStatus,
183
+ writing,
184
+ t,
185
+ onUpdate,
186
+ })));
187
+ }
188
+ function AccountCard({ account, siblingAccounts, accountApiStatus, writing, t, onUpdate }) {
189
+ const [reviewOn, setReviewOn] = useState(null);
190
+ const [saving, setSaving] = useState(false);
191
+ const [notice, setNotice] = useState('');
192
+ const roleKey = account.active === true ? 'magpie.management.primaryAccount' : account.active === false ? 'magpie.management.secondaryAccount' : 'magpie.management.unknown';
193
+ const stateKey = account.on === true
194
+ ? 'magpie.management.inRotation'
195
+ : account.active === true
196
+ ? 'magpie.management.primaryPaused'
197
+ : account.on === false
198
+ ? 'magpie.management.outOfRotation'
199
+ : 'magpie.management.unknown';
200
+ const activeInRotation = siblingAccounts.filter(item => item.on === true).length;
201
+ const isLastInRotation = account.on === true && activeInRotation <= 1;
202
+ const apply = async () => {
203
+ if (reviewOn === null)
204
+ return;
205
+ setSaving(true);
206
+ setNotice('');
207
+ try {
208
+ await onUpdate({ agent: account.agent, user: account.user, on: reviewOn });
209
+ setReviewOn(null);
210
+ setNotice(t('magpie.management.saved'));
211
+ }
212
+ catch {
213
+ setNotice(t('magpie.management.accountSaveFailed'));
214
+ }
215
+ finally {
216
+ setSaving(false);
217
+ }
218
+ };
219
+ return createElement('article', { className: 'codingns-magpie-panel codingns-magpie-management-account' }, createElement('div', { className: 'codingns-magpie-quota-topline' }, createElement(MagpieProviderLogo, { identities: [account.agent], size: 34, className: 'codingns-magpie-quota-icon codingns-magpie-provider-logo' }), createElement('div', undefined, createElement('h2', undefined, account.alias ?? account.user), createElement('p', undefined, `${account.agent}${account.plan ? ` · ${account.plan}` : ''}`))), createElement('div', { className: 'codingns-magpie-management-statusline' }, createElement(StateBadge, { state: account.active === true ? 'on' : account.active === false ? 'off' : 'unknown', label: t(roleKey), t }), createElement(StateBadge, { state: account.on === true ? 'on' : account.on === false ? 'off' : 'unknown', label: t(stateKey), t })), createElement('div', { className: 'codingns-magpie-management-actions' }, createElement('button', {
220
+ type: 'button',
221
+ className: 'codingns-magpie-text-button',
222
+ disabled: accountApiStatus !== 'available' || account.on === null || saving || writing || isLastInRotation,
223
+ title: accountApiStatus === 'available' ? undefined : t('magpie.management.accountApiRequired'),
224
+ onClick: () => {
225
+ setNotice('');
226
+ setReviewOn(account.on !== true);
227
+ },
228
+ }, t(account.on === true ? account.active === true ? 'magpie.management.pausePrimary' : 'magpie.management.removeFromRotation' : 'magpie.management.addToRotation')), isLastInRotation && createElement('small', undefined, t('magpie.management.lastAccountInRotation'))), account.balance !== null && createElement('div', { className: 'codingns-magpie-management-balance' }, account.balance), account.windows.length === 0
229
+ ? createElement('div', { className: 'codingns-magpie-inline-empty' }, t('magpie.management.noAccountWindows'))
230
+ : account.windows.map(window => createElement('div', { key: window.name, className: 'codingns-magpie-management-window' }, createElement('div', { className: 'codingns-magpie-quota-window-head' }, createElement('strong', undefined, window.name), createElement('span', undefined, window.display ?? (window.remaining === null ? '—' : t('magpie.remaining', { percent: Math.round(window.remaining) })))), window.used !== null && window.remaining !== null && createElement('div', { className: 'codingns-magpie-track quota-track' }, createElement('span', { style: { width: `${Math.max(0, Math.min(100, window.used))}%` } })), window.resetsAt !== null && createElement('small', undefined, t('magpie.resets', { time: window.resetsAt })))), account.readAt !== null && createElement('small', { className: 'codingns-magpie-management-readat' }, t('magpie.management.readAt', { time: account.readAt })), reviewOn !== null && createElement('div', { className: 'codingns-magpie-confirm' }, createElement('strong', undefined, t('magpie.management.reviewAccount')), createElement('span', undefined, t(reviewOn ? 'magpie.management.reviewAccountOn' : 'magpie.management.reviewAccountOff', { account: account.alias ?? account.user })), createElement('div', { className: 'codingns-magpie-management-actions' }, createElement('button', { type: 'button', disabled: saving || writing, onClick: () => setReviewOn(null) }, t('magpie.management.cancel')), createElement('button', { type: 'button', className: 'is-primary', disabled: saving || writing, onClick: () => void apply() }, saving || writing ? t('magpie.management.saving') : t('magpie.management.apply')))), notice !== '' && createElement('div', { className: 'codingns-magpie-management-message', role: 'status' }, notice));
231
+ }
232
+ /** Magpie's `provider.MemberEfforts`, in the order its editor lists them. */
233
+ const MEMBER_LEVELS = ['none', 'minimal', 'low', 'medium', 'high', 'xhigh', 'max'];
234
+ const GROUP_EFFORT_AUTO = 'auto';
235
+ const CONTEXT_LARGEST = 0;
236
+ const CONTEXT_SMALLEST = -1;
237
+ export function MagpieGroupsPage({ snapshot, t, onUpdate }) {
238
+ const groups = snapshot?.groups ?? [];
239
+ const [selectedId, setSelectedId] = useState(groups[0]?.id ?? null);
240
+ const selected = groups.find(group => group.id === selectedId) ?? groups[0] ?? null;
241
+ useEffect(() => {
242
+ if (selected !== null && selected.id !== selectedId)
243
+ setSelectedId(selected.id);
244
+ }, [selected, selectedId]);
245
+ if (snapshot?.groupStatus !== 'available')
246
+ return createElement(PanelEmpty, { message: t('magpie.management.groupsUnavailable') });
247
+ if (groups.length === 0)
248
+ return createElement(PanelEmpty, { message: t('magpie.management.noGroups') });
249
+ return createElement('div', { className: 'codingns-magpie-view' }, createElement('div', { className: 'codingns-magpie-management-grid' }, createElement('nav', { className: 'codingns-magpie-panel codingns-magpie-management-list', 'aria-label': t('magpie.management.groups') }, ...groups.map(group => createElement('button', {
250
+ key: group.id,
251
+ type: 'button',
252
+ className: `codingns-magpie-management-row${group.id === selected?.id ? ' is-active' : ''}`,
253
+ 'aria-pressed': group.id === selected?.id,
254
+ onClick: () => setSelectedId(group.id),
255
+ }, createElement('span', { className: 'codingns-magpie-management-row-main' }, createElement('strong', undefined, group.name), createElement('small', undefined, `group/${group.id}`)), createElement('span', { className: 'codingns-magpie-management-policy' }, group.routing === null ? '—' : magpiePolicyLabel('routing', group.routing, t))))), selected === null
256
+ ? createElement(PanelEmpty, { message: t('magpie.management.noGroups') })
257
+ : createElement(GroupEditor, { group: selected, candidates: groupModelCandidates(snapshot, selected), snapshot, t, onUpdate })));
258
+ }
259
+ function GroupEditor({ group, candidates, snapshot, t, onUpdate }) {
260
+ const [draft, setDraft] = useState(() => groupDraft(group));
261
+ // The context input keeps what was typed ("200k"), because 200000 would read back as "200K"
262
+ // under the caret on every keystroke.
263
+ const [contextText, setContextText] = useState(() => group.context > 0 ? formatContextTokens(group.context) : '');
264
+ const [review, setReview] = useState(null);
265
+ const [saving, setSaving] = useState(false);
266
+ const [notice, setNotice] = useState('');
267
+ const key = JSON.stringify(group);
268
+ useEffect(() => {
269
+ setDraft(groupDraft(group));
270
+ setContextText(group.context > 0 ? formatContextTokens(group.context) : '');
271
+ setReview(null);
272
+ }, [group.id, key]);
273
+ const setText = (field, value) => setDraft(current => ({ ...current, [field]: value }));
274
+ // `fast` is kept in step with the members: a model taken out of the group takes its fast
275
+ // mode with it, so a later save cannot fast-mode a model the group no longer names.
276
+ const setModels = (models) => setDraft(current => ({ ...current, models, fast: current.fast.filter(model => models.includes(model)) }));
277
+ const baseline = groupDraft(group);
278
+ const manual = draft.routing === MANUAL_ROUTING;
279
+ const fast = draft.models.filter(model => draft.fast.includes(model));
280
+ // A manual group with nothing to send to is not saveable here: this Host refuses that write,
281
+ // and Magpie would otherwise keep whichever member came first.
282
+ const missingPick = manual && draft.pick === '';
283
+ // Picking each turn's level is a classifier's job: without one Magpie refuses the save, so
284
+ // the review button waits until the model that rates a turn is chosen.
285
+ const missingClassifier = draft.effort === GROUP_EFFORT_AUTO && draft.classifier === '';
286
+ const update = () => {
287
+ if (missingPick || missingClassifier)
288
+ return null;
289
+ const result = {
290
+ id: group.id,
291
+ ...(draft.name.trim() === baseline.name ? {} : { name: draft.name.trim() }),
292
+ ...(sameStringOrder(draft.models, baseline.models) ? {} : { models: [...draft.models] }),
293
+ ...(draft.routing === baseline.routing ? {} : { routing: draft.routing }),
294
+ ...(draft.stays === baseline.stays ? {} : { stays: draft.stays }),
295
+ ...(!manual || draft.pick === baseline.pick ? {} : { pick: draft.pick }),
296
+ ...(draft.unlists === baseline.unlists ? {} : { unlists: draft.unlists }),
297
+ ...(sameStringSet(fast, baseline.fast) ? {} : { fast }),
298
+ ...(draft.context === baseline.context ? {} : { context: draft.context }),
299
+ ...(sameStringSet(draft.levels, baseline.levels) ? {} : { levels: [...draft.levels] }),
300
+ ...(draft.effort === baseline.effort ? {} : { effort: draft.effort }),
301
+ ...(draft.classifier === baseline.classifier ? {} : { classifier: draft.classifier }),
302
+ };
303
+ return Object.keys(result).length === 1 ? null : result;
304
+ };
305
+ const apply = async () => {
306
+ if (review === null)
307
+ return;
308
+ setSaving(true);
309
+ setNotice('');
310
+ try {
311
+ await onUpdate(review);
312
+ setReview(null);
313
+ setNotice(t('magpie.management.saved'));
314
+ }
315
+ catch {
316
+ setNotice(t('magpie.management.saveFailed'));
317
+ }
318
+ finally {
319
+ setSaving(false);
320
+ }
321
+ };
322
+ const updateField = update();
323
+ const routingOptions = policyOptions('routing', ROUTING_POLICY_VALUES, draft.routing, t);
324
+ const staysOptions = policyOptions('stays', STAYS_POLICY_VALUES, draft.stays, t);
325
+ // Magpie's editor offers a member's fast mode only where the model has one
326
+ // (provider.CanFast); `canFast` is the only per-model field it brings for this.
327
+ const fastCapable = draft.models.flatMap(id => {
328
+ const candidate = candidates.find(model => model.id === id);
329
+ return candidate?.canFast === true ? [candidate] : [];
330
+ });
331
+ const contextMode = draft.context === CONTEXT_SMALLEST ? 'smallest' : draft.context > 0 ? 'custom' : 'largest';
332
+ // Typed text that is not a token count stays on screen with the error, rather than being
333
+ // rewritten to the last value that parsed.
334
+ const contextError = contextMode === 'custom' && parseContextTokens(contextText) === null;
335
+ // A group that picks each turn's level needs a model to rate the turn: the members first,
336
+ // then every model the snapshot knows, so a small classifier outside the group can be picked.
337
+ const classifierOptions = uniqueBy([
338
+ ...draft.models.map(id => ({ value: id, label: id })),
339
+ ...(snapshot?.providers ?? []).flatMap(provider => provider.models.map(model => ({ value: model.id, label: model.id }))),
340
+ ], option => option.value);
341
+ return createElement('section', { className: 'codingns-magpie-panel codingns-magpie-management-editor' }, createElement('div', { className: 'codingns-magpie-panel-head' }, createElement('div', undefined, createElement('h2', undefined, group.name), createElement('p', undefined, `group/${group.id}`))), createElement('div', { className: 'codingns-magpie-management-statusline' }, createElement('span', undefined, t('magpie.management.membersCount', { count: group.members.length })), group.usedBy.length > 0 && createElement('span', undefined, t('magpie.management.usedBy', { agents: group.usedBy.join(', ') }))), group.members.length > 0 && createElement('div', { className: 'codingns-magpie-management-members' }, ...group.members.map(member => createElement('span', { key: member.id, className: `codingns-magpie-member-chip${member.ready === false ? ' is-muted' : ''}`, title: member.name ?? member.id }, member.id))), createElement('label', { className: 'codingns-magpie-field' }, createElement('span', undefined, t('magpie.management.groupName')), createElement('input', { value: draft.name, maxLength: 120, onChange: (event) => setText('name', event.currentTarget.value) })), createElement('div', { className: 'codingns-magpie-field' }, createElement('span', undefined, t('magpie.management.groupModels')), createElement('small', undefined, t('magpie.management.groupModelsHint')), createElement(GroupModelEditor, {
342
+ key: group.id,
343
+ value: draft.models,
344
+ candidates,
345
+ t,
346
+ onChange: setModels,
347
+ })), createElement('div', { className: 'codingns-magpie-field-row' }, createElement(SelectField, { label: t('magpie.management.routing'), hint: t('magpie.management.routingHint'), value: draft.routing, options: routingOptions, onChange: value => setText('routing', value) }), createElement(SelectField, { label: t('magpie.management.stays'), hint: t('magpie.management.staysHint'), value: draft.stays, options: staysOptions, onChange: value => setText('stays', value) })), manual && (draft.models.length === 0
348
+ ? createElement('p', { className: 'codingns-magpie-management-hint' }, t('magpie.management.noSelectedGroupModels'))
349
+ : createElement(SelectField, {
350
+ label: t('magpie.management.manualPick'),
351
+ hint: t('magpie.management.manualPickHint'),
352
+ value: draft.pick,
353
+ options: [{ value: '', label: t('magpie.management.manualPickEmpty') }, ...draft.models.map(model => ({ value: model, label: model }))],
354
+ onChange: value => setText('pick', value),
355
+ })), fastCapable.length > 0 && createElement('div', { className: 'codingns-magpie-field' }, createElement('span', undefined, t('magpie.management.fastMode')), createElement('small', undefined, t('magpie.management.fastModeHint', { model: fastCapable[0]?.id ?? '' })), createElement(CheckboxList, {
356
+ label: t('magpie.management.fastMode'),
357
+ options: fastCapable.map(model => ({ id: model.id, label: model.id })),
358
+ value: fast,
359
+ disabled: saving,
360
+ onChange: (id, checked) => setDraft(current => ({
361
+ ...current,
362
+ fast: checked ? uniqueStrings([...current.fast, id]) : current.fast.filter(model => model !== id),
363
+ })),
364
+ })), createElement('label', { className: 'codingns-magpie-checkbox' }, createElement('input', {
365
+ type: 'checkbox',
366
+ checked: draft.unlists,
367
+ disabled: saving,
368
+ onChange: (event) => setDraft(current => ({ ...current, unlists: event.currentTarget.checked })),
369
+ }), createElement('span', undefined, t('magpie.management.unlists'))), createElement('div', { className: 'codingns-magpie-field' }, createElement('span', undefined, t('magpie.management.context')), createElement('small', undefined, t('magpie.management.contextHint')), createElement(Segmented, {
370
+ label: t('magpie.management.context'),
371
+ value: contextMode,
372
+ options: [
373
+ { value: 'largest', label: t('magpie.management.contextLargest') },
374
+ { value: 'smallest', label: t('magpie.management.contextSmallest') },
375
+ { value: 'custom', label: t('magpie.management.contextCustom') },
376
+ ],
377
+ onChange: mode => {
378
+ const tokens = mode === 'custom' && draft.context <= 0 ? 200_000 : null;
379
+ if (tokens !== null) {
380
+ setContextText(formatContextTokens(tokens));
381
+ setDraft(current => ({ ...current, context: tokens }));
382
+ return;
383
+ }
384
+ if (mode === 'custom')
385
+ setContextText(formatContextTokens(draft.context));
386
+ setDraft(current => ({
387
+ ...current,
388
+ context: mode === 'smallest' ? CONTEXT_SMALLEST : mode === 'largest' ? CONTEXT_LARGEST : current.context,
389
+ }));
390
+ },
391
+ }), contextMode === 'custom' && createElement('input', {
392
+ className: 'codingns-magpie-context-input',
393
+ value: contextText,
394
+ maxLength: 12,
395
+ inputMode: 'text',
396
+ placeholder: '200k',
397
+ 'aria-label': t('magpie.management.contextCustom'),
398
+ 'aria-invalid': contextError,
399
+ onChange: (event) => {
400
+ const tokens = parseContextTokens(event.currentTarget.value);
401
+ setContextText(event.currentTarget.value);
402
+ if (tokens !== null)
403
+ setDraft(current => ({ ...current, context: tokens }));
404
+ },
405
+ }), contextError && createElement('small', { className: 'codingns-magpie-field-error', role: 'alert' }, t('magpie.management.contextInvalid'))), createElement('div', { className: 'codingns-magpie-field' }, createElement('span', undefined, t('magpie.management.levels')), createElement('small', undefined, t(draft.levels.length === 0
406
+ ? 'magpie.management.levelsSharedHint'
407
+ : 'magpie.management.levelsNamedHint', group.sharedLevels.length === 0 ? {} : { levels: group.sharedLevels.join(', ') })), createElement(Segmented, {
408
+ label: t('magpie.management.levels'),
409
+ value: draft.levels.length === 0 ? 'shared' : 'named',
410
+ options: [
411
+ { value: 'shared', label: t('magpie.management.levelsShared') },
412
+ { value: 'named', label: t('magpie.management.levelsNamed') },
413
+ ],
414
+ onChange: mode => setDraft(current => ({
415
+ ...current,
416
+ levels: mode === 'shared' ? [] : current.levels.length > 0 ? current.levels : defaultLevels(group.sharedLevels),
417
+ })),
418
+ }), draft.levels.length > 0 && createElement('div', { className: 'codingns-magpie-levels', role: 'group', 'aria-label': t('magpie.management.levels') }, ...MEMBER_LEVELS.map(level => createElement('button', {
419
+ key: level,
420
+ type: 'button',
421
+ className: `codingns-magpie-level${draft.levels.includes(level) ? ' is-on' : ''}`,
422
+ 'aria-pressed': draft.levels.includes(level),
423
+ onClick: () => setDraft(current => ({
424
+ ...current,
425
+ // Magpie keeps the levels in its own order, so a chip toggles in place.
426
+ levels: current.levels.includes(level)
427
+ ? current.levels.filter(item => item !== level)
428
+ : MEMBER_LEVELS.filter(item => item === level || current.levels.includes(item)),
429
+ })),
430
+ }, level)))), createElement('div', { className: 'codingns-magpie-field' }, createElement('span', undefined, t('magpie.management.effort')), createElement('small', undefined, t(draft.effort === GROUP_EFFORT_AUTO ? 'magpie.management.effortAutoHint' : 'magpie.management.effortAgentHint')), createElement(Segmented, {
431
+ label: t('magpie.management.effort'),
432
+ value: draft.effort === GROUP_EFFORT_AUTO ? GROUP_EFFORT_AUTO : 'agent',
433
+ options: [
434
+ { value: 'agent', label: t('magpie.management.effortAgent') },
435
+ { value: GROUP_EFFORT_AUTO, label: t('magpie.management.effortAuto') },
436
+ ],
437
+ onChange: mode => setDraft(current => ({
438
+ ...current,
439
+ effort: mode === GROUP_EFFORT_AUTO ? GROUP_EFFORT_AUTO : '',
440
+ // Magpie needs a classifier the moment a turn's level is picked, and clears it again
441
+ // when the effort goes back to the Agent's own.
442
+ classifier: mode === GROUP_EFFORT_AUTO ? current.classifier : '',
443
+ })),
444
+ }), draft.effort === GROUP_EFFORT_AUTO && (classifierOptions.length === 0
445
+ ? createElement('small', { className: 'codingns-magpie-field-error', role: 'alert' }, t('magpie.management.effortNeedsClassifier'))
446
+ : createElement(SelectField, {
447
+ label: t('magpie.management.classifier'),
448
+ hint: t('magpie.management.classifierHint'),
449
+ value: draft.classifier,
450
+ options: [{ value: '', label: t('magpie.management.classifierEmpty') }, ...classifierOptions],
451
+ onChange: value => setText('classifier', value),
452
+ }))), createElement('p', { className: 'codingns-magpie-management-hint' }, t('magpie.management.unlistsHint')), fastCapable.length === 0 && draft.models.length > 0 && createElement('p', { className: 'codingns-magpie-management-hint' }, t('magpie.management.noFastModels')), review !== null && createElement('div', { className: 'codingns-magpie-confirm' }, createElement('strong', undefined, t('magpie.management.reviewGroup')), createElement('span', undefined, summarizeGroupUpdate(review, t)), createElement('div', { className: 'codingns-magpie-management-actions' }, createElement('button', { type: 'button', disabled: saving, onClick: () => setReview(null) }, t('magpie.management.cancel')), createElement('button', { type: 'button', className: 'is-primary', disabled: saving, onClick: () => void apply() }, saving ? t('magpie.management.saving') : t('magpie.management.apply')))), notice !== '' && createElement('div', { className: 'codingns-magpie-management-message', role: 'status' }, notice), review === null && createElement('div', { className: 'codingns-magpie-management-actions' }, createElement('button', { type: 'button', onClick: () => { setDraft(groupDraft(group)); setNotice(''); } }, t('magpie.management.reset')), createElement('button', { type: 'button', className: 'is-primary', disabled: updateField === null, onClick: () => { setNotice(''); setReview(updateField); } }, t('magpie.management.reviewChanges'))));
453
+ }
454
+ function groupDraft(group) {
455
+ return {
456
+ name: group.name,
457
+ models: uniqueStrings([
458
+ ...group.members.filter(member => !member.byPattern).map(member => member.id),
459
+ ...group.patterns,
460
+ ]),
461
+ // An empty policy is Magpie's Smart and its Auto, as its own editor shows them.
462
+ routing: group.routing === null || group.routing === '' ? 'smart' : group.routing,
463
+ stays: group.stays === null || group.stays === '' ? 'auto' : group.stays,
464
+ pick: group.pick ?? '',
465
+ unlists: group.unlists === true,
466
+ fast: group.fast,
467
+ context: group.context,
468
+ levels: group.levels,
469
+ effort: group.effort === null || group.effort === undefined ? '' : group.effort,
470
+ classifier: group.classifier ?? '',
471
+ };
472
+ }
473
+ export function reorderModels(models, sourceId, targetId) {
474
+ if (sourceId === targetId)
475
+ return [...models];
476
+ const sourceIndex = models.indexOf(sourceId);
477
+ const targetIndex = models.indexOf(targetId);
478
+ if (sourceIndex < 0 || targetIndex < 0)
479
+ return [...models];
480
+ const next = [...models];
481
+ const [moved] = next.splice(sourceIndex, 1);
482
+ if (moved === undefined)
483
+ return [...models];
484
+ next.splice(sourceIndex < targetIndex ? targetIndex - 1 : targetIndex, 0, moved);
485
+ return next;
486
+ }
487
+ function uniqueStrings(values) {
488
+ return [...new Set(values)];
489
+ }
490
+ function sameStringOrder(left, right) {
491
+ return left.length === right.length && left.every((value, index) => value === right[index]);
492
+ }
493
+ function sameStringSet(left, right) {
494
+ return left.length === right.length && left.every(value => right.includes(value));
495
+ }
496
+ /**
497
+ * Read a context window the way Magpie's own editor does: a token count, optionally written
498
+ * with a `k` or `m` suffix ("200k", "1m"). Returns null for anything else, which keeps the
499
+ * previous value and shows the error instead of silently saving a wrong window.
500
+ */
501
+ export function parseContextTokens(value) {
502
+ const match = value.trim().toLocaleLowerCase().replace(/_/gu, '').match(/^(\d+(?:\.\d+)?)\s*([km]?)$/u);
503
+ if (match === null)
504
+ return null;
505
+ const suffix = match[2] ?? '';
506
+ const scale = suffix === 'k' ? 1_000 : suffix === 'm' ? 1_000_000 : 1;
507
+ const tokens = Math.round(Number(match[1]) * scale);
508
+ return Number.isSafeInteger(tokens) && tokens > 0 ? tokens : null;
509
+ }
510
+ /** The inverse, so a stored window reads back as Magpie writes it. */
511
+ export function formatContextTokens(tokens) {
512
+ if (tokens >= 1_000_000)
513
+ return `${Number((tokens / 1_000_000).toFixed(1))}m`;
514
+ if (tokens >= 1_000)
515
+ return `${Math.round(tokens / 1_000)}k`;
516
+ return String(tokens);
517
+ }
518
+ /** The levels Magpie starts a "named" list with: those the members share, or its usual three. */
519
+ function defaultLevels(shared) {
520
+ const seed = shared.length > 0 ? shared : ['low', 'medium', 'high'];
521
+ return MEMBER_LEVELS.filter(level => seed.includes(level));
522
+ }
523
+ function uniqueBy(items, keyOf) {
524
+ const seen = new Set();
525
+ return items.filter(item => {
526
+ const key = keyOf(item);
527
+ if (seen.has(key))
528
+ return false;
529
+ seen.add(key);
530
+ return true;
531
+ });
532
+ }
533
+ /** A small set of exclusive choices, drawn as buttons rather than a select. */
534
+ function Segmented({ label, value, options, onChange }) {
535
+ return createElement('div', { className: 'codingns-magpie-segmented', role: 'group', 'aria-label': label }, ...options.map(option => createElement('button', {
536
+ key: option.value,
537
+ type: 'button',
538
+ className: option.value === value ? 'is-active' : '',
539
+ 'aria-pressed': option.value === value,
540
+ onClick: () => onChange(option.value),
541
+ }, option.label)));
542
+ }
543
+ /** One checkbox per option, for the few per-model switches a save carries. */
544
+ function CheckboxList({ label, options, value, disabled, onChange }) {
545
+ return createElement('div', { className: 'codingns-magpie-checkbox-list', role: 'group', 'aria-label': label }, ...options.map(option => createElement('label', { key: option.id, className: 'codingns-magpie-model-option' }, createElement('input', {
546
+ type: 'checkbox',
547
+ checked: value.includes(option.id),
548
+ disabled,
549
+ 'aria-label': option.id,
550
+ onChange: (event) => onChange(option.id, event.currentTarget.checked),
551
+ }), createElement('span', { className: 'codingns-magpie-model-option-copy' }, createElement('code', { className: 'codingns-magpie-model-id', title: option.id }, option.label)))));
552
+ }
553
+ function groupModelCandidates(snapshot, group) {
554
+ const candidates = new Map();
555
+ const providerNames = new Map((snapshot?.providers ?? []).map(provider => [provider.id, provider.name]));
556
+ const providerAgents = new Map((snapshot?.providers ?? []).map(provider => [provider.id, provider.accountAgent]));
557
+ for (const provider of snapshot?.providers ?? []) {
558
+ for (const model of provider.models) {
559
+ if (!candidates.has(model.id))
560
+ candidates.set(model.id, { id: model.id, name: model.name, provider: provider.id, providerName: provider.name, providerAgent: provider.accountAgent, kind: 'model' });
561
+ }
562
+ }
563
+ for (const member of group.members) {
564
+ if (!candidates.has(member.id))
565
+ candidates.set(member.id, {
566
+ id: member.id,
567
+ name: member.name,
568
+ provider: member.provider,
569
+ providerName: member.provider === null ? null : providerNames.get(member.provider) ?? null,
570
+ providerAgent: member.provider === null ? null : providerAgents.get(member.provider) ?? null,
571
+ kind: member.id.startsWith('group/') ? 'group' : 'model',
572
+ canFast: member.canFast === true,
573
+ });
574
+ }
575
+ for (const pattern of group.patterns) {
576
+ if (!candidates.has(pattern))
577
+ candidates.set(pattern, { id: pattern, name: null, provider: null, providerName: null, kind: 'pattern' });
578
+ }
579
+ return [...candidates.values()];
580
+ }
581
+ function GroupModelEditor({ value, candidates, t, onChange }) {
582
+ const [draggingId, setDraggingId] = useState(null);
583
+ const candidateById = new Map(candidates.map(candidate => [candidate.id, candidate]));
584
+ const fallback = (id) => ({
585
+ id,
586
+ name: null,
587
+ provider: null,
588
+ providerName: null,
589
+ providerAgent: null,
590
+ kind: id.startsWith('group/') ? 'group' : id.includes('*') || id.startsWith('re:') ? 'pattern' : 'model',
591
+ });
592
+ const selected = value.map(id => candidateById.get(id) ?? fallback(id));
593
+ const unselected = candidates.filter(candidate => !value.includes(candidate.id));
594
+ const [pickerOpen, setPickerOpen] = useState(false);
595
+ const [pickerQuery, setPickerQuery] = useState('');
596
+ const move = (id, delta) => {
597
+ const index = value.indexOf(id);
598
+ const targetIndex = index + delta;
599
+ if (index < 0 || targetIndex < 0 || targetIndex >= value.length)
600
+ return;
601
+ const targetId = value[targetIndex];
602
+ if (targetId !== undefined)
603
+ onChange(reorderModels(value, id, targetId));
604
+ };
605
+ const drop = (event, targetId) => {
606
+ event.preventDefault();
607
+ const sourceId = draggingId ?? event.dataTransfer?.getData('text/plain') ?? '';
608
+ if (sourceId !== '')
609
+ onChange(reorderModels(value, sourceId, targetId));
610
+ setDraggingId(null);
611
+ };
612
+ const renderOption = (candidate, enabled, index) => createElement('div', {
613
+ key: candidate.id,
614
+ className: `codingns-magpie-group-model-option${enabled ? ' is-selected' : ''}${draggingId === candidate.id ? ' is-dragging' : ''}`,
615
+ draggable: enabled && candidate.kind !== 'pattern',
616
+ 'data-model-id': candidate.id,
617
+ onDragStart: enabled && candidate.kind !== 'pattern' ? (event) => {
618
+ setDraggingId(candidate.id);
619
+ event.dataTransfer?.setData('text/plain', candidate.id);
620
+ if (event.dataTransfer !== undefined)
621
+ event.dataTransfer.effectAllowed = 'move';
622
+ } : undefined,
623
+ onDragEnd: () => setDraggingId(null),
624
+ onDragOver: enabled && candidate.kind !== 'pattern' ? (event) => {
625
+ event.preventDefault();
626
+ if (event.dataTransfer !== undefined)
627
+ event.dataTransfer.dropEffect = 'move';
628
+ } : undefined,
629
+ onDrop: enabled && candidate.kind !== 'pattern' ? (event) => drop(event, candidate.id) : undefined,
630
+ }, createElement('label', { className: 'codingns-magpie-group-model-check' }, createElement('input', {
631
+ type: 'checkbox',
632
+ checked: value.includes(candidate.id),
633
+ 'aria-label': candidate.id,
634
+ onChange: (event) => onChange(event.currentTarget.checked ? addGroupModel(value, candidate, candidateById) : value.filter(id => id !== candidate.id)),
635
+ }), createElement('span', { className: 'codingns-magpie-group-model-order', 'aria-hidden': true }, String(index + 1)), createElement(MagpieProviderLogo, { identities: [candidate.providerAgent, candidate.provider, candidate.providerName], size: 20, className: 'codingns-magpie-provider-logo codingns-magpie-provider-logo-compact', fallback: 'none' }), createElement('span', { className: 'codingns-magpie-model-option-copy' }, createElement('strong', { className: 'codingns-magpie-model-name', title: candidate.name ?? candidate.id }, candidate.name ?? candidate.id), createElement('span', { className: 'codingns-magpie-model-meta' }, candidate.provider !== null && createElement('span', { className: 'codingns-magpie-model-provider', title: candidate.provider }, candidate.provider), createElement('code', { className: 'codingns-magpie-model-id', title: candidate.id }, candidate.id)))), enabled && candidate.kind !== 'pattern' && createElement('div', { className: 'codingns-magpie-group-model-actions' }, createElement('button', { type: 'button', disabled: index === 0, 'aria-label': t('magpie.management.moveModelUp', { model: candidate.id }), onClick: () => move(candidate.id, -1) }, '↑'), createElement('button', { type: 'button', disabled: index === value.length - 1, 'aria-label': t('magpie.management.moveModelDown', { model: candidate.id }), onClick: () => move(candidate.id, 1) }, '↓')));
636
+ return createElement('div', { className: 'codingns-magpie-group-model-editor', role: 'list' }, selected.length === 0 && createElement('div', { className: 'codingns-magpie-inline-empty' }, t('magpie.management.noSelectedGroupModels')), ...selected.map((candidate, index) => renderOption(candidate, true, index)), unselected.length > 0 && createElement('div', { className: 'codingns-magpie-group-model-add' }, createElement('button', {
637
+ type: 'button',
638
+ className: 'codingns-magpie-group-model-add-button',
639
+ 'aria-label': t('magpie.management.addGroupModel'),
640
+ 'aria-expanded': pickerOpen,
641
+ 'aria-controls': 'codingns-magpie-group-model-picker',
642
+ onClick: () => setPickerOpen(open => !open),
643
+ }, createElement('span', { className: 'codingns-magpie-group-model-add-icon', 'aria-hidden': true }, '+'), t('magpie.management.addGroupModel')), pickerOpen && createElement(GroupModelPicker, {
644
+ candidates: unselected,
645
+ value,
646
+ query: pickerQuery,
647
+ t,
648
+ onQueryChange: setPickerQuery,
649
+ onSelect: candidate => {
650
+ onChange(addGroupModel(value, candidate, candidateById));
651
+ setPickerOpen(false);
652
+ setPickerQuery('');
653
+ },
654
+ })));
655
+ }
656
+ export function GroupModelPicker({ candidates, value, query, t, onQueryChange, onSelect }) {
657
+ const normalizedQuery = query.trim().toLocaleLowerCase();
658
+ const filtered = candidates.filter(candidate => [candidate.name, candidate.id, candidate.provider, candidate.providerName]
659
+ .some(value => value?.toLocaleLowerCase().includes(normalizedQuery) === true));
660
+ const groups = new Map();
661
+ for (const candidate of filtered) {
662
+ const key = candidate.provider ?? 'other';
663
+ const group = groups.get(key);
664
+ if (group !== undefined)
665
+ group.candidates.push(candidate);
666
+ else
667
+ groups.set(key, { label: candidate.providerName ?? candidate.provider ?? t('magpie.management.otherGroupModels'), candidates: [candidate] });
668
+ }
669
+ return createElement('div', { id: 'codingns-magpie-group-model-picker', className: 'codingns-magpie-group-model-picker', role: 'dialog', 'aria-label': t('magpie.management.addGroupModel') }, createElement('div', { className: 'codingns-magpie-group-model-picker-search' }, createElement('span', { 'aria-hidden': true }, '⌕'), createElement('input', {
670
+ type: 'search',
671
+ value: query,
672
+ autoFocus: true,
673
+ placeholder: t('magpie.management.searchGroupModels'),
674
+ 'aria-label': t('magpie.management.searchGroupModels'),
675
+ onChange: (event) => onQueryChange(event.currentTarget.value),
676
+ })), createElement('div', { className: 'codingns-magpie-group-model-picker-list', role: 'listbox' }, groups.size === 0
677
+ ? createElement('div', { className: 'codingns-magpie-inline-empty' }, t('magpie.management.noMatchingGroupModels'))
678
+ : [...groups.entries()].map(([key, group]) => createElement('section', { key, className: 'codingns-magpie-group-model-picker-group' }, createElement('h4', { className: 'codingns-magpie-group-model-picker-heading' }, group.label), ...group.candidates.map(candidate => createElement('button', {
679
+ key: candidate.id,
680
+ type: 'button',
681
+ className: 'codingns-magpie-group-model-picker-option',
682
+ role: 'option',
683
+ 'aria-selected': value.includes(candidate.id),
684
+ onClick: () => onSelect(candidate),
685
+ }, createElement(MagpieProviderLogo, { identities: [candidate.providerAgent, candidate.provider, candidate.providerName], size: 24, className: 'codingns-magpie-provider-logo codingns-magpie-provider-logo-compact', fallback: 'none' }), createElement('span', { className: 'codingns-magpie-model-option-copy' }, createElement('strong', { className: 'codingns-magpie-model-name', title: candidate.name ?? candidate.id }, candidate.name ?? candidate.id), createElement('span', { className: 'codingns-magpie-model-meta' }, candidate.provider !== null && createElement('span', { className: 'codingns-magpie-model-provider', title: candidate.provider }, candidate.provider), createElement('code', { className: 'codingns-magpie-model-id', title: candidate.id }, candidate.id)))))))));
686
+ }
687
+ function addGroupModel(value, candidate, candidateById) {
688
+ if (value.includes(candidate.id))
689
+ return [...value];
690
+ if (candidate.kind === 'pattern')
691
+ return [...value, candidate.id];
692
+ const firstPattern = value.findIndex(id => candidateById.get(id)?.kind === 'pattern' || id.includes('*') || id.startsWith('re:'));
693
+ if (firstPattern < 0)
694
+ return [...value, candidate.id];
695
+ return [...value.slice(0, firstPattern), candidate.id, ...value.slice(firstPattern)];
696
+ }
697
+ function accountBelongsToProvider(account, provider) {
698
+ const providerAgent = (provider.accountAgent ?? provider.id).toLocaleLowerCase();
699
+ return account.agent.toLocaleLowerCase() === providerAgent;
700
+ }
701
+ function SelectField({ label, hint, value, options, onChange }) {
702
+ return createElement('label', { className: 'codingns-magpie-field' }, createElement('span', undefined, label), hint !== undefined && createElement('small', undefined, hint), createElement('select', { value, onChange: (event) => onChange(event.currentTarget.value) }, ...options.map(option => createElement('option', { key: option.value, value: option.value }, option.label))));
703
+ }
704
+ function StateBadge({ state, label, t }) {
705
+ return createElement('span', { className: `codingns-magpie-state is-${state}` }, label ?? t(state === 'on' ? 'magpie.management.on' : state === 'off' ? 'magpie.management.off' : 'magpie.management.unknown'));
706
+ }
707
+ function PanelEmpty({ message }) {
708
+ return createElement('div', { className: 'codingns-magpie-panel codingns-magpie-management-empty', role: 'note' }, message);
709
+ }
710
+ function summarizeProviderUpdate(update, t) {
711
+ const changes = [];
712
+ if (update.name !== undefined)
713
+ changes.push(t('magpie.management.reviewName', { value: update.name }));
714
+ if (update.endpointUrl !== undefined)
715
+ changes.push(t('magpie.management.reviewEndpoint', { field: update.endpointField ?? '', value: update.endpointUrl }));
716
+ if (update.models !== undefined)
717
+ changes.push(t('magpie.management.reviewModels', { count: update.models.length }));
718
+ if (update.on !== undefined)
719
+ changes.push(t('magpie.management.reviewProviderStatus', { value: t(update.on ? 'magpie.management.on' : 'magpie.management.off') }));
720
+ return changes.join(' · ');
721
+ }
722
+ function summarizeGroupUpdate(update, t) {
723
+ const changes = [];
724
+ if (update.name !== undefined)
725
+ changes.push(t('magpie.management.reviewName', { value: update.name }));
726
+ if (update.models !== undefined)
727
+ changes.push(t('magpie.management.reviewModels', { count: update.models.length }));
728
+ if (update.routing !== undefined)
729
+ changes.push(t('magpie.management.reviewRouting', { value: magpiePolicyLabel('routing', update.routing, t) }));
730
+ if (update.stays !== undefined)
731
+ changes.push(t('magpie.management.reviewStays', { value: magpiePolicyLabel('stays', update.stays, t) }));
732
+ if (update.pick !== undefined)
733
+ changes.push(t('magpie.management.reviewPick', { value: update.pick }));
734
+ if (update.unlists !== undefined)
735
+ changes.push(t('magpie.management.reviewUnlists', { value: t(update.unlists ? 'magpie.management.on' : 'magpie.management.off') }));
736
+ if (update.fast !== undefined)
737
+ changes.push(t('magpie.management.reviewFast', { count: update.fast.length }));
738
+ if (update.context !== undefined) {
739
+ changes.push(t('magpie.management.reviewContext', {
740
+ value: update.context === CONTEXT_SMALLEST
741
+ ? t('magpie.management.contextSmallest')
742
+ : update.context > 0 ? formatContextTokens(update.context) : t('magpie.management.contextLargest'),
743
+ }));
744
+ }
745
+ if (update.levels !== undefined) {
746
+ changes.push(t('magpie.management.reviewLevels', {
747
+ value: update.levels.length === 0 ? t('magpie.management.levelsShared') : update.levels.join(', '),
748
+ }));
749
+ }
750
+ if (update.effort !== undefined) {
751
+ changes.push(t('magpie.management.reviewEffort', {
752
+ value: update.effort === GROUP_EFFORT_AUTO
753
+ ? t('magpie.management.reviewEffortAuto', { model: update.classifier ?? '' })
754
+ : t('magpie.management.effortAgent'),
755
+ }));
756
+ }
757
+ return changes.join(' · ');
758
+ }
759
+ //# sourceMappingURL=magpie-management-controls.js.map