@adecore/agents-react 0.39.0 → 0.40.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 (317) hide show
  1. package/dist/agents/AgentModelLabel.js +2 -1
  2. package/dist/agents/model-name.js +2 -1
  3. package/dist/agents/provider-paths.d.ts +2 -1
  4. package/dist/agents/provider-paths.js +7 -3
  5. package/dist/chat/account-choice.js +57 -28
  6. package/dist/chat/bookmarks.js +2 -1
  7. package/dist/chat/drafts.d.ts +0 -1
  8. package/dist/chat/drafts.js +9 -28
  9. package/dist/chat/logic/picker-entries.js +2 -8
  10. package/dist/chat/logic/resume-compaction.js +2 -5
  11. package/dist/chat/logic/timeline-copy.js +2 -8
  12. package/dist/chat/logic/timeline.js +9 -10
  13. package/dist/chat/logic/workflow.js +2 -4
  14. package/dist/chat/subagent-conversation.js +2 -1
  15. package/dist/chat/ui/GoalDock.js +2 -1
  16. package/dist/chat/ui/LimitState.js +4 -6
  17. package/dist/chat/ui/composer/use-continuable-turn.js +0 -1
  18. package/dist/chat/ui/composer/use-notice.js +2 -1
  19. package/dist/chat/ui/composer/use-prompt-history.js +1 -1
  20. package/dist/chat/ui/composer/use-prompt-menus.js +216 -253
  21. package/dist/chat/ui/composer/use-take-back.js +2 -2
  22. package/dist/chat/ui/diff/ApprovalReview.js +1 -1
  23. package/dist/chat/ui/highlighter.d.ts +0 -6
  24. package/dist/chat/ui/highlighter.js +0 -12
  25. package/dist/chat/ui/icons.d.ts +0 -1
  26. package/dist/chat/ui/icons.js +0 -3
  27. package/dist/chat/ui/rows/MessageRows.js +2 -5
  28. package/dist/chat/ui/rows/row-rhythm.js +2 -5
  29. package/dist/chat/ui/theme-watch.js +3 -7
  30. package/dist/prompts/logic/usePromptSession.js +2 -1
  31. package/dist/providers/AddAccountForm.js +2 -1
  32. package/dist/providers/CliDetail.js +104 -130
  33. package/dist/providers/account-actions.js +6 -9
  34. package/dist/state/chats.d.ts +1 -0
  35. package/dist/state/chats.js +6 -11
  36. package/dist/state/provider-accounts.d.ts +1 -1
  37. package/dist/state/provider-accounts.js +2 -8
  38. package/dist/transport.d.ts +2 -0
  39. package/dist/transport.js +14 -0
  40. package/dist/usage/ChartLogo.d.ts +5 -0
  41. package/dist/usage/ChartLogo.js +48 -0
  42. package/dist/usage/LimitsList.js +6 -16
  43. package/dist/usage/UsageBreakdown.js +17 -40
  44. package/dist/usage/UsageLimits.js +183 -211
  45. package/dist/usage/UsagePage.js +3 -17
  46. package/dist/usage/UsageSummary.js +4 -9
  47. package/dist/usage/limits.js +16 -31
  48. package/dist/usage/summary.d.ts +1 -1
  49. package/dist/usage/summary.js +3 -5
  50. package/package.json +26 -26
  51. package/src/agents/AccountDot.tsx +1 -0
  52. package/src/agents/AgentIcon.tsx +2 -0
  53. package/src/agents/AgentModelLabel.tsx +4 -6
  54. package/src/agents/ModelOptionControl.tsx +8 -0
  55. package/src/agents/account-limits.ts +3 -0
  56. package/src/agents/accounts.ts +12 -0
  57. package/src/agents/model-name.ts +13 -1
  58. package/src/agents/model-options.ts +2 -0
  59. package/src/agents/model-requirement.ts +4 -0
  60. package/src/agents/option-words.ts +2 -0
  61. package/src/agents/provider-paths.ts +8 -3
  62. package/src/agents/status-look.ts +1 -0
  63. package/src/chat/account-choice.ts +25 -19
  64. package/src/chat/actions.ts +5 -0
  65. package/src/chat/attachments.ts +8 -0
  66. package/src/chat/bookmarks.ts +13 -1
  67. package/src/chat/chat-client.ts +63 -0
  68. package/src/chat/chat-references.ts +3 -0
  69. package/src/chat/composer-effort.ts +5 -0
  70. package/src/chat/composer-send.ts +4 -0
  71. package/src/chat/drafts.ts +21 -17
  72. package/src/chat/forks.ts +4 -0
  73. package/src/chat/guards.ts +2 -0
  74. package/src/chat/index.ts +7 -0
  75. package/src/chat/logic/ansi.ts +47 -0
  76. package/src/chat/logic/bookmarks.ts +7 -0
  77. package/src/chat/logic/command-looks.ts +29 -0
  78. package/src/chat/logic/context-usage.ts +3 -0
  79. package/src/chat/logic/continue-after-stop.ts +5 -0
  80. package/src/chat/logic/effort.ts +4 -0
  81. package/src/chat/logic/embedded-code.ts +63 -0
  82. package/src/chat/logic/fork.ts +22 -0
  83. package/src/chat/logic/generated-image.ts +7 -0
  84. package/src/chat/logic/goal.ts +7 -0
  85. package/src/chat/logic/handback.ts +2 -0
  86. package/src/chat/logic/limit.ts +8 -0
  87. package/src/chat/logic/picker-entries.ts +16 -4
  88. package/src/chat/logic/resume-compaction.ts +22 -5
  89. package/src/chat/logic/scrubber.ts +38 -5
  90. package/src/chat/logic/thought.ts +5 -0
  91. package/src/chat/logic/thread-cards.ts +6 -0
  92. package/src/chat/logic/timeline-copy.ts +4 -9
  93. package/src/chat/logic/timeline-target.ts +15 -0
  94. package/src/chat/logic/timeline.ts +113 -10
  95. package/src/chat/logic/tools.ts +30 -0
  96. package/src/chat/logic/visual-height.ts +5 -0
  97. package/src/chat/logic/visual-viewport.ts +1 -0
  98. package/src/chat/logic/welcome.ts +3 -0
  99. package/src/chat/logic/workflow.ts +26 -7
  100. package/src/chat/mentions.ts +56 -0
  101. package/src/chat/pending-prompts.ts +16 -0
  102. package/src/chat/persisted-json.ts +15 -0
  103. package/src/chat/preferences.ts +16 -0
  104. package/src/chat/prompt-hold.ts +2 -0
  105. package/src/chat/quote.ts +7 -0
  106. package/src/chat/reading-width.ts +1 -0
  107. package/src/chat/recent-messages.ts +5 -0
  108. package/src/chat/resume-compaction-dismissals.ts +1 -0
  109. package/src/chat/stash.ts +12 -0
  110. package/src/chat/subagent-conversation.ts +24 -4
  111. package/src/chat/subagent-list.ts +14 -0
  112. package/src/chat/subagent-support.ts +1 -0
  113. package/src/chat/subagent-view.ts +9 -0
  114. package/src/chat/thumbnails.ts +14 -0
  115. package/src/chat/timeline-flash.ts +2 -0
  116. package/src/chat/timeline-scroll.ts +23 -0
  117. package/src/chat/ui/AccountPill.tsx +4 -0
  118. package/src/chat/ui/AnsiOutput.tsx +1 -0
  119. package/src/chat/ui/BookmarkMarker.tsx +5 -0
  120. package/src/chat/ui/BookmarkSubmenu.tsx +1 -0
  121. package/src/chat/ui/ChatActivity.tsx +13 -0
  122. package/src/chat/ui/CodeBlock.tsx +8 -0
  123. package/src/chat/ui/Composer.tsx +15 -0
  124. package/src/chat/ui/ComposerInput.tsx +22 -0
  125. package/src/chat/ui/DiffPool.tsx +3 -0
  126. package/src/chat/ui/EditDiff.tsx +5 -0
  127. package/src/chat/ui/GoalDock.tsx +13 -1
  128. package/src/chat/ui/ImageView.tsx +11 -0
  129. package/src/chat/ui/LimitState.tsx +23 -6
  130. package/src/chat/ui/Markdown.tsx +41 -0
  131. package/src/chat/ui/MermaidBlock.tsx +16 -0
  132. package/src/chat/ui/MessageActions.tsx +8 -0
  133. package/src/chat/ui/ModelMarks.tsx +1 -0
  134. package/src/chat/ui/Pickers.tsx +26 -0
  135. package/src/chat/ui/PromptComposer.tsx +2 -0
  136. package/src/chat/ui/PromptEditor.tsx +6 -0
  137. package/src/chat/ui/QuoteButton.tsx +12 -0
  138. package/src/chat/ui/ReferenceChip.tsx +3 -0
  139. package/src/chat/ui/ResumeCompactionDock.tsx +1 -0
  140. package/src/chat/ui/RowTime.tsx +1 -0
  141. package/src/chat/ui/RunSettings.tsx +38 -0
  142. package/src/chat/ui/Scrubber.tsx +14 -0
  143. package/src/chat/ui/SessionLine.tsx +1 -0
  144. package/src/chat/ui/ShellCommand.tsx +32 -0
  145. package/src/chat/ui/SubagentControls.tsx +7 -0
  146. package/src/chat/ui/SubagentInfo.tsx +1 -0
  147. package/src/chat/ui/SubagentStopButton.tsx +6 -0
  148. package/src/chat/ui/SubagentTimeline.tsx +10 -0
  149. package/src/chat/ui/Timeline.tsx +119 -0
  150. package/src/chat/ui/TimelineMenu.tsx +5 -0
  151. package/src/chat/ui/UnifiedDiff.tsx +6 -0
  152. package/src/chat/ui/UploadThumb.tsx +2 -0
  153. package/src/chat/ui/VisualDialogs.tsx +3 -0
  154. package/src/chat/ui/VisualFrame.tsx +15 -0
  155. package/src/chat/ui/Welcome.tsx +1 -0
  156. package/src/chat/ui/chip-clipboard.ts +20 -0
  157. package/src/chat/ui/code-lines.ts +14 -0
  158. package/src/chat/ui/code-theme.ts +1 -0
  159. package/src/chat/ui/composer/ComposerControls.tsx +5 -0
  160. package/src/chat/ui/composer/ComposerMenu.tsx +12 -0
  161. package/src/chat/ui/composer/DraftParts.tsx +2 -0
  162. package/src/chat/ui/composer/QueuedMessages.tsx +4 -0
  163. package/src/chat/ui/composer/chip-paste.ts +16 -0
  164. package/src/chat/ui/composer/chips.ts +6 -0
  165. package/src/chat/ui/composer/editor.ts +9 -0
  166. package/src/chat/ui/composer/insert.ts +2 -0
  167. package/src/chat/ui/composer/key-handler.ts +39 -0
  168. package/src/chat/ui/composer/keys.ts +23 -0
  169. package/src/chat/ui/composer/placeholder.ts +6 -0
  170. package/src/chat/ui/composer/prompt-picks.ts +1 -0
  171. package/src/chat/ui/composer/surface.ts +5 -0
  172. package/src/chat/ui/composer/use-chat-controls.ts +13 -0
  173. package/src/chat/ui/composer/use-compaction-offer.ts +3 -0
  174. package/src/chat/ui/composer/use-composer-menus.ts +2 -0
  175. package/src/chat/ui/composer/use-composer-submit.ts +27 -0
  176. package/src/chat/ui/composer/use-continuable-turn.ts +3 -5
  177. package/src/chat/ui/composer/use-draft-files.ts +24 -0
  178. package/src/chat/ui/composer/use-effort-stepper.ts +8 -0
  179. package/src/chat/ui/composer/use-notice.ts +4 -1
  180. package/src/chat/ui/composer/use-pending-requests.ts +3 -0
  181. package/src/chat/ui/composer/use-prompt-history.ts +20 -11
  182. package/src/chat/ui/composer/use-prompt-hold.ts +3 -0
  183. package/src/chat/ui/composer/use-prompt-menus.ts +34 -14
  184. package/src/chat/ui/composer/use-take-back.ts +20 -2
  185. package/src/chat/ui/diff/ApprovalReview.tsx +18 -15
  186. package/src/chat/ui/diff/DiffFallbackBoundary.tsx +1 -0
  187. package/src/chat/ui/diff/DiffOmitted.tsx +1 -0
  188. package/src/chat/ui/diff/DiffStack.tsx +2 -0
  189. package/src/chat/ui/diff/DiffUnavailable.tsx +1 -0
  190. package/src/chat/ui/diff/EditorEditDiff.tsx +13 -0
  191. package/src/chat/ui/diff/EditorPatchDiff.tsx +4 -0
  192. package/src/chat/ui/diff/LegacyDiffPool.tsx +2 -0
  193. package/src/chat/ui/diff/LegacyEditDiff.tsx +2 -0
  194. package/src/chat/ui/diff/LegacyUnifiedDiff.tsx +8 -0
  195. package/src/chat/ui/diff/RawDiff.tsx +1 -0
  196. package/src/chat/ui/diff/ReviewDiff.tsx +1 -0
  197. package/src/chat/ui/diff/diff-source-budget.ts +8 -0
  198. package/src/chat/ui/diff/editor-edit-model.ts +4 -0
  199. package/src/chat/ui/diff/review-plan.ts +9 -0
  200. package/src/chat/ui/diff/review-settle.ts +1 -0
  201. package/src/chat/ui/diff/syntax-runtime.ts +52 -0
  202. package/src/chat/ui/diff/use-review-stack.ts +9 -0
  203. package/src/chat/ui/diff-syntax.ts +12 -0
  204. package/src/chat/ui/diff-theme.ts +2 -0
  205. package/src/chat/ui/file-links.ts +2 -0
  206. package/src/chat/ui/find-reveal.ts +1 -0
  207. package/src/chat/ui/full-diff.ts +1 -0
  208. package/src/chat/ui/highlighter.ts +29 -15
  209. package/src/chat/ui/icons.tsx +2 -4
  210. package/src/chat/ui/index.ts +4 -0
  211. package/src/chat/ui/intelligent-ui/UiBlockFrame.tsx +25 -0
  212. package/src/chat/ui/intelligent-ui/UiFallbackPart.tsx +1 -0
  213. package/src/chat/ui/intelligent-ui/UiReply.tsx +63 -0
  214. package/src/chat/ui/intelligent-ui/block-local.ts +5 -0
  215. package/src/chat/ui/intelligent-ui/chart-data.ts +15 -0
  216. package/src/chat/ui/intelligent-ui/node-text.ts +17 -0
  217. package/src/chat/ui/intelligent-ui/renderers/binding.ts +1 -0
  218. package/src/chat/ui/intelligent-ui/renderers/chart.tsx +31 -0
  219. package/src/chat/ui/intelligent-ui/renderers/choices.tsx +4 -0
  220. package/src/chat/ui/intelligent-ui/renderers/content.tsx +18 -0
  221. package/src/chat/ui/intelligent-ui/renderers/data.tsx +11 -0
  222. package/src/chat/ui/intelligent-ui/renderers/inputs.tsx +13 -0
  223. package/src/chat/ui/intelligent-ui/renderers/links.tsx +9 -0
  224. package/src/chat/ui/intelligent-ui/renderers/map-slots.ts +15 -0
  225. package/src/chat/ui/intelligent-ui/renderers/map-style.ts +15 -0
  226. package/src/chat/ui/intelligent-ui/renderers/map-view.tsx +48 -0
  227. package/src/chat/ui/intelligent-ui/renderers/map.tsx +20 -0
  228. package/src/chat/ui/intelligent-ui/renderers/place-point.ts +3 -0
  229. package/src/chat/ui/intelligent-ui/renderers/structure.tsx +3 -0
  230. package/src/chat/ui/intelligent-ui/renderers/text.tsx +8 -0
  231. package/src/chat/ui/intelligent-ui/reply-parts.ts +5 -0
  232. package/src/chat/ui/intelligent-ui/table-data.ts +17 -0
  233. package/src/chat/ui/intelligent-ui/use-in-view.ts +4 -0
  234. package/src/chat/ui/intelligent-ui/use-later.ts +4 -0
  235. package/src/chat/ui/intelligent-ui/use-truncated.ts +5 -0
  236. package/src/chat/ui/intelligent-ui/use-ui-links.ts +29 -0
  237. package/src/chat/ui/intelligent-ui/use-ui-queries.ts +60 -0
  238. package/src/chat/ui/markdown-blocks.ts +64 -0
  239. package/src/chat/ui/mermaid.ts +4 -0
  240. package/src/chat/ui/quote-selection.ts +10 -0
  241. package/src/chat/ui/rehype-chips.ts +5 -0
  242. package/src/chat/ui/rehype-fade.ts +2 -0
  243. package/src/chat/ui/remark-html-as-text.ts +5 -0
  244. package/src/chat/ui/reveal.ts +18 -0
  245. package/src/chat/ui/rows/ForksRow.tsx +5 -0
  246. package/src/chat/ui/rows/GeneratedImageRow.tsx +10 -0
  247. package/src/chat/ui/rows/MessageRows.tsx +29 -5
  248. package/src/chat/ui/rows/RowContainer.tsx +1 -0
  249. package/src/chat/ui/rows/Rows.tsx +2 -0
  250. package/src/chat/ui/rows/SubagentRow.tsx +13 -0
  251. package/src/chat/ui/rows/TaskRow.tsx +7 -0
  252. package/src/chat/ui/rows/VisualRow.tsx +4 -0
  253. package/src/chat/ui/rows/WorkRows.tsx +46 -0
  254. package/src/chat/ui/rows/WorkflowRow.tsx +10 -0
  255. package/src/chat/ui/rows/row-rhythm.ts +7 -5
  256. package/src/chat/ui/theme-watch.ts +8 -7
  257. package/src/chat/ui/thread-references.ts +7 -0
  258. package/src/chat/ui/use-diff-source-tokens.ts +8 -0
  259. package/src/chat/ui/useToggleSet.ts +3 -0
  260. package/src/chat/ui/visual-theme.ts +30 -0
  261. package/src/chat/visual-bridge.ts +23 -0
  262. package/src/chat/visual-viewport.ts +12 -0
  263. package/src/host-hooks.ts +6 -4
  264. package/src/host.ts +2 -0
  265. package/src/index.ts +3 -0
  266. package/src/lazy.tsx +9 -0
  267. package/src/mounted-registry.ts +4 -0
  268. package/src/port-transport.ts +32 -0
  269. package/src/prompts/index.ts +2 -0
  270. package/src/prompts/logic/focus.ts +5 -0
  271. package/src/prompts/logic/keys.ts +12 -0
  272. package/src/prompts/logic/prompts.ts +8 -0
  273. package/src/prompts/logic/subjects.ts +8 -0
  274. package/src/prompts/logic/useFocusAfterAnswer.ts +2 -0
  275. package/src/prompts/logic/usePromptSession.ts +13 -1
  276. package/src/prompts/ui/ApprovalBody.tsx +2 -0
  277. package/src/prompts/ui/PromptActions.tsx +2 -0
  278. package/src/prompts/ui/PromptCard.tsx +6 -0
  279. package/src/prompts/ui/PromptView.tsx +6 -0
  280. package/src/prompts/ui/QuestionBody.tsx +11 -0
  281. package/src/providers/AccountColors.tsx +1 -0
  282. package/src/providers/AccountDetail.tsx +7 -0
  283. package/src/providers/AccountVariables.tsx +2 -0
  284. package/src/providers/AddAccountForm.tsx +5 -1
  285. package/src/providers/CliDetail.tsx +6 -5
  286. package/src/providers/InstallPage.tsx +11 -0
  287. package/src/providers/ProviderList.tsx +3 -0
  288. package/src/providers/ProvidersPane.tsx +18 -0
  289. package/src/providers/account-actions.ts +10 -8
  290. package/src/providers/install-steps.ts +3 -0
  291. package/src/providers/pane-target.ts +5 -0
  292. package/src/providers/provider-abilities.ts +1 -0
  293. package/src/providers/provider-groups.ts +6 -0
  294. package/src/providers/variables.ts +12 -0
  295. package/src/scope.ts +2 -0
  296. package/src/state/chats.ts +61 -14
  297. package/src/state/index.ts +2 -0
  298. package/src/state/provider-accounts.ts +7 -9
  299. package/src/state/providers.ts +1 -0
  300. package/src/state/usage.ts +6 -0
  301. package/src/storage.ts +18 -0
  302. package/src/testing/prompts.ts +5 -0
  303. package/src/transport.ts +18 -0
  304. package/src/usage/ChartLogo.tsx +12 -0
  305. package/src/usage/LimitsList.tsx +7 -8
  306. package/src/usage/UsageBreakdown.tsx +11 -4
  307. package/src/usage/UsageChart.tsx +5 -0
  308. package/src/usage/UsageLimits.tsx +10 -7
  309. package/src/usage/UsageLimitsCard.tsx +2 -0
  310. package/src/usage/UsagePage.tsx +16 -19
  311. package/src/usage/UsageSummary.tsx +4 -5
  312. package/src/usage/UsageTiles.tsx +2 -0
  313. package/src/usage/format.ts +7 -0
  314. package/src/usage/limit-groups.ts +14 -0
  315. package/src/usage/limits.ts +11 -13
  316. package/src/usage/money.ts +1 -0
  317. package/src/usage/summary.ts +15 -7
@@ -5,6 +5,7 @@ import { ChatScopeContext } from '../scope.js';
5
5
  import { useProvidersStore } from '../state/providers.js';
6
6
  import { AgentIcon } from './AgentIcon.js';
7
7
  import { modelName } from './model-name.js';
8
+ import { hasProviderLogo } from './provider-paths.js';
8
9
  import { ProviderLogo } from './ProviderLogo.js';
9
10
  /*
10
11
  * Who answered or will answer, in one line: the CLI's mark and the model, named the way the machine's
@@ -55,7 +56,7 @@ export function AgentModelLabel(t0) {
55
56
  }
56
57
  let t5;
57
58
  if ($[10] !== provider || $[11] !== size) {
58
- t5 = provider === "claude" || provider === "codex" ? /*#__PURE__*/_jsx(ProviderLogo, {
59
+ t5 = hasProviderLogo(provider) ? /*#__PURE__*/_jsx(ProviderLogo, {
59
60
  provider: provider,
60
61
  size: size
61
62
  }) : /*#__PURE__*/_jsx(AgentIcon, {
@@ -1,5 +1,6 @@
1
1
  import { c as _c } from "react/compiler-runtime";
2
2
  import { useProviders } from '../state/providers.js';
3
+ import { hasProviderLogo } from './provider-paths.js';
3
4
  /*
4
5
  * A model id as a person reads it, for a model no catalog names: without its vendor prefix and its
5
6
  * date, and with the version number put back together (`claude-opus-4-5` is one 4.5, not a 4 and a
@@ -25,7 +26,7 @@ export function modelName(slug, models) {
25
26
  export function agentChipOf(providers, provider, model) {
26
27
  const owner = providers.find(entry => entry.kind === provider);
27
28
  return {
28
- mark: provider === 'claude' || provider === 'codex' ? 'logo' : 'icon',
29
+ mark: hasProviderLogo(provider) ? 'logo' : 'icon',
29
30
  name: owner?.name ?? provider,
30
31
  model: modelName(model, owner?.models)
31
32
  };
@@ -1,2 +1,3 @@
1
- import type { UsageProvider } from '@adecore/agent-contracts';
1
+ import type { AgentKind, UsageProvider } from '@adecore/agent-contracts';
2
2
  export declare const PROVIDER_PATHS: Record<UsageProvider, string>;
3
+ export declare function hasProviderLogo(kind: AgentKind): kind is 'claude' | 'codex';
@@ -1,7 +1,7 @@
1
1
  import { siGithubcopilot } from 'simple-icons';
2
2
  /*
3
- * The marks of Anthropic, OpenAI, xAI and GitHub Copilot, and a monogram for a provider with no mark of its own. Lucide has no brand marks, so these are the icon rule's
4
- * exception for provider marks. One path each, in `currentColor`, so a row decides how loud the logo is.
3
+ * Lucide has no brand marks, so these are the icon rule's exception for provider marks. One path each,
4
+ * in `currentColor`, so a row decides how loud the logo is.
5
5
  */
6
6
  const CLAUDE_PATH = 'M4.709 15.955l4.72-2.647.079-.23-.08-.128H9.2l-.79-.048-2.698-.073-2.339-.097-2.266-.122-.571-.121L0 11.784l.055-.352.48-.321.686.06 1.52.103 2.278.158 1.652.097 2.449.255h.389l.055-.157-.134-.098-.103-.097-2.358-1.596-2.552-1.688-1.336-.972-.724-.491-.364-.462-.158-1.008.656-.722.881.06.225.061.893.686 1.908 1.476 2.491 1.833.365.304.145-.103.019-.073-.164-.274-1.355-2.446-1.446-2.49-.644-1.032-.17-.619a2.97 2.97 0 01-.104-.729L6.283.134 6.696 0l.996.134.42.364.62 1.414 1.002 2.229 1.555 3.03.456.898.243.832.091.255h.158V9.01l.128-1.706.237-2.095.23-2.695.08-.76.377-.91.747-.492.584.28.48.685-.067.444-.286 1.851-.559 2.903-.364 1.942h.212l.243-.242.985-1.306 1.652-2.064.73-.82.85-.904.547-.431h1.033l.76 1.129-.34 1.166-1.064 1.347-.881 1.142-1.264 1.7-.79 1.36.073.11.188-.02 2.856-.606 1.543-.28 1.841-.315.833.388.091.395-.328.807-1.969.486-2.309.462-3.439.813-.042.03.048.061 1.549.146.662.036h1.622l3.02.225.79.522.474.638-.079.485-1.215.62-1.64-.389-3.829-.91-1.312-.329h-.182v.11l1.093 1.068 2.006 1.81 2.509 2.33.127.578-.322.455-.34-.049-2.205-1.657-.851-.747-1.926-1.62h-.128v.17l.444.649 2.345 3.521.122 1.08-.17.353-.607.212-.668-.122-1.374-1.925-1.415-2.167-1.143-1.943-.14.08-.674 7.254-.316.37-.729.28-.607-.461-.322-.747.322-1.476.389-1.924.315-1.53.286-1.9.17-.632-.012-.042-.14.018-1.434 1.967-2.18 2.945-1.726 1.845-.414.164-.717-.37.067-.662.401-.589 2.388-3.036 1.44-1.882.93-1.086-.006-.158h-.055L4.132 18.56l-1.13.146-.487-.456.061-.746.231-.243 1.914-1.316-.012.01z';
7
7
  export const PROVIDER_PATHS = {
@@ -11,4 +11,8 @@ export const PROVIDER_PATHS = {
11
11
  nanogpt: 'M5 20V4h2.6l8.8 11.2V4H19v16h-2.6L7.6 8.8V20z',
12
12
  grok: 'M6.469 8.776 16.512 23h-4.464L2.005 8.776H6.47Zm-.004 7.9 2.233 3.164L6.467 23H2l4.465-6.324ZM22 2.582V23h-3.659V7.764L22 2.582ZM22 1l-9.952 14.095-2.233-3.163L17.533 1H22Z',
13
13
  copilot: siGithubcopilot.path
14
- };
14
+ };
15
+ /* The CLIs drawn with the logo of the usage page rather than their agent mark. */
16
+ export function hasProviderLogo(kind) {
17
+ return kind === 'claude' || kind === 'codex';
18
+ }
@@ -1,5 +1,4 @@
1
1
  import { c as _c } from "react/compiler-runtime";
2
- import { useMemo } from 'react';
3
2
  import { accountName, accountsOfKind, hasAccountChoice, offeredAccounts } from '../agents/accounts.js';
4
3
  import { useProviderAccounts } from '../state/provider-accounts.js';
5
4
  import { useProviders } from '../state/providers.js';
@@ -8,48 +7,78 @@ import { useProviders } from '../state/providers.js';
8
7
  * the CLI has fewer than two accounts that are on: with one there is nothing to choose or tell apart.
9
8
  */
10
9
  export function useAccountChoice(kind, account) {
11
- const $ = _c(7);
10
+ const $ = _c(17);
12
11
  const accounts = useProviderAccounts(_temp);
13
12
  const providerName = useProviders(row_0 => row_0.providers.find(entry => entry.kind === kind)?.name) ?? kind ?? "";
13
+ if (kind === null || accounts === null) {
14
+ return null;
15
+ }
14
16
  let t0;
15
- if ($[0] !== account || $[1] !== accounts || $[2] !== kind || $[3] !== providerName) {
17
+ let t1;
18
+ let t2;
19
+ let t3;
20
+ let t4;
21
+ if ($[0] !== account || $[1] !== accounts || $[2] !== kind) {
22
+ t4 = Symbol.for("react.early_return_sentinel");
16
23
  bb0: {
17
- if (kind === null || accounts === null) {
18
- t0 = null;
19
- break bb0;
20
- }
21
24
  const entries = accountsOfKind(accounts, kind);
22
25
  if (!hasAccountChoice(entries)) {
23
- t0 = null;
26
+ t4 = null;
24
27
  break bb0;
25
28
  }
26
29
  const currentId = account ?? kind;
27
- let t1;
28
- if ($[5] !== providerName) {
29
- t1 = entry_1 => accountName(entry_1, providerName);
30
- $[5] = providerName;
31
- $[6] = t1;
32
- } else {
33
- t1 = $[6];
34
- }
35
- t0 = {
36
- accounts,
37
- offered: offeredAccounts(entries, currentId),
38
- currentId,
39
- current: entries.find(entry_0 => entry_0.id === currentId) ?? null,
40
- providerName,
41
- nameOf: t1
42
- };
30
+ t0 = accounts;
31
+ t1 = offeredAccounts(entries, currentId);
32
+ t2 = currentId;
33
+ t3 = entries.find(entry_0 => entry_0.id === currentId) ?? null;
43
34
  }
44
35
  $[0] = account;
45
36
  $[1] = accounts;
46
37
  $[2] = kind;
47
- $[3] = providerName;
48
- $[4] = t0;
38
+ $[3] = t0;
39
+ $[4] = t1;
40
+ $[5] = t2;
41
+ $[6] = t3;
42
+ $[7] = t4;
43
+ } else {
44
+ t0 = $[3];
45
+ t1 = $[4];
46
+ t2 = $[5];
47
+ t3 = $[6];
48
+ t4 = $[7];
49
+ }
50
+ if (t4 !== Symbol.for("react.early_return_sentinel")) {
51
+ return t4;
52
+ }
53
+ let t5;
54
+ if ($[8] !== providerName) {
55
+ t5 = entry_1 => accountName(entry_1, providerName);
56
+ $[8] = providerName;
57
+ $[9] = t5;
49
58
  } else {
50
- t0 = $[4];
59
+ t5 = $[9];
51
60
  }
52
- return t0;
61
+ let t6;
62
+ if ($[10] !== providerName || $[11] !== t0 || $[12] !== t1 || $[13] !== t2 || $[14] !== t3 || $[15] !== t5) {
63
+ t6 = {
64
+ accounts: t0,
65
+ offered: t1,
66
+ currentId: t2,
67
+ current: t3,
68
+ providerName,
69
+ nameOf: t5
70
+ };
71
+ $[10] = providerName;
72
+ $[11] = t0;
73
+ $[12] = t1;
74
+ $[13] = t2;
75
+ $[14] = t3;
76
+ $[15] = t5;
77
+ $[16] = t6;
78
+ } else {
79
+ t6 = $[16];
80
+ }
81
+ return t6;
53
82
  }
54
83
  // One object each, so a render that changes nothing hands back the same answer.
55
84
  function _temp(row) {
@@ -1,5 +1,6 @@
1
1
  import i18next from 'i18next';
2
2
  import { create } from 'zustand';
3
+ import { errorMessage } from '../transport.js';
3
4
  import { jumpToTimelineItem } from './timeline-scroll.js';
4
5
  export const useBookmarkNaming = create(set => ({
5
6
  chatKey: null,
@@ -16,7 +17,7 @@ export const useBookmarkNaming = create(set => ({
16
17
  function failed(host, title, e) {
17
18
  host.notify({
18
19
  title,
19
- description: e instanceof Error ? e.message : String(e),
20
+ description: errorMessage(e),
20
21
  kind: 'error'
21
22
  });
22
23
  }
@@ -15,7 +15,6 @@ export declare function isEmptyDraft(draft: ChatDraft): boolean;
15
15
  export declare const useDrafts: import("zustand").UseBoundStore<import("zustand").StoreApi<{
16
16
  ids: string[];
17
17
  }>>;
18
- export declare function useHasDraft(chatId: string): boolean;
19
18
  export declare function readDraft(chatId: string): ChatDraft;
20
19
  export declare function writeDraft(chatId: string, draft: ChatDraft): void;
21
20
  export declare function joinDraftText(current: string, added: string): string;
@@ -1,4 +1,3 @@
1
- import { c as _c } from "react/compiler-runtime";
2
1
  import { chatStorageKey, chatStorageLegacyKeys, createChatStore } from '../storage.js';
3
2
  import { checkAttachmentLimits, uploadBytes } from './attachments.js';
4
3
  import { persistedJson } from './persisted-json.js';
@@ -26,18 +25,6 @@ export const useDrafts = createChatStore(() => ({
26
25
  }), store => store.setState({
27
26
  ids: Object.keys(storage.read())
28
27
  }));
29
- export function useHasDraft(chatId) {
30
- const $ = _c(2);
31
- let t0;
32
- if ($[0] !== chatId) {
33
- t0 = s => s.ids.includes(chatId);
34
- $[0] = chatId;
35
- $[1] = t0;
36
- } else {
37
- t0 = $[1];
38
- }
39
- return useDrafts(t0);
40
- }
41
28
  function trackDraft(chatId, held) {
42
29
  const {
43
30
  ids
@@ -74,28 +61,23 @@ export function writeDraft(chatId, draft) {
74
61
  storage.write(drafts);
75
62
  return;
76
63
  }
77
- drafts[chatId] = {
78
- text: draft.text,
79
- mentions: draft.mentions,
80
- skills: draft.skills,
81
- chats: draft.chats,
82
- attachments: draft.attachments,
83
- quote: draft.quote,
84
- ...(draft.quoteSource === null ? {} : {
85
- quoteSource: draft.quoteSource
86
- }),
87
- references: draft.references,
88
- ...namesOf(draft)
89
- };
64
+ drafts[chatId] = recordOf(draft, true);
90
65
  if (storage.write(drafts)) {
91
66
  return;
92
67
  }
93
68
  // A file can outgrow the storage quota; the text is the part worth keeping then.
94
- drafts[chatId] = {
69
+ drafts[chatId] = recordOf(draft, false);
70
+ storage.write(drafts);
71
+ }
72
+ function recordOf(draft, withFiles) {
73
+ return {
95
74
  text: draft.text,
96
75
  mentions: draft.mentions,
97
76
  skills: draft.skills,
98
77
  chats: draft.chats,
78
+ ...(withFiles ? {
79
+ attachments: draft.attachments
80
+ } : {}),
99
81
  quote: draft.quote,
100
82
  ...(draft.quoteSource === null ? {} : {
101
83
  quoteSource: draft.quoteSource
@@ -103,7 +85,6 @@ export function writeDraft(chatId, draft) {
103
85
  references: draft.references,
104
86
  ...namesOf(draft)
105
87
  };
106
- storage.write(drafts);
107
88
  }
108
89
  function namesOf(draft) {
109
90
  return draft.referenceNames === undefined ? {} : {
@@ -113,14 +113,8 @@ export function pickerEntriesOf(providers, query, legacyOpen, expanded = NONE, c
113
113
  open: false
114
114
  }];
115
115
  });
116
- if (legacy.length === 0) {
117
- return live;
118
- }
119
- return legacyOpen ? [...live, {
120
- kind: 'legacy',
121
- count: legacy.length
122
- }, ...legacy] : [...live, {
116
+ return legacy.length === 0 ? live : [...live, {
123
117
  kind: 'legacy',
124
118
  count: legacy.length
125
- }];
119
+ }, ...(legacyOpen ? legacy : [])];
126
120
  }
@@ -35,11 +35,8 @@ function offerableTurn({
35
35
  if (turn === null || turn.endedAt === null || turn.id === dismissedTurnId) {
36
36
  return null;
37
37
  }
38
- /*
39
- * `contextTokens` keeps the old number until the next request, so without this the offer would
40
- * come straight back after a compaction. A native compaction is a turn without a message of the
41
- * person, which is why this looks at the turn and not at the last thing that was said.
42
- */
38
+ // `contextTokens` keeps the old number until the next request, so the offer would return right after
39
+ // a compaction. A native one is a turn without a message of the person, hence the look at the turn.
43
40
  if (items.some(item => item.kind === 'compaction' && item.turnId === turn.id)) {
44
41
  return null;
45
42
  }
@@ -1,13 +1,7 @@
1
1
  import { stripAnsi } from './ansi.js';
2
2
  /*
3
- * What a row of the thread puts on the clipboard. An answer is markdown on the wire and rendered
4
- * text on the screen, so copying it as text has to undo the marks the renderer swallowed; the
5
- * source itself stays available as "Copy as Markdown".
6
- */
7
- /*
8
- * The marks that only exist to be rendered come off, what they marked stays. `_` is left alone on
9
- * purpose: it is a letter in half the identifiers an agent writes, and no italic is worth mangling
10
- * `file_path`.
3
+ * An answer is markdown on the wire and rendered text on screen, so a copy as text undoes the marks the
4
+ * renderer swallowed. `_` stays: it is a letter in half the identifiers an agent writes (`file_path`).
11
5
  */
12
6
  export function stripMarkdown(text) {
13
7
  return text.replace(/^ *```[^\n]*\n?/gm, '').replace(/^ *(#{1,6}) +/gm, '').replace(/^ *> ?/gm, '').replace(/!\[([^\]]*)\]\([^)]*\)/g, '$1').replace(/\[([^\]]*)\]\([^)]*\)/g, '$1').replace(/(\*\*|__)(?=\S)([\s\S]*?\S)\1/g, '$2').replace(/\*(?=\S)([^*\n]*\S)\*/g, '$1').replace(/`+([^`]+)`+/g, '$1').trim();
@@ -479,7 +479,7 @@ function withLiveThought(rows, items) {
479
479
  const index = rows.findIndex(row => row.kind === 'work-live' && after.has(row.tool.id));
480
480
  const call = rows[index];
481
481
  const shownAt = rows.findIndex(row => row.kind === 'thinking' && row.id === thought.id);
482
- const inSight = shownAt !== -1 && shownAt < index && !rows.slice(shownAt + 1, index).some(row => row.kind === 'work');
482
+ const inSight = shownAt !== -1 && shownAt < index && !rows.slice(shownAt + 1, index).some(row => row.kind === 'work' || row.kind === 'work-group');
483
483
  if (call?.kind !== 'work-live' || inSight) {
484
484
  return rows;
485
485
  }
@@ -496,8 +496,8 @@ function chunksByTurn(items) {
496
496
  const byTurn = new Map();
497
497
  for (const item of items) {
498
498
  if (item.turnId === null) {
499
- const last = chunks[chunks.length - 1];
500
- if (last && last.turnId === null) {
499
+ const last = chunks.at(-1);
500
+ if (last?.turnId === null) {
501
501
  last.items.push(item);
502
502
  } else {
503
503
  chunks.push({
@@ -561,12 +561,13 @@ export function deriveTimelineRows(items, options) {
561
561
  const work = rowsForItems(rest, options, children);
562
562
  // The closing answer stays visible; the work after the last input folds behind the label.
563
563
  const finalAssistant = lastAssistantRow(work);
564
- const before = finalAssistant ? work.slice(0, work.indexOf(finalAssistant)) : work;
564
+ const closing = finalAssistant ? work.indexOf(finalAssistant) : work.length;
565
+ const before = work.slice(0, closing);
565
566
  // Images remain a turn's visible result, and a workflow or a background subagent may still be running after its turn ends.
566
567
  const standing = before.filter(row => isImageRow(row) || row.kind === 'workflow' && row.tool.state === 'running' || row.kind === 'subagent' && row.item.status === 'running');
567
- const folded = before.filter(row => !standing.includes(row));
568
+ const folded = before.length - standing.length;
568
569
  const expanded = options.expandedTurns.has(turnId);
569
- if (folded.length > 0) {
570
+ if (folded > 0) {
570
571
  const tools = rest.filter(item => item.kind === 'tool' && parentOf(item) === null && handbackReportOf(item) === null && !isImageGeneration(item));
571
572
  rows.push({
572
573
  kind: 'turn-fold',
@@ -574,7 +575,7 @@ export function deriveTimelineRows(items, options) {
574
575
  turn,
575
576
  label: turnLabel(turn, chunk.items),
576
577
  work: summarizeTurn(tools, options.commandLooks),
577
- hiddenCount: folded.length,
578
+ hiddenCount: folded,
578
579
  expanded
579
580
  });
580
581
  }
@@ -583,9 +584,7 @@ export function deriveTimelineRows(items, options) {
583
584
  if (changed) {
584
585
  rows.push(changed);
585
586
  }
586
- if (finalAssistant) {
587
- rows.push(...work.slice(work.indexOf(finalAssistant)));
588
- }
587
+ rows.push(...work.slice(closing));
589
588
  if (options.forkedTurns?.has(turnId) === true) {
590
589
  rows.push({
591
590
  kind: 'forks',
@@ -55,8 +55,7 @@ export function workflowAgentTime(view) {
55
55
  }
56
56
  /* The CLI's previews start with a markdown heading as often as not, which says nothing on one line. */
57
57
  function firstLine(text) {
58
- const line = text?.split('\n').map(part => part.replace(/^#+\s*/, '').trim()).find(part => part !== '');
59
- return line === undefined ? null : line;
58
+ return text?.split('\n').map(part => part.replace(/^#+\s*/, '').trim()).find(part => part !== '') ?? null;
60
59
  }
61
60
  /* The second line of an agent: what it does while at work, what it answered once it stopped, what it was asked before. */
62
61
  export function workflowAgentPreview(view) {
@@ -140,6 +139,5 @@ function metaLiteral(script) {
140
139
  export function workflowDescription(input) {
141
140
  const script = typeof input === 'object' && input !== null && 'script' in input ? input.script : undefined;
142
141
  const meta = typeof script === 'string' ? metaLiteral(script) : null;
143
- const found = meta === null ? undefined : DESCRIPTION.exec(meta)?.[2]?.replace(/\\(.)/g, '$1').trim();
144
- return found ? found : null;
142
+ return (meta === null ? undefined : DESCRIPTION.exec(meta)?.[2]?.replace(/\\(.)/g, '$1').trim()) || null;
145
143
  }
@@ -1,4 +1,5 @@
1
1
  import i18next from 'i18next';
2
+ import { isWaiting } from '../state/chats.js';
2
3
  import { errorCode, isConnectionError } from '../transport.js';
3
4
  // What the panel opens on: the newest end of the conversation, which is where an agent that works is.
4
5
  export const SUBAGENT_PAGE = 60;
@@ -42,7 +43,7 @@ export function mergeNewest(current, currentCursor, page, pageCursor) {
42
43
  };
43
44
  }
44
45
  function pendingOf(items) {
45
- return items.filter(item => item.kind === 'approval' && item.decision === 'pending' || item.kind === 'question' && item.state === 'pending');
46
+ return items.filter(isWaiting);
46
47
  }
47
48
  function messageOf(error) {
48
49
  return error instanceof Error ? error.message : i18next.t('agent-chat:subagents.noAnswer');
@@ -10,6 +10,7 @@ import { useChatScope } from '../../scope.js';
10
10
  import { useChats } from '../../state/chats.js';
11
11
  import { useChatActions } from '../actions.js';
12
12
  import { goalView } from '../logic/goal.js';
13
+ import { errorMessage } from '../../transport.js';
13
14
  /* How far the goal got, in what its CLI counts: the checks that sent the agent on, or the tokens it spent. */
14
15
  import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
15
16
  function progressOf(goal, t) {
@@ -71,7 +72,7 @@ export function GoalDock(t0) {
71
72
  actions.goal(chatId, action).catch(e => host.notify({
72
73
  kind: "error",
73
74
  title: t("goal.failed"),
74
- description: e instanceof Error ? e.message : String(e)
75
+ description: errorMessage(e)
75
76
  })).finally(() => setChanging(false));
76
77
  };
77
78
  $[9] = actions;
@@ -18,6 +18,7 @@ import { useChatActions } from '../actions.js';
18
18
  import { useUsageStore } from '../../state/usage.js';
19
19
  import { SessionLine } from './SessionLine.js';
20
20
  import { useHostResumeAtReset } from '../../host-hooks.js';
21
+ import { errorMessage } from '../../transport.js';
21
22
  // A time a limit names reads as a clock today and with its day after that, so the words follow the minute.
22
23
  import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
23
24
  const MINUTE_MS = 60_000;
@@ -121,11 +122,8 @@ function ResumeAtResetToggle(t0) {
121
122
  return t7;
122
123
  }
123
124
  /*
124
- * Another account of the chat's CLI that has room: the one with the least of its session spent, and
125
- * beside it a menu of every account with room, for a person whose companies each pay for their own
126
- * work. Only ever offered, since going on there spends someone's other plan, and nothing is
127
- * remembered: the next limit suggests the one with the most room again. An account that reads the
128
- * chat's conversation takes it over; any other goes on in a fork, which then opens the way a fork does.
125
+ * Another account of the chat's CLI with room, only ever offered since it spends someone's other plan, and
126
+ * never remembered. One that reads the chat's conversation takes it over; any other goes on in a fork.
129
127
  */
130
128
  function _temp() {}
131
129
  function ContinueOn(t0) {
@@ -187,7 +185,7 @@ function ContinueOn(t0) {
187
185
  title: t("limit.continueFailed", {
188
186
  account: choice.nameOf(entry)
189
187
  }),
190
- description: e instanceof Error ? e.message : String(e)
188
+ description: errorMessage(e)
191
189
  })).finally(() => setBusy(false));
192
190
  };
193
191
  $[9] = actions;
@@ -1,5 +1,4 @@
1
1
  import { c as _c } from "react/compiler-runtime";
2
- import { useMemo } from 'react';
3
2
  import { useChatRow } from '../../../state/chats.js';
4
3
  import { continuableTurn } from '../../logic/continue-after-stop.js';
5
4
  /* The turn a person stopped that Continue would pick up, or null when there is none. */
@@ -1,5 +1,6 @@
1
1
  import { c as _c } from "react/compiler-runtime";
2
2
  import { useEffect, useState } from 'react';
3
+ import { errorMessage } from '../../../transport.js';
3
4
  const NOTICE_MS = 4000;
4
5
  /* A line under the box that says what went wrong, gone again after a few seconds. */
5
6
  export function useNotice() {
@@ -42,7 +43,7 @@ export function useNotice() {
42
43
  const t4 = shown?.tone ?? "error";
43
44
  let t5;
44
45
  if ($[4] === Symbol.for("react.memo_cache_sentinel")) {
45
- t5 = error => setNotice(error instanceof Error ? error.message : String(error));
46
+ t5 = error => setNotice(errorMessage(error));
46
47
  $[4] = t5;
47
48
  } else {
48
49
  t5 = $[4];
@@ -1,5 +1,5 @@
1
1
  import { c as _c } from "react/compiler-runtime";
2
- import { useMemo, useState } from 'react';
2
+ import { useState } from 'react';
3
3
  import { useChatRow } from '../../../state/chats.js';
4
4
  // How many sent prompts the arrow keys walk back through, per chat.
5
5
  const PROMPT_HISTORY = 50;