@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
|
@@ -121,7 +121,7 @@ export function workflowCounts(phases: WorkflowPhaseView[]): WorkflowCounts {
|
|
|
121
121
|
/* `running` while an agent of it is at work, `waiting` before any started, and once none can move again `failed` when one did not finish. */
|
|
122
122
|
export type WorkflowPhaseStateKind = 'running' | 'waiting' | 'done' | 'failed';
|
|
123
123
|
|
|
124
|
-
|
|
124
|
+
interface WorkflowPhaseState {
|
|
125
125
|
state: WorkflowPhaseStateKind;
|
|
126
126
|
/* The agents of the phase that are no longer at work or waiting, of all it started so far. */
|
|
127
127
|
settled: number;
|
|
@@ -146,7 +146,7 @@ export function workflowPhaseState(phase: WorkflowPhaseView): WorkflowPhaseState
|
|
|
146
146
|
return { state: phase.agents.every((view) => view.state === 'done') ? 'done' : 'failed', settled, total };
|
|
147
147
|
}
|
|
148
148
|
|
|
149
|
-
|
|
149
|
+
interface WorkflowPhaseTime {
|
|
150
150
|
startedAt: number;
|
|
151
151
|
/* Null while an agent of it is still at work, so the time counts on from `startedAt`. */
|
|
152
152
|
endedAt: number | null;
|
|
@@ -200,7 +200,6 @@ export function liveWorkflowPhase(phases: WorkflowPhaseView[], workflowRunning:
|
|
|
200
200
|
const META_START = /export\s+const\s+meta\s*=\s*\{/;
|
|
201
201
|
const DESCRIPTION = /\bdescription\s*:\s*(['"`])((?:\\.|(?!\1)[^\\])*)\1/;
|
|
202
202
|
|
|
203
|
-
/* The literal from its opening brace to the one that closes it, skipping braces inside strings. */
|
|
204
203
|
function metaLiteral(script: string): string | null {
|
|
205
204
|
const start = META_START.exec(script);
|
|
206
205
|
|
package/src/chat/mentions.ts
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
*/
|
|
5
5
|
export const MENTION_DRAG_TYPE = 'application/x-adecore-mention';
|
|
6
6
|
export const LEGACY_MENTION_DRAG_TYPE = 'application/x-ruimte-mention';
|
|
7
|
-
|
|
7
|
+
const MENTION_DRAG_TYPES = [MENTION_DRAG_TYPE, LEGACY_MENTION_DRAG_TYPE] as const;
|
|
8
8
|
|
|
9
9
|
export function carriesMentions(types: readonly string[]): boolean {
|
|
10
10
|
return MENTION_DRAG_TYPES.some((type) => types.includes(type));
|
|
@@ -102,7 +102,6 @@ export function readClipboardChips(data: Pick<DataTransfer, 'getData'>): Clipboa
|
|
|
102
102
|
}
|
|
103
103
|
|
|
104
104
|
export interface MentionQuery {
|
|
105
|
-
// Index of the sigil in the text.
|
|
106
105
|
start: number;
|
|
107
106
|
query: string;
|
|
108
107
|
}
|
|
@@ -190,7 +189,6 @@ export function findReferenceQuery(text: string, caret: number): MentionQuery |
|
|
|
190
189
|
return found === null || (found.query !== '' && !/^\p{L}/u.test(found.query)) ? null : found;
|
|
191
190
|
}
|
|
192
191
|
|
|
193
|
-
/* Replaces the `<sigil>query` under the caret with the chosen token and a space, and says where the caret goes. */
|
|
194
192
|
export function insertToken(text: string, query: MentionQuery, sigil: string, value: string): { text: string; caret: number } {
|
|
195
193
|
const end = query.start + 1 + query.query.length;
|
|
196
194
|
const token = `${sigil}${value} `;
|
|
@@ -225,7 +223,7 @@ export interface NamedPick {
|
|
|
225
223
|
id: string;
|
|
226
224
|
}
|
|
227
225
|
|
|
228
|
-
|
|
226
|
+
type MentionPick = { kind: 'file'; path: string } | NamedPick;
|
|
229
227
|
|
|
230
228
|
/*
|
|
231
229
|
* What Enter or Tab takes from the `@` list at `index`: `named` first, then the files. Those answer the
|
|
@@ -331,7 +329,7 @@ export interface TextRange {
|
|
|
331
329
|
}
|
|
332
330
|
|
|
333
331
|
/* `value` is the path, the skill's name, a reference's id or a model's or account's `<cli>/<id>`; the range spans the name. */
|
|
334
|
-
|
|
332
|
+
interface ChipRange extends TextRange {
|
|
335
333
|
kind: 'mention' | 'skill' | 'reference' | NamedChipKind;
|
|
336
334
|
value: string;
|
|
337
335
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { CHAT_REQUEST_LIMITS, type ChatInfo } from '@adecore/agent-contracts';
|
|
2
|
-
import type { PendingPrompt } from '../
|
|
3
|
-
import type { PromptSubject } from '../prompts
|
|
2
|
+
import type { PendingPrompt } from '../host/prompts';
|
|
3
|
+
import type { PromptSubject } from '../host/prompts';
|
|
4
4
|
import type { ChatScope } from '../scope';
|
|
5
5
|
import { useChats, waitingRequestsOf } from '../state/chats';
|
|
6
6
|
import { subagentTitle } from './subagent-list';
|
package/src/chat/preferences.ts
CHANGED
|
@@ -7,8 +7,8 @@ import {
|
|
|
7
7
|
type ProviderAccounts,
|
|
8
8
|
type RuntimeMode
|
|
9
9
|
} from '@adecore/agent-contracts';
|
|
10
|
+
import { persistedJson } from '../persisted-json';
|
|
10
11
|
import { chatStorageKey, chatStorageLegacyKeys, createChatStore, onChatStorageConfiguration } from '../storage';
|
|
11
|
-
import { persistedJson } from './persisted-json';
|
|
12
12
|
import { DEFAULT_READING_WIDTH, isChatReadingWidth, type ChatReadingWidth } from './reading-width';
|
|
13
13
|
import { DEFAULT_SEND_KEY, isChatSendKey, type ChatSendKey } from './send-key';
|
|
14
14
|
|
|
@@ -266,7 +266,6 @@ export function toggleFavoriteModel(provider: AgentKind, slug: string): void {
|
|
|
266
266
|
store(withFavoriteToggled(useChatPreferences.getState(), provider, slug));
|
|
267
267
|
}
|
|
268
268
|
|
|
269
|
-
/* Back to the CLI's own default for this provider; the other providers keep what they had. */
|
|
270
269
|
export function forgetChatSelection(provider: AgentKind): void {
|
|
271
270
|
const current = useChatPreferences.getState();
|
|
272
271
|
const { [provider]: _dropped, ...rest } = current.selectionByProvider;
|
package/src/chat/prompt-hold.ts
CHANGED
|
@@ -10,7 +10,6 @@ export interface HoldInput {
|
|
|
10
10
|
|
|
11
11
|
export type HoldRelease = 'pause' | 'send' | 'blur' | 'show';
|
|
12
12
|
|
|
13
|
-
/* A card waits while the person is composing, or typed less than the pause ago. */
|
|
14
13
|
export function holdsPrompt(input: HoldInput, now: number): boolean {
|
|
15
14
|
if (input.composing) {
|
|
16
15
|
return true;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
// Public API: exports.test.ts snapshots this list, so a name added or dropped here is an API change.
|
|
2
|
+
export { focusPromptStart } from './logic/focus';
|
|
3
|
+
export { PROMPT_SHORTCUTS, pageKey } from './logic/keys';
|
|
4
|
+
export { emptyPromptDraft, orderPrompts } from './logic/prompts';
|
|
5
|
+
export { type PendingPrompt, type PromptAction, type PromptDraft } from '../../host/prompts';
|
|
6
|
+
|
|
7
|
+
export { type ChatPromptClients, type ApprovalButtonSpec, promptIdOf, promptCreatedAt, isBlockingSubject, answerPrompt } from './logic/subjects';
|
|
8
|
+
export { type HostPrompt, type PromptSubject, type PromptViewProps } from '../../host/prompts';
|
|
9
|
+
|
|
10
|
+
export { useFocusAfterAnswer } from './logic/useFocusAfterAnswer';
|
|
11
|
+
export { usePromptSession } from './logic/usePromptSession';
|
|
12
|
+
export { PromptPrimary, ApprovalActions } from './ui/PromptActions';
|
|
13
|
+
export { PROMPT_SURFACE, PromptCard } from './ui/PromptCard';
|
|
14
|
+
export { PromptView } from './ui/PromptView';
|
|
@@ -12,11 +12,11 @@ export const PROMPT_SHORTCUTS = {
|
|
|
12
12
|
|
|
13
13
|
export type PromptKeyEvent = KeyLike & { isComposing: boolean };
|
|
14
14
|
|
|
15
|
-
|
|
15
|
+
type ListStep = 'previous' | 'next' | 'first' | 'last';
|
|
16
16
|
|
|
17
|
-
|
|
17
|
+
type ChoiceKeyAction = { kind: 'move'; to: ListStep } | { kind: 'pick' } | { kind: 'pick-and-commit' } | { kind: 'commit' };
|
|
18
18
|
|
|
19
|
-
|
|
19
|
+
type AnswerFieldKeyAction = { kind: 'to-last-choice' } | { kind: 'commit' } | { kind: 'ignore' };
|
|
20
20
|
|
|
21
21
|
function isPlain(event: PromptKeyEvent): boolean {
|
|
22
22
|
return !event.ctrlKey && !event.metaKey && !event.altKey && !event.shiftKey && !event.isComposing;
|
|
@@ -1,27 +1,6 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
export type PendingPrompt = ChatApprovalItem | ChatQuestionItem;
|
|
5
|
-
|
|
6
|
-
export type PromptAction =
|
|
7
|
-
| { kind: 'approve'; decision: 'allow' | 'allow-always' | 'deny'; message?: string }
|
|
8
|
-
| { kind: 'answer'; answers: Record<string, string> }
|
|
9
|
-
| { kind: 'dismiss' }
|
|
10
|
-
// A terminal's permission request, answered with one of the choices the host offered.
|
|
11
|
-
| { kind: 'choose'; choiceId: string };
|
|
12
|
-
|
|
13
|
-
export interface PromptAnswer {
|
|
14
|
-
choices: string[];
|
|
15
|
-
text: string;
|
|
16
|
-
custom: boolean;
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
export interface PromptDraft {
|
|
20
|
-
index: number;
|
|
21
|
-
answers: Record<string, PromptAnswer>;
|
|
22
|
-
reason: string;
|
|
23
|
-
showReason: boolean;
|
|
24
|
-
}
|
|
1
|
+
import type { ChatQuestion, ChatQuestionItem } from '@adecore/agent-contracts';
|
|
2
|
+
import type { PendingPrompt, PromptAnswer, PromptDraft } from '../../../host/prompts';
|
|
3
|
+
import { toggleChoice } from '../../logic/answers';
|
|
25
4
|
|
|
26
5
|
export function emptyPromptDraft(): PromptDraft {
|
|
27
6
|
return { index: 0, answers: {}, reason: '', showReason: false };
|
|
@@ -1,29 +1,7 @@
|
|
|
1
|
-
import type { AgentKind } from '@adecore/agent-contracts';
|
|
2
1
|
import i18next from 'i18next';
|
|
3
|
-
import type {
|
|
4
|
-
import type {
|
|
5
|
-
import { isBlockingPrompt
|
|
6
|
-
|
|
7
|
-
/*
|
|
8
|
-
* A prompt the app raises beside a chat's own requests, such as its own approval to operate
|
|
9
|
-
* something. The app draws it and answers it (`ChatHost.prompts`); the chat only orders it among the
|
|
10
|
-
* rest and keeps its draft.
|
|
11
|
-
*/
|
|
12
|
-
export interface HostPrompt {
|
|
13
|
-
/* Unique across the prompts of a view, and stable while the prompt waits. */
|
|
14
|
-
id: string;
|
|
15
|
-
createdAt: number;
|
|
16
|
-
blocking: boolean;
|
|
17
|
-
/* The mark a pointer to it wears: a hand for a request, a question mark for anything else. */
|
|
18
|
-
asks: 'approval' | 'question';
|
|
19
|
-
/* What the app knows about it, for its own drawing and answering; the same object while nothing about it changed. */
|
|
20
|
-
data: unknown;
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
/* What a prompt card draws, whatever asked it. The chat's items pass through unchanged. */
|
|
24
|
-
export type PromptSubject =
|
|
25
|
-
| { kind: 'chat'; nodeId: string; item: PendingPrompt; source?: { label: string; provider?: AgentKind } }
|
|
26
|
-
| { kind: 'host'; nodeId: string; prompt: HostPrompt };
|
|
2
|
+
import type { ChatHost } from '../../../host/host';
|
|
3
|
+
import type { PromptAction, PromptSubject } from '../../../host/prompts';
|
|
4
|
+
import { isBlockingPrompt } from './prompts';
|
|
27
5
|
|
|
28
6
|
/* The requests a chat's own prompts are answered with. */
|
|
29
7
|
export interface ChatPromptClients {
|
|
@@ -32,23 +10,6 @@ export interface ChatPromptClients {
|
|
|
32
10
|
dismiss(chatId: string, itemId: string): Promise<void>;
|
|
33
11
|
}
|
|
34
12
|
|
|
35
|
-
/* What a card is given to draw, the chat's and the app's alike. */
|
|
36
|
-
export interface PromptViewProps {
|
|
37
|
-
subject: PromptSubject;
|
|
38
|
-
draft: PromptDraft;
|
|
39
|
-
onDraft(draft: PromptDraft): void;
|
|
40
|
-
onAction(action: PromptAction): void;
|
|
41
|
-
more: number;
|
|
42
|
-
hasDraft: boolean;
|
|
43
|
-
denyReason: boolean;
|
|
44
|
-
disabled: boolean;
|
|
45
|
-
sending: boolean;
|
|
46
|
-
error: string | null;
|
|
47
|
-
top?: ReactNode;
|
|
48
|
-
/* Takes the person to whatever an app's own card is about. */
|
|
49
|
-
onReveal?: () => void;
|
|
50
|
-
}
|
|
51
|
-
|
|
52
13
|
export interface ApprovalButtonSpec {
|
|
53
14
|
id: string;
|
|
54
15
|
label: string;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { useEffect, useRef, type RefObject } from 'react';
|
|
2
2
|
import { focusPromptStart } from './focus';
|
|
3
3
|
|
|
4
|
-
|
|
4
|
+
interface FocusAfterAnswer {
|
|
5
5
|
/* Called before the front card changes, to remember whether the keyboard is in it, since the card is gone by the time the next one shows. */
|
|
6
6
|
hold(): void;
|
|
7
7
|
/* The card stays after all, as when its answer failed. */
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { useRef, useState, type MouseEvent } from 'react';
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
2
|
+
import { type PromptDraft } from '../../../host/prompts';
|
|
3
|
+
import { errorMessage } from '../../../transport';
|
|
4
|
+
import { emptyPromptDraft } from './prompts';
|
|
4
5
|
|
|
5
6
|
interface PromptSessionOptions<T> {
|
|
6
7
|
prompts: readonly T[];
|
|
@@ -10,10 +11,9 @@ interface PromptSessionOptions<T> {
|
|
|
10
11
|
disabled: boolean;
|
|
11
12
|
}
|
|
12
13
|
|
|
13
|
-
|
|
14
|
+
interface PromptSession<T> {
|
|
14
15
|
active: T | null;
|
|
15
16
|
activeId: string | null;
|
|
16
|
-
/* Where the active prompt stands among the waiting ones. */
|
|
17
17
|
index: number;
|
|
18
18
|
/* The prompts not answered yet from this card, in the order they came in. */
|
|
19
19
|
waiting: readonly T[];
|
|
@@ -3,15 +3,14 @@ import { Button, ScrollArea, TextMenu } from '@adecore/ui';
|
|
|
3
3
|
import clsx from 'clsx';
|
|
4
4
|
import { useState } from 'react';
|
|
5
5
|
import { useTranslation } from 'react-i18next';
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
6
|
+
import { useChatHost } from '../../../host/host';
|
|
7
|
+
import type { PromptDraft } from '../../../host/prompts';
|
|
8
|
+
import { approvalChanges, fileChanges } from '../../logic/tools';
|
|
9
|
+
import { ApprovalReview } from '../../ui/diff/ApprovalReview';
|
|
10
|
+
import { reviewEntries } from '../../ui/diff/review-plan';
|
|
10
11
|
import { isPrimaryKey } from '../logic/keys';
|
|
11
|
-
import type { PromptDraft } from '../logic/prompts';
|
|
12
12
|
|
|
13
|
-
|
|
14
|
-
export function CommandBox({ command, cwd }: { command: string; cwd?: string }) {
|
|
13
|
+
function CommandBox({ command, cwd }: { command: string; cwd?: string }) {
|
|
15
14
|
return (
|
|
16
15
|
<TextMenu className="rounded-xl bg-surface-sunken p-3">
|
|
17
16
|
{cwd !== undefined && <p className="mb-2 break-all font-mono text-xs text-text-muted select-text">{cwd}</p>}
|
|
@@ -8,7 +8,7 @@ export function PromptPrimary(props: ButtonHTMLAttributes<HTMLButtonElement>) {
|
|
|
8
8
|
return <Button variant="inverse" size="sm" data-prompt-primary {...props} />;
|
|
9
9
|
}
|
|
10
10
|
|
|
11
|
-
|
|
11
|
+
interface ApprovalButton {
|
|
12
12
|
id: string;
|
|
13
13
|
label: string;
|
|
14
14
|
description?: string;
|
|
@@ -65,7 +65,6 @@ export function ApprovalActions({
|
|
|
65
65
|
);
|
|
66
66
|
}
|
|
67
67
|
|
|
68
|
-
/* The buttons of a question: back through its questions, dismissing an optional one, and Next until the last becomes Answer. */
|
|
69
68
|
export function QuestionActions({
|
|
70
69
|
index,
|
|
71
70
|
dismissable,
|
|
@@ -2,14 +2,14 @@ import { Icon, ScrollArea } from '@adecore/ui';
|
|
|
2
2
|
import { Hand, MessageCircleQuestionMark, type LucideIcon } from 'lucide-react';
|
|
3
3
|
import type { KeyboardEvent, ReactNode } from 'react';
|
|
4
4
|
import { useTranslation } from 'react-i18next';
|
|
5
|
-
import { useChatHost } from '
|
|
5
|
+
import { useChatHost } from '../../../host/host';
|
|
6
6
|
import { headingKey, isPrimaryKey, staysInCard, stepIndex, toolbarKey } from '../logic/keys';
|
|
7
7
|
|
|
8
8
|
/* The raised glass a chat's composer is made of, for a card that stands on its own over a canvas. */
|
|
9
9
|
export const PROMPT_SURFACE =
|
|
10
10
|
'flex flex-col overflow-hidden rounded-2xl border border-border bg-[color-mix(in_srgb,var(--surface-raised)_92%,transparent)] shadow-float backdrop-blur-[14px]';
|
|
11
11
|
|
|
12
|
-
|
|
12
|
+
type PromptCardKind = 'approval' | 'question' | 'waiting';
|
|
13
13
|
|
|
14
14
|
const ICONS: Record<PromptCardKind, LucideIcon> = { approval: Hand, question: MessageCircleQuestionMark, waiting: MessageCircleQuestionMark };
|
|
15
15
|
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import { Pill } from '@adecore/ui';
|
|
2
2
|
import { useTranslation } from 'react-i18next';
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
3
|
+
import { useChatHost } from '../../../host/host';
|
|
4
|
+
import { type PromptDraft } from '../../../host/prompts';
|
|
5
|
+
import { type PromptViewProps } from '../../../host/prompts';
|
|
6
|
+
import { toolSummary } from '../../logic/tools';
|
|
7
|
+
import { answerValue, promptAnswers, questionAnswer } from '../logic/prompts';
|
|
8
|
+
import { approvalButtons } from '../logic/subjects';
|
|
7
9
|
import { ApprovalBody } from './ApprovalBody';
|
|
8
10
|
import { ApprovalActions, QuestionActions } from './PromptActions';
|
|
9
11
|
import { PromptCard } from './PromptCard';
|
|
@@ -4,11 +4,11 @@ import clsx from 'clsx';
|
|
|
4
4
|
import { Circle, CircleCheck, Square } from 'lucide-react';
|
|
5
5
|
import { useEffect, useRef, type KeyboardEvent } from 'react';
|
|
6
6
|
import { useTranslation } from 'react-i18next';
|
|
7
|
-
import { useChatHost } from '
|
|
7
|
+
import { useChatHost } from '../../../host/host';
|
|
8
|
+
import { type PromptAnswer } from '../../../host/prompts';
|
|
8
9
|
import { answerFieldKey, choiceKey, stepIndex } from '../logic/keys';
|
|
9
|
-
import { pickPromptChoice
|
|
10
|
+
import { pickPromptChoice } from '../logic/prompts';
|
|
10
11
|
|
|
11
|
-
/* One question of a request: its choices, "Something else…", or a written answer when it offers no choices. */
|
|
12
12
|
export function QuestionBody({
|
|
13
13
|
question,
|
|
14
14
|
answer,
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { REPLY_COLUMN_WIDTH } from '@adecore/agent-contracts';
|
|
1
2
|
import i18next from 'i18next';
|
|
2
3
|
import type { CSSProperties } from 'react';
|
|
3
4
|
|
|
@@ -11,7 +12,7 @@ export const DEFAULT_READING_WIDTH: ChatReadingWidth = 'comfortable';
|
|
|
11
12
|
// About 75 and 90 characters of the thread's text a line.
|
|
12
13
|
const MEASURES: Readonly<Record<ChatReadingWidth, number>> = {
|
|
13
14
|
narrow: 640,
|
|
14
|
-
comfortable:
|
|
15
|
+
comfortable: REPLY_COLUMN_WIDTH,
|
|
15
16
|
full: Number.POSITIVE_INFINITY
|
|
16
17
|
};
|
|
17
18
|
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import type { ChatItem } from '@adecore/agent-contracts';
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
interface RecentChatMessage {
|
|
4
4
|
role: 'user' | 'assistant';
|
|
5
5
|
text: string;
|
|
6
6
|
createdAt: number;
|
|
7
7
|
}
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
interface RecentChatMessages {
|
|
10
10
|
messages: RecentChatMessage[];
|
|
11
11
|
truncated: boolean;
|
|
12
12
|
}
|
|
@@ -25,7 +25,7 @@ function isMessage(item: ChatItem | undefined): item is MessageItem {
|
|
|
25
25
|
}
|
|
26
26
|
|
|
27
27
|
/* The last messages of a conversation already cut down to the ones worth reading, clipped to what a reader can take in. */
|
|
28
|
-
|
|
28
|
+
function recentMessages(eligible: readonly MessageItem[], limit: number): RecentChatMessages {
|
|
29
29
|
const candidates = eligible.slice(-limit);
|
|
30
30
|
const messages: RecentChatMessage[] = [];
|
|
31
31
|
let characters = 0;
|
package/src/chat/send-key.ts
CHANGED
|
@@ -23,7 +23,6 @@ export function modSends(sendKey: ChatSendKey, multiline: boolean): boolean {
|
|
|
23
23
|
return sendKey === 'mod-enter' || (sendKey === 'mod-enter-multiline' && multiline);
|
|
24
24
|
}
|
|
25
25
|
|
|
26
|
-
/* The key that sends a message, as a hint prints it. */
|
|
27
26
|
export function sendShortcut(sendKey: ChatSendKey, multiline: boolean): Shortcut {
|
|
28
27
|
return modSends(sendKey, multiline) ? KEY_SHORTCUTS.modEnter : KEY_SHORTCUTS.enter;
|
|
29
28
|
}
|
package/src/chat/stash.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { shortcut } from '@adecore/ui';
|
|
2
2
|
import { isRecord } from '@adecore/utils/record';
|
|
3
|
+
import { persistedJson } from '../persisted-json';
|
|
3
4
|
import { chatStorageKey, chatStorageLegacyKeys, createChatStore } from '../storage';
|
|
4
5
|
import { uploadBytes } from './attachments';
|
|
5
6
|
import { isEmptyDraft, type ChatDraft } from './drafts';
|
|
6
|
-
import { persistedJson } from './persisted-json';
|
|
7
7
|
import { withQuote } from './quote';
|
|
8
8
|
|
|
9
9
|
/* Puts the draft away, or takes the last one back on an empty box. */
|
|
@@ -15,7 +15,7 @@ const storageKey = (): string => chatStorageKey('stash');
|
|
|
15
15
|
export const STASH_LIMIT = 20;
|
|
16
16
|
|
|
17
17
|
/* What was attached when the prompt was put away. The bytes are not kept, only what they were. */
|
|
18
|
-
|
|
18
|
+
interface StashedAttachment {
|
|
19
19
|
name: string;
|
|
20
20
|
mime: string;
|
|
21
21
|
size: number;
|
|
@@ -36,7 +36,7 @@ export interface StashedPrompt {
|
|
|
36
36
|
references: string[];
|
|
37
37
|
}
|
|
38
38
|
|
|
39
|
-
|
|
39
|
+
interface StashedQuote {
|
|
40
40
|
text: string;
|
|
41
41
|
chatId: string;
|
|
42
42
|
itemId: string;
|
|
@@ -4,7 +4,7 @@ import { isWaiting } from '../state/chats';
|
|
|
4
4
|
import { errorCode, isConnectionError, type ChatTransport } from '../transport';
|
|
5
5
|
|
|
6
6
|
// What the panel opens on: the newest end of the conversation, which is where an agent that works is.
|
|
7
|
-
|
|
7
|
+
const SUBAGENT_PAGE = 60;
|
|
8
8
|
|
|
9
9
|
export interface SubagentConversationState {
|
|
10
10
|
status: 'loading' | 'ready' | 'failed';
|
|
@@ -1,18 +1,13 @@
|
|
|
1
|
-
import { activeSubagents, type ChatInfo, type ChatItem, type ChatSubagentItem } from '@adecore/agent-contracts';
|
|
1
|
+
import { activeSubagents, HOST_TASK_ORIGIN, type ChatInfo, type ChatItem, type ChatSubagentItem } from '@adecore/agent-contracts';
|
|
2
2
|
import { formatMoment, formatElapsedShort } from '@adecore/ui/format';
|
|
3
3
|
import i18next from 'i18next';
|
|
4
4
|
import type { StatusWord } from '../agents/status-look';
|
|
5
|
-
import type { SubagentTask } from '../host';
|
|
5
|
+
import type { SubagentTask } from '../host/host';
|
|
6
6
|
|
|
7
7
|
export function subagentTitle(item: ChatSubagentItem): string {
|
|
8
8
|
return item.description || item.summary || item.subagentType || i18next.t('agent-chat:rows.subagent.label');
|
|
9
9
|
}
|
|
10
10
|
|
|
11
|
-
/* The task a row stands for, whose id the host wrote into the row's own. */
|
|
12
|
-
export function taskIdOf(item: ChatSubagentItem): string | null {
|
|
13
|
-
return item.origin === 'ruimte' && item.id.startsWith('task-') ? item.id.slice(5) : null;
|
|
14
|
-
}
|
|
15
|
-
|
|
16
11
|
/* A cancelled task is a failed row on the wire and a paused one a running row, and only the task itself still says which it is. */
|
|
17
12
|
export function statusWordOf(item: ChatSubagentItem, task: SubagentTask | null): StatusWord {
|
|
18
13
|
if (item.status === 'failed' && task?.status === 'cancelled') {
|
|
@@ -111,7 +106,7 @@ export function stopOf(item: ChatSubagentItem, turnRunning: boolean): SubagentSt
|
|
|
111
106
|
return null;
|
|
112
107
|
}
|
|
113
108
|
|
|
114
|
-
if (item.origin ===
|
|
109
|
+
if (item.origin === HOST_TASK_ORIGIN) {
|
|
115
110
|
return item.childId === undefined ? null : 'task';
|
|
116
111
|
}
|
|
117
112
|
|
|
@@ -130,7 +125,7 @@ export function stopLabel(stop: SubagentStop): string {
|
|
|
130
125
|
* What the composer's Stop does. A plain click stops the turn alone, as it always has; Shift also ends
|
|
131
126
|
* every agent the chat opened and marks its CLI's own sub-agents stopped, which a turn alone leaves running.
|
|
132
127
|
*/
|
|
133
|
-
|
|
128
|
+
type ComposerStop = 'turn' | 'turn-and-subagents';
|
|
134
129
|
|
|
135
130
|
export function composerStopOf(shiftKey: boolean): ComposerStop {
|
|
136
131
|
return shiftKey ? 'turn-and-subagents' : 'turn';
|
|
@@ -14,7 +14,7 @@ export interface SubagentStep {
|
|
|
14
14
|
/* From the chat down to what is on screen, which is the last step; empty is the main agent. */
|
|
15
15
|
export type SubagentTrail = readonly SubagentStep[];
|
|
16
16
|
|
|
17
|
-
|
|
17
|
+
interface BreadcrumbStep {
|
|
18
18
|
label: string;
|
|
19
19
|
/* How many steps of the trail stay when this crumb is picked; the chat's own title is 0. */
|
|
20
20
|
depth: number;
|
|
@@ -73,7 +73,6 @@ export function subagentOf(structure: Readonly<Record<string, ChatItem>>, toolUs
|
|
|
73
73
|
return Object.values(structure).find((item): item is ChatSubagentItem => item.kind === 'subagent' && item.toolUseId === toolUseId) ?? null;
|
|
74
74
|
}
|
|
75
75
|
|
|
76
|
-
/* The subagents a chat can open, in the order the thread has them. */
|
|
77
76
|
export function openableSubagents(order: readonly string[], structure: Record<string, ChatItem>, machineRefused: boolean): ChatSubagentItem[] {
|
|
78
77
|
return order.flatMap((id) => {
|
|
79
78
|
const item = structure[id];
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import type
|
|
2
|
-
import { accountName, accountsOfKind, hasAccountChoice, projectOffered, type AccountEntry
|
|
1
|
+
import { inPickerOrder, type AgentKind, type ModelInfo, type ProviderAccounts, type ProviderAccountState, type ProviderInfo } from '@adecore/agent-contracts';
|
|
2
|
+
import { accountName, accountsOfKind, hasAccountChoice, projectOffered, type AccountEntry } from '../agents/accounts';
|
|
3
3
|
import { modelRequirementOf } from '../agents/model-requirement';
|
|
4
|
-
import {
|
|
4
|
+
import type { AccountRule } from '../host/host';
|
|
5
5
|
import type { NamedPick } from './mentions';
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
|
|
7
|
+
const MODEL_SUGGESTIONS = 5;
|
|
8
|
+
const ACCOUNT_SUGGESTIONS = 3;
|
|
9
9
|
|
|
10
10
|
export interface ModelSuggestion extends NamedPick {
|
|
11
11
|
kind: 'model';
|
package/src/chat/thumbnails.ts
CHANGED
|
@@ -7,10 +7,9 @@ import { imageForDisplay } from './image-display';
|
|
|
7
7
|
/* The edge of a composer thumbnail: a few times the 56 px it is drawn at, so a sharp screen still gets a sharp one. */
|
|
8
8
|
export const THUMBNAIL_PX = 256;
|
|
9
9
|
|
|
10
|
-
|
|
10
|
+
interface ThumbnailCrop {
|
|
11
11
|
sx: number;
|
|
12
12
|
sy: number;
|
|
13
|
-
/* The edge of the square taken from the middle of the image. */
|
|
14
13
|
size: number;
|
|
15
14
|
/* The edge the square is drawn at, never larger than it was. */
|
|
16
15
|
out: number;
|
|
@@ -98,7 +97,6 @@ function thumbnailOf(upload: ChatAttachmentUpload): Promise<string> {
|
|
|
98
97
|
return promise;
|
|
99
98
|
}
|
|
100
99
|
|
|
101
|
-
/* The thumbnail of an image the composer holds, or null while it is being made. */
|
|
102
100
|
export function useUploadThumbnail(upload: ChatAttachmentUpload): string | null {
|
|
103
101
|
const [ready, setReady] = useState<{ upload: ChatAttachmentUpload; url: string } | null>(null);
|
|
104
102
|
const cached = made.get(upload);
|
|
@@ -2,7 +2,7 @@ import { create } from 'zustand';
|
|
|
2
2
|
import type { UiReplyTarget } from './logic/timeline-target';
|
|
3
3
|
|
|
4
4
|
/* The row of a thread a jump landed on: it lights up once, and a card of changes opens when the jump asked for it. */
|
|
5
|
-
|
|
5
|
+
interface TimelineFlash {
|
|
6
6
|
/* The scope's key of the chat, so two chats showing the same row id never light up together. */
|
|
7
7
|
key: string;
|
|
8
8
|
rowId: string;
|
|
@@ -154,9 +154,7 @@ function waitingJumps<T>(): { register(key: string, jump: (target: T) => void):
|
|
|
154
154
|
};
|
|
155
155
|
}
|
|
156
156
|
|
|
157
|
-
/* What a jump to an item may ask beyond scrolling to it. */
|
|
158
157
|
export interface ItemJumpOptions {
|
|
159
|
-
/* Lights the row up once it is in view. */
|
|
160
158
|
flash?: boolean;
|
|
161
159
|
/* Runs when the item is nowhere in the thread, after every earlier page has been tried. */
|
|
162
160
|
onMissing?(): void;
|
|
@@ -4,7 +4,7 @@ import clsx from 'clsx';
|
|
|
4
4
|
import { Bookmark, Pencil, X } from 'lucide-react';
|
|
5
5
|
import { useEffect, useRef } from 'react';
|
|
6
6
|
import { useTranslation } from 'react-i18next';
|
|
7
|
-
import { useChatHost } from '../../host';
|
|
7
|
+
import { useChatHost } from '../../host/host';
|
|
8
8
|
import { useChatScope } from '../../scope';
|
|
9
9
|
import { nameBookmark, removeBookmark, useBookmarkNaming } from '../bookmarks';
|
|
10
10
|
import { bookmarkLabel } from '../logic/bookmarks';
|
|
@@ -2,8 +2,8 @@ import { Icon, Menu } from '@adecore/ui';
|
|
|
2
2
|
import clsx from 'clsx';
|
|
3
3
|
import { Bookmark, Pencil, X } from 'lucide-react';
|
|
4
4
|
import { useTranslation } from 'react-i18next';
|
|
5
|
-
import { useChatHost } from '../../host';
|
|
6
|
-
import { useHostChatPlace } from '../../host-hooks';
|
|
5
|
+
import { useChatHost } from '../../host/host';
|
|
6
|
+
import { useHostChatPlace } from '../../host/host-hooks';
|
|
7
7
|
import { useChatScope } from '../../scope';
|
|
8
8
|
import { useChatRow } from '../../state/chats';
|
|
9
9
|
import { goToBookmark, removeBookmark } from '../bookmarks';
|