veryfront 0.1.1237 → 0.1.1239
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/auth/login.d.ts +24 -2
- package/esm/cli/auth/login.d.ts.map +1 -1
- package/esm/cli/auth/login.js +444 -35
- package/esm/cli/commands/build/error-handler.d.ts.map +1 -1
- package/esm/cli/commands/build/error-handler.js +41 -3
- package/esm/cli/commands/build/handler.d.ts.map +1 -1
- package/esm/cli/commands/build/handler.js +1 -1
- package/esm/cli/commands/dev/command.d.ts.map +1 -1
- package/esm/cli/commands/dev/command.js +14 -1
- package/esm/cli/commands/dev/inference-status.d.ts +6 -0
- package/esm/cli/commands/dev/inference-status.d.ts.map +1 -1
- package/esm/cli/commands/dev/inference-status.js +14 -2
- package/esm/cli/commands/generate/command.d.ts.map +1 -1
- package/esm/cli/commands/generate/command.js +61 -0
- package/esm/cli/commands/init/init-command.d.ts.map +1 -1
- package/esm/cli/commands/init/init-command.js +23 -31
- package/esm/cli/commands/install/registry.d.ts.map +1 -1
- package/esm/cli/commands/install/registry.js +6 -9
- package/esm/cli/commands/login/command-help.d.ts.map +1 -1
- package/esm/cli/commands/login/command-help.js +3 -1
- package/esm/cli/commands/pull/command.d.ts +1 -0
- package/esm/cli/commands/pull/command.d.ts.map +1 -1
- package/esm/cli/commands/pull/command.js +49 -6
- package/esm/cli/commands/push/command-help.d.ts.map +1 -1
- package/esm/cli/commands/push/command-help.js +7 -0
- package/esm/cli/commands/push/command.d.ts +23 -12
- package/esm/cli/commands/push/command.d.ts.map +1 -1
- package/esm/cli/commands/push/command.js +461 -44
- package/esm/cli/commands/push/plan.d.ts +35 -0
- package/esm/cli/commands/push/plan.d.ts.map +1 -0
- package/esm/cli/commands/push/plan.js +96 -0
- package/esm/cli/commands/schedule/handler.d.ts +21 -2
- package/esm/cli/commands/schedule/handler.d.ts.map +1 -1
- package/esm/cli/commands/schedule/handler.js +74 -27
- package/esm/cli/commands/schema/command-help.js +1 -1
- package/esm/cli/commands/up/command.js +1 -1
- package/esm/cli/commands/webhook/handler.d.ts.map +1 -1
- package/esm/cli/commands/webhook/handler.js +3 -1
- package/esm/cli/router.d.ts.map +1 -1
- package/esm/cli/router.js +27 -5
- package/esm/cli/shared/args.d.ts +15 -1
- package/esm/cli/shared/args.d.ts.map +1 -1
- package/esm/cli/shared/args.js +56 -3
- package/esm/cli/shared/config.d.ts +11 -2
- package/esm/cli/shared/config.d.ts.map +1 -1
- package/esm/cli/shared/config.js +72 -27
- package/esm/cli/shared/project-creation.js +1 -1
- package/esm/cli/sync/state.d.ts +20 -0
- package/esm/cli/sync/state.d.ts.map +1 -0
- package/esm/cli/sync/state.js +193 -0
- package/esm/deno.js +2 -2
- package/esm/extensions/ext-llm-anthropic/src/anthropic-request-builder.d.ts.map +1 -1
- package/esm/extensions/ext-llm-anthropic/src/anthropic-request-builder.js +852 -21
- package/esm/extensions/ext-observability-sentry/src/policy.d.ts +2 -0
- package/esm/extensions/ext-observability-sentry/src/policy.d.ts.map +1 -1
- package/esm/extensions/ext-observability-sentry/src/policy.js +214 -3
- package/esm/src/agent/conversation/delegation-policy.d.ts +2 -0
- package/esm/src/agent/conversation/delegation-policy.d.ts.map +1 -1
- package/esm/src/agent/conversation/delegation-policy.js +13 -3
- package/esm/src/agent/conversation/hosted-terminal.d.ts.map +1 -1
- package/esm/src/agent/conversation/hosted-terminal.js +6 -2
- package/esm/src/agent/conversation/run-chunk-mirror.d.ts.map +1 -1
- package/esm/src/agent/conversation/run-chunk-mirror.js +14 -2
- package/esm/src/agent/factory.d.ts.map +1 -1
- package/esm/src/agent/factory.js +22 -11
- package/esm/src/agent/hosted/chat-runtime-tool-assembly.d.ts +2 -0
- package/esm/src/agent/hosted/chat-runtime-tool-assembly.d.ts.map +1 -1
- package/esm/src/agent/hosted/chat-runtime-tool-assembly.js +6 -1
- package/esm/src/agent/hosted/child-fork-execution-runner.d.ts +2 -1
- package/esm/src/agent/hosted/child-fork-execution-runner.d.ts.map +1 -1
- package/esm/src/agent/hosted/child-fork-execution-runner.js +6 -3
- package/esm/src/agent/hosted/child-fork-step-message-preparation.d.ts +12 -3
- package/esm/src/agent/hosted/child-fork-step-message-preparation.d.ts.map +1 -1
- package/esm/src/agent/hosted/child-fork-step-message-preparation.js +16 -3
- package/esm/src/agent/hosted/cloud-agent-chat-execution.d.ts +1 -1
- package/esm/src/agent/hosted/cloud-agent-chat-execution.d.ts.map +1 -1
- package/esm/src/agent/hosted/cloud-agent-chat-execution.js +3 -3
- package/esm/src/agent/hosted/cloud-agent-child-tools.d.ts +11 -0
- package/esm/src/agent/hosted/cloud-agent-child-tools.d.ts.map +1 -1
- package/esm/src/agent/hosted/cloud-agent-child-tools.js +2 -3
- package/esm/src/agent/hosted/cloud-agent-config.d.ts +1 -0
- package/esm/src/agent/hosted/cloud-agent-config.d.ts.map +1 -1
- package/esm/src/agent/hosted/cloud-runtime-system-messages.d.ts +16 -1
- package/esm/src/agent/hosted/cloud-runtime-system-messages.d.ts.map +1 -1
- package/esm/src/agent/hosted/cloud-runtime-system-messages.js +13 -3
- package/esm/src/agent/hosted/default-chat-runtime.d.ts +2 -1
- package/esm/src/agent/hosted/default-chat-runtime.d.ts.map +1 -1
- package/esm/src/agent/hosted/default-chat-runtime.js +18 -7
- package/esm/src/agent/hosted/default-invoke-agent-tool.d.ts +2 -1
- package/esm/src/agent/hosted/default-invoke-agent-tool.d.ts.map +1 -1
- package/esm/src/agent/hosted/default-invoke-agent-tool.js +11 -3
- package/esm/src/agent/hosted/default-project-steering-refresh.d.ts +2 -1
- package/esm/src/agent/hosted/default-project-steering-refresh.d.ts.map +1 -1
- package/esm/src/agent/hosted/default-project-steering-refresh.js +4 -1
- package/esm/src/agent/hosted/runtime-state-resolver.d.ts +6 -4
- package/esm/src/agent/hosted/runtime-state-resolver.d.ts.map +1 -1
- package/esm/src/agent/hosted/runtime-state-resolver.js +8 -11
- package/esm/src/agent/index.d.ts +3 -3
- package/esm/src/agent/index.d.ts.map +1 -1
- package/esm/src/agent/project/agent-runtime.d.ts.map +1 -1
- package/esm/src/agent/project/agent-runtime.js +6 -3
- package/esm/src/agent/runtime/agent-definition.d.ts +68 -66
- package/esm/src/agent/runtime/agent-definition.d.ts.map +1 -1
- package/esm/src/agent/runtime/agent-definition.js +15 -2
- package/esm/src/agent/runtime/agent-invocation-contract.d.ts +2 -0
- package/esm/src/agent/runtime/agent-invocation-contract.d.ts.map +1 -1
- package/esm/src/agent/runtime/agent-markdown-adapter.js +1 -1
- package/esm/src/agent/runtime/agent-runtime-step.d.ts +11 -5
- package/esm/src/agent/runtime/agent-runtime-step.d.ts.map +1 -1
- package/esm/src/agent/runtime/agent-runtime-step.js +23 -6
- package/esm/src/agent/runtime/call-context.d.ts +42 -11
- package/esm/src/agent/runtime/call-context.d.ts.map +1 -1
- package/esm/src/agent/runtime/call-context.js +480 -42
- package/esm/src/agent/runtime/chat-stream-handler.d.ts +18 -0
- package/esm/src/agent/runtime/chat-stream-handler.d.ts.map +1 -1
- package/esm/src/agent/runtime/chat-stream-handler.js +38 -18
- package/esm/src/agent/runtime/effective-agent-system.d.ts +13 -4
- package/esm/src/agent/runtime/effective-agent-system.d.ts.map +1 -1
- package/esm/src/agent/runtime/effective-agent-system.js +29 -0
- package/esm/src/agent/runtime/index.d.ts +1 -0
- package/esm/src/agent/runtime/index.d.ts.map +1 -1
- package/esm/src/agent/runtime/index.js +638 -53
- package/esm/src/agent/runtime/load-skill-tool.d.ts +33 -3
- package/esm/src/agent/runtime/load-skill-tool.d.ts.map +1 -1
- package/esm/src/agent/runtime/load-skill-tool.js +152 -21
- package/esm/src/agent/runtime/model-resolution.d.ts +3 -0
- package/esm/src/agent/runtime/model-resolution.d.ts.map +1 -1
- package/esm/src/agent/runtime/model-resolution.js +14 -0
- package/esm/src/agent/runtime/model-transport.d.ts +1 -0
- package/esm/src/agent/runtime/model-transport.d.ts.map +1 -1
- package/esm/src/agent/runtime/model-transport.js +5 -2
- package/esm/src/agent/runtime/run-runtime-context.d.ts +4 -0
- package/esm/src/agent/runtime/run-runtime-context.d.ts.map +1 -1
- package/esm/src/agent/runtime/run-runtime-context.js +9 -3
- package/esm/src/agent/runtime/runtime-tool-config.d.ts +1 -0
- package/esm/src/agent/runtime/runtime-tool-config.d.ts.map +1 -1
- package/esm/src/agent/runtime/skill-prompt.d.ts +3 -0
- package/esm/src/agent/runtime/skill-prompt.d.ts.map +1 -1
- package/esm/src/agent/runtime/skill-prompt.js +113 -25
- package/esm/src/agent/runtime/streamed-assistant-message.d.ts +22 -2
- package/esm/src/agent/runtime/streamed-assistant-message.d.ts.map +1 -1
- package/esm/src/agent/runtime/streamed-assistant-message.js +26 -5
- package/esm/src/agent/runtime/tool-inventory.d.ts.map +1 -1
- package/esm/src/agent/runtime/tool-inventory.js +13 -9
- package/esm/src/agent/runtime/tool-result-continuation.d.ts +4 -2
- package/esm/src/agent/runtime/tool-result-continuation.d.ts.map +1 -1
- package/esm/src/agent/runtime/tool-result-continuation.js +24 -20
- package/esm/src/agent/schemas/agent.schema.d.ts +2 -2
- package/esm/src/agent/service/runtime.js +1 -1
- package/esm/src/agent/streaming/fork-runtime-stream.d.ts +5 -4
- package/esm/src/agent/streaming/fork-runtime-stream.d.ts.map +1 -1
- package/esm/src/agent/types.d.ts +14 -1
- package/esm/src/agent/types.d.ts.map +1 -1
- package/esm/src/chat/chat-ui-message-helpers.d.ts.map +1 -1
- package/esm/src/chat/chat-ui-message-helpers.js +75 -16
- package/esm/src/config/loader.d.ts.map +1 -1
- package/esm/src/config/loader.js +37 -1
- package/esm/src/errors/catalog/build-errors.d.ts.map +1 -1
- package/esm/src/errors/catalog/build-errors.js +14 -0
- package/esm/src/errors/error-registry/build.d.ts +2 -0
- package/esm/src/errors/error-registry/build.d.ts.map +1 -1
- package/esm/src/errors/error-registry/build.js +8 -0
- package/esm/src/errors/error-registry/deploy.d.ts +4 -0
- package/esm/src/errors/error-registry/deploy.d.ts.map +1 -1
- package/esm/src/errors/error-registry/deploy.js +16 -0
- package/esm/src/errors/error-registry.d.ts +3 -0
- package/esm/src/errors/error-registry.d.ts.map +1 -1
- package/esm/src/errors/index.d.ts +2 -1
- package/esm/src/errors/index.d.ts.map +1 -1
- package/esm/src/errors/index.js +4 -3
- package/esm/src/errors/tenant-classification.d.ts +25 -0
- package/esm/src/errors/tenant-classification.d.ts.map +1 -0
- package/esm/src/errors/tenant-classification.js +61 -0
- package/esm/src/extensions/builtin-extensions.d.ts +10 -15
- package/esm/src/extensions/builtin-extensions.d.ts.map +1 -1
- package/esm/src/extensions/builtin-extensions.js +32 -26
- package/esm/src/extensions/deferred-extension.d.ts +4 -4
- package/esm/src/extensions/deferred-extension.js +4 -4
- package/esm/src/extensions/index.d.ts +1 -0
- package/esm/src/extensions/index.d.ts.map +1 -1
- package/esm/src/extensions/index.js +1 -0
- package/esm/src/html/hydration-script-builder/hydration-runtime.generated.js +1 -1
- package/esm/src/integrations/_data.d.ts.map +1 -1
- package/esm/src/integrations/_data.js +6 -0
- package/esm/src/integrations/schema.d.ts +8 -0
- package/esm/src/integrations/schema.d.ts.map +1 -1
- package/esm/src/integrations/schema.js +3 -0
- package/esm/src/integrations/types.d.ts +2 -0
- package/esm/src/integrations/types.d.ts.map +1 -1
- package/esm/src/internal-agents/run-stream.d.ts.map +1 -1
- package/esm/src/internal-agents/run-stream.js +35 -20
- package/esm/src/internal-agents/run-system-prompt.d.ts +7 -2
- package/esm/src/internal-agents/run-system-prompt.d.ts.map +1 -1
- package/esm/src/internal-agents/run-system-prompt.js +19 -13
- package/esm/src/internal-agents/schema.d.ts +2 -0
- package/esm/src/internal-agents/schema.d.ts.map +1 -1
- 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 +2 -18
- package/esm/src/modules/react-loader/ssr-module-loader/ssr-dependency-validator.d.ts +11 -0
- package/esm/src/modules/react-loader/ssr-module-loader/ssr-dependency-validator.d.ts.map +1 -1
- package/esm/src/modules/react-loader/ssr-module-loader/ssr-dependency-validator.js +53 -6
- package/esm/src/observability/application-error-contract.d.ts +4 -0
- package/esm/src/observability/application-error-contract.d.ts.map +1 -1
- package/esm/src/observability/application-errors.d.ts.map +1 -1
- package/esm/src/observability/application-errors.js +64 -3
- package/esm/src/platform/adapters/runtime/deno/http-server.d.ts.map +1 -1
- package/esm/src/platform/adapters/runtime/deno/http-server.js +2 -10
- package/esm/src/platform/adapters/runtime/shared/request-peer.d.ts +14 -0
- package/esm/src/platform/adapters/runtime/shared/request-peer.d.ts.map +1 -1
- package/esm/src/platform/adapters/runtime/shared/request-peer.js +82 -0
- package/esm/src/platform/compat/http/pinned-fetch.d.ts +1 -1
- package/esm/src/provider/runtime-loader/provider-http.d.ts +5 -1
- package/esm/src/provider/runtime-loader/provider-http.d.ts.map +1 -1
- package/esm/src/provider/runtime-loader/provider-http.js +55 -17
- package/esm/src/provider/shared/index.d.ts +1 -0
- package/esm/src/provider/shared/index.d.ts.map +1 -1
- package/esm/src/provider/shared/index.js +2 -0
- package/esm/src/provider/types.d.ts +1 -0
- package/esm/src/provider/types.d.ts.map +1 -1
- package/esm/src/react/components/ui/adapter/builtin/combobox.d.ts +3 -0
- package/esm/src/react/components/ui/adapter/builtin/combobox.d.ts.map +1 -0
- package/esm/src/react/components/ui/adapter/builtin/combobox.js +204 -0
- package/esm/src/react/components/ui/adapter/builtin/dialog.d.ts +3 -0
- package/esm/src/react/components/ui/adapter/builtin/dialog.d.ts.map +1 -0
- package/esm/src/react/components/ui/adapter/builtin/dialog.js +20 -0
- package/esm/src/react/components/ui/adapter/builtin/drawer.d.ts +3 -0
- package/esm/src/react/components/ui/adapter/builtin/drawer.d.ts.map +1 -0
- package/esm/src/react/components/ui/adapter/builtin/drawer.js +21 -0
- package/esm/src/react/components/ui/adapter/builtin/index.d.ts.map +1 -1
- package/esm/src/react/components/ui/adapter/builtin/index.js +10 -0
- package/esm/src/react/components/ui/adapter/builtin/popover.d.ts +3 -0
- package/esm/src/react/components/ui/adapter/builtin/popover.d.ts.map +1 -0
- package/esm/src/react/components/ui/adapter/builtin/popover.js +28 -0
- package/esm/src/react/components/ui/adapter/builtin/tabs.d.ts +3 -0
- package/esm/src/react/components/ui/adapter/builtin/tabs.d.ts.map +1 -0
- package/esm/src/react/components/ui/adapter/builtin/tabs.js +73 -0
- package/esm/src/react/components/ui/adapter/context.d.ts.map +1 -1
- package/esm/src/react/components/ui/adapter/context.js +10 -0
- package/esm/src/react/components/ui/adapter/contract.d.ts +212 -0
- package/esm/src/react/components/ui/adapter/contract.d.ts.map +1 -1
- package/esm/src/react/components/ui/adapter/token-scope.d.ts +24 -0
- package/esm/src/react/components/ui/adapter/token-scope.d.ts.map +1 -0
- package/esm/src/react/components/ui/adapter/token-scope.js +26 -0
- package/esm/src/react/components/ui/alert-dialog.d.ts +101 -0
- package/esm/src/react/components/ui/alert-dialog.d.ts.map +1 -0
- package/esm/src/react/components/ui/alert-dialog.js +181 -0
- package/esm/src/react/components/ui/aspect-ratio.d.ts +18 -0
- package/esm/src/react/components/ui/aspect-ratio.d.ts.map +1 -0
- package/esm/src/react/components/ui/aspect-ratio.js +13 -0
- package/esm/src/react/components/ui/autocomplete.d.ts +67 -0
- package/esm/src/react/components/ui/autocomplete.d.ts.map +1 -0
- package/esm/src/react/components/ui/autocomplete.js +59 -0
- package/esm/src/react/components/ui/breadcrumb.d.ts +86 -0
- package/esm/src/react/components/ui/breadcrumb.d.ts.map +1 -0
- package/esm/src/react/components/ui/breadcrumb.js +67 -0
- package/esm/src/react/components/ui/calendar.d.ts +40 -0
- package/esm/src/react/components/ui/calendar.d.ts.map +1 -0
- package/esm/src/react/components/ui/calendar.js +170 -0
- package/esm/src/react/components/ui/combobox.d.ts +74 -0
- package/esm/src/react/components/ui/combobox.d.ts.map +1 -0
- package/esm/src/react/components/ui/combobox.js +100 -0
- package/esm/src/react/components/ui/context-menu.d.ts +116 -0
- package/esm/src/react/components/ui/context-menu.d.ts.map +1 -0
- package/esm/src/react/components/ui/context-menu.js +168 -0
- package/esm/src/react/components/ui/date-picker.d.ts +69 -0
- package/esm/src/react/components/ui/date-picker.d.ts.map +1 -0
- package/esm/src/react/components/ui/date-picker.js +96 -0
- package/esm/src/react/components/ui/dialog.d.ts +41 -11
- package/esm/src/react/components/ui/dialog.d.ts.map +1 -1
- package/esm/src/react/components/ui/dialog.js +47 -28
- package/esm/src/react/components/ui/drawer.d.ts +31 -8
- package/esm/src/react/components/ui/drawer.d.ts.map +1 -1
- package/esm/src/react/components/ui/drawer.js +33 -22
- package/esm/src/react/components/ui/dropdown-menu.d.ts.map +1 -1
- package/esm/src/react/components/ui/dropdown-menu.js +7 -75
- package/esm/src/react/components/ui/field.d.ts +70 -0
- package/esm/src/react/components/ui/field.d.ts.map +1 -0
- package/esm/src/react/components/ui/field.js +161 -0
- package/esm/src/react/components/ui/file-type.d.ts +9 -8
- package/esm/src/react/components/ui/file-type.d.ts.map +1 -1
- package/esm/src/react/components/ui/file-type.js +8 -8
- package/esm/src/react/components/ui/hover-card.d.ts +82 -0
- package/esm/src/react/components/ui/hover-card.d.ts.map +1 -0
- package/esm/src/react/components/ui/hover-card.js +140 -0
- package/esm/src/react/components/ui/index.d.ts +23 -2
- package/esm/src/react/components/ui/index.d.ts.map +1 -1
- package/esm/src/react/components/ui/index.js +21 -0
- package/esm/src/react/components/ui/input-otp.d.ts +37 -0
- package/esm/src/react/components/ui/input-otp.d.ts.map +1 -0
- package/esm/src/react/components/ui/input-otp.js +42 -0
- package/esm/src/react/components/ui/menu-keyboard.d.ts +8 -0
- package/esm/src/react/components/ui/menu-keyboard.d.ts.map +1 -0
- package/esm/src/react/components/ui/menu-keyboard.js +76 -0
- package/esm/src/react/components/ui/menubar.d.ts +98 -0
- package/esm/src/react/components/ui/menubar.d.ts.map +1 -0
- package/esm/src/react/components/ui/menubar.js +173 -0
- package/esm/src/react/components/ui/meter.d.ts +45 -0
- package/esm/src/react/components/ui/meter.d.ts.map +1 -0
- package/esm/src/react/components/ui/meter.js +59 -0
- package/esm/src/react/components/ui/modal-surface.d.ts +7 -1
- package/esm/src/react/components/ui/modal-surface.d.ts.map +1 -1
- package/esm/src/react/components/ui/modal-surface.js +23 -6
- package/esm/src/react/components/ui/navigation-menu.d.ts +101 -0
- package/esm/src/react/components/ui/navigation-menu.d.ts.map +1 -0
- package/esm/src/react/components/ui/navigation-menu.js +195 -0
- package/esm/src/react/components/ui/number-field.d.ts +46 -0
- package/esm/src/react/components/ui/number-field.d.ts.map +1 -0
- package/esm/src/react/components/ui/number-field.js +121 -0
- package/esm/src/react/components/ui/pagination.d.ts +77 -0
- package/esm/src/react/components/ui/pagination.d.ts.map +1 -0
- package/esm/src/react/components/ui/pagination.js +62 -0
- package/esm/src/react/components/ui/popover.d.ts +42 -13
- package/esm/src/react/components/ui/popover.d.ts.map +1 -1
- package/esm/src/react/components/ui/popover.js +25 -12
- package/esm/src/react/components/ui/scroll-area.d.ts +38 -0
- package/esm/src/react/components/ui/scroll-area.d.ts.map +1 -0
- package/esm/src/react/components/ui/scroll-area.js +35 -0
- package/esm/src/react/components/ui/separator.d.ts +20 -0
- package/esm/src/react/components/ui/separator.d.ts.map +1 -0
- package/esm/src/react/components/ui/separator.js +13 -0
- package/esm/src/react/components/ui/slider.d.ts +44 -0
- package/esm/src/react/components/ui/slider.d.ts.map +1 -0
- package/esm/src/react/components/ui/slider.js +46 -0
- package/esm/src/react/components/ui/status.d.ts +6 -5
- package/esm/src/react/components/ui/status.d.ts.map +1 -1
- package/esm/src/react/components/ui/status.js +4 -4
- package/esm/src/react/components/ui/tabs.d.ts +32 -9
- package/esm/src/react/components/ui/tabs.d.ts.map +1 -1
- package/esm/src/react/components/ui/tabs.js +46 -22
- package/esm/src/react/components/ui/toggle.d.ts +26 -0
- package/esm/src/react/components/ui/toggle.d.ts.map +1 -0
- package/esm/src/react/components/ui/toggle.js +29 -0
- package/esm/src/react/components/ui/use-isomorphic-layout-effect.d.ts +2 -1
- package/esm/src/react/components/ui/use-isomorphic-layout-effect.d.ts.map +1 -1
- package/esm/src/react/components/ui/use-isomorphic-layout-effect.js +6 -3
- package/esm/src/rendering/chunk-optimizer/source-imports.d.ts.map +1 -1
- package/esm/src/rendering/chunk-optimizer/source-imports.js +4 -114
- package/esm/src/rendering/orchestrator/css-candidate-manifest.d.ts.map +1 -1
- package/esm/src/rendering/orchestrator/css-candidate-manifest.js +30 -1
- package/esm/src/rendering/orchestrator/module-loader/build-failure.d.ts +10 -0
- package/esm/src/rendering/orchestrator/module-loader/build-failure.d.ts.map +1 -1
- package/esm/src/rendering/orchestrator/module-loader/build-failure.js +50 -3
- package/esm/src/rendering/orchestrator/module-loader/dependency-resolver.d.ts +2 -0
- package/esm/src/rendering/orchestrator/module-loader/dependency-resolver.d.ts.map +1 -1
- package/esm/src/rendering/orchestrator/module-loader/dependency-resolver.js +21 -6
- package/esm/src/rendering/orchestrator/module-loader/index.d.ts +2 -1
- package/esm/src/rendering/orchestrator/module-loader/index.d.ts.map +1 -1
- package/esm/src/rendering/orchestrator/module-loader/index.js +190 -7
- package/esm/src/rendering/orchestrator/module-loader/module-persistence.d.ts +4 -0
- package/esm/src/rendering/orchestrator/module-loader/module-persistence.d.ts.map +1 -1
- package/esm/src/rendering/orchestrator/module-loader/module-persistence.js +374 -7
- package/esm/src/rendering/orchestrator/pipeline.d.ts.map +1 -1
- package/esm/src/rendering/orchestrator/pipeline.js +12 -1
- package/esm/src/runs/runs-client.d.ts +2 -4
- package/esm/src/runs/runs-client.d.ts.map +1 -1
- package/esm/src/runs/schemas.d.ts +18 -8
- package/esm/src/runs/schemas.d.ts.map +1 -1
- package/esm/src/runs/schemas.js +26 -0
- package/esm/src/runtime/model-call-context.d.ts +6 -1
- package/esm/src/runtime/model-call-context.d.ts.map +1 -1
- package/esm/src/runtime/runtime-bridge.d.ts.map +1 -1
- package/esm/src/runtime/runtime-bridge.js +133 -15
- package/esm/src/schedule/factory.d.ts +8 -2
- package/esm/src/schedule/factory.d.ts.map +1 -1
- package/esm/src/schedule/factory.js +0 -8
- package/esm/src/schedule/index.d.ts +10 -1
- package/esm/src/schedule/index.d.ts.map +1 -1
- package/esm/src/schedule/index.js +9 -0
- package/esm/src/schedule/types.d.ts +30 -11
- package/esm/src/schedule/types.d.ts.map +1 -1
- package/esm/src/schedule/validation.d.ts +17 -0
- package/esm/src/schedule/validation.d.ts.map +1 -1
- package/esm/src/schedule/validation.js +93 -5
- package/esm/src/security/sandbox/worker-pool.d.ts.map +1 -1
- package/esm/src/security/sandbox/worker-pool.js +6 -1
- package/esm/src/server/bootstrap.d.ts.map +1 -1
- package/esm/src/server/bootstrap.js +6 -0
- package/esm/src/server/dev-server/index.d.ts +1 -1
- package/esm/src/server/dev-server/index.d.ts.map +1 -1
- package/esm/src/server/dev-server/server.d.ts +7 -3
- package/esm/src/server/dev-server/server.d.ts.map +1 -1
- package/esm/src/server/dev-server/server.js +12 -3
- package/esm/src/server/dev-server/types.d.ts +7 -1
- package/esm/src/server/dev-server/types.d.ts.map +1 -1
- package/esm/src/server/dev-server.d.ts +1 -1
- package/esm/src/server/dev-server.d.ts.map +1 -1
- package/esm/src/server/handlers/dev/framework-candidates.generated.d.ts.map +1 -1
- package/esm/src/server/handlers/dev/framework-candidates.generated.js +2509 -34
- package/esm/src/server/handlers/dev/projects/index.d.ts.map +1 -1
- package/esm/src/server/handlers/dev/projects/index.js +3 -0
- package/esm/src/server/handlers/request/agent-stream.handler.d.ts.map +1 -1
- package/esm/src/server/handlers/request/agent-stream.handler.js +29 -24
- package/esm/src/server/index.d.ts +3 -3
- package/esm/src/server/index.d.ts.map +1 -1
- package/esm/src/server/index.js +10 -5
- package/esm/src/server/node-handler.d.ts.map +1 -1
- package/esm/src/server/node-handler.js +4 -1
- package/esm/src/server/production-server.d.ts.map +1 -1
- package/esm/src/server/production-server.js +2 -1
- package/esm/src/server/project-env/cache.d.ts +17 -0
- package/esm/src/server/project-env/cache.d.ts.map +1 -1
- package/esm/src/server/project-env/cache.js +78 -2
- package/esm/src/server/project-env/fetcher.d.ts.map +1 -1
- package/esm/src/server/project-env/fetcher.js +24 -14
- package/esm/src/server/project-env/index.d.ts +1 -1
- package/esm/src/server/project-env/index.d.ts.map +1 -1
- package/esm/src/server/project-env/index.js +1 -1
- package/esm/src/server/project-env/internal-authorization.d.ts +7 -0
- package/esm/src/server/project-env/internal-authorization.d.ts.map +1 -0
- package/esm/src/server/project-env/internal-authorization.js +32 -0
- package/esm/src/server/runtime-handler/index.d.ts.map +1 -1
- package/esm/src/server/runtime-handler/index.js +1 -1
- package/esm/src/server/runtime-handler/projects-handler.d.ts +1 -1
- package/esm/src/server/runtime-handler/projects-handler.d.ts.map +1 -1
- package/esm/src/server/runtime-handler/projects-handler.js +4 -2
- package/esm/src/transforms/esm/http-bundler.d.ts.map +1 -1
- package/esm/src/transforms/esm/http-bundler.js +6 -5
- package/esm/src/transforms/esm/http-cache-helpers.d.ts +11 -0
- package/esm/src/transforms/esm/http-cache-helpers.d.ts.map +1 -1
- package/esm/src/transforms/esm/http-cache-helpers.js +35 -0
- package/esm/src/transforms/esm/http-cache.d.ts.map +1 -1
- package/esm/src/transforms/esm/http-cache.js +16 -10
- package/esm/src/transforms/esm/specifier-resolver.d.ts.map +1 -1
- package/esm/src/transforms/esm/specifier-resolver.js +87 -7
- package/esm/src/transforms/import-rewriter/strategies/alias-strategy.d.ts +2 -0
- package/esm/src/transforms/import-rewriter/strategies/alias-strategy.d.ts.map +1 -1
- package/esm/src/transforms/import-rewriter/strategies/alias-strategy.js +11 -6
- package/esm/src/transforms/md/compiler/md-compiler.d.ts.map +1 -1
- package/esm/src/transforms/md/compiler/md-compiler.js +12 -5
- package/esm/src/transforms/mdx/compiler/frontmatter-extractor.d.ts +2 -0
- package/esm/src/transforms/mdx/compiler/frontmatter-extractor.d.ts.map +1 -1
- package/esm/src/transforms/mdx/compiler/frontmatter-extractor.js +33 -1
- package/esm/src/transforms/mdx/compiler/mdx-compiler.d.ts.map +1 -1
- package/esm/src/transforms/mdx/compiler/mdx-compiler.js +46 -7
- package/esm/src/transforms/mdx/esm-module-loader/cache/index.d.ts.map +1 -1
- package/esm/src/transforms/mdx/esm-module-loader/cache/index.js +8 -2
- package/esm/src/transforms/mdx/esm-module-loader/cache-format.d.ts +1 -0
- package/esm/src/transforms/mdx/esm-module-loader/cache-format.d.ts.map +1 -1
- package/esm/src/transforms/mdx/esm-module-loader/cache-format.js +3 -0
- package/esm/src/transforms/mdx/esm-module-loader/loader-helpers.d.ts +4 -0
- package/esm/src/transforms/mdx/esm-module-loader/loader-helpers.d.ts.map +1 -1
- package/esm/src/transforms/mdx/esm-module-loader/loader-helpers.js +44 -8
- package/esm/src/transforms/mdx/esm-module-loader/missing-module.d.ts +2 -0
- package/esm/src/transforms/mdx/esm-module-loader/missing-module.d.ts.map +1 -1
- package/esm/src/transforms/mdx/esm-module-loader/missing-module.js +4 -0
- package/esm/src/transforms/mdx/esm-module-loader/module-fetcher/http-fallback.d.ts.map +1 -1
- package/esm/src/transforms/mdx/esm-module-loader/module-fetcher/http-fallback.js +5 -1
- package/esm/src/transforms/mdx/esm-module-loader/module-fetcher/http-fetcher.d.ts +2 -0
- package/esm/src/transforms/mdx/esm-module-loader/module-fetcher/http-fetcher.d.ts.map +1 -1
- package/esm/src/transforms/mdx/esm-module-loader/module-fetcher/http-fetcher.js +50 -11
- package/esm/src/transforms/mdx/esm-module-loader/module-fetcher/nested-imports.d.ts +24 -12
- package/esm/src/transforms/mdx/esm-module-loader/module-fetcher/nested-imports.d.ts.map +1 -1
- package/esm/src/transforms/mdx/esm-module-loader/module-fetcher/nested-imports.js +201 -18
- package/esm/src/transforms/mdx/esm-module-loader/types.d.ts +5 -0
- package/esm/src/transforms/mdx/esm-module-loader/types.d.ts.map +1 -1
- package/esm/src/transforms/mdx/esm-module-loader/utils/source-spans.d.ts +22 -2
- package/esm/src/transforms/mdx/esm-module-loader/utils/source-spans.d.ts.map +1 -1
- package/esm/src/transforms/mdx/esm-module-loader/utils/source-spans.js +2080 -129
- package/esm/src/transforms/mdx/esm-module-loader/utils/stub-module.d.ts +11 -1
- package/esm/src/transforms/mdx/esm-module-loader/utils/stub-module.d.ts.map +1 -1
- package/esm/src/transforms/mdx/esm-module-loader/utils/stub-module.js +32 -15
- package/esm/src/transforms/pipeline/stages/compile.d.ts.map +1 -1
- package/esm/src/transforms/pipeline/stages/compile.js +44 -0
- package/esm/src/transforms/shared/specifier-suffix.d.ts +25 -0
- package/esm/src/transforms/shared/specifier-suffix.d.ts.map +1 -0
- package/esm/src/transforms/shared/specifier-suffix.js +43 -0
- package/esm/src/trigger/index.d.ts +2 -2
- package/esm/src/trigger/index.d.ts.map +1 -1
- package/esm/src/trigger/index.js +1 -1
- package/esm/src/trigger/local-runner.d.ts +2 -2
- package/esm/src/trigger/local-runner.d.ts.map +1 -1
- package/esm/src/trigger/local-runner.js +11 -4
- package/esm/src/trigger/target.d.ts +97 -5
- package/esm/src/trigger/target.d.ts.map +1 -1
- package/esm/src/trigger/target.js +175 -5
- package/esm/src/utils/version-constant.d.ts +1 -1
- package/esm/src/utils/version-constant.js +1 -1
- package/esm/src/webhook/types.d.ts +21 -6
- package/esm/src/webhook/types.d.ts.map +1 -1
- package/esm/src/webhook/validation.d.ts.map +1 -1
- package/esm/src/webhook/validation.js +27 -39
- package/esm/templates/index.d.ts +1 -1
- package/esm/templates/index.d.ts.map +1 -1
- package/esm/templates/loader.d.ts +6 -6
- package/esm/templates/loader.d.ts.map +1 -1
- package/esm/templates/loader.js +34 -18
- package/esm/templates/manifest.generated.d.ts +3 -0
- package/esm/templates/manifest.generated.d.ts.map +1 -0
- package/esm/templates/manifest.generated.js +2 -0
- package/package.json +8 -8
- package/esm/templates/manifest.d.ts +0 -664
- package/esm/templates/manifest.d.ts.map +0 -1
- package/esm/templates/manifest.js +0 -662
|
@@ -9,6 +9,7 @@
|
|
|
9
9
|
* @module platform/adapters/runtime/shared/request-peer
|
|
10
10
|
*/
|
|
11
11
|
const requestPeerProvenance = new WeakMap();
|
|
12
|
+
const interceptorHandledRequests = new WeakSet();
|
|
12
13
|
const MAX_PEER_HOSTNAME_CHARACTERS = 255;
|
|
13
14
|
const DECIMAL_OCTET_PATTERN = /^(?:0|[1-9][0-9]{0,2})$/;
|
|
14
15
|
const IPV4_MAPPED_IPV6_PATTERN = /^::ffff:([0-9a-f]{1,4}):([0-9a-f]{1,4})$/;
|
|
@@ -68,6 +69,75 @@ export function recordRequestPeerFromTransport(request, provenance) {
|
|
|
68
69
|
}));
|
|
69
70
|
return true;
|
|
70
71
|
}
|
|
72
|
+
/** @internal Record the native peer supplied to a Deno.serve handler. */
|
|
73
|
+
export function recordDenoServeRequestPeer(request, info) {
|
|
74
|
+
if (typeof info !== "object" || info === null)
|
|
75
|
+
return false;
|
|
76
|
+
try {
|
|
77
|
+
const remoteAddress = info.remoteAddr;
|
|
78
|
+
if (remoteAddress?.transport !== "tcp" ||
|
|
79
|
+
typeof remoteAddress.hostname !== "string") {
|
|
80
|
+
return false;
|
|
81
|
+
}
|
|
82
|
+
return recordRequestPeerFromTransport(request, {
|
|
83
|
+
runtime: "deno",
|
|
84
|
+
transport: "tcp",
|
|
85
|
+
hostname: remoteAddress.hostname,
|
|
86
|
+
});
|
|
87
|
+
}
|
|
88
|
+
catch {
|
|
89
|
+
return false;
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
/** @internal Record the native peer supplied by a Node IncomingMessage. */
|
|
93
|
+
export function recordNodeIncomingRequestPeer(request, incoming) {
|
|
94
|
+
if (typeof incoming !== "object" || incoming === null)
|
|
95
|
+
return false;
|
|
96
|
+
try {
|
|
97
|
+
const socket = incoming.socket;
|
|
98
|
+
if (typeof socket?.remoteAddress !== "string")
|
|
99
|
+
return false;
|
|
100
|
+
return recordRequestPeerFromTransport(request, {
|
|
101
|
+
runtime: "node",
|
|
102
|
+
transport: "tcp",
|
|
103
|
+
hostname: socket.remoteAddress,
|
|
104
|
+
});
|
|
105
|
+
}
|
|
106
|
+
catch {
|
|
107
|
+
return false;
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
/** @internal Record the native peer supplied by a Bun server context. */
|
|
111
|
+
export function recordBunServerRequestPeer(request, server) {
|
|
112
|
+
if (typeof server !== "object" || server === null)
|
|
113
|
+
return false;
|
|
114
|
+
try {
|
|
115
|
+
const requestIP = server.requestIP;
|
|
116
|
+
if (typeof requestIP !== "function")
|
|
117
|
+
return false;
|
|
118
|
+
const peer = requestIP.call(server, request);
|
|
119
|
+
if (typeof peer?.address !== "string")
|
|
120
|
+
return false;
|
|
121
|
+
return recordRequestPeerFromTransport(request, {
|
|
122
|
+
runtime: "bun",
|
|
123
|
+
transport: "tcp",
|
|
124
|
+
hostname: peer.address,
|
|
125
|
+
});
|
|
126
|
+
}
|
|
127
|
+
catch {
|
|
128
|
+
return false;
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
/**
|
|
132
|
+
* @internal Record native peer context passed through a public handler bridge.
|
|
133
|
+
* Supports Deno.serve handler info, Node IncomingMessage values, and Bun server
|
|
134
|
+
* context values.
|
|
135
|
+
*/
|
|
136
|
+
export function recordHandlerRequestPeer(request, context) {
|
|
137
|
+
return recordDenoServeRequestPeer(request, context) ||
|
|
138
|
+
recordNodeIncomingRequestPeer(request, context) ||
|
|
139
|
+
recordBunServerRequestPeer(request, context);
|
|
140
|
+
}
|
|
71
141
|
/** @internal Read immutable transport provenance without consulting headers. */
|
|
72
142
|
export function getRequestPeerProvenance(request) {
|
|
73
143
|
return requestPeerProvenance.get(request);
|
|
@@ -87,6 +157,18 @@ export function inheritRequestPeerProvenance(source, target) {
|
|
|
87
157
|
requestPeerProvenance.set(target, provenance);
|
|
88
158
|
return target;
|
|
89
159
|
}
|
|
160
|
+
/** @internal Run an interceptor without discarding transport peer authority. */
|
|
161
|
+
export async function runRequestInterceptor(request, interceptor) {
|
|
162
|
+
interceptorHandledRequests.add(request);
|
|
163
|
+
const intercepted = await interceptor(request);
|
|
164
|
+
if (intercepted === request)
|
|
165
|
+
return request;
|
|
166
|
+
if (interceptorHandledRequests.has(intercepted)) {
|
|
167
|
+
throw new TypeError("Request interceptors must return a fresh replacement Request");
|
|
168
|
+
}
|
|
169
|
+
interceptorHandledRequests.add(intercepted);
|
|
170
|
+
return inheritRequestPeerProvenance(request, intercepted);
|
|
171
|
+
}
|
|
90
172
|
/** @internal True for IPv4 127/8, IPv6 ::1, or mapped IPv4 127/8. */
|
|
91
173
|
export function isLoopbackAddress(hostname) {
|
|
92
174
|
const ipv4 = parseCanonicalIpv4(hostname);
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
* Client identity for guarded egress, standing in for the runtime-supplied
|
|
8
8
|
* `user-agent` (`node`, `Deno/x.y.z`) that this transport cannot inherit.
|
|
9
9
|
*/
|
|
10
|
-
export declare const DEFAULT_OUTBOUND_USER_AGENT = "veryfront/0.1.
|
|
10
|
+
export declare const DEFAULT_OUTBOUND_USER_AGENT = "veryfront/0.1.1239";
|
|
11
11
|
/**
|
|
12
12
|
* Fill in the request headers a plain `fetch` attaches on its own, leaving any
|
|
13
13
|
* the caller set untouched. This transport talks to `node:http` directly, so
|
|
@@ -68,7 +68,11 @@ export declare function requestJson(options: {
|
|
|
68
68
|
maxResponseBytes?: number;
|
|
69
69
|
}): Promise<unknown>;
|
|
70
70
|
/**
|
|
71
|
-
* Request a streaming response.
|
|
71
|
+
* Request a streaming response. When the request body is replayable,
|
|
72
|
+
* classified rate-limit responses are retried up to two times before provider
|
|
73
|
+
* output is exposed, with all retry waits and attempts bounded by the stream
|
|
74
|
+
* header deadline. ReadableStream request bodies are not retried because fetch
|
|
75
|
+
* can consume them on the first attempt.
|
|
72
76
|
*
|
|
73
77
|
* Response headers and error bodies have a 30-second default deadline. After
|
|
74
78
|
* headers arrive, caller cancellation remains connected to the returned body;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"provider-http.d.ts","sourceRoot":"","sources":["../../../../src/src/provider/runtime-loader/provider-http.ts"],"names":[],"mappings":"AAIA;;;;;GA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WAAW,GACxB,OAAO,CAAC,aAAa,CAAC,CA6JxB;AAiWD;;;;;;GAMG;AACH,wBAAsB,WAAW,CAAC,OAAO,EAAE;IACzC,GAAG,EAAE,MAAM,CAAC;IACZ,SAAS,EAAE,OAAO,UAAU,CAAC,KAAK,CAAC;IACnC,IAAI,EAAE,WAAW,CAAC;IAClB,aAAa,EAAE,MAAM,CAAC;IACtB,YAAY,EAAE,YAAY,CAAC;IAC3B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,gBAAgB,CAAC,EAAE,MAAM,CAAC;CAC3B,GAAG,OAAO,CAAC,OAAO,CAAC,CAqDnB;AAED;;;;;;;;;;GAUG;AACH,wBAAsB,aAAa,CAAC,OAAO,EAAE;IAC3C,GAAG,EAAE,MAAM,CAAC;IACZ,SAAS,EAAE,OAAO,UAAU,CAAC,KAAK,CAAC;IACnC,IAAI,EAAE,WAAW,CAAC;IAClB,aAAa,EAAE,MAAM,CAAC;IACtB,YAAY,EAAE,YAAY,CAAC;IAC3B,gBAAgB,CAAC,EAAE,MAAM,CAAC;CAC3B,GAAG,OAAO,CAAC,cAAc,CAAC,UAAU,CAAC,CAAC,CAiEtC"}
|
|
@@ -5,6 +5,8 @@ import { MAX_TIMER_DELAY_MS, normalizeTimerDurationMs } from "../../utils/timer.
|
|
|
5
5
|
const MAX_ERROR_BODY_BYTES = 8_000;
|
|
6
6
|
const DEFAULT_PROVIDER_JSON_TIMEOUT_MS = 5 * 60_000;
|
|
7
7
|
const DEFAULT_PROVIDER_STREAM_HEADERS_TIMEOUT_MS = 30_000;
|
|
8
|
+
const MAX_PROVIDER_STREAM_RATE_LIMIT_RETRIES = 2;
|
|
9
|
+
const DEFAULT_PROVIDER_STREAM_RATE_LIMIT_RETRY_DELAY_MS = 1_000;
|
|
8
10
|
const DEFAULT_PROVIDER_JSON_MAX_BYTES = 32 * 1024 * 1024;
|
|
9
11
|
const MAX_PROVIDER_JSON_MAX_BYTES = 256 * 1024 * 1024;
|
|
10
12
|
const MAX_PROVIDER_JSON_BODY_READS = 65_536;
|
|
@@ -367,6 +369,25 @@ async function waitForAbortable(operation, abortSignal, onLateValue) {
|
|
|
367
369
|
});
|
|
368
370
|
});
|
|
369
371
|
}
|
|
372
|
+
async function waitForProviderRateLimitRetry(delayMs, abortSignal) {
|
|
373
|
+
abortSignal.throwIfAborted();
|
|
374
|
+
if (delayMs === 0)
|
|
375
|
+
return;
|
|
376
|
+
await new Promise((resolve, reject) => {
|
|
377
|
+
const timeoutId = setTimeout(() => {
|
|
378
|
+
abortSignal.removeEventListener("abort", onAbort);
|
|
379
|
+
resolve();
|
|
380
|
+
}, delayMs);
|
|
381
|
+
const onAbort = () => {
|
|
382
|
+
clearTimeout(timeoutId);
|
|
383
|
+
abortSignal.removeEventListener("abort", onAbort);
|
|
384
|
+
reject(abortSignal.reason);
|
|
385
|
+
};
|
|
386
|
+
abortSignal.addEventListener("abort", onAbort, { once: true });
|
|
387
|
+
if (abortSignal.aborted)
|
|
388
|
+
onAbort();
|
|
389
|
+
});
|
|
390
|
+
}
|
|
370
391
|
function cancelLateResponse(response) {
|
|
371
392
|
try {
|
|
372
393
|
const cancellation = response.body?.cancel();
|
|
@@ -587,7 +608,11 @@ export async function requestJson(options) {
|
|
|
587
608
|
}
|
|
588
609
|
}
|
|
589
610
|
/**
|
|
590
|
-
* Request a streaming response.
|
|
611
|
+
* Request a streaming response. When the request body is replayable,
|
|
612
|
+
* classified rate-limit responses are retried up to two times before provider
|
|
613
|
+
* output is exposed, with all retry waits and attempts bounded by the stream
|
|
614
|
+
* header deadline. ReadableStream request bodies are not retried because fetch
|
|
615
|
+
* can consume them on the first attempt.
|
|
591
616
|
*
|
|
592
617
|
* Response headers and error bodies have a 30-second default deadline. After
|
|
593
618
|
* headers arrive, caller cancellation remains connected to the returned body;
|
|
@@ -596,24 +621,37 @@ export async function requestJson(options) {
|
|
|
596
621
|
export async function requestStream(options) {
|
|
597
622
|
const deadline = createRequestDeadline(options.init, options.headersTimeoutMs ?? DEFAULT_PROVIDER_STREAM_HEADERS_TIMEOUT_MS, "headersTimeoutMs");
|
|
598
623
|
let streamOwnsDeadline = false;
|
|
624
|
+
let rateLimitRetryCount = 0;
|
|
625
|
+
const requestBodyIsReplayable = !(deadline.init.body instanceof ReadableStream);
|
|
599
626
|
try {
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
627
|
+
while (true) {
|
|
628
|
+
const response = await waitForAbortable(() => options.fetchImpl(options.url, deadline.init), deadline.deadlineSignal, cancelLateResponse);
|
|
629
|
+
if (!response.ok) {
|
|
630
|
+
const err = await buildProviderError(options.providerKind, response, deadline.deadlineSignal);
|
|
631
|
+
err.message = `${options.providerLabel} request failed: ${err.message}`;
|
|
632
|
+
if (err instanceof ProviderRateLimitError &&
|
|
633
|
+
requestBodyIsReplayable &&
|
|
634
|
+
rateLimitRetryCount < MAX_PROVIDER_STREAM_RATE_LIMIT_RETRIES) {
|
|
635
|
+
const retryDelayMs = err.retryAfterMs ??
|
|
636
|
+
DEFAULT_PROVIDER_STREAM_RATE_LIMIT_RETRY_DELAY_MS * 2 ** rateLimitRetryCount;
|
|
637
|
+
rateLimitRetryCount++;
|
|
638
|
+
await waitForProviderRateLimitRetry(retryDelayMs, deadline.deadlineSignal);
|
|
639
|
+
continue;
|
|
640
|
+
}
|
|
641
|
+
throw err;
|
|
642
|
+
}
|
|
643
|
+
if (!response.body) {
|
|
644
|
+
throw new ProviderRequestError({
|
|
645
|
+
provider: options.providerKind,
|
|
646
|
+
status: response.status,
|
|
647
|
+
message: `${options.providerLabel} request failed: stream body missing`,
|
|
648
|
+
retryable: false,
|
|
649
|
+
});
|
|
650
|
+
}
|
|
651
|
+
deadline.cancelTimeout();
|
|
652
|
+
streamOwnsDeadline = true;
|
|
653
|
+
return streamWithCleanup(response.body, deadline.deadlineSignal, deadline.abort, deadline.dispose);
|
|
613
654
|
}
|
|
614
|
-
deadline.cancelTimeout();
|
|
615
|
-
streamOwnsDeadline = true;
|
|
616
|
-
return streamWithCleanup(response.body, deadline.deadlineSignal, deadline.abort, deadline.dispose);
|
|
617
655
|
}
|
|
618
656
|
catch (error) {
|
|
619
657
|
if (deadline.timedOut) {
|
|
@@ -15,4 +15,5 @@ export { MAX_PROVIDER_SSE_BUFFER_CODE_UNITS, parseFinalSseChunk, parseSseChunk,
|
|
|
15
15
|
export { buildProviderError, createWarningCollector, isNumberArray, jsonValuesEqual, mergeUsage, parseRetryAfterMs, ProviderError, ProviderOverloadedError, ProviderQuotaError, ProviderRateLimitError, ProviderRequestError, readGatewayBillingMode, readProviderOptions, readRecord, readTextParts, requestJson, requestStream, snapshotJsonValue, snapshotProviderJsonValue, stringifyJsonValue, stringifyToolArguments, stringifyToolResultValue, toOpenAICompatibleMessages, toOpenAICompatibleTools, unwrapToolInputSchema, } from "../runtime-loader.js";
|
|
16
16
|
export type { JsonSnapshotOptions, JsonSnapshotValue, OpenAICompatibleChatMessage, OpenAICompatibleChatRequest, ProviderWarning, RuntimeUsage, } from "../runtime-loader.js";
|
|
17
17
|
export type { ModelRuntimeCallOptions, ModelRuntimePromptMessage, ModelRuntimeToolDefinition, RuntimeAssistantContentPart, RuntimePromptMessage, RuntimeReasoningOption, RuntimeResponseFormat, } from "../types.js";
|
|
18
|
+
export { canIdentifyProxyWithoutHooks, isProxyWithoutHooks, } from "../../platform/compat/error-introspection.js";
|
|
18
19
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/src/provider/shared/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAGH,OAAO,4BAA4B,CAAC;AAEpC,OAAO,EACL,uBAAuB,EACvB,qBAAqB,EACrB,2BAA2B,EAC3B,iCAAiC,EACjC,2BAA2B,EAC3B,qBAAqB,EACrB,qBAAqB,GACtB,MAAM,yCAAyC,CAAC;AAGjD,OAAO,EACL,0BAA0B,EAC1B,uBAAuB,EACvB,uBAAuB,GACxB,MAAM,4CAA4C,CAAC;AAGpD,OAAO,EACL,+BAA+B,EAC/B,8BAA8B,GAC/B,MAAM,wCAAwC,CAAC;AAGhD,OAAO,EACL,kCAAkC,EAClC,kBAAkB,EAClB,aAAa,GACd,MAAM,mCAAmC,CAAC;AAG3C,OAAO,EACL,kBAAkB,EAClB,sBAAsB,EACtB,aAAa,EACb,eAAe,EACf,UAAU,EACV,iBAAiB,EACjB,aAAa,EACb,uBAAuB,EACvB,kBAAkB,EAClB,sBAAsB,EACtB,oBAAoB,EACpB,sBAAsB,EACtB,mBAAmB,EACnB,UAAU,EACV,aAAa,EACb,WAAW,EACX,aAAa,EACb,iBAAiB,EACjB,yBAAyB,EACzB,kBAAkB,EAClB,sBAAsB,EACtB,wBAAwB,EACxB,0BAA0B,EAC1B,uBAAuB,EACvB,qBAAqB,GACtB,MAAM,sBAAsB,CAAC;AAE9B,YAAY,EACV,mBAAmB,EACnB,iBAAiB,EACjB,2BAA2B,EAC3B,2BAA2B,EAC3B,eAAe,EACf,YAAY,GACb,MAAM,sBAAsB,CAAC;AAC9B,YAAY,EACV,uBAAuB,EACvB,yBAAyB,EACzB,0BAA0B,EAC1B,2BAA2B,EAC3B,oBAAoB,EACpB,sBAAsB,EACtB,qBAAqB,GACtB,MAAM,aAAa,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/src/provider/shared/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAGH,OAAO,4BAA4B,CAAC;AAEpC,OAAO,EACL,uBAAuB,EACvB,qBAAqB,EACrB,2BAA2B,EAC3B,iCAAiC,EACjC,2BAA2B,EAC3B,qBAAqB,EACrB,qBAAqB,GACtB,MAAM,yCAAyC,CAAC;AAGjD,OAAO,EACL,0BAA0B,EAC1B,uBAAuB,EACvB,uBAAuB,GACxB,MAAM,4CAA4C,CAAC;AAGpD,OAAO,EACL,+BAA+B,EAC/B,8BAA8B,GAC/B,MAAM,wCAAwC,CAAC;AAGhD,OAAO,EACL,kCAAkC,EAClC,kBAAkB,EAClB,aAAa,GACd,MAAM,mCAAmC,CAAC;AAG3C,OAAO,EACL,kBAAkB,EAClB,sBAAsB,EACtB,aAAa,EACb,eAAe,EACf,UAAU,EACV,iBAAiB,EACjB,aAAa,EACb,uBAAuB,EACvB,kBAAkB,EAClB,sBAAsB,EACtB,oBAAoB,EACpB,sBAAsB,EACtB,mBAAmB,EACnB,UAAU,EACV,aAAa,EACb,WAAW,EACX,aAAa,EACb,iBAAiB,EACjB,yBAAyB,EACzB,kBAAkB,EAClB,sBAAsB,EACtB,wBAAwB,EACxB,0BAA0B,EAC1B,uBAAuB,EACvB,qBAAqB,GACtB,MAAM,sBAAsB,CAAC;AAE9B,YAAY,EACV,mBAAmB,EACnB,iBAAiB,EACjB,2BAA2B,EAC3B,2BAA2B,EAC3B,eAAe,EACf,YAAY,GACb,MAAM,sBAAsB,CAAC;AAC9B,YAAY,EACV,uBAAuB,EACvB,yBAAyB,EACzB,0BAA0B,EAC1B,2BAA2B,EAC3B,oBAAoB,EACpB,sBAAsB,EACtB,qBAAqB,GACtB,MAAM,aAAa,CAAC;AAGrB,OAAO,EACL,4BAA4B,EAC5B,mBAAmB,GACpB,MAAM,8CAA8C,CAAC"}
|
|
@@ -18,3 +18,5 @@ export { TOOL_INPUT_PENDING_THRESHOLD_MS, withToolInputStatusTransitions, } from
|
|
|
18
18
|
export { MAX_PROVIDER_SSE_BUFFER_CODE_UNITS, parseFinalSseChunk, parseSseChunk, } from "../runtime-loader/provider-sse.js";
|
|
19
19
|
// Retry, error, HTTP, usage, and JSON boundary plumbing.
|
|
20
20
|
export { buildProviderError, createWarningCollector, isNumberArray, jsonValuesEqual, mergeUsage, parseRetryAfterMs, ProviderError, ProviderOverloadedError, ProviderQuotaError, ProviderRateLimitError, ProviderRequestError, readGatewayBillingMode, readProviderOptions, readRecord, readTextParts, requestJson, requestStream, snapshotJsonValue, snapshotProviderJsonValue, stringifyJsonValue, stringifyToolArguments, stringifyToolResultValue, toOpenAICompatibleMessages, toOpenAICompatibleTools, unwrapToolInputSchema, } from "../runtime-loader.js";
|
|
21
|
+
// No-hook runtime inspection used by provider extensions at JSON boundaries.
|
|
22
|
+
export { canIdentifyProxyWithoutHooks, isProxyWithoutHooks, } from "../../platform/compat/error-introspection.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/src/provider/types.ts"],"names":[],"mappings":"AAAA,OAAO,yBAAyB,CAAC;AACjC,MAAM,WAAW,eAAe;IAC9B,QAAQ,CAAC,oBAAoB,CAAC,EAAE,MAAM,CAAC;IACvC,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,CAAC;IAC1B,QAAQ,EAAE,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;CACjC;AAED,KAAK,iCAAiC,GAClC;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,GAC9B;IACA,IAAI,EAAE,WAAW,CAAC;IAClB,UAAU,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE,MAAM,CAAC;IACjB,KAAK,EAAE,OAAO,CAAC;IACf,gBAAgB,CAAC,EAAE,OAAO,CAAC;CAC5B,GACC;IACA,IAAI,EAAE,WAAW,CAAC;IAClB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB,CAAC;AAEJ;;;;;;;;GAQG;AACH,MAAM,MAAM,2BAA2B,GACnC,OAAO,CAAC,iCAAiC,EAAE;IAAE,IAAI,EAAE,WAAW,CAAA;CAAE,CAAC,GACjE;IACA,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BAAgB,CAAC;AAoRnE,eAAO,MAAM,eAAe,EAAE,aAK7B,CAAC"}
|
|
@@ -0,0 +1,204 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Builtin Combobox adapter - the zero-dependency, hand-rolled engine for the
|
|
3
|
+
* Combobox primitive: a `role="combobox"` text input filtering a `role="listbox"`
|
|
4
|
+
* of `role="option"`s, with `aria-activedescendant` keyboard navigation
|
|
5
|
+
* (ArrowUp/Down/Home/End/Enter/Escape) over the *filtered* option set. Filtering,
|
|
6
|
+
* the option registry, and the active-descendant live here (the adapter), not in
|
|
7
|
+
* the skin - see {@link ComboboxState}. The floating listbox portals into the
|
|
8
|
+
* token scope via `Floating`. No `cmdk`/Base UI dependency; those are opt-in
|
|
9
|
+
* adapters that satisfy the same `ComboboxParts` contract.
|
|
10
|
+
*
|
|
11
|
+
* @module react/components/ui/adapter/builtin/combobox
|
|
12
|
+
*/
|
|
13
|
+
import * as React from "react";
|
|
14
|
+
import { createStrictContext } from "../../../create-strict-context.js";
|
|
15
|
+
import { Floating } from "../../floating.js";
|
|
16
|
+
const [ComboboxContext, useCombobox] = createStrictContext("Combobox components", "<Combobox>");
|
|
17
|
+
function ComboboxRoot({ children, value, defaultValue, onValueChange, open, defaultOpen, onOpenChange, defaultInputValue, optionLabels = [], onInputValueChange, }) {
|
|
18
|
+
const listboxId = React.useId();
|
|
19
|
+
const anchorRef = React.useRef(null);
|
|
20
|
+
const optionsRef = React.useRef([]);
|
|
21
|
+
const selectedValue = value ?? defaultValue;
|
|
22
|
+
const selectedLabel = optionLabels.find((option) => option.value === selectedValue)?.text;
|
|
23
|
+
const [query, setQueryState] = React.useState(defaultInputValue ?? selectedLabel ?? "");
|
|
24
|
+
const [internalValue, setInternalValue] = React.useState(defaultValue);
|
|
25
|
+
const [internalOpen, setInternalOpen] = React.useState(defaultOpen ?? false);
|
|
26
|
+
const [activeId, setActiveId] = React.useState(undefined);
|
|
27
|
+
const isValueControlled = value !== undefined;
|
|
28
|
+
const isOpenControlled = open !== undefined;
|
|
29
|
+
const currentValue = isValueControlled ? value : internalValue;
|
|
30
|
+
const isOpen = isOpenControlled ? open : internalOpen;
|
|
31
|
+
const synchronizedValueRef = React.useRef(defaultInputValue !== undefined || selectedLabel !== undefined ? currentValue : undefined);
|
|
32
|
+
React.useEffect(() => {
|
|
33
|
+
if (currentValue === undefined && !isValueControlled)
|
|
34
|
+
return;
|
|
35
|
+
if (!isValueControlled && synchronizedValueRef.current === currentValue)
|
|
36
|
+
return;
|
|
37
|
+
const label = optionLabels.find((option) => option.value === currentValue)?.text;
|
|
38
|
+
if (label === undefined) {
|
|
39
|
+
synchronizedValueRef.current = currentValue;
|
|
40
|
+
setQueryState((previous) => previous === "" ? previous : "");
|
|
41
|
+
onInputValueChange?.("");
|
|
42
|
+
return;
|
|
43
|
+
}
|
|
44
|
+
if (synchronizedValueRef.current === currentValue)
|
|
45
|
+
return;
|
|
46
|
+
synchronizedValueRef.current = currentValue;
|
|
47
|
+
setQueryState(label);
|
|
48
|
+
onInputValueChange?.(label);
|
|
49
|
+
}, [currentValue, isValueControlled, onInputValueChange, optionLabels]);
|
|
50
|
+
const matches = React.useCallback((text) => !query || text.toLowerCase().includes(query.toLowerCase()), [query]);
|
|
51
|
+
const setOpen = React.useCallback((next) => {
|
|
52
|
+
if (!isOpenControlled)
|
|
53
|
+
setInternalOpen(next);
|
|
54
|
+
onOpenChange?.(next);
|
|
55
|
+
if (!next)
|
|
56
|
+
setActiveId(undefined);
|
|
57
|
+
}, [isOpenControlled, onOpenChange]);
|
|
58
|
+
const setQuery = React.useCallback((next) => {
|
|
59
|
+
setQueryState(next);
|
|
60
|
+
onInputValueChange?.(next);
|
|
61
|
+
setActiveId(undefined);
|
|
62
|
+
if (!isOpenControlled)
|
|
63
|
+
setInternalOpen(true);
|
|
64
|
+
onOpenChange?.(true);
|
|
65
|
+
}, [isOpenControlled, onOpenChange, onInputValueChange]);
|
|
66
|
+
const select = React.useCallback((nextValue, text) => {
|
|
67
|
+
if (!isValueControlled)
|
|
68
|
+
setInternalValue(nextValue);
|
|
69
|
+
synchronizedValueRef.current = nextValue;
|
|
70
|
+
onValueChange?.(nextValue);
|
|
71
|
+
setQueryState(text);
|
|
72
|
+
onInputValueChange?.(text);
|
|
73
|
+
setActiveId(undefined);
|
|
74
|
+
if (!isOpenControlled)
|
|
75
|
+
setInternalOpen(false);
|
|
76
|
+
onOpenChange?.(false);
|
|
77
|
+
}, [isValueControlled, onValueChange, isOpenControlled, onOpenChange, onInputValueChange]);
|
|
78
|
+
const registerOption = React.useCallback((id, value, text, disabled = false) => {
|
|
79
|
+
const existing = optionsRef.current.find((o) => o.id === id);
|
|
80
|
+
if (existing) {
|
|
81
|
+
existing.value = value;
|
|
82
|
+
existing.text = text;
|
|
83
|
+
existing.disabled = disabled;
|
|
84
|
+
}
|
|
85
|
+
else {
|
|
86
|
+
optionsRef.current.push({ id, value, text, disabled });
|
|
87
|
+
}
|
|
88
|
+
}, []);
|
|
89
|
+
const unregisterOption = React.useCallback((id) => {
|
|
90
|
+
optionsRef.current = optionsRef.current.filter((o) => o.id !== id);
|
|
91
|
+
}, []);
|
|
92
|
+
const onInputKeyDown = React.useCallback((event) => {
|
|
93
|
+
const visible = optionsRef.current.filter((o) => !o.disabled && matches(o.text));
|
|
94
|
+
const currentIndex = visible.findIndex((o) => o.id === activeId);
|
|
95
|
+
const move = (nextIndex) => {
|
|
96
|
+
const clamped = Math.max(0, Math.min(visible.length - 1, nextIndex));
|
|
97
|
+
setActiveId(visible[clamped]?.id);
|
|
98
|
+
};
|
|
99
|
+
switch (event.key) {
|
|
100
|
+
case "ArrowDown":
|
|
101
|
+
event.preventDefault();
|
|
102
|
+
if (!isOpen)
|
|
103
|
+
setOpen(true);
|
|
104
|
+
else
|
|
105
|
+
move(currentIndex + 1);
|
|
106
|
+
break;
|
|
107
|
+
case "ArrowUp":
|
|
108
|
+
event.preventDefault();
|
|
109
|
+
if (!isOpen)
|
|
110
|
+
setOpen(true);
|
|
111
|
+
else
|
|
112
|
+
move(currentIndex <= 0 ? 0 : currentIndex - 1);
|
|
113
|
+
break;
|
|
114
|
+
case "Home":
|
|
115
|
+
if (isOpen && visible.length) {
|
|
116
|
+
event.preventDefault();
|
|
117
|
+
move(0);
|
|
118
|
+
}
|
|
119
|
+
break;
|
|
120
|
+
case "End":
|
|
121
|
+
if (isOpen && visible.length) {
|
|
122
|
+
event.preventDefault();
|
|
123
|
+
move(visible.length - 1);
|
|
124
|
+
}
|
|
125
|
+
break;
|
|
126
|
+
case "Enter": {
|
|
127
|
+
const active = visible.find((o) => o.id === activeId);
|
|
128
|
+
if (isOpen && active) {
|
|
129
|
+
event.preventDefault();
|
|
130
|
+
select(active.value, active.text);
|
|
131
|
+
}
|
|
132
|
+
break;
|
|
133
|
+
}
|
|
134
|
+
case "Escape":
|
|
135
|
+
if (isOpen) {
|
|
136
|
+
event.preventDefault();
|
|
137
|
+
setOpen(false);
|
|
138
|
+
}
|
|
139
|
+
break;
|
|
140
|
+
}
|
|
141
|
+
}, [matches, activeId, isOpen, setOpen, select]);
|
|
142
|
+
const ctx = React.useMemo(() => ({
|
|
143
|
+
query,
|
|
144
|
+
setQuery,
|
|
145
|
+
open: isOpen,
|
|
146
|
+
setOpen,
|
|
147
|
+
value: currentValue,
|
|
148
|
+
select,
|
|
149
|
+
activeId,
|
|
150
|
+
matches,
|
|
151
|
+
listboxId,
|
|
152
|
+
registerOption,
|
|
153
|
+
unregisterOption,
|
|
154
|
+
onInputKeyDown,
|
|
155
|
+
anchorRef,
|
|
156
|
+
}), [
|
|
157
|
+
query,
|
|
158
|
+
setQuery,
|
|
159
|
+
isOpen,
|
|
160
|
+
setOpen,
|
|
161
|
+
currentValue,
|
|
162
|
+
select,
|
|
163
|
+
activeId,
|
|
164
|
+
matches,
|
|
165
|
+
listboxId,
|
|
166
|
+
registerOption,
|
|
167
|
+
unregisterOption,
|
|
168
|
+
onInputKeyDown,
|
|
169
|
+
]);
|
|
170
|
+
return React.createElement(ComboboxContext.Provider, { value: ctx }, children);
|
|
171
|
+
}
|
|
172
|
+
function ComboboxInputPart({ className, onChange, onKeyDown, onFocus, ref, ...props }) {
|
|
173
|
+
const ctx = useCombobox();
|
|
174
|
+
const setRef = React.useCallback((node) => {
|
|
175
|
+
ctx.anchorRef.current = node;
|
|
176
|
+
if (typeof ref === "function")
|
|
177
|
+
ref(node);
|
|
178
|
+
else if (ref != null)
|
|
179
|
+
ref.current = node;
|
|
180
|
+
}, [ctx.anchorRef, ref]);
|
|
181
|
+
return (React.createElement("input", { ref: setRef, role: "combobox", "aria-expanded": ctx.open, "aria-controls": ctx.listboxId, "aria-activedescendant": ctx.activeId, "aria-autocomplete": "list", autoComplete: "off", value: ctx.query, className: className, onChange: (event) => {
|
|
182
|
+
onChange?.(event);
|
|
183
|
+
ctx.setQuery(event.target.value);
|
|
184
|
+
}, onKeyDown: (event) => {
|
|
185
|
+
onKeyDown?.(event);
|
|
186
|
+
if (!event.defaultPrevented)
|
|
187
|
+
ctx.onInputKeyDown(event);
|
|
188
|
+
}, onFocus: (event) => {
|
|
189
|
+
onFocus?.(event);
|
|
190
|
+
if (!ctx.open)
|
|
191
|
+
ctx.setOpen(true);
|
|
192
|
+
}, ...props }));
|
|
193
|
+
}
|
|
194
|
+
function ComboboxContentPart({ className, children, ref, ...props }) {
|
|
195
|
+
const ctx = useCombobox();
|
|
196
|
+
return (React.createElement(Floating, { anchorRef: ctx.anchorRef, open: ctx.open, align: "start", matchTriggerWidth: true, onDismiss: () => ctx.setOpen(false), role: "listbox", id: ctx.listboxId, className: className, contentRef: ref, ...props },
|
|
197
|
+
React.createElement("div", { className: "p-1.5" }, children)));
|
|
198
|
+
}
|
|
199
|
+
export const builtinCombobox = {
|
|
200
|
+
Root: ComboboxRoot,
|
|
201
|
+
Input: ComboboxInputPart,
|
|
202
|
+
Content: ComboboxContentPart,
|
|
203
|
+
useCombobox: useCombobox,
|
|
204
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dialog.d.ts","sourceRoot":"","sources":["../../../../../../../src/src/react/components/ui/adapter/builtin/dialog.tsx"],"names":[],"mappings":"AAUA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAMlD,eAAO,MAAM,aAAa,EAAE,WAM3B,CAAC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Builtin Dialog adapter - a behaviour-preserving wrapper over the existing
|
|
3
|
+
* `createModalSurfaceParts("Dialog")` machinery (overlay + centered panel,
|
|
4
|
+
* Escape / overlay-click dismiss, first-focusable focus + restoration). The
|
|
5
|
+
* default zero-dependency engine; nothing about the rendered output changes
|
|
6
|
+
* versus the pre-adapter `dialog.tsx`.
|
|
7
|
+
*
|
|
8
|
+
* @module react/components/ui/adapter/builtin/dialog
|
|
9
|
+
*/
|
|
10
|
+
import { createModalSurfaceParts } from "../../modal-surface.js";
|
|
11
|
+
// One instance at module scope - distinct from Drawer's so a nested DrawerClose
|
|
12
|
+
// cannot close an enclosing Dialog.
|
|
13
|
+
const parts = createModalSurfaceParts("Dialog");
|
|
14
|
+
export const builtinDialog = {
|
|
15
|
+
Root: parts.ModalRoot,
|
|
16
|
+
Trigger: parts.ModalTrigger,
|
|
17
|
+
Content: parts.ModalContent,
|
|
18
|
+
Close: parts.ModalClose,
|
|
19
|
+
useDialog: parts.useModal,
|
|
20
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"drawer.d.ts","sourceRoot":"","sources":["../../../../../../../src/src/react/components/ui/adapter/builtin/drawer.tsx"],"names":[],"mappings":"AAUA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAKlD,eAAO,MAAM,aAAa,EAAE,WAQ3B,CAAC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Builtin Drawer adapter - the zero-dependency STATIC bottom sheet: the shared
|
|
3
|
+
* modal surface (overlay + panel, Escape/outside-click dismiss) assembled as
|
|
4
|
+
* `DrawerParts`, with the drawer skin supplying the edge-slide layout. No drag
|
|
5
|
+
* physics. Custom drawer adapters can supply different mechanics through
|
|
6
|
+
* `UIAdapterProvider`.
|
|
7
|
+
*
|
|
8
|
+
* @module react/components/ui/adapter/builtin/drawer
|
|
9
|
+
*/
|
|
10
|
+
import { createModalSurfaceParts } from "../../modal-surface.js";
|
|
11
|
+
// A distinct modal instance from Dialog's, so the two never share open-state.
|
|
12
|
+
const parts = createModalSurfaceParts("Drawer");
|
|
13
|
+
export const builtinDrawer = {
|
|
14
|
+
// `direction` is ignored by the builtin (the skin positions the sheet); it is
|
|
15
|
+
// part of the contract for engines like Vaul that drive the slide direction.
|
|
16
|
+
Root: ({ direction: _direction, ...props }) => React.createElement(parts.ModalRoot, { ...props }),
|
|
17
|
+
Trigger: parts.ModalTrigger,
|
|
18
|
+
Content: parts.ModalContent,
|
|
19
|
+
Close: parts.ModalClose,
|
|
20
|
+
useDrawer: parts.useModal,
|
|
21
|
+
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../../src/src/react/components/ui/adapter/builtin/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../../src/src/react/components/ui/adapter/builtin/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAWhD,eAAO,MAAM,cAAc,EAAE,SAW5B,CAAC"}
|
|
@@ -2,10 +2,20 @@ import { builtinToast } from "./toast.js";
|
|
|
2
2
|
import { builtinDisclosure } from "./disclosure.js";
|
|
3
3
|
import { builtinToggleGroup } from "./toggle-group.js";
|
|
4
4
|
import { builtinToolbar } from "./toolbar.js";
|
|
5
|
+
import { builtinDialog } from "./dialog.js";
|
|
6
|
+
import { builtinDrawer } from "./drawer.js";
|
|
7
|
+
import { builtinTabs } from "./tabs.js";
|
|
8
|
+
import { builtinPopover } from "./popover.js";
|
|
9
|
+
import { builtinCombobox } from "./combobox.js";
|
|
5
10
|
export const builtinAdapter = {
|
|
6
11
|
name: "builtin",
|
|
7
12
|
toast: builtinToast,
|
|
8
13
|
disclosure: builtinDisclosure,
|
|
9
14
|
toggleGroup: builtinToggleGroup,
|
|
10
15
|
toolbar: builtinToolbar,
|
|
16
|
+
dialog: builtinDialog,
|
|
17
|
+
drawer: builtinDrawer,
|
|
18
|
+
tabs: builtinTabs,
|
|
19
|
+
popover: builtinPopover,
|
|
20
|
+
combobox: builtinCombobox,
|
|
11
21
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"popover.d.ts","sourceRoot":"","sources":["../../../../../../../src/src/react/components/ui/adapter/builtin/popover.tsx"],"names":[],"mappings":"AAcA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAQnD,eAAO,MAAM,cAAc,EAAE,YAQ5B,CAAC"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Builtin Popover adapter - a behaviour-preserving wrapper over the existing
|
|
3
|
+
* `createAnchoredSurfaceParts()` machinery. This is the default, zero-dependency
|
|
4
|
+
* engine: nothing about the rendered output or behaviour changes versus the
|
|
5
|
+
* pre-adapter `popover.tsx` that called the factory directly.
|
|
6
|
+
*
|
|
7
|
+
* The `<span className="relative inline-block">` positioning anchor now lives
|
|
8
|
+
* entirely inside this builtin adapter (via `AnchoredRoot`) - it is no longer
|
|
9
|
+
* part of the Popover *contract*, so a parts-based engine (Base UI) is free to
|
|
10
|
+
* anchor on the trigger and emit no wrapper at all.
|
|
11
|
+
*
|
|
12
|
+
* @module react/components/ui/adapter/builtin/popover
|
|
13
|
+
*/
|
|
14
|
+
import { createAnchoredSurfaceParts } from "../../anchored-surface.js";
|
|
15
|
+
// One instance, created once at module scope - exactly as `popover.tsx` used to
|
|
16
|
+
// do. Keeping this distinct from the DropdownMenu instance preserves the
|
|
17
|
+
// per-skin context isolation (a nested menu must not close an enclosing
|
|
18
|
+
// popover).
|
|
19
|
+
const parts = createAnchoredSurfaceParts();
|
|
20
|
+
export const builtinPopover = {
|
|
21
|
+
Root: parts.AnchoredRoot,
|
|
22
|
+
// `haspopup` is a builtin-machinery concern (Popover vs Menu differ only
|
|
23
|
+
// here), so the builtin trigger supplies it and the skin stays engine-neutral.
|
|
24
|
+
Trigger: (props) => React.createElement(parts.AnchoredTrigger, { haspopup: "dialog", ...props }),
|
|
25
|
+
// Already portals via `Floating` into the nearest `[data-vf-ui]`/`[data-vf-chat]`
|
|
26
|
+
// token scope. The skin passes the contract-level initial-focus default.
|
|
27
|
+
Content: (props) => React.createElement(parts.AnchoredContent, { ...props }),
|
|
28
|
+
};
|