@adecore/agents-react 0.31.12 → 0.33.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 (409) hide show
  1. package/README.md +1 -1
  2. package/dist/agents/AccountDot.js +57 -6
  3. package/dist/agents/AgentIcon.js +88 -12
  4. package/dist/agents/ModelOptionControl.js +153 -18
  5. package/dist/agents/ProviderLogo.js +49 -4
  6. package/dist/agents/account-limits.js +17 -14
  7. package/dist/agents/accounts.js +99 -67
  8. package/dist/agents/agent-marks.js +5 -3
  9. package/dist/agents/model-name.js +42 -31
  10. package/dist/agents/model-options.js +8 -8
  11. package/dist/agents/model-requirement.js +17 -14
  12. package/dist/agents/option-words.d.ts +7 -0
  13. package/dist/agents/option-words.js +35 -0
  14. package/dist/agents/provider-paths.js +6 -6
  15. package/dist/agents/status-look.js +32 -12
  16. package/dist/chat/account-choice.d.ts +13 -0
  17. package/dist/chat/account-choice.js +90 -20
  18. package/dist/chat/actions.js +126 -59
  19. package/dist/chat/activity.js +5 -5
  20. package/dist/chat/attachments.js +74 -53
  21. package/dist/chat/bookmarks.js +58 -48
  22. package/dist/chat/chat-client.js +344 -263
  23. package/dist/chat/chat-references.js +3 -3
  24. package/dist/chat/composer-effort.d.ts +5 -0
  25. package/dist/chat/composer-effort.js +26 -0
  26. package/dist/chat/composer-send.js +13 -13
  27. package/dist/chat/drafts.js +115 -79
  28. package/dist/chat/forks.js +81 -24
  29. package/dist/chat/guards.js +15 -43
  30. package/dist/chat/index.d.ts +3 -1
  31. package/dist/chat/index.js +3 -2
  32. package/dist/chat/logic/ansi.js +170 -167
  33. package/dist/chat/logic/answers.js +2 -2
  34. package/dist/chat/logic/bookmarks.js +19 -19
  35. package/dist/chat/logic/command-looks.js +138 -96
  36. package/dist/chat/logic/context-usage.js +13 -9
  37. package/dist/chat/logic/continue-after-stop.js +15 -19
  38. package/dist/chat/logic/effort.d.ts +14 -0
  39. package/dist/chat/logic/effort.js +34 -0
  40. package/dist/chat/logic/embedded-code.js +387 -326
  41. package/dist/chat/logic/fork.js +134 -110
  42. package/dist/chat/logic/generated-image.js +54 -23
  43. package/dist/chat/logic/goal.js +28 -20
  44. package/dist/chat/logic/handback.js +6 -6
  45. package/dist/chat/logic/json.js +2 -2
  46. package/dist/chat/logic/limit.js +46 -30
  47. package/dist/chat/logic/picker-entries.d.ts +5 -3
  48. package/dist/chat/logic/picker-entries.js +83 -43
  49. package/dist/chat/logic/resume-compaction.d.ts +14 -1
  50. package/dist/chat/logic/resume-compaction.js +93 -24
  51. package/dist/chat/logic/scrubber.js +188 -136
  52. package/dist/chat/logic/thought.js +13 -16
  53. package/dist/chat/logic/thread-cards.js +60 -48
  54. package/dist/chat/logic/timeline-copy.js +30 -38
  55. package/dist/chat/logic/timeline-target.js +92 -63
  56. package/dist/chat/logic/timeline.js +499 -355
  57. package/dist/chat/logic/tool-catalog.js +54 -34
  58. package/dist/chat/logic/tools.js +106 -82
  59. package/dist/chat/logic/visual-height.js +18 -18
  60. package/dist/chat/logic/visual-viewport.js +6 -3
  61. package/dist/chat/logic/welcome.js +9 -9
  62. package/dist/chat/logic/workflow.d.ts +10 -0
  63. package/dist/chat/logic/workflow.js +130 -32
  64. package/dist/chat/mentions.js +149 -109
  65. package/dist/chat/persisted-json.js +51 -54
  66. package/dist/chat/preferences.d.ts +4 -0
  67. package/dist/chat/preferences.js +162 -84
  68. package/dist/chat/prompt-hold.js +9 -9
  69. package/dist/chat/quote.js +21 -30
  70. package/dist/chat/reading-width.js +12 -10
  71. package/dist/chat/recent-messages.js +34 -21
  72. package/dist/chat/resume-compaction-dismissals.js +25 -5
  73. package/dist/chat/runtime-modes.js +3 -3
  74. package/dist/chat/send-key.js +11 -7
  75. package/dist/chat/stash.js +89 -69
  76. package/dist/chat/subagent-conversation.js +181 -139
  77. package/dist/chat/subagent-list.js +65 -67
  78. package/dist/chat/subagent-support.js +12 -7
  79. package/dist/chat/subagent-view.js +132 -44
  80. package/dist/chat/thumbnails.js +88 -60
  81. package/dist/chat/timeline-flash.js +24 -12
  82. package/dist/chat/timeline-scroll.js +116 -86
  83. package/dist/chat/ui/AccountPill.js +126 -15
  84. package/dist/chat/ui/AnsiOutput.js +62 -6
  85. package/dist/chat/ui/BookmarkMarker.js +231 -41
  86. package/dist/chat/ui/BookmarkSubmenu.js +165 -18
  87. package/dist/chat/ui/ChatActivity.js +649 -70
  88. package/dist/chat/ui/ChatReferenceChip.js +104 -9
  89. package/dist/chat/ui/CodeBlock.js +132 -58
  90. package/dist/chat/ui/Composer.js +866 -132
  91. package/dist/chat/ui/ComposerInput.js +309 -120
  92. package/dist/chat/ui/DiffPool.js +75 -14
  93. package/dist/chat/ui/EditDiff.js +160 -21
  94. package/dist/chat/ui/FadingWords.js +32 -3
  95. package/dist/chat/ui/GoalDock.js +235 -42
  96. package/dist/chat/ui/ImageView.js +617 -61
  97. package/dist/chat/ui/LimitState.js +446 -72
  98. package/dist/chat/ui/Markdown.js +991 -173
  99. package/dist/chat/ui/MermaidBlock.js +285 -79
  100. package/dist/chat/ui/MessageActions.js +251 -39
  101. package/dist/chat/ui/ModelMarks.js +55 -5
  102. package/dist/chat/ui/Pickers.js +664 -113
  103. package/dist/chat/ui/PromptComposer.js +281 -51
  104. package/dist/chat/ui/QuoteButton.js +151 -57
  105. package/dist/chat/ui/ResumeCompactionDock.d.ts +6 -2
  106. package/dist/chat/ui/ResumeCompactionDock.js +141 -6
  107. package/dist/chat/ui/RowTime.js +59 -5
  108. package/dist/chat/ui/RunSettings.js +1744 -154
  109. package/dist/chat/ui/Scrubber.js +517 -88
  110. package/dist/chat/ui/ShellCommand.js +183 -107
  111. package/dist/chat/ui/SubagentControls.js +212 -24
  112. package/dist/chat/ui/SubagentInfo.js +170 -13
  113. package/dist/chat/ui/SubagentStopButton.js +115 -24
  114. package/dist/chat/ui/SubagentTimeline.js +357 -91
  115. package/dist/chat/ui/Timeline.js +988 -476
  116. package/dist/chat/ui/TimelineMenu.js +552 -37
  117. package/dist/chat/ui/UnifiedDiff.js +234 -27
  118. package/dist/chat/ui/UploadThumb.js +37 -7
  119. package/dist/chat/ui/VisualDialogs.js +251 -20
  120. package/dist/chat/ui/VisualFrame.js +321 -95
  121. package/dist/chat/ui/Welcome.js +72 -7
  122. package/dist/chat/ui/chips.js +1 -1
  123. package/dist/chat/ui/code-lines.js +36 -36
  124. package/dist/chat/ui/code-streaming.js +1 -1
  125. package/dist/chat/ui/code-theme.js +7 -7
  126. package/dist/chat/ui/composer/ComposerControls.js +329 -21
  127. package/dist/chat/ui/composer/ComposerMenu.js +358 -30
  128. package/dist/chat/ui/composer/DraftParts.js +185 -11
  129. package/dist/chat/ui/composer/QueuedMessages.js +138 -13
  130. package/dist/chat/ui/composer/chips.js +29 -19
  131. package/dist/chat/ui/composer/editor.js +79 -63
  132. package/dist/chat/ui/composer/insert.js +26 -12
  133. package/dist/chat/ui/composer/key-handler.js +180 -127
  134. package/dist/chat/ui/composer/keys.js +90 -73
  135. package/dist/chat/ui/composer/menu-aria.js +18 -9
  136. package/dist/chat/ui/composer/placeholder.js +78 -31
  137. package/dist/chat/ui/composer/surface.js +13 -37
  138. package/dist/chat/ui/composer/use-chat-controls.js +230 -90
  139. package/dist/chat/ui/composer/use-compaction-offer.js +50 -18
  140. package/dist/chat/ui/composer/use-composer-draft.js +65 -34
  141. package/dist/chat/ui/composer/use-composer-menus.js +478 -193
  142. package/dist/chat/ui/composer/use-composer-submit.js +251 -109
  143. package/dist/chat/ui/composer/use-continuable-turn.js +33 -6
  144. package/dist/chat/ui/composer/use-draft-files.js +245 -93
  145. package/dist/chat/ui/composer/use-effort-stepper.d.ts +13 -0
  146. package/dist/chat/ui/composer/use-effort-stepper.js +88 -0
  147. package/dist/chat/ui/composer/use-notice.js +61 -16
  148. package/dist/chat/ui/composer/use-pending-requests.js +38 -17
  149. package/dist/chat/ui/composer/use-prompt-history.js +117 -45
  150. package/dist/chat/ui/composer/use-prompt-hold.js +119 -35
  151. package/dist/chat/ui/composer/use-take-back.js +94 -72
  152. package/dist/chat/ui/diff/ApprovalReview.js +101 -23
  153. package/dist/chat/ui/diff/DiffFallbackBoundary.js +21 -13
  154. package/dist/chat/ui/diff/DiffOmitted.js +56 -6
  155. package/dist/chat/ui/diff/DiffStack.js +92 -8
  156. package/dist/chat/ui/diff/DiffUnavailable.js +56 -6
  157. package/dist/chat/ui/diff/EditorEditDiff.js +263 -51
  158. package/dist/chat/ui/diff/EditorPatchDiff.js +39 -14
  159. package/dist/chat/ui/diff/LegacyDiffPool.js +27 -10
  160. package/dist/chat/ui/diff/LegacyEditDiff.js +97 -20
  161. package/dist/chat/ui/diff/LegacyUnifiedDiff.js +172 -42
  162. package/dist/chat/ui/diff/RawDiff.js +65 -5
  163. package/dist/chat/ui/diff/ReviewDiff.js +77 -5
  164. package/dist/chat/ui/diff/diff-props.js +1 -1
  165. package/dist/chat/ui/diff/diff-source-budget.js +46 -35
  166. package/dist/chat/ui/diff/editor-edit-model.js +18 -14
  167. package/dist/chat/ui/diff/review-plan.js +63 -40
  168. package/dist/chat/ui/diff/review-settle.js +24 -9
  169. package/dist/chat/ui/diff/syntax-runtime.js +236 -201
  170. package/dist/chat/ui/diff/use-review-stack.js +146 -25
  171. package/dist/chat/ui/diff-syntax.js +70 -58
  172. package/dist/chat/ui/diff-theme.js +31 -12
  173. package/dist/chat/ui/file-links.js +39 -10
  174. package/dist/chat/ui/find-reveal.js +29 -8
  175. package/dist/chat/ui/full-diff.js +17 -12
  176. package/dist/chat/ui/highlighter.js +143 -113
  177. package/dist/chat/ui/icons.js +16 -7
  178. package/dist/chat/ui/index.js +1 -1
  179. package/dist/chat/ui/intelligent-ui/UiBlockFrame.js +556 -82
  180. package/dist/chat/ui/intelligent-ui/UiFallbackPart.js +73 -5
  181. package/dist/chat/ui/intelligent-ui/UiReply.js +666 -262
  182. package/dist/chat/ui/intelligent-ui/block-local.js +59 -31
  183. package/dist/chat/ui/intelligent-ui/chart-data.js +77 -67
  184. package/dist/chat/ui/intelligent-ui/node-text.js +77 -91
  185. package/dist/chat/ui/intelligent-ui/registry.js +46 -46
  186. package/dist/chat/ui/intelligent-ui/render-context.js +1 -1
  187. package/dist/chat/ui/intelligent-ui/renderers/base-land.js +1 -1
  188. package/dist/chat/ui/intelligent-ui/renderers/binding.js +3 -3
  189. package/dist/chat/ui/intelligent-ui/renderers/chart.js +1223 -123
  190. package/dist/chat/ui/intelligent-ui/renderers/choices.js +312 -34
  191. package/dist/chat/ui/intelligent-ui/renderers/content.js +1241 -86
  192. package/dist/chat/ui/intelligent-ui/renderers/data.js +619 -54
  193. package/dist/chat/ui/intelligent-ui/renderers/inputs.js +868 -67
  194. package/dist/chat/ui/intelligent-ui/renderers/links.js +366 -62
  195. package/dist/chat/ui/intelligent-ui/renderers/map-slots.js +118 -60
  196. package/dist/chat/ui/intelligent-ui/renderers/map-style.js +85 -78
  197. package/dist/chat/ui/intelligent-ui/renderers/map-view.js +282 -217
  198. package/dist/chat/ui/intelligent-ui/renderers/map.js +621 -69
  199. package/dist/chat/ui/intelligent-ui/renderers/place-point.js +15 -8
  200. package/dist/chat/ui/intelligent-ui/renderers/structure.js +262 -20
  201. package/dist/chat/ui/intelligent-ui/renderers/text.js +674 -49
  202. package/dist/chat/ui/intelligent-ui/reply-parts.js +24 -15
  203. package/dist/chat/ui/intelligent-ui/table-data.js +97 -57
  204. package/dist/chat/ui/intelligent-ui/tones.js +31 -31
  205. package/dist/chat/ui/intelligent-ui/use-in-view.js +30 -12
  206. package/dist/chat/ui/intelligent-ui/use-later.js +28 -13
  207. package/dist/chat/ui/intelligent-ui/use-truncated.js +45 -21
  208. package/dist/chat/ui/intelligent-ui/use-ui-links.js +296 -109
  209. package/dist/chat/ui/intelligent-ui/use-ui-queries.js +256 -246
  210. package/dist/chat/ui/markdown-blocks.js +296 -262
  211. package/dist/chat/ui/mermaid.d.ts +8 -20
  212. package/dist/chat/ui/mermaid.js +47 -84
  213. package/dist/chat/ui/quote-selection.js +32 -29
  214. package/dist/chat/ui/rehype-chips.js +35 -23
  215. package/dist/chat/ui/rehype-fade.js +28 -17
  216. package/dist/chat/ui/remark-html-as-text.js +22 -15
  217. package/dist/chat/ui/reply-context.js +1 -1
  218. package/dist/chat/ui/reveal.js +161 -72
  219. package/dist/chat/ui/rows/ForksRow.js +226 -24
  220. package/dist/chat/ui/rows/GeneratedImageRow.js +541 -87
  221. package/dist/chat/ui/rows/MessageRows.js +1706 -159
  222. package/dist/chat/ui/rows/RowContainer.js +57 -7
  223. package/dist/chat/ui/rows/Rows.js +463 -54
  224. package/dist/chat/ui/rows/SubagentRow.js +577 -60
  225. package/dist/chat/ui/rows/TaskRow.js +359 -40
  226. package/dist/chat/ui/rows/VisualRow.js +233 -11
  227. package/dist/chat/ui/rows/WorkRows.d.ts +3 -0
  228. package/dist/chat/ui/rows/WorkRows.js +1945 -164
  229. package/dist/chat/ui/rows/WorkflowRow.js +756 -37
  230. package/dist/chat/ui/rows/row-rhythm.js +27 -17
  231. package/dist/chat/ui/theme-watch.js +26 -23
  232. package/dist/chat/ui/timestamp-format.js +4 -1
  233. package/dist/chat/ui/use-diff-source-tokens.js +70 -34
  234. package/dist/chat/ui/useToggleSet.js +51 -19
  235. package/dist/chat/ui/visual-theme.js +153 -128
  236. package/dist/chat/visual-bridge.js +123 -123
  237. package/dist/chat/visual-viewport.js +94 -83
  238. package/dist/chat/visuals.js +13 -5
  239. package/dist/host-hooks.d.ts +29 -0
  240. package/dist/host-hooks.js +78 -0
  241. package/dist/host.js +120 -48
  242. package/dist/index.js +1 -1
  243. package/dist/lazy.js +38 -32
  244. package/dist/locales/en/agent-chat.d.ts +42 -0
  245. package/dist/locales/en/agent-chat.js +755 -713
  246. package/dist/locales/en/agent-prompts.js +42 -42
  247. package/dist/locales/en/agent-providers.d.ts +1 -0
  248. package/dist/locales/en/agent-providers.js +166 -165
  249. package/dist/locales/en/agent-usage.d.ts +6 -0
  250. package/dist/locales/en/agent-usage.js +129 -123
  251. package/dist/locales/nl/agent-chat.d.ts +42 -0
  252. package/dist/locales/nl/agent-chat.js +755 -713
  253. package/dist/locales/nl/agent-prompts.js +42 -42
  254. package/dist/locales/nl/agent-providers.d.ts +1 -0
  255. package/dist/locales/nl/agent-providers.js +166 -165
  256. package/dist/locales/nl/agent-usage.d.ts +6 -0
  257. package/dist/locales/nl/agent-usage.js +129 -123
  258. package/dist/locales.js +14 -14
  259. package/dist/mounted-registry.js +31 -30
  260. package/dist/port-transport.js +122 -111
  261. package/dist/prompts/index.js +1 -1
  262. package/dist/prompts/logic/focus.js +15 -14
  263. package/dist/prompts/logic/keys.js +93 -59
  264. package/dist/prompts/logic/prompts.js +27 -14
  265. package/dist/prompts/logic/subjects.js +60 -46
  266. package/dist/prompts/logic/useFocusAfterAnswer.js +60 -20
  267. package/dist/prompts/logic/usePromptSession.js +88 -77
  268. package/dist/prompts/ui/ApprovalBody.js +246 -27
  269. package/dist/prompts/ui/PromptActions.js +215 -9
  270. package/dist/prompts/ui/PromptCard.js +215 -36
  271. package/dist/prompts/ui/PromptView.js +372 -34
  272. package/dist/prompts/ui/QuestionBody.js +269 -73
  273. package/dist/providers/AccountColors.js +36 -5
  274. package/dist/providers/AccountDetail.js +683 -50
  275. package/dist/providers/AccountVariables.js +139 -32
  276. package/dist/providers/AddAccountForm.js +125 -38
  277. package/dist/providers/CliDetail.js +343 -36
  278. package/dist/providers/InstallPage.js +644 -59
  279. package/dist/providers/ProviderList.d.ts +2 -1
  280. package/dist/providers/ProviderList.js +215 -23
  281. package/dist/providers/ProvidersPane.d.ts +4 -2
  282. package/dist/providers/ProvidersPane.js +244 -64
  283. package/dist/providers/account-actions.js +54 -30
  284. package/dist/providers/index.js +1 -1
  285. package/dist/providers/install-steps.js +12 -9
  286. package/dist/providers/pane-target.d.ts +3 -0
  287. package/dist/providers/pane-target.js +34 -13
  288. package/dist/providers/parts.js +62 -12
  289. package/dist/providers/provider-abilities.js +5 -5
  290. package/dist/providers/provider-groups.js +75 -40
  291. package/dist/providers/variables.js +73 -39
  292. package/dist/scope.js +6 -6
  293. package/dist/settings/sections.js +18 -18
  294. package/dist/state/chats.js +404 -192
  295. package/dist/state/index.js +1 -1
  296. package/dist/state/provider-accounts.js +70 -47
  297. package/dist/state/providers.js +45 -16
  298. package/dist/state/usage.js +154 -77
  299. package/dist/storage.js +69 -68
  300. package/dist/testing/index.js +1 -1
  301. package/dist/testing/prompts.js +105 -67
  302. package/dist/transport.js +10 -10
  303. package/dist/ui/PlainTextarea.js +27 -3
  304. package/dist/usage/LimitsList.js +646 -40
  305. package/dist/usage/UsageBreakdown.js +879 -38
  306. package/dist/usage/UsageChart.js +311 -32
  307. package/dist/usage/UsageDialog.js +46 -4
  308. package/dist/usage/UsageLimits.js +467 -34
  309. package/dist/usage/UsageLimitsCard.js +95 -11
  310. package/dist/usage/UsagePage.js +817 -96
  311. package/dist/usage/UsagePane.js +164 -10
  312. package/dist/usage/UsageSummary.js +151 -6
  313. package/dist/usage/UsageTiles.js +164 -14
  314. package/dist/usage/format.js +32 -32
  315. package/dist/usage/index.d.ts +1 -1
  316. package/dist/usage/index.js +2 -1
  317. package/dist/usage/limit-groups.d.ts +2 -0
  318. package/dist/usage/limit-groups.js +77 -59
  319. package/dist/usage/limits.js +78 -43
  320. package/dist/usage/money.js +20 -4
  321. package/dist/usage/summary.js +85 -64
  322. package/package.json +9 -9
  323. package/src/agents/ModelOptionControl.tsx +3 -1
  324. package/src/agents/option-words.ts +27 -0
  325. package/src/chat/account-choice.ts +41 -1
  326. package/src/chat/composer-effort.ts +32 -0
  327. package/src/chat/forks.ts +4 -5
  328. package/src/chat/index.ts +3 -1
  329. package/src/chat/logic/effort.ts +32 -0
  330. package/src/chat/logic/picker-entries.ts +45 -10
  331. package/src/chat/logic/resume-compaction.ts +95 -17
  332. package/src/chat/logic/timeline.ts +11 -3
  333. package/src/chat/logic/workflow.ts +86 -4
  334. package/src/chat/preferences.ts +35 -0
  335. package/src/chat/subagent-view.ts +2 -3
  336. package/src/chat/ui/AnsiOutput.tsx +1 -2
  337. package/src/chat/ui/BookmarkSubmenu.tsx +3 -3
  338. package/src/chat/ui/ChatActivity.tsx +14 -22
  339. package/src/chat/ui/ChatReferenceChip.tsx +2 -3
  340. package/src/chat/ui/Composer.tsx +15 -7
  341. package/src/chat/ui/EditDiff.tsx +2 -3
  342. package/src/chat/ui/LimitState.tsx +2 -2
  343. package/src/chat/ui/Markdown.tsx +10 -8
  344. package/src/chat/ui/MermaidBlock.tsx +57 -49
  345. package/src/chat/ui/Pickers.tsx +49 -29
  346. package/src/chat/ui/PromptComposer.tsx +7 -9
  347. package/src/chat/ui/ResumeCompactionDock.tsx +16 -4
  348. package/src/chat/ui/RunSettings.tsx +67 -28
  349. package/src/chat/ui/Scrubber.tsx +3 -3
  350. package/src/chat/ui/ShellCommand.tsx +2 -0
  351. package/src/chat/ui/SubagentInfo.tsx +2 -3
  352. package/src/chat/ui/SubagentTimeline.tsx +12 -16
  353. package/src/chat/ui/Timeline.tsx +6 -6
  354. package/src/chat/ui/UnifiedDiff.tsx +3 -4
  355. package/src/chat/ui/VisualFrame.tsx +5 -8
  356. package/src/chat/ui/code-theme.ts +4 -4
  357. package/src/chat/ui/composer/placeholder.ts +2 -2
  358. package/src/chat/ui/composer/use-compaction-offer.ts +36 -16
  359. package/src/chat/ui/composer/use-composer-menus.ts +4 -9
  360. package/src/chat/ui/composer/use-composer-submit.ts +2 -1
  361. package/src/chat/ui/composer/use-effort-stepper.ts +56 -0
  362. package/src/chat/ui/composer/use-notice.ts +2 -2
  363. package/src/chat/ui/diff/EditorEditDiff.tsx +9 -13
  364. package/src/chat/ui/diff/LegacyEditDiff.tsx +12 -17
  365. package/src/chat/ui/diff/LegacyUnifiedDiff.tsx +13 -21
  366. package/src/chat/ui/diff/use-review-stack.ts +4 -4
  367. package/src/chat/ui/diff-theme.ts +3 -3
  368. package/src/chat/ui/file-links.ts +2 -2
  369. package/src/chat/ui/intelligent-ui/UiReply.tsx +2 -0
  370. package/src/chat/ui/intelligent-ui/renderers/chart.tsx +3 -3
  371. package/src/chat/ui/intelligent-ui/renderers/content.tsx +5 -6
  372. package/src/chat/ui/intelligent-ui/renderers/map-view.tsx +2 -1
  373. package/src/chat/ui/intelligent-ui/renderers/map.tsx +2 -1
  374. package/src/chat/ui/intelligent-ui/use-truncated.ts +16 -19
  375. package/src/chat/ui/intelligent-ui/use-ui-links.ts +3 -3
  376. package/src/chat/ui/mermaid.ts +52 -96
  377. package/src/chat/ui/rows/ForksRow.tsx +3 -5
  378. package/src/chat/ui/rows/GeneratedImageRow.tsx +2 -1
  379. package/src/chat/ui/rows/MessageRows.tsx +12 -21
  380. package/src/chat/ui/rows/SubagentRow.tsx +3 -3
  381. package/src/chat/ui/rows/TaskRow.tsx +1 -1
  382. package/src/chat/ui/rows/WorkRows.tsx +11 -6
  383. package/src/chat/ui/rows/WorkflowRow.tsx +144 -54
  384. package/src/chat/ui/useToggleSet.ts +15 -18
  385. package/src/chat/ui/visual-theme.ts +2 -3
  386. package/src/host-hooks.ts +113 -0
  387. package/src/lazy.tsx +2 -0
  388. package/src/locales/en/agent-chat.ts +142 -108
  389. package/src/locales/en/agent-prompts.ts +7 -7
  390. package/src/locales/en/agent-providers.ts +35 -34
  391. package/src/locales/en/agent-usage.ts +26 -20
  392. package/src/locales/nl/agent-chat.ts +134 -100
  393. package/src/locales/nl/agent-prompts.ts +5 -5
  394. package/src/locales/nl/agent-providers.ts +33 -32
  395. package/src/locales/nl/agent-usage.ts +25 -20
  396. package/src/providers/CliDetail.tsx +2 -1
  397. package/src/providers/InstallPage.tsx +2 -4
  398. package/src/providers/ProviderList.tsx +12 -2
  399. package/src/providers/ProvidersPane.tsx +45 -15
  400. package/src/providers/pane-target.ts +20 -4
  401. package/src/state/chats.ts +2 -2
  402. package/src/usage/LimitsList.tsx +12 -13
  403. package/src/usage/UsageBreakdown.tsx +17 -6
  404. package/src/usage/UsageLimits.tsx +2 -1
  405. package/src/usage/UsagePage.tsx +3 -3
  406. package/src/usage/index.ts +1 -1
  407. package/src/usage/limit-groups.ts +12 -0
  408. package/src/usage/limits.ts +2 -2
  409. package/src/usage/money.ts +1 -2
@@ -5,146 +5,199 @@ import { STASH_SHORTCUT } from '../../stash.js';
5
5
  import { pageTimeline } from '../../timeline-scroll.js';
6
6
  import { enterAction, inCode, inFenceBody, inOpenFence, listItemAt, recallDirection, tabSpaces } from './keys.js';
7
7
  const SEND_HOW = {
8
- send: 'default',
9
- 'send-alternate': 'alternate',
10
- 'send-and-new': 'and-new'
8
+ send: 'default',
9
+ 'send-alternate': 'alternate',
10
+ 'send-and-new': 'and-new'
11
11
  };
12
12
  /* In a fence Tab indents like a code editor; anywhere else it keeps moving the focus. */
13
13
  function indentInFence(e, view) {
14
- const { state } = view;
15
- const { from, to, head } = state.selection.main;
16
- const tree = ensureSyntaxTree(state, state.doc.length, 50) ?? syntaxTree(state);
17
- if (!inFenceBody(tree, state.doc.toString(), head)) {
18
- return false;
14
+ const {
15
+ state
16
+ } = view;
17
+ const {
18
+ from,
19
+ to,
20
+ head
21
+ } = state.selection.main;
22
+ const tree = ensureSyntaxTree(state, state.doc.length, 50) ?? syntaxTree(state);
23
+ if (!inFenceBody(tree, state.doc.toString(), head)) {
24
+ return false;
25
+ }
26
+ // Handled even when there is nothing to outdent, so Shift+Tab never throws the focus out of a block.
27
+ if (e.shiftKey) {
28
+ indentLess(view);
29
+ } else if (from !== to) {
30
+ indentMore(view);
31
+ } else {
32
+ view.dispatch(state.replaceSelection(tabSpaces(head - state.doc.lineAt(head).from)), {
33
+ scrollIntoView: true,
34
+ userEvent: 'input'
35
+ });
36
+ }
37
+ return true;
38
+ }
39
+ /* The keys an open picker takes: the arrows walk it, and Tab (or Enter, outside the commands) picks. */
40
+ function pickInMenu(e, {
41
+ menus,
42
+ setText
43
+ }) {
44
+ const {
45
+ activeIndex
46
+ } = menus;
47
+ if (menus.commandMenuOpen) {
48
+ if (menus.moveInMenu(e.key, menus.commands.length)) {
49
+ return true;
19
50
  }
20
- // Handled even when there is nothing to outdent, so Shift+Tab never throws the focus out of a block.
21
- if (e.shiftKey) {
22
- indentLess(view);
51
+ if (e.key === 'Tab') {
52
+ const chosen = menus.commands[activeIndex];
53
+ if (chosen.skill) {
54
+ menus.chooseSkill(chosen.name);
55
+ } else {
56
+ setText(`/${chosen.name} `);
57
+ }
58
+ return true;
23
59
  }
24
- else if (from !== to) {
25
- indentMore(view);
60
+ }
61
+ if (menus.skillMenuOpen) {
62
+ if (menus.moveInMenu(e.key, menus.skillMatches.length)) {
63
+ return true;
26
64
  }
27
- else {
28
- view.dispatch(state.replaceSelection(tabSpaces(head - state.doc.lineAt(head).from)), { scrollIntoView: true, userEvent: 'input' });
65
+ if (e.key === 'Tab' || e.key === 'Enter') {
66
+ menus.chooseSkill((menus.skillMatches[activeIndex] ?? menus.skillMatches[0]).name);
67
+ return true;
29
68
  }
30
- return true;
31
- }
32
- /* The keys an open picker takes: the arrows walk it, and Tab (or Enter, outside the commands) picks. */
33
- function pickInMenu(e, { menus, setText }) {
34
- const { activeIndex } = menus;
35
- if (menus.commandMenuOpen) {
36
- if (menus.moveInMenu(e.key, menus.commands.length)) {
37
- return true;
38
- }
39
- if (e.key === 'Tab') {
40
- const chosen = menus.commands[activeIndex];
41
- if (chosen.skill) {
42
- menus.chooseSkill(chosen.name);
43
- }
44
- else {
45
- setText(`/${chosen.name} `);
46
- }
47
- return true;
48
- }
49
- }
50
- if (menus.skillMenuOpen) {
51
- if (menus.moveInMenu(e.key, menus.skillMatches.length)) {
52
- return true;
53
- }
54
- if (e.key === 'Tab' || e.key === 'Enter') {
55
- menus.chooseSkill((menus.skillMatches[activeIndex] ?? menus.skillMatches[0]).name);
56
- return true;
57
- }
69
+ }
70
+ if (menus.mentionMenuOpen && menus.mentionCount > 0) {
71
+ if (menus.moveInMenu(e.key, menus.mentionCount)) {
72
+ return true;
58
73
  }
59
- if (menus.mentionMenuOpen && menus.mentionCount > 0) {
60
- if (menus.moveInMenu(e.key, menus.mentionCount)) {
61
- return true;
62
- }
63
- if (e.key === 'Tab' || e.key === 'Enter') {
64
- menus.chooseMentionAt(activeIndex);
65
- return true;
66
- }
74
+ if (e.key === 'Tab' || e.key === 'Enter') {
75
+ menus.chooseMentionAt(activeIndex);
76
+ return true;
67
77
  }
68
- return false;
78
+ }
79
+ return false;
69
80
  }
70
81
  /* Enter sends, adds a line, or carries a list on, by the send key and where the caret is. */
71
- function enter(e, view, { host, sendKey, submit }) {
72
- const { state } = view;
73
- const { from, to, head } = state.selection.main;
74
- // Parsed to the end, since the fence that closes the block can sit after the caret.
75
- const tree = ensureSyntaxTree(state, state.doc.length, 50) ?? syntaxTree(state);
76
- const line = state.doc.lineAt(head);
77
- const list = from === to && !inCode(tree, state.doc.toString(), head) ? listItemAt(line.text) : null;
78
- const action = enterAction({ shift: e.shiftKey, mod: isModHeld(e, host.isApplePlatform()), alt: e.altKey }, {
79
- inOpenFence: inOpenFence(tree, head),
80
- list,
81
- column: head - line.from,
82
- sendKey,
83
- multiline: state.doc.lines > 1,
84
- startsNewChat: host.openNewChat !== null
85
- });
86
- if (action === 'newline') {
87
- return insertNewline(view);
88
- }
89
- if (action === 'continue-list') {
90
- if (list) {
91
- view.dispatch({
92
- changes: { from: head, insert: `\n${list.next}` },
93
- selection: { anchor: head + 1 + list.next.length },
94
- scrollIntoView: true,
95
- userEvent: 'input'
96
- });
97
- }
98
- return true;
99
- }
100
- if (action === 'leave-list') {
101
- view.dispatch({ changes: { from: line.from, to: line.to }, selection: { anchor: line.from }, userEvent: 'delete' });
102
- return true;
82
+ function enter(e, view, {
83
+ host,
84
+ sendKey,
85
+ submit
86
+ }) {
87
+ const {
88
+ state
89
+ } = view;
90
+ const {
91
+ from,
92
+ to,
93
+ head
94
+ } = state.selection.main;
95
+ // Parsed to the end, since the fence that closes the block can sit after the caret.
96
+ const tree = ensureSyntaxTree(state, state.doc.length, 50) ?? syntaxTree(state);
97
+ const line = state.doc.lineAt(head);
98
+ const list = from === to && !inCode(tree, state.doc.toString(), head) ? listItemAt(line.text) : null;
99
+ const action = enterAction({
100
+ shift: e.shiftKey,
101
+ mod: isModHeld(e, host.isApplePlatform()),
102
+ alt: e.altKey
103
+ }, {
104
+ inOpenFence: inOpenFence(tree, head),
105
+ list,
106
+ column: head - line.from,
107
+ sendKey,
108
+ multiline: state.doc.lines > 1,
109
+ startsNewChat: host.openNewChat !== null
110
+ });
111
+ if (action === 'newline') {
112
+ return insertNewline(view);
113
+ }
114
+ if (action === 'continue-list') {
115
+ if (list) {
116
+ view.dispatch({
117
+ changes: {
118
+ from: head,
119
+ insert: `\n${list.next}`
120
+ },
121
+ selection: {
122
+ anchor: head + 1 + list.next.length
123
+ },
124
+ scrollIntoView: true,
125
+ userEvent: 'input'
126
+ });
103
127
  }
104
- submit(SEND_HOW[action]);
105
128
  return true;
129
+ }
130
+ if (action === 'leave-list') {
131
+ view.dispatch({
132
+ changes: {
133
+ from: line.from,
134
+ to: line.to
135
+ },
136
+ selection: {
137
+ anchor: line.from
138
+ },
139
+ userEvent: 'delete'
140
+ });
141
+ return true;
142
+ }
143
+ submit(SEND_HOW[action]);
144
+ return true;
106
145
  }
107
146
  /* Runs before the editor's own keymap; true means the key is handled and its default prevented. */
108
147
  export function composerKeyHandler(input) {
109
- const { chatId, host, text, history } = input;
110
- return (e, view) => {
111
- input.noteKey(e);
112
- // Escape leaves the node, unless it first has a recalled prompt to put back.
113
- if (e.key === 'Escape' && !e.isComposing) {
114
- if (!history.leave()) {
115
- return false;
116
- }
117
- e.stopPropagation();
118
- return true;
119
- }
120
- // The app's own shortcuts stay the app's while you type: Mod+Shift+Enter would otherwise send as well.
121
- if (host.isAppShortcut(e)) {
122
- return false;
123
- }
124
- e.stopPropagation();
125
- // A key inside an IME composition belongs to the composition, Enter and the arrows included.
126
- if (e.isComposing) {
127
- return false;
128
- }
129
- // Reading back through a long answer should not mean leaving the box you are typing in.
130
- if (e.key === 'PageUp' || e.key === 'PageDown') {
131
- return pageTimeline(chatId, e.key === 'PageUp' ? -1 : 1);
132
- }
133
- if (matchesShortcut(STASH_SHORTCUT, e, host.isApplePlatform())) {
134
- input.toggleStash();
135
- return true;
136
- }
137
- if (pickInMenu(e, input)) {
138
- return true;
139
- }
140
- if (e.key === 'Tab' && !e.altKey && !e.metaKey && !e.ctrlKey && indentInFence(e, view)) {
141
- return true;
142
- }
143
- if (e.key === 'Enter') {
144
- return enter(e, view, input);
145
- }
146
- const { from, to } = view.state.selection.main;
147
- const direction = recallDirection({ key: e.key, text, from, to, recalled: history.recalled(text) });
148
- return direction !== null && history.recall(direction);
149
- };
150
- }
148
+ const {
149
+ chatId,
150
+ host,
151
+ text,
152
+ history
153
+ } = input;
154
+ return (e, view) => {
155
+ input.noteKey(e);
156
+ // Escape leaves the node, unless it first has a recalled prompt to put back.
157
+ if (e.key === 'Escape' && !e.isComposing) {
158
+ if (!history.leave()) {
159
+ return false;
160
+ }
161
+ e.stopPropagation();
162
+ return true;
163
+ }
164
+ // The app's own shortcuts stay the app's while you type: Mod+Shift+Enter would otherwise send as well.
165
+ if (host.isAppShortcut(e)) {
166
+ return false;
167
+ }
168
+ e.stopPropagation();
169
+ // A key inside an IME composition belongs to the composition, Enter and the arrows included.
170
+ if (e.isComposing) {
171
+ return false;
172
+ }
173
+ // Reading back through a long answer should not mean leaving the box you are typing in.
174
+ if (e.key === 'PageUp' || e.key === 'PageDown') {
175
+ return pageTimeline(chatId, e.key === 'PageUp' ? -1 : 1);
176
+ }
177
+ if (matchesShortcut(STASH_SHORTCUT, e, host.isApplePlatform())) {
178
+ input.toggleStash();
179
+ return true;
180
+ }
181
+ if (pickInMenu(e, input)) {
182
+ return true;
183
+ }
184
+ if (e.key === 'Tab' && !e.altKey && !e.metaKey && !e.ctrlKey && indentInFence(e, view)) {
185
+ return true;
186
+ }
187
+ if (e.key === 'Enter') {
188
+ return enter(e, view, input);
189
+ }
190
+ const {
191
+ from,
192
+ to
193
+ } = view.state.selection.main;
194
+ const direction = recallDirection({
195
+ key: e.key,
196
+ text,
197
+ from,
198
+ to,
199
+ recalled: history.recalled(text)
200
+ });
201
+ return direction !== null && history.recall(direction);
202
+ };
203
+ }
@@ -2,13 +2,17 @@ import { modSends } from '../../send-key.js';
2
2
  const LIST_ITEM = /^([ \t]*)(?:([-*+])|(\d{1,9})([.)]))([ \t]+)(\[[ xX]\](?:[ \t]+|$))?/;
3
3
  /* The list item a line starts, if it starts one. */
4
4
  export function listItemAt(line) {
5
- const match = LIST_ITEM.exec(line);
6
- if (match === null) {
7
- return null;
8
- }
9
- const [prefix, indent, bullet, number, delimiter, space, task] = match;
10
- const marker = bullet ?? `${Number(number) + 1}${delimiter}`;
11
- return { prefix, next: `${indent}${marker}${space}${task ? '[ ] ' : ''}`, empty: line.slice(prefix.length).trim() === '' };
5
+ const match = LIST_ITEM.exec(line);
6
+ if (match === null) {
7
+ return null;
8
+ }
9
+ const [prefix, indent, bullet, number, delimiter, space, task] = match;
10
+ const marker = bullet ?? `${Number(number) + 1}${delimiter}`;
11
+ return {
12
+ prefix,
13
+ next: `${indent}${marker}${space}${task ? '[ ] ' : ''}`,
14
+ empty: line.slice(prefix.length).trim() === ''
15
+ };
12
16
  }
13
17
  /*
14
18
  * Enter sends, except where whoever types is still writing: inside a fence nobody has closed yet
@@ -17,59 +21,66 @@ export function listItemAt(line) {
17
21
  * is Mod+Enter, Enter adds a line instead of sending. Alt sends the other way (queue or steer), and so
18
22
  * does Mod+Shift+Enter where Mod+Enter is the send key; Mod+Alt+Enter is the send that opens a new chat.
19
23
  */
20
- export function enterAction(keys, { inOpenFence, list, column, sendKey = 'enter', multiline = false, startsNewChat = false }) {
21
- const modOnly = modSends(sendKey, multiline);
22
- if (keys.mod) {
23
- if (keys.alt && startsNewChat) {
24
- return 'send-and-new';
25
- }
26
- return keys.alt || (modOnly && keys.shift) ? 'send-alternate' : 'send';
27
- }
28
- if (keys.shift || inOpenFence) {
29
- return 'newline';
30
- }
31
- if (list !== null) {
32
- // A caret in front of the marker moves the item down rather than splitting its marker.
33
- if (column < list.prefix.length) {
34
- return 'newline';
35
- }
36
- return list.empty ? 'leave-list' : 'continue-list';
24
+ export function enterAction(keys, {
25
+ inOpenFence,
26
+ list,
27
+ column,
28
+ sendKey = 'enter',
29
+ multiline = false,
30
+ startsNewChat = false
31
+ }) {
32
+ const modOnly = modSends(sendKey, multiline);
33
+ if (keys.mod) {
34
+ if (keys.alt && startsNewChat) {
35
+ return 'send-and-new';
37
36
  }
38
- if (keys.alt) {
39
- return 'send-alternate';
37
+ return keys.alt || modOnly && keys.shift ? 'send-alternate' : 'send';
38
+ }
39
+ if (keys.shift || inOpenFence) {
40
+ return 'newline';
41
+ }
42
+ if (list !== null) {
43
+ // A caret in front of the marker moves the item down rather than splitting its marker.
44
+ if (column < list.prefix.length) {
45
+ return 'newline';
40
46
  }
41
- return modOnly ? 'newline' : 'send';
47
+ return list.empty ? 'leave-list' : 'continue-list';
48
+ }
49
+ if (keys.alt) {
50
+ return 'send-alternate';
51
+ }
52
+ return modOnly ? 'newline' : 'send';
42
53
  }
43
54
  /* The innermost fenced code block around `pos`, if any. */
44
55
  function enclosingFence(tree, pos) {
45
- for (let node = tree.resolveInner(pos, -1); node !== null; node = node.parent) {
46
- if (node.name === 'FencedCode') {
47
- return node;
48
- }
56
+ for (let node = tree.resolveInner(pos, -1); node !== null; node = node.parent) {
57
+ if (node.name === 'FencedCode') {
58
+ return node;
49
59
  }
50
- return null;
60
+ }
61
+ return null;
51
62
  }
52
63
  /* A fence nobody has closed yet has its opening mark only. */
53
64
  function isOpenFence(fence) {
54
- return fence.getChildren('CodeMark').length < 2;
65
+ return fence.getChildren('CodeMark').length < 2;
55
66
  }
56
67
  /* Whether `pos` sits inside a fenced code block that has an opening fence and no closing one yet. */
57
68
  export function inOpenFence(tree, pos) {
58
- const fence = enclosingFence(tree, pos);
59
- return fence !== null && pos > fence.from && isOpenFence(fence);
69
+ const fence = enclosingFence(tree, pos);
70
+ return fence !== null && pos > fence.from && isOpenFence(fence);
60
71
  }
61
72
  /* Whether `pos` sits in the body of a fenced code block, open or closed: below its opening line and before its end. */
62
73
  export function inFenceBody(tree, text, pos) {
63
- const fence = enclosingFence(tree, pos);
64
- if (fence === null) {
65
- return false;
66
- }
67
- const openingEnd = text.indexOf('\n', fence.from);
68
- return openingEnd !== -1 && pos > openingEnd && (pos < fence.to || isOpenFence(fence));
74
+ const fence = enclosingFence(tree, pos);
75
+ if (fence === null) {
76
+ return false;
77
+ }
78
+ const openingEnd = text.indexOf('\n', fence.from);
79
+ return openingEnd !== -1 && pos > openingEnd && (pos < fence.to || isOpenFence(fence));
69
80
  }
70
81
  /* The spaces Tab inserts at `column`, up to the next stop of four, the way a code editor lines up. */
71
82
  export function tabSpaces(column) {
72
- return ' '.repeat(4 - (column % 4));
83
+ return ' '.repeat(4 - column % 4);
73
84
  }
74
85
  const INLINE_BLOCK = /^(Paragraph|ATXHeading\d|SetextHeading\d)$/;
75
86
  /*
@@ -78,41 +89,47 @@ const INLINE_BLOCK = /^(Paragraph|ATXHeading\d|SetextHeading\d)$/;
78
89
  * counts as well: whoever types after it is writing code.
79
90
  */
80
91
  export function inCode(tree, text, pos) {
81
- let blockFrom = null;
82
- for (let node = tree.resolveInner(pos, -1); node !== null; node = node.parent) {
83
- if (node.name === 'FencedCode') {
84
- return pos > node.from && (pos < node.to || isOpenFence(node));
85
- }
86
- if (node.name === 'InlineCode' && pos > node.from && pos < node.to) {
87
- return true;
88
- }
89
- if (blockFrom === null && INLINE_BLOCK.test(node.name)) {
90
- blockFrom = node.from;
91
- }
92
+ let blockFrom = null;
93
+ for (let node = tree.resolveInner(pos, -1); node !== null; node = node.parent) {
94
+ if (node.name === 'FencedCode') {
95
+ return pos > node.from && (pos < node.to || isOpenFence(node));
96
+ }
97
+ if (node.name === 'InlineCode' && pos > node.from && pos < node.to) {
98
+ return true;
92
99
  }
93
- let from = blockFrom ?? text.lastIndexOf('\n', pos - 1) + 1;
94
- tree.iterate({
95
- from,
96
- to: pos,
97
- enter: (node) => {
98
- if (node.name === 'InlineCode' && node.to <= pos) {
99
- from = Math.max(from, node.to);
100
- }
101
- }
102
- });
103
- return /(^|[^\\])`/.test(text.slice(from, pos));
100
+ if (blockFrom === null && INLINE_BLOCK.test(node.name)) {
101
+ blockFrom = node.from;
102
+ }
103
+ }
104
+ let from = blockFrom ?? text.lastIndexOf('\n', pos - 1) + 1;
105
+ tree.iterate({
106
+ from,
107
+ to: pos,
108
+ enter: node => {
109
+ if (node.name === 'InlineCode' && node.to <= pos) {
110
+ from = Math.max(from, node.to);
111
+ }
112
+ }
113
+ });
114
+ return /(^|[^\\])`/.test(text.slice(from, pos));
104
115
  }
105
116
  /*
106
117
  * Which way the arrow walks through earlier prompts, or null when the arrow just moves the caret.
107
118
  * Only an empty box or an unedited recall walks, so an arrow in a prompt being written never
108
119
  * throws it away.
109
120
  */
110
- export function recallDirection({ key, text, from, to, recalled }) {
111
- if (key === 'ArrowUp' && (text === '' || (recalled && from === 0))) {
112
- return -1;
113
- }
114
- if (key === 'ArrowDown' && recalled && to === text.length) {
115
- return 1;
116
- }
117
- return null;
118
- }
121
+ export function recallDirection({
122
+ key,
123
+ text,
124
+ from,
125
+ to,
126
+ recalled
127
+ }) {
128
+ if (key === 'ArrowUp' && (text === '' || recalled && from === 0)) {
129
+ return -1;
130
+ }
131
+ if (key === 'ArrowDown' && recalled && to === text.length) {
132
+ return 1;
133
+ }
134
+ return null;
135
+ }
@@ -1,18 +1,27 @@
1
1
  /* The index that still points at an option once the list has shrunk under a stale one. */
2
2
  export function clampMenuIndex(index, count) {
3
- return Math.min(index, Math.max(count - 1, 0));
3
+ return Math.min(index, Math.max(count - 1, 0));
4
4
  }
5
5
  export function optionIdOf(listId, index) {
6
- return `${listId}-${index}`;
6
+ return `${listId}-${index}`;
7
7
  }
8
8
  /*
9
9
  * The attributes the editor's content element takes while a suggestion menu stands beside it. The
10
10
  * element keeps its `textbox` role; ARIA 1.2 lets it name the option the arrow keys are on.
11
11
  */
12
- export function composerMenuAria({ label, listId, open, activeIndex, count }) {
13
- return {
14
- 'aria-label': label,
15
- 'aria-autocomplete': 'list',
16
- ...(open && count > 0 ? { 'aria-controls': listId, 'aria-activedescendant': optionIdOf(listId, activeIndex) } : {})
17
- };
18
- }
12
+ export function composerMenuAria({
13
+ label,
14
+ listId,
15
+ open,
16
+ activeIndex,
17
+ count
18
+ }) {
19
+ return {
20
+ 'aria-label': label,
21
+ 'aria-autocomplete': 'list',
22
+ ...(open && count > 0 ? {
23
+ 'aria-controls': listId,
24
+ 'aria-activedescendant': optionIdOf(listId, activeIndex)
25
+ } : {})
26
+ };
27
+ }