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,77 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Conversation Export Utilities
|
|
3
|
+
* @module ai/react/components/chat/utils/export
|
|
4
|
+
*/
|
|
5
|
+
import * as dntShim from "../../../../../../_dnt.shims.js";
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
import type { UIMessage } from "../../../../../agent/react/index.js";
|
|
9
|
+
import { extractSourcesFromParts, getTextContent } from "./message-parts.js";
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* Convert chat messages to a markdown string.
|
|
13
|
+
*/
|
|
14
|
+
export function exportAsMarkdown(messages: UIMessage[]): string {
|
|
15
|
+
const lines: string[] = [];
|
|
16
|
+
|
|
17
|
+
for (const msg of messages) {
|
|
18
|
+
if (msg.role === "system") continue;
|
|
19
|
+
|
|
20
|
+
if (msg.role === "user") {
|
|
21
|
+
lines.push(`**User:**\n${getTextContent(msg)}`);
|
|
22
|
+
lines.push("");
|
|
23
|
+
continue;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
// Assistant message
|
|
27
|
+
const textParts: string[] = [];
|
|
28
|
+
const toolSummaries: string[] = [];
|
|
29
|
+
|
|
30
|
+
for (const part of msg.parts) {
|
|
31
|
+
if (part.type === "text") {
|
|
32
|
+
textParts.push(part.text);
|
|
33
|
+
} else if (part.type === "reasoning") {
|
|
34
|
+
textParts.push(`> *Thinking:* ${part.text}`);
|
|
35
|
+
} else if (
|
|
36
|
+
part.type.startsWith("tool-") && part.type !== "tool-result" && "toolName" in part
|
|
37
|
+
) {
|
|
38
|
+
const name = (part as { toolName: string }).toolName;
|
|
39
|
+
const state = (part as { state?: string }).state ?? "";
|
|
40
|
+
toolSummaries.push(`> Tool: **${name}** (${state})`);
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
lines.push("**Assistant:**");
|
|
45
|
+
if (toolSummaries.length > 0) {
|
|
46
|
+
lines.push(toolSummaries.join("\n"));
|
|
47
|
+
}
|
|
48
|
+
lines.push(textParts.join(""));
|
|
49
|
+
|
|
50
|
+
const sources = extractSourcesFromParts(msg.parts);
|
|
51
|
+
if (sources.length > 0) {
|
|
52
|
+
lines.push(
|
|
53
|
+
"\nSources: " +
|
|
54
|
+
sources.map((s, i) => `[${i + 1}] ${s.title}${s.url ? ` (${s.url})` : ""}`).join(", "),
|
|
55
|
+
);
|
|
56
|
+
}
|
|
57
|
+
lines.push("");
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
return lines.join("\n").trim() + "\n";
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
/**
|
|
64
|
+
* Download messages as a .md file.
|
|
65
|
+
*/
|
|
66
|
+
export function downloadMarkdown(messages: UIMessage[], filename?: string): void {
|
|
67
|
+
const md = exportAsMarkdown(messages);
|
|
68
|
+
const blob = new dntShim.Blob([md], { type: "text/markdown;charset=utf-8" });
|
|
69
|
+
const url = URL.createObjectURL(blob);
|
|
70
|
+
const a = document.createElement("a");
|
|
71
|
+
a.href = url;
|
|
72
|
+
a.download = filename ?? `chat-${new Date().toISOString().slice(0, 10)}.md`;
|
|
73
|
+
document.body.appendChild(a);
|
|
74
|
+
a.click();
|
|
75
|
+
document.body.removeChild(a);
|
|
76
|
+
URL.revokeObjectURL(url);
|
|
77
|
+
}
|
|
@@ -9,6 +9,7 @@ import type {
|
|
|
9
9
|
UIMessage,
|
|
10
10
|
UIMessagePart,
|
|
11
11
|
} from "../../../../../agent/react/index.js";
|
|
12
|
+
import type { Source } from "../components/sources.js";
|
|
12
13
|
|
|
13
14
|
/** Get text content from UIMessage parts */
|
|
14
15
|
export function getTextContent(message: UIMessage): string {
|
|
@@ -27,6 +28,17 @@ export function isToolPart(part: UIMessagePart): part is ToolUIPart | DynamicToo
|
|
|
27
28
|
return part.type.startsWith("tool-") && part.type !== "tool-result";
|
|
28
29
|
}
|
|
29
30
|
|
|
31
|
+
const SKILL_TOOL_NAMES: ReadonlySet<string> = new Set([
|
|
32
|
+
"load-skill",
|
|
33
|
+
"load-skill-reference",
|
|
34
|
+
"execute-skill-script",
|
|
35
|
+
]);
|
|
36
|
+
|
|
37
|
+
/** Check if a tool part is a skill-related tool (load-skill, load-skill-reference, execute-skill-script) */
|
|
38
|
+
export function isSkillToolPart(tool: ToolUIPart | DynamicToolUIPart): boolean {
|
|
39
|
+
return SKILL_TOOL_NAMES.has(tool.toolName);
|
|
40
|
+
}
|
|
41
|
+
|
|
30
42
|
/** Check if a part is a reasoning part */
|
|
31
43
|
export function isReasoningPart(
|
|
32
44
|
part: UIMessagePart,
|
|
@@ -40,7 +52,8 @@ export function isReasoningPart(
|
|
|
40
52
|
export type PartGroup =
|
|
41
53
|
| { type: "text"; content: string }
|
|
42
54
|
| { type: "tool"; tool: ToolUIPart | DynamicToolUIPart }
|
|
43
|
-
| { type: "reasoning"; text: string; isStreaming: boolean }
|
|
55
|
+
| { type: "reasoning"; text: string; isStreaming: boolean }
|
|
56
|
+
| { type: "step"; stepIndex: number; isComplete: boolean };
|
|
44
57
|
|
|
45
58
|
/**
|
|
46
59
|
* Group consecutive parts for ordered rendering
|
|
@@ -80,6 +93,16 @@ export function groupPartsInOrder(parts: UIMessagePart[]): PartGroup[] {
|
|
|
80
93
|
text: part.text,
|
|
81
94
|
isStreaming: part.state === "streaming",
|
|
82
95
|
});
|
|
96
|
+
continue;
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
if (part.type === "step-start" || part.type === "step-end") {
|
|
100
|
+
groups.push({
|
|
101
|
+
type: "step",
|
|
102
|
+
stepIndex: (part as { stepIndex: number }).stepIndex,
|
|
103
|
+
isComplete: part.type === "step-end",
|
|
104
|
+
});
|
|
105
|
+
continue;
|
|
83
106
|
}
|
|
84
107
|
// Skip other non-renderable parts
|
|
85
108
|
}
|
|
@@ -87,3 +110,42 @@ export function groupPartsInOrder(parts: UIMessagePart[]): PartGroup[] {
|
|
|
87
110
|
flushText();
|
|
88
111
|
return groups;
|
|
89
112
|
}
|
|
113
|
+
|
|
114
|
+
/**
|
|
115
|
+
* Extract sources from tool result parts.
|
|
116
|
+
* Looks for `documents` arrays in tool outputs and maps them to Source[].
|
|
117
|
+
*/
|
|
118
|
+
export function extractSourcesFromParts(parts: UIMessagePart[]): Source[] {
|
|
119
|
+
const sources: Source[] = [];
|
|
120
|
+
|
|
121
|
+
for (const part of parts) {
|
|
122
|
+
if (part.type !== "tool-result") continue;
|
|
123
|
+
|
|
124
|
+
const result = (part as { result?: unknown }).result;
|
|
125
|
+
if (!result || typeof result !== "object") continue;
|
|
126
|
+
|
|
127
|
+
const docs = (result as Record<string, unknown>).documents;
|
|
128
|
+
if (!Array.isArray(docs)) continue;
|
|
129
|
+
|
|
130
|
+
for (const doc of docs) {
|
|
131
|
+
if (!doc || typeof doc !== "object") continue;
|
|
132
|
+
const d = doc as Record<string, unknown>;
|
|
133
|
+
sources.push({
|
|
134
|
+
title: typeof d.title === "string"
|
|
135
|
+
? d.title
|
|
136
|
+
: typeof d.name === "string"
|
|
137
|
+
? d.name
|
|
138
|
+
: "Source",
|
|
139
|
+
url: typeof d.url === "string" ? d.url : undefined,
|
|
140
|
+
score: typeof d.score === "number" ? d.score : undefined,
|
|
141
|
+
snippet: typeof d.snippet === "string"
|
|
142
|
+
? d.snippet
|
|
143
|
+
: typeof d.content === "string"
|
|
144
|
+
? d.content.slice(0, 200)
|
|
145
|
+
: undefined,
|
|
146
|
+
});
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
return sources;
|
|
151
|
+
}
|
|
@@ -0,0 +1,371 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { cn, generateTokenCSS } from "./theme.js";
|
|
3
|
+
import { Chat, type ChatProps } from "./chat/index.js";
|
|
4
|
+
import { ChatSidebar } from "./chat/components/sidebar.js";
|
|
5
|
+
import { type ChatTab, TabSwitcher } from "./chat/components/tab-switcher.js";
|
|
6
|
+
import { useThreads } from "./chat/hooks/use-threads.js";
|
|
7
|
+
import { PanelLeftIcon } from "./icons/index.js";
|
|
8
|
+
|
|
9
|
+
type ChatMessageSetter = (messages: ChatProps["messages"]) => void;
|
|
10
|
+
type ChatWithSidebarPassthroughProps = Omit<
|
|
11
|
+
ChatProps,
|
|
12
|
+
"messages" | "model" | "onModelChange" | "activeTab" | "onTabChange" | "className"
|
|
13
|
+
>;
|
|
14
|
+
type TabChangeHandler = NonNullable<ChatProps["onTabChange"]>;
|
|
15
|
+
|
|
16
|
+
export interface ChatWithSidebarChatController {
|
|
17
|
+
messages: ChatProps["messages"];
|
|
18
|
+
input: ChatProps["input"];
|
|
19
|
+
onChange: ChatProps["onChange"];
|
|
20
|
+
onSubmit?: ChatProps["onSubmit"];
|
|
21
|
+
stop?: ChatProps["stop"];
|
|
22
|
+
reload?: ChatProps["reload"];
|
|
23
|
+
setInput?: ChatProps["setInput"];
|
|
24
|
+
isLoading?: ChatProps["isLoading"];
|
|
25
|
+
error?: ChatProps["error"];
|
|
26
|
+
model?: ChatProps["model"];
|
|
27
|
+
activeModel?: ChatProps["activeModel"];
|
|
28
|
+
onModelChange?: ChatProps["onModelChange"];
|
|
29
|
+
inferenceMode?: ChatProps["inferenceMode"];
|
|
30
|
+
browserStatus?: ChatProps["browserStatus"];
|
|
31
|
+
editMessage?: ChatProps["editMessage"];
|
|
32
|
+
getBranches?: ChatProps["getBranches"];
|
|
33
|
+
switchBranch?: ChatProps["switchBranch"];
|
|
34
|
+
setMessages: ChatMessageSetter;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
interface ChatWithSidebarSidebarBaseConfig {
|
|
38
|
+
storageKey?: string;
|
|
39
|
+
visible?: boolean;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
export type ChatWithSidebarSidebarConfig =
|
|
43
|
+
| (ChatWithSidebarSidebarBaseConfig & {
|
|
44
|
+
open: boolean;
|
|
45
|
+
onToggle: () => void;
|
|
46
|
+
})
|
|
47
|
+
| (ChatWithSidebarSidebarBaseConfig & {
|
|
48
|
+
open?: undefined;
|
|
49
|
+
onToggle?: () => void;
|
|
50
|
+
});
|
|
51
|
+
|
|
52
|
+
export interface ChatWithSidebarModelConfig {
|
|
53
|
+
options?: ChatProps["models"];
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
export interface ChatWithSidebarAttachmentConfig {
|
|
57
|
+
accept?: ChatProps["attachAccept"];
|
|
58
|
+
items?: ChatProps["attachments"];
|
|
59
|
+
uploads?: ChatProps["uploads"];
|
|
60
|
+
onAttach?: ChatProps["onAttach"];
|
|
61
|
+
onDrop?: ChatProps["onDrop"];
|
|
62
|
+
onRemoveItem?: ChatProps["onRemoveAttachment"];
|
|
63
|
+
onRemoveUpload?: ChatProps["onRemoveUpload"];
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
export interface ChatWithSidebarQuickActionsConfig {
|
|
67
|
+
suggestions?: ChatProps["suggestions"];
|
|
68
|
+
onSuggestionClick?: ChatProps["onSuggestionClick"];
|
|
69
|
+
actions?: ChatProps["quickActions"];
|
|
70
|
+
onAction?: ChatProps["onQuickAction"];
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
export interface ChatWithSidebarMessageConfig {
|
|
74
|
+
render?: ChatProps["renderMessage"];
|
|
75
|
+
renderTool?: ChatProps["renderTool"];
|
|
76
|
+
onFeedback?: ChatProps["onFeedback"];
|
|
77
|
+
onSourceClick?: ChatProps["onSourceClick"];
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
export interface ChatWithSidebarFeatureConfig {
|
|
81
|
+
steps?: ChatProps["showSteps"];
|
|
82
|
+
tabs?: ChatProps["showTabs"];
|
|
83
|
+
sources?: ChatProps["showSources"];
|
|
84
|
+
export?: ChatProps["showExport"];
|
|
85
|
+
scrollButton?: ChatProps["showScrollButton"];
|
|
86
|
+
messageActions?: ChatProps["showMessageActions"];
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
export type ChatWithSidebarTabsConfig =
|
|
90
|
+
| {
|
|
91
|
+
active: ChatProps["activeTab"];
|
|
92
|
+
onChange: TabChangeHandler;
|
|
93
|
+
}
|
|
94
|
+
| {
|
|
95
|
+
active?: undefined;
|
|
96
|
+
onChange?: TabChangeHandler;
|
|
97
|
+
};
|
|
98
|
+
|
|
99
|
+
export interface ChatWithSidebarVoiceConfig {
|
|
100
|
+
enabled?: ChatProps["enableVoice"];
|
|
101
|
+
onVoice?: ChatProps["onVoice"];
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
export interface ChatWithSidebarGroupedProps {
|
|
105
|
+
chat: ChatWithSidebarChatController;
|
|
106
|
+
sidebar?: ChatWithSidebarSidebarConfig;
|
|
107
|
+
models?: ChatWithSidebarModelConfig;
|
|
108
|
+
attachments?: ChatWithSidebarAttachmentConfig;
|
|
109
|
+
quickActions?: ChatWithSidebarQuickActionsConfig;
|
|
110
|
+
message?: ChatWithSidebarMessageConfig;
|
|
111
|
+
features?: ChatWithSidebarFeatureConfig;
|
|
112
|
+
tabs?: ChatWithSidebarTabsConfig;
|
|
113
|
+
voice?: ChatWithSidebarVoiceConfig;
|
|
114
|
+
className?: string;
|
|
115
|
+
maxHeight?: ChatProps["maxHeight"];
|
|
116
|
+
theme?: ChatProps["theme"];
|
|
117
|
+
placeholder?: ChatProps["placeholder"];
|
|
118
|
+
emptyState?: ChatProps["emptyState"];
|
|
119
|
+
children?: ChatProps["children"];
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
export type ChatWithSidebarProps = ChatWithSidebarGroupedProps;
|
|
123
|
+
|
|
124
|
+
export const ChatWithSidebar = React.forwardRef<HTMLDivElement, ChatWithSidebarProps>(
|
|
125
|
+
function ChatWithSidebar(
|
|
126
|
+
{
|
|
127
|
+
chat,
|
|
128
|
+
sidebar,
|
|
129
|
+
models,
|
|
130
|
+
attachments,
|
|
131
|
+
quickActions,
|
|
132
|
+
message,
|
|
133
|
+
features,
|
|
134
|
+
tabs,
|
|
135
|
+
voice,
|
|
136
|
+
className,
|
|
137
|
+
maxHeight,
|
|
138
|
+
theme,
|
|
139
|
+
placeholder,
|
|
140
|
+
emptyState,
|
|
141
|
+
children,
|
|
142
|
+
},
|
|
143
|
+
ref,
|
|
144
|
+
): React.ReactElement {
|
|
145
|
+
const storageKey = sidebar?.storageKey;
|
|
146
|
+
const controlledOpen = sidebar?.open;
|
|
147
|
+
const onSidebarToggle = sidebar?.onToggle;
|
|
148
|
+
const showSidebar = sidebar?.visible ?? true;
|
|
149
|
+
const setMessages = chat.setMessages;
|
|
150
|
+
const messages = chat.messages;
|
|
151
|
+
const model = chat.model;
|
|
152
|
+
const onModelChange = chat.onModelChange;
|
|
153
|
+
const controlledTab = tabs?.active;
|
|
154
|
+
const chatProps: ChatWithSidebarPassthroughProps = {
|
|
155
|
+
input: chat.input,
|
|
156
|
+
onChange: chat.onChange,
|
|
157
|
+
onSubmit: chat.onSubmit,
|
|
158
|
+
stop: chat.stop,
|
|
159
|
+
reload: chat.reload,
|
|
160
|
+
setInput: chat.setInput,
|
|
161
|
+
isLoading: chat.isLoading,
|
|
162
|
+
error: chat.error,
|
|
163
|
+
placeholder,
|
|
164
|
+
maxHeight,
|
|
165
|
+
theme,
|
|
166
|
+
renderMessage: message?.render,
|
|
167
|
+
renderTool: message?.renderTool,
|
|
168
|
+
suggestions: quickActions?.suggestions,
|
|
169
|
+
onSuggestionClick: quickActions?.onSuggestionClick,
|
|
170
|
+
emptyState,
|
|
171
|
+
showScrollButton: features?.scrollButton,
|
|
172
|
+
showMessageActions: features?.messageActions,
|
|
173
|
+
models: models?.options,
|
|
174
|
+
activeModel: chat.activeModel,
|
|
175
|
+
inferenceMode: chat.inferenceMode,
|
|
176
|
+
browserStatus: chat.browserStatus,
|
|
177
|
+
showSources: features?.sources,
|
|
178
|
+
onSourceClick: message?.onSourceClick,
|
|
179
|
+
onAttach: attachments?.onAttach,
|
|
180
|
+
onDrop: attachments?.onDrop,
|
|
181
|
+
attachAccept: attachments?.accept,
|
|
182
|
+
attachments: attachments?.items,
|
|
183
|
+
onRemoveAttachment: attachments?.onRemoveItem,
|
|
184
|
+
showExport: features?.export,
|
|
185
|
+
onFeedback: message?.onFeedback,
|
|
186
|
+
editMessage: chat.editMessage,
|
|
187
|
+
getBranches: chat.getBranches,
|
|
188
|
+
switchBranch: chat.switchBranch,
|
|
189
|
+
showSteps: features?.steps,
|
|
190
|
+
showTabs: features?.tabs,
|
|
191
|
+
uploads: attachments?.uploads,
|
|
192
|
+
onRemoveUpload: attachments?.onRemoveUpload,
|
|
193
|
+
quickActions: quickActions?.actions,
|
|
194
|
+
onQuickAction: quickActions?.onAction,
|
|
195
|
+
enableVoice: voice?.enabled,
|
|
196
|
+
onVoice: voice?.onVoice,
|
|
197
|
+
children,
|
|
198
|
+
};
|
|
199
|
+
|
|
200
|
+
const {
|
|
201
|
+
activeThreadId,
|
|
202
|
+
createThread,
|
|
203
|
+
deleteThread,
|
|
204
|
+
renameThread,
|
|
205
|
+
selectThread,
|
|
206
|
+
threads,
|
|
207
|
+
updateThread,
|
|
208
|
+
} = useThreads({ storageKey });
|
|
209
|
+
const [internalOpen, setInternalOpen] = React.useState(false);
|
|
210
|
+
const [internalTab, setInternalTab] = React.useState<ChatTab>("chat");
|
|
211
|
+
const showTabs = chatProps.showTabs ?? false;
|
|
212
|
+
|
|
213
|
+
const isSidebarControlled = controlledOpen !== undefined;
|
|
214
|
+
const sidebarOpen = isSidebarControlled ? controlledOpen : internalOpen;
|
|
215
|
+
const toggleSidebar = React.useCallback(() => {
|
|
216
|
+
if (isSidebarControlled) {
|
|
217
|
+
onSidebarToggle?.();
|
|
218
|
+
return;
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
setInternalOpen((prev) => {
|
|
222
|
+
const next = !prev;
|
|
223
|
+
onSidebarToggle?.();
|
|
224
|
+
return next;
|
|
225
|
+
});
|
|
226
|
+
}, [isSidebarControlled, onSidebarToggle]);
|
|
227
|
+
|
|
228
|
+
const isTabControlled = controlledTab !== undefined;
|
|
229
|
+
const activeTab = controlledTab ?? internalTab;
|
|
230
|
+
const handleTabChange = React.useCallback((tab: ChatTab) => {
|
|
231
|
+
if (!isTabControlled) {
|
|
232
|
+
setInternalTab(tab);
|
|
233
|
+
}
|
|
234
|
+
tabs?.onChange?.(tab);
|
|
235
|
+
}, [isTabControlled, tabs]);
|
|
236
|
+
|
|
237
|
+
// Keep refs in sync so callbacks always read current values
|
|
238
|
+
const activeIdRef = React.useRef(activeThreadId);
|
|
239
|
+
activeIdRef.current = activeThreadId;
|
|
240
|
+
const messagesRef = React.useRef(messages);
|
|
241
|
+
messagesRef.current = messages;
|
|
242
|
+
const threadsRef = React.useRef(threads);
|
|
243
|
+
threadsRef.current = threads;
|
|
244
|
+
|
|
245
|
+
// Sync current messages to active thread on change
|
|
246
|
+
const prevMessagesRef = React.useRef(messages);
|
|
247
|
+
React.useEffect(() => {
|
|
248
|
+
const currentActiveId = activeIdRef.current;
|
|
249
|
+
if (!currentActiveId || messages === prevMessagesRef.current) return;
|
|
250
|
+
prevMessagesRef.current = messages;
|
|
251
|
+
|
|
252
|
+
if (messages.length > 0) {
|
|
253
|
+
// Auto-title from first user message — combine with message sync
|
|
254
|
+
// into a single updateThread call to avoid racing setThreads batches
|
|
255
|
+
const activeThread = threadsRef.current.find((t) => t.id === currentActiveId);
|
|
256
|
+
let title: string | undefined;
|
|
257
|
+
if (activeThread?.title === "New Chat") {
|
|
258
|
+
const firstUserMsg = messages.find((m) => m.role === "user");
|
|
259
|
+
if (firstUserMsg) {
|
|
260
|
+
const text = firstUserMsg.parts
|
|
261
|
+
.filter((p) => p.type === "text")
|
|
262
|
+
.map((p) => (p as { text: string }).text)
|
|
263
|
+
.join("")
|
|
264
|
+
.trim();
|
|
265
|
+
if (text) title = text.slice(0, 30);
|
|
266
|
+
}
|
|
267
|
+
}
|
|
268
|
+
|
|
269
|
+
updateThread(currentActiveId, title ? { messages, title } : { messages });
|
|
270
|
+
}
|
|
271
|
+
}, [messages, updateThread]);
|
|
272
|
+
|
|
273
|
+
const setInput = chat.setInput;
|
|
274
|
+
const stopChat = chat.stop;
|
|
275
|
+
|
|
276
|
+
const handleSelectThread = React.useCallback(
|
|
277
|
+
(id: string) => {
|
|
278
|
+
stopChat?.();
|
|
279
|
+
const currentActiveId = activeIdRef.current;
|
|
280
|
+
if (currentActiveId && messagesRef.current.length > 0) {
|
|
281
|
+
updateThread(currentActiveId, { messages: messagesRef.current });
|
|
282
|
+
}
|
|
283
|
+
selectThread(id);
|
|
284
|
+
const thread = threadsRef.current.find((t) => t.id === id);
|
|
285
|
+
setMessages(thread?.messages ?? []);
|
|
286
|
+
setInput?.("");
|
|
287
|
+
},
|
|
288
|
+
[selectThread, updateThread, setMessages, setInput, stopChat],
|
|
289
|
+
);
|
|
290
|
+
|
|
291
|
+
const handleNewThread = React.useCallback(() => {
|
|
292
|
+
stopChat?.();
|
|
293
|
+
const currentActiveId = activeIdRef.current;
|
|
294
|
+
if (currentActiveId && messagesRef.current.length > 0) {
|
|
295
|
+
updateThread(currentActiveId, { messages: messagesRef.current });
|
|
296
|
+
}
|
|
297
|
+
const nextThread = createThread();
|
|
298
|
+
setMessages(nextThread.messages);
|
|
299
|
+
setInput?.("");
|
|
300
|
+
}, [createThread, updateThread, setMessages, setInput, stopChat]);
|
|
301
|
+
|
|
302
|
+
if (!showSidebar) {
|
|
303
|
+
return (
|
|
304
|
+
<Chat
|
|
305
|
+
ref={ref}
|
|
306
|
+
messages={messages}
|
|
307
|
+
model={model}
|
|
308
|
+
onModelChange={onModelChange}
|
|
309
|
+
className={className}
|
|
310
|
+
{...chatProps}
|
|
311
|
+
/>
|
|
312
|
+
);
|
|
313
|
+
}
|
|
314
|
+
|
|
315
|
+
const tokenCSS = React.useMemo(() => generateTokenCSS(), []);
|
|
316
|
+
|
|
317
|
+
return (
|
|
318
|
+
<div
|
|
319
|
+
ref={ref}
|
|
320
|
+
className={cn("flex h-full bg-[var(--background)]", className)}
|
|
321
|
+
data-vf-chat=""
|
|
322
|
+
>
|
|
323
|
+
<style dangerouslySetInnerHTML={{ __html: tokenCSS }} />
|
|
324
|
+
{sidebarOpen && (
|
|
325
|
+
<ChatSidebar
|
|
326
|
+
threads={threads}
|
|
327
|
+
activeThreadId={activeThreadId}
|
|
328
|
+
onSelectThread={handleSelectThread}
|
|
329
|
+
onDeleteThread={(id) => {
|
|
330
|
+
deleteThread(id);
|
|
331
|
+
const next = threadsRef.current.find((t) => t.id !== id);
|
|
332
|
+
setMessages(next?.messages ?? []);
|
|
333
|
+
}}
|
|
334
|
+
onRenameThread={renameThread}
|
|
335
|
+
onNewThread={handleNewThread}
|
|
336
|
+
/>
|
|
337
|
+
)}
|
|
338
|
+
<div className="flex-1 min-w-0 flex flex-col">
|
|
339
|
+
<div className="flex items-center px-3 pt-4 pb-1 shrink-0">
|
|
340
|
+
<button
|
|
341
|
+
type="button"
|
|
342
|
+
onClick={toggleSidebar}
|
|
343
|
+
className="size-8 inline-flex items-center justify-center rounded-full text-[var(--muted-foreground)] hover:text-[var(--foreground)] hover:bg-[var(--foreground)]/5 transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--ring)] focus-visible:ring-offset-2"
|
|
344
|
+
aria-label={sidebarOpen ? "Close sidebar" : "Open sidebar"}
|
|
345
|
+
>
|
|
346
|
+
<PanelLeftIcon className="size-[18px]" />
|
|
347
|
+
</button>
|
|
348
|
+
{showTabs && (
|
|
349
|
+
<div className="flex-1 flex justify-center">
|
|
350
|
+
<TabSwitcher activeTab={activeTab} onTabChange={handleTabChange} className="py-0" />
|
|
351
|
+
</div>
|
|
352
|
+
)}
|
|
353
|
+
{showTabs && <div className="size-8 shrink-0" />}
|
|
354
|
+
</div>
|
|
355
|
+
<Chat
|
|
356
|
+
messages={messages}
|
|
357
|
+
model={model}
|
|
358
|
+
onModelChange={onModelChange}
|
|
359
|
+
className="flex-1 min-h-0"
|
|
360
|
+
activeTab={activeTab}
|
|
361
|
+
onTabChange={handleTabChange}
|
|
362
|
+
hideTabSwitcher
|
|
363
|
+
{...chatProps}
|
|
364
|
+
/>
|
|
365
|
+
</div>
|
|
366
|
+
</div>
|
|
367
|
+
);
|
|
368
|
+
},
|
|
369
|
+
);
|
|
370
|
+
|
|
371
|
+
ChatWithSidebar.displayName = "ChatWithSidebar";
|
|
@@ -1,31 +1,146 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Chat re-export aggregator — single import path for all chat components.
|
|
3
|
+
*
|
|
4
|
+
* @module ai/react/components/ai/chat
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
// ---------------------------------------------------------------------------
|
|
8
|
+
// Core preset + compound
|
|
9
|
+
// ---------------------------------------------------------------------------
|
|
10
|
+
export { Chat, ChatComponents, type ChatProps } from "./chat/index.js";
|
|
11
|
+
|
|
12
|
+
// ---------------------------------------------------------------------------
|
|
13
|
+
// Composition building blocks
|
|
14
|
+
// ---------------------------------------------------------------------------
|
|
15
|
+
export {
|
|
16
|
+
ChatComposer,
|
|
17
|
+
type ChatComposerProps,
|
|
18
|
+
ChatEmpty,
|
|
19
|
+
type ChatEmptyProps,
|
|
20
|
+
ChatIf,
|
|
21
|
+
type ChatIfProps,
|
|
22
|
+
ChatMessageList,
|
|
23
|
+
type ChatMessageListProps,
|
|
24
|
+
ChatRoot,
|
|
25
|
+
type ChatRootProps,
|
|
26
|
+
ErrorBanner,
|
|
27
|
+
type ErrorBannerProps,
|
|
28
|
+
Message,
|
|
29
|
+
type MessageRootProps,
|
|
30
|
+
ModelAvatar,
|
|
31
|
+
type ModelAvatarProps,
|
|
32
|
+
} from "./chat/index.js";
|
|
33
|
+
|
|
34
|
+
// ---------------------------------------------------------------------------
|
|
35
|
+
// Contexts
|
|
36
|
+
// ---------------------------------------------------------------------------
|
|
1
37
|
export {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
38
|
+
ChatContextProvider,
|
|
39
|
+
type ChatContextValue,
|
|
40
|
+
ComposerContextProvider,
|
|
41
|
+
type ComposerContextValue,
|
|
42
|
+
MessageContextProvider,
|
|
43
|
+
type MessageContextValue,
|
|
44
|
+
ThreadListContextProvider,
|
|
45
|
+
type ThreadListContextValue,
|
|
46
|
+
useChatContext,
|
|
47
|
+
useChatContextOptional,
|
|
48
|
+
useComposerContext,
|
|
49
|
+
useComposerContextOptional,
|
|
50
|
+
useMessageContext,
|
|
51
|
+
useMessageContextOptional,
|
|
52
|
+
useThreadListContext,
|
|
53
|
+
useThreadListContextOptional,
|
|
54
|
+
} from "./chat/index.js";
|
|
55
|
+
|
|
56
|
+
// ---------------------------------------------------------------------------
|
|
57
|
+
// Sub-components
|
|
58
|
+
// ---------------------------------------------------------------------------
|
|
59
|
+
export {
|
|
60
|
+
type AttachmentInfo,
|
|
61
|
+
AttachmentPill,
|
|
62
|
+
type AttachmentPillProps,
|
|
63
|
+
BranchPicker,
|
|
64
|
+
type BranchPickerProps,
|
|
65
|
+
ChatSidebar,
|
|
66
|
+
type ChatSidebarProps,
|
|
67
|
+
type ChatTab,
|
|
68
|
+
type CodeBlockProps,
|
|
9
69
|
ConversationEmptyState,
|
|
10
70
|
type ConversationEmptyStateProps,
|
|
11
71
|
ConversationScrollButton,
|
|
12
72
|
type ConversationScrollButtonProps,
|
|
73
|
+
downloadMarkdown,
|
|
74
|
+
DropZoneOverlay,
|
|
75
|
+
type DropZoneOverlayProps,
|
|
76
|
+
exportAsMarkdown,
|
|
77
|
+
extractSourcesFromParts,
|
|
78
|
+
FadeIn,
|
|
79
|
+
type FeedbackValue,
|
|
13
80
|
getTextContent,
|
|
14
81
|
groupPartsInOrder,
|
|
82
|
+
InferenceBadge,
|
|
83
|
+
type InferenceBadgeProps,
|
|
84
|
+
InlineCitation,
|
|
85
|
+
type InlineCitationProps,
|
|
15
86
|
isReasoningPart,
|
|
87
|
+
isSkillToolPart,
|
|
16
88
|
isToolPart,
|
|
17
89
|
Loader,
|
|
18
90
|
MessageActions,
|
|
19
91
|
type MessageActionsProps,
|
|
92
|
+
MessageEditForm,
|
|
93
|
+
type MessageEditFormProps,
|
|
94
|
+
MessageFeedback,
|
|
95
|
+
type MessageFeedbackProps,
|
|
20
96
|
type PartGroup,
|
|
97
|
+
type QuickAction,
|
|
98
|
+
QuickActions,
|
|
99
|
+
type QuickActionsProps,
|
|
21
100
|
ReasoningCard,
|
|
101
|
+
RichCodeBlock,
|
|
22
102
|
Shimmer,
|
|
103
|
+
SkillBadge,
|
|
104
|
+
type SkillBadgeProps,
|
|
105
|
+
type Source,
|
|
106
|
+
Sources,
|
|
107
|
+
type SourcesProps,
|
|
108
|
+
StepIndicator,
|
|
109
|
+
type StepIndicatorProps,
|
|
23
110
|
Suggestion,
|
|
24
111
|
type SuggestionProps,
|
|
25
112
|
Suggestions,
|
|
26
113
|
type SuggestionsProps,
|
|
114
|
+
TabSwitcher,
|
|
115
|
+
type TabSwitcherProps,
|
|
116
|
+
type Thread,
|
|
27
117
|
ToolCallCard,
|
|
28
118
|
ToolStatusBadge,
|
|
119
|
+
UpgradeCTA,
|
|
120
|
+
type UpgradeCTAProps,
|
|
121
|
+
type UploadedFile,
|
|
122
|
+
UploadsPanel,
|
|
123
|
+
type UploadsPanelProps,
|
|
124
|
+
useThreads,
|
|
125
|
+
type UseThreadsOptions,
|
|
126
|
+
type UseThreadsResult,
|
|
29
127
|
} from "./chat/index.js";
|
|
30
128
|
|
|
129
|
+
// ---------------------------------------------------------------------------
|
|
130
|
+
// Adjacent components
|
|
131
|
+
// ---------------------------------------------------------------------------
|
|
31
132
|
export { type ModelOption, ModelSelector, type ModelSelectorProps } from "./model-selector.js";
|
|
133
|
+
export {
|
|
134
|
+
ChatWithSidebar,
|
|
135
|
+
type ChatWithSidebarAttachmentConfig,
|
|
136
|
+
type ChatWithSidebarChatController,
|
|
137
|
+
type ChatWithSidebarFeatureConfig,
|
|
138
|
+
type ChatWithSidebarGroupedProps,
|
|
139
|
+
type ChatWithSidebarMessageConfig,
|
|
140
|
+
type ChatWithSidebarModelConfig,
|
|
141
|
+
type ChatWithSidebarProps,
|
|
142
|
+
type ChatWithSidebarQuickActionsConfig,
|
|
143
|
+
type ChatWithSidebarSidebarConfig,
|
|
144
|
+
type ChatWithSidebarTabsConfig,
|
|
145
|
+
type ChatWithSidebarVoiceConfig,
|
|
146
|
+
} from "./chat-with-sidebar.js";
|