@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
package/src/index.ts
CHANGED
|
@@ -12,8 +12,6 @@ export {
|
|
|
12
12
|
type ComposerSlotProps,
|
|
13
13
|
type ReferenceIconProps,
|
|
14
14
|
type OutsideReference,
|
|
15
|
-
type ComposerSendAction,
|
|
16
|
-
type ComposerSendDraft,
|
|
17
15
|
type ComposerStatusDetail,
|
|
18
16
|
type ComposerStatusItem,
|
|
19
17
|
type SubagentSlotProps,
|
|
@@ -33,12 +31,10 @@ export {
|
|
|
33
31
|
type ToolLookCall,
|
|
34
32
|
type ToolLookMatch,
|
|
35
33
|
ChatHostProvider,
|
|
36
|
-
|
|
37
|
-
type
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
type ResourceUrl
|
|
41
|
-
} from './host';
|
|
34
|
+
type AgentMark,
|
|
35
|
+
type ChatHostLayer,
|
|
36
|
+
useChatHost
|
|
37
|
+
} from './host/host';
|
|
42
38
|
|
|
43
39
|
export { type ChatScope, ChatScopeContext, useChatScope } from './scope';
|
|
44
40
|
|
|
@@ -53,8 +49,6 @@ export {
|
|
|
53
49
|
} from './transport';
|
|
54
50
|
|
|
55
51
|
export { portTransport, type PortTransport } from './port-transport';
|
|
56
|
-
export {
|
|
57
|
-
export { configureChatStorage, type ChatStorageRecord, type ChatStorageAdapter, type ChatStorageOptions } from './storage';
|
|
58
|
-
export { setLazyPrefetch, onLazyOpenError } from './lazy';
|
|
52
|
+
export { configureChatStorage } from './storage';
|
|
59
53
|
export { type MountedEntry, MountedRegistry } from './mounted-registry';
|
|
60
|
-
export {
|
|
54
|
+
export { PROVIDERS_SECTION, USAGE_SECTION, settingsSection } from './settings/sections';
|
|
@@ -24,6 +24,7 @@ export default {
|
|
|
24
24
|
refusal: {
|
|
25
25
|
notInConversation: 'This turn is not in the conversation',
|
|
26
26
|
cliCannotFork: 'This agent cannot fork its conversation',
|
|
27
|
+
agentsLoading: 'Wait for the agents to load',
|
|
27
28
|
noConversation: 'Nothing to fork yet. Send a message first.',
|
|
28
29
|
turnRunning: 'Wait for the turn to end',
|
|
29
30
|
originalGone: 'Original no longer in this project'
|
|
@@ -443,7 +444,6 @@ export default {
|
|
|
443
444
|
continue: 'Continue',
|
|
444
445
|
continueHint: 'Continue the stopped turn',
|
|
445
446
|
send: 'Send',
|
|
446
|
-
sendActions: 'More send options',
|
|
447
447
|
clear: {
|
|
448
448
|
title: 'Clear thread?',
|
|
449
449
|
description: 'A turn is running.',
|
|
@@ -24,6 +24,7 @@ export default {
|
|
|
24
24
|
refusal: {
|
|
25
25
|
notInConversation: 'Deze turn zit niet in het gesprek',
|
|
26
26
|
cliCannotFork: 'Deze agent kan zijn gesprek niet forken',
|
|
27
|
+
agentsLoading: 'Wacht tot de agents geladen zijn',
|
|
27
28
|
noConversation: 'Nog niets om te forken. Stuur eerst een bericht.',
|
|
28
29
|
turnRunning: 'Wacht tot de turn klaar is',
|
|
29
30
|
originalGone: 'Origineel niet meer in dit project'
|
|
@@ -443,7 +444,6 @@ export default {
|
|
|
443
444
|
continue: 'Doorgaan',
|
|
444
445
|
continueHint: 'Ga verder met de gestopte turn',
|
|
445
446
|
send: 'Versturen',
|
|
446
|
-
sendActions: 'Meer verzendopties',
|
|
447
447
|
clear: {
|
|
448
448
|
title: 'Thread wissen?',
|
|
449
449
|
description: 'Er loopt een turn.',
|
package/src/locales.ts
CHANGED
|
@@ -3,7 +3,7 @@ type Bundle = Record<string, unknown>;
|
|
|
3
3
|
/* The words of this package, a namespace per part of the package, which the app adds to its i18next beside its own namespaces. */
|
|
4
4
|
export const AGENTS_NAMESPACES = ['agent-chat', 'agent-prompts', 'agent-providers', 'agent-usage'] as const;
|
|
5
5
|
|
|
6
|
-
|
|
6
|
+
type AgentsNamespace = (typeof AGENTS_NAMESPACES)[number];
|
|
7
7
|
|
|
8
8
|
type Files = Record<AgentsNamespace, () => Promise<{ default: Bundle }>>;
|
|
9
9
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { chatStorageAdapter, hydrateChatStorage } from '
|
|
1
|
+
import { chatStorageAdapter, hydrateChatStorage } from './storage';
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
interface PersistedJson<T> {
|
|
4
4
|
read(): T;
|
|
5
5
|
/* False when storage refused; the value still survives for this session. */
|
|
6
6
|
write(value: T): boolean;
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { AccentSwatches } from '@adecore/ui';
|
|
2
|
-
import { useChatHost } from '../host';
|
|
2
|
+
import { useChatHost } from '../host/host';
|
|
3
3
|
|
|
4
|
-
/* The colors an account may wear, the host's palette. */
|
|
5
4
|
export function AccountColors({ value, label, onChange }: { value: string | undefined; label: string; onChange(id: string): void }) {
|
|
6
5
|
const { all, featured, label: labelOf } = useChatHost().accents;
|
|
7
6
|
|
|
@@ -6,8 +6,8 @@ import { useState } from 'react';
|
|
|
6
6
|
import { Trans, useTranslation } from 'react-i18next';
|
|
7
7
|
import { AccountDot } from '../agents/AccountDot';
|
|
8
8
|
import { accountName, FOLDER_VARIABLES, type AccountEntry, type AccountLogin } from '../agents/accounts';
|
|
9
|
-
import { useChatHost } from '../host';
|
|
10
|
-
import { useHostCanShareAccountConfig } from '../host-hooks';
|
|
9
|
+
import { useChatHost } from '../host/host';
|
|
10
|
+
import { useHostCanShareAccountConfig } from '../host/host-hooks';
|
|
11
11
|
import { useChatScope } from '../scope';
|
|
12
12
|
import { useProviderAccounts } from '../state/provider-accounts';
|
|
13
13
|
import { removeAccount, saveAccount, shareAccountConfig } from './account-actions';
|
|
@@ -23,7 +23,6 @@ interface AccountDetailProps {
|
|
|
23
23
|
entry: AccountEntry;
|
|
24
24
|
/* Null for a CLI without a config folder: it has only its own login, and nothing to sign in here. */
|
|
25
25
|
login: AccountLogin;
|
|
26
|
-
/* Whether the host can open a terminal for a login at all. */
|
|
27
26
|
canOpenLogin: boolean;
|
|
28
27
|
/* Why a login cannot open a terminal right now, or null when it can. */
|
|
29
28
|
loginBlocked: string | null;
|
|
@@ -64,7 +63,6 @@ function NameField({ value, label, onSave }: { value: string; label: string; onS
|
|
|
64
63
|
);
|
|
65
64
|
}
|
|
66
65
|
|
|
67
|
-
/* One account: how it looks in a picker, who is signed in, where its folder is, its variables. */
|
|
68
66
|
export function AccountDetail({ provider, entry, login, canOpenLogin, loginBlocked, secretsAvailable, onRemoved }: AccountDetailProps) {
|
|
69
67
|
const { t } = useTranslation('agent-providers');
|
|
70
68
|
const scope = useChatScope();
|
|
@@ -4,7 +4,7 @@ import { SettingsRow, SettingsSection } from '@adecore/ui/settings';
|
|
|
4
4
|
import { Lock, LockOpen, Plus, X } from 'lucide-react';
|
|
5
5
|
import { useState } 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 { saveAccount } from './account-actions';
|
|
10
10
|
import { draftsOf, emptyDraft, variablesChanged, variablesOf, variablesProblem, type VariableDraft } from './variables';
|
|
@@ -6,7 +6,7 @@ import { ChevronRight } from 'lucide-react';
|
|
|
6
6
|
import { useState, type FormEvent } from 'react';
|
|
7
7
|
import { useTranslation } from 'react-i18next';
|
|
8
8
|
import { freeAccountColor, mintAccountId, type AccountEntry, type AccountLogin } from '../agents/accounts';
|
|
9
|
-
import { useChatHost } from '../host';
|
|
9
|
+
import { useChatHost } from '../host/host';
|
|
10
10
|
import { useChatScope } from '../scope';
|
|
11
11
|
import { providerAccountsOf } from '../state/provider-accounts';
|
|
12
12
|
import { errorMessage } from '../transport';
|
|
@@ -9,8 +9,8 @@ import { carryOptions } from '../agents/model-options';
|
|
|
9
9
|
import { ModelOptionControl } from '../agents/ModelOptionControl';
|
|
10
10
|
import { optionWord } from '../agents/option-words';
|
|
11
11
|
import { accountFor, forgetChatSelection, rememberChatAccount, rememberChatSelection, selectionFor, useChatPreferences } from '../chat/preferences';
|
|
12
|
-
import { useChatHost } from '../host';
|
|
13
|
-
import { useHostCanReorderAccounts } from '../host-hooks';
|
|
12
|
+
import { useChatHost } from '../host/host';
|
|
13
|
+
import { useHostCanReorderAccounts } from '../host/host-hooks';
|
|
14
14
|
import { useChatScope } from '../scope';
|
|
15
15
|
import { knownAccounts, useProviderAccounts } from '../state/provider-accounts';
|
|
16
16
|
import { reorderAccounts } from './account-actions';
|
|
@@ -51,7 +51,6 @@ interface CliDetailProps {
|
|
|
51
51
|
onPickAccount(id: string): void;
|
|
52
52
|
}
|
|
53
53
|
|
|
54
|
-
/* One CLI: what it is, what a new chat of it starts with unless `defaults` is off, and its accounts. */
|
|
55
54
|
export function CliDetail({ provider, entries, defaults, login, onAddAccount, onPickAccount }: CliDetailProps) {
|
|
56
55
|
const { t } = useTranslation('agent-providers');
|
|
57
56
|
const scope = useChatScope();
|
|
@@ -4,8 +4,8 @@ import clsx from 'clsx';
|
|
|
4
4
|
import { Check, Copy, ExternalLink, SquareTerminal } from 'lucide-react';
|
|
5
5
|
import { useState, type ReactNode } from 'react';
|
|
6
6
|
import { Trans, useTranslation } from 'react-i18next';
|
|
7
|
-
import { useChatHost } from '../host';
|
|
8
|
-
import { useHostMachinePlatform } from '../host-hooks';
|
|
7
|
+
import { useChatHost } from '../host/host';
|
|
8
|
+
import { useHostMachinePlatform } from '../host/host-hooks';
|
|
9
9
|
import { useChatScope } from '../scope';
|
|
10
10
|
import { installPlatforms, installStepStates, pagePlatform, type InstallStepState, type ProviderInstallStep } from './install-steps';
|
|
11
11
|
import { CliMark } from './parts';
|
|
@@ -101,7 +101,6 @@ interface InstallPageProps {
|
|
|
101
101
|
extra: ProviderInstallStep | null;
|
|
102
102
|
}
|
|
103
103
|
|
|
104
|
-
/* How to get a CLI that is not on the machine yet, step by step, until it is there and signed in. */
|
|
105
104
|
export function InstallPage({ provider, signedIn, extra }: InstallPageProps) {
|
|
106
105
|
const { t } = useTranslation('agent-providers');
|
|
107
106
|
const { id: scopeId } = useChatScope();
|
|
@@ -60,7 +60,6 @@ interface ProviderListProps {
|
|
|
60
60
|
onPick(picked: Picked): void;
|
|
61
61
|
}
|
|
62
62
|
|
|
63
|
-
/* The providers by whether they are ready, need setup or are not installed; a group without providers is left out. */
|
|
64
63
|
export function ProviderList({ groups, current, canAddAccount, canAddProvider = false, onPick }: ProviderListProps) {
|
|
65
64
|
const { t } = useTranslation('agent-providers');
|
|
66
65
|
|
|
@@ -4,8 +4,8 @@ import { MasterDetail } from '@adecore/ui/settings';
|
|
|
4
4
|
import { useState, type ReactNode } from 'react';
|
|
5
5
|
import { useTranslation } from 'react-i18next';
|
|
6
6
|
import { accountLoginOf, accountsOfKind, type AccountEntry } from '../agents/accounts';
|
|
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 { useProviders } from '../state/providers';
|
|
@@ -35,7 +35,6 @@ interface ProvidersPaneProps {
|
|
|
35
35
|
addPage?(added: (kind: AgentKind) => void): ReactNode;
|
|
36
36
|
}
|
|
37
37
|
|
|
38
|
-
/* The agent CLIs of the host in scope, each with its accounts, beside the detail of what is picked. */
|
|
39
38
|
export function ProvidersPane({ target = null, detailOf, defaults = true, installStepOf, setupStatusOf, sectionsOf, addPage }: ProvidersPaneProps) {
|
|
40
39
|
const { t } = useTranslation('agent-providers');
|
|
41
40
|
const { id: scopeId } = useChatScope();
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { AgentKind, ProviderAccount, ProviderAccountMap } from '@adecore/agent-contracts';
|
|
2
2
|
import i18next from 'i18next';
|
|
3
3
|
import { accountFor, readChatPreferences, rememberChatAccount } from '../chat/preferences';
|
|
4
|
-
import type { ChatHost } from '../host';
|
|
4
|
+
import type { ChatHost } from '../host/host';
|
|
5
5
|
import type { ChatScope } from '../scope';
|
|
6
6
|
import { providerAccountsOf, useProviderAccountsStore } from '../state/provider-accounts';
|
|
7
7
|
import { errorMessage, type ChatTransport } from '../transport';
|
|
@@ -19,7 +19,7 @@ function linkTo(scope: ChatScope): ChatTransport {
|
|
|
19
19
|
}
|
|
20
20
|
|
|
21
21
|
/* The whole map, as `accounts.save` takes it. Answers false when the host refused, which a toast then says. */
|
|
22
|
-
|
|
22
|
+
async function saveAccounts(scope: ChatScope, host: Pick<ChatHost, 'notify'>, accounts: ProviderAccountMap): Promise<boolean> {
|
|
23
23
|
try {
|
|
24
24
|
useProviderAccountsStore.getState().set(scope.id, await linkTo(scope).request('accounts.save', { accounts }));
|
|
25
25
|
|
package/src/providers/index.ts
CHANGED
|
@@ -4,21 +4,9 @@ export { AgentIcon } from '../agents/AgentIcon';
|
|
|
4
4
|
export { AgentModelLabel } from '../agents/AgentModelLabel';
|
|
5
5
|
export { ModelOptionControl } from '../agents/ModelOptionControl';
|
|
6
6
|
export { ProviderLogo } from '../agents/ProviderLogo';
|
|
7
|
-
export {
|
|
8
|
-
|
|
9
|
-
type AccountRule,
|
|
10
|
-
accountsOfKind,
|
|
11
|
-
ACCOUNT_TONE_CLASSES,
|
|
12
|
-
accountStatusLine,
|
|
13
|
-
canContinueOn,
|
|
14
|
-
projectDefault,
|
|
15
|
-
topAccountEntry,
|
|
16
|
-
type AccountTone
|
|
17
|
-
} from '../agents/accounts';
|
|
7
|
+
export { hasProviderLogo } from '../agents/provider-paths';
|
|
8
|
+
export { type AccountEntry, accountsOfKind, ACCOUNT_TONE_CLASSES, accountStatusLine, canContinueOn, projectDefault, topAccountEntry } from '../agents/accounts';
|
|
18
9
|
export { modelName, useModelName, shortModelName } from '../agents/model-name';
|
|
19
10
|
export { carryOptions } from '../agents/model-options';
|
|
20
|
-
export { type ModelRequirement } from '../agents/model-requirement';
|
|
21
11
|
export { ProvidersPane } from './ProvidersPane';
|
|
22
|
-
export type { ProviderInstallStep } from './install-steps';
|
|
23
|
-
export type { ProviderSetupStatus } from './provider-groups';
|
|
24
12
|
export { CliMark, CliTile } from './parts';
|
|
@@ -14,7 +14,6 @@ export type InstallStepState = 'done' | 'current' | 'later';
|
|
|
14
14
|
|
|
15
15
|
const PLATFORMS: readonly ProviderPlatform[] = ['darwin', 'linux', 'win32'];
|
|
16
16
|
|
|
17
|
-
/* The first step not done is the current one. */
|
|
18
17
|
export function installStepStates(done: readonly boolean[]): InstallStepState[] {
|
|
19
18
|
const first = done.indexOf(false);
|
|
20
19
|
|
|
@@ -1,15 +1,9 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { ProviderInfo } from '@adecore/agent-contracts';
|
|
2
2
|
import i18next from 'i18next';
|
|
3
3
|
|
|
4
|
-
/* What a provider offers, in one sentence, where it can be opened and whether its hooks report status. */
|
|
5
4
|
export function providerAbilities(provider: ProviderInfo): string {
|
|
6
5
|
const where = provider.capabilities.chat ? i18next.t('agent-providers:abilities.chatAndTerminal') : i18next.t('agent-providers:abilities.terminalOnly');
|
|
7
6
|
const status = provider.capabilities.hooks ? i18next.t('agent-providers:abilities.reportsStatus') : i18next.t('agent-providers:abilities.noStatus');
|
|
8
7
|
|
|
9
8
|
return `${where} ${status}`;
|
|
10
9
|
}
|
|
11
|
-
|
|
12
|
-
/* Whether a message sent while a turn runs may join it. Undefined while the host has not answered `provider.list`, which steers nothing. */
|
|
13
|
-
export function canSteer(capabilities: ProviderCapabilities | undefined): boolean {
|
|
14
|
-
return capabilities?.steer === true;
|
|
15
|
-
}
|
|
@@ -3,7 +3,6 @@ import i18next from 'i18next';
|
|
|
3
3
|
|
|
4
4
|
const NAME = /^[A-Za-z_][A-Za-z0-9_]{0,127}$/;
|
|
5
5
|
|
|
6
|
-
/* One variable as the person edits it, before it is saved. */
|
|
7
6
|
export interface VariableDraft {
|
|
8
7
|
/* Keeps a row in place while its name is typed. */
|
|
9
8
|
key: string;
|
|
@@ -88,7 +87,6 @@ export function variablesOf(drafts: readonly VariableDraft[]): ProviderAccountVa
|
|
|
88
87
|
});
|
|
89
88
|
}
|
|
90
89
|
|
|
91
|
-
/* Whether the drafts say something other than what the machine holds. */
|
|
92
90
|
export function variablesChanged(drafts: readonly VariableDraft[], env: readonly ProviderAccountVariable[] | undefined): boolean {
|
|
93
91
|
return (
|
|
94
92
|
JSON.stringify(variablesOf(drafts)) !==
|
package/src/scope.ts
CHANGED
package/src/settings/sections.ts
CHANGED
|
@@ -4,7 +4,7 @@ import { Brain, ChartNoAxesColumn, type LucideIcon } from 'lucide-react';
|
|
|
4
4
|
import type { ComponentType } from 'react';
|
|
5
5
|
|
|
6
6
|
/* A section of this package for the settings dialog of @adecore/ui, with its words read when it is drawn. */
|
|
7
|
-
|
|
7
|
+
interface AgentsSettingsSection {
|
|
8
8
|
id: string;
|
|
9
9
|
icon: LucideIcon;
|
|
10
10
|
/* A list beside a detail that scrolls on its own (`MasterDetail`). */
|
package/src/state/chats.ts
CHANGED
|
@@ -7,13 +7,12 @@ import type {
|
|
|
7
7
|
ChatInfo,
|
|
8
8
|
ChatItem,
|
|
9
9
|
ChatQuestionItem,
|
|
10
|
-
ChatSubagentItem,
|
|
11
|
-
ChatToolItem,
|
|
12
10
|
ChatVisual
|
|
13
11
|
} from '@adecore/agent-contracts';
|
|
14
12
|
import { appendToolOutput } from '@adecore/agent-contracts/text';
|
|
15
13
|
import { useContext } from 'react';
|
|
16
14
|
import { create } from 'zustand';
|
|
15
|
+
import type { ChatHistoryPage, ChatPage, ChatSink } from '../chat-sink';
|
|
17
16
|
import { ChatScopeContext, useChatScope } from '../scope';
|
|
18
17
|
|
|
19
18
|
export interface ChatState {
|
|
@@ -55,48 +54,12 @@ export interface ChatState {
|
|
|
55
54
|
visuals?: ChatVisual[];
|
|
56
55
|
}
|
|
57
56
|
|
|
58
|
-
export type ChatHistoryPage = ChatHistoryResult['history'];
|
|
59
|
-
|
|
60
|
-
/* The newest part of a thread, as `chat.attach` hands it over with a `historyLimit`. */
|
|
61
|
-
export interface ChatPage {
|
|
62
|
-
history: ChatHistoryPage;
|
|
63
|
-
/* Every request of the chat that still waits, wherever in the thread it is. */
|
|
64
|
-
pending: ChatItem[];
|
|
65
|
-
/* The active sub-agents from before the page; absent from a host that sends none. */
|
|
66
|
-
subagents?: ChatSubagentItem[];
|
|
67
|
-
/* The active Workflow calls from before the page; absent from a host that sends none. */
|
|
68
|
-
workflows?: ChatToolItem[];
|
|
69
|
-
/* The outline of the thread before the page; absent from a host that sends none. */
|
|
70
|
-
outline?: ChatItem[];
|
|
71
|
-
}
|
|
72
|
-
|
|
73
57
|
/* Rows keyed with the scope's `keyOf`, so a thread says which host it runs on. */
|
|
74
58
|
export type ChatsById = Record<string, ChatState>;
|
|
75
59
|
|
|
76
60
|
/* What a chat is doing, without its thread. */
|
|
77
61
|
export type ChatStatuses = Record<string, Pick<ChatState, 'info'>>;
|
|
78
62
|
|
|
79
|
-
/* What a chat client writes. It owns one host's link, so it speaks in chat ids alone. */
|
|
80
|
-
export interface ChatSink {
|
|
81
|
-
/*
|
|
82
|
-
* A token held by the cached thread, replaced on reset or eviction. It may change after a write.
|
|
83
|
-
* Without it a client can only retain a replay checkpoint while the chat is mounted.
|
|
84
|
-
*/
|
|
85
|
-
historyIdentity?(chatId: string): object | undefined;
|
|
86
|
-
/* Without a page the items are the whole thread. */
|
|
87
|
-
reset(chatId: string, info: ChatInfo, items: ChatItem[], page?: ChatPage): void;
|
|
88
|
-
/* The page before the one the chat holds, read with `cursor`. */
|
|
89
|
-
prepend(chatId: string, cursor: string, page: ChatHistoryResult): void;
|
|
90
|
-
apply(chatId: string, event: ChatEvent): void;
|
|
91
|
-
/* A reconnect can publish its complete replay at once; absent sinks receive each event through apply. */
|
|
92
|
-
replay?(chatId: string, events: readonly ChatEvent[]): void;
|
|
93
|
-
/* What a chat is doing, for a thread nobody in this window has open. */
|
|
94
|
-
status(chatId: string, info: ChatInfo): void;
|
|
95
|
-
bookmarks(chatId: string, bookmarks: ChatBookmark[]): void;
|
|
96
|
-
visuals(chatId: string, visuals: ChatVisual[]): void;
|
|
97
|
-
forget(chatId: string): void;
|
|
98
|
-
}
|
|
99
|
-
|
|
100
63
|
interface ChatsStore {
|
|
101
64
|
byKey: ChatsById;
|
|
102
65
|
/* Replaced only when a chat's info is, never for a streamed word, so what reads the status alone is not redrawn by one. */
|
|
@@ -233,7 +196,6 @@ function sameInfo(left: ChatInfo, right: ChatInfo): boolean {
|
|
|
233
196
|
return JSON.stringify(left) === JSON.stringify(right);
|
|
234
197
|
}
|
|
235
198
|
|
|
236
|
-
/* The statuses with this chat's info in them, the same object when that info is already there. */
|
|
237
199
|
function withStatus(statuses: ChatStatuses, key: string, info: ChatInfo): ChatStatuses {
|
|
238
200
|
return statuses[key]?.info === info ? statuses : { ...statuses, [key]: { info } };
|
|
239
201
|
}
|
|
@@ -471,7 +433,6 @@ export function useReportedModels(provider: AgentKind): ReadonlySet<string> {
|
|
|
471
433
|
return new Set(joined === '' ? [] : joined.split('\n'));
|
|
472
434
|
}
|
|
473
435
|
|
|
474
|
-
/* `useReportedModels` for every provider at once, as a lookup by provider. */
|
|
475
436
|
export function useReportedModelsByProvider(): (provider: AgentKind) => ReadonlySet<string> {
|
|
476
437
|
const scope = useContext(ChatScopeContext);
|
|
477
438
|
|
package/src/state/index.ts
CHANGED
|
@@ -1,26 +1,8 @@
|
|
|
1
1
|
// Public API: exports.test.ts snapshots this list, so a name added or dropped here is an API change.
|
|
2
|
-
export {
|
|
3
|
-
|
|
4
|
-
type ChatsById,
|
|
5
|
-
type ChatStatuses,
|
|
6
|
-
type ChatSink,
|
|
7
|
-
waitingRequestsOf,
|
|
8
|
-
applyEvent,
|
|
9
|
-
useChats,
|
|
10
|
-
chatSink,
|
|
11
|
-
useChatRow,
|
|
12
|
-
type ChatHistoryPage,
|
|
13
|
-
type ChatPage
|
|
14
|
-
} from './chats';
|
|
2
|
+
export { type ChatState, type ChatsById, type ChatStatuses, waitingRequestsOf, applyEvent, useChats, chatSink, useChatRow } from './chats';
|
|
3
|
+
export type { ChatHistoryPage, ChatSink } from '../chat-sink';
|
|
15
4
|
|
|
16
|
-
export {
|
|
17
|
-
useProviderAccountsStore,
|
|
18
|
-
useProviderAccounts,
|
|
19
|
-
providerAccountsOf,
|
|
20
|
-
knownAccounts,
|
|
21
|
-
watchProviderAccounts,
|
|
22
|
-
type ProviderAccountsRow
|
|
23
|
-
} from './provider-accounts';
|
|
5
|
+
export { useProviderAccountsStore, useProviderAccounts, providerAccountsOf, knownAccounts, watchProviderAccounts } from './provider-accounts';
|
|
24
6
|
|
|
25
7
|
export { useProvidersStore, useProviders, providersOf, providerSinkFor, type ProvidersRow } from './providers';
|
|
26
|
-
export { type UsageMetric, USAGE_PREFERENCES_KEY, dayOf, windowFor, reloadUsagePreferences, useUsageStore, type UsagePeriod
|
|
8
|
+
export { type UsageMetric, USAGE_PREFERENCES_KEY, dayOf, windowFor, reloadUsagePreferences, useUsageStore, type UsagePeriod } from './usage';
|
|
@@ -30,7 +30,6 @@ export const useProviderAccountsStore = create<ProviderAccountsStore>((set, get)
|
|
|
30
30
|
}
|
|
31
31
|
}));
|
|
32
32
|
|
|
33
|
-
/* The accounts of the host in scope, like `useProviders`. */
|
|
34
33
|
export function useProviderAccounts<T>(select: (row: ProviderAccountsRow) => T): T {
|
|
35
34
|
const { id } = useChatScope();
|
|
36
35
|
|
package/src/state/usage.ts
CHANGED
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import { UsageRateSchema, type UsageLimitsSnapshot, type UsageRate, type UsageSummaryPayload, type UsageSummaryResult } from '@adecore/agent-contracts';
|
|
2
2
|
import { localTimeZone } from '@adecore/ui/format';
|
|
3
|
-
import { persistedJson } from '../
|
|
3
|
+
import { persistedJson } from '../persisted-json';
|
|
4
4
|
import { useChatScope } from '../scope';
|
|
5
5
|
import { chatStorageKey, chatStorageLegacyKeys, createChatStore, onChatStorageConfiguration } from '../storage';
|
|
6
|
-
|
|
6
|
+
|
|
7
|
+
/* Dollars are what a price table is in; euros are what the page can be set to. */
|
|
8
|
+
export type UsageCurrency = 'USD' | 'EUR';
|
|
7
9
|
|
|
8
10
|
export type UsagePeriod = 'today' | '7d' | '30d' | '90d';
|
|
9
11
|
export type UsageMetric = 'cost' | 'tokens';
|
|
@@ -95,7 +97,6 @@ interface UsageRow {
|
|
|
95
97
|
/* The question the summary on screen answers, or null while nothing has come back yet. */
|
|
96
98
|
asked: string | null;
|
|
97
99
|
summary: UsageSummaryResult | null;
|
|
98
|
-
/* True while the host has not answered the question that is being asked now. */
|
|
99
100
|
loading: boolean;
|
|
100
101
|
/* The last request failed; the summary before it stays on screen under a red line. */
|
|
101
102
|
failed: boolean;
|
|
@@ -112,7 +113,6 @@ interface UsageStore extends Preferences {
|
|
|
112
113
|
* remembered host outlives this client's knowledge of it. It does survive closing the page.
|
|
113
114
|
*/
|
|
114
115
|
chosen: string | null;
|
|
115
|
-
/* Which host's numbers the page shows; null hands it back to the one around it. */
|
|
116
116
|
choose(scopeId: string | null): void;
|
|
117
117
|
setPeriod(period: UsagePeriod): void;
|
|
118
118
|
setMetric(metric: UsageMetric): void;
|
|
@@ -186,7 +186,7 @@ export const useUsageStore = createChatStore<UsageStore>(
|
|
|
186
186
|
* The viewer's preferences over the numbers of the host in scope. The usage page renders its picked
|
|
187
187
|
* host as a scope of its own, so browsing another host's spend never moves the limit bars outside it.
|
|
188
188
|
*/
|
|
189
|
-
|
|
189
|
+
type UsageView = Preferences & UsageRow;
|
|
190
190
|
|
|
191
191
|
export function useUsage<T>(select: (view: UsageView) => T): T {
|
|
192
192
|
const { id } = useChatScope();
|
package/src/storage.ts
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { create, type StateCreator, type StoreApi, type UseBoundStore } from 'zustand';
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
type ChatStorageRecord = 'drafts' | 'preferences' | 'stash' | 'usage';
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
interface ChatStorageAdapter {
|
|
6
6
|
getItem(key: string): string | null;
|
|
7
7
|
setItem(key: string, value: string): void;
|
|
8
8
|
}
|
|
9
9
|
|
|
10
|
-
|
|
10
|
+
interface ChatStorageOptions {
|
|
11
11
|
namespace?: string;
|
|
12
12
|
keys?: Partial<Record<ChatStorageRecord, string>>;
|
|
13
13
|
legacyNamespaces?: readonly string[];
|
package/src/testing/prompts.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { ChatQuestion, ChatQuestionItem, ChatApprovalItem } from '@adecore/agent-contracts';
|
|
2
|
-
import type { PendingPrompt } from '../
|
|
2
|
+
import type { PendingPrompt } from '../host/prompts';
|
|
3
3
|
|
|
4
4
|
const endpoints: ChatQuestion = {
|
|
5
5
|
id: 'endpoints',
|
package/src/usage/ChartLogo.tsx
CHANGED
|
@@ -2,7 +2,6 @@ import type { UsageProvider } from '@adecore/agent-contracts';
|
|
|
2
2
|
import { ProviderLogo } from '../agents/ProviderLogo';
|
|
3
3
|
import { PROVIDER_COLORS } from './format';
|
|
4
4
|
|
|
5
|
-
/* A provider's logo in its color of the chart, so it reads as the series it names. */
|
|
6
5
|
export function ChartLogo({ provider, className }: { provider: UsageProvider; className?: string }) {
|
|
7
6
|
return (
|
|
8
7
|
<span className={className} style={{ color: PROVIDER_COLORS[provider] }}>
|
package/src/usage/LimitsList.tsx
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type
|
|
1
|
+
import { evenPace, type PaceStanding, type UsageLimitsSnapshot, type UsageWindow } from '@adecore/agent-contracts';
|
|
2
2
|
import { Icon, Tooltip } from '@adecore/ui';
|
|
3
3
|
import { formatClock, formatWeekdayClock, isSameDay, formatCountdown, formatPercent } from '@adecore/ui/format';
|
|
4
4
|
import clsx from 'clsx';
|
|
@@ -8,13 +8,12 @@ import { useTranslation } from 'react-i18next';
|
|
|
8
8
|
import { limitsAccountId } from '../agents/account-limits';
|
|
9
9
|
import { accountColor } from '../agents/accounts';
|
|
10
10
|
import { ProviderLogo } from '../agents/ProviderLogo';
|
|
11
|
-
import { useChatHost } from '../host';
|
|
11
|
+
import { useChatHost } from '../host/host';
|
|
12
12
|
import { ChartLogo } from './ChartLogo';
|
|
13
13
|
import { PROVIDER_COLORS, PROVIDER_LABELS } from './format';
|
|
14
14
|
import {
|
|
15
15
|
accountNote,
|
|
16
16
|
emptyWindows,
|
|
17
|
-
evenPace,
|
|
18
17
|
explain,
|
|
19
18
|
isSignedOut,
|
|
20
19
|
limitAccountKey,
|
|
@@ -23,8 +22,7 @@ import {
|
|
|
23
22
|
ringWindows,
|
|
24
23
|
showsWindows,
|
|
25
24
|
type LimitAccount,
|
|
26
|
-
type LimitGroup
|
|
27
|
-
type PaceStanding
|
|
25
|
+
type LimitGroup
|
|
28
26
|
} from './limit-groups';
|
|
29
27
|
import { LimitProvenance } from './LimitProvenance';
|
|
30
28
|
|
|
@@ -33,12 +31,10 @@ function toneOf(used: number): string {
|
|
|
33
31
|
return used >= 0.9 ? 'bg-status-error' : used >= 0.7 ? 'bg-status-needs-you' : 'bg-text';
|
|
34
32
|
}
|
|
35
33
|
|
|
36
|
-
/* A time of day when the reset is today, a weekday and a time when it is not. */
|
|
37
34
|
function resetAtLabel(resetsAt: number, now: number): string {
|
|
38
35
|
return isSameDay(resetsAt, now) ? formatClock(resetsAt) : formatWeekdayClock(resetsAt);
|
|
39
36
|
}
|
|
40
37
|
|
|
41
|
-
/* How long the window still has, or nothing once it has run out. */
|
|
42
38
|
function resetInLabel(resetsAt: number, now: number): string | null {
|
|
43
39
|
return resetsAt <= now ? null : formatCountdown(resetsAt - now);
|
|
44
40
|
}
|
|
@@ -69,7 +65,6 @@ export function WindowBar({ window, now, compact }: { window: UsageWindow; now:
|
|
|
69
65
|
className={clsx('relative cursor-default', compact ? 'h-4' : 'h-6')}
|
|
70
66
|
>
|
|
71
67
|
<div className={clsx('absolute inset-x-0 rounded-full bg-track', compact ? 'inset-y-1' : 'inset-y-1.5')} />
|
|
72
|
-
{/* Past a hundred there is nothing left to fill, so the bar stops rather than overflows. */}
|
|
73
68
|
<div
|
|
74
69
|
className={clsx('absolute left-0 rounded-full', compact ? 'inset-y-1' : 'inset-y-1.5', toneOf(window.used))}
|
|
75
70
|
style={{ width: `${Math.min(100, percent)}%` }}
|
|
@@ -157,7 +152,6 @@ export function LimitsList({ limits, now, compact = false }: LimitsListProps) {
|
|
|
157
152
|
);
|
|
158
153
|
}
|
|
159
154
|
|
|
160
|
-
/* Red where a window is nearly spent, amber where it is worth knowing, in the color of a word. */
|
|
161
155
|
function textToneOf(used: number): string {
|
|
162
156
|
return used >= 0.9 ? 'text-status-error' : used >= 0.7 ? 'text-status-needs-you' : 'text-text';
|
|
163
157
|
}
|
|
@@ -204,7 +198,6 @@ function WindowLine({ window, now }: { window: UsageWindow; now: number }) {
|
|
|
204
198
|
);
|
|
205
199
|
}
|
|
206
200
|
|
|
207
|
-
/* A window this account has not reported on: no number to draw, so an empty bar and a dash. */
|
|
208
201
|
function EmptyWindowLine({ label }: { label: string }) {
|
|
209
202
|
return (
|
|
210
203
|
<div className={WINDOW_LINE}>
|
|
@@ -276,7 +269,6 @@ interface AccountRowProps {
|
|
|
276
269
|
onToggle: () => void;
|
|
277
270
|
}
|
|
278
271
|
|
|
279
|
-
/* One account: a row that folds its windows away, or only a row with the words for why it has none. */
|
|
280
272
|
function AccountRow({ group, account, now, folded, onToggle }: AccountRowProps) {
|
|
281
273
|
const { t } = useTranslation('agent-usage');
|
|
282
274
|
const empty = emptyWindows(group, account);
|
|
@@ -6,7 +6,7 @@ import { CircleHelp, Folder, Info } from 'lucide-react';
|
|
|
6
6
|
import { useState } from 'react';
|
|
7
7
|
import { useTranslation } from 'react-i18next';
|
|
8
8
|
import { useModelName } from '../agents/model-name';
|
|
9
|
-
import { useHostProjectLook } from '../host-hooks';
|
|
9
|
+
import { useHostProjectLook } from '../host/host-hooks';
|
|
10
10
|
import { useChatScope } from '../scope';
|
|
11
11
|
import type { UsageMetric } from '../state/usage';
|
|
12
12
|
import { ChartLogo } from './ChartLogo';
|
|
@@ -38,7 +38,6 @@ function ProviderMark({ provider }: { provider: UsageProvider }) {
|
|
|
38
38
|
);
|
|
39
39
|
}
|
|
40
40
|
|
|
41
|
-
/* The name the machine's catalog gives the model, where it has the model; the slug made readable where it does not. */
|
|
42
41
|
function ModelName({ provider, slug }: { provider: UsageProvider; slug: string }) {
|
|
43
42
|
return useModelName(provider, slug);
|
|
44
43
|
}
|
|
@@ -108,7 +107,6 @@ function ModelRows({ models, metric, total }: { models: readonly UsageModel[]; m
|
|
|
108
107
|
);
|
|
109
108
|
}
|
|
110
109
|
|
|
111
|
-
/* One project's row, under the name and the mark its host gives it, or its folder's own under a folder. */
|
|
112
110
|
function ProjectRow({ project, top, money }: { project: UsageProject; top: number; money(usd: number): string }) {
|
|
113
111
|
// The usage on screen is one host's, so the look of a project is that host's too.
|
|
114
112
|
const look = useHostProjectLook(useChatScope().id, project.projectId);
|
|
@@ -154,7 +152,6 @@ function ProjectRows({ projects }: { projects: readonly UsageProject[] }) {
|
|
|
154
152
|
);
|
|
155
153
|
}
|
|
156
154
|
|
|
157
|
-
/* The chart written out per calendar day, a column per provider that did anything in the period. */
|
|
158
155
|
function DayRows({ summary, providers }: { summary: UsageSummaryResult; providers: readonly UsageProvider[] }) {
|
|
159
156
|
const { t } = useTranslation('agent-usage');
|
|
160
157
|
const money = useMoney();
|
|
@@ -199,7 +196,6 @@ interface UsageBreakdownProps {
|
|
|
199
196
|
providers: readonly UsageProvider[];
|
|
200
197
|
}
|
|
201
198
|
|
|
202
|
-
/* The same period cut three ways: which model, which checkout, and which day it went on. */
|
|
203
199
|
export function UsageBreakdown({ summary, metric, providers }: UsageBreakdownProps) {
|
|
204
200
|
const { t } = useTranslation('agent-usage');
|
|
205
201
|
const [tab, setTab] = useState<Breakdown>('models');
|