experimental-ash 0.26.0 → 0.27.0
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/CHANGELOG.md +7 -0
- package/dist/docs/public/subagents.md +38 -0
- package/dist/src/_virtual/_rolldown/runtime.js +1 -0
- package/dist/src/channel/adapter-context.js +1 -24
- package/dist/src/channel/adapter.js +1 -62
- package/dist/src/channel/compiled-channel.js +1 -6
- package/dist/src/channel/cross-channel-receive.js +2 -108
- package/dist/src/channel/http.js +1 -30
- package/dist/src/channel/receive-args.js +1 -1
- package/dist/src/channel/resolve-text.js +1 -59
- package/dist/src/channel/routes.js +1 -15
- package/dist/src/channel/schedule.js +1 -81
- package/dist/src/channel/send.js +1 -81
- package/dist/src/channel/session-callback.js +1 -65
- package/dist/src/channel/session.js +1 -58
- package/dist/src/channel/types.js +1 -1
- package/dist/src/cli/commands/channels.js +3 -9
- package/dist/src/cli/commands/info.js +2 -2
- package/dist/src/cli/dev/environment.js +1 -1
- package/dist/src/cli/dev/input-requests.js +1 -1
- package/dist/src/cli/dev/input.js +1 -1
- package/dist/src/cli/dev/repl.js +2 -3
- package/dist/src/cli/dev/terminal.js +5 -5
- package/dist/src/cli/dev/url.js +1 -1
- package/dist/src/cli/run.js +2 -2
- package/dist/src/cli/ui/output.js +8 -8
- package/dist/src/client/client-error.js +1 -19
- package/dist/src/client/client.js +1 -128
- package/dist/src/client/index.js +1 -11
- package/dist/src/client/message-reducer-types.js +1 -1
- package/dist/src/client/message-reducer.js +1 -456
- package/dist/src/client/message-response.js +1 -55
- package/dist/src/client/ndjson.js +3 -62
- package/dist/src/client/open-stream.js +1 -45
- package/dist/src/client/reducer.js +1 -1
- package/dist/src/client/session-utils.js +1 -62
- package/dist/src/client/session.js +1 -206
- package/dist/src/client/types.js +1 -1
- package/dist/src/client/url.js +1 -34
- package/dist/src/compiled/.vendor-stamp.json +6 -1
- package/dist/src/compiled/@vercel/oidc/LICENSE +202 -0
- package/dist/src/compiled/@vercel/oidc/index.d.ts +21 -0
- package/dist/src/compiled/@vercel/oidc/index.js +2 -0
- package/dist/src/compiled/@vercel/oidc/package.json +7 -0
- package/dist/src/compiled/chokidar/LICENSE +21 -0
- package/dist/src/compiled/chokidar/index.d.ts +33 -0
- package/dist/src/compiled/chokidar/index.js +1 -0
- package/dist/src/compiled/chokidar/package.json +7 -0
- package/dist/src/compiled/commander/LICENSE +22 -0
- package/dist/src/compiled/commander/index.d.ts +1113 -0
- package/dist/src/{chunks/url-JdCGA634.js → compiled/commander/index.js} +10 -10
- package/dist/src/compiled/commander/package.json +7 -0
- package/dist/src/compiled/gray-matter/LICENSE +21 -0
- package/dist/src/compiled/gray-matter/index.d.ts +62 -0
- package/dist/src/{chunks/gray-matter-D-9jHwOT.js → compiled/gray-matter/index.js} +2 -2
- package/dist/src/compiled/gray-matter/package.json +7 -0
- package/dist/src/compiled/picocolors/LICENSE +15 -0
- package/dist/src/compiled/picocolors/index.d.ts +55 -0
- package/dist/src/compiled/picocolors/index.js +1 -0
- package/dist/src/compiled/picocolors/package.json +7 -0
- package/dist/src/compiler/artifacts.js +1 -147
- package/dist/src/compiler/compile-agent.js +3 -76
- package/dist/src/compiler/compile-from-memory.js +1 -59
- package/dist/src/compiler/manifest.js +1 -424
- package/dist/src/compiler/model-catalog.js +1 -224
- package/dist/src/compiler/module-map.js +5 -295
- package/dist/src/compiler/normalize-agent-config.js +1 -157
- package/dist/src/compiler/normalize-channel.js +1 -51
- package/dist/src/compiler/normalize-connection.js +1 -58
- package/dist/src/compiler/normalize-helpers.js +1 -23
- package/dist/src/compiler/normalize-hook.js +1 -19
- package/dist/src/compiler/normalize-instructions.js +1 -28
- package/dist/src/compiler/normalize-manifest.js +1 -79
- package/dist/src/compiler/normalize-sandbox.js +1 -20
- package/dist/src/compiler/normalize-schedule.js +1 -38
- package/dist/src/compiler/normalize-skill.js +1 -60
- package/dist/src/compiler/normalize-subagent.js +1 -174
- package/dist/src/compiler/normalize-tool.js +1 -40
- package/dist/src/compiler/remote-agent-node.js +1 -19
- package/dist/src/compiler/workspace-resources.js +1 -85
- package/dist/src/context/accessors.js +1 -93
- package/dist/src/context/container.js +1 -89
- package/dist/src/context/hook-lifecycle.js +1 -242
- package/dist/src/context/key.js +1 -39
- package/dist/src/context/keys.js +1 -43
- package/dist/src/context/node.js +1 -9
- package/dist/src/context/provider.js +1 -1
- package/dist/src/context/providers/connection.js +1 -17
- package/dist/src/context/providers/sandbox.js +1 -46
- package/dist/src/context/providers/session.js +1 -18
- package/dist/src/context/run-step.js +1 -51
- package/dist/src/context/seed-keys.js +1 -37
- package/dist/src/context/serialize.js +1 -44
- package/dist/src/discover/connections.js +1 -153
- package/dist/src/discover/diagnostics.js +1 -82
- package/dist/src/discover/discover-agent.js +1 -159
- package/dist/src/discover/discover-subagent.js +1 -223
- package/dist/src/discover/filesystem.js +1 -215
- package/dist/src/discover/grammar.js +1 -371
- package/dist/src/discover/lib.js +1 -34
- package/dist/src/discover/manifest.js +1 -136
- package/dist/src/discover/markdown.js +1 -17
- package/dist/src/discover/named-source-directory.js +1 -188
- package/dist/src/discover/project-source.js +1 -152
- package/dist/src/discover/project.js +1 -117
- package/dist/src/discover/sandbox.js +1 -220
- package/dist/src/discover/schedules.js +1 -41
- package/dist/src/discover/skills.js +1 -274
- package/dist/src/discover/slots.js +1 -68
- package/dist/src/evals/cli/eval.js +1 -1
- package/dist/src/evals/define-eval-suite.js +1 -1
- package/dist/src/evals/index.js +1 -1
- package/dist/src/evals/loaders/index.js +1 -1
- package/dist/src/evals/loaders/json.js +1 -1
- package/dist/src/evals/loaders/yaml.js +1 -1
- package/dist/src/evals/reporters/index.js +1 -1
- package/dist/src/evals/runner/artifacts.js +3 -3
- package/dist/src/evals/runner/derive-run-facts.js +1 -1
- package/dist/src/evals/runner/discover.js +1 -1
- package/dist/src/evals/runner/execute-case.js +1 -1
- package/dist/src/evals/runner/execute-suite.js +1 -1
- package/dist/src/evals/runner/reporters/braintrust.js +2 -2
- package/dist/src/evals/runner/reporters/console.js +1 -1
- package/dist/src/evals/runner/resolve-git-metadata.js +1 -1
- package/dist/src/evals/scorers/autoevals-client.js +2 -2
- package/dist/src/evals/scorers/autoevals.js +1 -1
- package/dist/src/evals/scorers/json.js +1 -1
- package/dist/src/evals/scorers/run.js +1 -1
- package/dist/src/evals/scorers/sql.js +1 -1
- package/dist/src/evals/scorers/text.js +1 -1
- package/dist/src/evals/scores/index.js +1 -1
- package/dist/src/execution/authorization-challenge-defaults.js +1 -60
- package/dist/src/execution/await-authorization-orchestrator.js +1 -192
- package/dist/src/execution/await-authorization-splice.js +1 -66
- package/dist/src/execution/connection-auth-steps.js +1 -338
- package/dist/src/execution/node-step.js +1 -146
- package/dist/src/execution/remote-agent-dispatch.js +1 -79
- package/dist/src/execution/runtime-context.js +1 -26
- package/dist/src/execution/runtime-errors.js +1 -19
- package/dist/src/execution/sandbox/bash-tool.js +1 -42
- package/dist/src/execution/sandbox/bindings/local.js +1 -296
- package/dist/src/execution/sandbox/bindings/vercel.js +1 -363
- package/dist/src/execution/sandbox/ensure.js +1 -91
- package/dist/src/execution/sandbox/glob-tool.js +3 -146
- package/dist/src/execution/sandbox/grep-tool.js +3 -183
- package/dist/src/execution/sandbox/lazy-backend.js +1 -33
- package/dist/src/execution/sandbox/prewarm.js +1 -132
- package/dist/src/execution/sandbox/read-file-tool.js +3 -118
- package/dist/src/execution/sandbox/require-sandbox.js +1 -32
- package/dist/src/execution/sandbox/ripgrep-probe.js +1 -36
- package/dist/src/execution/sandbox/session.js +3 -158
- package/dist/src/execution/sandbox/shell-quote.js +1 -14
- package/dist/src/execution/sandbox/stream-utils.js +1 -22
- package/dist/src/execution/sandbox/truncate-output.js +3 -110
- package/dist/src/execution/sandbox/write-file-tool.js +1 -62
- package/dist/src/execution/session-callback-step.js +1 -72
- package/dist/src/execution/session.js +3 -94
- package/dist/src/execution/skills/instructions.js +2 -30
- package/dist/src/execution/skills/types.js +1 -1
- package/dist/src/execution/subagent-adapter.js +1 -94
- package/dist/src/execution/subagent-hitl-proxy.js +1 -81
- package/dist/src/execution/subagent-invocation.js +2 -16
- package/dist/src/execution/subagent-tool.js +1 -48
- package/dist/src/execution/tool-compaction.js +1 -54
- package/dist/src/execution/turn-workflow.js +1 -95
- package/dist/src/execution/web-fetch/html.js +7 -60
- package/dist/src/execution/web-fetch/tool.js +1 -90
- package/dist/src/execution/workflow-entry.js +1 -494
- package/dist/src/execution/workflow-errors.js +1 -54
- package/dist/src/execution/workflow-runtime.js +3 -161
- package/dist/src/execution/workflow-steps.js +1 -467
- package/dist/src/harness/action-result-helpers.js +1 -82
- package/dist/src/harness/attachment-staging.js +1 -303
- package/dist/src/harness/compaction.js +4 -221
- package/dist/src/harness/emission.js +1 -323
- package/dist/src/harness/execute-tool.js +1 -1
- package/dist/src/harness/input-extraction.js +1 -62
- package/dist/src/harness/input-requests.js +1 -306
- package/dist/src/harness/instrumentation-config.js +1 -42
- package/dist/src/harness/messages.js +1 -144
- package/dist/src/harness/model-call-error.js +1 -368
- package/dist/src/harness/otel-integration.js +1 -18
- package/dist/src/harness/prompt-cache.js +1 -137
- package/dist/src/harness/provider-tools.js +1 -137
- package/dist/src/harness/proxy-input-requests.js +1 -91
- package/dist/src/harness/runtime-actions.js +1 -321
- package/dist/src/harness/step-hooks.js +1 -192
- package/dist/src/harness/tool-loop.js +1 -877
- package/dist/src/harness/tool-result-pruning.js +1 -124
- package/dist/src/harness/tools.js +1 -98
- package/dist/src/harness/types.js +1 -1
- package/dist/src/index.js +1 -1
- package/dist/src/internal/application/cache-metadata.js +1 -42
- package/dist/src/internal/application/compiled-artifacts.js +4 -114
- package/dist/src/internal/application/import-specifier.js +1 -58
- package/dist/src/internal/application/package.js +1 -196
- package/dist/src/internal/application/paths.js +1 -117
- package/dist/src/internal/application/runtime-compiled-artifacts-source.js +1 -11
- package/dist/src/internal/attachments/data.js +1 -127
- package/dist/src/internal/attachments/errors.js +1 -26
- package/dist/src/internal/attachments/refs.js +1 -94
- package/dist/src/internal/attachments/sandbox-refs.js +1 -78
- package/dist/src/internal/attachments/url-refs.js +1 -20
- package/dist/src/internal/authored-asset-import-plugin.js +1 -141
- package/dist/src/internal/authored-definition/channel.js +1 -21
- package/dist/src/internal/authored-definition/connection.js +1 -148
- package/dist/src/internal/authored-definition/core.js +1 -180
- package/dist/src/internal/authored-definition/sandbox.js +1 -47
- package/dist/src/internal/authored-definition/schema-backed.js +1 -56
- package/dist/src/internal/authored-module-bundle.js +2 -19
- package/dist/src/internal/authored-module-loader.js +2 -263
- package/dist/src/internal/authored-module-map-loader.js +1 -53
- package/dist/src/internal/authored-module.js +1 -81
- package/dist/src/internal/authored-package-tsconfig-paths.js +1 -209
- package/dist/src/internal/bundler/nitro-rolldown.js +1 -42
- package/dist/src/internal/helpers/markdown.js +3 -174
- package/dist/src/internal/json-schema.js +1 -13
- package/dist/src/internal/logging.js +1 -226
- package/dist/src/internal/nitro/host/artifacts-config.js +1 -17
- package/dist/src/internal/nitro/host/build-application.js +1 -177
- package/dist/src/internal/nitro/host/build-vercel-agent-summary.js +1 -140
- package/dist/src/internal/nitro/host/channel-routes.js +2 -126
- package/dist/src/internal/nitro/host/compiled-sandbox-backend-prune-plugin.js +2 -28
- package/dist/src/internal/nitro/host/configure-nitro-routes.js +4 -272
- package/dist/src/internal/nitro/host/create-application-nitro.js +1 -491
- package/dist/src/internal/nitro/host/cron-handler-route.js +1 -49
- package/dist/src/internal/nitro/host/dev-authored-source-watcher.js +1 -390
- package/dist/src/internal/nitro/host/nitro-bundler-config.js +1 -10
- package/dist/src/internal/nitro/host/nitro-routing-import-specifier-plugin.js +1 -28
- package/dist/src/internal/nitro/host/prepare-application-host.js +1 -32
- package/dist/src/internal/nitro/host/schedule-task-routes.js +2 -148
- package/dist/src/internal/nitro/host/server-external-packages.js +1 -107
- package/dist/src/internal/nitro/host/start-development-server.js +1 -223
- package/dist/src/internal/nitro/host/types.js +1 -1
- package/dist/src/internal/nitro/host/vercel-build-output-config.js +1 -14
- package/dist/src/internal/nitro/host/vercel-build-prewarm.js +1 -30
- package/dist/src/internal/nitro/host.js +1 -2
- package/dist/src/internal/nitro/routes/agent-info/build-agent-info-response.js +2 -180
- package/dist/src/internal/nitro/routes/agent-info/load-agent-info-data.js +1 -46
- package/dist/src/internal/nitro/routes/channel-dispatch.js +1 -74
- package/dist/src/internal/nitro/routes/health.js +1 -17
- package/dist/src/internal/nitro/routes/index.js +2 -89
- package/dist/src/internal/nitro/routes/info.js +1 -50
- package/dist/src/internal/nitro/routes/runtime-artifacts.js +1 -24
- package/dist/src/internal/nitro/routes/runtime-stack.js +1 -23
- package/dist/src/internal/nitro/routes/schedule-task.js +1 -57
- package/dist/src/internal/nitro/routes/workflow-data.js +1 -141
- package/dist/src/internal/nitro/routes/workflow-route-helpers.js +1 -137
- package/dist/src/internal/nitro/routes/workflow-run-events.js +1 -41
- package/dist/src/internal/nitro/routes/workflow-run-steps.js +1 -41
- package/dist/src/internal/nitro/routes/workflow-run.js +1 -34
- package/dist/src/internal/nitro/routes/workflow-runs.js +1 -28
- package/dist/src/internal/node-esm-compat-banner.js +2 -65
- package/dist/src/internal/package-name.js +1 -8
- package/dist/src/internal/process/pnpm.js +1 -50
- package/dist/src/internal/runtime-model.js +1 -24
- package/dist/src/internal/runtime-registry.js +1 -93
- package/dist/src/internal/vercel-agent-summary.js +1 -72
- package/dist/src/internal/workflow/builtins.js +1 -18
- package/dist/src/internal/workflow/index.js +1 -9
- package/dist/src/internal/workflow-bundle/ash-service-route-output.js +3 -93
- package/dist/src/internal/workflow-bundle/builder-support.js +5 -372
- package/dist/src/internal/workflow-bundle/builder.js +5 -472
- package/dist/src/internal/workflow-bundle/nitro-step-entry.js +2 -132
- package/dist/src/internal/workflow-bundle/vercel-workflow-output.js +3 -494
- package/dist/src/internal/workflow-bundle/workflow-builders.js +1 -292
- package/dist/src/internal/workflow-bundle/workflow-core-shim.js +1 -84
- package/dist/src/internal/workflow-bundle/workflow-transformer.js +5 -318
- package/dist/src/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/ajv.js +1 -0
- package/dist/src/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/compile/codegen/code.js +1 -0
- package/dist/src/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/compile/codegen/index.js +2 -0
- package/dist/src/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/compile/codegen/scope.js +1 -0
- package/dist/src/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/compile/errors.js +1 -0
- package/dist/src/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/compile/index.js +1 -0
- package/dist/src/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/compile/names.js +1 -0
- package/dist/src/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/compile/ref_error.js +1 -0
- package/dist/src/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/compile/resolve.js +1 -0
- package/dist/src/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/compile/rules.js +1 -0
- package/dist/src/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/compile/util.js +1 -0
- package/dist/src/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/compile/validate/applicability.js +1 -0
- package/dist/src/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/compile/validate/boolSchema.js +1 -0
- package/dist/src/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/compile/validate/dataType.js +4 -0
- package/dist/src/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/compile/validate/defaults.js +1 -0
- package/dist/src/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/compile/validate/index.js +1 -0
- package/dist/src/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/compile/validate/keyword.js +1 -0
- package/dist/src/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/compile/validate/subschema.js +1 -0
- package/dist/src/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/core.js +1 -0
- package/dist/src/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/refs/data.js +1 -0
- package/dist/src/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/refs/json-schema-draft-07.js +1 -0
- package/dist/src/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/runtime/equal.js +1 -0
- package/dist/src/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/runtime/ucs2length.js +1 -0
- package/dist/src/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/runtime/uri.js +1 -0
- package/dist/src/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/runtime/validation_error.js +1 -0
- package/dist/src/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/applicator/additionalItems.js +1 -0
- package/dist/src/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/applicator/additionalProperties.js +1 -0
- package/dist/src/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/applicator/allOf.js +1 -0
- package/dist/src/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/applicator/anyOf.js +1 -0
- package/dist/src/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/applicator/contains.js +1 -0
- package/dist/src/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/applicator/dependencies.js +4 -0
- package/dist/src/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/applicator/if.js +1 -0
- package/dist/src/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/applicator/index.js +1 -0
- package/dist/src/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/applicator/items.js +1 -0
- package/dist/src/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/applicator/items2020.js +1 -0
- package/dist/src/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/applicator/not.js +1 -0
- package/dist/src/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/applicator/oneOf.js +1 -0
- package/dist/src/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/applicator/patternProperties.js +1 -0
- package/dist/src/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/applicator/prefixItems.js +1 -0
- package/dist/src/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/applicator/properties.js +1 -0
- package/dist/src/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/applicator/propertyNames.js +1 -0
- package/dist/src/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/applicator/thenElse.js +1 -0
- package/dist/src/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/code.js +1 -0
- package/dist/src/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/core/id.js +1 -0
- package/dist/src/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/core/index.js +1 -0
- package/dist/src/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/core/ref.js +1 -0
- package/dist/src/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/discriminator/index.js +1 -0
- package/dist/src/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/discriminator/types.js +1 -0
- package/dist/src/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/draft7.js +1 -0
- package/dist/src/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/format/format.js +1 -0
- package/dist/src/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/format/index.js +1 -0
- package/dist/src/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/metadata.js +1 -0
- package/dist/src/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/validation/const.js +1 -0
- package/dist/src/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/validation/enum.js +1 -0
- package/dist/src/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/validation/index.js +1 -0
- package/dist/src/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/validation/limitItems.js +1 -0
- package/dist/src/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/validation/limitLength.js +1 -0
- package/dist/src/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/validation/limitNumber.js +1 -0
- package/dist/src/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/validation/limitProperties.js +1 -0
- package/dist/src/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/validation/multipleOf.js +1 -0
- package/dist/src/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/validation/pattern.js +1 -0
- package/dist/src/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/validation/required.js +1 -0
- package/dist/src/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/validation/uniqueItems.js +1 -0
- package/dist/src/node_modules/.pnpm/autoevals@0.0.132_ws@8.21.0/node_modules/autoevals/jsdist/index.js +384 -0
- package/dist/src/node_modules/.pnpm/compute-cosine-similarity@1.1.0/node_modules/compute-cosine-similarity/lib/index.js +1 -0
- package/dist/src/node_modules/.pnpm/compute-dot@1.1.0/node_modules/compute-dot/lib/index.js +1 -0
- package/dist/src/node_modules/.pnpm/compute-l2norm@1.1.0/node_modules/compute-l2norm/lib/index.js +1 -0
- package/dist/src/node_modules/.pnpm/fast-deep-equal@3.1.3/node_modules/fast-deep-equal/index.js +1 -0
- package/dist/src/node_modules/.pnpm/fast-uri@3.1.2/node_modules/fast-uri/index.js +1 -0
- package/dist/src/node_modules/.pnpm/fast-uri@3.1.2/node_modules/fast-uri/lib/schemes.js +1 -0
- package/dist/src/node_modules/.pnpm/fast-uri@3.1.2/node_modules/fast-uri/lib/utils.js +1 -0
- package/dist/src/node_modules/.pnpm/js-levenshtein@1.1.6/node_modules/js-levenshtein/index.js +1 -0
- package/dist/src/node_modules/.pnpm/js-yaml@4.1.1/node_modules/js-yaml/dist/js-yaml.js +32 -0
- package/dist/src/node_modules/.pnpm/json-schema-traverse@1.0.0/node_modules/json-schema-traverse/index.js +1 -0
- package/dist/src/node_modules/.pnpm/mustache@4.2.0/node_modules/mustache/mustache.js +4 -0
- package/dist/src/node_modules/.pnpm/openai@6.39.0_ws@8.21.0_zod@3.25.76/node_modules/openai/_vendor/partial-json-parser/parser.js +2 -0
- package/dist/src/node_modules/.pnpm/openai@6.39.0_ws@8.21.0_zod@3.25.76/node_modules/openai/auth/workload-identity-auth.js +1 -0
- package/dist/src/node_modules/.pnpm/openai@6.39.0_ws@8.21.0_zod@3.25.76/node_modules/openai/azure.js +1 -0
- package/dist/src/node_modules/.pnpm/openai@6.39.0_ws@8.21.0_zod@3.25.76/node_modules/openai/client.js +11 -0
- package/dist/src/node_modules/.pnpm/openai@6.39.0_ws@8.21.0_zod@3.25.76/node_modules/openai/core/api-promise.js +1 -0
- package/dist/src/node_modules/.pnpm/openai@6.39.0_ws@8.21.0_zod@3.25.76/node_modules/openai/core/error.js +1 -0
- package/dist/src/node_modules/.pnpm/openai@6.39.0_ws@8.21.0_zod@3.25.76/node_modules/openai/core/pagination.js +1 -0
- package/dist/src/node_modules/.pnpm/openai@6.39.0_ws@8.21.0_zod@3.25.76/node_modules/openai/core/resource.js +1 -0
- package/dist/src/node_modules/.pnpm/openai@6.39.0_ws@8.21.0_zod@3.25.76/node_modules/openai/core/streaming.js +3 -0
- package/dist/src/node_modules/.pnpm/openai@6.39.0_ws@8.21.0_zod@3.25.76/node_modules/openai/core/uploads.js +1 -0
- package/dist/src/node_modules/.pnpm/openai@6.39.0_ws@8.21.0_zod@3.25.76/node_modules/openai/error.js +1 -0
- package/dist/src/node_modules/.pnpm/openai@6.39.0_ws@8.21.0_zod@3.25.76/node_modules/openai/index.js +1 -0
- package/dist/src/node_modules/.pnpm/openai@6.39.0_ws@8.21.0_zod@3.25.76/node_modules/openai/internal/decoders/line.js +3 -0
- package/dist/src/node_modules/.pnpm/openai@6.39.0_ws@8.21.0_zod@3.25.76/node_modules/openai/internal/detect-platform.js +1 -0
- package/dist/src/node_modules/.pnpm/openai@6.39.0_ws@8.21.0_zod@3.25.76/node_modules/openai/internal/errors.js +1 -0
- package/dist/src/node_modules/.pnpm/openai@6.39.0_ws@8.21.0_zod@3.25.76/node_modules/openai/internal/headers.js +1 -0
- package/dist/src/node_modules/.pnpm/openai@6.39.0_ws@8.21.0_zod@3.25.76/node_modules/openai/internal/parse.js +1 -0
- package/dist/src/node_modules/.pnpm/openai@6.39.0_ws@8.21.0_zod@3.25.76/node_modules/openai/internal/qs/formats.js +1 -0
- package/dist/src/node_modules/.pnpm/openai@6.39.0_ws@8.21.0_zod@3.25.76/node_modules/openai/internal/qs/stringify.js +1 -0
- package/dist/src/node_modules/.pnpm/openai@6.39.0_ws@8.21.0_zod@3.25.76/node_modules/openai/internal/qs/utils.js +1 -0
- package/dist/src/node_modules/.pnpm/openai@6.39.0_ws@8.21.0_zod@3.25.76/node_modules/openai/internal/request-options.js +1 -0
- package/dist/src/node_modules/.pnpm/openai@6.39.0_ws@8.21.0_zod@3.25.76/node_modules/openai/internal/shims.js +1 -0
- package/dist/src/node_modules/.pnpm/openai@6.39.0_ws@8.21.0_zod@3.25.76/node_modules/openai/internal/to-file.js +1 -0
- package/dist/src/node_modules/.pnpm/openai@6.39.0_ws@8.21.0_zod@3.25.76/node_modules/openai/internal/tslib.js +1 -0
- package/dist/src/node_modules/.pnpm/openai@6.39.0_ws@8.21.0_zod@3.25.76/node_modules/openai/internal/uploads.js +1 -0
- package/dist/src/node_modules/.pnpm/openai@6.39.0_ws@8.21.0_zod@3.25.76/node_modules/openai/internal/utils/base64.js +1 -0
- package/dist/src/node_modules/.pnpm/openai@6.39.0_ws@8.21.0_zod@3.25.76/node_modules/openai/internal/utils/bytes.js +1 -0
- package/dist/src/node_modules/.pnpm/openai@6.39.0_ws@8.21.0_zod@3.25.76/node_modules/openai/internal/utils/env.js +1 -0
- package/dist/src/node_modules/.pnpm/openai@6.39.0_ws@8.21.0_zod@3.25.76/node_modules/openai/internal/utils/log.js +1 -0
- package/dist/src/node_modules/.pnpm/openai@6.39.0_ws@8.21.0_zod@3.25.76/node_modules/openai/internal/utils/path.js +2 -0
- package/dist/src/node_modules/.pnpm/openai@6.39.0_ws@8.21.0_zod@3.25.76/node_modules/openai/internal/utils/query.js +1 -0
- package/dist/src/node_modules/.pnpm/openai@6.39.0_ws@8.21.0_zod@3.25.76/node_modules/openai/internal/utils/sleep.js +1 -0
- package/dist/src/node_modules/.pnpm/openai@6.39.0_ws@8.21.0_zod@3.25.76/node_modules/openai/internal/utils/uuid.js +1 -0
- package/dist/src/node_modules/.pnpm/openai@6.39.0_ws@8.21.0_zod@3.25.76/node_modules/openai/internal/utils/values.js +1 -0
- package/dist/src/node_modules/.pnpm/openai@6.39.0_ws@8.21.0_zod@3.25.76/node_modules/openai/internal/utils.js +1 -0
- package/dist/src/node_modules/.pnpm/openai@6.39.0_ws@8.21.0_zod@3.25.76/node_modules/openai/lib/AbstractChatCompletionRunner.js +1 -0
- package/dist/src/node_modules/.pnpm/openai@6.39.0_ws@8.21.0_zod@3.25.76/node_modules/openai/lib/AssistantStream.js +1 -0
- package/dist/src/node_modules/.pnpm/openai@6.39.0_ws@8.21.0_zod@3.25.76/node_modules/openai/lib/ChatCompletionRunner.js +1 -0
- package/dist/src/node_modules/.pnpm/openai@6.39.0_ws@8.21.0_zod@3.25.76/node_modules/openai/lib/ChatCompletionStream.js +1 -0
- package/dist/src/node_modules/.pnpm/openai@6.39.0_ws@8.21.0_zod@3.25.76/node_modules/openai/lib/ChatCompletionStreamingRunner.js +1 -0
- package/dist/src/node_modules/.pnpm/openai@6.39.0_ws@8.21.0_zod@3.25.76/node_modules/openai/lib/EventStream.js +1 -0
- package/dist/src/node_modules/.pnpm/openai@6.39.0_ws@8.21.0_zod@3.25.76/node_modules/openai/lib/ResponsesParser.js +1 -0
- package/dist/src/node_modules/.pnpm/openai@6.39.0_ws@8.21.0_zod@3.25.76/node_modules/openai/lib/RunnableFunction.js +1 -0
- package/dist/src/node_modules/.pnpm/openai@6.39.0_ws@8.21.0_zod@3.25.76/node_modules/openai/lib/Util.js +1 -0
- package/dist/src/node_modules/.pnpm/openai@6.39.0_ws@8.21.0_zod@3.25.76/node_modules/openai/lib/chatCompletionUtils.js +1 -0
- package/dist/src/node_modules/.pnpm/openai@6.39.0_ws@8.21.0_zod@3.25.76/node_modules/openai/lib/parser.js +1 -0
- package/dist/src/node_modules/.pnpm/openai@6.39.0_ws@8.21.0_zod@3.25.76/node_modules/openai/lib/responses/ResponseStream.js +1 -0
- package/dist/src/node_modules/.pnpm/openai@6.39.0_ws@8.21.0_zod@3.25.76/node_modules/openai/resources/admin/admin.js +1 -0
- package/dist/src/node_modules/.pnpm/openai@6.39.0_ws@8.21.0_zod@3.25.76/node_modules/openai/resources/admin/organization/admin-api-keys.js +1 -0
- package/dist/src/node_modules/.pnpm/openai@6.39.0_ws@8.21.0_zod@3.25.76/node_modules/openai/resources/admin/organization/audit-logs.js +1 -0
- package/dist/src/node_modules/.pnpm/openai@6.39.0_ws@8.21.0_zod@3.25.76/node_modules/openai/resources/admin/organization/certificates.js +1 -0
- package/dist/src/node_modules/.pnpm/openai@6.39.0_ws@8.21.0_zod@3.25.76/node_modules/openai/resources/admin/organization/data-retention.js +1 -0
- package/dist/src/node_modules/.pnpm/openai@6.39.0_ws@8.21.0_zod@3.25.76/node_modules/openai/resources/admin/organization/groups/groups.js +1 -0
- package/dist/src/node_modules/.pnpm/openai@6.39.0_ws@8.21.0_zod@3.25.76/node_modules/openai/resources/admin/organization/groups/roles.js +1 -0
- package/dist/src/node_modules/.pnpm/openai@6.39.0_ws@8.21.0_zod@3.25.76/node_modules/openai/resources/admin/organization/groups/users.js +1 -0
- package/dist/src/node_modules/.pnpm/openai@6.39.0_ws@8.21.0_zod@3.25.76/node_modules/openai/resources/admin/organization/invites.js +1 -0
- package/dist/src/node_modules/.pnpm/openai@6.39.0_ws@8.21.0_zod@3.25.76/node_modules/openai/resources/admin/organization/organization.js +1 -0
- package/dist/src/node_modules/.pnpm/openai@6.39.0_ws@8.21.0_zod@3.25.76/node_modules/openai/resources/admin/organization/projects/api-keys.js +1 -0
- package/dist/src/node_modules/.pnpm/openai@6.39.0_ws@8.21.0_zod@3.25.76/node_modules/openai/resources/admin/organization/projects/certificates.js +1 -0
- package/dist/src/node_modules/.pnpm/openai@6.39.0_ws@8.21.0_zod@3.25.76/node_modules/openai/resources/admin/organization/projects/data-retention.js +1 -0
- package/dist/src/node_modules/.pnpm/openai@6.39.0_ws@8.21.0_zod@3.25.76/node_modules/openai/resources/admin/organization/projects/groups/groups.js +1 -0
- package/dist/src/node_modules/.pnpm/openai@6.39.0_ws@8.21.0_zod@3.25.76/node_modules/openai/resources/admin/organization/projects/groups/roles.js +1 -0
- package/dist/src/node_modules/.pnpm/openai@6.39.0_ws@8.21.0_zod@3.25.76/node_modules/openai/resources/admin/organization/projects/hosted-tool-permissions.js +1 -0
- package/dist/src/node_modules/.pnpm/openai@6.39.0_ws@8.21.0_zod@3.25.76/node_modules/openai/resources/admin/organization/projects/model-permissions.js +1 -0
- package/dist/src/node_modules/.pnpm/openai@6.39.0_ws@8.21.0_zod@3.25.76/node_modules/openai/resources/admin/organization/projects/projects.js +1 -0
- package/dist/src/node_modules/.pnpm/openai@6.39.0_ws@8.21.0_zod@3.25.76/node_modules/openai/resources/admin/organization/projects/rate-limits.js +1 -0
- package/dist/src/node_modules/.pnpm/openai@6.39.0_ws@8.21.0_zod@3.25.76/node_modules/openai/resources/admin/organization/projects/roles.js +1 -0
- package/dist/src/node_modules/.pnpm/openai@6.39.0_ws@8.21.0_zod@3.25.76/node_modules/openai/resources/admin/organization/projects/service-accounts.js +1 -0
- package/dist/src/node_modules/.pnpm/openai@6.39.0_ws@8.21.0_zod@3.25.76/node_modules/openai/resources/admin/organization/projects/spend-alerts.js +1 -0
- package/dist/src/node_modules/.pnpm/openai@6.39.0_ws@8.21.0_zod@3.25.76/node_modules/openai/resources/admin/organization/projects/users/roles.js +1 -0
- package/dist/src/node_modules/.pnpm/openai@6.39.0_ws@8.21.0_zod@3.25.76/node_modules/openai/resources/admin/organization/projects/users/users.js +1 -0
- package/dist/src/node_modules/.pnpm/openai@6.39.0_ws@8.21.0_zod@3.25.76/node_modules/openai/resources/admin/organization/roles.js +1 -0
- package/dist/src/node_modules/.pnpm/openai@6.39.0_ws@8.21.0_zod@3.25.76/node_modules/openai/resources/admin/organization/spend-alerts.js +1 -0
- package/dist/src/node_modules/.pnpm/openai@6.39.0_ws@8.21.0_zod@3.25.76/node_modules/openai/resources/admin/organization/usage.js +1 -0
- package/dist/src/node_modules/.pnpm/openai@6.39.0_ws@8.21.0_zod@3.25.76/node_modules/openai/resources/admin/organization/users/roles.js +1 -0
- package/dist/src/node_modules/.pnpm/openai@6.39.0_ws@8.21.0_zod@3.25.76/node_modules/openai/resources/admin/organization/users/users.js +1 -0
- package/dist/src/node_modules/.pnpm/openai@6.39.0_ws@8.21.0_zod@3.25.76/node_modules/openai/resources/audio/audio.js +1 -0
- package/dist/src/node_modules/.pnpm/openai@6.39.0_ws@8.21.0_zod@3.25.76/node_modules/openai/resources/audio/speech.js +1 -0
- package/dist/src/node_modules/.pnpm/openai@6.39.0_ws@8.21.0_zod@3.25.76/node_modules/openai/resources/audio/transcriptions.js +1 -0
- package/dist/src/node_modules/.pnpm/openai@6.39.0_ws@8.21.0_zod@3.25.76/node_modules/openai/resources/audio/translations.js +1 -0
- package/dist/src/node_modules/.pnpm/openai@6.39.0_ws@8.21.0_zod@3.25.76/node_modules/openai/resources/batches.js +1 -0
- package/dist/src/node_modules/.pnpm/openai@6.39.0_ws@8.21.0_zod@3.25.76/node_modules/openai/resources/beta/assistants.js +1 -0
- package/dist/src/node_modules/.pnpm/openai@6.39.0_ws@8.21.0_zod@3.25.76/node_modules/openai/resources/beta/beta.js +1 -0
- package/dist/src/node_modules/.pnpm/openai@6.39.0_ws@8.21.0_zod@3.25.76/node_modules/openai/resources/beta/chatkit/chatkit.js +1 -0
- package/dist/src/node_modules/.pnpm/openai@6.39.0_ws@8.21.0_zod@3.25.76/node_modules/openai/resources/beta/chatkit/sessions.js +1 -0
- package/dist/src/node_modules/.pnpm/openai@6.39.0_ws@8.21.0_zod@3.25.76/node_modules/openai/resources/beta/chatkit/threads.js +1 -0
- package/dist/src/node_modules/.pnpm/openai@6.39.0_ws@8.21.0_zod@3.25.76/node_modules/openai/resources/beta/realtime/realtime.js +1 -0
- package/dist/src/node_modules/.pnpm/openai@6.39.0_ws@8.21.0_zod@3.25.76/node_modules/openai/resources/beta/realtime/sessions.js +1 -0
- package/dist/src/node_modules/.pnpm/openai@6.39.0_ws@8.21.0_zod@3.25.76/node_modules/openai/resources/beta/realtime/transcription-sessions.js +1 -0
- package/dist/src/node_modules/.pnpm/openai@6.39.0_ws@8.21.0_zod@3.25.76/node_modules/openai/resources/beta/threads/messages.js +1 -0
- package/dist/src/node_modules/.pnpm/openai@6.39.0_ws@8.21.0_zod@3.25.76/node_modules/openai/resources/beta/threads/runs/runs.js +1 -0
- package/dist/src/node_modules/.pnpm/openai@6.39.0_ws@8.21.0_zod@3.25.76/node_modules/openai/resources/beta/threads/runs/steps.js +1 -0
- package/dist/src/node_modules/.pnpm/openai@6.39.0_ws@8.21.0_zod@3.25.76/node_modules/openai/resources/beta/threads/threads.js +1 -0
- package/dist/src/node_modules/.pnpm/openai@6.39.0_ws@8.21.0_zod@3.25.76/node_modules/openai/resources/chat/chat.js +1 -0
- package/dist/src/node_modules/.pnpm/openai@6.39.0_ws@8.21.0_zod@3.25.76/node_modules/openai/resources/chat/completions/completions.js +1 -0
- package/dist/src/node_modules/.pnpm/openai@6.39.0_ws@8.21.0_zod@3.25.76/node_modules/openai/resources/chat/completions/index.js +1 -0
- package/dist/src/node_modules/.pnpm/openai@6.39.0_ws@8.21.0_zod@3.25.76/node_modules/openai/resources/chat/completions/messages.js +1 -0
- package/dist/src/node_modules/.pnpm/openai@6.39.0_ws@8.21.0_zod@3.25.76/node_modules/openai/resources/chat/index.js +1 -0
- package/dist/src/node_modules/.pnpm/openai@6.39.0_ws@8.21.0_zod@3.25.76/node_modules/openai/resources/completions.js +1 -0
- package/dist/src/node_modules/.pnpm/openai@6.39.0_ws@8.21.0_zod@3.25.76/node_modules/openai/resources/containers/containers.js +1 -0
- package/dist/src/node_modules/.pnpm/openai@6.39.0_ws@8.21.0_zod@3.25.76/node_modules/openai/resources/containers/files/content.js +1 -0
- package/dist/src/node_modules/.pnpm/openai@6.39.0_ws@8.21.0_zod@3.25.76/node_modules/openai/resources/containers/files/files.js +1 -0
- package/dist/src/node_modules/.pnpm/openai@6.39.0_ws@8.21.0_zod@3.25.76/node_modules/openai/resources/conversations/conversations.js +1 -0
- package/dist/src/node_modules/.pnpm/openai@6.39.0_ws@8.21.0_zod@3.25.76/node_modules/openai/resources/conversations/items.js +1 -0
- package/dist/src/node_modules/.pnpm/openai@6.39.0_ws@8.21.0_zod@3.25.76/node_modules/openai/resources/embeddings.js +1 -0
- package/dist/src/node_modules/.pnpm/openai@6.39.0_ws@8.21.0_zod@3.25.76/node_modules/openai/resources/evals/evals.js +1 -0
- package/dist/src/node_modules/.pnpm/openai@6.39.0_ws@8.21.0_zod@3.25.76/node_modules/openai/resources/evals/runs/output-items.js +1 -0
- package/dist/src/node_modules/.pnpm/openai@6.39.0_ws@8.21.0_zod@3.25.76/node_modules/openai/resources/evals/runs/runs.js +1 -0
- package/dist/src/node_modules/.pnpm/openai@6.39.0_ws@8.21.0_zod@3.25.76/node_modules/openai/resources/files.js +1 -0
- package/dist/src/node_modules/.pnpm/openai@6.39.0_ws@8.21.0_zod@3.25.76/node_modules/openai/resources/fine-tuning/alpha/alpha.js +1 -0
- package/dist/src/node_modules/.pnpm/openai@6.39.0_ws@8.21.0_zod@3.25.76/node_modules/openai/resources/fine-tuning/alpha/graders.js +1 -0
- package/dist/src/node_modules/.pnpm/openai@6.39.0_ws@8.21.0_zod@3.25.76/node_modules/openai/resources/fine-tuning/checkpoints/checkpoints.js +1 -0
- package/dist/src/node_modules/.pnpm/openai@6.39.0_ws@8.21.0_zod@3.25.76/node_modules/openai/resources/fine-tuning/checkpoints/permissions.js +1 -0
- package/dist/src/node_modules/.pnpm/openai@6.39.0_ws@8.21.0_zod@3.25.76/node_modules/openai/resources/fine-tuning/fine-tuning.js +1 -0
- package/dist/src/node_modules/.pnpm/openai@6.39.0_ws@8.21.0_zod@3.25.76/node_modules/openai/resources/fine-tuning/jobs/checkpoints.js +1 -0
- package/dist/src/node_modules/.pnpm/openai@6.39.0_ws@8.21.0_zod@3.25.76/node_modules/openai/resources/fine-tuning/jobs/jobs.js +1 -0
- package/dist/src/node_modules/.pnpm/openai@6.39.0_ws@8.21.0_zod@3.25.76/node_modules/openai/resources/fine-tuning/methods.js +1 -0
- package/dist/src/node_modules/.pnpm/openai@6.39.0_ws@8.21.0_zod@3.25.76/node_modules/openai/resources/graders/grader-models.js +1 -0
- package/dist/src/node_modules/.pnpm/openai@6.39.0_ws@8.21.0_zod@3.25.76/node_modules/openai/resources/graders/graders.js +1 -0
- package/dist/src/node_modules/.pnpm/openai@6.39.0_ws@8.21.0_zod@3.25.76/node_modules/openai/resources/images.js +1 -0
- package/dist/src/node_modules/.pnpm/openai@6.39.0_ws@8.21.0_zod@3.25.76/node_modules/openai/resources/index.js +1 -0
- package/dist/src/node_modules/.pnpm/openai@6.39.0_ws@8.21.0_zod@3.25.76/node_modules/openai/resources/models.js +1 -0
- package/dist/src/node_modules/.pnpm/openai@6.39.0_ws@8.21.0_zod@3.25.76/node_modules/openai/resources/moderations.js +1 -0
- package/dist/src/node_modules/.pnpm/openai@6.39.0_ws@8.21.0_zod@3.25.76/node_modules/openai/resources/realtime/calls.js +1 -0
- package/dist/src/node_modules/.pnpm/openai@6.39.0_ws@8.21.0_zod@3.25.76/node_modules/openai/resources/realtime/client-secrets.js +1 -0
- package/dist/src/node_modules/.pnpm/openai@6.39.0_ws@8.21.0_zod@3.25.76/node_modules/openai/resources/realtime/realtime.js +1 -0
- package/dist/src/node_modules/.pnpm/openai@6.39.0_ws@8.21.0_zod@3.25.76/node_modules/openai/resources/responses/input-items.js +1 -0
- package/dist/src/node_modules/.pnpm/openai@6.39.0_ws@8.21.0_zod@3.25.76/node_modules/openai/resources/responses/input-tokens.js +1 -0
- package/dist/src/node_modules/.pnpm/openai@6.39.0_ws@8.21.0_zod@3.25.76/node_modules/openai/resources/responses/responses.js +1 -0
- package/dist/src/node_modules/.pnpm/openai@6.39.0_ws@8.21.0_zod@3.25.76/node_modules/openai/resources/shared.js +1 -0
- package/dist/src/node_modules/.pnpm/openai@6.39.0_ws@8.21.0_zod@3.25.76/node_modules/openai/resources/skills/content.js +1 -0
- package/dist/src/node_modules/.pnpm/openai@6.39.0_ws@8.21.0_zod@3.25.76/node_modules/openai/resources/skills/skills.js +1 -0
- package/dist/src/node_modules/.pnpm/openai@6.39.0_ws@8.21.0_zod@3.25.76/node_modules/openai/resources/skills/versions/content.js +1 -0
- package/dist/src/node_modules/.pnpm/openai@6.39.0_ws@8.21.0_zod@3.25.76/node_modules/openai/resources/skills/versions/versions.js +1 -0
- package/dist/src/node_modules/.pnpm/openai@6.39.0_ws@8.21.0_zod@3.25.76/node_modules/openai/resources/uploads/parts.js +1 -0
- package/dist/src/node_modules/.pnpm/openai@6.39.0_ws@8.21.0_zod@3.25.76/node_modules/openai/resources/uploads/uploads.js +1 -0
- package/dist/src/node_modules/.pnpm/openai@6.39.0_ws@8.21.0_zod@3.25.76/node_modules/openai/resources/vector-stores/file-batches.js +1 -0
- package/dist/src/node_modules/.pnpm/openai@6.39.0_ws@8.21.0_zod@3.25.76/node_modules/openai/resources/vector-stores/files.js +1 -0
- package/dist/src/node_modules/.pnpm/openai@6.39.0_ws@8.21.0_zod@3.25.76/node_modules/openai/resources/vector-stores/vector-stores.js +1 -0
- package/dist/src/node_modules/.pnpm/openai@6.39.0_ws@8.21.0_zod@3.25.76/node_modules/openai/resources/videos.js +1 -0
- package/dist/src/node_modules/.pnpm/openai@6.39.0_ws@8.21.0_zod@3.25.76/node_modules/openai/resources/webhooks/index.js +1 -0
- package/dist/src/node_modules/.pnpm/openai@6.39.0_ws@8.21.0_zod@3.25.76/node_modules/openai/resources/webhooks/webhooks.js +1 -0
- package/dist/src/node_modules/.pnpm/openai@6.39.0_ws@8.21.0_zod@3.25.76/node_modules/openai/resources/webhooks.js +1 -0
- package/dist/src/node_modules/.pnpm/openai@6.39.0_ws@8.21.0_zod@3.25.76/node_modules/openai/streaming.js +1 -0
- package/dist/src/node_modules/.pnpm/openai@6.39.0_ws@8.21.0_zod@3.25.76/node_modules/openai/version.js +1 -0
- package/dist/src/node_modules/.pnpm/validate.io-array@1.0.6/node_modules/validate.io-array/lib/index.js +1 -0
- package/dist/src/node_modules/.pnpm/validate.io-function@1.0.2/node_modules/validate.io-function/lib/index.js +1 -0
- package/dist/src/node_modules/.pnpm/zod-to-json-schema@3.25.2_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/Options.js +1 -0
- package/dist/src/node_modules/.pnpm/zod-to-json-schema@3.25.2_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/Refs.js +1 -0
- package/dist/src/node_modules/.pnpm/zod-to-json-schema@3.25.2_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/errorMessages.js +1 -0
- package/dist/src/node_modules/.pnpm/zod-to-json-schema@3.25.2_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/getRelativePath.js +1 -0
- package/dist/src/node_modules/.pnpm/zod-to-json-schema@3.25.2_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/index.js +1 -0
- package/dist/src/node_modules/.pnpm/zod-to-json-schema@3.25.2_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parseDef.js +1 -0
- package/dist/src/node_modules/.pnpm/zod-to-json-schema@3.25.2_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parseTypes.js +1 -0
- package/dist/src/node_modules/.pnpm/zod-to-json-schema@3.25.2_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parsers/any.js +1 -0
- package/dist/src/node_modules/.pnpm/zod-to-json-schema@3.25.2_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parsers/array.js +1 -0
- package/dist/src/node_modules/.pnpm/zod-to-json-schema@3.25.2_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parsers/bigint.js +1 -0
- package/dist/src/node_modules/.pnpm/zod-to-json-schema@3.25.2_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parsers/boolean.js +1 -0
- package/dist/src/node_modules/.pnpm/zod-to-json-schema@3.25.2_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parsers/branded.js +1 -0
- package/dist/src/node_modules/.pnpm/zod-to-json-schema@3.25.2_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parsers/catch.js +1 -0
- package/dist/src/node_modules/.pnpm/zod-to-json-schema@3.25.2_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parsers/date.js +1 -0
- package/dist/src/node_modules/.pnpm/zod-to-json-schema@3.25.2_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parsers/default.js +1 -0
- package/dist/src/node_modules/.pnpm/zod-to-json-schema@3.25.2_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parsers/effects.js +1 -0
- package/dist/src/node_modules/.pnpm/zod-to-json-schema@3.25.2_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parsers/enum.js +1 -0
- package/dist/src/node_modules/.pnpm/zod-to-json-schema@3.25.2_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parsers/intersection.js +1 -0
- package/dist/src/node_modules/.pnpm/zod-to-json-schema@3.25.2_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parsers/literal.js +1 -0
- package/dist/src/node_modules/.pnpm/zod-to-json-schema@3.25.2_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parsers/map.js +1 -0
- package/dist/src/node_modules/.pnpm/zod-to-json-schema@3.25.2_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parsers/nativeEnum.js +1 -0
- package/dist/src/node_modules/.pnpm/zod-to-json-schema@3.25.2_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parsers/never.js +1 -0
- package/dist/src/node_modules/.pnpm/zod-to-json-schema@3.25.2_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parsers/null.js +1 -0
- package/dist/src/node_modules/.pnpm/zod-to-json-schema@3.25.2_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parsers/nullable.js +1 -0
- package/dist/src/node_modules/.pnpm/zod-to-json-schema@3.25.2_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parsers/number.js +1 -0
- package/dist/src/node_modules/.pnpm/zod-to-json-schema@3.25.2_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parsers/object.js +1 -0
- package/dist/src/node_modules/.pnpm/zod-to-json-schema@3.25.2_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parsers/optional.js +1 -0
- package/dist/src/node_modules/.pnpm/zod-to-json-schema@3.25.2_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parsers/pipeline.js +1 -0
- package/dist/src/node_modules/.pnpm/zod-to-json-schema@3.25.2_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parsers/promise.js +1 -0
- package/dist/src/node_modules/.pnpm/zod-to-json-schema@3.25.2_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parsers/readonly.js +1 -0
- package/dist/src/node_modules/.pnpm/zod-to-json-schema@3.25.2_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parsers/record.js +1 -0
- package/dist/src/node_modules/.pnpm/zod-to-json-schema@3.25.2_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parsers/set.js +1 -0
- package/dist/src/node_modules/.pnpm/zod-to-json-schema@3.25.2_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parsers/string.js +3 -0
- package/dist/src/node_modules/.pnpm/zod-to-json-schema@3.25.2_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parsers/tuple.js +1 -0
- package/dist/src/node_modules/.pnpm/zod-to-json-schema@3.25.2_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parsers/undefined.js +1 -0
- package/dist/src/node_modules/.pnpm/zod-to-json-schema@3.25.2_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parsers/union.js +1 -0
- package/dist/src/node_modules/.pnpm/zod-to-json-schema@3.25.2_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parsers/unknown.js +1 -0
- package/dist/src/node_modules/.pnpm/zod-to-json-schema@3.25.2_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/selectParser.js +1 -0
- package/dist/src/node_modules/.pnpm/zod-to-json-schema@3.25.2_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/zodToJsonSchema.js +1 -0
- package/dist/src/node_modules/.pnpm/zod@3.25.76/node_modules/zod/index.js +1 -0
- package/dist/src/node_modules/.pnpm/zod@3.25.76/node_modules/zod/v3/ZodError.js +1 -0
- package/dist/src/node_modules/.pnpm/zod@3.25.76/node_modules/zod/v3/errors.js +1 -0
- package/dist/src/node_modules/.pnpm/zod@3.25.76/node_modules/zod/v3/external.js +1 -0
- package/dist/src/node_modules/.pnpm/zod@3.25.76/node_modules/zod/v3/helpers/errorUtil.js +1 -0
- package/dist/src/node_modules/.pnpm/zod@3.25.76/node_modules/zod/v3/helpers/parseUtil.js +1 -0
- package/dist/src/node_modules/.pnpm/zod@3.25.76/node_modules/zod/v3/helpers/typeAliases.js +1 -0
- package/dist/src/node_modules/.pnpm/zod@3.25.76/node_modules/zod/v3/helpers/util.js +1 -0
- package/dist/src/node_modules/.pnpm/zod@3.25.76/node_modules/zod/v3/index.js +1 -0
- package/dist/src/node_modules/.pnpm/zod@3.25.76/node_modules/zod/v3/locales/en.js +1 -0
- package/dist/src/node_modules/.pnpm/zod@3.25.76/node_modules/zod/v3/types.js +1 -0
- package/dist/src/packages/ash-scaffold/src/channels.js +7 -0
- package/dist/src/packages/ash-scaffold/src/files.js +1 -0
- package/dist/src/packages/ash-scaffold/src/index.js +1 -0
- package/dist/src/packages/ash-scaffold/src/module-files.js +1 -0
- package/dist/src/packages/ash-scaffold/src/package-json.js +1 -0
- package/dist/src/packages/ash-scaffold/src/project.js +1 -0
- package/dist/src/protocol/message.js +2 -501
- package/dist/src/protocol/routes.js +1 -85
- package/dist/src/public/agents/auth.js +1 -37
- package/dist/src/public/channels/ash.js +2 -346
- package/dist/src/public/channels/auth.js +1 -414
- package/dist/src/public/channels/discord/api.js +2 -167
- package/dist/src/public/channels/discord/defaults.js +3 -74
- package/dist/src/public/channels/discord/discordChannel.js +1 -402
- package/dist/src/public/channels/discord/hitl.js +1 -194
- package/dist/src/public/channels/discord/inbound.js +2 -238
- package/dist/src/public/channels/discord/index.js +1 -6
- package/dist/src/public/channels/discord/responses.js +1 -40
- package/dist/src/public/channels/discord/verify.js +1 -72
- package/dist/src/public/channels/discord/verifyInbound.js +1 -19
- package/dist/src/public/channels/index.js +1 -1
- package/dist/src/public/channels/slack/api-encoding.js +1 -40
- package/dist/src/public/channels/slack/api.js +1 -333
- package/dist/src/public/channels/slack/attachments.js +1 -156
- package/dist/src/public/channels/slack/blocks.js +3 -266
- package/dist/src/public/channels/slack/connections.js +1 -70
- package/dist/src/public/channels/slack/constants.js +1 -7
- package/dist/src/public/channels/slack/defaults.js +4 -211
- package/dist/src/public/channels/slack/hitl.js +1 -242
- package/dist/src/public/channels/slack/inbound.js +2 -149
- package/dist/src/public/channels/slack/index.js +1 -13
- package/dist/src/public/channels/slack/interactions.js +1 -315
- package/dist/src/public/channels/slack/limits.js +1 -75
- package/dist/src/public/channels/slack/mrkdwn.js +1 -89
- package/dist/src/public/channels/slack/slackChannel.js +1 -251
- package/dist/src/public/channels/slack/thread.js +1 -45
- package/dist/src/public/channels/slack/verify.js +1 -70
- package/dist/src/public/channels/twilio/api.js +1 -103
- package/dist/src/public/channels/twilio/defaults.js +3 -69
- package/dist/src/public/channels/twilio/inbound.js +2 -123
- package/dist/src/public/channels/twilio/index.js +1 -4
- package/dist/src/public/channels/twilio/twilioChannel.js +1 -316
- package/dist/src/public/channels/twilio/twiml.js +1 -58
- package/dist/src/public/channels/twilio/verify.js +1 -73
- package/dist/src/public/channels/upload-policy.js +1 -170
- package/dist/src/public/connections/errors.js +1 -53
- package/dist/src/public/connections/index.js +1 -6
- package/dist/src/public/context/index.js +1 -13
- package/dist/src/public/definitions/agent.js +1 -6
- package/dist/src/public/definitions/channel.js +1 -24
- package/dist/src/public/definitions/connections/mcp.js +1 -20
- package/dist/src/public/definitions/defineChannel.js +1 -74
- package/dist/src/public/definitions/hook.js +1 -11
- package/dist/src/public/definitions/instructions.js +1 -7
- package/dist/src/public/definitions/instrumentation.js +1 -13
- package/dist/src/public/definitions/remote-agent.js +1 -11
- package/dist/src/public/definitions/sandbox-backend.js +1 -13
- package/dist/src/public/definitions/sandbox.js +1 -6
- package/dist/src/public/definitions/schedule.js +1 -32
- package/dist/src/public/definitions/skill.js +1 -7
- package/dist/src/public/definitions/source.js +1 -1
- package/dist/src/public/definitions/state.js +1 -34
- package/dist/src/public/definitions/tool.js +1 -27
- package/dist/src/public/hooks/index.js +1 -9
- package/dist/src/public/index.js +1 -5
- package/dist/src/public/instructions/index.js +1 -4
- package/dist/src/public/instrumentation/index.js +1 -4
- package/dist/src/public/next/index.js +1 -148
- package/dist/src/public/next/server.js +1 -348
- package/dist/src/public/next/vercel-json.js +1 -77
- package/dist/src/public/sandbox/backends/default.js +1 -15
- package/dist/src/public/sandbox/backends/local.js +1 -18
- package/dist/src/public/sandbox/backends/vercel.js +1 -25
- package/dist/src/public/sandbox/index.js +1 -10
- package/dist/src/public/sandbox/local-sandbox.js +1 -1
- package/dist/src/public/sandbox/vercel-sandbox.js +1 -1
- package/dist/src/public/schedules/index.js +1 -4
- package/dist/src/public/skills/index.js +1 -5
- package/dist/src/public/tool-result-narrowing.js +1 -87
- package/dist/src/public/tools/approval/approval-helpers.js +1 -22
- package/dist/src/public/tools/approval/index.js +1 -4
- package/dist/src/public/tools/defaults.js +1 -70
- package/dist/src/public/tools/define-bash-tool.js +1 -14
- package/dist/src/public/tools/define-glob-tool.js +1 -21
- package/dist/src/public/tools/define-grep-tool.js +1 -21
- package/dist/src/public/tools/define-read-file-tool.js +1 -27
- package/dist/src/public/tools/define-write-file-tool.js +1 -21
- package/dist/src/public/tools/index.js +1 -10
- package/dist/src/public/tools/internal.js +1 -24
- package/dist/src/public/types/json.js +1 -13
- package/dist/src/react/index.js +1 -3
- package/dist/src/react/use-ash-agent.js +2 -348
- package/dist/src/runtime/actions/keys.js +1 -30
- package/dist/src/runtime/actions/types.js +1 -99
- package/dist/src/runtime/agent/bootstrap-model-utils.js +1 -148
- package/dist/src/runtime/agent/bootstrap-model.js +1 -36
- package/dist/src/runtime/agent/bootstrap.js +1 -49
- package/dist/src/runtime/agent/mock-model-adapter.js +7 -358
- package/dist/src/runtime/agent/resolve-model.js +1 -48
- package/dist/src/runtime/cache-key.js +1 -52
- package/dist/src/runtime/channels/registry.js +1 -133
- package/dist/src/runtime/compiled-artifacts-source.js +1 -42
- package/dist/src/runtime/connections/authorization-complete-page.js +2 -21
- package/dist/src/runtime/connections/authorization-tokens.js +1 -66
- package/dist/src/runtime/connections/callback-route.js +1 -139
- package/dist/src/runtime/connections/mcp-client.js +1 -307
- package/dist/src/runtime/connections/principal-context.js +1 -111
- package/dist/src/runtime/connections/principal.js +1 -106
- package/dist/src/runtime/connections/registry.js +1 -61
- package/dist/src/runtime/connections/types.js +1 -41
- package/dist/src/runtime/connections/validate-authorization.js +1 -92
- package/dist/src/runtime/framework-channels/index.js +1 -38
- package/dist/src/runtime/framework-tools/ask-question.js +1 -30
- package/dist/src/runtime/framework-tools/bash.js +1 -40
- package/dist/src/runtime/framework-tools/connection-search.js +1 -224
- package/dist/src/runtime/framework-tools/connection-tools.js +1 -103
- package/dist/src/runtime/framework-tools/file-state.js +1 -71
- package/dist/src/runtime/framework-tools/glob.js +2 -56
- package/dist/src/runtime/framework-tools/grep.js +2 -75
- package/dist/src/runtime/framework-tools/index.js +1 -52
- package/dist/src/runtime/framework-tools/pending-connection-tool-calls.js +1 -63
- package/dist/src/runtime/framework-tools/read-file.js +2 -64
- package/dist/src/runtime/framework-tools/skill.js +1 -47
- package/dist/src/runtime/framework-tools/todo.js +3 -122
- package/dist/src/runtime/framework-tools/web-fetch.js +2 -42
- package/dist/src/runtime/framework-tools/web-search.js +1 -15
- package/dist/src/runtime/framework-tools/write-file.js +2 -48
- package/dist/src/runtime/governance/auth/http-basic.js +1 -63
- package/dist/src/runtime/governance/auth/jwt-ecdsa.js +1 -69
- package/dist/src/runtime/governance/auth/jwt-hmac.js +1 -39
- package/dist/src/runtime/governance/auth/oidc.js +1 -126
- package/dist/src/runtime/governance/auth/token-claims.js +1 -84
- package/dist/src/runtime/governance/auth/types.js +1 -14
- package/dist/src/runtime/governance/network/ip-allow-list.js +1 -66
- package/dist/src/runtime/graph.js +1 -17
- package/dist/src/runtime/hooks/registry.js +1 -55
- package/dist/src/runtime/input/types.js +1 -63
- package/dist/src/runtime/loaders/artifact-paths.js +1 -26
- package/dist/src/runtime/loaders/bundled-artifacts.js +1 -21
- package/dist/src/runtime/loaders/compile-metadata.js +1 -92
- package/dist/src/runtime/loaders/manifest.js +1 -56
- package/dist/src/runtime/loaders/module-map.js +1 -64
- package/dist/src/runtime/prompt/compose.js +2 -47
- package/dist/src/runtime/prompt/connections.js +2 -23
- package/dist/src/runtime/resolve-agent-graph.js +1 -287
- package/dist/src/runtime/resolve-agent.js +1 -134
- package/dist/src/runtime/resolve-channel.js +1 -62
- package/dist/src/runtime/resolve-connection.js +1 -72
- package/dist/src/runtime/resolve-helpers.js +1 -58
- package/dist/src/runtime/resolve-hook.js +1 -67
- package/dist/src/runtime/resolve-sandbox.js +1 -65
- package/dist/src/runtime/resolve-tool.js +1 -110
- package/dist/src/runtime/sandbox/keys.js +1 -72
- package/dist/src/runtime/sandbox/registry.js +1 -42
- package/dist/src/runtime/schedules/register.js +1 -62
- package/dist/src/runtime/schedules/resolve-schedule.js +1 -66
- package/dist/src/runtime/session-callback-route.js +1 -87
- package/dist/src/runtime/sessions/auth.js +1 -18
- package/dist/src/runtime/sessions/compiled-agent-cache.js +1 -125
- package/dist/src/runtime/sessions/runtime-session.js +1 -50
- package/dist/src/runtime/sessions/turn.js +1 -1
- package/dist/src/runtime/skills/fragment-context.js +1 -4
- package/dist/src/runtime/skills/sandbox-access.js +1 -85
- package/dist/src/runtime/subagents/registry.js +1 -62
- package/dist/src/runtime/tools/registry.js +1 -40
- package/dist/src/runtime/types.js +1 -1
- package/dist/src/runtime/validation.js +1 -7
- package/dist/src/runtime/workspace/seed-files.js +1 -42
- package/dist/src/runtime/workspace/spec.js +2 -22
- package/dist/src/runtime/workspace/types.js +1 -9
- package/dist/src/sandbox/state.js +1 -1
- package/dist/src/services/dev-client/request-headers.js +1 -197
- package/dist/src/services/dev-client/stream.js +1 -7
- package/dist/src/services/dev-client/url.js +1 -25
- package/dist/src/services/dev-client/vercel-auth-error.js +2 -98
- package/dist/src/services/dev-client.js +1 -48
- package/dist/src/services/inspect-application.js +1 -45
- package/dist/src/shared/agent-definition.js +1 -1
- package/dist/src/shared/errors.js +1 -66
- package/dist/src/shared/guards.js +1 -35
- package/dist/src/shared/json-schemas.js +1 -41
- package/dist/src/shared/json.js +1 -80
- package/dist/src/shared/node.js +1 -1
- package/dist/src/shared/optional.js +1 -1
- package/dist/src/shared/run-mode.js +1 -1
- package/dist/src/shared/sandbox-backend.js +1 -1
- package/dist/src/shared/sandbox-definition.js +1 -1
- package/dist/src/shared/sandbox-session.js +1 -1
- package/dist/src/shared/skill-definition.js +1 -1
- package/dist/src/shared/skill-package.js +1 -100
- package/dist/src/shared/source-ref.js +1 -1
- package/dist/src/shared/tool-definition.js +1 -1
- package/package.json +4 -4
- package/dist/src/chunks/authored-module-loader-DcCfCiBm.js +0 -4
- package/dist/src/chunks/chunk-DSjMdhoD.js +0 -1
- package/dist/src/chunks/client-ZqNLLMZB.js +0 -4
- package/dist/src/chunks/compile-agent-DrIyb818.js +0 -5
- package/dist/src/chunks/dev-authored-source-watcher-C1WUVv9F.js +0 -1
- package/dist/src/chunks/errors-HYWjHxV6.js +0 -1
- package/dist/src/chunks/guards-26p6sOw3.js +0 -1
- package/dist/src/chunks/host-CwAcCrg7.js +0 -70
- package/dist/src/chunks/input-requests-DJiy6dG9.js +0 -1
- package/dist/src/chunks/jsdist-BkeWZ7EZ.js +0 -443
- package/dist/src/chunks/paths-CWZN-XRX.js +0 -85
- package/dist/src/chunks/picocolors-aAkqW4On.js +0 -1
- package/dist/src/chunks/runtime-model-Dh0Nz64z.js +0 -1
- package/dist/src/chunks/token-YW4VSeBB.js +0 -1
- package/dist/src/chunks/types-BJSR0JNV.js +0 -1
|
@@ -1,472 +1,5 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
import { normalizeEsmImportSpecifier } from "#internal/application/import-specifier.js";
|
|
7
|
-
import { atomicWriteFile, bundleFinalWorkflowOutput, collectWorkflowInputFiles, convertClassesManifest, convertStepsManifest, convertWorkflowsManifest, createAshPackageImportsPlugin, createWorkflowImport, createWorkflowPseudoPackagePlugin, createWorkflowTransformPlugin, createWorkflowVirtualEntryPlugin, WORKFLOW_VIRTUAL_ENTRY_ID, } from "#internal/workflow-bundle/builder-support.js";
|
|
8
|
-
import { buildWithNitroRolldown, getSingleRolldownChunk, } from "#internal/bundler/nitro-rolldown.js";
|
|
9
|
-
import { writeNitroStepEntrypoint } from "#internal/workflow-bundle/nitro-step-entry.js";
|
|
10
|
-
import { copyNitroFunctionDirectory, createWorkflowFunctionEnvironment, retargetNitroFunctionDirectoryToWorkflowRoute, WORKFLOW_BUILDER_DEFERRED_PACKAGES, WORKFLOW_STEP_EXTERNAL_PACKAGES, } from "#internal/workflow-bundle/vercel-workflow-output.js";
|
|
11
|
-
import { detectWorkflowPatterns, WORKFLOW_QUEUE_TRIGGER, } from "#internal/workflow-bundle/workflow-builders.js";
|
|
12
|
-
// Serialize same-output builds so parallel Vercel surfaces never read
|
|
13
|
-
// `workflows.mjs` between the workflow wrapper write and literal rewrite pass.
|
|
14
|
-
const workflowBundleBuildLocks = new Map();
|
|
15
|
-
export class WorkflowBundleBuilder {
|
|
16
|
-
#compiledArtifactsBootstrapPath;
|
|
17
|
-
#outDir;
|
|
18
|
-
config;
|
|
19
|
-
#discoveredEntries = new WeakMap();
|
|
20
|
-
constructor(options) {
|
|
21
|
-
this.config = {
|
|
22
|
-
buildTarget: "standalone",
|
|
23
|
-
dirs: [resolvePackageSourceDirectoryPath("src/execution")],
|
|
24
|
-
externalPackages: [...WORKFLOW_STEP_EXTERNAL_PACKAGES, ...WORKFLOW_BUILDER_DEFERRED_PACKAGES],
|
|
25
|
-
// Keep package-version workflow ids stable across bundling targets.
|
|
26
|
-
projectRoot: options.appRoot,
|
|
27
|
-
watch: options.watch,
|
|
28
|
-
workingDir: options.rootDir,
|
|
29
|
-
};
|
|
30
|
-
this.#compiledArtifactsBootstrapPath = options.compiledArtifactsBootstrapPath;
|
|
31
|
-
this.#outDir = options.outDir;
|
|
32
|
-
}
|
|
33
|
-
async build(options = {}) {
|
|
34
|
-
const previous = workflowBundleBuildLocks.get(this.#outDir) ?? Promise.resolve();
|
|
35
|
-
const next = previous.then(() => this.#performBuild(options));
|
|
36
|
-
workflowBundleBuildLocks.set(this.#outDir, next.catch(() => { }));
|
|
37
|
-
await next;
|
|
38
|
-
}
|
|
39
|
-
async #performBuild(options) {
|
|
40
|
-
await prepareAshVersionedCacheDirectory(this.#outDir);
|
|
41
|
-
const inputFiles = await this.#getBuildInputFiles();
|
|
42
|
-
if (inputFiles.length === 0) {
|
|
43
|
-
throw new Error(`Expected the execution workflow source file under "${resolvePackageSourceDirectoryPath("src/execution")}".`);
|
|
44
|
-
}
|
|
45
|
-
const tsconfigPath = await this.findTsConfigPath();
|
|
46
|
-
await mkdir(this.#outDir, { recursive: true });
|
|
47
|
-
const discoveredEntries = await this.discoverEntries(inputFiles, this.#outDir, tsconfigPath);
|
|
48
|
-
const workflowsOutfile = join(this.#outDir, "workflows.mjs");
|
|
49
|
-
const { manifest: workflowsManifest } = await this.createWorkflowsBundle({
|
|
50
|
-
discoveredEntries,
|
|
51
|
-
// Ash owns dev rebuilds through `dev-authored-source-watcher`.
|
|
52
|
-
keepInterimBundleContext: false,
|
|
53
|
-
outfile: workflowsOutfile,
|
|
54
|
-
bundleFinalOutput: false,
|
|
55
|
-
format: "esm",
|
|
56
|
-
inputFiles,
|
|
57
|
-
tsconfigPath,
|
|
58
|
-
});
|
|
59
|
-
const stepsOutfile = join(this.#outDir, "steps.mjs");
|
|
60
|
-
const stepsManifest = await writeNitroStepEntrypoint({
|
|
61
|
-
builtinsPath: resolveWorkflowModulePath("workflow/internal/builtins"),
|
|
62
|
-
discoveredEntries,
|
|
63
|
-
outfile: stepsOutfile,
|
|
64
|
-
preferAbsoluteFileImports: true,
|
|
65
|
-
projectRoot: this.config.projectRoot ?? this.config.workingDir,
|
|
66
|
-
workingDir: this.config.workingDir,
|
|
67
|
-
});
|
|
68
|
-
const nitroStepOutfile = options.nitroStepOutfile;
|
|
69
|
-
if (nitroStepOutfile !== undefined && nitroStepOutfile !== stepsOutfile) {
|
|
70
|
-
await writeNitroStepEntrypoint({
|
|
71
|
-
builtinsPath: resolveWorkflowModulePath("workflow/internal/builtins"),
|
|
72
|
-
discoveredEntries,
|
|
73
|
-
outfile: nitroStepOutfile,
|
|
74
|
-
preferAbsoluteFileImports: true,
|
|
75
|
-
projectRoot: this.config.projectRoot ?? this.config.workingDir,
|
|
76
|
-
workingDir: this.config.workingDir,
|
|
77
|
-
});
|
|
78
|
-
}
|
|
79
|
-
await addStepRegistrationsImport(workflowsOutfile, stepsOutfile);
|
|
80
|
-
await rewriteWorkflowRuntimeImports(workflowsOutfile);
|
|
81
|
-
await rewriteWorkflowCodeLiteral(workflowsOutfile);
|
|
82
|
-
const nitroWorkflowOutfile = options.nitroWorkflowOutfile;
|
|
83
|
-
if (nitroWorkflowOutfile !== undefined && nitroWorkflowOutfile !== workflowsOutfile) {
|
|
84
|
-
await mkdir(dirname(nitroWorkflowOutfile), { recursive: true });
|
|
85
|
-
await mirrorFileBypassingUnlink(workflowsOutfile, nitroWorkflowOutfile);
|
|
86
|
-
if (nitroStepOutfile !== undefined) {
|
|
87
|
-
await addStepRegistrationsImport(nitroWorkflowOutfile, nitroStepOutfile);
|
|
88
|
-
await rewriteWorkflowRuntimeImports(nitroWorkflowOutfile);
|
|
89
|
-
await rewriteWorkflowCodeLiteral(nitroWorkflowOutfile);
|
|
90
|
-
}
|
|
91
|
-
}
|
|
92
|
-
await this.createManifest({
|
|
93
|
-
workflowBundlePath: join(this.#outDir, "workflows.mjs"),
|
|
94
|
-
manifestDir: this.#outDir,
|
|
95
|
-
manifest: {
|
|
96
|
-
steps: {
|
|
97
|
-
...stepsManifest.steps,
|
|
98
|
-
...workflowsManifest.steps,
|
|
99
|
-
},
|
|
100
|
-
workflows: {
|
|
101
|
-
...stepsManifest.workflows,
|
|
102
|
-
...workflowsManifest.workflows,
|
|
103
|
-
},
|
|
104
|
-
classes: {
|
|
105
|
-
...stepsManifest.classes,
|
|
106
|
-
...workflowsManifest.classes,
|
|
107
|
-
},
|
|
108
|
-
},
|
|
109
|
-
});
|
|
110
|
-
await writeAshVersionedCacheMetadata(this.#outDir);
|
|
111
|
-
// Workflow bundle output may use bare `workflow/*` specifiers.
|
|
112
|
-
}
|
|
113
|
-
get transformProjectRoot() {
|
|
114
|
-
return this.config.projectRoot ?? this.config.workingDir;
|
|
115
|
-
}
|
|
116
|
-
async findTsConfigPath() {
|
|
117
|
-
let current = this.config.workingDir;
|
|
118
|
-
while (true) {
|
|
119
|
-
for (const filename of ["tsconfig.json", "jsconfig.json"]) {
|
|
120
|
-
const candidate = join(current, filename);
|
|
121
|
-
try {
|
|
122
|
-
await readFile(candidate);
|
|
123
|
-
return candidate;
|
|
124
|
-
}
|
|
125
|
-
catch (error) {
|
|
126
|
-
if (!(error instanceof Error && "code" in error && error.code === "ENOENT")) {
|
|
127
|
-
throw error;
|
|
128
|
-
}
|
|
129
|
-
}
|
|
130
|
-
}
|
|
131
|
-
const parent = dirname(current);
|
|
132
|
-
if (parent === current) {
|
|
133
|
-
return undefined;
|
|
134
|
-
}
|
|
135
|
-
current = parent;
|
|
136
|
-
}
|
|
137
|
-
}
|
|
138
|
-
async getInputFiles() {
|
|
139
|
-
const roots = this.config.dirs.map((dir) => resolve(this.config.workingDir, dir));
|
|
140
|
-
const files = await Promise.all(roots.map((root) => collectWorkflowInputFiles(root)));
|
|
141
|
-
return files.flat();
|
|
142
|
-
}
|
|
143
|
-
async discoverEntries(inputs, _outdir, _tsconfigPath) {
|
|
144
|
-
const cached = this.#discoveredEntries.get(inputs);
|
|
145
|
-
if (cached !== undefined) {
|
|
146
|
-
return cached;
|
|
147
|
-
}
|
|
148
|
-
const discovered = {
|
|
149
|
-
discoveredSerdeFiles: [],
|
|
150
|
-
discoveredSteps: [],
|
|
151
|
-
discoveredWorkflows: [],
|
|
152
|
-
};
|
|
153
|
-
for (const filePath of inputs) {
|
|
154
|
-
const source = await readFile(filePath, "utf8");
|
|
155
|
-
const patterns = detectWorkflowPatterns(source);
|
|
156
|
-
if (patterns.hasUseStep) {
|
|
157
|
-
discovered.discoveredSteps.push(filePath);
|
|
158
|
-
}
|
|
159
|
-
if (patterns.hasUseWorkflow) {
|
|
160
|
-
discovered.discoveredWorkflows.push(filePath);
|
|
161
|
-
}
|
|
162
|
-
if (patterns.hasSerde) {
|
|
163
|
-
discovered.discoveredSerdeFiles.push(filePath);
|
|
164
|
-
}
|
|
165
|
-
}
|
|
166
|
-
this.#discoveredEntries.set(inputs, discovered);
|
|
167
|
-
return discovered;
|
|
168
|
-
}
|
|
169
|
-
async createWorkflowsBundle({ bundleFinalOutput = true, discoveredEntries, format = "cjs", inputFiles, keepInterimBundleContext = this.config.watch, outfile, tsconfigPath, }) {
|
|
170
|
-
const discovered = discoveredEntries ?? (await this.discoverEntries(inputFiles, dirname(outfile), tsconfigPath));
|
|
171
|
-
const workflowFiles = [...discovered.discoveredWorkflows].sort();
|
|
172
|
-
const workflowFileSet = new Set(workflowFiles);
|
|
173
|
-
const serdeOnlyFiles = [...discovered.discoveredSerdeFiles]
|
|
174
|
-
.sort()
|
|
175
|
-
.filter((filePath) => !workflowFileSet.has(filePath));
|
|
176
|
-
const workflowManifest = {};
|
|
177
|
-
const virtualEntrySource = [
|
|
178
|
-
...workflowFiles.map((filePath) => createWorkflowImport(filePath, this.config.workingDir)),
|
|
179
|
-
...serdeOnlyFiles.map((filePath) => createWorkflowImport(filePath, this.config.workingDir)),
|
|
180
|
-
].join("\n");
|
|
181
|
-
const output = await buildWithNitroRolldown({
|
|
182
|
-
cwd: this.config.workingDir,
|
|
183
|
-
input: WORKFLOW_VIRTUAL_ENTRY_ID,
|
|
184
|
-
platform: "neutral",
|
|
185
|
-
plugins: [
|
|
186
|
-
createWorkflowVirtualEntryPlugin(virtualEntrySource),
|
|
187
|
-
createWorkflowPseudoPackagePlugin(),
|
|
188
|
-
createAshPackageImportsPlugin(this.config.workingDir, { workflowCondition: true }),
|
|
189
|
-
createWorkflowTransformPlugin({
|
|
190
|
-
manifest: workflowManifest,
|
|
191
|
-
projectRoot: this.transformProjectRoot,
|
|
192
|
-
sideEffectFiles: [...workflowFiles, ...serdeOnlyFiles],
|
|
193
|
-
workingDir: this.config.workingDir,
|
|
194
|
-
}),
|
|
195
|
-
],
|
|
196
|
-
resolve: {
|
|
197
|
-
conditionNames: ["ash-source", "workflow", "node", "import", "default"],
|
|
198
|
-
extensions: [".ts", ".tsx", ".mts", ".cts", ".js", ".jsx", ".mjs", ".cjs"],
|
|
199
|
-
mainFields: ["module", "main"],
|
|
200
|
-
},
|
|
201
|
-
tsconfig: tsconfigPath ?? false,
|
|
202
|
-
write: false,
|
|
203
|
-
output: {
|
|
204
|
-
banner: "globalThis.__private_workflows = new Map();",
|
|
205
|
-
codeSplitting: false,
|
|
206
|
-
comments: false,
|
|
207
|
-
format: "cjs",
|
|
208
|
-
sourcemap: "inline",
|
|
209
|
-
},
|
|
210
|
-
});
|
|
211
|
-
const interimBundle = getSingleRolldownChunk(output, `intermediate workflow bundle for "${outfile}"`);
|
|
212
|
-
await bundleFinalWorkflowOutput({
|
|
213
|
-
bundleFinalOutput,
|
|
214
|
-
code: interimBundle.code,
|
|
215
|
-
format,
|
|
216
|
-
outfile,
|
|
217
|
-
workingDir: this.config.workingDir,
|
|
218
|
-
});
|
|
219
|
-
if (keepInterimBundleContext) {
|
|
220
|
-
return {
|
|
221
|
-
bundleFinal: async (interimBundleResult) => {
|
|
222
|
-
await bundleFinalWorkflowOutput({
|
|
223
|
-
bundleFinalOutput,
|
|
224
|
-
code: interimBundleResult,
|
|
225
|
-
format,
|
|
226
|
-
outfile,
|
|
227
|
-
workingDir: this.config.workingDir,
|
|
228
|
-
});
|
|
229
|
-
},
|
|
230
|
-
interimBundleCtx: undefined,
|
|
231
|
-
manifest: workflowManifest,
|
|
232
|
-
};
|
|
233
|
-
}
|
|
234
|
-
return { manifest: workflowManifest };
|
|
235
|
-
}
|
|
236
|
-
async createManifest({ manifest, manifestDir, }) {
|
|
237
|
-
const output = {
|
|
238
|
-
version: "1.0.0",
|
|
239
|
-
steps: convertStepsManifest(manifest.steps),
|
|
240
|
-
workflows: convertWorkflowsManifest(manifest.workflows),
|
|
241
|
-
classes: convertClassesManifest(manifest.classes),
|
|
242
|
-
};
|
|
243
|
-
const manifestJson = JSON.stringify(output, null, 2);
|
|
244
|
-
await mkdir(manifestDir, { recursive: true });
|
|
245
|
-
await writeFile(join(manifestDir, "manifest.json"), manifestJson);
|
|
246
|
-
return manifestJson;
|
|
247
|
-
}
|
|
248
|
-
async buildVercelOutput(options) {
|
|
249
|
-
await this.build();
|
|
250
|
-
const stagedWorkflowGeneratedDir = join(this.#outDir, "vercel-build-output", "functions", ".well-known", "workflow", "v1");
|
|
251
|
-
const stagedFlowFunctionDir = join(stagedWorkflowGeneratedDir, "flow.func");
|
|
252
|
-
const workflowGeneratedDir = join(options.outputDir, "functions", ".well-known", "workflow", "v1");
|
|
253
|
-
const nitroFlowServerFunctionDir = join(options.flowNitroOutputDir, "functions", "__server.func");
|
|
254
|
-
const nitroFlowFunctionDir = join(options.flowNitroOutputDir, "functions", ".well-known", "workflow", "v1", "flow.func");
|
|
255
|
-
const flowFunctionDir = join(workflowGeneratedDir, "flow.func");
|
|
256
|
-
const staleStepFunctionDir = join(workflowGeneratedDir, "step.func");
|
|
257
|
-
const staleWebhookFunctionDir = join(workflowGeneratedDir, "webhook", "[token].func");
|
|
258
|
-
await copyNitroFunctionDirectory({
|
|
259
|
-
fallbackPath: nitroFlowServerFunctionDir,
|
|
260
|
-
sourcePath: nitroFlowFunctionDir,
|
|
261
|
-
targetPath: stagedFlowFunctionDir,
|
|
262
|
-
});
|
|
263
|
-
await Promise.all([
|
|
264
|
-
this.#patchVercelFunctionConfig(stagedFlowFunctionDir, {
|
|
265
|
-
experimentalTriggers: Array.from([WORKFLOW_QUEUE_TRIGGER]),
|
|
266
|
-
maxDuration: "max",
|
|
267
|
-
runtime: options.runtime ?? null,
|
|
268
|
-
shouldAddHelpers: false,
|
|
269
|
-
}),
|
|
270
|
-
cp(join(this.#outDir, "manifest.json"), join(stagedWorkflowGeneratedDir, "manifest.json")),
|
|
271
|
-
]);
|
|
272
|
-
await retargetNitroFunctionDirectoryToWorkflowRoute({
|
|
273
|
-
functionDirectoryPath: stagedFlowFunctionDir,
|
|
274
|
-
workflowRoutePath: "/.well-known/workflow/v1/flow",
|
|
275
|
-
});
|
|
276
|
-
await Promise.all([
|
|
277
|
-
rm(flowFunctionDir, {
|
|
278
|
-
force: true,
|
|
279
|
-
recursive: true,
|
|
280
|
-
}),
|
|
281
|
-
rm(staleStepFunctionDir, {
|
|
282
|
-
force: true,
|
|
283
|
-
recursive: true,
|
|
284
|
-
}),
|
|
285
|
-
rm(staleWebhookFunctionDir, {
|
|
286
|
-
force: true,
|
|
287
|
-
recursive: true,
|
|
288
|
-
}),
|
|
289
|
-
]);
|
|
290
|
-
await mkdir(workflowGeneratedDir, { recursive: true });
|
|
291
|
-
await Promise.all([
|
|
292
|
-
cp(stagedFlowFunctionDir, flowFunctionDir, { recursive: true }),
|
|
293
|
-
cp(join(stagedWorkflowGeneratedDir, "manifest.json"), join(workflowGeneratedDir, "manifest.json")),
|
|
294
|
-
]);
|
|
295
|
-
}
|
|
296
|
-
async #getBuildInputFiles() {
|
|
297
|
-
const inputFiles = await this.getInputFiles();
|
|
298
|
-
return [...inputFiles, this.#compiledArtifactsBootstrapPath];
|
|
299
|
-
}
|
|
300
|
-
async #patchVercelFunctionConfig(directoryPath, patch) {
|
|
301
|
-
const configPath = join(directoryPath, ".vc-config.json");
|
|
302
|
-
const baseConfig = await this.#readVercelFunctionConfig(configPath);
|
|
303
|
-
const nextConfig = {
|
|
304
|
-
...baseConfig,
|
|
305
|
-
};
|
|
306
|
-
nextConfig.environment = createWorkflowFunctionEnvironment(baseConfig.environment);
|
|
307
|
-
if (patch.runtime !== null) {
|
|
308
|
-
nextConfig.runtime = patch.runtime;
|
|
309
|
-
}
|
|
310
|
-
if (patch.maxDuration !== undefined) {
|
|
311
|
-
nextConfig.maxDuration = patch.maxDuration;
|
|
312
|
-
}
|
|
313
|
-
if (patch.shouldAddHelpers !== undefined) {
|
|
314
|
-
nextConfig.shouldAddHelpers = patch.shouldAddHelpers;
|
|
315
|
-
}
|
|
316
|
-
if (patch.shouldAddSourcemapSupport !== undefined) {
|
|
317
|
-
nextConfig.shouldAddSourcemapSupport = patch.shouldAddSourcemapSupport;
|
|
318
|
-
}
|
|
319
|
-
if (patch.experimentalTriggers !== undefined) {
|
|
320
|
-
nextConfig.experimentalTriggers = [...patch.experimentalTriggers];
|
|
321
|
-
}
|
|
322
|
-
await writeFile(configPath, `${JSON.stringify(nextConfig, null, 2)}\n`);
|
|
323
|
-
}
|
|
324
|
-
async #readVercelFunctionConfig(configPath) {
|
|
325
|
-
try {
|
|
326
|
-
const parsed = JSON.parse(await readFile(configPath, "utf8"));
|
|
327
|
-
if (parsed !== null && typeof parsed === "object") {
|
|
328
|
-
return parsed;
|
|
329
|
-
}
|
|
330
|
-
}
|
|
331
|
-
catch {
|
|
332
|
-
// fall through
|
|
333
|
-
}
|
|
334
|
-
return {};
|
|
335
|
-
}
|
|
336
|
-
}
|
|
337
|
-
async function addStepRegistrationsImport(workflowBundlePath, stepRegistrationsPath) {
|
|
338
|
-
const source = await readTextFileIfPresent(workflowBundlePath);
|
|
339
|
-
if (source === null || source.includes("__ashWorkflowStepsRegistered")) {
|
|
340
|
-
return;
|
|
341
|
-
}
|
|
342
|
-
const importSpecifier = createRelativeImportSpecifier(dirname(workflowBundlePath), stepRegistrationsPath);
|
|
343
|
-
const importSource = [
|
|
344
|
-
`import { __steps_registered as __ashWorkflowStepsRegistered } from ${JSON.stringify(importSpecifier)};`,
|
|
345
|
-
"void __ashWorkflowStepsRegistered;",
|
|
346
|
-
"",
|
|
347
|
-
].join("\n");
|
|
348
|
-
const firstImportMatch = source.match(/^import\s.+?;\n/m);
|
|
349
|
-
if (firstImportMatch === null || firstImportMatch.index === undefined) {
|
|
350
|
-
await atomicWriteFile(workflowBundlePath, `${importSource}${source}`);
|
|
351
|
-
return;
|
|
352
|
-
}
|
|
353
|
-
const insertionIndex = firstImportMatch.index + firstImportMatch[0].length;
|
|
354
|
-
const nextSource = `${source.slice(0, insertionIndex)}${importSource}${source.slice(insertionIndex)}`;
|
|
355
|
-
await atomicWriteFile(workflowBundlePath, nextSource);
|
|
356
|
-
}
|
|
357
|
-
async function rewriteWorkflowRuntimeImports(filePath) {
|
|
358
|
-
const source = await readTextFileIfPresent(filePath);
|
|
359
|
-
if (source === null) {
|
|
360
|
-
return;
|
|
361
|
-
}
|
|
362
|
-
let nextSource = source;
|
|
363
|
-
for (const specifier of [
|
|
364
|
-
"workflow",
|
|
365
|
-
"workflow/api",
|
|
366
|
-
"workflow/internal/builtins",
|
|
367
|
-
"workflow/internal/private",
|
|
368
|
-
"workflow/runtime",
|
|
369
|
-
]) {
|
|
370
|
-
const resolvedSpecifier = normalizeImportSpecifierPath(resolveWorkflowModulePath(specifier));
|
|
371
|
-
nextSource = replaceStringLiteralSpecifier(nextSource, specifier, resolvedSpecifier);
|
|
372
|
-
}
|
|
373
|
-
if (nextSource !== source) {
|
|
374
|
-
await atomicWriteFile(filePath, nextSource);
|
|
375
|
-
}
|
|
376
|
-
}
|
|
377
|
-
async function rewriteWorkflowCodeLiteral(filePath) {
|
|
378
|
-
const source = await readTextFileIfPresent(filePath);
|
|
379
|
-
if (source === null) {
|
|
380
|
-
return;
|
|
381
|
-
}
|
|
382
|
-
const declarationPrefix = "const workflowCode = ";
|
|
383
|
-
const declarationSuffix = ";\n\nexport const POST = workflowEntrypoint(workflowCode);";
|
|
384
|
-
const expressionStart = source.indexOf(declarationPrefix);
|
|
385
|
-
const expressionEnd = source.lastIndexOf(declarationSuffix);
|
|
386
|
-
if (expressionStart === -1 || expressionEnd === -1 || expressionEnd <= expressionStart) {
|
|
387
|
-
return;
|
|
388
|
-
}
|
|
389
|
-
const valueStart = expressionStart + declarationPrefix.length;
|
|
390
|
-
const expression = source.slice(valueStart, expressionEnd);
|
|
391
|
-
if (!expression.trimStart().startsWith("`")) {
|
|
392
|
-
return;
|
|
393
|
-
}
|
|
394
|
-
const workflowCode = decodeWorkflowCodeTemplateLiteral(expression, filePath);
|
|
395
|
-
const nextSource = `${source.slice(0, valueStart)}${encodeWorkflowCodeLiteral(workflowCode)}${source.slice(expressionEnd)}`;
|
|
396
|
-
if (nextSource !== source) {
|
|
397
|
-
await atomicWriteFile(filePath, nextSource);
|
|
398
|
-
}
|
|
399
|
-
}
|
|
400
|
-
function encodeWorkflowCodeLiteral(workflowCode) {
|
|
401
|
-
const encodedWorkflowCode = Buffer.from(workflowCode, "utf8").toString("base64");
|
|
402
|
-
const chunks = encodedWorkflowCode.match(/.{1,16384}/g) ?? [""];
|
|
403
|
-
return `Buffer.from(${JSON.stringify(chunks)}.join(""), "base64").toString("utf8")`;
|
|
404
|
-
}
|
|
405
|
-
function decodeWorkflowCodeTemplateLiteral(expression, filePath) {
|
|
406
|
-
const trimmedExpression = expression.trim();
|
|
407
|
-
if (!trimmedExpression.startsWith("`") || !trimmedExpression.endsWith("`")) {
|
|
408
|
-
throw new Error(`Expected generated workflow code literal in "${filePath}" to be a template.`);
|
|
409
|
-
}
|
|
410
|
-
const rawValue = trimmedExpression.slice(1, -1);
|
|
411
|
-
let value = "";
|
|
412
|
-
for (let index = 0; index < rawValue.length; index += 1) {
|
|
413
|
-
const char = rawValue[index];
|
|
414
|
-
if (char !== "\\") {
|
|
415
|
-
value += char;
|
|
416
|
-
continue;
|
|
417
|
-
}
|
|
418
|
-
const escapedChar = rawValue[index + 1];
|
|
419
|
-
if (escapedChar === "\\" || escapedChar === "`" || escapedChar === "$") {
|
|
420
|
-
value += escapedChar;
|
|
421
|
-
index += 1;
|
|
422
|
-
continue;
|
|
423
|
-
}
|
|
424
|
-
value += char;
|
|
425
|
-
}
|
|
426
|
-
return value;
|
|
427
|
-
}
|
|
428
|
-
function replaceStringLiteralSpecifier(source, from, to) {
|
|
429
|
-
return source
|
|
430
|
-
.replaceAll(JSON.stringify(from), JSON.stringify(to))
|
|
431
|
-
.replaceAll(`'${from}'`, JSON.stringify(to));
|
|
432
|
-
}
|
|
433
|
-
function normalizeImportSpecifierPath(path) {
|
|
434
|
-
return normalizeEsmImportSpecifier(path);
|
|
435
|
-
}
|
|
436
|
-
function createRelativeImportSpecifier(fromDirectoryPath, targetPath) {
|
|
437
|
-
const relativePath = relative(fromDirectoryPath, targetPath).replaceAll("\\", "/");
|
|
438
|
-
if (relativePath.startsWith(".")) {
|
|
439
|
-
return relativePath;
|
|
440
|
-
}
|
|
441
|
-
return `./${relativePath}`;
|
|
442
|
-
}
|
|
443
|
-
async function readTextFileIfPresent(filePath) {
|
|
444
|
-
try {
|
|
445
|
-
return await readFile(filePath, "utf8");
|
|
446
|
-
}
|
|
447
|
-
catch (error) {
|
|
448
|
-
if (error instanceof Error && "code" in error && error.code === "ENOENT") {
|
|
449
|
-
return null;
|
|
450
|
-
}
|
|
451
|
-
throw error;
|
|
452
|
-
}
|
|
453
|
-
}
|
|
454
|
-
async function readBinaryFileIfPresent(filePath) {
|
|
455
|
-
try {
|
|
456
|
-
return await readFile(filePath);
|
|
457
|
-
}
|
|
458
|
-
catch (error) {
|
|
459
|
-
if (error instanceof Error && "code" in error && error.code === "ENOENT") {
|
|
460
|
-
return null;
|
|
461
|
-
}
|
|
462
|
-
throw error;
|
|
463
|
-
}
|
|
464
|
-
}
|
|
465
|
-
async function mirrorFileBypassingUnlink(sourcePath, targetPath) {
|
|
466
|
-
const sourceContents = await readFile(sourcePath);
|
|
467
|
-
const existingContents = await readBinaryFileIfPresent(targetPath);
|
|
468
|
-
if (existingContents !== null && existingContents.equals(sourceContents)) {
|
|
469
|
-
return;
|
|
470
|
-
}
|
|
471
|
-
await atomicWriteFile(targetPath, sourceContents);
|
|
472
|
-
}
|
|
1
|
+
import{dirname,join,relative,resolve}from"node:path";import{cp,mkdir,readFile,rm,writeFile}from"node:fs/promises";import{resolvePackageSourceDirectoryPath,resolveWorkflowModulePath}from"#internal/application/package.js";import{normalizeEsmImportSpecifier}from"#internal/application/import-specifier.js";import{Buffer}from"node:buffer";import{buildWithNitroRolldown,getSingleRolldownChunk}from"#internal/bundler/nitro-rolldown.js";import{prepareAshVersionedCacheDirectory,writeAshVersionedCacheMetadata}from"#internal/application/cache-metadata.js";import{WORKFLOW_BUILDER_DEFERRED_PACKAGES,WORKFLOW_STEP_EXTERNAL_PACKAGES,copyNitroFunctionDirectory,createWorkflowFunctionEnvironment,retargetNitroFunctionDirectoryToWorkflowRoute}from"#internal/workflow-bundle/vercel-workflow-output.js";import{WORKFLOW_QUEUE_TRIGGER,detectWorkflowPatterns}from"#internal/workflow-bundle/workflow-builders.js";import{WORKFLOW_VIRTUAL_ENTRY_ID,atomicWriteFile,bundleFinalWorkflowOutput,collectWorkflowInputFiles,convertClassesManifest,convertStepsManifest,convertWorkflowsManifest,createAshPackageImportsPlugin,createWorkflowImport,createWorkflowPseudoPackagePlugin,createWorkflowTransformPlugin,createWorkflowVirtualEntryPlugin}from"#internal/workflow-bundle/builder-support.js";import{writeNitroStepEntrypoint}from"#internal/workflow-bundle/nitro-step-entry.js";var workflowBundleBuildLocks=new Map,WorkflowBundleBuilder=class{#e;#t;config;#n=new WeakMap;constructor(e){this.config={buildTarget:`standalone`,dirs:[resolvePackageSourceDirectoryPath(`src/execution`)],externalPackages:[...WORKFLOW_STEP_EXTERNAL_PACKAGES,...WORKFLOW_BUILDER_DEFERRED_PACKAGES],projectRoot:e.appRoot,watch:e.watch,workingDir:e.rootDir},this.#e=e.compiledArtifactsBootstrapPath,this.#t=e.outDir}async build(e={}){let t=(workflowBundleBuildLocks.get(this.#t)??Promise.resolve()).then(()=>this.#r(e));workflowBundleBuildLocks.set(this.#t,t.catch(()=>{})),await t}async#r(n){await prepareAshVersionedCacheDirectory(this.#t);let r=await this.#i();if(r.length===0)throw Error(`Expected the execution workflow source file under "${resolvePackageSourceDirectoryPath(`src/execution`)}".`);let i=await this.findTsConfigPath();await mkdir(this.#t,{recursive:!0});let o=await this.discoverEntries(r,this.#t,i),s=join(this.#t,`workflows.mjs`),{manifest:c}=await this.createWorkflowsBundle({discoveredEntries:o,keepInterimBundleContext:!1,outfile:s,bundleFinalOutput:!1,format:`esm`,inputFiles:r,tsconfigPath:i}),d=join(this.#t,`steps.mjs`),f=await writeNitroStepEntrypoint({builtinsPath:resolveWorkflowModulePath(`workflow/internal/builtins`),discoveredEntries:o,outfile:d,preferAbsoluteFileImports:!0,projectRoot:this.config.projectRoot??this.config.workingDir,workingDir:this.config.workingDir}),p=n.nitroStepOutfile;p!==void 0&&p!==d&&await writeNitroStepEntrypoint({builtinsPath:resolveWorkflowModulePath(`workflow/internal/builtins`),discoveredEntries:o,outfile:p,preferAbsoluteFileImports:!0,projectRoot:this.config.projectRoot??this.config.workingDir,workingDir:this.config.workingDir}),await addStepRegistrationsImport(s,d),await rewriteWorkflowRuntimeImports(s),await rewriteWorkflowCodeLiteral(s);let m=n.nitroWorkflowOutfile;m!==void 0&&m!==s&&(await mkdir(dirname(m),{recursive:!0}),await mirrorFileBypassingUnlink(s,m),p!==void 0&&(await addStepRegistrationsImport(m,p),await rewriteWorkflowRuntimeImports(m),await rewriteWorkflowCodeLiteral(m))),await this.createManifest({workflowBundlePath:join(this.#t,`workflows.mjs`),manifestDir:this.#t,manifest:{steps:{...f.steps,...c.steps},workflows:{...f.workflows,...c.workflows},classes:{...f.classes,...c.classes}}}),await writeAshVersionedCacheMetadata(this.#t)}get transformProjectRoot(){return this.config.projectRoot??this.config.workingDir}async findTsConfigPath(){let n=this.config.workingDir;for(;;){for(let e of[`tsconfig.json`,`jsconfig.json`]){let r=join(n,e);try{return await readFile(r),r}catch(e){if(!(e instanceof Error&&`code`in e&&e.code===`ENOENT`))throw e}}let r=dirname(n);if(r===n)return;n=r}}async getInputFiles(){let e=this.config.dirs.map(e=>resolve(this.config.workingDir,e));return(await Promise.all(e.map(e=>collectWorkflowInputFiles(e)))).flat()}async discoverEntries(e,t,n){let r=this.#n.get(e);if(r!==void 0)return r;let i={discoveredSerdeFiles:[],discoveredSteps:[],discoveredWorkflows:[]};for(let t of e){let e=detectWorkflowPatterns(await readFile(t,`utf8`));e.hasUseStep&&i.discoveredSteps.push(t),e.hasUseWorkflow&&i.discoveredWorkflows.push(t),e.hasSerde&&i.discoveredSerdeFiles.push(t)}return this.#n.set(e,i),i}async createWorkflowsBundle({bundleFinalOutput:t=!0,discoveredEntries:n,format:r=`cjs`,inputFiles:i,keepInterimBundleContext:a=this.config.watch,outfile:o,tsconfigPath:s}){let c=n??await this.discoverEntries(i,dirname(o),s),l=[...c.discoveredWorkflows].sort(),u=new Set(l),d=[...c.discoveredSerdeFiles].sort().filter(e=>!u.has(e)),f={},h=[...l.map(e=>createWorkflowImport(e,this.config.workingDir)),...d.map(e=>createWorkflowImport(e,this.config.workingDir))].join(`
|
|
2
|
+
`);return await bundleFinalWorkflowOutput({bundleFinalOutput:t,code:getSingleRolldownChunk(await buildWithNitroRolldown({cwd:this.config.workingDir,input:WORKFLOW_VIRTUAL_ENTRY_ID,platform:`neutral`,plugins:[createWorkflowVirtualEntryPlugin(h),createWorkflowPseudoPackagePlugin(),createAshPackageImportsPlugin(this.config.workingDir,{workflowCondition:!0}),createWorkflowTransformPlugin({manifest:f,projectRoot:this.transformProjectRoot,sideEffectFiles:[...l,...d],workingDir:this.config.workingDir})],resolve:{conditionNames:[`ash-source`,`workflow`,`node`,`import`,`default`],extensions:[`.ts`,`.tsx`,`.mts`,`.cts`,`.js`,`.jsx`,`.mjs`,`.cjs`],mainFields:[`module`,`main`]},tsconfig:s??!1,write:!1,output:{banner:`globalThis.__private_workflows = new Map();`,codeSplitting:!1,comments:!1,format:`cjs`,sourcemap:`inline`}}),`intermediate workflow bundle for "${o}"`).code,format:r,outfile:o,workingDir:this.config.workingDir}),a?{bundleFinal:async e=>{await bundleFinalWorkflowOutput({bundleFinalOutput:t,code:e,format:r,outfile:o,workingDir:this.config.workingDir})},interimBundleCtx:void 0,manifest:f}:{manifest:f}}async createManifest({manifest:e,manifestDir:n}){let r={version:`1.0.0`,steps:convertStepsManifest(e.steps),workflows:convertWorkflowsManifest(e.workflows),classes:convertClassesManifest(e.classes)},i=JSON.stringify(r,null,2);return await mkdir(n,{recursive:!0}),await writeFile(join(n,`manifest.json`),i),i}async buildVercelOutput(e){await this.build();let n=join(this.#t,`vercel-build-output`,`functions`,`.well-known`,`workflow`,`v1`),r=join(n,`flow.func`),o=join(e.outputDir,`functions`,`.well-known`,`workflow`,`v1`),c=join(e.flowNitroOutputDir,`functions`,`__server.func`),l=join(e.flowNitroOutputDir,`functions`,`.well-known`,`workflow`,`v1`,`flow.func`),u=join(o,`flow.func`),d=join(o,`step.func`),f=join(o,`webhook`,`[token].func`);await copyNitroFunctionDirectory({fallbackPath:c,sourcePath:l,targetPath:r}),await Promise.all([this.#a(r,{experimentalTriggers:Array.from([WORKFLOW_QUEUE_TRIGGER]),maxDuration:`max`,runtime:e.runtime??null,shouldAddHelpers:!1}),cp(join(this.#t,`manifest.json`),join(n,`manifest.json`))]),await retargetNitroFunctionDirectoryToWorkflowRoute({functionDirectoryPath:r,workflowRoutePath:`/.well-known/workflow/v1/flow`}),await Promise.all([rm(u,{force:!0,recursive:!0}),rm(d,{force:!0,recursive:!0}),rm(f,{force:!0,recursive:!0})]),await mkdir(o,{recursive:!0}),await Promise.all([cp(r,u,{recursive:!0}),cp(join(n,`manifest.json`),join(o,`manifest.json`))])}async#i(){return[...await this.getInputFiles(),this.#e]}async#a(e,n){let r=join(e,`.vc-config.json`),i=await this.#o(r),a={...i};a.environment=createWorkflowFunctionEnvironment(i.environment),n.runtime!==null&&(a.runtime=n.runtime),n.maxDuration!==void 0&&(a.maxDuration=n.maxDuration),n.shouldAddHelpers!==void 0&&(a.shouldAddHelpers=n.shouldAddHelpers),n.shouldAddSourcemapSupport!==void 0&&(a.shouldAddSourcemapSupport=n.shouldAddSourcemapSupport),n.experimentalTriggers!==void 0&&(a.experimentalTriggers=[...n.experimentalTriggers]),await writeFile(r,`${JSON.stringify(a,null,2)}\n`)}async#o(e){try{let t=JSON.parse(await readFile(e,`utf8`));if(typeof t==`object`&&t)return t}catch{}return{}}};async function addStepRegistrationsImport(t,n){let r=await readTextFileIfPresent(t);if(r===null||r.includes(`__ashWorkflowStepsRegistered`))return;let i=createRelativeImportSpecifier(dirname(t),n),a=[`import { __steps_registered as __ashWorkflowStepsRegistered } from ${JSON.stringify(i)};`,`void __ashWorkflowStepsRegistered;`,``].join(`
|
|
3
|
+
`),o=r.match(/^import\s.+?;\n/m);if(o===null||o.index===void 0){await atomicWriteFile(t,`${a}${r}`);return}let s=o.index+o[0].length;await atomicWriteFile(t,`${r.slice(0,s)}${a}${r.slice(s)}`)}async function rewriteWorkflowRuntimeImports(e){let t=await readTextFileIfPresent(e);if(t===null)return;let n=t;for(let e of[`workflow`,`workflow/api`,`workflow/internal/builtins`,`workflow/internal/private`,`workflow/runtime`]){let t=normalizeImportSpecifierPath(resolveWorkflowModulePath(e));n=replaceStringLiteralSpecifier(n,e,t)}n!==t&&await atomicWriteFile(e,n)}async function rewriteWorkflowCodeLiteral(e){let t=await readTextFileIfPresent(e);if(t===null)return;let n=t.indexOf(`const workflowCode = `),r=t.lastIndexOf(`;
|
|
4
|
+
|
|
5
|
+
export const POST = workflowEntrypoint(workflowCode);`);if(n===-1||r===-1||r<=n)return;let i=n+21,a=t.slice(i,r);if(!a.trimStart().startsWith("`"))return;let o=decodeWorkflowCodeTemplateLiteral(a,e),s=`${t.slice(0,i)}${encodeWorkflowCodeLiteral(o)}${t.slice(r)}`;s!==t&&await atomicWriteFile(e,s)}function encodeWorkflowCodeLiteral(e){let t=Buffer.from(e,`utf8`).toString(`base64`).match(/.{1,16384}/g)??[``];return`Buffer.from(${JSON.stringify(t)}.join(""), "base64").toString("utf8")`}function decodeWorkflowCodeTemplateLiteral(e,t){let n=e.trim();if(!n.startsWith("`")||!n.endsWith("`"))throw Error(`Expected generated workflow code literal in "${t}" to be a template.`);let r=n.slice(1,-1),i=``;for(let e=0;e<r.length;e+=1){let t=r[e];if(t!==`\\`){i+=t;continue}let n=r[e+1];if(n===`\\`||n==="`"||n===`$`){i+=n,e+=1;continue}i+=t}return i}function replaceStringLiteralSpecifier(e,t,n){return e.replaceAll(JSON.stringify(t),JSON.stringify(n)).replaceAll(`'${t}'`,JSON.stringify(n))}function normalizeImportSpecifierPath(e){return normalizeEsmImportSpecifier(e)}function createRelativeImportSpecifier(e,t){let r=relative(e,t).replaceAll(`\\`,`/`);return r.startsWith(`.`)?r:`./${r}`}async function readTextFileIfPresent(e){try{return await readFile(e,`utf8`)}catch(e){if(e instanceof Error&&`code`in e&&e.code===`ENOENT`)return null;throw e}}async function readBinaryFileIfPresent(e){try{return await readFile(e)}catch(e){if(e instanceof Error&&`code`in e&&e.code===`ENOENT`)return null;throw e}}async function mirrorFileBypassingUnlink(e,t){let n=await readFile(e),r=await readBinaryFileIfPresent(t);r!==null&&r.equals(n)||await atomicWriteFile(t,n)}export{WorkflowBundleBuilder};
|
|
@@ -1,132 +1,2 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
3
|
-
import { normalizeEsmImportSpecifier } from "#internal/application/import-specifier.js";
|
|
4
|
-
import { applyWorkflowTransform, } from "#internal/workflow-bundle/workflow-builders.js";
|
|
5
|
-
/**
|
|
6
|
-
* Writes the hosted Nitro step entrypoint source and returns the manifest
|
|
7
|
-
* metadata discovered from the imported step and serde files.
|
|
8
|
-
*/
|
|
9
|
-
export async function writeNitroStepEntrypoint(input) {
|
|
10
|
-
const stepFiles = [...input.discoveredEntries.discoveredSteps].sort();
|
|
11
|
-
const stepFileSet = new Set(stepFiles);
|
|
12
|
-
const serdeOnlyFiles = [...input.discoveredEntries.discoveredSerdeFiles]
|
|
13
|
-
.sort()
|
|
14
|
-
.filter((filePath) => !stepFileSet.has(filePath));
|
|
15
|
-
const manifest = await collectNitroStepManifest({
|
|
16
|
-
projectRoot: input.projectRoot,
|
|
17
|
-
stepFiles,
|
|
18
|
-
serdeOnlyFiles,
|
|
19
|
-
workingDir: input.workingDir,
|
|
20
|
-
});
|
|
21
|
-
const outfileDirectory = dirname(input.outfile);
|
|
22
|
-
const builtinsImportSpecifier = input.builtinsPath === undefined
|
|
23
|
-
? "workflow/internal/builtins"
|
|
24
|
-
: createFileImportSpecifier({
|
|
25
|
-
outfileDirectory,
|
|
26
|
-
preferAbsoluteFileImports: input.preferAbsoluteFileImports ?? false,
|
|
27
|
-
targetPath: input.builtinsPath,
|
|
28
|
-
});
|
|
29
|
-
const importLines = createEntrypointImportLines({
|
|
30
|
-
builtinsImportSpecifier,
|
|
31
|
-
outfileDirectory,
|
|
32
|
-
preferAbsoluteFileImports: input.preferAbsoluteFileImports ?? false,
|
|
33
|
-
serdeOnlyFiles,
|
|
34
|
-
stepFiles,
|
|
35
|
-
});
|
|
36
|
-
const lines = [
|
|
37
|
-
"// Generated by Ash. Do not edit by hand.",
|
|
38
|
-
...importLines,
|
|
39
|
-
"export const __steps_registered = true;",
|
|
40
|
-
"",
|
|
41
|
-
];
|
|
42
|
-
const nextSource = lines.join("\n");
|
|
43
|
-
await mkdir(outfileDirectory, { recursive: true });
|
|
44
|
-
const existingSource = await readTextFileIfPresent(input.outfile);
|
|
45
|
-
if (existingSource !== nextSource) {
|
|
46
|
-
await writeFile(input.outfile, nextSource);
|
|
47
|
-
}
|
|
48
|
-
return manifest;
|
|
49
|
-
}
|
|
50
|
-
function createEntrypointImportLines(input) {
|
|
51
|
-
const importedModules = [
|
|
52
|
-
input.builtinsImportSpecifier,
|
|
53
|
-
...input.stepFiles.map((filePath) => createFileImportSpecifier({
|
|
54
|
-
outfileDirectory: input.outfileDirectory,
|
|
55
|
-
preferAbsoluteFileImports: input.preferAbsoluteFileImports,
|
|
56
|
-
targetPath: filePath,
|
|
57
|
-
})),
|
|
58
|
-
...input.serdeOnlyFiles.map((filePath) => createFileImportSpecifier({
|
|
59
|
-
outfileDirectory: input.outfileDirectory,
|
|
60
|
-
preferAbsoluteFileImports: input.preferAbsoluteFileImports,
|
|
61
|
-
targetPath: filePath,
|
|
62
|
-
})),
|
|
63
|
-
];
|
|
64
|
-
return importedModules.map((importSpecifier) => `import ${JSON.stringify(importSpecifier)};`);
|
|
65
|
-
}
|
|
66
|
-
function createFileImportSpecifier(input) {
|
|
67
|
-
if (input.preferAbsoluteFileImports) {
|
|
68
|
-
return normalizeEsmImportSpecifier(input.targetPath);
|
|
69
|
-
}
|
|
70
|
-
return createRelativeImportSpecifier(input.outfileDirectory, input.targetPath);
|
|
71
|
-
}
|
|
72
|
-
async function collectNitroStepManifest(input) {
|
|
73
|
-
const manifest = {};
|
|
74
|
-
const files = [...input.stepFiles, ...input.serdeOnlyFiles];
|
|
75
|
-
for (const filePath of files) {
|
|
76
|
-
const source = await readFile(filePath, "utf8");
|
|
77
|
-
const relativeFilepath = createManifestRelativeFilepath(input.workingDir, filePath);
|
|
78
|
-
const transformed = await applyWorkflowTransform(relativeFilepath, source, "step", filePath, input.projectRoot);
|
|
79
|
-
mergeWorkflowManifest(manifest, transformed.workflowManifest);
|
|
80
|
-
}
|
|
81
|
-
return manifest;
|
|
82
|
-
}
|
|
83
|
-
function mergeWorkflowManifest(target, source) {
|
|
84
|
-
target.steps = mergeWorkflowManifestSection(target.steps, source.steps);
|
|
85
|
-
target.workflows = mergeWorkflowManifestSection(target.workflows, source.workflows);
|
|
86
|
-
target.classes = mergeWorkflowManifestSection(target.classes, source.classes);
|
|
87
|
-
}
|
|
88
|
-
function mergeWorkflowManifestSection(target, source) {
|
|
89
|
-
if (source === undefined) {
|
|
90
|
-
return target;
|
|
91
|
-
}
|
|
92
|
-
const nextSection = {
|
|
93
|
-
...target,
|
|
94
|
-
};
|
|
95
|
-
for (const [relativeFileName, entries] of Object.entries(source)) {
|
|
96
|
-
nextSection[relativeFileName] = {
|
|
97
|
-
...nextSection[relativeFileName],
|
|
98
|
-
...entries,
|
|
99
|
-
};
|
|
100
|
-
}
|
|
101
|
-
return nextSection;
|
|
102
|
-
}
|
|
103
|
-
function createManifestRelativeFilepath(workingDir, absolutePath) {
|
|
104
|
-
const normalizedFile = absolutePath.replaceAll("\\", "/");
|
|
105
|
-
const normalizedWorkingDir = workingDir.replaceAll("\\", "/");
|
|
106
|
-
let relativePath = relative(normalizedWorkingDir, normalizedFile).replaceAll("\\", "/");
|
|
107
|
-
if (relativePath.startsWith("../")) {
|
|
108
|
-
relativePath = relativePath
|
|
109
|
-
.split("/")
|
|
110
|
-
.filter((part) => part !== "..")
|
|
111
|
-
.join("/");
|
|
112
|
-
}
|
|
113
|
-
return relativePath;
|
|
114
|
-
}
|
|
115
|
-
function createRelativeImportSpecifier(fromDirectoryPath, targetPath) {
|
|
116
|
-
const relativePath = relative(fromDirectoryPath, targetPath).replaceAll("\\", "/");
|
|
117
|
-
if (relativePath.startsWith(".")) {
|
|
118
|
-
return relativePath;
|
|
119
|
-
}
|
|
120
|
-
return `./${relativePath}`;
|
|
121
|
-
}
|
|
122
|
-
async function readTextFileIfPresent(filePath) {
|
|
123
|
-
try {
|
|
124
|
-
return await readFile(filePath, "utf8");
|
|
125
|
-
}
|
|
126
|
-
catch (error) {
|
|
127
|
-
if (error instanceof Error && "code" in error && error.code === "ENOENT") {
|
|
128
|
-
return null;
|
|
129
|
-
}
|
|
130
|
-
throw error;
|
|
131
|
-
}
|
|
132
|
-
}
|
|
1
|
+
import{dirname,relative}from"node:path";import{mkdir,readFile,writeFile}from"node:fs/promises";import{normalizeEsmImportSpecifier}from"#internal/application/import-specifier.js";import{applyWorkflowTransform}from"#internal/workflow-bundle/workflow-builders.js";async function writeNitroStepEntrypoint(t){let r=[...t.discoveredEntries.discoveredSteps].sort(),a=new Set(r),o=[...t.discoveredEntries.discoveredSerdeFiles].sort().filter(e=>!a.has(e)),s=await collectNitroStepManifest({projectRoot:t.projectRoot,stepFiles:r,serdeOnlyFiles:o,workingDir:t.workingDir}),c=dirname(t.outfile),l=[`// Generated by Ash. Do not edit by hand.`,...createEntrypointImportLines({builtinsImportSpecifier:t.builtinsPath===void 0?`workflow/internal/builtins`:createFileImportSpecifier({outfileDirectory:c,preferAbsoluteFileImports:t.preferAbsoluteFileImports??!1,targetPath:t.builtinsPath}),outfileDirectory:c,preferAbsoluteFileImports:t.preferAbsoluteFileImports??!1,serdeOnlyFiles:o,stepFiles:r}),`export const __steps_registered = true;`,``].join(`
|
|
2
|
+
`);return await mkdir(c,{recursive:!0}),await readTextFileIfPresent(t.outfile)!==l&&await writeFile(t.outfile,l),s}function createEntrypointImportLines(e){return[e.builtinsImportSpecifier,...e.stepFiles.map(t=>createFileImportSpecifier({outfileDirectory:e.outfileDirectory,preferAbsoluteFileImports:e.preferAbsoluteFileImports,targetPath:t})),...e.serdeOnlyFiles.map(t=>createFileImportSpecifier({outfileDirectory:e.outfileDirectory,preferAbsoluteFileImports:e.preferAbsoluteFileImports,targetPath:t}))].map(e=>`import ${JSON.stringify(e)};`)}function createFileImportSpecifier(e){return e.preferAbsoluteFileImports?normalizeEsmImportSpecifier(e.targetPath):createRelativeImportSpecifier(e.outfileDirectory,e.targetPath)}async function collectNitroStepManifest(e){let t={},n=[...e.stepFiles,...e.serdeOnlyFiles];for(let i of n){let n=await readFile(i,`utf8`);mergeWorkflowManifest(t,(await applyWorkflowTransform(createManifestRelativeFilepath(e.workingDir,i),n,`step`,i,e.projectRoot)).workflowManifest)}return t}function mergeWorkflowManifest(e,t){e.steps=mergeWorkflowManifestSection(e.steps,t.steps),e.workflows=mergeWorkflowManifestSection(e.workflows,t.workflows),e.classes=mergeWorkflowManifestSection(e.classes,t.classes)}function mergeWorkflowManifestSection(e,t){if(t===void 0)return e;let n={...e};for(let[e,r]of Object.entries(t))n[e]={...n[e],...r};return n}function createManifestRelativeFilepath(e,n){let r=n.replaceAll(`\\`,`/`),i=relative(e.replaceAll(`\\`,`/`),r).replaceAll(`\\`,`/`);return i.startsWith(`../`)&&(i=i.split(`/`).filter(e=>e!==`..`).join(`/`)),i}function createRelativeImportSpecifier(e,n){let r=relative(e,n).replaceAll(`\\`,`/`);return r.startsWith(`.`)?r:`./${r}`}async function readTextFileIfPresent(e){try{return await readFile(e,`utf8`)}catch(e){if(e instanceof Error&&`code`in e&&e.code===`ENOENT`)return null;throw e}}export{writeNitroStepEntrypoint};
|