@adecore/agents-react 0.31.11 → 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 (404) 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 +1946 -163
  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 +35 -0
  241. package/dist/locales/en/agent-chat.js +747 -712
  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 +35 -0
  248. package/dist/locales/nl/agent-chat.js +747 -712
  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 -25
  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.d.ts +1 -0
  291. package/dist/state/chats.js +408 -192
  292. package/dist/state/index.js +1 -1
  293. package/dist/state/provider-accounts.js +70 -47
  294. package/dist/state/providers.js +45 -16
  295. package/dist/state/usage.js +154 -77
  296. package/dist/storage.js +69 -68
  297. package/dist/testing/index.js +1 -1
  298. package/dist/testing/prompts.js +105 -67
  299. package/dist/transport.js +10 -10
  300. package/dist/ui/PlainTextarea.js +27 -3
  301. package/dist/usage/LimitsList.js +646 -40
  302. package/dist/usage/UsageBreakdown.js +879 -38
  303. package/dist/usage/UsageChart.js +311 -32
  304. package/dist/usage/UsageDialog.js +46 -4
  305. package/dist/usage/UsageLimits.js +467 -34
  306. package/dist/usage/UsageLimitsCard.js +95 -11
  307. package/dist/usage/UsagePage.js +817 -96
  308. package/dist/usage/UsagePane.js +164 -10
  309. package/dist/usage/UsageSummary.js +151 -6
  310. package/dist/usage/UsageTiles.js +164 -14
  311. package/dist/usage/format.js +32 -32
  312. package/dist/usage/index.d.ts +1 -1
  313. package/dist/usage/index.js +2 -1
  314. package/dist/usage/limit-groups.d.ts +2 -0
  315. package/dist/usage/limit-groups.js +77 -59
  316. package/dist/usage/limits.js +78 -43
  317. package/dist/usage/money.js +20 -4
  318. package/dist/usage/summary.js +85 -64
  319. package/package.json +8 -8
  320. package/src/agents/ModelOptionControl.tsx +3 -1
  321. package/src/agents/option-words.ts +27 -0
  322. package/src/chat/account-choice.ts +41 -1
  323. package/src/chat/composer-effort.ts +32 -0
  324. package/src/chat/forks.ts +4 -5
  325. package/src/chat/index.ts +3 -1
  326. package/src/chat/logic/effort.ts +32 -0
  327. package/src/chat/logic/picker-entries.ts +45 -10
  328. package/src/chat/logic/resume-compaction.ts +95 -17
  329. package/src/chat/logic/timeline.ts +11 -3
  330. package/src/chat/preferences.ts +35 -0
  331. package/src/chat/subagent-view.ts +2 -3
  332. package/src/chat/ui/AnsiOutput.tsx +1 -2
  333. package/src/chat/ui/BookmarkSubmenu.tsx +3 -3
  334. package/src/chat/ui/ChatActivity.tsx +14 -22
  335. package/src/chat/ui/ChatReferenceChip.tsx +2 -3
  336. package/src/chat/ui/Composer.tsx +15 -7
  337. package/src/chat/ui/EditDiff.tsx +2 -3
  338. package/src/chat/ui/LimitState.tsx +2 -2
  339. package/src/chat/ui/Markdown.tsx +10 -8
  340. package/src/chat/ui/MermaidBlock.tsx +2 -3
  341. package/src/chat/ui/Pickers.tsx +49 -29
  342. package/src/chat/ui/PromptComposer.tsx +7 -9
  343. package/src/chat/ui/ResumeCompactionDock.tsx +16 -4
  344. package/src/chat/ui/RunSettings.tsx +67 -28
  345. package/src/chat/ui/Scrubber.tsx +3 -3
  346. package/src/chat/ui/ShellCommand.tsx +2 -0
  347. package/src/chat/ui/SubagentInfo.tsx +2 -3
  348. package/src/chat/ui/SubagentTimeline.tsx +12 -16
  349. package/src/chat/ui/Timeline.tsx +6 -6
  350. package/src/chat/ui/UnifiedDiff.tsx +3 -4
  351. package/src/chat/ui/VisualFrame.tsx +5 -8
  352. package/src/chat/ui/code-theme.ts +4 -4
  353. package/src/chat/ui/composer/placeholder.ts +2 -2
  354. package/src/chat/ui/composer/use-compaction-offer.ts +36 -16
  355. package/src/chat/ui/composer/use-composer-menus.ts +4 -9
  356. package/src/chat/ui/composer/use-composer-submit.ts +2 -1
  357. package/src/chat/ui/composer/use-effort-stepper.ts +56 -0
  358. package/src/chat/ui/composer/use-notice.ts +2 -2
  359. package/src/chat/ui/diff/EditorEditDiff.tsx +9 -13
  360. package/src/chat/ui/diff/LegacyEditDiff.tsx +12 -17
  361. package/src/chat/ui/diff/LegacyUnifiedDiff.tsx +13 -21
  362. package/src/chat/ui/diff/use-review-stack.ts +4 -4
  363. package/src/chat/ui/diff-theme.ts +3 -3
  364. package/src/chat/ui/file-links.ts +2 -2
  365. package/src/chat/ui/intelligent-ui/UiReply.tsx +2 -0
  366. package/src/chat/ui/intelligent-ui/renderers/chart.tsx +3 -3
  367. package/src/chat/ui/intelligent-ui/renderers/content.tsx +5 -6
  368. package/src/chat/ui/intelligent-ui/renderers/map-view.tsx +2 -1
  369. package/src/chat/ui/intelligent-ui/renderers/map.tsx +2 -1
  370. package/src/chat/ui/intelligent-ui/use-truncated.ts +16 -19
  371. package/src/chat/ui/intelligent-ui/use-ui-links.ts +3 -3
  372. package/src/chat/ui/rows/ForksRow.tsx +3 -5
  373. package/src/chat/ui/rows/GeneratedImageRow.tsx +2 -1
  374. package/src/chat/ui/rows/MessageRows.tsx +12 -21
  375. package/src/chat/ui/rows/SubagentRow.tsx +3 -3
  376. package/src/chat/ui/rows/TaskRow.tsx +1 -1
  377. package/src/chat/ui/rows/WorkRows.tsx +20 -7
  378. package/src/chat/ui/useToggleSet.ts +15 -18
  379. package/src/chat/ui/visual-theme.ts +2 -3
  380. package/src/host-hooks.ts +113 -0
  381. package/src/lazy.tsx +2 -0
  382. package/src/locales/en/agent-chat.ts +135 -108
  383. package/src/locales/en/agent-prompts.ts +7 -7
  384. package/src/locales/en/agent-providers.ts +35 -34
  385. package/src/locales/en/agent-usage.ts +26 -20
  386. package/src/locales/nl/agent-chat.ts +127 -100
  387. package/src/locales/nl/agent-prompts.ts +5 -5
  388. package/src/locales/nl/agent-providers.ts +33 -32
  389. package/src/locales/nl/agent-usage.ts +25 -20
  390. package/src/prompts/ui/ApprovalBody.tsx +3 -1
  391. package/src/providers/CliDetail.tsx +2 -1
  392. package/src/providers/InstallPage.tsx +2 -4
  393. package/src/providers/ProviderList.tsx +12 -2
  394. package/src/providers/ProvidersPane.tsx +45 -15
  395. package/src/providers/pane-target.ts +20 -4
  396. package/src/state/chats.ts +7 -2
  397. package/src/usage/LimitsList.tsx +12 -13
  398. package/src/usage/UsageBreakdown.tsx +17 -6
  399. package/src/usage/UsageLimits.tsx +2 -1
  400. package/src/usage/UsagePage.tsx +3 -3
  401. package/src/usage/index.ts +1 -1
  402. package/src/usage/limit-groups.ts +12 -0
  403. package/src/usage/limits.ts +2 -2
  404. package/src/usage/money.ts +1 -2
@@ -1,3 +1,4 @@
1
+ import { c as _c } from "react/compiler-runtime";
1
2
  import { useEffect, useId, useMemo, useState } from 'react';
2
3
  import { useTranslation } from 'react-i18next';
3
4
  import { ensureSyntaxTree, syntaxTree } from '@codemirror/language';
@@ -8,6 +9,7 @@ import { usableSlashCommands } from '../../guards.js';
8
9
  import { dropQuery, findMentionQuery, findSkillQuery, insertMention, insertSkill, mentionPick, NO_MENTION_SEARCH } from '../../mentions.js';
9
10
  import { inCode } from './keys.js';
10
11
  import { clampMenuIndex, composerMenuAria } from './menu-aria.js';
12
+ import { useHostReferableChats } from '../../../host-hooks.js';
11
13
  const SEARCH_DEBOUNCE_MS = 80;
12
14
  // What fits above the composer without turning the picker into a file tree.
13
15
  const MENTION_RESULTS = 8;
@@ -16,217 +18,500 @@ const CHAT_RESULTS = 4;
16
18
  // Commands the composer handles itself; the CLI's own ones are sent through as text.
17
19
  export const LOCAL_COMMANDS = ['model', 'compact', 'clear'];
18
20
  function sameQuery(left, right) {
19
- return left?.start === right?.start && left?.query === right?.query;
21
+ return left?.start === right?.start && left?.query === right?.query;
20
22
  }
21
23
  /*
22
24
  * The pickers over the box: `/` for a command, `$` for a skill and `@` for a file or another chat.
23
25
  * One is open at a time, and the arrow keys and the editor's ARIA attributes follow that one.
24
26
  */
25
- export function useComposerMenus({ chatId, info, capabilities, providerName, draft: { draft, setDraft, setText }, inputRef }) {
26
- const { t } = useTranslation('agent-chat');
27
- const scope = useChatScope();
28
- const host = useChatHost();
29
- const { searchFiles } = host;
30
- const chats = host.useReferableChats();
31
- const [menuIndex, setMenuIndex] = useState(0);
32
- const [mention, setMention] = useState(null);
33
- const [skillQuery, setSkillQuery] = useState(null);
34
- const [skills, setSkills] = useState([]);
35
- const [searched, setSearched] = useState(NO_MENTION_SEARCH);
36
- const text = draft.text;
37
- const goals = capabilities?.goals;
38
- // Every keystroke inside an `@word` searches again; a slow answer must not overwrite a newer one.
39
- useEffect(() => {
40
- if (mention === null) {
41
- return;
27
+ export function useComposerMenus(t0) {
28
+ const $ = _c(105);
29
+ const {
30
+ chatId,
31
+ info,
32
+ capabilities,
33
+ providerName,
34
+ draft: t1,
35
+ inputRef
36
+ } = t0;
37
+ const {
38
+ draft,
39
+ setDraft,
40
+ setText
41
+ } = t1;
42
+ const {
43
+ t
44
+ } = useTranslation("agent-chat");
45
+ const scope = useChatScope();
46
+ const host = useChatHost();
47
+ const {
48
+ searchFiles
49
+ } = host;
50
+ const chats = useHostReferableChats();
51
+ const [menuIndex, setMenuIndex] = useState(0);
52
+ const [mention, setMention] = useState(null);
53
+ const [skillQuery, setSkillQuery] = useState(null);
54
+ let t2;
55
+ if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
56
+ t2 = [];
57
+ $[0] = t2;
58
+ } else {
59
+ t2 = $[0];
60
+ }
61
+ const [skills, setSkills] = useState(t2);
62
+ const [searched, setSearched] = useState(NO_MENTION_SEARCH);
63
+ const text = draft.text;
64
+ const goals = capabilities?.goals;
65
+ let t3;
66
+ if ($[1] !== info.cwd || $[2] !== mention || $[3] !== scope.id || $[4] !== searchFiles) {
67
+ t3 = () => {
68
+ if (mention === null) {
69
+ return;
70
+ }
71
+ let stale = false;
72
+ const search = () => {
73
+ if (searchFiles === null) {
74
+ return;
42
75
  }
43
- let stale = false;
44
- const search = () => {
45
- if (searchFiles === null) {
46
- return;
47
- }
48
- searchFiles(scope.id, info.cwd, mention.query, MENTION_RESULTS)
49
- .then((files) => {
50
- if (!stale) {
51
- setSearched({ query: mention.query, files });
52
- setMenuIndex(0);
53
- }
54
- })
55
- .catch(() => undefined);
56
- };
57
- // A bare `@` is not a keystroke in a query. It opens the list of what is there, at once.
58
- if (mention.query === '') {
59
- search();
60
- return () => {
61
- stale = true;
62
- };
63
- }
64
- const timer = setTimeout(search, SEARCH_DEBOUNCE_MS);
65
- return () => {
66
- stale = true;
67
- clearTimeout(timer);
68
- };
69
- }, [scope, info.cwd, mention, searchFiles]);
70
- /*
71
- * The host's skill list, once per chat, again once the CLI announced its own after the first message,
72
- * and again when its process comes or goes, which is when a restart reads new skills.
73
- */
74
- useEffect(() => {
75
- let stale = false;
76
- scope.chats
77
- .listSkills(chatId)
78
- .then((found) => {
79
- if (!stale) {
80
- setSkills(found);
81
- }
82
- })
83
- .catch(() => undefined);
76
+ searchFiles(scope.id, info.cwd, mention.query, MENTION_RESULTS).then(files => {
77
+ if (!stale) {
78
+ setSearched({
79
+ query: mention.query,
80
+ files
81
+ });
82
+ setMenuIndex(0);
83
+ }
84
+ }).catch(_temp);
85
+ };
86
+ if (mention.query === "") {
87
+ search();
84
88
  return () => {
85
- stale = true;
89
+ stale = true;
86
90
  };
87
- }, [scope, chatId, info.skills, info.running]);
88
- const commandQuery = text.startsWith('/') && !text.includes('\n') ? text.slice(1).trim().toLowerCase() : null;
89
- const commands = useMemo(() => {
90
- if (commandQuery === null) {
91
- return [];
92
- }
93
- const known = new Set(skills.map((skill) => skill.name));
94
- const own = LOCAL_COMMANDS.map((name) => ({ name, hint: t(`composer.commands.${name}`), local: true, skill: false }));
95
- // Every CLI with goals reads `/goal`, also one that lists no commands of its own.
96
- const goal = goals === undefined ? [] : [{ name: 'goal', hint: t('composer.commands.goal'), local: false, skill: false }];
97
- const cli = usableSlashCommands(info.slashCommands)
98
- .filter((name) => !LOCAL_COMMANDS.includes(name) && (goals === undefined || name !== 'goal'))
99
- .map((name) => ({
100
- name,
101
- hint: known.has(name) ? t('composer.commands.skill') : t('composer.commands.cli', { cli: providerName ?? t('composer.commands.anyCli') }),
102
- local: false,
103
- skill: known.has(name)
104
- }));
105
- return [...own, ...goal, ...cli].filter((command) => command.name.startsWith(commandQuery)).slice(0, 8);
106
- }, [commandQuery, goals, info.slashCommands, providerName, skills, t]);
107
- const skillMatches = useMemo(() => {
108
- if (skillQuery === null) {
109
- return [];
91
+ }
92
+ const timer = setTimeout(search, SEARCH_DEBOUNCE_MS);
93
+ return () => {
94
+ stale = true;
95
+ clearTimeout(timer);
96
+ };
97
+ };
98
+ $[1] = info.cwd;
99
+ $[2] = mention;
100
+ $[3] = scope.id;
101
+ $[4] = searchFiles;
102
+ $[5] = t3;
103
+ } else {
104
+ t3 = $[5];
105
+ }
106
+ let t4;
107
+ if ($[6] !== info.cwd || $[7] !== mention || $[8] !== scope || $[9] !== searchFiles) {
108
+ t4 = [scope, info.cwd, mention, searchFiles];
109
+ $[6] = info.cwd;
110
+ $[7] = mention;
111
+ $[8] = scope;
112
+ $[9] = searchFiles;
113
+ $[10] = t4;
114
+ } else {
115
+ t4 = $[10];
116
+ }
117
+ useEffect(t3, t4);
118
+ let t5;
119
+ if ($[11] !== chatId || $[12] !== scope.chats) {
120
+ t5 = () => {
121
+ let stale_0 = false;
122
+ scope.chats.listSkills(chatId).then(found => {
123
+ if (!stale_0) {
124
+ setSkills(found);
110
125
  }
111
- const query = skillQuery.query.toLowerCase();
112
- return skills.filter((skill) => skill.name.toLowerCase().includes(query)).slice(0, 8);
113
- }, [skillQuery, skills]);
114
- const commandMenuOpen = commandQuery !== null && commands.length > 0;
115
- const skillMenuOpen = !commandMenuOpen && skillQuery !== null && skillMatches.length > 0;
116
- const mentionMenuOpen = !commandMenuOpen && !skillMenuOpen && mention !== null;
117
- // Results belong to the query that asked for them; a closed picker shows none while the next answer is on its way.
118
- const files = mention === null ? [] : searched.files;
119
- const chatMatches = useMemo(() => (mention === null ? [] : chatSuggestions(chats, mention.query, [chatId, ...draft.chats], CHAT_RESULTS)), [chatId, chats, draft.chats, mention]);
120
- const mentionCount = chatMatches.length + files.length;
121
- // One menu is open at a time, so they share an id.
122
- const listId = useId();
123
- const menuOpen = commandMenuOpen || skillMenuOpen || mentionMenuOpen;
124
- const menuCount = commandMenuOpen ? commands.length : skillMenuOpen ? skillMatches.length : mentionCount;
125
- // The list can shrink under a stale index; every reader takes the one that still points at an option.
126
- const activeIndex = clampMenuIndex(menuIndex, menuCount);
127
- const inputAria = useMemo(() => composerMenuAria({ label: t('composer.inputLabel'), listId, open: menuOpen, activeIndex, count: menuCount }), [t, listId, menuOpen, activeIndex, menuCount]);
128
- /* Which picker the caret opens: `@` for a file, `$` for a skill, or neither. In code a sigil is just text. */
129
- const trackTriggers = (value, selection, state) => {
130
- const empty = selection.from === selection.to;
131
- const tree = empty ? (ensureSyntaxTree(state, selection.from, 50) ?? syntaxTree(state)) : null;
132
- const caret = tree !== null && !inCode(tree, value, selection.from) ? selection.from : null;
133
- const skill = caret === null ? null : findSkillQuery(value, caret);
134
- setSkillQuery((current) => (sameQuery(current, skill) ? current : skill));
135
- // A CLI that does not expand `@path` gets the text as it is, so the picker stays out of the way.
136
- const next = caret === null || capabilities?.mentions === false ? null : findMentionQuery(value, caret);
137
- setMention((current) => (sameQuery(current, next) ? current : next));
126
+ }).catch(_temp2);
127
+ return () => {
128
+ stale_0 = true;
129
+ };
138
130
  };
139
- // The inserted text reaches the editor with the render it causes, so the caret waits a frame for it.
140
- const moveCaret = (caret) => {
141
- requestAnimationFrame(() => inputRef.current?.setCaret(caret));
131
+ $[11] = chatId;
132
+ $[12] = scope.chats;
133
+ $[13] = t5;
134
+ } else {
135
+ t5 = $[13];
136
+ }
137
+ let t6;
138
+ if ($[14] !== chatId || $[15] !== info.running || $[16] !== info.skills || $[17] !== scope) {
139
+ t6 = [scope, chatId, info.skills, info.running];
140
+ $[14] = chatId;
141
+ $[15] = info.running;
142
+ $[16] = info.skills;
143
+ $[17] = scope;
144
+ $[18] = t6;
145
+ } else {
146
+ t6 = $[18];
147
+ }
148
+ useEffect(t5, t6);
149
+ let t7;
150
+ if ($[19] !== text) {
151
+ t7 = text.startsWith("/") && !text.includes("\n") ? text.slice(1).trim().toLowerCase() : null;
152
+ $[19] = text;
153
+ $[20] = t7;
154
+ } else {
155
+ t7 = $[20];
156
+ }
157
+ const commandQuery = t7;
158
+ let t8;
159
+ bb0: {
160
+ if (commandQuery === null) {
161
+ let t9;
162
+ if ($[21] === Symbol.for("react.memo_cache_sentinel")) {
163
+ t9 = [];
164
+ $[21] = t9;
165
+ } else {
166
+ t9 = $[21];
167
+ }
168
+ t8 = t9;
169
+ break bb0;
170
+ }
171
+ let t9;
172
+ if ($[22] !== skills) {
173
+ t9 = new Set(skills.map(_temp3));
174
+ $[22] = skills;
175
+ $[23] = t9;
176
+ } else {
177
+ t9 = $[23];
178
+ }
179
+ const known = t9;
180
+ let t10;
181
+ if ($[24] !== commandQuery || $[25] !== goals || $[26] !== info.slashCommands || $[27] !== known || $[28] !== providerName || $[29] !== t) {
182
+ const own = LOCAL_COMMANDS.map(name => ({
183
+ name,
184
+ hint: t(`composer.commands.${name}`),
185
+ local: true,
186
+ skill: false
187
+ }));
188
+ const goal = goals === undefined ? [] : [{
189
+ name: "goal",
190
+ hint: t("composer.commands.goal"),
191
+ local: false,
192
+ skill: false
193
+ }];
194
+ const cli = usableSlashCommands(info.slashCommands).filter(name_0 => !LOCAL_COMMANDS.includes(name_0) && (goals === undefined || name_0 !== "goal")).map(name_1 => ({
195
+ name: name_1,
196
+ hint: known.has(name_1) ? t("composer.commands.skill") : t("composer.commands.cli", {
197
+ cli: providerName ?? t("composer.commands.anyCli")
198
+ }),
199
+ local: false,
200
+ skill: known.has(name_1)
201
+ }));
202
+ t10 = [...own, ...goal, ...cli].filter(command => command.name.startsWith(commandQuery)).slice(0, 8);
203
+ $[24] = commandQuery;
204
+ $[25] = goals;
205
+ $[26] = info.slashCommands;
206
+ $[27] = known;
207
+ $[28] = providerName;
208
+ $[29] = t;
209
+ $[30] = t10;
210
+ } else {
211
+ t10 = $[30];
212
+ }
213
+ t8 = t10;
214
+ }
215
+ const commands = t8;
216
+ let t9;
217
+ bb1: {
218
+ if (skillQuery === null) {
219
+ let t10;
220
+ if ($[31] === Symbol.for("react.memo_cache_sentinel")) {
221
+ t10 = [];
222
+ $[31] = t10;
223
+ } else {
224
+ t10 = $[31];
225
+ }
226
+ t9 = t10;
227
+ break bb1;
228
+ }
229
+ let t10;
230
+ if ($[32] !== skillQuery.query || $[33] !== skills) {
231
+ const query = skillQuery.query.toLowerCase();
232
+ t10 = skills.filter(skill_0 => skill_0.name.toLowerCase().includes(query)).slice(0, 8);
233
+ $[32] = skillQuery.query;
234
+ $[33] = skills;
235
+ $[34] = t10;
236
+ } else {
237
+ t10 = $[34];
238
+ }
239
+ t9 = t10;
240
+ }
241
+ const skillMatches = t9;
242
+ const commandMenuOpen = commandQuery !== null && commands.length > 0;
243
+ const skillMenuOpen = !commandMenuOpen && skillQuery !== null && skillMatches.length > 0;
244
+ const mentionMenuOpen = !commandMenuOpen && !skillMenuOpen && mention !== null;
245
+ let t10;
246
+ if ($[35] !== mention || $[36] !== searched) {
247
+ t10 = mention === null ? [] : searched.files;
248
+ $[35] = mention;
249
+ $[36] = searched;
250
+ $[37] = t10;
251
+ } else {
252
+ t10 = $[37];
253
+ }
254
+ const files_0 = t10;
255
+ let t11;
256
+ if ($[38] !== chatId || $[39] !== chats || $[40] !== draft.chats || $[41] !== mention) {
257
+ t11 = mention === null ? [] : chatSuggestions(chats, mention.query, [chatId, ...draft.chats], CHAT_RESULTS);
258
+ $[38] = chatId;
259
+ $[39] = chats;
260
+ $[40] = draft.chats;
261
+ $[41] = mention;
262
+ $[42] = t11;
263
+ } else {
264
+ t11 = $[42];
265
+ }
266
+ const chatMatches = t11;
267
+ const mentionCount = chatMatches.length + files_0.length;
268
+ const listId = useId();
269
+ const menuOpen = commandMenuOpen || skillMenuOpen || mentionMenuOpen;
270
+ const menuCount = commandMenuOpen ? commands.length : skillMenuOpen ? skillMatches.length : mentionCount;
271
+ let activeIndex;
272
+ let t12;
273
+ if ($[43] !== listId || $[44] !== menuCount || $[45] !== menuIndex || $[46] !== menuOpen || $[47] !== t) {
274
+ activeIndex = clampMenuIndex(menuIndex, menuCount);
275
+ t12 = composerMenuAria({
276
+ label: t("composer.inputLabel"),
277
+ listId,
278
+ open: menuOpen,
279
+ activeIndex,
280
+ count: menuCount
281
+ });
282
+ $[43] = listId;
283
+ $[44] = menuCount;
284
+ $[45] = menuIndex;
285
+ $[46] = menuOpen;
286
+ $[47] = t;
287
+ $[48] = activeIndex;
288
+ $[49] = t12;
289
+ } else {
290
+ activeIndex = $[48];
291
+ t12 = $[49];
292
+ }
293
+ const inputAria = t12;
294
+ let t13;
295
+ if ($[50] !== capabilities?.mentions) {
296
+ t13 = (value, selection, state) => {
297
+ const empty = selection.from === selection.to;
298
+ const tree = empty ? ensureSyntaxTree(state, selection.from, 50) ?? syntaxTree(state) : null;
299
+ const caret = tree !== null && !inCode(tree, value, selection.from) ? selection.from : null;
300
+ const skill_1 = caret === null ? null : findSkillQuery(value, caret);
301
+ setSkillQuery(current => sameQuery(current, skill_1) ? current : skill_1);
302
+ const next = caret === null || capabilities?.mentions === false ? null : findMentionQuery(value, caret);
303
+ setMention(current_0 => sameQuery(current_0, next) ? current_0 : next);
142
304
  };
143
- const close = () => {
144
- setMention(null);
145
- setSkillQuery(null);
305
+ $[50] = capabilities?.mentions;
306
+ $[51] = t13;
307
+ } else {
308
+ t13 = $[51];
309
+ }
310
+ const trackTriggers = t13;
311
+ let t14;
312
+ if ($[52] !== inputRef) {
313
+ t14 = caret_0 => {
314
+ requestAnimationFrame(() => inputRef.current?.setCaret(caret_0));
146
315
  };
147
- const chooseMention = (path) => {
148
- if (!mention) {
149
- return;
150
- }
151
- const result = insertMention(text, mention, path);
152
- setText(result.text, draft.mentions.includes(path) ? draft.mentions : [...draft.mentions, path]);
153
- setMention(null);
154
- moveCaret(result.caret);
316
+ $[52] = inputRef;
317
+ $[53] = t14;
318
+ } else {
319
+ t14 = $[53];
320
+ }
321
+ const moveCaret = t14;
322
+ let t15;
323
+ if ($[54] === Symbol.for("react.memo_cache_sentinel")) {
324
+ t15 = () => {
325
+ setMention(null);
326
+ setSkillQuery(null);
155
327
  };
156
- /* A picked chat sits beside the text as a chip, so the `@query` that found it goes. */
157
- const chooseChat = (id) => {
158
- if (!mention) {
159
- return;
160
- }
161
- const result = dropQuery(text, mention);
162
- setDraft((current) => ({ ...current, text: result.text, chats: current.chats.includes(id) ? current.chats : [...current.chats, id] }));
163
- setMention(null);
164
- moveCaret(result.caret);
328
+ $[54] = t15;
329
+ } else {
330
+ t15 = $[54];
331
+ }
332
+ const close = t15;
333
+ let t16;
334
+ if ($[55] !== draft.mentions || $[56] !== mention || $[57] !== moveCaret || $[58] !== setText || $[59] !== text) {
335
+ t16 = path => {
336
+ if (!mention) {
337
+ return;
338
+ }
339
+ const result = insertMention(text, mention, path);
340
+ setText(result.text, draft.mentions.includes(path) ? draft.mentions : [...draft.mentions, path]);
341
+ setMention(null);
342
+ moveCaret(result.caret);
165
343
  };
166
- const chooseMentionAt = (index) => {
167
- const pick = mention === null ? null : mentionPick(index, chatMatches, searched, mention.query);
168
- if (pick?.kind === 'chat') {
169
- chooseChat(pick.chat.id);
170
- }
171
- else if (pick?.kind === 'file') {
172
- chooseMention(pick.path);
344
+ $[55] = draft.mentions;
345
+ $[56] = mention;
346
+ $[57] = moveCaret;
347
+ $[58] = setText;
348
+ $[59] = text;
349
+ $[60] = t16;
350
+ } else {
351
+ t16 = $[60];
352
+ }
353
+ const chooseMention = t16;
354
+ let t17;
355
+ if ($[61] !== mention || $[62] !== moveCaret || $[63] !== setDraft || $[64] !== text) {
356
+ t17 = id => {
357
+ if (!mention) {
358
+ return;
359
+ }
360
+ const result_0 = dropQuery(text, mention);
361
+ setDraft(current_1 => ({
362
+ ...current_1,
363
+ text: result_0.text,
364
+ chats: current_1.chats.includes(id) ? current_1.chats : [...current_1.chats, id]
365
+ }));
366
+ setMention(null);
367
+ moveCaret(result_0.caret);
368
+ };
369
+ $[61] = mention;
370
+ $[62] = moveCaret;
371
+ $[63] = setDraft;
372
+ $[64] = text;
373
+ $[65] = t17;
374
+ } else {
375
+ t17 = $[65];
376
+ }
377
+ const chooseChat = t17;
378
+ let t18;
379
+ if ($[66] !== chatMatches || $[67] !== chooseChat || $[68] !== chooseMention || $[69] !== mention || $[70] !== searched) {
380
+ t18 = index => {
381
+ const pick = mention === null ? null : mentionPick(index, chatMatches, searched, mention.query);
382
+ if (pick?.kind === "chat") {
383
+ chooseChat(pick.chat.id);
384
+ } else {
385
+ if (pick?.kind === "file") {
386
+ chooseMention(pick.path);
173
387
  }
388
+ }
174
389
  };
175
- /*
176
- * A picked skill becomes a `$name` chip in the text and a name on the send, which is what
177
- * dispatches it. The `/` menu lands here too, so both spellings end up on the same path.
178
- */
179
- const chooseSkill = (name) => {
180
- const result = skillQuery ? insertSkill(text, skillQuery, name) : { text: `$${name} `, caret: name.length + 2 };
181
- setText(result.text, draft.mentions, draft.skills.includes(name) ? draft.skills : [...draft.skills, name]);
182
- setSkillQuery(null);
183
- moveCaret(result.caret);
390
+ $[66] = chatMatches;
391
+ $[67] = chooseChat;
392
+ $[68] = chooseMention;
393
+ $[69] = mention;
394
+ $[70] = searched;
395
+ $[71] = t18;
396
+ } else {
397
+ t18 = $[71];
398
+ }
399
+ const chooseMentionAt = t18;
400
+ let t19;
401
+ if ($[72] !== draft.mentions || $[73] !== draft.skills || $[74] !== moveCaret || $[75] !== setText || $[76] !== skillQuery || $[77] !== text) {
402
+ t19 = name_2 => {
403
+ const result_1 = skillQuery ? insertSkill(text, skillQuery, name_2) : {
404
+ text: `$${name_2} `,
405
+ caret: name_2.length + 2
406
+ };
407
+ setText(result_1.text, draft.mentions, draft.skills.includes(name_2) ? draft.skills : [...draft.skills, name_2]);
408
+ setSkillQuery(null);
409
+ moveCaret(result_1.caret);
184
410
  };
185
- /* A clicked command; Tab completes one with a space after it instead. */
186
- const pickCommand = (command, index) => {
187
- setMenuIndex(index);
188
- if (command.skill) {
189
- chooseSkill(command.name);
190
- return;
191
- }
192
- setText(`/${command.name}`);
193
- inputRef.current?.focus();
411
+ $[72] = draft.mentions;
412
+ $[73] = draft.skills;
413
+ $[74] = moveCaret;
414
+ $[75] = setText;
415
+ $[76] = skillQuery;
416
+ $[77] = text;
417
+ $[78] = t19;
418
+ } else {
419
+ t19 = $[78];
420
+ }
421
+ const chooseSkill = t19;
422
+ let t20;
423
+ if ($[79] !== chooseSkill || $[80] !== inputRef || $[81] !== setText) {
424
+ t20 = (command_0, index_0) => {
425
+ setMenuIndex(index_0);
426
+ if (command_0.skill) {
427
+ chooseSkill(command_0.name);
428
+ return;
429
+ }
430
+ setText(`/${command_0.name}`);
431
+ inputRef.current?.focus();
194
432
  };
195
- /* The arrows walk an open picker round; true when the key was one of them. */
196
- const moveInMenu = (key, count) => {
197
- if (key === 'ArrowDown') {
198
- setMenuIndex((i) => (i + 1) % count);
199
- return true;
200
- }
201
- if (key === 'ArrowUp') {
202
- setMenuIndex((i) => (i - 1 + count) % count);
203
- return true;
204
- }
205
- return false;
433
+ $[79] = chooseSkill;
434
+ $[80] = inputRef;
435
+ $[81] = setText;
436
+ $[82] = t20;
437
+ } else {
438
+ t20 = $[82];
439
+ }
440
+ const pickCommand = t20;
441
+ let t21;
442
+ if ($[83] === Symbol.for("react.memo_cache_sentinel")) {
443
+ t21 = (key, count) => {
444
+ if (key === "ArrowDown") {
445
+ setMenuIndex(i => (i + 1) % count);
446
+ return true;
447
+ }
448
+ if (key === "ArrowUp") {
449
+ setMenuIndex(i_0 => (i_0 - 1 + count) % count);
450
+ return true;
451
+ }
452
+ return false;
206
453
  };
207
- return {
208
- listId,
209
- activeIndex,
210
- inputAria,
211
- hasSkills: skills.length > 0,
212
- commandQuery,
213
- commands,
214
- commandMenuOpen,
215
- skillMatches,
216
- skillMenuOpen,
217
- mention,
218
- mentionMenuOpen,
219
- mentionCount,
220
- chatMatches,
221
- files,
222
- setMenuIndex,
223
- trackTriggers,
224
- close,
225
- chooseMention,
226
- chooseChat,
227
- chooseMentionAt,
228
- chooseSkill,
229
- pickCommand,
230
- moveInMenu
454
+ $[83] = t21;
455
+ } else {
456
+ t21 = $[83];
457
+ }
458
+ const moveInMenu = t21;
459
+ const t22 = skills.length > 0;
460
+ let t23;
461
+ if ($[84] !== activeIndex || $[85] !== chatMatches || $[86] !== chooseChat || $[87] !== chooseMention || $[88] !== chooseMentionAt || $[89] !== chooseSkill || $[90] !== commandMenuOpen || $[91] !== commandQuery || $[92] !== commands || $[93] !== files_0 || $[94] !== inputAria || $[95] !== listId || $[96] !== mention || $[97] !== mentionCount || $[98] !== mentionMenuOpen || $[99] !== pickCommand || $[100] !== skillMatches || $[101] !== skillMenuOpen || $[102] !== t22 || $[103] !== trackTriggers) {
462
+ t23 = {
463
+ listId,
464
+ activeIndex,
465
+ inputAria,
466
+ hasSkills: t22,
467
+ commandQuery,
468
+ commands,
469
+ commandMenuOpen,
470
+ skillMatches,
471
+ skillMenuOpen,
472
+ mention,
473
+ mentionMenuOpen,
474
+ mentionCount,
475
+ chatMatches,
476
+ files: files_0,
477
+ setMenuIndex,
478
+ trackTriggers,
479
+ close,
480
+ chooseMention,
481
+ chooseChat,
482
+ chooseMentionAt,
483
+ chooseSkill,
484
+ pickCommand,
485
+ moveInMenu
231
486
  };
487
+ $[84] = activeIndex;
488
+ $[85] = chatMatches;
489
+ $[86] = chooseChat;
490
+ $[87] = chooseMention;
491
+ $[88] = chooseMentionAt;
492
+ $[89] = chooseSkill;
493
+ $[90] = commandMenuOpen;
494
+ $[91] = commandQuery;
495
+ $[92] = commands;
496
+ $[93] = files_0;
497
+ $[94] = inputAria;
498
+ $[95] = listId;
499
+ $[96] = mention;
500
+ $[97] = mentionCount;
501
+ $[98] = mentionMenuOpen;
502
+ $[99] = pickCommand;
503
+ $[100] = skillMatches;
504
+ $[101] = skillMenuOpen;
505
+ $[102] = t22;
506
+ $[103] = trackTriggers;
507
+ $[104] = t23;
508
+ } else {
509
+ t23 = $[104];
510
+ }
511
+ return t23;
512
+ }
513
+ function _temp3(skill) {
514
+ return skill.name;
232
515
  }
516
+ function _temp2() {}
517
+ function _temp() {}