@agent-native/toolkit 0.228.0-nightly-20261111212500 → 0.228.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/agent-native.eject.json +2 -0
- package/dist/app/agentkit/react/approval-card.d.ts.map +1 -1
- package/dist/app/agentkit/react/approval-card.js +5 -3
- package/dist/app/agentkit/react/approval-card.js.map +1 -1
- package/dist/app/agentkit/react/code-block.d.ts +32 -0
- package/dist/app/agentkit/react/code-block.d.ts.map +1 -0
- package/dist/app/agentkit/react/code-block.js +125 -0
- package/dist/app/agentkit/react/code-block.js.map +1 -0
- package/dist/app/agentkit/react/components.d.ts +33 -14
- package/dist/app/agentkit/react/components.d.ts.map +1 -1
- package/dist/app/agentkit/react/components.js +843 -168
- package/dist/app/agentkit/react/components.js.map +1 -1
- package/dist/app/agentkit/react/context-usage.d.ts +45 -0
- package/dist/app/agentkit/react/context-usage.d.ts.map +1 -0
- package/dist/app/agentkit/react/context-usage.js +93 -0
- package/dist/app/agentkit/react/context-usage.js.map +1 -0
- package/dist/app/agentkit/react/context.d.ts +42 -3
- package/dist/app/agentkit/react/context.d.ts.map +1 -1
- package/dist/app/agentkit/react/context.js +46 -1
- package/dist/app/agentkit/react/context.js.map +1 -1
- package/dist/app/agentkit/react/disclosure-content.d.ts +12 -0
- package/dist/app/agentkit/react/disclosure-content.d.ts.map +1 -0
- package/dist/app/agentkit/react/disclosure-content.js +33 -0
- package/dist/app/agentkit/react/disclosure-content.js.map +1 -0
- package/dist/app/agentkit/react/duration.d.ts +6 -0
- package/dist/app/agentkit/react/duration.d.ts.map +1 -0
- package/dist/app/agentkit/react/duration.js +21 -0
- package/dist/app/agentkit/react/duration.js.map +1 -0
- package/dist/app/agentkit/react/file-change.d.ts +33 -0
- package/dist/app/agentkit/react/file-change.d.ts.map +1 -0
- package/dist/app/agentkit/react/file-change.js +83 -0
- package/dist/app/agentkit/react/file-change.js.map +1 -0
- package/dist/app/agentkit/react/file-diff.d.ts +17 -0
- package/dist/app/agentkit/react/file-diff.d.ts.map +1 -0
- package/dist/app/agentkit/react/file-diff.js +94 -0
- package/dist/app/agentkit/react/file-diff.js.map +1 -0
- package/dist/app/agentkit/react/index.d.ts +7 -0
- package/dist/app/agentkit/react/index.d.ts.map +1 -1
- package/dist/app/agentkit/react/index.js +7 -0
- package/dist/app/agentkit/react/index.js.map +1 -1
- package/dist/app/agentkit/react/question-card.d.ts +67 -0
- package/dist/app/agentkit/react/question-card.d.ts.map +1 -0
- package/dist/app/agentkit/react/question-card.js +198 -0
- package/dist/app/agentkit/react/question-card.js.map +1 -0
- package/dist/app/agentkit/react/root.d.ts +3 -2
- package/dist/app/agentkit/react/root.d.ts.map +1 -1
- package/dist/app/agentkit/react/root.js +2 -2
- package/dist/app/agentkit/react/root.js.map +1 -1
- package/dist/app/agentkit/react/roving-focus.d.ts +4 -0
- package/dist/app/agentkit/react/roving-focus.d.ts.map +1 -0
- package/dist/app/agentkit/react/roving-focus.js +75 -0
- package/dist/app/agentkit/react/roving-focus.js.map +1 -0
- package/dist/app/agentkit/react/stack-trace.d.ts +34 -0
- package/dist/app/agentkit/react/stack-trace.d.ts.map +1 -0
- package/dist/app/agentkit/react/stack-trace.js +121 -0
- package/dist/app/agentkit/react/stack-trace.js.map +1 -0
- package/dist/app/agentkit/react/stop-button.d.ts.map +1 -1
- package/dist/app/agentkit/react/stop-button.js +22 -6
- package/dist/app/agentkit/react/stop-button.js.map +1 -1
- package/dist/app/agentkit/react/styles.css +1306 -395
- package/dist/app/agentkit/react/terminal.d.ts +28 -0
- package/dist/app/agentkit/react/terminal.d.ts.map +1 -0
- package/dist/app/agentkit/react/terminal.js +84 -0
- package/dist/app/agentkit/react/terminal.js.map +1 -0
- package/dist/app/agentkit/react/trace.d.ts +31 -0
- package/dist/app/agentkit/react/trace.d.ts.map +1 -0
- package/dist/app/agentkit/react/trace.js +73 -0
- package/dist/app/agentkit/react/trace.js.map +1 -0
- package/dist/app/blocks/library/HighlightedCode.d.ts +2 -1
- package/dist/app/blocks/library/HighlightedCode.d.ts.map +1 -1
- package/dist/app/blocks/library/HighlightedCode.js +8 -111
- package/dist/app/blocks/library/HighlightedCode.js.map +1 -1
- package/dist/app/chat/AgentKitAssistantChat.d.ts.map +1 -1
- package/dist/app/chat/AgentKitAssistantChat.js +23 -245
- package/dist/app/chat/AgentKitAssistantChat.js.map +1 -1
- package/dist/app/chat/agentkit-chat/guided-questions.d.ts +15 -1
- package/dist/app/chat/agentkit-chat/guided-questions.d.ts.map +1 -1
- package/dist/app/chat/agentkit-chat/guided-questions.js +142 -2
- package/dist/app/chat/agentkit-chat/guided-questions.js.map +1 -1
- package/dist/app/chat/agentkit-chat/history.js +1 -1
- package/dist/app/chat/agentkit-chat/history.js.map +1 -1
- package/dist/app/chat/agentkit-chat/index.d.ts +1 -1
- package/dist/app/chat/agentkit-chat/index.d.ts.map +1 -1
- package/dist/app/chat/agentkit-chat/index.js +1 -1
- package/dist/app/chat/agentkit-chat/index.js.map +1 -1
- package/dist/app/chat/agentkit-chat/labels.d.ts +5 -0
- package/dist/app/chat/agentkit-chat/labels.d.ts.map +1 -0
- package/dist/app/chat/agentkit-chat/labels.js +245 -0
- package/dist/app/chat/agentkit-chat/labels.js.map +1 -0
- package/dist/app/chat/agentkit-chat/questions.d.ts +1 -1
- package/dist/app/chat/agentkit-chat/questions.d.ts.map +1 -1
- package/dist/app/chat/agentkit-chat/questions.js +1 -1
- package/dist/app/chat/agentkit-chat/questions.js.map +1 -1
- package/dist/app/chat/agentkit-chat/root.d.ts.map +1 -1
- package/dist/app/chat/agentkit-chat/root.js +5 -64
- package/dist/app/chat/agentkit-chat/root.js.map +1 -1
- package/dist/app/chat/agentkit-chat/work-step-labels.d.ts +2 -0
- package/dist/app/chat/agentkit-chat/work-step-labels.d.ts.map +1 -1
- package/dist/app/chat/agentkit-chat/work-step-labels.js +31 -0
- package/dist/app/chat/agentkit-chat/work-step-labels.js.map +1 -1
- package/dist/app/chat/chat/markdown-renderer.d.ts +2 -12
- package/dist/app/chat/chat/markdown-renderer.d.ts.map +1 -1
- package/dist/app/chat/chat/markdown-renderer.js +2 -41
- package/dist/app/chat/chat/markdown-renderer.js.map +1 -1
- package/dist/app/chat/chat/tool-call-display.d.ts.map +1 -1
- package/dist/app/chat/chat/tool-call-display.js +2 -2
- package/dist/app/chat/chat/tool-call-display.js.map +1 -1
- package/dist/app/chat/conversation/AgentConversation.d.ts.map +1 -1
- package/dist/app/chat/conversation/AgentConversation.js +2 -37
- package/dist/app/chat/conversation/AgentConversation.js.map +1 -1
- package/dist/app/chat/tool-cells/BashCell.d.ts +3 -1
- package/dist/app/chat/tool-cells/BashCell.d.ts.map +1 -1
- package/dist/app/chat/tool-cells/BashCell.js +4 -40
- package/dist/app/chat/tool-cells/BashCell.js.map +1 -1
- package/dist/app/chat/tool-cells/EditCell.d.ts.map +1 -1
- package/dist/app/chat/tool-cells/EditCell.js +5 -108
- package/dist/app/chat/tool-cells/EditCell.js.map +1 -1
- package/dist/app/chat/tool-cells/FilesChangedSummary.d.ts.map +1 -1
- package/dist/app/chat/tool-cells/FilesChangedSummary.js +23 -81
- package/dist/app/chat/tool-cells/FilesChangedSummary.js.map +1 -1
- package/dist/app/chat/tool-cells/WriteCell.d.ts.map +1 -1
- package/dist/app/chat/tool-cells/WriteCell.js +5 -24
- package/dist/app/chat/tool-cells/WriteCell.js.map +1 -1
- package/dist/app/code-highlighter.d.ts +11 -0
- package/dist/app/code-highlighter.d.ts.map +1 -0
- package/dist/app/code-highlighter.js +122 -0
- package/dist/app/code-highlighter.js.map +1 -0
- package/dist/app/context-xray/ThreadContextRing.js +3 -3
- package/dist/app/context-xray/ThreadContextRing.js.map +1 -1
- package/dist/app/i18n/catalogs/ar-SA.d.ts.map +1 -1
- package/dist/app/i18n/catalogs/ar-SA.js +22 -0
- package/dist/app/i18n/catalogs/ar-SA.js.map +1 -1
- package/dist/app/i18n/catalogs/de-DE.d.ts.map +1 -1
- package/dist/app/i18n/catalogs/de-DE.js +22 -0
- package/dist/app/i18n/catalogs/de-DE.js.map +1 -1
- package/dist/app/i18n/catalogs/en-US.d.ts +22 -0
- package/dist/app/i18n/catalogs/en-US.d.ts.map +1 -1
- package/dist/app/i18n/catalogs/en-US.js +22 -0
- package/dist/app/i18n/catalogs/en-US.js.map +1 -1
- package/dist/app/i18n/catalogs/es-ES.d.ts.map +1 -1
- package/dist/app/i18n/catalogs/es-ES.js +22 -0
- package/dist/app/i18n/catalogs/es-ES.js.map +1 -1
- package/dist/app/i18n/catalogs/fr-FR.d.ts.map +1 -1
- package/dist/app/i18n/catalogs/fr-FR.js +22 -0
- package/dist/app/i18n/catalogs/fr-FR.js.map +1 -1
- package/dist/app/i18n/catalogs/hi-IN.d.ts.map +1 -1
- package/dist/app/i18n/catalogs/hi-IN.js +22 -0
- package/dist/app/i18n/catalogs/hi-IN.js.map +1 -1
- package/dist/app/i18n/catalogs/ja-JP.d.ts.map +1 -1
- package/dist/app/i18n/catalogs/ja-JP.js +22 -0
- package/dist/app/i18n/catalogs/ja-JP.js.map +1 -1
- package/dist/app/i18n/catalogs/ko-KR.d.ts.map +1 -1
- package/dist/app/i18n/catalogs/ko-KR.js +22 -0
- package/dist/app/i18n/catalogs/ko-KR.js.map +1 -1
- package/dist/app/i18n/catalogs/pt-BR.d.ts.map +1 -1
- package/dist/app/i18n/catalogs/pt-BR.js +22 -0
- package/dist/app/i18n/catalogs/pt-BR.js.map +1 -1
- package/dist/app/i18n/catalogs/zh-CN.d.ts.map +1 -1
- package/dist/app/i18n/catalogs/zh-CN.js +22 -0
- package/dist/app/i18n/catalogs/zh-CN.js.map +1 -1
- package/dist/app/i18n/catalogs/zh-TW.d.ts.map +1 -1
- package/dist/app/i18n/catalogs/zh-TW.js +22 -0
- package/dist/app/i18n/catalogs/zh-TW.js.map +1 -1
- package/dist/app/onboarding/first-run-first-paint.d.ts +10 -0
- package/dist/app/onboarding/first-run-first-paint.d.ts.map +1 -0
- package/dist/app/onboarding/first-run-first-paint.js +22 -0
- package/dist/app/onboarding/first-run-first-paint.js.map +1 -0
- package/dist/app/onboarding/first-run-startup-gate.d.ts +3 -1
- package/dist/app/onboarding/first-run-startup-gate.d.ts.map +1 -1
- package/dist/app/onboarding/first-run-startup-gate.js +30 -6
- package/dist/app/onboarding/first-run-startup-gate.js.map +1 -1
- package/dist/app/providers/AppProviders.d.ts.map +1 -1
- package/dist/app/providers/AppProviders.js +9 -2
- package/dist/app/providers/AppProviders.js.map +1 -1
- package/dist/app/providers/BuilderSignupActivation.d.ts +2 -1
- package/dist/app/providers/BuilderSignupActivation.d.ts.map +1 -1
- package/dist/app/providers/BuilderSignupActivation.js +6 -3
- package/dist/app/providers/BuilderSignupActivation.js.map +1 -1
- package/dist/app/shared/AppShellSkeleton.d.ts.map +1 -1
- package/dist/app/shared/AppShellSkeleton.js +11 -1
- package/dist/app/shared/AppShellSkeleton.js.map +1 -1
- package/dist/app/styles/agent-native.css +2 -2
- package/dist/app/styles/tokens/agent-kit.css +20 -3
- package/dist/composer/AgentSuggestionBar.d.ts.map +1 -1
- package/dist/composer/AgentSuggestionBar.js +2 -2
- package/dist/composer/AgentSuggestionBar.js.map +1 -1
- package/dist/composer/ComposerContextMenu.js +4 -4
- package/dist/composer/ComposerContextMenu.js.map +1 -1
- package/dist/composer/ComposerContextPicker.d.ts.map +1 -1
- package/dist/composer/ComposerContextPicker.js +2 -2
- package/dist/composer/ComposerContextPicker.js.map +1 -1
- package/dist/composer/ComposerContextPickerDialog.d.ts.map +1 -1
- package/dist/composer/ComposerContextPickerDialog.js +2 -2
- package/dist/composer/ComposerContextPickerDialog.js.map +1 -1
- package/dist/composer/ComposerModePicker.d.ts.map +1 -1
- package/dist/composer/ComposerModePicker.js +2 -1
- package/dist/composer/ComposerModePicker.js.map +1 -1
- package/dist/composer/ComposerPlusMenu.js +1 -1
- package/dist/composer/ComposerPlusMenu.js.map +1 -1
- package/dist/composer/MentionChip.js +1 -1
- package/dist/composer/MentionChip.js.map +1 -1
- package/dist/composer/MentionPopover.d.ts +3 -0
- package/dist/composer/MentionPopover.d.ts.map +1 -1
- package/dist/composer/MentionPopover.js +34 -15
- package/dist/composer/MentionPopover.js.map +1 -1
- package/dist/composer/MessageQueueDrawer.d.ts.map +1 -1
- package/dist/composer/MessageQueueDrawer.js +14 -9
- package/dist/composer/MessageQueueDrawer.js.map +1 -1
- package/dist/composer/PastedTextChip.d.ts.map +1 -1
- package/dist/composer/PastedTextChip.js +14 -18
- package/dist/composer/PastedTextChip.js.map +1 -1
- package/dist/composer/PromptBar.js +1 -1
- package/dist/composer/PromptBar.js.map +1 -1
- package/dist/composer/PromptComposer.d.ts.map +1 -1
- package/dist/composer/PromptComposer.js +11 -9
- package/dist/composer/PromptComposer.js.map +1 -1
- package/dist/composer/RealtimeVoiceMode.js +2 -2
- package/dist/composer/RealtimeVoiceMode.js.map +1 -1
- package/dist/composer/TiptapComposer.d.ts.map +1 -1
- package/dist/composer/TiptapComposer.js +52 -89
- package/dist/composer/TiptapComposer.js.map +1 -1
- package/dist/composer/VoiceButton.d.ts +3 -1
- package/dist/composer/VoiceButton.d.ts.map +1 -1
- package/dist/composer/VoiceButton.js +10 -8
- package/dist/composer/VoiceButton.js.map +1 -1
- package/dist/composer/composer-notice.js +3 -3
- package/dist/composer/composer-notice.js.map +1 -1
- package/dist/composer/extensions/FileReference.js +1 -1
- package/dist/composer/extensions/FileReference.js.map +1 -1
- package/dist/composer/extensions/SkillReference.js +1 -1
- package/dist/composer/extensions/SkillReference.js.map +1 -1
- package/dist/composer/popover-surface.d.ts +1 -1
- package/dist/composer/popover-surface.d.ts.map +1 -1
- package/dist/composer/popover-surface.js +1 -1
- package/dist/composer/popover-surface.js.map +1 -1
- package/dist/context-ui/ContextUsageRing.d.ts +1 -45
- package/dist/context-ui/ContextUsageRing.d.ts.map +1 -1
- package/dist/context-ui/ContextUsageRing.js +2 -87
- package/dist/context-ui/ContextUsageRing.js.map +1 -1
- package/dist/context-ui/index.d.ts +2 -2
- package/dist/context-ui/index.d.ts.map +1 -1
- package/dist/context-ui/index.js +2 -2
- package/dist/context-ui/index.js.map +1 -1
- package/package.json +4 -4
- package/src/app/agentkit/react/approval-card.tsx +14 -2
- package/src/app/agentkit/react/code-block.spec.tsx +154 -0
- package/src/app/agentkit/react/code-block.tsx +317 -0
- package/src/app/agentkit/react/components.interaction.spec.tsx +7 -0
- package/src/app/agentkit/react/components.papercuts.spec.tsx +143 -2
- package/src/app/agentkit/react/components.spec.tsx +40 -47
- package/src/app/agentkit/react/components.tsx +1533 -413
- package/src/app/agentkit/react/composer-context.spec.tsx +35 -0
- package/src/app/agentkit/react/context-usage.tsx +353 -0
- package/src/app/agentkit/react/context.tsx +93 -1
- package/src/app/agentkit/react/disclosure-content.ts +42 -0
- package/src/app/agentkit/react/disclosures.spec.tsx +62 -4
- package/src/app/agentkit/react/duration.ts +22 -0
- package/src/app/agentkit/react/file-change.spec.tsx +124 -0
- package/src/app/agentkit/react/file-change.tsx +228 -0
- package/src/app/agentkit/react/file-diff.ts +110 -0
- package/src/app/agentkit/react/index.ts +7 -0
- package/src/app/agentkit/react/lifecycle.spec.tsx +565 -20
- package/src/app/agentkit/react/markdown.spec.tsx +18 -8
- package/src/app/agentkit/react/message-actions.spec.tsx +55 -1
- package/src/app/agentkit/react/notices.spec.tsx +4 -4
- package/src/app/agentkit/react/optimistic-send.spec.tsx +43 -0
- package/src/app/agentkit/react/question-card.spec.tsx +276 -0
- package/src/app/agentkit/react/question-card.tsx +533 -0
- package/src/app/agentkit/react/root.tsx +4 -0
- package/src/app/agentkit/react/roving-focus.spec.tsx +114 -0
- package/src/app/agentkit/react/roving-focus.ts +82 -0
- package/src/app/agentkit/react/stack-trace.spec.tsx +177 -0
- package/src/app/agentkit/react/stack-trace.tsx +281 -0
- package/src/app/agentkit/react/stop-button.spec.tsx +40 -0
- package/src/app/agentkit/react/stop-button.tsx +22 -5
- package/src/app/agentkit/react/styles.css +1306 -395
- package/src/app/agentkit/react/subagent-step.spec.tsx +554 -0
- package/src/app/agentkit/react/terminal.spec.tsx +228 -0
- package/src/app/agentkit/react/terminal.tsx +228 -0
- package/src/app/agentkit/react/trace.spec.tsx +120 -0
- package/src/app/agentkit/react/trace.tsx +239 -0
- package/src/app/blocks/library/HighlightedCode.tsx +14 -126
- package/src/app/chat/AgentKitAssistantChat.spec.tsx +28 -12
- package/src/app/chat/AgentKitAssistantChat.tsx +27 -253
- package/src/app/chat/agentkit-chat/approval-card.spec.tsx +1 -0
- package/src/app/chat/agentkit-chat/guided-questions.flow.spec.tsx +381 -0
- package/src/app/chat/agentkit-chat/guided-questions.tsx +236 -3
- package/src/app/chat/agentkit-chat/history.tsx +1 -1
- package/src/app/chat/agentkit-chat/index.ts +2 -0
- package/src/app/chat/agentkit-chat/labels.ts +259 -0
- package/src/app/chat/agentkit-chat/questions.ts +2 -0
- package/src/app/chat/agentkit-chat/root.spec.tsx +18 -0
- package/src/app/chat/agentkit-chat/root.tsx +5 -64
- package/src/app/chat/agentkit-chat/work-step-labels.ts +42 -0
- package/src/app/chat/chat/markdown-renderer.tsx +2 -59
- package/src/app/chat/chat/tool-call-display.spec.tsx +26 -14
- package/src/app/chat/chat/tool-call-display.tsx +2 -1
- package/src/app/chat/conversation/AgentConversation.tsx +2 -50
- package/src/app/chat/tool-cells/BashCell.tsx +14 -136
- package/src/app/chat/tool-cells/EditCell.tsx +11 -248
- package/src/app/chat/tool-cells/FilesChangedSummary.spec.tsx +62 -5
- package/src/app/chat/tool-cells/FilesChangedSummary.tsx +31 -162
- package/src/app/chat/tool-cells/WriteCell.tsx +11 -121
- package/src/app/code-highlighter.ts +131 -0
- package/src/app/context-xray/ThreadContextRing.tsx +7 -7
- package/src/app/i18n/catalogs/ar-SA.ts +22 -0
- package/src/app/i18n/catalogs/de-DE.ts +22 -0
- package/src/app/i18n/catalogs/en-US.ts +22 -0
- package/src/app/i18n/catalogs/es-ES.ts +22 -0
- package/src/app/i18n/catalogs/fr-FR.ts +22 -0
- package/src/app/i18n/catalogs/hi-IN.ts +22 -0
- package/src/app/i18n/catalogs/ja-JP.ts +22 -0
- package/src/app/i18n/catalogs/ko-KR.ts +22 -0
- package/src/app/i18n/catalogs/pt-BR.ts +22 -0
- package/src/app/i18n/catalogs/zh-CN.ts +22 -0
- package/src/app/i18n/catalogs/zh-TW.ts +22 -0
- package/src/app/onboarding/first-run-first-paint.spec.ts +39 -0
- package/src/app/onboarding/first-run-first-paint.ts +24 -0
- package/src/app/onboarding/first-run-startup-gate.spec.tsx +125 -13
- package/src/app/onboarding/first-run-startup-gate.tsx +48 -5
- package/src/app/providers/AppProviders.tsx +18 -0
- package/src/app/providers/BuilderSignupActivation.tsx +8 -2
- package/src/app/shared/AppShellSkeleton.spec.tsx +60 -1
- package/src/app/shared/AppShellSkeleton.tsx +31 -1
- package/src/app/styles/agent-native.css +2 -2
- package/src/app/styles/agent-native.spec.ts +2 -2
- package/src/app/styles/tokens/agent-kit.css +20 -3
- package/src/composer/AgentSuggestionBar.spec.tsx +3 -1
- package/src/composer/AgentSuggestionBar.tsx +5 -2
- package/src/composer/ComposerContextMenu.tsx +4 -4
- package/src/composer/ComposerContextPicker.tsx +8 -2
- package/src/composer/ComposerContextPickerDialog.tsx +5 -2
- package/src/composer/ComposerModePicker.tsx +2 -1
- package/src/composer/ComposerPlusMenu.tsx +1 -1
- package/src/composer/MentionChip.tsx +1 -1
- package/src/composer/MentionPopover.spec.tsx +108 -2
- package/src/composer/MentionPopover.tsx +93 -17
- package/src/composer/MessageQueueDrawer.spec.tsx +5 -5
- package/src/composer/MessageQueueDrawer.tsx +19 -12
- package/src/composer/PastedTextChip.spec.tsx +36 -0
- package/src/composer/PastedTextChip.tsx +52 -58
- package/src/composer/PromptBar.tsx +1 -1
- package/src/composer/PromptComposer.context.spec.tsx +2 -2
- package/src/composer/PromptComposer.submission.spec.tsx +27 -0
- package/src/composer/PromptComposer.tsx +17 -9
- package/src/composer/RealtimeVoiceMode.tsx +2 -2
- package/src/composer/TiptapComposer.model-picker.spec.tsx +23 -82
- package/src/composer/TiptapComposer.tsx +68 -145
- package/src/composer/VoiceButton.tsx +12 -7
- package/src/composer/composer-notice.tsx +3 -3
- package/src/composer/extensions/FileReference.tsx +1 -1
- package/src/composer/extensions/SkillReference.tsx +1 -1
- package/src/composer/popover-surface.ts +1 -1
- package/src/context-ui/ContextUsageRing.spec.tsx +33 -8
- package/src/context-ui/ContextUsageRing.tsx +13 -348
- package/src/context-ui/index.ts +7 -1
- package/dist/composer/ModelPickerParts.d.ts +0 -20
- package/dist/composer/ModelPickerParts.d.ts.map +0 -1
- package/dist/composer/ModelPickerParts.js +0 -77
- package/dist/composer/ModelPickerParts.js.map +0 -1
- package/src/composer/ModelPickerParts.tsx +0 -188
|
@@ -0,0 +1,259 @@
|
|
|
1
|
+
import type { useFormatters, useT } from "@agent-native/core/client/i18n";
|
|
2
|
+
|
|
3
|
+
import type { AgentKitLabels } from "../../agentkit/react/context.js";
|
|
4
|
+
import {
|
|
5
|
+
agentKitQuestionLabels,
|
|
6
|
+
agentKitWorkStepLabels,
|
|
7
|
+
} from "./work-step-labels.js";
|
|
8
|
+
|
|
9
|
+
/** Both Chat roots, the sidebar and the /chat route, spread these labels. */
|
|
10
|
+
export function agentKitChatLabels(
|
|
11
|
+
t: ReturnType<typeof useT>,
|
|
12
|
+
formatDate: ReturnType<typeof useFormatters>["formatDate"],
|
|
13
|
+
): Partial<AgentKitLabels> {
|
|
14
|
+
return {
|
|
15
|
+
conversation: t("agentChat.message.messages"),
|
|
16
|
+
assistant: t("agentChat.common.agent"),
|
|
17
|
+
you: t("agentChat.common.you"),
|
|
18
|
+
approvalApprove: t("agentChat.approval.approve"),
|
|
19
|
+
approvalDeny: t("agentChat.approval.deny"),
|
|
20
|
+
approvalSubmit: t("agentChat.approval.submit"),
|
|
21
|
+
approvalOther: t("agentChat.approval.other"),
|
|
22
|
+
approvalOtherPlaceholder: t("agentChat.approval.otherPlaceholder"),
|
|
23
|
+
approvalPending: t("agentChat.approval.pending"),
|
|
24
|
+
approvalAnswerPending: t("agentChat.approval.answerPending"),
|
|
25
|
+
connectionConnect: t("agentChat.common.connect"),
|
|
26
|
+
connectionConnecting: t("agentChat.connection.connecting"),
|
|
27
|
+
connectionRetry: t("agentChat.common.retry"),
|
|
28
|
+
connectionConnected: t("agentChat.integrations.connectedSection"),
|
|
29
|
+
connectionNotNow: t("agentChat.connection.notNow"),
|
|
30
|
+
connectionFailed: t("agentChat.connection.failed"),
|
|
31
|
+
connectionAdminRequired: t("agentChat.connection.adminRequired"),
|
|
32
|
+
activities: t("agentChat.activity.groupLabel"),
|
|
33
|
+
activityBuckets: {
|
|
34
|
+
thinking: t("agentChat.activity.bucketThinking"),
|
|
35
|
+
research: t("agentChat.activity.bucketResearch"),
|
|
36
|
+
actions: t("agentChat.activity.bucketActions"),
|
|
37
|
+
other: t("agentChat.activity.bucketOther"),
|
|
38
|
+
},
|
|
39
|
+
agents: t("agentChat.activity.agents"),
|
|
40
|
+
tasks: t("agentChat.activity.tasks"),
|
|
41
|
+
tasksProgress: t("agentChat.activity.tasksProgress", {
|
|
42
|
+
completed: "{{completed}}",
|
|
43
|
+
total: "{{total}}",
|
|
44
|
+
}),
|
|
45
|
+
toolInput: t("agentChat.tool.input"),
|
|
46
|
+
toolResult: t("agentChat.tool.result"),
|
|
47
|
+
activityValueIdentifierHidden: t("agentChat.tool.identifierHidden"),
|
|
48
|
+
activityValueOmitted: t("agentChat.tool.contentOmitted"),
|
|
49
|
+
activityValueCircular: t("agentChat.tool.circularReference"),
|
|
50
|
+
working: t("agentChat.status.working"),
|
|
51
|
+
workingFor: t("agentChat.status.workingFor", {
|
|
52
|
+
duration: "{{duration}}",
|
|
53
|
+
}),
|
|
54
|
+
worked: t("agentChat.tool.worked"),
|
|
55
|
+
workedFor: t("agentChat.tool.workedFor", { duration: "{{duration}}" }),
|
|
56
|
+
showMoreActivities: t("agentChat.activity.showMore", {
|
|
57
|
+
count: "{{count}}",
|
|
58
|
+
}),
|
|
59
|
+
...agentKitWorkStepLabels(t),
|
|
60
|
+
...agentKitQuestionLabels(t),
|
|
61
|
+
durationHourShort: t("agentChat.duration.hourShort"),
|
|
62
|
+
durationMinuteShort: t("agentChat.duration.minuteShort"),
|
|
63
|
+
durationSecondShort: t("agentChat.duration.secondShort"),
|
|
64
|
+
composerLabel: t("agentChat.composer.messageAgent"),
|
|
65
|
+
composerReplyPlaceholder: t("agentChat.composer.replyPlaceholder"),
|
|
66
|
+
emptyStateText: t("agentChat.empty.prompt"),
|
|
67
|
+
queue: t("agentChat.queue.label"),
|
|
68
|
+
queueSendNow: t("agentChat.queue.sendNow"),
|
|
69
|
+
queueSendNowHint: t("agentChat.queue.sendNowHint"),
|
|
70
|
+
queueSendNext: t("agentChat.queue.sendNext"),
|
|
71
|
+
queueSendNextHint: t("agentChat.queue.sendNextHint"),
|
|
72
|
+
queueItemBusy: t("agentChat.queue.itemBusy"),
|
|
73
|
+
queueItemBlocked: t("agentChat.queue.itemBlocked"),
|
|
74
|
+
queueOrderStale: t("agentChat.queue.orderStale"),
|
|
75
|
+
queueRemove: t("agentChat.queue.remove"),
|
|
76
|
+
queueMore: t("agentChat.queue.moreActions"),
|
|
77
|
+
suggestions: t("agentChat.composer.suggestedPrompts"),
|
|
78
|
+
copy: t("agentChat.message.copyMessage"),
|
|
79
|
+
copied: t("agentChat.common.copied"),
|
|
80
|
+
messageActions: t("agentChat.message.actions"),
|
|
81
|
+
copyRequestId: t("agentChat.message.copyRequestId"),
|
|
82
|
+
usage: t("agentChat.message.usage"),
|
|
83
|
+
usageLoading: t("agentChat.message.usageLoading"),
|
|
84
|
+
usageUnavailable: t("agentChat.message.usageUnavailable"),
|
|
85
|
+
usageNotRecorded: t("agentChat.message.usageNotRecorded"),
|
|
86
|
+
usageIncomplete: t("agentChat.message.usageIncomplete"),
|
|
87
|
+
usageReportedCost: t("agentChat.message.usageReportedCost", {
|
|
88
|
+
amount: "{{amount}}",
|
|
89
|
+
}),
|
|
90
|
+
usageEstimatedCost: t("agentChat.message.usageEstimatedCost", {
|
|
91
|
+
amount: "{{amount}}",
|
|
92
|
+
}),
|
|
93
|
+
usageMixedCost: t("agentChat.message.usageMixedCost", {
|
|
94
|
+
amount: "{{amount}}",
|
|
95
|
+
}),
|
|
96
|
+
usageBuilderCredits: t("agentChat.message.usageBuilderCredits", {
|
|
97
|
+
amount: "{{amount}}",
|
|
98
|
+
}),
|
|
99
|
+
usageEstimatedBuilderCredits: t(
|
|
100
|
+
"agentChat.message.usageEstimatedBuilderCredits",
|
|
101
|
+
{ amount: "{{amount}}" },
|
|
102
|
+
),
|
|
103
|
+
usageMixedBuilderCredits: t("agentChat.message.usageMixedBuilderCredits", {
|
|
104
|
+
amount: "{{amount}}",
|
|
105
|
+
}),
|
|
106
|
+
requestIdUnavailable: t("agentChat.message.requestIdUnavailable"),
|
|
107
|
+
runDetails: t("agentChat.message.runDetails"),
|
|
108
|
+
runCreditsUsed: t("agentChat.message.creditsUsed"),
|
|
109
|
+
runCost: t("agentChat.message.cost"),
|
|
110
|
+
runToolCalls: t("agentChat.message.toolCalls"),
|
|
111
|
+
runModel: t("agentChat.message.modelUsed"),
|
|
112
|
+
runDetailUnavailable: t("agentChat.message.detailUnavailable"),
|
|
113
|
+
runDetailNotRecorded: t("agentChat.message.notRecorded"),
|
|
114
|
+
runDetailIncomplete: t("agentChat.message.incomplete"),
|
|
115
|
+
runDetailEstimated: t("agentChat.message.estimatedAmount", {
|
|
116
|
+
amount: "{{amount}}",
|
|
117
|
+
}),
|
|
118
|
+
runDetailMixed: t("agentChat.message.mixedAmount", {
|
|
119
|
+
amount: "{{amount}}",
|
|
120
|
+
}),
|
|
121
|
+
suggestedActions: t("agentChat.composer.suggestedActions"),
|
|
122
|
+
messageUnavailable: t("agentChat.message.unavailable"),
|
|
123
|
+
navigationUnavailable: t("agentChat.message.navigationUnavailable"),
|
|
124
|
+
copyUnavailable: t("agentChat.recovery.copyFailed"),
|
|
125
|
+
positiveFeedback: t("agentChat.feedback.thumbsUp"),
|
|
126
|
+
negativeFeedback: t("agentChat.feedback.notHelpful"),
|
|
127
|
+
feedbackSubmitted: t("agentChat.feedback.submitted"),
|
|
128
|
+
feedbackWhatWentWrong: t("agentChat.feedback.whatWentWrong"),
|
|
129
|
+
feedbackPlaceholder: t("agentChat.feedback.placeholder"),
|
|
130
|
+
feedbackKeyboardHint: t("agentChat.feedback.keyboardHint", {
|
|
131
|
+
shortcut: "{{shortcut}}",
|
|
132
|
+
}),
|
|
133
|
+
feedbackSubmit: t("agentChat.feedback.submit"),
|
|
134
|
+
feedbackReasonMisread: t("agentChat.feedback.reasonMisread"),
|
|
135
|
+
feedbackReasonNotDone: t("agentChat.feedback.reasonNotDone"),
|
|
136
|
+
feedbackReasonWrongNumbers: t("agentChat.feedback.reasonWrongNumbers"),
|
|
137
|
+
feedbackReasonTooSlow: t("agentChat.feedback.tooSlow"),
|
|
138
|
+
feedbackCopyDetails: t("agentChat.feedback.copyDetails"),
|
|
139
|
+
feedback: t("agentChat.feedback.label"),
|
|
140
|
+
feedbackGood: t("agentChat.feedback.goodResponse"),
|
|
141
|
+
feedbackBad: t("agentChat.feedback.badResponse"),
|
|
142
|
+
rateResponse: t("agentChat.feedback.rate"),
|
|
143
|
+
forkFromHere: t("agentChat.message.forkFromHere"),
|
|
144
|
+
feedbackNote: t("agentChat.feedback.note"),
|
|
145
|
+
moreMessageActions: t("agentChat.message.moreActions"),
|
|
146
|
+
fewerMessageActions: t("agentChat.message.fewerActions"),
|
|
147
|
+
fork: t("agentChat.message.forkChat"),
|
|
148
|
+
previousBranch: t("agentChat.message.previousBranch"),
|
|
149
|
+
nextBranch: t("agentChat.message.nextBranch"),
|
|
150
|
+
branchPosition: "{{index}}/{{count}}",
|
|
151
|
+
error: t("agentChat.error.failed"),
|
|
152
|
+
renderError: t("agentChat.error.render"),
|
|
153
|
+
runFailed: t("agentChat.error.failed"),
|
|
154
|
+
continueRun: t("agentChat.common.continue"),
|
|
155
|
+
continueRunUnavailable: t("agentChat.recovery.continueUnavailable"),
|
|
156
|
+
reconnect: t("agentChat.common.reconnect"),
|
|
157
|
+
dismissNotice: t("agentChat.common.dismiss"),
|
|
158
|
+
reasoning: t("agentChat.status.thinking"),
|
|
159
|
+
expandActivity: t("agentChat.common.expand"),
|
|
160
|
+
collapseActivity: t("agentChat.common.collapse"),
|
|
161
|
+
agentStarted: t("agentChat.agent.started"),
|
|
162
|
+
agentResumed: t("agentChat.agent.resumed"),
|
|
163
|
+
agentMessaged: t("agentChat.agent.messaged"),
|
|
164
|
+
agentDelegated: t("agentChat.agent.delegated"),
|
|
165
|
+
agentWorking: t("agentChat.agent.working"),
|
|
166
|
+
agentWorkedFor: t("agentChat.agent.workedFor", {
|
|
167
|
+
duration: "{{duration}}",
|
|
168
|
+
}),
|
|
169
|
+
agentPaused: t("agentChat.agent.paused"),
|
|
170
|
+
agentCompleted: t("agentChat.agent.completed"),
|
|
171
|
+
agentFailed: t("agentChat.agent.failed"),
|
|
172
|
+
agentClosed: t("agentChat.agent.closed"),
|
|
173
|
+
editMessage: t("agentChat.message.edit"),
|
|
174
|
+
editingMessage: t("agentChat.message.editing"),
|
|
175
|
+
editingMessageHint: t("agentChat.message.editingHint"),
|
|
176
|
+
cancelEditing: t("agentChat.common.cancel"),
|
|
177
|
+
regenerateResponse: t("agentChat.common.retry"),
|
|
178
|
+
expandMessage: t("agentChat.common.expand"),
|
|
179
|
+
collapseMessage: t("agentChat.common.collapse"),
|
|
180
|
+
previewAttachment: t("agentChat.composer.previewAttachment", {
|
|
181
|
+
name: "{{name}}",
|
|
182
|
+
}),
|
|
183
|
+
pastedText: t("agentChat.pastedText.title"),
|
|
184
|
+
attachmentNotSaved: t("agentChat.composer.attachmentNotSaved"),
|
|
185
|
+
imagePreview: t("agentChat.composer.imagePreview"),
|
|
186
|
+
closePreview: t("agentChat.composer.closePreview"),
|
|
187
|
+
dropFilesToAttach: t("agentChat.composer.dropToAttach"),
|
|
188
|
+
dropFileFailed: t("agentChat.composer.droppedFileError"),
|
|
189
|
+
scrollToBottom: t("agentChat.composer.scrollToBottom"),
|
|
190
|
+
skipToComposer: t("agentChat.composer.skipToMessageBox"),
|
|
191
|
+
stop: t("agentChat.composer.stop"),
|
|
192
|
+
copyCode: t("agentChat.message.copyCode"),
|
|
193
|
+
codeCopied: t("agentChat.message.codeCopied"),
|
|
194
|
+
codeBlock: t("agentChat.message.codeBlock"),
|
|
195
|
+
codeBlockLanguage: t("agentChat.message.codeBlockLanguage", {
|
|
196
|
+
language: "{{language}}",
|
|
197
|
+
}),
|
|
198
|
+
table: t("agentChat.message.table"),
|
|
199
|
+
runStopped: t("agentChat.message.runStopped"),
|
|
200
|
+
responseReady: t("agentChat.message.responseReady"),
|
|
201
|
+
responseFailed: t("agentChat.message.responseFailed"),
|
|
202
|
+
waitingForApproval: t("agentChat.message.waitingForApproval"),
|
|
203
|
+
waitingForInput: t("agentChat.message.waitingForInput"),
|
|
204
|
+
workSummaryFailedCount: t("agentChat.message.workSummaryFailedCount", {
|
|
205
|
+
summary: "{{summary}}",
|
|
206
|
+
count: "{{count}}",
|
|
207
|
+
}),
|
|
208
|
+
taskStatusPending: t("agentChat.message.taskStatusPending"),
|
|
209
|
+
taskStatusRunning: t("agentChat.message.taskStatusRunning"),
|
|
210
|
+
taskStatusCompleted: t("agentChat.message.taskStatusCompleted"),
|
|
211
|
+
taskStatusFailed: t("agentChat.message.taskStatusFailed"),
|
|
212
|
+
taskStatusAwaitingInput: t("agentChat.message.taskStatusAwaitingInput"),
|
|
213
|
+
untitledTask: t("agentChat.message.untitledTask"),
|
|
214
|
+
connectionConnectProvider: t("agentChat.message.connectProvider", {
|
|
215
|
+
provider: "{{provider}}",
|
|
216
|
+
}),
|
|
217
|
+
connectionDeclined: t("agentChat.message.connectionDeclined", {
|
|
218
|
+
provider: "{{provider}}",
|
|
219
|
+
}),
|
|
220
|
+
connectionAdminRequiredTitle: t(
|
|
221
|
+
"agentChat.message.connectionAdminRequiredTitle",
|
|
222
|
+
{ provider: "{{provider}}" },
|
|
223
|
+
),
|
|
224
|
+
branchPositionLabel: t("agentChat.message.branchPositionLabel", {
|
|
225
|
+
index: "{{index}}",
|
|
226
|
+
count: "{{count}}",
|
|
227
|
+
}),
|
|
228
|
+
taskListChecked: t("agentChat.message.taskListChecked"),
|
|
229
|
+
taskListUnchecked: t("agentChat.message.taskListUnchecked"),
|
|
230
|
+
threadUnavailable: t("agentChat.message.threadNotFound"),
|
|
231
|
+
newChat: t("agentChat.tabs.newChat"),
|
|
232
|
+
loadingConversation: t("agentChat.empty.loadingChat"),
|
|
233
|
+
formatTimestamp: (createdAt: string) => {
|
|
234
|
+
const date = new Date(createdAt);
|
|
235
|
+
if (Number.isNaN(date.getTime())) return createdAt;
|
|
236
|
+
const now = new Date();
|
|
237
|
+
const yesterday = new Date(now);
|
|
238
|
+
yesterday.setDate(now.getDate() - 1);
|
|
239
|
+
const time = formatDate(date, {
|
|
240
|
+
hour: "numeric",
|
|
241
|
+
minute: "2-digit",
|
|
242
|
+
});
|
|
243
|
+
const sameDay = (left: Date, right: Date) =>
|
|
244
|
+
left.getFullYear() === right.getFullYear() &&
|
|
245
|
+
left.getMonth() === right.getMonth() &&
|
|
246
|
+
left.getDate() === right.getDate();
|
|
247
|
+
if (sameDay(date, now)) return time;
|
|
248
|
+
if (sameDay(date, yesterday)) {
|
|
249
|
+
return `${t("agentChat.history.yesterday")} ${time}`;
|
|
250
|
+
}
|
|
251
|
+
return formatDate(date, {
|
|
252
|
+
month: "short",
|
|
253
|
+
day: "numeric",
|
|
254
|
+
hour: "numeric",
|
|
255
|
+
minute: "2-digit",
|
|
256
|
+
});
|
|
257
|
+
},
|
|
258
|
+
};
|
|
259
|
+
}
|
|
@@ -13,6 +13,7 @@ const mocks = vi.hoisted(() => ({
|
|
|
13
13
|
|
|
14
14
|
vi.mock("@agent-native/core/client/i18n", () => ({
|
|
15
15
|
useT: () => (key: string) => key,
|
|
16
|
+
useFormatters: () => ({ formatDate: (date: Date) => date.toISOString() }),
|
|
16
17
|
}));
|
|
17
18
|
|
|
18
19
|
vi.mock("@agent-native/core/client/hooks", () => ({
|
|
@@ -72,6 +73,23 @@ describe("CoreAgentKitRoot", () => {
|
|
|
72
73
|
});
|
|
73
74
|
});
|
|
74
75
|
|
|
76
|
+
it("localizes the same AgentKit copy as the sidebar chat", () => {
|
|
77
|
+
renderToStaticMarkup(
|
|
78
|
+
<CoreAgentKitRoot transport={transport} threadId="thread-1" />,
|
|
79
|
+
);
|
|
80
|
+
|
|
81
|
+
expect(mocks.rootProps?.labels).toMatchObject({
|
|
82
|
+
agentDelegated: "agentChat.agent.delegated",
|
|
83
|
+
agentWorking: "agentChat.agent.working",
|
|
84
|
+
tasksProgress: "agentChat.activity.tasksProgress",
|
|
85
|
+
negativeFeedback: expect.stringMatching(/^agentChat\./),
|
|
86
|
+
queueSendNow: expect.stringMatching(/^agentChat\./),
|
|
87
|
+
question: "agentChat.guided.question",
|
|
88
|
+
threadLoadFailed: "agentChat.message.threadLoadFailed",
|
|
89
|
+
composerPlaceholder: "agentChat.composer.newChatPlaceholder",
|
|
90
|
+
});
|
|
91
|
+
});
|
|
92
|
+
|
|
75
93
|
it("reports the model the run's calls recorded, and none for the store's unknown", async () => {
|
|
76
94
|
renderToStaticMarkup(
|
|
77
95
|
<CoreAgentKitRoot transport={transport} threadId="thread-1" />,
|
|
@@ -4,7 +4,7 @@ import {
|
|
|
4
4
|
clearAgentNativeAgentKitUploads,
|
|
5
5
|
} from "@agent-native/core/client/agentkit-chat/transport";
|
|
6
6
|
import { callAction } from "@agent-native/core/client/hooks";
|
|
7
|
-
import { useT } from "@agent-native/core/client/i18n";
|
|
7
|
+
import { useFormatters, useT } from "@agent-native/core/client/i18n";
|
|
8
8
|
import { readFileUploadStatus } from "@agent-native/core/client/uploads";
|
|
9
9
|
import { useSession } from "@agent-native/core/client/use-session";
|
|
10
10
|
import { useMemo, useEffect } from "react";
|
|
@@ -15,7 +15,7 @@ import type { AgentKitRootProps } from "../../agentkit/react/root.js";
|
|
|
15
15
|
import { FileStorageSetupPopover } from "../FileStorageSetupPopover.js";
|
|
16
16
|
import { AgentKitActionWidget } from "./action-widget.js";
|
|
17
17
|
import { CoreAgentKitApproval } from "./approval-card.js";
|
|
18
|
-
import {
|
|
18
|
+
import { agentKitChatLabels } from "./labels.js";
|
|
19
19
|
|
|
20
20
|
// Every agent-native app serves this framework action, so run details can
|
|
21
21
|
// show credits and the model that ran without each host wiring a loader.
|
|
@@ -39,6 +39,7 @@ function coreModelDisplayName(model: string): string {
|
|
|
39
39
|
|
|
40
40
|
export function CoreAgentKitRoot(props: AgentKitRootProps) {
|
|
41
41
|
const t = useT();
|
|
42
|
+
const { formatDate } = useFormatters();
|
|
42
43
|
const nativeUpload = props.transport
|
|
43
44
|
? getAgentNativeAgentKitUploadDriver(props.transport)
|
|
44
45
|
: undefined;
|
|
@@ -117,75 +118,15 @@ export function CoreAgentKitRoot(props: AgentKitRootProps) {
|
|
|
117
118
|
}),
|
|
118
119
|
[props.slots],
|
|
119
120
|
);
|
|
120
|
-
// Thread-load states, the empty greeting, the default approval card and the
|
|
121
|
-
// reply footer render for any host, so their copy is localized here rather
|
|
122
|
-
// than left to each host.
|
|
123
121
|
const labels = useMemo(
|
|
124
122
|
() => ({
|
|
125
|
-
|
|
123
|
+
...agentKitChatLabels(t, formatDate),
|
|
126
124
|
threadLoadFailed: t("agentChat.message.threadLoadFailed"),
|
|
127
125
|
threadLoadRetry: t("agentChat.common.retry"),
|
|
128
|
-
newChat: t("agentChat.tabs.newChat"),
|
|
129
|
-
loadingConversation: t("agentChat.empty.loadingChat"),
|
|
130
|
-
emptyStateText: t("agentChat.empty.prompt"),
|
|
131
126
|
composerPlaceholder: t("agentChat.composer.newChatPlaceholder"),
|
|
132
|
-
composerReplyPlaceholder: t("agentChat.composer.replyPlaceholder"),
|
|
133
|
-
worked: t("agentChat.tool.worked"),
|
|
134
|
-
workedFor: t("agentChat.tool.workedFor", { duration: "{{duration}}" }),
|
|
135
|
-
showMoreActivities: t("agentChat.activity.showMore", {
|
|
136
|
-
count: "{{count}}",
|
|
137
|
-
}),
|
|
138
|
-
...agentKitWorkStepLabels(t),
|
|
139
|
-
approvalApprove: t("agentChat.approval.approve"),
|
|
140
|
-
approvalDeny: t("agentChat.approval.deny"),
|
|
141
|
-
approvalSubmit: t("agentChat.approval.submit"),
|
|
142
|
-
approvalOther: t("agentChat.approval.other"),
|
|
143
|
-
approvalOtherPlaceholder: t("agentChat.approval.otherPlaceholder"),
|
|
144
|
-
approvalPending: t("agentChat.approval.pending"),
|
|
145
|
-
approvalAnswerPending: t("agentChat.approval.answerPending"),
|
|
146
|
-
messageActions: t("agentChat.message.actions"),
|
|
147
|
-
moreMessageActions: t("agentChat.message.moreActions"),
|
|
148
|
-
fewerMessageActions: t("agentChat.message.fewerActions"),
|
|
149
|
-
copyRequestId: t("agentChat.message.copyRequestId"),
|
|
150
|
-
copy: t("agentChat.message.copyMessage"),
|
|
151
|
-
copied: t("agentChat.common.copied"),
|
|
152
|
-
runDetails: t("agentChat.message.runDetails"),
|
|
153
|
-
runCreditsUsed: t("agentChat.message.creditsUsed"),
|
|
154
|
-
runCost: t("agentChat.message.cost"),
|
|
155
|
-
runToolCalls: t("agentChat.message.toolCalls"),
|
|
156
|
-
runModel: t("agentChat.message.modelUsed"),
|
|
157
|
-
runDetailUnavailable: t("agentChat.message.detailUnavailable"),
|
|
158
|
-
runDetailNotRecorded: t("agentChat.message.notRecorded"),
|
|
159
|
-
runDetailIncomplete: t("agentChat.message.incomplete"),
|
|
160
|
-
runDetailEstimated: t("agentChat.message.estimatedAmount", {
|
|
161
|
-
amount: "{{amount}}",
|
|
162
|
-
}),
|
|
163
|
-
runDetailMixed: t("agentChat.message.mixedAmount", {
|
|
164
|
-
amount: "{{amount}}",
|
|
165
|
-
}),
|
|
166
|
-
regenerateResponse: t("agentChat.common.retry"),
|
|
167
|
-
suggestedActions: t("agentChat.composer.suggestedActions"),
|
|
168
|
-
fork: t("agentChat.message.forkChat"),
|
|
169
|
-
editMessage: t("agentChat.message.edit"),
|
|
170
|
-
editingMessage: t("agentChat.message.editing"),
|
|
171
|
-
editingMessageHint: t("agentChat.message.editingHint"),
|
|
172
|
-
cancelEditing: t("agentChat.common.cancel"),
|
|
173
|
-
feedback: t("agentChat.feedback.label"),
|
|
174
|
-
feedbackGood: t("agentChat.feedback.goodResponse"),
|
|
175
|
-
feedbackBad: t("agentChat.feedback.badResponse"),
|
|
176
|
-
rateResponse: t("agentChat.feedback.rate"),
|
|
177
|
-
forkFromHere: t("agentChat.message.forkFromHere"),
|
|
178
|
-
feedbackNote: t("agentChat.feedback.note"),
|
|
179
|
-
feedbackSubmit: t("agentChat.feedback.submit"),
|
|
180
|
-
feedbackSubmitted: t("agentChat.feedback.submitted"),
|
|
181
|
-
runFailed: t("agentChat.error.failed"),
|
|
182
|
-
continueRun: t("agentChat.common.continue"),
|
|
183
|
-
continueRunUnavailable: t("agentChat.recovery.continueUnavailable"),
|
|
184
|
-
reconnect: t("agentChat.common.reconnect"),
|
|
185
|
-
dismissNotice: t("agentChat.common.dismiss"),
|
|
186
127
|
...props.labels,
|
|
187
128
|
}),
|
|
188
|
-
[props.labels, t],
|
|
129
|
+
[formatDate, props.labels, t],
|
|
189
130
|
);
|
|
190
131
|
const rootProps: AgentKitRootProps = props.controller
|
|
191
132
|
? props
|
|
@@ -23,6 +23,23 @@ export function agentKitWorkStepLabels(
|
|
|
23
23
|
workStepReadPagesOther: t("agentChat.workSteps.readPagesOther", count),
|
|
24
24
|
workStepFetchedOne: t("agentChat.workSteps.fetchedOne"),
|
|
25
25
|
workStepFetchedOther: t("agentChat.workSteps.fetchedOther", count),
|
|
26
|
+
workStepSourcesOne: t("agentChat.workSteps.sourcesOne"),
|
|
27
|
+
workStepSourcesOther: t("agentChat.workSteps.sourcesOther", count),
|
|
28
|
+
workStepFrameworkFrames: t("agentChat.workSteps.frameworkFrames", count),
|
|
29
|
+
workStepCopyStackTrace: t("agentChat.workSteps.copyStackTrace"),
|
|
30
|
+
workStepTerminalExitCode: t("agentChat.toolCells.exitCode", {
|
|
31
|
+
code: "{{code}}",
|
|
32
|
+
}),
|
|
33
|
+
workStepTerminalTimedOut: t("agentChat.toolCells.timedOut"),
|
|
34
|
+
workStepTerminalEarlierLines: t(
|
|
35
|
+
"agentChat.toolCells.showEarlierLines",
|
|
36
|
+
count,
|
|
37
|
+
),
|
|
38
|
+
workStepCopyOutput: t("agentChat.toolCells.copyOutput"),
|
|
39
|
+
workStepFilePartial: t("agentChat.toolCells.partial"),
|
|
40
|
+
workStepFileMoreLines: t("agentChat.toolCells.showMoreLines", count),
|
|
41
|
+
workStepLineAdded: t("agentChat.toolCells.lineAdded"),
|
|
42
|
+
workStepLineRemoved: t("agentChat.toolCells.lineRemoved"),
|
|
26
43
|
workStepReadFilesOne: t("agentChat.workSteps.readFilesOne"),
|
|
27
44
|
workStepReadFilesOther: t("agentChat.workSteps.readFilesOther", count),
|
|
28
45
|
workStepEditedOne: t("agentChat.workSteps.editedOne"),
|
|
@@ -42,3 +59,28 @@ export function agentKitWorkStepLabels(
|
|
|
42
59
|
workStepRunningActions: t("agentChat.workSteps.runningActions"),
|
|
43
60
|
};
|
|
44
61
|
}
|
|
62
|
+
|
|
63
|
+
type QuestionLabelKey = Extract<keyof AgentKitLabels, `question${string}`>;
|
|
64
|
+
|
|
65
|
+
export function agentKitQuestionLabels(
|
|
66
|
+
t: ReturnType<typeof useT>,
|
|
67
|
+
): Pick<AgentKitLabels, QuestionLabelKey> {
|
|
68
|
+
const progress = { current: "{{current}}", total: "{{total}}" };
|
|
69
|
+
return {
|
|
70
|
+
question: t("agentChat.guided.question"),
|
|
71
|
+
questionProgress: t("agentChat.guided.questionProgress", progress),
|
|
72
|
+
questionProgressLabel: t(
|
|
73
|
+
"agentChat.guided.questionProgressLabel",
|
|
74
|
+
progress,
|
|
75
|
+
),
|
|
76
|
+
questionOwnResponse: t("agentChat.guided.ownResponse"),
|
|
77
|
+
questionAnswer: t("agentChat.guided.typeAnswer"),
|
|
78
|
+
questionSkip: t("agentChat.guided.skip"),
|
|
79
|
+
questionNext: t("agentChat.guided.next"),
|
|
80
|
+
questionSend: t("agentChat.guided.send"),
|
|
81
|
+
questionRecommended: t("agentChat.guided.recommended"),
|
|
82
|
+
questionDismiss: t("agentChat.guided.dismiss"),
|
|
83
|
+
questionChooseFiles: t("agentChat.guided.chooseFiles"),
|
|
84
|
+
questionRemoveFile: t("agentChat.guided.removeFile", { name: "{{name}}" }),
|
|
85
|
+
};
|
|
86
|
+
}
|
|
@@ -21,6 +21,7 @@ import {
|
|
|
21
21
|
useBufferedAgentText,
|
|
22
22
|
useStreamingRevealOrigin,
|
|
23
23
|
} from "../../agentkit/react/streaming-text.js";
|
|
24
|
+
import { loadCodeHighlighter } from "../../code-highlighter.js";
|
|
24
25
|
import { HighlightedCodeBlock as SharedHighlightedCodeBlock } from "../HighlightedCodeBlock.js";
|
|
25
26
|
import { IframeEmbed, parseEmbedBody } from "./IframeEmbed.js";
|
|
26
27
|
import {
|
|
@@ -79,65 +80,7 @@ export function onMarkdownReady(fn: () => void): () => void {
|
|
|
79
80
|
|
|
80
81
|
loadMarkdown();
|
|
81
82
|
|
|
82
|
-
|
|
83
|
-
// Using the fine-grained API so we only ship the languages and themes we
|
|
84
|
-
// actually use (instead of shiki's full ~30 MB bundle of every grammar).
|
|
85
|
-
// Required to keep the Cloudflare Pages Functions bundle under 25 MiB.
|
|
86
|
-
|
|
87
|
-
type ShikiHighlighter = {
|
|
88
|
-
codeToHtml: (
|
|
89
|
-
code: string,
|
|
90
|
-
options: {
|
|
91
|
-
lang: string;
|
|
92
|
-
themes: { light: string; dark: string };
|
|
93
|
-
defaultColor?: false | "light" | "dark";
|
|
94
|
-
},
|
|
95
|
-
) => string | Promise<string>;
|
|
96
|
-
getLoadedLanguages: () => string[];
|
|
97
|
-
};
|
|
98
|
-
|
|
99
|
-
let highlighterLoader: Promise<ShikiHighlighter> | null = null;
|
|
100
|
-
export function loadHighlighter(): Promise<ShikiHighlighter> {
|
|
101
|
-
if (!highlighterLoader) {
|
|
102
|
-
highlighterLoader = (async () => {
|
|
103
|
-
// Use the JavaScript regex engine instead of Oniguruma WASM (~608 KB saved).
|
|
104
|
-
// forgiving:true degrades unsupported patterns gracefully instead of throwing.
|
|
105
|
-
const [{ createHighlighterCore }, { createJavaScriptRegexEngine }] =
|
|
106
|
-
await Promise.all([
|
|
107
|
-
import("shiki/core"),
|
|
108
|
-
import("shiki/engine/javascript"),
|
|
109
|
-
]);
|
|
110
|
-
return createHighlighterCore({
|
|
111
|
-
themes: [
|
|
112
|
-
import("shiki/themes/github-light-default.mjs"),
|
|
113
|
-
import("shiki/themes/github-dark-default.mjs"),
|
|
114
|
-
],
|
|
115
|
-
langs: [
|
|
116
|
-
import("shiki/langs/javascript.mjs"),
|
|
117
|
-
import("shiki/langs/typescript.mjs"),
|
|
118
|
-
import("shiki/langs/jsx.mjs"),
|
|
119
|
-
import("shiki/langs/tsx.mjs"),
|
|
120
|
-
import("shiki/langs/json.mjs"),
|
|
121
|
-
import("shiki/langs/css.mjs"),
|
|
122
|
-
import("shiki/langs/html.mjs"),
|
|
123
|
-
import("shiki/langs/markdown.mjs"),
|
|
124
|
-
import("shiki/langs/bash.mjs"),
|
|
125
|
-
import("shiki/langs/shellscript.mjs"),
|
|
126
|
-
import("shiki/langs/python.mjs"),
|
|
127
|
-
import("shiki/langs/yaml.mjs"),
|
|
128
|
-
import("shiki/langs/sql.mjs"),
|
|
129
|
-
],
|
|
130
|
-
engine: createJavaScriptRegexEngine({ forgiving: true }),
|
|
131
|
-
}) as unknown as Promise<ShikiHighlighter>;
|
|
132
|
-
})().catch((error) => {
|
|
133
|
-
// Reset on failure so a future code block can retry instead of
|
|
134
|
-
// silently failing forever on a stale chunk / network blip.
|
|
135
|
-
highlighterLoader = null;
|
|
136
|
-
throw error;
|
|
137
|
-
});
|
|
138
|
-
}
|
|
139
|
-
return highlighterLoader;
|
|
140
|
-
}
|
|
83
|
+
export const loadHighlighter = loadCodeHighlighter;
|
|
141
84
|
|
|
142
85
|
// ─── Streaming context ───────────────────────────────────────────────────────
|
|
143
86
|
// Declared at module level so HighlightedCodeBlock (used in markdownComponents
|
|
@@ -152,6 +152,15 @@ const mcpApp: AgentMcpAppPayload = {
|
|
|
152
152
|
toolResult: {},
|
|
153
153
|
};
|
|
154
154
|
|
|
155
|
+
// The summary's trace line is `display: contents`: its parts are the row's.
|
|
156
|
+
function summaryParts(summary: Element | null | undefined): Element[] {
|
|
157
|
+
return Array.from(summary?.children ?? []).flatMap((child) =>
|
|
158
|
+
child.classList.contains("agentkit-trace-line")
|
|
159
|
+
? Array.from(child.children)
|
|
160
|
+
: [child],
|
|
161
|
+
);
|
|
162
|
+
}
|
|
163
|
+
|
|
155
164
|
describe("ToolCallDisplay native renderers", () => {
|
|
156
165
|
let container: HTMLDivElement;
|
|
157
166
|
let root: Root;
|
|
@@ -529,7 +538,12 @@ describe("ToolCallDisplay native renderers", () => {
|
|
|
529
538
|
"button[aria-expanded]",
|
|
530
539
|
);
|
|
531
540
|
expect(disclosure?.getAttribute("aria-expanded")).toBe("false");
|
|
532
|
-
|
|
541
|
+
// Closed, the output stays in the DOM, hidden, for find-in-page.
|
|
542
|
+
expect(
|
|
543
|
+
container
|
|
544
|
+
.querySelector(".agentkit-terminal-body")
|
|
545
|
+
?.getAttribute("hidden"),
|
|
546
|
+
).toBe("until-found");
|
|
533
547
|
expect(container.querySelector(".text-destructive")).toBeNull();
|
|
534
548
|
|
|
535
549
|
act(() => disclosure?.click());
|
|
@@ -1644,13 +1658,10 @@ describe("ToolCallDisplay native renderers", () => {
|
|
|
1644
1658
|
"button.agentkit-disclosure-summary",
|
|
1645
1659
|
);
|
|
1646
1660
|
expect(trigger?.getAttribute("aria-expanded")).toBe("false");
|
|
1647
|
-
|
|
1648
|
-
|
|
1649
|
-
);
|
|
1650
|
-
expect(
|
|
1651
|
-
"agentkit-disclosure-label",
|
|
1652
|
-
);
|
|
1653
|
-
expect(trigger?.children[2]?.getAttribute("class")).toContain(
|
|
1661
|
+
const parts = summaryParts(trigger);
|
|
1662
|
+
expect(parts[0]?.className).toContain("agentkit-disclosure-icon-slot");
|
|
1663
|
+
expect(parts[1]?.className).toContain("agentkit-disclosure-label");
|
|
1664
|
+
expect(parts[2]?.getAttribute("class")).toContain(
|
|
1654
1665
|
"agentkit-disclosure-chevron",
|
|
1655
1666
|
);
|
|
1656
1667
|
|
|
@@ -2955,11 +2966,10 @@ describe("WorkedForSummary", () => {
|
|
|
2955
2966
|
|
|
2956
2967
|
const button = container.querySelector("button[aria-expanded]");
|
|
2957
2968
|
expect(button?.classList).toContain("agentkit-disclosure-summary");
|
|
2958
|
-
|
|
2959
|
-
|
|
2960
|
-
);
|
|
2961
|
-
expect(
|
|
2962
|
-
expect(button?.children[2]?.getAttribute("class")).toContain(
|
|
2969
|
+
const parts = summaryParts(button);
|
|
2970
|
+
expect(parts[0]?.className).toContain("agentkit-disclosure-icon-slot");
|
|
2971
|
+
expect(parts[1]?.textContent).toBe("Worked for 5s");
|
|
2972
|
+
expect(parts[2]?.getAttribute("class")).toContain(
|
|
2963
2973
|
"agentkit-disclosure-chevron",
|
|
2964
2974
|
);
|
|
2965
2975
|
expect(button?.getAttribute("aria-controls")).toBeNull();
|
|
@@ -3374,7 +3384,9 @@ describe("ApprovalAffordance", () => {
|
|
|
3374
3384
|
) as HTMLParagraphElement;
|
|
3375
3385
|
const actionButtons = Array.from(approvalCard.querySelectorAll("button"));
|
|
3376
3386
|
|
|
3377
|
-
expect(approvalCard.className).toContain(
|
|
3387
|
+
expect(approvalCard.className).toContain(
|
|
3388
|
+
"rounded-[var(--agent-kit-radius-sm,0.5rem)]",
|
|
3389
|
+
);
|
|
3378
3390
|
expect(approvalCopy.className).toContain("font-medium");
|
|
3379
3391
|
// The card lets the question wrap instead of truncating it.
|
|
3380
3392
|
expect(
|
|
@@ -725,7 +725,7 @@ export function ToolCallDisplay({
|
|
|
725
725
|
{children}
|
|
726
726
|
</ToolActivityPresentation>
|
|
727
727
|
);
|
|
728
|
-
if (
|
|
728
|
+
if (toolKind === "bash") {
|
|
729
729
|
return wrapToolDisplay(
|
|
730
730
|
<BashCell
|
|
731
731
|
meta={
|
|
@@ -733,6 +733,7 @@ export function ToolCallDisplay({
|
|
|
733
733
|
}
|
|
734
734
|
output={result}
|
|
735
735
|
isRunning={effectiveIsRunning}
|
|
736
|
+
isError={isError}
|
|
736
737
|
/>,
|
|
737
738
|
);
|
|
738
739
|
}
|