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,4 +1,14 @@
|
|
|
1
1
|
export declare function extractNamedImports(code: string, importStatement: string): string[];
|
|
2
2
|
export declare function generateStubCode(modulePath: string, namedImports?: string[]): string;
|
|
3
|
-
export
|
|
3
|
+
export interface DeferredImportErrorDescriptor {
|
|
4
|
+
name: string;
|
|
5
|
+
message: string;
|
|
6
|
+
}
|
|
7
|
+
export interface CreateStubModuleOptions {
|
|
8
|
+
/** Reject a dynamic import when it executes instead of exporting fallback values. */
|
|
9
|
+
failOnImport?: boolean;
|
|
10
|
+
/** Sanitized typed error to throw when a strict dynamic import executes. */
|
|
11
|
+
deferredError?: DeferredImportErrorDescriptor;
|
|
12
|
+
}
|
|
13
|
+
export declare function createStubModule(modulePath: string, code: string, importStatement: string, esmCacheDir: string, options?: CreateStubModuleOptions): Promise<string | null>;
|
|
4
14
|
//# sourceMappingURL=stub-module.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"stub-module.d.ts","sourceRoot":"","sources":["../../../../../../src/src/transforms/mdx/esm-module-loader/utils/stub-module.ts"],"names":[],"mappings":"AAOA,wBAAgB,mBAAmB,CACjC,IAAI,EAAE,MAAM,EACZ,eAAe,EAAE,MAAM,GACtB,MAAM,EAAE,CAcV;AAgBD,wBAAgB,gBAAgB,CAC9B,UAAU,EAAE,MAAM,EAClB,YAAY,GAAE,MAAM,EAAO,GAC1B,MAAM,CA0BR;AAED,wBAAsB,gBAAgB,CACpC,UAAU,EAAE,MAAM,EAClB,IAAI,EAAE,MAAM,EACZ,eAAe,EAAE,MAAM,EACvB,WAAW,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"stub-module.d.ts","sourceRoot":"","sources":["../../../../../../src/src/transforms/mdx/esm-module-loader/utils/stub-module.ts"],"names":[],"mappings":"AAOA,wBAAgB,mBAAmB,CACjC,IAAI,EAAE,MAAM,EACZ,eAAe,EAAE,MAAM,GACtB,MAAM,EAAE,CAcV;AAgBD,wBAAgB,gBAAgB,CAC9B,UAAU,EAAE,MAAM,EAClB,YAAY,GAAE,MAAM,EAAO,GAC1B,MAAM,CA0BR;AAED,MAAM,WAAW,6BAA6B;IAC5C,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;CACjB;AAiBD,MAAM,WAAW,uBAAuB;IACtC,qFAAqF;IACrF,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,4EAA4E;IAC5E,aAAa,CAAC,EAAE,6BAA6B,CAAC;CAC/C;AAED,wBAAsB,gBAAgB,CACpC,UAAU,EAAE,MAAM,EAClB,IAAI,EAAE,MAAM,EACZ,eAAe,EAAE,MAAM,EACvB,WAAW,EAAE,MAAM,EACnB,OAAO,GAAE,uBAA4B,GACpC,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CA4CxB"}
|
|
@@ -52,28 +52,45 @@ export default new Proxy(function(){}, handler);
|
|
|
52
52
|
${namedExports}
|
|
53
53
|
`;
|
|
54
54
|
}
|
|
55
|
-
|
|
55
|
+
function generateDeferredImportFailureCode(modulePath, deferredError) {
|
|
56
|
+
const message = JSON.stringify(deferredError?.message ??
|
|
57
|
+
`[Veryfront] Missing module: ${modulePath}. This module or file does not exist in your project.`);
|
|
58
|
+
const name = JSON.stringify(deferredError?.name ?? "MissingModuleError");
|
|
59
|
+
return `const error = new Error(${message});
|
|
60
|
+
error.name = ${name};
|
|
61
|
+
throw error;
|
|
62
|
+
`;
|
|
63
|
+
}
|
|
64
|
+
export async function createStubModule(modulePath, code, importStatement, esmCacheDir, options = {}) {
|
|
56
65
|
const namedImports = extractNamedImports(code, importStatement);
|
|
57
|
-
const
|
|
66
|
+
const behavior = options.failOnImport ? "fail-on-import" : "fallback";
|
|
67
|
+
const deferredIdentity = options.deferredError
|
|
68
|
+
? `${options.deferredError.name}:${options.deferredError.message}`
|
|
69
|
+
: "";
|
|
70
|
+
const stubHash = hashString(`stub:${behavior}:${modulePath}:${namedImports.join(",")}:${deferredIdentity}`);
|
|
58
71
|
const stubPath = join(esmCacheDir, `stub-${stubHash}.mjs`);
|
|
59
|
-
const stubCode =
|
|
72
|
+
const stubCode = options.failOnImport
|
|
73
|
+
? generateDeferredImportFailureCode(modulePath, options.deferredError)
|
|
74
|
+
: generateStubCode(modulePath, namedImports);
|
|
60
75
|
try {
|
|
61
76
|
await getLocalFs().writeTextFile(stubPath, stubCode);
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
77
|
+
if (!options.failOnImport) {
|
|
78
|
+
const errorMessage = namedImports.length
|
|
79
|
+
? `Missing module: ${modulePath} (imports: ${namedImports.join(", ")})`
|
|
80
|
+
: `Missing module: ${modulePath}`;
|
|
81
|
+
try {
|
|
82
|
+
getErrorCollector().addModuleError(errorMessage, modulePath, {
|
|
83
|
+
namedImports,
|
|
84
|
+
importStatement,
|
|
85
|
+
});
|
|
86
|
+
}
|
|
87
|
+
catch (_) {
|
|
88
|
+
/* expected: error collector may not be initialized in all contexts */
|
|
89
|
+
}
|
|
90
|
+
logger.error(`${LOG_PREFIX_MDX_LOADER} Missing module: ${modulePath}`, {
|
|
67
91
|
namedImports,
|
|
68
|
-
importStatement,
|
|
69
92
|
});
|
|
70
93
|
}
|
|
71
|
-
catch (_) {
|
|
72
|
-
/* expected: error collector may not be initialized in all contexts */
|
|
73
|
-
}
|
|
74
|
-
logger.error(`${LOG_PREFIX_MDX_LOADER} Missing module: ${modulePath}`, {
|
|
75
|
-
namedImports,
|
|
76
|
-
});
|
|
77
94
|
return stubPath;
|
|
78
95
|
}
|
|
79
96
|
catch (error) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"compile.d.ts","sourceRoot":"","sources":["../../../../../src/src/transforms/pipeline/stages/compile.ts"],"names":[],"mappings":"AAMA,OAAO,EAAyB,KAAK,eAAe,EAAkB,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"compile.d.ts","sourceRoot":"","sources":["../../../../../src/src/transforms/pipeline/stages/compile.ts"],"names":[],"mappings":"AAMA,OAAO,EAAyB,KAAK,eAAe,EAAkB,MAAM,aAAa,CAAC;AAoD1F,eAAO,MAAM,aAAa,EAAE,eAqE3B,CAAC"}
|
|
@@ -6,6 +6,46 @@ import { upgradeImportAssertions } from "../../esm/import-attributes.js";
|
|
|
6
6
|
import { ESBUILD_SUPPORTED_FEATURES, getLoaderFromPath } from "../../esm/transform-utils.js";
|
|
7
7
|
import { TransformStage } from "../types.js";
|
|
8
8
|
const logger = rendererLogger.component("esm-transform");
|
|
9
|
+
const ESBUILD_SOURCE_DIAGNOSTIC = Symbol.for("veryfront.bundler.esbuild-source-diagnostic");
|
|
10
|
+
const ObjectPrototypeHasOwnProperty = Object.prototype.hasOwnProperty;
|
|
11
|
+
const ReflectApply = Reflect.apply;
|
|
12
|
+
const ReflectGetOwnPropertyDescriptor = Reflect.getOwnPropertyDescriptor;
|
|
13
|
+
function readOwnDataProperty(value, key) {
|
|
14
|
+
if (value === null ||
|
|
15
|
+
(typeof value !== "object" && typeof value !== "function")) {
|
|
16
|
+
return undefined;
|
|
17
|
+
}
|
|
18
|
+
try {
|
|
19
|
+
const descriptor = ReflectGetOwnPropertyDescriptor(value, key);
|
|
20
|
+
if (descriptor !== undefined &&
|
|
21
|
+
ReflectApply(ObjectPrototypeHasOwnProperty, descriptor, ["value"]) === true) {
|
|
22
|
+
return descriptor.value;
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
catch {
|
|
26
|
+
// A hostile proxy cannot provide trusted source-diagnostic evidence.
|
|
27
|
+
}
|
|
28
|
+
return undefined;
|
|
29
|
+
}
|
|
30
|
+
function isEsbuildSourceDiagnostic(error) {
|
|
31
|
+
return readOwnDataProperty(error, ESBUILD_SOURCE_DIAGNOSTIC) === true;
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* `.mdx` and `.md` reach this stage as *generated* JSX: PARSE has already run
|
|
35
|
+
* the MDX compiler over the tenant's source, so `ctx.code` here is framework
|
|
36
|
+
* output. A diagnostic with a location points into that generated code, not
|
|
37
|
+
* into anything the project wrote, so it must not claim tenant ownership — a
|
|
38
|
+
* remark/rehype/recma plugin emitting broken JSX is a framework fault that has
|
|
39
|
+
* to page someone.
|
|
40
|
+
*
|
|
41
|
+
* Nothing is lost by refusing to infer ownership for these two extensions:
|
|
42
|
+
* genuine MDX and Markdown *source* errors are classified upstream at PARSE as
|
|
43
|
+
* `mdx-compile-error` / `markdown-compile-error`, both of which the shared
|
|
44
|
+
* tenant classifier already recognizes.
|
|
45
|
+
*/
|
|
46
|
+
function isGeneratedContentOutput(filePath) {
|
|
47
|
+
return filePath.endsWith(".mdx") || filePath.endsWith(".md");
|
|
48
|
+
}
|
|
9
49
|
export const compilePlugin = {
|
|
10
50
|
name: "esbuild-compile",
|
|
11
51
|
stage: TransformStage.COMPILE,
|
|
@@ -58,6 +98,10 @@ export const compilePlugin = {
|
|
|
58
98
|
throw COMPILATION_ERROR.create({
|
|
59
99
|
detail: `ESM transform failed for ${ctx.filePath} (loader: ${loader}): ${errorMsg}`,
|
|
60
100
|
cause: err,
|
|
101
|
+
context: {
|
|
102
|
+
tenantBuildFailure: !isGeneratedContentOutput(ctx.filePath) &&
|
|
103
|
+
isEsbuildSourceDiagnostic(err),
|
|
104
|
+
},
|
|
61
105
|
});
|
|
62
106
|
}
|
|
63
107
|
},
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Import specifier query/hash suffix splitting.
|
|
3
|
+
*
|
|
4
|
+
* @module transforms/shared/specifier-suffix
|
|
5
|
+
*/
|
|
6
|
+
/** A specifier split into its path and its trailing `?query` / `#hash`. */
|
|
7
|
+
export interface SplitSpecifier {
|
|
8
|
+
readonly path: string;
|
|
9
|
+
readonly suffix: string;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* Split an import specifier into the path and everything from the first `?` or
|
|
13
|
+
* `#` onward, whichever comes first.
|
|
14
|
+
*
|
|
15
|
+
* The cut is at whichever delimiter appears first, not at `?` by preference:
|
|
16
|
+
* `@/a#b?c` is a hash whose fragment happens to contain a `?`, so the suffix is
|
|
17
|
+
* `#b?c` and the path is `@/a`. Splitting on `?` there would leave `#b` stuck
|
|
18
|
+
* on the path and no file would resolve.
|
|
19
|
+
*
|
|
20
|
+
* This is the single definition of that rule. It previously existed as three
|
|
21
|
+
* separate copies across the alias, nested-import and HTTP-cache resolvers,
|
|
22
|
+
* which agreed only by coincidence.
|
|
23
|
+
*/
|
|
24
|
+
export declare function splitSpecifierSuffix(specifier: string): SplitSpecifier;
|
|
25
|
+
//# sourceMappingURL=specifier-suffix.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"specifier-suffix.d.ts","sourceRoot":"","sources":["../../../../src/src/transforms/shared/specifier-suffix.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAeH,2EAA2E;AAC3E,MAAM,WAAW,cAAc;IAC7B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;CACzB;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,oBAAoB,CAAC,SAAS,EAAE,MAAM,GAAG,cAAc,CActE"}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Import specifier query/hash suffix splitting.
|
|
3
|
+
*
|
|
4
|
+
* @module transforms/shared/specifier-suffix
|
|
5
|
+
*/
|
|
6
|
+
const ReflectApply = Reflect.apply;
|
|
7
|
+
const MathMin = Math.min;
|
|
8
|
+
const StringIndexOf = String.prototype.indexOf;
|
|
9
|
+
const StringSlice = String.prototype.slice;
|
|
10
|
+
function stringIndexOf(value, search) {
|
|
11
|
+
return ReflectApply(StringIndexOf, value, [search]);
|
|
12
|
+
}
|
|
13
|
+
function stringSlice(value, start, end) {
|
|
14
|
+
return ReflectApply(StringSlice, value, end === undefined ? [start] : [start, end]);
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Split an import specifier into the path and everything from the first `?` or
|
|
18
|
+
* `#` onward, whichever comes first.
|
|
19
|
+
*
|
|
20
|
+
* The cut is at whichever delimiter appears first, not at `?` by preference:
|
|
21
|
+
* `@/a#b?c` is a hash whose fragment happens to contain a `?`, so the suffix is
|
|
22
|
+
* `#b?c` and the path is `@/a`. Splitting on `?` there would leave `#b` stuck
|
|
23
|
+
* on the path and no file would resolve.
|
|
24
|
+
*
|
|
25
|
+
* This is the single definition of that rule. It previously existed as three
|
|
26
|
+
* separate copies across the alias, nested-import and HTTP-cache resolvers,
|
|
27
|
+
* which agreed only by coincidence.
|
|
28
|
+
*/
|
|
29
|
+
export function splitSpecifierSuffix(specifier) {
|
|
30
|
+
const queryStart = stringIndexOf(specifier, "?");
|
|
31
|
+
const hashStart = stringIndexOf(specifier, "#");
|
|
32
|
+
const suffixStart = queryStart === -1
|
|
33
|
+
? hashStart
|
|
34
|
+
: hashStart === -1
|
|
35
|
+
? queryStart
|
|
36
|
+
: MathMin(queryStart, hashStart);
|
|
37
|
+
if (suffixStart === -1)
|
|
38
|
+
return { path: specifier, suffix: "" };
|
|
39
|
+
return {
|
|
40
|
+
path: stringSlice(specifier, 0, suffixStart),
|
|
41
|
+
suffix: stringSlice(specifier, suffixStart),
|
|
42
|
+
};
|
|
43
|
+
}
|
|
@@ -24,9 +24,9 @@
|
|
|
24
24
|
import "../../_dnt.polyfills.js";
|
|
25
25
|
export { discoverSourceTriggers } from "./discovery.js";
|
|
26
26
|
export { runTriggerTarget } from "./local-runner.js";
|
|
27
|
-
export { isTriggerTarget } from "./target.js";
|
|
27
|
+
export { conversationConflictDiagnostic, declarationConflictDiagnostic, isTriggerTarget, } from "./target.js";
|
|
28
28
|
export { isTriggerId } from "./validation.js";
|
|
29
29
|
export type { SourceTriggerDiscoveryError, SourceTriggerDiscoveryErrorCode, SourceTriggerDiscoveryOptions, SourceTriggerDiscoveryResult, SourceTriggerKind, TriggerDefinitionWithId, TriggerDiscoveryOptions, } from "./discovery.js";
|
|
30
30
|
export type { RunTriggerTargetOptions, TriggerTargetRunResult } from "./local-runner.js";
|
|
31
|
-
export type { TriggerTarget, TriggerTargetKind } from "./target.js";
|
|
31
|
+
export type { AgentConversationMode, AgentTriggerTarget, ResolvedTriggerTarget, TaskTriggerTarget, TriggerTarget, TriggerTargetConfig, TriggerTargetKind, WorkflowTriggerTarget, } from "./target.js";
|
|
32
32
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/src/trigger/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,OAAO,yBAAyB,CAAC;AAGjC,OAAO,EAAE,sBAAsB,EAAE,MAAM,gBAAgB,CAAC;AACxD,OAAO,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AACrD,OAAO,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/src/trigger/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,OAAO,yBAAyB,CAAC;AAGjC,OAAO,EAAE,sBAAsB,EAAE,MAAM,gBAAgB,CAAC;AACxD,OAAO,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AACrD,OAAO,EACL,8BAA8B,EAC9B,6BAA6B,EAC7B,eAAe,GAChB,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAC9C,YAAY,EACV,2BAA2B,EAC3B,+BAA+B,EAC/B,6BAA6B,EAC7B,4BAA4B,EAC5B,iBAAiB,EACjB,uBAAuB,EACvB,uBAAuB,GACxB,MAAM,gBAAgB,CAAC;AACxB,YAAY,EAAE,uBAAuB,EAAE,sBAAsB,EAAE,MAAM,mBAAmB,CAAC;AACzF,YAAY,EACV,qBAAqB,EACrB,kBAAkB,EAClB,qBAAqB,EACrB,iBAAiB,EACjB,aAAa,EACb,mBAAmB,EACnB,iBAAiB,EACjB,qBAAqB,GACtB,MAAM,aAAa,CAAC"}
|
package/esm/src/trigger/index.js
CHANGED
|
@@ -24,5 +24,5 @@
|
|
|
24
24
|
import "../../_dnt.polyfills.js";
|
|
25
25
|
export { discoverSourceTriggers } from "./discovery.js";
|
|
26
26
|
export { runTriggerTarget } from "./local-runner.js";
|
|
27
|
-
export { isTriggerTarget } from "./target.js";
|
|
27
|
+
export { conversationConflictDiagnostic, declarationConflictDiagnostic, isTriggerTarget, } from "./target.js";
|
|
28
28
|
export { isTriggerId } from "./validation.js";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { RuntimeAdapter } from "../platform/index.js";
|
|
2
2
|
import type { VeryfrontConfig } from "../config/index.js";
|
|
3
|
-
import { type TriggerTarget } from "./target.js";
|
|
3
|
+
import { type TriggerTarget, type TriggerTargetConfig } from "./target.js";
|
|
4
4
|
/** Options for one local trigger target execution. */
|
|
5
5
|
export interface RunTriggerTargetOptions {
|
|
6
6
|
/** Project root used by unified runtime discovery. */
|
|
@@ -14,7 +14,7 @@ export interface RunTriggerTargetOptions {
|
|
|
14
14
|
/** Project identifier exposed to task execution context. */
|
|
15
15
|
projectId?: string;
|
|
16
16
|
/** Canonical task, workflow, or agent reference to execute. */
|
|
17
|
-
target:
|
|
17
|
+
target: TriggerTargetConfig;
|
|
18
18
|
/** Bounded JSON input supplied to tasks and workflows. */
|
|
19
19
|
input?: unknown;
|
|
20
20
|
/** Required prompt input for agent targets. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"local-runner.d.ts","sourceRoot":"","sources":["../../../src/src/trigger/local-runner.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAC3D,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAU1D,OAAO,
|
|
1
|
+
{"version":3,"file":"local-runner.d.ts","sourceRoot":"","sources":["../../../src/src/trigger/local-runner.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAC3D,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAU1D,OAAO,EAGL,KAAK,aAAa,EAClB,KAAK,mBAAmB,EACzB,MAAM,aAAa,CAAC;AAKrB,sDAAsD;AACtD,MAAM,WAAW,uBAAuB;IACtC,sDAAsD;IACtD,UAAU,EAAE,MAAM,CAAC;IACnB,sEAAsE;IACtE,OAAO,EAAE,cAAc,CAAC;IACxB,qEAAqE;IACrE,MAAM,CAAC,EAAE,eAAe,CAAC;IACzB,8DAA8D;IAC9D,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,4DAA4D;IAC5D,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,+DAA+D;IAC/D,MAAM,EAAE,mBAAmB,CAAC;IAC5B,0DAA0D;IAC1D,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,+CAA+C;IAC/C,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,8DAA8D;IAC9D,YAAY,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACvC,2EAA2E;IAC3E,MAAM,CAAC,EAAE,WAAW,CAAC;IACrB,yCAAyC;IACzC,KAAK,CAAC,EAAE,OAAO,CAAC;CACjB;AAED,8CAA8C;AAC9C,MAAM,WAAW,sBAAsB;IACrC,4BAA4B;IAC5B,IAAI,EAAE,aAAa,CAAC,MAAM,CAAC,CAAC;IAC5B,mCAAmC;IACnC,EAAE,EAAE,MAAM,CAAC;IACX,sCAAsC;IACtC,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,kFAAkF;IAClF,UAAU,EAAE,MAAM,CAAC;CACpB;AAuSD;;;;;;GAMG;AACH,wBAAsB,gBAAgB,CACpC,OAAO,EAAE,uBAAuB,GAC/B,OAAO,CAAC,sBAAsB,CAAC,CA+BjC"}
|
|
@@ -6,7 +6,7 @@ import { createWorkflowClient } from "../workflow/api/workflow-client.js";
|
|
|
6
6
|
import { discoverProjectTaskRuntime, findProjectRuntimeTask, } from "../task/project-runtime.js";
|
|
7
7
|
import { runTask } from "../task/runner.js";
|
|
8
8
|
import { sleep } from "../utils/sleep.js";
|
|
9
|
-
import {
|
|
9
|
+
import { resolveTriggerTarget, } from "./target.js";
|
|
10
10
|
import { snapshotSerializable } from "./validation.js";
|
|
11
11
|
const WORKFLOW_STATUS_POLL_INTERVAL_MS = 1_000;
|
|
12
12
|
function invalidTriggerConfiguration(detail) {
|
|
@@ -257,9 +257,16 @@ async function runAgentTarget(options) {
|
|
|
257
257
|
export async function runTriggerTarget(options) {
|
|
258
258
|
const start = performance.now();
|
|
259
259
|
options.signal?.throwIfAborted();
|
|
260
|
-
const
|
|
261
|
-
if (target ===
|
|
262
|
-
invalidTriggerConfiguration(
|
|
260
|
+
const resolution = resolveTriggerTarget("Trigger target", options.target);
|
|
261
|
+
if (resolution.target === undefined) {
|
|
262
|
+
invalidTriggerConfiguration(resolution.detail);
|
|
263
|
+
}
|
|
264
|
+
const target = resolution.target;
|
|
265
|
+
// A local run never reaches the hosted conversation store, so only
|
|
266
|
+
// `existing` is refusable: `create_new` and `none` both mean "run
|
|
267
|
+
// standalone here" and need no local handling.
|
|
268
|
+
if (target.kind === "agent" && target.conversationMode === "existing") {
|
|
269
|
+
invalidTriggerConfiguration("Local agent trigger runs cannot attach to an existing cloud conversation.");
|
|
263
270
|
}
|
|
264
271
|
const normalizedOptions = {
|
|
265
272
|
...options,
|
|
@@ -1,16 +1,108 @@
|
|
|
1
|
-
/**
|
|
2
|
-
export type
|
|
1
|
+
/** Hosted conversation behavior for an agent trigger target. */
|
|
2
|
+
export type AgentConversationMode = "create_new" | "existing" | "none";
|
|
3
|
+
/** Trigger target addressing a task definition. */
|
|
4
|
+
export interface TaskTriggerTarget extends TriggerTarget {
|
|
5
|
+
/** Definition kind resolved by project runtime discovery. */
|
|
6
|
+
kind: "task";
|
|
7
|
+
/** Canonical slash-separated definition identifier. */
|
|
8
|
+
id: string;
|
|
9
|
+
/** Task targets do not carry hosted conversation behavior. */
|
|
10
|
+
conversationMode?: never;
|
|
11
|
+
/** Task targets do not carry hosted conversation identifiers. */
|
|
12
|
+
conversationId?: never;
|
|
13
|
+
}
|
|
14
|
+
/** Trigger target addressing a workflow definition. */
|
|
15
|
+
export interface WorkflowTriggerTarget extends TriggerTarget {
|
|
16
|
+
/** Definition kind resolved by project runtime discovery. */
|
|
17
|
+
kind: "workflow";
|
|
18
|
+
/** Canonical slash-separated definition identifier. */
|
|
19
|
+
id: string;
|
|
20
|
+
/** Workflow targets do not carry hosted conversation behavior. */
|
|
21
|
+
conversationMode?: never;
|
|
22
|
+
/** Workflow targets do not carry hosted conversation identifiers. */
|
|
23
|
+
conversationId?: never;
|
|
24
|
+
}
|
|
25
|
+
/** Trigger target addressing an agent definition and its hosted conversation. */
|
|
26
|
+
export interface AgentTriggerTarget extends TriggerTarget {
|
|
27
|
+
/** Definition kind resolved by project runtime discovery. */
|
|
28
|
+
kind: "agent";
|
|
29
|
+
/** Canonical slash-separated definition identifier. */
|
|
30
|
+
id: string;
|
|
31
|
+
/** Hosted conversation behavior; defaults to `none`. */
|
|
32
|
+
conversationMode?: AgentConversationMode | undefined;
|
|
33
|
+
/** Existing conversation UUID; required only with `conversationMode: "existing"`. */
|
|
34
|
+
conversationId?: string | null | undefined;
|
|
35
|
+
}
|
|
3
36
|
/** Canonical reference to a runnable project definition. */
|
|
4
37
|
export interface TriggerTarget {
|
|
5
38
|
/** Definition kind resolved by project runtime discovery. */
|
|
6
|
-
kind:
|
|
39
|
+
kind: "task" | "workflow" | "agent";
|
|
7
40
|
/** Canonical slash-separated definition identifier. */
|
|
8
41
|
id: string;
|
|
9
42
|
}
|
|
43
|
+
/** Author-facing target shape accepting stored base values and kind-specific literals. */
|
|
44
|
+
export type TriggerTargetConfig = (TriggerTarget & {
|
|
45
|
+
conversationMode?: never;
|
|
46
|
+
conversationId?: never;
|
|
47
|
+
}) | TaskTriggerTarget | WorkflowTriggerTarget | AgentTriggerTarget;
|
|
48
|
+
/** Validated target value that narrows conversation fields by `kind`. */
|
|
49
|
+
export type ResolvedTriggerTarget = TaskTriggerTarget | WorkflowTriggerTarget | AgentTriggerTarget;
|
|
50
|
+
/** Supported local trigger target kinds. */
|
|
51
|
+
export type TriggerTargetKind = TriggerTarget["kind"];
|
|
52
|
+
/**
|
|
53
|
+
* Own keys a trigger target may declare, widened for agent targets.
|
|
54
|
+
*
|
|
55
|
+
* TypeScript without `exactOptionalPropertyTypes` accepts an explicitly
|
|
56
|
+
* undefined value for an optional `never` property. Keep that authoring shape
|
|
57
|
+
* aligned with runtime normalization while still rejecting accessors and every
|
|
58
|
+
* defined conversation value on non-agent targets.
|
|
59
|
+
*/
|
|
60
|
+
export declare function triggerTargetKeys(value: unknown): readonly string[];
|
|
61
|
+
/**
|
|
62
|
+
* Describe why agent conversation addressing is invalid, or return `null`.
|
|
63
|
+
*
|
|
64
|
+
* `label` prefixes the diagnostic so schedules, webhooks, and targets report
|
|
65
|
+
* the same invariant with their own field path.
|
|
66
|
+
*/
|
|
67
|
+
export declare function agentConversationDiagnostic(label: string, conversationMode: unknown, conversationId: unknown): string | null;
|
|
68
|
+
/**
|
|
69
|
+
* Describe one value declared in two places with disagreeing content.
|
|
70
|
+
*
|
|
71
|
+
* Repeating a value is redundant, not wrong: an author spanning a platform
|
|
72
|
+
* upgrade must be able to write a single definition that both the old and the
|
|
73
|
+
* new platform read correctly. Only a disagreement is unresolvable, because
|
|
74
|
+
* honoring one copy would detach the deployed trigger from what the other copy
|
|
75
|
+
* names.
|
|
76
|
+
*/
|
|
77
|
+
export declare function declarationConflictDiagnostic(label: string, path: string, legacyPath: string, value: unknown, legacyValue: unknown): string | null;
|
|
78
|
+
/**
|
|
79
|
+
* Describe a conversation pair that disagrees across two locations.
|
|
80
|
+
*
|
|
81
|
+
* `legacyLabel` names the other location so the message spells out both real
|
|
82
|
+
* field paths without ranking them: which one a given platform reads depends
|
|
83
|
+
* on its version, so neither can be called authoritative here.
|
|
84
|
+
*/
|
|
85
|
+
export declare function conversationConflictDiagnostic(label: string, legacyLabel: string, target: ResolvedTriggerTarget, legacyConversationMode: unknown, legacyConversationId: unknown): string | null;
|
|
86
|
+
/** A canonical target, or the reason the value is not one. */
|
|
87
|
+
export type TriggerTargetResolution = {
|
|
88
|
+
readonly target: ResolvedTriggerTarget;
|
|
89
|
+
readonly detail?: undefined;
|
|
90
|
+
} | {
|
|
91
|
+
readonly target?: undefined;
|
|
92
|
+
readonly detail: string;
|
|
93
|
+
};
|
|
94
|
+
/**
|
|
95
|
+
* Validate and copy the canonical fields of a trigger target.
|
|
96
|
+
*
|
|
97
|
+
* Public `TriggerTarget` interfaces are intentionally extendable, so this
|
|
98
|
+
* generic helper ignores caller-owned extension fields. Schedule and webhook
|
|
99
|
+
* authoring validators apply strict key checks before calling this helper.
|
|
100
|
+
*/
|
|
101
|
+
export declare function resolveTriggerTarget(label: string, value: unknown): TriggerTargetResolution;
|
|
10
102
|
/**
|
|
11
103
|
* Validate and copy a trigger target without retaining caller-owned state.
|
|
12
104
|
*/
|
|
13
|
-
export declare function snapshotTriggerTarget(value: unknown):
|
|
105
|
+
export declare function snapshotTriggerTarget(value: unknown): ResolvedTriggerTarget | null;
|
|
14
106
|
/** Return true only for canonical targets stored in own data properties. */
|
|
15
|
-
export declare function isTriggerTarget(value: unknown): value is
|
|
107
|
+
export declare function isTriggerTarget(value: unknown): value is ResolvedTriggerTarget;
|
|
16
108
|
//# sourceMappingURL=target.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"target.d.ts","sourceRoot":"","sources":["../../../src/src/trigger/target.ts"],"names":[],"mappings":"AAEA,
|
|
1
|
+
{"version":3,"file":"target.d.ts","sourceRoot":"","sources":["../../../src/src/trigger/target.ts"],"names":[],"mappings":"AAEA,gEAAgE;AAChE,MAAM,MAAM,qBAAqB,GAAG,YAAY,GAAG,UAAU,GAAG,MAAM,CAAC;AAEvE,mDAAmD;AACnD,MAAM,WAAW,iBAAkB,SAAQ,aAAa;IACtD,6DAA6D;IAC7D,IAAI,EAAE,MAAM,CAAC;IACb,uDAAuD;IACvD,EAAE,EAAE,MAAM,CAAC;IACX,8DAA8D;IAC9D,gBAAgB,CAAC,EAAE,KAAK,CAAC;IACzB,iEAAiE;IACjE,cAAc,CAAC,EAAE,KAAK,CAAC;CACxB;AAED,uDAAuD;AACvD,MAAM,WAAW,qBAAsB,SAAQ,aAAa;IAC1D,6DAA6D;IAC7D,IAAI,EAAE,UAAU,CAAC;IACjB,uDAAuD;IACvD,EAAE,EAAE,MAAM,CAAC;IACX,kEAAkE;IAClE,gBAAgB,CAAC,EAAE,KAAK,CAAC;IACzB,qEAAqE;IACrE,cAAc,CAAC,EAAE,KAAK,CAAC;CACxB;AAED,iFAAiF;AACjF,MAAM,WAAW,kBAAmB,SAAQ,aAAa;IACvD,6DAA6D;IAC7D,IAAI,EAAE,OAAO,CAAC;IACd,uDAAuD;IACvD,EAAE,EAAE,MAAM,CAAC;IACX,wDAAwD;IACxD,gBAAgB,CAAC,EAAE,qBAAqB,GAAG,SAAS,CAAC;IACrD,qFAAqF;IACrF,cAAc,CAAC,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,CAAC;CAC5C;AAED,4DAA4D;AAC5D,MAAM,WAAW,aAAa;IAC5B,6DAA6D;IAC7D,IAAI,EAAE,MAAM,GAAG,UAAU,GAAG,OAAO,CAAC;IACpC,uDAAuD;IACvD,EAAE,EAAE,MAAM,CAAC;CACZ;AAED,0FAA0F;AAC1F,MAAM,MAAM,mBAAmB,GAC3B,CAAC,aAAa,GAAG;IACjB,gBAAgB,CAAC,EAAE,KAAK,CAAC;IACzB,cAAc,CAAC,EAAE,KAAK,CAAC;CACxB,CAAC,GACA,iBAAiB,GACjB,qBAAqB,GACrB,kBAAkB,CAAC;AAEvB,yEAAyE;AACzE,MAAM,MAAM,qBAAqB,GAC7B,iBAAiB,GACjB,qBAAqB,GACrB,kBAAkB,CAAC;AAEvB,4CAA4C;AAC5C,MAAM,MAAM,iBAAiB,GAAG,aAAa,CAAC,MAAM,CAAC,CAAC;AAuBtD;;;;;;;GAOG;AACH,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,OAAO,GAAG,SAAS,MAAM,EAAE,CAgBnE;AAED;;;;;GAKG;AACH,wBAAgB,2BAA2B,CACzC,KAAK,EAAE,MAAM,EACb,gBAAgB,EAAE,OAAO,EACzB,cAAc,EAAE,OAAO,GACtB,MAAM,GAAG,IAAI,CAuBf;AAED;;;;;;;;GAQG;AACH,wBAAgB,6BAA6B,CAC3C,KAAK,EAAE,MAAM,EACb,IAAI,EAAE,MAAM,EACZ,UAAU,EAAE,MAAM,EAClB,KAAK,EAAE,OAAO,EACd,WAAW,EAAE,OAAO,GACnB,MAAM,GAAG,IAAI,CAIf;AAED;;;;;;GAMG;AACH,wBAAgB,8BAA8B,CAC5C,KAAK,EAAE,MAAM,EACb,WAAW,EAAE,MAAM,EACnB,MAAM,EAAE,qBAAqB,EAC7B,sBAAsB,EAAE,OAAO,EAC/B,oBAAoB,EAAE,OAAO,GAC5B,MAAM,GAAG,IAAI,CAkBf;AAmBD,8DAA8D;AAC9D,MAAM,MAAM,uBAAuB,GAC/B;IAAE,QAAQ,CAAC,MAAM,EAAE,qBAAqB,CAAC;IAAC,QAAQ,CAAC,MAAM,CAAC,EAAE,SAAS,CAAA;CAAE,GACvE;IAAE,QAAQ,CAAC,MAAM,CAAC,EAAE,SAAS,CAAC;IAAC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAA;CAAE,CAAC;AAc7D;;;;;;GAMG;AACH,wBAAgB,oBAAoB,CAClC,KAAK,EAAE,MAAM,EACb,KAAK,EAAE,OAAO,GACb,uBAAuB,CAsDzB;AAED;;GAEG;AACH,wBAAgB,qBAAqB,CAAC,KAAK,EAAE,OAAO,GAAG,qBAAqB,GAAG,IAAI,CAElF;AAED,4EAA4E;AAC5E,wBAAgB,eAAe,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,qBAAqB,CAE9E"}
|
|
@@ -1,27 +1,197 @@
|
|
|
1
1
|
import { isTriggerId } from "./validation.js";
|
|
2
|
+
const AGENT_CONVERSATION_MODES = new Set([
|
|
3
|
+
"create_new",
|
|
4
|
+
"existing",
|
|
5
|
+
"none",
|
|
6
|
+
]);
|
|
7
|
+
const CONVERSATION_ID_PATTERN = /^[0-9a-f]{8}-[0-9a-f]{4}-[1-8][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i;
|
|
8
|
+
const MAX_DIAGNOSTIC_KEY_LENGTH = 80;
|
|
9
|
+
const SIMPLE_DIAGNOSTIC_KEY_PATTERN = /^[A-Za-z_$][A-Za-z0-9_$-]*$/;
|
|
10
|
+
const TARGET_KEYS = ["kind", "id"];
|
|
11
|
+
const CONVERSATION_TARGET_KEYS = ["conversationMode", "conversationId"];
|
|
12
|
+
const AGENT_TARGET_KEYS = [
|
|
13
|
+
...TARGET_KEYS,
|
|
14
|
+
...CONVERSATION_TARGET_KEYS,
|
|
15
|
+
];
|
|
2
16
|
function readOwnDataProperty(value, key) {
|
|
3
17
|
const descriptor = Reflect.getOwnPropertyDescriptor(value, key);
|
|
4
18
|
return descriptor && "value" in descriptor ? descriptor.value : undefined;
|
|
5
19
|
}
|
|
6
20
|
/**
|
|
7
|
-
*
|
|
21
|
+
* Own keys a trigger target may declare, widened for agent targets.
|
|
22
|
+
*
|
|
23
|
+
* TypeScript without `exactOptionalPropertyTypes` accepts an explicitly
|
|
24
|
+
* undefined value for an optional `never` property. Keep that authoring shape
|
|
25
|
+
* aligned with runtime normalization while still rejecting accessors and every
|
|
26
|
+
* defined conversation value on non-agent targets.
|
|
8
27
|
*/
|
|
9
|
-
export function
|
|
28
|
+
export function triggerTargetKeys(value) {
|
|
10
29
|
if (typeof value !== "object" || value === null)
|
|
30
|
+
return TARGET_KEYS;
|
|
31
|
+
try {
|
|
32
|
+
if (readOwnDataProperty(value, "kind") === "agent")
|
|
33
|
+
return AGENT_TARGET_KEYS;
|
|
34
|
+
const keys = [...TARGET_KEYS];
|
|
35
|
+
for (const key of CONVERSATION_TARGET_KEYS) {
|
|
36
|
+
const descriptor = Reflect.getOwnPropertyDescriptor(value, key);
|
|
37
|
+
if (descriptor !== undefined && "value" in descriptor && descriptor.value === undefined) {
|
|
38
|
+
keys.push(key);
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
return keys;
|
|
42
|
+
}
|
|
43
|
+
catch {
|
|
44
|
+
return TARGET_KEYS;
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* Describe why agent conversation addressing is invalid, or return `null`.
|
|
49
|
+
*
|
|
50
|
+
* `label` prefixes the diagnostic so schedules, webhooks, and targets report
|
|
51
|
+
* the same invariant with their own field path.
|
|
52
|
+
*/
|
|
53
|
+
export function agentConversationDiagnostic(label, conversationMode, conversationId) {
|
|
54
|
+
if (conversationMode !== undefined &&
|
|
55
|
+
!AGENT_CONVERSATION_MODES.has(conversationMode)) {
|
|
56
|
+
return `${label}.conversationMode must be create_new, existing, or none.`;
|
|
57
|
+
}
|
|
58
|
+
if (conversationId !== undefined && conversationId !== null &&
|
|
59
|
+
(typeof conversationId !== "string" ||
|
|
60
|
+
!CONVERSATION_ID_PATTERN.test(conversationId))) {
|
|
61
|
+
return `${label}.conversationId must be a UUID or null.`;
|
|
62
|
+
}
|
|
63
|
+
const effectiveMode = conversationMode ?? "none";
|
|
64
|
+
if (effectiveMode === "existing" && typeof conversationId !== "string") {
|
|
65
|
+
return `${label}.conversationId is required when conversationMode is existing.`;
|
|
66
|
+
}
|
|
67
|
+
if (effectiveMode !== "existing" && typeof conversationId === "string") {
|
|
68
|
+
return `${label}.conversationId is allowed only when conversationMode is existing.`;
|
|
69
|
+
}
|
|
70
|
+
return null;
|
|
71
|
+
}
|
|
72
|
+
/**
|
|
73
|
+
* Describe one value declared in two places with disagreeing content.
|
|
74
|
+
*
|
|
75
|
+
* Repeating a value is redundant, not wrong: an author spanning a platform
|
|
76
|
+
* upgrade must be able to write a single definition that both the old and the
|
|
77
|
+
* new platform read correctly. Only a disagreement is unresolvable, because
|
|
78
|
+
* honoring one copy would detach the deployed trigger from what the other copy
|
|
79
|
+
* names.
|
|
80
|
+
*/
|
|
81
|
+
export function declarationConflictDiagnostic(label, path, legacyPath, value, legacyValue) {
|
|
82
|
+
if (value === undefined || legacyValue === undefined)
|
|
83
|
+
return null;
|
|
84
|
+
if (value === legacyValue)
|
|
85
|
+
return null;
|
|
86
|
+
return `${label} ${path} and ${legacyPath} are both set to different values. Declare it in one place.`;
|
|
87
|
+
}
|
|
88
|
+
/**
|
|
89
|
+
* Describe a conversation pair that disagrees across two locations.
|
|
90
|
+
*
|
|
91
|
+
* `legacyLabel` names the other location so the message spells out both real
|
|
92
|
+
* field paths without ranking them: which one a given platform reads depends
|
|
93
|
+
* on its version, so neither can be called authoritative here.
|
|
94
|
+
*/
|
|
95
|
+
export function conversationConflictDiagnostic(label, legacyLabel, target, legacyConversationMode, legacyConversationId) {
|
|
96
|
+
if (target.kind !== "agent")
|
|
97
|
+
return null;
|
|
98
|
+
for (const [field, targetValue, legacyValue] of [
|
|
99
|
+
["conversationMode", target.conversationMode, legacyConversationMode],
|
|
100
|
+
["conversationId", target.conversationId, legacyConversationId],
|
|
101
|
+
]) {
|
|
102
|
+
const detail = declarationConflictDiagnostic(label, `target.${field}`, `${legacyLabel}.${field}`, targetValue, legacyValue);
|
|
103
|
+
if (detail !== null)
|
|
104
|
+
return detail;
|
|
105
|
+
}
|
|
106
|
+
return null;
|
|
107
|
+
}
|
|
108
|
+
function truncateDiagnosticKey(key) {
|
|
109
|
+
if (key.length <= MAX_DIAGNOSTIC_KEY_LENGTH)
|
|
110
|
+
return key;
|
|
111
|
+
let prefix = key.slice(0, MAX_DIAGNOSTIC_KEY_LENGTH);
|
|
112
|
+
const finalCodeUnit = prefix.charCodeAt(prefix.length - 1);
|
|
113
|
+
if (finalCodeUnit >= 0xd800 && finalCodeUnit <= 0xdbff) {
|
|
114
|
+
prefix = prefix.slice(0, -1);
|
|
115
|
+
}
|
|
116
|
+
return `${prefix}…`;
|
|
117
|
+
}
|
|
118
|
+
function formatDiagnosticProperty(label, key) {
|
|
119
|
+
const boundedKey = truncateDiagnosticKey(key);
|
|
120
|
+
return SIMPLE_DIAGNOSTIC_KEY_PATTERN.test(boundedKey)
|
|
121
|
+
? `${label}.${boundedKey}`
|
|
122
|
+
: `${label}[${JSON.stringify(boundedKey)}]`;
|
|
123
|
+
}
|
|
124
|
+
function requireOwnDataField(label, value, key) {
|
|
125
|
+
const descriptor = Reflect.getOwnPropertyDescriptor(value, key);
|
|
126
|
+
if (descriptor === undefined || "value" in descriptor)
|
|
11
127
|
return null;
|
|
128
|
+
return {
|
|
129
|
+
detail: `${formatDiagnosticProperty(label, key)} must be an own data property.`,
|
|
130
|
+
};
|
|
131
|
+
}
|
|
132
|
+
/**
|
|
133
|
+
* Validate and copy the canonical fields of a trigger target.
|
|
134
|
+
*
|
|
135
|
+
* Public `TriggerTarget` interfaces are intentionally extendable, so this
|
|
136
|
+
* generic helper ignores caller-owned extension fields. Schedule and webhook
|
|
137
|
+
* authoring validators apply strict key checks before calling this helper.
|
|
138
|
+
*/
|
|
139
|
+
export function resolveTriggerTarget(label, value) {
|
|
140
|
+
const notATarget = {
|
|
141
|
+
detail: `${label} must specify a canonical task, workflow, or agent id.`,
|
|
142
|
+
};
|
|
143
|
+
if (typeof value !== "object" || value === null)
|
|
144
|
+
return notATarget;
|
|
12
145
|
try {
|
|
13
146
|
const kind = readOwnDataProperty(value, "kind");
|
|
14
147
|
const id = readOwnDataProperty(value, "id");
|
|
15
148
|
if ((kind !== "task" && kind !== "workflow" && kind !== "agent") ||
|
|
16
149
|
!isTriggerId(id)) {
|
|
17
|
-
return
|
|
150
|
+
return notATarget;
|
|
18
151
|
}
|
|
19
|
-
|
|
152
|
+
const conversationModeField = requireOwnDataField(label, value, "conversationMode");
|
|
153
|
+
if (conversationModeField !== null)
|
|
154
|
+
return conversationModeField;
|
|
155
|
+
const conversationIdField = requireOwnDataField(label, value, "conversationId");
|
|
156
|
+
if (conversationIdField !== null)
|
|
157
|
+
return conversationIdField;
|
|
158
|
+
const conversationMode = readOwnDataProperty(value, "conversationMode");
|
|
159
|
+
const conversationId = readOwnDataProperty(value, "conversationId");
|
|
160
|
+
if (kind !== "agent") {
|
|
161
|
+
if (conversationMode !== undefined) {
|
|
162
|
+
return { detail: `${label}.conversationMode is supported only for agent targets.` };
|
|
163
|
+
}
|
|
164
|
+
if (conversationId !== undefined) {
|
|
165
|
+
return { detail: `${label}.conversationId is supported only for agent targets.` };
|
|
166
|
+
}
|
|
167
|
+
return { target: { kind, id } };
|
|
168
|
+
}
|
|
169
|
+
const conversationDetail = agentConversationDiagnostic(label, conversationMode, conversationId);
|
|
170
|
+
if (conversationDetail !== null)
|
|
171
|
+
return { detail: conversationDetail };
|
|
172
|
+
return {
|
|
173
|
+
target: {
|
|
174
|
+
kind,
|
|
175
|
+
id,
|
|
176
|
+
...(conversationMode === undefined
|
|
177
|
+
? {}
|
|
178
|
+
: { conversationMode: conversationMode }),
|
|
179
|
+
...(conversationId === undefined
|
|
180
|
+
? {}
|
|
181
|
+
: { conversationId: conversationId }),
|
|
182
|
+
},
|
|
183
|
+
};
|
|
20
184
|
}
|
|
21
185
|
catch {
|
|
22
|
-
return
|
|
186
|
+
return notATarget;
|
|
23
187
|
}
|
|
24
188
|
}
|
|
189
|
+
/**
|
|
190
|
+
* Validate and copy a trigger target without retaining caller-owned state.
|
|
191
|
+
*/
|
|
192
|
+
export function snapshotTriggerTarget(value) {
|
|
193
|
+
return resolveTriggerTarget("Trigger target", value).target ?? null;
|
|
194
|
+
}
|
|
25
195
|
/** Return true only for canonical targets stored in own data properties. */
|
|
26
196
|
export function isTriggerTarget(value) {
|
|
27
197
|
return snapshotTriggerTarget(value) !== null;
|