@adecore/agents-react 0.62.1 → 0.63.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/AccountDot.js +1 -1
- package/dist/agents/AgentIcon.js +43 -51
- package/dist/agents/accounts.d.ts +3 -6
- package/dist/agents/model-name.d.ts +2 -1
- package/dist/agents/model-requirement.d.ts +2 -1
- package/dist/agents/provider-paths.d.ts +1 -1
- package/dist/agents/status-look.d.ts +3 -2
- package/dist/chat/account-choice.d.ts +2 -1
- package/dist/chat/account-choice.js +2 -1
- package/dist/chat/actions.d.ts +1 -3
- package/dist/chat/actions.js +2 -2
- package/dist/chat/attachments.js +0 -2
- package/dist/chat/bookmarks.d.ts +1 -1
- package/dist/chat/chat-references.d.ts +1 -30
- package/dist/chat/chat-references.js +0 -12
- package/dist/chat/drafts.js +1 -1
- package/dist/chat/forks.js +0 -2
- package/dist/chat/guards.js +0 -1
- package/dist/chat/index.d.ts +20 -24
- package/dist/chat/index.js +6 -6
- package/dist/chat/logic/ansi.d.ts +2 -1
- package/dist/chat/logic/bookmarks.d.ts +1 -1
- package/dist/chat/logic/command-looks.d.ts +4 -3
- package/dist/chat/logic/command-looks.js +0 -2
- package/dist/chat/logic/context-usage.d.ts +2 -2
- package/dist/chat/logic/context-usage.js +1 -1
- package/dist/chat/logic/effort.d.ts +2 -1
- package/dist/chat/logic/embedded-code.d.ts +4 -3
- package/dist/chat/logic/embedded-code.js +0 -1
- package/dist/chat/logic/fork.d.ts +11 -6
- package/dist/chat/logic/fork.js +12 -9
- package/dist/chat/logic/generated-image.d.ts +2 -1
- package/dist/chat/logic/generated-image.js +0 -2
- package/dist/chat/logic/goal.d.ts +2 -1
- package/dist/chat/logic/limit.d.ts +2 -1
- package/dist/chat/logic/picker-entries.d.ts +4 -10
- package/dist/chat/logic/picker-entries.js +2 -13
- package/dist/chat/logic/resume-compaction.js +0 -1
- package/dist/chat/logic/scrubber.d.ts +5 -5
- package/dist/chat/logic/scrubber.js +1 -3
- package/dist/chat/logic/steer.d.ts +2 -0
- package/dist/chat/logic/steer.js +4 -0
- package/dist/chat/logic/thought.js +0 -1
- package/dist/chat/logic/thread-cards.d.ts +4 -4
- package/dist/chat/logic/thread-cards.js +1 -1
- package/dist/chat/logic/timeline-copy.d.ts +1 -1
- package/dist/chat/logic/timeline-copy.js +0 -2
- package/dist/chat/logic/timeline-target.d.ts +4 -3
- package/dist/chat/logic/timeline-target.js +0 -1
- package/dist/chat/logic/timeline.d.ts +3 -133
- package/dist/chat/logic/timeline.js +0 -2
- package/dist/chat/logic/tool-catalog.d.ts +2 -1
- package/dist/chat/logic/tool-looks.d.ts +4 -3
- package/dist/chat/logic/tool-looks.js +0 -1
- package/dist/chat/logic/tools.d.ts +3 -2
- package/dist/chat/logic/tools.js +11 -32
- package/dist/chat/logic/visual-height.js +0 -1
- package/dist/chat/logic/welcome.d.ts +2 -1
- package/dist/chat/logic/workflow.d.ts +3 -2
- package/dist/chat/logic/workflow.js +0 -1
- package/dist/chat/mentions.d.ts +3 -3
- package/dist/chat/mentions.js +1 -2
- package/dist/chat/pending-prompts.d.ts +1 -1
- package/dist/chat/preferences.js +1 -2
- package/dist/chat/prompt-hold.js +0 -1
- package/dist/chat/prompts/index.d.ts +11 -0
- package/dist/{prompts → chat/prompts}/index.js +2 -0
- package/dist/{prompts → chat/prompts}/logic/keys.d.ts +4 -3
- package/dist/{prompts → chat/prompts}/logic/prompts.d.ts +2 -26
- package/dist/{prompts → chat/prompts}/logic/prompts.js +1 -1
- package/dist/{prompts → chat/prompts}/logic/subjects.d.ts +2 -38
- package/dist/{prompts → chat/prompts}/logic/useFocusAfterAnswer.d.ts +2 -1
- package/dist/{prompts → chat/prompts}/logic/usePromptSession.d.ts +2 -2
- package/dist/{prompts → chat/prompts}/logic/usePromptSession.js +2 -1
- package/dist/{prompts → chat/prompts}/ui/ApprovalBody.d.ts +1 -5
- package/dist/{prompts → chat/prompts}/ui/ApprovalBody.js +5 -6
- package/dist/{prompts → chat/prompts}/ui/PromptActions.d.ts +2 -1
- package/dist/{prompts → chat/prompts}/ui/PromptActions.js +0 -1
- package/dist/{prompts → chat/prompts}/ui/PromptCard.d.ts +1 -1
- package/dist/{prompts → chat/prompts}/ui/PromptCard.js +1 -1
- package/dist/{prompts → chat/prompts}/ui/PromptView.d.ts +1 -1
- package/dist/{prompts → chat/prompts}/ui/PromptView.js +4 -2
- package/dist/{prompts → chat/prompts}/ui/QuestionBody.d.ts +1 -1
- package/dist/{prompts → chat/prompts}/ui/QuestionBody.js +2 -2
- package/dist/chat/reading-width.js +2 -1
- package/dist/chat/recent-messages.d.ts +2 -6
- package/dist/chat/recent-messages.js +1 -1
- package/dist/chat/send-key.js +0 -1
- package/dist/chat/stash.d.ts +3 -2
- package/dist/chat/stash.js +1 -1
- package/dist/chat/subagent-conversation.d.ts +0 -1
- package/dist/chat/subagent-conversation.js +1 -1
- package/dist/chat/subagent-list.d.ts +3 -3
- package/dist/chat/subagent-list.js +2 -6
- package/dist/chat/subagent-view.d.ts +1 -1
- package/dist/chat/subagent-view.js +0 -1
- package/dist/chat/tag-suggestions.d.ts +3 -4
- package/dist/chat/tag-suggestions.js +3 -3
- package/dist/chat/thumbnails.d.ts +2 -1
- package/dist/chat/thumbnails.js +0 -1
- package/dist/chat/timeline-flash.d.ts +1 -1
- package/dist/chat/ui/BookmarkMarker.js +1 -1
- package/dist/chat/ui/BookmarkSubmenu.js +2 -2
- package/dist/chat/ui/ChatActivity.js +8 -48
- package/dist/chat/ui/CodeBlock.js +1 -1
- package/dist/chat/ui/Composer.d.ts +1 -1
- package/dist/chat/ui/Composer.js +174 -209
- package/dist/chat/ui/ComposerInput.d.ts +1 -1
- package/dist/chat/ui/ComposerInput.js +1 -1
- package/dist/chat/ui/EditDiff.js +2 -3
- package/dist/chat/ui/GoalDock.js +1 -1
- package/dist/chat/ui/HostMenuItems.d.ts +1 -1
- package/dist/chat/ui/HostMenuItems.js +0 -1
- package/dist/chat/ui/ImageView.d.ts +3 -2
- package/dist/chat/ui/LimitState.js +2 -2
- package/dist/chat/ui/Markdown.d.ts +1 -1
- package/dist/chat/ui/Markdown.js +1 -2
- package/dist/chat/ui/MermaidBlock.js +1 -1
- package/dist/chat/ui/MessageActions.d.ts +1 -1
- package/dist/chat/ui/MessageActions.js +94 -88
- package/dist/chat/ui/Pickers.d.ts +1 -1
- package/dist/chat/ui/Pickers.js +4 -3
- package/dist/chat/ui/PromptComposer.d.ts +1 -1
- package/dist/chat/ui/PromptComposer.js +9 -8
- package/dist/chat/ui/PromptEditor.d.ts +1 -1
- package/dist/chat/ui/PromptEditor.js +1 -1
- package/dist/chat/ui/ReferenceChip.js +1 -1
- package/dist/chat/ui/ReferenceTrail.d.ts +2 -2
- package/dist/chat/ui/RunSettings.js +3 -3
- package/dist/chat/ui/SessionLine.d.ts +1 -1
- package/dist/chat/ui/SessionLine.js +2 -1
- package/dist/chat/ui/ShellCommand.d.ts +1 -1
- package/dist/chat/ui/ShellCommand.js +1 -3
- package/dist/chat/ui/SubagentInfo.js +4 -3
- package/dist/chat/ui/SubagentStopButton.js +1 -1
- package/dist/chat/ui/SubagentTimeline.js +2 -2
- package/dist/chat/ui/Timeline.js +6 -4
- package/dist/chat/ui/TimelineMenu.js +125 -119
- package/dist/chat/ui/UnifiedDiff.js +2 -3
- package/dist/chat/ui/VisualFrame.d.ts +3 -2
- package/dist/chat/ui/VisualFrame.js +1 -1
- package/dist/chat/ui/chip-clipboard.d.ts +1 -2
- package/dist/chat/ui/chip-clipboard.js +1 -1
- package/dist/chat/ui/code-theme.d.ts +1 -1
- package/dist/chat/ui/code-theme.js +2 -2
- package/dist/chat/ui/composer/ComposerControls.d.ts +0 -3
- package/dist/chat/ui/composer/ComposerControls.js +60 -215
- package/dist/chat/ui/composer/ComposerMenu.js +1 -1
- package/dist/chat/ui/composer/ComposerStatusLine.d.ts +1 -1
- package/dist/chat/ui/composer/DraftParts.js +0 -1
- package/dist/chat/ui/composer/chip-paste.d.ts +1 -1
- package/dist/chat/ui/composer/chip-paste.js +0 -1
- package/dist/chat/ui/composer/chips.d.ts +4 -3
- package/dist/chat/ui/composer/chips.js +0 -1
- package/dist/chat/ui/composer/editor.d.ts +2 -1
- package/dist/chat/ui/composer/key-handler.d.ts +1 -1
- package/dist/chat/ui/composer/key-handler.js +0 -1
- package/dist/chat/ui/composer/keys.d.ts +4 -3
- package/dist/chat/ui/composer/keys.js +0 -4
- package/dist/chat/ui/composer/placeholder.js +1 -1
- package/dist/chat/ui/composer/prompt-picks.d.ts +2 -2
- package/dist/chat/ui/composer/prompt-picks.js +1 -0
- package/dist/chat/ui/composer/use-chat-controls.js +2 -2
- package/dist/chat/ui/composer/use-composer-menus.d.ts +0 -1
- package/dist/chat/ui/composer/use-composer-menus.js +2 -2
- package/dist/chat/ui/composer/use-composer-submit.d.ts +1 -1
- package/dist/chat/ui/composer/use-composer-submit.js +1 -1
- package/dist/chat/ui/composer/use-continuable-turn.js +0 -1
- package/dist/chat/ui/composer/use-draft-files.d.ts +1 -1
- package/dist/chat/ui/composer/use-draft-files.js +1 -1
- package/dist/chat/ui/composer/use-pending-requests.d.ts +1 -1
- package/dist/chat/ui/composer/use-prompt-menus.d.ts +6 -5
- package/dist/chat/ui/composer/use-prompt-menus.js +3 -2
- package/dist/chat/ui/composer/use-take-back.js +1 -2
- package/dist/chat/ui/diff/EditorEditDiff.js +1 -1
- package/dist/chat/ui/diff/LegacyDiffPool.js +1 -1
- package/dist/chat/ui/diff/LegacyEditDiff.js +1 -1
- package/dist/chat/ui/diff/LegacyUnifiedDiff.js +1 -1
- package/dist/chat/ui/diff/ReviewDiff.js +1 -2
- package/dist/chat/ui/diff/diff-source-budget.d.ts +0 -7
- package/dist/chat/ui/diff/diff-source-budget.js +1 -1
- package/dist/chat/ui/diff/review-plan.d.ts +2 -2
- package/dist/chat/ui/diff/review-plan.js +1 -1
- package/dist/chat/ui/diff/syntax-runtime.d.ts +1 -1
- package/dist/chat/ui/diff-theme.js +2 -2
- package/dist/chat/ui/file-links.d.ts +1 -1
- package/dist/chat/ui/file-links.js +1 -2
- package/dist/chat/ui/highlighter.d.ts +1 -1
- package/dist/chat/ui/highlighter.js +1 -2
- package/dist/chat/ui/index.d.ts +9 -17
- package/dist/chat/ui/index.js +3 -9
- package/dist/chat/ui/intelligent-ui/UiBlockFrame.d.ts +2 -1
- package/dist/chat/ui/intelligent-ui/UiBlockFrame.js +1 -1
- package/dist/chat/ui/intelligent-ui/UiFallbackPart.d.ts +2 -1
- package/dist/chat/ui/intelligent-ui/UiReply.js +1 -1
- package/dist/chat/ui/intelligent-ui/chart-data.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 +0 -2
- package/dist/chat/ui/intelligent-ui/renderers/choices.js +1 -1
- package/dist/chat/ui/intelligent-ui/renderers/content.d.ts +2 -1
- package/dist/chat/ui/intelligent-ui/renderers/content.js +2 -2
- package/dist/chat/ui/intelligent-ui/renderers/inputs.js +0 -1
- package/dist/chat/ui/intelligent-ui/renderers/links.d.ts +1 -5
- package/dist/chat/ui/intelligent-ui/renderers/links.js +1 -1
- package/dist/chat/ui/intelligent-ui/renderers/map-slots.d.ts +2 -2
- package/dist/chat/ui/intelligent-ui/renderers/map-slots.js +1 -1
- package/dist/chat/ui/intelligent-ui/renderers/map-style.d.ts +3 -8
- package/dist/chat/ui/intelligent-ui/renderers/map-style.js +3 -5
- package/dist/chat/ui/intelligent-ui/renderers/map-view.d.ts +1 -1
- package/dist/chat/ui/intelligent-ui/renderers/map-view.js +2 -2
- package/dist/chat/ui/intelligent-ui/renderers/map.js +3 -4
- package/dist/chat/ui/intelligent-ui/reply-parts.d.ts +2 -1
- package/dist/chat/ui/intelligent-ui/table-data.d.ts +2 -1
- package/dist/chat/ui/intelligent-ui/use-ui-links.js +1 -1
- package/dist/chat/ui/intelligent-ui/use-ui-queries.js +1 -1
- package/dist/chat/ui/markdown-blocks.js +0 -1
- package/dist/chat/ui/named-chip-look.d.ts +1 -1
- package/dist/chat/ui/named-chip-look.js +1 -1
- package/dist/chat/ui/reference-icons.d.ts +2 -2
- package/dist/chat/ui/reference-lookup.d.ts +2 -2
- package/dist/chat/ui/rehype-fade.js +0 -1
- package/dist/chat/ui/reveal.d.ts +2 -3
- package/dist/chat/ui/reveal.js +2 -2
- package/dist/chat/ui/rows/ForksRow.js +1 -1
- package/dist/chat/ui/rows/GeneratedImageRow.js +2 -2
- package/dist/chat/ui/rows/MessageRows.d.ts +1 -1
- package/dist/chat/ui/rows/MessageRows.js +2 -3
- package/dist/chat/ui/rows/RowContainer.d.ts +3 -2
- package/dist/chat/ui/rows/RowContainer.js +1 -1
- package/dist/chat/ui/rows/Rows.d.ts +1 -1
- package/dist/chat/ui/rows/SubagentRow.d.ts +2 -2
- package/dist/chat/ui/rows/SubagentRow.js +6 -6
- package/dist/chat/ui/rows/TaskRow.d.ts +1 -1
- package/dist/chat/ui/rows/VisualRow.js +1 -1
- package/dist/chat/ui/rows/WorkRows.d.ts +3 -2
- package/dist/chat/ui/rows/WorkRows.js +4 -8
- package/dist/chat/ui/rows/WorkflowRow.js +1 -1
- package/dist/chat/ui/rows/row-rhythm.d.ts +1 -1
- package/dist/chat/ui/rows/row-rhythm.js +1 -0
- package/dist/chat/ui/thread-references.d.ts +0 -2
- package/dist/chat/ui/thread-references.js +3 -3
- package/dist/chat/ui/use-diff-source-tokens.js +1 -1
- package/dist/chat/ui/useToggleSet.d.ts +2 -1
- package/dist/chat/ui/visual-theme.js +1 -1
- package/dist/chat/visual-bridge.js +0 -1
- package/dist/chat/waiting-on.js +1 -1
- package/dist/chat/workflow-list.d.ts +2 -1
- package/dist/{chat/chat-client.d.ts → chat-client.d.ts} +2 -2
- package/dist/{chat/chat-client.js → chat-client.js} +2 -2
- package/dist/chat-sink.d.ts +20 -0
- package/dist/chat-sink.js +1 -0
- package/dist/{ui → host}/PlainTextarea.d.ts +1 -1
- package/dist/{host-hooks.d.ts → host/host-hooks.d.ts} +3 -6
- package/dist/{host-hooks.js → host/host-hooks.js} +2 -13
- package/dist/{host.d.ts → host/host.d.ts} +27 -25
- package/dist/{host.js → host/host.js} +65 -32
- package/dist/host/prompts.d.ts +61 -0
- package/dist/host/prompts.js +1 -0
- package/dist/host/references.d.ts +31 -0
- package/dist/host/references.js +12 -0
- package/dist/host/timeline-row.d.ts +133 -0
- package/dist/host/timeline-row.js +1 -0
- package/dist/images.d.ts +1 -1
- package/dist/images.js +1 -1
- package/dist/index.d.ts +3 -5
- package/dist/index.js +1 -3
- package/dist/locales/en/agent-chat.d.ts +1 -1
- package/dist/locales/en/agent-chat.js +1 -1
- package/dist/locales/nl/agent-chat.d.ts +1 -1
- package/dist/locales/nl/agent-chat.js +1 -1
- package/dist/locales.d.ts +1 -1
- package/dist/{chat/persisted-json.d.ts → persisted-json.d.ts} +2 -1
- package/dist/{chat/persisted-json.js → persisted-json.js} +1 -1
- package/dist/providers/AccountColors.js +1 -2
- package/dist/providers/AccountDetail.js +2 -3
- package/dist/providers/AccountVariables.js +1 -1
- package/dist/providers/AddAccountForm.js +1 -1
- package/dist/providers/CliDetail.js +2 -3
- package/dist/providers/InstallPage.js +2 -3
- package/dist/providers/ProviderList.js +0 -1
- package/dist/providers/ProvidersPane.js +2 -3
- package/dist/providers/account-actions.d.ts +2 -3
- package/dist/providers/account-actions.js +1 -1
- package/dist/providers/index.d.ts +2 -4
- package/dist/providers/index.js +1 -1
- package/dist/providers/install-steps.js +0 -1
- package/dist/providers/provider-abilities.d.ts +1 -2
- package/dist/providers/provider-abilities.js +0 -5
- package/dist/providers/variables.js +0 -1
- package/dist/scope.d.ts +1 -1
- package/dist/settings/sections.d.ts +2 -1
- package/dist/state/chats.d.ts +2 -20
- package/dist/state/chats.js +0 -2
- package/dist/state/index.d.ts +4 -3
- package/dist/state/provider-accounts.js +0 -1
- package/dist/state/usage.d.ts +2 -2
- package/dist/state/usage.js +1 -1
- package/dist/storage.d.ts +4 -3
- package/dist/testing/prompts.d.ts +1 -1
- package/dist/usage/ChartLogo.js +0 -1
- package/dist/usage/LimitsList.d.ts +1 -1
- package/dist/usage/LimitsList.js +3 -7
- package/dist/usage/UsageBreakdown.js +1 -5
- package/dist/usage/UsageLimits.js +2 -3
- package/dist/usage/UsagePage.js +3 -3
- package/dist/usage/UsageTiles.js +0 -1
- package/dist/usage/format.d.ts +1 -2
- package/dist/usage/format.js +0 -2
- package/dist/usage/index.d.ts +2 -3
- package/dist/usage/index.js +1 -2
- package/dist/usage/limit-groups.d.ts +0 -1
- package/dist/usage/limit-groups.js +0 -2
- package/dist/usage/limits.js +0 -1
- package/dist/usage/summary.d.ts +3 -2
- package/dist/usage/summary.js +0 -1
- package/package.json +19 -12
- package/src/agents/AccountDot.tsx +1 -1
- package/src/agents/AgentIcon.tsx +2 -2
- package/src/agents/accounts.ts +2 -5
- package/src/agents/model-name.ts +1 -1
- package/src/agents/model-requirement.ts +1 -1
- package/src/agents/provider-paths.ts +1 -1
- package/src/agents/status-look.ts +2 -2
- package/src/chat/account-choice.ts +3 -11
- package/src/chat/actions.ts +2 -2
- package/src/chat/attachments.ts +0 -2
- package/src/chat/bookmarks.ts +1 -1
- package/src/chat/chat-references.ts +1 -64
- package/src/chat/drafts.ts +1 -1
- package/src/chat/forks.ts +0 -2
- package/src/chat/guards.ts +0 -2
- package/src/chat/index.ts +21 -38
- package/src/chat/logic/ansi.ts +1 -1
- package/src/chat/logic/bookmarks.ts +1 -1
- package/src/chat/logic/command-looks.ts +3 -7
- package/src/chat/logic/context-usage.ts +2 -2
- package/src/chat/logic/effort.ts +1 -1
- package/src/chat/logic/embedded-code.ts +3 -7
- package/src/chat/logic/fork.ts +23 -13
- package/src/chat/logic/generated-image.ts +1 -3
- package/src/chat/logic/goal.ts +1 -1
- package/src/chat/logic/limit.ts +1 -1
- package/src/chat/logic/picker-entries.ts +5 -19
- package/src/chat/logic/resume-compaction.ts +0 -1
- package/src/chat/logic/scrubber.ts +6 -9
- package/src/chat/logic/steer.ts +6 -0
- package/src/chat/logic/thought.ts +0 -1
- package/src/chat/logic/thread-cards.ts +4 -4
- package/src/chat/logic/timeline-copy.ts +1 -3
- package/src/chat/logic/timeline-target.ts +3 -6
- package/src/chat/logic/timeline.ts +4 -85
- package/src/chat/logic/tool-catalog.ts +1 -2
- package/src/chat/logic/tool-looks.ts +3 -6
- package/src/chat/logic/tools.ts +6 -25
- package/src/chat/logic/visual-height.ts +0 -1
- package/src/chat/logic/welcome.ts +1 -1
- package/src/chat/logic/workflow.ts +2 -3
- package/src/chat/mentions.ts +3 -5
- package/src/chat/pending-prompts.ts +2 -2
- package/src/chat/preferences.ts +1 -2
- package/src/chat/prompt-hold.ts +0 -1
- package/src/chat/prompts/index.ts +14 -0
- package/src/{prompts → chat/prompts}/logic/keys.ts +3 -3
- package/src/{prompts → chat/prompts}/logic/prompts.ts +3 -24
- package/src/{prompts → chat/prompts}/logic/subjects.ts +3 -42
- package/src/{prompts → chat/prompts}/logic/useFocusAfterAnswer.ts +1 -1
- package/src/{prompts → chat/prompts}/logic/usePromptSession.ts +4 -4
- package/src/{prompts → chat/prompts}/ui/ApprovalBody.tsx +6 -7
- package/src/{prompts → chat/prompts}/ui/PromptActions.tsx +1 -2
- package/src/{prompts → chat/prompts}/ui/PromptCard.tsx +2 -2
- package/src/{prompts → chat/prompts}/ui/PromptView.tsx +6 -4
- package/src/{prompts → chat/prompts}/ui/QuestionBody.tsx +3 -3
- package/src/chat/reading-width.ts +2 -1
- package/src/chat/recent-messages.ts +3 -3
- package/src/chat/send-key.ts +0 -1
- package/src/chat/stash.ts +3 -3
- package/src/chat/subagent-conversation.ts +1 -1
- package/src/chat/subagent-list.ts +4 -9
- package/src/chat/subagent-view.ts +1 -2
- package/src/chat/tag-suggestions.ts +5 -5
- package/src/chat/thumbnails.ts +1 -3
- package/src/chat/timeline-flash.ts +1 -1
- package/src/chat/timeline-scroll.ts +0 -2
- package/src/chat/ui/BookmarkMarker.tsx +1 -1
- package/src/chat/ui/BookmarkSubmenu.tsx +2 -2
- package/src/chat/ui/ChatActivity.tsx +8 -18
- package/src/chat/ui/CodeBlock.tsx +1 -1
- package/src/chat/ui/Composer.tsx +5 -15
- package/src/chat/ui/ComposerInput.tsx +2 -2
- package/src/chat/ui/EditDiff.tsx +2 -3
- package/src/chat/ui/GoalDock.tsx +1 -1
- package/src/chat/ui/HostMenuItems.tsx +1 -2
- package/src/chat/ui/ImageView.tsx +2 -2
- package/src/chat/ui/LimitState.tsx +2 -2
- package/src/chat/ui/Markdown.tsx +1 -2
- package/src/chat/ui/MermaidBlock.tsx +1 -2
- package/src/chat/ui/MessageActions.tsx +5 -3
- package/src/chat/ui/Pickers.tsx +4 -4
- package/src/chat/ui/PromptComposer.tsx +9 -8
- package/src/chat/ui/PromptEditor.tsx +2 -2
- package/src/chat/ui/ReferenceChip.tsx +1 -1
- package/src/chat/ui/ReferenceTrail.tsx +2 -2
- package/src/chat/ui/RunSettings.tsx +4 -2
- package/src/chat/ui/SessionLine.tsx +2 -2
- package/src/chat/ui/ShellCommand.tsx +1 -4
- package/src/chat/ui/SubagentInfo.tsx +4 -3
- package/src/chat/ui/SubagentStopButton.tsx +1 -1
- package/src/chat/ui/SubagentTimeline.tsx +2 -2
- package/src/chat/ui/Timeline.tsx +7 -6
- package/src/chat/ui/TimelineMenu.tsx +4 -2
- package/src/chat/ui/UnifiedDiff.tsx +2 -3
- package/src/chat/ui/VisualFrame.tsx +3 -3
- package/src/chat/ui/chip-clipboard.ts +2 -2
- package/src/chat/ui/code-theme.ts +2 -2
- package/src/chat/ui/composer/ComposerControls.tsx +8 -59
- package/src/chat/ui/composer/ComposerMenu.tsx +2 -2
- package/src/chat/ui/composer/ComposerStatusLine.tsx +1 -1
- package/src/chat/ui/composer/DraftParts.tsx +0 -1
- package/src/chat/ui/composer/chip-paste.ts +1 -2
- package/src/chat/ui/composer/chips.ts +3 -4
- package/src/chat/ui/composer/editor.ts +1 -1
- package/src/chat/ui/composer/key-handler.ts +1 -2
- package/src/chat/ui/composer/keys.ts +3 -8
- package/src/chat/ui/composer/placeholder.ts +1 -1
- package/src/chat/ui/composer/prompt-picks.ts +3 -2
- package/src/chat/ui/composer/use-chat-controls.ts +2 -2
- 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-continuable-turn.ts +0 -1
- package/src/chat/ui/composer/use-draft-files.ts +2 -2
- package/src/chat/ui/composer/use-pending-requests.ts +1 -1
- package/src/chat/ui/composer/use-prompt-menus.ts +6 -9
- package/src/chat/ui/composer/use-take-back.ts +1 -3
- package/src/chat/ui/diff/EditorEditDiff.tsx +1 -1
- package/src/chat/ui/diff/LegacyDiffPool.tsx +1 -1
- package/src/chat/ui/diff/LegacyEditDiff.tsx +1 -1
- package/src/chat/ui/diff/LegacyUnifiedDiff.tsx +1 -1
- package/src/chat/ui/diff/ReviewDiff.tsx +1 -2
- package/src/chat/ui/diff/diff-source-budget.ts +1 -1
- package/src/chat/ui/diff/review-plan.ts +2 -2
- package/src/chat/ui/diff/syntax-runtime.ts +1 -1
- package/src/chat/ui/diff-theme.ts +2 -2
- package/src/chat/ui/file-links.ts +1 -2
- package/src/chat/ui/highlighter.ts +1 -2
- package/src/chat/ui/index.ts +9 -39
- package/src/chat/ui/intelligent-ui/UiBlockFrame.tsx +2 -2
- package/src/chat/ui/intelligent-ui/UiFallbackPart.tsx +1 -1
- package/src/chat/ui/intelligent-ui/UiReply.tsx +1 -1
- package/src/chat/ui/intelligent-ui/chart-data.ts +1 -1
- package/src/chat/ui/intelligent-ui/render-context.ts +1 -1
- package/src/chat/ui/intelligent-ui/renderers/chart.tsx +0 -3
- package/src/chat/ui/intelligent-ui/renderers/choices.tsx +1 -1
- package/src/chat/ui/intelligent-ui/renderers/content.tsx +3 -3
- package/src/chat/ui/intelligent-ui/renderers/inputs.tsx +0 -1
- package/src/chat/ui/intelligent-ui/renderers/links.tsx +1 -1
- package/src/chat/ui/intelligent-ui/renderers/map-slots.ts +2 -2
- package/src/chat/ui/intelligent-ui/renderers/map-style.ts +5 -7
- package/src/chat/ui/intelligent-ui/renderers/map-view.tsx +2 -3
- package/src/chat/ui/intelligent-ui/renderers/map.tsx +3 -4
- package/src/chat/ui/intelligent-ui/reply-parts.ts +1 -1
- package/src/chat/ui/intelligent-ui/table-data.ts +1 -1
- package/src/chat/ui/intelligent-ui/use-ui-links.ts +1 -1
- package/src/chat/ui/intelligent-ui/use-ui-queries.ts +1 -1
- package/src/chat/ui/markdown-blocks.ts +0 -2
- package/src/chat/ui/named-chip-look.ts +1 -1
- package/src/chat/ui/reference-icons.ts +2 -2
- package/src/chat/ui/reference-lookup.ts +2 -2
- package/src/chat/ui/rehype-fade.ts +0 -1
- package/src/chat/ui/reveal.ts +3 -3
- package/src/chat/ui/rows/ForksRow.tsx +1 -1
- package/src/chat/ui/rows/GeneratedImageRow.tsx +2 -2
- package/src/chat/ui/rows/MessageRows.tsx +2 -3
- package/src/chat/ui/rows/RowContainer.tsx +3 -3
- package/src/chat/ui/rows/Rows.tsx +2 -2
- package/src/chat/ui/rows/SubagentRow.tsx +7 -8
- package/src/chat/ui/rows/TaskRow.tsx +1 -1
- package/src/chat/ui/rows/VisualRow.tsx +1 -1
- package/src/chat/ui/rows/WorkRows.tsx +6 -10
- package/src/chat/ui/rows/WorkflowRow.tsx +1 -1
- package/src/chat/ui/rows/row-rhythm.ts +2 -1
- package/src/chat/ui/thread-references.ts +3 -3
- package/src/chat/ui/use-diff-source-tokens.ts +1 -1
- package/src/chat/ui/useToggleSet.ts +1 -1
- package/src/chat/ui/visual-theme.ts +1 -1
- package/src/chat/visual-bridge.ts +0 -2
- package/src/chat/waiting-on.ts +1 -1
- package/src/chat/workflow-list.ts +1 -1
- package/src/{chat/chat-client.ts → chat-client.ts} +3 -3
- package/src/chat-sink.ts +37 -0
- package/src/{ui → host}/PlainTextarea.tsx +1 -1
- package/src/{host-hooks.ts → host/host-hooks.ts} +4 -20
- package/src/{host.ts → host/host.ts} +78 -42
- package/src/host/prompts.ts +62 -0
- package/src/host/references.ts +63 -0
- package/src/host/timeline-row.ts +85 -0
- package/src/images.ts +1 -1
- package/src/index.ts +6 -12
- package/src/locales/en/agent-chat.ts +1 -1
- package/src/locales/nl/agent-chat.ts +1 -1
- package/src/locales.ts +1 -1
- package/src/{chat/persisted-json.ts → persisted-json.ts} +2 -2
- package/src/providers/AccountColors.tsx +1 -2
- package/src/providers/AccountDetail.tsx +2 -4
- package/src/providers/AccountVariables.tsx +1 -1
- package/src/providers/AddAccountForm.tsx +1 -1
- package/src/providers/CliDetail.tsx +2 -3
- package/src/providers/InstallPage.tsx +2 -3
- package/src/providers/ProviderList.tsx +0 -1
- package/src/providers/ProvidersPane.tsx +2 -3
- package/src/providers/account-actions.ts +2 -2
- package/src/providers/index.ts +2 -14
- package/src/providers/install-steps.ts +0 -1
- package/src/providers/provider-abilities.ts +1 -7
- package/src/providers/variables.ts +0 -2
- package/src/scope.ts +1 -1
- package/src/settings/sections.ts +1 -1
- package/src/state/chats.ts +1 -40
- package/src/state/index.ts +4 -22
- package/src/state/provider-accounts.ts +0 -1
- package/src/state/usage.ts +5 -5
- package/src/storage.ts +3 -3
- package/src/testing/prompts.ts +1 -1
- package/src/usage/ChartLogo.tsx +0 -1
- package/src/usage/LimitsList.tsx +3 -11
- package/src/usage/UsageBreakdown.tsx +1 -5
- package/src/usage/UsageLimits.tsx +2 -3
- package/src/usage/UsagePage.tsx +3 -3
- package/src/usage/UsagePane.tsx +2 -2
- package/src/usage/UsageTiles.tsx +0 -1
- package/src/usage/format.ts +1 -6
- package/src/usage/index.ts +2 -3
- package/src/usage/limit-groups.ts +0 -4
- package/src/usage/limits.ts +0 -1
- package/src/usage/summary.ts +2 -5
- package/dist/agents/agent-marks.d.ts +0 -9
- package/dist/agents/agent-marks.js +0 -14
- package/dist/lazy.d.ts +0 -8
- package/dist/lazy.js +0 -63
- package/dist/prompts/index.d.ts +0 -9
- package/src/agents/agent-marks.ts +0 -28
- package/src/lazy.tsx +0 -76
- package/src/prompts/index.ts +0 -22
- /package/dist/{prompts → chat/prompts}/logic/focus.d.ts +0 -0
- /package/dist/{prompts → chat/prompts}/logic/focus.js +0 -0
- /package/dist/{prompts → chat/prompts}/logic/keys.js +0 -0
- /package/dist/{prompts → chat/prompts}/logic/subjects.js +0 -0
- /package/dist/{prompts → chat/prompts}/logic/useFocusAfterAnswer.js +0 -0
- /package/dist/{ui → host}/PlainTextarea.js +0 -0
- /package/src/{prompts → chat/prompts}/logic/focus.ts +0 -0
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type
|
|
1
|
+
import { taskIdOfRow, type ChatBackgroundTask, type ChatSubagentItem } from '@adecore/agent-contracts';
|
|
2
2
|
import { Icon, IconButton, Popover, ScrollArea, Surface, useNow } from '@adecore/ui';
|
|
3
3
|
import { formatElapsedShort } from '@adecore/ui/format';
|
|
4
4
|
import clsx from 'clsx';
|
|
@@ -7,16 +7,15 @@ import { useState, type ReactNode } from 'react';
|
|
|
7
7
|
import { useTranslation } from 'react-i18next';
|
|
8
8
|
import { useShallow } from 'zustand/shallow';
|
|
9
9
|
import { statusLookOf, type StatusWord } from '../../agents/status-look';
|
|
10
|
-
import { useChatHost } from '../../host';
|
|
11
|
-
import { useHostTask, useHostTasks } from '../../host-hooks';
|
|
10
|
+
import { useChatHost } from '../../host/host';
|
|
11
|
+
import { useHostTask, useHostTasks } from '../../host/host-hooks';
|
|
12
12
|
import { useChatScope } from '../../scope';
|
|
13
13
|
import { useChatRow, useChats } from '../../state/chats';
|
|
14
14
|
import { useChatActions } from '../actions';
|
|
15
15
|
import { backgroundCounts } from '../activity';
|
|
16
|
-
import { badgeCountOf, entryTimeOf, flyoutSubagents, progressOf, statusWordOf, subagentTitle, summaryWordOf,
|
|
16
|
+
import { badgeCountOf, entryTimeOf, flyoutSubagents, progressOf, statusWordOf, subagentTitle, summaryWordOf, taskRowStateOf } from '../subagent-list';
|
|
17
17
|
import { useSubagentSupport } from '../subagent-support';
|
|
18
18
|
import { canOpenSubagent, crumbOf, openFromMain, useSubagentTrail, type SubagentStep } from '../subagent-view';
|
|
19
|
-
import { waitingOnLabel, waitingOnOf } from '../waiting-on';
|
|
20
19
|
import { flyoutWorkflows, workflowPillOf, type WorkflowCall, type WorkflowWord } from '../workflow-list';
|
|
21
20
|
import { WorkflowRow } from './rows/WorkflowRow';
|
|
22
21
|
import { SubagentStopButton } from './SubagentStopButton';
|
|
@@ -47,14 +46,14 @@ export function ChatActivity({ chatId, workflows: showsWorkflows = true }: { cha
|
|
|
47
46
|
|
|
48
47
|
const progress = progressOf(
|
|
49
48
|
subagents.map((item, index) => {
|
|
50
|
-
const taskId =
|
|
49
|
+
const taskId = taskIdOfRow(item);
|
|
51
50
|
|
|
52
51
|
return taskRowStateOf(item, taskId === null ? null : (tasks?.[taskId] ?? null), children[index]);
|
|
53
52
|
})
|
|
54
53
|
);
|
|
55
54
|
|
|
56
55
|
const words = subagents.map((item) => {
|
|
57
|
-
const taskId =
|
|
56
|
+
const taskId = taskIdOfRow(item);
|
|
58
57
|
|
|
59
58
|
return statusWordOf(item, taskId === null ? null : (tasks?.[taskId] ?? null));
|
|
60
59
|
});
|
|
@@ -99,8 +98,7 @@ export function ChatActivity({ chatId, workflows: showsWorkflows = true }: { cha
|
|
|
99
98
|
{background.length > 0 && (
|
|
100
99
|
<Flyout
|
|
101
100
|
icon={<Icon icon={shells > 0 ? SquareTerminal : Activity} size={14} />}
|
|
102
|
-
label={
|
|
103
|
-
heading={[shells > 0 && t('activity.shells', { count: shells }), monitors > 0 && t('activity.monitors', { count: monitors })]
|
|
101
|
+
label={[shells > 0 && t('activity.shells', { count: shells }), monitors > 0 && t('activity.monitors', { count: monitors })]
|
|
104
102
|
.filter(Boolean)
|
|
105
103
|
.join(' · ')}
|
|
106
104
|
>
|
|
@@ -136,14 +134,6 @@ function Flyout({ icon, label, heading = label, children }: { icon: ReactNode; l
|
|
|
136
134
|
);
|
|
137
135
|
}
|
|
138
136
|
|
|
139
|
-
/* What the background chip says: the oldest command or monitor and how long it has run, on a clock of its own. */
|
|
140
|
-
function BackgroundLabel({ tasks }: { tasks: readonly ChatBackgroundTask[] }) {
|
|
141
|
-
const now = useNow(1000);
|
|
142
|
-
const waiting = waitingOnOf({ background: tasks });
|
|
143
|
-
|
|
144
|
-
return <span className="truncate">{waiting === null ? null : waitingOnLabel(waiting, now)}</span>;
|
|
145
|
-
}
|
|
146
|
-
|
|
147
137
|
function WorkflowIcon({ word }: { word: WorkflowWord }) {
|
|
148
138
|
return word === 'stalled' ? <Icon icon={TriangleAlert} size={14} className="shrink-0 text-status-needs-you" /> : <StatusIcon word={word} />;
|
|
149
139
|
}
|
|
@@ -238,7 +228,7 @@ function SubagentEntry({ chatId, item, now }: { chatId: string; item: ChatSubage
|
|
|
238
228
|
const { t } = useTranslation('agent-chat');
|
|
239
229
|
const { id, keyOf } = useChatScope();
|
|
240
230
|
const refused = useSubagentSupport((s) => s.unsupported[id] === true);
|
|
241
|
-
const task = useHostTask(id,
|
|
231
|
+
const task = useHostTask(id, taskIdOfRow(item));
|
|
242
232
|
const { show } = useSubagentTrail(chatId);
|
|
243
233
|
const child = useChats((s) => (item.childId === undefined ? undefined : s.statusByKey[keyOf(item.childId)]?.info));
|
|
244
234
|
const word = statusWordOf(item, task);
|
|
@@ -3,7 +3,7 @@ import clsx from 'clsx';
|
|
|
3
3
|
import { Check, Copy } from 'lucide-react';
|
|
4
4
|
import { Fragment, memo, useContext, useEffect, useMemo, useRef, useState, type ReactNode } from 'react';
|
|
5
5
|
import { useTranslation } from 'react-i18next';
|
|
6
|
-
import { useChatHost } from '../../host';
|
|
6
|
+
import { useChatHost } from '../../host/host';
|
|
7
7
|
import { IncrementalLines, type CodeToken } from './code-lines';
|
|
8
8
|
import { CodeStreamingContext } from './code-streaming';
|
|
9
9
|
import { useCodeTheme } from './code-theme';
|
package/src/chat/ui/Composer.tsx
CHANGED
|
@@ -5,14 +5,14 @@ import clsx from 'clsx';
|
|
|
5
5
|
import { ChevronDown } from 'lucide-react';
|
|
6
6
|
import { useEffect, useRef, useState, useSyncExternalStore, type MouseEvent, type PointerEvent } from 'react';
|
|
7
7
|
import { useTranslation } from 'react-i18next';
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
8
|
+
import type { ChatSendExtras } from '../../chat-client';
|
|
9
|
+
import { useChatHost } from '../../host/host';
|
|
10
|
+
import { useHostComposerStatus, useHostExtraPrompts, useHostSendDelivery } from '../../host/host-hooks';
|
|
11
11
|
import { useChatScope } from '../../scope';
|
|
12
12
|
import { useProviders } from '../../state/providers';
|
|
13
|
-
import type { ChatSendExtras } from '../chat-client';
|
|
14
13
|
import { isEmptyDraft } from '../drafts';
|
|
15
14
|
import { PROMPT_MAX_CHARS, promptGuard } from '../guards';
|
|
15
|
+
import { canSteer } from '../logic/steer';
|
|
16
16
|
import { useChatPreferences } from '../preferences';
|
|
17
17
|
import { withQuote } from '../quote';
|
|
18
18
|
import { dismissResumeCompaction } from '../resume-compaction-dismissals';
|
|
@@ -141,7 +141,6 @@ export function Composer({
|
|
|
141
141
|
// The stopped turn something went out for, since the chat takes a moment to answer and Continue must not stand there meanwhile.
|
|
142
142
|
const [sentFor, setSentFor] = useState<string | null>(null);
|
|
143
143
|
const extraPrompts = useHostExtraPrompts(scope.id, chatId);
|
|
144
|
-
const sendActions = useHostComposerSendActions(scope.id, chatId);
|
|
145
144
|
const statusItems = useHostComposerStatus(scope.id, chatId);
|
|
146
145
|
|
|
147
146
|
const { submit, continueTurn, restoreStashed, toggleStash } = useComposerSubmit({
|
|
@@ -380,16 +379,7 @@ export function Composer({
|
|
|
380
379
|
onContinue:
|
|
381
380
|
continuable !== null && continuable !== sentFor && empty && writable && pending.length === 0 && extraPrompts.length === 0
|
|
382
381
|
? continueTurn
|
|
383
|
-
: null
|
|
384
|
-
actions: sendActions,
|
|
385
|
-
draft: {
|
|
386
|
-
scopeId: scope.id,
|
|
387
|
-
chatId,
|
|
388
|
-
text: withQuote(draft.quote, draft.text.trim()),
|
|
389
|
-
provider: info.provider,
|
|
390
|
-
selection: info.selection,
|
|
391
|
-
runtimeMode: info.runtimeMode
|
|
392
|
-
}
|
|
382
|
+
: null
|
|
393
383
|
}}
|
|
394
384
|
dictationToolbar={setDictationToolbar}
|
|
395
385
|
onFiles={(picked) => {
|
|
@@ -2,7 +2,7 @@ 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
4
|
import { useImperativeHandle, useLayoutEffect, useRef, useState, type Ref } from 'react';
|
|
5
|
-
import { useChatHost } from '../../host';
|
|
5
|
+
import { useChatHost } from '../../host/host';
|
|
6
6
|
import { composerEditorExtensions, externalChange } from './composer/editor';
|
|
7
7
|
import { insertAtSelection, insertSigil } from './composer/insert';
|
|
8
8
|
|
|
@@ -16,7 +16,7 @@ export interface ComposerInputHandle {
|
|
|
16
16
|
insertSigil(sigil: string): void;
|
|
17
17
|
}
|
|
18
18
|
|
|
19
|
-
|
|
19
|
+
interface InputSelection {
|
|
20
20
|
from: number;
|
|
21
21
|
to: number;
|
|
22
22
|
}
|
package/src/chat/ui/EditDiff.tsx
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import { LazyBoundary } from '@adecore/ui';
|
|
1
|
+
import { LazyBoundary, lazyNamed } from '@adecore/ui';
|
|
2
2
|
import { useTranslation } from 'react-i18next';
|
|
3
|
-
import { useChatHost } from '../../host';
|
|
4
|
-
import { lazyNamed } from '../../lazy';
|
|
3
|
+
import { useChatHost } from '../../host/host';
|
|
5
4
|
import type { FileChange } from '../logic/tools';
|
|
6
5
|
import { diffSourceBudget, legacyDiffBudget } from './diff/diff-source-budget';
|
|
7
6
|
import { DiffFallbackBoundary } from './diff/DiffFallbackBoundary';
|
package/src/chat/ui/GoalDock.tsx
CHANGED
|
@@ -6,7 +6,7 @@ import type { TFunction } from 'i18next';
|
|
|
6
6
|
import { Target } from 'lucide-react';
|
|
7
7
|
import { useState } from 'react';
|
|
8
8
|
import { useTranslation } from 'react-i18next';
|
|
9
|
-
import { useChatHost } from '../../host';
|
|
9
|
+
import { useChatHost } from '../../host/host';
|
|
10
10
|
import { useChatScope } from '../../scope';
|
|
11
11
|
import { useChats } from '../../state/chats';
|
|
12
12
|
import { errorMessage } from '../../transport';
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { Icon, Menu } from '@adecore/ui';
|
|
2
|
-
import type { HostMenuAction } from '../../host';
|
|
2
|
+
import type { HostMenuAction } from '../../host/host';
|
|
3
3
|
|
|
4
|
-
/* The items a host adds to a menu of the chat's, in the order it gave them. */
|
|
5
4
|
export function HostMenuItems({ actions }: { actions: readonly HostMenuAction[] }) {
|
|
6
5
|
return actions.map((action) => (
|
|
7
6
|
<Menu.Item key={action.id} disabled={action.disabled} onClick={() => action.run()}>
|
|
@@ -4,7 +4,7 @@ import clsx from 'clsx';
|
|
|
4
4
|
import { ChevronLeft, ChevronRight, ImageOff, Minus, Plus, RotateCcw } from 'lucide-react';
|
|
5
5
|
import { createContext, useContext, useId, useLayoutEffect, useRef, useState, useSyncExternalStore, type KeyboardEvent, type ReactNode } from 'react';
|
|
6
6
|
import { useTranslation } from 'react-i18next';
|
|
7
|
-
import type { ResourceUrl } from '../../host';
|
|
7
|
+
import type { ResourceUrl } from '../../host/host';
|
|
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
|
|
|
@@ -329,7 +329,7 @@ function Lightbox({
|
|
|
329
329
|
);
|
|
330
330
|
}
|
|
331
331
|
|
|
332
|
-
|
|
332
|
+
interface ImageThumbProps {
|
|
333
333
|
source: ResourceUrl;
|
|
334
334
|
alt: string;
|
|
335
335
|
className?: string;
|
|
@@ -8,8 +8,8 @@ import { useTranslation } from 'react-i18next';
|
|
|
8
8
|
import { continueTargets, hasUnreadAccount, limitsOfAccount, sessionWindow } from '../../agents/account-limits';
|
|
9
9
|
import { AccountDot } from '../../agents/AccountDot';
|
|
10
10
|
import { canContinueOn, type AccountEntry } from '../../agents/accounts';
|
|
11
|
-
import { useChatHost } from '../../host';
|
|
12
|
-
import { useHostResumeAtReset } from '../../host-hooks';
|
|
11
|
+
import { useChatHost } from '../../host/host';
|
|
12
|
+
import { useHostResumeAtReset } from '../../host/host-hooks';
|
|
13
13
|
import { useChatScope, type ChatScope } from '../../scope';
|
|
14
14
|
import { useChats } from '../../state/chats';
|
|
15
15
|
import { useUsageStore } from '../../state/usage';
|
package/src/chat/ui/Markdown.tsx
CHANGED
|
@@ -6,7 +6,7 @@ import { useTranslation } from 'react-i18next';
|
|
|
6
6
|
import ReactMarkdown, { type Components, type ExtraProps, type Options } from 'react-markdown';
|
|
7
7
|
import remarkBreaks from 'remark-breaks';
|
|
8
8
|
import remarkGfm from 'remark-gfm';
|
|
9
|
-
import { useChatHost, type ChatHost, type FileRef, type ShellCodeBlockContext } from '../../host';
|
|
9
|
+
import { useChatHost, type ChatHost, type FileRef, type ShellCodeBlockContext } from '../../host/host';
|
|
10
10
|
import type { ReferenceToken } from '../mentions';
|
|
11
11
|
import { MENTION_TONE, SKILL_TONE, TOKEN_ICON } from './chips';
|
|
12
12
|
import { CodeStreamingContext } from './code-streaming';
|
|
@@ -236,7 +236,6 @@ function PlainImage({ src, alt }: { src?: string; alt?: string }) {
|
|
|
236
236
|
return <DisplayImage src={src} alt={alt} />;
|
|
237
237
|
}
|
|
238
238
|
|
|
239
|
-
/* A ```mermaid fence, which draws what it says. */
|
|
240
239
|
function Diagram({ code }: { code: string }) {
|
|
241
240
|
const { t } = useTranslation('agent-chat');
|
|
242
241
|
|
|
@@ -2,7 +2,7 @@ import { IconButton, ScrollArea } from '@adecore/ui';
|
|
|
2
2
|
import { Code, Workflow } from 'lucide-react';
|
|
3
3
|
import { useContext, useEffect, useId, useRef, useState } from 'react';
|
|
4
4
|
import { useTranslation } from 'react-i18next';
|
|
5
|
-
import { useHostCodeMode } from '../../host-hooks';
|
|
5
|
+
import { useHostCodeMode } from '../../host/host-hooks';
|
|
6
6
|
import { CodeStreamingContext } from './code-streaming';
|
|
7
7
|
import { CodeBlock } from './CodeBlock';
|
|
8
8
|
import { DIAGRAM_TOKENS, GROUND_TOKEN, renderOptions, svgDataUrl, themedSvg, type DiagramFont } from './mermaid';
|
|
@@ -39,7 +39,6 @@ function resolveColor(element: HTMLElement, token: string, ground: string): stri
|
|
|
39
39
|
return `#${[red, green, blue].map((channel) => channel!.toString(16).padStart(2, '0')).join('')}`;
|
|
40
40
|
}
|
|
41
41
|
|
|
42
|
-
/* What a diagram reads of the theme where it stands. */
|
|
43
42
|
interface DiagramLook {
|
|
44
43
|
colors: Record<string, string>;
|
|
45
44
|
font: DiagramFont;
|
|
@@ -4,12 +4,13 @@ import clsx from 'clsx';
|
|
|
4
4
|
import { Bookmark, Check, Copy, GitFork } from 'lucide-react';
|
|
5
5
|
import { useEffect, useState } from 'react';
|
|
6
6
|
import { useTranslation } from 'react-i18next';
|
|
7
|
-
import { useChatHost } from '../../host';
|
|
7
|
+
import { useChatHost } from '../../host/host';
|
|
8
|
+
import type { TimelineRow } from '../../host/timeline-row';
|
|
8
9
|
import { useChatScope } from '../../scope';
|
|
9
10
|
import { useChatRow, useChats } from '../../state/chats';
|
|
11
|
+
import { useProviders } from '../../state/providers';
|
|
10
12
|
import { placeBookmark } from '../bookmarks';
|
|
11
13
|
import { forkRefusal } from '../logic/fork';
|
|
12
|
-
import type { TimelineRow } from '../logic/timeline';
|
|
13
14
|
import { markdownOf, messageTextOf } from '../logic/timeline-copy';
|
|
14
15
|
import { copyWithChips, messageClipboardChips } from './chip-clipboard';
|
|
15
16
|
import { useReferenceLookup } from './thread-references';
|
|
@@ -45,7 +46,8 @@ export function MessageActions({ chatId, row }: { chatId: string; row: MessageRo
|
|
|
45
46
|
});
|
|
46
47
|
|
|
47
48
|
const bookmarked = bookmarks?.some((candidate) => candidate.itemId === row.id) === true;
|
|
48
|
-
const
|
|
49
|
+
const providers = useProviders((host) => host);
|
|
50
|
+
const canFork = turnId !== null && forkRefusal(info, turn, providers) === null;
|
|
49
51
|
const [copied, setCopied] = useState(false);
|
|
50
52
|
const lookup = useReferenceLookup(chatId);
|
|
51
53
|
|
package/src/chat/ui/Pickers.tsx
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type
|
|
1
|
+
import { inPickerOrder, separatesGroups, type AgentKind, type ModelSelection, type ProviderInfo, type UsageProvider } from '@adecore/agent-contracts';
|
|
2
2
|
import { Button, Icon, IconButton, Menu, Popover, ScrollArea, Tooltip } from '@adecore/ui';
|
|
3
3
|
import { ChevronDown, ChevronRight, Search, Star } from 'lucide-react';
|
|
4
4
|
import { useContext, useEffect, useRef, useState, type ReactNode, type RefObject } from 'react';
|
|
@@ -7,11 +7,11 @@ import { AgentIcon } from '../../agents/AgentIcon';
|
|
|
7
7
|
import { agentChipOf, modelName } from '../../agents/model-name';
|
|
8
8
|
import { modelRequirementOf } from '../../agents/model-requirement';
|
|
9
9
|
import { ProviderLogo } from '../../agents/ProviderLogo';
|
|
10
|
-
import { useChatHost } from '../../host';
|
|
11
|
-
import { useHostMachineLabel } from '../../host-hooks';
|
|
10
|
+
import { useChatHost } from '../../host/host';
|
|
11
|
+
import { useHostMachineLabel } from '../../host/host-hooks';
|
|
12
12
|
import { ChatScopeContext } from '../../scope';
|
|
13
13
|
import { useReportedModels } from '../../state/chats';
|
|
14
|
-
import {
|
|
14
|
+
import { pickerEntriesOf, type PickerEntry } from '../logic/picker-entries';
|
|
15
15
|
import { favoriteModelsOf, toggleFavoriteModel, useChatPreferences } from '../preferences';
|
|
16
16
|
import { ModelMarks } from './ModelMarks';
|
|
17
17
|
|
|
@@ -2,18 +2,19 @@ import { Button, Icon } from '@adecore/ui';
|
|
|
2
2
|
import { ArrowDown, Hand, MessageCircleQuestionMark } from 'lucide-react';
|
|
3
3
|
import { useEffect, useRef, type ReactNode } from 'react';
|
|
4
4
|
import { useTranslation } from 'react-i18next';
|
|
5
|
-
import { useChatHost } from '../../host';
|
|
6
|
-
import { useHostExtraPrompts } from '../../host-hooks';
|
|
7
|
-
import {
|
|
8
|
-
import { orderPrompts } from '../../prompts/logic/prompts';
|
|
9
|
-
import { answerPrompt, isBlockingSubject, promptCreatedAt, promptIdOf, type PromptSubject } from '../../prompts/logic/subjects';
|
|
10
|
-
import { useFocusAfterAnswer } from '../../prompts/logic/useFocusAfterAnswer';
|
|
11
|
-
import { usePromptSession } from '../../prompts/logic/usePromptSession';
|
|
12
|
-
import { PromptView } from '../../prompts/ui/PromptView';
|
|
5
|
+
import { useChatHost } from '../../host/host';
|
|
6
|
+
import { useHostExtraPrompts } from '../../host/host-hooks';
|
|
7
|
+
import { type PromptSubject } from '../../host/prompts';
|
|
13
8
|
import { useChatScope } from '../../scope';
|
|
14
9
|
import { useProviders } from '../../state/providers';
|
|
15
10
|
import { useChatActions } from '../actions';
|
|
16
11
|
import type { HoldRelease } from '../prompt-hold';
|
|
12
|
+
import { focusPromptHeading, focusPromptStart } from '../prompts/logic/focus';
|
|
13
|
+
import { orderPrompts } from '../prompts/logic/prompts';
|
|
14
|
+
import { answerPrompt, isBlockingSubject, promptCreatedAt, promptIdOf } from '../prompts/logic/subjects';
|
|
15
|
+
import { useFocusAfterAnswer } from '../prompts/logic/useFocusAfterAnswer';
|
|
16
|
+
import { usePromptSession } from '../prompts/logic/usePromptSession';
|
|
17
|
+
import { PromptView } from '../prompts/ui/PromptView';
|
|
17
18
|
|
|
18
19
|
/* Keeps a prompt card behind the draft while the person types; `released` says what lifted the hold last. */
|
|
19
20
|
export interface PromptHold {
|
|
@@ -2,8 +2,8 @@ import type { ChatSkill } from '@adecore/agent-contracts';
|
|
|
2
2
|
import { Surface } from '@adecore/ui';
|
|
3
3
|
import clsx from 'clsx';
|
|
4
4
|
import { useLayoutEffect, useRef, type SetStateAction } from 'react';
|
|
5
|
-
import { useChatHost } from '../../host';
|
|
6
|
-
import type { Referables } from '
|
|
5
|
+
import { useChatHost } from '../../host/host';
|
|
6
|
+
import type { Referables } from '../../host/references';
|
|
7
7
|
import { chipDecorations } from './composer/chips';
|
|
8
8
|
import { ComposerMenu } from './composer/ComposerMenu';
|
|
9
9
|
import { pickInMenu } from './composer/key-handler';
|
|
@@ -3,7 +3,7 @@ import clsx from 'clsx';
|
|
|
3
3
|
import { CircleOff } from 'lucide-react';
|
|
4
4
|
import { useContext, type HTMLAttributes, type KeyboardEvent, type ReactNode } from 'react';
|
|
5
5
|
import { useTranslation } from 'react-i18next';
|
|
6
|
-
import { useChatHost } from '../../host';
|
|
6
|
+
import { useChatHost } from '../../host/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';
|
|
9
9
|
import { ReferenceLookupContext } from './reference-lookup';
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { Icon } from '@adecore/ui';
|
|
2
2
|
import { ChevronRight } from 'lucide-react';
|
|
3
3
|
import { Fragment, type ComponentType } from 'react';
|
|
4
|
-
import type { ReferenceIconProps } from '../../host';
|
|
5
|
-
import type { ReferenceStep } from '
|
|
4
|
+
import type { ReferenceIconProps } from '../../host/host';
|
|
5
|
+
import type { ReferenceStep } from '../../host/references';
|
|
6
6
|
import { referenceGlyph } from './reference-icons';
|
|
7
7
|
|
|
8
8
|
interface ReferenceTrailProps {
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
|
+
inPickerOrder,
|
|
3
|
+
separatesGroups,
|
|
2
4
|
UsageProviderSchema,
|
|
3
5
|
type AgentKind,
|
|
4
6
|
type ChatUsage,
|
|
@@ -36,13 +38,13 @@ import { accountColor, canContinueOn } from '../../agents/accounts';
|
|
|
36
38
|
import { AgentIcon } from '../../agents/AgentIcon';
|
|
37
39
|
import { modelName } from '../../agents/model-name';
|
|
38
40
|
import { localizedOption } from '../../agents/option-words';
|
|
39
|
-
import { useChatHost } from '../../host';
|
|
41
|
+
import { useChatHost } from '../../host/host';
|
|
40
42
|
import { PROVIDER_COLORS } from '../../usage/format';
|
|
41
43
|
import { useUsageLimits } from '../../usage/limits';
|
|
42
44
|
import type { AccountChoice } from '../account-choice';
|
|
43
45
|
import { CONTEXT_OPTION, contextFraction, contextSegments, orderOptions, type ContextPart } from '../logic/context-usage';
|
|
44
46
|
import { EFFORT_OPTION } from '../logic/effort';
|
|
45
|
-
import { favoritesFirst,
|
|
47
|
+
import { favoritesFirst, searchModels, shortlistOf, wantsModelSearch } from '../logic/picker-entries';
|
|
46
48
|
import { favoriteModelsOf, toggleFavoriteModel, useChatPreferences } from '../preferences';
|
|
47
49
|
import { RUNTIME_MODES } from '../runtime-modes';
|
|
48
50
|
import { ModelMarks } from './ModelMarks';
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import type
|
|
1
|
+
import { evenPace, type UsageWindow } from '@adecore/agent-contracts';
|
|
2
2
|
import { formatClock, formatPercent, formatWeekdayClock, isSameDay } from '@adecore/ui/format';
|
|
3
3
|
import clsx from 'clsx';
|
|
4
4
|
import { useTranslation } from 'react-i18next';
|
|
5
|
-
import {
|
|
5
|
+
import { 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. */
|
|
8
8
|
function sessionTone(used: number): { bar: string; text: string } {
|
|
@@ -1,14 +1,13 @@
|
|
|
1
1
|
import { Tooltip } from '@adecore/ui';
|
|
2
2
|
import { useEffect, useState, type ReactNode } from 'react';
|
|
3
3
|
import type { BundledLanguage } from 'shiki';
|
|
4
|
-
import { useChatHost, type CommandName } from '../../host';
|
|
4
|
+
import { useChatHost, type CommandName } from '../../host/host';
|
|
5
5
|
import { EMBEDDED_CODE_LIMIT, SHELL_LANGUAGE, embeddedCode, type EmbeddedCode } from '../logic/embedded-code';
|
|
6
6
|
import type { CodeToken } from './code-lines';
|
|
7
7
|
import { useCodeTheme } from './code-theme';
|
|
8
8
|
import { tokenStyle, useCodeHighlighter, type CodeHighlighter, type Highlighter } from './highlighter';
|
|
9
9
|
import { ReferenceChip } from './ReferenceChip';
|
|
10
10
|
|
|
11
|
-
/* One colored run of a command, as offsets into it. */
|
|
12
11
|
interface Run extends CodeToken {
|
|
13
12
|
start: number;
|
|
14
13
|
end: number;
|
|
@@ -43,7 +42,6 @@ function runsOf(highlighter: Highlighter, code: string, language: string, theme:
|
|
|
43
42
|
}));
|
|
44
43
|
}
|
|
45
44
|
|
|
46
|
-
/* `base` with `[start, end)` cut out of it and `inner` in its place. */
|
|
47
45
|
function overlay(base: readonly Run[], start: number, end: number, inner: readonly Run[]): Run[] {
|
|
48
46
|
const kept: Run[] = [];
|
|
49
47
|
|
|
@@ -112,7 +110,6 @@ function highlight(command: string, extra: readonly EmbeddedCode[], theme: strin
|
|
|
112
110
|
return runs;
|
|
113
111
|
}
|
|
114
112
|
|
|
115
|
-
/* `command[from, to)` in its colors, or as it is while there are none. */
|
|
116
113
|
function draw(command: string, runs: readonly Run[] | null, from: number, to: number): ReactNode[] {
|
|
117
114
|
if (runs === null) {
|
|
118
115
|
return [command.slice(from, to)];
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
+
import { taskIdOfRow } from '@adecore/agent-contracts';
|
|
1
2
|
import { Tooltip, useNow } from '@adecore/ui';
|
|
2
3
|
import { useTranslation } from 'react-i18next';
|
|
3
4
|
import { useModelName } from '../../agents/model-name';
|
|
4
|
-
import { useHostTask } from '../../host-hooks';
|
|
5
|
+
import { useHostTask } from '../../host/host-hooks';
|
|
5
6
|
import { useChatScope } from '../../scope';
|
|
6
7
|
import { useChatRow } from '../../state/chats';
|
|
7
|
-
import { entryTimeOf, statusWordOf
|
|
8
|
+
import { entryTimeOf, statusWordOf } from '../subagent-list';
|
|
8
9
|
import { useSubagentItem } from '../subagent-view';
|
|
9
10
|
import { StatusIcon } from './ChatActivity';
|
|
10
11
|
import { SubagentActions, SubagentBreadcrumb } from './SubagentControls';
|
|
@@ -19,7 +20,7 @@ export function SubagentInfo({ chatId, toolUseId }: { chatId: string; toolUseId:
|
|
|
19
20
|
const { id } = useChatScope();
|
|
20
21
|
const item = useSubagentItem(chatId, toolUseId);
|
|
21
22
|
const provider = useChatRow(chatId, (row) => row?.info.provider);
|
|
22
|
-
const task = useHostTask(id, item === null ? null :
|
|
23
|
+
const task = useHostTask(id, item === null ? null : taskIdOfRow(item));
|
|
23
24
|
const modelName = useModelName(provider, item?.model ?? '');
|
|
24
25
|
const now = useNow(1000, item?.status === 'running');
|
|
25
26
|
const word = item === null ? null : statusWordOf(item, task);
|
|
@@ -2,7 +2,7 @@ import type { ChatSubagentItem } from '@adecore/agent-contracts';
|
|
|
2
2
|
import { IconButton } from '@adecore/ui';
|
|
3
3
|
import { Square } from 'lucide-react';
|
|
4
4
|
import { useTranslation } from 'react-i18next';
|
|
5
|
-
import { useChatHost } from '../../host';
|
|
5
|
+
import { useChatHost } from '../../host/host';
|
|
6
6
|
import { useChatScope } from '../../scope';
|
|
7
7
|
import { useChatRow } from '../../state/chats';
|
|
8
8
|
import { useChatActions } from '../actions';
|
|
@@ -2,8 +2,8 @@ import { EmptyState, ContextMenu, Icon, ScrollArea } from '@adecore/ui';
|
|
|
2
2
|
import { Bot, LoaderCircle } from 'lucide-react';
|
|
3
3
|
import { useCallback, useContext, useEffect, useLayoutEffect, useRef, useState } from 'react';
|
|
4
4
|
import { useTranslation } from 'react-i18next';
|
|
5
|
-
import { useChatHost } from '../../host';
|
|
6
|
-
import { useHostHidesToolCalls } from '../../host-hooks';
|
|
5
|
+
import { useChatHost } from '../../host/host';
|
|
6
|
+
import { useHostHidesToolCalls } from '../../host/host-hooks';
|
|
7
7
|
import { useChatScope } from '../../scope';
|
|
8
8
|
import { useChatRow } from '../../state/chats';
|
|
9
9
|
import { deriveTimelineRows } from '../logic/timeline';
|
package/src/chat/ui/Timeline.tsx
CHANGED
|
@@ -18,10 +18,12 @@ import {
|
|
|
18
18
|
} from 'react';
|
|
19
19
|
import { useTranslation } from 'react-i18next';
|
|
20
20
|
import { useModelName } from '../../agents/model-name';
|
|
21
|
-
import { useChatHost, type TimelineFindOptions } from '../../host';
|
|
22
|
-
import { useHostContextSources, useHostHidesToolCalls, useHostThreadCards, useHostTimelineFind, useHostWelcome } from '../../host-hooks';
|
|
21
|
+
import { useChatHost, type TimelineFindOptions } from '../../host/host';
|
|
22
|
+
import { useHostContextSources, useHostHidesToolCalls, useHostThreadCards, useHostTimelineFind, useHostWelcome } from '../../host/host-hooks';
|
|
23
|
+
import { type TimelineRow } from '../../host/timeline-row';
|
|
23
24
|
import { useChatScope } from '../../scope';
|
|
24
25
|
import { useChatRow, useChats } from '../../state/chats';
|
|
26
|
+
import { providersOf } from '../../state/providers';
|
|
25
27
|
import { useForkedTurns } from '../forks';
|
|
26
28
|
import { bookmarkRows } from '../logic/bookmarks';
|
|
27
29
|
import { forkRefusal } from '../logic/fork';
|
|
@@ -39,7 +41,7 @@ import {
|
|
|
39
41
|
EARLIER_ROW
|
|
40
42
|
} from '../logic/scrubber';
|
|
41
43
|
import { timedRowsOf, withTimedRows } from '../logic/thread-cards';
|
|
42
|
-
import { deriveTimelineRows, findSubagentBranch
|
|
44
|
+
import { deriveTimelineRows, findSubagentBranch } from '../logic/timeline';
|
|
43
45
|
import {
|
|
44
46
|
EMPTY_TARGET,
|
|
45
47
|
readTimelineTarget,
|
|
@@ -183,7 +185,6 @@ interface ThreadRowProps extends Omit<RowProps, 'openConversation'> {
|
|
|
183
185
|
index: number;
|
|
184
186
|
top: number;
|
|
185
187
|
measure: (element: HTMLDivElement | null) => void;
|
|
186
|
-
/* The nonce of the flash on this row, or null when it has none. */
|
|
187
188
|
flashNonce: number | null;
|
|
188
189
|
bookmark: ChatBookmark | null;
|
|
189
190
|
openConversation(step: SubagentStep): void;
|
|
@@ -877,11 +878,11 @@ export function Timeline({
|
|
|
877
878
|
|
|
878
879
|
const row = useChats.getState().byKey[keyOf(chatId)];
|
|
879
880
|
|
|
880
|
-
return forkRefusal(row?.info ?? null, row?.structure[turnId]) === null;
|
|
881
|
+
return forkRefusal(row?.info ?? null, row?.structure[turnId], providersOf(scopeId)) === null;
|
|
881
882
|
},
|
|
882
883
|
fork: (turnId) => fork?.(chatId, turnId)
|
|
883
884
|
}),
|
|
884
|
-
[keyOf, chatId, fork]
|
|
885
|
+
[keyOf, scopeId, chatId, fork]
|
|
885
886
|
);
|
|
886
887
|
|
|
887
888
|
const stepRef = useRef<(direction: -1 | 1) => boolean>(() => false);
|
|
@@ -2,9 +2,10 @@ import { ContextMenu, copyText, DisabledReason, EDIT_SHORTCUTS, Icon, Kbd, selec
|
|
|
2
2
|
import { BookmarkPlus, BookmarkX, Braces, Copy, Eye, FileText, GitFork, MessageSquare, MoveHorizontal, Pencil, Scan } from 'lucide-react';
|
|
3
3
|
import type { RefObject } from 'react';
|
|
4
4
|
import { useTranslation } from 'react-i18next';
|
|
5
|
-
import { useChatHost } from '../../host';
|
|
5
|
+
import { useChatHost } from '../../host/host';
|
|
6
6
|
import { useChatScope } from '../../scope';
|
|
7
7
|
import { useChatRow } from '../../state/chats';
|
|
8
|
+
import { useProviders } from '../../state/providers';
|
|
8
9
|
import { placeBookmark, removeBookmark, useBookmarkNaming } from '../bookmarks';
|
|
9
10
|
import { forkRefusal, turnIdOfRow } from '../logic/fork';
|
|
10
11
|
import { markdownOf, messageTextOf } from '../logic/timeline-copy';
|
|
@@ -33,7 +34,8 @@ export function TimelineMenuPopup({
|
|
|
33
34
|
const row = target.row;
|
|
34
35
|
const message = row === null ? null : messageTextOf(row);
|
|
35
36
|
const turnId = chatId === null || target.row === null ? null : turnIdOfRow(target.row);
|
|
36
|
-
const
|
|
37
|
+
const providers = useProviders((host) => host);
|
|
38
|
+
const forkBlocked = useChatRow(chatId ?? '', (row) => (turnId === null ? null : forkRefusal(row?.info ?? null, row?.structure[turnId], providers)));
|
|
37
39
|
const markdown = target.row === null ? null : markdownOf(target.row);
|
|
38
40
|
const markable = chatId !== null && (target.row?.kind === 'user' || target.row?.kind === 'assistant') ? target.row.id : null;
|
|
39
41
|
// A thread outside a chat (a sub-agent's transcript) has no cwd of its own; the app answers for it then.
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import { LazyBoundary } from '@adecore/ui';
|
|
1
|
+
import { LazyBoundary, lazyNamed } from '@adecore/ui';
|
|
2
2
|
import { useTranslation } from 'react-i18next';
|
|
3
|
-
import { useChatHost } from '../../host';
|
|
4
|
-
import { lazyNamed } from '../../lazy';
|
|
3
|
+
import { useChatHost } from '../../host/host';
|
|
5
4
|
import type { UnifiedDiffProps } from './diff/diff-props';
|
|
6
5
|
import { diffSourceBudget, legacyDiffBudget, patchSourceBudget } from './diff/diff-source-budget';
|
|
7
6
|
import { DiffFallbackBoundary } from './diff/DiffFallbackBoundary';
|
|
@@ -3,7 +3,7 @@ import { Spinner, useMeasuredWidth } from '@adecore/ui';
|
|
|
3
3
|
import clsx from 'clsx';
|
|
4
4
|
import { useCallback, useEffect, useLayoutEffect, useRef, useState } from 'react';
|
|
5
5
|
import { useTranslation } from 'react-i18next';
|
|
6
|
-
import { useChatHost } from '../../host';
|
|
6
|
+
import { useChatHost } from '../../host/host';
|
|
7
7
|
import { useChatScope } from '../../scope';
|
|
8
8
|
import { imageDocumentForDisplay } from '../image-display';
|
|
9
9
|
import { DEFAULT_HEIGHT_PX, initialVisualContentHeight, rememberVisualHeight } from '../logic/visual-height';
|
|
@@ -11,7 +11,7 @@ import { VisualBridge } from '../visual-bridge';
|
|
|
11
11
|
import { VisualViewportController } from '../visual-viewport';
|
|
12
12
|
import { useVisualTheme } from './visual-theme';
|
|
13
13
|
|
|
14
|
-
|
|
14
|
+
interface VisualFrameProps {
|
|
15
15
|
chatId: string;
|
|
16
16
|
visual: ChatVisual;
|
|
17
17
|
/* Fills its positioned parent and lets the page scroll inside it, rather than taking the height the page reports. */
|
|
@@ -19,7 +19,7 @@ export interface VisualFrameProps {
|
|
|
19
19
|
className?: string;
|
|
20
20
|
}
|
|
21
21
|
|
|
22
|
-
|
|
22
|
+
interface VisualPageFrameProps {
|
|
23
23
|
/* Reads the page's HTML each time the frame opens; the frame opens again when this changes, so keep it the same function while the page is. */
|
|
24
24
|
page: () => Promise<string>;
|
|
25
25
|
/* The frame's accessible name. */
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { ChatAssistantItem, ChatUserItem } from '@adecore/agent-contracts';
|
|
2
2
|
import { copyText } from '@adecore/ui';
|
|
3
|
+
import type { TimelineRow } from '../../host/timeline-row';
|
|
3
4
|
import { referenceTokens } from '../chat-references';
|
|
4
|
-
import type { TimelineRow } from '../logic/timeline';
|
|
5
5
|
import {
|
|
6
6
|
clipboardChipsOf,
|
|
7
7
|
hasClipboardChips,
|
|
@@ -68,7 +68,7 @@ function segmentOf(chip: Element): ChipSegment | null {
|
|
|
68
68
|
}
|
|
69
69
|
|
|
70
70
|
/* The chips a selection holds whole, beside the text it copies; a chip cut in half is only text. */
|
|
71
|
-
|
|
71
|
+
function selectionChips(selection: Selection): ClipboardChips {
|
|
72
72
|
const segments: ChipSegment[] = [];
|
|
73
73
|
|
|
74
74
|
for (let i = 0; i < selection.rangeCount; i++) {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { ThemeRegistration } from 'shiki';
|
|
2
|
-
import { type ChatHost } from '../../host';
|
|
3
|
-
import { useHostCodeMode, useHostCodeThemes } from '../../host-hooks';
|
|
2
|
+
import { type ChatHost } from '../../host/host';
|
|
3
|
+
import { useHostCodeMode, useHostCodeThemes } from '../../host/host-hooks';
|
|
4
4
|
|
|
5
5
|
/* The Shiki theme code is drawn in under the app's current light or dark. */
|
|
6
6
|
export function useCodeTheme(): string {
|