veryfront 0.1.47 → 0.1.49
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/app/components/inline-input.d.ts +1 -4
- package/esm/cli/app/components/inline-input.d.ts.map +1 -1
- package/esm/cli/app/components/inline-input.js +1 -1
- package/esm/cli/app/components/list-select.d.ts +0 -8
- package/esm/cli/app/components/list-select.d.ts.map +1 -1
- package/esm/cli/app/components/list-select.js +0 -13
- package/esm/cli/app/operations/project-creation.d.ts +2 -14
- package/esm/cli/app/operations/project-creation.d.ts.map +1 -1
- package/esm/cli/app/operations/project-creation.js +3 -68
- package/esm/cli/app/shell.js +2 -2
- package/esm/cli/app/utils.d.ts +1 -2
- package/esm/cli/app/utils.d.ts.map +1 -1
- package/esm/cli/app/utils.js +1 -17
- package/esm/cli/app/views/dashboard.d.ts +0 -4
- package/esm/cli/app/views/dashboard.d.ts.map +1 -1
- package/esm/cli/app/views/dashboard.js +0 -15
- package/esm/cli/app/views/startup.d.ts +0 -4
- package/esm/cli/app/views/startup.d.ts.map +1 -1
- package/esm/cli/app/views/startup.js +0 -7
- package/esm/cli/auth/login.d.ts.map +1 -1
- package/esm/cli/auth/login.js +1 -2
- package/esm/cli/auth/token-store.js +1 -1
- package/esm/cli/auth/utils.d.ts +2 -1
- package/esm/cli/auth/utils.d.ts.map +1 -1
- package/esm/cli/commands/build/handler.d.ts +1 -1
- package/esm/cli/commands/generate/integration-generator.js +1 -1
- package/esm/cli/commands/init/catalog.js +3 -3
- package/esm/cli/commands/init/command-help.js +2 -2
- package/esm/cli/commands/init/config-generator.d.ts.map +1 -1
- package/esm/cli/commands/init/config-generator.js +8 -0
- package/esm/cli/commands/init/types.d.ts +1 -1
- package/esm/cli/commands/init/types.d.ts.map +1 -1
- package/esm/cli/commands/install/types.d.ts +2 -2
- package/esm/cli/commands/merge/command.d.ts +1 -1
- package/esm/cli/help/formatters.d.ts +1 -1
- package/esm/cli/help/formatters.d.ts.map +1 -1
- package/esm/cli/help/formatters.js +8 -4
- package/esm/cli/help/main-help.d.ts.map +1 -1
- package/esm/cli/help/main-help.js +2 -2
- package/esm/cli/help/tips.js +1 -1
- package/esm/cli/mcp/remote-file-tools.js +1 -1
- package/esm/cli/mcp/server.d.ts +0 -1
- package/esm/cli/mcp/server.d.ts.map +1 -1
- package/esm/cli/mcp/server.js +2 -5
- package/esm/cli/mcp/tools/catalog-tools.d.ts +3 -3
- package/esm/cli/mcp/tools/catalog-tools.js +3 -3
- package/esm/cli/mcp/tools/dev-tools.d.ts +1 -1
- package/esm/cli/mcp/tools/dev-tools.d.ts.map +1 -1
- package/esm/cli/mcp/tools/dev-tools.js +1 -2
- package/esm/cli/mcp/tools/scaffold-tools.d.ts +2 -2
- package/esm/cli/mcp/tools.d.ts +1 -2
- package/esm/cli/mcp/tools.d.ts.map +1 -1
- package/esm/cli/mcp/tools.js +1 -2
- package/esm/cli/shared/reserve-slug.d.ts.map +1 -1
- package/esm/cli/shared/reserve-slug.js +1 -3
- package/esm/cli/sync/ignore.d.ts +1 -1
- package/esm/cli/sync/ignore.d.ts.map +1 -1
- package/esm/cli/sync/ignore.js +22 -18
- package/esm/cli/templates/index.js +2 -2
- package/esm/cli/templates/manifest.d.ts +10 -8
- package/esm/cli/templates/manifest.js +15 -13
- package/esm/cli/templates/types.d.ts +1 -1
- package/esm/cli/templates/types.d.ts.map +1 -1
- package/esm/cli/ui/colors.d.ts +0 -1
- package/esm/cli/ui/colors.d.ts.map +1 -1
- package/esm/cli/ui/colors.js +0 -10
- package/esm/cli/ui/dot-matrix.d.ts.map +1 -1
- package/esm/cli/ui/dot-matrix.js +2 -5
- package/esm/cli/ui/tui.js +2 -3
- package/esm/cli/utils/index.js +1 -2
- package/esm/cli/utils/package-manager.d.ts.map +1 -1
- package/esm/cli/utils/package-manager.js +3 -4
- package/esm/deno.d.ts +10 -0
- package/esm/deno.js +30 -20
- package/esm/src/agent/chat-handler.d.ts +22 -0
- package/esm/src/agent/chat-handler.d.ts.map +1 -1
- package/esm/src/agent/chat-handler.js +88 -28
- package/esm/src/agent/factory.d.ts +0 -8
- package/esm/src/agent/factory.d.ts.map +1 -1
- package/esm/src/agent/factory.js +50 -1
- package/esm/src/agent/index.d.ts +17 -2
- package/esm/src/agent/index.d.ts.map +1 -1
- package/esm/src/agent/index.js +17 -2
- package/esm/src/agent/memory/memory.d.ts +2 -2
- package/esm/src/agent/memory/memory.d.ts.map +1 -1
- package/esm/src/agent/memory/memory.js +0 -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/index.d.ts +1 -1
- package/esm/src/agent/react/use-chat/index.d.ts.map +1 -1
- package/esm/src/agent/react/use-chat/streaming/handler.d.ts.map +1 -1
- package/esm/src/agent/react/use-chat/streaming/handler.js +42 -4
- 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/parts-builder.js +14 -1
- package/esm/src/agent/react/use-chat/streaming/types.d.ts +5 -0
- package/esm/src/agent/react/use-chat/streaming/types.d.ts.map +1 -1
- package/esm/src/agent/react/use-chat/types.d.ts +23 -1
- package/esm/src/agent/react/use-chat/types.d.ts.map +1 -1
- package/esm/src/agent/react/use-chat/use-chat.d.ts +15 -1
- package/esm/src/agent/react/use-chat/use-chat.d.ts.map +1 -1
- package/esm/src/agent/react/use-chat/use-chat.js +187 -35
- package/esm/src/agent/runtime/index.d.ts +18 -0
- package/esm/src/agent/runtime/index.d.ts.map +1 -1
- package/esm/src/agent/runtime/index.js +167 -36
- package/esm/src/agent/runtime/tool-helpers.d.ts +6 -1
- package/esm/src/agent/runtime/tool-helpers.d.ts.map +1 -1
- package/esm/src/agent/runtime/tool-helpers.js +10 -1
- package/esm/src/agent/schemas/agent.schema.d.ts +4 -4
- package/esm/src/agent/types.d.ts +10 -0
- package/esm/src/agent/types.d.ts.map +1 -1
- package/esm/src/ai/registry-manager.d.ts.map +1 -1
- package/esm/src/ai/registry-manager.js +2 -1
- package/esm/src/build/bundler/code-splitter/manifest-builder.d.ts +0 -2
- package/esm/src/build/bundler/code-splitter/manifest-builder.d.ts.map +1 -1
- package/esm/src/build/bundler/code-splitter/manifest-builder.js +1 -1
- package/esm/src/build/compiler/mdx-compiler/validator.d.ts.map +1 -1
- package/esm/src/build/compiler/mdx-compiler/validator.js +2 -3
- package/esm/src/build/compiler/mdx-to-js.d.ts +0 -2
- package/esm/src/build/compiler/mdx-to-js.d.ts.map +1 -1
- package/esm/src/build/compiler/mdx-to-js.js +0 -81
- package/esm/src/build/index.d.ts +0 -6
- package/esm/src/build/index.d.ts.map +1 -1
- package/esm/src/build/index.js +0 -1
- package/esm/src/build/production-build/build/route-collector.d.ts.map +1 -1
- package/esm/src/build/production-build/build/route-collector.js +2 -3
- package/esm/src/build/production-build/client-runtime.d.ts +7 -3
- package/esm/src/build/production-build/client-runtime.d.ts.map +1 -1
- package/esm/src/build/production-build/client-runtime.js +9 -9
- package/esm/src/build/production-build/templates.d.ts +5 -9
- package/esm/src/build/production-build/templates.d.ts.map +1 -1
- package/esm/src/build/production-build/templates.js +6 -18
- package/esm/src/build/vendor-cache.d.ts.map +1 -1
- package/esm/src/build/vendor-cache.js +0 -5
- package/esm/src/cache/tokenizing-gateway.d.ts +0 -2
- package/esm/src/cache/tokenizing-gateway.d.ts.map +1 -1
- package/esm/src/cache/tokenizing-gateway.js +1 -3
- package/esm/src/chat/index.d.ts +33 -24
- package/esm/src/chat/index.d.ts.map +1 -1
- package/esm/src/chat/index.js +40 -26
- package/esm/src/config/define-config.d.ts.map +1 -1
- package/esm/src/config/define-config.js +28 -25
- package/esm/src/config/loader.d.ts.map +1 -1
- package/esm/src/config/loader.js +10 -7
- package/esm/src/config/schemas/config.schema.d.ts +58 -12
- package/esm/src/config/schemas/config.schema.d.ts.map +1 -1
- package/esm/src/config/schemas/config.schema.js +12 -0
- package/esm/src/data/data-fetcher.d.ts +1 -2
- package/esm/src/data/data-fetcher.d.ts.map +1 -1
- package/esm/src/data/data-fetcher.js +14 -15
- package/esm/src/data/server-data-fetcher.d.ts +0 -3
- package/esm/src/data/server-data-fetcher.d.ts.map +1 -1
- package/esm/src/data/server-data-fetcher.js +1 -8
- package/esm/src/data/static-data-fetcher.d.ts +1 -3
- package/esm/src/data/static-data-fetcher.d.ts.map +1 -1
- package/esm/src/data/static-data-fetcher.js +1 -3
- package/esm/src/discovery/discovery-engine.d.ts.map +1 -1
- package/esm/src/discovery/discovery-engine.js +19 -1
- package/esm/src/discovery/discovery-utils.d.ts +0 -4
- package/esm/src/discovery/discovery-utils.d.ts.map +1 -1
- package/esm/src/discovery/discovery-utils.js +0 -6
- package/esm/src/discovery/file-discovery.d.ts +3 -1
- package/esm/src/discovery/file-discovery.d.ts.map +1 -1
- package/esm/src/discovery/file-discovery.js +3 -8
- package/esm/src/discovery/handlers/index.d.ts +1 -0
- package/esm/src/discovery/handlers/index.d.ts.map +1 -1
- package/esm/src/discovery/handlers/index.js +1 -0
- package/esm/src/discovery/handlers/skill-handler.d.ts +26 -0
- package/esm/src/discovery/handlers/skill-handler.d.ts.map +1 -0
- package/esm/src/discovery/handlers/skill-handler.js +87 -0
- package/esm/src/discovery/handlers/task-handler.d.ts.map +1 -1
- package/esm/src/discovery/handlers/task-handler.js +1 -5
- package/esm/src/discovery/transpiler.d.ts.map +1 -1
- package/esm/src/discovery/transpiler.js +7 -2
- package/esm/src/discovery/types.d.ts +3 -0
- package/esm/src/discovery/types.d.ts.map +1 -1
- package/esm/src/embedding/chunk.d.ts +18 -0
- package/esm/src/embedding/chunk.d.ts.map +1 -0
- package/esm/src/embedding/chunk.js +48 -0
- package/esm/src/embedding/embedding.d.ts +23 -0
- package/esm/src/embedding/embedding.d.ts.map +1 -0
- package/esm/src/embedding/embedding.js +54 -0
- package/esm/src/embedding/index.d.ts +29 -0
- package/esm/src/embedding/index.d.ts.map +1 -0
- package/esm/src/embedding/index.js +26 -0
- package/esm/src/embedding/react/use-uploads.d.ts +31 -0
- package/esm/src/embedding/react/use-uploads.d.ts.map +1 -0
- package/esm/src/embedding/react/use-uploads.js +71 -0
- package/esm/src/embedding/resolve.d.ts +27 -0
- package/esm/src/embedding/resolve.d.ts.map +1 -0
- package/esm/src/embedding/resolve.js +94 -0
- package/esm/src/embedding/types.d.ts +90 -0
- package/esm/src/embedding/types.d.ts.map +1 -0
- package/esm/src/embedding/types.js +1 -0
- package/esm/src/embedding/upload-handler.d.ts +43 -0
- package/esm/src/embedding/upload-handler.d.ts.map +1 -0
- package/esm/src/embedding/upload-handler.js +144 -0
- package/esm/src/embedding/upload-loader.d.ts +14 -0
- package/esm/src/embedding/upload-loader.d.ts.map +1 -0
- package/esm/src/embedding/upload-loader.js +70 -0
- package/esm/src/embedding/upload-store.d.ts +27 -0
- package/esm/src/embedding/upload-store.d.ts.map +1 -0
- package/esm/src/embedding/upload-store.js +244 -0
- package/esm/src/embedding/vector-store.d.ts +33 -0
- package/esm/src/embedding/vector-store.d.ts.map +1 -0
- package/esm/src/embedding/vector-store.js +215 -0
- package/esm/src/errors/error-registry.d.ts +2 -1
- package/esm/src/errors/error-registry.d.ts.map +1 -1
- package/esm/src/errors/http-error.d.ts +1 -2
- package/esm/src/errors/http-error.d.ts.map +1 -1
- package/esm/src/errors/http-error.js +2 -2
- package/esm/src/errors/middleware/cli-error-boundary.d.ts.map +1 -1
- package/esm/src/errors/middleware/cli-error-boundary.js +13 -2
- package/esm/src/errors/middleware/wrap-unknown.d.ts +0 -7
- package/esm/src/errors/middleware/wrap-unknown.d.ts.map +1 -1
- package/esm/src/errors/middleware/wrap-unknown.js +0 -9
- package/esm/src/errors/veryfront-error.d.ts +0 -3
- package/esm/src/errors/veryfront-error.d.ts.map +1 -1
- package/esm/src/errors/veryfront-error.js +0 -5
- package/esm/src/html/schemas/html.schema.d.ts +2 -2
- package/esm/src/html/styles-builder/css-hash-cache.d.ts.map +1 -1
- package/esm/src/html/styles-builder/css-hash-cache.js +1 -2
- package/esm/src/html/styles-builder/plugin-loader.d.ts.map +1 -1
- package/esm/src/html/styles-builder/plugin-loader.js +50 -21
- package/esm/src/html/styles-builder/tailwind-compiler-cache.d.ts.map +1 -1
- package/esm/src/html/styles-builder/tailwind-compiler-cache.js +12 -4
- package/esm/src/html/utils.d.ts +0 -7
- package/esm/src/html/utils.d.ts.map +1 -1
- package/esm/src/html/utils.js +0 -25
- package/esm/src/modules/component-registry/registry.d.ts +0 -3
- package/esm/src/modules/component-registry/registry.d.ts.map +1 -1
- package/esm/src/modules/component-registry/registry.js +0 -3
- package/esm/src/modules/import-map/default-import-map.d.ts.map +1 -1
- package/esm/src/modules/import-map/default-import-map.js +8 -0
- package/esm/src/modules/react-loader/component-loader.d.ts.map +1 -1
- package/esm/src/modules/react-loader/component-loader.js +1 -0
- package/esm/src/modules/react-loader/ssr-module-loader/loader.d.ts.map +1 -1
- package/esm/src/modules/react-loader/ssr-module-loader/loader.js +10 -1
- package/esm/src/modules/react-loader/ssr-module-loader/types.d.ts +2 -0
- package/esm/src/modules/react-loader/ssr-module-loader/types.d.ts.map +1 -1
- package/esm/src/modules/react-loader/types.d.ts +2 -0
- package/esm/src/modules/react-loader/types.d.ts.map +1 -1
- package/esm/src/modules/server/module-server.d.ts +2 -0
- package/esm/src/modules/server/module-server.d.ts.map +1 -1
- package/esm/src/modules/server/module-server.js +2 -1
- package/esm/src/oauth/handlers/callback-handler.d.ts +2 -0
- package/esm/src/oauth/handlers/callback-handler.d.ts.map +1 -1
- package/esm/src/oauth/handlers/callback-handler.js +10 -4
- package/esm/src/oauth/providers/common.d.ts.map +1 -1
- package/esm/src/oauth/providers/common.js +0 -23
- package/esm/src/observability/auto-instrument/react-instrumentation.js +2 -1
- package/esm/src/observability/instruments/instruments-factory.d.ts +1 -1
- package/esm/src/observability/instruments/instruments-factory.d.ts.map +1 -1
- package/esm/src/observability/instruments/instruments-factory.js +5 -4
- package/esm/src/observability/metrics/config.js +5 -4
- package/esm/src/observability/metrics/manager.js +1 -1
- package/esm/src/observability/tracing/span-operations.d.ts.map +1 -1
- package/esm/src/observability/tracing/span-operations.js +14 -8
- package/esm/src/platform/compat/console/node.d.ts +0 -1
- package/esm/src/platform/compat/console/node.d.ts.map +1 -1
- package/esm/src/platform/compat/console/node.js +4 -11
- package/esm/src/platform/compat/fs.d.ts.map +1 -1
- package/esm/src/platform/compat/fs.js +4 -2
- package/esm/src/platform/compat/opaque-deps.d.ts +18 -2
- package/esm/src/platform/compat/opaque-deps.d.ts.map +1 -1
- package/esm/src/platform/compat/opaque-deps.js +19 -0
- package/esm/src/platform/compat/path/basic-operations.d.ts.map +1 -1
- package/esm/src/platform/compat/path/basic-operations.js +17 -10
- package/esm/src/platform/compat/path/resolution.d.ts.map +1 -1
- package/esm/src/platform/compat/path/resolution.js +65 -20
- package/esm/src/platform/compat/path/url-conversion.d.ts.map +1 -1
- package/esm/src/platform/compat/path/url-conversion.js +3 -2
- package/esm/src/platform/compat/process.d.ts +2 -14
- package/esm/src/platform/compat/process.d.ts.map +1 -1
- package/esm/src/platform/compat/process.js +92 -70
- package/esm/src/provider/index.d.ts +1 -1
- package/esm/src/provider/index.d.ts.map +1 -1
- package/esm/src/provider/index.js +1 -1
- package/esm/src/provider/local/ai-sdk-adapter.d.ts.map +1 -1
- package/esm/src/provider/local/ai-sdk-adapter.js +18 -18
- package/esm/src/provider/local/env.d.ts.map +1 -1
- package/esm/src/provider/local/env.js +2 -1
- package/esm/src/provider/local/local-embedding-adapter.d.ts +19 -0
- package/esm/src/provider/local/local-embedding-adapter.d.ts.map +1 -0
- package/esm/src/provider/local/local-embedding-adapter.js +32 -0
- package/esm/src/provider/local/local-embedding-engine.d.ts +17 -0
- package/esm/src/provider/local/local-embedding-engine.d.ts.map +1 -0
- package/esm/src/provider/local/local-embedding-engine.js +63 -0
- package/esm/src/provider/local/local-engine.d.ts +7 -0
- package/esm/src/provider/local/local-engine.d.ts.map +1 -1
- package/esm/src/provider/local/local-engine.js +1 -1
- package/esm/src/provider/local/model-catalog.d.ts +10 -1
- package/esm/src/provider/local/model-catalog.d.ts.map +1 -1
- package/esm/src/provider/local/model-catalog.js +61 -0
- package/esm/src/provider/model-registry.d.ts +10 -0
- package/esm/src/provider/model-registry.d.ts.map +1 -1
- package/esm/src/provider/model-registry.js +43 -0
- package/esm/src/proxy/retry.d.ts +3 -3
- package/esm/src/proxy/retry.d.ts.map +1 -1
- package/esm/src/proxy/retry.js +0 -7
- package/esm/src/proxy/tracing.d.ts +1 -5
- package/esm/src/proxy/tracing.d.ts.map +1 -1
- package/esm/src/proxy/tracing.js +1 -7
- package/esm/src/react/components/ai/agent-card.js +13 -13
- package/esm/src/react/components/ai/chat/components/animations.d.ts +5 -0
- package/esm/src/react/components/ai/chat/components/animations.d.ts.map +1 -1
- package/esm/src/react/components/ai/chat/components/animations.js +13 -1
- package/esm/src/react/components/ai/chat/components/attachment-pill.d.ts +15 -0
- package/esm/src/react/components/ai/chat/components/attachment-pill.d.ts.map +1 -0
- package/esm/src/react/components/ai/chat/components/attachment-pill.js +40 -0
- package/esm/src/react/components/ai/chat/components/branch-picker.d.ts +9 -0
- package/esm/src/react/components/ai/chat/components/branch-picker.d.ts.map +1 -0
- package/esm/src/react/components/ai/chat/components/branch-picker.js +17 -0
- package/esm/src/react/components/ai/chat/components/code-block.d.ts +8 -0
- package/esm/src/react/components/ai/chat/components/code-block.d.ts.map +1 -0
- package/esm/src/react/components/ai/chat/components/code-block.js +38 -0
- package/esm/src/react/components/ai/chat/components/drop-zone.d.ts +7 -0
- package/esm/src/react/components/ai/chat/components/drop-zone.d.ts.map +1 -0
- package/esm/src/react/components/ai/chat/components/drop-zone.js +14 -0
- package/esm/src/react/components/ai/chat/components/empty-state.d.ts.map +1 -1
- package/esm/src/react/components/ai/chat/components/empty-state.js +10 -8
- package/esm/src/react/components/ai/chat/components/inference-badge.js +1 -1
- package/esm/src/react/components/ai/chat/components/inline-citation.d.ts +10 -0
- package/esm/src/react/components/ai/chat/components/inline-citation.d.ts.map +1 -0
- package/esm/src/react/components/ai/chat/components/inline-citation.js +59 -0
- package/esm/src/react/components/ai/chat/components/message-actions.d.ts +3 -2
- package/esm/src/react/components/ai/chat/components/message-actions.d.ts.map +1 -1
- package/esm/src/react/components/ai/chat/components/message-actions.js +10 -10
- package/esm/src/react/components/ai/chat/components/message-edit-form.d.ts +8 -0
- package/esm/src/react/components/ai/chat/components/message-edit-form.d.ts.map +1 -0
- package/esm/src/react/components/ai/chat/components/message-edit-form.js +46 -0
- package/esm/src/react/components/ai/chat/components/message-feedback.d.ts +9 -0
- package/esm/src/react/components/ai/chat/components/message-feedback.d.ts.map +1 -0
- package/esm/src/react/components/ai/chat/components/message-feedback.js +19 -0
- package/esm/src/react/components/ai/chat/components/quick-actions.d.ts +14 -0
- package/esm/src/react/components/ai/chat/components/quick-actions.d.ts.map +1 -0
- package/esm/src/react/components/ai/chat/components/quick-actions.js +7 -0
- package/esm/src/react/components/ai/chat/components/reasoning.d.ts +3 -4
- package/esm/src/react/components/ai/chat/components/reasoning.d.ts.map +1 -1
- package/esm/src/react/components/ai/chat/components/reasoning.js +11 -6
- package/esm/src/react/components/ai/chat/components/sidebar.d.ts +14 -0
- package/esm/src/react/components/ai/chat/components/sidebar.d.ts.map +1 -0
- package/esm/src/react/components/ai/chat/components/sidebar.js +92 -0
- package/esm/src/react/components/ai/chat/components/skill-badge.d.ts +12 -0
- package/esm/src/react/components/ai/chat/components/skill-badge.d.ts.map +1 -0
- package/esm/src/react/components/ai/chat/components/skill-badge.js +34 -0
- package/esm/src/react/components/ai/chat/components/sources.d.ts +13 -0
- package/esm/src/react/components/ai/chat/components/sources.d.ts.map +1 -0
- package/esm/src/react/components/ai/chat/components/sources.js +28 -0
- package/esm/src/react/components/ai/chat/components/step-indicator.d.ts +8 -0
- package/esm/src/react/components/ai/chat/components/step-indicator.d.ts.map +1 -0
- package/esm/src/react/components/ai/chat/components/step-indicator.js +15 -0
- package/esm/src/react/components/ai/chat/components/tab-switcher.d.ts +16 -0
- package/esm/src/react/components/ai/chat/components/tab-switcher.d.ts.map +1 -0
- package/esm/src/react/components/ai/chat/components/tab-switcher.js +28 -0
- package/esm/src/react/components/ai/chat/components/tool-ui.d.ts.map +1 -1
- package/esm/src/react/components/ai/chat/components/tool-ui.js +23 -21
- package/esm/src/react/components/ai/chat/components/upgrade-cta.d.ts.map +1 -1
- package/esm/src/react/components/ai/chat/components/upgrade-cta.js +3 -3
- package/esm/src/react/components/ai/chat/components/uploads-panel.d.ts +16 -0
- package/esm/src/react/components/ai/chat/components/uploads-panel.d.ts.map +1 -0
- package/esm/src/react/components/ai/chat/components/uploads-panel.js +46 -0
- package/esm/src/react/components/ai/chat/composition/api.d.ts +10 -5
- package/esm/src/react/components/ai/chat/composition/api.d.ts.map +1 -1
- package/esm/src/react/components/ai/chat/composition/api.js +12 -20
- package/esm/src/react/components/ai/chat/composition/chat-composer.d.ts +35 -0
- package/esm/src/react/components/ai/chat/composition/chat-composer.d.ts.map +1 -0
- package/esm/src/react/components/ai/chat/composition/chat-composer.js +53 -0
- package/esm/src/react/components/ai/chat/composition/chat-empty.d.ts +20 -0
- package/esm/src/react/components/ai/chat/composition/chat-empty.d.ts.map +1 -0
- package/esm/src/react/components/ai/chat/composition/chat-empty.js +23 -0
- package/esm/src/react/components/ai/chat/composition/chat-if.d.ts +14 -0
- package/esm/src/react/components/ai/chat/composition/chat-if.d.ts.map +1 -0
- package/esm/src/react/components/ai/chat/composition/chat-if.js +11 -0
- package/esm/src/react/components/ai/chat/composition/chat-message-list.d.ts +36 -0
- package/esm/src/react/components/ai/chat/composition/chat-message-list.d.ts.map +1 -0
- package/esm/src/react/components/ai/chat/composition/chat-message-list.js +113 -0
- package/esm/src/react/components/ai/chat/composition/chat-root.d.ts +43 -0
- package/esm/src/react/components/ai/chat/composition/chat-root.d.ts.map +1 -0
- package/esm/src/react/components/ai/chat/composition/chat-root.js +78 -0
- package/esm/src/react/components/ai/chat/composition/error-banner.d.ts +12 -0
- package/esm/src/react/components/ai/chat/composition/error-banner.d.ts.map +1 -0
- package/esm/src/react/components/ai/chat/composition/error-banner.js +17 -0
- package/esm/src/react/components/ai/chat/composition/message.d.ts +54 -0
- package/esm/src/react/components/ai/chat/composition/message.d.ts.map +1 -0
- package/esm/src/react/components/ai/chat/composition/message.js +175 -0
- package/esm/src/react/components/ai/chat/composition/model-avatar.d.ts +14 -0
- package/esm/src/react/components/ai/chat/composition/model-avatar.d.ts.map +1 -0
- package/esm/src/react/components/ai/chat/composition/model-avatar.js +60 -0
- package/esm/src/react/components/ai/chat/contexts/chat-context.d.ts +45 -0
- package/esm/src/react/components/ai/chat/contexts/chat-context.d.ts.map +1 -0
- package/esm/src/react/components/ai/chat/contexts/chat-context.js +20 -0
- package/esm/src/react/components/ai/chat/contexts/composer-context.d.ts +34 -0
- package/esm/src/react/components/ai/chat/contexts/composer-context.d.ts.map +1 -0
- package/esm/src/react/components/ai/chat/contexts/composer-context.js +21 -0
- package/esm/src/react/components/ai/chat/contexts/index.d.ts +13 -0
- package/esm/src/react/components/ai/chat/contexts/index.d.ts.map +1 -0
- package/esm/src/react/components/ai/chat/contexts/index.js +12 -0
- package/esm/src/react/components/ai/chat/contexts/message-context.d.ts +30 -0
- package/esm/src/react/components/ai/chat/contexts/message-context.d.ts.map +1 -0
- package/esm/src/react/components/ai/chat/contexts/message-context.js +21 -0
- package/esm/src/react/components/ai/chat/contexts/thread-list-context.d.ts +23 -0
- package/esm/src/react/components/ai/chat/contexts/thread-list-context.d.ts.map +1 -0
- package/esm/src/react/components/ai/chat/contexts/thread-list-context.js +21 -0
- package/esm/src/react/components/ai/chat/hooks/use-threads.d.ts +24 -0
- package/esm/src/react/components/ai/chat/hooks/use-threads.d.ts.map +1 -0
- package/esm/src/react/components/ai/chat/hooks/use-threads.js +151 -0
- package/esm/src/react/components/ai/chat/index.d.ts +102 -17
- package/esm/src/react/components/ai/chat/index.d.ts.map +1 -1
- package/esm/src/react/components/ai/chat/index.js +164 -95
- package/esm/src/react/components/ai/chat/utils/export.d.ts +10 -0
- package/esm/src/react/components/ai/chat/utils/export.d.ts.map +1 -0
- package/esm/src/react/components/ai/chat/utils/export.js +64 -0
- package/esm/src/react/components/ai/chat/utils/message-parts.d.ts +12 -0
- package/esm/src/react/components/ai/chat/utils/message-parts.d.ts.map +1 -1
- package/esm/src/react/components/ai/chat/utils/message-parts.js +55 -0
- package/esm/src/react/components/ai/chat-with-sidebar.d.ts +98 -0
- package/esm/src/react/components/ai/chat-with-sidebar.d.ts.map +1 -0
- package/esm/src/react/components/ai/chat-with-sidebar.js +165 -0
- package/esm/src/react/components/ai/chat.d.ts +10 -1
- package/esm/src/react/components/ai/chat.d.ts.map +1 -1
- package/esm/src/react/components/ai/chat.js +25 -1
- package/esm/src/react/components/ai/error-boundary.js +6 -6
- package/esm/src/react/components/ai/icons/index.d.ts +9 -0
- package/esm/src/react/components/ai/icons/index.d.ts.map +1 -1
- package/esm/src/react/components/ai/icons/index.js +82 -0
- package/esm/src/react/components/ai/markdown.d.ts.map +1 -1
- package/esm/src/react/components/ai/markdown.js +12 -12
- package/esm/src/react/components/ai/model-selector.d.ts +10 -2
- package/esm/src/react/components/ai/model-selector.d.ts.map +1 -1
- package/esm/src/react/components/ai/model-selector.js +138 -4
- package/esm/src/react/components/ai/theme.d.ts +96 -13
- package/esm/src/react/components/ai/theme.d.ts.map +1 -1
- package/esm/src/react/components/ai/theme.js +177 -21
- package/esm/src/react/primitives/input-box.d.ts.map +1 -1
- package/esm/src/react/primitives/input-box.js +16 -3
- package/esm/src/rendering/cache/index.d.ts +1 -5
- package/esm/src/rendering/cache/index.d.ts.map +1 -1
- package/esm/src/rendering/cache/index.js +1 -5
- package/esm/src/rendering/component-handling.d.ts +2 -0
- package/esm/src/rendering/component-handling.d.ts.map +1 -1
- package/esm/src/rendering/component-handling.js +7 -9
- package/esm/src/rendering/orchestrator/pipeline.d.ts +11 -2
- package/esm/src/rendering/orchestrator/pipeline.d.ts.map +1 -1
- package/esm/src/rendering/page-renderer.d.ts.map +1 -1
- package/esm/src/rendering/page-renderer.js +1 -0
- package/esm/src/rendering/shared/context-aware-cache.d.ts.map +1 -1
- package/esm/src/rendering/shared/context-aware-cache.js +0 -4
- package/esm/src/repositories/schemas/index.d.ts +1 -1
- package/esm/src/repositories/schemas/index.d.ts.map +1 -1
- package/esm/src/repositories/schemas/index.js +1 -1
- package/esm/src/repositories/schemas/repository.schema.d.ts +0 -11
- package/esm/src/repositories/schemas/repository.schema.d.ts.map +1 -1
- package/esm/src/repositories/schemas/repository.schema.js +0 -13
- package/esm/src/repositories/types.d.ts +1 -1
- package/esm/src/repositories/types.d.ts.map +1 -1
- package/esm/src/routing/api/module-loader/esbuild-plugin.d.ts.map +1 -1
- package/esm/src/routing/api/module-loader/esbuild-plugin.js +11 -24
- package/esm/src/routing/api/module-loader/loader.d.ts +1 -0
- package/esm/src/routing/api/module-loader/loader.d.ts.map +1 -1
- package/esm/src/routing/api/module-loader/loader.js +347 -27
- package/esm/src/routing/api/openapi/path-utils.d.ts +0 -19
- package/esm/src/routing/api/openapi/path-utils.d.ts.map +1 -1
- package/esm/src/routing/api/openapi/path-utils.js +0 -34
- package/esm/src/routing/api/openapi/spec-generator.d.ts.map +1 -1
- package/esm/src/routing/api/openapi/spec-generator.js +1 -19
- package/esm/src/routing/api/openapi/types.d.ts +1 -0
- package/esm/src/routing/api/openapi/types.d.ts.map +1 -1
- package/esm/src/routing/api/openapi/types.js +18 -0
- package/esm/src/sandbox/sandbox.d.ts +1 -0
- package/esm/src/sandbox/sandbox.d.ts.map +1 -1
- package/esm/src/sandbox/sandbox.js +7 -8
- package/esm/src/security/http/cors/constants.d.ts +0 -2
- package/esm/src/security/http/cors/constants.d.ts.map +1 -1
- package/esm/src/security/http/cors/constants.js +0 -2
- package/esm/src/security/http/response/index.d.ts +3 -4
- package/esm/src/security/http/response/index.d.ts.map +1 -1
- package/esm/src/security/http/response/index.js +2 -3
- package/esm/src/server/context/enriched-context.d.ts +0 -8
- package/esm/src/server/context/enriched-context.d.ts.map +1 -1
- package/esm/src/server/context/enriched-context.js +1 -12
- package/esm/src/server/dev-server/server.d.ts.map +1 -1
- package/esm/src/server/dev-server/server.js +11 -4
- package/esm/src/server/dev-ui/manifest.d.ts +20 -20
- package/esm/src/server/dev-ui/manifest.js +20 -20
- package/esm/src/server/handlers/dev/framework-candidates.generated.d.ts +9 -0
- package/esm/src/server/handlers/dev/framework-candidates.generated.d.ts.map +1 -0
- package/esm/src/server/handlers/dev/framework-candidates.generated.js +5187 -0
- package/esm/src/server/handlers/dev/styles-candidate-scanner.d.ts.map +1 -1
- package/esm/src/server/handlers/dev/styles-candidate-scanner.js +3 -190
- package/esm/src/server/handlers/request/module/module-server-handler.d.ts.map +1 -1
- package/esm/src/server/handlers/request/module/module-server-handler.js +1 -0
- package/esm/src/server/runtime-handler/index.d.ts.map +1 -1
- package/esm/src/server/runtime-handler/index.js +14 -24
- package/esm/src/server/shared/renderer/memory/pressure.d.ts +0 -7
- package/esm/src/server/shared/renderer/memory/pressure.d.ts.map +1 -1
- package/esm/src/server/shared/renderer/memory/pressure.js +1 -13
- package/esm/src/server/utils/domain-lookup.d.ts +0 -4
- package/esm/src/server/utils/domain-lookup.d.ts.map +1 -1
- package/esm/src/server/utils/domain-lookup.js +0 -3
- package/esm/src/skill/allowed-tools.d.ts +54 -0
- package/esm/src/skill/allowed-tools.d.ts.map +1 -0
- package/esm/src/skill/allowed-tools.js +87 -0
- package/esm/src/skill/executor.d.ts +28 -0
- package/esm/src/skill/executor.d.ts.map +1 -0
- package/esm/src/skill/executor.js +187 -0
- package/esm/src/skill/index.d.ts +19 -0
- package/esm/src/skill/index.d.ts.map +1 -0
- package/esm/src/skill/index.js +24 -0
- package/esm/src/skill/parser.d.ts +30 -0
- package/esm/src/skill/parser.d.ts.map +1 -0
- package/esm/src/skill/parser.js +162 -0
- package/esm/src/skill/path-safety.d.ts +22 -0
- package/esm/src/skill/path-safety.d.ts.map +1 -0
- package/esm/src/skill/path-safety.js +156 -0
- package/esm/src/skill/prompt-augmentation.d.ts +19 -0
- package/esm/src/skill/prompt-augmentation.d.ts.map +1 -0
- package/esm/src/skill/prompt-augmentation.js +36 -0
- package/esm/src/skill/registry.d.ts +25 -0
- package/esm/src/skill/registry.d.ts.map +1 -0
- package/esm/src/skill/registry.js +42 -0
- package/esm/src/skill/tools.d.ts +27 -0
- package/esm/src/skill/tools.d.ts.map +1 -0
- package/esm/src/skill/tools.js +149 -0
- package/esm/src/skill/types.d.ts +85 -0
- package/esm/src/skill/types.d.ts.map +1 -0
- package/esm/src/skill/types.js +27 -0
- package/esm/src/studio/bridge/bridge-bundle.generated.d.ts +1 -1
- package/esm/src/studio/bridge/bridge-bundle.generated.d.ts.map +1 -1
- package/esm/src/studio/bridge/bridge-bundle.generated.js +1 -1
- package/esm/src/studio/element-selector-injector.d.ts +0 -2
- package/esm/src/studio/element-selector-injector.d.ts.map +1 -1
- package/esm/src/task/runner.d.ts +6 -0
- package/esm/src/task/runner.d.ts.map +1 -1
- package/esm/src/task/runner.js +8 -8
- package/esm/src/tool/factory.js +31 -39
- package/esm/src/transforms/esm/http-cache-helpers.d.ts +0 -8
- package/esm/src/transforms/esm/http-cache-helpers.d.ts.map +1 -1
- package/esm/src/transforms/esm/http-cache-helpers.js +0 -20
- package/esm/src/transforms/esm/path-resolver.d.ts +0 -14
- package/esm/src/transforms/esm/path-resolver.d.ts.map +1 -1
- package/esm/src/transforms/esm/path-resolver.js +1 -92
- package/esm/src/transforms/esm/source-url-embed.d.ts +0 -14
- package/esm/src/transforms/esm/source-url-embed.d.ts.map +1 -1
- package/esm/src/transforms/esm/source-url-embed.js +0 -47
- package/esm/src/transforms/esm/transform-cache.d.ts.map +1 -1
- package/esm/src/transforms/esm/transform-cache.js +2 -6
- package/esm/src/transforms/mdx/index.d.ts +0 -1
- package/esm/src/transforms/mdx/index.d.ts.map +1 -1
- package/esm/src/transforms/mdx/index.js +0 -4
- package/esm/src/transforms/pipeline/context.d.ts +0 -1
- package/esm/src/transforms/pipeline/context.d.ts.map +1 -1
- package/esm/src/transforms/pipeline/context.js +0 -1
- package/esm/src/transforms/pipeline/index.d.ts +1 -2
- package/esm/src/transforms/pipeline/index.d.ts.map +1 -1
- package/esm/src/transforms/pipeline/index.js +0 -3
- package/esm/src/transforms/pipeline/stages/ssr-http-cache.d.ts.map +1 -1
- package/esm/src/transforms/pipeline/stages/ssr-http-cache.js +0 -1
- package/esm/src/transforms/plugins/rehype-node-positions.d.ts.map +1 -1
- package/esm/src/transforms/plugins/rehype-node-positions.js +1 -0
- package/esm/src/types/entities/getEntityInfo.js +1 -1
- package/esm/src/types/index.d.ts +2 -13
- package/esm/src/types/index.d.ts.map +1 -1
- package/esm/src/types/server.d.ts +2 -1
- package/esm/src/types/server.d.ts.map +1 -1
- package/esm/src/utils/cache-file-ops.d.ts +1 -1
- package/esm/src/utils/cache-file-ops.d.ts.map +1 -1
- package/esm/src/utils/cache-file-ops.js +5 -6
- package/esm/src/utils/lru-wrapper.d.ts.map +1 -1
- package/esm/src/utils/lru-wrapper.js +2 -4
- package/esm/src/workflow/claude-code/event-publisher.d.ts +0 -4
- package/esm/src/workflow/claude-code/event-publisher.d.ts.map +1 -1
- package/esm/src/workflow/claude-code/event-publisher.js +2 -6
- package/esm/src/workflow/executor/workflow-executor.d.ts.map +1 -1
- package/esm/src/workflow/executor/workflow-executor.js +6 -1
- package/esm/src/workflow/react/use-workflow-list.d.ts.map +1 -1
- package/esm/src/workflow/react/use-workflow-list.js +2 -1
- package/esm/src/workflow/schemas/workflow.schema.d.ts +8 -8
- package/package.json +10 -3
- package/src/cli/app/components/inline-input.ts +0 -5
- package/src/cli/app/components/list-select.ts +0 -21
- package/src/cli/app/operations/project-creation.ts +4 -109
- package/src/cli/app/shell.ts +2 -2
- package/src/cli/app/utils.ts +0 -22
- package/src/cli/app/views/dashboard.ts +0 -17
- package/src/cli/app/views/startup.ts +0 -13
- package/src/cli/auth/login.ts +1 -2
- package/src/cli/auth/token-store.ts +1 -1
- package/src/cli/auth/utils.ts +2 -1
- package/src/cli/commands/generate/integration-generator.ts +1 -1
- package/src/cli/commands/init/catalog.ts +3 -3
- package/src/cli/commands/init/command-help.ts +2 -2
- package/src/cli/commands/init/config-generator.ts +9 -0
- package/src/cli/commands/init/types.ts +1 -1
- package/src/cli/help/formatters.ts +11 -4
- package/src/cli/help/main-help.ts +2 -3
- package/src/cli/help/tips.ts +1 -1
- package/src/cli/mcp/remote-file-tools.ts +1 -1
- package/src/cli/mcp/server.ts +2 -5
- package/src/cli/mcp/tools/catalog-tools.ts +3 -3
- package/src/cli/mcp/tools/dev-tools.ts +1 -2
- package/src/cli/mcp/tools.ts +8 -2
- package/src/cli/shared/reserve-slug.ts +1 -4
- package/src/cli/sync/ignore.ts +26 -21
- package/src/cli/templates/index.ts +2 -2
- package/src/cli/templates/manifest.js +15 -13
- package/src/cli/templates/types.ts +1 -1
- package/src/cli/ui/colors.ts +0 -12
- package/src/cli/ui/dot-matrix.ts +3 -6
- package/src/cli/ui/tui.ts +3 -3
- package/src/cli/utils/index.ts +1 -1
- package/src/cli/utils/package-manager.ts +3 -4
- package/src/deno.js +30 -20
- package/src/src/agent/chat-handler.ts +138 -28
- package/src/src/agent/factory.ts +58 -9
- package/src/src/agent/index.ts +24 -2
- package/src/src/agent/memory/memory.ts +0 -9
- package/src/src/agent/react/index.ts +2 -0
- package/src/src/agent/react/use-chat/index.ts +2 -0
- package/src/src/agent/react/use-chat/streaming/handler.ts +66 -5
- package/src/src/agent/react/use-chat/streaming/parts-builder.ts +18 -1
- package/src/src/agent/react/use-chat/streaming/types.ts +6 -0
- package/src/src/agent/react/use-chat/types.ts +26 -1
- package/src/src/agent/react/use-chat/use-chat.ts +245 -36
- package/src/src/agent/runtime/index.ts +213 -35
- package/src/src/agent/runtime/tool-helpers.ts +9 -0
- package/src/src/agent/types.ts +10 -0
- package/src/src/ai/registry-manager.ts +2 -1
- package/src/src/build/bundler/code-splitter/manifest-builder.ts +1 -1
- package/src/src/build/compiler/mdx-compiler/validator.ts +3 -7
- package/src/src/build/compiler/mdx-to-js.ts +0 -101
- package/src/src/build/index.ts +0 -8
- package/src/src/build/production-build/build/route-collector.ts +2 -4
- package/src/src/build/production-build/client-runtime.ts +21 -5
- package/src/src/build/production-build/templates.ts +9 -18
- package/src/src/build/vendor-cache.ts +0 -6
- package/src/src/cache/tokenizing-gateway.ts +1 -9
- package/src/src/chat/index.ts +169 -34
- package/src/src/config/define-config.ts +30 -29
- package/src/src/config/loader.ts +10 -9
- package/src/src/config/schemas/config.schema.ts +12 -0
- package/src/src/data/data-fetcher.ts +15 -21
- package/src/src/data/server-data-fetcher.ts +1 -8
- package/src/src/data/static-data-fetcher.ts +1 -6
- package/src/src/discovery/discovery-engine.ts +27 -0
- package/src/src/discovery/discovery-utils.ts +0 -7
- package/src/src/discovery/file-discovery.ts +3 -9
- package/src/src/discovery/handlers/index.ts +1 -0
- package/src/src/discovery/handlers/skill-handler.ts +123 -0
- package/src/src/discovery/handlers/task-handler.ts +1 -5
- package/src/src/discovery/transpiler.ts +7 -2
- package/src/src/discovery/types.ts +3 -0
- package/src/src/embedding/chunk.ts +60 -0
- package/src/src/embedding/embedding.ts +62 -0
- package/src/src/embedding/index.ts +49 -0
- package/src/src/embedding/react/use-uploads.ts +101 -0
- package/src/src/embedding/resolve.ts +126 -0
- package/src/src/embedding/types.ts +103 -0
- package/src/src/embedding/upload-handler.ts +180 -0
- package/src/src/embedding/upload-loader.ts +76 -0
- package/src/src/embedding/upload-store.ts +299 -0
- package/src/src/embedding/vector-store.ts +282 -0
- package/src/src/errors/error-registry.ts +2 -2
- package/src/src/errors/http-error.ts +7 -3
- package/src/src/errors/middleware/cli-error-boundary.ts +28 -2
- package/src/src/errors/middleware/wrap-unknown.ts +0 -10
- package/src/src/errors/veryfront-error.ts +0 -9
- package/src/src/html/styles-builder/css-hash-cache.ts +5 -2
- package/src/src/html/styles-builder/plugin-loader.ts +58 -21
- package/src/src/html/styles-builder/tailwind-compiler-cache.ts +11 -4
- package/src/src/html/utils.ts +0 -33
- package/src/src/modules/component-registry/registry.ts +0 -3
- package/src/src/modules/import-map/default-import-map.ts +10 -0
- package/src/src/modules/react-loader/component-loader.ts +1 -0
- package/src/src/modules/react-loader/ssr-module-loader/loader.ts +12 -1
- package/src/src/modules/react-loader/ssr-module-loader/types.ts +2 -0
- package/src/src/modules/react-loader/types.ts +2 -0
- package/src/src/modules/server/module-server.ts +4 -1
- package/src/src/modules/server/websocket-handler.ts +1 -1
- package/src/src/oauth/handlers/callback-handler.ts +17 -5
- package/src/src/oauth/providers/base.ts +3 -3
- package/src/src/oauth/providers/common.ts +0 -23
- package/src/src/observability/auto-instrument/react-instrumentation.ts +2 -2
- package/src/src/observability/instruments/instruments-factory.ts +6 -6
- package/src/src/observability/metrics/config.ts +5 -5
- package/src/src/observability/metrics/manager.ts +1 -1
- package/src/src/observability/tracing/span-operations.ts +14 -9
- package/src/src/platform/compat/console/node.ts +4 -14
- package/src/src/platform/compat/fs.ts +14 -3
- package/src/src/platform/compat/opaque-deps.ts +32 -2
- package/src/src/platform/compat/path/basic-operations.ts +19 -10
- package/src/src/platform/compat/path/resolution.ts +69 -18
- package/src/src/platform/compat/path/url-conversion.ts +10 -6
- package/src/src/platform/compat/process.ts +133 -76
- package/src/src/provider/index.ts +1 -0
- package/src/src/provider/local/ai-sdk-adapter.ts +40 -37
- package/src/src/provider/local/env.ts +4 -1
- package/src/src/provider/local/local-embedding-adapter.ts +37 -0
- package/src/src/provider/local/local-embedding-engine.ts +88 -0
- package/src/src/provider/local/local-engine.ts +1 -1
- package/src/src/provider/local/model-catalog.ts +67 -1
- package/src/src/provider/model-registry.ts +47 -0
- package/src/src/proxy/retry.ts +0 -9
- package/src/src/proxy/tracing.ts +1 -9
- package/src/src/react/components/ai/agent-card.tsx +13 -13
- package/src/src/react/components/ai/chat/components/animations.tsx +31 -1
- package/src/src/react/components/ai/chat/components/attachment-pill.tsx +110 -0
- package/src/src/react/components/ai/chat/components/branch-picker.tsx +70 -0
- package/src/src/react/components/ai/chat/components/code-block.tsx +82 -0
- package/src/src/react/components/ai/chat/components/drop-zone.tsx +49 -0
- package/src/src/react/components/ai/chat/components/empty-state.tsx +20 -8
- package/src/src/react/components/ai/chat/components/inference-badge.tsx +1 -1
- package/src/src/react/components/ai/chat/components/inline-citation.tsx +150 -0
- package/src/src/react/components/ai/chat/components/message-actions.tsx +73 -51
- package/src/src/react/components/ai/chat/components/message-edit-form.tsx +95 -0
- package/src/src/react/components/ai/chat/components/message-feedback.tsx +72 -0
- package/src/src/react/components/ai/chat/components/quick-actions.tsx +38 -0
- package/src/src/react/components/ai/chat/components/reasoning.tsx +40 -35
- package/src/src/react/components/ai/chat/components/sidebar.tsx +204 -0
- package/src/src/react/components/ai/chat/components/skill-badge.tsx +51 -0
- package/src/src/react/components/ai/chat/components/sources.tsx +99 -0
- package/src/src/react/components/ai/chat/components/step-indicator.tsx +33 -0
- package/src/src/react/components/ai/chat/components/tab-switcher.tsx +69 -0
- package/src/src/react/components/ai/chat/components/tool-ui.tsx +31 -29
- package/src/src/react/components/ai/chat/components/upgrade-cta.tsx +3 -4
- package/src/src/react/components/ai/chat/components/uploads-panel.tsx +129 -0
- package/src/src/react/components/ai/chat/composition/api.tsx +12 -62
- package/src/src/react/components/ai/chat/composition/chat-composer.tsx +205 -0
- package/src/src/react/components/ai/chat/composition/chat-empty.tsx +77 -0
- package/src/src/react/components/ai/chat/composition/chat-if.tsx +25 -0
- package/src/src/react/components/ai/chat/composition/chat-message-list.tsx +356 -0
- package/src/src/react/components/ai/chat/composition/chat-root.tsx +181 -0
- package/src/src/react/components/ai/chat/composition/error-banner.tsx +38 -0
- package/src/src/react/components/ai/chat/composition/message.tsx +337 -0
- package/src/src/react/components/ai/chat/composition/model-avatar.tsx +103 -0
- package/src/src/react/components/ai/chat/contexts/chat-context.tsx +78 -0
- package/src/src/react/components/ai/chat/contexts/composer-context.tsx +59 -0
- package/src/src/react/components/ai/chat/contexts/index.ts +36 -0
- package/src/src/react/components/ai/chat/contexts/message-context.tsx +49 -0
- package/src/src/react/components/ai/chat/contexts/thread-list-context.tsx +40 -0
- package/src/src/react/components/ai/chat/hooks/use-threads.ts +208 -0
- package/src/src/react/components/ai/chat/index.tsx +389 -230
- package/src/src/react/components/ai/chat/utils/export.ts +77 -0
- package/src/src/react/components/ai/chat/utils/message-parts.ts +63 -1
- package/src/src/react/components/ai/chat-with-sidebar.tsx +371 -0
- package/src/src/react/components/ai/chat.tsx +122 -7
- package/src/src/react/components/ai/error-boundary.tsx +6 -6
- package/src/src/react/components/ai/icons/index.ts +100 -0
- package/src/src/react/components/ai/markdown.tsx +12 -15
- package/src/src/react/components/ai/model-selector.tsx +223 -15
- package/src/src/react/components/ai/theme.ts +205 -39
- package/src/src/react/primitives/input-box.tsx +27 -4
- package/src/src/rendering/cache/index.ts +12 -5
- package/src/src/rendering/component-handling.ts +9 -9
- package/src/src/rendering/orchestrator/pipeline.ts +12 -2
- package/src/src/rendering/page-renderer.ts +1 -0
- package/src/src/rendering/renderer.ts +1 -1
- package/src/src/rendering/shared/context-aware-cache.ts +0 -5
- package/src/src/repositories/schemas/index.ts +0 -2
- package/src/src/repositories/schemas/repository.schema.ts +0 -15
- package/src/src/repositories/types.ts +1 -6
- package/src/src/routing/api/module-loader/esbuild-plugin.ts +11 -25
- package/src/src/routing/api/module-loader/loader.ts +421 -17
- package/src/src/routing/api/openapi/path-utils.ts +0 -39
- package/src/src/routing/api/openapi/spec-generator.ts +1 -20
- package/src/src/routing/api/openapi/types.ts +20 -0
- package/src/src/sandbox/sandbox.ts +8 -8
- package/src/src/security/http/cors/constants.ts +0 -4
- package/src/src/security/http/response/index.ts +3 -9
- package/src/src/server/context/enriched-context.ts +1 -19
- package/src/src/server/dev-server/server.ts +11 -4
- package/src/src/server/dev-ui/manifest.js +20 -20
- package/src/src/server/handlers/dev/framework-candidates.generated.ts +5188 -0
- package/src/src/server/handlers/dev/styles-candidate-scanner.ts +3 -191
- package/src/src/server/handlers/request/module/module-server-handler.ts +1 -0
- package/src/src/server/runtime-handler/index.ts +17 -28
- package/src/src/server/shared/renderer/memory/pressure.ts +2 -15
- package/src/src/server/utils/domain-lookup.ts +0 -4
- package/src/src/skill/allowed-tools.ts +107 -0
- package/src/src/skill/executor.ts +215 -0
- package/src/src/skill/index.ts +60 -0
- package/src/src/skill/parser.ts +214 -0
- package/src/src/skill/path-safety.ts +203 -0
- package/src/src/skill/prompt-augmentation.ts +48 -0
- package/src/src/skill/registry.ts +51 -0
- package/src/src/skill/tools.ts +197 -0
- package/src/src/skill/types.ts +107 -0
- package/src/src/studio/bridge/bridge-bundle.generated.ts +1 -1
- package/src/src/studio/element-selector-injector.ts +0 -2
- package/src/src/task/runner.ts +10 -8
- package/src/src/tool/factory.ts +54 -54
- package/src/src/transforms/esm/http-cache-helpers.ts +0 -20
- package/src/src/transforms/esm/path-resolver.ts +1 -140
- package/src/src/transforms/esm/source-url-embed.ts +0 -53
- package/src/src/transforms/esm/transform-cache.ts +3 -7
- package/src/src/transforms/mdx/index.ts +0 -5
- package/src/src/transforms/pipeline/context.ts +0 -2
- package/src/src/transforms/pipeline/index.ts +0 -4
- package/src/src/transforms/pipeline/stages/ssr-http-cache.ts +0 -1
- package/src/src/transforms/plugins/rehype-node-positions.ts +1 -0
- package/src/src/types/entities/getEntityInfo.ts +1 -1
- package/src/src/types/index.ts +1 -20
- package/src/src/types/server.ts +1 -1
- package/src/src/utils/cache-file-ops.ts +5 -5
- package/src/src/utils/logger/logger.ts +2 -2
- package/src/src/utils/lru-wrapper.ts +2 -8
- package/src/src/workflow/claude-code/event-publisher.ts +13 -4
- package/src/src/workflow/executor/workflow-executor.ts +7 -2
- package/src/src/workflow/react/use-workflow-list.ts +3 -2
- package/esm/src/transforms/mdx/parser.d.ts +0 -4
- package/esm/src/transforms/mdx/parser.d.ts.map +0 -1
- package/esm/src/transforms/mdx/parser.js +0 -49
- package/src/src/transforms/mdx/parser.ts +0 -65
|
@@ -0,0 +1,244 @@
|
|
|
1
|
+
import * as dntShim from "../../_dnt.shims.js";
|
|
2
|
+
import { cosineSimilarity } from "ai";
|
|
3
|
+
import { isNotFoundError, mkdir, readDir, readTextFile, writeTextFile, } from "../platform/compat/fs.js";
|
|
4
|
+
import { dirname, extname, join } from "../platform/compat/path/basic-operations.js";
|
|
5
|
+
import { embedding } from "./embedding.js";
|
|
6
|
+
import { chunk } from "./chunk.js";
|
|
7
|
+
/**
|
|
8
|
+
* Creates a persistent upload store with lazy embedding and similarity search.
|
|
9
|
+
*
|
|
10
|
+
* Combines upload management, chunking, embedding, and vector search into
|
|
11
|
+
* a single factory. Uploads are chunked on ingest; embeddings are generated
|
|
12
|
+
* lazily on the first search call to avoid blocking uploads on AI API calls.
|
|
13
|
+
*
|
|
14
|
+
* Persistence is JSON-file-based (via the platform fs adapter), making it
|
|
15
|
+
* suitable for prototypes, templates, and small-to-medium knowledge bases.
|
|
16
|
+
*
|
|
17
|
+
* @example
|
|
18
|
+
* ```ts
|
|
19
|
+
* import { uploadStore } from "veryfront/embedding";
|
|
20
|
+
*
|
|
21
|
+
* const store = uploadStore({
|
|
22
|
+
* model: "openai/text-embedding-3-small",
|
|
23
|
+
* storagePath: "data/index.json",
|
|
24
|
+
* contentDir: "content",
|
|
25
|
+
* });
|
|
26
|
+
*
|
|
27
|
+
* await store.ingest("My Doc", text, { source: "upload:file.pdf", type: "pdf" });
|
|
28
|
+
* const results = await store.search("query", { topK: 5, threshold: 0.7 });
|
|
29
|
+
* ```
|
|
30
|
+
*/
|
|
31
|
+
export function uploadStore(config) {
|
|
32
|
+
const storagePath = config.storagePath ?? "data/index.json";
|
|
33
|
+
const contentDir = config.contentDir;
|
|
34
|
+
const contentExtensions = new Set(config.contentExtensions ?? [".md", ".mdx", ".txt"]);
|
|
35
|
+
const chunkOptions = config.chunkOptions;
|
|
36
|
+
const MAX_TEXT_LENGTH = 5 * 1024 * 1024; // 5 MB text limit per document
|
|
37
|
+
// Serialize all load→modify→save operations to prevent concurrent overwrites.
|
|
38
|
+
let mutex = Promise.resolve();
|
|
39
|
+
function withLock(fn) {
|
|
40
|
+
const result = mutex.then(fn);
|
|
41
|
+
mutex = result.then(() => { }, (err) => {
|
|
42
|
+
console.error("[upload-store] Lock operation failed:", err);
|
|
43
|
+
});
|
|
44
|
+
return result;
|
|
45
|
+
}
|
|
46
|
+
const embedder = embedding({
|
|
47
|
+
model: config.model,
|
|
48
|
+
documentPrefix: config.documentPrefix,
|
|
49
|
+
queryPrefix: config.queryPrefix,
|
|
50
|
+
batchSize: config.batchSize,
|
|
51
|
+
});
|
|
52
|
+
async function load() {
|
|
53
|
+
try {
|
|
54
|
+
const data = await readTextFile(storagePath);
|
|
55
|
+
const parsed = JSON.parse(data);
|
|
56
|
+
if (!parsed || !Array.isArray(parsed.uploads) || !Array.isArray(parsed.chunks)) {
|
|
57
|
+
console.warn("[upload-store] Corrupted store file, resetting:", storagePath);
|
|
58
|
+
return { uploads: [], chunks: [] };
|
|
59
|
+
}
|
|
60
|
+
return parsed;
|
|
61
|
+
}
|
|
62
|
+
catch (err) {
|
|
63
|
+
// File not found is expected on first run; anything else is worth logging
|
|
64
|
+
if (isNotFoundError(err)) {
|
|
65
|
+
return { uploads: [], chunks: [] };
|
|
66
|
+
}
|
|
67
|
+
console.warn("[upload-store] Failed to load store, resetting:", err);
|
|
68
|
+
return { uploads: [], chunks: [] };
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
async function save(data) {
|
|
72
|
+
const dir = dirname(storagePath);
|
|
73
|
+
if (dir && dir !== ".") {
|
|
74
|
+
await mkdir(dir, { recursive: true });
|
|
75
|
+
}
|
|
76
|
+
const payload = JSON.stringify(data, null, 2);
|
|
77
|
+
// Atomic write: write to temp file then rename to prevent corruption on crash
|
|
78
|
+
const tmpPath = storagePath + ".tmp";
|
|
79
|
+
await writeTextFile(tmpPath, payload);
|
|
80
|
+
try {
|
|
81
|
+
if (typeof dntShim.Deno !== "undefined") {
|
|
82
|
+
await dntShim.Deno.rename(tmpPath, storagePath);
|
|
83
|
+
}
|
|
84
|
+
else {
|
|
85
|
+
const fs = await import("node:fs/promises");
|
|
86
|
+
await fs.rename(tmpPath, storagePath);
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
catch {
|
|
90
|
+
// Fallback for environments where rename isn't available
|
|
91
|
+
await writeTextFile(storagePath, payload);
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
async function ensureEmbeddings(data) {
|
|
95
|
+
const unembedded = data.chunks.filter((c) => c.embedding.length === 0);
|
|
96
|
+
if (unembedded.length === 0)
|
|
97
|
+
return false;
|
|
98
|
+
const embeddings = await embedder.embedMany(unembedded.map((c) => c.text));
|
|
99
|
+
for (let i = 0; i < unembedded.length; i++) {
|
|
100
|
+
unembedded[i].embedding = embeddings[i];
|
|
101
|
+
}
|
|
102
|
+
return true;
|
|
103
|
+
}
|
|
104
|
+
async function listContentFiles(dir) {
|
|
105
|
+
const files = [];
|
|
106
|
+
try {
|
|
107
|
+
for await (const entry of readDir(dir)) {
|
|
108
|
+
const fullPath = join(dir, entry.name);
|
|
109
|
+
if (entry.isDirectory) {
|
|
110
|
+
files.push(...(await listContentFiles(fullPath)));
|
|
111
|
+
}
|
|
112
|
+
else if (entry.isFile && contentExtensions.has(extname(entry.name))) {
|
|
113
|
+
files.push(fullPath);
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
catch {
|
|
118
|
+
// directory may not exist yet
|
|
119
|
+
}
|
|
120
|
+
return files;
|
|
121
|
+
}
|
|
122
|
+
return {
|
|
123
|
+
async ingest(title, text, meta) {
|
|
124
|
+
return withLock(async () => {
|
|
125
|
+
const data = await load();
|
|
126
|
+
const uploadId = dntShim.crypto.randomUUID();
|
|
127
|
+
if (text.length > MAX_TEXT_LENGTH) {
|
|
128
|
+
throw new Error(`Upload text exceeds ${MAX_TEXT_LENGTH / 1024 / 1024} MB limit`);
|
|
129
|
+
}
|
|
130
|
+
const chunks = await chunk(text, chunkOptions);
|
|
131
|
+
if (chunks.length === 0) {
|
|
132
|
+
throw new Error("Upload contains no extractable text");
|
|
133
|
+
}
|
|
134
|
+
const doc = {
|
|
135
|
+
id: uploadId,
|
|
136
|
+
title,
|
|
137
|
+
source: meta?.source ?? "",
|
|
138
|
+
type: meta?.type ?? "",
|
|
139
|
+
createdAt: Date.now(),
|
|
140
|
+
};
|
|
141
|
+
const chunkRecords = chunks.map((chunkText, i) => ({
|
|
142
|
+
id: dntShim.crypto.randomUUID(),
|
|
143
|
+
uploadId,
|
|
144
|
+
text: chunkText,
|
|
145
|
+
embedding: [], // filled lazily on first search
|
|
146
|
+
index: i,
|
|
147
|
+
}));
|
|
148
|
+
data.uploads.push(doc);
|
|
149
|
+
data.chunks.push(...chunkRecords);
|
|
150
|
+
await save(data);
|
|
151
|
+
return uploadId;
|
|
152
|
+
});
|
|
153
|
+
},
|
|
154
|
+
async search(query, options) {
|
|
155
|
+
return withLock(async () => {
|
|
156
|
+
const data = await load();
|
|
157
|
+
if (data.chunks.length === 0)
|
|
158
|
+
return [];
|
|
159
|
+
const updated = await ensureEmbeddings(data);
|
|
160
|
+
if (updated)
|
|
161
|
+
await save(data);
|
|
162
|
+
const queryEmbedding = await embedder.embed(query);
|
|
163
|
+
const topK = options?.topK ?? 5;
|
|
164
|
+
const threshold = options?.threshold;
|
|
165
|
+
const docMap = new Map(data.uploads.map((d) => [d.id, d]));
|
|
166
|
+
const scored = data.chunks.map((c) => {
|
|
167
|
+
const doc = docMap.get(c.uploadId);
|
|
168
|
+
return {
|
|
169
|
+
text: c.text,
|
|
170
|
+
score: cosineSimilarity(queryEmbedding, c.embedding),
|
|
171
|
+
uploadId: c.uploadId,
|
|
172
|
+
title: doc?.title ?? "Unknown",
|
|
173
|
+
source: doc?.source ?? "",
|
|
174
|
+
type: doc?.type ?? "",
|
|
175
|
+
};
|
|
176
|
+
});
|
|
177
|
+
scored.sort((a, b) => b.score - a.score);
|
|
178
|
+
let results = scored.slice(0, topK);
|
|
179
|
+
if (threshold !== undefined) {
|
|
180
|
+
results = results.filter((r) => r.score >= threshold);
|
|
181
|
+
}
|
|
182
|
+
return results;
|
|
183
|
+
});
|
|
184
|
+
},
|
|
185
|
+
async listUploads() {
|
|
186
|
+
return withLock(async () => {
|
|
187
|
+
const data = await load();
|
|
188
|
+
return data.uploads;
|
|
189
|
+
});
|
|
190
|
+
},
|
|
191
|
+
async removeUpload(id) {
|
|
192
|
+
return withLock(async () => {
|
|
193
|
+
const data = await load();
|
|
194
|
+
data.uploads = data.uploads.filter((d) => d.id !== id);
|
|
195
|
+
data.chunks = data.chunks.filter((c) => c.uploadId !== id);
|
|
196
|
+
await save(data);
|
|
197
|
+
});
|
|
198
|
+
},
|
|
199
|
+
async indexContentDir() {
|
|
200
|
+
if (!contentDir)
|
|
201
|
+
return;
|
|
202
|
+
return withLock(async () => {
|
|
203
|
+
const data = await load();
|
|
204
|
+
const indexedSources = new Set(data.uploads.map((d) => d.source));
|
|
205
|
+
const files = await listContentFiles(contentDir);
|
|
206
|
+
const newFiles = files.filter((f) => !indexedSources.has(f));
|
|
207
|
+
if (newFiles.length === 0)
|
|
208
|
+
return;
|
|
209
|
+
for (const file of newFiles) {
|
|
210
|
+
const content = await readTextFile(file);
|
|
211
|
+
if (!content?.trim())
|
|
212
|
+
continue;
|
|
213
|
+
if (content.length > MAX_TEXT_LENGTH) {
|
|
214
|
+
console.warn(`[upload-store] Skipping ${file}: exceeds ${MAX_TEXT_LENGTH / 1024 / 1024} MB text limit`);
|
|
215
|
+
continue;
|
|
216
|
+
}
|
|
217
|
+
const title = file.startsWith(contentDir + "/")
|
|
218
|
+
? file.slice(contentDir.length + 1).replace(/\.[^.]+$/, "")
|
|
219
|
+
: file.replace(/\.[^.]+$/, "");
|
|
220
|
+
const uploadId = dntShim.crypto.randomUUID();
|
|
221
|
+
const type = extname(file).slice(1);
|
|
222
|
+
const chunks = await chunk(content, chunkOptions);
|
|
223
|
+
if (chunks.length === 0)
|
|
224
|
+
continue;
|
|
225
|
+
data.uploads.push({
|
|
226
|
+
id: uploadId,
|
|
227
|
+
title,
|
|
228
|
+
source: file,
|
|
229
|
+
type,
|
|
230
|
+
createdAt: Date.now(),
|
|
231
|
+
});
|
|
232
|
+
data.chunks.push(...chunks.map((chunkText, i) => ({
|
|
233
|
+
id: dntShim.crypto.randomUUID(),
|
|
234
|
+
uploadId,
|
|
235
|
+
text: chunkText,
|
|
236
|
+
embedding: [],
|
|
237
|
+
index: i,
|
|
238
|
+
})));
|
|
239
|
+
}
|
|
240
|
+
await save(data);
|
|
241
|
+
});
|
|
242
|
+
},
|
|
243
|
+
};
|
|
244
|
+
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import type { VectorStore, VectorStoreConfig } from "./types.js";
|
|
2
|
+
/**
|
|
3
|
+
* Creates an in-memory vector store with integrated embedding and similarity search.
|
|
4
|
+
*
|
|
5
|
+
* Supports three search strategies:
|
|
6
|
+
* - `"dense"` (default) — cosine similarity ranking
|
|
7
|
+
* - `"mmr"` — Maximum Marginal Relevance for diverse results
|
|
8
|
+
* - `"hybrid"` — BM25 + dense fusion via Reciprocal Rank Fusion
|
|
9
|
+
*
|
|
10
|
+
* @example
|
|
11
|
+
* ```ts
|
|
12
|
+
* const store = vectorStore({ embedder });
|
|
13
|
+
* await store.add(["chunk 1", "chunk 2"]);
|
|
14
|
+
*
|
|
15
|
+
* // Basic search
|
|
16
|
+
* const results = await store.search("query", { topK: 5 });
|
|
17
|
+
*
|
|
18
|
+
* // With threshold and metadata filtering
|
|
19
|
+
* const filtered = await store.search("query", {
|
|
20
|
+
* topK: 10,
|
|
21
|
+
* threshold: 0.7,
|
|
22
|
+
* filter: { source: "upload" },
|
|
23
|
+
* });
|
|
24
|
+
*
|
|
25
|
+
* // MMR for diverse results
|
|
26
|
+
* const diverse = await store.search("query", { strategy: "mmr", lambda: 0.5 });
|
|
27
|
+
*
|
|
28
|
+
* // Hybrid search (BM25 + dense, fused with RRF)
|
|
29
|
+
* const hybrid = await store.search("query", { strategy: "hybrid" });
|
|
30
|
+
* ```
|
|
31
|
+
*/
|
|
32
|
+
export declare function vectorStore(config: VectorStoreConfig): VectorStore;
|
|
33
|
+
//# sourceMappingURL=vector-store.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"vector-store.d.ts","sourceRoot":"","sources":["../../../src/src/embedding/vector-store.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAIV,WAAW,EACX,iBAAiB,EAClB,MAAM,YAAY,CAAC;AAQpB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AACH,wBAAgB,WAAW,CAAC,MAAM,EAAE,iBAAiB,GAAG,WAAW,CA6DlE"}
|
|
@@ -0,0 +1,215 @@
|
|
|
1
|
+
import { cosineSimilarity } from "ai";
|
|
2
|
+
/**
|
|
3
|
+
* Creates an in-memory vector store with integrated embedding and similarity search.
|
|
4
|
+
*
|
|
5
|
+
* Supports three search strategies:
|
|
6
|
+
* - `"dense"` (default) — cosine similarity ranking
|
|
7
|
+
* - `"mmr"` — Maximum Marginal Relevance for diverse results
|
|
8
|
+
* - `"hybrid"` — BM25 + dense fusion via Reciprocal Rank Fusion
|
|
9
|
+
*
|
|
10
|
+
* @example
|
|
11
|
+
* ```ts
|
|
12
|
+
* const store = vectorStore({ embedder });
|
|
13
|
+
* await store.add(["chunk 1", "chunk 2"]);
|
|
14
|
+
*
|
|
15
|
+
* // Basic search
|
|
16
|
+
* const results = await store.search("query", { topK: 5 });
|
|
17
|
+
*
|
|
18
|
+
* // With threshold and metadata filtering
|
|
19
|
+
* const filtered = await store.search("query", {
|
|
20
|
+
* topK: 10,
|
|
21
|
+
* threshold: 0.7,
|
|
22
|
+
* filter: { source: "upload" },
|
|
23
|
+
* });
|
|
24
|
+
*
|
|
25
|
+
* // MMR for diverse results
|
|
26
|
+
* const diverse = await store.search("query", { strategy: "mmr", lambda: 0.5 });
|
|
27
|
+
*
|
|
28
|
+
* // Hybrid search (BM25 + dense, fused with RRF)
|
|
29
|
+
* const hybrid = await store.search("query", { strategy: "hybrid" });
|
|
30
|
+
* ```
|
|
31
|
+
*/
|
|
32
|
+
export function vectorStore(config) {
|
|
33
|
+
const embedder = config.embedder;
|
|
34
|
+
const entries = [];
|
|
35
|
+
return {
|
|
36
|
+
async add(texts, metadata) {
|
|
37
|
+
const embeddings = await embedder.embedMany(texts);
|
|
38
|
+
for (let i = 0; i < texts.length; i++) {
|
|
39
|
+
entries.push({
|
|
40
|
+
text: texts[i],
|
|
41
|
+
vector: embeddings[i],
|
|
42
|
+
metadata: metadata?.[i],
|
|
43
|
+
});
|
|
44
|
+
}
|
|
45
|
+
},
|
|
46
|
+
async search(query, options) {
|
|
47
|
+
if (entries.length === 0)
|
|
48
|
+
return [];
|
|
49
|
+
const topK = options?.topK ?? 5;
|
|
50
|
+
const threshold = options?.threshold;
|
|
51
|
+
const filter = options?.filter;
|
|
52
|
+
const strategy = options?.strategy ?? "dense";
|
|
53
|
+
// Filter entries by metadata
|
|
54
|
+
const candidates = filter
|
|
55
|
+
? entries.filter((e) => matchesFilter(e.metadata, filter))
|
|
56
|
+
: entries;
|
|
57
|
+
if (candidates.length === 0)
|
|
58
|
+
return [];
|
|
59
|
+
const queryEmbedding = await embedder.embed(query);
|
|
60
|
+
let results;
|
|
61
|
+
switch (strategy) {
|
|
62
|
+
case "mmr":
|
|
63
|
+
results = searchMMR(queryEmbedding, candidates, topK, options?.lambda ?? 0.5);
|
|
64
|
+
break;
|
|
65
|
+
case "hybrid":
|
|
66
|
+
results = searchHybrid(query, queryEmbedding, candidates, topK);
|
|
67
|
+
break;
|
|
68
|
+
default:
|
|
69
|
+
results = searchDense(queryEmbedding, candidates, topK);
|
|
70
|
+
}
|
|
71
|
+
// Apply score threshold
|
|
72
|
+
if (threshold !== undefined) {
|
|
73
|
+
results = results.filter((r) => r.score >= threshold);
|
|
74
|
+
}
|
|
75
|
+
return results;
|
|
76
|
+
},
|
|
77
|
+
clear() {
|
|
78
|
+
entries.length = 0;
|
|
79
|
+
},
|
|
80
|
+
get size() {
|
|
81
|
+
return entries.length;
|
|
82
|
+
},
|
|
83
|
+
};
|
|
84
|
+
}
|
|
85
|
+
// --- Dense search (cosine similarity) ---
|
|
86
|
+
function searchDense(queryVector, candidates, topK) {
|
|
87
|
+
const scored = candidates.map((e) => ({
|
|
88
|
+
text: e.text,
|
|
89
|
+
score: cosineSimilarity(queryVector, e.vector),
|
|
90
|
+
metadata: e.metadata,
|
|
91
|
+
}));
|
|
92
|
+
scored.sort((a, b) => b.score - a.score);
|
|
93
|
+
return scored.slice(0, topK);
|
|
94
|
+
}
|
|
95
|
+
// --- MMR (Maximum Marginal Relevance) ---
|
|
96
|
+
function searchMMR(queryVector, candidates, topK, lambda) {
|
|
97
|
+
// Score all candidates against query
|
|
98
|
+
const scored = candidates.map((e, i) => ({
|
|
99
|
+
index: i,
|
|
100
|
+
text: e.text,
|
|
101
|
+
vector: e.vector,
|
|
102
|
+
relevance: cosineSimilarity(queryVector, e.vector),
|
|
103
|
+
metadata: e.metadata,
|
|
104
|
+
}));
|
|
105
|
+
const selected = [];
|
|
106
|
+
const selectedVectors = [];
|
|
107
|
+
const remaining = new Set(scored.map((_, i) => i));
|
|
108
|
+
for (let k = 0; k < Math.min(topK, scored.length); k++) {
|
|
109
|
+
let bestIdx = -1;
|
|
110
|
+
let bestScore = -Infinity;
|
|
111
|
+
for (const i of remaining) {
|
|
112
|
+
const candidate = scored[i];
|
|
113
|
+
const relevance = candidate.relevance;
|
|
114
|
+
// Max similarity to any already-selected document
|
|
115
|
+
let maxSim = 0;
|
|
116
|
+
for (const sv of selectedVectors) {
|
|
117
|
+
const sim = cosineSimilarity(candidate.vector, sv);
|
|
118
|
+
if (sim > maxSim)
|
|
119
|
+
maxSim = sim;
|
|
120
|
+
}
|
|
121
|
+
const mmrScore = lambda * relevance - (1 - lambda) * maxSim;
|
|
122
|
+
if (mmrScore > bestScore) {
|
|
123
|
+
bestScore = mmrScore;
|
|
124
|
+
bestIdx = i;
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
if (bestIdx === -1)
|
|
128
|
+
break;
|
|
129
|
+
const winner = scored[bestIdx];
|
|
130
|
+
remaining.delete(bestIdx);
|
|
131
|
+
selectedVectors.push(winner.vector);
|
|
132
|
+
selected.push({
|
|
133
|
+
text: winner.text,
|
|
134
|
+
score: winner.relevance, // return the actual relevance score, not MMR score
|
|
135
|
+
metadata: winner.metadata,
|
|
136
|
+
});
|
|
137
|
+
}
|
|
138
|
+
return selected;
|
|
139
|
+
}
|
|
140
|
+
// --- Hybrid search (BM25 + dense, fused with RRF) ---
|
|
141
|
+
const RRF_K = 60; // standard RRF constant
|
|
142
|
+
const BM25_K1 = 1.2;
|
|
143
|
+
const BM25_B = 0.75;
|
|
144
|
+
function searchHybrid(query, queryVector, candidates, topK) {
|
|
145
|
+
// Dense ranking
|
|
146
|
+
const denseScores = candidates.map((e, i) => ({
|
|
147
|
+
index: i,
|
|
148
|
+
score: cosineSimilarity(queryVector, e.vector),
|
|
149
|
+
}));
|
|
150
|
+
denseScores.sort((a, b) => b.score - a.score);
|
|
151
|
+
// BM25 ranking
|
|
152
|
+
const bm25Scores = computeBM25(query, candidates);
|
|
153
|
+
bm25Scores.sort((a, b) => b.score - a.score);
|
|
154
|
+
// Build rank maps (index → rank, 0-based)
|
|
155
|
+
const denseRank = new Map();
|
|
156
|
+
for (let r = 0; r < denseScores.length; r++) {
|
|
157
|
+
denseRank.set(denseScores[r].index, r);
|
|
158
|
+
}
|
|
159
|
+
const bm25Rank = new Map();
|
|
160
|
+
for (let r = 0; r < bm25Scores.length; r++) {
|
|
161
|
+
bm25Rank.set(bm25Scores[r].index, r);
|
|
162
|
+
}
|
|
163
|
+
// Reciprocal Rank Fusion
|
|
164
|
+
const fused = candidates.map((e, i) => {
|
|
165
|
+
const dr = denseRank.get(i) ?? candidates.length;
|
|
166
|
+
const br = bm25Rank.get(i) ?? candidates.length;
|
|
167
|
+
const rrfScore = 1 / (RRF_K + dr) + 1 / (RRF_K + br);
|
|
168
|
+
return { text: e.text, score: rrfScore, metadata: e.metadata };
|
|
169
|
+
});
|
|
170
|
+
fused.sort((a, b) => b.score - a.score);
|
|
171
|
+
return fused.slice(0, topK);
|
|
172
|
+
}
|
|
173
|
+
function computeBM25(query, candidates) {
|
|
174
|
+
const queryTerms = tokenize(query);
|
|
175
|
+
if (queryTerms.length === 0) {
|
|
176
|
+
return candidates.map((_, i) => ({ index: i, score: 0 }));
|
|
177
|
+
}
|
|
178
|
+
const N = candidates.length;
|
|
179
|
+
const docTokens = candidates.map((e) => tokenize(e.text));
|
|
180
|
+
const totalTokens = docTokens.reduce((sum, t) => sum + t.length, 0);
|
|
181
|
+
const avgDl = totalTokens === 0 ? 1 : totalTokens / N;
|
|
182
|
+
// Document frequency per query term
|
|
183
|
+
const df = new Map();
|
|
184
|
+
for (const term of queryTerms) {
|
|
185
|
+
if (df.has(term))
|
|
186
|
+
continue;
|
|
187
|
+
let count = 0;
|
|
188
|
+
for (const tokens of docTokens) {
|
|
189
|
+
if (tokens.includes(term))
|
|
190
|
+
count++;
|
|
191
|
+
}
|
|
192
|
+
df.set(term, count);
|
|
193
|
+
}
|
|
194
|
+
return candidates.map((_, i) => {
|
|
195
|
+
const tokens = docTokens[i];
|
|
196
|
+
const dl = tokens.length;
|
|
197
|
+
let score = 0;
|
|
198
|
+
for (const term of queryTerms) {
|
|
199
|
+
const n = df.get(term) ?? 0;
|
|
200
|
+
const idf = Math.log((N - n + 0.5) / (n + 0.5) + 1);
|
|
201
|
+
const tf = tokens.filter((t) => t === term).length;
|
|
202
|
+
score += idf * ((tf * (BM25_K1 + 1)) / (tf + BM25_K1 * (1 - BM25_B + BM25_B * dl / avgDl)));
|
|
203
|
+
}
|
|
204
|
+
return { index: i, score };
|
|
205
|
+
});
|
|
206
|
+
}
|
|
207
|
+
function tokenize(text) {
|
|
208
|
+
return text.toLowerCase().split(/\W+/).filter(Boolean);
|
|
209
|
+
}
|
|
210
|
+
// --- Metadata filtering ---
|
|
211
|
+
function matchesFilter(metadata, filter) {
|
|
212
|
+
if (!metadata)
|
|
213
|
+
return false;
|
|
214
|
+
return Object.entries(filter).every(([key, value]) => metadata[key] === value);
|
|
215
|
+
}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { type ErrorCategory } from "./types.js";
|
|
1
2
|
export declare const CONFIG_NOT_FOUND: import("./types.js").RegisteredError;
|
|
2
3
|
export declare const CONFIG_INVALID: import("./types.js").RegisteredError;
|
|
3
4
|
export declare const CONFIG_PARSE_ERROR: import("./types.js").RegisteredError;
|
|
@@ -174,7 +175,7 @@ export declare function getErrorBySlug(slug: ErrorSlug): import("./types.js").Re
|
|
|
174
175
|
/**
|
|
175
176
|
* Get all errors in a category
|
|
176
177
|
*/
|
|
177
|
-
export declare function getErrorsByCategory(category:
|
|
178
|
+
export declare function getErrorsByCategory(category: ErrorCategory): import("./types.js").RegisteredError[];
|
|
178
179
|
/**
|
|
179
180
|
* Get all registered slugs
|
|
180
181
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"error-registry.d.ts","sourceRoot":"","sources":["../../../src/src/errors/error-registry.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"error-registry.d.ts","sourceRoot":"","sources":["../../../src/src/errors/error-registry.ts"],"names":[],"mappings":"AAAA,OAAO,EAAe,KAAK,aAAa,EAAE,MAAM,YAAY,CAAC;AAM7D,eAAO,MAAM,gBAAgB,sCAM3B,CAAC;AAEH,eAAO,MAAM,cAAc,sCAMzB,CAAC;AAEH,eAAO,MAAM,kBAAkB,sCAM7B,CAAC;AAEH,2EAA2E;AAC3E,eAAO,MAAM,uBAAuB,sCAMlC,CAAC;AAEH,eAAO,MAAM,iBAAiB,sCAM5B,CAAC;AAEH,eAAO,MAAM,kBAAkB,sCAM7B,CAAC;AAEH,eAAO,MAAM,mBAAmB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AAC;AAEH,eAAO,MAAM,kBAAkB,sCAM7B,CAAC;AAEH,eAAO,MAAM,mBAAmB,sCAM9B,CAAC;AAMH,eAAO,MAAM,aAAa,sCAMxB,CAAC;AAEH,eAAO,MAAM,iBAAiB,sCAM5B,CAAC;AAEH,eAAO,MAAM,cAAc,sCAMzB,CAAC;AAEH,eAAO,MAAM,gBAAgB,sCAM3B,CAAC;AAEH,eAAO,MAAM,aAAa,sCAMxB,CAAC;AAEH,eAAO,MAAM,oBAAoB,sCAM/B,CAAC;AAEH,eAAO,MAAM,aAAa,sCAMxB,CAAC;AAEH,qEAAqE;AACrE,eAAO,MAAM,kBAAkB,sCAM7B,CAAC;AAEH,wEAAwE;AACxE,eAAO,MAAM,uBAAuB,sCAMlC,CAAC;AAMH;;GAEG;AACH,eAAO,MAAM,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAmGjB,CAAC;AAEX,MAAM,MAAM,SAAS,GAAG,MAAM,OAAO,cAAc,CAAC;AAEpD;;GAEG;AACH,wBAAgB,cAAc,CAAC,IAAI,EAAE,SAAS,wCAE7C;AAED;;GAEG;AACH,wBAAgB,mBAAmB,CAAC,QAAQ,EAAE,aAAa,0CAE1D;AAED;;GAEG;AACH,wBAAgB,WAAW,IAAI,SAAS,EAAE,CAEzC"}
|
|
@@ -7,8 +7,7 @@
|
|
|
7
7
|
* @see https://datatracker.ietf.org/doc/html/rfc9457
|
|
8
8
|
*/
|
|
9
9
|
import * as dntShim from "../../_dnt.shims.js";
|
|
10
|
-
import { type ErrorCategory, VeryfrontError } from "./types.js";
|
|
11
|
-
import type { RegisteredError } from "./types.js";
|
|
10
|
+
import { type ErrorCategory, type RegisteredError, VeryfrontError } from "./types.js";
|
|
12
11
|
/**
|
|
13
12
|
* Content-Type header for RFC 9457 responses
|
|
14
13
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"http-error.d.ts","sourceRoot":"","sources":["../../../src/src/errors/http-error.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,OAAO,KAAK,OAAO,MAAM,qBAAqB,CAAC;AAG/C,OAAO,
|
|
1
|
+
{"version":3,"file":"http-error.d.ts","sourceRoot":"","sources":["../../../src/src/errors/http-error.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,OAAO,KAAK,OAAO,MAAM,qBAAqB,CAAC;AAG/C,OAAO,EACL,KAAK,aAAa,EAClB,KAAK,eAAe,EAEpB,cAAc,EACf,MAAM,YAAY,CAAC;AAGpB;;GAEG;AACH,eAAO,MAAM,yBAAyB,6BAA6B,CAAC;AAEpE;;GAEG;AACH,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,cAAc,GAAG,OAAO,CAAC,QAAQ,CAS3E;AAED;;GAEG;AACH,wBAAgB,iCAAiC,CAC/C,QAAQ,EAAE,eAAe,EACzB,OAAO,CAAC,EAAE;IACR,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB,GACA,OAAO,CAAC,QAAQ,CAGlB;AAED;;GAEG;AACH,wBAAgB,qBAAqB,CAAC,MAAM,EAAE;IAC5C,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,aAAa,CAAC;IACxB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB,GAAG,OAAO,CAAC,QAAQ,CAkBnB;AAED;;GAEG;AACH,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,cAAc,CAExE;AAED;;;;;GAKG;AACH,wBAAgB,eAAe,CAAC,KAAK,EAAE,OAAO,EAAE,QAAQ,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,QAAQ,CAoBnF;AAED;;;;;;;GAOG;AACH,wBAAgB,kBAAkB,KACxB,OAAO,OAAO,EAAE,GAAG;IAAE,GAAG,EAAE;QAAE,GAAG,EAAE,MAAM,CAAA;KAAE,CAAA;CAAE,KAAG,OAAO,CAAC,QAAQ,CAIvE;AAED;;;;;;;;GAQG;AACH,wBAAgB,cAAc,CAAC,KAAK,EAAE,cAAc,GAAG,MAAM,CAc5D"}
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
* @see https://datatracker.ietf.org/doc/html/rfc9457
|
|
8
8
|
*/
|
|
9
9
|
import * as dntShim from "../../_dnt.shims.js";
|
|
10
|
-
import { VeryfrontError } from "./types.js";
|
|
10
|
+
import { VeryfrontError, } from "./types.js";
|
|
11
11
|
import { getErrorMessage } from "./veryfront-error.js";
|
|
12
12
|
/**
|
|
13
13
|
* Content-Type header for RFC 9457 responses
|
|
@@ -57,7 +57,7 @@ export function createProblemResponse(params) {
|
|
|
57
57
|
* Check if an error is a VeryfrontError with slug-based identity
|
|
58
58
|
*/
|
|
59
59
|
export function isVeryfrontError(error) {
|
|
60
|
-
return error instanceof VeryfrontError
|
|
60
|
+
return error instanceof VeryfrontError;
|
|
61
61
|
}
|
|
62
62
|
/**
|
|
63
63
|
* Convert any error to an RFC 9457 Response
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cli-error-boundary.d.ts","sourceRoot":"","sources":["../../../../src/src/errors/middleware/cli-error-boundary.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"cli-error-boundary.d.ts","sourceRoot":"","sources":["../../../../src/src/errors/middleware/cli-error-boundary.ts"],"names":[],"mappings":"AAmIA;;GAEG;AACH,wBAAgB,cAAc,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,CAgBrD;AAED;;;;;;;;;;;GAWG;AACH,wBAAsB,gBAAgB,CACpC,OAAO,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,GAC3B,OAAO,CAAC,IAAI,CAAC,CAuBf;AAED;;GAEG;AACH,wBAAgB,oBAAoB,CAClC,OAAO,EAAE,MAAM,IAAI,GAClB,IAAI,CAuBN"}
|
|
@@ -18,7 +18,11 @@ import { isProduction } from "../../build/config/environment.js";
|
|
|
18
18
|
* Check if output is a TTY (supports colors)
|
|
19
19
|
*/
|
|
20
20
|
function isTTY() {
|
|
21
|
-
|
|
21
|
+
const deno = dntShim.dntGlobalThis;
|
|
22
|
+
if (typeof deno.Deno?.stdout?.isTerminal === "function") {
|
|
23
|
+
return deno.Deno.stdout.isTerminal();
|
|
24
|
+
}
|
|
25
|
+
return deno.process?.stdout?.isTTY ?? false;
|
|
22
26
|
}
|
|
23
27
|
/**
|
|
24
28
|
* Check if running in development mode
|
|
@@ -166,5 +170,12 @@ export function cliErrorBoundarySync(handler) {
|
|
|
166
170
|
* Exit the process with a status code
|
|
167
171
|
*/
|
|
168
172
|
function exit(code) {
|
|
169
|
-
dntShim.
|
|
173
|
+
const runtime = dntShim.dntGlobalThis;
|
|
174
|
+
if (typeof runtime.Deno?.exit === "function") {
|
|
175
|
+
runtime.Deno.exit(code);
|
|
176
|
+
}
|
|
177
|
+
if (typeof runtime.process?.exit === "function") {
|
|
178
|
+
runtime.process.exit(code);
|
|
179
|
+
}
|
|
180
|
+
throw new Error(`Failed to exit with code ${code}`);
|
|
170
181
|
}
|
|
@@ -29,13 +29,6 @@ import { VeryfrontError } from "../types.js";
|
|
|
29
29
|
* ```
|
|
30
30
|
*/
|
|
31
31
|
export declare function wrapUnknownError(error: unknown, context?: Record<string, unknown>): VeryfrontError;
|
|
32
|
-
/**
|
|
33
|
-
* Check if an error is already a VeryfrontError
|
|
34
|
-
*
|
|
35
|
-
* @param error - Any error value
|
|
36
|
-
* @returns True if the error is a VeryfrontError instance
|
|
37
|
-
*/
|
|
38
|
-
export declare function isVeryfrontError(error: unknown): error is VeryfrontError;
|
|
39
32
|
/**
|
|
40
33
|
* Wrap an error with additional context
|
|
41
34
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"wrap-unknown.d.ts","sourceRoot":"","sources":["../../../../src/src/errors/middleware/wrap-unknown.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAI7C;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wBAAgB,gBAAgB,CAC9B,KAAK,EAAE,OAAO,EACd,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAChC,cAAc,CAkBhB;AAED
|
|
1
|
+
{"version":3,"file":"wrap-unknown.d.ts","sourceRoot":"","sources":["../../../../src/src/errors/middleware/wrap-unknown.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAI7C;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wBAAgB,gBAAgB,CAC9B,KAAK,EAAE,OAAO,EACd,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAChC,cAAc,CAkBhB;AAED;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wBAAgB,eAAe,CAC7B,KAAK,EAAE,OAAO,EACd,OAAO,EAAE,MAAM,EACf,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAChC,cAAc,CAmChB"}
|
|
@@ -46,15 +46,6 @@ export function wrapUnknownError(error, context) {
|
|
|
46
46
|
context: context ? { ...context } : undefined,
|
|
47
47
|
});
|
|
48
48
|
}
|
|
49
|
-
/**
|
|
50
|
-
* Check if an error is already a VeryfrontError
|
|
51
|
-
*
|
|
52
|
-
* @param error - Any error value
|
|
53
|
-
* @returns True if the error is a VeryfrontError instance
|
|
54
|
-
*/
|
|
55
|
-
export function isVeryfrontError(error) {
|
|
56
|
-
return error instanceof VeryfrontError;
|
|
57
|
-
}
|
|
58
49
|
/**
|
|
59
50
|
* Wrap an error with additional context
|
|
60
51
|
*
|
|
@@ -142,9 +142,6 @@ export declare const isNetworkError: (error: VeryfrontErrorData) => error is {
|
|
|
142
142
|
*/
|
|
143
143
|
export declare function toError(veryfrontError: VeryfrontErrorData): Error;
|
|
144
144
|
export declare function fromError(error: unknown): VeryfrontErrorData | null;
|
|
145
|
-
export declare function logError(error: VeryfrontErrorData, logger?: {
|
|
146
|
-
error: (msg: string, ...args: unknown[]) => void;
|
|
147
|
-
}): void;
|
|
148
145
|
/**
|
|
149
146
|
* Extract error message from any error type
|
|
150
147
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"veryfront-error.d.ts","sourceRoot":"","sources":["../../../src/src/errors/veryfront-error.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,YAAY;IAC3B,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,KAAK,CAAC,EACF,OAAO,GACP,WAAW,GACX,QAAQ,GACR,UAAU,GACV,uBAAuB,GACvB,iBAAiB,GACjB,wBAAwB,CAAC;IAC7B,+CAA+C;IAC/C,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,gCAAgC;IAChC,OAAO,CAAC,EAAE,KAAK,CAAC;QAAE,SAAS,EAAE,MAAM,CAAC;QAAC,QAAQ,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IACzE,oCAAoC;IACpC,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC;IAClB,2BAA2B;IAC3B,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,WAAW,UAAU;IACzB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,UAAU,CAAC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