@antelopejs/dms-ai 0.1.5 → 0.2.0

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 (564) hide show
  1. package/README.md +54 -11
  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 +3 -1
  22. package/dist/constants/sidecar.js +4 -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 +14 -0
  27. package/dist/lifecycle/sidecar-owner.js +102 -0
  28. package/dist/lifecycle/sidecar-owner.js.map +1 -0
  29. package/dist/lifecycle/spawn-sidecar.d.ts +1 -0
  30. package/dist/lifecycle/spawn-sidecar.js +59 -145
  31. package/dist/lifecycle/spawn-sidecar.js.map +1 -1
  32. package/dist/lifecycle/terminate-process.d.ts +1 -0
  33. package/dist/lifecycle/terminate-process.js +34 -0
  34. package/dist/lifecycle/terminate-process.js.map +1 -0
  35. package/dist/logging/log-buffer.d.ts +0 -6
  36. package/dist/logging/log-buffer.js +0 -1
  37. package/dist/logging/log-buffer.js.map +1 -1
  38. package/dist/pages/activity/columns.d.ts +2 -0
  39. package/dist/pages/activity/columns.js +103 -0
  40. package/dist/pages/activity/columns.js.map +1 -0
  41. package/dist/pages/activity/page.d.ts +1 -2
  42. package/dist/pages/activity/page.js +79 -44
  43. package/dist/pages/activity/page.js.map +1 -1
  44. package/dist/pages/all.d.ts +1 -0
  45. package/dist/pages/all.js +1 -0
  46. package/dist/pages/all.js.map +1 -1
  47. package/dist/pages/changes/page.d.ts +9 -0
  48. package/dist/pages/changes/page.js +22 -0
  49. package/dist/pages/changes/page.js.map +1 -0
  50. package/dist/pages/meta.d.ts +9 -0
  51. package/dist/pages/meta.js +31 -0
  52. package/dist/pages/meta.js.map +1 -0
  53. package/dist/pages/module.js +9 -5
  54. package/dist/pages/module.js.map +1 -1
  55. package/dist/pages/overview/insights.d.ts +3 -0
  56. package/dist/pages/overview/insights.js +77 -0
  57. package/dist/pages/overview/insights.js.map +1 -0
  58. package/dist/pages/overview/kpis.d.ts +2 -0
  59. package/dist/pages/overview/kpis.js +39 -0
  60. package/dist/pages/overview/kpis.js.map +1 -0
  61. package/dist/pages/overview/page.d.ts +6 -3
  62. package/dist/pages/overview/page.js +19 -62
  63. package/dist/pages/overview/page.js.map +1 -1
  64. package/dist/pages/overview/recent-changes.d.ts +2 -0
  65. package/dist/pages/overview/recent-changes.js +144 -0
  66. package/dist/pages/overview/recent-changes.js.map +1 -0
  67. package/dist/pages/overview/status.d.ts +3 -0
  68. package/dist/pages/overview/status.js +36 -0
  69. package/dist/pages/overview/status.js.map +1 -0
  70. package/dist/pages/settings/availability.d.ts +2 -0
  71. package/dist/pages/settings/availability.js +46 -0
  72. package/dist/pages/settings/availability.js.map +1 -0
  73. package/dist/pages/settings/options.d.ts +10 -0
  74. package/dist/pages/settings/options.js +58 -0
  75. package/dist/pages/settings/options.js.map +1 -0
  76. package/dist/pages/settings/page.d.ts +2 -1
  77. package/dist/pages/settings/page.js +39 -13
  78. package/dist/pages/settings/page.js.map +1 -1
  79. package/dist/pages/settings/sections.d.ts +2 -0
  80. package/dist/pages/settings/sections.js +164 -0
  81. package/dist/pages/settings/sections.js.map +1 -0
  82. package/dist/pages/skills/page.d.ts +2 -1
  83. package/dist/pages/skills/page.js +122 -12
  84. package/dist/pages/skills/page.js.map +1 -1
  85. package/dist/routes/activity-csv.d.ts +2 -0
  86. package/dist/routes/activity-csv.js +42 -0
  87. package/dist/routes/activity-csv.js.map +1 -0
  88. package/dist/routes/activity.d.ts +8 -0
  89. package/dist/routes/activity.js +105 -0
  90. package/dist/routes/activity.js.map +1 -0
  91. package/dist/routes/actor.d.ts +2 -0
  92. package/dist/routes/actor.js +8 -0
  93. package/dist/routes/actor.js.map +1 -0
  94. package/dist/routes/banner.d.ts +3 -0
  95. package/dist/routes/banner.js +9 -0
  96. package/dist/routes/banner.js.map +1 -0
  97. package/dist/routes/builder.js +1 -5
  98. package/dist/routes/builder.js.map +1 -1
  99. package/dist/routes/changes.d.ts +17 -0
  100. package/dist/routes/changes.js +152 -0
  101. package/dist/routes/changes.js.map +1 -0
  102. package/dist/routes/channels.js +2 -1
  103. package/dist/routes/channels.js.map +1 -1
  104. package/dist/routes/index.d.ts +3 -0
  105. package/dist/routes/index.js +3 -0
  106. package/dist/routes/index.js.map +1 -1
  107. package/dist/routes/list-query.d.ts +9 -0
  108. package/dist/routes/list-query.js +34 -0
  109. package/dist/routes/list-query.js.map +1 -0
  110. package/dist/routes/metric-shapes.d.ts +8 -0
  111. package/dist/routes/metric-shapes.js +107 -0
  112. package/dist/routes/metric-shapes.js.map +1 -0
  113. package/dist/routes/metrics.d.ts +5 -48
  114. package/dist/routes/metrics.js +52 -42
  115. package/dist/routes/metrics.js.map +1 -1
  116. package/dist/routes/settings.d.ts +3 -16
  117. package/dist/routes/settings.js +40 -14
  118. package/dist/routes/settings.js.map +1 -1
  119. package/dist/routes/sidecar-results.d.ts +6 -0
  120. package/dist/routes/sidecar-results.js +44 -0
  121. package/dist/routes/sidecar-results.js.map +1 -0
  122. package/dist/routes/skills.d.ts +4 -14
  123. package/dist/routes/skills.js +91 -6
  124. package/dist/routes/skills.js.map +1 -1
  125. package/dist/routes/status-shapes.d.ts +5 -0
  126. package/dist/routes/status-shapes.js +176 -0
  127. package/dist/routes/status-shapes.js.map +1 -0
  128. package/dist/routes/status.d.ts +9 -0
  129. package/dist/routes/status.js +92 -0
  130. package/dist/routes/status.js.map +1 -0
  131. package/dist/routes/undo-confirm.d.ts +3 -0
  132. package/dist/routes/undo-confirm.js +51 -0
  133. package/dist/routes/undo-confirm.js.map +1 -0
  134. package/dist/sidecar/http-client.d.ts +11 -0
  135. package/dist/sidecar/http-client.js +59 -0
  136. package/dist/sidecar/http-client.js.map +1 -0
  137. package/dist/sidecar/index.d.ts +2 -0
  138. package/dist/sidecar/index.js +19 -0
  139. package/dist/sidecar/index.js.map +1 -0
  140. package/dist/sidecar/query.d.ts +3 -0
  141. package/dist/sidecar/query.js +25 -0
  142. package/dist/sidecar/query.js.map +1 -0
  143. package/dist/types/activity.d.ts +31 -0
  144. package/dist/types/activity.js +3 -0
  145. package/dist/types/activity.js.map +1 -0
  146. package/dist/types/changes.d.ts +45 -0
  147. package/dist/types/changes.js +3 -0
  148. package/dist/types/changes.js.map +1 -0
  149. package/dist/types/index.d.ts +5 -0
  150. package/dist/types/index.js +5 -0
  151. package/dist/types/index.js.map +1 -1
  152. package/dist/types/metrics.d.ts +76 -0
  153. package/dist/types/metrics.js +3 -0
  154. package/dist/types/metrics.js.map +1 -0
  155. package/dist/types/skills.d.ts +51 -0
  156. package/dist/types/skills.js +3 -0
  157. package/dist/types/skills.js.map +1 -0
  158. package/dist/types/status.d.ts +16 -0
  159. package/dist/types/status.js +3 -0
  160. package/dist/types/status.js.map +1 -0
  161. package/dist/vocabulary/enumerations.d.ts +9 -0
  162. package/dist/vocabulary/enumerations.js +52 -0
  163. package/dist/vocabulary/enumerations.js.map +1 -0
  164. package/dist/vocabulary/index.d.ts +5 -0
  165. package/dist/vocabulary/index.js +22 -0
  166. package/dist/vocabulary/index.js.map +1 -0
  167. package/dist/vocabulary/keys.d.ts +1 -0
  168. package/dist/vocabulary/keys.js +8 -0
  169. package/dist/vocabulary/keys.js.map +1 -0
  170. package/dist/vocabulary/options.d.ts +7 -0
  171. package/dist/vocabulary/options.js +33 -0
  172. package/dist/vocabulary/options.js.map +1 -0
  173. package/dist/vocabulary/tools.d.ts +7 -0
  174. package/dist/vocabulary/tools.js +99 -0
  175. package/dist/vocabulary/tools.js.map +1 -0
  176. package/dist/vocabulary/types.d.ts +20 -0
  177. package/dist/vocabulary/types.js +3 -0
  178. package/dist/vocabulary/types.js.map +1 -0
  179. package/frontend-vue/app/chat/components/AnswerRecord.vue +95 -0
  180. package/frontend-vue/app/chat/components/ApprovalDock.vue +371 -0
  181. package/frontend-vue/app/chat/components/ChangeSetCard.vue +297 -0
  182. package/frontend-vue/app/chat/components/ChatEmpty.vue +142 -0
  183. package/frontend-vue/app/chat/components/ChatView.vue +664 -406
  184. package/frontend-vue/app/chat/components/Composer.vue +589 -0
  185. package/frontend-vue/app/chat/components/ConnectionBanner.vue +41 -65
  186. package/frontend-vue/app/chat/components/ConversationDrawer.vue +387 -177
  187. package/frontend-vue/app/chat/components/DiffView.vue +131 -0
  188. package/frontend-vue/app/chat/components/FullAutoBanner.vue +76 -0
  189. package/frontend-vue/app/chat/components/FullAutoDialog.vue +103 -0
  190. package/frontend-vue/app/chat/components/MarkdownContent.vue +15 -15
  191. package/frontend-vue/app/chat/components/MessageList.vue +389 -295
  192. package/frontend-vue/app/chat/components/NoticeCard.vue +193 -0
  193. package/frontend-vue/app/chat/components/PanelHeader.vue +242 -0
  194. package/frontend-vue/app/chat/components/PermissionCard.vue +470 -0
  195. package/frontend-vue/app/chat/components/PlanCard.vue +115 -0
  196. package/frontend-vue/app/chat/components/QuestionDock.vue +407 -0
  197. package/frontend-vue/app/chat/components/QueueDock.vue +310 -0
  198. package/frontend-vue/app/chat/components/RulesList.vue +97 -0
  199. package/frontend-vue/app/chat/components/StepsDock.vue +181 -0
  200. package/frontend-vue/app/chat/components/ToolCluster.vue +186 -178
  201. package/frontend-vue/app/chat/components/ToolRow.vue +251 -0
  202. package/frontend-vue/app/chat/components/TurnErrorCard.vue +135 -0
  203. package/frontend-vue/app/chat/composables/conversation-events.ts +404 -0
  204. package/frontend-vue/app/chat/composables/useChangeSetActions.ts +135 -0
  205. package/frontend-vue/app/chat/composables/useChatChannel.ts +11 -3
  206. package/frontend-vue/app/chat/composables/useChatI18n.ts +35 -0
  207. package/frontend-vue/app/chat/composables/useComposerAttachments.ts +111 -0
  208. package/frontend-vue/app/chat/composables/useConversation.ts +149 -651
  209. package/frontend-vue/app/chat/composables/useConversationId.ts +2 -10
  210. package/frontend-vue/app/chat/composables/useConversationList.ts +77 -21
  211. package/frontend-vue/app/chat/composables/useConversationMode.ts +73 -0
  212. package/frontend-vue/app/chat/composables/usePaletteTurn.ts +124 -0
  213. package/frontend-vue/app/chat/composables/usePermissionQueue.ts +211 -34
  214. package/frontend-vue/app/chat/composables/useQuestionQueue.ts +103 -21
  215. package/frontend-vue/app/chat/composables/useQueueActions.ts +55 -0
  216. package/frontend-vue/app/chat/composables/useSettings.ts +17 -34
  217. package/frontend-vue/app/chat/constants/attachments.ts +2 -1
  218. package/frontend-vue/app/chat/constants/conversation.ts +18 -32
  219. package/frontend-vue/app/chat/constants/protocol.ts +25 -2
  220. package/frontend-vue/app/chat/constants/run-status.ts +8 -14
  221. package/frontend-vue/app/chat/constants/settings.ts +5 -47
  222. package/frontend-vue/app/chat/types/conversation.ts +72 -2
  223. package/frontend-vue/app/chat/types/permission.ts +31 -0
  224. package/frontend-vue/app/chat/types/protocol.ts +226 -0
  225. package/frontend-vue/app/chat/types/question.ts +10 -1
  226. package/frontend-vue/app/chat/types/settings.ts +9 -5
  227. package/frontend-vue/app/chat/utils/approval-keyboard.ts +49 -0
  228. package/frontend-vue/app/chat/utils/arrays.ts +10 -0
  229. package/frontend-vue/app/chat/utils/conversation-groups.ts +96 -0
  230. package/frontend-vue/app/chat/utils/conversation-messages.ts +251 -0
  231. package/frontend-vue/app/chat/utils/diff.ts +78 -0
  232. package/frontend-vue/app/chat/utils/format.ts +43 -0
  233. package/frontend-vue/app/chat/utils/markdown.ts +1 -1
  234. package/frontend-vue/app/chat/utils/permission-view.ts +159 -0
  235. package/frontend-vue/app/chat/utils/platform.ts +34 -0
  236. package/frontend-vue/app/chat/utils/queue.ts +18 -0
  237. package/frontend-vue/app/chat/utils/render-items.ts +164 -0
  238. package/frontend-vue/app/chat/utils/run-status.ts +19 -23
  239. package/frontend-vue/app/chat/utils/suggestions.ts +101 -0
  240. package/frontend-vue/app/chat/utils/todos.ts +2 -2
  241. package/frontend-vue/app/chat/utils/tool-lexicon.ts +540 -0
  242. package/frontend-vue/app/chat/utils/tool-state.ts +60 -0
  243. package/frontend-vue/app/components/ActivityDetail.vue +235 -0
  244. package/frontend-vue/app/components/ChangesView.vue +249 -0
  245. package/frontend-vue/app/components/ChatPanel.vue +141 -196
  246. package/frontend-vue/app/components/PaletteAnswer.vue +185 -0
  247. package/frontend-vue/app/components/SkillCard.vue +77 -0
  248. package/frontend-vue/app/components/SkillDetail.vue +188 -0
  249. package/frontend-vue/app/plugins/ai.client.ts +349 -57
  250. package/frontend-vue/app/plugins/side-panel.ts +13 -0
  251. package/frontend-vue/app/runtime/assistant-activity.ts +105 -0
  252. package/frontend-vue/app/runtime/assistant-commands.ts +210 -0
  253. package/frontend-vue/app/runtime/assistant-notifications.ts +181 -0
  254. package/frontend-vue/app/runtime/assistant-session.ts +49 -6
  255. package/frontend-vue/app/runtime/channel-client.ts +3 -6
  256. package/frontend-vue/app/runtime/constants.ts +29 -35
  257. package/frontend-vue/app/runtime/host-commands.ts +4 -4
  258. package/frontend-vue/app/runtime/listeners.ts +1 -1
  259. package/frontend-vue/app/runtime/navigation-complete.ts +1 -1
  260. package/frontend-vue/app/runtime/panel-intents.ts +55 -0
  261. package/frontend-vue/app/runtime/shortcuts.ts +3 -1
  262. package/frontend-vue/app/runtime/sidecar-status.ts +9 -1
  263. package/frontend-vue/app/runtime/stream-holds.ts +24 -0
  264. package/frontend-vue/app/views/ChangeSetPanel.vue +222 -0
  265. package/frontend-vue/app/views/DecisionLabel.vue +30 -0
  266. package/frontend-vue/app/views/DiffView.vue +215 -0
  267. package/frontend-vue/app/views/ResultPill.vue +32 -0
  268. package/frontend-vue/app/views/RowStepper.vue +48 -0
  269. package/frontend-vue/app/views/UnavailableState.vue +66 -0
  270. package/frontend-vue/app/views/composables/useAiRequest.ts +89 -0
  271. package/frontend-vue/app/views/composables/useAssistant.ts +33 -0
  272. package/frontend-vue/app/views/composables/useChangeSetActions.ts +102 -0
  273. package/frontend-vue/app/views/composables/useViewFormat.ts +55 -0
  274. package/frontend-vue/app/views/constants.ts +43 -0
  275. package/frontend-vue/app/views/types.ts +189 -0
  276. package/frontend-vue/app/views/utils/activity.ts +77 -0
  277. package/frontend-vue/app/views/utils/change-sets.ts +44 -0
  278. package/frontend-vue/app/views/utils/diff.ts +98 -0
  279. package/frontend-vue/app/views/utils/moment.ts +92 -0
  280. package/frontend-vue/app/views/utils/skills.ts +27 -0
  281. package/frontend-vue/app/views/utils/tools.ts +73 -0
  282. package/frontend-vue/dms.frontend.ts +17 -5
  283. package/frontend-vue/i18n/locales/dms-ai-pages-en-GB.json +607 -0
  284. package/frontend-vue/i18n/locales/dms-ai-pages-fr-FR.json +607 -0
  285. package/frontend-vue/i18n/locales/dms-ai-panel-en-GB.json +425 -0
  286. package/frontend-vue/i18n/locales/dms-ai-panel-fr-FR.json +425 -0
  287. package/frontend-vue/i18n/locales/dms-ai-views-en-GB.json +142 -0
  288. package/frontend-vue/i18n/locales/dms-ai-views-fr-FR.json +142 -0
  289. package/frontend-vue/package.json +1 -1
  290. package/frontend-vue/tests/chat/conversation-events.test.ts +590 -0
  291. package/frontend-vue/tests/chat/diff-and-keys.test.ts +178 -0
  292. package/frontend-vue/tests/chat/tool-lexicon.test.ts +188 -0
  293. package/frontend-vue/tests/chat/useConversation.test.ts +36 -33
  294. package/frontend-vue/tests/chat-panel.test.ts +78 -131
  295. package/frontend-vue/tests/i18n-panel.test.ts +118 -0
  296. package/frontend-vue/tests/palette-assistant.test.ts +220 -0
  297. package/frontend-vue/tests/panel-states.test.ts +806 -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 +149 -0
  303. package/frontend-vue/tests/views/view-format.test.ts +59 -0
  304. package/package.json +5 -3
  305. package/sidecar/dist/agent/attachment-files.d.ts +0 -1
  306. package/sidecar/dist/agent/attachment-files.js +1 -1
  307. package/sidecar/dist/agent/attachment-files.js.map +1 -1
  308. package/sidecar/dist/agent/call-ledger.d.ts +6 -0
  309. package/sidecar/dist/agent/call-ledger.js +41 -0
  310. package/sidecar/dist/agent/call-ledger.js.map +1 -0
  311. package/sidecar/dist/agent/command-analysis.d.ts +9 -0
  312. package/sidecar/dist/agent/command-analysis.js +104 -0
  313. package/sidecar/dist/agent/command-analysis.js.map +1 -0
  314. package/sidecar/dist/agent/conversation-modes.d.ts +32 -0
  315. package/sidecar/dist/agent/conversation-modes.js +122 -0
  316. package/sidecar/dist/agent/conversation-modes.js.map +1 -0
  317. package/sidecar/dist/agent/edit-targets.d.ts +5 -0
  318. package/sidecar/dist/agent/edit-targets.js +41 -0
  319. package/sidecar/dist/agent/edit-targets.js.map +1 -0
  320. package/sidecar/dist/agent/effective-mode.d.ts +9 -2
  321. package/sidecar/dist/agent/effective-mode.js +14 -16
  322. package/sidecar/dist/agent/effective-mode.js.map +1 -1
  323. package/sidecar/dist/agent/host-context.js +2 -2
  324. package/sidecar/dist/agent/host-context.js.map +1 -1
  325. package/sidecar/dist/agent/line-diff.d.ts +8 -0
  326. package/sidecar/dist/agent/line-diff.js +204 -0
  327. package/sidecar/dist/agent/line-diff.js.map +1 -0
  328. package/sidecar/dist/agent/permission-bus.d.ts +55 -10
  329. package/sidecar/dist/agent/permission-bus.js +130 -100
  330. package/sidecar/dist/agent/permission-bus.js.map +1 -1
  331. package/sidecar/dist/agent/permission-preview.d.ts +20 -0
  332. package/sidecar/dist/agent/permission-preview.js +203 -0
  333. package/sidecar/dist/agent/permission-preview.js.map +1 -0
  334. package/sidecar/dist/agent/permission-rules.d.ts +17 -0
  335. package/sidecar/dist/agent/permission-rules.js +95 -0
  336. package/sidecar/dist/agent/permission-rules.js.map +1 -0
  337. package/sidecar/dist/agent/provider.d.ts +12 -4
  338. package/sidecar/dist/agent/question-bus.d.ts +14 -2
  339. package/sidecar/dist/agent/question-bus.js +30 -11
  340. package/sidecar/dist/agent/question-bus.js.map +1 -1
  341. package/sidecar/dist/agent/runner-events.d.ts +3 -1
  342. package/sidecar/dist/agent/runner.d.ts +6 -4
  343. package/sidecar/dist/agent/runner.js +24 -7
  344. package/sidecar/dist/agent/runner.js.map +1 -1
  345. package/sidecar/dist/agent/switching-runner.js +1 -0
  346. package/sidecar/dist/agent/switching-runner.js.map +1 -1
  347. package/sidecar/dist/agent/tool-kinds.d.ts +12 -0
  348. package/sidecar/dist/agent/tool-kinds.js +50 -0
  349. package/sidecar/dist/agent/tool-kinds.js.map +1 -0
  350. package/sidecar/dist/agent/typecheck.d.ts +2 -6
  351. package/sidecar/dist/audit/activity-query.d.ts +37 -0
  352. package/sidecar/dist/audit/activity-query.js +111 -0
  353. package/sidecar/dist/audit/activity-query.js.map +1 -0
  354. package/sidecar/dist/audit/activity-target.d.ts +2 -0
  355. package/sidecar/dist/audit/activity-target.js +46 -0
  356. package/sidecar/dist/audit/activity-target.js.map +1 -0
  357. package/sidecar/dist/audit/activity.d.ts +45 -0
  358. package/sidecar/dist/audit/activity.js +255 -0
  359. package/sidecar/dist/audit/activity.js.map +1 -0
  360. package/sidecar/dist/audit/call-audit.d.ts +11 -0
  361. package/sidecar/dist/audit/call-audit.js +23 -0
  362. package/sidecar/dist/audit/call-audit.js.map +1 -0
  363. package/sidecar/dist/checkpoints/checkpoints.d.ts +69 -0
  364. package/sidecar/dist/checkpoints/checkpoints.js +244 -0
  365. package/sidecar/dist/checkpoints/checkpoints.js.map +1 -0
  366. package/sidecar/dist/checkpoints/shadow-git.d.ts +23 -0
  367. package/sidecar/dist/checkpoints/shadow-git.js +173 -0
  368. package/sidecar/dist/checkpoints/shadow-git.js.map +1 -0
  369. package/sidecar/dist/constants/agent.d.ts +2 -0
  370. package/sidecar/dist/constants/agent.js +4 -0
  371. package/sidecar/dist/constants/agent.js.map +1 -1
  372. package/sidecar/dist/constants/audit.d.ts +22 -0
  373. package/sidecar/dist/constants/audit.js +49 -0
  374. package/sidecar/dist/constants/audit.js.map +1 -0
  375. package/sidecar/dist/constants/builder.d.ts +3 -0
  376. package/sidecar/dist/constants/builder.js +2 -0
  377. package/sidecar/dist/constants/builder.js.map +1 -1
  378. package/sidecar/dist/constants/checkpoints.d.ts +15 -0
  379. package/sidecar/dist/constants/checkpoints.js +26 -0
  380. package/sidecar/dist/constants/checkpoints.js.map +1 -0
  381. package/sidecar/dist/constants/claude.d.ts +1 -0
  382. package/sidecar/dist/constants/claude.js +1 -0
  383. package/sidecar/dist/constants/claude.js.map +1 -1
  384. package/sidecar/dist/constants/codex.d.ts +2 -4
  385. package/sidecar/dist/constants/codex.js +2 -4
  386. package/sidecar/dist/constants/codex.js.map +1 -1
  387. package/sidecar/dist/constants/http.d.ts +1 -0
  388. package/sidecar/dist/constants/http.js +1 -0
  389. package/sidecar/dist/constants/http.js.map +1 -1
  390. package/sidecar/dist/constants/mcp.d.ts +3 -0
  391. package/sidecar/dist/constants/mcp.js +9 -0
  392. package/sidecar/dist/constants/mcp.js.map +1 -1
  393. package/sidecar/dist/constants/permissions.d.ts +9 -3
  394. package/sidecar/dist/constants/permissions.js +9 -2
  395. package/sidecar/dist/constants/permissions.js.map +1 -1
  396. package/sidecar/dist/constants/settings.d.ts +2 -1
  397. package/sidecar/dist/constants/settings.js +7 -1
  398. package/sidecar/dist/constants/settings.js.map +1 -1
  399. package/sidecar/dist/constants/tool-kinds.d.ts +14 -0
  400. package/sidecar/dist/constants/tool-kinds.js +65 -0
  401. package/sidecar/dist/constants/tool-kinds.js.map +1 -0
  402. package/sidecar/dist/index.d.ts +4 -0
  403. package/sidecar/dist/index.js +35 -5
  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/skills/dms-builder-safe/REFERENCE.md +1 -1
  543. package/skills/dms-builder-safe/SKILL.md +12 -7
  544. package/dist/routes/proxy.d.ts +0 -4
  545. package/dist/routes/proxy.js +0 -55
  546. package/dist/routes/proxy.js.map +0 -1
  547. package/frontend-vue/app/chat/components/ComposerInput.vue +0 -742
  548. package/frontend-vue/app/chat/components/PermissionRequests.vue +0 -323
  549. package/frontend-vue/app/chat/components/QuestionPrompt.vue +0 -275
  550. package/frontend-vue/app/chat/components/QueuedMessages.vue +0 -109
  551. package/frontend-vue/app/chat/components/TodoList.vue +0 -291
  552. package/frontend-vue/app/chat/components/ToolCallEntry.vue +0 -218
  553. package/frontend-vue/app/chat/constants/connection-banner.ts +0 -7
  554. package/frontend-vue/app/chat/constants/conversation-drawer.ts +0 -13
  555. package/frontend-vue/app/chat/constants/permissions.ts +0 -50
  556. package/frontend-vue/app/chat/utils/tool-summary.ts +0 -53
  557. package/frontend-vue/app/components/ActivityView.vue +0 -94
  558. package/frontend-vue/app/components/SettingsView.vue +0 -387
  559. package/frontend-vue/app/components/SkillsView.vue +0 -230
  560. package/frontend-vue/app/runtime/header-action.ts +0 -64
  561. package/frontend-vue/app/runtime/overlay-prefs.ts +0 -89
  562. package/frontend-vue/app/runtime/panel-state.ts +0 -88
  563. package/frontend-vue/tests/overlay-prefs.test.ts +0 -91
  564. package/frontend-vue/tests/panel-state.test.ts +0 -58
@@ -1,50 +1,132 @@
1
1
  import { type Ref, ref } from "vue";
2
- import { CLIENT_MESSAGE_TYPES } from "../constants/protocol";
3
- import type { QuestionRequestData } from "../types/question";
2
+ import {
3
+ CLIENT_MESSAGE_TYPES,
4
+ SERVER_EVENT_TYPES,
5
+ } from "../constants/protocol";
6
+ import type { QuestionAnswerRecord } from "../types/protocol";
7
+ import type {
8
+ QuestionData,
9
+ QuestionReply,
10
+ QuestionRequestData,
11
+ } from "../types/question";
4
12
 
5
13
  export interface UseQuestionQueueOptions {
6
- send: (msg: object) => void;
14
+ activeId: Ref<string>;
15
+ send: (msg: object) => boolean;
16
+ onMessage: (handler: (msg: unknown) => void) => () => void;
7
17
  }
8
18
 
9
19
  export interface UseQuestionQueueResult {
10
20
  queue: Ref<QuestionRequestData[]>;
11
- enqueue: (req: QuestionRequestData) => void;
12
- respond: (requestId: string, answers: string[]) => void;
21
+ /**
22
+ * Sends the replies, one per question. Answers what the transcript keeps of
23
+ * them, or null when nothing was sent.
24
+ */
25
+ respond: (
26
+ requestId: string,
27
+ replies: QuestionReply[],
28
+ ) => QuestionAnswerRecord[] | null;
13
29
  clear: () => void;
14
30
  }
15
31
 
16
- function buildResponseMessage(
32
+ interface AskQuestionWire {
33
+ conversationId: string;
34
+ requestId: string;
35
+ questions: QuestionData[];
36
+ createdAtMs: number;
37
+ expiresAtMs: number;
38
+ }
39
+
40
+ interface RequestIdWire {
41
+ requestId: string;
42
+ }
43
+
44
+ function toRequest(wire: AskQuestionWire): QuestionRequestData {
45
+ return {
46
+ requestId: wire.requestId,
47
+ conversationId: wire.conversationId,
48
+ questions: wire.questions,
49
+ createdAtMs: wire.createdAtMs,
50
+ expiresAtMs: wire.expiresAtMs,
51
+ };
52
+ }
53
+
54
+ /** What the transcript keeps of each answer. */
55
+ function toAnswerRecords(
56
+ questions: readonly QuestionData[],
57
+ replies: readonly QuestionReply[],
58
+ ): QuestionAnswerRecord[] {
59
+ return questions.map((question, index) => {
60
+ const reply = replies[index];
61
+ const isSkipped = reply === undefined || reply.skipped;
62
+ return {
63
+ header: question.header,
64
+ question: question.question,
65
+ answer: isSkipped ? null : reply.answer,
66
+ skipped: isSkipped,
67
+ isCustom: !isSkipped && reply.isCustom,
68
+ };
69
+ });
70
+ }
71
+
72
+ function responseMessage(
17
73
  req: QuestionRequestData,
18
- answers: string[],
74
+ replies: readonly QuestionReply[],
19
75
  ): object {
76
+ const skipped = req.questions.map(
77
+ (_, index) => replies[index]?.skipped ?? true,
78
+ );
20
79
  return {
21
80
  type: CLIENT_MESSAGE_TYPES.QUESTION_RESPONSE,
22
81
  conversationId: req.conversationId,
23
82
  requestId: req.requestId,
24
- answers,
83
+ answers: req.questions.map((_, index) =>
84
+ skipped[index] ? "" : (replies[index]?.answer ?? ""),
85
+ ),
86
+ ...(skipped.some(Boolean) ? { skipped } : {}),
25
87
  };
26
88
  }
27
89
 
90
+ function isForActive(msg: Record<string, unknown>, activeId: string): boolean {
91
+ const id = msg.conversationId;
92
+ return typeof id !== "string" || id === activeId;
93
+ }
94
+
95
+ /**
96
+ * The questions the agent waits on in the active chat. Answering sends the
97
+ * replies and gives back what the transcript keeps of them; a question the
98
+ * sidecar timed out simply leaves.
99
+ */
28
100
  export function useQuestionQueue(
29
101
  options: UseQuestionQueueOptions,
30
102
  ): UseQuestionQueueResult {
31
103
  const queue = ref<QuestionRequestData[]>([]);
32
-
33
- const enqueue = (req: QuestionRequestData): void => {
34
- if (queue.value.some((q) => q.requestId === req.requestId)) return;
35
- queue.value = [...queue.value, req];
104
+ const drop = (requestId: string): void => {
105
+ queue.value = queue.value.filter((req) => req.requestId !== requestId);
36
106
  };
37
107
 
38
- const respond = (requestId: string, answers: string[]): void => {
39
- const target = queue.value.find((q) => q.requestId === requestId);
40
- if (target === undefined) return;
41
- options.send(buildResponseMessage(target, answers));
42
- queue.value = queue.value.filter((q) => q.requestId !== requestId);
43
- };
108
+ options.onMessage((msg) => {
109
+ if (msg === null || typeof msg !== "object") return;
110
+ const event = msg as Record<string, unknown>;
111
+ if (!isForActive(event, options.activeId.value)) return;
112
+ if (event.type === SERVER_EVENT_TYPES.QUESTION_EXPIRED)
113
+ drop((msg as RequestIdWire).requestId);
114
+ if (event.type !== SERVER_EVENT_TYPES.ASK_QUESTION) return;
115
+ const wire = msg as AskQuestionWire;
116
+ if (queue.value.some((req) => req.requestId === wire.requestId)) return;
117
+ queue.value = [...queue.value, toRequest(wire)];
118
+ });
44
119
 
45
- const clear = (): void => {
46
- queue.value = [];
120
+ const respond = (
121
+ requestId: string,
122
+ replies: QuestionReply[],
123
+ ): QuestionAnswerRecord[] | null => {
124
+ const target = queue.value.find((req) => req.requestId === requestId);
125
+ if (target === undefined) return null;
126
+ if (!options.send(responseMessage(target, replies))) return null;
127
+ drop(requestId);
128
+ return toAnswerRecords(target.questions, replies);
47
129
  };
48
130
 
49
- return { queue, enqueue, respond, clear };
131
+ return { queue, respond, clear: () => (queue.value = []) };
50
132
  }
@@ -0,0 +1,55 @@
1
+ import type { Ref } from "vue";
2
+ import { CLIENT_MESSAGE_TYPES } from "../constants/protocol";
3
+ import type { QueuedMessage } from "../types/conversation";
4
+ import { moveItem } from "../utils/queue";
5
+
6
+ export interface UseQueueActionsOptions {
7
+ activeId: Ref<string>;
8
+ queued: Ref<QueuedMessage[]>;
9
+ send: (msg: object) => boolean;
10
+ }
11
+
12
+ export interface UseQueueActionsResult {
13
+ cancel: (id: string) => void;
14
+ update: (id: string, content: string) => void;
15
+ move: (id: string, toIndex: number) => void;
16
+ clear: () => void;
17
+ }
18
+
19
+ /**
20
+ * Edits to the follow-up queue. The sidecar owns it and answers each change
21
+ * with the new `queue_state`; the chat shows the change at once meanwhile.
22
+ */
23
+ export function useQueueActions(
24
+ options: UseQueueActionsOptions,
25
+ ): UseQueueActionsResult {
26
+ const send = (type: string, fields: Record<string, unknown>): boolean =>
27
+ options.send({
28
+ type,
29
+ conversationId: options.activeId.value,
30
+ ...fields,
31
+ });
32
+
33
+ return {
34
+ cancel: (id) => {
35
+ if (!send(CLIENT_MESSAGE_TYPES.QUEUE_CANCEL, { id })) return;
36
+ options.queued.value = options.queued.value.filter(
37
+ (item) => item.id !== id,
38
+ );
39
+ },
40
+ update: (id, content) => {
41
+ if (!send(CLIENT_MESSAGE_TYPES.QUEUE_UPDATE, { id, content })) return;
42
+ options.queued.value = options.queued.value.map((item) =>
43
+ item.id === id ? { ...item, content } : item,
44
+ );
45
+ },
46
+ move: (id, toIndex) => {
47
+ if (!send(CLIENT_MESSAGE_TYPES.QUEUE_MOVE, { id, toIndex })) return;
48
+ options.queued.value = moveItem(options.queued.value, id, toIndex);
49
+ },
50
+ clear: () => {
51
+ if (!send(CLIENT_MESSAGE_TYPES.QUEUE_CLEAR, {})) return;
52
+ options.queued.value = [];
53
+ },
54
+ };
55
+ }
@@ -1,9 +1,6 @@
1
1
  import { type Ref, ref } from "vue";
2
2
  import { DEFAULT_SETTINGS } from "../constants/settings";
3
- import {
4
- CLIENT_MESSAGE_TYPES,
5
- SERVER_EVENT_TYPES,
6
- } from "../constants/protocol";
3
+ import { SERVER_EVENT_TYPES } from "../constants/protocol";
7
4
  import type {
8
5
  AppSettings,
9
6
  ProviderAvailability,
@@ -11,57 +8,43 @@ import type {
11
8
  } from "../types/settings";
12
9
 
13
10
  export interface UseSettingsOptions {
14
- send: (msg: object) => void;
15
11
  onMessage: (handler: (msg: unknown) => void) => () => void;
16
12
  }
17
13
 
18
14
  export interface UseSettingsResult {
19
15
  settings: Ref<AppSettings>;
20
- update: (next: Partial<AppSettings>) => void;
21
16
  }
22
17
 
23
18
  interface SettingsUpdateEvent {
24
19
  type: typeof SERVER_EVENT_TYPES.SETTINGS_UPDATE;
25
- settings: AppSettings;
20
+ settings?: Partial<AppSettings>;
26
21
  builderAvailable?: boolean;
27
22
  providers?: Record<ProviderName, ProviderAvailability>;
28
23
  }
29
24
 
30
- function isObject(value: unknown): value is Record<string, unknown> {
31
- return value !== null && typeof value === "object";
25
+ function isSettingsUpdate(msg: unknown): msg is SettingsUpdateEvent {
26
+ if (msg === null || typeof msg !== "object") return false;
27
+ return Reflect.get(msg, "type") === SERVER_EVENT_TYPES.SETTINGS_UPDATE;
32
28
  }
33
29
 
34
- function getEventType(msg: unknown): string | null {
35
- if (!isObject(msg)) return null;
36
- const t = msg.type;
37
- return typeof t === "string" ? t : null;
30
+ /** The pushed settings over the defaults. */
31
+ function readSettings(event: SettingsUpdateEvent): AppSettings {
32
+ return {
33
+ ...DEFAULT_SETTINGS,
34
+ ...event.settings,
35
+ builderAvailable: event.builderAvailable ?? false,
36
+ providers: event.providers ?? DEFAULT_SETTINGS.providers,
37
+ };
38
38
  }
39
39
 
40
+ /** The sidecar's settings, as it pushes them; the Settings page edits them. */
40
41
  export function useSettings(options: UseSettingsOptions): UseSettingsResult {
41
42
  const settings = ref<AppSettings>({ ...DEFAULT_SETTINGS });
42
43
 
43
44
  options.onMessage((msg: unknown): void => {
44
- if (getEventType(msg) !== SERVER_EVENT_TYPES.SETTINGS_UPDATE) return;
45
- const event = msg as SettingsUpdateEvent;
46
- settings.value = {
47
- ...event.settings,
48
- builderAvailable: event.builderAvailable ?? false,
49
- providers: event.providers ?? DEFAULT_SETTINGS.providers,
50
- };
45
+ if (!isSettingsUpdate(msg)) return;
46
+ settings.value = readSettings(msg);
51
47
  });
52
48
 
53
- const update = (partial: Partial<AppSettings>): void => {
54
- const next: AppSettings = { ...settings.value, ...partial };
55
- settings.value = next;
56
- options.send({
57
- type: CLIENT_MESSAGE_TYPES.SET_SETTINGS,
58
- provider: next.provider,
59
- mode: next.mode,
60
- thinking: next.thinking,
61
- generationMode: next.generationMode,
62
- allowLocalSkills: next.allowLocalSkills,
63
- });
64
- };
65
-
66
- return { settings, update };
49
+ return { settings };
67
50
  }
@@ -13,4 +13,5 @@ export const INLINE_IMAGE_MIME_TYPES = [
13
13
  "image/webp",
14
14
  ] as const;
15
15
 
16
- export const ATTACH_LABEL = "Attach files";
16
+ /** The size limit as the composer states it. */
17
+ export const MAX_ATTACHMENT_MEGABYTES = 25;
@@ -3,6 +3,9 @@ export const MESSAGE_ROLES = {
3
3
  ASSISTANT: "assistant",
4
4
  TOOL: "tool",
5
5
  ERROR: "error",
6
+ NOTICE: "notice",
7
+ CHANGE_SET: "change_set",
8
+ QUESTION_ANSWER: "question_answer",
6
9
  } as const;
7
10
 
8
11
  export const STORED_TOOL_USE_ROLE = "tool_use";
@@ -16,6 +19,13 @@ export const TOOL_STATUS = {
16
19
  } as const;
17
20
 
18
21
  export const TODO_WRITE_TOOL_NAME = "TodoWrite";
22
+ export const EXIT_PLAN_MODE_TOOL_NAME = "ExitPlanMode";
23
+ /** A question asked from the command palette is answered read-only. */
24
+ export const PALETTE_TURN_MODE = {
25
+ mode: "plan",
26
+ generationMode: "safe",
27
+ } as const;
28
+ export const PLAN_ARG_KEY = "plan";
19
29
 
20
30
  export const TODO_STATUS = {
21
31
  PENDING: "pending",
@@ -23,45 +33,18 @@ export const TODO_STATUS = {
23
33
  COMPLETED: "completed",
24
34
  } as const;
25
35
 
26
- export const TODO_PANEL_TITLE = "Plan";
27
-
28
36
  export const STORAGE_CONVERSATION_ID_KEY = "dms-ai-conversation-id";
29
37
 
30
38
  export const SEND_HOTKEY = "Enter";
31
39
  export const NEWLINE_HOTKEY_MODIFIER = "shiftKey";
32
40
 
33
- export const ROLE_LABELS = {
34
- USER: "You",
35
- ASSISTANT: "Assistant",
36
- TOOL: "Tool",
37
- ERROR: "The run did not finish",
41
+ /** Translation keys of the errors the chat itself raises. */
42
+ export const LOCAL_ERROR_KEYS = {
43
+ NOT_SENT: "dms_ai.panel.errors.not_sent",
44
+ RETRY_NEEDS_FILES: "dms_ai.panel.errors.retry_needs_files",
45
+ STOP_NOT_DELIVERED: "dms_ai.panel.errors.stop_not_delivered",
38
46
  } as const;
39
47
 
40
- export const STATUS_LABELS = {
41
- PENDING: "running",
42
- SUCCESS: "success",
43
- ERROR: "error",
44
- } as const;
45
-
46
- /** Shown when a message could not even leave the chat. */
47
- export const NOT_SENT_MESSAGE =
48
- "Your message was not sent: the assistant is not connected. Reconnect, then retry.";
49
-
50
- /** Shown when a retry needs files that only the original message still had. */
51
- export const RETRY_NEEDS_FILES_MESSAGE =
52
- "Attach the files again to retry: they are no longer available after a reload.";
53
-
54
- /** Shown when Stop could not reach the sidecar, so the run is let go locally. */
55
- export const STOP_NOT_DELIVERED_MESSAGE =
56
- "The assistant could not be reached to stop the run. Reconnect to see where it stands.";
57
-
58
- /** Result given to a tool that was still running when its run ended. */
59
- export const TOOL_CUT_SHORT_RESULT = "The run ended before this tool finished.";
60
-
61
- export const RETRY_LABEL = "Retry";
62
-
63
- export const TOOL_CLUSTER_LABEL = "Used";
64
-
65
48
  /**
66
49
  * A live cluster peeks only its most recent rows; the rest hide behind a
67
50
  * reveal.
@@ -73,3 +56,6 @@ export const TOOL_CLUSTER_VISIBLE_LIMIT = 3;
73
56
  * a fast hand-off to the next cluster doesn't flash.
74
57
  */
75
58
  export const TOOL_CLUSTER_COLLAPSE_LINGER_MS = 600;
59
+
60
+ /** How long a deleted conversation can be brought back before it is deleted. */
61
+ export const DELETE_UNDO_MS = 8_000;
@@ -9,13 +9,25 @@ export const CLIENT_MESSAGE_TYPES = {
9
9
  INTERRUPT_TURN: "interrupt_turn",
10
10
  QUEUE_ENQUEUE: "queue_enqueue",
11
11
  QUEUE_CANCEL: "queue_cancel",
12
+ QUEUE_UPDATE: "queue_update",
13
+ QUEUE_MOVE: "queue_move",
14
+ QUEUE_CLEAR: "queue_clear",
15
+ REVOKE_RULE: "revoke_rule",
16
+ SET_CONVERSATION_MODE: "set_conversation_mode",
17
+ LEAVE_CONVERSATION: "leave_conversation",
18
+ STOP_AUTOFIX: "stop_autofix",
19
+ RETRY_TURN: "retry_turn",
20
+ CHANGE_SET_ACTION: "change_set_action",
12
21
  } as const;
13
22
 
14
23
  /**
15
- * Route of the dms-ai Settings page, reached from the chat's cogwheel. Module
16
- * pages live under `/modules/<moduleId>/<slug>`.
24
+ * Pages of the dms-ai module the chat links to. Module pages live under
25
+ * `/modules/<moduleId>/<slug>`.
17
26
  */
18
27
  export const SETTINGS_PAGE_PATH = "/modules/ai/settings";
28
+ export const CHANGES_PAGE_PATH = "/modules/ai/changes";
29
+ export const ACTIVITY_PAGE_PATH = "/modules/ai/activity";
30
+ export const CHANGE_SET_QUERY_KEY = "set";
19
31
 
20
32
  export const SERVER_EVENT_TYPES = {
21
33
  ASSISTANT_MESSAGE_CHUNK: "assistant_message_chunk",
@@ -28,10 +40,18 @@ export const SERVER_EVENT_TYPES = {
28
40
  CONVERSATION_LIST: "conversation_list",
29
41
  SETTINGS_UPDATE: "settings_update",
30
42
  PERMISSION_REQUEST: "permission_request",
43
+ PERMISSION_EXPIRED: "permission_expired",
44
+ PERMISSION_RESOLVED: "permission_resolved",
45
+ RULES_STATE: "rules_state",
31
46
  ASK_QUESTION: "ask_question",
47
+ QUESTION_EXPIRED: "question_expired",
32
48
  QUEUE_STATE: "queue_state",
33
49
  USER_MESSAGE_ECHO: "user_message_echo",
34
50
  RUN_PROGRESS: "run_progress",
51
+ CONVERSATION_MODE: "conversation_mode",
52
+ NOTICE: "notice",
53
+ CHANGE_SET: "change_set",
54
+ USAGE: "usage",
35
55
  } as const;
36
56
 
37
57
  /** The role the chat says hello with. */
@@ -46,3 +66,6 @@ export const CONNECTION_STATUSES = {
46
66
 
47
67
  export type ConnectionStatus =
48
68
  (typeof CONNECTION_STATUSES)[keyof typeof CONNECTION_STATUSES];
69
+
70
+ /** The wire's most a "Suggest a change" text may carry. */
71
+ export const FEEDBACK_MAX_CHARS = 2000;
@@ -10,14 +10,14 @@ export const ACTIVITY_KINDS = {
10
10
  RETRYING: "retrying",
11
11
  } as const;
12
12
 
13
- /** What a running turn shows while the agent works, by reported activity. */
14
- export const ACTIVITY_LABELS: Record<ActivityKind, string> = {
15
- [ACTIVITY_KINDS.THINKING]: "Thinking",
16
- [ACTIVITY_KINDS.RESPONDING]: "Writing the answer",
17
- [ACTIVITY_KINDS.WRITING]: "Preparing",
18
- [ACTIVITY_KINDS.TOOL]: "Running",
19
- [ACTIVITY_KINDS.COMPACTING]: "Compacting the conversation",
20
- [ACTIVITY_KINDS.RETRYING]: "The model is busy, retrying",
13
+ /** Translation key of what a running turn shows, by reported activity. */
14
+ export const ACTIVITY_LABEL_KEYS: Record<ActivityKind, string> = {
15
+ [ACTIVITY_KINDS.THINKING]: "dms_ai.panel.activity.thinking",
16
+ [ACTIVITY_KINDS.RESPONDING]: "dms_ai.panel.activity.responding",
17
+ [ACTIVITY_KINDS.WRITING]: "dms_ai.panel.activity.writing",
18
+ [ACTIVITY_KINDS.TOOL]: "dms_ai.panel.activity.tool",
19
+ [ACTIVITY_KINDS.COMPACTING]: "dms_ai.panel.activity.compacting",
20
+ [ACTIVITY_KINDS.RETRYING]: "dms_ai.panel.activity.retrying",
21
21
  };
22
22
 
23
23
  /** Activities whose detail names a tool, shown with the tool's own label. */
@@ -29,7 +29,6 @@ export const TOOL_DETAIL_ACTIVITIES: readonly ActivityKind[] = [
29
29
  /** Activities during which a silent agent is expected, so never called quiet. */
30
30
  export const SILENT_ACTIVITIES: readonly ActivityKind[] = [ACTIVITY_KINDS.TOOL];
31
31
 
32
- export const DEFAULT_ACTIVITY_LABEL = "Thinking";
33
32
  export const ACTIVITY_ELLIPSIS = "…";
34
33
 
35
34
  /**
@@ -43,8 +42,3 @@ export const STALL_AFTER_MS = 20_000;
43
42
  export const QUIET_NOTICE_AFTER_MS = 60_000;
44
43
 
45
44
  export const RUN_CLOCK_TICK_MS = 1_000;
46
-
47
- export const STALLED_LABEL = "No news from the assistant for";
48
- export const QUIET_LABEL = "no activity for";
49
- export const RECONNECT_LABEL = "Reconnect";
50
- export const STOP_LABEL = "Stop";
@@ -1,4 +1,6 @@
1
- import type { AppSettings, ChatMode, ProviderName } from "../types/settings";
1
+ import type { AppSettings } from "../types/settings";
2
+
3
+ const DEFAULT_REQUEST_TIMEOUT_MINUTES = 5;
2
4
 
3
5
  export const DEFAULT_SETTINGS: AppSettings = {
4
6
  provider: "claude",
@@ -6,55 +8,11 @@ export const DEFAULT_SETTINGS: AppSettings = {
6
8
  thinking: "medium",
7
9
  generationMode: "safe",
8
10
  allowLocalSkills: false,
11
+ notifyRequests: true,
12
+ requestTimeoutMinutes: DEFAULT_REQUEST_TIMEOUT_MINUTES,
9
13
  builderAvailable: false,
10
14
  providers: {
11
15
  claude: { available: true },
12
16
  codex: { available: false },
13
17
  },
14
18
  };
15
-
16
- export const OPEN_SETTINGS_LABEL = "Settings";
17
-
18
- export const MODE_SECTION_LABEL = "Mode";
19
- export const PROVIDER_SECTION_LABEL = "Agent";
20
-
21
- export const PROVIDER_OPTIONS: { value: ProviderName; label: string }[] = [
22
- { value: "claude", label: "Claude" },
23
- { value: "codex", label: "Codex" },
24
- ];
25
-
26
- /**
27
- * Shown in place of the hint when the sidecar reports the provider as
28
- * unavailable, so the reason travels with the greyed-out option.
29
- */
30
- export const PROVIDER_UNAVAILABLE_PREFIX = "Unavailable: ";
31
-
32
- /**
33
- * Sessions belong to the backend that opened them, so a switch tears them down.
34
- * The transcript survives; what the agent remembers of it does not — and that
35
- * is not something to discover after the fact.
36
- */
37
- export const PROVIDER_SWITCH_WARNING =
38
- "Switching agent starts a new session: open conversations lose what the agent remembers of them. Transcripts are kept.";
39
- export const PROVIDER_SWITCH_CONFIRM = `${PROVIDER_SWITCH_WARNING}\n\nSwitch now?`;
40
- export const PROVIDER_BUSY_HINT =
41
- "Stop the current turn before switching agent.";
42
-
43
- export const MODE_OPTIONS: { value: ChatMode; label: string }[] = [
44
- { value: "normal", label: "Normal" },
45
- { value: "acceptEdits", label: "Accept edits" },
46
- { value: "plan", label: "Plan" },
47
- { value: "auto", label: "Auto" },
48
- ];
49
-
50
- export const MODE_HINTS: Record<ChatMode, string> = {
51
- normal: "Ask before each tool action",
52
- acceptEdits: "Auto-accept file edits, ask for the rest",
53
- plan: "Plan only — propose without making changes",
54
- auto: "Auto-approve every tool action",
55
- };
56
-
57
- // Safe mode refuses raw edits whatever the mode, and Auto stops short of
58
- // approving everything there, so the mode hint says so while it is active.
59
- export const SAFE_MODE_MODE_NOTE =
60
- "Safe mode: raw edits and shell commands stay blocked, and Auto still asks before other actions.";
@@ -1,10 +1,31 @@
1
1
  import type { ACTIVITY_KINDS } from "../constants/run-status";
2
2
  import type { PendingAttachment } from "../utils/attachments";
3
+ import type {
4
+ AllowedBy,
5
+ Notice,
6
+ ProviderName,
7
+ QuestionAnswerRecord,
8
+ Scope,
9
+ ToolOutcome,
10
+ } from "./protocol";
3
11
 
4
- export type MessageRole = "user" | "assistant" | "tool" | "error";
5
12
  export type ToolStatus = "pending" | "success" | "error";
6
13
  export type ActivityKind = (typeof ACTIVITY_KINDS)[keyof typeof ACTIVITY_KINDS];
7
14
 
15
+ /**
16
+ * What a tool row shows. `waiting` and `running` are derived by the chat (an
17
+ * open call, with or without a pending request); the rest come from the
18
+ * sidecar's `outcome`.
19
+ */
20
+ export type ToolRowState =
21
+ | "done"
22
+ | "running"
23
+ | "waiting"
24
+ | "denied"
25
+ | "blocked"
26
+ | "failed"
27
+ | "stopped";
28
+
8
29
  /**
9
30
  * A file attached to a user message. `dataUrl` is only present for messages
10
31
  * sent in this session (drives the image thumbnail); after a reload the
@@ -23,6 +44,8 @@ export interface UserMessage {
23
44
  content: string;
24
45
  attachments?: MessageAttachment[];
25
46
  isUnsent?: boolean;
47
+ /** The page the message was sent from, known for messages of this session. */
48
+ pagePath?: string;
26
49
  timestampMs: number;
27
50
  }
28
51
 
@@ -38,7 +61,33 @@ export interface ErrorMessage {
38
61
  id: string;
39
62
  role: "error";
40
63
  content: string;
64
+ /** Set for the chat's own errors: translated at render time. */
65
+ contentKey?: string;
41
66
  isRetryable: boolean;
67
+ /** True when only this tab knows of it: a retry resends locally. */
68
+ isLocal?: boolean;
69
+ timestampMs: number;
70
+ }
71
+
72
+ export interface NoticeMessage {
73
+ id: string;
74
+ role: "notice";
75
+ notice: Notice;
76
+ timestampMs: number;
77
+ }
78
+
79
+ /** Where a turn's change set is drawn: its summary lives in the change set map. */
80
+ export interface ChangeSetMessage {
81
+ id: string;
82
+ role: "change_set";
83
+ changeSetId: string;
84
+ timestampMs: number;
85
+ }
86
+
87
+ export interface QuestionAnswerMessage {
88
+ id: string;
89
+ role: "question_answer";
90
+ answers: QuestionAnswerRecord[];
42
91
  timestampMs: number;
43
92
  }
44
93
 
@@ -63,14 +112,21 @@ export interface ToolCallMessage {
63
112
  args: unknown;
64
113
  result?: unknown;
65
114
  status: ToolStatus;
115
+ outcome?: ToolOutcome;
116
+ allowedBy?: AllowedBy;
117
+ changeSetId?: string;
66
118
  timestampMs: number;
119
+ endedAtMs?: number;
67
120
  }
68
121
 
69
122
  export type ConversationMessage =
70
123
  | UserMessage
71
124
  | AssistantMessage
72
125
  | ToolCallMessage
73
- | ErrorMessage;
126
+ | ErrorMessage
127
+ | NoticeMessage
128
+ | ChangeSetMessage
129
+ | QuestionAnswerMessage;
74
130
 
75
131
  export interface QueuedMessage {
76
132
  id: string;
@@ -84,4 +140,18 @@ export interface ConversationSummary {
84
140
  createdAtMs: number;
85
141
  updatedAtMs: number;
86
142
  messageCount: number;
143
+ provider?: ProviderName;
144
+ totalTokens?: number;
145
+ filesChanged?: number;
146
+ filesUndone?: number;
147
+ isRunning?: boolean;
148
+ pendingApprovals?: number;
149
+ pendingQuestions?: number;
150
+ generationMode?: Scope;
151
+ }
152
+
153
+ /** The page the dashboard shows, which the composer's chip names. */
154
+ export interface CurrentPage {
155
+ path: string;
156
+ title?: string;
87
157
  }