veryfront 0.1.1048 → 0.1.1049
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/esm/cli/templates/manifest.js +3 -3
- package/esm/deno.d.ts +3 -0
- package/esm/deno.js +10 -6
- package/esm/src/agent/react/use-agent-metadata.js +1 -1
- package/esm/src/agent/react/use-agent.js +1 -1
- package/esm/src/agent/react/use-agents.js +1 -1
- package/esm/src/agent/react/use-chat/types.d.ts +0 -6
- package/esm/src/agent/react/use-chat/types.d.ts.map +1 -1
- package/esm/src/agent/react/use-chat/use-chat.d.ts +5 -0
- package/esm/src/agent/react/use-chat/use-chat.d.ts.map +1 -1
- package/esm/src/agent/react/use-chat/use-chat.js +87 -34
- package/esm/src/agent/react/use-completion.js +1 -1
- package/esm/src/agent/react/use-streaming.js +1 -1
- package/esm/src/agent/react/use-voice-input.js +1 -1
- package/esm/src/cache/backends/api.d.ts.map +1 -1
- package/esm/src/cache/backends/api.js +10 -7
- package/esm/src/chat/index.d.ts +8 -15
- package/esm/src/chat/index.d.ts.map +1 -1
- package/esm/src/chat/index.js +7 -16
- package/esm/src/modules/component-registry/registry.d.ts +1 -1
- package/esm/src/modules/component-registry/registry.d.ts.map +1 -1
- package/esm/src/modules/react-loader/component-loader.d.ts +1 -1
- package/esm/src/modules/react-loader/component-loader.d.ts.map +1 -1
- package/esm/src/modules/react-loader/extract-component.d.ts +1 -1
- package/esm/src/modules/react-loader/extract-component.d.ts.map +1 -1
- package/esm/src/modules/react-loader/ssr-module-loader/loader.d.ts +1 -1
- package/esm/src/modules/react-loader/ssr-module-loader/loader.d.ts.map +1 -1
- package/esm/src/modules/react-loader/types.d.ts +1 -1
- package/esm/src/modules/react-loader/types.d.ts.map +1 -1
- package/esm/src/platform/adapters/fs/veryfront/multi-project-adapter.d.ts +3 -1
- package/esm/src/platform/adapters/fs/veryfront/multi-project-adapter.d.ts.map +1 -1
- package/esm/src/platform/adapters/fs/veryfront/multi-project-adapter.js +2 -0
- package/esm/src/platform/adapters/fs/veryfront/request-context.d.ts +4 -0
- package/esm/src/platform/adapters/fs/veryfront/request-context.d.ts.map +1 -1
- package/esm/src/platform/adapters/fs/veryfront/request-context.js +1 -0
- package/esm/src/proxy/main.js +6 -5
- package/esm/src/proxy/retry.d.ts +14 -6
- package/esm/src/proxy/retry.d.ts.map +1 -1
- package/esm/src/proxy/retry.js +82 -20
- package/esm/src/react/compat/hooks-adapter.d.ts +1 -1
- package/esm/src/react/compat/hooks-adapter.d.ts.map +1 -1
- package/esm/src/react/compat/hooks-adapter.js +1 -1
- package/esm/src/react/compat/ssr-adapter/response-builder.d.ts +1 -1
- package/esm/src/react/compat/ssr-adapter/response-builder.d.ts.map +1 -1
- package/esm/src/react/compat/ssr-adapter/server-loader.d.ts +5 -5
- package/esm/src/react/compat/ssr-adapter/server-loader.d.ts.map +1 -1
- package/esm/src/react/compat/ssr-adapter/stream-renderer.d.ts +1 -1
- package/esm/src/react/compat/ssr-adapter/stream-renderer.d.ts.map +1 -1
- package/esm/src/react/compat/ssr-adapter/string-renderer.d.ts +1 -1
- package/esm/src/react/compat/ssr-adapter/string-renderer.d.ts.map +1 -1
- package/esm/src/react/compat/version-detector/feature-detector.js +1 -1
- package/esm/src/react/components/AppWrapper.d.ts +1 -1
- package/esm/src/react/components/AppWrapper.d.ts.map +1 -1
- package/esm/src/react/components/AppWrapper.js +1 -1
- package/esm/src/react/components/LayoutComponent.d.ts +1 -1
- package/esm/src/react/components/LayoutComponent.d.ts.map +1 -1
- package/esm/src/react/components/LayoutComponent.js +1 -1
- package/esm/src/react/components/MDXProvider.d.ts +1 -1
- package/esm/src/react/components/MDXProvider.d.ts.map +1 -1
- package/esm/src/react/components/MDXProvider.js +1 -1
- package/esm/src/react/components/ProviderComponent.d.ts +1 -1
- package/esm/src/react/components/ProviderComponent.d.ts.map +1 -1
- package/esm/src/react/components/ProviderComponent.js +1 -1
- package/esm/src/react/components/chat/agent-card.d.ts +15 -7
- package/esm/src/react/components/chat/agent-card.d.ts.map +1 -1
- package/esm/src/react/components/chat/agent-card.js +9 -10
- package/esm/src/react/components/chat/agent-picker-actions.d.ts +20 -0
- package/esm/src/react/components/chat/agent-picker-actions.d.ts.map +1 -0
- package/esm/src/react/components/chat/agent-picker-actions.js +24 -0
- package/esm/src/react/components/chat/agent-picker-context.d.ts +19 -0
- package/esm/src/react/components/chat/agent-picker-context.d.ts.map +1 -0
- package/esm/src/react/components/chat/agent-picker-context.js +13 -0
- package/esm/src/react/components/chat/agent-picker.d.ts +35 -42
- package/esm/src/react/components/chat/agent-picker.d.ts.map +1 -1
- package/esm/src/react/components/chat/agent-picker.js +59 -50
- package/esm/src/react/components/chat/chat/app-mode-chat.d.ts +14 -0
- package/esm/src/react/components/chat/chat/app-mode-chat.d.ts.map +1 -0
- package/esm/src/react/components/chat/chat/app-mode-chat.js +137 -0
- package/esm/src/react/components/chat/chat/chat-attachments.d.ts +7 -0
- package/esm/src/react/components/chat/chat/chat-attachments.d.ts.map +1 -0
- package/esm/src/react/components/chat/chat/chat-attachments.js +16 -0
- package/esm/src/react/components/chat/chat/chat-component.d.ts +21 -0
- package/esm/src/react/components/chat/chat/chat-component.d.ts.map +1 -0
- package/esm/src/react/components/chat/chat/chat-component.js +1 -0
- package/esm/src/react/components/chat/chat/chat-props.d.ts +114 -0
- package/esm/src/react/components/chat/chat/chat-props.d.ts.map +1 -0
- package/esm/src/react/components/chat/chat/chat-props.js +1 -0
- package/esm/src/react/components/chat/chat/components/animations.d.ts +1 -1
- package/esm/src/react/components/chat/chat/components/animations.d.ts.map +1 -1
- package/esm/src/react/components/chat/chat/components/animations.js +1 -1
- package/esm/src/react/components/chat/chat/components/attachment-pill.d.ts +18 -18
- package/esm/src/react/components/chat/chat/components/attachment-pill.d.ts.map +1 -1
- package/esm/src/react/components/chat/chat/components/attachment-pill.js +11 -15
- package/esm/src/react/components/chat/chat/components/attachments-panel.d.ts +14 -3
- package/esm/src/react/components/chat/chat/components/attachments-panel.d.ts.map +1 -1
- package/esm/src/react/components/chat/chat/components/attachments-panel.js +3 -3
- package/esm/src/react/components/chat/chat/components/branch-picker.d.ts +44 -14
- package/esm/src/react/components/chat/chat/components/branch-picker.d.ts.map +1 -1
- package/esm/src/react/components/chat/chat/components/branch-picker.js +55 -12
- package/esm/src/react/components/chat/chat/components/chat-messages-skeleton.d.ts +1 -1
- package/esm/src/react/components/chat/chat/components/chat-messages-skeleton.d.ts.map +1 -1
- package/esm/src/react/components/chat/chat/components/chat-messages-skeleton.js +1 -1
- package/esm/src/react/components/chat/chat/components/code-block.d.ts +7 -2
- package/esm/src/react/components/chat/chat/components/code-block.d.ts.map +1 -1
- package/esm/src/react/components/chat/chat/components/code-block.js +3 -3
- package/esm/src/react/components/chat/chat/components/drop-zone.d.ts +1 -1
- package/esm/src/react/components/chat/chat/components/drop-zone.d.ts.map +1 -1
- package/esm/src/react/components/chat/chat/components/drop-zone.js +1 -1
- package/esm/src/react/components/chat/chat/components/empty-state.d.ts +1 -1
- package/esm/src/react/components/chat/chat/components/empty-state.d.ts.map +1 -1
- package/esm/src/react/components/chat/chat/components/empty-state.js +1 -1
- package/esm/src/react/components/chat/chat/components/inference-badge.d.ts +1 -1
- package/esm/src/react/components/chat/chat/components/inference-badge.d.ts.map +1 -1
- package/esm/src/react/components/chat/chat/components/inference-badge.js +1 -1
- package/esm/src/react/components/chat/chat/components/inline-citation.d.ts +33 -10
- package/esm/src/react/components/chat/chat/components/inline-citation.d.ts.map +1 -1
- package/esm/src/react/components/chat/chat/components/inline-citation.js +145 -51
- package/esm/src/react/components/chat/chat/components/message-actions.d.ts +49 -20
- package/esm/src/react/components/chat/chat/components/message-actions.d.ts.map +1 -1
- package/esm/src/react/components/chat/chat/components/message-actions.js +72 -18
- package/esm/src/react/components/chat/chat/components/message-edit-form.d.ts +1 -1
- package/esm/src/react/components/chat/chat/components/message-edit-form.d.ts.map +1 -1
- package/esm/src/react/components/chat/chat/components/message-edit-form.js +1 -1
- package/esm/src/react/components/chat/chat/components/message-feedback.d.ts +34 -14
- package/esm/src/react/components/chat/chat/components/message-feedback.d.ts.map +1 -1
- package/esm/src/react/components/chat/chat/components/message-feedback.js +54 -15
- package/esm/src/react/components/chat/chat/components/quick-actions.d.ts +1 -1
- package/esm/src/react/components/chat/chat/components/quick-actions.d.ts.map +1 -1
- package/esm/src/react/components/chat/chat/components/quick-actions.js +1 -1
- package/esm/src/react/components/chat/chat/components/reasoning.d.ts +14 -6
- package/esm/src/react/components/chat/chat/components/reasoning.d.ts.map +1 -1
- package/esm/src/react/components/chat/chat/components/reasoning.js +3 -5
- package/esm/src/react/components/chat/chat/components/sidebar.d.ts +70 -16
- package/esm/src/react/components/chat/chat/components/sidebar.d.ts.map +1 -1
- package/esm/src/react/components/chat/chat/components/sidebar.js +72 -23
- package/esm/src/react/components/chat/chat/components/skill-badge.d.ts +1 -1
- package/esm/src/react/components/chat/chat/components/skill-badge.d.ts.map +1 -1
- package/esm/src/react/components/chat/chat/components/skill-badge.js +1 -1
- package/esm/src/react/components/chat/chat/components/skill-tool.d.ts +1 -1
- package/esm/src/react/components/chat/chat/components/skill-tool.d.ts.map +1 -1
- package/esm/src/react/components/chat/chat/components/skill-tool.js +1 -1
- package/esm/src/react/components/chat/chat/components/sources.d.ts +25 -15
- package/esm/src/react/components/chat/chat/components/sources.d.ts.map +1 -1
- package/esm/src/react/components/chat/chat/components/sources.js +7 -7
- package/esm/src/react/components/chat/chat/components/step-indicator.d.ts +14 -3
- package/esm/src/react/components/chat/chat/components/step-indicator.d.ts.map +1 -1
- package/esm/src/react/components/chat/chat/components/step-indicator.js +3 -3
- package/esm/src/react/components/chat/chat/components/tab-switcher.d.ts +1 -1
- package/esm/src/react/components/chat/chat/components/tab-switcher.d.ts.map +1 -1
- package/esm/src/react/components/chat/chat/components/tab-switcher.js +1 -1
- package/esm/src/react/components/chat/chat/components/tool-ui.d.ts +16 -9
- package/esm/src/react/components/chat/chat/components/tool-ui.d.ts.map +1 -1
- package/esm/src/react/components/chat/chat/components/tool-ui.js +10 -14
- package/esm/src/react/components/chat/chat/composition/agent-avatar.d.ts +1 -1
- package/esm/src/react/components/chat/chat/composition/agent-avatar.d.ts.map +1 -1
- package/esm/src/react/components/chat/chat/composition/agent-avatar.js +1 -1
- package/esm/src/react/components/chat/chat/composition/api.d.ts +3 -3
- package/esm/src/react/components/chat/chat/composition/api.d.ts.map +1 -1
- package/esm/src/react/components/chat/chat/composition/api.js +2 -2
- package/esm/src/react/components/chat/chat/composition/chat-composer.d.ts +72 -29
- package/esm/src/react/components/chat/chat/composition/chat-composer.d.ts.map +1 -1
- package/esm/src/react/components/chat/chat/composition/chat-composer.js +92 -82
- package/esm/src/react/components/chat/chat/composition/chat-empty-state.d.ts +1 -1
- package/esm/src/react/components/chat/chat/composition/chat-empty-state.d.ts.map +1 -1
- package/esm/src/react/components/chat/chat/composition/chat-empty-state.js +1 -1
- package/esm/src/react/components/chat/chat/composition/chat-empty.d.ts +7 -2
- package/esm/src/react/components/chat/chat/composition/chat-empty.d.ts.map +1 -1
- package/esm/src/react/components/chat/chat/composition/chat-empty.js +3 -3
- package/esm/src/react/components/chat/chat/composition/chat-if.d.ts +1 -1
- package/esm/src/react/components/chat/chat/composition/chat-if.d.ts.map +1 -1
- package/esm/src/react/components/chat/chat/composition/chat-message-list.d.ts +25 -11
- package/esm/src/react/components/chat/chat/composition/chat-message-list.d.ts.map +1 -1
- package/esm/src/react/components/chat/chat/composition/chat-message-list.js +67 -29
- package/esm/src/react/components/chat/chat/composition/chat-root.d.ts +7 -3
- package/esm/src/react/components/chat/chat/composition/chat-root.d.ts.map +1 -1
- package/esm/src/react/components/chat/chat/composition/chat-root.js +3 -5
- package/esm/src/react/components/chat/chat/composition/error-banner.d.ts +7 -2
- package/esm/src/react/components/chat/chat/composition/error-banner.d.ts.map +1 -1
- package/esm/src/react/components/chat/chat/composition/error-banner.js +3 -3
- package/esm/src/react/components/chat/chat/composition/message.d.ts +85 -34
- package/esm/src/react/components/chat/chat/composition/message.d.ts.map +1 -1
- package/esm/src/react/components/chat/chat/composition/message.js +146 -122
- package/esm/src/react/components/chat/chat/composition/model-avatar.d.ts +1 -1
- package/esm/src/react/components/chat/chat/composition/model-avatar.d.ts.map +1 -1
- package/esm/src/react/components/chat/chat/composition/model-avatar.js +1 -1
- package/esm/src/react/components/chat/chat/composition/pending-message.d.ts +1 -1
- package/esm/src/react/components/chat/chat/composition/pending-message.d.ts.map +1 -1
- package/esm/src/react/components/chat/chat/composition/pending-message.js +1 -1
- package/esm/src/react/components/chat/chat/contexts/chat-context.d.ts +2 -3
- package/esm/src/react/components/chat/chat/contexts/chat-context.d.ts.map +1 -1
- package/esm/src/react/components/chat/chat/contexts/chat-context.js +1 -1
- package/esm/src/react/components/chat/chat/contexts/composer-context.d.ts +2 -2
- package/esm/src/react/components/chat/chat/contexts/composer-context.d.ts.map +1 -1
- package/esm/src/react/components/chat/chat/contexts/composer-context.js +1 -1
- package/esm/src/react/components/chat/chat/contexts/conversations-context.d.ts +2 -2
- package/esm/src/react/components/chat/chat/contexts/conversations-context.d.ts.map +1 -1
- package/esm/src/react/components/chat/chat/contexts/conversations-context.js +1 -1
- package/esm/src/react/components/chat/chat/contexts/index.d.ts +1 -1
- package/esm/src/react/components/chat/chat/contexts/index.d.ts.map +1 -1
- package/esm/src/react/components/chat/chat/contexts/index.js +1 -1
- package/esm/src/react/components/chat/chat/contexts/message-context.d.ts +15 -2
- package/esm/src/react/components/chat/chat/contexts/message-context.d.ts.map +1 -1
- package/esm/src/react/components/chat/chat/contexts/message-context.js +11 -1
- package/esm/src/react/components/chat/chat/controlled-chat.d.ts +15 -0
- package/esm/src/react/components/chat/chat/controlled-chat.d.ts.map +1 -0
- package/esm/src/react/components/chat/chat/controlled-chat.js +97 -0
- package/esm/src/react/components/chat/chat/hooks/use-clipboard.js +1 -1
- package/esm/src/react/components/chat/chat/hooks/use-conversation-chat.d.ts +54 -0
- package/esm/src/react/components/chat/chat/hooks/use-conversation-chat.d.ts.map +1 -0
- package/esm/src/react/components/chat/chat/hooks/use-conversation-chat.js +179 -0
- package/esm/src/react/components/chat/chat/hooks/use-conversation.js +1 -1
- package/esm/src/react/components/chat/chat/hooks/use-conversations.d.ts.map +1 -1
- package/esm/src/react/components/chat/chat/hooks/use-conversations.js +3 -6
- package/esm/src/react/components/chat/chat/hooks/use-drop-zone.d.ts +8 -5
- package/esm/src/react/components/chat/chat/hooks/use-drop-zone.d.ts.map +1 -1
- package/esm/src/react/components/chat/chat/hooks/use-drop-zone.js +6 -6
- package/esm/src/react/components/chat/chat/hooks/use-stick-to-bottom.d.ts +1 -1
- package/esm/src/react/components/chat/chat/hooks/use-stick-to-bottom.d.ts.map +1 -1
- package/esm/src/react/components/chat/chat/hooks/use-stick-to-bottom.js +1 -1
- package/esm/src/react/components/chat/chat/hooks/use-upload.js +1 -1
- package/esm/src/react/components/chat/chat/hooks/use-uploads-registry.js +1 -1
- package/esm/src/react/components/chat/chat/index.d.ts +13 -230
- package/esm/src/react/components/chat/chat/index.d.ts.map +1 -1
- package/esm/src/react/components/chat/chat/index.js +27 -383
- package/esm/src/react/components/chat/chat-actions.d.ts +1 -1
- package/esm/src/react/components/chat/chat-actions.d.ts.map +1 -1
- package/esm/src/react/components/chat/chat-actions.js +1 -1
- package/esm/src/react/components/chat/chat-agent-picker.d.ts +1 -1
- package/esm/src/react/components/chat/chat-agent-picker.d.ts.map +1 -1
- package/esm/src/react/components/chat/chat-agent-picker.js +1 -1
- package/esm/src/react/components/chat/chat-theme-scope.d.ts +1 -1
- package/esm/src/react/components/chat/chat-theme-scope.d.ts.map +1 -1
- package/esm/src/react/components/chat/chat-theme-scope.js +1 -1
- package/esm/src/react/components/chat/chat.d.ts +6 -6
- package/esm/src/react/components/chat/chat.d.ts.map +1 -1
- package/esm/src/react/components/chat/chat.js +4 -4
- package/esm/src/react/components/chat/error-boundary.d.ts +1 -1
- package/esm/src/react/components/chat/error-boundary.d.ts.map +1 -1
- package/esm/src/react/components/chat/error-boundary.js +1 -1
- package/esm/src/react/components/chat/markdown.d.ts +3 -5
- package/esm/src/react/components/chat/markdown.d.ts.map +1 -1
- package/esm/src/react/components/chat/markdown.js +4 -72
- package/esm/src/react/components/chat/model-selector.d.ts +21 -27
- package/esm/src/react/components/chat/model-selector.d.ts.map +1 -1
- package/esm/src/react/components/chat/model-selector.js +26 -31
- package/esm/src/react/components/optimized-image/OptimizedBackgroundImage.d.ts +1 -1
- package/esm/src/react/components/optimized-image/OptimizedBackgroundImage.d.ts.map +1 -1
- package/esm/src/react/components/optimized-image/OptimizedBackgroundImage.js +1 -1
- package/esm/src/react/components/optimized-image/OptimizedImage.d.ts +1 -1
- package/esm/src/react/components/optimized-image/OptimizedImage.d.ts.map +1 -1
- package/esm/src/react/components/optimized-image/OptimizedImage.js +1 -1
- package/esm/src/react/components/optimized-image/SimpleOptimizedImage.d.ts +1 -1
- package/esm/src/react/components/optimized-image/SimpleOptimizedImage.d.ts.map +1 -1
- package/esm/src/react/components/optimized-image/utils.d.ts +1 -1
- package/esm/src/react/components/optimized-image/utils.d.ts.map +1 -1
- package/esm/src/react/components/optimized-image/utils.js +1 -1
- package/esm/src/react/components/ui/alert.d.ts +1 -1
- package/esm/src/react/components/ui/alert.d.ts.map +1 -1
- package/esm/src/react/components/ui/alert.js +1 -1
- package/esm/src/react/components/ui/app-shell.d.ts +1 -1
- package/esm/src/react/components/ui/app-shell.d.ts.map +1 -1
- package/esm/src/react/components/ui/app-shell.js +1 -1
- package/esm/src/react/components/ui/avatar.d.ts +1 -1
- package/esm/src/react/components/ui/avatar.d.ts.map +1 -1
- package/esm/src/react/components/ui/avatar.js +1 -1
- package/esm/src/react/components/ui/badge.d.ts +1 -1
- package/esm/src/react/components/ui/badge.d.ts.map +1 -1
- package/esm/src/react/components/ui/badge.js +1 -1
- package/esm/src/react/components/ui/button.d.ts +1 -1
- package/esm/src/react/components/ui/button.d.ts.map +1 -1
- package/esm/src/react/components/ui/button.js +1 -1
- package/esm/src/react/components/ui/card.d.ts +1 -1
- package/esm/src/react/components/ui/card.d.ts.map +1 -1
- package/esm/src/react/components/ui/card.js +1 -1
- package/esm/src/react/components/ui/checkbox.d.ts +1 -1
- package/esm/src/react/components/ui/checkbox.d.ts.map +1 -1
- package/esm/src/react/components/ui/checkbox.js +1 -1
- package/esm/src/react/components/ui/code-block.d.ts +1 -1
- package/esm/src/react/components/ui/code-block.d.ts.map +1 -1
- package/esm/src/react/components/ui/code-block.js +1 -1
- package/esm/src/react/components/ui/collapsible.d.ts +1 -1
- package/esm/src/react/components/ui/collapsible.d.ts.map +1 -1
- package/esm/src/react/components/ui/collapsible.js +1 -1
- package/esm/src/react/components/ui/color-mode.d.ts +2 -2
- package/esm/src/react/components/ui/color-mode.d.ts.map +1 -1
- package/esm/src/react/components/ui/color-mode.js +1 -1
- package/esm/src/react/components/ui/command.d.ts +1 -1
- package/esm/src/react/components/ui/command.d.ts.map +1 -1
- package/esm/src/react/components/ui/command.js +1 -1
- package/esm/src/react/components/ui/dialog.d.ts +1 -1
- package/esm/src/react/components/ui/dialog.d.ts.map +1 -1
- package/esm/src/react/components/ui/dialog.js +1 -1
- package/esm/src/react/components/ui/drawer.d.ts +1 -1
- package/esm/src/react/components/ui/drawer.d.ts.map +1 -1
- package/esm/src/react/components/ui/drawer.js +1 -1
- package/esm/src/react/components/ui/dropdown-menu.d.ts +1 -1
- package/esm/src/react/components/ui/dropdown-menu.d.ts.map +1 -1
- package/esm/src/react/components/ui/dropdown-menu.js +1 -1
- package/esm/src/react/components/ui/file-type.d.ts +1 -1
- package/esm/src/react/components/ui/file-type.d.ts.map +1 -1
- package/esm/src/react/components/ui/file-type.js +1 -1
- package/esm/src/react/components/ui/floating.d.ts +1 -1
- package/esm/src/react/components/ui/floating.d.ts.map +1 -1
- package/esm/src/react/components/ui/floating.js +2 -2
- package/esm/src/react/components/ui/icon-button.d.ts +1 -1
- package/esm/src/react/components/ui/icon-button.d.ts.map +1 -1
- package/esm/src/react/components/ui/icon-button.js +1 -1
- package/esm/src/react/components/ui/icons/index.d.ts +1 -1
- package/esm/src/react/components/ui/icons/index.d.ts.map +1 -1
- package/esm/src/react/components/ui/icons/index.js +1 -1
- package/esm/src/react/components/ui/input.d.ts +1 -1
- package/esm/src/react/components/ui/input.d.ts.map +1 -1
- package/esm/src/react/components/ui/input.js +1 -1
- package/esm/src/react/components/ui/label.d.ts +1 -1
- package/esm/src/react/components/ui/label.d.ts.map +1 -1
- package/esm/src/react/components/ui/label.js +1 -1
- package/esm/src/react/components/ui/list.d.ts +1 -1
- package/esm/src/react/components/ui/list.d.ts.map +1 -1
- package/esm/src/react/components/ui/list.js +1 -1
- package/esm/src/react/components/ui/pill.d.ts +1 -1
- package/esm/src/react/components/ui/pill.d.ts.map +1 -1
- package/esm/src/react/components/ui/pill.js +1 -1
- package/esm/src/react/components/ui/popover.d.ts +1 -1
- package/esm/src/react/components/ui/popover.d.ts.map +1 -1
- package/esm/src/react/components/ui/popover.js +1 -1
- package/esm/src/react/components/ui/progress-bar.d.ts +1 -1
- package/esm/src/react/components/ui/progress-bar.d.ts.map +1 -1
- package/esm/src/react/components/ui/progress-bar.js +1 -1
- package/esm/src/react/components/ui/radio.d.ts +1 -1
- package/esm/src/react/components/ui/radio.d.ts.map +1 -1
- package/esm/src/react/components/ui/radio.js +1 -1
- package/esm/src/react/components/ui/scroll-fade.d.ts +1 -1
- package/esm/src/react/components/ui/scroll-fade.d.ts.map +1 -1
- package/esm/src/react/components/ui/scroll-fade.js +1 -1
- package/esm/src/react/components/ui/select.d.ts +1 -1
- package/esm/src/react/components/ui/select.d.ts.map +1 -1
- package/esm/src/react/components/ui/select.js +1 -1
- package/esm/src/react/components/ui/shimmer.d.ts +1 -1
- package/esm/src/react/components/ui/shimmer.d.ts.map +1 -1
- package/esm/src/react/components/ui/shimmer.js +1 -1
- package/esm/src/react/components/ui/skeleton.d.ts +1 -1
- package/esm/src/react/components/ui/skeleton.d.ts.map +1 -1
- package/esm/src/react/components/ui/skeleton.js +1 -1
- package/esm/src/react/components/ui/slot.d.ts +1 -1
- package/esm/src/react/components/ui/slot.d.ts.map +1 -1
- package/esm/src/react/components/ui/slot.js +1 -1
- package/esm/src/react/components/ui/status.d.ts +1 -1
- package/esm/src/react/components/ui/status.d.ts.map +1 -1
- package/esm/src/react/components/ui/status.js +1 -1
- package/esm/src/react/components/ui/switch.d.ts +1 -1
- package/esm/src/react/components/ui/switch.d.ts.map +1 -1
- package/esm/src/react/components/ui/switch.js +1 -1
- package/esm/src/react/components/ui/tabs.d.ts +3 -3
- package/esm/src/react/components/ui/tabs.d.ts.map +1 -1
- package/esm/src/react/components/ui/tabs.js +1 -1
- package/esm/src/react/components/ui/tag.d.ts +1 -1
- package/esm/src/react/components/ui/tag.d.ts.map +1 -1
- package/esm/src/react/components/ui/tag.js +1 -1
- package/esm/src/react/components/ui/textarea.d.ts +1 -1
- package/esm/src/react/components/ui/textarea.d.ts.map +1 -1
- package/esm/src/react/components/ui/textarea.js +1 -1
- package/esm/src/react/components/ui/tokens.d.ts +1 -1
- package/esm/src/react/components/ui/tokens.d.ts.map +1 -1
- package/esm/src/react/components/ui/tokens.js +1 -1
- package/esm/src/react/components/ui/tooltip.d.ts +1 -1
- package/esm/src/react/components/ui/tooltip.d.ts.map +1 -1
- package/esm/src/react/components/ui/tooltip.js +2 -2
- package/esm/src/react/fonts/index.d.ts +1 -1
- package/esm/src/react/fonts/index.d.ts.map +1 -1
- package/esm/src/react/fonts/index.js +1 -1
- package/esm/src/react/primitives/agent-primitives.d.ts +4 -4
- package/esm/src/react/primitives/agent-primitives.d.ts.map +1 -1
- package/esm/src/react/primitives/agent-primitives.js +1 -1
- package/esm/src/react/primitives/chat-container.d.ts +2 -2
- package/esm/src/react/primitives/chat-container.d.ts.map +1 -1
- package/esm/src/react/primitives/chat-container.js +1 -1
- package/esm/src/react/primitives/input-box.d.ts +4 -4
- package/esm/src/react/primitives/input-box.d.ts.map +1 -1
- package/esm/src/react/primitives/input-box.js +1 -1
- package/esm/src/react/primitives/message-list.d.ts +5 -5
- package/esm/src/react/primitives/message-list.d.ts.map +1 -1
- package/esm/src/react/primitives/message-list.js +1 -1
- package/esm/src/react/primitives/tool-primitives.d.ts +4 -4
- package/esm/src/react/primitives/tool-primitives.d.ts.map +1 -1
- package/esm/src/react/primitives/tool-primitives.js +1 -1
- package/esm/src/react/runtime/core.d.ts +1 -1
- package/esm/src/react/runtime/core.d.ts.map +1 -1
- package/esm/src/react/runtime/core.js +1 -1
- package/esm/src/rendering/app-reserved.d.ts +1 -1
- package/esm/src/rendering/app-reserved.d.ts.map +1 -1
- package/esm/src/rendering/app-reserved.js +1 -1
- package/esm/src/rendering/component-handling.d.ts +1 -1
- package/esm/src/rendering/component-handling.d.ts.map +1 -1
- package/esm/src/rendering/element-validator/element-normalizer.d.ts +1 -1
- package/esm/src/rendering/element-validator/element-normalizer.d.ts.map +1 -1
- package/esm/src/rendering/element-validator/element-normalizer.js +1 -1
- package/esm/src/rendering/element-validator/primitive-checks.d.ts +1 -1
- package/esm/src/rendering/element-validator/primitive-checks.d.ts.map +1 -1
- package/esm/src/rendering/element-validator/primitive-checks.js +1 -1
- package/esm/src/rendering/element-validator/validator-core.d.ts +1 -1
- package/esm/src/rendering/element-validator/validator-core.d.ts.map +1 -1
- package/esm/src/rendering/layouts/layout-applicator.d.ts +1 -1
- package/esm/src/rendering/layouts/layout-applicator.d.ts.map +1 -1
- package/esm/src/rendering/layouts/utils/applicator.d.ts +1 -1
- package/esm/src/rendering/layouts/utils/applicator.d.ts.map +1 -1
- package/esm/src/rendering/layouts/utils/component-loader.d.ts +1 -1
- package/esm/src/rendering/layouts/utils/component-loader.d.ts.map +1 -1
- package/esm/src/rendering/layouts/utils/ensure-valid-child.d.ts +1 -1
- package/esm/src/rendering/layouts/utils/ensure-valid-child.d.ts.map +1 -1
- package/esm/src/rendering/orchestrator/layout.d.ts +1 -1
- package/esm/src/rendering/orchestrator/layout.d.ts.map +1 -1
- package/esm/src/rendering/orchestrator/ssr-orchestrator.d.ts +1 -1
- package/esm/src/rendering/orchestrator/ssr-orchestrator.d.ts.map +1 -1
- package/esm/src/rendering/page-renderer.d.ts +1 -1
- package/esm/src/rendering/page-renderer.d.ts.map +1 -1
- package/esm/src/rendering/page-rendering.d.ts +1 -1
- package/esm/src/rendering/page-rendering.d.ts.map +1 -1
- package/esm/src/rendering/rsc/server-renderer/component-detector.d.ts +1 -1
- package/esm/src/rendering/rsc/server-renderer/component-detector.d.ts.map +1 -1
- package/esm/src/rendering/rsc/server-renderer/rsc-renderer.d.ts +1 -1
- package/esm/src/rendering/rsc/server-renderer/rsc-renderer.d.ts.map +1 -1
- package/esm/src/rendering/rsc/server-renderer/tree-processor.d.ts +1 -1
- package/esm/src/rendering/rsc/server-renderer/tree-processor.d.ts.map +1 -1
- package/esm/src/rendering/rsc/server-renderer/tree-processor.js +1 -1
- package/esm/src/rendering/snippet-renderer.js +2 -2
- package/esm/src/rendering/ssr/component-registry.d.ts +1 -1
- package/esm/src/rendering/ssr/component-registry.d.ts.map +1 -1
- package/esm/src/rendering/ssr/component-registry.js +1 -1
- package/esm/src/rendering/ssr/mdx-renderer.d.ts +1 -1
- package/esm/src/rendering/ssr/mdx-renderer.d.ts.map +1 -1
- package/esm/src/rendering/ssr/mdx-renderer.js +1 -1
- package/esm/src/rendering/ssr/types.d.ts +1 -1
- package/esm/src/rendering/ssr/types.d.ts.map +1 -1
- package/esm/src/rendering/ssr-renderer.d.ts +1 -1
- package/esm/src/rendering/ssr-renderer.d.ts.map +1 -1
- package/esm/src/rendering/utils/react-helpers.d.ts +1 -1
- package/esm/src/rendering/utils/react-helpers.d.ts.map +1 -1
- package/esm/src/rendering/utils/react-helpers.js +1 -1
- package/esm/src/security/http/base-handler.d.ts +2 -0
- package/esm/src/security/http/base-handler.d.ts.map +1 -1
- package/esm/src/security/http/base-handler.js +1 -0
- package/esm/src/server/handlers/dev/framework-candidates.generated.d.ts.map +1 -1
- package/esm/src/server/handlers/dev/framework-candidates.generated.js +841 -596
- package/esm/src/server/handlers/request/agent-stream.handler.d.ts.map +1 -1
- package/esm/src/server/handlers/request/agent-stream.handler.js +4 -1
- package/esm/src/transforms/mdx/esm-module-loader/components/resolver.d.ts +1 -1
- package/esm/src/transforms/mdx/esm-module-loader/components/resolver.d.ts.map +1 -1
- package/esm/src/transforms/mdx/esm-module-loader/jsx/runtime-loader.js +1 -1
- package/esm/src/transforms/mdx/index.d.ts +1 -1
- package/esm/src/transforms/mdx/index.d.ts.map +1 -1
- package/esm/src/transforms/mdx/index.js +1 -1
- package/esm/src/transforms/mdx/mdx-cache-adapter.js +1 -1
- package/esm/src/transforms/mdx/module-loader/types.d.ts +1 -1
- package/esm/src/transforms/mdx/module-loader/types.d.ts.map +1 -1
- package/esm/src/transforms/mdx/types.d.ts +2 -2
- package/esm/src/transforms/mdx/types.d.ts.map +1 -1
- package/esm/src/types/app.d.ts +1 -1
- package/esm/src/types/app.d.ts.map +1 -1
- package/esm/src/types/global-guards.d.ts +1 -1
- package/esm/src/types/global-guards.d.ts.map +1 -1
- package/esm/src/types/index.d.ts +1 -1
- package/esm/src/types/index.d.ts.map +1 -1
- package/esm/src/utils/id.d.ts +7 -0
- package/esm/src/utils/id.d.ts.map +1 -1
- package/esm/src/utils/id.js +22 -0
- package/esm/src/utils/version-constant.d.ts +1 -1
- package/esm/src/utils/version-constant.js +1 -1
- package/esm/src/workflow/claude-code/react/use-claude-code-stream.js +1 -1
- package/esm/src/workflow/claude-code/react/use-claude-code-websocket.js +1 -1
- package/esm/src/workflow/react/use-approval.js +1 -1
- package/esm/src/workflow/react/use-workflow-list.js +1 -1
- package/esm/src/workflow/react/use-workflow-start.js +1 -1
- package/esm/src/workflow/react/use-workflow.js +1 -1
- package/package.json +4 -5
- package/esm/deps/esm.sh/react-dom@19.2.4/client.d.ts +0 -3
- package/esm/deps/esm.sh/react-dom@19.2.4/client.d.ts.map +0 -1
- package/esm/deps/esm.sh/react-dom@19.2.4/client.js +0 -3
- package/esm/deps/esm.sh/react-dom@19.2.4/server.d.ts +0 -3
- package/esm/deps/esm.sh/react-dom@19.2.4/server.d.ts.map +0 -1
- package/esm/deps/esm.sh/react-dom@19.2.4/server.js +0 -3
- package/esm/deps/esm.sh/react-dom@19.2.4.d.ts +0 -3
- package/esm/deps/esm.sh/react-dom@19.2.4.d.ts.map +0 -1
- package/esm/deps/esm.sh/react-dom@19.2.4.js +0 -3
- package/esm/deps/esm.sh/react@19.2.4/jsx-dev-runtime.d.ts +0 -3
- package/esm/deps/esm.sh/react@19.2.4/jsx-dev-runtime.d.ts.map +0 -1
- package/esm/deps/esm.sh/react@19.2.4/jsx-dev-runtime.js +0 -3
- package/esm/deps/esm.sh/react@19.2.4/jsx-runtime.d.ts +0 -3
- package/esm/deps/esm.sh/react@19.2.4/jsx-runtime.d.ts.map +0 -1
- package/esm/deps/esm.sh/react@19.2.4/jsx-runtime.js +0 -3
- package/esm/deps/esm.sh/react@19.2.4.d.ts +0 -3
- package/esm/deps/esm.sh/react@19.2.4.d.ts.map +0 -1
- package/esm/deps/esm.sh/react@19.2.4.js +0 -3
- package/esm/deps/esm.sh/scheduler@^0.27.0.d.ts +0 -3
- package/esm/deps/esm.sh/scheduler@^0.27.0.d.ts.map +0 -1
- package/esm/deps/esm.sh/scheduler@^0.27.0.js +0 -3
- package/esm/react/jsx-dev-runtime.d.ts +0 -2
- package/esm/react/jsx-dev-runtime.d.ts.map +0 -1
- package/esm/react/jsx-dev-runtime.js +0 -1
- package/esm/react/jsx-runtime.d.ts +0 -2
- package/esm/react/jsx-runtime.d.ts.map +0 -1
- package/esm/react/jsx-runtime.js +0 -1
- package/esm/react/react-dom-client.d.ts +0 -3
- package/esm/react/react-dom-client.d.ts.map +0 -1
- package/esm/react/react-dom-client.js +0 -2
- package/esm/react/react-dom-server.d.ts +0 -3
- package/esm/react/react-dom-server.d.ts.map +0 -1
- package/esm/react/react-dom-server.js +0 -2
- package/esm/react/react-dom.d.ts +0 -3
- package/esm/react/react-dom.d.ts.map +0 -1
- package/esm/react/react-dom.js +0 -2
- package/esm/react/react.d.ts +0 -6
- package/esm/react/react.d.ts.map +0 -1
- package/esm/react/react.js +0 -7
package/esm/src/proxy/main.js
CHANGED
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
import * as dntShim from "../../_dnt.shims.js";
|
|
23
23
|
import { createProxyHandler, INTERNAL_PROXY_HEADERS } from "./handler.js";
|
|
24
24
|
import { createCacheFromEnv } from "./cache/index.js";
|
|
25
|
-
import {
|
|
25
|
+
import { getReplayableRequestBodies, getUpstreamRetryCount, shouldRetryUpstreamRequest, } from "./retry.js";
|
|
26
26
|
import { authorizeWebSocketRequest, closeBridgePeer, createProxyClientWebSocketUpgradeOptions, getClientWebSocketErrorLogLevel, getServerWebSocketErrorLogLevel, } from "./websocket-bridge.js";
|
|
27
27
|
import { register } from "../extensions/contracts.js";
|
|
28
28
|
import { importFirstPartyExtensionModule } from "../extensions/first-party-import.js";
|
|
@@ -301,8 +301,8 @@ function forwardToServer(req, url) {
|
|
|
301
301
|
newHeaders.set("x-branch-name", ctx.branchName);
|
|
302
302
|
newHeaders.delete("host");
|
|
303
303
|
injectContext(newHeaders);
|
|
304
|
-
const maxRetries = getUpstreamRetryCount(req
|
|
305
|
-
const
|
|
304
|
+
const maxRetries = getUpstreamRetryCount(req, url.pathname, VERYFRONT_SERVER_RETRY_COUNT);
|
|
305
|
+
const upstreamBodies = getReplayableRequestBodies(req, maxRetries);
|
|
306
306
|
let lastError = null;
|
|
307
307
|
// After a retryable connection error to a dedicated server, fall back to shared pool
|
|
308
308
|
let skipDedicated = false;
|
|
@@ -333,7 +333,7 @@ function forwardToServer(req, url) {
|
|
|
333
333
|
const response = await profileProxyServerTimingPhase(proxyTiming, "proxy.upstream", () => withSpan(ProxySpanNames.HTTP_CLIENT_FETCH, () => fetch(serverUrl.toString(), {
|
|
334
334
|
method: req.method,
|
|
335
335
|
headers: newHeaders,
|
|
336
|
-
body:
|
|
336
|
+
body: upstreamBodies[attempt] ?? null,
|
|
337
337
|
redirect: "manual",
|
|
338
338
|
signal: abortController.signal,
|
|
339
339
|
}), {
|
|
@@ -372,7 +372,8 @@ function forwardToServer(req, url) {
|
|
|
372
372
|
return withProxyTiming(createUpstreamTimeoutResponse(VERYFRONT_SERVER_REQUEST_TIMEOUT_MS));
|
|
373
373
|
}
|
|
374
374
|
// Check if this is a retryable error and we have retries left
|
|
375
|
-
if (
|
|
375
|
+
if (shouldRetryUpstreamRequest(req, url.pathname, error) &&
|
|
376
|
+
attempt < maxRetries) {
|
|
376
377
|
// If we were targeting a dedicated server, fall back to shared pool on retry
|
|
377
378
|
if (dedicatedServerUrl) {
|
|
378
379
|
skipDedicated = true;
|
package/esm/src/proxy/retry.d.ts
CHANGED
|
@@ -9,11 +9,19 @@ export declare function isRetryableConnectionError(error: unknown): boolean;
|
|
|
9
9
|
/**
|
|
10
10
|
* Decide how many times the proxy can safely retry an upstream request.
|
|
11
11
|
*
|
|
12
|
-
* Ordinary non-idempotent requests are not replayed.
|
|
13
|
-
* stream
|
|
14
|
-
*
|
|
15
|
-
*
|
|
12
|
+
* Ordinary non-idempotent requests are not replayed. A bounded control-plane
|
|
13
|
+
* run stream invocation may retry to the shared runtime when the dedicated
|
|
14
|
+
* runtime refuses the connection. Missing, chunked, invalid, and oversized
|
|
15
|
+
* bodies remain single-shot so cloning cannot buffer unbounded input.
|
|
16
16
|
*/
|
|
17
|
-
export declare function getUpstreamRetryCount(
|
|
18
|
-
|
|
17
|
+
export declare function getUpstreamRetryCount(request: Request, pathname: string, configuredRetryCount: number): number;
|
|
18
|
+
/** Decide whether this failure mode is safe to replay for the request. */
|
|
19
|
+
export declare function shouldRetryUpstreamRequest(request: Request, pathname: string, error: unknown): boolean;
|
|
20
|
+
/**
|
|
21
|
+
* Build one independently consumable body stream for every upstream attempt.
|
|
22
|
+
* Request bodies are one-shot streams, so reusing the first stream would make
|
|
23
|
+
* a retry fail before it reaches the fallback runtime. Cloning before the
|
|
24
|
+
* first fetch preserves the exact signed bytes for each attempt.
|
|
25
|
+
*/
|
|
26
|
+
export declare function getReplayableRequestBodies(request: Request, retryCount: number): Array<ReadableStream<Uint8Array> | null>;
|
|
19
27
|
//# sourceMappingURL=retry.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"retry.d.ts","sourceRoot":"","sources":["../../../src/src/proxy/retry.ts"],"names":[],"mappings":"AAAA;;GAEG;
|
|
1
|
+
{"version":3,"file":"retry.d.ts","sourceRoot":"","sources":["../../../src/src/proxy/retry.ts"],"names":[],"mappings":"AAAA;;GAEG;AAQH;;;GAGG;AACH,wBAAgB,0BAA0B,CAAC,KAAK,EAAE,OAAO,GAAG,OAAO,CAUlE;AAwCD;;;;;;;GAOG;AACH,wBAAgB,qBAAqB,CACnC,OAAO,EAAE,OAAO,EAChB,QAAQ,EAAE,MAAM,EAChB,oBAAoB,EAAE,MAAM,GAC3B,MAAM,CAUR;AAED,0EAA0E;AAC1E,wBAAgB,0BAA0B,CACxC,OAAO,EAAE,OAAO,EAChB,QAAQ,EAAE,MAAM,EAChB,KAAK,EAAE,OAAO,GACb,OAAO,CAQT;AAED;;;;;GAKG;AACH,wBAAgB,0BAA0B,CACxC,OAAO,EAAE,OAAO,EAChB,UAAU,EAAE,MAAM,GACjB,KAAK,CAAC,cAAc,CAAC,UAAU,CAAC,GAAG,IAAI,CAAC,CAc1C"}
|
package/esm/src/proxy/retry.js
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Retry utilities for the proxy server.
|
|
3
3
|
*/
|
|
4
|
+
import { DEFAULT_MAX_BODY_SIZE_BYTES } from "../utils/constants/index.js";
|
|
5
|
+
const CONTROL_PLANE_RUN_STREAM_PATH = /^\/api\/control-plane\/runs\/[^/]+\/stream$/;
|
|
4
6
|
/**
|
|
5
7
|
* Check if a fetch error is a transient connection error worth retrying.
|
|
6
8
|
* These occur when renderer pods are being recycled or temporarily unavailable.
|
|
@@ -16,30 +18,90 @@ export function isRetryableConnectionError(error) {
|
|
|
16
18
|
msg.includes("os error 111") // ECONNREFUSED
|
|
17
19
|
);
|
|
18
20
|
}
|
|
21
|
+
function isConnectionRefusedError(error) {
|
|
22
|
+
if (!(error instanceof Error))
|
|
23
|
+
return false;
|
|
24
|
+
const message = error.message.toLowerCase();
|
|
25
|
+
return message.includes("connection refused") || message.includes("os error 111");
|
|
26
|
+
}
|
|
27
|
+
function isIdempotentMethod(method) {
|
|
28
|
+
return method === "GET" || method === "HEAD" || method === "OPTIONS";
|
|
29
|
+
}
|
|
30
|
+
function isControlPlaneRunStreamPost(request, pathname) {
|
|
31
|
+
return request.method === "POST" && CONTROL_PLANE_RUN_STREAM_PATH.test(pathname);
|
|
32
|
+
}
|
|
33
|
+
function getRequestBodyReplayKind(request) {
|
|
34
|
+
const transferEncoding = request.headers.get("transfer-encoding");
|
|
35
|
+
if (transferEncoding !== null && transferEncoding.trim() !== "") {
|
|
36
|
+
return "unsupported";
|
|
37
|
+
}
|
|
38
|
+
const contentLength = request.headers.get("content-length");
|
|
39
|
+
if (contentLength === null)
|
|
40
|
+
return request.body === null ? "bodyless" : "unsupported";
|
|
41
|
+
const normalizedLength = contentLength.trim();
|
|
42
|
+
if (!/^\d+$/.test(normalizedLength))
|
|
43
|
+
return "unsupported";
|
|
44
|
+
const length = Number(normalizedLength);
|
|
45
|
+
if (length === 0)
|
|
46
|
+
return "bodyless";
|
|
47
|
+
if (request.body === null ||
|
|
48
|
+
!Number.isSafeInteger(length) ||
|
|
49
|
+
length > DEFAULT_MAX_BODY_SIZE_BYTES) {
|
|
50
|
+
return "unsupported";
|
|
51
|
+
}
|
|
52
|
+
return "bounded";
|
|
53
|
+
}
|
|
19
54
|
/**
|
|
20
55
|
* Decide how many times the proxy can safely retry an upstream request.
|
|
21
56
|
*
|
|
22
|
-
* Ordinary non-idempotent requests are not replayed.
|
|
23
|
-
* stream
|
|
24
|
-
*
|
|
25
|
-
*
|
|
57
|
+
* Ordinary non-idempotent requests are not replayed. A bounded control-plane
|
|
58
|
+
* run stream invocation may retry to the shared runtime when the dedicated
|
|
59
|
+
* runtime refuses the connection. Missing, chunked, invalid, and oversized
|
|
60
|
+
* bodies remain single-shot so cloning cannot buffer unbounded input.
|
|
26
61
|
*/
|
|
27
|
-
export function getUpstreamRetryCount(
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
62
|
+
export function getUpstreamRetryCount(request, pathname, configuredRetryCount) {
|
|
63
|
+
const bodyKind = getRequestBodyReplayKind(request);
|
|
64
|
+
if (bodyKind === "unsupported")
|
|
65
|
+
return 0;
|
|
66
|
+
const retryCount = Math.max(0, configuredRetryCount);
|
|
67
|
+
if (isIdempotentMethod(request.method))
|
|
68
|
+
return retryCount;
|
|
69
|
+
if (isControlPlaneRunStreamPost(request, pathname)) {
|
|
70
|
+
return Math.min(retryCount, 1);
|
|
71
|
+
}
|
|
72
|
+
return 0;
|
|
73
|
+
}
|
|
74
|
+
/** Decide whether this failure mode is safe to replay for the request. */
|
|
75
|
+
export function shouldRetryUpstreamRequest(request, pathname, error) {
|
|
76
|
+
if (!isRetryableConnectionError(error))
|
|
77
|
+
return false;
|
|
78
|
+
if (isIdempotentMethod(request.method))
|
|
79
|
+
return true;
|
|
80
|
+
if (!isControlPlaneRunStreamPost(request, pathname))
|
|
81
|
+
return false;
|
|
82
|
+
const bodyKind = getRequestBodyReplayKind(request);
|
|
83
|
+
if (bodyKind === "bodyless")
|
|
41
84
|
return true;
|
|
85
|
+
return bodyKind === "bounded" && isConnectionRefusedError(error);
|
|
86
|
+
}
|
|
87
|
+
/**
|
|
88
|
+
* Build one independently consumable body stream for every upstream attempt.
|
|
89
|
+
* Request bodies are one-shot streams, so reusing the first stream would make
|
|
90
|
+
* a retry fail before it reaches the fallback runtime. Cloning before the
|
|
91
|
+
* first fetch preserves the exact signed bytes for each attempt.
|
|
92
|
+
*/
|
|
93
|
+
export function getReplayableRequestBodies(request, retryCount) {
|
|
94
|
+
const attemptCount = Math.max(0, retryCount) + 1;
|
|
95
|
+
const bodyKind = getRequestBodyReplayKind(request);
|
|
96
|
+
if (bodyKind === "bodyless") {
|
|
97
|
+
return Array.from({ length: attemptCount }, () => null);
|
|
98
|
+
}
|
|
99
|
+
if (bodyKind === "unsupported" || attemptCount === 1)
|
|
100
|
+
return [request.body];
|
|
101
|
+
const bodies = [];
|
|
102
|
+
for (let attempt = 1; attempt < attemptCount; attempt++) {
|
|
103
|
+
bodies.push(request.clone().body);
|
|
42
104
|
}
|
|
43
|
-
|
|
44
|
-
return
|
|
105
|
+
bodies.push(request.body);
|
|
106
|
+
return bodies;
|
|
45
107
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hooks-adapter.d.ts","sourceRoot":"","sources":["../../../../src/src/react/compat/hooks-adapter.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,
|
|
1
|
+
{"version":3,"file":"hooks-adapter.d.ts","sourceRoot":"","sources":["../../../../src/src/react/compat/hooks-adapter.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAG/B,MAAM,WAAW,UAAU;IACzB,OAAO,EAAE,OAAO,CAAC;IACjB,IAAI,EAAE,QAAQ,GAAG,IAAI,CAAC;IACtB,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;IACtB,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;CACvB;AAED,MAAM,MAAM,qBAAqB,CAAC,KAAK,IAAI,KAAK,GAAG,CAAC,CAAC,YAAY,EAAE,KAAK,KAAK,KAAK,CAAC,CAAC;AAmBpF,wBAAgB,iCAAiC,CAC/C,eAAe,EAAE,CAAC,OAAO,EAAE,OAAO,KAAK,IAAI,GAC1C;IACD,OAAO,IAAI,IAAI,CAAC;IAChB,eAAe,CAAC,QAAQ,EAAE,MAAM,IAAI,GAAG,IAAI,CAAC;CAC7C,CAoBA;AAED,wBAAgB,mBAAmB,IAAI,UAAU,CAWhD;AAED,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,eAAe,GAAG,KAAK,EAChE,KAAK,EAAE,KAAK,EACZ,QAAQ,CAAC,EAAE,CAAC,YAAY,EAAE,KAAK,EAAE,eAAe,EAAE,eAAe,KAAK,KAAK,GAC1E,CAAC,KAAK,EAAE,CAAC,MAAM,EAAE,qBAAqB,CAAC,eAAe,CAAC,KAAK,IAAI,CAAC,CA+CnE;AAED,wBAAgB,mBAAmB,IAAI,UAAU,CAAC,OAAO,KAAK,CAAC,aAAa,CAAC,CA2B5E;AAED,wBAAgB,sBAAsB,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,GAAG,CAAC,CAUrD;AAID,wBAAgB,WAAW,IAAI,MAAM,CAWpC;AAED,wBAAgB,cAAc,CAAC,EAC7B,QAAQ,EACR,QAAQ,GACT,EAAE;IACD,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;CAC3B,GAAG,KAAK,CAAC,YAAY,CAOrB;AAED,MAAM,WAAW,WAAW;IAC1B,aAAa,EAAE,OAAO,mBAAmB,CAAC;IAC1C,aAAa,EAAE,OAAO,mBAAmB,CAAC;IAC1C,aAAa,EAAE,OAAO,mBAAmB,CAAC;IAC1C,gBAAgB,EAAE,OAAO,sBAAsB,CAAC;IAChD,KAAK,EAAE,OAAO,WAAW,CAAC;CAC3B;AAkBD;;;GAGG;AACH,wBAAgB,uBAAuB,IAAI,IAAI,CAE9C;AAED,wBAAgB,cAAc,IAAI,WAAW,CAE5C;AAED,wBAAgB,mBAAmB,CAAC,EAClC,QAAQ,GACT,EAAE;IACD,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;CAC3B,GAAG,KAAK,CAAC,YAAY,CAMrB;AAED,eAAO,MAAM,WAAW,aAAqB,CAAC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as dntShim from "../../../_dnt.shims.js";
|
|
2
2
|
import { rendererLogger as logger } from "../../utils/index.js";
|
|
3
|
-
import * as React from "
|
|
3
|
+
import * as React from "react";
|
|
4
4
|
import { getReactVersionInfo, hasFeature } from "./version-detector/index.js";
|
|
5
5
|
function hasReactHook(hookName) {
|
|
6
6
|
return typeof React[hookName] === "function";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type * as React from "
|
|
1
|
+
import type * as React from "react";
|
|
2
2
|
import type { SSRResponseOptions } from "./types.js";
|
|
3
3
|
export declare function createSSRResponse(element: React.ReactNode, options?: SSRResponseOptions): Promise<Response>;
|
|
4
4
|
//# sourceMappingURL=response-builder.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"response-builder.d.ts","sourceRoot":"","sources":["../../../../../src/src/react/compat/ssr-adapter/response-builder.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,KAAK,MAAM,
|
|
1
|
+
{"version":3,"file":"response-builder.d.ts","sourceRoot":"","sources":["../../../../../src/src/react/compat/ssr-adapter/response-builder.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,KAAK,MAAM,OAAO,CAAC;AAIpC,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAC;AAUrD,wBAAsB,iBAAiB,CACrC,OAAO,EAAE,KAAK,CAAC,SAAS,EACxB,OAAO,GAAE,kBAAuB,GAC/B,OAAO,CAAC,QAAQ,CAAC,CA0BnB"}
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
export interface ReactDOMServer {
|
|
2
|
-
renderToString: typeof import("
|
|
3
|
-
renderToStaticMarkup: typeof import("
|
|
4
|
-
renderToPipeableStream?: typeof import("
|
|
5
|
-
renderToReadableStream?: typeof import("
|
|
2
|
+
renderToString: typeof import("react-dom/server").renderToString;
|
|
3
|
+
renderToStaticMarkup: typeof import("react-dom/server").renderToStaticMarkup;
|
|
4
|
+
renderToPipeableStream?: typeof import("react-dom/server").renderToPipeableStream;
|
|
5
|
+
renderToReadableStream?: typeof import("react-dom/server").renderToReadableStream;
|
|
6
6
|
}
|
|
7
7
|
type ServerModuleLoader = (url: string, label: string, reactVersion: string) => Promise<unknown>;
|
|
8
8
|
export declare function resetReactCache(): void;
|
|
9
9
|
export declare function __injectReactDOMServerForTests(server: ReactDOMServer | null, version?: string): void;
|
|
10
10
|
export declare function __setServerModuleLoaderForTests(loader: ServerModuleLoader | null): void;
|
|
11
|
-
export declare function getProjectReact(version?: string): Promise<typeof import("
|
|
11
|
+
export declare function getProjectReact(version?: string): Promise<typeof import("react")>;
|
|
12
12
|
export declare function getReactDOMServer(version?: string): Promise<ReactDOMServer>;
|
|
13
13
|
export {};
|
|
14
14
|
//# sourceMappingURL=server-loader.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"server-loader.d.ts","sourceRoot":"","sources":["../../../../../src/src/react/compat/ssr-adapter/server-loader.ts"],"names":[],"mappings":"AAaA,MAAM,WAAW,cAAc;IAC7B,cAAc,EAAE,cAAc,
|
|
1
|
+
{"version":3,"file":"server-loader.d.ts","sourceRoot":"","sources":["../../../../../src/src/react/compat/ssr-adapter/server-loader.ts"],"names":[],"mappings":"AAaA,MAAM,WAAW,cAAc;IAC7B,cAAc,EAAE,cAAc,kBAAkB,EAAE,cAAc,CAAC;IACjE,oBAAoB,EAAE,cAAc,kBAAkB,EAAE,oBAAoB,CAAC;IAC7E,sBAAsB,CAAC,EAAE,cAAc,kBAAkB,EAAE,sBAAsB,CAAC;IAClF,sBAAsB,CAAC,EAAE,cAAc,kBAAkB,EAAE,sBAAsB,CAAC;CACnF;AAED,KAAK,kBAAkB,GAAG,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,KAAK,OAAO,CAAC,OAAO,CAAC,CAAC;AAQjG,wBAAgB,eAAe,IAAI,IAAI,CAGtC;AAMD,wBAAgB,8BAA8B,CAC5C,MAAM,EAAE,cAAc,GAAG,IAAI,EAC7B,OAAO,CAAC,EAAE,MAAM,GACf,IAAI,CAON;AAeD,wBAAgB,+BAA+B,CAAC,MAAM,EAAE,kBAAkB,GAAG,IAAI,GAAG,IAAI,CAEvF;AAED,wBAAgB,eAAe,CAAC,OAAO,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,cAAc,OAAO,CAAC,CAAC,CA4BjF;AAED,wBAAgB,iBAAiB,CAAC,OAAO,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,cAAc,CAAC,CAqC3E"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as React from "
|
|
1
|
+
import * as React from "react";
|
|
2
2
|
import type { SSROptions, SSRResult } from "./types.js";
|
|
3
3
|
export declare function __setSSRStreamTimeoutForTests(timeoutMs: number): void;
|
|
4
4
|
export declare function __resetSSRStreamRendererForTests(): void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"stream-renderer.d.ts","sourceRoot":"","sources":["../../../../../src/src/react/compat/ssr-adapter/stream-renderer.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,KAAK,MAAM,
|
|
1
|
+
{"version":3,"file":"stream-renderer.d.ts","sourceRoot":"","sources":["../../../../../src/src/react/compat/ssr-adapter/stream-renderer.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAK/B,OAAO,KAAK,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAexD,wBAAgB,6BAA6B,CAAC,SAAS,EAAE,MAAM,GAAG,IAAI,CAErE;AAED,wBAAgB,gCAAgC,IAAI,IAAI,CAEvD;AAwMD,wBAAsB,qBAAqB,CACzC,OAAO,EAAE,KAAK,CAAC,SAAS,EACxB,OAAO,GAAE,UAAe,GACvB,OAAO,CAAC,SAAS,CAAC,CAwBpB"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as React from "
|
|
1
|
+
import * as React from "react";
|
|
2
2
|
import type { SSROptions } from "./types.js";
|
|
3
3
|
export declare function renderToStringAdapter(element: React.ReactNode, options?: SSROptions): Promise<string>;
|
|
4
4
|
export declare function renderToStaticMarkupAdapter(element: React.ReactNode, options?: SSROptions): Promise<string>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"string-renderer.d.ts","sourceRoot":"","sources":["../../../../../src/src/react/compat/ssr-adapter/string-renderer.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,
|
|
1
|
+
{"version":3,"file":"string-renderer.d.ts","sourceRoot":"","sources":["../../../../../src/src/react/compat/ssr-adapter/string-renderer.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAK/B,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAiB7C,wBAAsB,qBAAqB,CACzC,OAAO,EAAE,KAAK,CAAC,SAAS,EACxB,OAAO,GAAE,UAAe,GACvB,OAAO,CAAC,MAAM,CAAC,CAmCjB;AAED,wBAAsB,2BAA2B,CAC/C,OAAO,EAAE,KAAK,CAAC,SAAS,EACxB,OAAO,GAAE,UAAe,GACvB,OAAO,CAAC,MAAM,CAAC,CAUjB"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { rendererLogger as logger } from "../../../utils/index.js";
|
|
2
2
|
import { readTextFile } from "../../../platform/compat/fs.js";
|
|
3
|
-
import * as React from "
|
|
3
|
+
import * as React from "react";
|
|
4
4
|
import { isReact17, isReact18, isReact19, parseVersion } from "./version-parser.js";
|
|
5
5
|
export function detectFeatures(major, minor, isReact19Flag) {
|
|
6
6
|
const isReact18Plus = major >= 18;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AppWrapper.d.ts","sourceRoot":"","sources":["../../../../src/src/react/components/AppWrapper.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,
|
|
1
|
+
{"version":3,"file":"AppWrapper.d.ts","sourceRoot":"","sources":["../../../../src/src/react/components/AppWrapper.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,KAAK,EAAE,aAAa,EAAE,WAAW,IAAI,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AAC3F,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AAItD,MAAM,WAAW,eAAe;IAC9B,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,SAAS,CAAC,EAAE,SAAS,EAAE,CAAC;IACxB,MAAM,CAAC,EAAE,SAAS,CAAC;IACnB,UAAU,CAAC,EAAE,aAAa,CAAC;IAC3B,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,WAAW,CAAC,EAAE,gBAAgB,CAAC;CAChC;AAED,wBAAgB,UAAU,CAAC,EACzB,QAAQ,EACR,SAAc,EACd,MAAM,EACN,UAAe,EACf,WAAW,GACZ,EAAE,eAAe,GAAG,KAAK,CAAC,SAAS,CAqBnC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as React from "
|
|
1
|
+
import * as React from "react";
|
|
2
2
|
import { LayoutComponent } from "./LayoutComponent.js";
|
|
3
3
|
import { ProviderComponent } from "./ProviderComponent.js";
|
|
4
4
|
export function AppWrapper({ children, providers = [], layout, components = {}, pageContext, }) {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type React from "
|
|
1
|
+
import type React from "react";
|
|
2
2
|
import type { MdxBundle, MDXComponents, PageContext as TypedPageContext } from "../../types/index.js";
|
|
3
3
|
export type { MdxBundle } from "../../types/index.js";
|
|
4
4
|
interface LayoutComponentProps {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LayoutComponent.d.ts","sourceRoot":"","sources":["../../../../src/src/react/components/LayoutComponent.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,
|
|
1
|
+
{"version":3,"file":"LayoutComponent.d.ts","sourceRoot":"","sources":["../../../../src/src/react/components/LayoutComponent.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAG/B,OAAO,KAAK,EAAE,SAAS,EAAE,aAAa,EAAE,WAAW,IAAI,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AAGtG,YAAY,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AAEtD,UAAU,oBAAoB;IAC5B,SAAS,EAAE,SAAS,CAAC;IACrB,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,UAAU,CAAC,EAAE,aAAa,CAAC;IAC3B,WAAW,CAAC,EAAE,gBAAgB,CAAC;CAChC;AAcD,wBAAgB,eAAe,CAAC,EAC9B,SAAS,EACT,QAAQ,EACR,UAAe,EACf,WAAW,GACZ,EAAE,oBAAoB,GAAG,KAAK,CAAC,YAAY,CA6B3C"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MDXProvider.d.ts","sourceRoot":"","sources":["../../../../src/src/react/components/MDXProvider.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAoC,MAAM,
|
|
1
|
+
{"version":3,"file":"MDXProvider.d.ts","sourceRoot":"","sources":["../../../../src/src/react/components/MDXProvider.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAoC,MAAM,OAAO,CAAC;AACzD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAI1D,sCAAsC;AACtC,MAAM,WAAW,gBAAgB;IAC/B,UAAU,CAAC,EAAE,aAAa,CAAC;IAC3B,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;CAC3B;AAED,2BAA2B;AAC3B,wBAAgB,WAAW,CAAC,EAC1B,UAAe,EACf,QAAQ,GACT,EAAE,gBAAgB,GAAG,KAAK,CAAC,SAAS,CAEpC;AAED,oCAAoC;AACpC,wBAAgB,gBAAgB,CAAC,UAAU,CAAC,EAAE,aAAa,GAAG,aAAa,CAG1E"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ProviderComponent.d.ts","sourceRoot":"","sources":["../../../../src/src/react/components/ProviderComponent.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,KAAK,MAAM,
|
|
1
|
+
{"version":3,"file":"ProviderComponent.d.ts","sourceRoot":"","sources":["../../../../src/src/react/components/ProviderComponent.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,KAAK,MAAM,OAAO,CAAC;AAGpC,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAC1D,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AAGtD,UAAU,sBAAsB;IAC9B,SAAS,EAAE,SAAS,CAAC;IACrB,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,UAAU,CAAC,EAAE,aAAa,CAAC;CAC5B;AAiBD,wBAAgB,iBAAiB,CAAC,EAChC,SAAS,EACT,QAAQ,EACR,UAAe,GAChB,EAAE,sBAAsB,GAAG,KAAK,CAAC,YAAY,CAyB7C"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { useMemo, useRef } from "
|
|
1
|
+
import { useMemo, useRef } from "react";
|
|
2
2
|
import { mdxRenderer } from "../../transforms/mdx/index.js";
|
|
3
3
|
import { rendererLogger as logger } from "../../utils/index.js";
|
|
4
4
|
function useStableFrontmatter(frontmatter) {
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
*
|
|
9
9
|
* @module react/components/chat/agent-card
|
|
10
10
|
*/
|
|
11
|
-
import * as React from "
|
|
11
|
+
import * as React from "react";
|
|
12
12
|
import type { AgentMessage, AgentStatus, ToolCall } from "../../../agent/index.js";
|
|
13
13
|
import { type StatusColor } from "../ui/status.js";
|
|
14
14
|
/** Props accepted by agent card. */
|
|
@@ -27,10 +27,10 @@ export interface AgentCardProps {
|
|
|
27
27
|
thinking?: string;
|
|
28
28
|
/** Additional class name for the card. */
|
|
29
29
|
className?: string;
|
|
30
|
-
/** Custom tool renderer — overrides the default `ToolCall` card. */
|
|
31
|
-
renderTool?: (toolCall: ToolCall) => React.ReactNode;
|
|
32
30
|
/** Compose your own card; when omitted, the default anatomy is rendered. */
|
|
33
31
|
children?: React.ReactNode;
|
|
32
|
+
/** React 19: ref is a regular prop. */
|
|
33
|
+
ref?: React.Ref<HTMLDivElement>;
|
|
34
34
|
}
|
|
35
35
|
/** Per-card state shared with `AgentCard.*` sub-parts. */
|
|
36
36
|
export interface AgentCardContextValue {
|
|
@@ -40,7 +40,6 @@ export interface AgentCardContextValue {
|
|
|
40
40
|
toolCalls: ToolCall[];
|
|
41
41
|
status: AgentStatus;
|
|
42
42
|
thinking?: string;
|
|
43
|
-
renderTool?: (toolCall: ToolCall) => React.ReactNode;
|
|
44
43
|
presentation: {
|
|
45
44
|
color: StatusColor;
|
|
46
45
|
label: string;
|
|
@@ -49,6 +48,15 @@ export interface AgentCardContextValue {
|
|
|
49
48
|
}
|
|
50
49
|
/** Read the enclosing `AgentCard` state. Throws when used outside an `AgentCard`. */
|
|
51
50
|
export declare function useAgentCard(): AgentCardContextValue;
|
|
51
|
+
/**
|
|
52
|
+
* `AgentCard.Root` — context provider + the `Card` wrapper. No children renders
|
|
53
|
+
* the default anatomy (`Header` + `Reasoning` + `Tools` + `Body`); pass children
|
|
54
|
+
* to recompose.
|
|
55
|
+
*/
|
|
56
|
+
declare function AgentCardRoot({ name, avatarUrl, messages, toolCalls, status, thinking, className, children, ref, }: AgentCardProps): React.ReactElement;
|
|
57
|
+
declare namespace AgentCardRoot {
|
|
58
|
+
var displayName: string;
|
|
59
|
+
}
|
|
52
60
|
/**
|
|
53
61
|
* The header row: Avatar + name (left), Status (right). Mirrors
|
|
54
62
|
* `ChatMessageHeader` / `Message.Header`.
|
|
@@ -66,7 +74,7 @@ declare function AgentCardReasoning({ className }: {
|
|
|
66
74
|
declare namespace AgentCardReasoning {
|
|
67
75
|
var displayName: string;
|
|
68
76
|
}
|
|
69
|
-
/** The tool-call list. Renders one `ToolCall` card per entry
|
|
77
|
+
/** The tool-call list. Renders one `ToolCall` card per entry. */
|
|
70
78
|
declare function AgentCardTools({ className }: {
|
|
71
79
|
className?: string;
|
|
72
80
|
}): React.JSX.Element | null;
|
|
@@ -85,8 +93,8 @@ declare namespace AgentCardBody {
|
|
|
85
93
|
* `AgentCard.Header` / `Reasoning` / `Tools` / `Body` for a custom layout.
|
|
86
94
|
* Mirrors the `ToolCall` compound: render it, or compose it.
|
|
87
95
|
*/
|
|
88
|
-
export declare const AgentCard:
|
|
89
|
-
Root:
|
|
96
|
+
export declare const AgentCard: typeof AgentCardRoot & {
|
|
97
|
+
Root: typeof AgentCardRoot;
|
|
90
98
|
Header: typeof AgentCardHeader;
|
|
91
99
|
Reasoning: typeof AgentCardReasoning;
|
|
92
100
|
Tools: typeof AgentCardTools;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"agent-card.d.ts","sourceRoot":"","sources":["../../../../../src/src/react/components/chat/agent-card.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAWH,OAAO,KAAK,KAAK,MAAM,
|
|
1
|
+
{"version":3,"file":"agent-card.d.ts","sourceRoot":"","sources":["../../../../../src/src/react/components/chat/agent-card.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAWH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,KAAK,EAAE,YAAY,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,yBAAyB,CAAC;AAMnF,OAAO,EAAU,KAAK,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAK3D,oCAAoC;AACpC,MAAM,WAAW,cAAc;IAC7B,gEAAgE;IAChE,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,oDAAoD;IACpD,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,0EAA0E;IAC1E,QAAQ,CAAC,EAAE,YAAY,EAAE,CAAC;IAC1B,gEAAgE;IAChE,SAAS,CAAC,EAAE,QAAQ,EAAE,CAAC;IACvB,6DAA6D;IAC7D,MAAM,EAAE,WAAW,CAAC;IACpB,4EAA4E;IAC5E,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,0CAA0C;IAC1C,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,4EAA4E;IAC5E,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAE3B,uCAAuC;IACvC,GAAG,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,cAAc,CAAC,CAAC;CACjC;AAmDD,0DAA0D;AAC1D,MAAM,WAAW,qBAAqB;IACpC,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,YAAY,EAAE,CAAC;IAC1B,SAAS,EAAE,QAAQ,EAAE,CAAC;IACtB,MAAM,EAAE,WAAW,CAAC;IACpB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,YAAY,EAAE;QAAE,KAAK,EAAE,WAAW,CAAC;QAAC,KAAK,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,OAAO,CAAA;KAAE,CAAC;CACrE;AAMD,qFAAqF;AACrF,wBAAgB,YAAY,IAAI,qBAAqB,CAQpD;AAED;;;;GAIG;AACH,iBAAS,aAAa,CACpB,EACE,IAAc,EACd,SAAS,EACT,QAAQ,EACR,SAAc,EACd,MAAM,EACN,QAAQ,EACR,SAAS,EACT,QAAQ,EACR,GAAG,GACJ,EAAE,cAAc,GAChB,KAAK,CAAC,YAAY,CAgCpB;kBA5CQ,aAAa;;;AA+CtB;;;GAGG;AACH,iBAAS,eAAe,CACtB,EAAE,SAAS,EAAE,EAAE;IAAE,SAAS,CAAC,EAAE,MAAM,CAAA;CAAE,GACpC,KAAK,CAAC,GAAG,CAAC,OAAO,CAgBnB;kBAlBQ,eAAe;;;AAqBxB,yEAAyE;AACzE,iBAAS,kBAAkB,CACzB,EAAE,SAAS,EAAE,EAAE;IAAE,SAAS,CAAC,EAAE,MAAM,CAAA;CAAE,GACpC,KAAK,CAAC,GAAG,CAAC,OAAO,GAAG,IAAI,CAI1B;kBANQ,kBAAkB;;;AAS3B,iEAAiE;AACjE,iBAAS,cAAc,CACrB,EAAE,SAAS,EAAE,EAAE;IAAE,SAAS,CAAC,EAAE,MAAM,CAAA;CAAE,GACpC,KAAK,CAAC,GAAG,CAAC,OAAO,GAAG,IAAI,CAQ1B;kBAVQ,cAAc;;;AAavB,qEAAqE;AACrE,iBAAS,aAAa,CACpB,EAAE,SAAS,EAAE,EAAE;IAAE,SAAS,CAAC,EAAE,MAAM,CAAA;CAAE,GACpC,KAAK,CAAC,GAAG,CAAC,OAAO,GAAG,IAAI,CAgB1B;kBAlBQ,aAAa;;;AAqBtB;;;;GAIG;AACH,eAAO,MAAM,SAAS;;;;;;CAMpB,CAAC"}
|
|
@@ -18,15 +18,15 @@
|
|
|
18
18
|
// sub-part takes `className`, merged LAST via `cn`. The preset `<AgentCard>`
|
|
19
19
|
// stays fully back-compatible.
|
|
20
20
|
// ---------------------------------------------------------------------------
|
|
21
|
-
import * as React from "
|
|
21
|
+
import * as React from "react";
|
|
22
22
|
import { COMPONENT_ERROR } from "../../../errors/error-registry.js";
|
|
23
23
|
import { cn } from "./theme.js";
|
|
24
24
|
import { Avatar } from "../ui/avatar.js";
|
|
25
25
|
import { Card } from "../ui/card.js";
|
|
26
26
|
import { Status } from "../ui/status.js";
|
|
27
27
|
import { Markdown } from "./markdown.js";
|
|
28
|
-
import {
|
|
29
|
-
import {
|
|
28
|
+
import { Reasoning } from "./chat/components/reasoning.js";
|
|
29
|
+
import { ToolCall as ToolCallView } from "./chat/components/tool-ui.js";
|
|
30
30
|
/** Map the agent status to a `Status` dot colour, label, and pulse. */
|
|
31
31
|
function statusPresentation(status) {
|
|
32
32
|
switch (status) {
|
|
@@ -86,7 +86,7 @@ export function useAgentCard() {
|
|
|
86
86
|
* the default anatomy (`Header` + `Reasoning` + `Tools` + `Body`); pass children
|
|
87
87
|
* to recompose.
|
|
88
88
|
*/
|
|
89
|
-
|
|
89
|
+
function AgentCardRoot({ name = "Agent", avatarUrl, messages, toolCalls = [], status, thinking, className, children, ref, }) {
|
|
90
90
|
const presentation = statusPresentation(status);
|
|
91
91
|
const context = {
|
|
92
92
|
name,
|
|
@@ -95,7 +95,6 @@ const AgentCardRoot = React.forwardRef(function AgentCard({ name = "Agent", avat
|
|
|
95
95
|
toolCalls,
|
|
96
96
|
status,
|
|
97
97
|
thinking,
|
|
98
|
-
renderTool,
|
|
99
98
|
presentation,
|
|
100
99
|
};
|
|
101
100
|
return (React.createElement(AgentCardContext.Provider, { value: context },
|
|
@@ -104,7 +103,7 @@ const AgentCardRoot = React.forwardRef(function AgentCard({ name = "Agent", avat
|
|
|
104
103
|
React.createElement(AgentCardReasoning, null),
|
|
105
104
|
React.createElement(AgentCardTools, null),
|
|
106
105
|
React.createElement(AgentCardBody, null))))));
|
|
107
|
-
}
|
|
106
|
+
}
|
|
108
107
|
AgentCardRoot.displayName = "AgentCard.Root";
|
|
109
108
|
/**
|
|
110
109
|
* The header row: Avatar + name (left), Status (right). Mirrors
|
|
@@ -123,15 +122,15 @@ function AgentCardReasoning({ className }) {
|
|
|
123
122
|
const { thinking } = useAgentCard();
|
|
124
123
|
if (!thinking)
|
|
125
124
|
return null;
|
|
126
|
-
return React.createElement(
|
|
125
|
+
return React.createElement(Reasoning, { text: thinking, className: className });
|
|
127
126
|
}
|
|
128
127
|
AgentCardReasoning.displayName = "AgentCard.Reasoning";
|
|
129
|
-
/** The tool-call list. Renders one `ToolCall` card per entry
|
|
128
|
+
/** The tool-call list. Renders one `ToolCall` card per entry. */
|
|
130
129
|
function AgentCardTools({ className }) {
|
|
131
|
-
const { toolCalls
|
|
130
|
+
const { toolCalls } = useAgentCard();
|
|
132
131
|
if (toolCalls.length === 0)
|
|
133
132
|
return null;
|
|
134
|
-
return (React.createElement("div", { className: cn("flex flex-col gap-2", className) }, toolCalls.map((tool) =>
|
|
133
|
+
return (React.createElement("div", { className: cn("flex flex-col gap-2", className) }, toolCalls.map((tool) => React.createElement(ToolCallView, { key: tool.id, tool: toToolPart(tool) }))));
|
|
135
134
|
}
|
|
136
135
|
AgentCardTools.displayName = "AgentCard.Tools";
|
|
137
136
|
/** The message body — each message's text rendered as `Markdown`. */
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
/** Props shared by `AgentPicker.Create` and `AgentPicker.Manage`. */
|
|
3
|
+
export interface AgentPickerActionProps {
|
|
4
|
+
/** Override the leading action glyph. */
|
|
5
|
+
icon?: React.ReactNode;
|
|
6
|
+
/** Override the action label. */
|
|
7
|
+
children?: React.ReactNode;
|
|
8
|
+
className?: string;
|
|
9
|
+
}
|
|
10
|
+
/** Create-agent action. Renders only when `onCreate` is available on the root. */
|
|
11
|
+
export declare function AgentPickerCreate({ icon, children, className, }: AgentPickerActionProps): React.ReactElement | null;
|
|
12
|
+
export declare namespace AgentPickerCreate {
|
|
13
|
+
var displayName: string;
|
|
14
|
+
}
|
|
15
|
+
/** Manage-agents action. Renders only when `onManage` is available on the root. */
|
|
16
|
+
export declare function AgentPickerManage({ icon, children, className, }: AgentPickerActionProps): React.ReactElement | null;
|
|
17
|
+
export declare namespace AgentPickerManage {
|
|
18
|
+
var displayName: string;
|
|
19
|
+
}
|
|
20
|
+
//# sourceMappingURL=agent-picker-actions.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"agent-picker-actions.d.ts","sourceRoot":"","sources":["../../../../../src/src/react/components/chat/agent-picker-actions.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAK/B,qEAAqE;AACrE,MAAM,WAAW,sBAAsB;IACrC,yCAAyC;IACzC,IAAI,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACvB,iCAAiC;IACjC,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC3B,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,kFAAkF;AAClF,wBAAgB,iBAAiB,CAAC,EAChC,IAAI,EACJ,QAAQ,EACR,SAAS,GACV,EAAE,sBAAsB,GAAG,KAAK,CAAC,YAAY,GAAG,IAAI,CASpD;yBAbe,iBAAiB;;;AAgBjC,mFAAmF;AACnF,wBAAgB,iBAAiB,CAAC,EAChC,IAAI,EACJ,QAAQ,EACR,SAAS,GACV,EAAE,sBAAsB,GAAG,KAAK,CAAC,YAAY,GAAG,IAAI,CASpD;yBAbe,iBAAiB"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { CommandItem } from "../ui/command.js";
|
|
3
|
+
import { PlusIcon, SparklesIcon } from "../ui/icons/index.js";
|
|
4
|
+
import { useAgentPicker } from "./agent-picker-context.js";
|
|
5
|
+
/** Create-agent action. Renders only when `onCreate` is available on the root. */
|
|
6
|
+
export function AgentPickerCreate({ icon, children, className, }) {
|
|
7
|
+
const { onCreate } = useAgentPicker();
|
|
8
|
+
if (!onCreate)
|
|
9
|
+
return null;
|
|
10
|
+
return (React.createElement(CommandItem, { value: "Create Agent", onSelect: onCreate, className: className },
|
|
11
|
+
icon ?? React.createElement(PlusIcon, null),
|
|
12
|
+
children ?? "Create Agent"));
|
|
13
|
+
}
|
|
14
|
+
AgentPickerCreate.displayName = "AgentPicker.Create";
|
|
15
|
+
/** Manage-agents action. Renders only when `onManage` is available on the root. */
|
|
16
|
+
export function AgentPickerManage({ icon, children, className, }) {
|
|
17
|
+
const { onManage } = useAgentPicker();
|
|
18
|
+
if (!onManage)
|
|
19
|
+
return null;
|
|
20
|
+
return (React.createElement(CommandItem, { value: "Manage Agents", onSelect: onManage, className: className },
|
|
21
|
+
icon ?? React.createElement(SparklesIcon, null),
|
|
22
|
+
children ?? "Manage Agents"));
|
|
23
|
+
}
|
|
24
|
+
AgentPickerManage.displayName = "AgentPicker.Manage";
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/** Shared selection and open state exposed to `AgentPicker.*` sub-parts. */
|
|
2
|
+
export interface AgentPickerContextValue {
|
|
3
|
+
/** Selected agent id. */
|
|
4
|
+
value?: string;
|
|
5
|
+
/** Select an agent by id and close the menu. */
|
|
6
|
+
onSelect: (id: string) => void;
|
|
7
|
+
/** Popover open state. */
|
|
8
|
+
open: boolean;
|
|
9
|
+
/** Set the popover open state and notify `onOpenChange`. */
|
|
10
|
+
setOpen: (open: boolean) => void;
|
|
11
|
+
/** Create an agent and close the menu when the action is available. */
|
|
12
|
+
onCreate?: () => void;
|
|
13
|
+
/** Manage agents and close the menu when the action is available. */
|
|
14
|
+
onManage?: () => void;
|
|
15
|
+
}
|
|
16
|
+
export declare const AgentPickerContext: any;
|
|
17
|
+
/** Read the enclosing `AgentPicker` state. */
|
|
18
|
+
export declare function useAgentPicker(): AgentPickerContextValue;
|
|
19
|
+
//# sourceMappingURL=agent-picker-context.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"agent-picker-context.d.ts","sourceRoot":"","sources":["../../../../../src/src/react/components/chat/agent-picker-context.tsx"],"names":[],"mappings":"AAGA,4EAA4E;AAC5E,MAAM,WAAW,uBAAuB;IACtC,yBAAyB;IACzB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,gDAAgD;IAChD,QAAQ,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAC;IAC/B,0BAA0B;IAC1B,IAAI,EAAE,OAAO,CAAC;IACd,4DAA4D;IAC5D,OAAO,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,IAAI,CAAC;IACjC,uEAAuE;IACvE,QAAQ,CAAC,EAAE,MAAM,IAAI,CAAC;IACtB,qEAAqE;IACrE,QAAQ,CAAC,EAAE,MAAM,IAAI,CAAC;CACvB;AAED,eAAO,MAAM,kBAAkB,KAA4D,CAAC;AAE5F,8CAA8C;AAC9C,wBAAgB,cAAc,IAAI,uBAAuB,CAQxD"}
|