@antelopejs/dms-ai 0.1.6 → 0.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (565) hide show
  1. package/README.md +50 -12
  2. package/dist/channels/bridge.d.ts +6 -1
  3. package/dist/channels/bridge.js +29 -1
  4. package/dist/channels/bridge.js.map +1 -1
  5. package/dist/channels/channel-service.d.ts +2 -1
  6. package/dist/channels/channel-service.js +3 -2
  7. package/dist/channels/channel-service.js.map +1 -1
  8. package/dist/channels/sse-stream.d.ts +3 -2
  9. package/dist/config.d.ts +0 -2
  10. package/dist/config.js +0 -7
  11. package/dist/config.js.map +1 -1
  12. package/dist/constants/http.d.ts +9 -0
  13. package/dist/constants/http.js +14 -0
  14. package/dist/constants/http.js.map +1 -0
  15. package/dist/constants/i18n.d.ts +11 -0
  16. package/dist/constants/i18n.js +15 -0
  17. package/dist/constants/i18n.js.map +1 -0
  18. package/dist/constants/pages.d.ts +50 -0
  19. package/dist/constants/pages.js +58 -0
  20. package/dist/constants/pages.js.map +1 -0
  21. package/dist/constants/sidecar.d.ts +0 -1
  22. package/dist/constants/sidecar.js +1 -2
  23. package/dist/constants/sidecar.js.map +1 -1
  24. package/dist/index.js +0 -8
  25. package/dist/index.js.map +1 -1
  26. package/dist/lifecycle/sidecar-owner.d.ts +1 -0
  27. package/dist/lifecycle/sidecar-owner.js +13 -0
  28. package/dist/lifecycle/sidecar-owner.js.map +1 -1
  29. package/dist/lifecycle/spawn-sidecar.d.ts +1 -0
  30. package/dist/lifecycle/spawn-sidecar.js +10 -10
  31. package/dist/lifecycle/spawn-sidecar.js.map +1 -1
  32. package/dist/logging/log-buffer.d.ts +0 -6
  33. package/dist/logging/log-buffer.js +0 -1
  34. package/dist/logging/log-buffer.js.map +1 -1
  35. package/dist/pages/activity/columns.d.ts +2 -0
  36. package/dist/pages/activity/columns.js +103 -0
  37. package/dist/pages/activity/columns.js.map +1 -0
  38. package/dist/pages/activity/page.d.ts +1 -2
  39. package/dist/pages/activity/page.js +79 -44
  40. package/dist/pages/activity/page.js.map +1 -1
  41. package/dist/pages/all.d.ts +1 -0
  42. package/dist/pages/all.js +1 -0
  43. package/dist/pages/all.js.map +1 -1
  44. package/dist/pages/changes/page.d.ts +9 -0
  45. package/dist/pages/changes/page.js +22 -0
  46. package/dist/pages/changes/page.js.map +1 -0
  47. package/dist/pages/meta.d.ts +9 -0
  48. package/dist/pages/meta.js +31 -0
  49. package/dist/pages/meta.js.map +1 -0
  50. package/dist/pages/module.js +9 -5
  51. package/dist/pages/module.js.map +1 -1
  52. package/dist/pages/overview/insights.d.ts +3 -0
  53. package/dist/pages/overview/insights.js +77 -0
  54. package/dist/pages/overview/insights.js.map +1 -0
  55. package/dist/pages/overview/kpis.d.ts +2 -0
  56. package/dist/pages/overview/kpis.js +39 -0
  57. package/dist/pages/overview/kpis.js.map +1 -0
  58. package/dist/pages/overview/page.d.ts +6 -3
  59. package/dist/pages/overview/page.js +19 -62
  60. package/dist/pages/overview/page.js.map +1 -1
  61. package/dist/pages/overview/recent-changes.d.ts +2 -0
  62. package/dist/pages/overview/recent-changes.js +144 -0
  63. package/dist/pages/overview/recent-changes.js.map +1 -0
  64. package/dist/pages/overview/status.d.ts +3 -0
  65. package/dist/pages/overview/status.js +36 -0
  66. package/dist/pages/overview/status.js.map +1 -0
  67. package/dist/pages/settings/availability.d.ts +2 -0
  68. package/dist/pages/settings/availability.js +46 -0
  69. package/dist/pages/settings/availability.js.map +1 -0
  70. package/dist/pages/settings/options.d.ts +10 -0
  71. package/dist/pages/settings/options.js +58 -0
  72. package/dist/pages/settings/options.js.map +1 -0
  73. package/dist/pages/settings/page.d.ts +2 -1
  74. package/dist/pages/settings/page.js +39 -13
  75. package/dist/pages/settings/page.js.map +1 -1
  76. package/dist/pages/settings/sections.d.ts +2 -0
  77. package/dist/pages/settings/sections.js +164 -0
  78. package/dist/pages/settings/sections.js.map +1 -0
  79. package/dist/pages/skills/page.d.ts +2 -1
  80. package/dist/pages/skills/page.js +120 -12
  81. package/dist/pages/skills/page.js.map +1 -1
  82. package/dist/routes/activity-csv.d.ts +2 -0
  83. package/dist/routes/activity-csv.js +42 -0
  84. package/dist/routes/activity-csv.js.map +1 -0
  85. package/dist/routes/activity.d.ts +8 -0
  86. package/dist/routes/activity.js +105 -0
  87. package/dist/routes/activity.js.map +1 -0
  88. package/dist/routes/actor.d.ts +2 -0
  89. package/dist/routes/actor.js +8 -0
  90. package/dist/routes/actor.js.map +1 -0
  91. package/dist/routes/banner.d.ts +3 -0
  92. package/dist/routes/banner.js +9 -0
  93. package/dist/routes/banner.js.map +1 -0
  94. package/dist/routes/builder.js +1 -5
  95. package/dist/routes/builder.js.map +1 -1
  96. package/dist/routes/changes.d.ts +17 -0
  97. package/dist/routes/changes.js +152 -0
  98. package/dist/routes/changes.js.map +1 -0
  99. package/dist/routes/channels.js +2 -1
  100. package/dist/routes/channels.js.map +1 -1
  101. package/dist/routes/index.d.ts +3 -0
  102. package/dist/routes/index.js +3 -0
  103. package/dist/routes/index.js.map +1 -1
  104. package/dist/routes/list-query.d.ts +9 -0
  105. package/dist/routes/list-query.js +34 -0
  106. package/dist/routes/list-query.js.map +1 -0
  107. package/dist/routes/metric-shapes.d.ts +8 -0
  108. package/dist/routes/metric-shapes.js +107 -0
  109. package/dist/routes/metric-shapes.js.map +1 -0
  110. package/dist/routes/metrics.d.ts +5 -48
  111. package/dist/routes/metrics.js +52 -42
  112. package/dist/routes/metrics.js.map +1 -1
  113. package/dist/routes/settings.d.ts +3 -16
  114. package/dist/routes/settings.js +40 -14
  115. package/dist/routes/settings.js.map +1 -1
  116. package/dist/routes/sidecar-results.d.ts +6 -0
  117. package/dist/routes/sidecar-results.js +44 -0
  118. package/dist/routes/sidecar-results.js.map +1 -0
  119. package/dist/routes/skills.d.ts +4 -14
  120. package/dist/routes/skills.js +91 -6
  121. package/dist/routes/skills.js.map +1 -1
  122. package/dist/routes/status-shapes.d.ts +5 -0
  123. package/dist/routes/status-shapes.js +176 -0
  124. package/dist/routes/status-shapes.js.map +1 -0
  125. package/dist/routes/status.d.ts +9 -0
  126. package/dist/routes/status.js +92 -0
  127. package/dist/routes/status.js.map +1 -0
  128. package/dist/routes/undo-confirm.d.ts +3 -0
  129. package/dist/routes/undo-confirm.js +51 -0
  130. package/dist/routes/undo-confirm.js.map +1 -0
  131. package/dist/sidecar/http-client.d.ts +11 -0
  132. package/dist/sidecar/http-client.js +59 -0
  133. package/dist/sidecar/http-client.js.map +1 -0
  134. package/dist/sidecar/index.d.ts +2 -0
  135. package/dist/sidecar/index.js +19 -0
  136. package/dist/sidecar/index.js.map +1 -0
  137. package/dist/sidecar/query.d.ts +3 -0
  138. package/dist/sidecar/query.js +25 -0
  139. package/dist/sidecar/query.js.map +1 -0
  140. package/dist/types/activity.d.ts +31 -0
  141. package/dist/types/activity.js +3 -0
  142. package/dist/types/activity.js.map +1 -0
  143. package/dist/types/changes.d.ts +45 -0
  144. package/dist/types/changes.js +3 -0
  145. package/dist/types/changes.js.map +1 -0
  146. package/dist/types/index.d.ts +5 -0
  147. package/dist/types/index.js +5 -0
  148. package/dist/types/index.js.map +1 -1
  149. package/dist/types/metrics.d.ts +76 -0
  150. package/dist/types/metrics.js +3 -0
  151. package/dist/types/metrics.js.map +1 -0
  152. package/dist/types/skills.d.ts +51 -0
  153. package/dist/types/skills.js +3 -0
  154. package/dist/types/skills.js.map +1 -0
  155. package/dist/types/status.d.ts +16 -0
  156. package/dist/types/status.js +3 -0
  157. package/dist/types/status.js.map +1 -0
  158. package/dist/vocabulary/enumerations.d.ts +9 -0
  159. package/dist/vocabulary/enumerations.js +52 -0
  160. package/dist/vocabulary/enumerations.js.map +1 -0
  161. package/dist/vocabulary/index.d.ts +5 -0
  162. package/dist/vocabulary/index.js +22 -0
  163. package/dist/vocabulary/index.js.map +1 -0
  164. package/dist/vocabulary/keys.d.ts +1 -0
  165. package/dist/vocabulary/keys.js +8 -0
  166. package/dist/vocabulary/keys.js.map +1 -0
  167. package/dist/vocabulary/options.d.ts +7 -0
  168. package/dist/vocabulary/options.js +33 -0
  169. package/dist/vocabulary/options.js.map +1 -0
  170. package/dist/vocabulary/tools.d.ts +7 -0
  171. package/dist/vocabulary/tools.js +99 -0
  172. package/dist/vocabulary/tools.js.map +1 -0
  173. package/dist/vocabulary/types.d.ts +20 -0
  174. package/dist/vocabulary/types.js +3 -0
  175. package/dist/vocabulary/types.js.map +1 -0
  176. package/frontend-vue/app/chat/components/AnswerRecord.vue +95 -0
  177. package/frontend-vue/app/chat/components/ApprovalDock.vue +371 -0
  178. package/frontend-vue/app/chat/components/ChangeSetCard.vue +297 -0
  179. package/frontend-vue/app/chat/components/ChatEmpty.vue +142 -0
  180. package/frontend-vue/app/chat/components/ChatView.vue +664 -406
  181. package/frontend-vue/app/chat/components/Composer.vue +589 -0
  182. package/frontend-vue/app/chat/components/ConnectionBanner.vue +41 -65
  183. package/frontend-vue/app/chat/components/ConversationDrawer.vue +387 -177
  184. package/frontend-vue/app/chat/components/DiffView.vue +131 -0
  185. package/frontend-vue/app/chat/components/FullAutoBanner.vue +76 -0
  186. package/frontend-vue/app/chat/components/FullAutoDialog.vue +103 -0
  187. package/frontend-vue/app/chat/components/MarkdownContent.vue +15 -15
  188. package/frontend-vue/app/chat/components/MessageList.vue +389 -295
  189. package/frontend-vue/app/chat/components/NoticeCard.vue +193 -0
  190. package/frontend-vue/app/chat/components/PanelHeader.vue +242 -0
  191. package/frontend-vue/app/chat/components/PermissionCard.vue +470 -0
  192. package/frontend-vue/app/chat/components/PlanCard.vue +115 -0
  193. package/frontend-vue/app/chat/components/QuestionDock.vue +407 -0
  194. package/frontend-vue/app/chat/components/QueueDock.vue +310 -0
  195. package/frontend-vue/app/chat/components/RulesList.vue +97 -0
  196. package/frontend-vue/app/chat/components/StepsDock.vue +181 -0
  197. package/frontend-vue/app/chat/components/ToolCluster.vue +186 -178
  198. package/frontend-vue/app/chat/components/ToolRow.vue +251 -0
  199. package/frontend-vue/app/chat/components/TurnErrorCard.vue +135 -0
  200. package/frontend-vue/app/chat/composables/conversation-events.ts +404 -0
  201. package/frontend-vue/app/chat/composables/useChangeSetActions.ts +135 -0
  202. package/frontend-vue/app/chat/composables/useChatChannel.ts +11 -3
  203. package/frontend-vue/app/chat/composables/useChatI18n.ts +35 -0
  204. package/frontend-vue/app/chat/composables/useComposerAttachments.ts +111 -0
  205. package/frontend-vue/app/chat/composables/useConversation.ts +149 -651
  206. package/frontend-vue/app/chat/composables/useConversationId.ts +2 -10
  207. package/frontend-vue/app/chat/composables/useConversationList.ts +77 -21
  208. package/frontend-vue/app/chat/composables/useConversationMode.ts +73 -0
  209. package/frontend-vue/app/chat/composables/usePaletteTurn.ts +124 -0
  210. package/frontend-vue/app/chat/composables/usePermissionQueue.ts +211 -34
  211. package/frontend-vue/app/chat/composables/useQuestionQueue.ts +103 -21
  212. package/frontend-vue/app/chat/composables/useQueueActions.ts +55 -0
  213. package/frontend-vue/app/chat/composables/useSettings.ts +17 -34
  214. package/frontend-vue/app/chat/constants/attachments.ts +2 -1
  215. package/frontend-vue/app/chat/constants/conversation.ts +18 -32
  216. package/frontend-vue/app/chat/constants/protocol.ts +25 -2
  217. package/frontend-vue/app/chat/constants/run-status.ts +8 -14
  218. package/frontend-vue/app/chat/constants/settings.ts +5 -47
  219. package/frontend-vue/app/chat/types/conversation.ts +72 -2
  220. package/frontend-vue/app/chat/types/permission.ts +31 -0
  221. package/frontend-vue/app/chat/types/protocol.ts +226 -0
  222. package/frontend-vue/app/chat/types/question.ts +10 -1
  223. package/frontend-vue/app/chat/types/settings.ts +9 -5
  224. package/frontend-vue/app/chat/utils/approval-keyboard.ts +49 -0
  225. package/frontend-vue/app/chat/utils/arrays.ts +10 -0
  226. package/frontend-vue/app/chat/utils/conversation-groups.ts +96 -0
  227. package/frontend-vue/app/chat/utils/conversation-messages.ts +251 -0
  228. package/frontend-vue/app/chat/utils/diff.ts +78 -0
  229. package/frontend-vue/app/chat/utils/format.ts +43 -0
  230. package/frontend-vue/app/chat/utils/markdown.ts +1 -1
  231. package/frontend-vue/app/chat/utils/permission-view.ts +159 -0
  232. package/frontend-vue/app/chat/utils/platform.ts +34 -0
  233. package/frontend-vue/app/chat/utils/queue.ts +18 -0
  234. package/frontend-vue/app/chat/utils/render-items.ts +164 -0
  235. package/frontend-vue/app/chat/utils/run-status.ts +19 -23
  236. package/frontend-vue/app/chat/utils/suggestions.ts +101 -0
  237. package/frontend-vue/app/chat/utils/todos.ts +2 -2
  238. package/frontend-vue/app/chat/utils/tool-lexicon.ts +540 -0
  239. package/frontend-vue/app/chat/utils/tool-state.ts +60 -0
  240. package/frontend-vue/app/components/ActivityDetail.vue +235 -0
  241. package/frontend-vue/app/components/ChangesView.vue +249 -0
  242. package/frontend-vue/app/components/ChatPanel.vue +141 -196
  243. package/frontend-vue/app/components/PaletteAnswer.vue +185 -0
  244. package/frontend-vue/app/components/SkillCard.vue +77 -0
  245. package/frontend-vue/app/components/SkillDetail.vue +188 -0
  246. package/frontend-vue/app/plugins/ai.client.ts +349 -57
  247. package/frontend-vue/app/plugins/side-panel.ts +13 -0
  248. package/frontend-vue/app/runtime/assistant-activity.ts +105 -0
  249. package/frontend-vue/app/runtime/assistant-commands.ts +210 -0
  250. package/frontend-vue/app/runtime/assistant-notifications.ts +181 -0
  251. package/frontend-vue/app/runtime/assistant-session.ts +49 -6
  252. package/frontend-vue/app/runtime/channel-client.ts +3 -6
  253. package/frontend-vue/app/runtime/constants.ts +29 -35
  254. package/frontend-vue/app/runtime/host-commands.ts +4 -4
  255. package/frontend-vue/app/runtime/listeners.ts +1 -1
  256. package/frontend-vue/app/runtime/navigation-complete.ts +1 -1
  257. package/frontend-vue/app/runtime/panel-intents.ts +55 -0
  258. package/frontend-vue/app/runtime/shortcuts.ts +3 -1
  259. package/frontend-vue/app/runtime/sidecar-status.ts +9 -1
  260. package/frontend-vue/app/runtime/stream-holds.ts +24 -0
  261. package/frontend-vue/app/views/ChangeSetPanel.vue +222 -0
  262. package/frontend-vue/app/views/DecisionLabel.vue +30 -0
  263. package/frontend-vue/app/views/DiffView.vue +215 -0
  264. package/frontend-vue/app/views/ResultPill.vue +32 -0
  265. package/frontend-vue/app/views/RowStepper.vue +48 -0
  266. package/frontend-vue/app/views/UnavailableState.vue +66 -0
  267. package/frontend-vue/app/views/composables/useAiRequest.ts +89 -0
  268. package/frontend-vue/app/views/composables/useAssistant.ts +33 -0
  269. package/frontend-vue/app/views/composables/useChangeSetActions.ts +102 -0
  270. package/frontend-vue/app/views/composables/useViewFormat.ts +55 -0
  271. package/frontend-vue/app/views/constants.ts +43 -0
  272. package/frontend-vue/app/views/types.ts +189 -0
  273. package/frontend-vue/app/views/utils/activity.ts +77 -0
  274. package/frontend-vue/app/views/utils/change-sets.ts +44 -0
  275. package/frontend-vue/app/views/utils/diff.ts +98 -0
  276. package/frontend-vue/app/views/utils/moment.ts +92 -0
  277. package/frontend-vue/app/views/utils/skills.ts +27 -0
  278. package/frontend-vue/app/views/utils/tools.ts +73 -0
  279. package/frontend-vue/dms.frontend.ts +17 -5
  280. package/frontend-vue/i18n/locales/dms-ai-pages-en-GB.json +607 -0
  281. package/frontend-vue/i18n/locales/dms-ai-pages-fr-FR.json +607 -0
  282. package/frontend-vue/i18n/locales/dms-ai-panel-en-GB.json +425 -0
  283. package/frontend-vue/i18n/locales/dms-ai-panel-fr-FR.json +425 -0
  284. package/frontend-vue/i18n/locales/dms-ai-views-en-GB.json +142 -0
  285. package/frontend-vue/i18n/locales/dms-ai-views-fr-FR.json +142 -0
  286. package/frontend-vue/package.json +1 -1
  287. package/frontend-vue/tests/chat/conversation-events.test.ts +590 -0
  288. package/frontend-vue/tests/chat/diff-and-keys.test.ts +178 -0
  289. package/frontend-vue/tests/chat/markdown.test.ts +1 -0
  290. package/frontend-vue/tests/chat/tool-lexicon.test.ts +188 -0
  291. package/frontend-vue/tests/chat/useConversation.test.ts +36 -33
  292. package/frontend-vue/tests/chat-panel.test.ts +79 -131
  293. package/frontend-vue/tests/host-commands.test.ts +1 -0
  294. package/frontend-vue/tests/i18n-panel.test.ts +118 -0
  295. package/frontend-vue/tests/navigation.test.ts +1 -0
  296. package/frontend-vue/tests/palette-assistant.test.ts +221 -0
  297. package/frontend-vue/tests/panel-states.test.ts +811 -0
  298. package/frontend-vue/tests/sidecar-guest.test.ts +35 -3
  299. package/frontend-vue/tests/support/i18n.ts +49 -0
  300. package/frontend-vue/tests/support/panel-harness.ts +198 -0
  301. package/frontend-vue/tests/support/stubs.ts +201 -0
  302. package/frontend-vue/tests/views/diff-view.test.ts +150 -0
  303. package/frontend-vue/tests/views/view-format.test.ts +59 -0
  304. package/frontend-vue/vitest.config.ts +4 -1
  305. package/package.json +5 -4
  306. package/sidecar/dist/agent/attachment-files.d.ts +0 -1
  307. package/sidecar/dist/agent/attachment-files.js +1 -1
  308. package/sidecar/dist/agent/attachment-files.js.map +1 -1
  309. package/sidecar/dist/agent/call-ledger.d.ts +6 -0
  310. package/sidecar/dist/agent/call-ledger.js +41 -0
  311. package/sidecar/dist/agent/call-ledger.js.map +1 -0
  312. package/sidecar/dist/agent/command-analysis.d.ts +9 -0
  313. package/sidecar/dist/agent/command-analysis.js +104 -0
  314. package/sidecar/dist/agent/command-analysis.js.map +1 -0
  315. package/sidecar/dist/agent/conversation-modes.d.ts +32 -0
  316. package/sidecar/dist/agent/conversation-modes.js +122 -0
  317. package/sidecar/dist/agent/conversation-modes.js.map +1 -0
  318. package/sidecar/dist/agent/edit-targets.d.ts +5 -0
  319. package/sidecar/dist/agent/edit-targets.js +41 -0
  320. package/sidecar/dist/agent/edit-targets.js.map +1 -0
  321. package/sidecar/dist/agent/effective-mode.d.ts +9 -2
  322. package/sidecar/dist/agent/effective-mode.js +14 -16
  323. package/sidecar/dist/agent/effective-mode.js.map +1 -1
  324. package/sidecar/dist/agent/host-context.js +2 -2
  325. package/sidecar/dist/agent/host-context.js.map +1 -1
  326. package/sidecar/dist/agent/line-diff.d.ts +8 -0
  327. package/sidecar/dist/agent/line-diff.js +204 -0
  328. package/sidecar/dist/agent/line-diff.js.map +1 -0
  329. package/sidecar/dist/agent/permission-bus.d.ts +55 -10
  330. package/sidecar/dist/agent/permission-bus.js +130 -100
  331. package/sidecar/dist/agent/permission-bus.js.map +1 -1
  332. package/sidecar/dist/agent/permission-preview.d.ts +20 -0
  333. package/sidecar/dist/agent/permission-preview.js +203 -0
  334. package/sidecar/dist/agent/permission-preview.js.map +1 -0
  335. package/sidecar/dist/agent/permission-rules.d.ts +17 -0
  336. package/sidecar/dist/agent/permission-rules.js +95 -0
  337. package/sidecar/dist/agent/permission-rules.js.map +1 -0
  338. package/sidecar/dist/agent/provider.d.ts +12 -4
  339. package/sidecar/dist/agent/question-bus.d.ts +14 -2
  340. package/sidecar/dist/agent/question-bus.js +30 -11
  341. package/sidecar/dist/agent/question-bus.js.map +1 -1
  342. package/sidecar/dist/agent/runner-events.d.ts +3 -1
  343. package/sidecar/dist/agent/runner.d.ts +6 -4
  344. package/sidecar/dist/agent/runner.js +24 -7
  345. package/sidecar/dist/agent/runner.js.map +1 -1
  346. package/sidecar/dist/agent/switching-runner.js +1 -0
  347. package/sidecar/dist/agent/switching-runner.js.map +1 -1
  348. package/sidecar/dist/agent/tool-kinds.d.ts +12 -0
  349. package/sidecar/dist/agent/tool-kinds.js +50 -0
  350. package/sidecar/dist/agent/tool-kinds.js.map +1 -0
  351. package/sidecar/dist/agent/typecheck.d.ts +2 -6
  352. package/sidecar/dist/audit/activity-query.d.ts +37 -0
  353. package/sidecar/dist/audit/activity-query.js +111 -0
  354. package/sidecar/dist/audit/activity-query.js.map +1 -0
  355. package/sidecar/dist/audit/activity-target.d.ts +2 -0
  356. package/sidecar/dist/audit/activity-target.js +46 -0
  357. package/sidecar/dist/audit/activity-target.js.map +1 -0
  358. package/sidecar/dist/audit/activity.d.ts +45 -0
  359. package/sidecar/dist/audit/activity.js +255 -0
  360. package/sidecar/dist/audit/activity.js.map +1 -0
  361. package/sidecar/dist/audit/call-audit.d.ts +11 -0
  362. package/sidecar/dist/audit/call-audit.js +23 -0
  363. package/sidecar/dist/audit/call-audit.js.map +1 -0
  364. package/sidecar/dist/checkpoints/checkpoints.d.ts +69 -0
  365. package/sidecar/dist/checkpoints/checkpoints.js +244 -0
  366. package/sidecar/dist/checkpoints/checkpoints.js.map +1 -0
  367. package/sidecar/dist/checkpoints/shadow-git.d.ts +23 -0
  368. package/sidecar/dist/checkpoints/shadow-git.js +173 -0
  369. package/sidecar/dist/checkpoints/shadow-git.js.map +1 -0
  370. package/sidecar/dist/constants/agent.d.ts +2 -0
  371. package/sidecar/dist/constants/agent.js +4 -0
  372. package/sidecar/dist/constants/agent.js.map +1 -1
  373. package/sidecar/dist/constants/audit.d.ts +22 -0
  374. package/sidecar/dist/constants/audit.js +49 -0
  375. package/sidecar/dist/constants/audit.js.map +1 -0
  376. package/sidecar/dist/constants/builder.d.ts +3 -0
  377. package/sidecar/dist/constants/builder.js +2 -0
  378. package/sidecar/dist/constants/builder.js.map +1 -1
  379. package/sidecar/dist/constants/checkpoints.d.ts +15 -0
  380. package/sidecar/dist/constants/checkpoints.js +26 -0
  381. package/sidecar/dist/constants/checkpoints.js.map +1 -0
  382. package/sidecar/dist/constants/claude.d.ts +1 -0
  383. package/sidecar/dist/constants/claude.js +1 -0
  384. package/sidecar/dist/constants/claude.js.map +1 -1
  385. package/sidecar/dist/constants/codex.d.ts +2 -4
  386. package/sidecar/dist/constants/codex.js +2 -4
  387. package/sidecar/dist/constants/codex.js.map +1 -1
  388. package/sidecar/dist/constants/http.d.ts +1 -0
  389. package/sidecar/dist/constants/http.js +1 -0
  390. package/sidecar/dist/constants/http.js.map +1 -1
  391. package/sidecar/dist/constants/mcp.d.ts +3 -0
  392. package/sidecar/dist/constants/mcp.js +9 -0
  393. package/sidecar/dist/constants/mcp.js.map +1 -1
  394. package/sidecar/dist/constants/permissions.d.ts +9 -3
  395. package/sidecar/dist/constants/permissions.js +9 -2
  396. package/sidecar/dist/constants/permissions.js.map +1 -1
  397. package/sidecar/dist/constants/settings.d.ts +2 -1
  398. package/sidecar/dist/constants/settings.js +7 -1
  399. package/sidecar/dist/constants/settings.js.map +1 -1
  400. package/sidecar/dist/constants/tool-kinds.d.ts +14 -0
  401. package/sidecar/dist/constants/tool-kinds.js +65 -0
  402. package/sidecar/dist/constants/tool-kinds.js.map +1 -0
  403. package/sidecar/dist/index.js +28 -2
  404. package/sidecar/dist/index.js.map +1 -1
  405. package/sidecar/dist/mcp/define-tool.d.ts +3 -2
  406. package/sidecar/dist/mcp/tool-definitions.js +4 -1
  407. package/sidecar/dist/mcp/tool-definitions.js.map +1 -1
  408. package/sidecar/dist/mcp/tools/ask-user.d.ts +2 -2
  409. package/sidecar/dist/mcp/tools/ask-user.js +7 -4
  410. package/sidecar/dist/mcp/tools/ask-user.js.map +1 -1
  411. package/sidecar/dist/mcp/tools/builder-catalog.d.ts +3 -0
  412. package/sidecar/dist/mcp/tools/builder-catalog.js +86 -0
  413. package/sidecar/dist/mcp/tools/builder-catalog.js.map +1 -0
  414. package/sidecar/dist/mcp/tools/builder-gate.d.ts +8 -0
  415. package/sidecar/dist/mcp/tools/builder-gate.js +22 -0
  416. package/sidecar/dist/mcp/tools/builder-gate.js.map +1 -0
  417. package/sidecar/dist/mcp/tools/builder.d.ts +7 -2
  418. package/sidecar/dist/mcp/tools/builder.js +48 -7
  419. package/sidecar/dist/mcp/tools/builder.js.map +1 -1
  420. package/sidecar/dist/mcp/types.d.ts +2 -0
  421. package/sidecar/dist/metrics/aggregate.d.ts +13 -10
  422. package/sidecar/dist/metrics/aggregate.js +140 -143
  423. package/sidecar/dist/metrics/aggregate.js.map +1 -1
  424. package/sidecar/dist/metrics/types.d.ts +36 -23
  425. package/sidecar/dist/metrics/types.js +3 -1
  426. package/sidecar/dist/metrics/types.js.map +1 -1
  427. package/sidecar/dist/pages/imports-scanner.d.ts +1 -1
  428. package/sidecar/dist/pages/imports-scanner.js +2 -5
  429. package/sidecar/dist/pages/imports-scanner.js.map +1 -1
  430. package/sidecar/dist/prompts/agent.d.ts +1 -3
  431. package/sidecar/dist/prompts/agent.js +4 -4
  432. package/sidecar/dist/prompts/agent.js.map +1 -1
  433. package/sidecar/dist/prompts/builder.d.ts +2 -2
  434. package/sidecar/dist/prompts/builder.js +2 -2
  435. package/sidecar/dist/protocol/events.d.ts +1084 -18
  436. package/sidecar/dist/protocol/events.js +239 -5
  437. package/sidecar/dist/protocol/events.js.map +1 -1
  438. package/sidecar/dist/protocol/messages.d.ts +273 -19
  439. package/sidecar/dist/protocol/messages.js +107 -7
  440. package/sidecar/dist/protocol/messages.js.map +1 -1
  441. package/sidecar/dist/providers/claude/config.d.ts +3 -2
  442. package/sidecar/dist/providers/claude/config.js +10 -4
  443. package/sidecar/dist/providers/claude/config.js.map +1 -1
  444. package/sidecar/dist/providers/claude/provider.d.ts +2 -8
  445. package/sidecar/dist/providers/claude/provider.js +37 -35
  446. package/sidecar/dist/providers/claude/provider.js.map +1 -1
  447. package/sidecar/dist/providers/claude/safe-mode.d.ts +6 -1
  448. package/sidecar/dist/providers/claude/safe-mode.js +13 -5
  449. package/sidecar/dist/providers/claude/safe-mode.js.map +1 -1
  450. package/sidecar/dist/providers/codex/adapter.d.ts +6 -0
  451. package/sidecar/dist/providers/codex/adapter.js +14 -4
  452. package/sidecar/dist/providers/codex/adapter.js.map +1 -1
  453. package/sidecar/dist/providers/codex/client.d.ts +0 -11
  454. package/sidecar/dist/providers/codex/config.d.ts +1 -3
  455. package/sidecar/dist/providers/codex/config.js +5 -11
  456. package/sidecar/dist/providers/codex/config.js.map +1 -1
  457. package/sidecar/dist/providers/codex/permissions.d.ts +7 -4
  458. package/sidecar/dist/providers/codex/permissions.js +32 -16
  459. package/sidecar/dist/providers/codex/permissions.js.map +1 -1
  460. package/sidecar/dist/providers/codex/process.js +1 -5
  461. package/sidecar/dist/providers/codex/process.js.map +1 -1
  462. package/sidecar/dist/providers/codex/provider.js +14 -3
  463. package/sidecar/dist/providers/codex/provider.js.map +1 -1
  464. package/sidecar/dist/providers/codex/skills.d.ts +0 -1
  465. package/sidecar/dist/providers/codex/skills.js +1 -1
  466. package/sidecar/dist/providers/codex/skills.js.map +1 -1
  467. package/sidecar/dist/providers/codex/stop.js +1 -10
  468. package/sidecar/dist/providers/codex/stop.js.map +1 -1
  469. package/sidecar/dist/server/change-set-actions.d.ts +10 -0
  470. package/sidecar/dist/server/change-set-actions.js +14 -0
  471. package/sidecar/dist/server/change-set-actions.js.map +1 -0
  472. package/sidecar/dist/server/chat-events.d.ts +15 -0
  473. package/sidecar/dist/server/chat-events.js +115 -0
  474. package/sidecar/dist/server/chat-events.js.map +1 -0
  475. package/sidecar/dist/server/chat-socket-registry.d.ts +2 -0
  476. package/sidecar/dist/server/chat-socket-registry.js +48 -37
  477. package/sidecar/dist/server/chat-socket-registry.js.map +1 -1
  478. package/sidecar/dist/server/conversation-runs.d.ts +13 -0
  479. package/sidecar/dist/server/conversation-runs.js +114 -0
  480. package/sidecar/dist/server/conversation-runs.js.map +1 -0
  481. package/sidecar/dist/server/http-io.d.ts +4 -0
  482. package/sidecar/dist/server/http-io.js +31 -0
  483. package/sidecar/dist/server/http-io.js.map +1 -0
  484. package/sidecar/dist/server/http-params.d.ts +9 -0
  485. package/sidecar/dist/server/http-params.js +79 -0
  486. package/sidecar/dist/server/http-params.js.map +1 -0
  487. package/sidecar/dist/server/http-routes.d.ts +27 -0
  488. package/sidecar/dist/server/http-routes.js +281 -0
  489. package/sidecar/dist/server/http-routes.js.map +1 -0
  490. package/sidecar/dist/server/http.d.ts +6 -1
  491. package/sidecar/dist/server/http.js +76 -164
  492. package/sidecar/dist/server/http.js.map +1 -1
  493. package/sidecar/dist/server/pending-queue.d.ts +2 -0
  494. package/sidecar/dist/server/pending-queue.js +16 -0
  495. package/sidecar/dist/server/pending-queue.js.map +1 -1
  496. package/sidecar/dist/server/permission-events.d.ts +15 -0
  497. package/sidecar/dist/server/permission-events.js +163 -0
  498. package/sidecar/dist/server/permission-events.js.map +1 -0
  499. package/sidecar/dist/server/routing.d.ts +4 -52
  500. package/sidecar/dist/server/routing.js +190 -501
  501. package/sidecar/dist/server/routing.js.map +1 -1
  502. package/sidecar/dist/server/safety-net.d.ts +7 -0
  503. package/sidecar/dist/server/safety-net.js +34 -6
  504. package/sidecar/dist/server/safety-net.js.map +1 -1
  505. package/sidecar/dist/server/services.d.ts +55 -0
  506. package/sidecar/dist/server/services.js +2 -0
  507. package/sidecar/dist/server/services.js.map +1 -0
  508. package/sidecar/dist/server/tool-calls.d.ts +6 -0
  509. package/sidecar/dist/server/tool-calls.js +134 -0
  510. package/sidecar/dist/server/tool-calls.js.map +1 -0
  511. package/sidecar/dist/server/turn-registry.d.ts +44 -0
  512. package/sidecar/dist/server/turn-registry.js +40 -0
  513. package/sidecar/dist/server/turn-registry.js.map +1 -0
  514. package/sidecar/dist/server/turns.d.ts +17 -0
  515. package/sidecar/dist/server/turns.js +335 -0
  516. package/sidecar/dist/server/turns.js.map +1 -0
  517. package/sidecar/dist/server/ws.d.ts +4 -1
  518. package/sidecar/dist/server/ws.js +102 -62
  519. package/sidecar/dist/server/ws.js.map +1 -1
  520. package/sidecar/dist/skills/build-catalog.d.ts +1 -0
  521. package/sidecar/dist/skills/build-catalog.js +14 -1
  522. package/sidecar/dist/skills/build-catalog.js.map +1 -1
  523. package/sidecar/dist/skills/skill-usage.d.ts +22 -0
  524. package/sidecar/dist/skills/skill-usage.js +97 -0
  525. package/sidecar/dist/skills/skill-usage.js.map +1 -0
  526. package/sidecar/dist/state/change-sets.d.ts +12 -0
  527. package/sidecar/dist/state/change-sets.js +77 -0
  528. package/sidecar/dist/state/change-sets.js.map +1 -0
  529. package/sidecar/dist/state/conversations.d.ts +19 -7
  530. package/sidecar/dist/state/conversations.js +61 -20
  531. package/sidecar/dist/state/conversations.js.map +1 -1
  532. package/sidecar/dist/state/host-state.d.ts +2 -1
  533. package/sidecar/dist/state/settings-store.d.ts +1 -0
  534. package/sidecar/dist/state/settings-store.js +27 -26
  535. package/sidecar/dist/state/settings-store.js.map +1 -1
  536. package/sidecar/dist/state/settings-types.d.ts +11 -1
  537. package/sidecar/dist/state/settings-types.js +3 -1
  538. package/sidecar/dist/state/settings-types.js.map +1 -1
  539. package/sidecar/dist/state/types.d.ts +114 -8
  540. package/sidecar/dist/state/types.js +6 -3
  541. package/sidecar/dist/state/types.js.map +1 -1
  542. package/sidecar/package.json +2 -1
  543. package/skills/dms-builder-safe/REFERENCE.md +1 -1
  544. package/skills/dms-builder-safe/SKILL.md +12 -7
  545. package/dist/routes/proxy.d.ts +0 -4
  546. package/dist/routes/proxy.js +0 -55
  547. package/dist/routes/proxy.js.map +0 -1
  548. package/frontend-vue/app/chat/components/ComposerInput.vue +0 -742
  549. package/frontend-vue/app/chat/components/PermissionRequests.vue +0 -323
  550. package/frontend-vue/app/chat/components/QuestionPrompt.vue +0 -275
  551. package/frontend-vue/app/chat/components/QueuedMessages.vue +0 -109
  552. package/frontend-vue/app/chat/components/TodoList.vue +0 -291
  553. package/frontend-vue/app/chat/components/ToolCallEntry.vue +0 -218
  554. package/frontend-vue/app/chat/constants/connection-banner.ts +0 -7
  555. package/frontend-vue/app/chat/constants/conversation-drawer.ts +0 -13
  556. package/frontend-vue/app/chat/constants/permissions.ts +0 -50
  557. package/frontend-vue/app/chat/utils/tool-summary.ts +0 -53
  558. package/frontend-vue/app/components/ActivityView.vue +0 -94
  559. package/frontend-vue/app/components/SettingsView.vue +0 -387
  560. package/frontend-vue/app/components/SkillsView.vue +0 -230
  561. package/frontend-vue/app/runtime/header-action.ts +0 -64
  562. package/frontend-vue/app/runtime/overlay-prefs.ts +0 -89
  563. package/frontend-vue/app/runtime/panel-state.ts +0 -88
  564. package/frontend-vue/tests/overlay-prefs.test.ts +0 -91
  565. package/frontend-vue/tests/panel-state.test.ts +0 -58
@@ -1,53 +1,70 @@
1
1
  <script setup lang="ts">
2
- import { computed, nextTick, onMounted, ref, watch } from "vue";
2
+ import {
3
+ computed,
4
+ nextTick,
5
+ onBeforeUnmount,
6
+ onMounted,
7
+ ref,
8
+ watch,
9
+ } from "vue";
3
10
  import type { ChatTransport } from "../../runtime/chat-transport";
11
+ import type { PanelIntent, PanelIntents } from "../../runtime/panel-intents";
12
+ import {
13
+ useChangeSetActions,
14
+ type ChatApi,
15
+ } from "../composables/useChangeSetActions";
4
16
  import { useChatChannel } from "../composables/useChatChannel";
17
+ import { useChatI18n } from "../composables/useChatI18n";
5
18
  import { useConversation } from "../composables/useConversation";
6
19
  import {
7
- newConversationId,
8
20
  persistConversationId,
9
21
  resolveConversationId,
10
22
  } from "../composables/useConversationId";
11
23
  import { useConversationList } from "../composables/useConversationList";
24
+ import { useConversationMode } from "../composables/useConversationMode";
12
25
  import { usePermissionQueue } from "../composables/usePermissionQueue";
13
26
  import { useQuestionQueue } from "../composables/useQuestionQueue";
27
+ import { useQueueActions } from "../composables/useQueueActions";
14
28
  import { useRunClock } from "../composables/useRunClock";
15
29
  import { useSettings } from "../composables/useSettings";
16
- import { TOGGLE_DRAWER_LABEL } from "../constants/conversation-drawer";
30
+ import { EXIT_PLAN_MODE_TOOL_NAME } from "../constants/conversation";
17
31
  import {
18
- type ConnectionStatus,
32
+ ACTIVITY_PAGE_PATH,
33
+ CHANGE_SET_QUERY_KEY,
34
+ CHANGES_PAGE_PATH,
35
+ CLIENT_MESSAGE_TYPES,
19
36
  SERVER_EVENT_TYPES,
20
37
  SETTINGS_PAGE_PATH,
21
38
  } from "../constants/protocol";
22
- import {
23
- MODE_HINTS,
24
- MODE_OPTIONS,
25
- MODE_SECTION_LABEL,
26
- OPEN_SETTINGS_LABEL,
27
- PROVIDER_BUSY_HINT,
28
- PROVIDER_OPTIONS,
29
- PROVIDER_SECTION_LABEL,
30
- PROVIDER_SWITCH_CONFIRM,
31
- PROVIDER_SWITCH_WARNING,
32
- PROVIDER_UNAVAILABLE_PREFIX,
33
- SAFE_MODE_MODE_NOTE,
34
- } from "../constants/settings";
35
- import type { ChatMode, ProviderName } from "../types/settings";
39
+ import type { ConversationSummary, CurrentPage } from "../types/conversation";
40
+ import type { ExpiredRequest } from "../types/permission";
41
+ import type { QuestionReply } from "../types/question";
36
42
  import type { PendingAttachment } from "../utils/attachments";
37
- import { isRunStalled } from "../utils/run-status";
43
+ import { formatClock, formatTokens } from "../utils/format";
44
+ import { newUuid } from "../utils/ids";
45
+ import { isRunStalled, runElapsedMs } from "../utils/run-status";
46
+ import { bareToolName } from "../utils/tool-lexicon";
38
47
  import { latestTodos } from "../utils/todos";
39
- import ComposerInput from "./ComposerInput.vue";
48
+ import ApprovalDock from "./ApprovalDock.vue";
49
+ import ChatEmpty from "./ChatEmpty.vue";
50
+ import Composer from "./Composer.vue";
40
51
  import ConnectionBanner from "./ConnectionBanner.vue";
41
52
  import ConversationDrawer from "./ConversationDrawer.vue";
53
+ import FullAutoBanner from "./FullAutoBanner.vue";
42
54
  import MessageList from "./MessageList.vue";
43
- import PermissionRequests from "./PermissionRequests.vue";
44
- import QuestionPrompt from "./QuestionPrompt.vue";
45
- import QueuedMessages from "./QueuedMessages.vue";
46
- import TodoList from "./TodoList.vue";
55
+ import PanelHeader, { type PanelStatusKind } from "./PanelHeader.vue";
56
+ import QuestionDock from "./QuestionDock.vue";
57
+ import QueueDock from "./QueueDock.vue";
58
+ import StepsDock from "./StepsDock.vue";
47
59
 
48
60
  interface Props {
49
61
  /** The chat's side of the tab's stream, which the dashboard owns. */
50
62
  transport: ChatTransport;
63
+ intents: PanelIntents;
64
+ page: CurrentPage | null;
65
+ /** The sidecar is coming back up: the transcript stays, under a banner. */
66
+ isReviving: boolean;
67
+ api: ChatApi | null;
51
68
  }
52
69
 
53
70
  interface Emits {
@@ -55,25 +72,26 @@ interface Emits {
55
72
  navigate: [path: string];
56
73
  }
57
74
 
58
- const props = defineProps<Props>();
59
- const emit = defineEmits<Emits>();
60
-
61
- const ASSISTANT_ICON = "i-ph-robot";
62
- const TOGGLE_DRAWER_ICON = "i-ph-list-light";
63
- const OPEN_SETTINGS_ICON = "i-ph-gear-six-light";
64
- const CLOSE_PANEL_ICON = "i-ph-x-light";
65
-
66
- const MODE_BAR_SELECT_UI = { content: "min-w-fit" };
75
+ interface FocusableComposer {
76
+ focus: () => void;
77
+ setDraft: (text: string) => void;
78
+ }
67
79
 
68
- function isObject(value: unknown): value is Record<string, unknown> {
69
- return value !== null && typeof value === "object";
80
+ interface FocusableDock {
81
+ focusRequest: (requestId: string) => void;
70
82
  }
71
83
 
72
- const STATUS_LABEL_BY_STATE: Record<ConnectionStatus, string> = {
73
- connecting: "connecting…",
74
- connected: "connected",
75
- reconnecting: "reconnecting…",
76
- disconnected: "disconnected",
84
+ const props = defineProps<Props>();
85
+ const emit = defineEmits<Emits>();
86
+ const { t } = useChatI18n();
87
+
88
+ const HISTORY_KEY = "j";
89
+ const ESCAPE_KEY = "Escape";
90
+ const SCROLL_STICKY_THRESHOLD_PX = 80;
91
+ const NAVIGATION_TARGETS: Record<string, string> = {
92
+ changes: CHANGES_PAGE_PATH,
93
+ activity: ACTIVITY_PAGE_PATH,
94
+ settings: SETTINGS_PAGE_PATH,
77
95
  };
78
96
 
79
97
  const activeId = ref(resolveConversationId());
@@ -81,502 +99,742 @@ const channel = useChatChannel({
81
99
  transport: props.transport,
82
100
  getConversationId: () => activeId.value,
83
101
  });
84
- const permissionQueue = usePermissionQueue({ send: channel.send });
85
- const questionQueue = useQuestionQueue({ send: channel.send });
86
- const conversation = useConversation({
102
+ const queueOptions = {
87
103
  activeId,
88
104
  send: channel.send,
89
105
  onMessage: channel.onMessage,
90
- onPermissionRequest: permissionQueue.enqueue,
91
- onQuestionRequest: questionQueue.enqueue,
106
+ };
107
+ const permissions = usePermissionQueue(queueOptions);
108
+ const questions = useQuestionQueue(queueOptions);
109
+ const conversation = useConversation({
110
+ ...queueOptions,
111
+ getPagePath: () => props.page?.path,
92
112
  });
93
- const conversationList = useConversationList({
113
+ const list = useConversationList({
94
114
  send: channel.send,
95
115
  onMessage: channel.onMessage,
96
116
  });
97
- const settings = useSettings({
117
+ const { settings } = useSettings({ onMessage: channel.onMessage });
118
+ const mode = useConversationMode({
119
+ activeId,
120
+ mode: conversation.mode,
121
+ settings,
98
122
  send: channel.send,
99
- onMessage: channel.onMessage,
123
+ });
124
+ const queueActions = useQueueActions({
125
+ activeId,
126
+ queued: conversation.queued,
127
+ send: channel.send,
128
+ });
129
+ const changeSetActions = useChangeSetActions({
130
+ activeId,
131
+ changeSets: conversation.changeSets,
132
+ send: channel.send,
133
+ api: props.api,
100
134
  });
101
135
 
102
- const drawerOpen = ref(false);
103
- const nowMs = ref(Date.now());
104
- const runClockMs = useRunClock(conversation.isRunning);
136
+ const isDrawerOpen = ref(false);
137
+ const nowMs = useRunClock(computed(() => true));
138
+ const composerRef = ref<FocusableComposer | null>(null);
139
+ const approvalDockRef = ref<FocusableDock | null>(null);
140
+ const scrollEl = ref<HTMLElement | null>(null);
105
141
 
106
- const isRunStalledNow = computed<boolean>(
142
+ const isConnected = channel.isConnected;
143
+ const isRunning = conversation.isRunning;
144
+ const pendingCount = computed(
145
+ () => permissions.queue.value.length + questions.queue.value.length,
146
+ );
147
+ const isStalled = computed(
107
148
  () =>
108
149
  conversation.isTurnInFlight.value &&
109
- channel.isConnected.value &&
110
- isRunStalled(conversation.lastEventAtMs.value, runClockMs.value),
150
+ isConnected.value &&
151
+ isRunStalled(conversation.lastEventAtMs.value, nowMs.value),
152
+ );
153
+ const todos = computed(() => latestTodos(conversation.messages.value));
154
+ const agentName = computed(() =>
155
+ t(`dms_ai.common.agent.${settings.value.provider}`),
156
+ );
157
+ const providerProblem = computed(
158
+ () => settings.value.providers[settings.value.provider]?.available === false,
111
159
  );
112
160
 
113
- const stalledForMs = computed<number>(
114
- () => runClockMs.value - conversation.lastEventAtMs.value,
161
+ const title = computed(
162
+ () =>
163
+ list.conversations.value.find((item) => item.id === activeId.value)
164
+ ?.title || t("dms_ai.panel.new_conversation"),
115
165
  );
116
166
 
117
- function openSettingsPage(): void {
118
- emit("navigate", SETTINGS_PAGE_PATH);
119
- }
167
+ const status = computed<PanelStatusKind>(() => {
168
+ if (!isConnected.value)
169
+ return channel.connectionStatus.value === "disconnected"
170
+ ? "offline"
171
+ : "connecting";
172
+ if (pendingCount.value > 0) return "waiting";
173
+ return isRunning.value ? "working" : "ready";
174
+ });
120
175
 
121
- const modeHint = computed(() => {
122
- const { mode, generationMode, builderAvailable } = settings.settings.value;
123
- const isSafeModeActive = generationMode === "safe" && builderAvailable;
124
- return isSafeModeActive
125
- ? `${MODE_HINTS[mode]}. ${SAFE_MODE_MODE_NOTE}`
126
- : MODE_HINTS[mode];
176
+ const statusLabel = computed<string>(() => {
177
+ const labels: Record<PanelStatusKind, () => string> = {
178
+ ready: () => t("dms_ai.panel.status.ready"),
179
+ working: () =>
180
+ t("dms_ai.panel.status.working", {
181
+ time: formatClock(
182
+ runElapsedMs(conversation.progress.value, nowMs.value),
183
+ ),
184
+ }),
185
+ waiting: () =>
186
+ t(
187
+ "dms_ai.panel.status.waiting",
188
+ { count: pendingCount.value },
189
+ pendingCount.value,
190
+ ),
191
+ connecting: () => t("dms_ai.panel.status.connecting"),
192
+ offline: () => t("dms_ai.panel.status.offline"),
193
+ };
194
+ const label = labels[status.value]();
195
+ return status.value === "offline" ? label : `${label} · ${agentName.value}`;
127
196
  });
128
197
 
129
- const modeModel = computed<ChatMode>({
130
- get: () => settings.settings.value.mode,
131
- set: (value) => {
132
- if (value !== settings.settings.value.mode)
133
- settings.update({ mode: value });
134
- },
198
+ const usageLabel = computed<string>(() => {
199
+ if (!isConnected.value) return t("dms_ai.panel.composer.usage_offline");
200
+ const tokens = conversation.totalTokens.value;
201
+ if (tokens === null || tokens === 0) {
202
+ return conversation.messages.value.length === 0
203
+ ? t("dms_ai.panel.composer.usage_new")
204
+ : "";
205
+ }
206
+ return t("dms_ai.panel.composer.usage", { count: formatTokens(tokens) });
135
207
  });
136
208
 
137
- const providerItems = computed(() =>
138
- PROVIDER_OPTIONS.map((option) => ({
139
- ...option,
140
- disabled:
141
- !isProviderAvailable(option.value) || conversation.isRunning.value,
142
- })),
209
+ const placeholder = computed<string>(() => {
210
+ if (!isConnected.value) return t("dms_ai.panel.composer.placeholder_offline");
211
+ if (questions.queue.value.length > 0)
212
+ return t("dms_ai.panel.composer.placeholder_question");
213
+ if (isRunning.value) return t("dms_ai.panel.composer.placeholder_running");
214
+ return t("dms_ai.panel.composer.placeholder_idle");
215
+ });
216
+
217
+ const isEmpty = computed(
218
+ () => conversation.messages.value.length === 0 && !isRunning.value,
143
219
  );
144
220
 
145
- function isProviderAvailable(name: ProviderName): boolean {
146
- return settings.settings.value.providers[name]?.available !== false;
221
+ // Sent on the tab's stream itself: the chat's own channel is already closed
222
+ // when the panel unmounts it.
223
+ function leave(conversationId: string): void {
224
+ props.transport.send({
225
+ type: CLIENT_MESSAGE_TYPES.LEAVE_CONVERSATION,
226
+ conversationId,
227
+ });
147
228
  }
148
229
 
149
- const providerHint = computed(() => {
150
- const active = settings.settings.value.provider;
151
- const reason = settings.settings.value.providers[active]?.reason;
152
- if (reason !== undefined) return `${PROVIDER_UNAVAILABLE_PREFIX}${reason}`;
153
- if (conversation.isRunning.value) return PROVIDER_BUSY_HINT;
154
- return PROVIDER_SWITCH_WARNING;
155
- });
156
-
157
- function mayLeaveCurrentSession(): boolean {
158
- if (conversation.messages.value.length === 0) return true;
159
- return window.confirm(PROVIDER_SWITCH_CONFIRM);
230
+ function switchConversation(id: string): void {
231
+ isDrawerOpen.value = false;
232
+ if (id === activeId.value) return;
233
+ leave(activeId.value);
234
+ activeId.value = id;
235
+ persistConversationId(id);
236
+ conversation.reset();
237
+ permissions.clear();
238
+ questions.clear();
239
+ channel.reidentify();
160
240
  }
161
241
 
162
- const providerModel = computed<ProviderName>({
163
- get: () => settings.settings.value.provider,
164
- set: (value) => {
165
- if (value === settings.settings.value.provider) return;
166
- if (!isProviderAvailable(value)) return;
167
- if (conversation.isRunning.value) return;
168
- if (!mayLeaveCurrentSession()) return;
169
- settings.update({ provider: value });
170
- },
171
- });
172
-
173
- function dismissPanel(): void {
174
- emit("close");
242
+ function newConversation(): void {
243
+ switchConversation(newUuid());
175
244
  }
176
245
 
177
- function refreshList(): void {
178
- nowMs.value = Date.now();
179
- conversationList.refresh();
246
+ function deleteConversation(item: ConversationSummary): void {
247
+ if (item.isRunning === true)
248
+ channel.send({
249
+ type: CLIENT_MESSAGE_TYPES.INTERRUPT_TURN,
250
+ conversationId: item.id,
251
+ });
252
+ list.remove(item);
253
+ if (item.id === activeId.value) newConversation();
180
254
  }
181
255
 
182
256
  function openDrawer(): void {
183
- refreshList();
184
- drawerOpen.value = true;
257
+ list.refresh();
258
+ isDrawerOpen.value = true;
185
259
  }
186
260
 
187
- function closeDrawer(): void {
188
- drawerOpen.value = false;
261
+ function navigate(path: string): void {
262
+ emit("navigate", path);
189
263
  }
190
264
 
191
- function switchConversation(id: string): void {
192
- closeDrawer();
193
- if (id === activeId.value) return;
194
- activeId.value = id;
195
- persistConversationId(id);
196
- conversation.reset();
197
- permissionQueue.clear();
198
- questionQueue.clear();
199
- channel.reidentify();
265
+ function reviewChangeSet(changeSetId: string): void {
266
+ const query = new URLSearchParams({ [CHANGE_SET_QUERY_KEY]: changeSetId });
267
+ navigate(`${CHANGES_PAGE_PATH}?${query.toString()}`);
200
268
  }
201
269
 
202
- function newConversation(): void {
203
- switchConversation(newConversationId());
270
+ function submit(
271
+ content: string,
272
+ attachments: PendingAttachment[],
273
+ includePage: boolean,
274
+ ): void {
275
+ conversation.sendUserMessage(
276
+ content,
277
+ attachments,
278
+ includePage ? {} : { includePageContext: false },
279
+ );
204
280
  }
205
281
 
206
- function deleteConversation(id: string): void {
207
- const wasActive = id === activeId.value;
208
- conversationList.remove(id);
209
- if (wasActive) newConversation();
282
+ function answerQuestions(requestId: string, replies: QuestionReply[]): void {
283
+ const records = questions.respond(requestId, replies);
284
+ if (records !== null) conversation.recordAnswers(records);
210
285
  }
211
286
 
212
- function refreshListAfterTurn(msg: unknown): void {
213
- if (!drawerOpen.value) return;
214
- if (!isObject(msg) || msg.type !== SERVER_EVENT_TYPES.RUN_DONE) return;
215
- refreshList();
287
+ function stopTurn(): void {
288
+ conversation.interrupt();
216
289
  }
217
290
 
218
- channel.onMessage(refreshListAfterTurn);
291
+ function stopAutoFix(): void {
292
+ channel.send({
293
+ type: CLIENT_MESSAGE_TYPES.STOP_AUTOFIX,
294
+ conversationId: activeId.value,
295
+ });
296
+ }
219
297
 
220
- const statusLabel = computed<string>(
221
- () => STATUS_LABEL_BY_STATE[channel.connectionStatus.value],
222
- );
298
+ function askAgain(summary: string): void {
299
+ conversation.sendUserMessage(
300
+ t("dms_ai.panel.approvals.ask_again_message", { summary }),
301
+ );
302
+ }
223
303
 
224
- const todos = computed(() => latestTodos(conversation.messages.value));
304
+ function askAgainExpired(request: ExpiredRequest): void {
305
+ permissions.dismissExpired(request.requestId);
306
+ askAgain(request.summary);
307
+ }
225
308
 
226
- const SCROLL_STICKY_THRESHOLD_PX = 80;
227
- const scrollContainer = ref<HTMLElement | null>(null);
309
+ function runPlan(): void {
310
+ mode.setMode("normal");
311
+ const planRequest = permissions.queue.value.find(
312
+ (request) => bareToolName(request.toolName) === EXIT_PLAN_MODE_TOOL_NAME,
313
+ );
314
+ if (planRequest !== undefined) {
315
+ permissions.respond(planRequest.requestId, { decision: "allow_once" });
316
+ return;
317
+ }
318
+ conversation.sendUserMessage(t("dms_ai.panel.plan.go_ahead"));
319
+ }
228
320
 
229
- function isNearBottom(el: HTMLElement): boolean {
230
- const distance = el.scrollHeight - el.scrollTop - el.clientHeight;
231
- return distance <= SCROLL_STICKY_THRESHOLD_PX;
321
+ function onConflictOpenChange(isOpen: boolean): void {
322
+ if (!isOpen) changeSetActions.cancelUndo();
232
323
  }
233
324
 
234
- function scrollToBottom(): void {
235
- const el = scrollContainer.value;
236
- if (el === null) return;
237
- el.scrollTop = el.scrollHeight;
325
+ function setDraft(text: string): void {
326
+ composerRef.value?.setDraft(text);
238
327
  }
239
328
 
329
+ const INTENT_HANDLERS: Record<
330
+ PanelIntent["kind"],
331
+ (intent: PanelIntent) => void
332
+ > = {
333
+ open: (intent) => {
334
+ if (intent.kind === "open") switchConversation(intent.conversationId);
335
+ },
336
+ start: (intent) => {
337
+ newConversation();
338
+ if (intent.kind === "start" && intent.prompt)
339
+ void nextTick(() => setDraft(intent.prompt ?? ""));
340
+ else void nextTick(() => composerRef.value?.focus());
341
+ },
342
+ focus: () => void nextTick(() => composerRef.value?.focus()),
343
+ approvals: () => {
344
+ const first = permissions.queue.value[0];
345
+ if (first !== undefined)
346
+ approvalDockRef.value?.focusRequest(first.requestId);
347
+ else openDrawer();
348
+ },
349
+ };
350
+
240
351
  watch(
241
- () => [conversation.messages.value, conversation.isRunning.value],
352
+ () => props.intents.pending.value,
242
353
  () => {
243
- const el = scrollContainer.value;
244
- const sticky = el === null || isNearBottom(el);
245
- if (!sticky) return;
246
- void nextTick(scrollToBottom);
354
+ const intent = props.intents.take();
355
+ if (intent !== null) INTENT_HANDLERS[intent.kind](intent);
247
356
  },
357
+ { immediate: true },
248
358
  );
249
359
 
250
- onMounted(() => {
251
- void nextTick(scrollToBottom);
252
- });
360
+ function isHistoryCombo(event: KeyboardEvent): boolean {
361
+ return (
362
+ (event.metaKey || event.ctrlKey) &&
363
+ !event.shiftKey &&
364
+ event.key.toLowerCase() === HISTORY_KEY
365
+ );
366
+ }
253
367
 
254
- function onComposerSubmit(
255
- content: string,
256
- attachments: PendingAttachment[],
257
- ): void {
258
- conversation.sendUserMessage(content, attachments);
368
+ function onDocumentKeydown(event: KeyboardEvent): void {
369
+ if (!isHistoryCombo(event)) return;
370
+ event.preventDefault();
371
+ if (isDrawerOpen.value) isDrawerOpen.value = false;
372
+ else openDrawer();
259
373
  }
260
374
 
261
- function onComposerStop(): void {
262
- conversation.interrupt();
263
- permissionQueue.clear();
264
- questionQueue.clear();
375
+ function onPanelKeydown(event: KeyboardEvent): void {
376
+ if (event.key !== ESCAPE_KEY || event.defaultPrevented) return;
377
+ if (isDrawerOpen.value) {
378
+ isDrawerOpen.value = false;
379
+ return;
380
+ }
381
+ if (isRunning.value) stopTurn();
265
382
  }
266
383
 
267
- function manualReconnect(): void {
268
- channel.reconnect();
384
+ function refreshListAfterTurn(msg: unknown): void {
385
+ if (!isDrawerOpen.value || msg === null || typeof msg !== "object") return;
386
+ if (Reflect.get(msg, "type") === SERVER_EVENT_TYPES.RUN_DONE) list.refresh();
269
387
  }
270
388
 
271
- function retryLastMessage(): void {
272
- conversation.retry();
389
+ channel.onMessage(refreshListAfterTurn);
390
+
391
+ function isNearBottom(el: HTMLElement): boolean {
392
+ return (
393
+ el.scrollHeight - el.scrollTop - el.clientHeight <=
394
+ SCROLL_STICKY_THRESHOLD_PX
395
+ );
396
+ }
397
+
398
+ function scrollToBottom(): void {
399
+ const el = scrollEl.value;
400
+ if (el !== null) el.scrollTop = el.scrollHeight;
273
401
  }
402
+
403
+ watch(
404
+ () => [conversation.messages.value, isRunning.value],
405
+ () => {
406
+ const el = scrollEl.value;
407
+ if (el === null || isNearBottom(el)) void nextTick(scrollToBottom);
408
+ },
409
+ );
410
+
411
+ // The DMS mounts the panel open on a reload, often before the tab's stream
412
+ // is up: the list (and the chat's title) is asked for again once it is.
413
+ watch(isConnected, (connected) => {
414
+ if (connected) list.refresh();
415
+ });
416
+
417
+ onMounted(() => {
418
+ document.addEventListener("keydown", onDocumentKeydown);
419
+ list.refresh();
420
+ void nextTick(scrollToBottom);
421
+ });
422
+
423
+ // The DMS unmounts the panel's content when the panel closes: the chat is
424
+ // left then, which ends a Full auto granted until the chat closes.
425
+ onBeforeUnmount(() => {
426
+ document.removeEventListener("keydown", onDocumentKeydown);
427
+ leave(activeId.value);
428
+ });
274
429
  </script>
275
430
 
276
431
  <template>
277
- <main class="chat-view">
278
- <header class="chat-view-header">
279
- <span class="chat-view-logo" aria-hidden="true">
280
- <UIcon :name="ASSISTANT_ICON" class="size-[19px]" />
281
- </span>
282
- <div class="chat-view-titlewrap">
283
- <b class="chat-view-title">AntelopeJS Assistant</b>
284
- <span
285
- class="chat-view-status"
286
- :data-connected="channel.isConnected.value"
287
- aria-live="polite"
288
- >
289
- <i class="chat-view-status-dot" />
290
- {{ statusLabel }}
291
- </span>
292
- </div>
293
- <button
294
- type="button"
295
- class="chat-view-ibtn"
296
- :aria-label="TOGGLE_DRAWER_LABEL"
297
- :title="TOGGLE_DRAWER_LABEL"
298
- @click="openDrawer"
299
- >
300
- <UIcon :name="TOGGLE_DRAWER_ICON" class="size-[18px]" />
301
- </button>
302
- <button
303
- type="button"
304
- class="chat-view-ibtn"
305
- :aria-label="OPEN_SETTINGS_LABEL"
306
- :title="OPEN_SETTINGS_LABEL"
307
- @click="openSettingsPage"
308
- >
309
- <UIcon :name="OPEN_SETTINGS_ICON" class="size-[18px]" />
310
- </button>
311
- <button
312
- type="button"
313
- class="chat-view-ibtn"
314
- aria-label="Close"
315
- title="Close"
316
- @click="dismissPanel"
317
- >
318
- <UIcon :name="CLOSE_PANEL_ICON" class="size-[18px]" />
319
- </button>
320
- </header>
321
-
322
- <div class="chat-view-modebar">
323
- <span class="modebar-label">{{ MODE_SECTION_LABEL }}</span>
324
- <USelect
325
- v-model="modeModel"
326
- :items="MODE_OPTIONS"
327
- :portal="false"
328
- :ui="MODE_BAR_SELECT_UI"
329
- variant="ghost"
330
- size="sm"
331
- :title="modeHint"
332
- class="text-primary font-semibold"
333
- />
334
- <span class="modebar-label">{{ PROVIDER_SECTION_LABEL }}</span>
335
- <USelect
336
- v-model="providerModel"
337
- :items="providerItems"
338
- :portal="false"
339
- :ui="MODE_BAR_SELECT_UI"
340
- variant="ghost"
341
- size="sm"
342
- :title="providerHint"
343
- class="text-primary font-semibold"
344
- />
345
- </div>
432
+ <main class="chat-view" @keydown="onPanelKeydown">
433
+ <PanelHeader
434
+ :title="title"
435
+ :status="status"
436
+ :status-label="statusLabel"
437
+ :rules="permissions.rules.value"
438
+ @history="openDrawer"
439
+ @new-chat="newConversation"
440
+ @close="emit('close')"
441
+ @navigate="(target) => navigate(NAVIGATION_TARGETS[target])"
442
+ @revoke-rule="permissions.revokeRule"
443
+ />
346
444
 
347
445
  <ConnectionBanner
348
446
  :status="channel.connectionStatus.value"
349
- @reconnect="manualReconnect"
447
+ :is-reviving="isReviving"
448
+ @reconnect="channel.reconnect"
449
+ />
450
+ <FullAutoBanner
451
+ v-if="mode.current.value.fullAuto"
452
+ :full-auto="mode.current.value.fullAuto"
453
+ :now-ms="nowMs"
454
+ @turn-off="mode.stopFullAuto"
350
455
  />
351
456
 
352
- <section ref="scrollContainer" class="chat-view-body">
457
+ <section
458
+ ref="scrollEl"
459
+ class="chat-view-body"
460
+ :class="{ 'is-dimmed': !isConnected }"
461
+ >
462
+ <ChatEmpty
463
+ v-if="isEmpty"
464
+ :page="page"
465
+ :scope="mode.current.value.generationMode"
466
+ @suggest="setDraft"
467
+ />
353
468
  <MessageList
469
+ v-else
354
470
  :messages="conversation.messages.value"
355
- :is-running="conversation.isRunning.value"
471
+ :change-sets="conversation.changeSets.value"
472
+ :busy-change-set-ids="changeSetActions.busyIds.value"
473
+ :requests="permissions.queue.value"
474
+ :is-running="isRunning"
356
475
  :progress="conversation.progress.value"
357
- :now-ms="runClockMs"
358
- :is-stalled="isRunStalledNow"
359
- :stalled-for-ms="stalledForMs"
360
- @retry="retryLastMessage"
361
- @reconnect="manualReconnect"
362
- @stop="onComposerStop"
476
+ :now-ms="nowMs"
477
+ :is-stalled="isStalled"
478
+ :stalled-for-ms="nowMs - conversation.lastEventAtMs.value"
479
+ @retry="conversation.retry"
480
+ @reconnect="channel.reconnect"
481
+ @stop="stopTurn"
482
+ @focus-request="(id) => approvalDockRef?.focusRequest(id)"
483
+ @undo="changeSetActions.undo"
484
+ @redo="changeSetActions.redo"
485
+ @review="reviewChangeSet"
486
+ @stop-auto-fix="stopAutoFix"
487
+ @ask-again="askAgain"
488
+ @run-plan="runPlan"
489
+ @edit-plan="setDraft(t('dms_ai.panel.plan.edit_prefix'))"
363
490
  />
491
+ <div v-if="providerProblem" class="chat-view-provider">
492
+ <div class="cb-provider" role="alert">
493
+ <UIcon name="i-ph-key" class="cb-provider__icon" />
494
+ <div>
495
+ <b>
496
+ {{
497
+ t("dms_ai.panel.errors.agent_cant_run", { agent: agentName })
498
+ }}
499
+ </b>
500
+ {{ settings.providers[settings.provider]?.reason ?? "" }}
501
+ {{ t("dms_ai.panel.errors.agent_no_fallback") }}
502
+ <div class="cb-provider__row">
503
+ <UButton
504
+ size="xs"
505
+ color="neutral"
506
+ variant="outline"
507
+ icon="i-ph-gear-six"
508
+ :label="t('dms_ai.panel.errors.open_settings')"
509
+ @click="navigate(SETTINGS_PAGE_PATH)"
510
+ />
511
+ </div>
512
+ </div>
513
+ </div>
514
+ </div>
364
515
  </section>
365
516
 
366
- <PermissionRequests
367
- v-if="permissionQueue.queue.value.length > 0"
368
- :requests="permissionQueue.queue.value"
369
- @decide="permissionQueue.respond"
370
- @decide-all="permissionQueue.respondAll"
371
- />
372
-
373
- <QuestionPrompt
374
- v-if="questionQueue.queue.value.length > 0"
375
- :requests="questionQueue.queue.value"
376
- @answer="questionQueue.respond"
377
- />
378
-
379
- <TodoList
380
- v-if="todos.length > 0"
381
- :todos="todos"
382
- :is-running="conversation.isRunning.value"
383
- />
384
-
385
- <QueuedMessages
386
- v-if="conversation.queued.value.length > 0"
387
- :queue="conversation.queued.value"
388
- @cancel="conversation.cancelQueued"
389
- />
390
-
391
- <ComposerInput
392
- :is-disabled="!channel.isConnected.value"
393
- :is-running="conversation.isRunning.value"
394
- :generation-mode="settings.settings.value.generationMode"
395
- :builder-available="settings.settings.value.builderAvailable"
396
- @submit="onComposerSubmit"
397
- @stop="onComposerStop"
398
- @update:generation-mode="(m) => settings.update({ generationMode: m })"
399
- />
517
+ <div class="cb__dock">
518
+ <ApprovalDock
519
+ ref="approvalDockRef"
520
+ :requests="permissions.queue.value"
521
+ :expired="permissions.expired.value"
522
+ :rules="permissions.rules.value"
523
+ :now-ms="nowMs"
524
+ :timeout-minutes="settings.requestTimeoutMinutes"
525
+ @answer="permissions.respond"
526
+ @deny-all="permissions.denyAll"
527
+ @revoke-rule="permissions.revokeRule"
528
+ @ask-again="askAgainExpired"
529
+ @dismiss-expired="permissions.dismissExpired"
530
+ />
531
+ <QuestionDock
532
+ v-if="questions.queue.value[0]"
533
+ :request="questions.queue.value[0]"
534
+ :now-ms="nowMs"
535
+ @respond="answerQuestions"
536
+ />
537
+ <StepsDock
538
+ v-if="todos.length > 0"
539
+ :todos="todos"
540
+ :is-running="isRunning"
541
+ />
542
+ <QueueDock
543
+ v-if="conversation.queued.value.length > 0"
544
+ :queue="conversation.queued.value"
545
+ @cancel="queueActions.cancel"
546
+ @update="queueActions.update"
547
+ @move="queueActions.move"
548
+ @clear="queueActions.clear"
549
+ />
550
+ <Composer
551
+ ref="composerRef"
552
+ :is-disabled="!isConnected || providerProblem"
553
+ :is-running="isRunning"
554
+ :mode="mode.current.value"
555
+ :builder-available="settings.builderAvailable"
556
+ :page="page"
557
+ :usage-label="usageLabel"
558
+ :placeholder="placeholder"
559
+ @submit="submit"
560
+ @stop="stopTurn"
561
+ @set-scope="mode.setScope"
562
+ @set-mode="mode.setMode"
563
+ @start-full-auto="mode.startFullAuto"
564
+ @open-settings="navigate(SETTINGS_PAGE_PATH)"
565
+ />
566
+ </div>
400
567
 
401
568
  <ConversationDrawer
402
- :open="drawerOpen"
403
- :conversations="conversationList.conversations.value"
569
+ :open="isDrawerOpen"
570
+ :conversations="list.conversations.value"
404
571
  :active-id="activeId"
405
572
  :now-ms="nowMs"
406
573
  @select="switchConversation"
407
574
  @delete="deleteConversation"
408
575
  @new="newConversation"
409
- @close="closeDrawer"
576
+ @close="isDrawerOpen = false"
410
577
  />
578
+
579
+ <div v-if="list.pendingDelete.value" class="cb-toast" role="status">
580
+ <UIcon name="i-ph-trash" class="cb-toast__icon" />
581
+ <span class="cb-toast__text">
582
+ {{
583
+ t("dms_ai.panel.drawer.deleted", {
584
+ title: list.pendingDelete.value.title,
585
+ })
586
+ }}
587
+ </span>
588
+ <UButton
589
+ size="xs"
590
+ color="neutral"
591
+ variant="outline"
592
+ :label="t('dms_ai.common.undo')"
593
+ @click="list.undoRemove(list.pendingDelete.value.id)"
594
+ />
595
+ </div>
596
+
597
+ <UModal
598
+ :open="changeSetActions.pendingUndo.value !== null"
599
+ :title="t('dms_ai.panel.change.conflict_title')"
600
+ @update:open="onConflictOpenChange"
601
+ >
602
+ <template #body>
603
+ <p class="chat-view-conflict">
604
+ {{
605
+ t("dms_ai.panel.change.conflict_text", {
606
+ number: changeSetActions.pendingUndo.value?.number ?? 0,
607
+ })
608
+ }}
609
+ </p>
610
+ <ul class="chat-view-conflicts">
611
+ <li
612
+ v-for="conflict in changeSetActions.pendingUndo.value?.conflicts ??
613
+ []"
614
+ :key="conflict.changeSetId"
615
+ >
616
+ <b>#{{ conflict.number }}</b>
617
+ {{ conflict.title }}
618
+ <span>{{ conflict.files.join(", ") }}</span>
619
+ </li>
620
+ </ul>
621
+ </template>
622
+ <template #footer>
623
+ <div class="chat-view-conflict-foot">
624
+ <UButton
625
+ color="neutral"
626
+ variant="ghost"
627
+ :label="t('dms_ai.panel.change.undo_only')"
628
+ @click="changeSetActions.confirmUndo(false)"
629
+ />
630
+ <UButton
631
+ color="secondary"
632
+ :label="t('dms_ai.panel.change.undo_together')"
633
+ @click="changeSetActions.confirmUndo(true)"
634
+ />
635
+ </div>
636
+ </template>
637
+ </UModal>
411
638
  </main>
412
639
  </template>
413
640
 
414
641
  <style scoped>
415
- /*
416
- * The chat's design tokens, aliases of the dashboard's Nuxt UI tokens scoped to
417
- * the chat: it follows the dashboard's theme and light/dark mode as they are.
418
- */
419
- .chat-view {
420
- --accent: var(--ui-primary);
421
- --accent-strong: var(--ui-color-primary-700);
422
- --accent-fg: var(--ui-bg);
423
- --accent-bg: color-mix(in oklab, var(--ui-primary) 10%, transparent);
424
- --accent-bg-strong: color-mix(in oklab, var(--ui-primary) 18%, transparent);
425
- --surface-side: var(--ui-bg);
426
- --surface-card: var(--ui-bg-elevated);
427
- --surface-card-2: var(--ui-bg-elevated);
428
- --surface-inset: var(--ui-bg-muted);
429
- --fg: var(--ui-text-highlighted);
430
- --fg-secondary: var(--ui-text-toned);
431
- --fg-tertiary: var(--ui-text-dimmed);
432
- --hair: var(--ui-border);
433
- --hair-strong: var(--ui-border-accented);
434
- --success-400: var(--ui-color-success-400);
435
- --success-500: var(--ui-color-success-500);
436
- --success-bg: color-mix(
437
- in oklab,
438
- var(--ui-color-success-500) 10%,
439
- transparent
440
- );
441
- --warning-400: var(--ui-color-warning-400);
442
- --warning-bg: color-mix(
443
- in oklab,
444
- var(--ui-color-warning-500) 10%,
445
- transparent
446
- );
447
- --danger-400: var(--ui-color-error-400);
448
- --danger-bg: color-mix(in oklab, var(--ui-color-error-500) 12%, transparent);
449
- --corner-sm: var(--ui-radius);
450
- --corner-md: calc(var(--ui-radius) * 1.5);
451
- --corner-lg: calc(var(--ui-radius) * 2);
452
- --font-code: var(
453
- --font-mono,
454
- ui-monospace,
455
- SFMono-Regular,
456
- Menlo,
457
- Monaco,
458
- Consolas,
459
- "Liberation Mono",
460
- "Courier New",
461
- monospace
462
- );
463
- --dur-fast: 150ms;
464
-
465
- position: relative;
642
+ .chat-view-body {
466
643
  display: flex;
644
+ flex: 1;
467
645
  flex-direction: column;
468
- height: 100%;
469
- font-size: 13px;
470
- background: var(--surface-side);
471
- color: var(--fg);
646
+ min-height: 0;
647
+ overflow-y: auto;
648
+ scrollbar-width: thin;
649
+ transition: opacity 150ms;
472
650
  }
473
651
 
474
- .chat-view,
475
- .chat-view :deep(*) {
476
- scrollbar-width: thin;
477
- scrollbar-color: var(--hair) transparent;
652
+ .chat-view-body.is-dimmed {
653
+ opacity: 0.6;
478
654
  }
479
655
 
480
- .chat-view-header {
656
+ .cb__dock {
657
+ flex: none;
658
+ border-top: 1px solid var(--ui-border);
659
+ background: var(--dms-bg-sidebar);
660
+ }
661
+
662
+ .chat-view-provider {
663
+ padding: 0 14px 16px;
664
+ }
665
+
666
+ .cb-provider {
667
+ display: flex;
668
+ gap: 10px;
669
+ padding: 10px 12px;
670
+ border: 1px solid var(--dms-error-line);
671
+ border-radius: var(--ai-radius-md);
672
+ background: var(--dms-error-tint);
673
+ font-size: 12.5px;
674
+ line-height: 1.5;
675
+ color: var(--ui-text-toned);
676
+ }
677
+
678
+ .cb-provider__icon {
679
+ width: 16px;
680
+ height: 16px;
681
+ flex: none;
682
+ margin-top: 1px;
683
+ color: var(--ui-error);
684
+ }
685
+
686
+ .cb-provider b {
687
+ font-weight: 600;
688
+ color: var(--ui-text-highlighted);
689
+ }
690
+
691
+ .cb-provider__row {
692
+ margin-top: 8px;
693
+ }
694
+
695
+ .cb-toast {
696
+ position: absolute;
697
+ right: 12px;
698
+ bottom: 12px;
699
+ left: 12px;
700
+ z-index: 7;
481
701
  display: flex;
482
702
  align-items: center;
483
- gap: 11px;
484
- padding: 14px 14px 12px;
485
- border-bottom: 1px solid var(--hair);
703
+ gap: 10px;
704
+ padding: 10px 10px 10px 12px;
705
+ border: 1px solid var(--ui-border-accented);
706
+ border-radius: var(--ai-radius-md);
707
+ background: var(--ui-bg-elevated);
708
+ box-shadow: var(--dms-shadow-pop);
709
+ font-size: 12.5px;
486
710
  }
487
711
 
488
- .chat-view-logo {
489
- width: 34px;
490
- height: 34px;
491
- flex: 0 0 auto;
492
- display: grid;
493
- place-items: center;
494
- border-radius: var(--corner-md);
495
- background: var(--accent-bg);
496
- border: 1px solid var(--accent-bg-strong);
497
- color: var(--accent);
712
+ .cb-toast__icon {
713
+ width: 15px;
714
+ height: 15px;
715
+ flex: none;
716
+ color: var(--ui-text-muted);
498
717
  }
499
718
 
500
- .chat-view-titlewrap {
719
+ .cb-toast__text {
501
720
  flex: 1;
502
721
  min-width: 0;
503
722
  }
504
723
 
505
- .chat-view-title {
506
- display: block;
507
- font-size: 15px;
508
- font-weight: 600;
509
- color: var(--fg);
724
+ .chat-view-conflict {
725
+ margin: 0 0 10px;
726
+ font-size: 13px;
727
+ line-height: 1.5;
728
+ color: var(--ui-text-muted);
510
729
  }
511
730
 
512
- .chat-view-status {
513
- display: flex;
514
- align-items: center;
731
+ .chat-view-conflicts {
732
+ display: grid;
515
733
  gap: 6px;
516
- font-size: 11.5px;
517
- margin-top: 2px;
518
- color: var(--fg-tertiary);
734
+ margin: 0;
735
+ padding: 0;
736
+ list-style: none;
737
+ font-size: 12.5px;
519
738
  }
520
739
 
521
- .chat-view-status-dot {
522
- width: 6px;
523
- height: 6px;
524
- border-radius: 50%;
525
- background: var(--fg-tertiary);
740
+ .chat-view-conflicts span {
741
+ display: block;
742
+ font-family: var(--ai-font-mono, ui-monospace, monospace);
743
+ font-size: 11px;
744
+ color: var(--ui-text-muted);
745
+ overflow-wrap: anywhere;
526
746
  }
527
747
 
528
- .chat-view-status[data-connected="true"] {
529
- color: var(--success-400);
748
+ .chat-view-conflict-foot {
749
+ display: flex;
750
+ justify-content: flex-end;
751
+ gap: 8px;
752
+ width: 100%;
530
753
  }
754
+ </style>
531
755
 
532
- .chat-view-status[data-connected="true"] .chat-view-status-dot {
533
- background: var(--success-500);
756
+ <style>
757
+ /*
758
+ * The panel's tokens, aliases of the dashboard's: violet (Nuxt UI
759
+ * `secondary`, tinted by the DMS's assistant tokens) is the AI colour,
760
+ * everything else follows the DMS surfaces in light and dark alike. Shared
761
+ * bits the panel's pieces draw are here too.
762
+ */
763
+ .chat-view,
764
+ .dms-ai-chat-tokens {
765
+ --ai: var(--ui-secondary);
766
+ --ai-tint: var(--dms-assistant-tint);
767
+ --ai-line: var(--dms-assistant-line);
768
+ --ai-bg-hover: var(--ui-bg-elevated);
769
+ --ai-radius-sm: 8px;
770
+ --ai-radius-md: 10px;
771
+ --ai-font-mono: var(
772
+ --font-mono,
773
+ ui-monospace,
774
+ SFMono-Regular,
775
+ Menlo,
776
+ Monaco,
777
+ Consolas,
778
+ "Liberation Mono",
779
+ monospace
780
+ );
534
781
  }
535
782
 
536
- .chat-view-status[data-connected="false"] {
537
- color: var(--danger-400);
783
+ .chat-view {
784
+ position: relative;
785
+ display: flex;
786
+ flex-direction: column;
787
+ height: 100%;
788
+ background: var(--dms-bg-sidebar, var(--ui-bg));
789
+ color: var(--ui-text);
790
+ font-size: 13px;
538
791
  }
539
792
 
540
- .chat-view-status[data-connected="false"] .chat-view-status-dot {
541
- background: var(--danger-400);
793
+ .chat-view .plus,
794
+ .dms-ai-chat-tokens .plus {
795
+ color: var(--ui-success);
796
+ font: 600 11.5px var(--ai-font-mono);
542
797
  }
543
798
 
544
- .chat-view-ibtn {
545
- width: 30px;
546
- height: 30px;
547
- flex: 0 0 auto;
548
- display: grid;
549
- place-items: center;
550
- border: none;
551
- background: transparent;
552
- border-radius: 7px;
553
- color: var(--fg-tertiary);
554
- line-height: 1;
555
- cursor: pointer;
799
+ .chat-view .minus,
800
+ .dms-ai-chat-tokens .minus {
801
+ color: var(--ui-error);
802
+ font: 600 11.5px var(--ai-font-mono);
556
803
  }
557
804
 
558
- .chat-view-ibtn:hover {
559
- background: var(--surface-inset);
560
- color: var(--fg);
805
+ .chat-view .inline-code,
806
+ .dms-ai-chat-tokens .inline-code,
807
+ .chat-view .cb-md code,
808
+ .dms-ai-chat-tokens .cb-md code {
809
+ padding: 1px 5px;
810
+ border-radius: 4px;
811
+ background: var(--ui-bg-accented);
812
+ color: var(--ui-text-highlighted);
813
+ font: 500 12px var(--ai-font-mono);
561
814
  }
562
815
 
563
- .chat-view-modebar {
564
- display: flex;
565
- align-items: center;
566
- gap: 8px;
567
- padding: 9px 14px;
568
- background: var(--surface-inset);
569
- border-bottom: 1px solid var(--hair);
816
+ .chat-view .spin-ai,
817
+ .dms-ai-chat-tokens .spin-ai {
818
+ display: inline-block;
819
+ width: 12px;
820
+ height: 12px;
821
+ flex: none;
822
+ border: 1.5px solid var(--ai);
823
+ border-right-color: transparent;
824
+ border-radius: 50%;
825
+ animation: dms-ai-spin 0.8s linear infinite;
570
826
  }
571
827
 
572
- .modebar-label {
573
- font-size: 11.5px;
574
- color: var(--fg-tertiary);
828
+ @keyframes dms-ai-spin {
829
+ to {
830
+ transform: rotate(360deg);
831
+ }
575
832
  }
576
833
 
577
- .chat-view-body {
578
- flex: 1;
579
- min-height: 0;
580
- overflow-y: auto;
834
+ @media (prefers-reduced-motion: reduce) {
835
+ .chat-view .spin-ai,
836
+ .dms-ai-chat-tokens .spin-ai {
837
+ animation-duration: 2.4s;
838
+ }
581
839
  }
582
840
  </style>