@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
|
@@ -4,8 +4,8 @@ import { ListRestart, LogIn } from 'lucide-react';
|
|
|
4
4
|
import { useEffect, useRef, useState, useSyncExternalStore } from 'react';
|
|
5
5
|
import { useTranslation } from 'react-i18next';
|
|
6
6
|
import { AccountDot } from '../agents/AccountDot';
|
|
7
|
-
import { useChatHost } from '../host';
|
|
8
|
-
import { useHostLoginBlocked } from '../host-hooks';
|
|
7
|
+
import { useChatHost } from '../host/host';
|
|
8
|
+
import { useHostLoginBlocked } from '../host/host-hooks';
|
|
9
9
|
import { useChatScope } from '../scope';
|
|
10
10
|
import { useProviderAccounts } from '../state/provider-accounts';
|
|
11
11
|
import { useUsageStore } from '../state/usage';
|
|
@@ -51,7 +51,6 @@ function LoginButton({ account, login }: { account: LimitAccount; login: Login }
|
|
|
51
51
|
);
|
|
52
52
|
}
|
|
53
53
|
|
|
54
|
-
/* One account: where its numbers come from, then a bar per window, or why there are none. */
|
|
55
54
|
function LimitCard({ account, named, now, login }: { account: LimitAccount; named: boolean; now: number; login: Login | null }) {
|
|
56
55
|
const { t } = useTranslation('agent-usage');
|
|
57
56
|
const signedOut = isSignedOut(account);
|
package/src/usage/UsagePage.tsx
CHANGED
|
@@ -1,15 +1,16 @@
|
|
|
1
1
|
import { USAGE_PROVIDERS, type UsageAccount } from '@adecore/agent-contracts';
|
|
2
2
|
import { Button, CloseButton, Dialog, EmptyState, FormError, IconButton, ScrollArea, Segmented, Select, Skeleton } from '@adecore/ui';
|
|
3
|
+
import { formatClock } from '@adecore/ui/format';
|
|
3
4
|
import { ChartNoAxesColumn, RefreshCw } from 'lucide-react';
|
|
4
5
|
import { useCallback, useEffect, useState, useSyncExternalStore, type ReactNode } from 'react';
|
|
5
6
|
import { useTranslation } from 'react-i18next';
|
|
6
7
|
import { AccountDot } from '../agents/AccountDot';
|
|
7
|
-
import { useChatHost } from '../host';
|
|
8
|
+
import { useChatHost } from '../host/host';
|
|
8
9
|
import { useChatScope } from '../scope';
|
|
9
10
|
import { useProvidersStore } from '../state/providers';
|
|
10
11
|
import { askedKey, summaryPayload, USAGE_PERIODS, useUsage, useUsageStore, type UsageMetric, type UsagePeriod } from '../state/usage';
|
|
11
12
|
import { whenOpen, type ChatTransport } from '../transport';
|
|
12
|
-
import {
|
|
13
|
+
import { formatCount, formatDate, formatRateDate, formatTokens, PROVIDER_LABELS } from './format';
|
|
13
14
|
import { useMoney } from './money';
|
|
14
15
|
import { deriveUsage, labelEveryFor } from './summary';
|
|
15
16
|
import { UsageBreakdown } from './UsageBreakdown';
|
|
@@ -26,7 +27,6 @@ const ALL_ACCOUNTS = '*';
|
|
|
26
27
|
/* Over the whole popup rather than the body under the header, so an empty state stands in the middle of the dialog. */
|
|
27
28
|
const DIALOG_CENTER = 'pointer-events-none absolute inset-0';
|
|
28
29
|
|
|
29
|
-
/* Whether the scope's host answers right now, redrawn as its link comes and goes. */
|
|
30
30
|
function useAnswering(transport: ChatTransport): boolean {
|
|
31
31
|
return useSyncExternalStore(
|
|
32
32
|
(onChange: () => void) => transport.subscribeStatus(onChange),
|
package/src/usage/UsagePane.tsx
CHANGED
|
@@ -2,8 +2,8 @@ import { Segmented, Button, Icon } from '@adecore/ui';
|
|
|
2
2
|
import { SettingsRow, SettingsSection } from '@adecore/ui/settings';
|
|
3
3
|
import { ChartNoAxesColumn } from 'lucide-react';
|
|
4
4
|
import { useTranslation } from 'react-i18next';
|
|
5
|
-
import { useUsage, useUsageStore } from '../state/usage';
|
|
6
|
-
import { formatRateDate
|
|
5
|
+
import { useUsage, useUsageStore, type UsageCurrency } from '../state/usage';
|
|
6
|
+
import { formatRateDate } from './format';
|
|
7
7
|
|
|
8
8
|
const CURRENCIES: readonly UsageCurrency[] = ['USD', 'EUR'];
|
|
9
9
|
|
package/src/usage/UsageTiles.tsx
CHANGED
|
@@ -9,7 +9,6 @@ interface UsageTilesProps {
|
|
|
9
9
|
cacheSavingsUsd: number;
|
|
10
10
|
}
|
|
11
11
|
|
|
12
|
-
/* What the period moved, split by the kinds of token that are priced differently. */
|
|
13
12
|
export function UsageTiles({ totals, cacheSavingsUsd }: UsageTilesProps) {
|
|
14
13
|
const { t } = useTranslation('agent-usage');
|
|
15
14
|
const money = useMoney();
|
package/src/usage/format.ts
CHANGED
|
@@ -1,12 +1,7 @@
|
|
|
1
1
|
import type { UsageProvider, UsageRate } from '@adecore/agent-contracts';
|
|
2
2
|
import { formatDay, formatHour, formatWeekdayDay, formatMoney, formatNumber, formatTokens } from '@adecore/ui/format';
|
|
3
|
+
import type { UsageCurrency } from '../state/usage';
|
|
3
4
|
|
|
4
|
-
export { formatClock } from '@adecore/ui/format';
|
|
5
|
-
|
|
6
|
-
/* Dollars are what a price table is in; euros are what the page can be set to. */
|
|
7
|
-
export type UsageCurrency = 'USD' | 'EUR';
|
|
8
|
-
|
|
9
|
-
/* Read in the region of the machine looking at it: `$5,480.96` in the US, `$ 5.480,96` in the Netherlands. */
|
|
10
5
|
export function formatCount(value: number): string {
|
|
11
6
|
return formatNumber(value);
|
|
12
7
|
}
|
package/src/usage/index.ts
CHANGED
|
@@ -9,8 +9,7 @@ export { UsagePage } from './UsagePage';
|
|
|
9
9
|
export { UsagePane } from './UsagePane';
|
|
10
10
|
export { UsageSummary } from './UsageSummary';
|
|
11
11
|
export { UsageTiles } from './UsageTiles';
|
|
12
|
-
export {
|
|
13
|
-
export { evenPace, type EvenPace, type LimitAccount, type LimitGroup, type PaceStanding } from './limit-groups';
|
|
12
|
+
export { type LimitAccount } from './limit-groups';
|
|
14
13
|
export { useLimitGroups } from './limits';
|
|
15
14
|
export { useMoney } from './money';
|
|
16
|
-
export { niceScale, labelEveryFor, deriveUsage, type
|
|
15
|
+
export { niceScale, labelEveryFor, deriveUsage, type ProviderTotal } from './summary';
|
|
@@ -14,11 +14,8 @@ import { limitsAccountId } from '../agents/account-limits';
|
|
|
14
14
|
import { accountName, accountsOfKind, accountStatusLine } from '../agents/accounts';
|
|
15
15
|
import { PROVIDER_LABELS } from './format';
|
|
16
16
|
|
|
17
|
-
export { evenPace, type EvenPace, type PaceStanding } from '@adecore/agent-contracts';
|
|
18
|
-
|
|
19
17
|
const MINUTE = 60_000;
|
|
20
18
|
|
|
21
|
-
/* One account of a CLI as the limits draw it. */
|
|
22
19
|
export interface LimitAccount {
|
|
23
20
|
id: string;
|
|
24
21
|
kind: UsageProvider;
|
|
@@ -169,7 +166,6 @@ export function checkedLabel(entry: UsageLimitsProvider, now: number): string |
|
|
|
169
166
|
return entry.source === 'event' ? i18next.t('agent-usage:limits.checked.fromTurn', { when }) : when;
|
|
170
167
|
}
|
|
171
168
|
|
|
172
|
-
/* Why a read account has no bars, or null when it has them. */
|
|
173
169
|
export function explain(provider: UsageLimitsProvider): string | null {
|
|
174
170
|
if (provider.unavailable === null) {
|
|
175
171
|
return provider.windows.length === 0 ? i18next.t('agent-usage:limits.none') : null;
|
package/src/usage/limits.ts
CHANGED
|
@@ -61,7 +61,6 @@ export function useUsageLimits(): UsageLimitsSnapshot | null {
|
|
|
61
61
|
return limits;
|
|
62
62
|
}
|
|
63
63
|
|
|
64
|
-
/* The snapshot per CLI and account, with the accounts of the same host it is read from. */
|
|
65
64
|
export function useLimitGroups(limits: UsageLimitsSnapshot | null): LimitGroup[] {
|
|
66
65
|
const accounts = useProviderAccounts((row) => row.accounts);
|
|
67
66
|
|
package/src/usage/summary.ts
CHANGED
|
@@ -2,7 +2,6 @@ import type { UsageProvider, UsageSummaryResult, UsageTotals } from '@adecore/ag
|
|
|
2
2
|
import { EMPTY_TOTALS, USAGE_PROVIDERS, addTotals, totalTokensOf } from '@adecore/agent-contracts';
|
|
3
3
|
import { dayOf, type UsageMetric } from '../state/usage';
|
|
4
4
|
|
|
5
|
-
/* One bar of the chart, what each provider put in this slot, and the height of the stack. */
|
|
6
5
|
export interface ChartSlot {
|
|
7
6
|
slot: string;
|
|
8
7
|
byProvider: Partial<Record<UsageProvider, number>>;
|
|
@@ -30,7 +29,7 @@ export function niceScale(max: number, ticks = 4): { max: number; step: number }
|
|
|
30
29
|
return { max: Math.ceil(max / step) * step, step };
|
|
31
30
|
}
|
|
32
31
|
|
|
33
|
-
|
|
32
|
+
interface DerivedUsage {
|
|
34
33
|
slots: ChartSlot[];
|
|
35
34
|
providers: ProviderTotal[];
|
|
36
35
|
/* The providers that did anything, in the order the chart stacks them. */
|
|
@@ -62,7 +61,6 @@ export function enumerateSlots(summary: Pick<UsageSummaryResult, 'from' | 'to' |
|
|
|
62
61
|
return slots;
|
|
63
62
|
}
|
|
64
63
|
|
|
65
|
-
/* How often an x label fits: every third hour, every day, every week, every fortnight. */
|
|
66
64
|
export function labelEveryFor(slots: number): number {
|
|
67
65
|
return slots <= 10 ? 1 : slots <= 24 ? 3 : slots <= 31 ? 7 : 15;
|
|
68
66
|
}
|
|
@@ -113,8 +111,7 @@ export function deriveUsage(summary: UsageSummaryResult, metric: UsageMetric): D
|
|
|
113
111
|
};
|
|
114
112
|
}
|
|
115
113
|
|
|
116
|
-
|
|
117
|
-
export interface UsageDay {
|
|
114
|
+
interface UsageDay {
|
|
118
115
|
/* `YYYY-MM-DD`, always a calendar day, whatever resolution the chart above it is drawn at. */
|
|
119
116
|
slot: string;
|
|
120
117
|
costByProvider: Partial<Record<UsageProvider, number>>;
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import type { AgentKind } from '@adecore/agent-contracts';
|
|
2
|
-
export interface AgentMark {
|
|
3
|
-
title: string;
|
|
4
|
-
path: string;
|
|
5
|
-
viewBox?: string;
|
|
6
|
-
fillRule?: 'nonzero' | 'evenodd';
|
|
7
|
-
}
|
|
8
|
-
export declare function configureAgentMarks(marks: Readonly<Partial<Record<AgentKind, AgentMark>>>): void;
|
|
9
|
-
export declare function hostAgentMark(kind: AgentKind): AgentMark | undefined;
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
let hostMarks = {};
|
|
2
|
-
/*
|
|
3
|
-
* The marks of the kinds a host adds, and any it draws differently, set once before the first render. Every
|
|
4
|
-
* place the shared UI draws an agent's mark reads them; a kind with none keeps the built-in mark or the robot.
|
|
5
|
-
* A later call replaces the whole set.
|
|
6
|
-
*/
|
|
7
|
-
export function configureAgentMarks(marks) {
|
|
8
|
-
hostMarks = {
|
|
9
|
-
...marks
|
|
10
|
-
};
|
|
11
|
-
}
|
|
12
|
-
export function hostAgentMark(kind) {
|
|
13
|
-
return hostMarks[kind];
|
|
14
|
-
}
|
package/dist/lazy.d.ts
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { type ComponentProps, type ComponentType } from 'react';
|
|
2
|
-
type Loader = () => Promise<unknown>;
|
|
3
|
-
export declare function setLazyPrefetch(next: (load: Loader) => void): void;
|
|
4
|
-
export declare function onLazyOpenError(listener: (error: unknown) => void): () => void;
|
|
5
|
-
export declare function lazyNamed<Module extends Record<Name, ComponentType<any>>, Name extends keyof Module>(load: () => Promise<Module>, name: Name, options?: {
|
|
6
|
-
readonly prefetch?: boolean;
|
|
7
|
-
}): ComponentType<ComponentProps<Module[Name]>>;
|
|
8
|
-
export {};
|
package/dist/lazy.js
DELETED
|
@@ -1,63 +0,0 @@
|
|
|
1
|
-
import { LoadedComponent } from '@adecore/ui';
|
|
2
|
-
import { lazy } from 'react';
|
|
3
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
4
|
-
const loaders = [];
|
|
5
|
-
let register = null;
|
|
6
|
-
const openErrorListeners = new Set();
|
|
7
|
-
/*
|
|
8
|
-
* Hands every module the chat loads lazily to the app's prefetcher: the ones made so far, and each
|
|
9
|
-
* one made from now on. Without it they load on their first render, as `React.lazy` does.
|
|
10
|
-
*/
|
|
11
|
-
export function setLazyPrefetch(next) {
|
|
12
|
-
register = next;
|
|
13
|
-
for (const load of loaders) {
|
|
14
|
-
next(load);
|
|
15
|
-
}
|
|
16
|
-
}
|
|
17
|
-
/*
|
|
18
|
-
* Tells `listener` when a module the chat loads for a render fails to load, the way `onLazyOpenError`
|
|
19
|
-
* of `@adecore/ui` does for the app's own. A failed prefetch never reaches it.
|
|
20
|
-
*/
|
|
21
|
-
export function onLazyOpenError(listener) {
|
|
22
|
-
openErrorListeners.add(listener);
|
|
23
|
-
return () => {
|
|
24
|
-
openErrorListeners.delete(listener);
|
|
25
|
-
};
|
|
26
|
-
}
|
|
27
|
-
/*
|
|
28
|
-
* `React.lazy` for a module that exports its component by name, `default` included. Once the module
|
|
29
|
-
* is here the component is drawn straight away, since `React.lazy` suspends for a tick even on a
|
|
30
|
-
* module the prefetcher already fetched.
|
|
31
|
-
*/
|
|
32
|
-
export function lazyNamed(load, name, options) {
|
|
33
|
-
// Through `LoadedComponent`, so a `LazyBoundary` around it draws the moment the module lands.
|
|
34
|
-
const loaded = new LoadedComponent(async () => (await load())[name]);
|
|
35
|
-
const open = () => loaded.load();
|
|
36
|
-
if (options?.prefetch !== false) {
|
|
37
|
-
loaders.push(open);
|
|
38
|
-
register?.(open);
|
|
39
|
-
}
|
|
40
|
-
// Only a render loads through here; a prefetch calls `open` itself, so its failures report nothing.
|
|
41
|
-
const Lazy = lazy(async () => {
|
|
42
|
-
try {
|
|
43
|
-
return {
|
|
44
|
-
default: await open()
|
|
45
|
-
};
|
|
46
|
-
} catch (error) {
|
|
47
|
-
for (const listener of openErrorListeners) {
|
|
48
|
-
listener(error);
|
|
49
|
-
}
|
|
50
|
-
throw error;
|
|
51
|
-
}
|
|
52
|
-
});
|
|
53
|
-
const LazyNamed = props => {
|
|
54
|
-
// `loaded` fills in place; compiled, the element drawn before the module landed would stay.
|
|
55
|
-
'use no memo';
|
|
56
|
-
|
|
57
|
-
const Component = loaded.current ?? Lazy;
|
|
58
|
-
return /*#__PURE__*/_jsx(Component, {
|
|
59
|
-
...props
|
|
60
|
-
});
|
|
61
|
-
};
|
|
62
|
-
return LazyNamed;
|
|
63
|
-
}
|
package/dist/prompts/index.d.ts
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
export { focusPromptStart } from './logic/focus.js';
|
|
2
|
-
export { PROMPT_SHORTCUTS, pageKey, type PromptKeyEvent } from './logic/keys.js';
|
|
3
|
-
export { type PendingPrompt, type PromptAction, emptyPromptDraft, orderPrompts, type PromptAnswer, type PromptDraft } from './logic/prompts.js';
|
|
4
|
-
export { type HostPrompt, type PromptSubject, type ChatPromptClients, type PromptViewProps, type ApprovalButtonSpec, promptIdOf, promptCreatedAt, isBlockingSubject, answerPrompt } from './logic/subjects.js';
|
|
5
|
-
export { useFocusAfterAnswer, type FocusAfterAnswer } from './logic/useFocusAfterAnswer.js';
|
|
6
|
-
export { usePromptSession, type PromptSession } from './logic/usePromptSession.js';
|
|
7
|
-
export { PromptPrimary, ApprovalActions, type ApprovalButton } from './ui/PromptActions.js';
|
|
8
|
-
export { PROMPT_SURFACE, PromptCard, type PromptCardKind } from './ui/PromptCard.js';
|
|
9
|
-
export { PromptView } from './ui/PromptView.js';
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import type { AgentKind } from '@adecore/agent-contracts';
|
|
2
|
-
|
|
3
|
-
/* A CLI's mark, drawn in the current text color. */
|
|
4
|
-
export interface AgentMark {
|
|
5
|
-
/* Read by a screen reader. */
|
|
6
|
-
title: string;
|
|
7
|
-
/* The `d` of one SVG path; several shapes go in one path. */
|
|
8
|
-
path: string;
|
|
9
|
-
/* `0 0 24 24` when absent. */
|
|
10
|
-
viewBox?: string;
|
|
11
|
-
/* `evenodd` for a path whose holes are subpaths inside its shape; `nonzero` when absent. */
|
|
12
|
-
fillRule?: 'nonzero' | 'evenodd';
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
let hostMarks: Readonly<Partial<Record<AgentKind, AgentMark>>> = {};
|
|
16
|
-
|
|
17
|
-
/*
|
|
18
|
-
* The marks of the kinds a host adds, and any it draws differently, set once before the first render. Every
|
|
19
|
-
* place the shared UI draws an agent's mark reads them; a kind with none keeps the built-in mark or the robot.
|
|
20
|
-
* A later call replaces the whole set.
|
|
21
|
-
*/
|
|
22
|
-
export function configureAgentMarks(marks: Readonly<Partial<Record<AgentKind, AgentMark>>>): void {
|
|
23
|
-
hostMarks = { ...marks };
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
export function hostAgentMark(kind: AgentKind): AgentMark | undefined {
|
|
27
|
-
return hostMarks[kind];
|
|
28
|
-
}
|
package/src/lazy.tsx
DELETED
|
@@ -1,76 +0,0 @@
|
|
|
1
|
-
import { LoadedComponent } from '@adecore/ui';
|
|
2
|
-
import { lazy, type ComponentProps, type ComponentType } from 'react';
|
|
3
|
-
|
|
4
|
-
type Loader = () => Promise<unknown>;
|
|
5
|
-
|
|
6
|
-
const loaders: Loader[] = [];
|
|
7
|
-
let register: ((load: Loader) => void) | null = null;
|
|
8
|
-
const openErrorListeners = new Set<(error: unknown) => void>();
|
|
9
|
-
|
|
10
|
-
/*
|
|
11
|
-
* Hands every module the chat loads lazily to the app's prefetcher: the ones made so far, and each
|
|
12
|
-
* one made from now on. Without it they load on their first render, as `React.lazy` does.
|
|
13
|
-
*/
|
|
14
|
-
export function setLazyPrefetch(next: (load: Loader) => void): void {
|
|
15
|
-
register = next;
|
|
16
|
-
|
|
17
|
-
for (const load of loaders) {
|
|
18
|
-
next(load);
|
|
19
|
-
}
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
/*
|
|
23
|
-
* Tells `listener` when a module the chat loads for a render fails to load, the way `onLazyOpenError`
|
|
24
|
-
* of `@adecore/ui` does for the app's own. A failed prefetch never reaches it.
|
|
25
|
-
*/
|
|
26
|
-
export function onLazyOpenError(listener: (error: unknown) => void): () => void {
|
|
27
|
-
openErrorListeners.add(listener);
|
|
28
|
-
|
|
29
|
-
return () => {
|
|
30
|
-
openErrorListeners.delete(listener);
|
|
31
|
-
};
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
/*
|
|
35
|
-
* `React.lazy` for a module that exports its component by name, `default` included. Once the module
|
|
36
|
-
* is here the component is drawn straight away, since `React.lazy` suspends for a tick even on a
|
|
37
|
-
* module the prefetcher already fetched.
|
|
38
|
-
*/
|
|
39
|
-
export function lazyNamed<Module extends Record<Name, ComponentType<any>>, Name extends keyof Module>(
|
|
40
|
-
load: () => Promise<Module>,
|
|
41
|
-
name: Name,
|
|
42
|
-
options?: { readonly prefetch?: boolean }
|
|
43
|
-
): ComponentType<ComponentProps<Module[Name]>> {
|
|
44
|
-
// Through `LoadedComponent`, so a `LazyBoundary` around it draws the moment the module lands.
|
|
45
|
-
const loaded = new LoadedComponent<ComponentType<any>>(async () => (await load())[name]);
|
|
46
|
-
|
|
47
|
-
const open = (): Promise<ComponentType<any>> => loaded.load();
|
|
48
|
-
|
|
49
|
-
if (options?.prefetch !== false) {
|
|
50
|
-
loaders.push(open);
|
|
51
|
-
register?.(open);
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
// Only a render loads through here; a prefetch calls `open` itself, so its failures report nothing.
|
|
55
|
-
const Lazy = lazy(async () => {
|
|
56
|
-
try {
|
|
57
|
-
return { default: await open() };
|
|
58
|
-
} catch (error) {
|
|
59
|
-
for (const listener of openErrorListeners) {
|
|
60
|
-
listener(error);
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
throw error;
|
|
64
|
-
}
|
|
65
|
-
});
|
|
66
|
-
|
|
67
|
-
const LazyNamed = (props: ComponentProps<Module[Name]>) => {
|
|
68
|
-
// `loaded` fills in place; compiled, the element drawn before the module landed would stay.
|
|
69
|
-
'use no memo';
|
|
70
|
-
const Component: ComponentType<any> = loaded.current ?? Lazy;
|
|
71
|
-
|
|
72
|
-
return <Component {...props} />;
|
|
73
|
-
};
|
|
74
|
-
|
|
75
|
-
return LazyNamed;
|
|
76
|
-
}
|
package/src/prompts/index.ts
DELETED
|
@@ -1,22 +0,0 @@
|
|
|
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, type PromptKeyEvent } from './logic/keys';
|
|
4
|
-
export { type PendingPrompt, type PromptAction, emptyPromptDraft, orderPrompts, type PromptAnswer, type PromptDraft } from './logic/prompts';
|
|
5
|
-
|
|
6
|
-
export {
|
|
7
|
-
type HostPrompt,
|
|
8
|
-
type PromptSubject,
|
|
9
|
-
type ChatPromptClients,
|
|
10
|
-
type PromptViewProps,
|
|
11
|
-
type ApprovalButtonSpec,
|
|
12
|
-
promptIdOf,
|
|
13
|
-
promptCreatedAt,
|
|
14
|
-
isBlockingSubject,
|
|
15
|
-
answerPrompt
|
|
16
|
-
} from './logic/subjects';
|
|
17
|
-
|
|
18
|
-
export { useFocusAfterAnswer, type FocusAfterAnswer } from './logic/useFocusAfterAnswer';
|
|
19
|
-
export { usePromptSession, type PromptSession } from './logic/usePromptSession';
|
|
20
|
-
export { PromptPrimary, ApprovalActions, type ApprovalButton } from './ui/PromptActions';
|
|
21
|
-
export { PROMPT_SURFACE, PromptCard, type PromptCardKind } from './ui/PromptCard';
|
|
22
|
-
export { PromptView } from './ui/PromptView';
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|