@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,16 +1,14 @@
|
|
|
1
1
|
import { holdsConversation, type ChatInfo } from '@adecore/agent-contracts';
|
|
2
|
-
import { Button, ErrorBoundary, Icon,
|
|
3
|
-
import
|
|
4
|
-
import {
|
|
5
|
-
import { useRef, useState, type Ref } from 'react';
|
|
2
|
+
import { Button, ErrorBoundary, Icon, Tooltip, type Shortcut } from '@adecore/ui';
|
|
3
|
+
import { ArrowUp, Play, Square } from 'lucide-react';
|
|
4
|
+
import { useRef, type Ref } from 'react';
|
|
6
5
|
import { useTranslation } from 'react-i18next';
|
|
7
|
-
import { useChatHost
|
|
6
|
+
import { useChatHost } from '../../../host/host';
|
|
8
7
|
import { useChatScope } from '../../../scope';
|
|
9
8
|
import { useProviders } from '../../../state/providers';
|
|
10
9
|
import { useAccountChoice, useAccountColorId } from '../../account-choice';
|
|
11
10
|
import type { StashedPrompt } from '../../stash';
|
|
12
11
|
import { composerStopLabel } from '../../subagent-list';
|
|
13
|
-
import { HostMenuItems } from '../HostMenuItems';
|
|
14
12
|
import { RunSettings } from '../RunSettings';
|
|
15
13
|
import { ComposerPlusMenu, type PlusMenuSigils } from './ComposerPlusMenu';
|
|
16
14
|
import type { ChatControls } from './use-chat-controls';
|
|
@@ -24,30 +22,13 @@ interface SendProps {
|
|
|
24
22
|
onSend(alternate: boolean): void;
|
|
25
23
|
/* Set when a person stopped the last turn and the box is empty: Continue stands where the send button would. */
|
|
26
24
|
onContinue: (() => void) | null;
|
|
27
|
-
/* The host's own, behind a chevron on the send button; empty draws the send button alone. */
|
|
28
|
-
actions: readonly ComposerSendAction[];
|
|
29
|
-
draft: ComposerSendDraft;
|
|
30
25
|
}
|
|
31
26
|
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
/* The chevron only follows whether the box takes input: an action may want an empty draft, such as to reuse the last message. */
|
|
35
|
-
writable: boolean;
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
/* The send button, split with a chevron that opens the host's send actions when it has any. */
|
|
39
|
-
function SendButton({ send, writable }: SendButtonProps) {
|
|
40
|
-
const { t } = useTranslation('agent-chat');
|
|
41
|
-
const [box, setBox] = useState<HTMLDivElement | null>(null);
|
|
42
|
-
const split = send.actions.length > 0;
|
|
43
|
-
|
|
44
|
-
const button = (
|
|
27
|
+
function SendButton({ send }: { send: SendProps }) {
|
|
28
|
+
return (
|
|
45
29
|
<Tooltip label={send.label} kbd={send.kbd} name>
|
|
46
30
|
<button
|
|
47
|
-
className=
|
|
48
|
-
'flex h-9 w-9 shrink-0 items-center justify-center bg-accent text-accent-text hover:brightness-90 disabled:opacity-50 disabled:hover:brightness-100',
|
|
49
|
-
split ? 'focus-visible:-outline-offset-2' : 'rounded-full'
|
|
50
|
-
)}
|
|
31
|
+
className="flex h-9 w-9 shrink-0 items-center justify-center rounded-full bg-accent text-accent-text hover:brightness-90 disabled:opacity-50 disabled:hover:brightness-100"
|
|
51
32
|
disabled={send.disabled}
|
|
52
33
|
onClick={(event) => send.onSend(event.altKey)}
|
|
53
34
|
>
|
|
@@ -55,37 +36,6 @@ function SendButton({ send, writable }: SendButtonProps) {
|
|
|
55
36
|
</button>
|
|
56
37
|
</Tooltip>
|
|
57
38
|
);
|
|
58
|
-
|
|
59
|
-
if (!split) {
|
|
60
|
-
return button;
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
const { draft } = send;
|
|
64
|
-
|
|
65
|
-
return (
|
|
66
|
-
// One round shape that clips both halves, the way a split button of the library draws its frame.
|
|
67
|
-
<div ref={setBox} className="flex h-9 shrink-0 overflow-clip rounded-full">
|
|
68
|
-
{button}
|
|
69
|
-
<Menu.Root>
|
|
70
|
-
<Tooltip label={t('composer.sendActions')} name>
|
|
71
|
-
<Menu.Trigger
|
|
72
|
-
render={
|
|
73
|
-
<button
|
|
74
|
-
type="button"
|
|
75
|
-
className='relative flex h-9 w-6 shrink-0 items-center justify-center bg-accent text-accent-text before:absolute before:inset-y-0 before:left-0 before:my-auto before:h-4 before:w-px before:bg-current/30 before:content-[""] hover:brightness-90 focus-visible:-outline-offset-2 disabled:opacity-50 disabled:hover:brightness-100'
|
|
76
|
-
/>
|
|
77
|
-
}
|
|
78
|
-
disabled={!writable}
|
|
79
|
-
>
|
|
80
|
-
<Icon icon={ChevronDown} size={14} />
|
|
81
|
-
</Menu.Trigger>
|
|
82
|
-
</Tooltip>
|
|
83
|
-
<Menu.Popup anchor={box} side="top" sideOffset={8} align="end" className="min-w-48">
|
|
84
|
-
<HostMenuItems actions={send.actions.map((action) => ({ ...action, run: () => action.run(draft) }))} />
|
|
85
|
-
</Menu.Popup>
|
|
86
|
-
</Menu.Root>
|
|
87
|
-
</div>
|
|
88
|
-
);
|
|
89
39
|
}
|
|
90
40
|
|
|
91
41
|
interface ComposerControlsProps {
|
|
@@ -106,7 +56,6 @@ interface ComposerControlsProps {
|
|
|
106
56
|
insert(text: string): void;
|
|
107
57
|
}
|
|
108
58
|
|
|
109
|
-
/* The row under the box: the + with attach, the stash and the sigils, the chat's settings, the app's own control, and stop and send. */
|
|
110
59
|
export function ComposerControls({
|
|
111
60
|
chatId,
|
|
112
61
|
info,
|
|
@@ -211,7 +160,7 @@ export function ComposerControls({
|
|
|
211
160
|
</Button>
|
|
212
161
|
</Tooltip>
|
|
213
162
|
)}
|
|
214
|
-
{send.onContinue === null && send.visible && <SendButton send={send}
|
|
163
|
+
{send.onContinue === null && send.visible && <SendButton send={send} />}
|
|
215
164
|
</div>
|
|
216
165
|
</div>
|
|
217
166
|
);
|
|
@@ -4,8 +4,8 @@ import { SquareSlash, Zap } from 'lucide-react';
|
|
|
4
4
|
import type { ReactNode } from 'react';
|
|
5
5
|
import { useTranslation } from 'react-i18next';
|
|
6
6
|
import { CliMark } from '../../../agents/AgentModelLabel';
|
|
7
|
-
import { useChatHost } from '../../../host';
|
|
8
|
-
import type { Referable } from '
|
|
7
|
+
import { useChatHost } from '../../../host/host';
|
|
8
|
+
import type { Referable } from '../../../host/references';
|
|
9
9
|
import type { AccountSuggestion, ModelSuggestion } from '../../tag-suggestions';
|
|
10
10
|
import { ModelMarks } from '../ModelMarks';
|
|
11
11
|
import { referenceGlyph } from '../reference-icons';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Icon, Popover, Tooltip } from '@adecore/ui';
|
|
2
2
|
import clsx from 'clsx';
|
|
3
3
|
import { useTranslation } from 'react-i18next';
|
|
4
|
-
import type { ComposerStatusItem } from '../../../host';
|
|
4
|
+
import type { ComposerStatusItem } from '../../../host/host';
|
|
5
5
|
|
|
6
6
|
const ITEM = 'flex h-6 min-w-0 items-center gap-1.5 rounded-md text-xs text-text-muted';
|
|
7
7
|
|
|
@@ -18,7 +18,6 @@ interface DraftQuoteProps {
|
|
|
18
18
|
onSourceGone(): void;
|
|
19
19
|
}
|
|
20
20
|
|
|
21
|
-
/* The quote that goes above the message, as a blockquote. */
|
|
22
21
|
export function DraftQuote({ chatId, quote, source, onRemove, onSourceGone }: DraftQuoteProps) {
|
|
23
22
|
const { t } = useTranslation('agent-chat');
|
|
24
23
|
const scope = useChatScope();
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { EditorView } from '@codemirror/view';
|
|
2
|
-
import type { Referable } from '
|
|
2
|
+
import type { Referable } from '../../../host/references';
|
|
3
3
|
import type { ChatDraft } from '../../drafts';
|
|
4
4
|
import {
|
|
5
5
|
chipRanges,
|
|
@@ -41,7 +41,6 @@ export function pastedChipsIn(text: string, from: number, to: number, code: read
|
|
|
41
41
|
);
|
|
42
42
|
}
|
|
43
43
|
|
|
44
|
-
/* Whether a plain paste could make a chip at all, before it goes in as text. */
|
|
45
44
|
export function mayHoldChips(text: string): boolean {
|
|
46
45
|
return /(^|[\s([{"'“‘])[$#]\p{L}/u.test(text);
|
|
47
46
|
}
|
|
@@ -5,8 +5,8 @@ import { Decoration, EditorView, WidgetType, type DecorationSet } from '@codemir
|
|
|
5
5
|
import { createElement, Fragment, type ComponentType } from 'react';
|
|
6
6
|
import { createRoot, type Root } from 'react-dom/client';
|
|
7
7
|
import { CliMark } from '../../../agents/AgentModelLabel';
|
|
8
|
-
import type { ReferenceIconProps } from '../../../host';
|
|
9
|
-
import type { ReferableKind, ReferenceStep } from '
|
|
8
|
+
import type { ReferenceIconProps } from '../../../host/host';
|
|
9
|
+
import type { ReferableKind, ReferenceStep } from '../../../host/references';
|
|
10
10
|
import { chipRanges, withNamedChips, type ReferenceToken } from '../../mentions';
|
|
11
11
|
import { CHIP_IN_EDITOR, MENTION_TONE, REFERENCE_TONE, SKILL_TONE, TOKEN_ICON_IN_EDITOR } from '../chips';
|
|
12
12
|
import type { NamedChipLook, NamedChipLookup } from '../named-chip-look';
|
|
@@ -14,7 +14,7 @@ import { referenceGlyph } from '../reference-icons';
|
|
|
14
14
|
import { ReferenceTrail } from '../ReferenceTrail';
|
|
15
15
|
import { codeRanges } from './editor';
|
|
16
16
|
|
|
17
|
-
|
|
17
|
+
interface ChipChoices {
|
|
18
18
|
mentions: string[];
|
|
19
19
|
skills: string[];
|
|
20
20
|
/* Null for a kind the host no longer names, which draws the chip without its mark. */
|
|
@@ -36,7 +36,6 @@ const referenceMark = Decoration.mark({ class: `${REFERENCE_TONE} ${CHIP_IN_EDIT
|
|
|
36
36
|
|
|
37
37
|
const roots = new WeakMap<HTMLElement, Root>();
|
|
38
38
|
|
|
39
|
-
/* The reference's mark in place of the `#`, the way a sent message draws it. */
|
|
40
39
|
class ReferenceIcon extends WidgetType {
|
|
41
40
|
readonly id: string;
|
|
42
41
|
readonly kind: ReferableKind;
|
|
@@ -2,7 +2,7 @@ import { isModHeld, matchesShortcut } from '@adecore/ui';
|
|
|
2
2
|
import { indentLess, indentMore, insertNewline } from '@codemirror/commands';
|
|
3
3
|
import { ensureSyntaxTree, syntaxTree } from '@codemirror/language';
|
|
4
4
|
import type { EditorView } from '@codemirror/view';
|
|
5
|
-
import type { ChatHost } from '../../../host';
|
|
5
|
+
import type { ChatHost } from '../../../host/host';
|
|
6
6
|
import type { ComposerSend } from '../../composer-send';
|
|
7
7
|
import type { ChatSendKey } from '../../send-key';
|
|
8
8
|
import { STASH_SHORTCUT } from '../../stash';
|
|
@@ -106,7 +106,6 @@ export function pickInMenu(e: KeyboardEvent, menus: ComposerMenus): boolean {
|
|
|
106
106
|
return false;
|
|
107
107
|
}
|
|
108
108
|
|
|
109
|
-
/* Enter sends, adds a line, or carries a list on, by the send key and where the caret is. */
|
|
110
109
|
function enter(e: KeyboardEvent, view: EditorView, { host, sendKey, submit }: KeyHandlerInput): boolean {
|
|
111
110
|
const { state } = view;
|
|
112
111
|
const { from, to, head } = state.selection.main;
|
|
@@ -2,9 +2,9 @@ import type { SyntaxNode, Tree } from '@lezer/common';
|
|
|
2
2
|
import { modSends, type ChatSendKey } from '../../send-key';
|
|
3
3
|
|
|
4
4
|
/* `send-alternate` sends with the delivery a running turn does not get by default; `send-and-new` also opens a new chat once it went. */
|
|
5
|
-
|
|
5
|
+
type EnterAction = 'send' | 'send-alternate' | 'send-and-new' | 'newline' | 'continue-list' | 'leave-list';
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
interface EnterKeys {
|
|
8
8
|
shift: boolean;
|
|
9
9
|
/* Cmd on macOS, Ctrl elsewhere. */
|
|
10
10
|
mod: boolean;
|
|
@@ -25,7 +25,6 @@ export interface EnterContext {
|
|
|
25
25
|
inOpenFence: boolean;
|
|
26
26
|
/* The list item on the caret's line, or null outside a list and in code. */
|
|
27
27
|
list: ListItem | null;
|
|
28
|
-
/* The caret's offset in its line. */
|
|
29
28
|
column: number;
|
|
30
29
|
/* Which key sends; `enter` when left out. */
|
|
31
30
|
sendKey?: ChatSendKey;
|
|
@@ -37,7 +36,6 @@ export interface EnterContext {
|
|
|
37
36
|
|
|
38
37
|
const LIST_ITEM = /^([ \t]*)(?:([-*+])|(\d{1,9})([.)]))([ \t]+)(\[[ xX]\](?:[ \t]+|$))?/;
|
|
39
38
|
|
|
40
|
-
/* The list item a line starts, if it starts one. */
|
|
41
39
|
export function listItemAt(line: string): ListItem | null {
|
|
42
40
|
const match = LIST_ITEM.exec(line);
|
|
43
41
|
|
|
@@ -92,7 +90,6 @@ export function enterAction(
|
|
|
92
90
|
return modOnly ? 'newline' : 'send';
|
|
93
91
|
}
|
|
94
92
|
|
|
95
|
-
/* The innermost fenced code block around `pos`, if any. */
|
|
96
93
|
function enclosingFence(tree: Tree, pos: number): SyntaxNode | null {
|
|
97
94
|
for (let node: SyntaxNode | null = tree.resolveInner(pos, -1); node !== null; node = node.parent) {
|
|
98
95
|
if (node.name === 'FencedCode') {
|
|
@@ -108,7 +105,6 @@ function isOpenFence(fence: SyntaxNode): boolean {
|
|
|
108
105
|
return fence.getChildren('CodeMark').length < 2;
|
|
109
106
|
}
|
|
110
107
|
|
|
111
|
-
/* Whether `pos` sits inside a fenced code block that has an opening fence and no closing one yet. */
|
|
112
108
|
export function inOpenFence(tree: Tree, pos: number): boolean {
|
|
113
109
|
const fence = enclosingFence(tree, pos);
|
|
114
110
|
|
|
@@ -128,7 +124,6 @@ export function inFenceBody(tree: Tree, text: string, pos: number): boolean {
|
|
|
128
124
|
return openingEnd !== -1 && pos > openingEnd && (pos < fence.to || isOpenFence(fence));
|
|
129
125
|
}
|
|
130
126
|
|
|
131
|
-
/* The spaces Tab inserts at `column`, up to the next stop of four, the way a code editor lines up. */
|
|
132
127
|
export function tabSpaces(column: number): string {
|
|
133
128
|
return ' '.repeat(4 - (column % 4));
|
|
134
129
|
}
|
|
@@ -172,7 +167,7 @@ export function inCode(tree: Tree, text: string, pos: number): boolean {
|
|
|
172
167
|
return /(^|[^\\])`/.test(text.slice(from, pos));
|
|
173
168
|
}
|
|
174
169
|
|
|
175
|
-
|
|
170
|
+
interface RecallContext {
|
|
176
171
|
key: string;
|
|
177
172
|
text: string;
|
|
178
173
|
from: number;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { TFunction } from 'i18next';
|
|
2
2
|
import { useMemo } from 'react';
|
|
3
3
|
import { useTranslation } from 'react-i18next';
|
|
4
|
-
import { useHostComposerPlaceholder } from '../../../host-hooks';
|
|
4
|
+
import { useHostComposerPlaceholder } from '../../../host/host-hooks';
|
|
5
5
|
import { useChatScope } from '../../../scope';
|
|
6
6
|
|
|
7
7
|
interface PlaceholderHint {
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import type { ChatSendExtras } from '
|
|
2
|
-
import {
|
|
1
|
+
import type { ChatSendExtras } from '../../../chat-client';
|
|
2
|
+
import { type Referables } from '../../../host/references';
|
|
3
|
+
import { referenceTokens } from '../../chat-references';
|
|
3
4
|
import { presentMentions, presentReferences, presentSkills } from '../../mentions';
|
|
4
5
|
import type { PromptDraft } from './use-prompt-menus';
|
|
5
6
|
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import type { AgentKind, ChatInfo, ModelSelection, RuntimeMode } from '@adecore/agent-contracts';
|
|
2
2
|
import { useRef, useState } from 'react';
|
|
3
3
|
import { useTranslation } from 'react-i18next';
|
|
4
|
-
import { useChatHost } from '../../../host';
|
|
5
|
-
import { useHostCanReorderAccounts } from '../../../host-hooks';
|
|
4
|
+
import { useChatHost } from '../../../host/host';
|
|
5
|
+
import { useHostCanReorderAccounts } from '../../../host/host-hooks';
|
|
6
6
|
import { useChatScope } from '../../../scope';
|
|
7
7
|
import { errorCode } from '../../../transport';
|
|
8
8
|
import { useChatActions } from '../../actions';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { ChatInfo, ChatSkill, ProviderCapabilities } from '@adecore/agent-contracts';
|
|
2
2
|
import { useEffect, useState, type RefObject } from 'react';
|
|
3
3
|
import { useTranslation } from 'react-i18next';
|
|
4
|
-
import { useHostAccountRule, useHostReferables } from '../../../host-hooks';
|
|
4
|
+
import { useHostAccountRule, useHostReferables } from '../../../host/host-hooks';
|
|
5
5
|
import { useChatScope } from '../../../scope';
|
|
6
6
|
import type { ComposerInputHandle } from '../ComposerInput';
|
|
7
7
|
import type { ComposerDraft } from './use-composer-draft';
|
|
@@ -10,7 +10,7 @@ import { usePromptMenus, type PromptMenus } from './use-prompt-menus';
|
|
|
10
10
|
export type { ComposerCommand } from './use-prompt-menus';
|
|
11
11
|
|
|
12
12
|
// Commands the composer handles itself; the CLI's own ones are sent through as text.
|
|
13
|
-
|
|
13
|
+
const LOCAL_COMMANDS = ['model', 'compact', 'clear'];
|
|
14
14
|
|
|
15
15
|
interface MenusInput {
|
|
16
16
|
chatId: string;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { useEffect, useRef, type RefObject } from 'react';
|
|
2
2
|
import { useTranslation } from 'react-i18next';
|
|
3
|
-
import {
|
|
3
|
+
import type { ChatSendExtras } from '../../../chat-client';
|
|
4
|
+
import { useChatHost } from '../../../host/host';
|
|
4
5
|
import { useChatScope } from '../../../scope';
|
|
5
6
|
import { checkAttachmentLimits, uploadBytes } from '../../attachments';
|
|
6
|
-
import type { ChatSendExtras } from '../../chat-client';
|
|
7
7
|
import { registerComposerSender, type ComposerSend } from '../../composer-send';
|
|
8
8
|
import { isEmptyDraft } from '../../drafts';
|
|
9
9
|
import type { PromptGuard } from '../../guards';
|
|
@@ -2,7 +2,6 @@ import type { ChatInfo, ChatItem } from '@adecore/agent-contracts';
|
|
|
2
2
|
import { useChatRow } from '../../../state/chats';
|
|
3
3
|
import { continuableTurn } from '../../logic/continue-after-stop';
|
|
4
4
|
|
|
5
|
-
/* The turn a person stopped that Continue would pick up, or null when there is none. */
|
|
6
5
|
export function useContinuableTurn(chatId: string, info: ChatInfo): string | null {
|
|
7
6
|
const order = useChatRow(chatId, (row) => row?.order);
|
|
8
7
|
const structure = useChatRow(chatId, (row) => row?.structure);
|
|
@@ -2,9 +2,9 @@ import type { ProviderCapabilities } from '@adecore/agent-contracts';
|
|
|
2
2
|
import { EditorView } from '@codemirror/view';
|
|
3
3
|
import { useRef, useState, type DragEvent, type RefObject } from 'react';
|
|
4
4
|
import { useTranslation } from 'react-i18next';
|
|
5
|
-
import { useChatHost } from '../../../host';
|
|
5
|
+
import { useChatHost } from '../../../host/host';
|
|
6
|
+
import type { Referable } from '../../../host/references';
|
|
6
7
|
import { checkAttachmentLimits, filesOf, readAttachments, uploadBytes } from '../../attachments';
|
|
7
|
-
import type { Referable } from '../../chat-references';
|
|
8
8
|
import { pasteBecomesAttachment, pastedTextName } from '../../guards';
|
|
9
9
|
import { carriesMentions, droppedMentions, pastedMentions, readClipboardChips, type ReferenceToken } from '../../mentions';
|
|
10
10
|
import type { ComposerInputHandle } from '../ComposerInput';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { useEffect, useState } from 'react';
|
|
2
|
-
import type { PromptSubject } from '../../../prompts
|
|
2
|
+
import type { PromptSubject } from '../../../host/prompts';
|
|
3
3
|
import { useChatScope } from '../../../scope';
|
|
4
4
|
import { ChatPromptFeed } from '../../pending-prompts';
|
|
5
5
|
|
|
@@ -3,14 +3,14 @@ import { ensureSyntaxTree, syntaxTree } from '@codemirror/language';
|
|
|
3
3
|
import type { EditorState } from '@codemirror/state';
|
|
4
4
|
import { useEffect, useId, useState, type Dispatch, type RefObject, type SetStateAction } from 'react';
|
|
5
5
|
import { useTranslation } from 'react-i18next';
|
|
6
|
-
import type
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
6
|
+
import { useChatHost, type AccountRule } from '../../../host/host';
|
|
7
|
+
import { useHostExpandingCommands } from '../../../host/host-hooks';
|
|
8
|
+
import { type Referable, type Referables } from '../../../host/references';
|
|
9
9
|
import { useChatScope } from '../../../scope';
|
|
10
10
|
import { useReportedModelsByProvider } from '../../../state/chats';
|
|
11
11
|
import { useProviderAccounts } from '../../../state/provider-accounts';
|
|
12
12
|
import { useProviders } from '../../../state/providers';
|
|
13
|
-
import { referenceSuggestions, referenceTokens
|
|
13
|
+
import { referenceSuggestions, referenceTokens } from '../../chat-references';
|
|
14
14
|
import type { ChatDraft } from '../../drafts';
|
|
15
15
|
import { usableSlashCommands } from '../../guards';
|
|
16
16
|
import {
|
|
@@ -44,11 +44,9 @@ const SEARCH_DEBOUNCE_MS = 80;
|
|
|
44
44
|
const MENTION_RESULTS = 8;
|
|
45
45
|
const REFERENCE_RESULTS = 20;
|
|
46
46
|
|
|
47
|
-
/* The text of a prompt and what the person picked in it with `@`, `$` and `#`. */
|
|
48
|
-
|
|
49
47
|
export type PromptDraft = Pick<ChatDraft, 'text' | 'mentions' | 'skills' | 'chats' | 'references' | 'referenceNames'>;
|
|
50
48
|
|
|
51
|
-
|
|
49
|
+
interface PromptDraftBox<D extends PromptDraft> {
|
|
52
50
|
draft: D;
|
|
53
51
|
setDraft: Dispatch<SetStateAction<D>>;
|
|
54
52
|
/* The mentions and skills default to the draft's own as last rendered. */
|
|
@@ -63,13 +61,12 @@ export interface ComposerCommand {
|
|
|
63
61
|
skill: boolean;
|
|
64
62
|
}
|
|
65
63
|
|
|
66
|
-
|
|
64
|
+
interface PromptMenusInput<D extends PromptDraft> {
|
|
67
65
|
draft: PromptDraftBox<D>;
|
|
68
66
|
inputRef: RefObject<ComposerInputHandle | null>;
|
|
69
67
|
/* Where `@` searches for files; null offers none. */
|
|
70
68
|
cwd: string | null;
|
|
71
69
|
skills: readonly ChatSkill[];
|
|
72
|
-
/* What the CLI said it answers after `/`. */
|
|
73
70
|
slashCommands: readonly string[];
|
|
74
71
|
/* Commands the box runs itself, named in `composer.commands`; the rest go to the CLI as text. */
|
|
75
72
|
localCommands?: readonly string[];
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { ChatAttachmentUpload, ChatQueuedMessage } from '@adecore/agent-contracts';
|
|
2
2
|
import { useState } from 'react';
|
|
3
3
|
import { useTranslation } from 'react-i18next';
|
|
4
|
-
import { useChatHost } from '../../../host';
|
|
4
|
+
import { useChatHost } from '../../../host/host';
|
|
5
5
|
import { useChatScope } from '../../../scope';
|
|
6
6
|
import { errorCode, errorMessage } from '../../../transport';
|
|
7
7
|
import { useChatActions } from '../../actions';
|
|
@@ -13,11 +13,9 @@ interface TakeBackInput {
|
|
|
13
13
|
chatId: string;
|
|
14
14
|
draft: ComposerDraft;
|
|
15
15
|
setNotice(notice: string): void;
|
|
16
|
-
/* The message is back in the draft. */
|
|
17
16
|
onTaken(): void;
|
|
18
17
|
}
|
|
19
18
|
|
|
20
|
-
/* Takes a queued message out of the queue and back into the draft, to be edited before it goes. */
|
|
21
19
|
export function useTakeBack({ chatId, draft: { latest, setDraft }, setNotice, onTaken }: TakeBackInput) {
|
|
22
20
|
const { t } = useTranslation('agent-chat');
|
|
23
21
|
const host = useChatHost();
|
|
@@ -4,7 +4,7 @@ import { diffDocument, patchOf, type DiffDocument } from '@adecore/merge';
|
|
|
4
4
|
import { getFiletypeFromFileName } from '@pierre/diffs';
|
|
5
5
|
import { useEffect, useState, type ReactNode } from 'react';
|
|
6
6
|
import { useTranslation } from 'react-i18next';
|
|
7
|
-
import { useHostCodeMode, useHostCodeThemes } from '../../../host-hooks';
|
|
7
|
+
import { useHostCodeMode, useHostCodeThemes } from '../../../host/host-hooks';
|
|
8
8
|
import { diffTexts, type FileChange } from '../../logic/tools';
|
|
9
9
|
import { useDiffSourceTokens } from '../use-diff-source-tokens';
|
|
10
10
|
import { diffSourceBudget } from './diff-source-budget';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { useWorkerPool } from '@pierre/diffs/react';
|
|
2
2
|
import type { ReactNode } from 'react';
|
|
3
|
-
import { useChatHost } from '../../../host';
|
|
3
|
+
import { useChatHost } from '../../../host/host';
|
|
4
4
|
import DiffPool from '../DiffPool';
|
|
5
5
|
|
|
6
6
|
export function LegacyDiffPool({ children }: { children: ReactNode }) {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ScrollArea } from '@adecore/ui';
|
|
2
2
|
import { MultiFileDiff } from '@pierre/diffs/react';
|
|
3
|
-
import { useHostCodeMode } from '../../../host-hooks';
|
|
3
|
+
import { useHostCodeMode } from '../../../host/host-hooks';
|
|
4
4
|
import { diffTexts, type FileChange } from '../../logic/tools';
|
|
5
5
|
import { useDiffTheme } from '../diff-theme';
|
|
6
6
|
import { LegacyDiffPool } from './LegacyDiffPool';
|
|
@@ -2,7 +2,7 @@ import type { ChatFileChange } from '@adecore/agent-contracts';
|
|
|
2
2
|
import { ScrollArea } from '@adecore/ui';
|
|
3
3
|
import { FileDiff, PatchDiff } from '@pierre/diffs/react';
|
|
4
4
|
import clsx from 'clsx';
|
|
5
|
-
import { useHostCodeMode } from '../../../host-hooks';
|
|
5
|
+
import { useHostCodeMode } from '../../../host/host-hooks';
|
|
6
6
|
import { useDiffTheme } from '../diff-theme';
|
|
7
7
|
import { fullFileDiff } from '../full-diff';
|
|
8
8
|
import type { UnifiedDiffProps } from './diff-props';
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import { LazyBoundary } from '@adecore/ui';
|
|
1
|
+
import { LazyBoundary, lazyNamed } from '@adecore/ui';
|
|
2
2
|
import { useTranslation } from 'react-i18next';
|
|
3
|
-
import { lazyNamed } from '../../../lazy';
|
|
4
3
|
import type { ReviewEntry } from './review-plan';
|
|
5
4
|
|
|
6
5
|
const EditDiff = lazyNamed(() => import('../EditDiff'), 'default');
|
|
@@ -9,7 +9,7 @@ const SOURCE_BUDGET: TextBudget = { rows: 20000, characters: 2000000, lineLength
|
|
|
9
9
|
const PATCH_BUDGET: TextBudget = { rows: 50000, characters: 4000000, lineLength: 1000001 };
|
|
10
10
|
const LEGACY_BUDGET: TextBudget = { rows: 400, characters: 100000, lineLength: 10000 };
|
|
11
11
|
|
|
12
|
-
|
|
12
|
+
function textFitsBudget(text: string, budget: TextBudget): boolean {
|
|
13
13
|
if (text.length > budget.characters) {
|
|
14
14
|
return false;
|
|
15
15
|
}
|
|
@@ -10,13 +10,13 @@ export interface ReviewEntry {
|
|
|
10
10
|
| { readonly kind: 'patch'; readonly patch: ChatFileChange; readonly contents?: DiffContents };
|
|
11
11
|
}
|
|
12
12
|
|
|
13
|
-
|
|
13
|
+
interface ReviewBudget {
|
|
14
14
|
readonly editors: number;
|
|
15
15
|
readonly rows: number;
|
|
16
16
|
readonly characters: number;
|
|
17
17
|
}
|
|
18
18
|
|
|
19
|
-
|
|
19
|
+
const REVIEW_BUDGET: ReviewBudget = { editors: 3, rows: 2000, characters: 2000000 };
|
|
20
20
|
|
|
21
21
|
export type ReviewSlot = 'editor' | 'deferred';
|
|
22
22
|
|
|
@@ -7,7 +7,7 @@ import {
|
|
|
7
7
|
type DiffSyntaxTokens
|
|
8
8
|
} from '@adecore/editor/shiki-worker';
|
|
9
9
|
import type { Highlighter, ThemeRegistration } from 'shiki';
|
|
10
|
-
import type { ChatHost } from '../../../host';
|
|
10
|
+
import type { ChatHost } from '../../../host/host';
|
|
11
11
|
|
|
12
12
|
interface Pending {
|
|
13
13
|
promise: Promise<DiffSyntaxTokens | null>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { registerCustomTheme, type ThemesType } from '@pierre/diffs';
|
|
2
|
-
import { useChatHost, type ChatHost } from '../../host';
|
|
3
|
-
import { useHostCodeThemes } from '../../host-hooks';
|
|
2
|
+
import { useChatHost, type ChatHost } from '../../host/host';
|
|
3
|
+
import { useHostCodeThemes } from '../../host/host-hooks';
|
|
4
4
|
|
|
5
5
|
// The library's registry is global and refuses a name twice, so what is registered is kept by name.
|
|
6
6
|
const registered = new Set<string>();
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { createContext, useContext } from 'react';
|
|
2
|
-
import { useChatHost, type FileRef } from '../../host';
|
|
2
|
+
import { useChatHost, type FileRef } from '../../host/host';
|
|
3
3
|
import { ChatScopeContext } from '../../scope';
|
|
4
4
|
|
|
5
5
|
/*
|
|
@@ -26,7 +26,6 @@ export function useFileLinkTarget(text: string): FileRef | null {
|
|
|
26
26
|
return fileLinks?.target(text, cwd, scopeId) ?? null;
|
|
27
27
|
}
|
|
28
28
|
|
|
29
|
-
/* Follows a reference the way the app opens a file or a folder. */
|
|
30
29
|
export function useOpenFileLink(): (cwd: string | null, ref: FileRef, scopeId?: string | null) => void {
|
|
31
30
|
const { fileLinks } = useChatHost();
|
|
32
31
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { CSSProperties } from 'react';
|
|
2
2
|
import type { BundledLanguage, BundledTheme, Highlighter, ThemeRegistration } from 'shiki';
|
|
3
|
-
import { useChatHost, type ChatHost } from '../../host';
|
|
3
|
+
import { useChatHost, type ChatHost } from '../../host/host';
|
|
4
4
|
import { TokenCache, type CodeToken, type Tokenize } from './code-lines';
|
|
5
5
|
import { shikiThemeOf } from './code-theme';
|
|
6
6
|
|
|
@@ -166,7 +166,6 @@ export function codeHighlighter(source?: () => Promise<Highlighter>): CodeHighli
|
|
|
166
166
|
return highlighter;
|
|
167
167
|
}
|
|
168
168
|
|
|
169
|
-
/* The code highlighter of the host this is rendered under. */
|
|
170
169
|
export function useCodeHighlighter(): CodeHighlighter {
|
|
171
170
|
return codeHighlighter(useChatHost().code.highlighter);
|
|
172
171
|
}
|