@adecore/agents-react 0.53.2 → 0.54.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.
- package/dist/agents/AgentIcon.js +1 -1
- package/dist/agents/AgentModelLabel.js +1 -1
- package/dist/agents/accounts.js +1 -1
- package/dist/chat/attachments.js +1 -1
- package/dist/chat/forks.js +1 -1
- package/dist/chat/logic/limit.js +1 -1
- package/dist/chat/logic/scrubber.js +1 -1
- package/dist/chat/logic/selection-switch.d.ts +6 -0
- package/dist/chat/logic/selection-switch.js +42 -0
- package/dist/chat/logic/timeline-target.d.ts +1 -1
- package/dist/chat/logic/timeline.d.ts +6 -1
- package/dist/chat/logic/timeline.js +16 -2
- package/dist/chat/logic/tool-looks.js +1 -1
- package/dist/chat/logic/tools.js +1 -1
- package/dist/chat/logic/workflow.js +1 -1
- package/dist/chat/preferences.js +1 -1
- package/dist/chat/runtime-modes.js +1 -1
- package/dist/chat/send-key.js +1 -1
- package/dist/chat/stash.js +2 -2
- package/dist/chat/subagent-list.js +1 -1
- package/dist/chat/ui/AccountPill.js +3 -3
- package/dist/chat/ui/BookmarkMarker.js +6 -6
- package/dist/chat/ui/BookmarkSubmenu.js +5 -5
- package/dist/chat/ui/ChatActivity.js +15 -14
- package/dist/chat/ui/CodeBlock.js +9 -7
- package/dist/chat/ui/Composer.js +13 -13
- package/dist/chat/ui/ComposerInput.d.ts +1 -1
- package/dist/chat/ui/ComposerInput.js +35 -18
- package/dist/chat/ui/DiffPool.js +1 -1
- package/dist/chat/ui/EditDiff.js +2 -2
- package/dist/chat/ui/GoalDock.js +5 -5
- package/dist/chat/ui/ImageView.js +4 -4
- package/dist/chat/ui/LimitState.js +12 -12
- package/dist/chat/ui/Markdown.d.ts +1 -1
- package/dist/chat/ui/Markdown.js +11 -10
- package/dist/chat/ui/MermaidBlock.js +7 -6
- package/dist/chat/ui/MessageActions.js +7 -7
- package/dist/chat/ui/ModelMarks.js +2 -2
- package/dist/chat/ui/Pickers.d.ts +1 -1
- package/dist/chat/ui/Pickers.js +32 -27
- package/dist/chat/ui/PromptComposer.d.ts +1 -1
- package/dist/chat/ui/PromptComposer.js +5 -5
- package/dist/chat/ui/PromptEditor.js +3 -3
- package/dist/chat/ui/QuoteButton.js +2 -2
- package/dist/chat/ui/ReferenceChip.js +3 -3
- package/dist/chat/ui/ReferenceTrail.js +2 -2
- package/dist/chat/ui/ResumeCompactionDock.js +3 -3
- package/dist/chat/ui/RunSettings.js +11 -11
- package/dist/chat/ui/Scrubber.js +4 -4
- package/dist/chat/ui/SessionLine.js +2 -2
- package/dist/chat/ui/ShellCommand.d.ts +1 -1
- package/dist/chat/ui/ShellCommand.js +2 -2
- package/dist/chat/ui/SubagentControls.js +3 -3
- package/dist/chat/ui/SubagentInfo.js +5 -5
- package/dist/chat/ui/SubagentStopButton.js +2 -2
- package/dist/chat/ui/SubagentTimeline.js +18 -16
- package/dist/chat/ui/Timeline.js +231 -145
- package/dist/chat/ui/TimelineMenu.js +7 -7
- package/dist/chat/ui/UnifiedDiff.js +2 -2
- package/dist/chat/ui/VisualDialogs.js +1 -1
- package/dist/chat/ui/VisualFrame.js +4 -4
- package/dist/chat/ui/WorkflowAgentLine.d.ts +1 -1
- package/dist/chat/ui/WorkflowAgentLine.js +3 -3
- package/dist/chat/ui/chip-clipboard.d.ts +1 -1
- package/dist/chat/ui/composer/ComposerControls.d.ts +1 -1
- package/dist/chat/ui/composer/ComposerControls.js +4 -4
- package/dist/chat/ui/composer/ComposerMenu.js +5 -4
- package/dist/chat/ui/composer/DraftParts.js +2 -2
- package/dist/chat/ui/composer/QueuedMessages.js +2 -2
- package/dist/chat/ui/composer/chip-paste.d.ts +1 -1
- package/dist/chat/ui/composer/chips.d.ts +1 -1
- package/dist/chat/ui/composer/chips.js +2 -2
- package/dist/chat/ui/composer/key-handler.js +1 -1
- package/dist/chat/ui/composer/placeholder.js +1 -1
- package/dist/chat/ui/composer/use-composer-menus.d.ts +1 -1
- package/dist/chat/ui/composer/use-composer-menus.js +1 -1
- package/dist/chat/ui/composer/use-composer-submit.d.ts +1 -1
- package/dist/chat/ui/composer/use-draft-files.d.ts +2 -2
- package/dist/chat/ui/composer/use-draft-files.js +1 -1
- package/dist/chat/ui/composer/use-effort-stepper.js +1 -1
- package/dist/chat/ui/composer/use-prompt-menus.d.ts +2 -2
- package/dist/chat/ui/composer/use-prompt-menus.js +1 -1
- package/dist/chat/ui/diff/ApprovalReview.js +2 -2
- package/dist/chat/ui/diff/DiffOmitted.js +1 -1
- package/dist/chat/ui/diff/DiffStack.js +2 -2
- package/dist/chat/ui/diff/EditorEditDiff.d.ts +1 -1
- package/dist/chat/ui/diff/EditorEditDiff.js +5 -5
- package/dist/chat/ui/diff/EditorPatchDiff.d.ts +1 -1
- package/dist/chat/ui/diff/EditorPatchDiff.js +1 -1
- package/dist/chat/ui/diff/LegacyEditDiff.js +47 -31
- package/dist/chat/ui/diff/LegacyUnifiedDiff.js +93 -69
- package/dist/chat/ui/diff/RawDiff.js +54 -35
- package/dist/chat/ui/diff/syntax-runtime.d.ts +1 -1
- package/dist/chat/ui/highlighter.d.ts +1 -1
- package/dist/chat/ui/highlighter.js +1 -1
- package/dist/chat/ui/icons.js +1 -1
- package/dist/chat/ui/intelligent-ui/UiBlockFrame.d.ts +1 -1
- package/dist/chat/ui/intelligent-ui/UiBlockFrame.js +4 -4
- package/dist/chat/ui/intelligent-ui/UiFallbackPart.js +2 -2
- package/dist/chat/ui/intelligent-ui/UiReply.d.ts +2 -2
- package/dist/chat/ui/intelligent-ui/UiReply.js +8 -8
- package/dist/chat/ui/intelligent-ui/node-text.d.ts +1 -1
- package/dist/chat/ui/intelligent-ui/render-context.d.ts +1 -1
- package/dist/chat/ui/intelligent-ui/renderers/chart.js +28 -15
- package/dist/chat/ui/intelligent-ui/renderers/choices.js +4 -4
- package/dist/chat/ui/intelligent-ui/renderers/content.js +6 -6
- package/dist/chat/ui/intelligent-ui/renderers/data.js +104 -87
- package/dist/chat/ui/intelligent-ui/renderers/inputs.js +3 -3
- package/dist/chat/ui/intelligent-ui/renderers/links.js +2 -2
- package/dist/chat/ui/intelligent-ui/renderers/map-view.js +4 -4
- package/dist/chat/ui/intelligent-ui/renderers/map.js +3 -3
- package/dist/chat/ui/intelligent-ui/renderers/structure.js +2 -2
- package/dist/chat/ui/intelligent-ui/renderers/text.js +5 -5
- package/dist/chat/ui/intelligent-ui/tones.d.ts +1 -1
- package/dist/chat/ui/intelligent-ui/use-ui-links.d.ts +1 -1
- package/dist/chat/ui/intelligent-ui/use-ui-links.js +2 -2
- package/dist/chat/ui/intelligent-ui/use-ui-queries.js +1 -1
- package/dist/chat/ui/reference-icons.d.ts +1 -1
- package/dist/chat/ui/reference-icons.js +2 -2
- package/dist/chat/ui/reply-context.d.ts +1 -1
- package/dist/chat/ui/rows/ForksRow.js +3 -3
- package/dist/chat/ui/rows/GeneratedImageRow.js +5 -5
- package/dist/chat/ui/rows/MessageRows.d.ts +6 -1
- package/dist/chat/ui/rows/MessageRows.js +151 -22
- package/dist/chat/ui/rows/Rows.js +39 -21
- package/dist/chat/ui/rows/SubagentRow.js +16 -16
- package/dist/chat/ui/rows/TaskRow.js +3 -3
- package/dist/chat/ui/rows/VisualRow.js +2 -2
- package/dist/chat/ui/rows/WorkRows.d.ts +2 -2
- package/dist/chat/ui/rows/WorkRows.js +37 -25
- package/dist/chat/ui/rows/WorkflowRow.js +8 -8
- package/dist/chat/ui/use-diff-source-tokens.js +1 -1
- package/dist/chat/ui/visual-theme.d.ts +1 -1
- package/dist/chat/ui/visual-theme.js +2 -2
- package/dist/chat/workflow-list.js +1 -1
- package/dist/host.d.ts +4 -4
- package/dist/host.js +1 -1
- package/dist/lazy.js +1 -1
- package/dist/locales/en/agent-chat.d.ts +4 -0
- package/dist/locales/en/agent-chat.js +4 -0
- package/dist/locales/nl/agent-chat.d.ts +4 -0
- package/dist/locales/nl/agent-chat.js +4 -0
- package/dist/port-transport.js +1 -1
- package/dist/prompts/logic/subjects.d.ts +1 -1
- package/dist/prompts/ui/ApprovalBody.js +16 -7
- package/dist/prompts/ui/PromptActions.js +2 -2
- package/dist/prompts/ui/PromptCard.js +5 -4
- package/dist/prompts/ui/PromptView.js +1 -1
- package/dist/prompts/ui/QuestionBody.js +4 -4
- package/dist/providers/AccountDetail.js +4 -4
- package/dist/providers/AccountOrderList.js +2 -2
- package/dist/providers/AccountVariables.js +3 -3
- package/dist/providers/AddAccountForm.js +6 -6
- package/dist/providers/CliDetail.js +8 -8
- package/dist/providers/InstallPage.js +3 -3
- package/dist/providers/ProviderList.js +2 -2
- package/dist/providers/ProvidersPane.d.ts +1 -1
- package/dist/providers/ProvidersPane.js +5 -5
- package/dist/providers/install-steps.d.ts +1 -1
- package/dist/settings/sections.d.ts +2 -2
- package/dist/state/chats.js +1 -1
- package/dist/state/usage.js +2 -2
- package/dist/theme.css +4 -4
- package/dist/transport.d.ts +1 -1
- package/dist/usage/LimitsList.js +4 -4
- package/dist/usage/UsageBreakdown.js +5 -5
- package/dist/usage/UsageChart.js +1 -1
- package/dist/usage/UsageDialog.js +1 -1
- package/dist/usage/UsageLimits.js +6 -6
- package/dist/usage/UsageLimitsCard.js +2 -2
- package/dist/usage/UsagePage.js +200 -189
- package/dist/usage/UsagePane.js +2 -2
- package/dist/usage/UsageSummary.js +1 -1
- package/dist/usage/UsageTiles.js +1 -1
- package/dist/usage/limit-groups.js +2 -2
- package/dist/usage/summary.js +1 -1
- package/package.json +9 -8
- package/src/agents/AgentIcon.tsx +1 -1
- package/src/agents/AgentModelLabel.tsx +2 -2
- package/src/agents/ProviderLogo.tsx +1 -1
- package/src/agents/accounts.ts +1 -1
- package/src/agents/option-words.ts +1 -1
- package/src/chat/attachments.ts +1 -1
- package/src/chat/bookmarks.ts +1 -1
- package/src/chat/drafts.ts +1 -1
- package/src/chat/forks.ts +1 -1
- package/src/chat/logic/fork.ts +1 -1
- package/src/chat/logic/limit.ts +1 -1
- package/src/chat/logic/scrubber.ts +1 -1
- package/src/chat/logic/selection-switch.ts +47 -0
- package/src/chat/logic/timeline-copy.ts +1 -1
- package/src/chat/logic/timeline-target.ts +1 -1
- package/src/chat/logic/timeline.ts +28 -4
- package/src/chat/logic/tool-looks.ts +1 -1
- package/src/chat/logic/tools.ts +1 -1
- package/src/chat/logic/workflow.ts +1 -1
- package/src/chat/pending-prompts.ts +1 -1
- package/src/chat/preferences.ts +1 -1
- package/src/chat/reading-width.ts +1 -1
- package/src/chat/runtime-modes.ts +1 -1
- package/src/chat/send-key.ts +1 -1
- package/src/chat/stash.ts +2 -2
- package/src/chat/subagent-conversation.ts +1 -1
- package/src/chat/subagent-list.ts +1 -1
- package/src/chat/subagent-view.ts +1 -1
- package/src/chat/thumbnails.ts +1 -1
- package/src/chat/ui/AccountPill.tsx +4 -4
- package/src/chat/ui/BookmarkMarker.tsx +6 -6
- package/src/chat/ui/BookmarkSubmenu.tsx +5 -5
- package/src/chat/ui/ChatActivity.tsx +15 -15
- package/src/chat/ui/CodeBlock.tsx +10 -8
- package/src/chat/ui/Composer.tsx +13 -13
- package/src/chat/ui/ComposerInput.tsx +10 -2
- package/src/chat/ui/DiffPool.tsx +1 -1
- package/src/chat/ui/EditDiff.tsx +3 -4
- package/src/chat/ui/GoalDock.tsx +6 -6
- package/src/chat/ui/ImageView.tsx +4 -4
- package/src/chat/ui/LimitState.tsx +13 -13
- package/src/chat/ui/Markdown.tsx +12 -12
- package/src/chat/ui/MermaidBlock.tsx +6 -6
- package/src/chat/ui/MessageActions.tsx +7 -7
- package/src/chat/ui/ModelMarks.tsx +2 -2
- package/src/chat/ui/Pickers.tsx +10 -10
- package/src/chat/ui/PromptComposer.tsx +6 -6
- package/src/chat/ui/PromptEditor.tsx +4 -4
- package/src/chat/ui/QuoteButton.tsx +2 -2
- package/src/chat/ui/ReferenceChip.tsx +3 -3
- package/src/chat/ui/ReferenceTrail.tsx +2 -2
- package/src/chat/ui/ResumeCompactionDock.tsx +3 -3
- package/src/chat/ui/RunSettings.tsx +13 -13
- package/src/chat/ui/Scrubber.tsx +4 -4
- package/src/chat/ui/SessionLine.tsx +2 -2
- package/src/chat/ui/ShellCommand.tsx +2 -2
- package/src/chat/ui/SubagentControls.tsx +3 -3
- package/src/chat/ui/SubagentInfo.tsx +5 -5
- package/src/chat/ui/SubagentStopButton.tsx +3 -3
- package/src/chat/ui/SubagentTimeline.tsx +20 -17
- package/src/chat/ui/Timeline.tsx +232 -143
- package/src/chat/ui/TimelineMenu.tsx +7 -7
- package/src/chat/ui/UnifiedDiff.tsx +3 -3
- package/src/chat/ui/VisualDialogs.tsx +2 -2
- package/src/chat/ui/VisualFrame.tsx +4 -4
- package/src/chat/ui/WorkflowAgentLine.tsx +4 -4
- package/src/chat/ui/chip-clipboard.ts +1 -1
- package/src/chat/ui/composer/ComposerControls.tsx +4 -4
- package/src/chat/ui/composer/ComposerMenu.tsx +6 -6
- package/src/chat/ui/composer/DraftParts.tsx +2 -2
- package/src/chat/ui/composer/QueuedMessages.tsx +2 -2
- package/src/chat/ui/composer/chip-paste.ts +1 -1
- package/src/chat/ui/composer/chips.ts +2 -2
- package/src/chat/ui/composer/key-handler.ts +2 -2
- package/src/chat/ui/composer/placeholder.ts +1 -1
- package/src/chat/ui/composer/use-chat-controls.ts +1 -1
- package/src/chat/ui/composer/use-compaction-offer.ts +1 -1
- package/src/chat/ui/composer/use-composer-menus.ts +2 -2
- package/src/chat/ui/composer/use-composer-submit.ts +2 -2
- package/src/chat/ui/composer/use-draft-files.ts +3 -3
- package/src/chat/ui/composer/use-effort-stepper.ts +2 -2
- package/src/chat/ui/composer/use-pending-requests.ts +1 -1
- package/src/chat/ui/composer/use-prompt-menus.ts +3 -3
- package/src/chat/ui/composer/use-take-back.ts +1 -1
- package/src/chat/ui/diff/ApprovalReview.tsx +3 -3
- package/src/chat/ui/diff/DiffOmitted.tsx +1 -1
- package/src/chat/ui/diff/DiffStack.tsx +2 -2
- package/src/chat/ui/diff/EditorEditDiff.tsx +5 -5
- package/src/chat/ui/diff/EditorPatchDiff.tsx +1 -1
- package/src/chat/ui/diff/LegacyDiffPool.tsx +1 -1
- package/src/chat/ui/diff/LegacyEditDiff.tsx +18 -9
- package/src/chat/ui/diff/LegacyUnifiedDiff.tsx +24 -13
- package/src/chat/ui/diff/RawDiff.tsx +8 -5
- package/src/chat/ui/diff/syntax-runtime.ts +1 -1
- package/src/chat/ui/highlighter.ts +1 -1
- package/src/chat/ui/icons.tsx +2 -2
- package/src/chat/ui/intelligent-ui/UiBlockFrame.tsx +5 -5
- package/src/chat/ui/intelligent-ui/UiFallbackPart.tsx +2 -2
- package/src/chat/ui/intelligent-ui/UiReply.tsx +18 -18
- package/src/chat/ui/intelligent-ui/node-text.ts +1 -1
- package/src/chat/ui/intelligent-ui/render-context.ts +1 -1
- package/src/chat/ui/intelligent-ui/renderers/chart.tsx +15 -7
- package/src/chat/ui/intelligent-ui/renderers/choices.tsx +4 -4
- package/src/chat/ui/intelligent-ui/renderers/content.tsx +7 -7
- package/src/chat/ui/intelligent-ui/renderers/data.tsx +8 -7
- package/src/chat/ui/intelligent-ui/renderers/inputs.tsx +3 -3
- package/src/chat/ui/intelligent-ui/renderers/links.tsx +4 -4
- package/src/chat/ui/intelligent-ui/renderers/map-view.tsx +4 -4
- package/src/chat/ui/intelligent-ui/renderers/map.tsx +5 -5
- package/src/chat/ui/intelligent-ui/renderers/structure.tsx +3 -3
- package/src/chat/ui/intelligent-ui/renderers/text.tsx +5 -5
- package/src/chat/ui/intelligent-ui/tones.ts +1 -1
- package/src/chat/ui/intelligent-ui/use-ui-links.ts +2 -2
- package/src/chat/ui/intelligent-ui/use-ui-queries.ts +1 -1
- package/src/chat/ui/reference-icons.ts +2 -2
- package/src/chat/ui/reply-context.ts +1 -1
- package/src/chat/ui/rows/ForksRow.tsx +3 -3
- package/src/chat/ui/rows/GeneratedImageRow.tsx +7 -7
- package/src/chat/ui/rows/MessageRows.tsx +57 -33
- package/src/chat/ui/rows/RowContainer.tsx +1 -1
- package/src/chat/ui/rows/Rows.tsx +7 -4
- package/src/chat/ui/rows/SubagentRow.tsx +16 -16
- package/src/chat/ui/rows/TaskRow.tsx +4 -4
- package/src/chat/ui/rows/VisualRow.tsx +2 -2
- package/src/chat/ui/rows/WorkRows.tsx +44 -32
- package/src/chat/ui/rows/WorkflowRow.tsx +9 -9
- package/src/chat/ui/rows/row-rhythm.ts +1 -1
- package/src/chat/ui/use-diff-source-tokens.ts +1 -1
- package/src/chat/ui/visual-theme.ts +2 -2
- package/src/chat/workflow-list.ts +1 -1
- package/src/host.ts +6 -6
- package/src/lazy.tsx +1 -1
- package/src/locales/en/agent-chat.ts +4 -0
- package/src/locales/nl/agent-chat.ts +4 -0
- package/src/port-transport.ts +1 -1
- package/src/prompts/logic/subjects.ts +1 -1
- package/src/prompts/ui/ApprovalBody.tsx +19 -9
- package/src/prompts/ui/PromptActions.tsx +2 -2
- package/src/prompts/ui/PromptCard.tsx +4 -4
- package/src/prompts/ui/PromptView.tsx +1 -1
- package/src/prompts/ui/QuestionBody.tsx +5 -5
- package/src/providers/AccountDetail.tsx +5 -5
- package/src/providers/AccountOrderList.tsx +2 -2
- package/src/providers/AccountVariables.tsx +4 -4
- package/src/providers/AddAccountForm.tsx +7 -7
- package/src/providers/CliDetail.tsx +9 -9
- package/src/providers/InstallPage.tsx +4 -4
- package/src/providers/ProviderList.tsx +4 -4
- package/src/providers/ProvidersPane.tsx +7 -7
- package/src/providers/account-actions.ts +1 -1
- package/src/providers/install-steps.ts +1 -1
- package/src/providers/parts.tsx +1 -1
- package/src/providers/provider-abilities.ts +1 -1
- package/src/providers/provider-groups.ts +1 -1
- package/src/providers/variables.ts +1 -1
- package/src/settings/sections.ts +2 -2
- package/src/state/chats.ts +2 -2
- package/src/state/provider-accounts.ts +1 -1
- package/src/state/providers.ts +1 -1
- package/src/state/usage.ts +2 -2
- package/src/theme.css +4 -4
- package/src/transport.ts +1 -1
- package/src/usage/LimitsList.tsx +5 -5
- package/src/usage/UsageBreakdown.tsx +6 -6
- package/src/usage/UsageChart.tsx +2 -2
- package/src/usage/UsageDialog.tsx +2 -2
- package/src/usage/UsageLimits.tsx +7 -7
- package/src/usage/UsageLimitsCard.tsx +2 -2
- package/src/usage/UsagePage.tsx +5 -5
- package/src/usage/UsagePane.tsx +2 -2
- package/src/usage/UsageSummary.tsx +2 -2
- package/src/usage/UsageTiles.tsx +1 -1
- package/src/usage/limit-groups.ts +2 -2
- package/src/usage/limits.ts +1 -1
- package/src/usage/summary.ts +1 -1
- package/dist/chat/logic/json.d.ts +0 -1
- package/dist/chat/logic/json.js +0 -4
- package/src/chat/logic/json.ts +0 -4
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { c as _c } from "react/compiler-runtime";
|
|
2
|
-
import { useTranslation } from 'react-i18next';
|
|
3
2
|
import { totalTokensOf } from '@adecore/agent-contracts';
|
|
3
|
+
import { useTranslation } from 'react-i18next';
|
|
4
4
|
import { ChartLogo } from './ChartLogo.js';
|
|
5
5
|
import { formatCount, formatTokens, PROVIDER_LABELS } from './format.js';
|
|
6
6
|
import { useMoney } from './money.js';
|
package/dist/usage/UsageTiles.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { c as _c } from "react/compiler-runtime";
|
|
2
|
-
import { useTranslation } from 'react-i18next';
|
|
3
2
|
import { totalTokensOf } from '@adecore/agent-contracts';
|
|
3
|
+
import { useTranslation } from 'react-i18next';
|
|
4
4
|
import { formatTokens } from './format.js';
|
|
5
5
|
import { useMoney } from './money.js';
|
|
6
6
|
/* What the period moved, split by the kinds of token that are priced differently. */
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import i18next from 'i18next';
|
|
2
1
|
import { evenPace, USAGE_PROVIDERS } from '@adecore/agent-contracts';
|
|
2
|
+
import { formatDuration } from '@adecore/ui/format';
|
|
3
|
+
import i18next from 'i18next';
|
|
3
4
|
import { limitsAccountId } from '../agents/account-limits.js';
|
|
4
5
|
import { accountName, accountsOfKind, accountStatusLine } from '../agents/accounts.js';
|
|
5
|
-
import { formatDuration } from '@adecore/ui/format';
|
|
6
6
|
import { PROVIDER_LABELS } from './format.js';
|
|
7
7
|
export { evenPace } from '@adecore/agent-contracts';
|
|
8
8
|
const MINUTE = 60_000;
|
package/dist/usage/summary.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { dayOf } from '../state/usage.js';
|
|
2
1
|
import { EMPTY_TOTALS, USAGE_PROVIDERS, addTotals, totalTokensOf } from '@adecore/agent-contracts';
|
|
2
|
+
import { dayOf } from '../state/usage.js';
|
|
3
3
|
/* Three or four round numbers up the side. The one piece of arithmetic a chart library would bring. */
|
|
4
4
|
export function niceScale(max, ticks = 4) {
|
|
5
5
|
if (!Number.isFinite(max) || max <= 0) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@adecore/agents-react",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.54.0",
|
|
4
4
|
"description": "React agent chat threads, composers, approvals, provider accounts and usage views.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"exports": {
|
|
@@ -72,11 +72,12 @@
|
|
|
72
72
|
"test:visuals": "bun --config=integration.bunfig.toml --conditions=source test ./src/chat/visual-viewport.integration.test.ts"
|
|
73
73
|
},
|
|
74
74
|
"dependencies": {
|
|
75
|
-
"@adecore/agent-contracts": "0.
|
|
76
|
-
"@adecore/editor": "0.
|
|
77
|
-
"@adecore/editor-react": "0.
|
|
78
|
-
"@adecore/intelligent-ui": "0.
|
|
79
|
-
"@adecore/merge": "0.
|
|
75
|
+
"@adecore/agent-contracts": "0.54.0",
|
|
76
|
+
"@adecore/editor": "0.54.0",
|
|
77
|
+
"@adecore/editor-react": "0.54.0",
|
|
78
|
+
"@adecore/intelligent-ui": "0.54.0",
|
|
79
|
+
"@adecore/merge": "0.54.0",
|
|
80
|
+
"@adecore/utils": "0.54.0",
|
|
80
81
|
"@codemirror/commands": "^6.11.1",
|
|
81
82
|
"@codemirror/language": "^6.13.1",
|
|
82
83
|
"@codemirror/state": "^6.7.6",
|
|
@@ -100,14 +101,14 @@
|
|
|
100
101
|
"zustand": "^5.0.16"
|
|
101
102
|
},
|
|
102
103
|
"peerDependencies": {
|
|
103
|
-
"@adecore/ui": "^0.
|
|
104
|
+
"@adecore/ui": "^0.54.0",
|
|
104
105
|
"i18next": "^26.4.2",
|
|
105
106
|
"react": "^19.3.0",
|
|
106
107
|
"react-dom": "^19.3.0",
|
|
107
108
|
"react-i18next": "^17.0.15"
|
|
108
109
|
},
|
|
109
110
|
"devDependencies": {
|
|
110
|
-
"@adecore/ui": "0.
|
|
111
|
+
"@adecore/ui": "0.54.0",
|
|
111
112
|
"@types/bun": "^1.4.4",
|
|
112
113
|
"@types/react": "^19.3.0",
|
|
113
114
|
"@types/react-dom": "^19.3.0",
|
package/src/agents/AgentIcon.tsx
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import type { AgentKind } from '@adecore/agent-contracts';
|
|
2
|
+
import { Icon } from '@adecore/ui';
|
|
2
3
|
import clsx from 'clsx';
|
|
3
4
|
import { Bot } from 'lucide-react';
|
|
4
5
|
import { siClaude, siGithubcopilot, siGooglegemini } from 'simple-icons';
|
|
5
|
-
import { Icon } from '@adecore/ui';
|
|
6
6
|
import { type AgentMark, hostAgentMark } from './agent-marks';
|
|
7
7
|
import { PROVIDER_PATHS } from './provider-paths';
|
|
8
8
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { useContext } from 'react';
|
|
2
|
-
import clsx from 'clsx';
|
|
3
1
|
import type { AgentKind } from '@adecore/agent-contracts';
|
|
2
|
+
import clsx from 'clsx';
|
|
3
|
+
import { useContext } from 'react';
|
|
4
4
|
import { ChatScopeContext } from '../scope';
|
|
5
5
|
import { useProvidersStore } from '../state/providers';
|
|
6
6
|
import { AgentIcon } from './AgentIcon';
|
package/src/agents/accounts.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import i18next from 'i18next';
|
|
2
1
|
import { orderedAccountIds, type AgentKind, type ProviderAccount, type ProviderAccounts, type ProviderAccountStatus } from '@adecore/agent-contracts';
|
|
2
|
+
import i18next from 'i18next';
|
|
3
3
|
import type { AccentChoice, ChatHost } from '../host';
|
|
4
4
|
|
|
5
5
|
/*
|
package/src/chat/attachments.ts
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import i18next from 'i18next';
|
|
2
1
|
import {
|
|
3
2
|
attachmentBytes,
|
|
4
3
|
attachmentImageMime,
|
|
@@ -9,6 +8,7 @@ import {
|
|
|
9
8
|
type ChatAttachmentUpload
|
|
10
9
|
} from '@adecore/agent-contracts';
|
|
11
10
|
import { formatBytes as bytesOf } from '@adecore/ui/format';
|
|
11
|
+
import i18next from 'i18next';
|
|
12
12
|
|
|
13
13
|
interface IncomingFile {
|
|
14
14
|
name: string;
|
package/src/chat/bookmarks.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
+
import type { ChatBookmark } from '@adecore/agent-contracts';
|
|
1
2
|
import i18next from 'i18next';
|
|
2
3
|
import { create } from 'zustand';
|
|
3
|
-
import type { ChatBookmark } from '@adecore/agent-contracts';
|
|
4
4
|
import type { ChatHost } from '../host';
|
|
5
5
|
import type { ChatScope } from '../scope';
|
|
6
6
|
import { errorMessage } from '../transport';
|
package/src/chat/drafts.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { chatStorageKey, chatStorageLegacyKeys, createChatStore } from '../storage';
|
|
2
1
|
import type { ChatAttachmentUpload } from '@adecore/agent-contracts';
|
|
2
|
+
import { chatStorageKey, chatStorageLegacyKeys, createChatStore } from '../storage';
|
|
3
3
|
import { checkAttachmentLimits, uploadBytes } from './attachments';
|
|
4
4
|
import { persistedJson } from './persisted-json';
|
|
5
5
|
|
package/src/chat/forks.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { ChatInfo } from '@adecore/agent-contracts';
|
|
2
|
-
import { forkIdsAfter, forkedTurnIds } from './logic/fork';
|
|
3
2
|
import { useChatScope } from '../scope';
|
|
4
3
|
import { useChats, type ChatStatuses } from '../state/chats';
|
|
4
|
+
import { forkIdsAfter, forkedTurnIds } from './logic/fork';
|
|
5
5
|
|
|
6
6
|
/* The chats this client holds of one host, which is where the forks it knows of are. */
|
|
7
7
|
function* forkInfosOn(statuses: ChatStatuses, owns: (key: string) => boolean): Generator<ChatInfo> {
|
package/src/chat/logic/fork.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import i18next from 'i18next';
|
|
2
1
|
import type { AgentKind, ChatForkPayload, ChatInfo, ChatItem, ChatTurnItem, ModelSelection } from '@adecore/agent-contracts';
|
|
2
|
+
import i18next from 'i18next';
|
|
3
3
|
import type { TimelineRow } from './timeline';
|
|
4
4
|
|
|
5
5
|
/* The providers whose chat a machine can fork, and go on with in a fork, are the ones with a conversation the CLI keeps. */
|
package/src/chat/logic/limit.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import i18next from 'i18next';
|
|
2
1
|
import type { ChatInfo } from '@adecore/agent-contracts';
|
|
3
2
|
import { formatMoment } from '@adecore/ui/format';
|
|
3
|
+
import i18next from 'i18next';
|
|
4
4
|
|
|
5
5
|
export interface LimitView {
|
|
6
6
|
/* The state in a word or two with its time, for a pill in a header. */
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { ChatBookmark, ChatItem } from '@adecore/agent-contracts';
|
|
2
|
-
import { agentTurnLabel, type TimelineRow } from './timeline';
|
|
3
2
|
import { DEFAULT_READING_WIDTH, readingMeasure } from '../reading-width';
|
|
3
|
+
import { agentTurnLabel, type TimelineRow } from './timeline';
|
|
4
4
|
|
|
5
5
|
// The strip of ticks at the left edge of a chat view, as numbers; the component only draws what comes out of here.
|
|
6
6
|
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import type { ModelInfo, ModelSelection } from '@adecore/agent-contracts';
|
|
2
|
+
import { modelName, shortModelName } from '../../agents/model-name';
|
|
3
|
+
import { EFFORT_OPTION } from './effort';
|
|
4
|
+
|
|
5
|
+
/* Whether a turn ran on another model or effort than the one before it; other options do not count. */
|
|
6
|
+
export function switchesSelection(from: ModelSelection, to: ModelSelection): boolean {
|
|
7
|
+
return from.model !== to.model || from.options[EFFORT_OPTION] !== to.options[EFFORT_OPTION];
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
/* The effort a selection runs on, in the catalog's words; null for a model without one or one the catalog does not know. */
|
|
11
|
+
function effortLabel(selection: ModelSelection, models: readonly ModelInfo[] | undefined): string | null {
|
|
12
|
+
const option = models?.find((entry) => entry.slug === selection.model)?.options.find((candidate) => candidate.id === EFFORT_OPTION);
|
|
13
|
+
|
|
14
|
+
if (option === undefined || option.type !== 'select') {
|
|
15
|
+
return null;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
const chosen = selection.options[EFFORT_OPTION];
|
|
19
|
+
const choice = option.choices.find((candidate) => candidate.id === chosen) ?? option.choices.find((candidate) => candidate.id === option.defaultChoice);
|
|
20
|
+
|
|
21
|
+
return choice?.label ?? null;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
/*
|
|
25
|
+
* Both sides of the line between two turns. A side names only what changed: the effort under the same model,
|
|
26
|
+
* the models when the effort stayed, and both otherwise. Null when the two read the same.
|
|
27
|
+
*/
|
|
28
|
+
export function selectionSwitchText(from: ModelSelection, to: ModelSelection, models: readonly ModelInfo[] | undefined): { from: string; to: string } | null {
|
|
29
|
+
const fromEffort = effortLabel(from, models);
|
|
30
|
+
const toEffort = effortLabel(to, models);
|
|
31
|
+
|
|
32
|
+
if (from.model === to.model) {
|
|
33
|
+
return fromEffort === null || toEffort === null || fromEffort === toEffort ? null : { from: fromEffort, to: toEffort };
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
const fromName = shortModelName(modelName(from.model, models), models);
|
|
37
|
+
const toName = shortModelName(modelName(to.model, models), models);
|
|
38
|
+
|
|
39
|
+
if (fromEffort === toEffort) {
|
|
40
|
+
return { from: fromName, to: toName };
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
return {
|
|
44
|
+
from: fromEffort === null ? fromName : `${fromName} ${fromEffort}`,
|
|
45
|
+
to: toEffort === null ? toName : `${toName} ${toEffort}`
|
|
46
|
+
};
|
|
47
|
+
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { ChatItem, ChatUiChoiceOrigin } from '@adecore/agent-contracts';
|
|
2
|
-
import type { TimelineRow } from './timeline';
|
|
3
2
|
import { selectionWithin } from '@adecore/ui';
|
|
4
3
|
import type { FileRef } from '../../host';
|
|
4
|
+
import type { TimelineRow } from './timeline';
|
|
5
5
|
|
|
6
6
|
/* What the right-click landed on, read once when the menu opens. */
|
|
7
7
|
export interface TimelineTarget {
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import i18next from 'i18next';
|
|
2
1
|
import type {
|
|
3
2
|
ChatApprovalItem,
|
|
4
3
|
ChatAssistantItem,
|
|
@@ -12,14 +11,17 @@ import type {
|
|
|
12
11
|
ChatTurnItem,
|
|
13
12
|
ChatUserItem,
|
|
14
13
|
ChatVisual,
|
|
15
|
-
ChatWorkflow
|
|
14
|
+
ChatWorkflow,
|
|
15
|
+
ModelSelection
|
|
16
16
|
} from '@adecore/agent-contracts';
|
|
17
17
|
import { abortedByMachine } from '@adecore/agent-contracts';
|
|
18
|
-
import type { CommandLook, CommandLookSent, ThreadCard, ToolLook } from '../../host';
|
|
19
18
|
import { formatElapsedShort } from '@adecore/ui/format';
|
|
19
|
+
import i18next from 'i18next';
|
|
20
|
+
import type { CommandLook, CommandLookSent, ThreadCard, ToolLook } from '../../host';
|
|
20
21
|
import { lookKey, lookRunOf, sentMessageOf, type Look } from './command-looks';
|
|
21
22
|
import { isImageGeneration } from './generated-image';
|
|
22
23
|
import { handbackReportOf } from './handback';
|
|
24
|
+
import { switchesSelection } from './selection-switch';
|
|
23
25
|
import { toolEntry } from './tool-catalog';
|
|
24
26
|
import { hasFileChanges, isFileChange } from './tools';
|
|
25
27
|
|
|
@@ -61,6 +63,8 @@ export type TimelineRow =
|
|
|
61
63
|
// A message this chat's agent sent another node with a command of a look, drawn as said instead of as its call.
|
|
62
64
|
| { kind: 'sent'; id: string; tool: ChatToolItem; sent: CommandLookSent }
|
|
63
65
|
| { kind: 'compaction'; id: string; preTokens: number | null }
|
|
66
|
+
// The turn below ran on another model or effort than the turn before it.
|
|
67
|
+
| { kind: 'selection-switch'; id: string; from: ModelSelection; to: ModelSelection }
|
|
64
68
|
| {
|
|
65
69
|
kind: 'changed-files';
|
|
66
70
|
id: string;
|
|
@@ -107,7 +111,17 @@ function shownRows(rows: TimelineRow[], options: TimelineOptions): TimelineRow[]
|
|
|
107
111
|
* against each other; prose and cards are blocks and need room around them. Where the two meet,
|
|
108
112
|
* the block gap marks the seam, so an answer never looks glued to the call above it.
|
|
109
113
|
*/
|
|
110
|
-
const BLOCK_KINDS = new Set<TimelineRow['kind']>([
|
|
114
|
+
const BLOCK_KINDS = new Set<TimelineRow['kind']>([
|
|
115
|
+
'assistant',
|
|
116
|
+
'report',
|
|
117
|
+
'sent',
|
|
118
|
+
'thinking',
|
|
119
|
+
'changed-files',
|
|
120
|
+
'compaction',
|
|
121
|
+
'selection-switch',
|
|
122
|
+
'app-card',
|
|
123
|
+
'visual'
|
|
124
|
+
]);
|
|
111
125
|
|
|
112
126
|
export function isBlock(row: TimelineRow): boolean {
|
|
113
127
|
return BLOCK_KINDS.has(row.kind) || isImageRow(row);
|
|
@@ -663,6 +677,7 @@ function opensUnderItsMessages(turn: ChatTurnItem, rows: readonly TimelineRow[])
|
|
|
663
677
|
export function deriveTimelineRows(items: ChatItem[], options: TimelineOptions): TimelineRow[] {
|
|
664
678
|
const rows: TimelineRow[] = [];
|
|
665
679
|
const children = groupChildren(items);
|
|
680
|
+
let selection: ModelSelection | null = null;
|
|
666
681
|
|
|
667
682
|
for (const chunk of chunksByTurn(items)) {
|
|
668
683
|
if (chunk.turnId === null) {
|
|
@@ -675,6 +690,15 @@ export function deriveTimelineRows(items: ChatItem[], options: TimelineOptions):
|
|
|
675
690
|
const turn = chunk.items.find((item): item is ChatTurnItem => item.kind === 'turn');
|
|
676
691
|
const conversation = chunk.items.filter((item) => item.kind !== 'turn');
|
|
677
692
|
|
|
693
|
+
// A turn without a selection (older ones, or one the CLI started on its own) compares the next with the one before it.
|
|
694
|
+
if (turn?.selection !== undefined) {
|
|
695
|
+
if (selection !== null && switchesSelection(selection, turn.selection)) {
|
|
696
|
+
rows.push({ kind: 'selection-switch', id: `switch-${turnId}`, from: selection, to: turn.selection });
|
|
697
|
+
}
|
|
698
|
+
|
|
699
|
+
selection = turn.selection;
|
|
700
|
+
}
|
|
701
|
+
|
|
678
702
|
// A turn a message opened needs no line of its own when that message stands right above it.
|
|
679
703
|
if (turn?.origin === 'agent' && !opensUnderItsMessages(turn, rows)) {
|
|
680
704
|
// The agent started this one itself, so there is no message of the person to show above it.
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { ChatToolItem } from '@adecore/agent-contracts';
|
|
2
|
+
import { isRecord } from '@adecore/utils/record';
|
|
2
3
|
import type { ToolLook, ToolLookMatch } from '../../host';
|
|
3
4
|
import type { CommandLookWord, LookRun } from './command-looks';
|
|
4
|
-
import { isRecord } from './json';
|
|
5
5
|
|
|
6
6
|
// A value keeps this many characters of what it says.
|
|
7
7
|
const FOLD_LENGTH = 40;
|
package/src/chat/logic/tools.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import i18next from 'i18next';
|
|
2
1
|
import type { ChatSubagentStatus, ChatWorkflow, ChatWorkflowAgent } from '@adecore/agent-contracts';
|
|
3
2
|
import { formatElapsedShort } from '@adecore/ui/format';
|
|
3
|
+
import i18next from 'i18next';
|
|
4
4
|
|
|
5
5
|
/* `waiting` has not started yet; `stopped` was still at work by the last report when the workflow ended. */
|
|
6
6
|
export type WorkflowAgentState = ChatSubagentStatus | 'waiting' | 'stopped';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { CHAT_REQUEST_LIMITS, type ChatInfo } from '@adecore/agent-contracts';
|
|
2
|
-
import type { PromptSubject } from '../prompts/logic/subjects';
|
|
3
2
|
import type { PendingPrompt } from '../prompts/logic/prompts';
|
|
3
|
+
import type { PromptSubject } from '../prompts/logic/subjects';
|
|
4
4
|
import type { ChatScope } from '../scope';
|
|
5
5
|
import { useChats, waitingRequestsOf } from '../state/chats';
|
|
6
6
|
import { subagentTitle } from './subagent-list';
|
package/src/chat/preferences.ts
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { chatStorageKey, chatStorageLegacyKeys, createChatStore, onChatStorageConfiguration } from '../storage';
|
|
2
1
|
import {
|
|
3
2
|
topAccountOf,
|
|
4
3
|
type AgentKind,
|
|
@@ -8,6 +7,7 @@ import {
|
|
|
8
7
|
type ProviderAccounts,
|
|
9
8
|
type RuntimeMode
|
|
10
9
|
} from '@adecore/agent-contracts';
|
|
10
|
+
import { chatStorageKey, chatStorageLegacyKeys, createChatStore, onChatStorageConfiguration } from '../storage';
|
|
11
11
|
import { persistedJson } from './persisted-json';
|
|
12
12
|
import { DEFAULT_READING_WIDTH, isChatReadingWidth, type ChatReadingWidth } from './reading-width';
|
|
13
13
|
import { DEFAULT_SEND_KEY, isChatSendKey, type ChatSendKey } from './send-key';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { CSSProperties } from 'react';
|
|
2
1
|
import i18next from 'i18next';
|
|
2
|
+
import type { CSSProperties } from 'react';
|
|
3
3
|
|
|
4
4
|
/* How wide a chat that is a view of its own lets its thread and composer run. A node on a canvas is narrower than any of them. */
|
|
5
5
|
export type ChatReadingWidth = 'narrow' | 'comfortable' | 'full';
|
package/src/chat/send-key.ts
CHANGED
package/src/chat/stash.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
+
import { shortcut } from '@adecore/ui';
|
|
2
|
+
import { isRecord } from '@adecore/utils/record';
|
|
1
3
|
import { chatStorageKey, chatStorageLegacyKeys, createChatStore } from '../storage';
|
|
2
4
|
import { uploadBytes } from './attachments';
|
|
3
5
|
import { isEmptyDraft, type ChatDraft } from './drafts';
|
|
4
|
-
import { isRecord } from './logic/json';
|
|
5
6
|
import { persistedJson } from './persisted-json';
|
|
6
7
|
import { withQuote } from './quote';
|
|
7
|
-
import { shortcut } from '@adecore/ui';
|
|
8
8
|
|
|
9
9
|
/* Puts the draft away, or takes the last one back on an empty box. */
|
|
10
10
|
export const STASH_SHORTCUT = shortcut('Mod+S');
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import i18next from 'i18next';
|
|
2
1
|
import type { ChatApprovalItem, ChatItem, ChatQuestionItem, ChatSubagentResult } from '@adecore/agent-contracts';
|
|
2
|
+
import i18next from 'i18next';
|
|
3
3
|
import { isWaiting } from '../state/chats';
|
|
4
4
|
import { errorCode, isConnectionError, type ChatTransport } from '../transport';
|
|
5
5
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import i18next from 'i18next';
|
|
2
1
|
import { activeSubagents, type ChatInfo, type ChatItem, type ChatSubagentItem } from '@adecore/agent-contracts';
|
|
3
2
|
import { formatMoment, formatElapsedShort, formatTokens } from '@adecore/ui/format';
|
|
3
|
+
import i18next from 'i18next';
|
|
4
4
|
import type { StatusWord } from '../agents/status-look';
|
|
5
5
|
import type { SubagentTask } from '../host';
|
|
6
6
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
+
import type { ChatItem, ChatSubagentItem } from '@adecore/agent-contracts';
|
|
1
2
|
import i18next from 'i18next';
|
|
2
3
|
import { create } from 'zustand';
|
|
3
|
-
import type { ChatItem, ChatSubagentItem } from '@adecore/agent-contracts';
|
|
4
4
|
import { useChatScope } from '../scope';
|
|
5
5
|
import { useChatRow } from '../state/chats';
|
|
6
6
|
import { useSubagentSupport } from './subagent-support';
|
package/src/chat/thumbnails.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
+
import type { ChatAttachmentUpload } from '@adecore/agent-contracts';
|
|
1
2
|
import i18next from 'i18next';
|
|
2
3
|
import { useEffect, useState } from 'react';
|
|
3
|
-
import type { ChatAttachmentUpload } from '@adecore/agent-contracts';
|
|
4
4
|
import { uploadPreviewUrl } from './attachments';
|
|
5
5
|
import { imageForDisplay } from './image-display';
|
|
6
6
|
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { useTranslation } from 'react-i18next';
|
|
2
1
|
import type { AgentKind } from '@adecore/agent-contracts';
|
|
2
|
+
import { Pill, Tooltip } from '@adecore/ui';
|
|
3
|
+
import { useTranslation } from 'react-i18next';
|
|
3
4
|
import { AccountDot } from '../../agents/AccountDot';
|
|
4
|
-
import { useAccountChoice } from '../account-choice';
|
|
5
|
-
import { useChats } from '../../state/chats';
|
|
6
5
|
import { useChatScope } from '../../scope';
|
|
7
|
-
import {
|
|
6
|
+
import { useChats } from '../../state/chats';
|
|
7
|
+
import { useAccountChoice } from '../account-choice';
|
|
8
8
|
|
|
9
9
|
function AccountPillOf({ chatId, provider, account }: { chatId: string; provider: AgentKind; account: string | undefined }) {
|
|
10
10
|
const { t } = useTranslation('agent-chat');
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { CHAT_BOOKMARK_LIMITS, type ChatBookmark } from '@adecore/agent-contracts';
|
|
2
|
+
import { ButtonGroup, Icon, IconButton, Input } from '@adecore/ui';
|
|
2
3
|
import clsx from 'clsx';
|
|
3
|
-
import { useTranslation } from 'react-i18next';
|
|
4
4
|
import { Bookmark, Pencil, X } from 'lucide-react';
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import { bookmarkLabel } from '../logic/bookmarks';
|
|
5
|
+
import { useEffect, useRef } from 'react';
|
|
6
|
+
import { useTranslation } from 'react-i18next';
|
|
8
7
|
import { useChatHost } from '../../host';
|
|
9
8
|
import { useChatScope } from '../../scope';
|
|
10
|
-
import {
|
|
9
|
+
import { nameBookmark, removeBookmark, useBookmarkNaming } from '../bookmarks';
|
|
10
|
+
import { bookmarkLabel } from '../logic/bookmarks';
|
|
11
11
|
|
|
12
12
|
interface BookmarkMarkerProps {
|
|
13
13
|
chatId: string;
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
+
import { Icon, Menu } from '@adecore/ui';
|
|
1
2
|
import clsx from 'clsx';
|
|
2
|
-
import { useTranslation } from 'react-i18next';
|
|
3
3
|
import { Bookmark, Pencil, X } from 'lucide-react';
|
|
4
|
-
import {
|
|
5
|
-
import { bookmarkLabel, bookmarksInThreadOrder } from '../logic/bookmarks';
|
|
4
|
+
import { useTranslation } from 'react-i18next';
|
|
6
5
|
import { useChatHost } from '../../host';
|
|
6
|
+
import { useHostChatPlace } from '../../host-hooks';
|
|
7
7
|
import { useChatScope } from '../../scope';
|
|
8
8
|
import { useChatRow } from '../../state/chats';
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
9
|
+
import { goToBookmark, removeBookmark } from '../bookmarks';
|
|
10
|
+
import { bookmarkLabel, bookmarksInThreadOrder } from '../logic/bookmarks';
|
|
11
11
|
|
|
12
12
|
/* A chat's bookmarks in thread order, each a jump to its message with rename and remove; nothing without bookmarks. */
|
|
13
13
|
export function BookmarkSubmenu({ chatId }: { chatId: string }) {
|
|
@@ -1,24 +1,24 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type { ChatBackgroundTask, ChatSubagentItem } from '@adecore/agent-contracts';
|
|
2
|
+
import { Icon, IconButton, Popover, ScrollArea, Surface, useNow } from '@adecore/ui';
|
|
3
|
+
import { formatElapsedShort } from '@adecore/ui/format';
|
|
2
4
|
import clsx from 'clsx';
|
|
3
|
-
import { useShallow } from 'zustand/shallow';
|
|
4
|
-
import { useTranslation } from 'react-i18next';
|
|
5
5
|
import { Activity, MessageCircleQuestionMark, Square, SquareTerminal, TriangleAlert } from 'lucide-react';
|
|
6
|
-
import
|
|
6
|
+
import { useState, type ReactNode } from 'react';
|
|
7
|
+
import { useTranslation } from 'react-i18next';
|
|
8
|
+
import { useShallow } from 'zustand/shallow';
|
|
9
|
+
import { statusLookOf, type StatusWord } from '../../agents/status-look';
|
|
10
|
+
import { useChatHost } from '../../host';
|
|
11
|
+
import { useHostTask, useHostTasks } from '../../host-hooks';
|
|
12
|
+
import { useChatScope } from '../../scope';
|
|
13
|
+
import { useChatRow, useChats } from '../../state/chats';
|
|
14
|
+
import { useChatActions } from '../actions';
|
|
7
15
|
import { backgroundCounts } from '../activity';
|
|
8
16
|
import { badgeCountOf, entryTimeOf, flyoutSubagents, progressOf, statusWordOf, subagentTitle, summaryWordOf, taskIdOf, taskRowStateOf } from '../subagent-list';
|
|
9
17
|
import { useSubagentSupport } from '../subagent-support';
|
|
10
18
|
import { canOpenSubagent, crumbOf, openFromMain, useSubagentTrail, type SubagentStep } from '../subagent-view';
|
|
11
19
|
import { flyoutWorkflows, workflowPillOf, type WorkflowCall, type WorkflowWord } from '../workflow-list';
|
|
12
|
-
import { SubagentStopButton } from './SubagentStopButton';
|
|
13
20
|
import { WorkflowRow } from './rows/WorkflowRow';
|
|
14
|
-
import {
|
|
15
|
-
import { Icon, IconButton, Popover, Surface, useNow } from '@adecore/ui';
|
|
16
|
-
import { useChatRow, useChats } from '../../state/chats';
|
|
17
|
-
import { useChatHost } from '../../host';
|
|
18
|
-
import { useChatScope } from '../../scope';
|
|
19
|
-
import { useChatActions } from '../actions';
|
|
20
|
-
import { statusLookOf, type StatusWord } from '../../agents/status-look';
|
|
21
|
-
import { useHostTask, useHostTasks } from '../../host-hooks';
|
|
21
|
+
import { SubagentStopButton } from './SubagentStopButton';
|
|
22
22
|
|
|
23
23
|
const NO_TASKS: readonly ChatBackgroundTask[] = [];
|
|
24
24
|
|
|
@@ -162,11 +162,11 @@ function WorkflowFlyout({ chatId, calls }: { chatId: string; calls: readonly Wor
|
|
|
162
162
|
</Surface>
|
|
163
163
|
<Popover.Popup side="top" className="w-96">
|
|
164
164
|
<div className="px-2.5 pt-1.5 pb-1 text-xs text-text-faint">{t('activity.workflows', { count: calls.length })}</div>
|
|
165
|
-
<
|
|
165
|
+
<ScrollArea className="max-h-96" viewportClassName="px-2.5 pb-1.5">
|
|
166
166
|
{calls.map((call) => (
|
|
167
167
|
<WorkflowRow key={call.id} chatId={chatId} tool={call} workflow={call.workflow} onOpenAgent={openAgent} place="flyout" />
|
|
168
168
|
))}
|
|
169
|
-
</
|
|
169
|
+
</ScrollArea>
|
|
170
170
|
</Popover.Popup>
|
|
171
171
|
</Popover.Root>
|
|
172
172
|
);
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ButtonGroup, IconButton, ScrollArea } from '@adecore/ui';
|
|
2
2
|
import clsx from 'clsx';
|
|
3
|
-
import { useTranslation } from 'react-i18next';
|
|
4
3
|
import { Check, Copy } from 'lucide-react';
|
|
5
|
-
import {
|
|
4
|
+
import { Fragment, memo, useContext, useEffect, useMemo, useRef, useState, type ReactNode } from 'react';
|
|
5
|
+
import { useTranslation } from 'react-i18next';
|
|
6
|
+
import { useChatHost } from '../../host';
|
|
6
7
|
import { IncrementalLines, type CodeToken } from './code-lines';
|
|
7
8
|
import { CodeStreamingContext } from './code-streaming';
|
|
8
|
-
import { WHOLE_FADE_CLASS } from './rehype-fade';
|
|
9
|
-
import { useChatHost } from '../../host';
|
|
10
9
|
import { useCodeTheme } from './code-theme';
|
|
11
10
|
import { tokenStyle, useCodeHighlighter } from './highlighter';
|
|
11
|
+
import { WHOLE_FADE_CLASS } from './rehype-fade';
|
|
12
12
|
|
|
13
13
|
const COPIED_MS = 1500;
|
|
14
14
|
|
|
@@ -97,8 +97,10 @@ export function CodeBlock({ code, lang, actions, view }: { code: string; lang: s
|
|
|
97
97
|
return (
|
|
98
98
|
<div className="chat-code" data-copy-state={copyState}>
|
|
99
99
|
{view ?? (
|
|
100
|
-
<
|
|
101
|
-
|
|
100
|
+
<ScrollArea
|
|
101
|
+
axis="both"
|
|
102
|
+
render={<pre />}
|
|
103
|
+
viewportClassName={clsx(pending && 'invisible', !pending && tokens !== null && waited && WHOLE_FADE_CLASS)}
|
|
102
104
|
aria-hidden={pending || undefined}
|
|
103
105
|
style={{ color: tokenizer?.fg }}
|
|
104
106
|
>
|
|
@@ -113,7 +115,7 @@ export function CodeBlock({ code, lang, actions, view }: { code: string; lang: s
|
|
|
113
115
|
</Fragment>
|
|
114
116
|
))}
|
|
115
117
|
</code>
|
|
116
|
-
</
|
|
118
|
+
</ScrollArea>
|
|
117
119
|
)}
|
|
118
120
|
<ButtonGroup className="chat-code-actions" role="group" aria-label={t('code.actions')}>
|
|
119
121
|
<IconButton
|