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
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import { AgentRuntime, } from "../agent/index.js";
|
|
2
2
|
import { normalizeAgUiRuntimeMessages } from "../agent/ag-ui/runtime-support.js";
|
|
3
|
+
import { createProviderAwareAgentSystemResolver, getEffectiveAgentSystem, resolveAgentSystem, resolveAgentSystemFromResolvedBase, } from "../agent/runtime/effective-agent-system.js";
|
|
4
|
+
import { flattenSystemInstructions } from "../agent/runtime/tool-inventory.js";
|
|
3
5
|
import { compactForStep, estimateOverhead } from "../chat/message-prep.js";
|
|
4
6
|
import { getRuntimeRemoteToolSources, } from "../agent/runtime/mcp-server-tool-sources.js";
|
|
5
7
|
import { buildRuntimeUsageTraceAttributes } from "../agent/runtime/trace-usage.js";
|
|
@@ -419,7 +421,10 @@ async function getDeclaredRemoteSourceToolNames(input) {
|
|
|
419
421
|
return [...toolNames];
|
|
420
422
|
}
|
|
421
423
|
function compactRuntimeMessagesForStream(messages, systemPrompt, toolCount) {
|
|
422
|
-
|
|
424
|
+
const systemText = typeof systemPrompt === "string"
|
|
425
|
+
? systemPrompt
|
|
426
|
+
: flattenSystemInstructions(systemPrompt);
|
|
427
|
+
return convertProviderMessagesToAgentRuntimeMessages(compactForStep(convertAgentRuntimeMessagesToProviderMessages(messages), estimateOverhead(systemText, toolCount)));
|
|
423
428
|
}
|
|
424
429
|
/**
|
|
425
430
|
* Relays run events produced by the runtime into the run's SSE stream.
|
|
@@ -529,18 +534,38 @@ export async function createRuntimeAgentStreamResponse(input, agent, deps) {
|
|
|
529
534
|
model: agent.config.model,
|
|
530
535
|
requiredToolNames: localToolNames,
|
|
531
536
|
});
|
|
532
|
-
const
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
537
|
+
const runtimeContext = {
|
|
538
|
+
threadId: input.threadId,
|
|
539
|
+
runId: input.runId,
|
|
540
|
+
...(deps.projectAgentSandbox?.authToken
|
|
541
|
+
? { authToken: deps.projectAgentSandbox.authToken }
|
|
542
|
+
: {}),
|
|
543
|
+
...(input.parentRunId ? { parentRunId: input.parentRunId } : {}),
|
|
544
|
+
...(input.state !== undefined ? { state: input.state } : {}),
|
|
545
|
+
context: input.context,
|
|
546
|
+
forwardedProps: input.forwardedProps,
|
|
547
|
+
};
|
|
548
|
+
const authoredSystemPromise = Promise.resolve(resolveAgentSystem(agent.config.system, undefined));
|
|
549
|
+
const effectiveAgentSystem = getEffectiveAgentSystem(agent);
|
|
550
|
+
const resolveSystemPrompt = async (providerOptionKey) => {
|
|
551
|
+
const authoredSystem = await authoredSystemPromise;
|
|
552
|
+
const resolvedBaseSystem = await resolveAgentSystemFromResolvedBase(effectiveAgentSystem, authoredSystem, providerOptionKey, { preserveRuntimeContextMarker: true });
|
|
553
|
+
return composeInternalAgentRunSystemPrompt({
|
|
554
|
+
agent,
|
|
555
|
+
resolvedBaseSystem,
|
|
556
|
+
runInput: input,
|
|
557
|
+
projectId: deps.projectAgentSandbox?.projectId ?? null,
|
|
558
|
+
branchId: deps.projectAgentSandbox?.branchId,
|
|
559
|
+
toolNames: runtimeToolNames,
|
|
560
|
+
...(providerOptionKey ? { providerOptionKey } : {}),
|
|
561
|
+
});
|
|
562
|
+
};
|
|
563
|
+
const systemPrompt = await resolveSystemPrompt();
|
|
539
564
|
const runtimeAgent = {
|
|
540
565
|
...agent,
|
|
541
566
|
config: {
|
|
542
567
|
...agent.config,
|
|
543
|
-
system:
|
|
568
|
+
system: createProviderAwareAgentSystemResolver(resolveSystemPrompt),
|
|
544
569
|
tools: mergedTools,
|
|
545
570
|
...(cappedProviderTools !== undefined ? { providerTools: cappedProviderTools } : {}),
|
|
546
571
|
...(allowedRemoteToolNames !== undefined
|
|
@@ -558,17 +583,7 @@ export async function createRuntimeAgentStreamResponse(input, agent, deps) {
|
|
|
558
583
|
// Scoped here because the runtime dispatches the run's first model call
|
|
559
584
|
// before stream() resolves. Later steps inherit this scope through the
|
|
560
585
|
// stream they are pumped from.
|
|
561
|
-
const candidateRuntimeStream = await runWithMandatoryRunEventSink(modelCallContextRelay.sink, () => runtime.stream(runtimeMessages, {
|
|
562
|
-
threadId: input.threadId,
|
|
563
|
-
runId: input.runId,
|
|
564
|
-
...(deps.projectAgentSandbox?.authToken
|
|
565
|
-
? { authToken: deps.projectAgentSandbox.authToken }
|
|
566
|
-
: {}),
|
|
567
|
-
...(input.parentRunId ? { parentRunId: input.parentRunId } : {}),
|
|
568
|
-
...(input.state !== undefined ? { state: input.state } : {}),
|
|
569
|
-
context: input.context,
|
|
570
|
-
forwardedProps: input.forwardedProps,
|
|
571
|
-
}, {
|
|
586
|
+
const candidateRuntimeStream = await runWithMandatoryRunEventSink(modelCallContextRelay.sink, () => runtime.stream(runtimeMessages, runtimeContext, {
|
|
572
587
|
onFinish: (response) => {
|
|
573
588
|
completedResponse = response;
|
|
574
589
|
},
|
|
@@ -17,8 +17,10 @@
|
|
|
17
17
|
*
|
|
18
18
|
* @module
|
|
19
19
|
*/
|
|
20
|
-
import type { Agent } from "../agent/index.js";
|
|
20
|
+
import type { Agent, AgentSystem } from "../agent/index.js";
|
|
21
|
+
import type { ChatSystemMessage } from "../chat/types.js";
|
|
21
22
|
import type { RuntimeRunAgentInput } from "./schema.js";
|
|
23
|
+
import type { ModelRuntime } from "../provider/index.js";
|
|
22
24
|
/** Caller-supplied run context extracted from the `studio_context` item. */
|
|
23
25
|
export type InternalAgentStudioRunContext = {
|
|
24
26
|
environmentContext?: string;
|
|
@@ -30,11 +32,14 @@ export declare function getInternalAgentStudioRunContext(context: RuntimeRunAgen
|
|
|
30
32
|
/** Input payload for compose internal agent run system prompt. */
|
|
31
33
|
export type ComposeInternalAgentRunSystemPromptInput = {
|
|
32
34
|
agent: Agent;
|
|
35
|
+
resolvedBaseSystem?: AgentSystem;
|
|
33
36
|
runInput: RuntimeRunAgentInput;
|
|
34
37
|
projectId?: string | null;
|
|
35
38
|
branchId?: string | null;
|
|
36
39
|
toolNames: readonly string[];
|
|
40
|
+
providerOptionKey?: string;
|
|
41
|
+
modelRuntime?: ModelRuntime;
|
|
37
42
|
};
|
|
38
43
|
/** Composes the internal agent run system prompt. */
|
|
39
|
-
export declare function composeInternalAgentRunSystemPrompt(input: ComposeInternalAgentRunSystemPromptInput): Promise<
|
|
44
|
+
export declare function composeInternalAgentRunSystemPrompt(input: ComposeInternalAgentRunSystemPromptInput): Promise<ChatSystemMessage[]>;
|
|
40
45
|
//# sourceMappingURL=run-system-prompt.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"run-system-prompt.d.ts","sourceRoot":"","sources":["../../../src/src/internal-agents/run-system-prompt.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAEH,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;
|
|
1
|
+
{"version":3,"file":"run-system-prompt.d.ts","sourceRoot":"","sources":["../../../src/src/internal-agents/run-system-prompt.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAEH,OAAO,KAAK,EAAE,KAAK,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAS5D,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AAC1D,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAC;AACxD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AAKzD,4EAA4E;AAC5E,MAAM,MAAM,6BAA6B,GAAG;IAC1C,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CAC1B,CAAC;AAqBF,uEAAuE;AACvE,wBAAgB,gCAAgC,CAC9C,OAAO,EAAE,oBAAoB,CAAC,SAAS,CAAC,GACvC,6BAA6B,CAmB/B;AAaD,kEAAkE;AAClE,MAAM,MAAM,wCAAwC,GAAG;IACrD,KAAK,EAAE,KAAK,CAAC;IACb,kBAAkB,CAAC,EAAE,WAAW,CAAC;IACjC,QAAQ,EAAE,oBAAoB,CAAC;IAC/B,SAAS,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1B,QAAQ,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB,SAAS,EAAE,SAAS,MAAM,EAAE,CAAC;IAC7B,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,YAAY,CAAC,EAAE,YAAY,CAAC;CAC7B,CAAC;AAEF,qDAAqD;AACrD,wBAAsB,mCAAmC,CACvD,KAAK,EAAE,wCAAwC,GAC9C,OAAO,CAAC,iBAAiB,EAAE,CAAC,CAyC9B"}
|
|
@@ -18,9 +18,10 @@
|
|
|
18
18
|
* @module
|
|
19
19
|
*/
|
|
20
20
|
import { buildAgentCallContext } from "../agent/runtime/call-context.js";
|
|
21
|
-
import { getEffectiveAgentSystem } from "../agent/runtime/effective-agent-system.js";
|
|
21
|
+
import { getEffectiveAgentSystem, resolveAgentSystem, } from "../agent/runtime/effective-agent-system.js";
|
|
22
22
|
import { createRuntimePromptBlock } from "../agent/runtime/prompt-block.js";
|
|
23
|
-
import {
|
|
23
|
+
import { resolveModelProviderOptionKey } from "../agent/runtime/model-resolution.js";
|
|
24
|
+
import { withRuntimeToolInventory } from "../agent/runtime/tool-inventory.js";
|
|
24
25
|
const STUDIO_CONTEXT_ITEM_TITLE = "studio_context";
|
|
25
26
|
const DEFAULT_SYSTEM_PROMPT = "You are a helpful assistant.";
|
|
26
27
|
function isRecord(value) {
|
|
@@ -57,20 +58,24 @@ export function getInternalAgentStudioRunContext(context) {
|
|
|
57
58
|
}
|
|
58
59
|
return {};
|
|
59
60
|
}
|
|
60
|
-
async function resolveBaseSystemPrompt(system) {
|
|
61
|
-
|
|
62
|
-
|
|
61
|
+
async function resolveBaseSystemPrompt(system, providerOptionKey) {
|
|
62
|
+
const resolved = await resolveAgentSystem(system, providerOptionKey);
|
|
63
|
+
if (typeof resolved === "string") {
|
|
64
|
+
return resolved;
|
|
63
65
|
}
|
|
64
|
-
|
|
65
|
-
return await system();
|
|
66
|
-
}
|
|
67
|
-
return DEFAULT_SYSTEM_PROMPT;
|
|
66
|
+
return resolved.length > 0 ? resolved : DEFAULT_SYSTEM_PROMPT;
|
|
68
67
|
}
|
|
69
68
|
/** Composes the internal agent run system prompt. */
|
|
70
69
|
export async function composeInternalAgentRunSystemPrompt(input) {
|
|
71
|
-
const
|
|
70
|
+
const baseSystem = input.resolvedBaseSystem === undefined
|
|
71
|
+
? await resolveBaseSystemPrompt(getEffectiveAgentSystem(input.agent), input.providerOptionKey)
|
|
72
|
+
: typeof input.resolvedBaseSystem === "string" || input.resolvedBaseSystem.length > 0
|
|
73
|
+
? input.resolvedBaseSystem
|
|
74
|
+
: DEFAULT_SYSTEM_PROMPT;
|
|
72
75
|
const studioContext = getInternalAgentStudioRunContext(input.runInput.context);
|
|
73
76
|
const projectId = input.projectId ?? studioContext.projectId;
|
|
77
|
+
const anthropicProviderAlias = input.providerOptionKey ??
|
|
78
|
+
resolveModelProviderOptionKey(input.agent.config.model, input.modelRuntime);
|
|
74
79
|
const extraBlocks = [];
|
|
75
80
|
if (input.agent.config.model) {
|
|
76
81
|
extraBlocks.push(createRuntimePromptBlock({
|
|
@@ -78,8 +83,9 @@ export async function composeInternalAgentRunSystemPrompt(input) {
|
|
|
78
83
|
content: `model: "${input.agent.config.model}"`,
|
|
79
84
|
}));
|
|
80
85
|
}
|
|
81
|
-
const
|
|
82
|
-
instructions:
|
|
86
|
+
const contextMessages = buildAgentCallContext({
|
|
87
|
+
instructions: baseSystem,
|
|
88
|
+
...(anthropicProviderAlias ? { anthropicProviderAlias } : {}),
|
|
83
89
|
...(projectId
|
|
84
90
|
? {
|
|
85
91
|
projectContext: {
|
|
@@ -93,5 +99,5 @@ export async function composeInternalAgentRunSystemPrompt(input) {
|
|
|
93
99
|
? { environmentContext: studioContext.environmentContext }
|
|
94
100
|
: {}),
|
|
95
101
|
});
|
|
96
|
-
return
|
|
102
|
+
return withRuntimeToolInventory(contextMessages, input.toolNames);
|
|
97
103
|
}
|
|
@@ -317,6 +317,7 @@ export declare const getInternalAgentControlPlaneStreamRequestSchema: () => Sche
|
|
|
317
317
|
description: Schema<string>;
|
|
318
318
|
avatarUrl: Schema<string | undefined>;
|
|
319
319
|
instructions: Schema<string>;
|
|
320
|
+
system: Schema<import("../chat/types.js").ChatSystemMessage[] | undefined>;
|
|
320
321
|
thinking: Schema<import("../extensions/schema/schema-validator.js").InferShape<{
|
|
321
322
|
enabled: Schema<boolean>;
|
|
322
323
|
budgetTokens: Schema<number | undefined>;
|
|
@@ -460,6 +461,7 @@ export declare const getInternalAgentStreamRequestSchema: () => Schema<import(".
|
|
|
460
461
|
description: Schema<string>;
|
|
461
462
|
avatarUrl: Schema<string | undefined>;
|
|
462
463
|
instructions: Schema<string>;
|
|
464
|
+
system: Schema<import("../chat/types.js").ChatSystemMessage[] | undefined>;
|
|
463
465
|
thinking: Schema<import("../extensions/schema/schema-validator.js").InferShape<{
|
|
464
466
|
enabled: Schema<boolean>;
|
|
465
467
|
budgetTokens: Schema<number | undefined>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../../src/src/internal-agents/schema.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,EAAE,MAAM,+BAA+B,CAAC;AACzE,OAAO,EACL,KAAK,sBAAsB,EAE3B,KAAK,kBAAkB,EAQxB,MAAM,oCAAoC,CAAC;AAG5C,OAAO,EAEL,kCAAkC,EAElC,KAAK,yBAAyB,EAG/B,MAAM,+CAA+C,CAAC;AAkBvD,eAAO,MAAM,cAAc,sBAA4B,CAAC;AAExD,eAAO,MAAM,gBAAgB,sBAE5B,CAAC;AAEF,eAAO,MAAM,4BAA4B;;;;;;GAAmC,CAAC;AAC7E,eAAO,MAAM,2BAA2B;;;;;;;;;;;;;;GAAkC,CAAC;AAC3E,eAAO,MAAM,uBAAuB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAA8B,CAAC;AACnE,eA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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqE3D,CAAC;AAEF,eAAO,MAAM,mCAAmC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAAkD,CAAC;AAmQnG,wBAAgB,sBAAsB,CACpC,KAAK,EAAE,WAAW,CAAC,UAAU,CAAC,OAAO,mCAAmC,CAAC,CAAC,GACzE,kBAAkB,CAWpB;AAED,eAAO,MAAM,qBAAqB;;;;;GAYjC,CAAC;AAEF,OAAO,EAAE,kCAAkC,EAAE,CAAC;AAC9C,YAAY,EAAE,yBAAyB,EAAE,CAAC;AAC1C,MAAM,MAAM,mBAAmB,GAAG,WAAW,CAAC,UAAU,CAAC,OAAO,4BAA4B,CAAC,CAAC,CAAC;AAC/F,MAAM,MAAM,kBAAkB,GAAG,sBAAsB,CAAC;AACxD,MAAM,MAAM,oBAAoB,GAAG,kBAAkB,CAAC;AACtD,MAAM,MAAM,0BAA0B,GAAG,WAAW,CAClD,UAAU,CAAC,OAAO,mCAAmC,CAAC,CACvD,CAAC;AACF,MAAM,MAAM,YAAY,GAAG,WAAW,CAAC,UAAU,CAAC,OAAO,qBAAqB,CAAC,CAAC,CAAC;AAGjF,YAAY,EAAE,MAAM,EAAE,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"loader.d.ts","sourceRoot":"","sources":["../../../../../src/src/modules/react-loader/ssr-module-loader/loader.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,KAAK,KAAK,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"loader.d.ts","sourceRoot":"","sources":["../../../../../src/src/modules/react-loader/ssr-module-loader/loader.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G,MAAM,CAEhD;AAED;;;;;GAKG;AACH,qBAAa,eAAe;IAKd,OAAO,CAAC,OAAO;IAJ3B,OAAO,CAAC,KAAK,CAAkB;IAC/B,OAAO,CAAC,cAAc,CAA2B;IACjD,OAAO,CAAC,YAAY,CAAyB;gBAEzB,OAAO,EAAE,sBAAsB;YAWrC,qBAAqB;YAgDrB,0BAA0B;YAoJ1B,0BAA0B;IAmBxC,OAAO,CAAC,wBAAwB;IAMhC,OAAO,CAAC,kCAAkC;IAY1C,aAAa,CACX,QAAQ,EAAE,MAAM,EAChB,MAAM,EAAE,MAAM,GACb,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IA8D7B,UAAU,CACd,QAAQ,EAAE,MAAM,EAChB,MAAM,EAAE,MAAM,GACb,OAAO,CAAC,KAAK,CAAC,aAAa,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC;YAK1C,2BAA2B;IAYzC,OAAO,CAAC,yBAAyB;YAkBnB,2BAA2B;CA2Y1C"}
|
|
@@ -16,7 +16,7 @@ import { SpanNames } from "../../../observability/index.js";
|
|
|
16
16
|
import { withSpan } from "../../../observability/tracing/otlp-setup.js";
|
|
17
17
|
import { extractComponent } from "../extract-component.js";
|
|
18
18
|
import { classifyImportError, createTransformCapacityError, } from "./loader-helpers.js";
|
|
19
|
-
import { getMaxConcurrentTransforms, MAX_TRANSFORM_DEPTH, TRANSFORM_ACQUIRE_TIMEOUT_MS,
|
|
19
|
+
import { getMaxConcurrentTransforms, MAX_TRANSFORM_DEPTH, TRANSFORM_ACQUIRE_TIMEOUT_MS, TRANSFORM_IN_PROGRESS_STALE_EVICTION_MS, TRANSFORM_IN_PROGRESS_WAIT_TIMEOUT_MS, } from "./constants.js";
|
|
20
20
|
import { getFromRedis, getTransformSemaphore, globalInProgress, globalModuleCache, isSSRDistributedCacheEnabled, releaseTransformSlot, setInRedis, tryAcquireTransformSlot, } from "./cache/index.js";
|
|
21
21
|
import { getHttpBundleCacheDir } from "../../../utils/cache-dir.js";
|
|
22
22
|
import { getMdxEsmSsrCacheDir, getMdxEsmSsrCacheDirs, invalidateMdxEsmModuleForCachedPath, lookupMdxEsmCache, } from "../../../transforms/mdx/esm-module-loader/cache/index.js";
|
|
@@ -529,25 +529,9 @@ export class SSRModuleLoader {
|
|
|
529
529
|
// Each recursive child acquires its own slot for its own transform only.
|
|
530
530
|
// This prevents hierarchical deadlock where parent holds a slot while
|
|
531
531
|
// children also need slots (10 batch x 2 depth = 21 slots, but limit is 17).
|
|
532
|
-
const crossProjectPaths = new Map();
|
|
533
532
|
const localFs = createFileSystem();
|
|
534
533
|
const localImportPaths = await this.depValidator.processLocalImports(parseResult.imports, filePath, depth, localFs, dependencyHashCache);
|
|
535
|
-
|
|
536
|
-
const batch = parseResult.crossProjectImports.slice(i, i + TRANSFORM_BATCH_SIZE);
|
|
537
|
-
await Promise.all(batch.map(async (crossImport) => {
|
|
538
|
-
try {
|
|
539
|
-
const tempPath = await this.transformCrossProjectImport(crossImport);
|
|
540
|
-
crossProjectPaths.set(crossImport.specifier, tempPath);
|
|
541
|
-
}
|
|
542
|
-
catch (error) {
|
|
543
|
-
this.depValidator.missingDependencies.push({
|
|
544
|
-
specifier: crossImport.specifier,
|
|
545
|
-
fromFile: filePath,
|
|
546
|
-
reason: `Failed to fetch cross-project import: ${error instanceof Error ? error.message : String(error)}`,
|
|
547
|
-
});
|
|
548
|
-
}
|
|
549
|
-
}));
|
|
550
|
-
}
|
|
534
|
+
const crossProjectPaths = await this.depValidator.processCrossProjectImports(parseResult.crossProjectImports, filePath);
|
|
551
535
|
// Hold project slots only around the actual transform and file write.
|
|
552
536
|
const entry = await this.withTransformCapacity(filePath, "build", async () => {
|
|
553
537
|
const projectId = this.options.projectId;
|
|
@@ -36,6 +36,17 @@ export declare class SSRDependencyValidator {
|
|
|
36
36
|
* processing local imports and cross-project imports.
|
|
37
37
|
*/
|
|
38
38
|
ensureDependenciesExist(code: string, filePath: string, depth?: number): Promise<void>;
|
|
39
|
+
/**
|
|
40
|
+
* Process cross-project imports in batches, building a map of
|
|
41
|
+
* specifier -> temp file path.
|
|
42
|
+
*
|
|
43
|
+
* Non-terminal failures are aggregated into {@link missingDependencies} so the
|
|
44
|
+
* caller can report every unresolved specifier at once. A terminal HTTP module
|
|
45
|
+
* fetch failure is rethrown untouched instead: it means the source could not be
|
|
46
|
+
* retrieved at all, so reporting it as a missing dependency would mislabel a
|
|
47
|
+
* transient network failure as a broken component.
|
|
48
|
+
*/
|
|
49
|
+
processCrossProjectImports(crossProjectImports: CrossProjectImport[], filePath: string): Promise<Map<string, string>>;
|
|
39
50
|
/**
|
|
40
51
|
* Process local imports in batches, recursively transforming dependencies
|
|
41
52
|
* and building a map of specifier -> temp file path.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ssr-dependency-validator.d.ts","sourceRoot":"","sources":["../../../../../src/src/modules/react-loader/ssr-module-loader/ssr-dependency-validator.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,EAAE,kBAAkB,EAAE,aAAa,EAAE,MAAM,0CAA0C,CAAC;AAGlG,OAAO,EAAE,gBAAgB,EAAE,MAAM,gCAAgC,CAAC;AAGlE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,oCAAoC,CAAC;AAEzE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AACnD,OAAO,EAEL,KAAK,mBAAmB,EACzB,MAAM,oCAAoC,CAAC;
|
|
1
|
+
{"version":3,"file":"ssr-dependency-validator.d.ts","sourceRoot":"","sources":["../../../../../src/src/modules/react-loader/ssr-module-loader/ssr-dependency-validator.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,EAAE,kBAAkB,EAAE,aAAa,EAAE,MAAM,0CAA0C,CAAC;AAGlG,OAAO,EAAE,gBAAgB,EAAE,MAAM,gCAAgC,CAAC;AAGlE,OAAO,KAAK,E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AO,EAAE,UAAU,CAAC,OAAO,gBAAgB,CAAC,EAC5C,mBAAmB,EAAE,mBAAmB,GACvC,OAAO,CAAC,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAsC/B,OAAO,CAAC,qBAAqB;IAM7B,OAAO,CAAC,qBAAqB;CAc9B"}
|
|
@@ -9,11 +9,32 @@
|
|
|
9
9
|
import { parseLocalImports } from "../../../transforms/esm/import-parser.js";
|
|
10
10
|
import { registerCSSImport } from "../css-import-collector.js";
|
|
11
11
|
import { createFileSystem } from "../../../platform/compat/fs.js";
|
|
12
|
-
import { createError, toError } from "../../../errors/index.js";
|
|
12
|
+
import { BUILD_FAILED, createError, toError, VeryfrontError } from "../../../errors/index.js";
|
|
13
13
|
import { rendererLogger } from "../../../utils/index.js";
|
|
14
14
|
import { MAX_TRANSFORM_DEPTH, TRANSFORM_BATCH_SIZE } from "./constants.js";
|
|
15
15
|
import { createDependencyHashCache, } from "../../../cache/dependency-graph.js";
|
|
16
16
|
const logger = rendererLogger.component("ssr-module-loader");
|
|
17
|
+
function isTerminalHttpModuleFetchFailure(error) {
|
|
18
|
+
if (!(error instanceof VeryfrontError) || error.slug !== BUILD_FAILED.slug)
|
|
19
|
+
return false;
|
|
20
|
+
const context = error.context;
|
|
21
|
+
return typeof context === "object" && context !== null &&
|
|
22
|
+
context.phase === "http-module-fetch";
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Pick the rejection a settled dependency batch should propagate.
|
|
26
|
+
*
|
|
27
|
+
* Both batch loops catch everything except a terminal HTTP module fetch
|
|
28
|
+
* failure, so today every rejection is that failure. Select on the predicate
|
|
29
|
+
* rather than on "first rejection" so a throw added outside either try block
|
|
30
|
+
* later cannot be mistaken for the terminal failure — and fall back to the
|
|
31
|
+
* first rejection so such a throw is still propagated rather than dropped.
|
|
32
|
+
*/
|
|
33
|
+
function selectPropagatedFailure(results) {
|
|
34
|
+
const rejections = results.filter((result) => result.status === "rejected");
|
|
35
|
+
return rejections.find((rejection) => isTerminalHttpModuleFetchFailure(rejection.reason)) ??
|
|
36
|
+
rejections[0];
|
|
37
|
+
}
|
|
17
38
|
/**
|
|
18
39
|
* Manages dependency validation for SSR module loading:
|
|
19
40
|
* - Pre-flight checks for local file existence
|
|
@@ -76,13 +97,30 @@ export class SSRDependencyValidator {
|
|
|
76
97
|
}
|
|
77
98
|
const localFs = createFileSystem();
|
|
78
99
|
await this.processLocalImports(parseResult.imports, filePath, depth, localFs, createDependencyHashCache());
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
100
|
+
await this.processCrossProjectImports(parseResult.crossProjectImports, filePath);
|
|
101
|
+
}
|
|
102
|
+
/**
|
|
103
|
+
* Process cross-project imports in batches, building a map of
|
|
104
|
+
* specifier -> temp file path.
|
|
105
|
+
*
|
|
106
|
+
* Non-terminal failures are aggregated into {@link missingDependencies} so the
|
|
107
|
+
* caller can report every unresolved specifier at once. A terminal HTTP module
|
|
108
|
+
* fetch failure is rethrown untouched instead: it means the source could not be
|
|
109
|
+
* retrieved at all, so reporting it as a missing dependency would mislabel a
|
|
110
|
+
* transient network failure as a broken component.
|
|
111
|
+
*/
|
|
112
|
+
async processCrossProjectImports(crossProjectImports, filePath) {
|
|
113
|
+
const crossProjectPaths = new Map();
|
|
114
|
+
for (let i = 0; i < crossProjectImports.length; i += TRANSFORM_BATCH_SIZE) {
|
|
115
|
+
const batch = crossProjectImports.slice(i, i + TRANSFORM_BATCH_SIZE);
|
|
116
|
+
const results = await Promise.allSettled(batch.map(async (crossImport) => {
|
|
82
117
|
try {
|
|
83
|
-
await this.transformCrossProjectImport(crossImport);
|
|
118
|
+
const tempPath = await this.transformCrossProjectImport(crossImport);
|
|
119
|
+
crossProjectPaths.set(crossImport.specifier, tempPath);
|
|
84
120
|
}
|
|
85
121
|
catch (error) {
|
|
122
|
+
if (isTerminalHttpModuleFetchFailure(error))
|
|
123
|
+
throw error;
|
|
86
124
|
this.missingDependencies.push({
|
|
87
125
|
specifier: crossImport.specifier,
|
|
88
126
|
fromFile: filePath,
|
|
@@ -90,7 +128,11 @@ export class SSRDependencyValidator {
|
|
|
90
128
|
});
|
|
91
129
|
}
|
|
92
130
|
}));
|
|
131
|
+
const failure = selectPropagatedFailure(results);
|
|
132
|
+
if (failure)
|
|
133
|
+
throw failure.reason;
|
|
93
134
|
}
|
|
135
|
+
return crossProjectPaths;
|
|
94
136
|
}
|
|
95
137
|
/**
|
|
96
138
|
* Process local imports in batches, recursively transforming dependencies
|
|
@@ -100,7 +142,7 @@ export class SSRDependencyValidator {
|
|
|
100
142
|
const importPathMap = new Map();
|
|
101
143
|
for (let i = 0; i < imports.length; i += TRANSFORM_BATCH_SIZE) {
|
|
102
144
|
const batch = imports.slice(i, i + TRANSFORM_BATCH_SIZE);
|
|
103
|
-
await Promise.
|
|
145
|
+
const results = await Promise.allSettled(batch.map(async (imp) => {
|
|
104
146
|
try {
|
|
105
147
|
const depSource = await this.readLocalImportSource(imp.absolutePath, localFs);
|
|
106
148
|
const depEntry = await this.transformWithDependencies(imp.absolutePath, depSource, depth + 1, dependencyHashCache);
|
|
@@ -108,6 +150,8 @@ export class SSRDependencyValidator {
|
|
|
108
150
|
importPathMap.set(imp.absolutePath, depEntry.tempPath);
|
|
109
151
|
}
|
|
110
152
|
catch (error) {
|
|
153
|
+
if (isTerminalHttpModuleFetchFailure(error))
|
|
154
|
+
throw error;
|
|
111
155
|
this.missingDependencies.push({
|
|
112
156
|
specifier: imp.specifier,
|
|
113
157
|
fromFile: fromFilePath,
|
|
@@ -115,6 +159,9 @@ export class SSRDependencyValidator {
|
|
|
115
159
|
});
|
|
116
160
|
}
|
|
117
161
|
}));
|
|
162
|
+
const failure = selectPropagatedFailure(results);
|
|
163
|
+
if (failure)
|
|
164
|
+
throw failure.reason;
|
|
118
165
|
}
|
|
119
166
|
return importPathMap;
|
|
120
167
|
}
|
|
@@ -14,6 +14,10 @@ export type ApplicationErrorContext = {
|
|
|
14
14
|
spanId?: string;
|
|
15
15
|
/** OpenTelemetry trace correlation identifier. */
|
|
16
16
|
traceId?: string;
|
|
17
|
+
/** Stable failure classification (e.g. "tenant-build") tagged on the event. */
|
|
18
|
+
errorClass?: string;
|
|
19
|
+
/** Severity of the captured event; reporters default to "error" when unset. */
|
|
20
|
+
level?: "error" | "warning";
|
|
17
21
|
/** Sanitized scalar metadata for the failure boundary. */
|
|
18
22
|
attributes?: Record<string, ApplicationErrorAttributeValue>;
|
|
19
23
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"application-error-contract.d.ts","sourceRoot":"","sources":["../../../src/src/observability/application-error-contract.ts"],"names":[],"mappings":"AAAA,8DAA8D;AAC9D,MAAM,MAAM,8BAA8B,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO,CAAC;AAEvE,8EAA8E;AAC9E,MAAM,MAAM,uBAAuB,GAAG;IACpC,8DAA8D;IAC9D,QAAQ,EAAE,MAAM,CAAC;IACjB,+CAA+C;IAC/C,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,gEAAgE;IAChE,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,sCAAsC;IACtC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,iDAAiD;IACjD,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,kDAAkD;IAClD,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,0DAA0D;IAC1D,UAAU,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,8BAA8B,CAAC,CAAC;CAC7D,CAAC;AAEF,sEAAsE;AACtE,MAAM,MAAM,wBAAwB,GAAG;IACrC,OAAO,CAAC,KAAK,EAAE,OAAO,EAAE,OAAO,EAAE,uBAAuB,GAAG,MAAM,GAAG,SAAS,CAAC;IAC9E,KAAK,CAAC,SAAS,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;CAC7C,CAAC"}
|
|
1
|
+
{"version":3,"file":"application-error-contract.d.ts","sourceRoot":"","sources":["../../../src/src/observability/application-error-contract.ts"],"names":[],"mappings":"AAAA,8DAA8D;AAC9D,MAAM,MAAM,8BAA8B,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO,CAAC;AAEvE,8EAA8E;AAC9E,MAAM,MAAM,uBAAuB,GAAG;IACpC,8DAA8D;IAC9D,QAAQ,EAAE,MAAM,CAAC;IACjB,+CAA+C;IAC/C,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,gEAAgE;IAChE,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,sCAAsC;IACtC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,iDAAiD;IACjD,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,kDAAkD;IAClD,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,+EAA+E;IAC/E,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,+EAA+E;IAC/E,KAAK,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;IAC5B,0DAA0D;IAC1D,UAAU,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,8BAA8B,CAAC,CAAC;CAC7D,CAAC;AAEF,sEAAsE;AACtE,MAAM,MAAM,wBAAwB,GAAG;IACrC,OAAO,CAAC,KAAK,EAAE,OAAO,EAAE,OAAO,EAAE,uBAAuB,GAAG,MAAM,GAAG,SAAS,CAAC;IAC9E,KAAK,CAAC,SAAS,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;CAC7C,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"application-errors.d.ts","sourceRoot":"","sources":["../../../src/src/observability/application-errors.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"application-errors.d.ts","sourceRoot":"","sources":["../../../src/src/observability/application-errors.ts"],"names":[],"mappings":"AAKA,OAAO,EACL,KAAK,mCAAmC,EACxC,uCAAuC,EAExC,MAAM,2DAA2D,CAAC;AACnE,OAAO,KAAK,EACV,uBAAuB,EACvB,wBAAwB,EACzB,MAAM,iCAAiC,CAAC;AAEzC,YAAY,EACV,6CAA6C,EAC7C,mCAAmC,EACnC,+BAA+B,GAChC,MAAM,2DAA2D,CAAC;AACnE,YAAY,EACV,8BAA8B,EAC9B,uBAAuB,EACvB,wBAAwB,GACzB,MAAM,iCAAiC,CAAC;AACzC,OAAO,EAAE,uCAAuC,EAAE,CAAC;AAEnD,mDAAmD;AACnD,MAAM,MAAM,iCAAiC,GAAG;IAC9C,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAC;IAC1B,OAAO,CAAC,KAAK,EAAE,OAAO,EAAE,OAAO,EAAE,uBAAuB,GAAG,MAAM,GAAG,SAAS,CAAC;IAC9E,KAAK,CAAC,SAAS,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;IAC5C,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;CAC1B,CAAC;AAcF;;;;;;;;;;;GAWG;AACH,wBAAgB,2BAA2B,CACzC,YAAY,EAAE,wBAAwB,GAAG,SAAS,GACjD,IAAI,CAQN;AA2ED;;;;;;;GAOG;AACH,wBAAgB,kCAAkC,CAAC,OAAO,EAAE;IAC1D,WAAW,CAAC,EAAE,mCAAmC,CAAC;IAClD,WAAW,EAAE,MAAM,CAAC;CACrB,GAAG,OAAO,CAAC,iCAAiC,CAAC,CAsE7C;AAwCD,wBAAgB,uBAAuB,CACrC,KAAK,EAAE,OAAO,EACd,OAAO,EAAE,uBAAuB,GAC/B,MAAM,GAAG,SAAS,CAuBpB;AAED,wBAAsB,sBAAsB,CAAC,SAAS,SAAQ,GAAG,OAAO,CAAC,OAAO,CAAC,CAuBhF;AAED,wBAAgB,0BAA0B,CAAC,KAAK,EAAE,OAAO,GAAG,OAAO,CAYlE"}
|
|
@@ -1,9 +1,14 @@
|
|
|
1
|
+
import { snapshotVeryfrontError } from "../errors/types.js";
|
|
2
|
+
import { isTenantSourceBuildError } from "../errors/tenant-classification.js";
|
|
1
3
|
import { MAX_TIMER_DELAY_MS } from "../utils/timer.js";
|
|
2
4
|
import { sanitizeTelemetryAttributes, sanitizeTelemetryText } from "./telemetry-error.js";
|
|
3
5
|
import { MAX_APPLICATION_ERROR_CONTEXT_VALUE_LENGTH } from "./limits.js";
|
|
4
6
|
import { ApplicationErrorReporterInitializerName, } from "../extensions/observability/application-error-reporter.js";
|
|
5
7
|
export { ApplicationErrorReporterInitializerName };
|
|
6
8
|
const MAX_APPLICATION_ERROR_SERVICE_NAME_LENGTH = 255;
|
|
9
|
+
const ObjectPrototypeHasOwnProperty = Object.prototype.hasOwnProperty;
|
|
10
|
+
const ReflectApply = Reflect.apply;
|
|
11
|
+
const ReflectGetOwnPropertyDescriptor = Reflect.getOwnPropertyDescriptor;
|
|
7
12
|
let reporter;
|
|
8
13
|
let reporterOwner;
|
|
9
14
|
let initializationGeneration = 0;
|
|
@@ -167,6 +172,42 @@ export function initializeApplicationErrorReporter(options) {
|
|
|
167
172
|
return lifecycle;
|
|
168
173
|
});
|
|
169
174
|
}
|
|
175
|
+
const TENANT_BUILD_ERROR_CLASS = "tenant-build";
|
|
176
|
+
/**
|
|
177
|
+
* Tag applied by the module loader only after an explicit tenant-source
|
|
178
|
+
* classification.
|
|
179
|
+
*
|
|
180
|
+
* The tag is read through the shared symbol registry instead of importing the
|
|
181
|
+
* rendering layer; see src/rendering/orchestrator/module-loader/build-failure.ts.
|
|
182
|
+
*/
|
|
183
|
+
const TENANT_BUILD_FAILURE_TAG = Symbol.for("veryfront.module-loader.tenant-build-failure");
|
|
184
|
+
function hasOwnTrueSymbol(value, key) {
|
|
185
|
+
const descriptor = ReflectGetOwnPropertyDescriptor(value, key);
|
|
186
|
+
return descriptor !== undefined &&
|
|
187
|
+
ReflectApply(ObjectPrototypeHasOwnProperty, descriptor, ["value"]) === true &&
|
|
188
|
+
descriptor.value === true;
|
|
189
|
+
}
|
|
190
|
+
/**
|
|
191
|
+
* Whether `error` describes tenant build/content failing to compile (a page
|
|
192
|
+
* that does not build, MDX that does not parse) rather than a framework fault.
|
|
193
|
+
*
|
|
194
|
+
* Recognizes the existing discriminators at their capture seam:
|
|
195
|
+
* - the module loader's tenant-build-failure tag, and
|
|
196
|
+
* - the shared slug/context classification in `#veryfront/errors`, which is the
|
|
197
|
+
* single owner of the tenant-source verdict.
|
|
198
|
+
*/
|
|
199
|
+
function isTenantBuildError(error) {
|
|
200
|
+
try {
|
|
201
|
+
if (error instanceof Error) {
|
|
202
|
+
if (hasOwnTrueSymbol(error, TENANT_BUILD_FAILURE_TAG))
|
|
203
|
+
return true;
|
|
204
|
+
}
|
|
205
|
+
return isTenantSourceBuildError(error);
|
|
206
|
+
}
|
|
207
|
+
catch {
|
|
208
|
+
return false;
|
|
209
|
+
}
|
|
210
|
+
}
|
|
170
211
|
export function captureApplicationError(error, context) {
|
|
171
212
|
if (isExpectedApplicationError(error))
|
|
172
213
|
return undefined;
|
|
@@ -174,7 +215,17 @@ export function captureApplicationError(error, context) {
|
|
|
174
215
|
if (!currentReporter)
|
|
175
216
|
return undefined;
|
|
176
217
|
try {
|
|
177
|
-
|
|
218
|
+
// Tenant build/content failures stay captured for escalation analysis,
|
|
219
|
+
// but are tagged and downgraded so per-request tenant mistakes stop
|
|
220
|
+
// surfacing as error-level framework issues.
|
|
221
|
+
const classifiedContext = isTenantBuildError(error)
|
|
222
|
+
? {
|
|
223
|
+
...context,
|
|
224
|
+
errorClass: context.errorClass ?? TENANT_BUILD_ERROR_CLASS,
|
|
225
|
+
level: context.level ?? "warning",
|
|
226
|
+
}
|
|
227
|
+
: context;
|
|
228
|
+
const snapshot = snapshotApplicationErrorContext(classifiedContext);
|
|
178
229
|
return snapshot ? currentReporter.capture(error, snapshot) : undefined;
|
|
179
230
|
}
|
|
180
231
|
catch {
|
|
@@ -208,7 +259,14 @@ export async function flushApplicationErrors(timeoutMs = 2_000) {
|
|
|
208
259
|
}
|
|
209
260
|
export function isExpectedApplicationError(error) {
|
|
210
261
|
try {
|
|
211
|
-
|
|
262
|
+
if (error instanceof DOMException && error.name === "AbortError")
|
|
263
|
+
return true;
|
|
264
|
+
// Client-class (4xx) VeryfrontErrors describe caller or tenant content
|
|
265
|
+
// (e.g. a rejected hosted config), not a server fault. They are still
|
|
266
|
+
// logged at their throw sites; reporting them per request would flood the
|
|
267
|
+
// error tracker with failures no code change here can fix.
|
|
268
|
+
const snapshot = snapshotVeryfrontError(error);
|
|
269
|
+
return snapshot !== null && snapshot.status >= 400 && snapshot.status < 500;
|
|
212
270
|
}
|
|
213
271
|
catch {
|
|
214
272
|
return false;
|
|
@@ -221,7 +279,7 @@ function snapshotApplicationErrorContext(context) {
|
|
|
221
279
|
if (!boundary)
|
|
222
280
|
return null;
|
|
223
281
|
const snapshot = { boundary };
|
|
224
|
-
for (const key of ["method", "processRole", "requestId", "spanId", "traceId"]) {
|
|
282
|
+
for (const key of ["method", "processRole", "requestId", "spanId", "traceId", "errorClass"]) {
|
|
225
283
|
const value = context[key];
|
|
226
284
|
if (value === undefined)
|
|
227
285
|
continue;
|
|
@@ -229,6 +287,9 @@ function snapshotApplicationErrorContext(context) {
|
|
|
229
287
|
if (normalized)
|
|
230
288
|
snapshot[key] = normalized;
|
|
231
289
|
}
|
|
290
|
+
if (context.level === "error" || context.level === "warning") {
|
|
291
|
+
snapshot.level = context.level;
|
|
292
|
+
}
|
|
232
293
|
const attributes = sanitizeTelemetryAttributes(context.attributes);
|
|
233
294
|
if (attributes && Object.keys(attributes).length > 0) {
|
|
234
295
|
snapshot.attributes = Object.freeze(attributes);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"http-server.d.ts","sourceRoot":"","sources":["../../../../../../src/src/platform/adapters/runtime/deno/http-server.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AAa1D,KAAK,kBAAkB,GAAG,CACxB,OAAO,EAAE,OAAO,KACb,OAAO,CAAC,QAAQ,CAAC,GAAG,QAAQ,CAAC;AAElC,MAAM,WA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B,OAAO,CAAC,MAAM,CAAC,CAajB"}
|
|
@@ -4,7 +4,7 @@ import { getEnvOverlayStorage } from "../../../compat/process.js";
|
|
|
4
4
|
import { isErrorAcrossRealms } from "../../../compat/error-introspection.js";
|
|
5
5
|
import { INITIALIZATION_ERROR, NOT_SUPPORTED } from "../../../../errors/error-registry/general.js";
|
|
6
6
|
import { serverLogger } from "../../../../utils/logger/logger.js";
|
|
7
|
-
import {
|
|
7
|
+
import { recordDenoServeRequestPeer } from "../shared/request-peer.js";
|
|
8
8
|
function abortError(signal) {
|
|
9
9
|
return isErrorAcrossRealms(signal.reason)
|
|
10
10
|
? signal.reason
|
|
@@ -120,15 +120,7 @@ export async function createDenoServerWithRuntime(runtime, handler, options = {}
|
|
|
120
120
|
signal: controller.signal,
|
|
121
121
|
handler: async (request, info) => {
|
|
122
122
|
try {
|
|
123
|
-
|
|
124
|
-
if (remoteAddress?.transport === "tcp" &&
|
|
125
|
-
typeof remoteAddress.hostname === "string") {
|
|
126
|
-
recordRequestPeerFromTransport(request, {
|
|
127
|
-
runtime: "deno",
|
|
128
|
-
transport: "tcp",
|
|
129
|
-
hostname: remoteAddress.hostname,
|
|
130
|
-
});
|
|
131
|
-
}
|
|
123
|
+
recordDenoServeRequestPeer(request, info);
|
|
132
124
|
const response = await wrappedHandler(request);
|
|
133
125
|
return toNativeResponse(response, NativeResponse);
|
|
134
126
|
}
|
|
@@ -16,6 +16,18 @@ export interface RequestPeerProvenance {
|
|
|
16
16
|
}
|
|
17
17
|
/** @internal Record native transport authority before untrusted request code runs. */
|
|
18
18
|
export declare function recordRequestPeerFromTransport(request: Request, provenance: RequestPeerProvenance): boolean;
|
|
19
|
+
/** @internal Record the native peer supplied to a Deno.serve handler. */
|
|
20
|
+
export declare function recordDenoServeRequestPeer(request: Request, info: unknown): boolean;
|
|
21
|
+
/** @internal Record the native peer supplied by a Node IncomingMessage. */
|
|
22
|
+
export declare function recordNodeIncomingRequestPeer(request: Request, incoming: unknown): boolean;
|
|
23
|
+
/** @internal Record the native peer supplied by a Bun server context. */
|
|
24
|
+
export declare function recordBunServerRequestPeer(request: Request, server: unknown): boolean;
|
|
25
|
+
/**
|
|
26
|
+
* @internal Record native peer context passed through a public handler bridge.
|
|
27
|
+
* Supports Deno.serve handler info, Node IncomingMessage values, and Bun server
|
|
28
|
+
* context values.
|
|
29
|
+
*/
|
|
30
|
+
export declare function recordHandlerRequestPeer(request: Request, context: unknown): boolean;
|
|
19
31
|
/** @internal Read immutable transport provenance without consulting headers. */
|
|
20
32
|
export declare function getRequestPeerProvenance(request: Request): RequestPeerProvenance | undefined;
|
|
21
33
|
/**
|
|
@@ -24,6 +36,8 @@ export declare function getRequestPeerProvenance(request: Request): RequestPeerP
|
|
|
24
36
|
* replacement cannot manufacture trust.
|
|
25
37
|
*/
|
|
26
38
|
export declare function inheritRequestPeerProvenance<T extends Request>(source: Request, target: T): T;
|
|
39
|
+
/** @internal Run an interceptor without discarding transport peer authority. */
|
|
40
|
+
export declare function runRequestInterceptor(request: Request, interceptor: (request: Request) => Request | Promise<Request>): Promise<Request>;
|
|
27
41
|
/** @internal True for IPv4 127/8, IPv6 ::1, or mapped IPv4 127/8. */
|
|
28
42
|
export declare function isLoopbackAddress(hostname: string): boolean;
|
|
29
43
|
/** True only when recorded native peer provenance contains a loopback address. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"request-peer.d.ts","sourceRoot":"","sources":["../../../../../../src/src/platform/adapters/runtime/shared/request-peer.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,MAAM,MAAM,kBAAkB,GAAG,MAAM,GAAG,MAAM,GAAG,KAAK,CAAC;AAEzD,MAAM,WAAW,qBAAqB;IACpC,QAAQ,CAAC,OAAO,EAAE,kBAAkB,CAAC;IACrC,QAAQ,CAAC,SAAS,EAAE,KAAK,CAAC;IAC1B,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;CAC3B;
|
|
1
|
+
{"version":3,"file":"request-peer.d.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