@adecore/agents-react 0.53.3 → 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
package/src/chat/ui/Composer.tsx
CHANGED
|
@@ -1,11 +1,12 @@
|
|
|
1
|
-
import { useEffect, useRef, useState, useSyncExternalStore, type MouseEvent, type PointerEvent } from 'react';
|
|
2
|
-
import { useTranslation } from 'react-i18next';
|
|
3
|
-
import clsx from 'clsx';
|
|
4
|
-
import { ChevronDown } from 'lucide-react';
|
|
5
1
|
import type { AgentKind, ChatInfo, ModelSelection } from '@adecore/agent-contracts';
|
|
6
2
|
import { Icon, PromptDialog, Surface, Tooltip } from '@adecore/ui';
|
|
7
3
|
import { formatNumber } from '@adecore/ui/format';
|
|
4
|
+
import clsx from 'clsx';
|
|
5
|
+
import { ChevronDown } from 'lucide-react';
|
|
6
|
+
import { useEffect, useRef, useState, useSyncExternalStore, type MouseEvent, type PointerEvent } from 'react';
|
|
7
|
+
import { useTranslation } from 'react-i18next';
|
|
8
8
|
import { useChatHost } from '../../host';
|
|
9
|
+
import { useHostComposerSendActions, useHostExtraPrompts, useHostSendDelivery } from '../../host-hooks';
|
|
9
10
|
import { canSteer } from '../../providers/provider-abilities';
|
|
10
11
|
import { useChatScope } from '../../scope';
|
|
11
12
|
import { useProviders } from '../../state/providers';
|
|
@@ -18,11 +19,6 @@ import { dismissResumeCompaction } from '../resume-compaction-dismissals';
|
|
|
18
19
|
import { sendShortcut } from '../send-key';
|
|
19
20
|
import { scrollTimelineToEnd, subscribeTimelineEnd, timelineAtEnd } from '../timeline-scroll';
|
|
20
21
|
import { ChatActivity } from './ChatActivity';
|
|
21
|
-
import { ComposerInput, type ComposerInputHandle } from './ComposerInput';
|
|
22
|
-
import { GoalDock } from './GoalDock';
|
|
23
|
-
import { LimitDock } from './LimitState';
|
|
24
|
-
import { PromptComposer } from './PromptComposer';
|
|
25
|
-
import { ResumeCompactionDock } from './ResumeCompactionDock';
|
|
26
22
|
import { chipDecorations } from './composer/chips';
|
|
27
23
|
import { ComposerControls } from './composer/ComposerControls';
|
|
28
24
|
import { ComposerMenu } from './composer/ComposerMenu';
|
|
@@ -30,21 +26,25 @@ import { DraftAttachments, DraftQuote } from './composer/DraftParts';
|
|
|
30
26
|
import { composerKeyHandler } from './composer/key-handler';
|
|
31
27
|
import { useHintedPlaceholder } from './composer/placeholder';
|
|
32
28
|
import { QueuedMessages } from './composer/QueuedMessages';
|
|
29
|
+
import { surfacePartOf } from './composer/surface';
|
|
33
30
|
import { useChatControls } from './composer/use-chat-controls';
|
|
34
31
|
import { useCompactionOffer } from './composer/use-compaction-offer';
|
|
35
32
|
import { useComposerDraft } from './composer/use-composer-draft';
|
|
36
33
|
import { useComposerMenus } from './composer/use-composer-menus';
|
|
37
34
|
import { useComposerSubmit } from './composer/use-composer-submit';
|
|
38
|
-
import { useEffortStepper } from './composer/use-effort-stepper';
|
|
39
|
-
import { LEAVE_DROPS_TO_THE_CARD, useDraftFiles } from './composer/use-draft-files';
|
|
40
35
|
import { useContinuableTurn } from './composer/use-continuable-turn';
|
|
36
|
+
import { LEAVE_DROPS_TO_THE_CARD, useDraftFiles } from './composer/use-draft-files';
|
|
37
|
+
import { useEffortStepper } from './composer/use-effort-stepper';
|
|
41
38
|
import { useNotice } from './composer/use-notice';
|
|
42
39
|
import { usePendingRequests } from './composer/use-pending-requests';
|
|
43
40
|
import { usePromptHistory } from './composer/use-prompt-history';
|
|
44
41
|
import { usePromptHold } from './composer/use-prompt-hold';
|
|
45
|
-
import { surfacePartOf } from './composer/surface';
|
|
46
42
|
import { useTakeBack } from './composer/use-take-back';
|
|
47
|
-
import {
|
|
43
|
+
import { ComposerInput, type ComposerInputHandle } from './ComposerInput';
|
|
44
|
+
import { GoalDock } from './GoalDock';
|
|
45
|
+
import { LimitDock } from './LimitState';
|
|
46
|
+
import { PromptComposer } from './PromptComposer';
|
|
47
|
+
import { ResumeCompactionDock } from './ResumeCompactionDock';
|
|
48
48
|
|
|
49
49
|
interface ComposerProps {
|
|
50
50
|
chatId: string;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { useOverlayScrollbars } from '@adecore/ui';
|
|
2
2
|
import { Compartment, EditorState, Prec, Transaction, type Extension } from '@codemirror/state';
|
|
3
3
|
import { EditorView, placeholder as placeholderText } from '@codemirror/view';
|
|
4
|
+
import { useImperativeHandle, useLayoutEffect, useRef, useState, type Ref } from 'react';
|
|
4
5
|
import { useChatHost } from '../../host';
|
|
5
6
|
import { composerEditorExtensions, externalChange } from './composer/editor';
|
|
6
7
|
import { insertAtSelection } from './composer/insert';
|
|
@@ -69,6 +70,8 @@ export function ComposerInput({
|
|
|
69
70
|
const hostRef = useRef<HTMLDivElement>(null);
|
|
70
71
|
const targetRef = useRef<HTMLDivElement>(null);
|
|
71
72
|
const viewRef = useRef<EditorView | null>(null);
|
|
73
|
+
const [scroller, setScroller] = useState<HTMLElement | null>(null);
|
|
74
|
+
const scrollbars = useOverlayScrollbars(scroller);
|
|
72
75
|
|
|
73
76
|
const [compartments] = useState(() => ({
|
|
74
77
|
attributes: new Compartment(),
|
|
@@ -150,10 +153,12 @@ export function ComposerInput({
|
|
|
150
153
|
});
|
|
151
154
|
|
|
152
155
|
viewRef.current = view;
|
|
156
|
+
setScroller(view.scrollDOM);
|
|
153
157
|
|
|
154
158
|
return () => {
|
|
155
159
|
view.destroy();
|
|
156
160
|
viewRef.current = null;
|
|
161
|
+
setScroller(null);
|
|
157
162
|
};
|
|
158
163
|
}, [compartments, dictation.composer?.extensions]);
|
|
159
164
|
|
|
@@ -222,7 +227,10 @@ export function ComposerInput({
|
|
|
222
227
|
|
|
223
228
|
return (
|
|
224
229
|
<div ref={targetRef} className="min-w-0">
|
|
225
|
-
<div
|
|
230
|
+
<div className="relative">
|
|
231
|
+
<div ref={hostRef} className={className} />
|
|
232
|
+
{scrollbars}
|
|
233
|
+
</div>
|
|
226
234
|
{Dictation && <Dictation buttonContainer={dictationToolbar} targetRef={targetRef} disabled={disabled} editor={() => viewRef.current} />}
|
|
227
235
|
</div>
|
|
228
236
|
);
|
package/src/chat/ui/DiffPool.tsx
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { useEffect, type ReactNode } from 'react';
|
|
2
1
|
import { useWorkerPool, WorkerPoolContextProvider } from '@pierre/diffs/react';
|
|
2
|
+
import { useEffect, type ReactNode } from 'react';
|
|
3
3
|
import { useDiffTheme } from './diff-theme';
|
|
4
4
|
|
|
5
5
|
// Two workers keep highlighting off the main thread without holding a shiki instance per chat node.
|
package/src/chat/ui/EditDiff.tsx
CHANGED
|
@@ -1,13 +1,12 @@
|
|
|
1
1
|
import { LazyBoundary } from '@adecore/ui';
|
|
2
2
|
import { useTranslation } from 'react-i18next';
|
|
3
|
+
import { useChatHost } from '../../host';
|
|
3
4
|
import { lazyNamed } from '../../lazy';
|
|
5
|
+
import type { FileChange } from '../logic/tools';
|
|
4
6
|
import { diffSourceBudget, legacyDiffBudget } from './diff/diff-source-budget';
|
|
7
|
+
import { DiffFallbackBoundary } from './diff/DiffFallbackBoundary';
|
|
5
8
|
import { DiffOmitted } from './diff/DiffOmitted';
|
|
6
9
|
import { DiffUnavailable } from './diff/DiffUnavailable';
|
|
7
|
-
import { DiffFallbackBoundary } from './diff/DiffFallbackBoundary';
|
|
8
|
-
import { useChatHost } from '../../host';
|
|
9
|
-
|
|
10
|
-
import type { FileChange } from '../logic/tools';
|
|
11
10
|
|
|
12
11
|
const LegacyEditDiff = lazyNamed(() => import('./diff/LegacyEditDiff'), 'default', { prefetch: false });
|
|
13
12
|
const EditorEditDiff = lazyNamed(() => import('./diff/EditorEditDiff'), 'default');
|
package/src/chat/ui/GoalDock.tsx
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
import { useState } from 'react';
|
|
2
|
-
import { useTranslation } from 'react-i18next';
|
|
3
|
-
import type { TFunction } from 'i18next';
|
|
4
|
-
import clsx from 'clsx';
|
|
5
|
-
import { Target } from 'lucide-react';
|
|
6
1
|
import type { ChatGoal, ChatGoalAction, ChatInfo, ProviderCapabilities } from '@adecore/agent-contracts';
|
|
7
2
|
import { Button, Icon, Pill, Tooltip } from '@adecore/ui';
|
|
8
3
|
import { formatTokens, useFormatLocale } from '@adecore/ui/format';
|
|
4
|
+
import clsx from 'clsx';
|
|
5
|
+
import type { TFunction } from 'i18next';
|
|
6
|
+
import { Target } from 'lucide-react';
|
|
7
|
+
import { useState } from 'react';
|
|
8
|
+
import { useTranslation } from 'react-i18next';
|
|
9
9
|
import { useChatHost } from '../../host';
|
|
10
10
|
import { useChatScope } from '../../scope';
|
|
11
11
|
import { useChats } from '../../state/chats';
|
|
12
|
+
import { errorMessage } from '../../transport';
|
|
12
13
|
import { useChatActions } from '../actions';
|
|
13
14
|
import { goalView } from '../logic/goal';
|
|
14
|
-
import { errorMessage } from '../../transport';
|
|
15
15
|
|
|
16
16
|
/* How far the goal got, in what its CLI counts: the checks that sent the agent on, or the tokens it spent. */
|
|
17
17
|
function progressOf(goal: ChatGoal, t: TFunction<'agent-chat'>): string | null {
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { ButtonGroup, CloseButton, Dialog, Icon, IconButton, Tooltip } from '@adecore/ui';
|
|
2
|
+
import { formatNumber } from '@adecore/ui/format';
|
|
3
3
|
import clsx from 'clsx';
|
|
4
4
|
import { ChevronLeft, ChevronRight, ImageOff, Minus, Plus, RotateCcw } from 'lucide-react';
|
|
5
|
+
import { createContext, useContext, useId, useLayoutEffect, useRef, useState, useSyncExternalStore, type KeyboardEvent, type ReactNode } from 'react';
|
|
6
|
+
import { useTranslation } from 'react-i18next';
|
|
5
7
|
import type { ResourceUrl } from '../../host';
|
|
6
|
-
import { ButtonGroup, CloseButton, Dialog, Icon, IconButton, Tooltip } from '@adecore/ui';
|
|
7
|
-
import { formatNumber } from '@adecore/ui/format';
|
|
8
8
|
import { BUTTON_STEP, clamped, MAX_SCALE, MIN_SCALE, START, stepped, wheeled, zoomed, type Bounds, type Point, type View } from '../logic/lightbox';
|
|
9
9
|
import { DisplayImage } from './DisplayImage';
|
|
10
10
|
|
|
@@ -1,24 +1,24 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import type { ChatInfo } from '@adecore/agent-contracts';
|
|
2
|
+
import { Switch, Button, ButtonGroup, Icon, Menu, Pill, Tooltip, useNow } from '@adecore/ui';
|
|
3
|
+
import { useFormatLocale } from '@adecore/ui/format';
|
|
3
4
|
import clsx from 'clsx';
|
|
4
5
|
import { ChevronDown, Hourglass } from 'lucide-react';
|
|
5
|
-
import
|
|
6
|
-
import {
|
|
6
|
+
import { useEffect, useState } from 'react';
|
|
7
|
+
import { useTranslation } from 'react-i18next';
|
|
7
8
|
import { continueTargets, hasUnreadAccount, limitsOfAccount, sessionWindow } from '../../agents/account-limits';
|
|
9
|
+
import { AccountDot } from '../../agents/AccountDot';
|
|
8
10
|
import { canContinueOn, type AccountEntry } from '../../agents/accounts';
|
|
9
|
-
import { useAccountChoice, type AccountChoice } from '../account-choice';
|
|
10
|
-
import { limitView } from '../logic/limit';
|
|
11
|
-
import { useFormatLocale } from '@adecore/ui/format';
|
|
12
|
-
import { Switch, Button, ButtonGroup, Icon, Menu, Pill, Tooltip, useNow } from '@adecore/ui';
|
|
13
|
-
import { useUsageLimits } from '../../usage/limits';
|
|
14
|
-
import { useChats } from '../../state/chats';
|
|
15
11
|
import { useChatHost } from '../../host';
|
|
12
|
+
import { useHostResumeAtReset } from '../../host-hooks';
|
|
16
13
|
import { useChatScope, type ChatScope } from '../../scope';
|
|
17
|
-
import {
|
|
14
|
+
import { useChats } from '../../state/chats';
|
|
18
15
|
import { useUsageStore } from '../../state/usage';
|
|
19
|
-
import { SessionLine } from './SessionLine';
|
|
20
|
-
import { useHostResumeAtReset } from '../../host-hooks';
|
|
21
16
|
import { errorMessage } from '../../transport';
|
|
17
|
+
import { useUsageLimits } from '../../usage/limits';
|
|
18
|
+
import { useAccountChoice, type AccountChoice } from '../account-choice';
|
|
19
|
+
import { useChatActions } from '../actions';
|
|
20
|
+
import { limitView } from '../logic/limit';
|
|
21
|
+
import { SessionLine } from './SessionLine';
|
|
22
22
|
|
|
23
23
|
// A time a limit names reads as a clock today and with its day after that, so the words follow the minute.
|
|
24
24
|
const MINUTE_MS = 60_000;
|
package/src/chat/ui/Markdown.tsx
CHANGED
|
@@ -1,25 +1,25 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ErrorBoundary, FileIcon, Icon, ScrollArea } from '@adecore/ui';
|
|
2
2
|
import clsx from 'clsx';
|
|
3
3
|
import { Zap } from 'lucide-react';
|
|
4
|
+
import { createContext, memo, useContext, useState, type ComponentProps, type MouseEvent, type ReactNode } from 'react';
|
|
5
|
+
import { useTranslation } from 'react-i18next';
|
|
4
6
|
import ReactMarkdown, { type Components, type ExtraProps, type Options } from 'react-markdown';
|
|
5
7
|
import remarkBreaks from 'remark-breaks';
|
|
6
8
|
import remarkGfm from 'remark-gfm';
|
|
9
|
+
import { useChatHost, type ChatHost, type FileRef, type ShellCodeBlockContext } from '../../host';
|
|
10
|
+
import type { ReferenceToken } from '../mentions';
|
|
7
11
|
import { MENTION_TONE, SKILL_TONE, TOKEN_ICON } from './chips';
|
|
8
|
-
import { CodeBlock } from './CodeBlock';
|
|
9
|
-
import { MermaidBlock } from './MermaidBlock';
|
|
10
12
|
import { CodeStreamingContext } from './code-streaming';
|
|
13
|
+
import { CodeBlock } from './CodeBlock';
|
|
14
|
+
import { DisplayImage } from './DisplayImage';
|
|
15
|
+
import { useFileLinkCwd, useFileLinkScopeId, useFileLinkTarget, useOpenFileLink } from './file-links';
|
|
11
16
|
import { createMarkdownBlockSplitter } from './markdown-blocks';
|
|
12
|
-
import {
|
|
17
|
+
import { MermaidBlock } from './MermaidBlock';
|
|
13
18
|
import { ReferenceLookupContext } from './reference-lookup';
|
|
19
|
+
import { ReferenceChip, TokenChip } from './ReferenceChip';
|
|
14
20
|
import { rehypeChips, rehypeNamedReferences, type ChipOptions, type NamedReferenceOptions } from './rehype-chips';
|
|
15
|
-
import type { ReferenceToken } from '../mentions';
|
|
16
21
|
import { rehypeFadeWords } from './rehype-fade';
|
|
17
22
|
import { remarkHtmlAsText } from './remark-html-as-text';
|
|
18
|
-
import { useChatHost, type ChatHost, type FileRef, type ShellCodeBlockContext } from '../../host';
|
|
19
|
-
import { useFileLinkCwd, useFileLinkScopeId, useFileLinkTarget, useOpenFileLink } from './file-links';
|
|
20
|
-
import { ErrorBoundary, FileIcon, Icon } from '@adecore/ui';
|
|
21
|
-
import { useTranslation } from 'react-i18next';
|
|
22
|
-
import { DisplayImage } from './DisplayImage';
|
|
23
23
|
|
|
24
24
|
type ShellCodeBlockReply = Pick<ShellCodeBlockContext, 'scopeId' | 'chatId' | 'itemId'> & { streaming: boolean };
|
|
25
25
|
|
|
@@ -273,9 +273,9 @@ const components = {
|
|
|
273
273
|
table({ children }: { children?: ReactNode }) {
|
|
274
274
|
// A table wider than the column scrolls on its own instead of pushing the thread sideways.
|
|
275
275
|
return (
|
|
276
|
-
<
|
|
276
|
+
<ScrollArea axis="x" className="chat-table">
|
|
277
277
|
<table>{children}</table>
|
|
278
|
-
</
|
|
278
|
+
</ScrollArea>
|
|
279
279
|
);
|
|
280
280
|
}
|
|
281
281
|
};
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
+
import { IconButton, ScrollArea } from '@adecore/ui';
|
|
2
|
+
import { Code, Workflow } from 'lucide-react';
|
|
1
3
|
import { useContext, useEffect, useId, useRef, useState } from 'react';
|
|
2
4
|
import { useTranslation } from 'react-i18next';
|
|
3
|
-
import {
|
|
4
|
-
import { IconButton } from '@adecore/ui';
|
|
5
|
-
import { CodeBlock } from './CodeBlock';
|
|
5
|
+
import { useHostCodeMode } from '../../host-hooks';
|
|
6
6
|
import { CodeStreamingContext } from './code-streaming';
|
|
7
|
+
import { CodeBlock } from './CodeBlock';
|
|
7
8
|
import { DIAGRAM_TOKENS, GROUND_TOKEN, renderOptions, svgDataUrl, themedSvg, type DiagramFont } from './mermaid';
|
|
8
9
|
import { watchTheme } from './theme-watch';
|
|
9
|
-
import { useHostCodeMode } from '../../host-hooks';
|
|
10
10
|
|
|
11
11
|
interface LaidOut {
|
|
12
12
|
svg: string;
|
|
@@ -152,7 +152,7 @@ export function MermaidBlock({ code }: { code: string }) {
|
|
|
152
152
|
actions={toggle}
|
|
153
153
|
view={
|
|
154
154
|
showsDiagram ? (
|
|
155
|
-
<
|
|
155
|
+
<ScrollArea axis="x" viewportClassName="p-3" aria-busy={image === null || undefined}>
|
|
156
156
|
{image !== null && (
|
|
157
157
|
<img
|
|
158
158
|
src={svgDataUrl(image.svg)}
|
|
@@ -163,7 +163,7 @@ export function MermaidBlock({ code }: { code: string }) {
|
|
|
163
163
|
draggable={false}
|
|
164
164
|
/>
|
|
165
165
|
)}
|
|
166
|
-
</
|
|
166
|
+
</ScrollArea>
|
|
167
167
|
) : undefined
|
|
168
168
|
}
|
|
169
169
|
/>
|
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ButtonGroup, IconButton, Tooltip } from '@adecore/ui';
|
|
2
|
+
import { formatClock, formatDateTime, useFormatLocale } from '@adecore/ui/format';
|
|
2
3
|
import clsx from 'clsx';
|
|
3
|
-
import { useTranslation } from 'react-i18next';
|
|
4
4
|
import { Bookmark, Check, Copy, GitFork } from 'lucide-react';
|
|
5
|
+
import { useEffect, useState } from 'react';
|
|
6
|
+
import { useTranslation } from 'react-i18next';
|
|
7
|
+
import { useChatHost } from '../../host';
|
|
8
|
+
import { useChatScope } from '../../scope';
|
|
9
|
+
import { useChatRow, useChats } from '../../state/chats';
|
|
5
10
|
import { placeBookmark } from '../bookmarks';
|
|
6
11
|
import { forkRefusal } from '../logic/fork';
|
|
7
12
|
import type { TimelineRow } from '../logic/timeline';
|
|
8
13
|
import { markdownOf, messageTextOf } from '../logic/timeline-copy';
|
|
9
|
-
import { useChatHost } from '../../host';
|
|
10
|
-
import { useChatScope } from '../../scope';
|
|
11
|
-
import { useChatRow, useChats } from '../../state/chats';
|
|
12
|
-
import { ButtonGroup, IconButton, Tooltip } from '@adecore/ui';
|
|
13
|
-
import { formatClock, formatDateTime, useFormatLocale } from '@adecore/ui/format';
|
|
14
14
|
import { copyWithChips, messageClipboardChips } from './chip-clipboard';
|
|
15
15
|
import { useReferenceLookup } from './thread-references';
|
|
16
16
|
import { TIMESTAMP_FORMAT } from './timestamp-format';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { useTranslation } from 'react-i18next';
|
|
2
|
-
import { Wrench } from 'lucide-react';
|
|
3
1
|
import type { ModelInfo } from '@adecore/agent-contracts';
|
|
4
2
|
import { Icon, Pill, Tooltip } from '@adecore/ui';
|
|
3
|
+
import { Wrench } from 'lucide-react';
|
|
4
|
+
import { useTranslation } from 'react-i18next';
|
|
5
5
|
|
|
6
6
|
/* What a model row says beside the name: its badge, and a mark when the provider says the model can call tools. */
|
|
7
7
|
export function ModelMarks({ model }: { model: ModelInfo }) {
|
package/src/chat/ui/Pickers.tsx
CHANGED
|
@@ -1,20 +1,20 @@
|
|
|
1
|
+
import type { AgentKind, ModelSelection, ProviderInfo, UsageProvider } from '@adecore/agent-contracts';
|
|
2
|
+
import { Button, Icon, IconButton, Menu, Popover, ScrollArea, Tooltip } from '@adecore/ui';
|
|
3
|
+
import { Bookmark, ChevronDown, ChevronRight, Search, Star, Trash2 } from 'lucide-react';
|
|
1
4
|
import { useContext, useEffect, useRef, useState, type ReactNode, type RefObject } from 'react';
|
|
2
5
|
import { useTranslation } from 'react-i18next';
|
|
3
|
-
import { Bookmark, ChevronDown, ChevronRight, Search, Star, Trash2 } from 'lucide-react';
|
|
4
|
-
import type { AgentKind, ModelSelection, ProviderInfo, UsageProvider } from '@adecore/agent-contracts';
|
|
5
6
|
import { AgentIcon } from '../../agents/AgentIcon';
|
|
6
|
-
import { ProviderLogo } from '../../agents/ProviderLogo';
|
|
7
7
|
import { agentChipOf, modelName } from '../../agents/model-name';
|
|
8
8
|
import { modelRequirementOf } from '../../agents/model-requirement';
|
|
9
|
+
import { ProviderLogo } from '../../agents/ProviderLogo';
|
|
9
10
|
import { useChatHost } from '../../host';
|
|
11
|
+
import { useHostMachineLabel } from '../../host-hooks';
|
|
10
12
|
import { ChatScopeContext } from '../../scope';
|
|
11
13
|
import { useReportedModels } from '../../state/chats';
|
|
12
|
-
import { ModelMarks } from './ModelMarks';
|
|
13
14
|
import { inPickerOrder, pickerEntriesOf, separatesGroups, type PickerEntry } from '../logic/picker-entries';
|
|
14
15
|
import { favoriteModelsOf, toggleFavoriteModel, useChatPreferences } from '../preferences';
|
|
15
16
|
import { forgetStashed, STASH_SHORTCUT, useStash, type StashedPrompt } from '../stash';
|
|
16
|
-
import {
|
|
17
|
-
import { useHostMachineLabel } from '../../host-hooks';
|
|
17
|
+
import { ModelMarks } from './ModelMarks';
|
|
18
18
|
|
|
19
19
|
const triggerClass =
|
|
20
20
|
'flex h-7 shrink-0 items-center gap-1 whitespace-nowrap rounded-md px-2 text-xs text-text-muted hover:bg-surface-hover hover:text-text data-[popup-open]:bg-surface-active data-[popup-open]:text-text';
|
|
@@ -201,7 +201,7 @@ export function ModelPicker({
|
|
|
201
201
|
onKeyDown={onKeyDown}
|
|
202
202
|
/>
|
|
203
203
|
</div>
|
|
204
|
-
<
|
|
204
|
+
<ScrollArea viewportRef={listRef} className="max-h-72" viewportClassName="p-1" role="listbox">
|
|
205
205
|
{entries.length === 0 && (
|
|
206
206
|
<div className="px-3 py-6 text-center text-xs text-text-faint">
|
|
207
207
|
{providers.length === 0 ? t('pickers.model.noProvider') : t('pickers.model.noMatch')}
|
|
@@ -335,7 +335,7 @@ export function ModelPicker({
|
|
|
335
335
|
</div>
|
|
336
336
|
);
|
|
337
337
|
})}
|
|
338
|
-
</
|
|
338
|
+
</ScrollArea>
|
|
339
339
|
{footer !== undefined && <div className="border-t border-border-soft px-3 py-2 text-xs text-text-faint">{footer}</div>}
|
|
340
340
|
</Popover.Popup>
|
|
341
341
|
</Popover.Root>
|
|
@@ -363,7 +363,7 @@ export function StashPicker({ onRestore }: { onRestore(prompt: StashedPrompt): v
|
|
|
363
363
|
</Popover.Trigger>
|
|
364
364
|
</Tooltip>
|
|
365
365
|
<Popover.Popup variant="picker" side="top" className="w-80">
|
|
366
|
-
<
|
|
366
|
+
<ScrollArea className="max-h-72" viewportClassName="p-1">
|
|
367
367
|
{prompts.map((prompt) => (
|
|
368
368
|
<div key={prompt.id} className="group/stash flex items-start gap-1">
|
|
369
369
|
<Popover.Close
|
|
@@ -385,7 +385,7 @@ export function StashPicker({ onRestore }: { onRestore(prompt: StashedPrompt): v
|
|
|
385
385
|
/>
|
|
386
386
|
</div>
|
|
387
387
|
))}
|
|
388
|
-
</
|
|
388
|
+
</ScrollArea>
|
|
389
389
|
</Popover.Popup>
|
|
390
390
|
</Popover.Root>
|
|
391
391
|
);
|
|
@@ -1,19 +1,19 @@
|
|
|
1
|
+
import { Button, Icon } from '@adecore/ui';
|
|
2
|
+
import { ArrowDown, Hand, MessageCircleQuestionMark } from 'lucide-react';
|
|
1
3
|
import { useEffect, useRef, type ReactNode } from 'react';
|
|
2
4
|
import { useTranslation } from 'react-i18next';
|
|
3
|
-
import {
|
|
4
|
-
import
|
|
5
|
+
import { useChatHost } from '../../host';
|
|
6
|
+
import { useHostExtraPrompts } from '../../host-hooks';
|
|
5
7
|
import { focusPromptHeading, focusPromptStart } from '../../prompts/logic/focus';
|
|
6
8
|
import { orderPrompts } from '../../prompts/logic/prompts';
|
|
7
9
|
import { answerPrompt, isBlockingSubject, promptCreatedAt, promptIdOf, type PromptSubject } from '../../prompts/logic/subjects';
|
|
8
10
|
import { useFocusAfterAnswer } from '../../prompts/logic/useFocusAfterAnswer';
|
|
9
11
|
import { usePromptSession } from '../../prompts/logic/usePromptSession';
|
|
10
12
|
import { PromptView } from '../../prompts/ui/PromptView';
|
|
11
|
-
import { useChatHost } from '../../host';
|
|
12
13
|
import { useChatScope } from '../../scope';
|
|
13
|
-
import { useChatActions } from '../actions';
|
|
14
|
-
import { Button, Icon } from '@adecore/ui';
|
|
15
14
|
import { useProviders } from '../../state/providers';
|
|
16
|
-
import {
|
|
15
|
+
import { useChatActions } from '../actions';
|
|
16
|
+
import type { HoldRelease } from '../prompt-hold';
|
|
17
17
|
|
|
18
18
|
/* Keeps a prompt card behind the draft while the person types; `released` says what lifted the hold last. */
|
|
19
19
|
export interface PromptHold {
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import { useLayoutEffect, useRef, type SetStateAction } from 'react';
|
|
2
|
-
import clsx from 'clsx';
|
|
3
|
-
import { Surface } from '@adecore/ui';
|
|
4
1
|
import type { ChatSkill } from '@adecore/agent-contracts';
|
|
2
|
+
import { Surface } from '@adecore/ui';
|
|
3
|
+
import clsx from 'clsx';
|
|
4
|
+
import { useLayoutEffect, useRef, type SetStateAction } from 'react';
|
|
5
5
|
import { useChatHost } from '../../host';
|
|
6
6
|
import type { Referables } from '../chat-references';
|
|
7
|
-
import { ComposerInput, type ComposerInputHandle } from './ComposerInput';
|
|
8
7
|
import { chipDecorations } from './composer/chips';
|
|
9
8
|
import { ComposerMenu } from './composer/ComposerMenu';
|
|
10
9
|
import { pickInMenu } from './composer/key-handler';
|
|
11
10
|
import { usePromptMenus, type PromptDraft } from './composer/use-prompt-menus';
|
|
11
|
+
import { ComposerInput, type ComposerInputHandle } from './ComposerInput';
|
|
12
12
|
|
|
13
13
|
interface PromptEditorProps {
|
|
14
14
|
value: PromptDraft;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
+
import { Button, Icon, Surface } from '@adecore/ui';
|
|
2
|
+
import { Quote } from 'lucide-react';
|
|
1
3
|
import { useEffect, useState, type RefObject } from 'react';
|
|
2
4
|
import { useTranslation } from 'react-i18next';
|
|
3
|
-
import { Quote } from 'lucide-react';
|
|
4
5
|
import { selectedAnswerQuote, type QuoteTaker } from './quote-selection';
|
|
5
|
-
import { Button, Icon, Surface } from '@adecore/ui';
|
|
6
6
|
|
|
7
7
|
const GAP_PX = 6;
|
|
8
8
|
// Keeps the button's middle far enough from the edges that it never sticks out of the thread.
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Icon, Tooltip } from '@adecore/ui';
|
|
2
2
|
import clsx from 'clsx';
|
|
3
|
-
import { useTranslation } from 'react-i18next';
|
|
4
3
|
import { CircleOff } from 'lucide-react';
|
|
5
|
-
import {
|
|
4
|
+
import { useContext, type HTMLAttributes, type KeyboardEvent, type ReactNode } from 'react';
|
|
5
|
+
import { useTranslation } from 'react-i18next';
|
|
6
6
|
import { useChatHost } from '../../host';
|
|
7
7
|
import { REFERENCE_GONE_TONE, REFERENCE_TONE, TOKEN_ICON, TOKEN_ICON_BOX, TOKEN_IN_MESSAGE } from './chips';
|
|
8
8
|
import { referenceGlyph } from './reference-icons';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { Fragment, type ComponentType } from 'react';
|
|
2
|
-
import { ChevronRight } from 'lucide-react';
|
|
3
1
|
import { Icon } from '@adecore/ui';
|
|
2
|
+
import { ChevronRight } from 'lucide-react';
|
|
3
|
+
import { Fragment, type ComponentType } from 'react';
|
|
4
4
|
import type { ReferenceIconProps } from '../../host';
|
|
5
5
|
import type { ReferenceStep } from '../chat-references';
|
|
6
6
|
import { referenceGlyph } from './reference-icons';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { useTranslation } from 'react-i18next';
|
|
2
|
-
import { Minimize2 } from 'lucide-react';
|
|
3
|
-
import { formatTokens } from '@adecore/ui/format';
|
|
4
1
|
import { Button, Icon } from '@adecore/ui';
|
|
2
|
+
import { formatTokens } from '@adecore/ui/format';
|
|
3
|
+
import { Minimize2 } from 'lucide-react';
|
|
4
|
+
import { useTranslation } from 'react-i18next';
|
|
5
5
|
import type { ResumeCompactionReason } from '../logic/resume-compaction';
|
|
6
6
|
|
|
7
7
|
interface ResumeCompactionDockProps {
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import type { AgentKind, ChatUsage, ModelInfo, ModelOptionDescriptor, ModelSelection, ProviderInfo, RuntimeMode } from '@adecore/agent-contracts';
|
|
2
|
+
import { Icon, Menu, Tooltip, useNow } from '@adecore/ui';
|
|
3
|
+
import { formatPercent, formatTokens } from '@adecore/ui/format';
|
|
3
4
|
import clsx from 'clsx';
|
|
4
5
|
import {
|
|
5
6
|
Activity,
|
|
@@ -18,24 +19,23 @@ import {
|
|
|
18
19
|
Star,
|
|
19
20
|
type LucideIcon
|
|
20
21
|
} from 'lucide-react';
|
|
21
|
-
import
|
|
22
|
-
import {
|
|
22
|
+
import { Fragment, useEffect, useRef, useState, type KeyboardEvent } from 'react';
|
|
23
|
+
import { useTranslation } from 'react-i18next';
|
|
23
24
|
import { limitsOfAccount, sessionWindow } from '../../agents/account-limits';
|
|
25
|
+
import { AccountDot } from '../../agents/AccountDot';
|
|
24
26
|
import { canContinueOn } from '../../agents/accounts';
|
|
25
27
|
import { AgentIcon } from '../../agents/AgentIcon';
|
|
26
|
-
import type { AccountChoice } from '../account-choice';
|
|
27
28
|
import { modelName, shortModelName } from '../../agents/model-name';
|
|
28
|
-
import { ModelMarks } from './ModelMarks';
|
|
29
|
-
import { SessionLine } from './SessionLine';
|
|
30
|
-
import { favoritesFirst, inPickerOrder, searchModels, separatesGroups, shortlistOf, wantsModelSearch } from '../logic/picker-entries';
|
|
31
|
-
import { favoriteModelsOf, toggleFavoriteModel, useChatPreferences } from '../preferences';
|
|
32
|
-
import { CONTEXT_OPTION, contextFraction, contextSegments, orderOptions, type ContextPart } from '../logic/context-usage';
|
|
33
|
-
import { RUNTIME_MODES } from '../runtime-modes';
|
|
34
29
|
import { localizedOption } from '../../agents/option-words';
|
|
35
|
-
import { formatPercent, formatTokens } from '@adecore/ui/format';
|
|
36
|
-
import { Icon, Menu, Tooltip, useNow } from '@adecore/ui';
|
|
37
30
|
import { useChatHost } from '../../host';
|
|
38
31
|
import { useUsageLimits } from '../../usage/limits';
|
|
32
|
+
import type { AccountChoice } from '../account-choice';
|
|
33
|
+
import { CONTEXT_OPTION, contextFraction, contextSegments, orderOptions, type ContextPart } from '../logic/context-usage';
|
|
34
|
+
import { favoritesFirst, inPickerOrder, searchModels, separatesGroups, shortlistOf, wantsModelSearch } from '../logic/picker-entries';
|
|
35
|
+
import { favoriteModelsOf, toggleFavoriteModel, useChatPreferences } from '../preferences';
|
|
36
|
+
import { RUNTIME_MODES } from '../runtime-modes';
|
|
37
|
+
import { ModelMarks } from './ModelMarks';
|
|
38
|
+
import { SessionLine } from './SessionLine';
|
|
39
39
|
|
|
40
40
|
const MINUTE_MS = 60_000;
|
|
41
41
|
|
package/src/chat/ui/Scrubber.tsx
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { cameThroughPortal, ContextMenu, copyText, Icon, Menu, PreviewCard } from '@adecore/ui';
|
|
2
|
+
import { formatMoment } from '@adecore/ui/format';
|
|
2
3
|
import clsx from 'clsx';
|
|
3
|
-
import { useTranslation } from 'react-i18next';
|
|
4
4
|
import { Bookmark, Copy, GitFork, type LucideIcon } from 'lucide-react';
|
|
5
|
+
import { Fragment, memo, useEffect, useMemo, useState, type ComponentProps, type MouseEvent as ReactMouseEvent } from 'react';
|
|
6
|
+
import { useTranslation } from 'react-i18next';
|
|
5
7
|
import { layoutTicks, messageAt, slotInView, slotOf, tickWidth, TICK_HEIGHT_PX, type ScrubberTick } from '../logic/scrubber';
|
|
6
8
|
import { BookmarkMenuItems } from './TimelineMenu';
|
|
7
|
-
import { formatMoment } from '@adecore/ui/format';
|
|
8
|
-
import { cameThroughPortal, ContextMenu, copyText, Icon, Menu, PreviewCard } from '@adecore/ui';
|
|
9
9
|
|
|
10
10
|
const PREVIEW_CHARS = 280;
|
|
11
11
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { useTranslation } from 'react-i18next';
|
|
2
|
-
import clsx from 'clsx';
|
|
3
1
|
import type { UsageWindow } from '@adecore/agent-contracts';
|
|
4
2
|
import { formatClock, formatPercent, formatWeekdayClock, isSameDay } from '@adecore/ui/format';
|
|
3
|
+
import clsx from 'clsx';
|
|
4
|
+
import { useTranslation } from 'react-i18next';
|
|
5
5
|
import { evenPace, paceText } from '../../usage/limit-groups';
|
|
6
6
|
|
|
7
7
|
/* Red where a window is nearly spent, amber where it is worth knowing, as the usage bars have it. */
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
+
import { Tooltip } from '@adecore/ui';
|
|
1
2
|
import { useEffect, useState, type ReactNode } from 'react';
|
|
2
3
|
import type { BundledLanguage } from 'shiki';
|
|
3
|
-
import {
|
|
4
|
+
import { useChatHost, type CommandName } from '../../host';
|
|
4
5
|
import { EMBEDDED_CODE_LIMIT, SHELL_LANGUAGE, embeddedCode, type EmbeddedCode } from '../logic/embedded-code';
|
|
5
6
|
import type { CodeToken } from './code-lines';
|
|
6
|
-
import { useChatHost, type CommandName } from '../../host';
|
|
7
7
|
import { useCodeTheme } from './code-theme';
|
|
8
8
|
import { tokenStyle, useCodeHighlighter, type CodeHighlighter, type Highlighter } from './highlighter';
|
|
9
9
|
import { ReferenceChip } from './ReferenceChip';
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Icon, IconButton } from '@adecore/ui';
|
|
2
2
|
import clsx from 'clsx';
|
|
3
|
-
import { useTranslation } from 'react-i18next';
|
|
4
3
|
import { ChevronRight, X } from 'lucide-react';
|
|
4
|
+
import { Fragment, type ReactNode } from 'react';
|
|
5
|
+
import { useTranslation } from 'react-i18next';
|
|
5
6
|
import { breadcrumbOf, MAIN_AGENT, trailTo, useOpenableSubagents, useSubagentTrail } from '../subagent-view';
|
|
6
7
|
import { SubagentStopButton } from './SubagentStopButton';
|
|
7
|
-
import { Icon, IconButton } from '@adecore/ui';
|
|
8
8
|
|
|
9
9
|
const CRUMB_LINK = 'truncate text-text-muted hover:text-text';
|
|
10
10
|
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
+
import { useNow } from '@adecore/ui';
|
|
1
2
|
import { Fragment } from 'react';
|
|
2
3
|
import { useTranslation } from 'react-i18next';
|
|
4
|
+
import { useModelName } from '../../agents/model-name';
|
|
5
|
+
import { useHostTask } from '../../host-hooks';
|
|
6
|
+
import { useChatScope } from '../../scope';
|
|
7
|
+
import { useChatRow } from '../../state/chats';
|
|
3
8
|
import { entryTimeOf, statusWordOf, subagentFacts, taskIdOf } from '../subagent-list';
|
|
4
9
|
import { useSubagentItem } from '../subagent-view';
|
|
5
10
|
import { StatusIcon } from './ChatActivity';
|
|
6
11
|
import { SubagentActions, SubagentBreadcrumb } from './SubagentControls';
|
|
7
|
-
import { useNow } from '@adecore/ui';
|
|
8
|
-
import { useModelName } from '../../agents/model-name';
|
|
9
|
-
import { useChatRow } from '../../state/chats';
|
|
10
|
-
import { useChatScope } from '../../scope';
|
|
11
|
-
import { useHostTask } from '../../host-hooks';
|
|
12
12
|
|
|
13
13
|
/*
|
|
14
14
|
* What a sub-agent is, over its conversation: the way down to it, its state and time, the model it runs on
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { useTranslation } from 'react-i18next';
|
|
2
|
-
import { Square } from 'lucide-react';
|
|
3
1
|
import type { ChatSubagentItem } from '@adecore/agent-contracts';
|
|
2
|
+
import { IconButton } from '@adecore/ui';
|
|
3
|
+
import { Square } from 'lucide-react';
|
|
4
|
+
import { useTranslation } from 'react-i18next';
|
|
4
5
|
import { useChatHost } from '../../host';
|
|
5
6
|
import { useChatScope } from '../../scope';
|
|
6
7
|
import { useChatRow } from '../../state/chats';
|
|
7
8
|
import { useChatActions } from '../actions';
|
|
8
9
|
import { stopLabel, stopOf, subagentTitle } from '../subagent-list';
|
|
9
|
-
import { IconButton } from '@adecore/ui';
|
|
10
10
|
|
|
11
11
|
/* Stops one active sub-agent of a chat, or says nothing when stopping it is not on offer. */
|
|
12
12
|
export function SubagentStopButton({
|