veryfront 0.1.149 → 0.1.151
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/commands/dev/command.js +3 -3
- package/esm/cli/commands/workflow/command-help.js +1 -1
- package/esm/cli/commands/workflow/command.js +2 -2
- package/esm/cli/shared/config.d.ts.map +1 -1
- package/esm/cli/shared/config.js +1 -3
- package/esm/deno.d.ts +5 -11
- package/esm/deno.js +16 -16
- package/esm/src/agent/ag-ui-handler.d.ts.map +1 -1
- package/esm/src/agent/ag-ui-handler.js +6 -0
- package/esm/src/agent/chat-handler.js +1 -1
- package/esm/src/agent/composition/composition.d.ts +1 -1
- package/esm/src/agent/composition/composition.d.ts.map +1 -1
- package/esm/src/agent/composition/composition.js +2 -2
- package/esm/src/agent/{ai-defaults.d.ts → defaults.d.ts} +1 -1
- package/esm/src/agent/defaults.d.ts.map +1 -0
- package/esm/src/agent/factory.js +1 -1
- package/esm/src/agent/react/index.d.ts +1 -1
- package/esm/src/agent/react/index.d.ts.map +1 -1
- package/esm/src/agent/react/use-chat/browser-inference/browser-engine.d.ts +5 -6
- package/esm/src/agent/react/use-chat/browser-inference/browser-engine.d.ts.map +1 -1
- package/esm/src/agent/react/use-chat/browser-inference/browser-engine.js +1 -1
- package/esm/src/agent/react/use-chat/index.d.ts +2 -1
- package/esm/src/agent/react/use-chat/index.d.ts.map +1 -1
- package/esm/src/agent/react/use-chat/stream-protocol.d.ts +2 -0
- package/esm/src/agent/react/use-chat/stream-protocol.d.ts.map +1 -0
- package/esm/src/agent/react/use-chat/stream-protocol.js +1 -0
- package/esm/src/agent/react/use-chat/streaming/parts-builder.d.ts +2 -2
- package/esm/src/agent/react/use-chat/streaming/parts-builder.d.ts.map +1 -1
- package/esm/src/agent/react/use-chat/streaming/types.d.ts +4 -4
- package/esm/src/agent/react/use-chat/streaming/types.d.ts.map +1 -1
- package/esm/src/agent/react/use-chat/types.d.ts +7 -55
- package/esm/src/agent/react/use-chat/types.d.ts.map +1 -1
- package/esm/src/agent/react/use-chat/use-chat.d.ts +4 -4
- package/esm/src/agent/react/use-chat/use-chat.d.ts.map +1 -1
- package/esm/src/agent/react/use-chat/use-chat.js +2 -2
- package/esm/src/agent/react/use-chat/utils.d.ts +2 -2
- package/esm/src/agent/react/use-chat/utils.d.ts.map +1 -1
- package/esm/src/agent/runtime/{ai-stream-handler.d.ts → chat-stream-handler.d.ts} +13 -13
- package/esm/src/agent/runtime/chat-stream-handler.d.ts.map +1 -0
- package/esm/src/agent/runtime/{ai-stream-handler.js → chat-stream-handler.js} +91 -89
- package/esm/src/agent/runtime/constants.js +1 -1
- package/esm/src/agent/runtime/index.d.ts +7 -5
- package/esm/src/agent/runtime/index.d.ts.map +1 -1
- package/esm/src/agent/runtime/index.js +67 -30
- package/esm/src/agent/runtime/model-message-converter.d.ts +7 -7
- package/esm/src/agent/runtime/model-message-converter.d.ts.map +1 -1
- package/esm/src/agent/runtime/model-message-converter.js +8 -6
- package/esm/src/agent/runtime/model-runtime-types.d.ts +44 -0
- package/esm/src/agent/runtime/model-runtime-types.d.ts.map +1 -0
- package/esm/src/agent/runtime/model-runtime-types.js +8 -0
- package/esm/src/agent/runtime/model-tool-converter.d.ts +9 -9
- package/esm/src/agent/runtime/model-tool-converter.d.ts.map +1 -1
- package/esm/src/agent/runtime/model-tool-converter.js +10 -22
- package/esm/src/agent/runtime/provider-native-tools.d.ts +3 -0
- package/esm/src/agent/runtime/provider-native-tools.d.ts.map +1 -0
- package/esm/src/agent/runtime/provider-native-tools.js +56 -0
- package/esm/src/agent/runtime/repair-tool-call.d.ts +2 -2
- package/esm/src/agent/runtime/repair-tool-call.d.ts.map +1 -1
- package/esm/src/agent/runtime/repair-tool-call.js +3 -3
- package/esm/src/agent/runtime/runtime-tool-builder.d.ts +48 -0
- package/esm/src/agent/runtime/runtime-tool-builder.d.ts.map +1 -0
- package/esm/src/agent/runtime/runtime-tool-builder.js +28 -0
- package/esm/src/agent/runtime/runtime-tool-errors.d.ts +16 -0
- package/esm/src/agent/runtime/runtime-tool-errors.d.ts.map +1 -0
- package/esm/src/agent/runtime/runtime-tool-errors.js +28 -0
- package/esm/src/agent/runtime/runtime-tool-types.d.ts +104 -0
- package/esm/src/agent/runtime/runtime-tool-types.d.ts.map +1 -0
- package/esm/src/agent/runtime/runtime-tool-types.js +7 -0
- package/esm/src/chat/index.d.ts +9 -9
- package/esm/src/chat/index.d.ts.map +1 -1
- package/esm/src/chat/index.js +7 -7
- package/esm/src/chat/protocol.d.ts +156 -0
- package/esm/src/chat/protocol.d.ts.map +1 -0
- package/esm/src/chat/protocol.js +7 -0
- package/esm/src/discovery/import-rewriter.d.ts.map +1 -1
- package/esm/src/discovery/import-rewriter.js +1 -14
- package/esm/src/discovery/index.d.ts +1 -1
- package/esm/src/discovery/index.d.ts.map +1 -1
- package/esm/src/discovery/index.js +2 -2
- package/esm/src/discovery/provider-config-validator.d.ts +14 -0
- package/esm/src/discovery/provider-config-validator.d.ts.map +1 -0
- package/esm/src/discovery/{config-validator.js → provider-config-validator.js} +4 -4
- package/esm/src/discovery/transpiler.d.ts.map +1 -1
- package/esm/src/discovery/transpiler.js +0 -3
- package/esm/src/embedding/embedding.d.ts.map +1 -1
- package/esm/src/embedding/embedding.js +1 -1
- package/esm/src/embedding/index.d.ts +3 -3
- package/esm/src/embedding/index.d.ts.map +1 -1
- package/esm/src/embedding/index.js +3 -3
- package/esm/src/embedding/rag-store.d.ts.map +1 -1
- package/esm/src/embedding/rag-store.js +1 -1
- package/esm/src/embedding/resolve.d.ts +5 -7
- package/esm/src/embedding/resolve.d.ts.map +1 -1
- package/esm/src/embedding/resolve.js +6 -9
- package/esm/src/embedding/vector-store.d.ts.map +1 -1
- package/esm/src/embedding/vector-store.js +1 -1
- package/esm/src/embedding/veryfront-cloud/provider.d.ts +2 -2
- package/esm/src/embedding/veryfront-cloud/provider.d.ts.map +1 -1
- package/esm/src/embedding/veryfront-cloud/provider.js +5 -6
- package/esm/src/internal-agents/ag-ui-sse.d.ts.map +1 -1
- package/esm/src/internal-agents/ag-ui-sse.js +12 -0
- package/esm/src/markdown/index.d.ts +1 -1
- package/esm/src/markdown/index.d.ts.map +1 -1
- package/esm/src/markdown/index.js +1 -1
- package/esm/src/modules/import-map/default-import-map.js +2 -2
- package/esm/src/prompt/registry.d.ts +1 -1
- package/esm/src/prompt/registry.d.ts.map +1 -1
- package/esm/src/prompt/registry.js +2 -2
- package/esm/src/provider/index.d.ts +7 -8
- package/esm/src/provider/index.d.ts.map +1 -1
- package/esm/src/provider/index.js +6 -8
- package/esm/src/provider/local/embedding-runtime-adapter.d.ts +19 -0
- package/esm/src/provider/local/embedding-runtime-adapter.d.ts.map +1 -0
- package/esm/src/provider/local/{local-embedding-adapter.js → embedding-runtime-adapter.js} +5 -5
- package/esm/src/provider/local/model-runtime-adapter.d.ts +18 -0
- package/esm/src/provider/local/model-runtime-adapter.d.ts.map +1 -0
- package/esm/src/provider/local/{ai-sdk-adapter.js → model-runtime-adapter.js} +10 -12
- package/esm/src/provider/model-registry.d.ts +11 -12
- package/esm/src/provider/model-registry.d.ts.map +1 -1
- package/esm/src/provider/model-registry.js +17 -20
- package/esm/src/provider/runtime-inspection.d.ts +6 -0
- package/esm/src/provider/runtime-inspection.d.ts.map +1 -0
- package/esm/src/provider/runtime-inspection.js +19 -0
- package/esm/src/provider/runtime-loader.d.ts +27 -0
- package/esm/src/provider/runtime-loader.d.ts.map +1 -0
- package/esm/src/provider/runtime-loader.js +1307 -0
- package/esm/src/provider/types.d.ts +35 -0
- package/esm/src/provider/types.d.ts.map +1 -0
- package/esm/src/provider/types.js +1 -0
- package/esm/src/provider/veryfront-cloud/provider.d.ts +2 -2
- package/esm/src/provider/veryfront-cloud/provider.d.ts.map +1 -1
- package/esm/src/provider/veryfront-cloud/provider.js +7 -9
- package/esm/src/provider/veryfront-cloud/shared.d.ts +1 -1
- package/esm/src/provider/veryfront-cloud/shared.js +1 -1
- package/esm/src/react/components/chat/agent-card.d.ts.map +1 -0
- package/esm/src/react/components/chat/chat/components/animations.d.ts.map +1 -0
- package/esm/src/react/components/chat/chat/components/attachment-pill.d.ts.map +1 -0
- package/esm/src/react/components/chat/chat/components/branch-picker.d.ts.map +1 -0
- package/esm/src/react/components/chat/chat/components/code-block.d.ts.map +1 -0
- package/esm/src/react/components/chat/chat/components/drop-zone.d.ts.map +1 -0
- package/esm/src/react/components/chat/chat/components/empty-state.d.ts.map +1 -0
- package/esm/src/react/components/chat/chat/components/inference-badge.d.ts.map +1 -0
- package/esm/src/react/components/{ai → chat}/chat/components/inference-badge.js +1 -1
- package/esm/src/react/components/chat/chat/components/inline-citation.d.ts.map +1 -0
- package/esm/src/react/components/chat/chat/components/message-actions.d.ts.map +1 -0
- package/esm/src/react/components/chat/chat/components/message-edit-form.d.ts.map +1 -0
- package/esm/src/react/components/chat/chat/components/message-feedback.d.ts.map +1 -0
- package/esm/src/react/components/chat/chat/components/quick-actions.d.ts.map +1 -0
- package/esm/src/react/components/chat/chat/components/reasoning.d.ts.map +1 -0
- package/esm/src/react/components/chat/chat/components/sidebar.d.ts.map +1 -0
- package/esm/src/react/components/{ai → chat}/chat/components/skill-badge.d.ts +3 -3
- package/esm/src/react/components/chat/chat/components/skill-badge.d.ts.map +1 -0
- package/esm/src/react/components/{ai → chat}/chat/components/skill-badge.js +1 -1
- package/esm/src/react/components/chat/chat/components/sources.d.ts.map +1 -0
- package/esm/src/react/components/chat/chat/components/step-indicator.d.ts.map +1 -0
- package/esm/src/react/components/chat/chat/components/tab-switcher.d.ts.map +1 -0
- package/esm/src/react/components/{ai → chat}/chat/components/tool-ui.d.ts +3 -3
- package/esm/src/react/components/chat/chat/components/tool-ui.d.ts.map +1 -0
- package/esm/src/react/components/{ai → chat}/chat/components/tool-ui.js +1 -1
- package/esm/src/react/components/chat/chat/components/upgrade-cta.d.ts.map +1 -0
- package/esm/src/react/components/chat/chat/components/uploads-panel.d.ts.map +1 -0
- package/esm/src/react/components/{ai → chat}/chat/composition/api.d.ts +1 -1
- package/esm/src/react/components/chat/chat/composition/api.d.ts.map +1 -0
- package/esm/src/react/components/{ai → chat}/chat/composition/api.js +1 -1
- package/esm/src/react/components/{ai → chat}/chat/composition/chat-composer.d.ts +3 -3
- package/esm/src/react/components/chat/chat/composition/chat-composer.d.ts.map +1 -0
- package/esm/src/react/components/{ai → chat}/chat/composition/chat-composer.js +1 -1
- package/esm/src/react/components/{ai → chat}/chat/composition/chat-empty.d.ts +1 -1
- package/esm/src/react/components/chat/chat/composition/chat-empty.d.ts.map +1 -0
- package/esm/src/react/components/{ai → chat}/chat/composition/chat-empty.js +1 -1
- package/esm/src/react/components/{ai → chat}/chat/composition/chat-if.d.ts +1 -1
- package/esm/src/react/components/chat/chat/composition/chat-if.d.ts.map +1 -0
- package/esm/src/react/components/{ai → chat}/chat/composition/chat-if.js +1 -1
- package/esm/src/react/components/{ai → chat}/chat/composition/chat-message-list.d.ts +5 -5
- package/esm/src/react/components/chat/chat/composition/chat-message-list.d.ts.map +1 -0
- package/esm/src/react/components/{ai → chat}/chat/composition/chat-message-list.js +2 -2
- package/esm/src/react/components/{ai → chat}/chat/composition/chat-root.d.ts +3 -3
- package/esm/src/react/components/chat/chat/composition/chat-root.d.ts.map +1 -0
- package/esm/src/react/components/{ai → chat}/chat/composition/chat-root.js +1 -1
- package/esm/src/react/components/{ai → chat}/chat/composition/error-banner.d.ts +1 -1
- package/esm/src/react/components/chat/chat/composition/error-banner.d.ts.map +1 -0
- package/esm/src/react/components/{ai → chat}/chat/composition/error-banner.js +1 -1
- package/esm/src/react/components/{ai → chat}/chat/composition/message.d.ts +4 -4
- package/esm/src/react/components/chat/chat/composition/message.d.ts.map +1 -0
- package/esm/src/react/components/{ai → chat}/chat/composition/message.js +1 -1
- package/esm/src/react/components/{ai → chat}/chat/composition/model-avatar.d.ts +1 -1
- package/esm/src/react/components/chat/chat/composition/model-avatar.d.ts.map +1 -0
- package/esm/src/react/components/{ai → chat}/chat/composition/model-avatar.js +1 -1
- package/esm/src/react/components/{ai → chat}/chat/contexts/chat-context.d.ts +3 -3
- package/esm/src/react/components/chat/chat/contexts/chat-context.d.ts.map +1 -0
- package/esm/src/react/components/{ai → chat}/chat/contexts/chat-context.js +1 -1
- package/esm/src/react/components/{ai → chat}/chat/contexts/composer-context.d.ts +1 -1
- package/esm/src/react/components/chat/chat/contexts/composer-context.d.ts.map +1 -0
- package/esm/src/react/components/{ai → chat}/chat/contexts/composer-context.js +1 -1
- package/esm/src/react/components/{ai → chat}/chat/contexts/index.d.ts +1 -1
- package/esm/src/react/components/chat/chat/contexts/index.d.ts.map +1 -0
- package/esm/src/react/components/{ai → chat}/chat/contexts/index.js +1 -1
- package/esm/src/react/components/{ai → chat}/chat/contexts/message-context.d.ts +3 -3
- package/esm/src/react/components/chat/chat/contexts/message-context.d.ts.map +1 -0
- package/esm/src/react/components/{ai → chat}/chat/contexts/message-context.js +1 -1
- package/esm/src/react/components/{ai → chat}/chat/contexts/thread-list-context.d.ts +1 -1
- package/esm/src/react/components/chat/chat/contexts/thread-list-context.d.ts.map +1 -0
- package/esm/src/react/components/{ai → chat}/chat/contexts/thread-list-context.js +1 -1
- package/esm/src/react/components/{ai → chat}/chat/hooks/use-threads.d.ts +2 -2
- package/esm/src/react/components/chat/chat/hooks/use-threads.d.ts.map +1 -0
- package/esm/src/react/components/{ai → chat}/chat/index.d.ts +5 -5
- package/esm/src/react/components/chat/chat/index.d.ts.map +1 -0
- package/esm/src/react/components/{ai → chat}/chat/index.js +1 -1
- package/esm/src/react/components/chat/chat/utils/export.d.ts +10 -0
- package/esm/src/react/components/chat/chat/utils/export.d.ts.map +1 -0
- package/esm/src/react/components/{ai → chat}/chat/utils/export.js +1 -1
- package/esm/src/react/components/{ai → chat}/chat/utils/message-parts.d.ts +10 -10
- package/esm/src/react/components/chat/chat/utils/message-parts.d.ts.map +1 -0
- package/esm/src/react/components/{ai → chat}/chat/utils/message-parts.js +2 -2
- package/esm/src/react/components/chat/chat-with-sidebar.d.ts.map +1 -0
- package/esm/src/react/components/{ai → chat}/chat.d.ts +1 -1
- package/esm/src/react/components/chat/chat.d.ts.map +1 -0
- package/esm/src/react/components/{ai → chat}/chat.js +1 -1
- package/esm/src/react/components/chat/csp-nonce.d.ts.map +1 -0
- package/esm/src/react/components/{ai → chat}/error-boundary.d.ts +6 -6
- package/esm/src/react/components/chat/error-boundary.d.ts.map +1 -0
- package/esm/src/react/components/{ai → chat}/error-boundary.js +5 -5
- package/esm/src/react/components/{ai → chat}/icons/index.d.ts +1 -1
- package/esm/src/react/components/chat/icons/index.d.ts.map +1 -0
- package/esm/src/react/components/{ai → chat}/icons/index.js +1 -1
- package/esm/src/react/components/chat/markdown.d.ts.map +1 -0
- package/esm/src/react/components/{ai → chat}/message.d.ts +8 -8
- package/esm/src/react/components/chat/message.d.ts.map +1 -0
- package/esm/src/react/components/chat/model-selector.d.ts.map +1 -0
- package/esm/src/react/components/chat/theme.d.ts.map +1 -0
- package/esm/src/react/primitives/message-list.d.ts +2 -2
- package/esm/src/react/primitives/message-list.d.ts.map +1 -1
- package/esm/src/react/primitives/tool-primitives.d.ts +3 -3
- package/esm/src/react/primitives/tool-primitives.d.ts.map +1 -1
- package/esm/src/{ai/registry-manager.d.ts → registry/project-scoped-registry-manager.d.ts} +5 -4
- package/esm/src/registry/project-scoped-registry-manager.d.ts.map +1 -0
- package/esm/src/{ai/registry-manager.js → registry/project-scoped-registry-manager.js} +5 -4
- package/esm/src/{ai/registry-facade.d.ts → registry/scoped-registry-facade.d.ts} +2 -2
- package/esm/src/registry/scoped-registry-facade.d.ts.map +1 -0
- package/esm/src/rendering/script-page-handling.d.ts.map +1 -1
- package/esm/src/rendering/script-page-handling.js +0 -2
- package/esm/src/resource/registry.d.ts +1 -1
- package/esm/src/resource/registry.d.ts.map +1 -1
- package/esm/src/resource/registry.js +2 -2
- package/esm/src/routing/api/module-loader/loader.js +3 -19
- package/esm/src/runtime/runtime-bridge.d.ts +82 -0
- package/esm/src/runtime/runtime-bridge.d.ts.map +1 -0
- package/esm/src/runtime/runtime-bridge.js +367 -0
- package/esm/src/server/dev-server/file-watch-setup.d.ts +4 -4
- package/esm/src/server/dev-server/file-watch-setup.d.ts.map +1 -1
- package/esm/src/server/dev-server/file-watch-setup.js +14 -14
- package/esm/src/server/dev-server/server.d.ts +2 -2
- package/esm/src/server/dev-server/server.d.ts.map +1 -1
- package/esm/src/server/dev-server/server.js +20 -18
- package/esm/src/server/dev-ui/manifest.d.ts +1 -1
- package/esm/src/server/dev-ui/manifest.js +2 -2
- package/esm/src/server/handlers/dev/framework-candidates.generated.d.ts.map +1 -1
- package/esm/src/server/handlers/dev/framework-candidates.generated.js +58 -61
- package/esm/src/server/handlers/request/api/api-handler-wrapper.js +1 -1
- package/esm/src/server/handlers/request/api/project-discovery.d.ts +1 -1
- package/esm/src/server/handlers/request/api/project-discovery.d.ts.map +1 -1
- package/esm/src/server/handlers/request/api/project-discovery.js +12 -10
- package/esm/src/server/production-server.js +2 -2
- package/esm/src/server/services/rsc/endpoints/rsc-bundles.generated.d.ts.map +1 -1
- package/esm/src/server/services/rsc/endpoints/rsc-bundles.generated.js +2 -2
- package/esm/src/skill/registry.d.ts +1 -1
- package/esm/src/skill/registry.d.ts.map +1 -1
- package/esm/src/skill/registry.js +2 -2
- package/esm/src/tool/registry.d.ts +1 -1
- package/esm/src/tool/registry.d.ts.map +1 -1
- package/esm/src/tool/registry.js +2 -2
- package/esm/src/transforms/npm-import-rewrites.d.ts +1 -1
- package/esm/src/transforms/npm-import-rewrites.d.ts.map +1 -1
- package/esm/src/transforms/npm-import-rewrites.js +5 -13
- package/esm/src/utils/constants/server.d.ts +4 -4
- package/esm/src/utils/constants/server.d.ts.map +1 -1
- package/esm/src/utils/constants/server.js +4 -4
- package/esm/src/utils/id.js +1 -1
- package/esm/src/utils/version-constant.d.ts +1 -1
- package/esm/src/utils/version-constant.js +1 -1
- package/esm/src/workflow/discovery/workflow-discovery.d.ts +3 -3
- package/esm/src/workflow/discovery/workflow-discovery.d.ts.map +1 -1
- package/esm/src/workflow/discovery/workflow-discovery.js +3 -3
- package/esm/src/workflow/registry.d.ts +1 -1
- package/esm/src/workflow/registry.d.ts.map +1 -1
- package/esm/src/workflow/registry.js +2 -2
- package/package.json +4 -5
- package/src/cli/commands/dev/command.ts +3 -3
- package/src/cli/commands/workflow/command-help.ts +1 -1
- package/src/cli/commands/workflow/command.ts +2 -2
- package/src/cli/shared/config.ts +1 -3
- package/src/deno.js +16 -16
- package/src/src/agent/ag-ui-handler.ts +6 -0
- package/src/src/agent/chat-handler.ts +1 -1
- package/src/src/agent/composition/composition.ts +2 -2
- package/src/src/agent/factory.ts +1 -1
- package/src/src/agent/react/index.ts +11 -9
- package/src/src/agent/react/use-chat/browser-inference/browser-engine.ts +9 -10
- package/src/src/agent/react/use-chat/index.ts +10 -9
- package/src/src/agent/react/use-chat/stream-protocol.ts +1 -0
- package/src/src/agent/react/use-chat/streaming/handler.ts +17 -17
- package/src/src/agent/react/use-chat/streaming/parts-builder.ts +5 -5
- package/src/src/agent/react/use-chat/streaming/types.ts +4 -4
- package/src/src/agent/react/use-chat/types.ts +27 -73
- package/src/src/agent/react/use-chat/use-chat.ts +13 -13
- package/src/src/agent/react/use-chat/utils.ts +2 -2
- package/src/src/agent/runtime/{ai-stream-handler.ts → chat-stream-handler.ts} +100 -96
- package/src/src/agent/runtime/constants.ts +1 -1
- package/src/src/agent/runtime/index.ts +88 -40
- package/src/src/agent/runtime/model-message-converter.ts +22 -33
- package/src/src/agent/runtime/model-runtime-types.ts +55 -0
- package/src/src/agent/runtime/model-tool-converter.ts +29 -26
- package/src/src/agent/runtime/provider-native-tools.ts +61 -0
- package/src/src/agent/runtime/repair-tool-call.ts +6 -9
- package/src/src/agent/runtime/runtime-tool-builder.ts +82 -0
- package/src/src/agent/runtime/runtime-tool-errors.ts +46 -0
- package/src/src/agent/runtime/runtime-tool-types.ts +114 -0
- package/src/src/chat/index.ts +22 -20
- package/src/src/chat/protocol.ts +210 -0
- package/src/src/discovery/import-rewriter.ts +1 -14
- package/src/src/discovery/index.ts +2 -2
- package/src/src/discovery/{config-validator.ts → provider-config-validator.ts} +4 -4
- package/src/src/discovery/transpiler.ts +0 -3
- package/src/src/embedding/embedding.ts +1 -1
- package/src/src/embedding/index.ts +3 -3
- package/src/src/embedding/rag-store.ts +1 -1
- package/src/src/embedding/resolve.ts +15 -12
- package/src/src/embedding/vector-store.ts +1 -1
- package/src/src/embedding/veryfront-cloud/provider.ts +10 -8
- package/src/src/internal-agents/ag-ui-sse.ts +12 -0
- package/src/src/markdown/index.ts +1 -1
- package/src/src/modules/import-map/default-import-map.ts +2 -2
- package/src/src/prompt/registry.ts +2 -2
- package/src/src/provider/index.ts +7 -8
- package/src/src/provider/local/{local-embedding-adapter.ts → embedding-runtime-adapter.ts} +8 -8
- package/src/src/provider/local/{ai-sdk-adapter.ts → model-runtime-adapter.ts} +13 -16
- package/src/src/provider/model-registry.ts +31 -26
- package/src/src/provider/runtime-inspection.ts +25 -0
- package/src/src/provider/runtime-loader.ts +1854 -0
- package/src/src/provider/types.ts +38 -0
- package/src/src/provider/veryfront-cloud/provider.ts +13 -11
- package/src/src/provider/veryfront-cloud/shared.ts +1 -1
- package/src/src/react/components/{ai → chat}/chat/components/inference-badge.tsx +1 -1
- package/src/src/react/components/{ai → chat}/chat/components/skill-badge.tsx +3 -3
- package/src/src/react/components/{ai → chat}/chat/components/tool-ui.tsx +3 -3
- package/src/src/react/components/{ai → chat}/chat/composition/api.tsx +1 -1
- package/src/src/react/components/{ai → chat}/chat/composition/chat-composer.tsx +3 -3
- package/src/src/react/components/{ai → chat}/chat/composition/chat-empty.tsx +1 -1
- package/src/src/react/components/{ai → chat}/chat/composition/chat-if.tsx +1 -1
- package/src/src/react/components/{ai → chat}/chat/composition/chat-message-list.tsx +11 -11
- package/src/src/react/components/{ai → chat}/chat/composition/chat-root.tsx +3 -3
- package/src/src/react/components/{ai → chat}/chat/composition/error-banner.tsx +1 -1
- package/src/src/react/components/{ai → chat}/chat/composition/message.tsx +9 -4
- package/src/src/react/components/{ai → chat}/chat/composition/model-avatar.tsx +1 -1
- package/src/src/react/components/{ai → chat}/chat/contexts/chat-context.tsx +3 -3
- package/src/src/react/components/{ai → chat}/chat/contexts/composer-context.tsx +1 -1
- package/src/src/react/components/{ai → chat}/chat/contexts/index.ts +1 -1
- package/src/src/react/components/{ai → chat}/chat/contexts/message-context.tsx +3 -3
- package/src/src/react/components/{ai → chat}/chat/contexts/thread-list-context.tsx +1 -1
- package/src/src/react/components/{ai → chat}/chat/hooks/use-threads.ts +2 -2
- package/src/src/react/components/{ai → chat}/chat/index.tsx +7 -7
- package/src/src/react/components/{ai → chat}/chat/utils/export.ts +4 -4
- package/src/src/react/components/{ai → chat}/chat/utils/message-parts.ts +13 -13
- package/src/src/react/components/{ai → chat}/chat.tsx +1 -1
- package/src/src/react/components/{ai → chat}/error-boundary.tsx +11 -11
- package/src/src/react/components/{ai → chat}/icons/index.ts +1 -1
- package/src/src/react/components/{ai → chat}/message.tsx +11 -11
- package/src/src/react/primitives/message-list.tsx +2 -2
- package/src/src/react/primitives/tool-primitives.tsx +4 -4
- package/src/src/{ai/registry-manager.ts → registry/project-scoped-registry-manager.ts} +5 -4
- package/src/src/{ai/registry-facade.ts → registry/scoped-registry-facade.ts} +1 -1
- package/src/src/rendering/script-page-handling.ts +0 -2
- package/src/src/resource/registry.ts +2 -2
- package/src/src/routing/api/module-loader/loader.ts +3 -19
- package/src/src/runtime/runtime-bridge.ts +608 -0
- package/src/src/server/dev-server/file-watch-setup.ts +14 -14
- package/src/src/server/dev-server/server.ts +20 -18
- package/src/src/server/dev-ui/manifest.js +2 -2
- package/src/src/server/handlers/dev/framework-candidates.generated.ts +58 -61
- package/src/src/server/handlers/request/api/api-handler-wrapper.ts +1 -1
- package/src/src/server/handlers/request/api/project-discovery.ts +12 -10
- package/src/src/server/production-server.ts +2 -2
- package/src/src/server/services/rsc/endpoints/rsc-bundles.generated.ts +2 -2
- package/src/src/skill/registry.ts +2 -2
- package/src/src/tool/registry.ts +2 -2
- package/src/src/transforms/npm-import-rewrites.ts +5 -13
- package/src/src/utils/constants/server.ts +4 -4
- package/src/src/utils/id.ts +1 -1
- package/src/src/utils/version-constant.ts +1 -1
- package/src/src/workflow/discovery/workflow-discovery.ts +4 -4
- package/src/src/workflow/registry.ts +2 -2
- package/esm/src/agent/ai-defaults.d.ts.map +0 -1
- package/esm/src/agent/runtime/ai-stream-handler.d.ts.map +0 -1
- package/esm/src/ai/registry-facade.d.ts.map +0 -1
- package/esm/src/ai/registry-manager.d.ts.map +0 -1
- package/esm/src/discovery/config-validator.d.ts +0 -14
- package/esm/src/discovery/config-validator.d.ts.map +0 -1
- package/esm/src/provider/local/ai-sdk-adapter.d.ts +0 -19
- package/esm/src/provider/local/ai-sdk-adapter.d.ts.map +0 -1
- package/esm/src/provider/local/local-embedding-adapter.d.ts +0 -19
- package/esm/src/provider/local/local-embedding-adapter.d.ts.map +0 -1
- package/esm/src/react/components/ai/agent-card.d.ts.map +0 -1
- package/esm/src/react/components/ai/chat/components/animations.d.ts.map +0 -1
- package/esm/src/react/components/ai/chat/components/attachment-pill.d.ts.map +0 -1
- package/esm/src/react/components/ai/chat/components/branch-picker.d.ts.map +0 -1
- package/esm/src/react/components/ai/chat/components/code-block.d.ts.map +0 -1
- package/esm/src/react/components/ai/chat/components/drop-zone.d.ts.map +0 -1
- package/esm/src/react/components/ai/chat/components/empty-state.d.ts.map +0 -1
- package/esm/src/react/components/ai/chat/components/inference-badge.d.ts.map +0 -1
- package/esm/src/react/components/ai/chat/components/inline-citation.d.ts.map +0 -1
- package/esm/src/react/components/ai/chat/components/message-actions.d.ts.map +0 -1
- package/esm/src/react/components/ai/chat/components/message-edit-form.d.ts.map +0 -1
- package/esm/src/react/components/ai/chat/components/message-feedback.d.ts.map +0 -1
- package/esm/src/react/components/ai/chat/components/quick-actions.d.ts.map +0 -1
- package/esm/src/react/components/ai/chat/components/reasoning.d.ts.map +0 -1
- package/esm/src/react/components/ai/chat/components/sidebar.d.ts.map +0 -1
- package/esm/src/react/components/ai/chat/components/skill-badge.d.ts.map +0 -1
- package/esm/src/react/components/ai/chat/components/sources.d.ts.map +0 -1
- package/esm/src/react/components/ai/chat/components/step-indicator.d.ts.map +0 -1
- package/esm/src/react/components/ai/chat/components/tab-switcher.d.ts.map +0 -1
- package/esm/src/react/components/ai/chat/components/tool-ui.d.ts.map +0 -1
- package/esm/src/react/components/ai/chat/components/upgrade-cta.d.ts.map +0 -1
- package/esm/src/react/components/ai/chat/components/uploads-panel.d.ts.map +0 -1
- package/esm/src/react/components/ai/chat/composition/api.d.ts.map +0 -1
- package/esm/src/react/components/ai/chat/composition/chat-composer.d.ts.map +0 -1
- package/esm/src/react/components/ai/chat/composition/chat-empty.d.ts.map +0 -1
- package/esm/src/react/components/ai/chat/composition/chat-if.d.ts.map +0 -1
- package/esm/src/react/components/ai/chat/composition/chat-message-list.d.ts.map +0 -1
- package/esm/src/react/components/ai/chat/composition/chat-root.d.ts.map +0 -1
- package/esm/src/react/components/ai/chat/composition/error-banner.d.ts.map +0 -1
- package/esm/src/react/components/ai/chat/composition/message.d.ts.map +0 -1
- package/esm/src/react/components/ai/chat/composition/model-avatar.d.ts.map +0 -1
- package/esm/src/react/components/ai/chat/contexts/chat-context.d.ts.map +0 -1
- package/esm/src/react/components/ai/chat/contexts/composer-context.d.ts.map +0 -1
- package/esm/src/react/components/ai/chat/contexts/index.d.ts.map +0 -1
- package/esm/src/react/components/ai/chat/contexts/message-context.d.ts.map +0 -1
- package/esm/src/react/components/ai/chat/contexts/thread-list-context.d.ts.map +0 -1
- package/esm/src/react/components/ai/chat/hooks/use-threads.d.ts.map +0 -1
- package/esm/src/react/components/ai/chat/index.d.ts.map +0 -1
- package/esm/src/react/components/ai/chat/utils/export.d.ts +0 -10
- package/esm/src/react/components/ai/chat/utils/export.d.ts.map +0 -1
- package/esm/src/react/components/ai/chat/utils/message-parts.d.ts.map +0 -1
- package/esm/src/react/components/ai/chat-with-sidebar.d.ts.map +0 -1
- package/esm/src/react/components/ai/chat.d.ts.map +0 -1
- package/esm/src/react/components/ai/csp-nonce.d.ts.map +0 -1
- package/esm/src/react/components/ai/error-boundary.d.ts.map +0 -1
- package/esm/src/react/components/ai/icons/index.d.ts.map +0 -1
- package/esm/src/react/components/ai/markdown.d.ts.map +0 -1
- package/esm/src/react/components/ai/message.d.ts.map +0 -1
- package/esm/src/react/components/ai/model-selector.d.ts.map +0 -1
- package/esm/src/react/components/ai/theme.d.ts.map +0 -1
- /package/esm/src/agent/{ai-defaults.js → defaults.js} +0 -0
- /package/esm/src/react/components/{ai → chat}/agent-card.d.ts +0 -0
- /package/esm/src/react/components/{ai → chat}/agent-card.js +0 -0
- /package/esm/src/react/components/{ai → chat}/chat/components/animations.d.ts +0 -0
- /package/esm/src/react/components/{ai → chat}/chat/components/animations.js +0 -0
- /package/esm/src/react/components/{ai → chat}/chat/components/attachment-pill.d.ts +0 -0
- /package/esm/src/react/components/{ai → chat}/chat/components/attachment-pill.js +0 -0
- /package/esm/src/react/components/{ai → chat}/chat/components/branch-picker.d.ts +0 -0
- /package/esm/src/react/components/{ai → chat}/chat/components/branch-picker.js +0 -0
- /package/esm/src/react/components/{ai → chat}/chat/components/code-block.d.ts +0 -0
- /package/esm/src/react/components/{ai → chat}/chat/components/code-block.js +0 -0
- /package/esm/src/react/components/{ai → chat}/chat/components/drop-zone.d.ts +0 -0
- /package/esm/src/react/components/{ai → chat}/chat/components/drop-zone.js +0 -0
- /package/esm/src/react/components/{ai → chat}/chat/components/empty-state.d.ts +0 -0
- /package/esm/src/react/components/{ai → chat}/chat/components/empty-state.js +0 -0
- /package/esm/src/react/components/{ai → chat}/chat/components/inference-badge.d.ts +0 -0
- /package/esm/src/react/components/{ai → chat}/chat/components/inline-citation.d.ts +0 -0
- /package/esm/src/react/components/{ai → chat}/chat/components/inline-citation.js +0 -0
- /package/esm/src/react/components/{ai → chat}/chat/components/message-actions.d.ts +0 -0
- /package/esm/src/react/components/{ai → chat}/chat/components/message-actions.js +0 -0
- /package/esm/src/react/components/{ai → chat}/chat/components/message-edit-form.d.ts +0 -0
- /package/esm/src/react/components/{ai → chat}/chat/components/message-edit-form.js +0 -0
- /package/esm/src/react/components/{ai → chat}/chat/components/message-feedback.d.ts +0 -0
- /package/esm/src/react/components/{ai → chat}/chat/components/message-feedback.js +0 -0
- /package/esm/src/react/components/{ai → chat}/chat/components/quick-actions.d.ts +0 -0
- /package/esm/src/react/components/{ai → chat}/chat/components/quick-actions.js +0 -0
- /package/esm/src/react/components/{ai → chat}/chat/components/reasoning.d.ts +0 -0
- /package/esm/src/react/components/{ai → chat}/chat/components/reasoning.js +0 -0
- /package/esm/src/react/components/{ai → chat}/chat/components/sidebar.d.ts +0 -0
- /package/esm/src/react/components/{ai → chat}/chat/components/sidebar.js +0 -0
- /package/esm/src/react/components/{ai → chat}/chat/components/sources.d.ts +0 -0
- /package/esm/src/react/components/{ai → chat}/chat/components/sources.js +0 -0
- /package/esm/src/react/components/{ai → chat}/chat/components/step-indicator.d.ts +0 -0
- /package/esm/src/react/components/{ai → chat}/chat/components/step-indicator.js +0 -0
- /package/esm/src/react/components/{ai → chat}/chat/components/tab-switcher.d.ts +0 -0
- /package/esm/src/react/components/{ai → chat}/chat/components/tab-switcher.js +0 -0
- /package/esm/src/react/components/{ai → chat}/chat/components/upgrade-cta.d.ts +0 -0
- /package/esm/src/react/components/{ai → chat}/chat/components/upgrade-cta.js +0 -0
- /package/esm/src/react/components/{ai → chat}/chat/components/uploads-panel.d.ts +0 -0
- /package/esm/src/react/components/{ai → chat}/chat/components/uploads-panel.js +0 -0
- /package/esm/src/react/components/{ai → chat}/chat/hooks/use-threads.js +0 -0
- /package/esm/src/react/components/{ai → chat}/chat-with-sidebar.d.ts +0 -0
- /package/esm/src/react/components/{ai → chat}/chat-with-sidebar.js +0 -0
- /package/esm/src/react/components/{ai → chat}/csp-nonce.d.ts +0 -0
- /package/esm/src/react/components/{ai → chat}/csp-nonce.js +0 -0
- /package/esm/src/react/components/{ai → chat}/markdown.d.ts +0 -0
- /package/esm/src/react/components/{ai → chat}/markdown.js +0 -0
- /package/esm/src/react/components/{ai → chat}/message.js +0 -0
- /package/esm/src/react/components/{ai → chat}/model-selector.d.ts +0 -0
- /package/esm/src/react/components/{ai → chat}/model-selector.js +0 -0
- /package/esm/src/react/components/{ai → chat}/theme.d.ts +0 -0
- /package/esm/src/react/components/{ai → chat}/theme.js +0 -0
- /package/esm/src/{ai/registry-facade.js → registry/scoped-registry-facade.js} +0 -0
- /package/src/src/agent/{ai-defaults.ts → defaults.ts} +0 -0
- /package/src/src/react/components/{ai → chat}/agent-card.tsx +0 -0
- /package/src/src/react/components/{ai → chat}/chat/components/animations.tsx +0 -0
- /package/src/src/react/components/{ai → chat}/chat/components/attachment-pill.tsx +0 -0
- /package/src/src/react/components/{ai → chat}/chat/components/branch-picker.tsx +0 -0
- /package/src/src/react/components/{ai → chat}/chat/components/code-block.tsx +0 -0
- /package/src/src/react/components/{ai → chat}/chat/components/drop-zone.tsx +0 -0
- /package/src/src/react/components/{ai → chat}/chat/components/empty-state.tsx +0 -0
- /package/src/src/react/components/{ai → chat}/chat/components/inline-citation.tsx +0 -0
- /package/src/src/react/components/{ai → chat}/chat/components/message-actions.tsx +0 -0
- /package/src/src/react/components/{ai → chat}/chat/components/message-edit-form.tsx +0 -0
- /package/src/src/react/components/{ai → chat}/chat/components/message-feedback.tsx +0 -0
- /package/src/src/react/components/{ai → chat}/chat/components/quick-actions.tsx +0 -0
- /package/src/src/react/components/{ai → chat}/chat/components/reasoning.tsx +0 -0
- /package/src/src/react/components/{ai → chat}/chat/components/sidebar.tsx +0 -0
- /package/src/src/react/components/{ai → chat}/chat/components/sources.tsx +0 -0
- /package/src/src/react/components/{ai → chat}/chat/components/step-indicator.tsx +0 -0
- /package/src/src/react/components/{ai → chat}/chat/components/tab-switcher.tsx +0 -0
- /package/src/src/react/components/{ai → chat}/chat/components/upgrade-cta.tsx +0 -0
- /package/src/src/react/components/{ai → chat}/chat/components/uploads-panel.tsx +0 -0
- /package/src/src/react/components/{ai → chat}/chat-with-sidebar.tsx +0 -0
- /package/src/src/react/components/{ai → chat}/csp-nonce.ts +0 -0
- /package/src/src/react/components/{ai → chat}/markdown.tsx +0 -0
- /package/src/src/react/components/{ai → chat}/model-selector.tsx +0 -0
- /package/src/src/react/components/{ai → chat}/theme.ts +0 -0
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
export interface RuntimeMetadata {
|
|
2
|
+
readonly specificationVersion?: string;
|
|
3
|
+
readonly provider?: string;
|
|
4
|
+
readonly modelId?: string;
|
|
5
|
+
readonly [key: string]: unknown;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
export interface ModelRuntimeGenerateResult {
|
|
9
|
+
content?: unknown[];
|
|
10
|
+
finishReason?: unknown;
|
|
11
|
+
usage?: unknown;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export interface ModelRuntimeStreamResult {
|
|
15
|
+
stream: ReadableStream<unknown>;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export interface ModelRuntime extends RuntimeMetadata {
|
|
19
|
+
readonly _isVfLocalModel?: boolean;
|
|
20
|
+
doGenerate(options: unknown): PromiseLike<ModelRuntimeGenerateResult>;
|
|
21
|
+
doStream(options: unknown): PromiseLike<ModelRuntimeStreamResult>;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
export interface EmbeddingRuntime extends RuntimeMetadata {
|
|
25
|
+
readonly maxEmbeddingsPerCall?: number | PromiseLike<number | undefined>;
|
|
26
|
+
readonly supportsParallelCalls?: boolean | PromiseLike<boolean | undefined>;
|
|
27
|
+
doEmbed(options: {
|
|
28
|
+
values: string[];
|
|
29
|
+
abortSignal?: AbortSignal;
|
|
30
|
+
}): PromiseLike<{
|
|
31
|
+
embeddings: number[][];
|
|
32
|
+
usage?: {
|
|
33
|
+
tokens?: number;
|
|
34
|
+
};
|
|
35
|
+
rawResponse?: unknown;
|
|
36
|
+
warnings?: unknown[];
|
|
37
|
+
}>;
|
|
38
|
+
}
|
|
@@ -1,8 +1,10 @@
|
|
|
1
|
-
import type { LanguageModel } from "ai";
|
|
2
|
-
import { createAnthropic } from "@ai-sdk/anthropic";
|
|
3
|
-
import { createGoogleGenerativeAI } from "@ai-sdk/google";
|
|
4
|
-
import { createOpenAI } from "@ai-sdk/openai";
|
|
5
1
|
import { createError, toError } from "../../errors/veryfront-error.js";
|
|
2
|
+
import {
|
|
3
|
+
createAnthropicModelRuntime,
|
|
4
|
+
createGoogleModelRuntime,
|
|
5
|
+
createOpenAIModelRuntime,
|
|
6
|
+
} from "../runtime-loader.js";
|
|
7
|
+
import type { ModelRuntime } from "../types.js";
|
|
6
8
|
import {
|
|
7
9
|
createVeryfrontCloudFetch,
|
|
8
10
|
getVeryfrontCloudGatewayBaseUrl,
|
|
@@ -10,7 +12,7 @@ import {
|
|
|
10
12
|
requireVeryfrontCloudBootstrap,
|
|
11
13
|
} from "./shared.js";
|
|
12
14
|
|
|
13
|
-
export function createVeryfrontCloudModel(modelId: string):
|
|
15
|
+
export function createVeryfrontCloudModel(modelId: string): ModelRuntime {
|
|
14
16
|
const { provider, modelId: upstreamModelId } = parseVeryfrontCloudModelId(modelId, "language");
|
|
15
17
|
const { apiBaseUrl, apiToken } = requireVeryfrontCloudBootstrap();
|
|
16
18
|
const baseURL = getVeryfrontCloudGatewayBaseUrl(apiBaseUrl, provider);
|
|
@@ -18,29 +20,29 @@ export function createVeryfrontCloudModel(modelId: string): LanguageModel {
|
|
|
18
20
|
|
|
19
21
|
switch (provider) {
|
|
20
22
|
case "anthropic":
|
|
21
|
-
return
|
|
23
|
+
return createAnthropicModelRuntime({
|
|
22
24
|
authToken: apiToken,
|
|
23
25
|
baseURL,
|
|
24
26
|
name: "veryfront-cloud",
|
|
25
27
|
fetch,
|
|
26
|
-
}
|
|
28
|
+
}, upstreamModelId);
|
|
27
29
|
|
|
28
30
|
case "google":
|
|
29
|
-
return
|
|
31
|
+
return createGoogleModelRuntime({
|
|
30
32
|
apiKey: apiToken,
|
|
31
33
|
baseURL,
|
|
32
34
|
name: "veryfront-cloud",
|
|
33
35
|
fetch,
|
|
34
|
-
}
|
|
36
|
+
}, upstreamModelId);
|
|
35
37
|
|
|
36
38
|
case "openai":
|
|
37
39
|
case "moonshotai":
|
|
38
|
-
return
|
|
40
|
+
return createOpenAIModelRuntime({
|
|
39
41
|
apiKey: apiToken,
|
|
40
42
|
baseURL,
|
|
41
43
|
name: "veryfront-cloud",
|
|
42
44
|
fetch,
|
|
43
|
-
}
|
|
45
|
+
}, upstreamModelId);
|
|
44
46
|
|
|
45
47
|
default: {
|
|
46
48
|
const _exhaustive: never = provider;
|
|
@@ -114,7 +114,7 @@ export function getVeryfrontCloudGatewayBaseUrl(
|
|
|
114
114
|
* Creates a fetch wrapper that replaces all SDK-injected auth headers with
|
|
115
115
|
* a single `Authorization: Bearer` header for the Veryfront Cloud gateway.
|
|
116
116
|
*
|
|
117
|
-
*
|
|
117
|
+
* Provider runtimes set their own native auth headers (`x-api-key` for
|
|
118
118
|
* Anthropic, `x-goog-api-key` for Google, `Authorization` for OpenAI).
|
|
119
119
|
* The gateway expects only Bearer auth, so we strip all provider-specific
|
|
120
120
|
* headers to prevent credential leakage to the wrong auth path.
|
|
@@ -24,7 +24,7 @@ export function InferenceBadge({
|
|
|
24
24
|
dotColor = "bg-amber-500";
|
|
25
25
|
showProgress = true;
|
|
26
26
|
} else if (browserStatus === "loading-runtime") {
|
|
27
|
-
label = "Loading
|
|
27
|
+
label = "Loading runtime...";
|
|
28
28
|
dotColor = "bg-amber-500";
|
|
29
29
|
} else if (browserStatus === "generating") {
|
|
30
30
|
label = "Running in browser";
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Skill Badge — compact indicator for skill tool calls (load-skill, load-skill-reference, execute-skill-script).
|
|
3
|
-
* @module
|
|
3
|
+
* @module react/components/chat/components/skill-badge
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
6
|
import * as React from "react";
|
|
7
7
|
import { cn } from "../../theme.js";
|
|
8
8
|
import { CheckCircleIcon, SparklesIcon, XCircleIcon } from "../../icons/index.js";
|
|
9
|
-
import type {
|
|
9
|
+
import type { ChatDynamicToolPart, ChatToolPart } from "../../../../../agent/react/index.js";
|
|
10
10
|
|
|
11
11
|
export interface SkillBadgeProps {
|
|
12
|
-
tool:
|
|
12
|
+
tool: ChatToolPart | ChatDynamicToolPart;
|
|
13
13
|
className?: string;
|
|
14
14
|
}
|
|
15
15
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Tool UI Components
|
|
3
|
-
* @module
|
|
3
|
+
* @module react/components/chat/components/tool-ui
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
6
|
import * as React from "react";
|
|
@@ -13,7 +13,7 @@ import {
|
|
|
13
13
|
WrenchIcon,
|
|
14
14
|
XCircleIcon,
|
|
15
15
|
} from "../../icons/index.js";
|
|
16
|
-
import type {
|
|
16
|
+
import type { ChatDynamicToolPart, ChatToolPart } from "../../../../../agent/react/index.js";
|
|
17
17
|
import { escapeHtml } from "../../../../../utils/html-escape.js";
|
|
18
18
|
|
|
19
19
|
/** Tool status configuration mapping state to label and icon */
|
|
@@ -135,7 +135,7 @@ function renderOutputAsTable(output: unknown): React.ReactNode | null {
|
|
|
135
135
|
export function ToolCallCard({
|
|
136
136
|
tool,
|
|
137
137
|
}: {
|
|
138
|
-
tool:
|
|
138
|
+
tool: ChatToolPart | ChatDynamicToolPart;
|
|
139
139
|
}): React.JSX.Element {
|
|
140
140
|
const [isExpanded, setIsExpanded] = React.useState(true);
|
|
141
141
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* ChatComposer — Input area with attachments, model selector, voice, and submit.
|
|
3
3
|
*
|
|
4
|
-
* @module
|
|
4
|
+
* @module react/components/chat/composition/chat-composer
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
7
|
import * as React from "react";
|
|
@@ -13,7 +13,7 @@ import type { ChatTheme } from "../../theme.js";
|
|
|
13
13
|
import { AttachmentPill } from "../components/attachment-pill.js";
|
|
14
14
|
import type { AttachmentInfo } from "../components/attachment-pill.js";
|
|
15
15
|
import { downloadMarkdown } from "../utils/export.js";
|
|
16
|
-
import type {
|
|
16
|
+
import type { ChatMessage } from "../../../../../agent/react/index.js";
|
|
17
17
|
|
|
18
18
|
export interface ChatComposerProps {
|
|
19
19
|
input: string;
|
|
@@ -42,7 +42,7 @@ export interface ChatComposerProps {
|
|
|
42
42
|
|
|
43
43
|
// Export
|
|
44
44
|
showExport?: boolean;
|
|
45
|
-
messages?:
|
|
45
|
+
messages?: ChatMessage[];
|
|
46
46
|
|
|
47
47
|
className?: string;
|
|
48
48
|
children?: React.ReactNode;
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* Renders user and assistant messages with support for branching, editing,
|
|
5
5
|
* feedback, sources, reasoning, tool calls, and step indicators.
|
|
6
6
|
*
|
|
7
|
-
* @module
|
|
7
|
+
* @module react/components/chat/composition/chat-message-list
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
10
|
import * as React from "react";
|
|
@@ -12,10 +12,10 @@ import { MessageItem, MessageList } from "../../../../primitives/index.js";
|
|
|
12
12
|
import type {
|
|
13
13
|
BranchInfo,
|
|
14
14
|
BrowserInferenceStatus,
|
|
15
|
-
|
|
15
|
+
ChatDynamicToolPart,
|
|
16
|
+
ChatMessage,
|
|
17
|
+
ChatToolPart,
|
|
16
18
|
InferenceMode,
|
|
17
|
-
ToolUIPart,
|
|
18
|
-
UIMessage,
|
|
19
19
|
} from "../../../../../agent/react/index.js";
|
|
20
20
|
import type { ChatTheme } from "../../theme.js";
|
|
21
21
|
import { cn } from "../../theme.js";
|
|
@@ -42,13 +42,13 @@ import { StepIndicator } from "../components/step-indicator.js";
|
|
|
42
42
|
import { ModelAvatar } from "./model-avatar.js";
|
|
43
43
|
|
|
44
44
|
export interface ChatMessageListProps {
|
|
45
|
-
messages:
|
|
45
|
+
messages: ChatMessage[];
|
|
46
46
|
isLoading?: boolean;
|
|
47
47
|
theme?: ChatTheme;
|
|
48
48
|
|
|
49
49
|
// Rendering
|
|
50
|
-
renderMessage?: (message:
|
|
51
|
-
renderTool?: (tool:
|
|
50
|
+
renderMessage?: (message: ChatMessage) => React.ReactNode;
|
|
51
|
+
renderTool?: (tool: ChatToolPart | ChatDynamicToolPart) => React.ReactNode;
|
|
52
52
|
model?: string;
|
|
53
53
|
|
|
54
54
|
// Features
|
|
@@ -165,7 +165,7 @@ export const ChatMessageList = React.forwardRef<HTMLDivElement, ChatMessageListP
|
|
|
165
165
|
<span>
|
|
166
166
|
{browserStatus === "downloading-model"
|
|
167
167
|
? "Downloading model..."
|
|
168
|
-
: "Loading
|
|
168
|
+
: "Loading runtime..."}
|
|
169
169
|
</span>
|
|
170
170
|
</div>
|
|
171
171
|
)
|
|
@@ -198,7 +198,7 @@ ChatMessageList.displayName = "ChatMessageList";
|
|
|
198
198
|
// --- Internal sub-components ---
|
|
199
199
|
|
|
200
200
|
interface UserMessageProps {
|
|
201
|
-
message:
|
|
201
|
+
message: ChatMessage;
|
|
202
202
|
theme?: ChatTheme;
|
|
203
203
|
isEditing: boolean;
|
|
204
204
|
onStartEdit: () => void;
|
|
@@ -260,9 +260,9 @@ function UserMessage({
|
|
|
260
260
|
}
|
|
261
261
|
|
|
262
262
|
interface AssistantMessageProps {
|
|
263
|
-
message:
|
|
263
|
+
message: ChatMessage;
|
|
264
264
|
theme?: ChatTheme;
|
|
265
|
-
renderTool?: (tool:
|
|
265
|
+
renderTool?: (tool: ChatToolPart | ChatDynamicToolPart) => React.ReactNode;
|
|
266
266
|
showMessageActions?: boolean;
|
|
267
267
|
showSources?: boolean;
|
|
268
268
|
showSteps?: boolean;
|
|
@@ -4,12 +4,12 @@
|
|
|
4
4
|
* Provides ChatContextValue to all descendant components. Extra HTML div
|
|
5
5
|
* attributes (e.g. drag handlers) are forwarded to the container element.
|
|
6
6
|
*
|
|
7
|
-
* @module
|
|
7
|
+
* @module react/components/chat/composition/chat-root
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
10
|
import * as React from "react";
|
|
11
11
|
import { ChatContainer } from "../../../../primitives/index.js";
|
|
12
|
-
import type {
|
|
12
|
+
import type { ChatMessage } from "../../../../../agent/react/index.js";
|
|
13
13
|
import type { ChatTheme } from "../../theme.js";
|
|
14
14
|
import { getDocumentNonce } from "../../csp-nonce.js";
|
|
15
15
|
import { cn, defaultChatTheme, generateTokenCSS, mergeThemes } from "../../theme.js";
|
|
@@ -25,7 +25,7 @@ export interface ChatRootProps extends Omit<React.HTMLAttributes<HTMLDivElement>
|
|
|
25
25
|
children: React.ReactNode;
|
|
26
26
|
|
|
27
27
|
// Messages
|
|
28
|
-
messages:
|
|
28
|
+
messages: ChatMessage[];
|
|
29
29
|
isLoading?: boolean;
|
|
30
30
|
error?: Error | null;
|
|
31
31
|
|
|
@@ -15,11 +15,16 @@
|
|
|
15
15
|
* </Message.Root>
|
|
16
16
|
* ```
|
|
17
17
|
*
|
|
18
|
-
* @module
|
|
18
|
+
* @module react/components/chat/composition/message
|
|
19
19
|
*/
|
|
20
20
|
|
|
21
21
|
import * as React from "react";
|
|
22
|
-
import type {
|
|
22
|
+
import type {
|
|
23
|
+
BranchInfo,
|
|
24
|
+
ChatDynamicToolPart,
|
|
25
|
+
ChatMessage,
|
|
26
|
+
ChatToolPart,
|
|
27
|
+
} from "../../../../../agent/react/index.js";
|
|
23
28
|
import { cn } from "../../theme.js";
|
|
24
29
|
import { Markdown } from "../../markdown.js";
|
|
25
30
|
import { MessageItem } from "../../../../primitives/index.js";
|
|
@@ -49,7 +54,7 @@ import {
|
|
|
49
54
|
// ---------------------------------------------------------------------------
|
|
50
55
|
|
|
51
56
|
export interface MessageRootProps {
|
|
52
|
-
message:
|
|
57
|
+
message: ChatMessage;
|
|
53
58
|
isStreaming?: boolean;
|
|
54
59
|
children: React.ReactNode;
|
|
55
60
|
className?: string;
|
|
@@ -184,7 +189,7 @@ MessageAvatar.displayName = "Message.Avatar";
|
|
|
184
189
|
// ---------------------------------------------------------------------------
|
|
185
190
|
|
|
186
191
|
export interface MessageContentProps {
|
|
187
|
-
renderTool?: (tool:
|
|
192
|
+
renderTool?: (tool: ChatToolPart | ChatDynamicToolPart) => React.ReactNode;
|
|
188
193
|
showSteps?: boolean;
|
|
189
194
|
showSources?: boolean;
|
|
190
195
|
onSourceClick?: (source: Source, index: number) => void;
|
|
@@ -3,12 +3,12 @@
|
|
|
3
3
|
*
|
|
4
4
|
* Provided by ChatRoot. Consumed by all descendant chat components via useChatContext().
|
|
5
5
|
*
|
|
6
|
-
* @module
|
|
6
|
+
* @module react/components/chat/contexts/chat-context
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
9
|
import * as React from "react";
|
|
10
10
|
import { COMPONENT_ERROR } from "../../../../../errors/error-registry.js";
|
|
11
|
-
import type {
|
|
11
|
+
import type { ChatMessage } from "../../../../../agent/react/index.js";
|
|
12
12
|
import type { ChatTheme } from "../../theme.js";
|
|
13
13
|
import type { ModelOption } from "../../model-selector.js";
|
|
14
14
|
import type { AttachmentInfo } from "../components/attachment-pill.js";
|
|
@@ -18,7 +18,7 @@ import type { BranchInfo } from "../../../../../agent/react/index.js";
|
|
|
18
18
|
|
|
19
19
|
export interface ChatContextValue {
|
|
20
20
|
// Messages
|
|
21
|
-
messages:
|
|
21
|
+
messages: ChatMessage[];
|
|
22
22
|
isLoading: boolean;
|
|
23
23
|
error: Error | null;
|
|
24
24
|
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* Provided by Composer.Root or ChatRoot. Consumed by input, submit button,
|
|
5
5
|
* attachment controls, model selector, voice input, etc.
|
|
6
6
|
*
|
|
7
|
-
* @module
|
|
7
|
+
* @module react/components/chat/contexts/composer-context
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
10
|
import * as React from "react";
|
|
@@ -4,17 +4,17 @@
|
|
|
4
4
|
* Provided by Message.Root or the message rendering loop.
|
|
5
5
|
* Consumed by action bars, branch pickers, feedback buttons, etc.
|
|
6
6
|
*
|
|
7
|
-
* @module
|
|
7
|
+
* @module react/components/chat/contexts/message-context
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
10
|
import * as React from "react";
|
|
11
11
|
import { COMPONENT_ERROR } from "../../../../../errors/error-registry.js";
|
|
12
|
-
import type { BranchInfo,
|
|
12
|
+
import type { BranchInfo, ChatMessage } from "../../../../../agent/react/index.js";
|
|
13
13
|
import type { FeedbackValue } from "../components/message-feedback.js";
|
|
14
14
|
import type { PartGroup } from "../utils/message-parts.js";
|
|
15
15
|
|
|
16
16
|
export interface MessageContextValue {
|
|
17
|
-
message:
|
|
17
|
+
message: ChatMessage;
|
|
18
18
|
role: "user" | "assistant" | "system" | "tool";
|
|
19
19
|
isStreaming: boolean;
|
|
20
20
|
parts: PartGroup[];
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* Provided by ThreadList.Root or ChatWithSidebar.
|
|
5
5
|
* Consumed by thread list items, create/delete buttons, etc.
|
|
6
6
|
*
|
|
7
|
-
* @module
|
|
7
|
+
* @module react/components/chat/contexts/thread-list-context
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
10
|
import * as React from "react";
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import * as dntShim from "../../../../../../_dnt.shims.js";
|
|
2
2
|
import * as React from "react";
|
|
3
|
-
import type {
|
|
3
|
+
import type { ChatMessage } from "../../../../../agent/react/index.js";
|
|
4
4
|
import { isBrowserEnvironment } from "../../../../../platform/compat/runtime.js";
|
|
5
5
|
|
|
6
6
|
export interface Thread {
|
|
7
7
|
id: string;
|
|
8
8
|
title: string;
|
|
9
|
-
messages:
|
|
9
|
+
messages: ChatMessage[];
|
|
10
10
|
createdAt: number;
|
|
11
11
|
updatedAt: number;
|
|
12
12
|
}
|
|
@@ -41,7 +41,7 @@
|
|
|
41
41
|
* </Message.Root>
|
|
42
42
|
* ```
|
|
43
43
|
*
|
|
44
|
-
* @module
|
|
44
|
+
* @module react/components/chat
|
|
45
45
|
*/
|
|
46
46
|
|
|
47
47
|
import * as React from "react";
|
|
@@ -49,10 +49,10 @@ import { useVoiceInput } from "../../../../agent/react/index.js";
|
|
|
49
49
|
import type {
|
|
50
50
|
BranchInfo,
|
|
51
51
|
BrowserInferenceStatus,
|
|
52
|
-
|
|
52
|
+
ChatDynamicToolPart,
|
|
53
|
+
ChatMessage,
|
|
54
|
+
ChatToolPart,
|
|
53
55
|
InferenceMode,
|
|
54
|
-
ToolUIPart,
|
|
55
|
-
UIMessage,
|
|
56
56
|
} from "../../../../agent/react/index.js";
|
|
57
57
|
import { type ChatTheme, defaultChatTheme, mergeThemes } from "../theme.js";
|
|
58
58
|
import type { ModelOption } from "../model-selector.js";
|
|
@@ -194,7 +194,7 @@ export {
|
|
|
194
194
|
// ---------------------------------------------------------------------------
|
|
195
195
|
|
|
196
196
|
export interface ChatProps {
|
|
197
|
-
messages:
|
|
197
|
+
messages: ChatMessage[];
|
|
198
198
|
input: string;
|
|
199
199
|
onChange: (e: React.ChangeEvent<HTMLInputElement | HTMLTextAreaElement>) => void;
|
|
200
200
|
onSubmit?: (e?: React.FormEvent) => void | Promise<void>;
|
|
@@ -207,8 +207,8 @@ export interface ChatProps {
|
|
|
207
207
|
maxHeight?: string;
|
|
208
208
|
className?: string;
|
|
209
209
|
theme?: Partial<ChatTheme>;
|
|
210
|
-
renderMessage?: (message:
|
|
211
|
-
renderTool?: (tool:
|
|
210
|
+
renderMessage?: (message: ChatMessage) => React.ReactNode;
|
|
211
|
+
renderTool?: (tool: ChatToolPart | ChatDynamicToolPart) => React.ReactNode;
|
|
212
212
|
suggestions?: string[];
|
|
213
213
|
onSuggestionClick?: (suggestion: string) => void;
|
|
214
214
|
emptyState?: {
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Conversation Export Utilities
|
|
3
|
-
* @module
|
|
3
|
+
* @module react/components/chat/utils/export
|
|
4
4
|
*/
|
|
5
5
|
import * as dntShim from "../../../../../../_dnt.shims.js";
|
|
6
6
|
|
|
7
7
|
|
|
8
|
-
import type {
|
|
8
|
+
import type { ChatMessage } from "../../../../../agent/react/index.js";
|
|
9
9
|
import { extractSourcesFromParts, getTextContent } from "./message-parts.js";
|
|
10
10
|
|
|
11
11
|
/**
|
|
12
12
|
* Convert chat messages to a markdown string.
|
|
13
13
|
*/
|
|
14
|
-
export function exportAsMarkdown(messages:
|
|
14
|
+
export function exportAsMarkdown(messages: ChatMessage[]): string {
|
|
15
15
|
const lines: string[] = [];
|
|
16
16
|
|
|
17
17
|
for (const msg of messages) {
|
|
@@ -63,7 +63,7 @@ export function exportAsMarkdown(messages: UIMessage[]): string {
|
|
|
63
63
|
/**
|
|
64
64
|
* Download messages as a .md file.
|
|
65
65
|
*/
|
|
66
|
-
export function downloadMarkdown(messages:
|
|
66
|
+
export function downloadMarkdown(messages: ChatMessage[], filename?: string): void {
|
|
67
67
|
const md = exportAsMarkdown(messages);
|
|
68
68
|
const blob = new dntShim.Blob([md], { type: "text/markdown;charset=utf-8" });
|
|
69
69
|
const url = URL.createObjectURL(blob);
|
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Message Parts Utilities
|
|
3
|
-
* @module
|
|
3
|
+
* @module react/components/chat/utils/message-parts
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
6
|
import type {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
7
|
+
ChatDynamicToolPart,
|
|
8
|
+
ChatMessage,
|
|
9
|
+
ChatMessagePart,
|
|
10
|
+
ChatToolPart,
|
|
11
11
|
} from "../../../../../agent/react/index.js";
|
|
12
12
|
import type { Source } from "../components/sources.js";
|
|
13
13
|
|
|
14
|
-
/** Get text content from
|
|
15
|
-
export function getTextContent(message:
|
|
14
|
+
/** Get text content from chat message parts */
|
|
15
|
+
export function getTextContent(message: ChatMessage): string {
|
|
16
16
|
let text = "";
|
|
17
17
|
|
|
18
18
|
for (const part of message.parts) {
|
|
@@ -23,7 +23,7 @@ export function getTextContent(message: UIMessage): string {
|
|
|
23
23
|
}
|
|
24
24
|
|
|
25
25
|
/** Check if a part is a tool part */
|
|
26
|
-
export function isToolPart(part:
|
|
26
|
+
export function isToolPart(part: ChatMessagePart): part is ChatToolPart | ChatDynamicToolPart {
|
|
27
27
|
if (part.type === "dynamic-tool") return true;
|
|
28
28
|
return part.type.startsWith("tool-") && part.type !== "tool-result";
|
|
29
29
|
}
|
|
@@ -35,13 +35,13 @@ const SKILL_TOOL_NAMES: ReadonlySet<string> = new Set([
|
|
|
35
35
|
]);
|
|
36
36
|
|
|
37
37
|
/** Check if a tool part is a skill-related tool (load-skill, load-skill-reference, execute-skill-script) */
|
|
38
|
-
export function isSkillToolPart(tool:
|
|
38
|
+
export function isSkillToolPart(tool: ChatToolPart | ChatDynamicToolPart): boolean {
|
|
39
39
|
return SKILL_TOOL_NAMES.has(tool.toolName);
|
|
40
40
|
}
|
|
41
41
|
|
|
42
42
|
/** Check if a part is a reasoning part */
|
|
43
43
|
export function isReasoningPart(
|
|
44
|
-
part:
|
|
44
|
+
part: ChatMessagePart,
|
|
45
45
|
): part is { type: "reasoning"; text: string; state?: "streaming" | "done" } {
|
|
46
46
|
return part.type === "reasoning";
|
|
47
47
|
}
|
|
@@ -51,7 +51,7 @@ export function isReasoningPart(
|
|
|
51
51
|
*/
|
|
52
52
|
export type PartGroup =
|
|
53
53
|
| { type: "text"; content: string }
|
|
54
|
-
| { type: "tool"; tool:
|
|
54
|
+
| { type: "tool"; tool: ChatToolPart | ChatDynamicToolPart }
|
|
55
55
|
| { type: "reasoning"; text: string; isStreaming: boolean }
|
|
56
56
|
| { type: "step"; stepIndex: number; isComplete: boolean };
|
|
57
57
|
|
|
@@ -59,7 +59,7 @@ export type PartGroup =
|
|
|
59
59
|
* Group consecutive parts for ordered rendering
|
|
60
60
|
* Returns an array of groups, each containing either consecutive text parts, a tool part, or a reasoning part
|
|
61
61
|
*/
|
|
62
|
-
export function groupPartsInOrder(parts:
|
|
62
|
+
export function groupPartsInOrder(parts: ChatMessagePart[]): PartGroup[] {
|
|
63
63
|
const groups: PartGroup[] = [];
|
|
64
64
|
let textBuffer = "";
|
|
65
65
|
|
|
@@ -115,7 +115,7 @@ export function groupPartsInOrder(parts: UIMessagePart[]): PartGroup[] {
|
|
|
115
115
|
* Extract sources from tool result parts.
|
|
116
116
|
* Looks for `documents` arrays in tool outputs and maps them to Source[].
|
|
117
117
|
*/
|
|
118
|
-
export function extractSourcesFromParts(parts:
|
|
118
|
+
export function extractSourcesFromParts(parts: ChatMessagePart[]): Source[] {
|
|
119
119
|
const sources: Source[] = [];
|
|
120
120
|
|
|
121
121
|
for (const part of parts) {
|