@adecore/agents-react 0.31.12 → 0.32.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 (402) hide show
  1. package/dist/agents/AccountDot.js +57 -6
  2. package/dist/agents/AgentIcon.js +88 -12
  3. package/dist/agents/ModelOptionControl.js +153 -18
  4. package/dist/agents/ProviderLogo.js +49 -4
  5. package/dist/agents/account-limits.js +17 -14
  6. package/dist/agents/accounts.js +99 -67
  7. package/dist/agents/agent-marks.js +5 -3
  8. package/dist/agents/model-name.js +42 -31
  9. package/dist/agents/model-options.js +8 -8
  10. package/dist/agents/model-requirement.js +17 -14
  11. package/dist/agents/option-words.d.ts +7 -0
  12. package/dist/agents/option-words.js +35 -0
  13. package/dist/agents/provider-paths.js +6 -6
  14. package/dist/agents/status-look.js +32 -12
  15. package/dist/chat/account-choice.d.ts +13 -0
  16. package/dist/chat/account-choice.js +90 -20
  17. package/dist/chat/actions.js +126 -59
  18. package/dist/chat/activity.js +5 -5
  19. package/dist/chat/attachments.js +74 -53
  20. package/dist/chat/bookmarks.js +58 -48
  21. package/dist/chat/chat-client.js +344 -263
  22. package/dist/chat/chat-references.js +3 -3
  23. package/dist/chat/composer-effort.d.ts +5 -0
  24. package/dist/chat/composer-effort.js +26 -0
  25. package/dist/chat/composer-send.js +13 -13
  26. package/dist/chat/drafts.js +115 -79
  27. package/dist/chat/forks.js +81 -24
  28. package/dist/chat/guards.js +15 -43
  29. package/dist/chat/index.d.ts +3 -1
  30. package/dist/chat/index.js +3 -2
  31. package/dist/chat/logic/ansi.js +170 -167
  32. package/dist/chat/logic/answers.js +2 -2
  33. package/dist/chat/logic/bookmarks.js +19 -19
  34. package/dist/chat/logic/command-looks.js +138 -96
  35. package/dist/chat/logic/context-usage.js +13 -9
  36. package/dist/chat/logic/continue-after-stop.js +15 -19
  37. package/dist/chat/logic/effort.d.ts +14 -0
  38. package/dist/chat/logic/effort.js +34 -0
  39. package/dist/chat/logic/embedded-code.js +387 -326
  40. package/dist/chat/logic/fork.js +134 -110
  41. package/dist/chat/logic/generated-image.js +54 -23
  42. package/dist/chat/logic/goal.js +28 -20
  43. package/dist/chat/logic/handback.js +6 -6
  44. package/dist/chat/logic/json.js +2 -2
  45. package/dist/chat/logic/limit.js +46 -30
  46. package/dist/chat/logic/picker-entries.d.ts +5 -3
  47. package/dist/chat/logic/picker-entries.js +83 -43
  48. package/dist/chat/logic/resume-compaction.d.ts +14 -1
  49. package/dist/chat/logic/resume-compaction.js +93 -24
  50. package/dist/chat/logic/scrubber.js +188 -136
  51. package/dist/chat/logic/thought.js +13 -16
  52. package/dist/chat/logic/thread-cards.js +60 -48
  53. package/dist/chat/logic/timeline-copy.js +30 -38
  54. package/dist/chat/logic/timeline-target.js +92 -63
  55. package/dist/chat/logic/timeline.js +499 -355
  56. package/dist/chat/logic/tool-catalog.js +54 -34
  57. package/dist/chat/logic/tools.js +106 -82
  58. package/dist/chat/logic/visual-height.js +18 -18
  59. package/dist/chat/logic/visual-viewport.js +6 -3
  60. package/dist/chat/logic/welcome.js +9 -9
  61. package/dist/chat/logic/workflow.js +45 -34
  62. package/dist/chat/mentions.js +149 -109
  63. package/dist/chat/persisted-json.js +51 -54
  64. package/dist/chat/preferences.d.ts +4 -0
  65. package/dist/chat/preferences.js +162 -84
  66. package/dist/chat/prompt-hold.js +9 -9
  67. package/dist/chat/quote.js +21 -30
  68. package/dist/chat/reading-width.js +12 -10
  69. package/dist/chat/recent-messages.js +34 -21
  70. package/dist/chat/resume-compaction-dismissals.js +25 -5
  71. package/dist/chat/runtime-modes.js +3 -3
  72. package/dist/chat/send-key.js +11 -7
  73. package/dist/chat/stash.js +89 -69
  74. package/dist/chat/subagent-conversation.js +181 -139
  75. package/dist/chat/subagent-list.js +65 -67
  76. package/dist/chat/subagent-support.js +12 -7
  77. package/dist/chat/subagent-view.js +132 -44
  78. package/dist/chat/thumbnails.js +88 -60
  79. package/dist/chat/timeline-flash.js +24 -12
  80. package/dist/chat/timeline-scroll.js +116 -86
  81. package/dist/chat/ui/AccountPill.js +126 -15
  82. package/dist/chat/ui/AnsiOutput.js +62 -6
  83. package/dist/chat/ui/BookmarkMarker.js +231 -41
  84. package/dist/chat/ui/BookmarkSubmenu.js +165 -18
  85. package/dist/chat/ui/ChatActivity.js +649 -70
  86. package/dist/chat/ui/ChatReferenceChip.js +104 -9
  87. package/dist/chat/ui/CodeBlock.js +132 -58
  88. package/dist/chat/ui/Composer.js +866 -132
  89. package/dist/chat/ui/ComposerInput.js +309 -120
  90. package/dist/chat/ui/DiffPool.js +75 -14
  91. package/dist/chat/ui/EditDiff.js +160 -21
  92. package/dist/chat/ui/FadingWords.js +32 -3
  93. package/dist/chat/ui/GoalDock.js +235 -42
  94. package/dist/chat/ui/ImageView.js +617 -61
  95. package/dist/chat/ui/LimitState.js +446 -72
  96. package/dist/chat/ui/Markdown.js +991 -173
  97. package/dist/chat/ui/MermaidBlock.js +238 -68
  98. package/dist/chat/ui/MessageActions.js +251 -39
  99. package/dist/chat/ui/ModelMarks.js +55 -5
  100. package/dist/chat/ui/Pickers.js +664 -113
  101. package/dist/chat/ui/PromptComposer.js +281 -51
  102. package/dist/chat/ui/QuoteButton.js +151 -57
  103. package/dist/chat/ui/ResumeCompactionDock.d.ts +6 -2
  104. package/dist/chat/ui/ResumeCompactionDock.js +141 -6
  105. package/dist/chat/ui/RowTime.js +59 -5
  106. package/dist/chat/ui/RunSettings.js +1744 -154
  107. package/dist/chat/ui/Scrubber.js +517 -88
  108. package/dist/chat/ui/ShellCommand.js +183 -107
  109. package/dist/chat/ui/SubagentControls.js +212 -24
  110. package/dist/chat/ui/SubagentInfo.js +170 -13
  111. package/dist/chat/ui/SubagentStopButton.js +115 -24
  112. package/dist/chat/ui/SubagentTimeline.js +357 -91
  113. package/dist/chat/ui/Timeline.js +988 -476
  114. package/dist/chat/ui/TimelineMenu.js +552 -37
  115. package/dist/chat/ui/UnifiedDiff.js +234 -27
  116. package/dist/chat/ui/UploadThumb.js +37 -7
  117. package/dist/chat/ui/VisualDialogs.js +251 -20
  118. package/dist/chat/ui/VisualFrame.js +321 -95
  119. package/dist/chat/ui/Welcome.js +72 -7
  120. package/dist/chat/ui/chips.js +1 -1
  121. package/dist/chat/ui/code-lines.js +36 -36
  122. package/dist/chat/ui/code-streaming.js +1 -1
  123. package/dist/chat/ui/code-theme.js +7 -7
  124. package/dist/chat/ui/composer/ComposerControls.js +329 -21
  125. package/dist/chat/ui/composer/ComposerMenu.js +358 -30
  126. package/dist/chat/ui/composer/DraftParts.js +185 -11
  127. package/dist/chat/ui/composer/QueuedMessages.js +138 -13
  128. package/dist/chat/ui/composer/chips.js +29 -19
  129. package/dist/chat/ui/composer/editor.js +79 -63
  130. package/dist/chat/ui/composer/insert.js +26 -12
  131. package/dist/chat/ui/composer/key-handler.js +180 -127
  132. package/dist/chat/ui/composer/keys.js +90 -73
  133. package/dist/chat/ui/composer/menu-aria.js +18 -9
  134. package/dist/chat/ui/composer/placeholder.js +78 -31
  135. package/dist/chat/ui/composer/surface.js +13 -37
  136. package/dist/chat/ui/composer/use-chat-controls.js +230 -90
  137. package/dist/chat/ui/composer/use-compaction-offer.js +50 -18
  138. package/dist/chat/ui/composer/use-composer-draft.js +65 -34
  139. package/dist/chat/ui/composer/use-composer-menus.js +478 -193
  140. package/dist/chat/ui/composer/use-composer-submit.js +251 -109
  141. package/dist/chat/ui/composer/use-continuable-turn.js +33 -6
  142. package/dist/chat/ui/composer/use-draft-files.js +245 -93
  143. package/dist/chat/ui/composer/use-effort-stepper.d.ts +13 -0
  144. package/dist/chat/ui/composer/use-effort-stepper.js +88 -0
  145. package/dist/chat/ui/composer/use-notice.js +61 -16
  146. package/dist/chat/ui/composer/use-pending-requests.js +38 -17
  147. package/dist/chat/ui/composer/use-prompt-history.js +117 -45
  148. package/dist/chat/ui/composer/use-prompt-hold.js +119 -35
  149. package/dist/chat/ui/composer/use-take-back.js +94 -72
  150. package/dist/chat/ui/diff/ApprovalReview.js +101 -23
  151. package/dist/chat/ui/diff/DiffFallbackBoundary.js +21 -13
  152. package/dist/chat/ui/diff/DiffOmitted.js +56 -6
  153. package/dist/chat/ui/diff/DiffStack.js +92 -8
  154. package/dist/chat/ui/diff/DiffUnavailable.js +56 -6
  155. package/dist/chat/ui/diff/EditorEditDiff.js +263 -51
  156. package/dist/chat/ui/diff/EditorPatchDiff.js +39 -14
  157. package/dist/chat/ui/diff/LegacyDiffPool.js +27 -10
  158. package/dist/chat/ui/diff/LegacyEditDiff.js +97 -20
  159. package/dist/chat/ui/diff/LegacyUnifiedDiff.js +172 -42
  160. package/dist/chat/ui/diff/RawDiff.js +65 -5
  161. package/dist/chat/ui/diff/ReviewDiff.js +77 -5
  162. package/dist/chat/ui/diff/diff-props.js +1 -1
  163. package/dist/chat/ui/diff/diff-source-budget.js +46 -35
  164. package/dist/chat/ui/diff/editor-edit-model.js +18 -14
  165. package/dist/chat/ui/diff/review-plan.js +63 -40
  166. package/dist/chat/ui/diff/review-settle.js +24 -9
  167. package/dist/chat/ui/diff/syntax-runtime.js +236 -201
  168. package/dist/chat/ui/diff/use-review-stack.js +146 -25
  169. package/dist/chat/ui/diff-syntax.js +70 -58
  170. package/dist/chat/ui/diff-theme.js +31 -12
  171. package/dist/chat/ui/file-links.js +39 -10
  172. package/dist/chat/ui/find-reveal.js +29 -8
  173. package/dist/chat/ui/full-diff.js +17 -12
  174. package/dist/chat/ui/highlighter.js +143 -113
  175. package/dist/chat/ui/icons.js +16 -7
  176. package/dist/chat/ui/index.js +1 -1
  177. package/dist/chat/ui/intelligent-ui/UiBlockFrame.js +556 -82
  178. package/dist/chat/ui/intelligent-ui/UiFallbackPart.js +73 -5
  179. package/dist/chat/ui/intelligent-ui/UiReply.js +666 -262
  180. package/dist/chat/ui/intelligent-ui/block-local.js +59 -31
  181. package/dist/chat/ui/intelligent-ui/chart-data.js +77 -67
  182. package/dist/chat/ui/intelligent-ui/node-text.js +77 -91
  183. package/dist/chat/ui/intelligent-ui/registry.js +46 -46
  184. package/dist/chat/ui/intelligent-ui/render-context.js +1 -1
  185. package/dist/chat/ui/intelligent-ui/renderers/base-land.js +1 -1
  186. package/dist/chat/ui/intelligent-ui/renderers/binding.js +3 -3
  187. package/dist/chat/ui/intelligent-ui/renderers/chart.js +1223 -123
  188. package/dist/chat/ui/intelligent-ui/renderers/choices.js +312 -34
  189. package/dist/chat/ui/intelligent-ui/renderers/content.js +1241 -86
  190. package/dist/chat/ui/intelligent-ui/renderers/data.js +619 -54
  191. package/dist/chat/ui/intelligent-ui/renderers/inputs.js +868 -67
  192. package/dist/chat/ui/intelligent-ui/renderers/links.js +366 -62
  193. package/dist/chat/ui/intelligent-ui/renderers/map-slots.js +118 -60
  194. package/dist/chat/ui/intelligent-ui/renderers/map-style.js +85 -78
  195. package/dist/chat/ui/intelligent-ui/renderers/map-view.js +282 -217
  196. package/dist/chat/ui/intelligent-ui/renderers/map.js +621 -69
  197. package/dist/chat/ui/intelligent-ui/renderers/place-point.js +15 -8
  198. package/dist/chat/ui/intelligent-ui/renderers/structure.js +262 -20
  199. package/dist/chat/ui/intelligent-ui/renderers/text.js +674 -49
  200. package/dist/chat/ui/intelligent-ui/reply-parts.js +24 -15
  201. package/dist/chat/ui/intelligent-ui/table-data.js +97 -57
  202. package/dist/chat/ui/intelligent-ui/tones.js +31 -31
  203. package/dist/chat/ui/intelligent-ui/use-in-view.js +30 -12
  204. package/dist/chat/ui/intelligent-ui/use-later.js +28 -13
  205. package/dist/chat/ui/intelligent-ui/use-truncated.js +45 -21
  206. package/dist/chat/ui/intelligent-ui/use-ui-links.js +296 -109
  207. package/dist/chat/ui/intelligent-ui/use-ui-queries.js +256 -246
  208. package/dist/chat/ui/markdown-blocks.js +296 -262
  209. package/dist/chat/ui/mermaid.js +60 -72
  210. package/dist/chat/ui/quote-selection.js +32 -29
  211. package/dist/chat/ui/rehype-chips.js +35 -23
  212. package/dist/chat/ui/rehype-fade.js +28 -17
  213. package/dist/chat/ui/remark-html-as-text.js +22 -15
  214. package/dist/chat/ui/reply-context.js +1 -1
  215. package/dist/chat/ui/reveal.js +161 -72
  216. package/dist/chat/ui/rows/ForksRow.js +226 -24
  217. package/dist/chat/ui/rows/GeneratedImageRow.js +541 -87
  218. package/dist/chat/ui/rows/MessageRows.js +1706 -159
  219. package/dist/chat/ui/rows/RowContainer.js +57 -7
  220. package/dist/chat/ui/rows/Rows.js +463 -54
  221. package/dist/chat/ui/rows/SubagentRow.js +577 -60
  222. package/dist/chat/ui/rows/TaskRow.js +359 -40
  223. package/dist/chat/ui/rows/VisualRow.js +233 -11
  224. package/dist/chat/ui/rows/WorkRows.js +1945 -164
  225. package/dist/chat/ui/rows/WorkflowRow.js +293 -34
  226. package/dist/chat/ui/rows/row-rhythm.js +27 -17
  227. package/dist/chat/ui/theme-watch.js +26 -23
  228. package/dist/chat/ui/timestamp-format.js +4 -1
  229. package/dist/chat/ui/use-diff-source-tokens.js +70 -34
  230. package/dist/chat/ui/useToggleSet.js +51 -19
  231. package/dist/chat/ui/visual-theme.js +153 -128
  232. package/dist/chat/visual-bridge.js +123 -123
  233. package/dist/chat/visual-viewport.js +94 -83
  234. package/dist/chat/visuals.js +13 -5
  235. package/dist/host-hooks.d.ts +29 -0
  236. package/dist/host-hooks.js +78 -0
  237. package/dist/host.js +120 -48
  238. package/dist/index.js +1 -1
  239. package/dist/lazy.js +38 -32
  240. package/dist/locales/en/agent-chat.d.ts +34 -0
  241. package/dist/locales/en/agent-chat.js +747 -713
  242. package/dist/locales/en/agent-prompts.js +42 -42
  243. package/dist/locales/en/agent-providers.d.ts +1 -0
  244. package/dist/locales/en/agent-providers.js +166 -165
  245. package/dist/locales/en/agent-usage.d.ts +6 -0
  246. package/dist/locales/en/agent-usage.js +129 -123
  247. package/dist/locales/nl/agent-chat.d.ts +34 -0
  248. package/dist/locales/nl/agent-chat.js +747 -713
  249. package/dist/locales/nl/agent-prompts.js +42 -42
  250. package/dist/locales/nl/agent-providers.d.ts +1 -0
  251. package/dist/locales/nl/agent-providers.js +166 -165
  252. package/dist/locales/nl/agent-usage.d.ts +6 -0
  253. package/dist/locales/nl/agent-usage.js +129 -123
  254. package/dist/locales.js +14 -14
  255. package/dist/mounted-registry.js +31 -30
  256. package/dist/port-transport.js +122 -111
  257. package/dist/prompts/index.js +1 -1
  258. package/dist/prompts/logic/focus.js +15 -14
  259. package/dist/prompts/logic/keys.js +93 -59
  260. package/dist/prompts/logic/prompts.js +27 -14
  261. package/dist/prompts/logic/subjects.js +60 -46
  262. package/dist/prompts/logic/useFocusAfterAnswer.js +60 -20
  263. package/dist/prompts/logic/usePromptSession.js +88 -77
  264. package/dist/prompts/ui/ApprovalBody.js +246 -27
  265. package/dist/prompts/ui/PromptActions.js +215 -9
  266. package/dist/prompts/ui/PromptCard.js +215 -36
  267. package/dist/prompts/ui/PromptView.js +372 -34
  268. package/dist/prompts/ui/QuestionBody.js +269 -73
  269. package/dist/providers/AccountColors.js +36 -5
  270. package/dist/providers/AccountDetail.js +683 -50
  271. package/dist/providers/AccountVariables.js +139 -32
  272. package/dist/providers/AddAccountForm.js +125 -38
  273. package/dist/providers/CliDetail.js +343 -36
  274. package/dist/providers/InstallPage.js +644 -59
  275. package/dist/providers/ProviderList.d.ts +2 -1
  276. package/dist/providers/ProviderList.js +215 -23
  277. package/dist/providers/ProvidersPane.d.ts +4 -2
  278. package/dist/providers/ProvidersPane.js +244 -64
  279. package/dist/providers/account-actions.js +54 -30
  280. package/dist/providers/index.js +1 -1
  281. package/dist/providers/install-steps.js +12 -9
  282. package/dist/providers/pane-target.d.ts +3 -0
  283. package/dist/providers/pane-target.js +34 -13
  284. package/dist/providers/parts.js +62 -12
  285. package/dist/providers/provider-abilities.js +5 -5
  286. package/dist/providers/provider-groups.js +75 -40
  287. package/dist/providers/variables.js +73 -39
  288. package/dist/scope.js +6 -6
  289. package/dist/settings/sections.js +18 -18
  290. package/dist/state/chats.js +404 -192
  291. package/dist/state/index.js +1 -1
  292. package/dist/state/provider-accounts.js +70 -47
  293. package/dist/state/providers.js +45 -16
  294. package/dist/state/usage.js +154 -77
  295. package/dist/storage.js +69 -68
  296. package/dist/testing/index.js +1 -1
  297. package/dist/testing/prompts.js +105 -67
  298. package/dist/transport.js +10 -10
  299. package/dist/ui/PlainTextarea.js +27 -3
  300. package/dist/usage/LimitsList.js +646 -40
  301. package/dist/usage/UsageBreakdown.js +879 -38
  302. package/dist/usage/UsageChart.js +311 -32
  303. package/dist/usage/UsageDialog.js +46 -4
  304. package/dist/usage/UsageLimits.js +467 -34
  305. package/dist/usage/UsageLimitsCard.js +95 -11
  306. package/dist/usage/UsagePage.js +817 -96
  307. package/dist/usage/UsagePane.js +164 -10
  308. package/dist/usage/UsageSummary.js +151 -6
  309. package/dist/usage/UsageTiles.js +164 -14
  310. package/dist/usage/format.js +32 -32
  311. package/dist/usage/index.d.ts +1 -1
  312. package/dist/usage/index.js +2 -1
  313. package/dist/usage/limit-groups.d.ts +2 -0
  314. package/dist/usage/limit-groups.js +77 -59
  315. package/dist/usage/limits.js +78 -43
  316. package/dist/usage/money.js +20 -4
  317. package/dist/usage/summary.js +85 -64
  318. package/package.json +8 -8
  319. package/src/agents/ModelOptionControl.tsx +3 -1
  320. package/src/agents/option-words.ts +27 -0
  321. package/src/chat/account-choice.ts +41 -1
  322. package/src/chat/composer-effort.ts +32 -0
  323. package/src/chat/forks.ts +4 -5
  324. package/src/chat/index.ts +3 -1
  325. package/src/chat/logic/effort.ts +32 -0
  326. package/src/chat/logic/picker-entries.ts +45 -10
  327. package/src/chat/logic/resume-compaction.ts +95 -17
  328. package/src/chat/logic/timeline.ts +11 -3
  329. package/src/chat/preferences.ts +35 -0
  330. package/src/chat/subagent-view.ts +2 -3
  331. package/src/chat/ui/AnsiOutput.tsx +1 -2
  332. package/src/chat/ui/BookmarkSubmenu.tsx +3 -3
  333. package/src/chat/ui/ChatActivity.tsx +14 -22
  334. package/src/chat/ui/ChatReferenceChip.tsx +2 -3
  335. package/src/chat/ui/Composer.tsx +15 -7
  336. package/src/chat/ui/EditDiff.tsx +2 -3
  337. package/src/chat/ui/LimitState.tsx +2 -2
  338. package/src/chat/ui/Markdown.tsx +10 -8
  339. package/src/chat/ui/MermaidBlock.tsx +2 -3
  340. package/src/chat/ui/Pickers.tsx +49 -29
  341. package/src/chat/ui/PromptComposer.tsx +7 -9
  342. package/src/chat/ui/ResumeCompactionDock.tsx +16 -4
  343. package/src/chat/ui/RunSettings.tsx +67 -28
  344. package/src/chat/ui/Scrubber.tsx +3 -3
  345. package/src/chat/ui/ShellCommand.tsx +2 -0
  346. package/src/chat/ui/SubagentInfo.tsx +2 -3
  347. package/src/chat/ui/SubagentTimeline.tsx +12 -16
  348. package/src/chat/ui/Timeline.tsx +6 -6
  349. package/src/chat/ui/UnifiedDiff.tsx +3 -4
  350. package/src/chat/ui/VisualFrame.tsx +5 -8
  351. package/src/chat/ui/code-theme.ts +4 -4
  352. package/src/chat/ui/composer/placeholder.ts +2 -2
  353. package/src/chat/ui/composer/use-compaction-offer.ts +36 -16
  354. package/src/chat/ui/composer/use-composer-menus.ts +4 -9
  355. package/src/chat/ui/composer/use-composer-submit.ts +2 -1
  356. package/src/chat/ui/composer/use-effort-stepper.ts +56 -0
  357. package/src/chat/ui/composer/use-notice.ts +2 -2
  358. package/src/chat/ui/diff/EditorEditDiff.tsx +9 -13
  359. package/src/chat/ui/diff/LegacyEditDiff.tsx +12 -17
  360. package/src/chat/ui/diff/LegacyUnifiedDiff.tsx +13 -21
  361. package/src/chat/ui/diff/use-review-stack.ts +4 -4
  362. package/src/chat/ui/diff-theme.ts +3 -3
  363. package/src/chat/ui/file-links.ts +2 -2
  364. package/src/chat/ui/intelligent-ui/UiReply.tsx +2 -0
  365. package/src/chat/ui/intelligent-ui/renderers/chart.tsx +3 -3
  366. package/src/chat/ui/intelligent-ui/renderers/content.tsx +5 -6
  367. package/src/chat/ui/intelligent-ui/renderers/map-view.tsx +2 -1
  368. package/src/chat/ui/intelligent-ui/renderers/map.tsx +2 -1
  369. package/src/chat/ui/intelligent-ui/use-truncated.ts +16 -19
  370. package/src/chat/ui/intelligent-ui/use-ui-links.ts +3 -3
  371. package/src/chat/ui/rows/ForksRow.tsx +3 -5
  372. package/src/chat/ui/rows/GeneratedImageRow.tsx +2 -1
  373. package/src/chat/ui/rows/MessageRows.tsx +12 -21
  374. package/src/chat/ui/rows/SubagentRow.tsx +3 -3
  375. package/src/chat/ui/rows/TaskRow.tsx +1 -1
  376. package/src/chat/ui/rows/WorkRows.tsx +10 -5
  377. package/src/chat/ui/useToggleSet.ts +15 -18
  378. package/src/chat/ui/visual-theme.ts +2 -3
  379. package/src/host-hooks.ts +113 -0
  380. package/src/lazy.tsx +2 -0
  381. package/src/locales/en/agent-chat.ts +134 -108
  382. package/src/locales/en/agent-prompts.ts +7 -7
  383. package/src/locales/en/agent-providers.ts +35 -34
  384. package/src/locales/en/agent-usage.ts +26 -20
  385. package/src/locales/nl/agent-chat.ts +126 -100
  386. package/src/locales/nl/agent-prompts.ts +5 -5
  387. package/src/locales/nl/agent-providers.ts +33 -32
  388. package/src/locales/nl/agent-usage.ts +25 -20
  389. package/src/providers/CliDetail.tsx +2 -1
  390. package/src/providers/InstallPage.tsx +2 -4
  391. package/src/providers/ProviderList.tsx +12 -2
  392. package/src/providers/ProvidersPane.tsx +45 -15
  393. package/src/providers/pane-target.ts +20 -4
  394. package/src/state/chats.ts +2 -2
  395. package/src/usage/LimitsList.tsx +12 -13
  396. package/src/usage/UsageBreakdown.tsx +17 -6
  397. package/src/usage/UsageLimits.tsx +2 -1
  398. package/src/usage/UsagePage.tsx +3 -3
  399. package/src/usage/index.ts +1 -1
  400. package/src/usage/limit-groups.ts +12 -0
  401. package/src/usage/limits.ts +2 -2
  402. package/src/usage/money.ts +1 -2
@@ -1,5 +1,5 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { useEffect, useMemo, useRef, useState, useSyncExternalStore } from 'react';
1
+ import { c as _c } from "react/compiler-runtime";
2
+ import { useEffect, useRef, useState, useSyncExternalStore } from 'react';
3
3
  import { useTranslation } from 'react-i18next';
4
4
  import clsx from 'clsx';
5
5
  import { ChevronDown } from 'lucide-react';
@@ -34,6 +34,7 @@ import { useCompactionOffer } from './composer/use-compaction-offer.js';
34
34
  import { useComposerDraft } from './composer/use-composer-draft.js';
35
35
  import { useComposerMenus } from './composer/use-composer-menus.js';
36
36
  import { useComposerSubmit } from './composer/use-composer-submit.js';
37
+ import { useEffortStepper } from './composer/use-effort-stepper.js';
37
38
  import { LEAVE_DROPS_TO_THE_CARD, useDraftFiles } from './composer/use-draft-files.js';
38
39
  import { useContinuableTurn } from './composer/use-continuable-turn.js';
39
40
  import { useNotice } from './composer/use-notice.js';
@@ -42,141 +43,874 @@ import { usePromptHistory } from './composer/use-prompt-history.js';
42
43
  import { usePromptHold } from './composer/use-prompt-hold.js';
43
44
  import { surfacePartOf } from './composer/surface.js';
44
45
  import { useTakeBack } from './composer/use-take-back.js';
46
+ import { useHostExtraPrompts, useHostSendDelivery } from '../../host-hooks.js';
47
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
45
48
  function sendLabelKey(busy, steerable, delivery) {
46
- if (!busy) {
47
- return 'composer.send';
48
- }
49
- if (!steerable) {
50
- return 'composer.queueButton';
51
- }
52
- return delivery === 'steer' ? 'composer.steerButton' : 'composer.queueWithSteerButton';
49
+ if (!busy) {
50
+ return 'composer.send';
51
+ }
52
+ if (!steerable) {
53
+ return 'composer.queueButton';
54
+ }
55
+ return delivery === 'steer' ? 'composer.steerButton' : 'composer.queueWithSteerButton';
53
56
  }
54
- export function Composer({ chatId, info, focused, answerPromptsElsewhere, disabled, readOnly = false, providerFixed, onSend, onRetarget }) {
55
- const { t } = useTranslation('agent-chat');
56
- const host = useChatHost();
57
- const scope = useChatScope();
58
- const sendDelivery = host.useSendDelivery();
59
- const sendKey = useChatPreferences((preferences) => preferences.sendKey);
60
- const provider = useProviders((row) => row.providers.find((entry) => entry.kind === info.provider));
61
- // Absent until the host answered `provider.list`, so only an explicit false hides anything.
62
- const capabilities = provider?.capabilities;
63
- const steerable = canSteer(capabilities);
64
- const writable = !disabled && !readOnly;
65
- const busy = info.activeTurnId !== null;
66
- const inputRef = useRef(null);
67
- const [dictationToolbar, setDictationToolbar] = useState(null);
68
- const hold = usePromptHold();
69
- const box = useComposerDraft(chatId, inputRef);
70
- const { draft } = box;
71
- const notice = useNotice();
72
- const history = usePromptHistory(chatId, box.setText);
73
- const menus = useComposerMenus({ chatId, info, capabilities, providerName: provider?.name, draft: box, inputRef });
74
- const files = useDraftFiles({ capabilities, providerName: provider?.name, writable, draft: box, inputRef, setNotice: notice.setNotice });
75
- const controls = useChatControls({ chatId, info, notice, onRetarget });
76
- const guard = promptGuard(withQuote(draft.quote, draft.text));
77
- const continuable = useContinuableTurn(chatId, info);
78
- // The stopped turn something went out for, since the chat takes a moment to answer and Continue must not stand there meanwhile.
79
- const [sentFor, setSentFor] = useState(null);
80
- const extraPrompts = host.prompts.useExtra(scope.id, chatId);
81
- const { submit, continueTurn, restoreStashed, toggleStash } = useComposerSubmit({
82
- chatId,
83
- writable,
84
- guard,
85
- steerable,
86
- sendDelivery,
87
- draft: box,
88
- menus,
89
- controls,
90
- history,
91
- hold,
92
- inputRef,
93
- setNotice: notice.setNotice,
94
- onSend: (text, extras) => {
95
- setSentFor(continuable);
96
- const sent = onSend(text, extras);
97
- // A send the host did not take leaves Continue where it was; the original promise still reaches its caller.
98
- void Promise.resolve(sent).then((taken) => {
99
- if (taken === false) {
100
- setSentFor(null);
101
- }
102
- }, (error) => {
103
- setSentFor(null);
104
- throw error;
105
- });
106
- return sent;
57
+ export function Composer(t0) {
58
+ const $ = _c(226);
59
+ const {
60
+ chatId,
61
+ info,
62
+ focused,
63
+ answerPromptsElsewhere,
64
+ disabled,
65
+ readOnly: t1,
66
+ providerFixed,
67
+ onSend,
68
+ onRetarget
69
+ } = t0;
70
+ const readOnly = t1 === undefined ? false : t1;
71
+ const {
72
+ t
73
+ } = useTranslation("agent-chat");
74
+ const host = useChatHost();
75
+ const scope = useChatScope();
76
+ const sendDelivery = useHostSendDelivery();
77
+ const sendKey = useChatPreferences(_temp);
78
+ let t2;
79
+ if ($[0] !== info.provider) {
80
+ t2 = row => row.providers.find(entry => entry.kind === info.provider);
81
+ $[0] = info.provider;
82
+ $[1] = t2;
83
+ } else {
84
+ t2 = $[1];
85
+ }
86
+ const provider = useProviders(t2);
87
+ const capabilities = provider?.capabilities;
88
+ const steerable = canSteer(capabilities);
89
+ const writable = !disabled && !readOnly;
90
+ const busy = info.activeTurnId !== null;
91
+ const inputRef = useRef(null);
92
+ const [dictationToolbar, setDictationToolbar] = useState(null);
93
+ const hold = usePromptHold();
94
+ const box = useComposerDraft(chatId, inputRef);
95
+ const {
96
+ draft
97
+ } = box;
98
+ const notice = useNotice();
99
+ const history = usePromptHistory(chatId, box.setText);
100
+ const t3 = provider?.name;
101
+ let t4;
102
+ if ($[2] !== box || $[3] !== capabilities || $[4] !== chatId || $[5] !== info || $[6] !== t3) {
103
+ t4 = {
104
+ chatId,
105
+ info,
106
+ capabilities,
107
+ providerName: t3,
108
+ draft: box,
109
+ inputRef
110
+ };
111
+ $[2] = box;
112
+ $[3] = capabilities;
113
+ $[4] = chatId;
114
+ $[5] = info;
115
+ $[6] = t3;
116
+ $[7] = t4;
117
+ } else {
118
+ t4 = $[7];
119
+ }
120
+ const menus = useComposerMenus(t4);
121
+ const t5 = provider?.name;
122
+ let t6;
123
+ if ($[8] !== box || $[9] !== capabilities || $[10] !== notice.setNotice || $[11] !== t5 || $[12] !== writable) {
124
+ t6 = {
125
+ capabilities,
126
+ providerName: t5,
127
+ writable,
128
+ draft: box,
129
+ inputRef,
130
+ setNotice: notice.setNotice
131
+ };
132
+ $[8] = box;
133
+ $[9] = capabilities;
134
+ $[10] = notice.setNotice;
135
+ $[11] = t5;
136
+ $[12] = writable;
137
+ $[13] = t6;
138
+ } else {
139
+ t6 = $[13];
140
+ }
141
+ const files = useDraftFiles(t6);
142
+ let t7;
143
+ if ($[14] !== chatId || $[15] !== info || $[16] !== notice || $[17] !== onRetarget) {
144
+ t7 = {
145
+ chatId,
146
+ info,
147
+ notice,
148
+ onRetarget
149
+ };
150
+ $[14] = chatId;
151
+ $[15] = info;
152
+ $[16] = notice;
153
+ $[17] = onRetarget;
154
+ $[18] = t7;
155
+ } else {
156
+ t7 = $[18];
157
+ }
158
+ const controls = useChatControls(t7);
159
+ let t8;
160
+ if ($[19] !== info.selection || $[20] !== provider?.models) {
161
+ t8 = provider?.models.find(entry_0 => entry_0.slug === info.selection.model);
162
+ $[19] = info.selection;
163
+ $[20] = provider?.models;
164
+ $[21] = t8;
165
+ } else {
166
+ t8 = $[21];
167
+ }
168
+ let t9;
169
+ if ($[22] !== chatId || $[23] !== controls || $[24] !== info || $[25] !== notice.setNotice || $[26] !== t8 || $[27] !== writable) {
170
+ t9 = {
171
+ chatId,
172
+ info,
173
+ model: t8,
174
+ writable,
175
+ controls,
176
+ setNotice: notice.setNotice
177
+ };
178
+ $[22] = chatId;
179
+ $[23] = controls;
180
+ $[24] = info;
181
+ $[25] = notice.setNotice;
182
+ $[26] = t8;
183
+ $[27] = writable;
184
+ $[28] = t9;
185
+ } else {
186
+ t9 = $[28];
187
+ }
188
+ useEffortStepper(t9);
189
+ const guard = promptGuard(withQuote(draft.quote, draft.text));
190
+ const continuable = useContinuableTurn(chatId, info);
191
+ const [sentFor, setSentFor] = useState(null);
192
+ const extraPrompts = useHostExtraPrompts(scope.id, chatId);
193
+ let t10;
194
+ if ($[29] !== continuable || $[30] !== onSend) {
195
+ t10 = (text, extras) => {
196
+ setSentFor(continuable);
197
+ const sent = onSend(text, extras);
198
+ Promise.resolve(sent).then(taken => {
199
+ if (taken === false) {
200
+ setSentFor(null);
107
201
  }
202
+ }, error => {
203
+ setSentFor(null);
204
+ throw error;
205
+ });
206
+ return sent;
207
+ };
208
+ $[29] = continuable;
209
+ $[30] = onSend;
210
+ $[31] = t10;
211
+ } else {
212
+ t10 = $[31];
213
+ }
214
+ const {
215
+ submit,
216
+ continueTurn,
217
+ restoreStashed,
218
+ toggleStash
219
+ } = useComposerSubmit({
220
+ chatId,
221
+ writable,
222
+ guard,
223
+ steerable,
224
+ sendDelivery,
225
+ draft: box,
226
+ menus,
227
+ controls,
228
+ history,
229
+ hold,
230
+ inputRef,
231
+ setNotice: notice.setNotice,
232
+ onSend: t10
233
+ });
234
+ let t11;
235
+ if ($[32] !== history) {
236
+ t11 = () => {
237
+ history.forget();
238
+ inputRef.current?.focus();
239
+ };
240
+ $[32] = history;
241
+ $[33] = t11;
242
+ } else {
243
+ t11 = $[33];
244
+ }
245
+ let t12;
246
+ if ($[34] !== box || $[35] !== chatId || $[36] !== notice.setNotice || $[37] !== t11) {
247
+ t12 = {
248
+ chatId,
249
+ draft: box,
250
+ setNotice: notice.setNotice,
251
+ onTaken: t11
252
+ };
253
+ $[34] = box;
254
+ $[35] = chatId;
255
+ $[36] = notice.setNotice;
256
+ $[37] = t11;
257
+ $[38] = t12;
258
+ } else {
259
+ t12 = $[38];
260
+ }
261
+ const {
262
+ takingBack,
263
+ takeBack
264
+ } = useTakeBack(t12);
265
+ const pending = usePendingRequests(chatId);
266
+ const compactionOffer = useCompactionOffer(chatId, info, capabilities?.compaction);
267
+ const t13 = capabilities?.mentions !== false;
268
+ let t14;
269
+ if ($[39] !== chatId || $[40] !== disabled || $[41] !== menus.hasSkills || $[42] !== readOnly || $[43] !== t13) {
270
+ t14 = {
271
+ chatId,
272
+ disabled,
273
+ readOnly,
274
+ mentionable: t13,
275
+ hasSkills: menus.hasSkills
276
+ };
277
+ $[39] = chatId;
278
+ $[40] = disabled;
279
+ $[41] = menus.hasSkills;
280
+ $[42] = readOnly;
281
+ $[43] = t13;
282
+ $[44] = t14;
283
+ } else {
284
+ t14 = $[44];
285
+ }
286
+ const placeholder = useHintedPlaceholder(t14);
287
+ let t15;
288
+ if ($[45] !== draft.mentions || $[46] !== draft.skills) {
289
+ t15 = chipDecorations({
290
+ mentions: draft.mentions,
291
+ skills: draft.skills
108
292
  });
109
- const { takingBack, takeBack } = useTakeBack({
110
- chatId,
111
- draft: box,
112
- setNotice: notice.setNotice,
113
- onTaken: () => {
114
- history.forget();
115
- inputRef.current?.focus();
116
- }
293
+ $[45] = draft.mentions;
294
+ $[46] = draft.skills;
295
+ $[47] = t15;
296
+ } else {
297
+ t15 = $[47];
298
+ }
299
+ let t16;
300
+ if ($[48] !== t15) {
301
+ t16 = [t15, LEAVE_DROPS_TO_THE_CARD];
302
+ $[48] = t15;
303
+ $[49] = t16;
304
+ } else {
305
+ t16 = $[49];
306
+ }
307
+ const editorExtensions = t16;
308
+ let t17;
309
+ if ($[50] !== chatId) {
310
+ t17 = () => timelineAtEnd(chatId);
311
+ $[50] = chatId;
312
+ $[51] = t17;
313
+ } else {
314
+ t17 = $[51];
315
+ }
316
+ const atEnd = useSyncExternalStore(subscribeTimelineEnd, t17, _temp2);
317
+ let t18;
318
+ if ($[52] !== info.queue) {
319
+ t18 = info.queue ?? [];
320
+ $[52] = info.queue;
321
+ $[53] = t18;
322
+ } else {
323
+ t18 = $[53];
324
+ }
325
+ const queue = t18;
326
+ let t19;
327
+ if ($[54] !== draft) {
328
+ t19 = isEmptyDraft(draft);
329
+ $[54] = draft;
330
+ $[55] = t19;
331
+ } else {
332
+ t19 = $[55];
333
+ }
334
+ const empty = t19;
335
+ let t20;
336
+ let t21;
337
+ if ($[56] !== focused) {
338
+ t20 = () => {
339
+ if (focused) {
340
+ inputRef.current?.focus();
341
+ }
342
+ };
343
+ t21 = [focused];
344
+ $[56] = focused;
345
+ $[57] = t20;
346
+ $[58] = t21;
347
+ } else {
348
+ t20 = $[57];
349
+ t21 = $[58];
350
+ }
351
+ useEffect(t20, t21);
352
+ let t22;
353
+ if ($[59] !== box) {
354
+ t22 = next => box.setText(next);
355
+ $[59] = box;
356
+ $[60] = t22;
357
+ } else {
358
+ t22 = $[60];
359
+ }
360
+ let t23;
361
+ if ($[61] !== chatId || $[62] !== draft.text || $[63] !== files.noteKey || $[64] !== history || $[65] !== host || $[66] !== menus || $[67] !== sendKey || $[68] !== submit || $[69] !== t22 || $[70] !== toggleStash) {
362
+ t23 = composerKeyHandler({
363
+ chatId,
364
+ host,
365
+ sendKey,
366
+ text: draft.text,
367
+ menus,
368
+ history,
369
+ noteKey: files.noteKey,
370
+ toggleStash,
371
+ setText: t22,
372
+ submit
117
373
  });
118
- const pending = usePendingRequests(chatId);
119
- const compactionOffer = useCompactionOffer(chatId, info, capabilities?.compaction);
120
- const placeholder = useHintedPlaceholder({ chatId, disabled, readOnly, mentionable: capabilities?.mentions !== false, hasSkills: menus.hasSkills });
121
- const editorExtensions = useMemo(() => [chipDecorations({ mentions: draft.mentions, skills: draft.skills }), LEAVE_DROPS_TO_THE_CARD], [draft.mentions, draft.skills]);
122
- /* The timeline owns the scroller; this is the one bit of it the composer needs to know. */
123
- const atEnd = useSyncExternalStore(subscribeTimelineEnd, () => timelineAtEnd(chatId), () => true);
124
- const queue = info.queue ?? [];
125
- const empty = isEmptyDraft(draft);
126
- useEffect(() => {
127
- if (focused) {
128
- inputRef.current?.focus();
129
- }
130
- }, [focused]);
131
- const onKeyDown = composerKeyHandler({
132
- chatId,
133
- host,
134
- sendKey,
135
- text: draft.text,
136
- menus,
137
- history,
138
- noteKey: files.noteKey,
139
- toggleStash,
140
- setText: (next) => box.setText(next),
141
- submit
142
- });
143
- const pointSurface = (event) => {
144
- event.currentTarget.toggleAttribute('data-text-cursor', surfacePartOf(event.target, event.currentTarget) !== 'action');
374
+ $[61] = chatId;
375
+ $[62] = draft.text;
376
+ $[63] = files.noteKey;
377
+ $[64] = history;
378
+ $[65] = host;
379
+ $[66] = menus;
380
+ $[67] = sendKey;
381
+ $[68] = submit;
382
+ $[69] = t22;
383
+ $[70] = toggleStash;
384
+ $[71] = t23;
385
+ } else {
386
+ t23 = $[71];
387
+ }
388
+ const onKeyDown = t23;
389
+ const pointSurface = _temp3;
390
+ let t24;
391
+ if ($[72] !== writable) {
392
+ t24 = event_0 => {
393
+ if (!writable || event_0.button !== 0 || event_0.defaultPrevented || surfacePartOf(event_0.target, event_0.currentTarget) !== "surface") {
394
+ return;
395
+ }
396
+ event_0.preventDefault();
397
+ inputRef.current?.setCaret(Infinity);
145
398
  };
146
- const pressSurface = (event) => {
147
- if (!writable || event.button !== 0 || event.defaultPrevented || surfacePartOf(event.target, event.currentTarget) !== 'surface') {
148
- return;
149
- }
150
- // Nothing around the field selects, so the default would only blur it on the way, closing its picker and lifting a held prompt card.
151
- event.preventDefault();
152
- inputRef.current?.setCaret(Infinity);
399
+ $[72] = writable;
400
+ $[73] = t24;
401
+ } else {
402
+ t24 = $[73];
403
+ }
404
+ const pressSurface = t24;
405
+ const t25 = "chat-composer-content pointer-events-none relative z-10 w-full";
406
+ let t26;
407
+ if ($[74] !== atEnd || $[75] !== chatId || $[76] !== readOnly || $[77] !== t) {
408
+ t26 = !atEnd && !readOnly && /*#__PURE__*/_jsx("div", {
409
+ className: "absolute inset-x-0 bottom-full mb-2 flex justify-center",
410
+ children: /*#__PURE__*/_jsx(Tooltip, {
411
+ label: t("composer.jumpToEnd"),
412
+ name: true,
413
+ children: /*#__PURE__*/_jsx(Surface, {
414
+ render: /*#__PURE__*/_jsx("button", {
415
+ onClick: () => scrollTimelineToEnd(chatId)
416
+ }),
417
+ className: "pointer-events-auto grid h-8 w-8 place-items-center rounded-full text-text-muted hover:text-text",
418
+ children: /*#__PURE__*/_jsx(Icon, {
419
+ icon: ChevronDown,
420
+ size: 16
421
+ })
422
+ })
423
+ })
424
+ });
425
+ $[74] = atEnd;
426
+ $[75] = chatId;
427
+ $[76] = readOnly;
428
+ $[77] = t;
429
+ $[78] = t26;
430
+ } else {
431
+ t26 = $[78];
432
+ }
433
+ let t27;
434
+ if ($[79] !== chatId) {
435
+ t27 = /*#__PURE__*/_jsx(ChatActivity, {
436
+ chatId: chatId
437
+ });
438
+ $[79] = chatId;
439
+ $[80] = t27;
440
+ } else {
441
+ t27 = $[80];
442
+ }
443
+ const t28 = files.dragging ? "border-accent bg-[color-mix(in_srgb,var(--accent-soft)_60%,var(--surface-raised))]" : "border-border bg-[color-mix(in_srgb,var(--surface-raised)_92%,transparent)]";
444
+ let t29;
445
+ if ($[81] !== t28) {
446
+ t29 = clsx("@container/composer pointer-events-auto flex flex-col overflow-hidden rounded-2xl border shadow-float backdrop-blur-[14px] focus-ring-within", t28);
447
+ $[81] = t28;
448
+ $[82] = t29;
449
+ } else {
450
+ t29 = $[82];
451
+ }
452
+ const t30 = files.dropTarget;
453
+ const T0 = PromptComposer;
454
+ const t31 = !empty;
455
+ const t32 = capabilities?.denyReason === true;
456
+ let t33;
457
+ if ($[83] === Symbol.for("react.memo_cache_sentinel")) {
458
+ t33 = () => inputRef.current?.focus();
459
+ $[83] = t33;
460
+ } else {
461
+ t33 = $[83];
462
+ }
463
+ const t34 = writable && "data-[text-cursor]:cursor-text";
464
+ let t35;
465
+ if ($[84] !== t34) {
466
+ t35 = clsx(t34);
467
+ $[84] = t34;
468
+ $[85] = t35;
469
+ } else {
470
+ t35 = $[85];
471
+ }
472
+ let t36;
473
+ if ($[86] !== chatId || $[87] !== info) {
474
+ t36 = /*#__PURE__*/_jsx(LimitDock, {
475
+ chatId: chatId,
476
+ info: info
477
+ });
478
+ $[86] = chatId;
479
+ $[87] = info;
480
+ $[88] = t36;
481
+ } else {
482
+ t36 = $[88];
483
+ }
484
+ const t37 = capabilities?.goals;
485
+ let t38;
486
+ if ($[89] !== chatId || $[90] !== info || $[91] !== t37) {
487
+ t38 = /*#__PURE__*/_jsx(GoalDock, {
488
+ chatId: chatId,
489
+ info: info,
490
+ goals: t37
491
+ });
492
+ $[89] = chatId;
493
+ $[90] = info;
494
+ $[91] = t37;
495
+ $[92] = t38;
496
+ } else {
497
+ t38 = $[92];
498
+ }
499
+ let t39;
500
+ if ($[93] !== chatId || $[94] !== compactionOffer || $[95] !== controls.compact || $[96] !== scope) {
501
+ t39 = compactionOffer && /*#__PURE__*/_jsx(ResumeCompactionDock, {
502
+ tokens: compactionOffer.tokens,
503
+ reason: compactionOffer.reason,
504
+ onCompact: controls.compact,
505
+ onDismiss: () => dismissResumeCompaction(scope, chatId, compactionOffer.turnId)
506
+ });
507
+ $[93] = chatId;
508
+ $[94] = compactionOffer;
509
+ $[95] = controls.compact;
510
+ $[96] = scope;
511
+ $[97] = t39;
512
+ } else {
513
+ t39 = $[97];
514
+ }
515
+ let t40;
516
+ if ($[98] !== menus) {
517
+ t40 = /*#__PURE__*/_jsx(ComposerMenu, {
518
+ menus: menus
519
+ });
520
+ $[98] = menus;
521
+ $[99] = t40;
522
+ } else {
523
+ t40 = $[99];
524
+ }
525
+ let t41;
526
+ if ($[100] !== chatId || $[101] !== info.queuePaused || $[102] !== queue || $[103] !== takeBack || $[104] !== takingBack) {
527
+ t41 = queue.length > 0 && /*#__PURE__*/_jsx(QueuedMessages, {
528
+ chatId: chatId,
529
+ queue: queue,
530
+ paused: info.queuePaused === true,
531
+ takingBack: takingBack !== null,
532
+ onEdit: message => void takeBack(message)
533
+ });
534
+ $[100] = chatId;
535
+ $[101] = info.queuePaused;
536
+ $[102] = queue;
537
+ $[103] = takeBack;
538
+ $[104] = takingBack;
539
+ $[105] = t41;
540
+ } else {
541
+ t41 = $[105];
542
+ }
543
+ let t42;
544
+ if ($[106] !== box.removeQuote || $[107] !== chatId || $[108] !== draft.quote || $[109] !== draft.quoteSource || $[110] !== notice || $[111] !== t) {
545
+ t42 = draft.quote !== "" && /*#__PURE__*/_jsx(DraftQuote, {
546
+ chatId: chatId,
547
+ quote: draft.quote,
548
+ source: draft.quoteSource,
549
+ onRemove: box.removeQuote,
550
+ onSourceGone: () => notice.setNotice(t("rows.user.quoteGone"), "info")
551
+ });
552
+ $[106] = box.removeQuote;
553
+ $[107] = chatId;
554
+ $[108] = draft.quote;
555
+ $[109] = draft.quoteSource;
556
+ $[110] = notice;
557
+ $[111] = t;
558
+ $[112] = t42;
559
+ } else {
560
+ t42 = $[112];
561
+ }
562
+ let t43;
563
+ if ($[113] !== box.removeChat || $[114] !== draft.chats) {
564
+ t43 = draft.chats.length > 0 && /*#__PURE__*/_jsx(DraftChats, {
565
+ chats: draft.chats,
566
+ onRemove: box.removeChat
567
+ });
568
+ $[113] = box.removeChat;
569
+ $[114] = draft.chats;
570
+ $[115] = t43;
571
+ } else {
572
+ t43 = $[115];
573
+ }
574
+ let t44;
575
+ if ($[116] !== box.removeAttachment || $[117] !== draft.attachments) {
576
+ t44 = draft.attachments.length > 0 && /*#__PURE__*/_jsx(DraftAttachments, {
577
+ attachments: draft.attachments,
578
+ onRemove: box.removeAttachment
579
+ });
580
+ $[116] = box.removeAttachment;
581
+ $[117] = draft.attachments;
582
+ $[118] = t44;
583
+ } else {
584
+ t44 = $[118];
585
+ }
586
+ const t45 = !writable;
587
+ let t46;
588
+ if ($[119] !== box || $[120] !== history || $[121] !== hold || $[122] !== menus) {
589
+ t46 = (value, selection, state) => {
590
+ hold.noteInput();
591
+ box.setText(value);
592
+ menus.setMenuIndex(0);
593
+ menus.trackTriggers(value, selection, state);
594
+ history.edited(value);
595
+ };
596
+ $[119] = box;
597
+ $[120] = history;
598
+ $[121] = hold;
599
+ $[122] = menus;
600
+ $[123] = t46;
601
+ } else {
602
+ t46 = $[123];
603
+ }
604
+ let t47;
605
+ if ($[124] !== hold || $[125] !== menus) {
606
+ t47 = () => {
607
+ menus.close();
608
+ hold.release("blur");
609
+ };
610
+ $[124] = hold;
611
+ $[125] = menus;
612
+ $[126] = t47;
613
+ } else {
614
+ t47 = $[126];
615
+ }
616
+ let t48;
617
+ if ($[127] !== dictationToolbar || $[128] !== draft.text || $[129] !== editorExtensions || $[130] !== files.onPaste || $[131] !== focused || $[132] !== hold.setComposing || $[133] !== menus.inputAria || $[134] !== menus.trackTriggers || $[135] !== onKeyDown || $[136] !== placeholder || $[137] !== t45 || $[138] !== t46 || $[139] !== t47) {
618
+ t48 = /*#__PURE__*/_jsx(ComposerInput, {
619
+ ref: inputRef,
620
+ dictationToolbar: dictationToolbar,
621
+ className: "composer-input select-text text-sm leading-normal text-text",
622
+ value: draft.text,
623
+ placeholder: placeholder,
624
+ disabled: t45,
625
+ tabbable: focused,
626
+ extensions: editorExtensions,
627
+ aria: menus.inputAria,
628
+ onChange: t46,
629
+ onSelectionChange: menus.trackTriggers,
630
+ onBlur: t47,
631
+ onComposing: hold.setComposing,
632
+ onKeyDown: onKeyDown,
633
+ onPaste: files.onPaste
634
+ });
635
+ $[127] = dictationToolbar;
636
+ $[128] = draft.text;
637
+ $[129] = editorExtensions;
638
+ $[130] = files.onPaste;
639
+ $[131] = focused;
640
+ $[132] = hold.setComposing;
641
+ $[133] = menus.inputAria;
642
+ $[134] = menus.trackTriggers;
643
+ $[135] = onKeyDown;
644
+ $[136] = placeholder;
645
+ $[137] = t45;
646
+ $[138] = t46;
647
+ $[139] = t47;
648
+ $[140] = t48;
649
+ } else {
650
+ t48 = $[140];
651
+ }
652
+ let t49;
653
+ if ($[141] !== notice.notice || $[142] !== notice.tone) {
654
+ t49 = notice.notice && /*#__PURE__*/_jsx("div", {
655
+ className: clsx("px-5 pb-1 text-xs @max-md/composer:px-3.5", notice.tone === "error" ? "text-status-error" : "text-text-muted"),
656
+ role: notice.tone === "error" ? "alert" : "status",
657
+ children: notice.notice
658
+ });
659
+ $[141] = notice.notice;
660
+ $[142] = notice.tone;
661
+ $[143] = t49;
662
+ } else {
663
+ t49 = $[143];
664
+ }
665
+ const t50 = guard.visible && /*#__PURE__*/_jsxs("div", {
666
+ className: clsx("px-5 pb-1 text-right text-xs tabular-nums @max-md/composer:px-3.5", guard.tooLong ? "text-status-error" : "text-text-faint"),
667
+ children: [formatNumber(guard.count), " / ", formatNumber(PROMPT_MAX_CHARS), guard.tooLong && ` ${t("composer.tooLong")}`]
668
+ });
669
+ const T1 = ComposerControls;
670
+ const t51 = capabilities?.attachments !== false;
671
+ const t52 = !busy || !empty;
672
+ const t53 = empty || !writable || guard.tooLong;
673
+ const t54 = t(sendLabelKey(busy, steerable, sendDelivery));
674
+ let t55;
675
+ if ($[144] !== draft.text || $[145] !== sendKey) {
676
+ t55 = sendShortcut(sendKey, draft.text.includes("\n"));
677
+ $[144] = draft.text;
678
+ $[145] = sendKey;
679
+ $[146] = t55;
680
+ } else {
681
+ t55 = $[146];
682
+ }
683
+ let t56;
684
+ if ($[147] !== submit) {
685
+ t56 = alternate => submit(alternate ? "alternate" : "default");
686
+ $[147] = submit;
687
+ $[148] = t56;
688
+ } else {
689
+ t56 = $[148];
690
+ }
691
+ const t57 = continuable !== null && continuable !== sentFor && empty && writable && pending.length === 0 && extraPrompts.length === 0 ? continueTurn : null;
692
+ let t58;
693
+ if ($[149] !== t52 || $[150] !== t53 || $[151] !== t54 || $[152] !== t55 || $[153] !== t56 || $[154] !== t57) {
694
+ t58 = {
695
+ visible: t52,
696
+ disabled: t53,
697
+ label: t54,
698
+ kbd: t55,
699
+ onSend: t56,
700
+ onContinue: t57
701
+ };
702
+ $[149] = t52;
703
+ $[150] = t53;
704
+ $[151] = t54;
705
+ $[152] = t55;
706
+ $[153] = t56;
707
+ $[154] = t57;
708
+ $[155] = t58;
709
+ } else {
710
+ t58 = $[155];
711
+ }
712
+ let t59;
713
+ if ($[156] !== files) {
714
+ t59 = picked => {
715
+ files.addFiles(picked);
716
+ inputRef.current?.focus();
153
717
  };
154
- return (_jsxs("div", { className: "chat-composer-content pointer-events-none relative z-10 w-full", children: [!atEnd && !readOnly && (_jsx("div", { className: "absolute inset-x-0 bottom-full mb-2 flex justify-center", children: _jsx(Tooltip, { label: t('composer.jumpToEnd'), name: true, children: _jsx(Surface, { render: _jsx("button", { onClick: () => scrollTimelineToEnd(chatId) }), className: "pointer-events-auto grid h-8 w-8 place-items-center rounded-full text-text-muted hover:text-text", children: _jsx(Icon, { icon: ChevronDown, size: 16 }) }) }) })), _jsx(ChatActivity, { chatId: chatId }), _jsx("div", { className: clsx('@container/composer pointer-events-auto flex flex-col overflow-hidden rounded-2xl border shadow-float backdrop-blur-[14px] focus-ring-within', files.dragging
155
- ? 'border-accent bg-[color-mix(in_srgb,var(--accent-soft)_60%,var(--surface-raised))]'
156
- : 'border-border bg-[color-mix(in_srgb,var(--surface-raised)_92%,transparent)]'), ...files.dropTarget, children: _jsx(PromptComposer, { chatId: chatId, pending: pending, focused: focused, onShowElsewhere: answerPromptsElsewhere, disabled: disabled, hasDraft: !empty, denyReason: capabilities?.denyReason === true, onAllAnswered: () => inputRef.current?.focus(), hold: hold, children: _jsxs("div", { className: clsx(writable && 'data-[text-cursor]:cursor-text'), onPointerOver: pointSurface, onMouseDown: pressSurface, children: [_jsx(LimitDock, { chatId: chatId, info: info }), _jsx(GoalDock, { chatId: chatId, info: info, goals: capabilities?.goals }), compactionOffer && (_jsx(ResumeCompactionDock, { tokens: compactionOffer.tokens, onCompact: controls.compact, onDismiss: () => dismissResumeCompaction(scope, chatId, compactionOffer.turnId) })), _jsx(ComposerMenu, { menus: menus }), queue.length > 0 && (_jsx(QueuedMessages, { chatId: chatId, queue: queue, paused: info.queuePaused === true, takingBack: takingBack !== null, onEdit: (message) => void takeBack(message) })), draft.quote !== '' && (_jsx(DraftQuote, { chatId: chatId, quote: draft.quote, source: draft.quoteSource, onRemove: box.removeQuote, onSourceGone: () => notice.setNotice(t('rows.user.quoteGone'), 'info') })), draft.chats.length > 0 && _jsx(DraftChats, { chats: draft.chats, onRemove: box.removeChat }), draft.attachments.length > 0 && _jsx(DraftAttachments, { attachments: draft.attachments, onRemove: box.removeAttachment }), _jsx(ComposerInput, { ref: inputRef, dictationToolbar: dictationToolbar, className: "composer-input select-text text-sm leading-normal text-text", value: draft.text, placeholder: placeholder, disabled: !writable, tabbable: focused, extensions: editorExtensions, aria: menus.inputAria, onChange: (value, selection, state) => {
157
- hold.noteInput();
158
- box.setText(value);
159
- menus.setMenuIndex(0);
160
- menus.trackTriggers(value, selection, state);
161
- history.edited(value);
162
- }, onSelectionChange: menus.trackTriggers, onBlur: () => {
163
- menus.close();
164
- hold.release('blur');
165
- }, onComposing: hold.setComposing, onKeyDown: onKeyDown, onPaste: files.onPaste }), notice.notice && (_jsx("div", { className: clsx('px-5 pb-1 text-xs @max-md/composer:px-3.5', notice.tone === 'error' ? 'text-status-error' : 'text-text-muted'), role: notice.tone === 'error' ? 'alert' : 'status', children: notice.notice })), guard.visible && (_jsxs("div", { className: clsx('px-5 pb-1 text-right text-xs tabular-nums @max-md/composer:px-3.5', guard.tooLong ? 'text-status-error' : 'text-text-faint'), children: [formatNumber(guard.count), " / ", formatNumber(PROMPT_MAX_CHARS), guard.tooLong && ` ${t('composer.tooLong')}`] })), _jsx(ComposerControls, { chatId: chatId, info: info, providerFixed: providerFixed, writable: writable, attachable: capabilities?.attachments !== false, controls: controls, send: {
166
- visible: !busy || !empty,
167
- disabled: empty || !writable || guard.tooLong,
168
- label: t(sendLabelKey(busy, steerable, sendDelivery)),
169
- kbd: sendShortcut(sendKey, draft.text.includes('\n')),
170
- onSend: (alternate) => submit(alternate ? 'alternate' : 'default'),
171
- onContinue: continuable !== null && continuable !== sentFor && empty && writable && pending.length === 0 && extraPrompts.length === 0
172
- ? continueTurn
173
- : null
174
- }, dictationToolbar: setDictationToolbar, onFiles: (picked) => {
175
- files.addFiles(picked);
176
- inputRef.current?.focus();
177
- }, onRestore: restoreStashed, insert: (added) => {
178
- if (writable) {
179
- inputRef.current?.insert(added);
180
- }
181
- } })] }) }) }), _jsx(PromptDialog, { open: controls.confirmClear, title: t('composer.clear.title'), description: t('composer.clear.description'), confirmLabel: t('composer.clear.confirm'), danger: true, fallbackMessage: t('composer.notice.clearFailed'), onConfirm: controls.forceClearThread, onOpenChange: controls.cancelClear })] }));
718
+ $[156] = files;
719
+ $[157] = t59;
720
+ } else {
721
+ t59 = $[157];
722
+ }
723
+ let t60;
724
+ if ($[158] !== writable) {
725
+ t60 = added => {
726
+ if (writable) {
727
+ inputRef.current?.insert(added);
728
+ }
729
+ };
730
+ $[158] = writable;
731
+ $[159] = t60;
732
+ } else {
733
+ t60 = $[159];
734
+ }
735
+ let t61;
736
+ if ($[160] !== T1 || $[161] !== chatId || $[162] !== controls || $[163] !== info || $[164] !== providerFixed || $[165] !== restoreStashed || $[166] !== setDictationToolbar || $[167] !== t51 || $[168] !== t58 || $[169] !== t59 || $[170] !== t60 || $[171] !== writable) {
737
+ t61 = /*#__PURE__*/_jsx(T1, {
738
+ chatId: chatId,
739
+ info: info,
740
+ providerFixed: providerFixed,
741
+ writable: writable,
742
+ attachable: t51,
743
+ controls: controls,
744
+ send: t58,
745
+ dictationToolbar: setDictationToolbar,
746
+ onFiles: t59,
747
+ onRestore: restoreStashed,
748
+ insert: t60
749
+ });
750
+ $[160] = T1;
751
+ $[161] = chatId;
752
+ $[162] = controls;
753
+ $[163] = info;
754
+ $[164] = providerFixed;
755
+ $[165] = restoreStashed;
756
+ $[166] = setDictationToolbar;
757
+ $[167] = t51;
758
+ $[168] = t58;
759
+ $[169] = t59;
760
+ $[170] = t60;
761
+ $[171] = writable;
762
+ $[172] = t61;
763
+ } else {
764
+ t61 = $[172];
765
+ }
766
+ let t62;
767
+ if ($[173] !== pointSurface || $[174] !== pressSurface || $[175] !== t35 || $[176] !== t36 || $[177] !== t38 || $[178] !== t39 || $[179] !== t40 || $[180] !== t41 || $[181] !== t42 || $[182] !== t43 || $[183] !== t44 || $[184] !== t48 || $[185] !== t49 || $[186] !== t50 || $[187] !== t61) {
768
+ t62 = /*#__PURE__*/_jsxs("div", {
769
+ className: t35,
770
+ onPointerOver: pointSurface,
771
+ onMouseDown: pressSurface,
772
+ children: [t36, t38, t39, t40, t41, t42, t43, t44, t48, t49, t50, t61]
773
+ });
774
+ $[173] = pointSurface;
775
+ $[174] = pressSurface;
776
+ $[175] = t35;
777
+ $[176] = t36;
778
+ $[177] = t38;
779
+ $[178] = t39;
780
+ $[179] = t40;
781
+ $[180] = t41;
782
+ $[181] = t42;
783
+ $[182] = t43;
784
+ $[183] = t44;
785
+ $[184] = t48;
786
+ $[185] = t49;
787
+ $[186] = t50;
788
+ $[187] = t61;
789
+ $[188] = t62;
790
+ } else {
791
+ t62 = $[188];
792
+ }
793
+ let t63;
794
+ if ($[189] !== T0 || $[190] !== answerPromptsElsewhere || $[191] !== chatId || $[192] !== disabled || $[193] !== focused || $[194] !== hold || $[195] !== pending || $[196] !== t31 || $[197] !== t32 || $[198] !== t33 || $[199] !== t62) {
795
+ t63 = /*#__PURE__*/_jsx(T0, {
796
+ chatId: chatId,
797
+ pending: pending,
798
+ focused: focused,
799
+ onShowElsewhere: answerPromptsElsewhere,
800
+ disabled: disabled,
801
+ hasDraft: t31,
802
+ denyReason: t32,
803
+ onAllAnswered: t33,
804
+ hold: hold,
805
+ children: t62
806
+ });
807
+ $[189] = T0;
808
+ $[190] = answerPromptsElsewhere;
809
+ $[191] = chatId;
810
+ $[192] = disabled;
811
+ $[193] = focused;
812
+ $[194] = hold;
813
+ $[195] = pending;
814
+ $[196] = t31;
815
+ $[197] = t32;
816
+ $[198] = t33;
817
+ $[199] = t62;
818
+ $[200] = t63;
819
+ } else {
820
+ t63 = $[200];
821
+ }
822
+ let t64;
823
+ if ($[201] !== files.dropTarget || $[202] !== t29 || $[203] !== t63) {
824
+ t64 = /*#__PURE__*/_jsx("div", {
825
+ className: t29,
826
+ ...t30,
827
+ children: t63
828
+ });
829
+ $[201] = files.dropTarget;
830
+ $[202] = t29;
831
+ $[203] = t63;
832
+ $[204] = t64;
833
+ } else {
834
+ t64 = $[204];
835
+ }
836
+ const t65 = controls.confirmClear;
837
+ let t66;
838
+ if ($[205] !== t) {
839
+ t66 = t("composer.clear.title");
840
+ $[205] = t;
841
+ $[206] = t66;
842
+ } else {
843
+ t66 = $[206];
844
+ }
845
+ let t67;
846
+ if ($[207] !== t) {
847
+ t67 = t("composer.clear.description");
848
+ $[207] = t;
849
+ $[208] = t67;
850
+ } else {
851
+ t67 = $[208];
852
+ }
853
+ let t68;
854
+ if ($[209] !== t) {
855
+ t68 = t("composer.clear.confirm");
856
+ $[209] = t;
857
+ $[210] = t68;
858
+ } else {
859
+ t68 = $[210];
860
+ }
861
+ let t69;
862
+ if ($[211] !== t) {
863
+ t69 = t("composer.notice.clearFailed");
864
+ $[211] = t;
865
+ $[212] = t69;
866
+ } else {
867
+ t69 = $[212];
868
+ }
869
+ let t70;
870
+ if ($[213] !== controls.cancelClear || $[214] !== controls.confirmClear || $[215] !== controls.forceClearThread || $[216] !== t66 || $[217] !== t67 || $[218] !== t68 || $[219] !== t69) {
871
+ t70 = /*#__PURE__*/_jsx(PromptDialog, {
872
+ open: t65,
873
+ title: t66,
874
+ description: t67,
875
+ confirmLabel: t68,
876
+ danger: true,
877
+ fallbackMessage: t69,
878
+ onConfirm: controls.forceClearThread,
879
+ onOpenChange: controls.cancelClear
880
+ });
881
+ $[213] = controls.cancelClear;
882
+ $[214] = controls.confirmClear;
883
+ $[215] = controls.forceClearThread;
884
+ $[216] = t66;
885
+ $[217] = t67;
886
+ $[218] = t68;
887
+ $[219] = t69;
888
+ $[220] = t70;
889
+ } else {
890
+ t70 = $[220];
891
+ }
892
+ let t71;
893
+ if ($[221] !== t26 || $[222] !== t27 || $[223] !== t64 || $[224] !== t70) {
894
+ t71 = /*#__PURE__*/_jsxs("div", {
895
+ className: t25,
896
+ children: [t26, t27, t64, t70]
897
+ });
898
+ $[221] = t26;
899
+ $[222] = t27;
900
+ $[223] = t64;
901
+ $[224] = t70;
902
+ $[225] = t71;
903
+ } else {
904
+ t71 = $[225];
905
+ }
906
+ return t71;
907
+ }
908
+ function _temp3(event) {
909
+ event.currentTarget.toggleAttribute("data-text-cursor", surfacePartOf(event.target, event.currentTarget) !== "action");
910
+ }
911
+ function _temp2() {
912
+ return true;
182
913
  }
914
+ function _temp(preferences) {
915
+ return preferences.sendKey;
916
+ }