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
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Project-Scoped Registry Manager
|
|
3
3
|
*
|
|
4
|
-
* Provides multi-tenant isolation for
|
|
5
|
-
* agents, resources, providers). Each project gets its own
|
|
6
|
-
* namespace, preventing cross-project leakage of
|
|
4
|
+
* Provides multi-tenant isolation for project-scoped registries (tools,
|
|
5
|
+
* prompts, workflows, agents, resources, providers). Each project gets its own
|
|
6
|
+
* isolated registry namespace, preventing cross-project leakage of registered
|
|
7
|
+
* resources.
|
|
7
8
|
*
|
|
8
9
|
* Usage:
|
|
9
10
|
* ```ts
|
|
@@ -119,7 +120,7 @@ export class ProjectScopedRegistryManager {
|
|
|
119
120
|
return new Map(this.sharedRegistry);
|
|
120
121
|
const result = new Map(this.sharedRegistry);
|
|
121
122
|
for (const [id, item] of projectRegistry)
|
|
122
|
-
result.set(id, item);
|
|
123
|
+
result.set(id, item);
|
|
123
124
|
return result;
|
|
124
125
|
}
|
|
125
126
|
/**
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ProjectScopedRegistryManager } from "./registry-manager.js";
|
|
1
|
+
import { ProjectScopedRegistryManager } from "./project-scoped-registry-manager.js";
|
|
2
2
|
export declare class ScopedRegistryFacade<T> {
|
|
3
3
|
protected readonly manager: ProjectScopedRegistryManager<T>;
|
|
4
4
|
constructor(manager: ProjectScopedRegistryManager<T>);
|
|
@@ -19,4 +19,4 @@ export declare class ScopedRegistryFacade<T> {
|
|
|
19
19
|
clearAll(): void;
|
|
20
20
|
getStats(): ReturnType<ProjectScopedRegistryManager<T>["getStats"]>;
|
|
21
21
|
}
|
|
22
|
-
//# sourceMappingURL=registry-facade.d.ts.map
|
|
22
|
+
//# sourceMappingURL=scoped-registry-facade.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"scoped-registry-facade.d.ts","sourceRoot":"","sources":["../../../src/src/registry/scoped-registry-facade.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,4BAA4B,EAAE,MAAM,sCAAsC,CAAC;AAEpF,qBAAa,oBAAoB,CAAC,CAAC;IACrB,SAAS,CAAC,QAAQ,CAAC,OAAO,EAAE,4BAA4B,CAAC,CAAC,CAAC;gBAAxC,OAAO,EAAE,4BAA4B,CAAC,CAAC,CAAC;IAEvE,QAAQ,CAAC,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC,GAAG,IAAI;IAInC;;OAEG;IACH,cAAc,CAAC,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC,GAAG,IAAI;IAIzC,GAAG,CAAC,EAAE,EAAE,MAAM,GAAG,CAAC,GAAG,SAAS;IAI9B,GAAG,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO;IAIxB,SAAS,IAAI,MAAM,EAAE;IAIrB,MAAM,IAAI,GAAG,CAAC,MAAM,EAAE,CAAC,CAAC;IAIxB,MAAM,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO;IAI3B,KAAK,IAAI,IAAI;IAIb;;OAEG;IACH,QAAQ,IAAI,IAAI;IAIhB,QAAQ,IAAI,UAAU,CAAC,4BAA4B,CAAC,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC;CAGpE"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"script-page-handling.d.ts","sourceRoot":"","sources":["../../../src/src/rendering/script-page-handling.ts"],"names":[],"mappings":"AAeA,OAAO,KAAK,EACV,cAAc,EACd,UAAU,EAGV,YAAY,EAEb,MAAM,mBAAmB,CAAC;AAC3B,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAC1D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AAenE,UAAU,iBAAiB;IACzB,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,eAAe,CAAC;IACxB,UAAU,EAAE,MAAM,CAAC;IACnB,OAAO,EAAE,cAAc,CAAC;IACxB,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC,CAAC;IAC3C,GAAG,CAAC,EAAE,GAAG,CAAC;IACV,KAAK,CAAC,EAAE,cAAc,CAAC;IACvB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;
|
|
1
|
+
{"version":3,"file":"script-page-handling.d.ts","sourceRoot":"","sources":["../../../src/src/rendering/script-page-handling.ts"],"names":[],"mappings":"AAeA,OAAO,KAAK,EACV,cAAc,EACd,UAAU,EAGV,YAAY,EAEb,MAAM,mBAAmB,CAAC;AAC3B,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAC1D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AAenE,UAAU,iBAAiB;IACzB,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,eAAe,CAAC;IACxB,UAAU,EAAE,MAAM,CAAC;IACnB,OAAO,EAAE,cAAc,CAAC;IACxB,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC,CAAC;IAC3C,GAAG,CAAC,EAAE,GAAG,CAAC;IACV,KAAK,CAAC,EAAE,cAAc,CAAC;IACvB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAqHD,wBAAsB,gBAAgB,CACpC,QAAQ,EAAE,UAAU,EACpB,IAAI,EAAE,MAAM,EACZ,OAAO,EAAE,iBAAiB,GACzB,OAAO,CAAC,YAAY,CAAC,CAiDvB"}
|
|
@@ -18,8 +18,6 @@ import { createFileSystem } from "../platform/compat/fs.js";
|
|
|
18
18
|
import { getEsbuildLoader } from "../utils/path-utils.js";
|
|
19
19
|
const logger = rendererLogger.component("script");
|
|
20
20
|
const ESBUILD_EXTERNALS = [
|
|
21
|
-
"ai",
|
|
22
|
-
"ai/*",
|
|
23
21
|
"zod",
|
|
24
22
|
"node:*",
|
|
25
23
|
"veryfront",
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
* @module
|
|
8
8
|
*/
|
|
9
9
|
import type { Resource } from "./types.js";
|
|
10
|
-
import { ScopedRegistryFacade } from "../
|
|
10
|
+
import { ScopedRegistryFacade } from "../registry/scoped-registry-facade.js";
|
|
11
11
|
declare class ResourceRegistry extends ScopedRegistryFacade<Resource> {
|
|
12
12
|
findByPattern(uri: string): Resource | undefined;
|
|
13
13
|
private patternToRegex;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"registry.d.ts","sourceRoot":"","sources":["../../../src/src/resource/registry.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"registry.d.ts","sourceRoot":"","sources":["../../../src/src/resource/registry.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAC3C,OAAO,EAAE,oBAAoB,EAAE,MAAM,uCAAuC,CAAC;AAK7E,cAAM,gBAAiB,SAAQ,oBAAoB,CAAC,QAAQ,CAAC;IAC3D,aAAa,CAAC,GAAG,EAAE,MAAM,GAAG,QAAQ,GAAG,SAAS;IAOhD,OAAO,CAAC,cAAc;IAItB,OAAO,CAAC,YAAY;IAIpB,aAAa,CAAC,GAAG,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC;IAInE,IAAI,IAAI,MAAM,EAAE;CAGjB;AAED,eAAO,MAAM,gBAAgB,kBAAgD,CAAC"}
|
|
@@ -6,8 +6,8 @@
|
|
|
6
6
|
*
|
|
7
7
|
* @module
|
|
8
8
|
*/
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
9
|
+
import { ScopedRegistryFacade } from "../registry/scoped-registry-facade.js";
|
|
10
|
+
import { ProjectScopedRegistryManager } from "../registry/project-scoped-registry-manager.js";
|
|
11
11
|
const resourceRegistryManager = new ProjectScopedRegistryManager("resource");
|
|
12
12
|
class ResourceRegistry extends ScopedRegistryFacade {
|
|
13
13
|
findByPattern(uri) {
|
|
@@ -257,9 +257,6 @@ function createImportMapPlugin(projectDir, adapter, config) {
|
|
|
257
257
|
return undefined;
|
|
258
258
|
if (args.path.startsWith("node:"))
|
|
259
259
|
return { path: args.path, external: true };
|
|
260
|
-
if (args.path === "ai/react" || args.path.startsWith("ai/react/")) {
|
|
261
|
-
return { path: args.path, external: true };
|
|
262
|
-
}
|
|
263
260
|
if (args.path.includes("bundle-manifest-kv") || args.path.includes("bundle-manifest-redis")) {
|
|
264
261
|
return { path: args.path, external: true };
|
|
265
262
|
}
|
|
@@ -374,8 +371,8 @@ function loadAndTranspileModule(modulePath, projectDir, adapter, fs, config) {
|
|
|
374
371
|
// Filter out framework-managed packages from user deps. These are already
|
|
375
372
|
// handled by the framework's own external/rewrite logic and should not be
|
|
376
373
|
// treated as user npm packages.
|
|
377
|
-
const frameworkPackages = new Set(["
|
|
378
|
-
const frameworkPrefixes = ["@
|
|
374
|
+
const frameworkPackages = new Set(["zod", "veryfront", "react", "react-dom", "path"]);
|
|
375
|
+
const frameworkPrefixes = ["@opentelemetry/", "node:", "veryfront/"];
|
|
379
376
|
const userDeps = new Map();
|
|
380
377
|
for (const [name, version] of allDeps) {
|
|
381
378
|
if (frameworkPackages.has(name))
|
|
@@ -418,10 +415,6 @@ function loadAndTranspileModule(modulePath, projectDir, adapter, fs, config) {
|
|
|
418
415
|
resolveExtensions: [".ts", ".tsx", ".js", ".jsx", ".mjs"],
|
|
419
416
|
banner: { js: requireShim },
|
|
420
417
|
external: [
|
|
421
|
-
"ai",
|
|
422
|
-
"ai/*",
|
|
423
|
-
"ai/react",
|
|
424
|
-
"@ai-sdk/*",
|
|
425
418
|
"zod",
|
|
426
419
|
"node:*",
|
|
427
420
|
...NODE_BUILTINS,
|
|
@@ -546,16 +539,7 @@ async function rewriteExternalImports(code, projectDir, fs, userDeps = new Map()
|
|
|
546
539
|
return null;
|
|
547
540
|
}
|
|
548
541
|
};
|
|
549
|
-
const externalPackagesToResolve = [
|
|
550
|
-
"zod",
|
|
551
|
-
"ai",
|
|
552
|
-
"@ai-sdk/anthropic",
|
|
553
|
-
"@ai-sdk/openai",
|
|
554
|
-
"@ai-sdk/google",
|
|
555
|
-
"@ai-sdk/mistral",
|
|
556
|
-
"@ai-sdk/provider",
|
|
557
|
-
"@ai-sdk/provider-utils",
|
|
558
|
-
];
|
|
542
|
+
const externalPackagesToResolve = ["zod"];
|
|
559
543
|
for (const name of userDeps.keys()) {
|
|
560
544
|
if (!externalPackagesToResolve.includes(name)) {
|
|
561
545
|
externalPackagesToResolve.push(name);
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Runtime Bridge
|
|
3
|
+
*
|
|
4
|
+
* Centralizes the framework's current runtime edge behind one internal
|
|
5
|
+
* module. Higher-level framework code imports framework-owned runtime
|
|
6
|
+
* types and calls into this bridge at the edge.
|
|
7
|
+
*/
|
|
8
|
+
import * as dntShim from "../../_dnt.shims.js";
|
|
9
|
+
import type { ModelRuntimeMessage } from "../agent/runtime/model-runtime-types.js";
|
|
10
|
+
import type { RuntimeGenerateTextResult, RuntimeStreamResult, RuntimeToolCallRepairFunction, RuntimeToolSet } from "../agent/runtime/runtime-tool-types.js";
|
|
11
|
+
import type { EmbeddingRuntime, ModelRuntime } from "../provider/types.js";
|
|
12
|
+
type GenerateTextOptions = {
|
|
13
|
+
model: ModelRuntime;
|
|
14
|
+
system?: unknown;
|
|
15
|
+
messages: ModelRuntimeMessage[];
|
|
16
|
+
tools?: RuntimeToolSet;
|
|
17
|
+
experimental_repairToolCall?: RuntimeToolCallRepairFunction;
|
|
18
|
+
maxOutputTokens?: number;
|
|
19
|
+
temperature?: number;
|
|
20
|
+
topP?: number;
|
|
21
|
+
topK?: number;
|
|
22
|
+
stopSequences?: string[];
|
|
23
|
+
toolChoice?: unknown;
|
|
24
|
+
seed?: number;
|
|
25
|
+
presencePenalty?: number;
|
|
26
|
+
frequencyPenalty?: number;
|
|
27
|
+
headers?: dntShim.HeadersInit;
|
|
28
|
+
providerOptions?: Record<string, unknown>;
|
|
29
|
+
abortSignal?: AbortSignal;
|
|
30
|
+
};
|
|
31
|
+
type StreamTextOptions = {
|
|
32
|
+
model: ModelRuntime;
|
|
33
|
+
system?: unknown;
|
|
34
|
+
messages: ModelRuntimeMessage[];
|
|
35
|
+
tools?: RuntimeToolSet;
|
|
36
|
+
experimental_repairToolCall?: RuntimeToolCallRepairFunction;
|
|
37
|
+
maxOutputTokens?: number;
|
|
38
|
+
temperature?: number;
|
|
39
|
+
topP?: number;
|
|
40
|
+
topK?: number;
|
|
41
|
+
stopSequences?: string[];
|
|
42
|
+
toolChoice?: unknown;
|
|
43
|
+
seed?: number;
|
|
44
|
+
presencePenalty?: number;
|
|
45
|
+
frequencyPenalty?: number;
|
|
46
|
+
headers?: dntShim.HeadersInit;
|
|
47
|
+
providerOptions?: Record<string, unknown>;
|
|
48
|
+
includeRawChunks?: boolean;
|
|
49
|
+
abortSignal?: AbortSignal;
|
|
50
|
+
};
|
|
51
|
+
type EmbedOptions = {
|
|
52
|
+
model: EmbeddingRuntime;
|
|
53
|
+
value: string;
|
|
54
|
+
abortSignal?: AbortSignal;
|
|
55
|
+
};
|
|
56
|
+
type EmbedManyOptions = {
|
|
57
|
+
model: EmbeddingRuntime;
|
|
58
|
+
values: string[];
|
|
59
|
+
abortSignal?: AbortSignal;
|
|
60
|
+
};
|
|
61
|
+
export declare function generateText(options: GenerateTextOptions): PromiseLike<RuntimeGenerateTextResult>;
|
|
62
|
+
export declare function streamText(options: StreamTextOptions): RuntimeStreamResult;
|
|
63
|
+
export declare function embed(options: EmbedOptions): PromiseLike<{
|
|
64
|
+
embedding: number[];
|
|
65
|
+
embeddings: number[][];
|
|
66
|
+
usage: {
|
|
67
|
+
tokens?: number;
|
|
68
|
+
} | undefined;
|
|
69
|
+
rawResponse: unknown;
|
|
70
|
+
warnings: unknown[];
|
|
71
|
+
}>;
|
|
72
|
+
export declare function embedMany(options: EmbedManyOptions): PromiseLike<{
|
|
73
|
+
embeddings: number[][];
|
|
74
|
+
usage: {
|
|
75
|
+
tokens?: number;
|
|
76
|
+
} | undefined;
|
|
77
|
+
rawResponse: unknown;
|
|
78
|
+
warnings: unknown[];
|
|
79
|
+
}>;
|
|
80
|
+
export declare function cosineSimilarity(a: number[], b: number[]): number;
|
|
81
|
+
export {};
|
|
82
|
+
//# sourceMappingURL=runtime-bridge.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"runtime-bridge.d.ts","sourceRoot":"","sources":["../../../src/src/runtime/runtime-bridge.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,OAAO,KAAK,OAAO,MAAM,qBAAqB,CAAC;AAE/C,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,yCAAyC,CAAC;AACnF,OAAO,KAAK,EACV,yBAAyB,EACzB,mBAAmB,EACnB,6BAA6B,EAC7B,cAAc,EACf,MAAM,wCAAwC,CAAC;AAChD,OAAO,KAAK,EACV,gBAAgB,EAChB,YAAY,EAEb,MAAM,sBAAsB,CAAC;AAE9B,KAAK,mBAAmB,GAAG;IACzB,KAAK,EAAE,YAAY,CAAC;IACpB,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,QAAQ,EAAE,mBAAmB,EAAE,CAAC;IAChC,KAAK,CAAC,EAAE,cAAc,CAAC;IACvB,2BAA2B,CAAC,EAAE,6BAA6B,CAAC;IAC5D,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,aAAa,CAAC,EAAE,MAAM,EAAE,CAAC;IACzB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,OAAO,CAAC,EAAE,OAAO,CAAC,WAAW,CAAC;IAC9B,eAAe,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAC1C,WAAW,CAAC,EAAE,WAAW,CAAC;CAC3B,CAAC;AAEF,KAAK,iBAAiB,GAAG;IACvB,KAAK,EAAE,YAAY,CAAC;IACpB,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,QAAQ,EAAE,mBAAmB,EAAE,CAAC;IAChC,KAAK,CAAC,EAAE,cAAc,CAAC;IACvB,2BAA2B,CAAC,EAAE,6BAA6B,CAAC;IAC5D,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,aAAa,CAAC,EAAE,MAAM,EAAE,CAAC;IACzB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,OAAO,CAAC,EAAE,OAAO,CAAC,WAAW,CAAC;IAC9B,eAAe,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAC1C,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,WAAW,CAAC,EAAE,WAAW,CAAC;CAC3B,CAAC;AAEF,KAAK,YAAY,GAAG;IAClB,KAAK,EAAE,gBAAgB,CAAC;IACxB,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,CAAC,EAAE,WAAW,CAAC;CAC3B,CAAC;AAEF,KAAK,gBAAgB,GAAG;IACtB,KAAK,EAAE,gBAAgB,CAAC;IACxB,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB,WAAW,CAAC,EAAE,WAAW,CAAC;CAC3B,CAAC;AAsaF,wBAAgB,YAAY,CAAC,OAAO,EAAE,mBAAmB,GAAG,WAAW,CAAC,yBAAyB,CAAC,CAuBjG;AAED,wBAAgB,UAAU,CAAC,OAAO,EAAE,iBAAiB,GAAG,mBAAmB,CAsC1E;AAED,wBAAgB,KAAK,CAAC,OAAO,EAAE,YAAY;;;;;;;;GAW1C;AAED,wBAAgB,SAAS,CAAC,OAAO,EAAE,gBAAgB;;;;;;;GAUlD;AAED,wBAAgB,gBAAgB,CAAC,CAAC,EAAE,MAAM,EAAE,EAAE,CAAC,EAAE,MAAM,EAAE,GAAG,MAAM,CAsBjE"}
|
|
@@ -0,0 +1,367 @@
|
|
|
1
|
+
function normalizeSystemPrompt(system) {
|
|
2
|
+
if (typeof system === "string") {
|
|
3
|
+
return system;
|
|
4
|
+
}
|
|
5
|
+
if (!system || typeof system !== "object") {
|
|
6
|
+
return undefined;
|
|
7
|
+
}
|
|
8
|
+
if ("content" in system && typeof system.content === "string") {
|
|
9
|
+
return system.content;
|
|
10
|
+
}
|
|
11
|
+
if (Array.isArray(system)) {
|
|
12
|
+
const parts = system.flatMap((entry) => entry && typeof entry === "object" && "content" in entry && typeof entry.content === "string"
|
|
13
|
+
? [entry.content]
|
|
14
|
+
: []);
|
|
15
|
+
return parts.length > 0 ? parts.join("\n") : undefined;
|
|
16
|
+
}
|
|
17
|
+
return undefined;
|
|
18
|
+
}
|
|
19
|
+
function toRuntimePrompt(system, messages) {
|
|
20
|
+
const prompt = [];
|
|
21
|
+
if (system && system.length > 0) {
|
|
22
|
+
prompt.push({ role: "system", content: system });
|
|
23
|
+
}
|
|
24
|
+
for (const message of messages) {
|
|
25
|
+
switch (message.role) {
|
|
26
|
+
case "system":
|
|
27
|
+
prompt.push({ role: "system", content: message.content });
|
|
28
|
+
break;
|
|
29
|
+
case "user":
|
|
30
|
+
prompt.push({
|
|
31
|
+
role: "user",
|
|
32
|
+
content: [{ type: "text", text: message.content }],
|
|
33
|
+
});
|
|
34
|
+
break;
|
|
35
|
+
case "assistant":
|
|
36
|
+
prompt.push({
|
|
37
|
+
role: "assistant",
|
|
38
|
+
content: message.content.map((part) => part.type === "text" ? { type: "text", text: part.text } : {
|
|
39
|
+
type: "tool-call",
|
|
40
|
+
toolCallId: part.toolCallId,
|
|
41
|
+
toolName: part.toolName,
|
|
42
|
+
input: part.input,
|
|
43
|
+
}),
|
|
44
|
+
});
|
|
45
|
+
break;
|
|
46
|
+
case "tool":
|
|
47
|
+
prompt.push({
|
|
48
|
+
role: "tool",
|
|
49
|
+
content: message.content.map((part) => ({
|
|
50
|
+
type: "tool-result",
|
|
51
|
+
toolCallId: part.toolCallId,
|
|
52
|
+
toolName: part.toolName,
|
|
53
|
+
output: part.output,
|
|
54
|
+
})),
|
|
55
|
+
});
|
|
56
|
+
break;
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
return prompt;
|
|
60
|
+
}
|
|
61
|
+
function normalizeUsage(usage) {
|
|
62
|
+
if (!usage || typeof usage !== "object") {
|
|
63
|
+
return undefined;
|
|
64
|
+
}
|
|
65
|
+
if ("inputTokens" in usage && typeof usage.inputTokens === "object" && usage.inputTokens) {
|
|
66
|
+
const inputTokens = "total" in usage.inputTokens && typeof usage.inputTokens.total === "number"
|
|
67
|
+
? usage.inputTokens.total
|
|
68
|
+
: undefined;
|
|
69
|
+
const outputTokens = "outputTokens" in usage && typeof usage.outputTokens === "object" && usage.outputTokens &&
|
|
70
|
+
"total" in usage.outputTokens && typeof usage.outputTokens.total === "number"
|
|
71
|
+
? usage.outputTokens.total
|
|
72
|
+
: undefined;
|
|
73
|
+
return {
|
|
74
|
+
inputTokens,
|
|
75
|
+
outputTokens,
|
|
76
|
+
totalTokens: (inputTokens ?? 0) + (outputTokens ?? 0),
|
|
77
|
+
};
|
|
78
|
+
}
|
|
79
|
+
const flatUsage = usage;
|
|
80
|
+
return {
|
|
81
|
+
inputTokens: flatUsage.inputTokens,
|
|
82
|
+
outputTokens: flatUsage.outputTokens,
|
|
83
|
+
totalTokens: flatUsage.totalTokens,
|
|
84
|
+
};
|
|
85
|
+
}
|
|
86
|
+
function normalizeFinishReason(finishReason) {
|
|
87
|
+
if (typeof finishReason === "string") {
|
|
88
|
+
return finishReason;
|
|
89
|
+
}
|
|
90
|
+
if (finishReason && typeof finishReason === "object" && "unified" in finishReason) {
|
|
91
|
+
return typeof finishReason.unified === "string" ? finishReason.unified : null;
|
|
92
|
+
}
|
|
93
|
+
return null;
|
|
94
|
+
}
|
|
95
|
+
function parseToolCallInput(input) {
|
|
96
|
+
if (typeof input !== "string") {
|
|
97
|
+
return input;
|
|
98
|
+
}
|
|
99
|
+
try {
|
|
100
|
+
return JSON.parse(input);
|
|
101
|
+
}
|
|
102
|
+
catch {
|
|
103
|
+
return input;
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
function isRuntimeProviderToolDefinition(value) {
|
|
107
|
+
return !!value &&
|
|
108
|
+
typeof value === "object" &&
|
|
109
|
+
"type" in value &&
|
|
110
|
+
value.type === "provider" &&
|
|
111
|
+
"id" in value &&
|
|
112
|
+
typeof value.id === "string" &&
|
|
113
|
+
"args" in value &&
|
|
114
|
+
typeof value.args === "object" &&
|
|
115
|
+
value.args !== null &&
|
|
116
|
+
!Array.isArray(value.args);
|
|
117
|
+
}
|
|
118
|
+
function isRuntimeFunctionToolDefinition(value) {
|
|
119
|
+
return !!value &&
|
|
120
|
+
typeof value === "object" &&
|
|
121
|
+
"inputSchema" in value &&
|
|
122
|
+
!!value.inputSchema &&
|
|
123
|
+
typeof value.inputSchema === "object" &&
|
|
124
|
+
"jsonSchema" in value.inputSchema;
|
|
125
|
+
}
|
|
126
|
+
async function resolveDirectTools(tools) {
|
|
127
|
+
if (!tools) {
|
|
128
|
+
return undefined;
|
|
129
|
+
}
|
|
130
|
+
const resolvedTools = [];
|
|
131
|
+
for (const [name, definition] of Object.entries(tools)) {
|
|
132
|
+
if (isRuntimeProviderToolDefinition(definition)) {
|
|
133
|
+
resolvedTools.push({
|
|
134
|
+
type: "provider",
|
|
135
|
+
name,
|
|
136
|
+
id: definition.id,
|
|
137
|
+
args: definition.args,
|
|
138
|
+
});
|
|
139
|
+
continue;
|
|
140
|
+
}
|
|
141
|
+
if (!isRuntimeFunctionToolDefinition(definition)) {
|
|
142
|
+
continue;
|
|
143
|
+
}
|
|
144
|
+
const inputSchema = await Promise.resolve(definition.inputSchema.jsonSchema);
|
|
145
|
+
resolvedTools.push({
|
|
146
|
+
type: "function",
|
|
147
|
+
name,
|
|
148
|
+
...(typeof definition.description === "string"
|
|
149
|
+
? { description: definition.description }
|
|
150
|
+
: {}),
|
|
151
|
+
inputSchema,
|
|
152
|
+
});
|
|
153
|
+
}
|
|
154
|
+
return resolvedTools.length > 0 ? resolvedTools : undefined;
|
|
155
|
+
}
|
|
156
|
+
function isDirectToolCallPart(part) {
|
|
157
|
+
return !!part &&
|
|
158
|
+
typeof part === "object" &&
|
|
159
|
+
"type" in part &&
|
|
160
|
+
part.type === "tool-call" &&
|
|
161
|
+
"toolCallId" in part &&
|
|
162
|
+
typeof part.toolCallId === "string" &&
|
|
163
|
+
"toolName" in part &&
|
|
164
|
+
typeof part.toolName === "string";
|
|
165
|
+
}
|
|
166
|
+
function isDirectTextPart(part) {
|
|
167
|
+
return !!part &&
|
|
168
|
+
typeof part === "object" &&
|
|
169
|
+
"type" in part &&
|
|
170
|
+
part.type === "text" &&
|
|
171
|
+
"text" in part &&
|
|
172
|
+
typeof part.text === "string";
|
|
173
|
+
}
|
|
174
|
+
function isDirectToolResultPart(part) {
|
|
175
|
+
return !!part &&
|
|
176
|
+
typeof part === "object" &&
|
|
177
|
+
"type" in part &&
|
|
178
|
+
part.type === "tool-result" &&
|
|
179
|
+
"toolCallId" in part &&
|
|
180
|
+
typeof part.toolCallId === "string" &&
|
|
181
|
+
"toolName" in part &&
|
|
182
|
+
typeof part.toolName === "string" &&
|
|
183
|
+
"result" in part;
|
|
184
|
+
}
|
|
185
|
+
function buildDirectGenerateResult(result) {
|
|
186
|
+
let text = "";
|
|
187
|
+
const toolCalls = [];
|
|
188
|
+
const toolResults = [];
|
|
189
|
+
for (const part of result.content ?? []) {
|
|
190
|
+
if (isDirectTextPart(part)) {
|
|
191
|
+
text += part.text;
|
|
192
|
+
continue;
|
|
193
|
+
}
|
|
194
|
+
if (isDirectToolCallPart(part)) {
|
|
195
|
+
toolCalls.push({
|
|
196
|
+
toolCallId: part.toolCallId,
|
|
197
|
+
toolName: part.toolName,
|
|
198
|
+
input: parseToolCallInput(part.input),
|
|
199
|
+
});
|
|
200
|
+
}
|
|
201
|
+
if (isDirectToolResultPart(part)) {
|
|
202
|
+
toolResults.push({
|
|
203
|
+
toolCallId: part.toolCallId,
|
|
204
|
+
toolName: part.toolName,
|
|
205
|
+
result: part.result,
|
|
206
|
+
...(part.isError === true ? { isError: true } : {}),
|
|
207
|
+
});
|
|
208
|
+
}
|
|
209
|
+
}
|
|
210
|
+
return {
|
|
211
|
+
text,
|
|
212
|
+
...(toolCalls.length > 0 ? { toolCalls } : {}),
|
|
213
|
+
...(toolResults.length > 0 ? { toolResults } : {}),
|
|
214
|
+
usage: normalizeUsage(result.usage),
|
|
215
|
+
finishReason: normalizeFinishReason(result.finishReason),
|
|
216
|
+
};
|
|
217
|
+
}
|
|
218
|
+
function normalizeStreamPart(part) {
|
|
219
|
+
if (!part || typeof part !== "object" || !("type" in part)) {
|
|
220
|
+
return part;
|
|
221
|
+
}
|
|
222
|
+
if (part.type === "text-delta") {
|
|
223
|
+
if ("delta" in part && typeof part.delta === "string") {
|
|
224
|
+
return {
|
|
225
|
+
type: "text-delta",
|
|
226
|
+
text: part.delta,
|
|
227
|
+
};
|
|
228
|
+
}
|
|
229
|
+
return part;
|
|
230
|
+
}
|
|
231
|
+
if (part.type !== "finish") {
|
|
232
|
+
return part;
|
|
233
|
+
}
|
|
234
|
+
const finishPart = part;
|
|
235
|
+
const usage = normalizeUsage(finishPart.usage);
|
|
236
|
+
return {
|
|
237
|
+
type: "finish",
|
|
238
|
+
finishReason: normalizeFinishReason(finishPart.finishReason),
|
|
239
|
+
...(usage
|
|
240
|
+
? {
|
|
241
|
+
totalUsage: {
|
|
242
|
+
inputTokens: usage.inputTokens,
|
|
243
|
+
outputTokens: usage.outputTokens,
|
|
244
|
+
},
|
|
245
|
+
}
|
|
246
|
+
: {}),
|
|
247
|
+
};
|
|
248
|
+
}
|
|
249
|
+
async function* mapReadableStream(stream) {
|
|
250
|
+
for await (const part of stream) {
|
|
251
|
+
yield normalizeStreamPart(part);
|
|
252
|
+
}
|
|
253
|
+
}
|
|
254
|
+
async function* textDeltasFromStream(stream) {
|
|
255
|
+
for await (const part of stream) {
|
|
256
|
+
if (!part || typeof part !== "object" || !("type" in part) || part.type !== "text-delta") {
|
|
257
|
+
continue;
|
|
258
|
+
}
|
|
259
|
+
if ("text" in part && typeof part.text === "string") {
|
|
260
|
+
yield part.text;
|
|
261
|
+
continue;
|
|
262
|
+
}
|
|
263
|
+
if ("delta" in part && typeof part.delta === "string") {
|
|
264
|
+
yield part.delta;
|
|
265
|
+
}
|
|
266
|
+
}
|
|
267
|
+
}
|
|
268
|
+
export function generateText(options) {
|
|
269
|
+
return resolveDirectTools(options.tools).then((tools) => options.model.doGenerate({
|
|
270
|
+
prompt: toRuntimePrompt(normalizeSystemPrompt(options.system), options.messages),
|
|
271
|
+
maxOutputTokens: options.maxOutputTokens,
|
|
272
|
+
temperature: options.temperature,
|
|
273
|
+
topP: options.topP,
|
|
274
|
+
topK: options.topK,
|
|
275
|
+
stopSequences: options.stopSequences,
|
|
276
|
+
...(tools ? { tools } : {}),
|
|
277
|
+
...(options.toolChoice ? { toolChoice: options.toolChoice } : {}),
|
|
278
|
+
...(options.seed !== undefined ? { seed: options.seed } : {}),
|
|
279
|
+
...(options.presencePenalty !== undefined
|
|
280
|
+
? { presencePenalty: options.presencePenalty }
|
|
281
|
+
: {}),
|
|
282
|
+
...(options.frequencyPenalty !== undefined
|
|
283
|
+
? { frequencyPenalty: options.frequencyPenalty }
|
|
284
|
+
: {}),
|
|
285
|
+
...(options.headers ? { headers: options.headers } : {}),
|
|
286
|
+
...(options.providerOptions ? { providerOptions: options.providerOptions } : {}),
|
|
287
|
+
abortSignal: options.abortSignal,
|
|
288
|
+
}).then(buildDirectGenerateResult));
|
|
289
|
+
}
|
|
290
|
+
export function streamText(options) {
|
|
291
|
+
const directResultPromise = resolveDirectTools(options.tools).then((tools) => options.model.doStream({
|
|
292
|
+
prompt: toRuntimePrompt(normalizeSystemPrompt(options.system), options.messages),
|
|
293
|
+
maxOutputTokens: options.maxOutputTokens,
|
|
294
|
+
temperature: options.temperature,
|
|
295
|
+
topP: options.topP,
|
|
296
|
+
topK: options.topK,
|
|
297
|
+
stopSequences: options.stopSequences,
|
|
298
|
+
...(tools ? { tools } : {}),
|
|
299
|
+
...(options.toolChoice ? { toolChoice: options.toolChoice } : {}),
|
|
300
|
+
...(options.seed !== undefined ? { seed: options.seed } : {}),
|
|
301
|
+
...(options.presencePenalty !== undefined
|
|
302
|
+
? { presencePenalty: options.presencePenalty }
|
|
303
|
+
: {}),
|
|
304
|
+
...(options.frequencyPenalty !== undefined
|
|
305
|
+
? { frequencyPenalty: options.frequencyPenalty }
|
|
306
|
+
: {}),
|
|
307
|
+
...(options.headers ? { headers: options.headers } : {}),
|
|
308
|
+
...(options.providerOptions ? { providerOptions: options.providerOptions } : {}),
|
|
309
|
+
...(options.includeRawChunks !== undefined
|
|
310
|
+
? { includeRawChunks: options.includeRawChunks }
|
|
311
|
+
: {}),
|
|
312
|
+
abortSignal: options.abortSignal,
|
|
313
|
+
}));
|
|
314
|
+
const branchedStreamsPromise = directResultPromise.then(({ stream }) => stream.tee());
|
|
315
|
+
return {
|
|
316
|
+
fullStream: (async function* () {
|
|
317
|
+
const [fullStreamBranch] = await branchedStreamsPromise;
|
|
318
|
+
yield* mapReadableStream(fullStreamBranch);
|
|
319
|
+
})(),
|
|
320
|
+
textStream: (async function* () {
|
|
321
|
+
const [, textStreamBranch] = await branchedStreamsPromise;
|
|
322
|
+
yield* textDeltasFromStream(textStreamBranch);
|
|
323
|
+
})(),
|
|
324
|
+
};
|
|
325
|
+
}
|
|
326
|
+
export function embed(options) {
|
|
327
|
+
return options.model.doEmbed({
|
|
328
|
+
values: [options.value],
|
|
329
|
+
abortSignal: options.abortSignal,
|
|
330
|
+
}).then((result) => ({
|
|
331
|
+
embedding: result.embeddings[0] ?? [],
|
|
332
|
+
embeddings: result.embeddings,
|
|
333
|
+
usage: result.usage,
|
|
334
|
+
rawResponse: result.rawResponse,
|
|
335
|
+
warnings: result.warnings ?? [],
|
|
336
|
+
}));
|
|
337
|
+
}
|
|
338
|
+
export function embedMany(options) {
|
|
339
|
+
return options.model.doEmbed({
|
|
340
|
+
values: options.values,
|
|
341
|
+
abortSignal: options.abortSignal,
|
|
342
|
+
}).then((result) => ({
|
|
343
|
+
embeddings: result.embeddings,
|
|
344
|
+
usage: result.usage,
|
|
345
|
+
rawResponse: result.rawResponse,
|
|
346
|
+
warnings: result.warnings ?? [],
|
|
347
|
+
}));
|
|
348
|
+
}
|
|
349
|
+
export function cosineSimilarity(a, b) {
|
|
350
|
+
if (a.length === 0 || b.length === 0 || a.length !== b.length) {
|
|
351
|
+
return 0;
|
|
352
|
+
}
|
|
353
|
+
let dot = 0;
|
|
354
|
+
let normA = 0;
|
|
355
|
+
let normB = 0;
|
|
356
|
+
for (let i = 0; i < a.length; i++) {
|
|
357
|
+
const av = a[i] ?? 0;
|
|
358
|
+
const bv = b[i] ?? 0;
|
|
359
|
+
dot += av * bv;
|
|
360
|
+
normA += av * av;
|
|
361
|
+
normB += bv * bv;
|
|
362
|
+
}
|
|
363
|
+
if (normA === 0 || normB === 0) {
|
|
364
|
+
return 0;
|
|
365
|
+
}
|
|
366
|
+
return dot / (Math.sqrt(normA) * Math.sqrt(normB));
|
|
367
|
+
}
|
|
@@ -12,19 +12,19 @@ export declare class FileWatchSetup {
|
|
|
12
12
|
private watcherController?;
|
|
13
13
|
private optimizedWatcher?;
|
|
14
14
|
private batchCount;
|
|
15
|
-
private
|
|
15
|
+
private primitiveDirs;
|
|
16
16
|
/** Content hashes to skip re-renders when file content is unchanged */
|
|
17
17
|
private contentHashes;
|
|
18
|
-
constructor(projectDir: string, adapter: RuntimeAdapter, routeDiscovery: RouteDiscovery, debounceMs: number, invalidateHandler?: () => void, devServer?: DevServer | undefined,
|
|
18
|
+
constructor(projectDir: string, adapter: RuntimeAdapter, routeDiscovery: RouteDiscovery, debounceMs: number, invalidateHandler?: () => void, devServer?: DevServer | undefined, primitiveDirNames?: string[]);
|
|
19
19
|
setup(): Promise<void>;
|
|
20
20
|
private getWatchPaths;
|
|
21
21
|
private processFileWatcher;
|
|
22
22
|
private refreshAndReload;
|
|
23
23
|
/**
|
|
24
|
-
* Check if a path is inside
|
|
24
|
+
* Check if a path is inside a configured primitive directory (tools/, agents/, etc.)
|
|
25
25
|
* Uses path segment matching to avoid false positives from substrings.
|
|
26
26
|
*/
|
|
27
|
-
private
|
|
27
|
+
private isPrimitivePath;
|
|
28
28
|
/**
|
|
29
29
|
* Check if a path is inside a runtime data directory (data/, etc.)
|
|
30
30
|
* that contains generated content (embedding indices) rather than source code.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"file-watch-setup.d.ts","sourceRoot":"","sources":["../../../../src/src/server/dev-server/file-watch-setup.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,iCAAiC,CAAC;AAEtE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAE3D,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAyC7C,qBAAa,cAAc;IAUvB,OAAO,CAAC,UAAU;IAClB,OAAO,CAAC,OAAO;IACf,OAAO,CAAC,cAAc;IACtB,OAAO,CAAC,UAAU;IAClB,OAAO,CAAC,iBAAiB;IACzB,OAAO,CAAC,SAAS,CAAC;IAdpB,OAAO,CAAC,WAAW,CAAC,CAAoB;IACxC,OAAO,CAAC,iBAAiB,CAAC,CAAkB;IAC5C,OAAO,CAAC,gBAAgB,CAAC,CAAuB;IAChD,OAAO,CAAC,UAAU,CAAK;IACvB,OAAO,CAAC,
|
|
1
|
+
{"version":3,"file":"file-watch-setup.d.ts","sourceRoot":"","sources":["../../../../src/src/server/dev-server/file-watch-setup.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,iCAAiC,CAAC;AAEtE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAE3D,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAyC7C,qBAAa,cAAc;IAUvB,OAAO,CAAC,UAAU;IAClB,OAAO,CAAC,OAAO;IACf,OAAO,CAAC,cAAc;IACtB,OAAO,CAAC,UAAU;IAClB,OAAO,CAAC,iBAAiB;IACzB,OAAO,CAAC,SAAS,CAAC;IAdpB,OAAO,CAAC,WAAW,CAAC,CAAoB;IACxC,OAAO,CAAC,iBAAiB,CAAC,CAAkB;IAC5C,OAAO,CAAC,gBAAgB,CAAC,CAAuB;IAChD,OAAO,CAAC,UAAU,CAAK;IACvB,OAAO,CAAC,aAAa,CAAc;IACnC,uEAAuE;IACvE,OAAO,CAAC,aAAa,CAA6B;gBAGxC,UAAU,EAAE,MAAM,EAClB,OAAO,EAAE,cAAc,EACvB,cAAc,EAAE,cAAc,EAC9B,UAAU,EAAE,MAAM,EAClB,iBAAiB,GAAE,MAAM,IAAe,EACxC,SAAS,CAAC,EAAE,SAAS,YAAA,EAC7B,iBAAiB,CAAC,EAAE,MAAM,EAAE;IAKxB,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC;YA8Bd,aAAa;YA2Bb,kBAAkB;YAgClB,gBAAgB;IAkB9B;;;OAGG;IACH,OAAO,CAAC,eAAe;IAMvB;;;OAGG;IACH,OAAO,CAAC,iBAAiB;IAMzB,8CAA8C;IAC9C,OAAO,CAAC,WAAW;IASnB,6DAA6D;YAC/C,kBAAkB;YAkBlB,wBAAwB;YA6BxB,yBAAyB;IAMvC,UAAU;IAIV,OAAO,IAAI,IAAI;CAYhB"}
|