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,210 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Canonical chat message and stream protocol for Veryfront chat surfaces.
|
|
3
|
+
*
|
|
4
|
+
* These types describe the framework-owned message parts and stream events used
|
|
5
|
+
* by AG-UI-aligned chat clients, hooks, and adapters.
|
|
6
|
+
*/
|
|
7
|
+
import "../../_dnt.polyfills.js";
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
export type ChatPartState = "streaming" | "done";
|
|
11
|
+
|
|
12
|
+
export interface ChatTextPart {
|
|
13
|
+
type: "text";
|
|
14
|
+
text: string;
|
|
15
|
+
state?: ChatPartState;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export interface ChatReasoningPart {
|
|
19
|
+
type: "reasoning";
|
|
20
|
+
text: string;
|
|
21
|
+
state?: ChatPartState;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
export type ChatToolState =
|
|
25
|
+
| "input-streaming"
|
|
26
|
+
| "input-available"
|
|
27
|
+
| "output-streaming"
|
|
28
|
+
| "output-available"
|
|
29
|
+
| "output-error";
|
|
30
|
+
|
|
31
|
+
export interface ChatToolPart<NAME extends string = string, INPUT = unknown, OUTPUT = unknown> {
|
|
32
|
+
type: `tool-${NAME}`;
|
|
33
|
+
toolCallId: string;
|
|
34
|
+
toolName: NAME;
|
|
35
|
+
state: ChatToolState;
|
|
36
|
+
input?: INPUT;
|
|
37
|
+
output?: OUTPUT;
|
|
38
|
+
errorText?: string;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
export interface ChatToolResultPart<RESULT = unknown> {
|
|
42
|
+
type: "tool-result";
|
|
43
|
+
toolCallId: string;
|
|
44
|
+
toolName: string;
|
|
45
|
+
result: RESULT;
|
|
46
|
+
isError?: boolean;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
export interface ChatDynamicToolPart {
|
|
50
|
+
type: "dynamic-tool";
|
|
51
|
+
toolCallId: string;
|
|
52
|
+
toolName: string;
|
|
53
|
+
state: ChatToolState;
|
|
54
|
+
input?: unknown;
|
|
55
|
+
output?: unknown;
|
|
56
|
+
errorText?: string;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
export interface ChatStepPart {
|
|
60
|
+
type: "step-start" | "step-end";
|
|
61
|
+
stepIndex: number;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
export type ChatMessagePart =
|
|
65
|
+
| ChatTextPart
|
|
66
|
+
| ChatReasoningPart
|
|
67
|
+
| ChatToolPart
|
|
68
|
+
| ChatToolResultPart
|
|
69
|
+
| ChatDynamicToolPart
|
|
70
|
+
| ChatStepPart;
|
|
71
|
+
|
|
72
|
+
export interface ChatMessage {
|
|
73
|
+
id: string;
|
|
74
|
+
role: "system" | "user" | "assistant";
|
|
75
|
+
parts: ChatMessagePart[];
|
|
76
|
+
metadata?: Record<string, unknown>;
|
|
77
|
+
createdAt?: Date | string;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
export type ChatFinishReason =
|
|
81
|
+
| "stop"
|
|
82
|
+
| "length"
|
|
83
|
+
| "tool-calls"
|
|
84
|
+
| "content-filter"
|
|
85
|
+
| "error"
|
|
86
|
+
| "other";
|
|
87
|
+
|
|
88
|
+
type ChatStreamEventBase = {
|
|
89
|
+
providerExecuted?: boolean;
|
|
90
|
+
dynamic?: boolean;
|
|
91
|
+
};
|
|
92
|
+
|
|
93
|
+
export type ChatStreamEvent =
|
|
94
|
+
| {
|
|
95
|
+
type: "start";
|
|
96
|
+
messageId?: string;
|
|
97
|
+
messageMetadata?: unknown;
|
|
98
|
+
}
|
|
99
|
+
| {
|
|
100
|
+
type: "message-metadata";
|
|
101
|
+
messageMetadata: unknown;
|
|
102
|
+
}
|
|
103
|
+
| {
|
|
104
|
+
type: "text-start";
|
|
105
|
+
id: string;
|
|
106
|
+
}
|
|
107
|
+
| {
|
|
108
|
+
type: "text-delta";
|
|
109
|
+
id: string;
|
|
110
|
+
delta: string;
|
|
111
|
+
}
|
|
112
|
+
| {
|
|
113
|
+
type: "text-end";
|
|
114
|
+
id: string;
|
|
115
|
+
}
|
|
116
|
+
| {
|
|
117
|
+
type: "reasoning-start";
|
|
118
|
+
id: string;
|
|
119
|
+
}
|
|
120
|
+
| {
|
|
121
|
+
type: "reasoning-delta";
|
|
122
|
+
id: string;
|
|
123
|
+
delta: string;
|
|
124
|
+
}
|
|
125
|
+
| {
|
|
126
|
+
type: "reasoning-end";
|
|
127
|
+
id: string;
|
|
128
|
+
}
|
|
129
|
+
| ({
|
|
130
|
+
type: "tool-input-start";
|
|
131
|
+
toolCallId: string;
|
|
132
|
+
toolName: string;
|
|
133
|
+
} & ChatStreamEventBase)
|
|
134
|
+
| ({
|
|
135
|
+
type: "tool-input-delta";
|
|
136
|
+
toolCallId: string;
|
|
137
|
+
inputTextDelta: string;
|
|
138
|
+
} & ChatStreamEventBase)
|
|
139
|
+
| ({
|
|
140
|
+
type: "tool-input-available";
|
|
141
|
+
toolCallId: string;
|
|
142
|
+
toolName: string;
|
|
143
|
+
input: unknown;
|
|
144
|
+
} & ChatStreamEventBase)
|
|
145
|
+
| ({
|
|
146
|
+
type: "tool-input-error";
|
|
147
|
+
toolCallId: string;
|
|
148
|
+
toolName: string;
|
|
149
|
+
input: unknown;
|
|
150
|
+
errorText: string;
|
|
151
|
+
} & ChatStreamEventBase)
|
|
152
|
+
| {
|
|
153
|
+
type: "tool-approval-request";
|
|
154
|
+
approvalId: string;
|
|
155
|
+
toolCallId: string;
|
|
156
|
+
}
|
|
157
|
+
| ({
|
|
158
|
+
type: "tool-output-available";
|
|
159
|
+
toolCallId: string;
|
|
160
|
+
output: unknown;
|
|
161
|
+
} & ChatStreamEventBase)
|
|
162
|
+
| {
|
|
163
|
+
type: "tool-output-denied";
|
|
164
|
+
toolCallId: string;
|
|
165
|
+
}
|
|
166
|
+
| ({
|
|
167
|
+
type: "tool-output-error";
|
|
168
|
+
toolCallId: string;
|
|
169
|
+
errorText: string;
|
|
170
|
+
} & ChatStreamEventBase)
|
|
171
|
+
| {
|
|
172
|
+
type: "source-url";
|
|
173
|
+
sourceId: string;
|
|
174
|
+
url: string;
|
|
175
|
+
title?: string;
|
|
176
|
+
}
|
|
177
|
+
| {
|
|
178
|
+
type: "source-document";
|
|
179
|
+
sourceId: string;
|
|
180
|
+
mediaType: string;
|
|
181
|
+
title: string;
|
|
182
|
+
filename?: string;
|
|
183
|
+
}
|
|
184
|
+
| {
|
|
185
|
+
type: "file";
|
|
186
|
+
url: string;
|
|
187
|
+
mediaType: string;
|
|
188
|
+
filename?: string;
|
|
189
|
+
}
|
|
190
|
+
| {
|
|
191
|
+
type: "start-step";
|
|
192
|
+
}
|
|
193
|
+
| {
|
|
194
|
+
type: "finish-step";
|
|
195
|
+
}
|
|
196
|
+
| {
|
|
197
|
+
type: `data-${string}`;
|
|
198
|
+
data: unknown;
|
|
199
|
+
}
|
|
200
|
+
| {
|
|
201
|
+
type: "finish";
|
|
202
|
+
finishReason?: ChatFinishReason;
|
|
203
|
+
}
|
|
204
|
+
| {
|
|
205
|
+
type: "abort";
|
|
206
|
+
}
|
|
207
|
+
| {
|
|
208
|
+
type: "error";
|
|
209
|
+
errorText: string;
|
|
210
|
+
};
|
|
@@ -17,11 +17,7 @@ import * as pathHelper from "../platform/compat/path/index.js";
|
|
|
17
17
|
*/
|
|
18
18
|
export function rewriteForDeno(code: string, fileDir: string): string {
|
|
19
19
|
const npmReplacements: Array<[RegExp, string]> = [
|
|
20
|
-
[/from\s+["']ai["']/g, 'from "npm:ai"'],
|
|
21
|
-
[/from\s+["']ai\/([^"']+)["']/g, 'from "npm:ai/$1"'],
|
|
22
|
-
[/from\s+["']@ai-sdk\/([^"']+)["']/g, 'from "npm:@ai-sdk/$1"'],
|
|
23
20
|
[/from\s+["']zod["']/g, 'from "npm:zod"'],
|
|
24
|
-
[/import\s*\(\s*["']ai["']\s*\)/g, 'import("npm:ai")'],
|
|
25
21
|
[/import\s*\(\s*["']zod["']\s*\)/g, 'import("npm:zod")'],
|
|
26
22
|
];
|
|
27
23
|
|
|
@@ -142,16 +138,7 @@ export async function rewriteDiscoveryImports(
|
|
|
142
138
|
};
|
|
143
139
|
|
|
144
140
|
// Rewrite external package imports
|
|
145
|
-
const externalPackages = [
|
|
146
|
-
"zod",
|
|
147
|
-
"ai",
|
|
148
|
-
"@ai-sdk/anthropic",
|
|
149
|
-
"@ai-sdk/openai",
|
|
150
|
-
"@ai-sdk/google",
|
|
151
|
-
"@ai-sdk/mistral",
|
|
152
|
-
"@ai-sdk/provider",
|
|
153
|
-
"@ai-sdk/provider-utils",
|
|
154
|
-
];
|
|
141
|
+
const externalPackages = ["zod"];
|
|
155
142
|
|
|
156
143
|
for (const pkg of externalPackages) {
|
|
157
144
|
transformed = await rewritePackageImports(transformed, pkg);
|
|
@@ -26,5 +26,5 @@ export { clearTrackedAgents, filenameToId, filePathToPattern } from "./discovery
|
|
|
26
26
|
// Re-export transpiler utilities
|
|
27
27
|
export { clearTranspileCache } from "./transpiler.js";
|
|
28
28
|
|
|
29
|
-
// Re-export config validation (pure logic — no ANSI colors)
|
|
30
|
-
export {
|
|
29
|
+
// Re-export provider config validation (pure logic — no ANSI colors)
|
|
30
|
+
export { validateProviderConfig, type ValidationResult } from "./provider-config-validator.js";
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
2
|
+
* Provider Config Validator
|
|
3
3
|
*
|
|
4
|
-
* Pure validation logic for
|
|
5
|
-
* without ANSI formatting
|
|
4
|
+
* Pure validation logic for configured model providers. Returns plain-text
|
|
5
|
+
* messages without ANSI formatting; the CLI caller applies colors when printing.
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
8
|
import type { VeryfrontConfig } from "../config/index.js";
|
|
@@ -13,7 +13,7 @@ export interface ValidationResult {
|
|
|
13
13
|
errors: string[];
|
|
14
14
|
}
|
|
15
15
|
|
|
16
|
-
export function
|
|
16
|
+
export function validateProviderConfig(config: VeryfrontConfig): ValidationResult {
|
|
17
17
|
const result: ValidationResult = { valid: true, warnings: [], errors: [] };
|
|
18
18
|
|
|
19
19
|
const providers = config.ai?.providers;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { embed, embedMany } from "ai";
|
|
2
1
|
import type { Embedding, EmbeddingConfig } from "./types.js";
|
|
3
2
|
import { resolveEmbeddingModel } from "./resolve.js";
|
|
4
3
|
import { resolveConfiguredEmbeddingModel } from "./model-resolution.js";
|
|
4
|
+
import { embed, embedMany } from "../runtime/runtime-bridge.js";
|
|
5
5
|
|
|
6
6
|
const DEFAULT_BATCH_SIZE = 100;
|
|
7
7
|
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Embedding — RAG primitives for chunking, embedding, and similarity search.
|
|
3
3
|
*
|
|
4
|
-
* Provides a facade over
|
|
5
|
-
*
|
|
4
|
+
* Provides a facade over the framework's current embedding runtime and
|
|
5
|
+
* LangChain text splitting behind veryfront's own API.
|
|
6
6
|
*
|
|
7
7
|
* @module embedding
|
|
8
8
|
*
|
|
@@ -19,7 +19,7 @@ import "../../_dnt.polyfills.js";
|
|
|
19
19
|
|
|
20
20
|
export { embedding } from "./embedding.js";
|
|
21
21
|
export { chunk } from "./chunk.js";
|
|
22
|
-
export { cosineSimilarity as similarity } from "
|
|
22
|
+
export { cosineSimilarity as similarity } from "../runtime/runtime-bridge.js";
|
|
23
23
|
export { vectorStore } from "./vector-store.js";
|
|
24
24
|
export { ragStore } from "./rag-store.js";
|
|
25
25
|
export { createUploadHandler } from "./upload-handler.js";
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import * as dntShim from "../../_dnt.shims.js";
|
|
2
|
-
import { cosineSimilarity } from "ai";
|
|
3
2
|
import {
|
|
4
3
|
isNotFoundError,
|
|
5
4
|
mkdir,
|
|
@@ -25,6 +24,7 @@ import type {
|
|
|
25
24
|
RagStoreConfig,
|
|
26
25
|
RagStoreData,
|
|
27
26
|
} from "./types.js";
|
|
27
|
+
import { cosineSimilarity } from "../runtime/runtime-bridge.js";
|
|
28
28
|
|
|
29
29
|
// Legacy data shapes used only for migrating old upload-store JSON files.
|
|
30
30
|
interface LegacyStoredChunk {
|
|
@@ -1,12 +1,14 @@
|
|
|
1
|
-
import type { EmbeddingModel } from "ai";
|
|
2
1
|
import { createError, toError } from "../errors/veryfront-error.js";
|
|
3
|
-
import { createOpenAI } from "@ai-sdk/openai";
|
|
4
|
-
import { createGoogleGenerativeAI } from "@ai-sdk/google";
|
|
5
2
|
import { getGoogleGenAIEnvConfig, getOpenAIEnvConfig } from "../config/env.js";
|
|
6
|
-
import { createLocalEmbeddingModel } from "../provider/local/
|
|
3
|
+
import { createLocalEmbeddingModel } from "../provider/local/embedding-runtime-adapter.js";
|
|
4
|
+
import {
|
|
5
|
+
createGoogleEmbeddingRuntime,
|
|
6
|
+
createOpenAIEmbeddingRuntime,
|
|
7
|
+
} from "../provider/runtime-loader.js";
|
|
8
|
+
import type { EmbeddingRuntime } from "../provider/types.js";
|
|
7
9
|
import { createVeryfrontCloudEmbeddingModel } from "./veryfront-cloud/provider.js";
|
|
8
10
|
|
|
9
|
-
type EmbeddingProviderFactory = (modelId: string) =>
|
|
11
|
+
type EmbeddingProviderFactory = (modelId: string) => EmbeddingRuntime;
|
|
10
12
|
|
|
11
13
|
const providers = new Map<string, EmbeddingProviderFactory>();
|
|
12
14
|
let autoInitialized = false;
|
|
@@ -16,9 +18,7 @@ let autoInitialized = false;
|
|
|
16
18
|
*
|
|
17
19
|
* @example
|
|
18
20
|
* ```ts
|
|
19
|
-
* registerEmbeddingProvider("openai", (id) =>
|
|
20
|
-
* createOpenAI({ apiKey })().embedding(id)
|
|
21
|
-
* );
|
|
21
|
+
* registerEmbeddingProvider("openai", (id) => createOpenAIEmbeddingRuntime({ apiKey }, id));
|
|
22
22
|
* ```
|
|
23
23
|
*/
|
|
24
24
|
export function registerEmbeddingProvider(
|
|
@@ -44,7 +44,10 @@ function autoInitializeFromEnv(): void {
|
|
|
44
44
|
}),
|
|
45
45
|
);
|
|
46
46
|
}
|
|
47
|
-
return
|
|
47
|
+
return createOpenAIEmbeddingRuntime(
|
|
48
|
+
{ apiKey: config.apiKey, baseURL: config.baseURL },
|
|
49
|
+
id,
|
|
50
|
+
);
|
|
48
51
|
});
|
|
49
52
|
}
|
|
50
53
|
|
|
@@ -60,7 +63,7 @@ function autoInitializeFromEnv(): void {
|
|
|
60
63
|
}),
|
|
61
64
|
);
|
|
62
65
|
}
|
|
63
|
-
return
|
|
66
|
+
return createGoogleEmbeddingRuntime({ apiKey: config.apiKey }, id);
|
|
64
67
|
});
|
|
65
68
|
}
|
|
66
69
|
|
|
@@ -74,14 +77,14 @@ function autoInitializeFromEnv(): void {
|
|
|
74
77
|
}
|
|
75
78
|
|
|
76
79
|
/**
|
|
77
|
-
* Resolve a "provider/model" string to an
|
|
80
|
+
* Resolve a "provider/model" string to an embedding runtime instance.
|
|
78
81
|
*
|
|
79
82
|
* @example
|
|
80
83
|
* ```ts
|
|
81
84
|
* const model = resolveEmbeddingModel("openai/text-embedding-3-small");
|
|
82
85
|
* ```
|
|
83
86
|
*/
|
|
84
|
-
export function resolveEmbeddingModel(modelString: string):
|
|
87
|
+
export function resolveEmbeddingModel(modelString: string): EmbeddingRuntime {
|
|
85
88
|
autoInitializeFromEnv();
|
|
86
89
|
|
|
87
90
|
const slashIndex = modelString.indexOf("/");
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { cosineSimilarity } from "ai";
|
|
2
1
|
import type {
|
|
3
2
|
Embedding,
|
|
4
3
|
SearchOptions,
|
|
@@ -6,6 +5,7 @@ import type {
|
|
|
6
5
|
VectorStore,
|
|
7
6
|
VectorStoreConfig,
|
|
8
7
|
} from "./types.js";
|
|
8
|
+
import { cosineSimilarity } from "../runtime/runtime-bridge.js";
|
|
9
9
|
|
|
10
10
|
interface VectorEntry {
|
|
11
11
|
text: string;
|
|
@@ -1,7 +1,9 @@
|
|
|
1
|
-
import type { EmbeddingModel } from "ai";
|
|
2
|
-
import { createGoogleGenerativeAI } from "@ai-sdk/google";
|
|
3
|
-
import { createOpenAI } from "@ai-sdk/openai";
|
|
4
1
|
import { createError, toError } from "../../errors/veryfront-error.js";
|
|
2
|
+
import {
|
|
3
|
+
createGoogleEmbeddingRuntime,
|
|
4
|
+
createOpenAIEmbeddingRuntime,
|
|
5
|
+
} from "../../provider/runtime-loader.js";
|
|
6
|
+
import type { EmbeddingRuntime } from "../../provider/types.js";
|
|
5
7
|
import {
|
|
6
8
|
createVeryfrontCloudFetch,
|
|
7
9
|
getVeryfrontCloudGatewayBaseUrl,
|
|
@@ -9,7 +11,7 @@ import {
|
|
|
9
11
|
requireVeryfrontCloudBootstrap,
|
|
10
12
|
} from "../../provider/veryfront-cloud/shared.js";
|
|
11
13
|
|
|
12
|
-
export function createVeryfrontCloudEmbeddingModel(modelId: string):
|
|
14
|
+
export function createVeryfrontCloudEmbeddingModel(modelId: string): EmbeddingRuntime {
|
|
13
15
|
const { provider, modelId: upstreamModelId } = parseVeryfrontCloudModelId(modelId, "embedding");
|
|
14
16
|
const { apiBaseUrl, apiToken } = requireVeryfrontCloudBootstrap();
|
|
15
17
|
const baseURL = getVeryfrontCloudGatewayBaseUrl(apiBaseUrl, provider);
|
|
@@ -17,20 +19,20 @@ export function createVeryfrontCloudEmbeddingModel(modelId: string): EmbeddingMo
|
|
|
17
19
|
|
|
18
20
|
switch (provider) {
|
|
19
21
|
case "openai":
|
|
20
|
-
return
|
|
22
|
+
return createOpenAIEmbeddingRuntime({
|
|
21
23
|
apiKey: apiToken,
|
|
22
24
|
baseURL,
|
|
23
25
|
name: "veryfront-cloud",
|
|
24
26
|
fetch,
|
|
25
|
-
}
|
|
27
|
+
}, upstreamModelId);
|
|
26
28
|
|
|
27
29
|
case "google":
|
|
28
|
-
return
|
|
30
|
+
return createGoogleEmbeddingRuntime({
|
|
29
31
|
apiKey: apiToken,
|
|
30
32
|
baseURL,
|
|
31
33
|
name: "veryfront-cloud",
|
|
32
34
|
fetch,
|
|
33
|
-
}
|
|
35
|
+
}, upstreamModelId);
|
|
34
36
|
}
|
|
35
37
|
|
|
36
38
|
throw toError(
|
|
@@ -41,6 +41,18 @@ const agUiEventPayloadSchemas = {
|
|
|
41
41
|
threadId: z.string().min(1),
|
|
42
42
|
agentId: z.string().min(1),
|
|
43
43
|
}),
|
|
44
|
+
StateSnapshot: z.object({
|
|
45
|
+
snapshot: z.record(z.string(), z.unknown()),
|
|
46
|
+
}),
|
|
47
|
+
MessagesSnapshot: z.object({
|
|
48
|
+
messages: z.array(z.object({
|
|
49
|
+
id: z.string().min(1),
|
|
50
|
+
role: z.enum(["user", "assistant", "system", "tool"]),
|
|
51
|
+
parts: z.array(z.record(z.string(), z.unknown())),
|
|
52
|
+
metadata: z.record(z.string(), z.unknown()).optional(),
|
|
53
|
+
createdAt: z.string().optional(),
|
|
54
|
+
})),
|
|
55
|
+
}),
|
|
44
56
|
TextMessageStart: z.object({
|
|
45
57
|
messageId: z.string().min(1),
|
|
46
58
|
role: z.literal("assistant"),
|
|
@@ -33,8 +33,8 @@ function getVeryfrontSsrImportMap(): Record<string, string> {
|
|
|
33
33
|
const react = `${base}/react/public.js${ssr}`;
|
|
34
34
|
|
|
35
35
|
// Map veryfront/embedding to the React hooks submodule for SSR.
|
|
36
|
-
// The full embedding/index.ts imports heavy server-side code (vectorStore, ragStore
|
|
37
|
-
//
|
|
36
|
+
// The full embedding/index.ts imports heavy server-side code (vectorStore, ragStore)
|
|
37
|
+
// that fails to transform. SSR only needs the React hook (useUploads).
|
|
38
38
|
const embedding = `${base}/embedding/react/index.js${ssr}`;
|
|
39
39
|
|
|
40
40
|
return {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { Prompt } from "./types.js";
|
|
2
2
|
import { createError, toError } from "../errors/veryfront-error.js";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
3
|
+
import { ScopedRegistryFacade } from "../registry/scoped-registry-facade.js";
|
|
4
|
+
import { ProjectScopedRegistryManager } from "../registry/project-scoped-registry-manager.js";
|
|
5
5
|
|
|
6
6
|
const promptRegistryManager = new ProjectScopedRegistryManager<Prompt>("prompt");
|
|
7
7
|
|
|
@@ -1,18 +1,16 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
2
|
+
* Provider registry.
|
|
3
3
|
*
|
|
4
|
-
* Maps "provider/model" strings to
|
|
5
|
-
* Auto-initializes providers from environment variables on first use.
|
|
4
|
+
* Maps "provider/model" strings to framework-compatible model runtimes.
|
|
5
|
+
* Auto-initializes built-in providers from environment variables on first use.
|
|
6
6
|
*
|
|
7
7
|
* @module provider
|
|
8
8
|
*
|
|
9
|
-
* @example
|
|
9
|
+
* @example Resolve a model
|
|
10
10
|
* ```ts
|
|
11
|
-
* import {
|
|
12
|
-
* import { createOpenAI } from "@ai-sdk/openai";
|
|
11
|
+
* import { resolveModel } from "veryfront/provider";
|
|
13
12
|
*
|
|
14
|
-
*
|
|
15
|
-
* const model = resolveModel("openai/gpt-4o");
|
|
13
|
+
* const model = resolveModel("veryfront-cloud/openai/gpt-5.2");
|
|
16
14
|
* ```
|
|
17
15
|
*/
|
|
18
16
|
import "../../_dnt.polyfills.js";
|
|
@@ -28,6 +26,7 @@ export {
|
|
|
28
26
|
resolveModel,
|
|
29
27
|
} from "./model-registry.js";
|
|
30
28
|
export type { ModelProviderFactory } from "./model-registry.js";
|
|
29
|
+
export type { ModelRuntime } from "./types.js";
|
|
31
30
|
export {
|
|
32
31
|
runWithVeryfrontCloudContext,
|
|
33
32
|
runWithVeryfrontCloudContextAsync,
|
|
@@ -1,25 +1,25 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
2
|
+
* Local Embedding Runtime Adapter
|
|
3
3
|
*
|
|
4
4
|
* Bridges `@huggingface/transformers` local embedding inference to the
|
|
5
|
-
*
|
|
5
|
+
* framework's current embedding runtime interface. This allows `embed()` and
|
|
6
6
|
* `embedMany()` to work with local models seamlessly.
|
|
7
7
|
*
|
|
8
8
|
* @module provider/local
|
|
9
9
|
*/
|
|
10
10
|
|
|
11
|
-
import type { EmbeddingModel } from "ai";
|
|
12
11
|
import { embedTexts } from "./local-embedding-engine.js";
|
|
13
12
|
import { DEFAULT_LOCAL_EMBEDDING_MODEL } from "./model-catalog.js";
|
|
13
|
+
import type { EmbeddingRuntime } from "../types.js";
|
|
14
14
|
|
|
15
15
|
/**
|
|
16
|
-
* Create a local
|
|
16
|
+
* Create a local embedding runtime for the given model ID.
|
|
17
17
|
*
|
|
18
|
-
* The returned object implements the
|
|
19
|
-
* compatible with all
|
|
18
|
+
* The returned object implements the current embedding runtime interface, making it
|
|
19
|
+
* compatible with all framework embedding functions and the Veryfront
|
|
20
20
|
* embedding/RAG primitives.
|
|
21
21
|
*/
|
|
22
|
-
export function createLocalEmbeddingModel(modelId?: string):
|
|
22
|
+
export function createLocalEmbeddingModel(modelId?: string): EmbeddingRuntime {
|
|
23
23
|
const resolvedId = modelId || DEFAULT_LOCAL_EMBEDDING_MODEL;
|
|
24
24
|
|
|
25
25
|
return {
|
|
@@ -33,5 +33,5 @@ export function createLocalEmbeddingModel(modelId?: string): EmbeddingModel {
|
|
|
33
33
|
const embeddings = await embedTexts(resolvedId, values);
|
|
34
34
|
return { embeddings, usage: { tokens: 0 }, rawResponse: undefined, warnings: [] };
|
|
35
35
|
},
|
|
36
|
-
}
|
|
36
|
+
};
|
|
37
37
|
}
|
|
@@ -1,36 +1,36 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
2
|
+
* Local Model Runtime Adapter
|
|
3
3
|
*
|
|
4
|
-
* Bridges `@huggingface/transformers` local inference to the
|
|
5
|
-
*
|
|
4
|
+
* Bridges `@huggingface/transformers` local inference to the framework's
|
|
5
|
+
* current model runtime substrate. This allows `streamText()` and
|
|
6
6
|
* `generateText()` to work with local models seamlessly.
|
|
7
7
|
*
|
|
8
8
|
* @module provider/local
|
|
9
9
|
*/
|
|
10
10
|
|
|
11
|
-
import type { LanguageModel } from "ai";
|
|
12
11
|
import { generate, generateStream } from "./local-engine.js";
|
|
13
12
|
import type { ChatMessage, GenerateOptions } from "./local-engine.js";
|
|
14
13
|
import { DEFAULT_LOCAL_MODEL } from "./model-catalog.js";
|
|
15
14
|
import { serverLogger } from "../../utils/index.js";
|
|
16
15
|
import { fromError } from "../../errors/veryfront-error.js";
|
|
17
16
|
import { throwIfLocalAIDisabled } from "./env.js";
|
|
17
|
+
import type { ModelRuntime } from "../types.js";
|
|
18
18
|
|
|
19
19
|
const logger = serverLogger.component("local-llm");
|
|
20
20
|
|
|
21
21
|
/** Default maximum new tokens for local model generation */
|
|
22
22
|
const DEFAULT_MAX_NEW_TOKENS = 512;
|
|
23
23
|
|
|
24
|
-
/** Shape of a single message in the
|
|
24
|
+
/** Shape of a single message in the current model-runtime prompt array. */
|
|
25
25
|
interface PromptMessage {
|
|
26
26
|
role: string;
|
|
27
27
|
content: string | ReadonlyArray<{ type: string; text?: string }>;
|
|
28
28
|
}
|
|
29
29
|
|
|
30
30
|
/**
|
|
31
|
-
* Convert
|
|
31
|
+
* Convert model-runtime prompt format to simple ChatMessage array.
|
|
32
32
|
*
|
|
33
|
-
* The
|
|
33
|
+
* The prompt is an array of message objects with role and content arrays.
|
|
34
34
|
* We extract text content for the local model.
|
|
35
35
|
*/
|
|
36
36
|
function convertPrompt(prompt: ReadonlyArray<PromptMessage>): ChatMessage[] {
|
|
@@ -75,7 +75,7 @@ interface LocalModelOptions {
|
|
|
75
75
|
stopSequences?: string[];
|
|
76
76
|
}
|
|
77
77
|
|
|
78
|
-
/** Map
|
|
78
|
+
/** Map model-runtime generation options to local engine GenerateOptions. */
|
|
79
79
|
function toGenerateOptions(options: LocalModelOptions): GenerateOptions {
|
|
80
80
|
return {
|
|
81
81
|
maxNewTokens: options.maxOutputTokens ?? DEFAULT_MAX_NEW_TOKENS,
|
|
@@ -87,16 +87,15 @@ function toGenerateOptions(options: LocalModelOptions): GenerateOptions {
|
|
|
87
87
|
}
|
|
88
88
|
|
|
89
89
|
/**
|
|
90
|
-
* Create a local
|
|
90
|
+
* Create a local model runtime for the given model ID.
|
|
91
91
|
*
|
|
92
|
-
* The returned object implements the
|
|
93
|
-
* compatible with
|
|
94
|
-
* and all VeryFront hooks (`useChat`).
|
|
92
|
+
* The returned object implements the current runtime interface, making it
|
|
93
|
+
* compatible with the framework execution path and related hooks.
|
|
95
94
|
*/
|
|
96
|
-
export function createLocalModel(modelId?: string):
|
|
95
|
+
export function createLocalModel(modelId?: string): ModelRuntime {
|
|
97
96
|
const resolvedId = modelId || DEFAULT_LOCAL_MODEL;
|
|
98
97
|
|
|
99
|
-
|
|
98
|
+
return {
|
|
100
99
|
/** Marker so ensureModelReady() can distinguish real local-engine models
|
|
101
100
|
* from mock/custom providers that happen to use provider:"local". */
|
|
102
101
|
_isVfLocalModel: true as const,
|
|
@@ -200,6 +199,4 @@ export function createLocalModel(modelId?: string): LanguageModel {
|
|
|
200
199
|
return { stream };
|
|
201
200
|
},
|
|
202
201
|
};
|
|
203
|
-
|
|
204
|
-
return model as LanguageModel;
|
|
205
202
|
}
|